1(function(scope){ 2'use strict'; 3 4function F(arity, fun, wrapper) { 5 wrapper.a = arity; 6 wrapper.f = fun; 7 return wrapper; 8} 9 10function F2(fun) { 11 return F(2, fun, function(a) { return function(b) { return fun(a,b); }; }) 12} 13function F3(fun) { 14 return F(3, fun, function(a) { 15 return function(b) { return function(c) { return fun(a, b, c); }; }; 16 }); 17} 18function F4(fun) { 19 return F(4, fun, function(a) { return function(b) { return function(c) { 20 return function(d) { return fun(a, b, c, d); }; }; }; 21 }); 22} 23function F5(fun) { 24 return F(5, fun, function(a) { return function(b) { return function(c) { 25 return function(d) { return function(e) { return fun(a, b, c, d, e); }; }; }; }; 26 }); 27} 28function F6(fun) { 29 return F(6, fun, function(a) { return function(b) { return function(c) { 30 return function(d) { return function(e) { return function(f) { 31 return fun(a, b, c, d, e, f); }; }; }; }; }; 32 }); 33} 34function F7(fun) { 35 return F(7, fun, function(a) { return function(b) { return function(c) { 36 return function(d) { return function(e) { return function(f) { 37 return function(g) { return fun(a, b, c, d, e, f, g); }; }; }; }; }; }; 38 }); 39} 40function F8(fun) { 41 return F(8, fun, function(a) { return function(b) { return function(c) { 42 return function(d) { return function(e) { return function(f) { 43 return function(g) { return function(h) { 44 return fun(a, b, c, d, e, f, g, h); }; }; }; }; }; }; }; 45 }); 46} 47function F9(fun) { 48 return F(9, fun, function(a) { return function(b) { return function(c) { 49 return function(d) { return function(e) { return function(f) { 50 return function(g) { return function(h) { return function(i) { 51 return fun(a, b, c, d, e, f, g, h, i); }; }; }; }; }; }; }; }; 52 }); 53} 54 55function A2(fun, a, b) { 56 return fun.a === 2 ? fun.f(a, b) : fun(a)(b); 57} 58function A3(fun, a, b, c) { 59 return fun.a === 3 ? fun.f(a, b, c) : fun(a)(b)(c); 60} 61function A4(fun, a, b, c, d) { 62 return fun.a === 4 ? fun.f(a, b, c, d) : fun(a)(b)(c)(d); 63} 64function A5(fun, a, b, c, d, e) { 65 return fun.a === 5 ? fun.f(a, b, c, d, e) : fun(a)(b)(c)(d)(e); 66} 67function A6(fun, a, b, c, d, e, f) { 68 return fun.a === 6 ? fun.f(a, b, c, d, e, f) : fun(a)(b)(c)(d)(e)(f); 69} 70function A7(fun, a, b, c, d, e, f, g) { 71 return fun.a === 7 ? fun.f(a, b, c, d, e, f, g) : fun(a)(b)(c)(d)(e)(f)(g); 72} 73function A8(fun, a, b, c, d, e, f, g, h) { 74 return fun.a === 8 ? fun.f(a, b, c, d, e, f, g, h) : fun(a)(b)(c)(d)(e)(f)(g)(h); 75} 76function A9(fun, a, b, c, d, e, f, g, h, i) { 77 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); 78} 79 80 81 82 83var _JsArray_empty = []; 84 85function _JsArray_singleton(value) 86{ 87 return [value]; 88} 89 90function _JsArray_length(array) 91{ 92 return array.length; 93} 94 95var _JsArray_initialize = F3(function(size, offset, func) 96{ 97 var result = new Array(size); 98 99 for (var i = 0; i < size; i++) 100 { 101 result[i] = func(offset + i); 102 } 103 104 return result; 105}); 106 107var _JsArray_initializeFromList = F2(function (max, ls) 108{ 109 var result = new Array(max); 110 111 for (var i = 0; i < max && ls.b; i++) 112 { 113 result[i] = ls.a; 114 ls = ls.b; 115 } 116 117 result.length = i; 118 return _Utils_Tuple2(result, ls); 119}); 120 121var _JsArray_unsafeGet = F2(function(index, array) 122{ 123 return array[index]; 124}); 125 126var _JsArray_unsafeSet = F3(function(index, value, array) 127{ 128 var length = array.length; 129 var result = new Array(length); 130 131 for (var i = 0; i < length; i++) 132 { 133 result[i] = array[i]; 134 } 135 136 result[index] = value; 137 return result; 138}); 139 140var _JsArray_push = F2(function(value, array) 141{ 142 var length = array.length; 143 var result = new Array(length + 1); 144 145 for (var i = 0; i < length; i++) 146 { 147 result[i] = array[i]; 148 } 149 150 result[length] = value; 151 return result; 152}); 153 154var _JsArray_foldl = F3(function(func, acc, array) 155{ 156 var length = array.length; 157 158 for (var i = 0; i < length; i++) 159 { 160 acc = A2(func, array[i], acc); 161 } 162 163 return acc; 164}); 165 166var _JsArray_foldr = F3(function(func, acc, array) 167{ 168 for (var i = array.length - 1; i >= 0; i--) 169 { 170 acc = A2(func, array[i], acc); 171 } 172 173 return acc; 174}); 175 176var _JsArray_map = F2(function(func, array) 177{ 178 var length = array.length; 179 var result = new Array(length); 180 181 for (var i = 0; i < length; i++) 182 { 183 result[i] = func(array[i]); 184 } 185 186 return result; 187}); 188 189var _JsArray_indexedMap = F3(function(func, offset, array) 190{ 191 var length = array.length; 192 var result = new Array(length); 193 194 for (var i = 0; i < length; i++) 195 { 196 result[i] = A2(func, offset + i, array[i]); 197 } 198 199 return result; 200}); 201 202var _JsArray_slice = F3(function(from, to, array) 203{ 204 return array.slice(from, to); 205}); 206 207var _JsArray_appendN = F3(function(n, dest, source) 208{ 209 var destLen = dest.length; 210 var itemsToCopy = n - destLen; 211 212 if (itemsToCopy > source.length) 213 { 214 itemsToCopy = source.length; 215 } 216 217 var size = destLen + itemsToCopy; 218 var result = new Array(size); 219 220 for (var i = 0; i < destLen; i++) 221 { 222 result[i] = dest[i]; 223 } 224 225 for (var i = 0; i < itemsToCopy; i++) 226 { 227 result[i + destLen] = source[i]; 228 } 229 230 return result; 231}); 232 233 234 235// LOG 236 237var _Debug_log = F2(function(tag, value) 238{ 239 return value; 240}); 241 242var _Debug_log_UNUSED = F2(function(tag, value) 243{ 244 console.log(tag + ': ' + _Debug_toString(value)); 245 return value; 246}); 247 248 249// TODOS 250 251function _Debug_todo(moduleName, region) 252{ 253 return function(message) { 254 _Debug_crash(8, moduleName, region, message); 255 }; 256} 257 258function _Debug_todoCase(moduleName, region, value) 259{ 260 return function(message) { 261 _Debug_crash(9, moduleName, region, value, message); 262 }; 263} 264 265 266// TO STRING 267 268function _Debug_toString(value) 269{ 270 return '<internals>'; 271} 272 273function _Debug_toString_UNUSED(value) 274{ 275 return _Debug_toAnsiString(false, value); 276} 277 278function _Debug_toAnsiString(ansi, value) 279{ 280 if (typeof value === 'function') 281 { 282 return _Debug_internalColor(ansi, '<function>'); 283 } 284 285 if (typeof value === 'boolean') 286 { 287 return _Debug_ctorColor(ansi, value ? 'True' : 'False'); 288 } 289 290 if (typeof value === 'number') 291 { 292 return _Debug_numberColor(ansi, value + ''); 293 } 294 295 if (value instanceof String) 296 { 297 return _Debug_charColor(ansi, "'" + _Debug_addSlashes(value, true) + "'"); 298 } 299 300 if (typeof value === 'string') 301 { 302 return _Debug_stringColor(ansi, '"' + _Debug_addSlashes(value, false) + '"'); 303 } 304 305 if (typeof value === 'object' && '$' in value) 306 { 307 var tag = value.$; 308 309 if (typeof tag === 'number') 310 { 311 return _Debug_internalColor(ansi, '<internals>'); 312 } 313 314 if (tag[0] === '#') 315 { 316 var output = []; 317 for (var k in value) 318 { 319 if (k === '$') continue; 320 output.push(_Debug_toAnsiString(ansi, value[k])); 321 } 322 return '(' + output.join(',') + ')'; 323 } 324 325 if (tag === 'Set_elm_builtin') 326 { 327 return _Debug_ctorColor(ansi, 'Set') 328 + _Debug_fadeColor(ansi, '.fromList') + ' ' 329 + _Debug_toAnsiString(ansi, $elm$core$Set$toList(value)); 330 } 331 332 if (tag === 'RBNode_elm_builtin' || tag === 'RBEmpty_elm_builtin') 333 { 334 return _Debug_ctorColor(ansi, 'Dict') 335 + _Debug_fadeColor(ansi, '.fromList') + ' ' 336 + _Debug_toAnsiString(ansi, $elm$core$Dict$toList(value)); 337 } 338 339 if (tag === 'Array_elm_builtin') 340 { 341 return _Debug_ctorColor(ansi, 'Array') 342 + _Debug_fadeColor(ansi, '.fromList') + ' ' 343 + _Debug_toAnsiString(ansi, $elm$core$Array$toList(value)); 344 } 345 346 if (tag === '::' || tag === '[]') 347 { 348 var output = '['; 349 350 value.b && (output += _Debug_toAnsiString(ansi, value.a), value = value.b) 351 352 for (; value.b; value = value.b) // WHILE_CONS 353 { 354 output += ',' + _Debug_toAnsiString(ansi, value.a); 355 } 356 return output + ']'; 357 } 358 359 var output = ''; 360 for (var i in value) 361 { 362 if (i === '$') continue; 363 var str = _Debug_toAnsiString(ansi, value[i]); 364 var c0 = str[0]; 365 var parenless = c0 === '{' || c0 === '(' || c0 === '[' || c0 === '<' || c0 === '"' || str.indexOf(' ') < 0; 366 output += ' ' + (parenless ? str : '(' + str + ')'); 367 } 368 return _Debug_ctorColor(ansi, tag) + output; 369 } 370 371 if (typeof DataView === 'function' && value instanceof DataView) 372 { 373 return _Debug_stringColor(ansi, '<' + value.byteLength + ' bytes>'); 374 } 375 376 if (typeof File !== 'undefined' && value instanceof File) 377 { 378 return _Debug_internalColor(ansi, '<' + value.name + '>'); 379 } 380 381 if (typeof value === 'object') 382 { 383 var output = []; 384 for (var key in value) 385 { 386 var field = key[0] === '_' ? key.slice(1) : key; 387 output.push(_Debug_fadeColor(ansi, field) + ' = ' + _Debug_toAnsiString(ansi, value[key])); 388 } 389 if (output.length === 0) 390 { 391 return '{}'; 392 } 393 return '{ ' + output.join(', ') + ' }'; 394 } 395 396 return _Debug_internalColor(ansi, '<internals>'); 397} 398 399function _Debug_addSlashes(str, isChar) 400{ 401 var s = str 402 .replace(/\\/g, '\\\\') 403 .replace(/\n/g, '\\n') 404 .replace(/\t/g, '\\t') 405 .replace(/\r/g, '\\r') 406 .replace(/\v/g, '\\v') 407 .replace(/\0/g, '\\0'); 408 409 if (isChar) 410 { 411 return s.replace(/\'/g, '\\\''); 412 } 413 else 414 { 415 return s.replace(/\"/g, '\\"'); 416 } 417} 418 419function _Debug_ctorColor(ansi, string) 420{ 421 return ansi ? '\x1b[96m' + string + '\x1b[0m' : string; 422} 423 424function _Debug_numberColor(ansi, string) 425{ 426 return ansi ? '\x1b[95m' + string + '\x1b[0m' : string; 427} 428 429function _Debug_stringColor(ansi, string) 430{ 431 return ansi ? '\x1b[93m' + string + '\x1b[0m' : string; 432} 433 434function _Debug_charColor(ansi, string) 435{ 436 return ansi ? '\x1b[92m' + string + '\x1b[0m' : string; 437} 438 439function _Debug_fadeColor(ansi, string) 440{ 441 return ansi ? '\x1b[37m' + string + '\x1b[0m' : string; 442} 443 444function _Debug_internalColor(ansi, string) 445{ 446 return ansi ? '\x1b[36m' + string + '\x1b[0m' : string; 447} 448 449function _Debug_toHexDigit(n) 450{ 451 return String.fromCharCode(n < 10 ? 48 + n : 55 + n); 452} 453 454 455// CRASH 456 457 458function _Debug_crash(identifier) 459{ 460 throw new Error('https://github.com/elm/core/blob/1.0.0/hints/' + identifier + '.md'); 461} 462 463 464function _Debug_crash_UNUSED(identifier, fact1, fact2, fact3, fact4) 465{ 466 switch(identifier) 467 { 468 case 0: 469 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.'); 470 471 case 1: 472 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.'); 473 474 case 2: 475 var jsonErrorString = fact1; 476 throw new Error('Problem with the flags given to your Elm program on initialization.\n\n' + jsonErrorString); 477 478 case 3: 479 var portName = fact1; 480 throw new Error('There can only be one port named `' + portName + '`, but your program has multiple.'); 481 482 case 4: 483 var portName = fact1; 484 var problem = fact2; 485 throw new Error('Trying to send an unexpected type of value through port `' + portName + '`:\n' + problem); 486 487 case 5: 488 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.'); 489 490 case 6: 491 var moduleName = fact1; 492 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!'); 493 494 case 8: 495 var moduleName = fact1; 496 var region = fact2; 497 var message = fact3; 498 throw new Error('TODO in module `' + moduleName + '` ' + _Debug_regionToString(region) + '\n\n' + message); 499 500 case 9: 501 var moduleName = fact1; 502 var region = fact2; 503 var value = fact3; 504 var message = fact4; 505 throw new Error( 506 'TODO in module `' + moduleName + '` from the `case` expression ' 507 + _Debug_regionToString(region) + '\n\nIt received the following value:\n\n ' 508 + _Debug_toString(value).replace('\n', '\n ') 509 + '\n\nBut the branch that handles it says:\n\n ' + message.replace('\n', '\n ') 510 ); 511 512 case 10: 513 throw new Error('Bug in https://github.com/elm/virtual-dom/issues'); 514 515 case 11: 516 throw new Error('Cannot perform mod 0. Division by zero error.'); 517 } 518} 519 520function _Debug_regionToString(region) 521{ 522 if (region.qs.dp === region.it.dp) 523 { 524 return 'on line ' + region.qs.dp; 525 } 526 return 'on lines ' + region.qs.dp + ' through ' + region.it.dp; 527} 528 529 530 531// EQUALITY 532 533function _Utils_eq(x, y) 534{ 535 for ( 536 var pair, stack = [], isEqual = _Utils_eqHelp(x, y, 0, stack); 537 isEqual && (pair = stack.pop()); 538 isEqual = _Utils_eqHelp(pair.a, pair.b, 0, stack) 539 ) 540 {} 541 542 return isEqual; 543} 544 545function _Utils_eqHelp(x, y, depth, stack) 546{ 547 if (x === y) 548 { 549 return true; 550 } 551 552 if (typeof x !== 'object' || x === null || y === null) 553 {
554 typeof x === 'function' && _Debug_crash(5); 555 return false; 556 } 557 558 if (depth > 100) 559 { 560 stack.push(_Utils_Tuple2(x,y)); 561 return true; 562 } 563 564 /**_UNUSED/ 565 if (x.$ === 'Set_elm_builtin') 566 { 567 x = $elm$core$Set$toList(x); 568 y = $elm$core$Set$toList(y); 569 } 570 if (x.$ === 'RBNode_elm_builtin' || x.$ === 'RBEmpty_elm_builtin') 571 { 572 x = $elm$core$Dict$toList(x); 573 y = $elm$core$Dict$toList(y); 574 } 575 //*/ 576 577 /**/ 578 if (x.$ < 0) 579 { 580 x = $elm$core$Dict$toList(x); 581 y = $elm$core$Dict$toList(y); 582 } 583 //*/ 584 585 for (var key in x) 586 { 587 if (!_Utils_eqHelp(x[key], y[key], depth + 1, stack)) 588 { 589 return false; 590 } 591 } 592 return true; 593} 594 595var _Utils_equal = F2(_Utils_eq); 596var _Utils_notEqual = F2(function(a, b) { return !_Utils_eq(a,b); }); 597 598 599 600// COMPARISONS 601 602// Code in Generate/JavaScript.hs, Basics.js, and List.js depends on 603// the particular integer values assigned to LT, EQ, and GT. 604 605function _Utils_cmp(x, y, ord) 606{ 607 if (typeof x !== 'object') 608 { 609 return x === y ? /*EQ*/ 0 : x < y ? /*LT*/ -1 : /*GT*/ 1; 610 } 611 612 /**_UNUSED/ 613 if (x instanceof String) 614 { 615 var a = x.valueOf(); 616 var b = y.valueOf(); 617 return a === b ? 0 : a < b ? -1 : 1; 618 } 619 //*/ 620 621 /**/ 622 if (typeof x.$ === 'undefined') 623 //*/ 624 /**_UNUSED/ 625 if (x.$[0] === '#') 626 //*/ 627 { 628 return (ord = _Utils_cmp(x.a, y.a)) 629 ? ord 630 : (ord = _Utils_cmp(x.b, y.b)) 631 ? ord 632 : _Utils_cmp(x.c, y.c); 633 } 634 635 // traverse conses until end of a list or a mismatch 636 for (; x.b && y.b && !(ord = _Utils_cmp(x.a, y.a)); x = x.b, y = y.b) {} // WHILE_CONSES 637 return ord || (x.b ? /*GT*/ 1 : y.b ? /*LT*/ -1 : /*EQ*/ 0); 638} 639 640var _Utils_lt = F2(function(a, b) { return _Utils_cmp(a, b) < 0; }); 641var _Utils_le = F2(function(a, b) { return _Utils_cmp(a, b) < 1; }); 642var _Utils_gt = F2(function(a, b) { return _Utils_cmp(a, b) > 0; }); 643var _Utils_ge = F2(function(a, b) { return _Utils_cmp(a, b) >= 0; }); 644 645var _Utils_compare = F2(function(x, y) 646{ 647 var n = _Utils_cmp(x, y); 648 return n < 0 ? $elm$core$Basics$LT : n ? $elm$core$Basics$GT : $elm$core$Basics$EQ; 649}); 650 651 652// COMMON VALUES 653 654var _Utils_Tuple0 = 0; 655var _Utils_Tuple0_UNUSED = { $: '#0' }; 656 657function _Utils_Tuple2(a, b) { return { a: a, b: b }; } 658function _Utils_Tuple2_UNUSED(a, b) { return { $: '#2', a: a, b: b }; } 659 660function _Utils_Tuple3(a, b, c) { return { a: a, b: b, c: c }; } 661function _Utils_Tuple3_UNUSED(a, b, c) { return { $: '#3', a: a, b: b, c: c }; } 662 663function _Utils_chr(c) { return c; } 664function _Utils_chr_UNUSED(c) { return new String(c); } 665 666 667// RECORDS 668 669function _Utils_update(oldRecord, updatedFields) 670{ 671 var newRecord = {}; 672 673 for (var key in oldRecord) 674 { 675 newRecord[key] = oldRecord[key]; 676 } 677 678 for (var key in updatedFields) 679 { 680 newRecord[key] = updatedFields[key]; 681 } 682 683 return newRecord; 684} 685 686 687// APPEND 688 689var _Utils_append = F2(_Utils_ap); 690 691function _Utils_ap(xs, ys) 692{ 693 // append Strings 694 if (typeof xs === 'string') 695 { 696 return xs + ys; 697 } 698 699 // append Lists 700 if (!xs.b) 701 { 702 return ys; 703 } 704 var root = _List_Cons(xs.a, ys); 705 xs = xs.b 706 for (var curr = root; xs.b; xs = xs.b) // WHILE_CONS 707 { 708 curr = curr.b = _List_Cons(xs.a, ys); 709 } 710 return root; 711} 712 713 714 715var _List_Nil = { $: 0 }; 716var _List_Nil_UNUSED = { $: '[]' }; 717 718function _List_Cons(hd, tl) { return { $: 1, a: hd, b: tl }; } 719function _List_Cons_UNUSED(hd, tl) { return { $: '::', a: hd, b: tl }; } 720 721 722var _List_cons = F2(_List_Cons); 723 724function _List_fromArray(arr) 725{ 726 var out = _List_Nil; 727 for (var i = arr.length; i--; ) 728 { 729 out = _List_Cons(arr[i], out); 730 } 731 return out; 732} 733 734function _List_toArray(xs) 735{ 736 for (var out = []; xs.b; xs = xs.b) // WHILE_CONS 737 { 738 out.push(xs.a); 739 } 740 return out; 741} 742 743var _List_map2 = F3(function(f, xs, ys) 744{ 745 for (var arr = []; xs.b && ys.b; xs = xs.b, ys = ys.b) // WHILE_CONSES 746 { 747 arr.push(A2(f, xs.a, ys.a)); 748 } 749 return _List_fromArray(arr); 750}); 751 752var _List_map3 = F4(function(f, xs, ys, zs) 753{ 754 for (var arr = []; xs.b && ys.b && zs.b; xs = xs.b, ys = ys.b, zs = zs.b) // WHILE_CONSES 755 { 756 arr.push(A3(f, xs.a, ys.a, zs.a)); 757 } 758 return _List_fromArray(arr); 759}); 760 761var _List_map4 = F5(function(f, ws, xs, ys, zs) 762{ 763 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 764 { 765 arr.push(A4(f, ws.a, xs.a, ys.a, zs.a)); 766 } 767 return _List_fromArray(arr); 768}); 769 770var _List_map5 = F6(function(f, vs, ws, xs, ys, zs) 771{ 772 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 773 { 774 arr.push(A5(f, vs.a, ws.a, xs.a, ys.a, zs.a)); 775 } 776 return _List_fromArray(arr); 777}); 778 779var _List_sortBy = F2(function(f, xs) 780{ 781 return _List_fromArray(_List_toArray(xs).sort(function(a, b) { 782 return _Utils_cmp(f(a), f(b)); 783 })); 784}); 785 786var _List_sortWith = F2(function(f, xs) 787{ 788 return _List_fromArray(_List_toArray(xs).sort(function(a, b) { 789 var ord = A2(f, a, b); 790 return ord === $elm$core$Basics$EQ ? 0 : ord === $elm$core$Basics$LT ? -1 : 1; 791 })); 792}); 793 794 795 796// MATH 797 798var _Basics_add = F2(function(a, b) { return a + b; }); 799var _Basics_sub = F2(function(a, b) { return a - b; }); 800var _Basics_mul = F2(function(a, b) { return a * b; }); 801var _Basics_fdiv = F2(function(a, b) { return a / b; }); 802var _Basics_idiv = F2(function(a, b) { return (a / b) | 0; }); 803var _Basics_pow = F2(Math.pow); 804 805var _Basics_remainderBy = F2(function(b, a) { return a % b; }); 806
807// https://www.microsoft.com/en-us/research/wp-content/uploads/2016/02/divmodnote-letter.pdf 808var _Basics_modBy = F2(function(modulus, x) 809{ 810 var answer = x % modulus; 811 return modulus === 0 812 ? _Debug_crash(11) 813 : 814 ((answer > 0 && modulus < 0) || (answer < 0 && modulus > 0)) 815 ? answer + modulus 816 : answer; 817}); 818 819 820// TRIGONOMETRY 821 822var _Basics_pi = Math.PI; 823var _Basics_e = Math.E; 824var _Basics_cos = Math.cos; 825var _Basics_sin = Math.sin; 826var _Basics_tan = Math.tan; 827var _Basics_acos = Math.acos; 828var _Basics_asin = Math.asin; 829var _Basics_atan = Math.atan; 830var _Basics_atan2 = F2(Math.atan2); 831 832 833// MORE MATH 834 835function _Basics_toFloat(x) { return x; } 836function _Basics_truncate(n) { return n | 0; } 837function _Basics_isInfinite(n) { return n === Infinity || n === -Infinity; } 838 839var _Basics_ceiling = Math.ceil; 840var _Basics_floor = Math.floor; 841var _Basics_round = Math.round; 842var _Basics_sqrt = Math.sqrt; 843var _Basics_log = Math.log; 844var _Basics_isNaN = isNaN; 845 846 847// BOOLEANS 848 849function _Basics_not(bool) { return !bool; } 850var _Basics_and = F2(function(a, b) { return a && b; }); 851var _Basics_or = F2(function(a, b) { return a || b; }); 852var _Basics_xor = F2(function(a, b) { return a !== b; }); 853 854 855 856var _String_cons = F2(function(chr, str) 857{ 858 return chr + str; 859}); 860 861function _String_uncons(string) 862{ 863 var word = string.charCodeAt(0); 864 return !isNaN(word) 865 ? $elm$core$Maybe$Just( 866 0xD800 <= word && word <= 0xDBFF 867 ? _Utils_Tuple2(_Utils_chr(string[0] + string[1]), string.slice(2)) 868 : _Utils_Tuple2(_Utils_chr(string[0]), string.slice(1)) 869 ) 870 : $elm$core$Maybe$Nothing; 871} 872 873var _String_append = F2(function(a, b) 874{ 875 return a + b; 876}); 877 878function _String_length(str) 879{ 880 return str.length; 881} 882 883var _String_map = F2(function(func, string) 884{ 885 var len = string.length; 886 var array = new Array(len); 887 var i = 0; 888 while (i < len) 889 { 890 var word = string.charCodeAt(i); 891 if (0xD800 <= word && word <= 0xDBFF) 892 { 893 array[i] = func(_Utils_chr(string[i] + string[i+1])); 894 i += 2; 895 continue; 896 } 897 array[i] = func(_Utils_chr(string[i])); 898 i++; 899 } 900 return array.join(''); 901}); 902 903var _String_filter = F2(function(isGood, str) 904{ 905 var arr = []; 906 var len = str.length; 907 var i = 0; 908 while (i < len) 909 { 910 var char = str[i]; 911 var word = str.charCodeAt(i); 912 i++; 913 if (0xD800 <= word && word <= 0xDBFF) 914 { 915 char += str[i]; 916 i++; 917 } 918 919 if (isGood(_Utils_chr(char))) 920 { 921 arr.push(char); 922 } 923 } 924 return arr.join(''); 925}); 926 927function _String_reverse(str) 928{ 929 var len = str.length; 930 var arr = new Array(len); 931 var i = 0; 932 while (i < len) 933 { 934 var word = str.charCodeAt(i); 935 if (0xD800 <= word && word <= 0xDBFF) 936 { 937 arr[len - i] = str[i + 1]; 938 i++; 939 arr[len - i] = str[i - 1]; 940 i++; 941 } 942 else 943 { 944 arr[len - i] = str[i]; 945 i++; 946 } 947 } 948 return arr.join(''); 949} 950 951var _String_foldl = F3(function(func, state, string) 952{ 953 var len = string.length; 954 var i = 0; 955 while (i < len) 956 { 957 var char = string[i]; 958 var word = string.charCodeAt(i); 959 i++; 960 if (0xD800 <= word && word <= 0xDBFF) 961 { 962 char += string[i]; 963 i++; 964 } 965 state = A2(func, _Utils_chr(char), state); 966 } 967 return state; 968}); 969 970var _String_foldr = F3(function(func, state, string) 971{ 972 var i = string.length; 973 while (i--) 974 { 975 var char = string[i]; 976 var word = string.charCodeAt(i); 977 if (0xDC00 <= word && word <= 0xDFFF) 978 { 979 i--; 980 char = string[i] + char; 981 } 982 state = A2(func, _Utils_chr(char), state); 983 } 984 return state; 985}); 986 987var _String_split = F2(function(sep, str) 988{ 989 return str.split(sep); 990}); 991 992var _String_join = F2(function(sep, strs) 993{ 994 return strs.join(sep); 995}); 996 997var _String_slice = F3(function(start, end, str) { 998 return str.slice(start, end); 999}); 1000 1001function _String_trim(str) 1002{ 1003 return str.trim(); 1004} 1005 1006function _String_trimLeft(str) 1007{ 1008 return str.replace(/^\s+/, ''); 1009} 1010 1011function _String_trimRight(str) 1012{ 1013 return str.replace(/\s+$/, ''); 1014} 1015 1016function _String_words(str) 1017{ 1018 return _List_fromArray(str.trim().split(/\s+/g)); 1019} 1020 1021function _String_lines(str) 1022{ 1023 return _List_fromArray(str.split(/\r\n|\r|\n/g)); 1024} 1025 1026function _String_toUpper(str) 1027{ 1028 return str.toUpperCase(); 1029} 1030 1031function _String_toLower(str) 1032{ 1033 return str.toLowerCase(); 1034} 1035 1036var _String_any = F2(function(isGood, string) 1037{ 1038 var i = string.length; 1039 while (i--) 1040 { 1041 var char = string[i]; 1042 var word = string.charCodeAt(i);
1043 if (0xDC00 <= word && word <= 0xDFFF) 1044 { 1045 i--; 1046 char = string[i] + char; 1047 } 1048 if (isGood(_Utils_chr(char))) 1049 { 1050 return true; 1051 } 1052 } 1053 return false; 1054}); 1055 1056var _String_all = F2(function(isGood, string) 1057{ 1058 var i = string.length; 1059 while (i--) 1060 { 1061 var char = string[i]; 1062 var word = string.charCodeAt(i); 1063 if (0xDC00 <= word && word <= 0xDFFF) 1064 { 1065 i--; 1066 char = string[i] + char; 1067 } 1068 if (!isGood(_Utils_chr(char))) 1069 { 1070 return false; 1071 } 1072 } 1073 return true; 1074}); 1075 1076var _String_contains = F2(function(sub, str) 1077{ 1078 return str.indexOf(sub) > -1; 1079}); 1080 1081var _String_startsWith = F2(function(sub, str) 1082{ 1083 return str.indexOf(sub) === 0; 1084}); 1085 1086var _String_endsWith = F2(function(sub, str) 1087{ 1088 return str.length >= sub.length && 1089 str.lastIndexOf(sub) === str.length - sub.length; 1090}); 1091 1092var _String_indexes = F2(function(sub, str) 1093{ 1094 var subLen = sub.length; 1095 1096 if (subLen < 1) 1097 { 1098 return _List_Nil; 1099 } 1100 1101 var i = 0; 1102 var is = []; 1103 1104 while ((i = str.indexOf(sub, i)) > -1) 1105 { 1106 is.push(i); 1107 i = i + subLen; 1108 } 1109 1110 return _List_fromArray(is); 1111}); 1112 1113 1114// TO STRING 1115 1116function _String_fromNumber(number) 1117{ 1118 return number + ''; 1119} 1120 1121 1122// INT CONVERSIONS 1123 1124function _String_toInt(str) 1125{ 1126 var total = 0; 1127 var code0 = str.charCodeAt(0); 1128 var start = code0 == 0x2B /* + */ || code0 == 0x2D /* - */ ? 1 : 0; 1129 1130 for (var i = start; i < str.length; ++i) 1131 { 1132 var code = str.charCodeAt(i); 1133 if (code < 0x30 || 0x39 < code) 1134 { 1135 return $elm$core$Maybe$Nothing; 1136 } 1137 total = 10 * total + code - 0x30; 1138 } 1139 1140 return i == start 1141 ? $elm$core$Maybe$Nothing 1142 : $elm$core$Maybe$Just(code0 == 0x2D ? -total : total); 1143} 1144 1145 1146// FLOAT CONVERSIONS 1147 1148function _String_toFloat(s) 1149{ 1150 // check if it is a hex, octal, or binary number 1151 if (s.length === 0 || /[\sxbo]/.test(s)) 1152 { 1153 return $elm$core$Maybe$Nothing; 1154 } 1155 var n = +s; 1156 // faster isNaN check 1157 return n === n ? $elm$core$Maybe$Just(n) : $elm$core$Maybe$Nothing; 1158} 1159 1160function _String_fromList(chars) 1161{ 1162 return _List_toArray(chars).join(''); 1163} 1164 1165 1166 1167 1168function _Char_toCode(char) 1169{ 1170 var code = char.charCodeAt(0); 1171 if (0xD800 <= code && code <= 0xDBFF) 1172 { 1173 return (code - 0xD800) * 0x400 + char.charCodeAt(1) - 0xDC00 + 0x10000 1174 } 1175 return code; 1176} 1177 1178function _Char_fromCode(code) 1179{ 1180 return _Utils_chr( 1181 (code < 0 || 0x10FFFF < code) 1182 ? '\uFFFD' 1183 : 1184 (code <= 0xFFFF) 1185 ? String.fromCharCode(code) 1186 : 1187 (code -= 0x10000, 1188 String.fromCharCode(Math.floor(code / 0x400) + 0xD800, code % 0x400 + 0xDC00) 1189 ) 1190 ); 1191} 1192 1193function _Char_toUpper(char) 1194{ 1195 return _Utils_chr(char.toUpperCase()); 1196} 1197 1198function _Char_toLower(char) 1199{ 1200 return _Utils_chr(char.toLowerCase()); 1201} 1202 1203function _Char_toLocaleUpper(char) 1204{ 1205 return _Utils_chr(char.toLocaleUpperCase()); 1206} 1207 1208function _Char_toLocaleLower(char) 1209{ 1210 return _Utils_chr(char.toLocaleLowerCase()); 1211} 1212 1213 1214 1215/**_UNUSED/ 1216function _Json_errorToString(error) 1217{ 1218 return $elm$json$Json$Decode$errorToString(error); 1219} 1220//*/ 1221 1222 1223// CORE DECODERS 1224 1225function _Json_succeed(msg) 1226{ 1227 return { 1228 $: 0, 1229 a: msg 1230 }; 1231} 1232 1233function _Json_fail(msg) 1234{ 1235 return { 1236 $: 1, 1237 a: msg 1238 }; 1239} 1240 1241function _Json_decodePrim(decoder) 1242{ 1243 return { $: 2, b: decoder }; 1244} 1245 1246var _Json_decodeInt = _Json_decodePrim(function(value) { 1247 return (typeof value !== 'number') 1248 ? _Json_expecting('an INT', value) 1249 : 1250 (-2147483647 < value && value < 2147483647 && (value | 0) === value) 1251 ? $elm$core$Result$Ok(value) 1252 : 1253 (isFinite(value) && !(value % 1)) 1254 ? $elm$core$Result$Ok(value) 1255 : _Json_expecting('an INT', value); 1256}); 1257 1258var _Json_decodeBool = _Json_decodePrim(function(value) { 1259 return (typeof value === 'boolean') 1260 ? $elm$core$Result$Ok(value) 1261 : _Json_expecting('a BOOL', value); 1262}); 1263 1264var _Json_decodeFloat = _Json_decodePrim(function(value) { 1265 return (typeof value === 'number') 1266 ? $elm$core$Result$Ok(value) 1267 : _Json_expecting('a FLOAT', value); 1268}); 1269 1270var _Json_decodeValue = _Json_decodePrim(function(value) { 1271 return $elm$core$Result$Ok(_Json_wrap(value)); 1272}); 1273 1274var _Json_decodeString = _Json_decodePrim(function(value) { 1275 return (typeof value === 'string') 1276 ? $elm$core$Result$Ok(value) 1277 : (value instanceof String) 1278 ? $elm$core$Result$Ok(value + '') 1279 : _Json_expecting('a STRING', value); 1280}); 1281 1282function _Json_decodeList(decoder) { return { $: 3, b: decoder }; } 1283function _Json_decodeArray(decoder) { return { $: 4, b: decoder }; } 1284 1285function _Json_decodeNull(value) { return { $: 5, c: value }; } 1286 1287var _Json_decodeField = F2(function(field, decoder) 1288{ 1289 return { 1290 $: 6, 1291 d: field, 1292 b: decoder 1293 }; 1294}); 1295 1296var _Json_decodeIndex = F2(function(index, decoder) 1297{ 1298 return { 1299 $: 7, 1300 e: index, 1301 b: decoder 1302 }; 1303}); 1304 1305function _Json_decodeKeyValuePairs(decoder) 1306{ 1307 return { 1308 $: 8, 1309 b: decoder 1310 }; 1311} 1312 1313function _Json_mapMany(f, decoders) 1314{ 1315 return { 1316 $: 9, 1317 f: f, 1318 g: decoders 1319 }; 1320} 1321 1322var _Json_andThen = F2(function(callback, decoder) 1323{ 1324 return { 1325 $: 10, 1326 b: decoder, 1327 h: callback 1328 }; 1329}); 1330 1331function _Json_oneOf(decoders) 1332{ 1333 return { 1334 $: 11, 1335 g: decoders 1336 }; 1337} 1338 1339 1340// DECODING OBJECTS 1341 1342var _Json_map1 = F2(function(f, d1) 1343{ 1344 return _Json_mapMany(f, [d1]); 1345}); 1346 1347var _Json_map2 = F3(function(f, d1, d2) 1348{ 1349 return _Json_mapMany(f, [d1, d2]); 1350}); 1351 1352var _Json_map3 = F4(function(f, d1, d2, d3) 1353{ 1354 return _Json_mapMany(f, [d1, d2, d3]); 1355}); 1356 1357var _Json_map4 = F5(function(f, d1, d2, d3, d4) 1358{ 1359 return _Json_mapMany(f, [d1, d2, d3, d4]); 1360}); 1361 1362var _Json_map5 = F6(function(f, d1, d2, d3, d4, d5) 1363{ 1364 return _Json_mapMany(f, [d1, d2, d3, d4, d5]); 1365}); 1366 1367var _Json_map6 = F7(function(f, d1, d2, d3, d4, d5, d6) 1368{ 1369 return _Json_mapMany(f, [d1, d2, d3, d4, d5, d6]); 1370}); 1371 1372var _Json_map7 = F8(function(f, d1, d2, d3, d4, d5, d6, d7) 1373{ 1374 return _Json_mapMany(f, [d1, d2, d3, d4, d5, d6, d7]); 1375}); 1376 1377var _Json_map8 = F9(function(f, d1, d2, d3, d4, d5, d6, d7, d8) 1378{ 1379 return _Json_mapMany(f, [d1, d2, d3, d4, d5, d6, d7, d8]); 1380}); 1381 1382 1383// DECODE 1384 1385var _Json_runOnString = F2(function(decoder, string) 1386{ 1387 try 1388 { 1389 var value = JSON.parse(string); 1390 return _Json_runHelp(decoder, value); 1391 } 1392 catch (e) 1393 { 1394 return $elm$core$Result$Err(A2($elm$json$Json$Decode$Failure, 'This is not val
1394id JSON! ' + e.message, _Json_wrap(string))); 1395 } 1396}); 1397 1398var _Json_run = F2(function(decoder, value) 1399{ 1400 return _Json_runHelp(decoder, _Json_unwrap(value)); 1401}); 1402 1403function _Json_runHelp(decoder, value) 1404{ 1405 switch (decoder.$) 1406 { 1407 case 2: 1408 return decoder.b(value); 1409 1410 case 5: 1411 return (value === null) 1412 ? $elm$core$Result$Ok(decoder.c) 1413 : _Json_expecting('null', value); 1414 1415 case 3: 1416 if (!_Json_isArray(value)) 1417 { 1418 return _Json_expecting('a LIST', value); 1419 } 1420 return _Json_runArrayDecoder(decoder.b, value, _List_fromArray); 1421 1422 case 4: 1423 if (!_Json_isArray(value)) 1424 { 1425 return _Json_expecting('an ARRAY', value); 1426 } 1427 return _Json_runArrayDecoder(decoder.b, value, _Json_toElmArray); 1428 1429 case 6: 1430 var field = decoder.d; 1431 if (typeof value !== 'object' || value === null || !(field in value)) 1432 { 1433 return _Json_expecting('an OBJECT with a field named `' + field + '`', value); 1434 } 1435 var result = _Json_runHelp(decoder.b, value[field]); 1436 return ($elm$core$Result$isOk(result)) ? result : $elm$core$Result$Err(A2($elm$json$Json$Decode$Field, field, result.a)); 1437 1438 case 7: 1439 var index = decoder.e; 1440 if (!_Json_isArray(value)) 1441 { 1442 return _Json_expecting('an ARRAY', value); 1443 } 1444 if (index >= value.length) 1445 { 1446 return _Json_expecting('a LONGER array. Need index ' + index + ' but only see ' + value.length + ' entries', value); 1447 } 1448 var result = _Json_runHelp(decoder.b, value[index]); 1449 return ($elm$core$Result$isOk(result)) ? result : $elm$core$Result$Err(A2($elm$json$Json$Decode$Index, index, result.a)); 1450 1451 case 8: 1452 if (typeof value !== 'object' || value === null || _Json_isArray(value)) 1453 { 1454 return _Json_expecting('an OBJECT', value); 1455 } 1456 1457 var keyValuePairs = _List_Nil; 1458 // TODO test perf of Object.keys and switch when support is good enough 1459 for (var key in value) 1460 { 1461 if (Object.prototype.hasOwnProperty.call(value, key)) 1462 { 1463 var result = _Json_runHelp(decoder.b, value[key]); 1464 if (!$elm$core$Result$isOk(result)) 1465 { 1466 return $elm$core$Result$Err(A2($elm$json$Json$Decode$Field, key, result.a)); 1467 } 1468 keyValuePairs = _List_Cons(_Utils_Tuple2(key, result.a), keyValuePairs); 1469 } 1470 } 1471 return $elm$core$Result$Ok($elm$core$List$reverse(keyValuePairs)); 1472 1473 case 9: 1474 var answer = decoder.f; 1475 var decoders = decoder.g; 1476 for (var i = 0; i < decoders.length; i++) 1477 { 1478 var result = _Json_runHelp(decoders[i], value); 1479 if (!$elm$core$Result$isOk(result)) 1480 { 1481 return result; 1482 } 1483 answer = answer(result.a); 1484 } 1485 return $elm$core$Result$Ok(answer); 1486 1487 case 10: 1488 var result = _Json_runHelp(decoder.b, value); 1489 return (!$elm$core$Result$isOk(result)) 1490 ? result 1491 : _Json_runHelp(decoder.h(result.a), value); 1492 1493 case 11: 1494 var errors = _List_Nil; 1495 for (var temp = decoder.g; temp.b; temp = temp.b) // WHILE_CONS 1496 { 1497 var result = _Json_runHelp(temp.a, value); 1498 if ($elm$core$Result$isOk(result)) 1499 { 1500 return result; 1501 } 1502 errors = _List_Cons(result.a, errors); 1503 } 1504 return $elm$core$Result$Err($elm$json$Json$Decode$OneOf($elm$core$List$reverse(errors))); 1505 1506 case 1: 1507 return $elm$core$Result$Err(A2($elm$json$Json$Decode$Failure, decoder.a, _Json_wrap(value))); 1508 1509 case 0: 1510 return $elm$core$Result$Ok(decoder.a); 1511 } 1512} 1513 1514function _Json_runArrayDecoder(decoder, value, toElmValue) 1515{ 1516 var len = value.length; 1517 var array = new Array(len); 1518 for (var i = 0; i < len; i++) 1519 { 1520 var result = _Json_runHelp(decoder, value[i]); 1521 if (!$elm$core$Result$isOk(result)) 1522 { 1523 return $elm$core$Result$Err(A2($elm$json$Json$Decode$Index, i, result.a)); 1524 } 1525 array[i] = result.a; 1526 } 1527 return $elm$core$Result$Ok(toElmValue(array)); 1528} 1529 1530function _Json_isArray(value) 1531{ 1532 return Array.isArray(value) || (typeof FileList !== 'undefined' && value instanceof FileList); 1533} 1534 1535function _Json_toElmArray(array) 1536{ 1537 return A2($elm$core$Array$initialize, array.length, function(i) { return array[i]; }); 1538} 1539 1540function _Json_expecting(type, value) 1541{ 1542 return $elm$core$Result$Err(A2($elm$json$Json$Decode$Failure, 'Expecting ' + type, _Json_wrap(value))); 1543} 1544 1545 1546// EQUALITY 1547 1548function _Json_equality(x, y) 1549{ 1550 if (x === y) 1551 { 1552 return true; 1553 } 1554 1555 if (x.$ !== y.$) 1556 { 1557 return false;
1558 } 1559 1560 switch (x.$) 1561 { 1562 case 0: 1563 case 1: 1564 return x.a === y.a; 1565 1566 case 2: 1567 return x.b === y.b; 1568 1569 case 5: 1570 return x.c === y.c; 1571 1572 case 3: 1573 case 4: 1574 case 8: 1575 return _Json_equality(x.b, y.b); 1576 1577 case 6: 1578 return x.d === y.d && _Json_equality(x.b, y.b); 1579 1580 case 7: 1581 return x.e === y.e && _Json_equality(x.b, y.b); 1582 1583 case 9: 1584 return x.f === y.f && _Json_listEquality(x.g, y.g); 1585 1586 case 10: 1587 return x.h === y.h && _Json_equality(x.b, y.b); 1588 1589 case 11: 1590 return _Json_listEquality(x.g, y.g); 1591 } 1592} 1593 1594function _Json_listEquality(aDecoders, bDecoders) 1595{ 1596 var len = aDecoders.length; 1597 if (len !== bDecoders.length) 1598 { 1599 return false; 1600 } 1601 for (var i = 0; i < len; i++) 1602 { 1603 if (!_Json_equality(aDecoders[i], bDecoders[i])) 1604 { 1605 return false; 1606 } 1607 } 1608 return true; 1609} 1610 1611 1612// ENCODE 1613 1614var _Json_encode = F2(function(indentLevel, value) 1615{ 1616 return JSON.stringify(_Json_unwrap(value), null, indentLevel) + ''; 1617}); 1618 1619function _Json_wrap_UNUSED(value) { return { $: 0, a: value }; } 1620function _Json_unwrap_UNUSED(value) { return value.a; } 1621 1622function _Json_wrap(value) { return value; } 1623function _Json_unwrap(value) { return value; } 1624 1625function _Json_emptyArray() { return []; } 1626function _Json_emptyObject() { return {}; } 1627 1628var _Json_addField = F3(function(key, value, object) 1629{ 1630 var unwrapped = _Json_unwrap(value); 1631 if (!(key === 'toJSON' && typeof unwrapped === 'function')) 1632 { 1633 object[key] = unwrapped; 1634 } 1635 return object; 1636}); 1637 1638function _Json_addEntry(func) 1639{ 1640 return F2(function(entry, array) 1641 { 1642 array.push(_Json_unwrap(func(entry))); 1643 return array; 1644 }); 1645} 1646 1647var _Json_encodeNull = _Json_wrap(null); 1648 1649 1650 1651// TASKS 1652 1653function _Scheduler_succeed(value) 1654{ 1655 return { 1656 $: 0, 1657 a: value 1658 }; 1659} 1660 1661function _Scheduler_fail(error) 1662{ 1663 return { 1664 $: 1, 1665 a: error 1666 }; 1667} 1668 1669function _Scheduler_binding(callback) 1670{ 1671 return { 1672 $: 2, 1673 b: callback, 1674 c: null 1675 }; 1676} 1677 1678var _Scheduler_andThen = F2(function(callback, task) 1679{ 1680 return { 1681 $: 3, 1682 b: callback, 1683 d: task 1684 }; 1685}); 1686 1687var _Scheduler_onError = F2(function(callback, task) 1688{ 1689 return { 1690 $: 4, 1691 b: callback, 1692 d: task 1693 }; 1694}); 1695 1696function _Scheduler_receive(callback) 1697{ 1698 return { 1699 $: 5, 1700 b: callback 1701 }; 1702} 1703 1704 1705// PROCESSES 1706 1707var _Scheduler_guid = 0; 1708 1709function _Scheduler_rawSpawn(task) 1710{ 1711 var proc = { 1712 $: 0, 1713 e: _Scheduler_guid++, 1714 f: task, 1715 g: null, 1716 h: [] 1717 }; 1718 1719 _Scheduler_enqueue(proc); 1720 1721 return proc; 1722} 1723 1724function _Scheduler_spawn(task) 1725{ 1726 return _Scheduler_binding(function(callback) { 1727 callback(_Scheduler_succeed(_Scheduler_rawSpawn(task))); 1728 }); 1729} 1730 1731function _Scheduler_rawSend(proc, msg) 1732{ 1733 proc.h.push(msg); 1734 _Scheduler_enqueue(proc); 1735} 1736 1737var _Scheduler_send = F2(function(proc, msg) 1738{ 1739 return _Scheduler_binding(function(callback) { 1740 _Scheduler_rawSend(proc, msg); 1741 callback(_Scheduler_succeed(_Utils_Tuple0)); 1742 }); 1743}); 1744 1745function _Scheduler_kill(proc) 1746{ 1747 return _Scheduler_binding(function(callback) { 1748 var task = proc.f; 1749 if (task.$ === 2 && task.c) 1750 { 1751 task.c(); 1752 } 1753 1754 proc.f = null; 1755 1756 callback(_Scheduler_succeed(_Utils_Tuple0)); 1757 }); 1758} 1759 1760 1761/* STEP PROCESSES 1762 1763type alias Process = 1764 { $ : tag 1765 , id : unique_id 1766 , root : Task 1767 , stack : null | { $: SUCCEED | FAIL, a: callback, b: stack } 1768 , mailbox : [msg] 1769 } 1770 1771*/ 1772 1773 1774var _Scheduler_working = false; 1775var _Scheduler_queue = []; 1776 1777 1778function _Scheduler_enqueue(proc) 1779{ 1780 _Scheduler_queue.push(proc); 1781 if (_Scheduler_working) 1782 { 1783 return; 1784 } 1785 _Scheduler_working = true; 1786 while (proc = _Scheduler_queue.shift()) 1787 { 1788 _Scheduler_step(proc); 1789 } 1790 _Scheduler_working = false; 1791} 1792 1793 1794function _Scheduler_step(proc) 1795{ 1796 while (proc.f) 1797 { 1798 var rootTag = proc.f.$; 1799 if (rootTag === 0 || rootTag === 1) 1800 { 1801 while (proc.g && proc.g.$ !== rootTag) 1802 { 1803 proc.g = proc.g.i; 1804 } 1805 if (!proc.g) 1806 { 1807 return; 1808 } 1809 proc.f = proc.g.b(proc.f.a); 1810 proc.g = proc.g.i; 1811 } 1812 else if (rootTag === 2) 1813 { 1814 proc.f.c = proc.f.b(function(newRoot) { 1815 proc.f = newRoot; 1816 _Scheduler_enqueue(proc); 1817 }); 1818 return; 1819 } 1820 else if (rootTag === 5) 1821 { 1822 if (proc.h.length === 0) 1823 { 1824 return; 1825 } 1826 proc.f = proc.f.b(proc.h.shift()); 1827 } 1828 else // if (rootTag === 3 || rootTag === 4) 1829 { 1830 proc.g = { 1831 $: rootTag === 3 ? 0 : 1, 1832 b: proc.f.b, 1833 i: proc.g 1834 }; 1835 proc.f = proc.f.d; 1836 } 1837 } 1838} 1839 1840 1841 1842function _Process_sleep(time) 1843{ 1844 return _Scheduler_binding(function(callback) { 1845 var id = setTimeout(function() {
1846 callback(_Scheduler_succeed(_Utils_Tuple0)); 1847 }, time); 1848 1849 return function() { clearTimeout(id); }; 1850 }); 1851} 1852 1853 1854 1855 1856// PROGRAMS 1857 1858 1859var _Platform_worker = F4(function(impl, flagDecoder, debugMetadata, args) 1860{ 1861 return _Platform_initialize( 1862 flagDecoder, 1863 args, 1864 impl.iZ, 1865 impl.q2, 1866 impl.qC, 1867 function() { return function() {} } 1868 ); 1869}); 1870 1871 1872 1873// INITIALIZE A PROGRAM 1874 1875 1876function _Platform_initialize(flagDecoder, args, init, update, subscriptions, stepperBuilder) 1877{ 1878 var result = A2(_Json_run, flagDecoder, _Json_wrap(args ? args['flags'] : undefined)); 1879 $elm$core$Result$isOk(result) || _Debug_crash(2 /**_UNUSED/, _Json_errorToString(result.a) /**/); 1880 var managers = {}; 1881 var initPair = init(result.a); 1882 var model = initPair.a; 1883 var stepper = stepperBuilder(sendToApp, model); 1884 var ports = _Platform_setupEffects(managers, sendToApp); 1885 1886 function sendToApp(msg, viewMetadata) 1887 { 1888 var pair = A2(update, msg, model); 1889 stepper(model = pair.a, viewMetadata); 1890 _Platform_enqueueEffects(managers, pair.b, subscriptions(model)); 1891 } 1892 1893 _Platform_enqueueEffects(managers, initPair.b, subscriptions(model)); 1894 1895 return ports ? { ports: ports } : {}; 1896} 1897 1898 1899 1900// TRACK PRELOADS 1901// 1902// This is used by code in elm/browser and elm/http 1903// to register any HTTP requests that are triggered by init. 1904// 1905 1906 1907var _Platform_preload; 1908 1909 1910function _Platform_registerPreload(url) 1911{ 1912 _Platform_preload.add(url); 1913} 1914 1915 1916 1917// EFFECT MANAGERS 1918 1919 1920var _Platform_effectManagers = {}; 1921 1922 1923function _Platform_setupEffects(managers, sendToApp) 1924{ 1925 var ports; 1926 1927 // setup all necessary effect managers 1928 for (var key in _Platform_effectManagers) 1929 { 1930 var manager = _Platform_effectManagers[key]; 1931 1932 if (manager.a) 1933 { 1934 ports = ports || {}; 1935 ports[key] = manager.a(key, sendToApp); 1936 } 1937 1938 managers[key] = _Platform_instantiateManager(manager, sendToApp); 1939 } 1940 1941 return ports; 1942} 1943 1944 1945function _Platform_createManager(init, onEffects, onSelfMsg, cmdMap, subMap) 1946{ 1947 return { 1948 b: init, 1949 c: onEffects, 1950 d: onSelfMsg, 1951 e: cmdMap, 1952 f: subMap 1953 }; 1954} 1955 1956 1957function _Platform_instantiateManager(info, sendToApp) 1958{ 1959 var router = { 1960 g: sendToApp, 1961 h: undefined 1962 }; 1963 1964 var onEffects = info.c; 1965 var onSelfMsg = info.d; 1966 var cmdMap = info.e; 1967 var subMap = info.f; 1968 1969 function loop(state) 1970 { 1971 return A2(_Scheduler_andThen, loop, _Scheduler_receive(function(msg) 1972 { 1973 var value = msg.a; 1974 1975 if (msg.$ === 0) 1976 { 1977 return A3(onSelfMsg, router, value, state); 1978 } 1979 1980 return cmdMap && subMap 1981 ? A4(onEffects, router, value.i, value.j, state) 1982 : A3(onEffects, router, cmdMap ? value.i : value.j, state); 1983 })); 1984 } 1985 1986 return router.h = _Scheduler_rawSpawn(A2(_Scheduler_andThen, loop, info.b)); 1987} 1988 1989 1990 1991// ROUTING 1992 1993 1994var _Platform_sendToApp = F2(function(router, msg) 1995{ 1996 return _Scheduler_binding(function(callback) 1997 { 1998 router.g(msg); 1999 callback(_Scheduler_succeed(_Utils_Tuple0)); 2000 }); 2001}); 2002 2003 2004var _Platform_sendToSelf = F2(function(router, msg) 2005{ 2006 return A2(_Scheduler_send, router.h, { 2007 $: 0, 2008 a: msg 2009 }); 2010}); 2011 2012 2013 2014// BAGS 2015 2016 2017function _Platform_leaf(home) 2018{ 2019 return function(value) 2020 { 2021 return { 2022 $: 1, 2023 k: home, 2024 l: value 2025 }; 2026 }; 2027} 2028 2029 2030function _Platform_batch(list) 2031{ 2032 return { 2033 $: 2, 2034 m: list 2035 }; 2036} 2037 2038 2039var _Platform_map = F2(function(tagger, bag) 2040{ 2041 return { 2042 $: 3, 2043 n: tagger, 2044 o: bag 2045 } 2046}); 2047 2048 2049 2050// PIPE BAGS INTO EFFECT MANAGERS 2051// 2052// Effects must be queued! 2053// 2054// Say your init contains a synchronous command, like Time.now or Time.here 2055// 2056// - This will produce a batch of effects (FX_1) 2057// - The synchronous task triggers the subsequent `update` call 2058// - This will produce a batch of effects (FX_2) 2059// 2060// If we just start dispatching FX_2, subscriptions from FX_2 can be processed 2061// before subscriptions from FX_1. No good! Earlier versions of this code had 2062// this problem, leading to these reports: 2063// 2064// https://github.com/elm/core/issues/980 2065// https://github.com/elm/core/pull/981 2066// https://github.com/elm/compiler/issues/1776 2067// 2068// The queue is necessary to avoid ordering issues for synchronous commands. 2069 2070 2071// Why use true/false here? Why not just check the length of the queue? 2072// The goal is to detect "are we currently dispatching effects?" If we 2073// are, we need to bail and let the ongoing while loop handle things. 2074// 2075// Now say the queue has 1 element. When we dequeue the final element, 2076// the queue will be empty, but we are still actively dispatching effects. 2077// So you could get queue jumping in a really tricky category of cases. 2078// 2079var _Platform_effectsQueue = []; 2080var _Platform_effectsActive = false;
2081 2082 2083function _Platform_enqueueEffects(managers, cmdBag, subBag) 2084{ 2085 _Platform_effectsQueue.push({ p: managers, q: cmdBag, r: subBag }); 2086 2087 if (_Platform_effectsActive) return; 2088 2089 _Platform_effectsActive = true; 2090 for (var fx; fx = _Platform_effectsQueue.shift(); ) 2091 { 2092 _Platform_dispatchEffects(fx.p, fx.q, fx.r); 2093 } 2094 _Platform_effectsActive = false; 2095} 2096 2097 2098function _Platform_dispatchEffects(managers, cmdBag, subBag) 2099{ 2100 var effectsDict = {}; 2101 _Platform_gatherEffects(true, cmdBag, effectsDict, null); 2102 _Platform_gatherEffects(false, subBag, effectsDict, null); 2103 2104 for (var home in managers) 2105 { 2106 _Scheduler_rawSend(managers[home], { 2107 $: 'fx', 2108 a: effectsDict[home] || { i: _List_Nil, j: _List_Nil } 2109 }); 2110 } 2111} 2112 2113 2114function _Platform_gatherEffects(isCmd, bag, effectsDict, taggers) 2115{ 2116 switch (bag.$) 2117 { 2118 case 1: 2119 var home = bag.k; 2120 var effect = _Platform_toEffect(isCmd, home, taggers, bag.l); 2121 effectsDict[home] = _Platform_insert(isCmd, effect, effectsDict[home]); 2122 return; 2123 2124 case 2: 2125 for (var list = bag.m; list.b; list = list.b) // WHILE_CONS 2126 { 2127 _Platform_gatherEffects(isCmd, list.a, effectsDict, taggers); 2128 } 2129 return; 2130 2131 case 3: 2132 _Platform_gatherEffects(isCmd, bag.o, effectsDict, { 2133 s: bag.n, 2134 t: taggers 2135 }); 2136 return; 2137 } 2138} 2139 2140 2141function _Platform_toEffect(isCmd, home, taggers, value) 2142{ 2143 function applyTaggers(x) 2144 { 2145 for (var temp = taggers; temp; temp = temp.t) 2146 { 2147 x = temp.s(x); 2148 } 2149 return x; 2150 } 2151 2152 var map = isCmd 2153 ? _Platform_effectManagers[home].e 2154 : _Platform_effectManagers[home].f; 2155 2156 return A2(map, applyTaggers, value) 2157} 2158 2159 2160function _Platform_insert(isCmd, newEffect, effects) 2161{ 2162 effects = effects || { i: _List_Nil, j: _List_Nil }; 2163 2164 isCmd 2165 ? (effects.i = _List_Cons(newEffect, effects.i)) 2166 : (effects.j = _List_Cons(newEffect, effects.j)); 2167 2168 return effects; 2169} 2170 2171 2172 2173// PORTS 2174 2175 2176function _Platform_checkPortName(name) 2177{ 2178 if (_Platform_effectManagers[name]) 2179 { 2180 _Debug_crash(3, name) 2181 } 2182} 2183 2184 2185 2186// OUTGOING PORTS 2187 2188 2189function _Platform_outgoingPort(name, converter) 2190{ 2191 _Platform_checkPortName(name); 2192 _Platform_effectManagers[name] = { 2193 e: _Platform_outgoingPortMap, 2194 u: converter, 2195 a: _Platform_setupOutgoingPort 2196 }; 2197 return _Platform_leaf(name); 2198} 2199 2200 2201var _Platform_outgoingPortMap = F2(function(tagger, value) { return value; }); 2202 2203 2204function _Platform_setupOutgoingPort(name) 2205{ 2206 var subs = []; 2207 var converter = _Platform_effectManagers[name].u; 2208 2209 // CREATE MANAGER 2210 2211 var init = _Process_sleep(0); 2212 2213 _Platform_effectManagers[name].b = init; 2214 _Platform_effectManagers[name].c = F3(function(router, cmdList, state) 2215 { 2216 for ( ; cmdList.b; cmdList = cmdList.b) // WHILE_CONS 2217 { 2218 // grab a separate reference to subs in case unsubscribe is called 2219 var currentSubs = subs; 2220 var value = _Json_unwrap(converter(cmdList.a)); 2221 for (var i = 0; i < currentSubs.length; i++) 2222 { 2223 currentSubs[i](value); 2224 } 2225 } 2226 return init; 2227 }); 2228 2229 // PUBLIC API 2230 2231 function subscribe(callback) 2232 { 2233 subs.push(callback); 2234 } 2235 2236 function unsubscribe(callback) 2237 { 2238 // copy subs into a new array in case unsubscribe is called within a 2239 // subscribed callback 2240 subs = subs.slice(); 2241 var index = subs.indexOf(callback); 2242 if (index >= 0) 2243 { 2244 subs.splice(index, 1); 2245 } 2246 } 2247 2248 return { 2249 subscribe: subscribe, 2250 unsubscribe: unsubscribe 2251 }; 2252} 2253 2254 2255 2256// INCOMING PORTS 2257 2258 2259function _Platform_incomingPort(name, converter) 2260{ 2261 _Platform_checkPortName(name); 2262 _Platform_effectManagers[name] = { 2263 f: _Platform_incomingPortMap, 2264 u: converter, 2265 a: _Platform_setupIncomingPort 2266 }; 2267 return _Platform_leaf(name); 2268} 2269 2270 2271var _Platform_incomingPortMap = F2(function(tagger, finalTagger) 2272{ 2273 return function(value) 2274 { 2275 return tagger(finalTagger(value)); 2276 }; 2277}); 2278 2279 2280function _Platform_setupIncomingPort(name, sendToApp) 2281{ 2282 var subs = _List_Nil; 2283 var converter = _Platform_effectManagers[name].u; 2284 2285 // CREATE MANAGER 2286 2287 var init = _Scheduler_succeed(null); 2288 2289 _Platform_effectManagers[name].b = init; 2290 _Platform_effectManagers[name].c = F3(function(router, subList, state) 2291 { 2292 subs = subList; 2293 return init; 2294 }); 2295 2296 // PUBLIC API 2297 2298 function send(incomingValue) 2299 { 2300 var result = A2(_Json_run, converter, _Json_wrap(incomingValue)); 2301 2302 $elm$core$Result$isOk(result) || _Debug_crash(4, name, result.a); 2303 2304 var value = result.a; 2305 for (var temp = subs; temp.b; temp = temp.b) // WHILE_CONS 2306 { 2307 sendToApp(temp.a(value)); 2308 } 2309 } 2310 2311 return { send: send }; 2312} 2313 2314 2315 2316// EXPORT ELM MODULES 2317//
2318// Have DEBUG and PROD versions so that we can (1) give nicer errors in 2319// debug mode and (2) not pay for the bits needed for that in prod mode. 2320// 2321 2322 2323function _Platform_export(exports) 2324{ 2325 scope['Elm'] 2326 ? _Platform_mergeExportsProd(scope['Elm'], exports) 2327 : scope['Elm'] = exports; 2328} 2329 2330 2331function _Platform_mergeExportsProd(obj, exports) 2332{ 2333 for (var name in exports) 2334 { 2335 (name in obj) 2336 ? (name == 'init') 2337 ? _Debug_crash(6) 2338 : _Platform_mergeExportsProd(obj[name], exports[name]) 2339 : (obj[name] = exports[name]); 2340 } 2341} 2342 2343 2344function _Platform_export_UNUSED(exports) 2345{ 2346 scope['Elm'] 2347 ? _Platform_mergeExportsDebug('Elm', scope['Elm'], exports) 2348 : scope['Elm'] = exports; 2349} 2350 2351 2352function _Platform_mergeExportsDebug(moduleName, obj, exports) 2353{ 2354 for (var name in exports) 2355 { 2356 (name in obj) 2357 ? (name == 'init') 2358 ? _Debug_crash(6, moduleName) 2359 : _Platform_mergeExportsDebug(moduleName + '.' + name, obj[name], exports[name]) 2360 : (obj[name] = exports[name]); 2361 } 2362} 2363 2364 2365 2366 2367// HELPERS 2368 2369 2370var _VirtualDom_divertHrefToApp; 2371 2372var _VirtualDom_doc = typeof document !== 'undefined' ? document : {}; 2373 2374 2375function _VirtualDom_appendChild(parent, child) 2376{ 2377 parent.appendChild(child); 2378} 2379 2380var _VirtualDom_init = F4(function(virtualNode, flagDecoder, debugMetadata, args) 2381{ 2382 // NOTE: this function needs _Platform_export available to work 2383 2384 /**/ 2385 var node = args['node']; 2386 //*/ 2387 /**_UNUSED/ 2388 var node = args && args['node'] ? args['node'] : _Debug_crash(0); 2389 //*/ 2390 2391 node.parentNode.replaceChild( 2392 _VirtualDom_render(virtualNode, function() {}), 2393 node 2394 ); 2395 2396 return {}; 2397}); 2398 2399 2400 2401// TEXT 2402 2403 2404function _VirtualDom_text(string) 2405{ 2406 return { 2407 $: 0, 2408 a: string 2409 }; 2410} 2411 2412 2413 2414// NODE 2415 2416 2417var _VirtualDom_nodeNS = F2(function(namespace, tag) 2418{ 2419 return F2(function(factList, kidList) 2420 { 2421 for (var kids = [], descendantsCount = 0; kidList.b; kidList = kidList.b) // WHILE_CONS 2422 { 2423 var kid = kidList.a; 2424 descendantsCount += (kid.b || 0); 2425 kids.push(kid); 2426 } 2427 descendantsCount += kids.length; 2428 2429 return { 2430 $: 1, 2431 c: tag, 2432 d: _VirtualDom_organizeFacts(factList), 2433 e: kids, 2434 f: namespace, 2435 b: descendantsCount 2436 }; 2437 }); 2438}); 2439 2440 2441var _VirtualDom_node = _VirtualDom_nodeNS(undefined); 2442 2443 2444 2445// KEYED NODE 2446 2447 2448var _VirtualDom_keyedNodeNS = F2(function(namespace, tag) 2449{ 2450 return F2(function(factList, kidList) 2451 { 2452 for (var kids = [], descendantsCount = 0; kidList.b; kidList = kidList.b) // WHILE_CONS 2453 { 2454 var kid = kidList.a; 2455 descendantsCount += (kid.b.b || 0); 2456 kids.push(kid); 2457 } 2458 descendantsCount += kids.length; 2459 2460 return { 2461 $: 2, 2462 c: tag, 2463 d: _VirtualDom_organizeFacts(factList), 2464 e: kids, 2465 f: namespace, 2466 b: descendantsCount 2467 }; 2468 }); 2469}); 2470 2471 2472var _VirtualDom_keyedNode = _VirtualDom_keyedNodeNS(undefined); 2473 2474 2475 2476// CUSTOM 2477 2478 2479function _VirtualDom_custom(factList, model, render, diff) 2480{ 2481 return { 2482 $: 3, 2483 d: _VirtualDom_organizeFacts(factList), 2484 g: model, 2485 h: render, 2486 i: diff 2487 }; 2488} 2489 2490 2491 2492// MAP 2493 2494 2495var _VirtualDom_map = F2(function(tagger, node) 2496{ 2497 return { 2498 $: 4, 2499 j: tagger, 2500 k: node, 2501 b: 1 + (node.b || 0) 2502 }; 2503}); 2504 2505 2506 2507// LAZY 2508 2509 2510function _VirtualDom_thunk(refs, thunk) 2511{ 2512 return { 2513 $: 5, 2514 l: refs, 2515 m: thunk, 2516 k: undefined 2517 }; 2518} 2519 2520var _VirtualDom_lazy = F2(function(func, a) 2521{ 2522 return _VirtualDom_thunk([func, a], function() { 2523 return func(a); 2524 }); 2525}); 2526 2527var _VirtualDom_lazy2 = F3(function(func, a, b) 2528{ 2529 return _VirtualDom_thunk([func, a, b], function() { 2530 return A2(func, a, b); 2531 }); 2532}); 2533 2534var _VirtualDom_lazy3 = F4(function(func, a, b, c) 2535{ 2536 return _VirtualDom_thunk([func, a, b, c], function() { 2537 return A3(func, a, b, c); 2538 }); 2539}); 2540 2541var _VirtualDom_lazy4 = F5(function(func, a, b, c, d) 2542{ 2543 return _VirtualDom_thunk([func, a, b, c, d], function() { 2544 return A4(func, a, b, c, d); 2545 }); 2546}); 2547 2548var _VirtualDom_lazy5 = F6(function(func, a, b, c, d, e) 2549{ 2550 return _VirtualDom_thunk([func, a, b, c, d, e], function() { 2551 return A5(func, a, b, c, d, e); 2552 }); 2553}); 2554 2555var _VirtualDom_lazy6 = F7(function(func, a, b, c, d, e, f) 2556{ 2557 return _VirtualDom_thunk([func, a, b, c, d, e, f], function() { 2558 return A6(func, a, b, c, d, e, f); 2559 }); 2560}); 2561 2562var _VirtualDom_lazy7 = F8(function(func, a, b, c, d, e, f, g) 2563{ 2564 return _VirtualDom_thunk([func, a, b, c, d, e, f, g], function() { 2565 return A7(func, a, b, c, d, e, f, g); 2566 }); 2567}); 2568 2569var _VirtualDom_lazy8 = F9(function(func, a, b, c, d, e, f, g, h) 2570{ 2571 return _VirtualDom_thunk([func, a, b, c, d, e, f, g, h], function() { 2572 return A8(func, a, b, c, d, e, f, g, h); 2573 }); 2574}); 2575 2576 2577 2578// FACTS 2579 2580 2581var _VirtualDom_on = F2(function(key, handler) 2582{ 2583 return { 2584 $: 'a0', 2585 n: key, 2586 o: handler 2587 }; 2588}); 2589var _VirtualDom_style = F2(function(key, value) 2590{ 2591 return { 2592 $: 'a1', 2593 n: key, 2594 o: value 2595 }; 2596}); 2597var _VirtualDom_property = F2(function(key, value) 2598{ 2599 return { 2600 $: 'a2', 2601 n: key, 2602 o: value 2603 }; 2604}); 2605var _VirtualDom_attribute = F2(function(key, value) 2606{ 2607 return { 2608 $: 'a3', 2609 n: key, 2610 o: value 2611 }; 2612}); 2613var _VirtualDom_attributeNS = F3(function(namespace, key, value) 2614{ 2615 return { 2616 $: 'a4', 2617 n: key, 2618 o: { f: namespace, o: value } 2619 }; 2620}); 2621 2622 2623 2624// XSS ATTACK VECTOR CHECKS 2625// 2626// For some reason, tabs can appear in href protocols and it still works. 2627// So '\tjava\tSCRIPT:alert("!!!")' and 'javascript:alert("!!!")' are the same
2628// in practice. That is why _VirtualDom_RE_js and _VirtualDom_RE_js_html look 2629// so freaky. 2630// 2631// Pulling the regular expressions out to the top level gives a slight speed 2632// boost in small benchmarks (4-10%) but hoisting values to reduce allocation 2633// can be unpredictable in large programs where JIT may have a harder time with 2634// functions are not fully self-contained. The benefit is more that the js and 2635// js_html ones are so weird that I prefer to see them near each other. 2636 2637 2638var _VirtualDom_RE_script = /^script$/i; 2639var _VirtualDom_RE_on_formAction = /^(on|formAction$)/i; 2640var _VirtualDom_RE_js = /^\s*j\s*a\s*v\s*a\s*s\s*c\s*r\s*i\s*p\s*t\s*:/i; 2641var _VirtualDom_RE_js_html = /^\s*(j\s*a\s*v\s*a\s*s\s*c\s*r\s*i\s*p\s*t\s*:|d\s*a\s*t\s*a\s*:\s*t\s*e\s*x\s*t\s*\/\s*h\s*t\s*m\s*l\s*(,|;))/i; 2642 2643 2644function _VirtualDom_noScript(tag) 2645{ 2646 return _VirtualDom_RE_script.test(tag) ? 'p' : tag; 2647} 2648 2649function _VirtualDom_noOnOrFormAction(key) 2650{ 2651 return _VirtualDom_RE_on_formAction.test(key) ? 'data-' + key : key; 2652} 2653 2654function _VirtualDom_noInnerHtmlOrFormAction(key) 2655{ 2656 return key == 'innerHTML' || key == 'outerHTML' || key == 'formAction' ? 'data-' + key : key; 2657} 2658 2659function _VirtualDom_noJavaScriptUri(value) 2660{ 2661 return _VirtualDom_RE_js.test(value) 2662 ? /**/''//*//**_UNUSED/'javascript:alert("This is an XSS vector. Please use ports or web components instead.")'//*/ 2663 : value; 2664} 2665 2666function _VirtualDom_noJavaScriptOrHtmlUri(value) 2667{ 2668 return _VirtualDom_RE_js_html.test(value) 2669 ? /**/''//*//**_UNUSED/'javascript:alert("This is an XSS vector. Please use ports or web components instead.")'//*/ 2670 : value; 2671} 2672 2673function _VirtualDom_noJavaScriptOrHtmlJson(value) 2674{ 2675 return ( 2676 (typeof _Json_unwrap(value) === 'string' && _VirtualDom_RE_js_html.test(_Json_unwrap(value))) 2677 || 2678 (Array.isArray(_Json_unwrap(value)) && _VirtualDom_RE_js_html.test(String(_Json_unwrap(value)))) 2679 ) 2680 ? _Json_wrap( 2681 /**/''//*//**_UNUSED/'javascript:alert("This is an XSS vector. Please use ports or web components instead.")'//*/ 2682 ) : value; 2683} 2684 2685 2686 2687// MAP FACTS 2688 2689 2690var _VirtualDom_mapAttribute = F2(function(func, attr) 2691{ 2692 return (attr.$ === 'a0') 2693 ? A2(_VirtualDom_on, attr.n, _VirtualDom_mapHandler(func, attr.o)) 2694 : attr; 2695}); 2696 2697function _VirtualDom_mapHandler(func, handler) 2698{ 2699 var tag = $elm$virtual_dom$VirtualDom$toHandlerInt(handler); 2700 2701 // 0 = Normal 2702 // 1 = MayStopPropagation 2703 // 2 = MayPreventDefault 2704 // 3 = Custom 2705 2706 return { 2707 $: handler.$, 2708 a: 2709 !tag 2710 ? A2($elm$json$Json$Decode$map, func, handler.a) 2711 : 2712 A3($elm$json$Json$Decode$map2, 2713 tag < 3 2714 ? _VirtualDom_mapEventTuple 2715 : _VirtualDom_mapEventRecord, 2716 $elm$json$Json$Decode$succeed(func), 2717 handler.a 2718 ) 2719 }; 2720} 2721 2722var _VirtualDom_mapEventTuple = F2(function(func, tuple) 2723{ 2724 return _Utils_Tuple2(func(tuple.a), tuple.b); 2725}); 2726 2727var _VirtualDom_mapEventRecord = F2(function(func, record) 2728{ 2729 return { 2730 dv: func(record.dv), 2731 qx: record.qx, 2732 pD: record.pD 2733 } 2734}); 2735 2736 2737 2738// ORGANIZE FACTS 2739 2740 2741function _VirtualDom_organizeFacts(factList) 2742{ 2743 for (var facts = {}; factList.b; factList = factList.b) // WHILE_CONS 2744 { 2745 var entry = factList.a; 2746 2747 var tag = entry.$; 2748 var key = entry.n; 2749 var value = entry.o; 2750 2751 if (tag === 'a2') 2752 { 2753 (key === 'className') 2754 ? _VirtualDom_addClass(facts, key, _Json_unwrap(value)) 2755 : facts[key] = _Json_unwrap(value); 2756 2757 continue; 2758 } 2759 2760 var subFacts = facts[tag] || (facts[tag] = {}); 2761 (tag === 'a3' && key === 'class') 2762 ? _VirtualDom_addClass(subFacts, key, value) 2763 : subFacts[key] = value; 2764 } 2765 2766 return facts; 2767} 2768 2769function _VirtualDom_addClass(object, key, newClass) 2770{ 2771 var classes = object[key]; 2772 object[key] = classes ? classes + ' ' + newClass : newClass; 2773} 2774 2775 2776 2777// RENDER 2778 2779 2780function _VirtualDom_render(vNode, eventNode) 2781{ 2782 var tag = vNode.$; 2783 2784 if (tag === 5) 2785 { 2786 return _VirtualDom_render(vNode.k || (vNode.k = vNode.m()), eventNode); 2787 } 2788 2789 if (tag === 0) 2790 { 2791 return _VirtualDom_doc.createTextNode(vNode.a); 2792 } 2793 2794 if (tag === 4) 2795 { 2796 var subNode = vNode.k; 2797 var tagger = vNode.j; 2798 2799 while (subNode.$ === 4) 2800 { 2801 typeof tagger !== 'object' 2802 ? tagger = [tagger, subNode.j]
2803 : tagger.push(subNode.j); 2804 2805 subNode = subNode.k; 2806 } 2807 2808 var subEventRoot = { j: tagger, p: eventNode }; 2809 var domNode = _VirtualDom_render(subNode, subEventRoot); 2810 domNode.elm_event_node_ref = subEventRoot; 2811 return domNode; 2812 } 2813 2814 if (tag === 3) 2815 { 2816 var domNode = vNode.h(vNode.g); 2817 _VirtualDom_applyFacts(domNode, eventNode, vNode.d); 2818 return domNode; 2819 } 2820 2821 // at this point `tag` must be 1 or 2 2822 2823 var domNode = vNode.f 2824 ? _VirtualDom_doc.createElementNS(vNode.f, vNode.c) 2825 : _VirtualDom_doc.createElement(vNode.c); 2826 2827 if (_VirtualDom_divertHrefToApp && vNode.c == 'a') 2828 { 2829 domNode.addEventListener('click', _VirtualDom_divertHrefToApp(domNode)); 2830 } 2831 2832 _VirtualDom_applyFacts(domNode, eventNode, vNode.d); 2833 2834 for (var kids = vNode.e, i = 0; i < kids.length; i++) 2835 { 2836 _VirtualDom_appendChild(domNode, _VirtualDom_render(tag === 1 ? kids[i] : kids[i].b, eventNode)); 2837 } 2838 2839 return domNode; 2840} 2841 2842 2843 2844// APPLY FACTS 2845 2846 2847function _VirtualDom_applyFacts(domNode, eventNode, facts) 2848{ 2849 for (var key in facts) 2850 { 2851 var value = facts[key]; 2852 2853 key === 'a1' 2854 ? _VirtualDom_applyStyles(domNode, value) 2855 : 2856 key === 'a0' 2857 ? _VirtualDom_applyEvents(domNode, eventNode, value) 2858 : 2859 key === 'a3' 2860 ? _VirtualDom_applyAttrs(domNode, value) 2861 : 2862 key === 'a4' 2863 ? _VirtualDom_applyAttrsNS(domNode, value) 2864 : 2865 ((key !== 'value' && key !== 'checked') || domNode[key] !== value) && (domNode[key] = value); 2866 } 2867} 2868 2869 2870 2871// APPLY STYLES 2872 2873 2874function _VirtualDom_applyStyles(domNode, styles) 2875{ 2876 var domNodeStyle = domNode.style; 2877 2878 for (var key in styles) 2879 { 2880 domNodeStyle[key] = styles[key]; 2881 } 2882} 2883 2884 2885 2886// APPLY ATTRS 2887 2888 2889function _VirtualDom_applyAttrs(domNode, attrs) 2890{ 2891 for (var key in attrs) 2892 { 2893 var value = attrs[key]; 2894 typeof value !== 'undefined' 2895 ? domNode.setAttribute(key, value) 2896 : domNode.removeAttribute(key); 2897 } 2898} 2899 2900 2901 2902// APPLY NAMESPACED ATTRS 2903 2904 2905function _VirtualDom_applyAttrsNS(domNode, nsAttrs) 2906{ 2907 for (var key in nsAttrs) 2908 { 2909 var pair = nsAttrs[key]; 2910 var namespace = pair.f; 2911 var value = pair.o; 2912 2913 typeof value !== 'undefined' 2914 ? domNode.setAttributeNS(namespace, key, value) 2915 : domNode.removeAttributeNS(namespace, key); 2916 } 2917} 2918 2919 2920 2921// APPLY EVENTS 2922 2923 2924function _VirtualDom_applyEvents(domNode, eventNode, events) 2925{ 2926 var allCallbacks = domNode.elmFs || (domNode.elmFs = {}); 2927 2928 for (var key in events) 2929 { 2930 var newHandler = events[key]; 2931 var oldCallback = allCallbacks[key]; 2932 2933 if (!newHandler) 2934 { 2935 domNode.removeEventListener(key, oldCallback); 2936 allCallbacks[key] = undefined; 2937 continue; 2938 } 2939 2940 if (oldCallback) 2941 { 2942 var oldHandler = oldCallback.q; 2943 if (oldHandler.$ === newHandler.$) 2944 { 2945 oldCallback.q = newHandler; 2946 continue; 2947 } 2948 domNode.removeEventListener(key, oldCallback); 2949 } 2950 2951 oldCallback = _VirtualDom_makeCallback(eventNode, newHandler); 2952 domNode.addEventListener(key, oldCallback, 2953 _VirtualDom_passiveSupported 2954 && { passive: $elm$virtual_dom$VirtualDom$toHandlerInt(newHandler) < 2 } 2955 ); 2956 allCallbacks[key] = oldCallback; 2957 } 2958} 2959 2960 2961 2962// PASSIVE EVENTS 2963 2964 2965var _VirtualDom_passiveSupported; 2966 2967try 2968{ 2969 window.addEventListener('t', null, Object.defineProperty({}, 'passive', { 2970 get: function() { _VirtualDom_passiveSupported = true; } 2971 })); 2972} 2973catch(e) {} 2974 2975 2976 2977// EVENT HANDLERS 2978 2979 2980function _VirtualDom_makeCallback(eventNode, initialHandler) 2981{ 2982 function callback(event) 2983 { 2984 var handler = callback.q; 2985 var result = _Json_runHelp(handler.a, event); 2986 2987 if (!$elm$core$Result$isOk(result)) 2988 { 2989 return; 2990 } 2991 2992 var tag = $elm$virtual_dom$VirtualDom$toHandlerInt(handler); 2993 2994 // 0 = Normal 2995 // 1 = MayStopPropagation 2996 // 2 = MayPreventDefault 2997 // 3 = Custom 2998 2999 var value = result.a; 3000 var message = !tag ? value : tag < 3 ? value.a : value.dv; 3001 var stopPropagation = tag == 1 ? value.b : tag == 3 && value.qx; 3002 var currentEventNode = ( 3003 stopPropagation && event.stopPropagation(), 3004 (tag == 2 ? value.b : tag == 3 && value.pD) && event.preventDefault(), 3005 eventNode 3006 ); 3007 var tagger; 3008 var i; 3009 while (tagger = currentEventNode.j) 3010 { 3011 if (typeof tagger == 'function') 3012 { 3013 message = tagger(message); 3014 } 3015 else 3016 { 3017 for (var i = tagger.length; i--; ) 3018 { 3019 message = tagger[i](message); 3020 } 3021 } 3022 currentEventNode = currentEventNode.p; 3023 } 3024 currentEventNode(message, stopPropagation); // stopPropagation implies isSync 3025 } 3026 3027 callback.q = initialHandler; 3028 3029 return callback; 3030} 3031 3032function _VirtualDom_equalEvents(x, y) 3033{ 3034 return x.$ == y.$ && _Json_equality(x.a, y.a); 3035} 3036 3037 3038 3039// DIFF 3040 3041 3042// TODO: Should we do patches like in iOS? 3043// 3044// type Patch 3045// = At Int Patch 3046// | Batch (List Patch) 3047// | Change ... 3048// 3049// How could it not be better? 3050// 3051function _VirtualDom_diff(x, y) 3052{ 3053 var patches = []; 3054 _VirtualDom_diffHelp(x, y, patches, 0); 3055 return patches; 3056} 3057 3058
3059function _VirtualDom_pushPatch(patches, type, index, data) 3060{ 3061 var patch = { 3062 $: type, 3063 r: index, 3064 s: data, 3065 t: undefined, 3066 u: undefined 3067 }; 3068 patches.push(patch); 3069 return patch; 3070} 3071 3072 3073function _VirtualDom_diffHelp(x, y, patches, index) 3074{ 3075 if (x === y) 3076 { 3077 return; 3078 } 3079 3080 var xType = x.$; 3081 var yType = y.$; 3082 3083 // Bail if you run into different types of nodes. Implies that the 3084 // structure has changed significantly and it's not worth a diff. 3085 if (xType !== yType) 3086 { 3087 if (xType === 1 && yType === 2) 3088 { 3089 y = _VirtualDom_dekey(y); 3090 yType = 1; 3091 } 3092 else 3093 { 3094 _VirtualDom_pushPatch(patches, 0, index, y); 3095 return; 3096 } 3097 } 3098 3099 // Now we know that both nodes are the same $. 3100 switch (yType) 3101 { 3102 case 5: 3103 var xRefs = x.l; 3104 var yRefs = y.l; 3105 var i = xRefs.length; 3106 var same = i === yRefs.length; 3107 while (same && i--) 3108 { 3109 same = xRefs[i] === yRefs[i]; 3110 } 3111 if (same) 3112 { 3113 y.k = x.k; 3114 return; 3115 } 3116 y.k = y.m(); 3117 var subPatches = []; 3118 _VirtualDom_diffHelp(x.k, y.k, subPatches, 0); 3119 subPatches.length > 0 && _VirtualDom_pushPatch(patches, 1, index, subPatches); 3120 return; 3121 3122 case 4: 3123 // gather nested taggers 3124 var xTaggers = x.j; 3125 var yTaggers = y.j; 3126 var nesting = false; 3127 3128 var xSubNode = x.k; 3129 while (xSubNode.$ === 4) 3130 { 3131 nesting = true; 3132 3133 typeof xTaggers !== 'object' 3134 ? xTaggers = [xTaggers, xSubNode.j] 3135 : xTaggers.push(xSubNode.j); 3136 3137 xSubNode = xSubNode.k; 3138 } 3139 3140 var ySubNode = y.k; 3141 while (ySubNode.$ === 4) 3142 { 3143 nesting = true; 3144 3145 typeof yTaggers !== 'object' 3146 ? yTaggers = [yTaggers, ySubNode.j] 3147 : yTaggers.push(ySubNode.j); 3148 3149 ySubNode = ySubNode.k; 3150 } 3151 3152 // Just bail if different numbers of taggers. This implies the 3153 // structure of the virtual DOM has changed. 3154 if (nesting && xTaggers.length !== yTaggers.length) 3155 { 3156 _VirtualDom_pushPatch(patches, 0, index, y); 3157 return; 3158 } 3159 3160 // check if taggers are "the same" 3161 if (nesting ? !_VirtualDom_pairwiseRefEqual(xTaggers, yTaggers) : xTaggers !== yTaggers) 3162 { 3163 _VirtualDom_pushPatch(patches, 2, index, yTaggers); 3164 } 3165 3166 // diff everything below the taggers 3167 _VirtualDom_diffHelp(xSubNode, ySubNode, patches, index + 1); 3168 return; 3169 3170 case 0: 3171 if (x.a !== y.a) 3172 { 3173 _VirtualDom_pushPatch(patches, 3, index, y.a); 3174 } 3175 return; 3176 3177 case 1: 3178 _VirtualDom_diffNodes(x, y, patches, index, _VirtualDom_diffKids); 3179 return; 3180 3181 case 2: 3182 _VirtualDom_diffNodes(x, y, patches, index, _VirtualDom_diffKeyedKids); 3183 return; 3184 3185 case 3: 3186 if (x.h !== y.h) 3187 { 3188 _VirtualDom_pushPatch(patches, 0, index, y); 3189 return; 3190 } 3191 3192 var factsDiff = _VirtualDom_diffFacts(x.d, y.d); 3193 factsDiff && _VirtualDom_pushPatch(patches, 4, index, factsDiff); 3194 3195 var patch = y.i(x.g, y.g); 3196 patch && _VirtualDom_pushPatch(patches, 5, index, patch); 3197 3198 return; 3199 } 3200} 3201 3202// assumes the incoming arrays are the same length 3203function _VirtualDom_pairwiseRefEqual(as, bs) 3204{ 3205 for (var i = 0; i < as.length; i++) 3206 { 3207 if (as[i] !== bs[i]) 3208 { 3209 return false; 3210 } 3211 } 3212 3213 return true; 3214} 3215 3216function _VirtualDom_diffNodes(x, y, patches, index, diffKids) 3217{ 3218 // Bail if obvious indicators have changed. Implies more serious 3219 // structural changes such that it's not worth it to diff. 3220 if (x.c !== y.c || x.f !== y.f) 3221 { 3222 _VirtualDom_pushPatch(patches, 0, index, y); 3223 return; 3224 } 3225 3226 var factsDiff = _VirtualDom_diffFacts(x.d, y.d); 3227 factsDiff && _VirtualDom_pushPatch(patches, 4, index, factsDiff); 3228 3229 diffKids(x, y, patches, index); 3230} 3231 3232 3233 3234// DIFF FACTS 3235 3236 3237// TODO Instead of creating a new diff object, it's possible to just test if 3238// there *is* a diff. During the actual patch, do the diff again and make the 3239// modifications directly. This way, there's no new allocations. Worth it? 3240function _VirtualDom_diffFacts(x, y, category) 3241{ 3242 var diff; 3243 3244 // look for changes and removals 3245 for (var xKey in x) 3246 { 3247 if (xKey === 'a1' || xKey === 'a0' || xKey === 'a3' || xKey === 'a4') 3248 { 3249 var subDiff = _VirtualDom_diffFacts(x[xKey], y[xKey] || {}, xKey); 3250 if (subDiff) 3251 { 3252 diff = diff || {}; 3253 diff[xKey] = subDiff; 3254 } 3255 continue; 3256 } 3257 3258 // remove if not in the new facts 3259 if (!(xKey in y)) 3260 { 3261 diff = diff || {}; 3262 diff[xKey] = 3263 !category 3264 ? (typeof x[xKey] === 'string' ? '' : null) 3265 : 3266 (category === 'a1') 3267 ? '' 3268 : 3269 (category === 'a0' || category === 'a3') 3270 ? undefined 3271 : 3272 { f: x[xKey].f, o: undefined }; 3273 3274 continue; 3275 } 3276 3277 var xValue = x[xKey]; 3278 var yValue = y[xKey]; 3279 3280 // reference equal, so don't worry about it 3281 if (xValue === yValue && xKey !== 'value' && xKey !== 'checked' 3282 || category === 'a0' && _VirtualDom_equalEvents(xValue, yValue)) 3283 {
3284 continue; 3285 } 3286 3287 diff = diff || {}; 3288 diff[xKey] = yValue; 3289 } 3290 3291 // add new stuff 3292 for (var yKey in y) 3293 { 3294 if (!(yKey in x)) 3295 { 3296 diff = diff || {}; 3297 diff[yKey] = y[yKey]; 3298 } 3299 } 3300 3301 return diff; 3302} 3303 3304 3305 3306// DIFF KIDS 3307 3308 3309function _VirtualDom_diffKids(xParent, yParent, patches, index) 3310{ 3311 var xKids = xParent.e; 3312 var yKids = yParent.e; 3313 3314 var xLen = xKids.length; 3315 var yLen = yKids.length; 3316 3317 // FIGURE OUT IF THERE ARE INSERTS OR REMOVALS 3318 3319 if (xLen > yLen) 3320 { 3321 _VirtualDom_pushPatch(patches, 6, index, { 3322 v: yLen, 3323 i: xLen - yLen 3324 }); 3325 } 3326 else if (xLen < yLen) 3327 { 3328 _VirtualDom_pushPatch(patches, 7, index, { 3329 v: xLen, 3330 e: yKids 3331 }); 3332 } 3333 3334 // PAIRWISE DIFF EVERYTHING ELSE 3335 3336 for (var minLen = xLen < yLen ? xLen : yLen, i = 0; i < minLen; i++) 3337 { 3338 var xKid = xKids[i]; 3339 _VirtualDom_diffHelp(xKid, yKids[i], patches, ++index); 3340 index += xKid.b || 0; 3341 } 3342} 3343 3344 3345 3346// KEYED DIFF 3347 3348 3349function _VirtualDom_diffKeyedKids(xParent, yParent, patches, rootIndex) 3350{ 3351 var localPatches = []; 3352 3353 var changes = {}; // Dict String Entry 3354 var inserts = []; // Array { index : Int, entry : Entry } 3355 // type Entry = { tag : String, vnode : VNode, index : Int, data : _ } 3356 3357 var xKids = xParent.e; 3358 var yKids = yParent.e; 3359 var xLen = xKids.length; 3360 var yLen = yKids.length; 3361 var xIndex = 0; 3362 var yIndex = 0; 3363 3364 var index = rootIndex; 3365 3366 while (xIndex < xLen && yIndex < yLen) 3367 { 3368 var x = xKids[xIndex]; 3369 var y = yKids[yIndex]; 3370 3371 var xKey = x.a; 3372 var yKey = y.a; 3373 var xNode = x.b; 3374 var yNode = y.b; 3375 3376 var newMatch = undefined; 3377 var oldMatch = undefined; 3378 3379 // check if keys match 3380 3381 if (xKey === yKey) 3382 { 3383 index++; 3384 _VirtualDom_diffHelp(xNode, yNode, localPatches, index); 3385 index += xNode.b || 0; 3386 3387 xIndex++; 3388 yIndex++; 3389 continue; 3390 } 3391 3392 // look ahead 1 to detect insertions and removals. 3393 3394 var xNext = xKids[xIndex + 1]; 3395 var yNext = yKids[yIndex + 1]; 3396 3397 if (xNext) 3398 { 3399 var xNextKey = xNext.a; 3400 var xNextNode = xNext.b; 3401 oldMatch = yKey === xNextKey; 3402 } 3403 3404 if (yNext) 3405 { 3406 var yNextKey = yNext.a; 3407 var yNextNode = yNext.b; 3408 newMatch = xKey === yNextKey; 3409 } 3410 3411 3412 // swap x and y 3413 if (newMatch && oldMatch) 3414 { 3415 index++; 3416 _VirtualDom_diffHelp(xNode, yNextNode, localPatches, index); 3417 _VirtualDom_insertNode(changes, localPatches, xKey, yNode, yIndex, inserts); 3418 index += xNode.b || 0; 3419 3420 index++; 3421 _VirtualDom_removeNode(changes, localPatches, xKey, xNextNode, index); 3422 index += xNextNode.b || 0; 3423 3424 xIndex += 2; 3425 yIndex += 2; 3426 continue; 3427 } 3428 3429 // insert y 3430 if (newMatch) 3431 { 3432 index++; 3433 _VirtualDom_insertNode(changes, localPatches, yKey, yNode, yIndex, inserts); 3434 _VirtualDom_diffHelp(xNode, yNextNode, localPatches, index); 3435 index += xNode.b || 0; 3436 3437 xIndex += 1; 3438 yIndex += 2; 3439 continue; 3440 } 3441 3442 // remove x 3443 if (oldMatch) 3444 { 3445 index++; 3446 _VirtualDom_removeNode(changes, localPatches, xKey, xNode, index); 3447 index += xNode.b || 0; 3448 3449 index++; 3450 _VirtualDom_diffHelp(xNextNode, yNode, localPatches, index); 3451 index += xNextNode.b || 0; 3452 3453 xIndex += 2; 3454 yIndex += 1; 3455 continue; 3456 } 3457 3458 // remove x, insert y 3459 if (xNext && xNextKey === yNextKey) 3460 { 3461 index++; 3462 _VirtualDom_removeNode(changes, localPatches, xKey, xNode, index); 3463 _VirtualDom_insertNode(changes, localPatches, yKey, yNode, yIndex, inserts); 3464 index += xNode.b || 0; 3465 3466 index++; 3467 _VirtualDom_diffHelp(xNextNode, yNextNode, localPatches, index); 3468 index += xNextNode.b || 0; 3469 3470 xIndex += 2; 3471 yIndex += 2; 3472 continue; 3473 } 3474 3475 break; 3476 } 3477 3478 // eat up any remaining nodes with removeNode and insertNode 3479 3480 while (xIndex < xLen) 3481 { 3482 index++; 3483 var x = xKids[xIndex]; 3484 var xNode = x.b; 3485 _VirtualDom_removeNode(changes, localPatches, x.a, xNode, index); 3486 index += xNode.b || 0; 3487 xIndex++; 3488 } 3489 3490 while (yIndex < yLen) 3491 { 3492 var endInserts = endInserts || []; 3493 var y = yKids[yIndex]; 3494 _VirtualDom_insertNode(changes, localPatches, y.a, y.b, undefined, endInserts); 3495 yIndex++; 3496 } 3497 3498 if (localPatches.length > 0 || inserts.length > 0 || endInserts) 3499 { 3500 _VirtualDom_pushPatch(patches, 8, rootIndex, { 3501 w: localPatches, 3502 x: inserts, 3503 y: endInserts 3504 }); 3505 } 3506} 3507 3508 3509 3510// CHANGES FROM KEYED DIFF 3511 3512 3513var _VirtualDom_POSTFIX = '_elmW6BL'; 3514 3515 3516function _VirtualDom_insertNode(changes, localPatches, key, vnode, yIndex, inserts) 3517{ 3518 var entry = changes[key]; 3519 3520 // never seen this key before
3521 if (!entry) 3522 { 3523 entry = { 3524 c: 0, 3525 z: vnode, 3526 r: yIndex, 3527 s: undefined 3528 }; 3529 3530 inserts.push({ r: yIndex, A: entry }); 3531 changes[key] = entry; 3532 3533 return; 3534 } 3535 3536 // this key was removed earlier, a match! 3537 if (entry.c === 1) 3538 { 3539 inserts.push({ r: yIndex, A: entry }); 3540 3541 entry.c = 2; 3542 var subPatches = []; 3543 _VirtualDom_diffHelp(entry.z, vnode, subPatches, entry.r); 3544 entry.r = yIndex; 3545 entry.s.s = { 3546 w: subPatches, 3547 A: entry 3548 }; 3549 3550 return; 3551 } 3552 3553 // this key has already been inserted or moved, a duplicate! 3554 _VirtualDom_insertNode(changes, localPatches, key + _VirtualDom_POSTFIX, vnode, yIndex, inserts); 3555} 3556 3557 3558function _VirtualDom_removeNode(changes, localPatches, key, vnode, index) 3559{ 3560 var entry = changes[key]; 3561 3562 // never seen this key before 3563 if (!entry) 3564 { 3565 var patch = _VirtualDom_pushPatch(localPatches, 9, index, undefined); 3566 3567 changes[key] = { 3568 c: 1, 3569 z: vnode, 3570 r: index, 3571 s: patch 3572 }; 3573 3574 return; 3575 } 3576 3577 // this key was inserted earlier, a match! 3578 if (entry.c === 0) 3579 { 3580 entry.c = 2; 3581 var subPatches = []; 3582 _VirtualDom_diffHelp(vnode, entry.z, subPatches, index); 3583 3584 _VirtualDom_pushPatch(localPatches, 9, index, { 3585 w: subPatches, 3586 A: entry 3587 }); 3588 3589 return; 3590 } 3591 3592 // this key has already been removed or moved, a duplicate! 3593 _VirtualDom_removeNode(changes, localPatches, key + _VirtualDom_POSTFIX, vnode, index); 3594} 3595 3596 3597 3598// ADD DOM NODES 3599// 3600// Each DOM node has an "index" assigned in order of traversal. It is important 3601// to minimize our crawl over the actual DOM, so these indexes (along with the 3602// descendantsCount of virtual nodes) let us skip touching entire subtrees of 3603// the DOM if we know there are no patches there. 3604 3605 3606function _VirtualDom_addDomNodes(domNode, vNode, patches, eventNode) 3607{ 3608 _VirtualDom_addDomNodesHelp(domNode, vNode, patches, 0, 0, vNode.b, eventNode); 3609} 3610 3611 3612// assumes `patches` is non-empty and indexes increase monotonically. 3613function _VirtualDom_addDomNodesHelp(domNode, vNode, patches, i, low, high, eventNode) 3614{ 3615 var patch = patches[i]; 3616 var index = patch.r; 3617 3618 while (index === low) 3619 { 3620 var patchType = patch.$; 3621 3622 if (patchType === 1) 3623 { 3624 _VirtualDom_addDomNodes(domNode, vNode.k, patch.s, eventNode); 3625 } 3626 else if (patchType === 8) 3627 { 3628 patch.t = domNode; 3629 patch.u = eventNode; 3630 3631 var subPatches = patch.s.w; 3632 if (subPatches.length > 0) 3633 { 3634 _VirtualDom_addDomNodesHelp(domNode, vNode, subPatches, 0, low, high, eventNode); 3635 } 3636 } 3637 else if (patchType === 9) 3638 { 3639 patch.t = domNode; 3640 patch.u = eventNode; 3641 3642 var data = patch.s; 3643 if (data) 3644 { 3645 data.A.s = domNode; 3646 var subPatches = data.w; 3647 if (subPatches.length > 0) 3648 { 3649 _VirtualDom_addDomNodesHelp(domNode, vNode, subPatches, 0, low, high, eventNode); 3650 } 3651 } 3652 } 3653 else 3654 { 3655 patch.t = domNode; 3656 patch.u = eventNode; 3657 } 3658 3659 i++; 3660 3661 if (!(patch = patches[i]) || (index = patch.r) > high) 3662 { 3663 return i; 3664 } 3665 } 3666 3667 var tag = vNode.$; 3668 3669 if (tag === 4) 3670 { 3671 var subNode = vNode.k; 3672 3673 while (subNode.$ === 4) 3674 { 3675 subNode = subNode.k; 3676 } 3677 3678 return _VirtualDom_addDomNodesHelp(domNode, subNode, patches, i, low + 1, high, domNode.elm_event_node_ref); 3679 } 3680 3681 // tag must be 1 or 2 at this point 3682 3683 var vKids = vNode.e; 3684 var childNodes = domNode.childNodes; 3685 for (var j = 0; j < vKids.length; j++) 3686 { 3687 low++; 3688 var vKid = tag === 1 ? vKids[j] : vKids[j].b; 3689 var nextLow = low + (vKid.b || 0); 3690 if (low <= index && index <= nextLow) 3691 { 3692 i = _VirtualDom_addDomNodesHelp(childNodes[j], vKid, patches, i, low, nextLow, eventNode); 3693 if (!(patch = patches[i]) || (index = patch.r) > high) 3694 { 3695 return i; 3696 } 3697 } 3698 low = nextLow; 3699 } 3700 return i; 3701} 3702 3703 3704 3705// APPLY PATCHES 3706 3707 3708function _VirtualDom_applyPatches(rootDomNode, oldVirtualNode, patches, eventNode) 3709{ 3710 if (patches.length === 0) 3711 { 3712 return rootDomNode; 3713 } 3714 3715 _VirtualDom_addDomNodes(rootDomNode, oldVirtualNode, patches, eventNode); 3716 return _VirtualDom_applyPatchesHelp(rootDomNode, patches); 3717} 3718 3719function _VirtualDom_applyPatchesHelp(rootDomNode, patches) 3720{ 3721 for (var i = 0; i < patches.length; i++) 3722 { 3723 var patch = patches[i]; 3724 var localDomNode = patch.t 3725 var newNode = _VirtualDom_applyPatch(localDomNode, patch); 3726 if (localDomNode === rootDomNode) 3727 { 3728 rootDomNode = newNode; 3729 } 3730 } 3731 return rootDomNode; 3732} 3733 3734function _VirtualDom_applyPatch(domNode, patch) 3735{ 3736 switch (patch.$) 3737 { 3738 case 0: 3739 return _VirtualDom_applyPatchRedraw(domNode, patch.s, patch.u); 3740 3741 case 4: 3742 _VirtualDom_applyFacts(domNode, patch.u, patch.s); 3743 return domNode; 3744 3745 case 3:
3746 domNode.replaceData(0, domNode.length, patch.s); 3747 return domNode; 3748 3749 case 1: 3750 return _VirtualDom_applyPatchesHelp(domNode, patch.s); 3751 3752 case 2: 3753 if (domNode.elm_event_node_ref) 3754 { 3755 domNode.elm_event_node_ref.j = patch.s; 3756 } 3757 else 3758 { 3759 domNode.elm_event_node_ref = { j: patch.s, p: patch.u }; 3760 } 3761 return domNode; 3762 3763 case 6: 3764 var data = patch.s; 3765 for (var i = 0; i < data.i; i++) 3766 { 3767 domNode.removeChild(domNode.childNodes[data.v]); 3768 } 3769 return domNode; 3770 3771 case 7: 3772 var data = patch.s; 3773 var kids = data.e; 3774 var i = data.v; 3775 var theEnd = domNode.childNodes[i]; 3776 for (; i < kids.length; i++) 3777 { 3778 domNode.insertBefore(_VirtualDom_render(kids[i], patch.u), theEnd); 3779 } 3780 return domNode; 3781 3782 case 9: 3783 var data = patch.s; 3784 if (!data) 3785 { 3786 domNode.parentNode.removeChild(domNode); 3787 return domNode; 3788 } 3789 var entry = data.A; 3790 if (typeof entry.r !== 'undefined') 3791 { 3792 domNode.parentNode.removeChild(domNode); 3793 } 3794 entry.s = _VirtualDom_applyPatchesHelp(domNode, data.w); 3795 return domNode; 3796 3797 case 8: 3798 return _VirtualDom_applyPatchReorder(domNode, patch); 3799 3800 case 5: 3801 return patch.s(domNode); 3802 3803 default: 3804 _Debug_crash(10); // 'Ran into an unknown patch!' 3805 } 3806} 3807 3808 3809function _VirtualDom_applyPatchRedraw(domNode, vNode, eventNode) 3810{ 3811 var parentNode = domNode.parentNode; 3812 var newNode = _VirtualDom_render(vNode, eventNode); 3813 3814 if (!newNode.elm_event_node_ref) 3815 { 3816 newNode.elm_event_node_ref = domNode.elm_event_node_ref; 3817 } 3818 3819 if (parentNode && newNode !== domNode) 3820 { 3821 parentNode.replaceChild(newNode, domNode); 3822 } 3823 return newNode; 3824} 3825 3826 3827function _VirtualDom_applyPatchReorder(domNode, patch) 3828{ 3829 var data = patch.s; 3830 3831 // remove end inserts 3832 var frag = _VirtualDom_applyPatchReorderEndInsertsHelp(data.y, patch); 3833 3834 // removals 3835 domNode = _VirtualDom_applyPatchesHelp(domNode, data.w); 3836 3837 // inserts 3838 var inserts = data.x; 3839 for (var i = 0; i < inserts.length; i++) 3840 { 3841 var insert = inserts[i]; 3842 var entry = insert.A; 3843 var node = entry.c === 2 3844 ? entry.s 3845 : _VirtualDom_render(entry.z, patch.u); 3846 domNode.insertBefore(node, domNode.childNodes[insert.r]); 3847 } 3848 3849 // add end inserts 3850 if (frag) 3851 { 3852 _VirtualDom_appendChild(domNode, frag); 3853 } 3854 3855 return domNode; 3856} 3857 3858 3859function _VirtualDom_applyPatchReorderEndInsertsHelp(endInserts, patch) 3860{ 3861 if (!endInserts) 3862 { 3863 return; 3864 } 3865 3866 var frag = _VirtualDom_doc.createDocumentFragment(); 3867 for (var i = 0; i < endInserts.length; i++) 3868 { 3869 var insert = endInserts[i]; 3870 var entry = insert.A; 3871 _VirtualDom_appendChild(frag, entry.c === 2 3872 ? entry.s 3873 : _VirtualDom_render(entry.z, patch.u) 3874 ); 3875 } 3876 return frag; 3877} 3878 3879 3880function _VirtualDom_virtualize(node) 3881{ 3882 // TEXT NODES 3883 3884 if (node.nodeType === 3) 3885 { 3886 return _VirtualDom_text(node.textContent); 3887 } 3888 3889 3890 // WEIRD NODES 3891 3892 if (node.nodeType !== 1) 3893 { 3894 return _VirtualDom_text(''); 3895 } 3896 3897 3898 // ELEMENT NODES 3899 3900 var attrList = _List_Nil; 3901 var attrs = node.attributes; 3902 for (var i = attrs.length; i--; ) 3903 { 3904 var attr = attrs[i]; 3905 var name = attr.name; 3906 var value = attr.value; 3907 attrList = _List_Cons( A2(_VirtualDom_attribute, name, value), attrList ); 3908 } 3909 3910 var tag = node.tagName.toLowerCase(); 3911 var kidList = _List_Nil; 3912 var kids = node.childNodes; 3913 3914 for (var i = kids.length; i--; ) 3915 { 3916 kidList = _List_Cons(_VirtualDom_virtualize(kids[i]), kidList); 3917 } 3918 return A3(_VirtualDom_node, tag, attrList, kidList); 3919} 3920 3921function _VirtualDom_dekey(keyedNode) 3922{ 3923 var keyedKids = keyedNode.e; 3924 var len = keyedKids.length; 3925 var kids = new Array(len); 3926 for (var i = 0; i < len; i++) 3927 { 3928 kids[i] = keyedKids[i].b; 3929 } 3930 3931 return { 3932 $: 1, 3933 c: keyedNode.c, 3934 d: keyedNode.d, 3935 e: kids, 3936 f: keyedNode.f, 3937 b: keyedNode.b 3938 }; 3939} 3940 3941 3942 3943 3944// ELEMENT 3945 3946 3947var _Debugger_element; 3948 3949var _Browser_element = _Debugger_element || F4(function(impl, flagDecoder, debugMetadata, args) 3950{ 3951 return _Platform_initialize( 3952 flagDecoder, 3953 args, 3954 impl.iZ, 3955 impl.q2, 3956 impl.qC, 3957 function(sendToApp, initialModel) { 3958 var view = impl.rb; 3959 /**/ 3960 var domNode = args['node']; 3961 //*/ 3962 /**_UNUSED/ 3963 var domNode = args && args['node'] ? args['node'] : _Debug_crash(0); 3964 //*/ 3965 var currNode = _VirtualDom_virtualize(domNode); 3966 3967 return _Browser_makeAnimator(initialModel, function(model) 3968 { 3969 var nextNode = view(model); 3970 var patches = _VirtualDom_diff(currNode, nextNode); 3971 domNode = _VirtualDom_applyPatches(domNode, currNode, patches, sendToApp); 3972 currNode = nextNode; 3973 }); 3974 } 3975 ); 3976}); 3977 3978 3979 3980// DOCUMENT 3981 3982 3983var _Debugger_document; 3984 3985var _Browser_document = _Debugger_document || F4(function(impl, flagDecoder, debugMetadata, args) 3986{ 3987 return _Platform_initialize( 3988 flagDecoder, 3989 args, 3990 impl.iZ, 3991 impl.q2, 3992 impl.qC, 3993 function(sendToApp, initialModel) { 3994 var divertHrefToApp = impl.hm && impl.hm(sendToApp) 3995 var view = impl.rb; 3996 var title = _VirtualDom_doc.title; 3997 var bodyNode = _VirtualDom_doc.body; 3998 var currNode = _VirtualDom_virtualize(bodyNode); 3999 return _Browser_makeAnimator(initialModel, function(model) 4000 { 4001 _VirtualDom_divertHrefToApp = divertHrefToApp; 4002 var doc = view(model); 4003 var nextNode = _VirtualDom_node('body')(_List_Nil)(doc.fY); 4004 var patches = _VirtualDom_diff(currNode, nextNode); 4005 bodyNode = _VirtualDom_applyPatches(bodyNode, currNode, patches, sendToApp); 4006 currNode = nextNode; 4007 _VirtualDom_divertHrefToApp = 0; 4008 (title !== doc.ba) && (_VirtualDom_doc.title = title = doc.ba); 4009 }); 4010 } 4011 ); 4012}); 4013 4014 4015 4016// ANIMATION 4017 4018 4019var _Browser_cancelAnimationFrame = 4020 typeof cancelAnimationFrame !== 'undefined' 4021 ? cancelAnimationFrame 4022 : function(id) { clearTimeout(id); }; 4023 4024var _Browser_requestAnimationFrame = 4025 typeof requestAnimationFrame !== 'undefined' 4026 ? requestAnimationFrame 4027 : function(callback) { return setTimeout(callback, 1000 / 60); }; 4028 4029 4030function _Browser_makeAnimator(model, draw) 4031{ 4032 draw(model); 4033 4034 var state = 0; 4035 4036 function updateIfNeeded() 4037 { 4038 state = state === 1 4039 ? 0 4040 : ( _Browser_requestAnimationFrame(updateIfNeeded), draw(model), 1 ); 4041 } 4042 4043 return function(nextModel, isSync) 4044 { 4045 model = nextModel; 4046 4047 isSync 4048 ? ( draw(model), 4049 state === 2 && (state = 1) 4050 ) 4051 : ( state === 0 && _Browser_requestAnimationFrame(updateIfNeeded), 4052 state = 2 4053 ); 4054 }; 4055} 4056 4057 4058 4059// APPLICATION 4060 4061 4062function _Browser_application(impl) 4063{ 4064 var onUrlChange = impl.pa; 4065 var onUrlRequest = impl.pb; 4066 var key = function() { key.a(onUrlChange(_Browser_getUrl())); }; 4067 4068 return _Browser_document({ 4069 hm: function(sendToApp) 4070 { 4071 key.a = sendToApp; 4072 _Browser_window.addEventListener('popstate', key); 4073 _Browser_window.navigator.userAgent.indexOf('Trident') < 0 || _Browser_window.addEventListener('hashchange', key); 4074 4075 return F2(function(domNode, event) 4076 { 4077 if (!event.ctrlKey && !event.metaKey && !event.shiftKey && event.button < 1 && !domNode.target && !domNode.hasAttribute('download')) 4078 { 4079 event.preventDefault(); 4080 var href = domNode.href; 4081 var curr = _Browser_getUrl(); 4082 var next = $elm$url$Url$fromString(href).a; 4083 sendToApp(onUrlRequest( 4084 (next 4085 && curr.jN === next.jN 4086 && curr.m5 === next.m5 4087 && curr.jH.a === next.jH.a 4088 ) 4089 ? $elm$browser$Browser$Internal(next) 4090 : $elm$browser$Browser$External(href) 4091 )); 4092 } 4093 }); 4094 }, 4095 iZ: function(flags) 4096 { 4097 return A3(impl.iZ, flags, _Browser_getUrl(), key); 4098 }, 4099 rb: impl.rb, 4100 q2: impl.q2,
4101 qC: impl.qC 4102 }); 4103} 4104 4105function _Browser_getUrl() 4106{ 4107 return $elm$url$Url$fromString(_VirtualDom_doc.location.href).a || _Debug_crash(1); 4108} 4109 4110var _Browser_go = F2(function(key, n) 4111{ 4112 return A2($elm$core$Task$perform, $elm$core$Basics$never, _Scheduler_binding(function() { 4113 n && history.go(n); 4114 key(); 4115 })); 4116}); 4117 4118var _Browser_pushUrl = F2(function(key, url) 4119{ 4120 return A2($elm$core$Task$perform, $elm$core$Basics$never, _Scheduler_binding(function() { 4121 history.pushState({}, '', url); 4122 key(); 4123 })); 4124}); 4125 4126var _Browser_replaceUrl = F2(function(key, url) 4127{ 4128 return A2($elm$core$Task$perform, $elm$core$Basics$never, _Scheduler_binding(function() { 4129 history.replaceState({}, '', url); 4130 key(); 4131 })); 4132}); 4133 4134 4135 4136// GLOBAL EVENTS 4137 4138 4139var _Browser_fakeNode = { addEventListener: function() {}, removeEventListener: function() {} }; 4140var _Browser_doc = typeof document !== 'undefined' ? document : _Browser_fakeNode; 4141var _Browser_window = typeof window !== 'undefined' ? window : _Browser_fakeNode; 4142 4143var _Browser_on = F3(function(node, eventName, sendToSelf) 4144{ 4145 return _Scheduler_spawn(_Scheduler_binding(function(callback) 4146 { 4147 function handler(event) { _Scheduler_rawSpawn(sendToSelf(event)); } 4148 node.addEventListener(eventName, handler, _VirtualDom_passiveSupported && { passive: true }); 4149 return function() { node.removeEventListener(eventName, handler); }; 4150 })); 4151}); 4152 4153var _Browser_decodeEvent = F2(function(decoder, event) 4154{ 4155 var result = _Json_runHelp(decoder, event); 4156 return $elm$core$Result$isOk(result) ? $elm$core$Maybe$Just(result.a) : $elm$core$Maybe$Nothing; 4157}); 4158 4159 4160 4161// PAGE VISIBILITY 4162 4163 4164function _Browser_visibilityInfo() 4165{ 4166 return (typeof _VirtualDom_doc.hidden !== 'undefined') 4167 ? { m2: 'hidden', lO: 'visibilitychange' } 4168 : 4169 (typeof _VirtualDom_doc.mozHidden !== 'undefined') 4170 ? { m2: 'mozHidden', lO: 'mozvisibilitychange' } 4171 : 4172 (typeof _VirtualDom_doc.msHidden !== 'undefined') 4173 ? { m2: 'msHidden', lO: 'msvisibilitychange' } 4174 : 4175 (typeof _VirtualDom_doc.webkitHidden !== 'undefined') 4176 ? { m2: 'webkitHidden', lO: 'webkitvisibilitychange' } 4177 : { m2: 'hidden', lO: 'visibilitychange' }; 4178} 4179 4180 4181 4182// ANIMATION FRAMES 4183 4184 4185function _Browser_rAF() 4186{ 4187 return _Scheduler_binding(function(callback) 4188 { 4189 var id = _Browser_requestAnimationFrame(function() { 4190 callback(_Scheduler_succeed(Date.now())); 4191 }); 4192 4193 return function() { 4194 _Browser_cancelAnimationFrame(id); 4195 }; 4196 }); 4197} 4198 4199 4200function _Browser_now() 4201{ 4202 return _Scheduler_binding(function(callback) 4203 { 4204 callback(_Scheduler_succeed(Date.now())); 4205 }); 4206} 4207 4208 4209 4210// DOM STUFF 4211 4212 4213function _Browser_withNode(id, doStuff) 4214{ 4215 return _Scheduler_binding(function(callback) 4216 { 4217 _Browser_requestAnimationFrame(function() { 4218 var node = document.getElementById(id); 4219 callback(node 4220 ? _Scheduler_succeed(doStuff(node)) 4221 : _Scheduler_fail($elm$browser$Browser$Dom$NotFound(id)) 4222 ); 4223 }); 4224 }); 4225} 4226 4227 4228function _Browser_withWindow(doStuff) 4229{ 4230 return _Scheduler_binding(function(callback) 4231 { 4232 _Browser_requestAnimationFrame(function() { 4233 callback(_Scheduler_succeed(doStuff())); 4234 }); 4235 }); 4236} 4237 4238 4239// FOCUS and BLUR 4240 4241 4242var _Browser_call = F2(function(functionName, id) 4243{ 4244 return _Browser_withNode(id, function(node) { 4245 node[functionName](); 4246 return _Utils_Tuple0; 4247 }); 4248}); 4249 4250 4251 4252// WINDOW VIEWPORT 4253 4254 4255function _Browser_getViewport() 4256{ 4257 return { 4258 ke: _Browser_getScene(), 4259 kU: { 4260 rm: _Browser_window.pageXOffset, 4261 k0: _Browser_window.pageYOffset, 4262 kZ: _Browser_doc.documentElement.clientWidth, 4263 mZ: _Browser_doc.documentElement.clientHeight 4264 } 4265 }; 4266} 4267 4268function _Browser_getScene() 4269{ 4270 var body = _Browser_doc.body; 4271 var elem = _Browser_doc.documentElement; 4272 return { 4273 kZ: Math.max(body.scrollWidth, body.offsetWidth, elem.scrollWidth, elem.offsetWidth, elem.clientWidth), 4274 mZ: Math.max(body.scrollHeight, body.offsetHeight, elem.scrollHeight, elem.offsetHeight, elem.clientHeight) 4275 }; 4276} 4277 4278var _Browser_setViewport = F2(function(x, y) 4279{ 4280 return _Browser_withWindow(function() 4281 { 4282 _Browser_window.scroll(x, y); 4283 return _Utils_Tuple0; 4284 }); 4285}); 4286 4287 4288 4289// ELEMENT VIEWPORT 4290 4291 4292function _Browser_getViewportOf(id) 4293{ 4294 return _Browser_withNode(id, function(node) 4295 { 4296 return { 4297 ke: { 4298 kZ: node.scrollWidth, 4299 mZ: node.scrollHeight 4300 }, 4301 kU: { 4302 rm: node.scrollLeft, 4303 k0: node.scrollTop, 4304 kZ: node.clientWidth, 4305 mZ: node.clientHeight 4306 } 4307 }; 4308 }); 4309} 4310 4311 4312var _Browser_setViewportOf = F3(function(id, x, y) 4313{ 4314 return _Browser_withNode(id, function(node) 4315 { 4316 node.scrollLeft = x; 4317 node.scrollTop = y; 4318 return _Utils_Tuple0; 4319 }); 4320}); 4321 4322 4323 4324// ELEMENT 4325 4326 4327function _Browser_getElement(id) 4328{ 4329 return _Browser_withNode(id, function(node) 4330 {
4331 var rect = node.getBoundingClientRect(); 4332 var x = _Browser_window.pageXOffset; 4333 var y = _Browser_window.pageYOffset; 4334 return { 4335 ke: _Browser_getScene(), 4336 kU: { 4337 rm: x, 4338 k0: y, 4339 kZ: _Browser_doc.documentElement.clientWidth, 4340 mZ: _Browser_doc.documentElement.clientHeight 4341 }, 4342 mr: { 4343 rm: x + rect.left, 4344 k0: y + rect.top, 4345 kZ: rect.width, 4346 mZ: rect.height 4347 } 4348 }; 4349 }); 4350} 4351 4352 4353 4354// LOAD and RELOAD 4355 4356 4357function _Browser_reload(skipCache) 4358{ 4359 return A2($elm$core$Task$perform, $elm$core$Basics$never, _Scheduler_binding(function(callback) 4360 { 4361 _VirtualDom_doc.location.reload(skipCache); 4362 })); 4363} 4364 4365function _Browser_load(url) 4366{ 4367 return A2($elm$core$Task$perform, $elm$core$Basics$never, _Scheduler_binding(function(callback) 4368 { 4369 try 4370 { 4371 _Browser_window.location = url; 4372 } 4373 catch(err) 4374 { 4375 // Only Firefox can throw a NS_ERROR_MALFORMED_URI exception here. 4376 // Other browsers reload the page, so let's be consistent about that. 4377 _VirtualDom_doc.location.reload(false); 4378 } 4379 })); 4380} 4381 4382 4383function _Url_percentEncode(string) 4384{ 4385 return encodeURIComponent(string); 4386} 4387 4388function _Url_percentDecode(string) 4389{ 4390 try 4391 { 4392 return $elm$core$Maybe$Just(decodeURIComponent(string)); 4393 } 4394 catch (e) 4395 { 4396 return $elm$core$Maybe$Nothing; 4397 } 4398} 4399 4400 4401function _Time_now(millisToPosix) 4402{ 4403 return _Scheduler_binding(function(callback) 4404 { 4405 callback(_Scheduler_succeed(millisToPosix(Date.now()))); 4406 }); 4407} 4408 4409var _Time_setInterval = F2(function(interval, task) 4410{ 4411 return _Scheduler_binding(function(callback) 4412 { 4413 var id = setInterval(function() { _Scheduler_rawSpawn(task); }, interval); 4414 return function() { clearInterval(id); }; 4415 }); 4416}); 4417 4418function _Time_here() 4419{ 4420 return _Scheduler_binding(function(callback) 4421 { 4422 callback(_Scheduler_succeed( 4423 A2($elm$time$Time$customZone, -(new Date().getTimezoneOffset()), _List_Nil) 4424 )); 4425 }); 4426} 4427 4428 4429function _Time_getZoneName() 4430{ 4431 return _Scheduler_binding(function(callback) 4432 { 4433 try 4434 { 4435 var name = $elm$time$Time$Name(Intl.DateTimeFormat().resolvedOptions().timeZone); 4436 } 4437 catch (e) 4438 { 4439 var name = $elm$time$Time$Offset(new Date().getTimezoneOffset()); 4440 } 4441 callback(_Scheduler_succeed(name)); 4442 }); 4443} 4444 4445 4446 4447var _Bitwise_and = F2(function(a, b) 4448{ 4449 return a & b; 4450}); 4451 4452var _Bitwise_or = F2(function(a, b) 4453{ 4454 return a | b; 4455}); 4456 4457var _Bitwise_xor = F2(function(a, b) 4458{ 4459 return a ^ b; 4460}); 4461 4462function _Bitwise_complement(a) 4463{ 4464 return ~a; 4465}; 4466 4467var _Bitwise_shiftLeftBy = F2(function(offset, a) 4468{ 4469 return a << offset; 4470}); 4471 4472var _Bitwise_shiftRightBy = F2(function(offset, a) 4473{ 4474 return a >> offset; 4475}); 4476 4477var _Bitwise_shiftRightZfBy = F2(function(offset, a) 4478{ 4479 return a >>> offset; 4480}); 4481 4482 4483// BYTES 4484 4485function _Bytes_width(bytes) 4486{ 4487 return bytes.byteLength; 4488} 4489 4490var _Bytes_getHostEndianness = F2(function(le, be) 4491{ 4492 return _Scheduler_binding(function(callback) 4493 { 4494 callback(_Scheduler_succeed(new Uint8Array(new Uint32Array([1]))[0] === 1 ? le : be)); 4495 }); 4496}); 4497 4498 4499// ENCODERS 4500 4501function _Bytes_encode(encoder) 4502{ 4503 var mutableBytes = new DataView(new ArrayBuffer($elm$bytes$Bytes$Encode$getWidth(encoder))); 4504 $elm$bytes$Bytes$Encode$write(encoder)(mutableBytes)(0); 4505 return mutableBytes; 4506} 4507 4508 4509// SIGNED INTEGERS 4510 4511var _Bytes_write_i8 = F3(function(mb, i, n) { mb.setInt8(i, n); return i + 1; }); 4512var _Bytes_write_i16 = F4(function(mb, i, n, isLE) { mb.setInt16(i, n, isLE); return i + 2; }); 4513var _Bytes_write_i32 = F4(function(mb, i, n, isLE) { mb.setInt32(i, n, isLE); return i + 4; }); 4514 4515 4516// UNSIGNED INTEGERS 4517 4518var _Bytes_write_u8 = F3(function(mb, i, n) { mb.setUint8(i, n); return i + 1 ;}); 4519var _Bytes_write_u16 = F4(function(mb, i, n, isLE) { mb.setUint16(i, n, isLE); return i + 2; }); 4520var _Bytes_write_u32 = F4(function(mb, i, n, isLE) { mb.setUint32(i, n, isLE); return i + 4; }); 4521 4522 4523// FLOATS 4524 4525var _Bytes_write_f32 = F4(function(mb, i, n, isLE) { mb.setFloat32(i, n, isLE); return i + 4; }); 4526var _Bytes_write_f64 = F4(function(mb, i, n, isLE) { mb.setFloat64(i, n, isLE); return i + 8; }); 4527 4528 4529// BYTES 4530 4531var _Bytes_write_bytes = F3(function(mb, offset, bytes) 4532{ 4533 for (var i = 0, len = bytes.byteLength, limit = len - 4; i <= limit; i += 4) 4534 { 4535 mb.setUint32(offset + i, bytes.getUint32(i)); 4536 } 4537 for (; i < len; i++) 4538 { 4539 mb.setUint8(offset + i, bytes.getUint8(i)); 4540 } 4541 return offset + len; 4542}); 4543 4544 4545// STRINGS 4546 4547function _Bytes_getStringWidth(string) 4548{ 4549 for (var width = 0, i = 0; i < string.length; i++) 4550 { 4551 var code = string.charCodeAt(i); 4552 width += 4553 (code < 0x80) ? 1 : 4554 (code < 0x800) ? 2 : 4555 (code < 0xD800 || 0xDBFF < code) ? 3 : (i++, 4); 4556 } 4557 return width; 4558} 4559 4560var _Bytes_write_string = F3(function(mb, offset, string) 4561{ 4562 for (var i = 0; i < string.length; i++) 4563 { 4564 var code = string.charCodeAt(i); 4565 offset += 4566 (code < 0x80) 4567 ? (mb.setUint8(offset, code) 4568 , 1 4569 ) 4570 : 4571 (code < 0x800) 4572 ? (mb.setUint16(offset, 0xC080 /* 0b1100000010000000 */ 4573 | (code >>> 6 & 0x1F /* 0b00011111 */) << 8 4574 | code & 0x3F /* 0b00111111 */) 4575 , 2 4576 ) 4577 : 4578 (code < 0xD800 || 0xDBFF < code) 4579 ? (mb.setUint16(offset, 0xE080 /* 0b1110000010000000 */ 4580 | (code >>> 12 & 0xF /* 0b00001111 */) << 8 4581 | code >>> 6 & 0x3F /* 0b00111111 */) 4582 , mb.setUint8(offset + 2, 0x80 /* 0b10000000 */ 4583 | code & 0x3F /* 0b00111111 */) 4584 , 3 4585 ) 4586 : 4587 (code = (code - 0xD800) * 0x400 + string.charCodeAt(++i) - 0xDC00 + 0x10000 4588 , mb.setUint32(offset, 0xF0808080 /* 0b11110000100000001000000010000000 */ 4589 | (code >>> 18 & 0x7 /* 0b00000111 */) << 24 4590 | (code >>> 12 & 0x3F /* 0b00111111 */) << 16 4591 | (code >>> 6 & 0x3F /* 0b00111111 */) << 8 4592 | code & 0x3F /* 0b00111111 */) 4593 , 4 4594 ); 4595 } 4596 return offset; 4597}); 4598 4599 4600// DECODER 4601 4602var _Bytes_decode = F2(function(decoder, bytes) 4603{ 4604 try { 4605 return $elm$core$Maybe$Just(A2(decoder, bytes, 0).b); 4606 } catch(e) { 4607 return $elm$core$Maybe$Nothing; 4608 } 4609}); 4610 4611var _Bytes_read_i8 = F2(function( bytes, offset) { return _Utils_Tuple2(offset + 1, bytes.getInt8(offset)); }); 4612var _Bytes_read_i16 = F3(function(isLE, bytes, offset) { return _Utils_Tuple2(offset + 2, bytes.getInt16(offset, isLE)); }); 4613var _Bytes_read_i32 = F3(function(isLE, bytes, offset) { return _Utils_Tuple2(offset + 4, bytes.getInt32(offset, isLE)); }); 4614var _Bytes_read_u8 = F2(function( bytes, offset) { return _Utils_Tuple2(offset + 1, bytes.getUint8(offset)); }); 4615var _Bytes_read_u16 = F3(function(isLE, bytes, offset) { return _Utils_Tuple2(offset + 2, bytes.getUint16(offset, isLE)); }); 4616var _Bytes_read_u32 = F3(function(isLE, bytes, offset) { return _Utils_Tuple2(offset + 4, bytes.getUint32(offset, isLE)); }); 4617var _Bytes_read_f32 = F3(function(isLE, bytes, offset) { return _Utils_Tuple2(offset + 4, bytes.getFloat32(offset, isLE)); }); 4618var _Bytes_read_f64 = F3(function(isLE, bytes, offset) { return _Utils_Tuple2(offset + 8, bytes.getFloat64(offset, isLE)); }); 4619 4620var _Bytes_read_bytes = F3(function(len, bytes, offset) 4621{ 4622 return _Utils_Tuple2(offset + len, new DataView(bytes.buffer, bytes.byteOffset + offset, len)); 4623}); 4624 4625var _Bytes_read_string = F3(function(len, bytes, offset) 4626{ 4627 var string = ''; 4628 var end = offset + len; 4629 for (; offset < end;) 4630 { 4631 var byte = bytes.getUint8(offset++); 4632 string += 4633 (byte < 128) 4634 ? String.fromCharCode(byte) 4635 : 4636 ((byte & 0xE0 /* 0b11100000 */) === 0xC0 /* 0b11000000 */) 4637 ? String.fromCharCode((byte & 0x1F /* 0b00011111 */) << 6 | bytes.getUint8(offset++) & 0x3F /* 0b00111111 */) 4638 : 4639 ((byte & 0xF0 /* 0b11110000 */) === 0xE0 /* 0b11100000 */) 4640 ? String.fromCharCode( 4641 (byte & 0xF /* 0b00001111 */) << 12 4642 | (bytes.getUint8(offset++) & 0x3F /* 0b00111111 */) << 6 4643 | bytes.getUint8(offset++) & 0x3F /* 0b00111111 */ 4644 ) 4645 : 4646 (byte = 4647 ((byte & 0x7 /* 0b00000111 */) << 18 4648 | (bytes.getUint8(offset++) & 0x3F /* 0b00111111 */) << 12 4649 | (bytes.getUint8(offset++) & 0x3F /* 0b00111111 */) << 6 4650 | bytes.getUint8(offset++) & 0x3F /* 0b00111111 */ 4651 ) - 0x10000 4652 , String.fromCharCode(Math.floor(byte / 0x400) + 0xD800, byte % 0x400 + 0xDC00) 4653 ); 4654 } 4655 return _Utils_Tuple2(offset, string); 4656}); 4657 4658var _Bytes_decodeFailure = F2(function() { throw 0; }); 4659 4660 4661 4662// DECODER 4663 4664var _File_decoder = _Json_decodePrim(function(value) { 4665 // NOTE: checks if `File` exists in case this is run on node 4666 return (typeof File !== 'undefined' && value instanceof File) 4667 ? $elm$core$Result$Ok(value) 4668 : _Json_expecting('a FILE', value); 4669}); 4670 4671 4672// METADATA 4673 4674function _File_name(file) { return file.name; } 4675function _File_mime(file) { return file.type; } 4676function _File_size(file) { return file.size; } 4677 4678function _File_lastModified(file) 4679{ 4680 return $elm$time$Time$millisToPosix(file.lastModified); 4681} 4682 4683 4684// DOWNLOAD 4685 4686var _File_downloadNode; 4687 4688function _File_getDownloadNode() 4689{ 4690 return _File_downloadNode || (_File_downloadNode = document.createElement('a')); 4691} 4692 4693var _File_download = F3(function(name, mime, content) 4694{ 4695 return _Scheduler_binding(function(callback) 4696 { 4697 var blob = new Blob([content], {type: mime}); 4698 4699 // for IE10+ 4700 if (navigator.msSaveOrOpenBlob) 4701 { 4702 navigator.msSaveOrOpenBlob(blob, name); 4703 return; 4704 } 4705 4706 // for HTML5 4707 var node = _File_getDownloadNode(); 4708 var objectUrl = URL.createObjectURL(blob); 4709 node.href = objectUrl;
4710 node.download = name; 4711 _File_click(node); 4712 URL.revokeObjectURL(objectUrl); 4713 }); 4714}); 4715 4716function _File_downloadUrl(href) 4717{ 4718 return _Scheduler_binding(function(callback) 4719 { 4720 var node = _File_getDownloadNode(); 4721 node.href = href; 4722 node.download = ''; 4723 node.origin === location.origin || (node.target = '_blank'); 4724 _File_click(node); 4725 }); 4726} 4727 4728 4729// IE COMPATIBILITY 4730 4731function _File_makeBytesSafeForInternetExplorer(bytes) 4732{ 4733 // only needed by IE10 and IE11 to fix https://github.com/elm/file/issues/10 4734 // all other browsers can just run `new Blob([bytes])` directly with no problem 4735 // 4736 return new Uint8Array(bytes.buffer, bytes.byteOffset, bytes.byteLength); 4737} 4738 4739function _File_click(node) 4740{ 4741 // only needed by IE10 and IE11 to fix https://github.com/elm/file/issues/11 4742 // all other browsers have MouseEvent and do not need this conditional stuff 4743 // 4744 if (typeof MouseEvent === 'function') 4745 { 4746 node.dispatchEvent(new MouseEvent('click')); 4747 } 4748 else 4749 { 4750 var event = document.createEvent('MouseEvents'); 4751 event.initMouseEvent('click', true, true, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null); 4752 document.body.appendChild(node); 4753 node.dispatchEvent(event); 4754 document.body.removeChild(node); 4755 } 4756} 4757 4758 4759// UPLOAD 4760 4761var _File_node; 4762 4763function _File_uploadOne(mimes) 4764{ 4765 return _Scheduler_binding(function(callback) 4766 { 4767 _File_node = document.createElement('input'); 4768 _File_node.type = 'file'; 4769 _File_node.accept = A2($elm$core$String$join, ',', mimes); 4770 _File_node.addEventListener('change', function(event) 4771 { 4772 callback(_Scheduler_succeed(event.target.files[0])); 4773 }); 4774 _File_click(_File_node); 4775 }); 4776} 4777 4778function _File_uploadOneOrMore(mimes) 4779{ 4780 return _Scheduler_binding(function(callback) 4781 { 4782 _File_node = document.createElement('input'); 4783 _File_node.type = 'file'; 4784 _File_node.multiple = true; 4785 _File_node.accept = A2($elm$core$String$join, ',', mimes); 4786 _File_node.addEventListener('change', function(event) 4787 { 4788 var elmFiles = _List_fromArray(event.target.files); 4789 callback(_Scheduler_succeed(_Utils_Tuple2(elmFiles.a, elmFiles.b))); 4790 }); 4791 _File_click(_File_node); 4792 }); 4793} 4794 4795 4796// CONTENT 4797 4798function _File_toString(blob) 4799{ 4800 return _Scheduler_binding(function(callback) 4801 { 4802 var reader = new FileReader(); 4803 reader.addEventListener('loadend', function() { 4804 callback(_Scheduler_succeed(reader.result)); 4805 }); 4806 reader.readAsText(blob); 4807 return function() { reader.abort(); }; 4808 }); 4809} 4810 4811function _File_toBytes(blob) 4812{ 4813 return _Scheduler_binding(function(callback) 4814 { 4815 var reader = new FileReader(); 4816 reader.addEventListener('loadend', function() { 4817 callback(_Scheduler_succeed(new DataView(reader.result))); 4818 }); 4819 reader.readAsArrayBuffer(blob); 4820 return function() { reader.abort(); }; 4821 }); 4822} 4823 4824function _File_toUrl(blob) 4825{ 4826 return _Scheduler_binding(function(callback) 4827 { 4828 var reader = new FileReader(); 4829 reader.addEventListener('loadend', function() { 4830 callback(_Scheduler_succeed(reader.result)); 4831 }); 4832 reader.readAsDataURL(blob); 4833 return function() { reader.abort(); }; 4834 }); 4835} 4836 4837 4838 4839// CREATE 4840 4841var _Regex_never = /.^/; 4842 4843var _Regex_fromStringWith = F2(function(options, string) 4844{ 4845 var flags = 'g'; 4846 if (options.nY) { flags += 'm'; } 4847 if (options.lN) { flags += 'i'; } 4848 4849 try 4850 { 4851 return $elm$core$Maybe$Just(new RegExp(string, flags)); 4852 } 4853 catch(error) 4854 { 4855 return $elm$core$Maybe$Nothing; 4856 } 4857}); 4858 4859 4860// USE 4861 4862var _Regex_contains = F2(function(re, string) 4863{ 4864 return string.match(re) !== null; 4865}); 4866 4867 4868var _Regex_findAtMost = F3(function(n, re, str) 4869{ 4870 var out = []; 4871 var number = 0; 4872 var string = str; 4873 var lastIndex = re.lastIndex; 4874 var prevLastIndex = -1; 4875 var result; 4876 while (number++ < n && (result = re.exec(string))) 4877 { 4878 if (prevLastIndex == re.lastIndex) break; 4879 var i = result.length - 1; 4880 var subs = new Array(i); 4881 while (i > 0) 4882 { 4883 var submatch = result[i]; 4884 subs[--i] = submatch 4885 ? $elm$core$Maybe$Just(submatch) 4886 : $elm$core$Maybe$Nothing; 4887 } 4888 out.push(A4($elm$regex$Regex$Match, result[0], result.index, number, _List_fromArray(subs))); 4889 prevLastIndex = re.lastIndex; 4890 } 4891 re.lastIndex = lastIndex; 4892 return _List_fromArray(out); 4893}); 4894 4895 4896var _Regex_replaceAtMost = F4(function(n, re, replacer, string) 4897{ 4898 var count = 0; 4899 function jsReplacer(match) 4900 { 4901 if (count++ >= n) 4902 { 4903 return match; 4904 } 4905 var i = arguments.length - 3; 4906 var submatches = new Array(i); 4907 while (i > 0) 4908 { 4909 var submatch = arguments[i]; 4910 submatches[--i] = submatch 4911 ? $elm$core$Maybe$Just(submatch) 4912 : $elm$core$Maybe$Nothing; 4913 } 4914 return replacer(A4($elm$regex$Regex$Match, match, arguments[arguments.length - 2], count, _List_fromArray(submatches))); 4915 } 4916 return string.replace(re, jsReplacer); 4917}); 4918 4919var _Regex_splitAtMost = F3(function(n, re, str) 4920{ 4921 var string = str; 4922 var out = []; 4923 var start = re.lastIndex; 4924 var restoreLastIndex = re.lastIndex; 4925 while (n--) 4926 { 4927 var result = re.exec(string); 4928 if (!result) break; 4929 out.push(string.slice(start, result.index)); 4930 start = re.lastIndex; 4931 } 4932 out.push(string.slice(start)); 4933 re.lastIndex = restoreLastIndex; 4934 return _List_fromArray(out); 4935}); 4936 4937var _Regex_infinity = Infinity; 4938var $elm$core$List$cons = _List_cons; 4939var $elm$core$Elm$JsArray$foldr = _JsArray_foldr; 4940var $elm$core$Array$foldr = F3(
4941 function (func, baseCase, _v0) { 4942 var tree = _v0.c; 4943 var tail = _v0.d; 4944 var helper = F2( 4945 function (node, acc) { 4946 if (!node.$) { 4947 var subTree = node.a; 4948 return A3($elm$core$Elm$JsArray$foldr, helper, acc, subTree); 4949 } else { 4950 var values = node.a; 4951 return A3($elm$core$Elm$JsArray$foldr, func, acc, values); 4952 } 4953 }); 4954 return A3( 4955 $elm$core$Elm$JsArray$foldr, 4956 helper, 4957 A3($elm$core$Elm$JsArray$foldr, func, baseCase, tail), 4958 tree); 4959 }); 4960var $elm$core$Array$toList = function (array) { 4961 return A3($elm$core$Array$foldr, $elm$core$List$cons, _List_Nil, array); 4962}; 4963var $elm$core$Dict$foldr = F3( 4964 function (func, acc, t) { 4965 foldr: 4966 while (true) { 4967 if (t.$ === -2) { 4968 return acc; 4969 } else { 4970 var key = t.b; 4971 var value = t.c; 4972 var left = t.d; 4973 var right = t.e; 4974 var $temp$func = func, 4975 $temp$acc = A3( 4976 func, 4977 key, 4978 value, 4979 A3($elm$core$Dict$foldr, func, acc, right)), 4980 $temp$t = left; 4981 func = $temp$func; 4982 acc = $temp$acc; 4983 t = $temp$t; 4984 continue foldr; 4985 } 4986 } 4987 }); 4988var $elm$core$Dict$toList = function (dict) { 4989 return A3( 4990 $elm$core$Dict$foldr, 4991 F3( 4992 function (key, value, list) { 4993 return A2( 4994 $elm$core$List$cons, 4995 _Utils_Tuple2(key, value), 4996 list); 4997 }), 4998 _List_Nil, 4999 dict); 5000}; 5001var $elm$core$Dict$keys = function (dict) { 5002 return A3( 5003 $elm$core$Dict$foldr, 5004 F3( 5005 function (key, value, keyList) { 5006 return A2($elm$core$List$cons, key, keyList); 5007 }), 5008 _List_Nil, 5009 dict); 5010}; 5011var $elm$core$Set$toList = function (_v0) { 5012 var dict = _v0; 5013 return $elm$core$Dict$keys(dict); 5014}; 5015var $elm$core$Basics$EQ = 1; 5016var $elm$core$Basics$GT = 2; 5017var $elm$core$Basics$LT = 0; 5018var $elm$core$Result$Err = function (a) { 5019 return {$: 1, a: a}; 5020}; 5021var $elm$json$Json$Decode$Failure = F2( 5022 function (a, b) { 5023 return {$: 3, a: a, b: b}; 5024 }); 5025var $elm$json$Json$Decode$Field = F2( 5026 function (a, b) { 5027 return {$: 0, a: a, b: b}; 5028 }); 5029var $elm$json$Json$Decode$Index = F2( 5030 function (a, b) { 5031 return {$: 1, a: a, b: b}; 5032 }); 5033var $elm$core$Result$Ok = function (a) { 5034 return {$: 0, a: a}; 5035}; 5036var $elm$json$Json$Decode$OneOf = function (a) { 5037 return {$: 2, a: a}; 5038}; 5039var $elm$core$Basics$False = 1; 5040var $elm$core$Basics$add = _Basics_add; 5041var $elm$core$Maybe$Just = function (a) { 5042 return {$: 0, a: a}; 5043}; 5044var $elm$core$Maybe$Nothing = {$: 1}; 5045var $elm$core$String$all = _String_all; 5046var $elm$core$Basics$and = _Basics_and; 5047var $elm$core$Basics$append = _Utils_append; 5048var $elm$json$Json$Encode$encode = _Json_encode;
5049var $elm$core$String$fromInt = _String_fromNumber; 5050var $elm$core$String$join = F2( 5051 function (sep, chunks) { 5052 return A2( 5053 _String_join, 5054 sep, 5055 _List_toArray(chunks)); 5056 }); 5057var $elm$core$String$split = F2( 5058 function (sep, string) { 5059 return _List_fromArray( 5060 A2(_String_split, sep, string)); 5061 }); 5062var $elm$json$Json$Decode$indent = function (str) { 5063 return A2( 5064 $elm$core$String$join, 5065 '\n ', 5066 A2($elm$core$String$split, '\n', str)); 5067}; 5068var $elm$core$List$foldl = F3( 5069 function (func, acc, list) { 5070 foldl: 5071 while (true) { 5072 if (!list.b) { 5073 return acc; 5074 } else { 5075 var x = list.a; 5076 var xs = list.b; 5077 var $temp$func = func, 5078 $temp$acc = A2(func, x, acc), 5079 $temp$list = xs; 5080 func = $temp$func; 5081 acc = $temp$acc; 5082 list = $temp$list; 5083 continue foldl; 5084 } 5085 } 5086 }); 5087var $elm$core$List$length = function (xs) { 5088 return A3( 5089 $elm$core$List$foldl, 5090 F2( 5091 function (_v0, i) { 5092 return i + 1; 5093 }), 5094 0, 5095 xs); 5096}; 5097var $elm$core$List$map2 = _List_map2; 5098var $elm$core$Basics$le = _Utils_le; 5099var $elm$core$Basics$sub = _Basics_sub; 5100var $elm$core$List$rangeHelp = F3( 5101 function (lo, hi, list) { 5102 rangeHelp: 5103 while (true) { 5104 if (_Utils_cmp(lo, hi) < 1) { 5105 var $temp$lo = lo, 5106 $temp$hi = hi - 1, 5107 $temp$list = A2($elm$core$List$cons, hi, list); 5108 lo = $temp$lo; 5109 hi = $temp$hi; 5110 list = $temp$list; 5111 continue rangeHelp; 5112 } else { 5113 return list; 5114 } 5115 } 5116 }); 5117var $elm$core$List$range = F2( 5118 function (lo, hi) { 5119 return A3($elm$core$List$rangeHelp, lo, hi, _List_Nil); 5120 }); 5121var $elm$core$List$indexedMap = F2( 5122 function (f, xs) { 5123 return A3( 5124 $elm$core$List$map2, 5125 f, 5126 A2( 5127 $elm$core$List$range, 5128 0, 5129 $elm$core$List$length(xs) - 1), 5130 xs); 5131 }); 5132var $elm$core$Char$toCode = _Char_toCode; 5133var $elm$core$Char$isLower = function (_char) { 5134 var code = $elm$core$Char$toCode(_char); 5135 return (97 <= code) && (code <= 122); 5136}; 5137var $elm$core$Char$isUpper = function (_char) { 5138 var code = $elm$core$Char$toCode(_char); 5139 return (code <= 90) && (65 <= code); 5140}; 5141var $elm$core$Basics$or = _Basics_or; 5142var $elm$core$Char$isAlpha = function (_char) { 5143 return $elm$core$Char$isLower(_char) || $elm$core$Char$isUpper(_char); 5144}; 5145var $elm$core$Char$isDigit = function (_char) { 5146 var code = $elm$core$Char$toCode(_char); 5147 return (code <= 57) && (48 <= code); 5148}; 5149var $elm$core$Char$isAlphaNum = function (_char) { 5150 return $elm$core$Char$isLower(_char) || ($elm$core$Char$isUpper(_char) || $elm$core$Char$isDigit(_char)); 5151}; 5152var $elm$core$List$reverse = function (list) { 5153 return A3($elm$core$List$foldl, $elm$core$List$cons, _List_Nil, list); 5154}; 5155var $elm$core$String$uncons = _String_uncons; 5156var $elm$json$Json$Decode$errorOneOf = F2( 5157 function (i, error) { 5158 return '\n\n(' + ($elm$core$String$fromInt(i + 1) + (') ' + $elm$json$Json$Decode$indent( 5159 $elm$json$Json$Decode$errorToString(error)))); 5160 }); 5161var $elm$json$Json$Decode$errorToString = function (error) { 5162 return A2($elm$json$Json$Decode$errorToStringHelp, error, _List_Nil); 5163}; 5164var $elm$json$Json$Decode$errorToStringHelp = F2( 5165 function (error, context) { 5166 errorToStringHelp: 5167 while (true) { 5168 switch (error.$) { 5169 case 0: 5170 var f = error.a; 5171 var err = error.b; 5172 var isSimple = function () { 5173 var _v1 = $elm$core$String$uncons(f); 5174 if (_v1.$ === 1) { 5175 return false; 5176 } else { 5177 var _v2 = _v1.a; 5178 var _char = _v2.a; 5179 var rest = _v2.b; 5180 return $elm$core$Char$isAlpha(_char) && A2($elm$core$String$all, $elm$core$Char$isAlphaNum, rest); 5181 } 5182 }(); 5183 var fieldName = isSimple ? ('.' + f) : ('[\'' + (f + '\']')); 5184 var $temp$error = err, 5185 $temp$context = A2($elm$core$List$cons, fieldName, context); 5186 error = $temp$error; 5187 context = $temp$context; 5188 continue errorToStringHelp; 5189 case 1: 5190 var i = error.a; 5191 var err = error.b; 5192 var indexName = '[' + ($elm$core$String$fromInt(i) + ']'); 5193 var $temp$error = err, 5194 $temp$context = A2($elm$core$List$cons, indexName, context); 5195 error = $temp$error; 5196 context = $temp$context; 5197 continue errorToStringHelp; 5198 case 2: 5199 var errors = error.a; 5200 if (!errors.b) { 5201 return 'Ran into a Json.Decode.oneOf with no possibilities' + function () { 5202 if (!context.b) { 5203 return '!'; 5204 } else { 5205 return ' at json' + A2( 5206 $elm$core$String$join, 5207 '', 5208 $elm$core$List$reverse(context)); 5209 } 5210 }(); 5211 } else { 5212 if (!errors.b.b) { 5213 var err = errors.a; 5214 var $temp$error = err, 5215 $temp$context = context; 5216 error = $temp$error; 5217 context = $temp$context; 5218 continue errorToStringHelp; 5219 } else { 5220 var starter = function () { 5221 if (!context.b) { 5222 return 'Json.Decode.oneOf'; 5223 } else { 5224 return 'The Json.Decode.oneOf at json' + A2( 5225 $elm$core$String$join, 5226 '', 5227 $elm$core$List$reverse(context)); 5228 } 5229 }(); 5230 var introduction = starter + (' failed in the following ' + ($elm$core$String$fromInt( 5231 $elm$core$List$length(errors)) + ' ways:')); 5232 return A2( 5233 $elm$core$String$join, 5234 '\n\n', 5235 A2( 5236 $elm$core$List$cons, 5237 introduction, 5238 A2($elm$core$List$indexedMap, $elm$json$Json$Decode$errorOneOf, errors))); 5239 } 5240 } 5241 default: 5242 var msg = error.a; 5243 var json = error.b; 5244 var introduction = function () { 5245 if (!context.b) { 5246 return 'Problem with the given value:\n\n'; 5247 } else { 5248 return 'Problem with the value at json' + (A2( 5249 $elm$core$String$join, 5250 '', 5251 $elm$core$List$reverse(context)) + ':\n\n '); 5252 } 5253 }(); 5254 return introduction + ($elm$json$Json$Decode$indent( 5255 A2($elm$json$Json$Encode$encode, 4, json)) + ('\n\n' + msg)); 5256 } 5257 } 5258 }); 5259var $elm$core$Array$branchFactor = 32; 5260var $elm$core$Array$Array_elm_builtin = F4( 5261 function (a, b, c, d) {
5262 return {$: 0, a: a, b: b, c: c, d: d}; 5263 }); 5264var $elm$core$Elm$JsArray$empty = _JsArray_empty; 5265var $elm$core$Basics$ceiling = _Basics_ceiling; 5266var $elm$core$Basics$fdiv = _Basics_fdiv; 5267var $elm$core$Basics$logBase = F2( 5268 function (base, number) { 5269 return _Basics_log(number) / _Basics_log(base); 5270 }); 5271var $elm$core$Basics$toFloat = _Basics_toFloat; 5272var $elm$core$Array$shiftStep = $elm$core$Basics$ceiling( 5273 A2($elm$core$Basics$logBase, 2, $elm$core$Array$branchFactor)); 5274var $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); 5275var $elm$core$Elm$JsArray$initialize = _JsArray_initialize; 5276var $elm$core$Array$Leaf = function (a) { 5277 return {$: 1, a: a}; 5278}; 5279var $elm$core$Basics$apL = F2( 5280 function (f, x) { 5281 return f(x); 5282 }); 5283var $elm$core$Basics$apR = F2( 5284 function (x, f) { 5285 return f(x); 5286 }); 5287var $elm$core$Basics$eq = _Utils_equal; 5288var $elm$core$Basics$floor = _Basics_floor; 5289var $elm$core$Elm$JsArray$length = _JsArray_length; 5290var $elm$core$Basics$gt = _Utils_gt; 5291var $elm$core$Basics$max = F2( 5292 function (x, y) { 5293 return (_Utils_cmp(x, y) > 0) ? x : y; 5294 }); 5295var $elm$core$Basics$mul = _Basics_mul; 5296var $elm$core$Array$SubTree = function (a) { 5297 return {$: 0, a: a}; 5298}; 5299var $elm$core$Elm$JsArray$initializeFromList = _JsArray_initializeFromList; 5300var $elm$core$Array$compressNodes = F2( 5301 function (nodes, acc) { 5302 compressNodes: 5303 while (true) { 5304 var _v0 = A2($elm$core$Elm$JsArray$initializeFromList, $elm$core$Array$branchFactor, nodes); 5305 var node = _v0.a; 5306 var remainingNodes = _v0.b; 5307 var newAcc = A2( 5308 $elm$core$List$cons, 5309 $elm$core$Array$SubTree(node), 5310 acc); 5311 if (!remainingNodes.b) { 5312 return $elm$core$List$reverse(newAcc); 5313 } else { 5314 var $temp$nodes = remainingNodes, 5315 $temp$acc = newAcc; 5316 nodes = $temp$nodes; 5317 acc = $temp$acc; 5318 continue compressNodes; 5319 } 5320 } 5321 }); 5322var $elm$core$Tuple$first = function (_v0) { 5323 var x = _v0.a; 5324 return x; 5325}; 5326var $elm$core$Array$treeFromBuilder = F2( 5327 function (nodeList, nodeListSize) { 5328 treeFromBuilder: 5329 while (true) { 5330 var newNodeSize = $elm$core$Basics$ceiling(nodeListSize / $elm$core$Array$branchFactor); 5331 if (newNodeSize === 1) { 5332 return A2($elm$core$Elm$JsArray$initializeFromList, $elm$core$Array$branchFactor, nodeList).a; 5333 } else { 5334 var $temp$nodeList = A2($elm$core$Array$compressNodes, nodeList, _List_Nil), 5335 $temp$nodeListSize = newNodeSize; 5336 nodeList = $temp$nodeList; 5337 nodeListSize = $temp$nodeListSize; 5338 continue treeFromBuilder; 5339 } 5340 } 5341 }); 5342var $elm$core$Array$builderToArray = F2( 5343 function (reverseNodeList, builder) { 5344 if (!builder.I) { 5345 return A4( 5346 $elm$core$Array$Array_elm_builtin, 5347 $elm$core$Elm$JsArray$length(builder.ky), 5348 $elm$core$Array$shiftStep, 5349 $elm$core$Elm$JsArray$empty, 5350 builder.ky); 5351 } else { 5352 var treeLen = builder.I * $elm$core$Array$branchFactor; 5353 var depth = $elm$core$Basics$floor( 5354 A2($elm$core$Basics$logBase, $elm$core$Array$branchFactor, treeLen - 1)); 5355 var correctNodeList = reverseNodeList ? $elm$core$List$reverse(builder.Q) : builder.Q; 5356 var tree = A2($elm$core$Array$treeFromBuilder, correctNodeList, builder.I); 5357 return A4( 5358 $elm$core$Array$Array_elm_builtin, 5359 $elm$core$Elm$JsArray$length(builder.ky) + treeLen, 5360 A2($elm$core$Basics$max, 5, depth * $elm$core$Array$shiftStep), 5361 tree, 5362 builder.ky); 5363 } 5364 }); 5365var $elm$core$Basics$idiv = _Basics_idiv; 5366var $elm$core$Basics$lt = _Utils_lt; 5367var $elm$core$Array$initializeHelp = F5( 5368 function (fn, fromIndex, len, nodeList, tail) { 5369 initializeHelp: 5370 while (true) { 5371 if (fromIndex < 0) { 5372 return A2( 5373 $elm$core$Array$builderToArray, 5374 false, 5375 {Q: nodeList, I: (len / $elm$core$Array$branchFactor) | 0, ky: tail}); 5376 } else { 5377 var leaf = $elm$core$Array$Leaf( 5378 A3($elm$core$Elm$JsArray$initialize, $elm$core$Array$branchFactor, fromIndex, fn)); 5379 var $temp$fn = fn, 5380 $temp$fromIndex = fromIndex - $elm$core$Array$branchFactor, 5381 $temp$len = len, 5382 $temp$nodeList = A2($elm$core$List$cons, leaf, nodeList), 5383 $temp$tail = tail; 5384 fn = $temp$fn; 5385 fromIndex = $temp$fromIndex; 5386 len = $temp$len; 5387 nodeList = $temp$nodeList; 5388 tail = $temp$tail; 5389 continue initializeHelp; 5390 } 5391 } 5392 }); 5393var $elm$core$Basics$remainderBy = _Basics_remainderBy; 5394var $elm$core$Array$initialize = F2( 5395 function (len, fn) { 5396 if (len <= 0) { 5397 return $elm$core$Array$empty; 5398 } else { 5399 var tailLen = len % $elm$core$Array$branchFactor; 5400 var tail = A3($elm$core$Elm$JsArray$initialize, tailLen, len - tail
5400Len, fn); 5401 var initialFromIndex = (len - tailLen) - $elm$core$Array$branchFactor; 5402 return A5($elm$core$Array$initializeHelp, fn, initialFromIndex, len, _List_Nil, tail); 5403 } 5404 }); 5405var $elm$core$Basics$True = 0; 5406var $elm$core$Result$isOk = function (result) { 5407 if (!result.$) { 5408 return true; 5409 } else { 5410 return false; 5411 } 5412}; 5413var $elm$json$Json$Decode$andThen = _Json_andThen; 5414var $elm$json$Json$Decode$bool = _Json_decodeBool; 5415var $elm$json$Json$Decode$map = _Json_map1; 5416var $elm$json$Json$Decode$map2 = _Json_map2; 5417var $elm$json$Json$Decode$succeed = _Json_succeed; 5418var $elm$virtual_dom$VirtualDom$toHandlerInt = function (handler) { 5419 switch (handler.$) { 5420 case 0: 5421 return 0; 5422 case 1: 5423 return 1; 5424 case 2: 5425 return 2; 5426 default: 5427 return 3; 5428 } 5429}; 5430var $elm$browser$Browser$External = function (a) { 5431 return {$: 1, a: a}; 5432}; 5433var $elm$browser$Browser$Internal = function (a) { 5434 return {$: 0, a: a}; 5435}; 5436var $elm$core$Basics$identity = function (x) { 5437 return x; 5438}; 5439var $elm$browser$Browser$Dom$NotFound = $elm$core$Basics$identity; 5440var $elm$url$Url$Http = 0; 5441var $elm$url$Url$Https = 1; 5442var $elm$url$Url$Url = F6( 5443 function (protocol, host, port_, path, query, fragment) { 5444 return {dh: fragment, m5: host, fb: path, jH: port_, jN: protocol, jU: query}; 5445 }); 5446var $elm$core$String$contains = _String_contains; 5447var $elm$core$String$length = _String_length; 5448var $elm$core$String$slice = _String_slice; 5449var $elm$core$String$dropLeft = F2( 5450 function (n, string) { 5451 return (n < 1) ? string : A3( 5452 $elm$core$String$slice, 5453 n, 5454 $elm$core$String$length(string), 5455 string); 5456 }); 5457var $elm$core$String$indexes = _String_indexes; 5458var $elm$core$String$isEmpty = function (string) { 5459 return string === ''; 5460}; 5461var $elm$core$String$left = F2( 5462 function (n, string) { 5463 return (n < 1) ? '' : A3($elm$core$String$slice, 0, n, string); 5464 }); 5465var $elm$core$String$toInt = _String_toInt; 5466var $elm$url$Url$chompBeforePath = F5( 5467 function (protocol, path, params, frag, str) { 5468 if ($elm$core$String$isEmpty(str) || A2($elm$core$String$contains, '@', str)) { 5469 return $elm$core$Maybe$Nothing; 5470 } else { 5471 var _v0 = A2($elm$core$String$indexes, ':', str); 5472 if (!_v0.b) { 5473 return $elm$core$Maybe$Just( 5474 A6($elm$url$Url$Url, protocol, str, $elm$core$Maybe$Nothing, path, params, frag)); 5475 } else { 5476 if (!_v0.b.b) { 5477 var i = _v0.a; 5478 var _v1 = $elm$core$String$toInt( 5479 A2($elm$core$String$dropLeft, i + 1, str)); 5480 if (_v1.$ === 1) { 5481 return $elm$core$Maybe$Nothing; 5482 } else { 5483 var port_ = _v1; 5484 return $elm$core$Maybe$Just( 5485 A6( 5486 $elm$url$Url$Url, 5487 protocol, 5488 A2($elm$core$String$left, i, str), 5489 port_, 5490 path, 5491 params, 5492 frag)); 5493 } 5494 } else { 5495 return $elm$core$Maybe$Nothing; 5496 } 5497 } 5498 } 5499 }); 5500var $elm$url$Url$chompBeforeQuery = F4( 5501 function (protocol, params, frag, str) { 5502 if ($elm$core$String$isEmpty(str)) { 5503 return $elm$core$Maybe$Nothing; 5504 } else { 5505 var _v0 = A2($elm$core$String$indexes, '/', str); 5506 if (!_v0.b) { 5507 return A5($elm$url$Url$chompBeforePath, protocol, '/', params, frag, str); 5508 } else { 5509 var i = _v0.a; 5510 return A5( 5511 $elm$url$Url$chompBeforePath, 5512 protocol, 5513 A2($elm$core$String$dropLeft, i, str), 5514 params, 5515 frag, 5516 A2($elm$core$String$left, i, str)); 5517 } 5518 } 5519 }); 5520var $elm$url$Url$chompBeforeFragment = F3( 5521 function (protocol, frag, str) { 5522 if ($elm$core$String$isEmpty(str)) { 5523 return $elm$core$Maybe$Nothing; 5524 } else { 5525 var _v0 = A2($elm$core$String$indexes, '?', str); 5526 if (!_v0.b) { 5527 return A4($elm$url$Url$chompBeforeQuery, protocol, $elm$core$Maybe$Nothing, frag, str); 5528 } else { 5529 var i = _v0.a; 5530 return A4( 5531 $elm$url$Url$chompBeforeQuery, 5532 protocol, 5533 $elm$core$Maybe$Just( 5534 A2($elm$core$String$dropLeft, i + 1, str)), 5535 frag, 5536 A2($elm$core$String$left, i, str)); 5537 } 5538 } 5539 }); 5540var $elm$url$Url$chompAfterProtocol = F2( 5541 function (protocol, str) { 5542 if ($elm$core$String$isEmpty(str)) { 5543 return $elm$core$Maybe$Nothing; 5544 } else { 5545 var _v0 = A2($elm$core$String$indexes, '#', str); 5546 if (!_v0.b) { 5547 return A3($elm$url$Url$chompBeforeFragment, protocol, $elm$core$Maybe$Nothing, str); 5548 } else { 5549 var i = _v0.a; 5550 return A3( 5551 $elm$url$Url$chompBeforeFragment, 5552 protocol, 5553 $elm$core$Maybe$Just( 5554 A2($elm$core$String$dropLeft, i + 1, str)), 5555 A2($elm$core$String$left, i, str)); 5556 } 5557 } 5558 }); 5559var $elm$core$String$startsWith = _String_startsWith; 5560var $elm$url$Url$fromString = function (str) { 5561 return A2($elm$core$String$startsWith, 'http://', str) ? A2( 5562 $elm$url$Url$chompAfterProtocol, 5563 0, 5564 A2($elm$core$String$dropLeft, 7, str)) : (A2($elm$core$String$startsWith, 'https://', str) ? A2( 5565 $elm$url$Url$chompAfterProtocol,
5566 1, 5567 A2($elm$core$String$dropLeft, 8, str)) : $elm$core$Maybe$Nothing); 5568}; 5569var $elm$core$Basics$never = function (_v0) { 5570 never: 5571 while (true) { 5572 var nvr = _v0; 5573 var $temp$_v0 = nvr; 5574 _v0 = $temp$_v0; 5575 continue never; 5576 } 5577}; 5578var $elm$core$Task$Perform = $elm$core$Basics$identity; 5579var $elm$core$Task$succeed = _Scheduler_succeed; 5580var $elm$core$Task$init = $elm$core$Task$succeed(0); 5581var $elm$core$List$foldrHelper = F4( 5582 function (fn, acc, ctr, ls) { 5583 if (!ls.b) { 5584 return acc; 5585 } else { 5586 var a = ls.a; 5587 var r1 = ls.b; 5588 if (!r1.b) { 5589 return A2(fn, a, acc); 5590 } else { 5591 var b = r1.a; 5592 var r2 = r1.b; 5593 if (!r2.b) { 5594 return A2( 5595 fn, 5596 a, 5597 A2(fn, b, acc)); 5598 } else { 5599 var c = r2.a; 5600 var r3 = r2.b; 5601 if (!r3.b) { 5602 return A2( 5603 fn, 5604 a, 5605 A2( 5606 fn, 5607 b, 5608 A2(fn, c, acc))); 5609 } else { 5610 var d = r3.a; 5611 var r4 = r3.b; 5612 var res = (ctr > 500) ? A3( 5613 $elm$core$List$foldl, 5614 fn, 5615 acc, 5616 $elm$core$List$reverse(r4)) : A4($elm$core$List$foldrHelper, fn, acc, ctr + 1, r4); 5617 return A2( 5618 fn, 5619 a, 5620 A2( 5621 fn, 5622 b, 5623 A2( 5624 fn, 5625 c, 5626 A2(fn, d, res)))); 5627 } 5628 } 5629 } 5630 } 5631 }); 5632var $elm$core$List$foldr = F3( 5633 function (fn, acc, ls) { 5634 return A4($elm$core$List$foldrHelper, fn, acc, 0, ls); 5635 }); 5636var $elm$core$List$map = F2( 5637 function (f, xs) { 5638 return A3( 5639 $elm$core$List$foldr, 5640 F2( 5641 function (x, acc) { 5642 return A2( 5643 $elm$core$List$cons, 5644 f(x), 5645 acc); 5646 }), 5647 _List_Nil, 5648 xs); 5649 }); 5650var $elm$core$Task$andThen = _Scheduler_andThen; 5651var $elm$core$Task$map = F2( 5652 function (func, taskA) { 5653 return A2( 5654 $elm$core$Task$andThen, 5655 function (a) { 5656 return $elm$core$Task$succeed( 5657 func(a)); 5658 }, 5659 taskA); 5660 }); 5661var $elm$core$Task$map2 = F3( 5662 function (func, taskA, taskB) { 5663 return A2( 5664 $elm$core$Task$andThen, 5665 function (a) { 5666 return A2( 5667 $elm$core$Task$andThen, 5668 function (b) { 5669 return $elm$core$Task$succeed( 5670 A2(func, a, b)); 5671 }, 5672 taskB); 5673 }, 5674 taskA); 5675 }); 5676var $elm$core$Task$sequence = function (tasks) { 5677 return A3( 5678 $elm$core$List$foldr, 5679 $elm$core$Task$map2($elm$core$List$cons), 5680 $elm$core$Task$succeed(_List_Nil), 5681 tasks); 5682}; 5683var $elm$core$Platform$sendToApp = _Platform_sendToApp; 5684var $elm$core$Task$spawnCmd = F2( 5685 function (router, _v0) { 5686 var task = _v0; 5687 return _Scheduler_spawn( 5688 A2( 5689 $elm$core$Task$andThen, 5690 $elm$core$Platform$sendToApp(router), 5691 task)); 5692 }); 5693var $elm$core$Task$onEffects = F3( 5694 function (router, commands, state) { 5695 return A2( 5696 $elm$core$Task$map, 5697 function (_v0) { 5698 return 0; 5699 }, 5700 $elm$core$Task$sequence( 5701 A2( 5702 $elm$core$List$map, 5703 $elm$core$Task$spawnCmd(router), 5704 commands))); 5705 }); 5706var $elm$core$Task$onSelfMsg = F3( 5707 function (_v0, _v1, _v2) { 5708 return $elm$core$Task$succeed(0); 5709 }); 5710var $elm$core$Task$cmdMap = F2( 5711 function (tagger, _v0) { 5712 var task = _v0; 5713 return A2($elm$core$Task$map, tagger, task); 5714 }); 5715_Platform_effectManagers['Task'] = _Platform_createManager($elm$core$Task$init, $elm$core$Task$onEffects, $elm$core$Task$onSelfMsg, $elm$core$Task$cmdMap); 5716var $elm$core$Task$command = _Platform_leaf('Task'); 5717var $elm$core$Task$perform = F2( 5718 function (toMessage, task) { 5719 return $elm$core$Task$command( 5720 A2($elm$core$Task$map, toMessage, task)); 5721 }); 5722var $elm$browser$Browser$element = _Browser_element; 5723var $elm$json$Json$Decode$field = _Json_decodeField; 5724var $author$project$Translations$En = 0; 5725var $author$project$Main$GotTimeZone = function (a) { 5726 return {$: 7, a: a}; 5727}; 5728var $author$project$Main$IdentityIdle = {$: 0}; 5729var $author$project$Main$Loading = {$: 0}; 5730var $author$project$Route$NotFound = {$: 9}; 5731var $author$project$Main$OnInitComplete = function (a) { 5732 return {$: 11, a: a}; 5733}; 5734var $author$project$Main$OnTaskProgress = function (a) { 5735 return {$: 6, a: a}; 5736}; 5737var $author$project$Infra$ConcurrentTaskExtra$TaskRunner = $elm$core$Basics$identity; 5738var $andrewMacmurray$elm_concurrent_task$ConcurrentTask$Error = function (a) { 5739 return {$: 1, a: a}; 5740}; 5741var $andrewMacmurray$elm_concurrent_task$ConcurrentTask$Success = function (a) { 5742 return {$: 0, a: a}; 5743}; 5744var $andrewMacmurray$elm_concurrent_task$ConcurrentTask$UnexpectedError = function (a) { 5745 return {$: 2, a: a}; 5746}; 5747var $andrewMacmurray$elm_concurrent_task$ConcurrentTask$Internal$Ids$get = function (_v0) { 5748 var id = _v0; 5749 return $elm$core$String$fromInt(id); 5750}; 5751var $andrewMacmurray$elm_concurrent_task$ConcurrentTask$Internal$currentAttemptId = function (_v0) { 5752 var pool_ = _v0; 5753 var _v1 = pool_.fe; 5754 if (!_v1.$) { 5755 var id = _v1.a; 5756 return $elm$core$String$fromInt(id) + (':' + $andrewMacmurray$elm_concurrent_task$ConcurrentTask$Internal$Ids$get(pool_.cf)); 5757 } else { 5758 return $andrewMacmurray$elm_concurrent_task$ConcurrentTask$Internal$Ids$get(pool_.cf); 5759 } 5760}; 5761var $elm$core$Dict$RBEmpty_elm_builtin = {$: -2}; 5762var $elm$core$Dict$empty = $elm$core$Dict$RBEmpty_elm_builtin; 5763var $elm$core$Set$Set_elm_builtin = $elm$core$Basics$identity; 5764var $elm$core$Set$empty = $elm$core$Dict$empty; 5765var $elm$core$Elm$JsArray$foldl = _JsArray_foldl; 5766var $elm$core$Array$foldl = F3(
5767 function (func, baseCase, _v0) { 5768 var tree = _v0.c; 5769 var tail = _v0.d; 5770 var helper = F2( 5771 function (node, acc) { 5772 if (!node.$) { 5773 var subTree = node.a; 5774 return A3($elm$core$Elm$JsArray$foldl, helper, acc, subTree); 5775 } else { 5776 var values = node.a; 5777 return A3($elm$core$Elm$JsArray$foldl, func, acc, values); 5778 } 5779 }); 5780 return A3( 5781 $elm$core$Elm$JsArray$foldl, 5782 func, 5783 A3($elm$core$Elm$JsArray$foldl, helper, baseCase, tree), 5784 tail); 5785 }); 5786var $elm$json$Json$Encode$array = F2( 5787 function (func, entries) { 5788 return _Json_wrap( 5789 A3( 5790 $elm$core$Array$foldl, 5791 _Json_addEntry(func), 5792 _Json_emptyArray(0), 5793 entries)); 5794 }); 5795var $elm$json$Json$Encode$object = function (pairs) { 5796 return _Json_wrap( 5797 A3( 5798 $elm$core$List$foldl, 5799 F2( 5800 function (_v0, obj) { 5801 var k = _v0.a; 5802 var v = _v0.b; 5803 return A3(_Json_addField, k, v, obj); 5804 }), 5805 _Json_emptyObject(0), 5806 pairs)); 5807}; 5808var $elm$json$Json$Encode$string = _Json_wrap; 5809var $andrewMacmurray$elm_concurrent_task$ConcurrentTask$Internal$encodeDefinitions = function (attemptId) { 5810 return $elm$json$Json$Encode$array( 5811 function (def) { 5812 return $elm$json$Json$Encode$object( 5813 _List_fromArray( 5814 [ 5815 _Utils_Tuple2( 5816 'attemptId', 5817 $elm$json$Json$Encode$string(attemptId)), 5818 _Utils_Tuple2( 5819 'taskId', 5820 $elm$json$Json$Encode$string(def.bB)), 5821 _Utils_Tuple2( 5822 'function', 5823 $elm$json$Json$Encode$string(def.n)), 5824 _Utils_Tuple2('args', def.k) 5825 ])); 5826 }); 5827}; 5828var $andrewMacmurray$elm_concurrent_task$ConcurrentTask$Internal$Ids$Sequence = $elm$core$Basics$identity; 5829var $andrewMacmurray$elm_concurrent_task$ConcurrentTask$Internal$Ids$init = 0; 5830var $elm$core$Dict$Black = 1; 5831var $elm$core$Dict$RBNode_elm_builtin = F5( 5832 function (a, b, c, d, e) { 5833 return {$: -1, a: a, b: b, c: c, d: d, e: e}; 5834 }); 5835var $elm$core$Dict$Red = 0; 5836var $elm$core$Dict$balance = F5( 5837 function (color, key, value, left, right) { 5838 if ((right.$ === -1) && (!right.a)) { 5839 var _v1 = right.a; 5840 var rK = right.b; 5841 var rV = right.c; 5842 var rLeft = right.d; 5843 var rRight = right.e; 5844 if ((left.$ === -1) && (!left.a)) { 5845 var _v3 = left.a; 5846 var lK = left.b; 5847 var lV = left.c; 5848 var lLeft = left.d; 5849 var lRight = left.e; 5850 return A5( 5851 $elm$core$Dict$RBNode_elm_builtin, 5852 0, 5853 key, 5854 value, 5855 A5($elm$core$Dict$RBNode_elm_builtin, 1, lK, lV, lLeft, lRight), 5856 A5($elm$core$Dict$RBNode_elm_builtin, 1, rK, rV, rLeft, rRight)); 5857 } else { 5858 return A5( 5859 $elm$core$Dict$RBNode_elm_builtin, 5860 color, 5861 rK, 5862 rV, 5863 A5($elm$core$Dict$RBNode_elm_builtin, 0, key, value, left, rLeft), 5864 rRight); 5865 } 5866 } else { 5867 if ((((left.$ === -1) && (!left.a)) && (left.d.$ === -1)) && (!left.d.a)) { 5868 var _v5 = left.a; 5869 var lK = left.b; 5870 var lV = left.c; 5871 var _v6 = left.d; 5872 var _v7 = _v6.a; 5873 var llK = _v6.b; 5874 var llV = _v6.c; 5875 var llLeft = _v6.d; 5876 var llRight = _v6.e; 5877 var lRight = left.e; 5878 return A5( 5879 $elm$core$Dict$RBNode_elm_builtin, 5880 0, 5881 lK, 5882 lV, 5883 A5($elm$core$Dict$RBNode_elm_builtin, 1, llK, llV, llLeft, llRight), 5884 A5($elm$core$Dict$RBNode_elm_builtin, 1, key, value, lRight, right)); 5885 } else { 5886 return A5($elm$core$Dict$RBNode_elm_builtin, color, key, value, left, right); 5887 } 5888 } 5889 }); 5890var $elm$core$Basics$compare = _Utils_compare; 5891var $elm$core$Dict$insertHelp = F3( 5892 function (key, value, dict) { 5893 if (dict.$ === -2) { 5894 return A5($elm$core$Dict$RBNode_elm_builtin, 0, key, value, $elm$core$Dict$RBEmpty_elm_builtin, $elm$core$Dict$RBEmpty_elm_builtin); 5895 } else { 5896 var nColor = dict.a; 5897 var nKey = dict.b; 5898 var nValue = dict.c; 5899 var nLeft = dict.d; 5900 var nRight = dict.e; 5901 var _v1 = A2($elm$core$Basics$compare, key, nKey); 5902 switch (_v1) { 5903 case 0: 5904 return A5( 5905 $elm$core$Dict$balance, 5906 nColor, 5907 nKey, 5908 nValue, 5909 A3($elm$core$Dict$insertHelp, key, value, nLeft), 5910 nRight); 5911 case 1: 5912 return A5($elm$core$Dict$RBNode_elm_builtin, nColor, nKey, value, nLeft, nRight); 5913 default: 5914 return A5( 5915 $elm$core$Dict$balance, 5916 nColor, 5917 nKey, 5918 nValue, 5919 nLeft, 5920 A3($elm$core$Dict$insertHelp, key, value, nRight)); 5921 } 5922 } 5923 }); 5924var $elm$core$Dict$insert = F3( 5925 function (key, value, dict) { 5926 var _v0 = A3($elm$core$Dict$insertHelp, key, value, dict); 5927 if ((_v0.$ === -1) && (!_v0.a)) { 5928 var _v1 = _v0.a; 5929 var k = _v0.b; 5930 var v = _v0.c; 5931 var l = _v0.d; 5932 var r = _v0.e; 5933 return A5($elm$core$Dict$RBNode_elm_builtin, 1, k, v, l, r); 5934 } else { 5935 var x = _v0; 5936 return x; 5937 } 5938 }); 5939var $elm$core$Set$insert = F2( 5940 function (key, _v0) { 5941 var dict = _v0; 5942 return A3($elm$core$Dict$insert, key, 0, dict); 5943 }); 5944var $elm$core$Set$fromList = function (list) { 5945 return A3($elm$core$List$foldl, $elm$core$Set$insert, $elm$core$Set$empty, list); 5946}; 5947var $elm$core$Elm$JsArray$map = _JsArray_map; 5948var $elm$core$Array$map = F2( 5949 function (func, _v0) { 5950 var len = _v0.a; 5951 var startShift = _v0.b; 5952 var tree = _v0.c; 5953 var tail = _v0.d; 5954 var helper = function (node) { 5955 if (!node.$) { 5956 var subTree = node.a; 5957 return $elm$core$Array$SubTree( 5958 A2($elm$core$Elm$JsArray$map, helper, subTree)); 5959 } else { 5960 var values = node.a; 5961 return $elm$core$Array$Leaf( 5962 A2($elm$core$Elm$JsArray$map, func, values)); 5963 } 5964 }; 5965 return A4( 5966 $elm$core$Array$Array_elm_builtin, 5967 len, 5968 startShift, 5969 A2($elm$core$Elm$JsArray$map, helper, tree), 5970 A2($elm$core$Elm$JsArray$map, func, tail)); 5971 }); 5972var $elm$core$Dict$foldl = F3( 5973 function (func, acc, dict) { 5974 foldl: 5975 while (true) { 5976 if (dict.$ === -2) { 5977 return acc; 5978 } else { 5979 var key = dict.b; 5980 var value = dict.c; 5981 var left = dict.d; 5982 var right = dict.e; 5983 var $temp$func = func, 5984 $temp$acc = A3( 5985 func, 5986 key, 5987 value, 5988 A3($elm$core$Dict$foldl, func, acc, left)), 5989 $temp$dict = right; 5990 func = $temp$func; 5991 acc = $temp$acc; 5992 dict = $temp$dict; 5993 continue foldl; 5994 } 5995 } 5996 }); 5997var $elm$core$Dict$union = F2( 5998 function (t1, t2) { 5999 return A3($elm$core$Dict$foldl, $elm$core$Dict$insert, t2, t1); 6000 }); 6001var $elm$core$Set$union = F2( 6002 function (_v0, _v1) { 6003 var dict1 = _v0; 6004 var dict2 = _v1; 6005 return A2($elm$core$Dict$union, dict1, dict2); 6006 }); 6007var $andrewMacmurray$elm_concurrent_task$ConcurrentTask$Internal$recordSent = F2( 6008 function (defs, inFlight) { 6009 var sentIds = $elm$core$Set$fromList( 6010 $elm$core$Array$toList( 6011 A2( 6012 $elm$core$Array$map, 6013 function ($) { 6014 return $.bB; 6015 }, 6016 defs))); 6017 return A2($elm$core$Set$union, inFlight, sentIds); 6018 }); 6019var $andrewMacmurray$elm_concurrent_task$ConcurrentTask$Internal$sendResult = F2( 6020 function (onComplete, res) { 6021 return A2( 6022 $elm$core$Task$perform, 6023 onComplete, 6024 $elm$core$Task$succeed(res)); 6025 }); 6026var $elm$core$Basics$composeR = F3( 6027 function (f, g, x) { 6028 return g( 6029 f(x)); 6030 }); 6031var $andrewMacmurray$elm_concurrent_task$ConcurrentTask$Internal$Pool = $elm$core$Basics$identity; 6032var $andrewMacmurray$elm_concurrent_task$ConcurrentTask$Internal$mapPool = F2( 6033 function (f, _v0) { 6034 var p = _v0; 6035 return f(p); 6036 }); 6037var $andrewMacmurray$elm_concurrent_task$ConcurrentTask$Internal$Ids$next = function (_v0) { 6038 var id = _v0; 6039 return id + 1; 6040}; 6041var $andrewMacmurray$elm_concurrent_task$ConcurrentTask$Internal$nextAttemptId = $andrewMacmurray$elm_concurrent_task$ConcurrentTask$Internal$mapPool( 6042 function (pool_) { 6043 return _Utils_update( 6044 pool_, 6045 { 6046 cf: $andrewMacmurray$elm_concurrent_task$ConcurrentTask$Internal$Ids$next(pool_.cf) 6047 }); 6048 }); 6049var $andrewMacmurray$elm_concurrent_task$ConcurrentTask$Internal$startAttempt = F2( 6050 function (id, progress) { 6051 return A2( 6052 $elm$core$Basics$composeR, 6053 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$Internal$mapPool( 6054 function (pool_) { 6055 return _Utils_update( 6056 pool_, 6057 { 6058 ax: A3($elm$core$Dict$insert, id, progress, pool_.ax) 6059 }); 6060 }), 6061 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$Internal$nextAttemptId); 6062 }); 6063var $andrewMacmurray$elm_concurrent_task$ConcurrentTask$Internal$stepTask = F2( 6064 function (res, _v0) { 6065 var ids = _v0.a; 6066 var run = _v0.b; 6067 return A2(run, res, ids); 6068 }); 6069var $andrewMacmurray$elm_concurrent_task$ConcurrentTask$Internal$attempt = F2( 6070 function (attempt_, task) { 6071 var id = $andrewMacmurray$elm_concurrent_task$ConcurrentTask$Internal$currentAttemptId(attempt_.cL); 6072 var _v0 = A2( 6073 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$Internal$stepTask, 6074 $elm$core$Dict$empty, 6075 _Utils_Tuple2($andrewMacmurray$elm_concurrent_task$ConcurrentTask$Internal$Ids$init, task)); 6076 if (_v0.b.$ === 1) { 6077 var res = _v0.b.a; 6078 return _Utils_Tuple3( 6079 id, 6080 attempt_.cL, 6081 A2($andrewMacmurray$elm_concurrent_task$ConcurrentTask$Internal$sendResult, attempt_.ju, res)); 6082 } else { 6083 var _v1 = _v0.b; 6084 var defs = _v1.a; 6085 var progress = { 6086 ai: A2($andrewMacmurray$elm_concurrent_task$ConcurrentTask$Internal$recordSent, defs, $elm$core$Set$empty), 6087 ju: attempt_.ju, 6088 fB: _Utils_Tuple2($andrewMacmurray$elm_concurrent_task$ConcurrentTask$Internal$Ids$init, task) 6089 }; 6090 return _Utils_Tuple3( 6091 id, 6092 A3($andrewMacmurray$elm_concurrent_task$ConcurrentTask$Internal$startAttempt, id, progress, attempt_.cL), 6093 attempt_.b$( 6094 A2($andrewMacmurray$elm_concurrent_task$ConcurrentTask$Internal$encodeDefinitions, id, defs))); 6095 } 6096 }); 6097var $andrewMacmurray$elm_concurrent_task$ConcurrentTask$Internal$Done = function (a) { 6098 return {$: 1, a: a}; 6099}; 6100var $andrewMacmurray$elm_concurrent_task$ConcurrentTask$Internal$Pending = F2( 6101 function (a, b) { 6102 return {$: 0, a: a, b: b}; 6103 }); 6104var $andrewMacmurray$elm_concurrent_task$ConcurrentTask$Internal$Task = $elm$core$Basics$identity; 6105var $andrewMacmurray$elm_concurrent_task$ConcurrentTask$Internal$Error = function (a) { 6106 return {$: 1, a: a}; 6107}; 6108var $andrewMacmurray$elm_concurrent_task$ConcurrentTask$Internal$Success = function (a) { 6109 return {$: 0, a: a}; 6110}; 6111var $andrewMacmurray$elm_concurrent_task$ConcurrentTask$Internal$UnexpectedError = function (a) { 6112 return {$: 2, a: a}; 6113}; 6114var $andrewMacmurray$elm_concurrent_task$ConcurrentTask$Internal$mapResponse = F2( 6115 function (f, res) { 6116 switch (res.$) { 6117 case 0: 6118 var a = res.a; 6119 return $andrewMacmurray$elm_concurrent_task$ConcurrentTask$Internal$Success( 6120 f(a)); 6121 case 1: 6122 var e = res.a; 6123 return $andrewMacmurray$elm_concurrent_task$ConcurrentTask$Internal$Error(e); 6124 default: 6125 var e = res.a; 6126 return $andrewMacmurray$elm_concurrent_task$ConcurrentTask$Internal$UnexpectedError(e); 6127 } 6128 }); 6129var $andrewMacmurray$elm_concurrent_task$ConcurrentTask$Internal$map = F2( 6130 function (f, _v0) { 6131 var run = _v0; 6132 return F2( 6133 function (result, ids) { 6134 var _v1 = A2(run, result, ids); 6135 var ids_ = _v1.a; 6136 var task = _v1.b; 6137 return _Utils_Tuple2( 6138 ids_, 6139 function () { 6140 if (!task.$) { 6141 var defs = task.a; 6142 var next = task.b; 6143 return A2( 6144 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$Internal$Pending, 6145 defs, 6146 A2($andrewMacmurray$elm_concurrent_task$ConcurrentTask$Internal$map, f, next)); 6147 } else { 6148 var a = task.a; 6149 return $andrewMacmurray$elm_concurrent_task$ConcurrentTask$Internal$Done( 6150 A2($andrewMacmurray$elm_concurrent_task$ConcurrentTask$Internal$mapResponse, f, a)); 6151 } 6152 }()); 6153 }); 6154 }); 6155var $andrewMacmurray$elm_concurrent_task$ConcurrentTask$map = $andrewMacmurray$elm_concurrent_task$ConcurrentTask$Internal$map; 6156var $andrewMacmurray$elm_concurrent_task$ConcurrentTask$Internal$onError = F2( 6157 function (f, _v0) { 6158 var run = _v0; 6159 return F2( 6160 function (res, ids) { 6161 var _v1 = A2(run, res, ids); 6162 var ids_ = _v1.a; 6163 var task = _v1.b; 6164 if (task.$ === 1) { 6165 var a = task.a; 6166 switch (a.$) { 6167 case 0: 6168 var a_ = a.a; 6169 return _Utils_Tuple2( 6170 ids_, 6171 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$Internal$Done( 6172 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$Internal$Success(a_))); 6173 case 1: 6174 var e = a.a; 6175 return A2( 6176 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$Internal$stepTask, 6177 res, 6178 _Utils_Tuple2( 6179 ids_, 6180 f(e))); 6181 default: 6182 var e = a.a; 6183 return _Utils_Tuple2( 6184 ids_, 6185 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$Internal$Done( 6186 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$Internal$UnexpectedError(e))); 6187 } 6188 } else { 6189 var defs = task.a; 6190 var next = task.b; 6191 return _Utils_Tuple2( 6192 ids_, 6193 A2( 6194 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$Internal$Pending, 6195 defs, 6196 A2($andrewMacmurray$elm_concurrent_task$ConcurrentTask$Internal$onError, f, next))); 6197 } 6198 }); 6199 }); 6200var $andrewMacmurray$elm_concurrent_task$ConcurrentTask$onError = $andrewMacmurray$elm_concurrent_task$ConcurrentTask$Internal$onError; 6201var $andrewMacmurray$elm_concurrent_task$ConcurrentTask$Internal$wrap = function (res) { 6202 return F2( 6203 function (_v0, ids) { 6204 return _Utils_Tuple2( 6205 ids, 6206 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$Internal$Done(res)); 6207 }); 6208}; 6209var $andrewMacmurray$elm_concurrent_task$ConcurrentTask$Internal$succeed = function (a) { 6210 return $andrewMacmurray$elm_concurrent_task$ConcurrentTask$Internal$wrap( 6211 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$Internal$Success(a)); 6212}; 6213var $andrewMacmurray$elm_concurrent_task$ConcurrentTask$succeed = $andrewMacmurray$elm_concurrent_task$ConcurrentTask$Internal$succeed; 6214var $andrewMacmurray$elm_concurrent_task$ConcurrentTask$ErrorsDecoderFailure = function (a) { 6215 return {$: 2, a: a}; 6216}; 6217var $andrewMacmurray$elm_concurrent_task$ConcurrentTask$InternalError = function (a) { 6218 return {$: 4, a: a}; 6219}; 6220var $andrewMacmurray$elm_concurrent_task$ConcurrentTask$MissingFunction = function (a) { 6221 return {$: 3, a: a}; 6222}; 6223var $andrewMacmurray$elm_concurrent_task$ConcurrentTask$ResponseDecoderFailure = function (a) { 6224 return {$: 1, a: a}; 6225}; 6226var $andrewMacmurray$elm_concurrent_task$ConcurrentTask$UnhandledJsException = function (a) { 6227 return {$: 0, a: a}; 6228}; 6229var $andrewMacmurray$elm_concurrent_task$ConcurrentTask$toUnexpectedError = function (err) { 6230 switch (err.$) { 6231 case 0: 6232 var e = err.a; 6233 return $andrewMacmurray$elm_concurrent_task$ConcurrentTask$UnhandledJsException(e); 6234 case 1: 6235 var e = err.a; 6236 return $andrewMacmurray$elm_concurrent_task$ConcurrentTask$ResponseDecoderFailure(e); 6237 case 2: 6238 var e = err.a; 6239 return $andrewMacmurray$elm_concurrent_task$ConcurrentTask$ErrorsDecoderFailure(e); 6240 case 3: 6241 var e = err.a; 6242 return $andrewMacmurray$elm_concurrent_task$ConcurrentTask$MissingFunction(e); 6243 default: 6244 var e = err.a; 6245 return $andrewMacmurray$elm_concurrent_task$ConcurrentTask$InternalError(e); 6246 } 6247}; 6248var $andrewMacmurray$elm_concurrent_task$ConcurrentTask$attemptWithId = F2( 6249 function (config, task) { 6250 var onComplete = function (res) { 6251 switch (res.$) { 6252 case 0: 6253 var s = res.a; 6254 return s; 6255 case 1: 6256 var e = res.a; 6257 return e; 6258 default: 6259 var e = res.a; 6260 return config.ju( 6261 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$UnexpectedError( 6262 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$toUnexpectedError(e))); 6263 } 6264 }; 6265 var mappedTask = A2( 6266 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$onError, 6267 function (err) { 6268 return $andrewMacmurray$elm_concurrent_task$ConcurrentTask$succeed( 6269 config.ju( 6270 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$Error(err))); 6271 }, 6272 A2( 6273 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$map, 6274 function (res) { 6275 return config.ju( 6276 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$Success(res)); 6277 }, 6278 task)); 6279 return A2( 6280 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$Internal$attempt, 6281 {ju: onComplete, cL: config.cL, b$: config.b$}, 6282 mappedTask); 6283 }); 6284var $andrewMacmurray$elm_concurrent_task$ConcurrentTask$attempt = F2( 6285 function (options, task) { 6286 var _v0 = A2($andrewMacmurray$elm_concurrent_task$ConcurrentTask$attemptWithId, options, task); 6287 var p = _v0.b; 6288 var cmd = _v0.c; 6289 return _Utils_Tuple2(p, cmd); 6290 }); 6291var $elm$core$Platform$Cmd$batch = _Platform_batch; 6292var $author$project$Infra$ConcurrentTaskExtra$andRun = F3( 6293 function (onComplete,
6293 task, _v0) { 6294 var r = _v0.a; 6295 var cmd = _v0.b; 6296 var _v1 = A2( 6297 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$attempt, 6298 {ju: onComplete, cL: r.cL, b$: r.b$}, 6299 task); 6300 var nextPool = _v1.a; 6301 var newCmd = _v1.b; 6302 return _Utils_Tuple2( 6303 {dA: r.dA, cL: nextPool, dH: r.dH, b$: r.b$}, 6304 $elm$core$Platform$Cmd$batch( 6305 _List_fromArray( 6306 [cmd, newCmd]))); 6307 }); 6308var $andrewMacmurray$elm_concurrent_task$ConcurrentTask$Internal$andThen = F2( 6309 function (f, _v0) { 6310 var run = _v0; 6311 return F2( 6312 function (res, ids) { 6313 var _v1 = A2(run, res, ids); 6314 var ids_ = _v1.a; 6315 var task = _v1.b; 6316 if (task.$ === 1) { 6317 var a = task.a; 6318 switch (a.$) { 6319 case 0: 6320 var a_ = a.a; 6321 return A2( 6322 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$Internal$stepTask, 6323 res, 6324 _Utils_Tuple2( 6325 ids_, 6326 f(a_))); 6327 case 1: 6328 var e = a.a; 6329 return _Utils_Tuple2( 6330 ids_, 6331 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$Internal$Done( 6332 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$Internal$Error(e))); 6333 default: 6334 var e = a.a; 6335 return _Utils_Tuple2( 6336 ids, 6337 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$Internal$Done( 6338 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$Internal$UnexpectedError(e))); 6339 } 6340 } else { 6341 var defs = task.a; 6342 var next = task.b; 6343 return _Utils_Tuple2( 6344 ids_, 6345 A2( 6346 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$Internal$Pending, 6347 defs, 6348 A2($andrewMacmurray$elm_concurrent_task$ConcurrentTask$Internal$andThen, f, next))); 6349 } 6350 }); 6351 }); 6352var $andrewMacmurray$elm_concurrent_task$ConcurrentTask$andThen = $andrewMacmurray$elm_concurrent_task$ConcurrentTask$Internal$andThen; 6353var $author$project$ErrorLog$empty = {E: _List_Nil, dW: 0}; 6354var $author$project$Route$About = {$: 7}; 6355var $author$project$Route$ActivityTab = 3; 6356var $author$project$Route$AddVirtualMember = {$: 5}; 6357var $author$project$Route$BalanceTab = 0; 6358var $author$project$Route$Diagnostics = {$: 11}; 6359var $author$project$Route$EditEntry = function (a) { 6360 return {$: 4, a: a}; 6361}; 6362var $author$project$Route$EditGroupMetadata = {$: 8}; 6363var $author$project$Route$EditMemberMetadata = function (a) { 6364 return {$: 6, a: a}; 6365}; 6366var $author$project$Route$EntriesTab = 1; 6367var $author$project$Route$ErrorLog = {$: 8}; 6368var $author$project$Route$GroupRoute = F2( 6369 function (a, b) { 6370 return {$: 6, a: a, b: b}; 6371 }); 6372var $author$project$Route$HighlightEntry = function (a) { 6373 return {$: 2, a: a}; 6374}; 6375var $author$project$Route$Home = {$: 0}; 6376var $author$project$Route$ImportSplitwise = {$: 3}; 6377var $author$project$Route$Join = function (a) { 6378 return {$: 0, a: a}; 6379}; 6380var $author$project$Route$MembersTab = 2; 6381var $author$project$Route$MergeMember = F2( 6382 function (a, b) { 6383 return {$: 7, a: a, b: b}; 6384 }); 6385var $author$project$Route$Migrate = {$: 10}; 6386var $author$project$Route$Move = {$: 4}; 6387var $author$project$Route$NewEntry = {$: 3}; 6388var $author$project$Route$NewGroup = {$: 2}; 6389var $author$project$Route$NotificationLanding = function (a) { 6390 return {$: 1, a: a}; 6391}; 6392var $author$project$Route$Receive = {$: 5}; 6393var $author$project$Route$Rejoin = {$: 9}; 6394var $author$project$Route$Tab = function (a) { 6395 return {$: 1, a: a}; 6396}; 6397var $elm$core$Maybe$andThen = F2( 6398 function (callback, maybeValue) { 6399 if (!maybeValue.$) { 6400 var value = maybeValue.a; 6401 return callback(value); 6402 } else { 6403 return $elm$core$Maybe$Nothing; 6404 } 6405 }); 6406var $elm$core$Dict$get = F2( 6407 function (targetKey, dict) { 6408 get: 6409 while (true) { 6410 if (dict.$ === -2) { 6411 return $elm$core$Maybe$Nothing; 6412 } else { 6413 var key = dict.b; 6414 var value = dict.c; 6415 var left = dict.d; 6416 var right = dict.e; 6417 var _v1 = A2($elm$core$Basics$compare, targetKey, key); 6418 switch (_v1) { 6419 case 0: 6420 var $temp$targetKey = targetKey, 6421 $temp$dict = left; 6422 targetKey = $temp$targetKey; 6423 dict = $temp$dict; 6424 continue get; 6425 case 1: 6426 return $elm$core$Maybe$Just(value); 6427 default: 6428 var $temp$targetKey = targetKey, 6429 $temp$dict = right; 6430 targetKey = $temp$targetKey; 6431 dict = $temp$dict; 6432 continue get; 6433 } 6434 } 6435 } 6436 }); 6437var $elm$core$List$head = function (list) { 6438 if (list.b) { 6439 var x = list.a; 6440 var xs = list.b; 6441 return $elm$core$Maybe$Just(x); 6442 } else { 6443 return $elm$core$Maybe$Nothing; 6444 } 6445}; 6446var $elm$core$List$isEmpty = function (xs) { 6447 if (!xs.b) { 6448 return true; 6449 } else { 6450 return false;
6451 } 6452}; 6453var $elm$core$Maybe$withDefault = F2( 6454 function (_default, maybe) { 6455 if (!maybe.$) { 6456 var value = maybe.a; 6457 return value; 6458 } else { 6459 return _default; 6460 } 6461 }); 6462var $author$project$Route$fromAppUrl = function (appUrl) { 6463 var _v0 = appUrl.fb; 6464 _v0$23: 6465 while (true) { 6466 if (!_v0.b) { 6467 return $author$project$Route$NotFound; 6468 } else { 6469 if (_v0.b.b) { 6470 if (!_v0.b.b.b) { 6471 switch (_v0.a) { 6472 case 'join': 6473 var _v4 = _v0.b; 6474 var groupId = _v4.a; 6475 var _v5 = A2( 6476 $elm$core$String$split, 6477 '.', 6478 A2($elm$core$Maybe$withDefault, '', appUrl.dh)); 6479 if (_v5.b) { 6480 var key = _v5.a; 6481 var rest = _v5.b; 6482 return A2( 6483 $author$project$Route$GroupRoute, 6484 groupId, 6485 $author$project$Route$Join( 6486 { 6487 i4: key, 6488 ky: $elm$core$List$isEmpty(rest) ? $elm$core$Maybe$Nothing : $elm$core$Maybe$Just( 6489 A2($elm$core$String$join, '.', rest)) 6490 })); 6491 } else { 6492 return A2( 6493 $author$project$Route$GroupRoute, 6494 groupId, 6495 $author$project$Route$Join( 6496 {i4: '', ky: $elm$core$Maybe$Nothing})); 6497 } 6498 case 'groups': 6499 switch (_v0.b.a) { 6500 case 'new': 6501 var _v2 = _v0.b; 6502 return $author$project$Route$NewGroup; 6503 case 'import-splitwise': 6504 var _v3 = _v0.b; 6505 return $author$project$Route$ImportSplitwise; 6506 default: 6507 var _v6 = _v0.b; 6508 var groupId = _v6.a; 6509 return A2( 6510 $author$project$Route$GroupRoute, 6511 groupId, 6512 $author$project$Route$Tab(0)); 6513 } 6514 default: 6515 break _v0$23; 6516 } 6517 } else { 6518 if (_v0.a === 'groups') { 6519 if (_v0.b.b.b.b) { 6520 if (!_v0.b.b.b.b.b) { 6521 if ((_v0.b.b.a === 'members') && (_v0.b.b.b.a === 'new')) { 6522 var _v20 = _v0.b; 6523 var groupId = _v20.a; 6524 var _v21 = _v20.b; 6525 var _v22 = _v21.b; 6526 return A2($author$project$Route$GroupRoute, groupId, $author$project$Route$AddVirtualMember); 6527 } else { 6528 break _v0$23; 6529 } 6530 } else { 6531 if (!_v0.b.b.b.b.b.b) { 6532 switch (_v0.b.b.a) { 6533 case 'entries': 6534 if (_v0.b.b.b.b.a === 'edit') { 6535 var _v16 = _v0.b; 6536 var groupId = _v16.a; 6537 var _v17 = _v16.b; 6538 var _v18 = _v17.b; 6539 var entryId = _v18.a; 6540 var _v19 = _v18.b; 6541 return A2( 6542 $author$project$Route$GroupRoute, 6543 groupId, 6544 $author$project$Route$EditEntry(entryId)); 6545 } else { 6546 break _v0$23; 6547 } 6548 case 'members': 6549 switch (_v0.b.b.b.b.a) { 6550 case 'edit': 6551 var _v23 = _v0.b; 6552 var groupId = _v23.a; 6553 var _v24 = _v23.b; 6554 var _v25 = _v24.b; 6555 var memberId = _v25.a; 6556 var _v26 = _v25.b; 6557 return A2( 6558 $author$project$Route$GroupRoute, 6559 groupId, 6560 $author$project$Route$EditMemberMetadata(memberId)); 6561 case 'merge': 6562 var _v27 = _v0.b; 6563 var groupId = _v27.a; 6564 var _v28 = _v27.b;
6565 var _v29 = _v28.b; 6566 var sourceId = _v29.a; 6567 var _v30 = _v29.b; 6568 return A2( 6569 $author$project$Route$GroupRoute, 6570 groupId, 6571 A2($author$project$Route$MergeMember, sourceId, $elm$core$Maybe$Nothing)); 6572 default: 6573 break _v0$23; 6574 } 6575 default: 6576 break _v0$23; 6577 } 6578 } else { 6579 if (((_v0.b.b.a === 'members') && (_v0.b.b.b.b.a === 'merge')) && (!_v0.b.b.b.b.b.b.b)) { 6580 var _v31 = _v0.b; 6581 var groupId = _v31.a; 6582 var _v32 = _v31.b; 6583 var _v33 = _v32.b; 6584 var sourceId = _v33.a; 6585 var _v34 = _v33.b; 6586 var _v35 = _v34.b; 6587 var targetId = _v35.a; 6588 return A2( 6589 $author$project$Route$GroupRoute, 6590 groupId, 6591 A2( 6592 $author$project$Route$MergeMember, 6593 sourceId, 6594 $elm$core$Maybe$Just(targetId))); 6595 } else { 6596 break _v0$23; 6597 } 6598 } 6599 } 6600 } else { 6601 switch (_v0.b.b.a) { 6602 case 'entries': 6603 var _v7 = _v0.b; 6604 var groupId = _v7.a; 6605 var _v8 = _v7.b; 6606 var _v9 = A2( 6607 $elm$core$Maybe$andThen, 6608 $elm$core$List$head, 6609 A2($elm$core$Dict$get, 'highlight', appUrl.fj)); 6610 if (!_v9.$) { 6611 var entryId = _v9.a; 6612 return A2( 6613 $author$project$Route$GroupRoute, 6614 groupId, 6615 $author$project$Route$HighlightEntry(entryId)); 6616 } else { 6617 return A2( 6618 $author$project$Route$GroupRoute, 6619 groupId, 6620 $author$project$Route$Tab(1)); 6621 } 6622 case 'members': 6623 var _v10 = _v0.b; 6624 var groupId = _v10.a; 6625 var _v11 = _v10.b; 6626 return A2( 6627 $author$project$Route$GroupRoute, 6628 groupId, 6629 $author$project$Route$Tab(2)); 6630 case 'activity': 6631 var _v12 = _v0.b; 6632 var groupId = _v12.a; 6633 var _v13 = _v12.b; 6634 return A2( 6635 $author$project$Route$GroupRoute, 6636 groupId, 6637 $author$project$Route$Tab(3)); 6638 case 'new-entry': 6639 var _v14 = _v0.b; 6640 var groupId = _v14.a; 6641 var _v15 = _v14.b; 6642 return A2($author$project$Route$GroupRoute, groupId, $author$project$Route$NewEntry); 6643 case 'settings': 6644 var _v36 = _v0.b; 6645 var groupId = _v36.a; 6646 var _v37 = _v36.b; 6647 return A2($author$project$Route$GroupRoute, groupId, $author$project$Route$EditGroupMetadata); 6648 case 'rejoin': 6649 var _v38 = _v0.b; 6650 var groupId = _v38.a; 6651 var _v39 = _v38.b; 6652 return A2($author$project$Route$GroupRoute, groupId, $author$project$Route$Rejoin); 6653 case 'migrate': 6654 var _v40 = _v0.b; 6655 var groupId = _v40.a; 6656 var _v41 = _v40.b; 6657 return A2($author$project$Route$GroupRoute, groupId, $author$project$Route$Migrate); 6658 case 'diagnostics': 6659 var _v42 = _v0.b; 6660 var groupId = _v42.a; 6661 var _v43 = _v42.b; 6662 return A2($author$project$Route$GroupRoute, groupId, $author$project$Route$Diagnostics); 6663 default: 6664 break _v0$23; 6665 } 6666 } 6667 } else { 6668 break _v0$23; 6669 } 6670 } 6671 } else { 6672 switch (_v0.a) { 6673 case 'groups': 6674 var _v1 = A2($elm$core$Maybe$withDefault, '', appUrl.dh); 6675 if (_v1 === '') { 6676 return $author$project$Route$Home; 6677 } else { 6678 var fragment = _v1; 6679 return A2($elm$core$String$startsWith, 'n=', fragment) ? $author$project$Route$NotificationLanding( 6680 A2($elm$core$String$dropLeft, 2, fragment)) : $author$project$Route$Home; 6681 } 6682 case 'move': 6683 return $author$project$Route$Move; 6684 case 'migrate': 6685 return $author$project$Route$Receive; 6686 case 'about': 6687 return $author$project$Route$About; 6688 case 'error-log': 6689 return $author$project$Route$ErrorLog; 6690 default: 6691 break _v0$23; 6692 } 6693 } 6694 } 6695 } 6696 return $author$project$Route$NotFound; 6697}; 6698var $elm$core$Maybe$map = F2( 6699 function (f, maybe) { 6700 if (!maybe.$) { 6701 var value = maybe.a; 6702 return $elm$core$Maybe$Just( 6703 f(value)); 6704 } else { 6705 return $elm$core$Maybe$Nothing; 6706 } 6707 }); 6708var $elm$url$Url$percentDecode = _Url_percentDecode; 6709var $lydell$elm_app_url$AppUrl$percentDecode = function (string) { 6710 return A2( 6711 $elm$core$Maybe$withDefault, 6712 string, 6713 $elm$url$Url$percentDecode(string)); 6714}; 6715var $lydell$elm_app_url$AppUrl$trimLeadingSlash = function (string) { 6716 return A2($elm$core$String$startsWith, '/', string) ? A2($elm$core$String$dropLeft, 1, string) : string; 6717}; 6718var $elm$core$Basics$negate = function (n) { 6719 return -n; 6720}; 6721var $elm$core$String$dropRight = F2( 6722 function (n, string) { 6723 return (n < 1) ? string : A3($elm$core$String$slice, 0, -n, string); 6724 }); 6725var $elm$core$String$endsWith = _String_endsWith; 6726var $lydell$elm_app_url$AppUrl$trimTrailingSlash = function (string) { 6727 return A2($elm$core$String$endsWith, '/', string) ? A2($elm$core$String$dropRight, 1, string) : string; 6728}; 6729var $lydell$elm_app_url$AppUrl$parsePath = function (path) { 6730 var trimmed = $lydell$elm_app_url$AppUrl$trimTrailingSlash( 6731 $lydell$elm_app_url$AppUrl$trimLeadingSlash(path)); 6732 return $elm$core$String$isEmpty(trimmed) ? _List_Nil : A2( 6733 $elm$core$List$map, 6734 $lydell$elm_app_url$AppUrl$percentDecode, 6735 A2($elm$core$String$split, '/', trimmed)); 6736}; 6737var $lydell$elm_app_url$AppUrl$insert = F2( 6738 function (value, maybeList) { 6739 return $elm$core$Maybe$Just( 6740 A2( 6741 $elm$core$List$cons, 6742 value, 6743 A2($elm$core$Maybe$withDefault, _List_Nil, maybeList))); 6744 }); 6745var $elm$core$String$replace = F3( 6746 function (before, after, string) { 6747 return A2( 6748 $elm$core$String$join, 6749 after, 6750 A2($elm$core$String$split, before, string)); 6751 }); 6752var $lydell$elm_app_url$AppUrl$queryParameterDecode = A2( 6753 $elm$core$Basics$composeR, 6754 A2($elm$core$String$replace, '+', ' '), 6755 $lydell$elm_app_url$AppUrl$percentDecode); 6756var $elm$core$Dict$getMin = function (dict) { 6757 getMin: 6758 while (true) { 6759 if ((dict.$ === -1) && (dict.d.$ === -1)) { 6760 var left = dict.d; 6761 var $temp$dict = left; 6762 dict = $temp$dict; 6763 continue getMin; 6764 } else { 6765 return dict; 6766 } 6767 } 6768}; 6769var $elm$core$Dict$moveRedLeft = function (dict) { 6770 if (((dict.$ === -1) && (dict.d.$ === -1)) && (dict.e.$ === -1)) { 6771 if ((dict.e.d.$ === -1) && (!dict.e.d.a)) { 6772 var clr = dict.a; 6773 var k = dict.b; 6774 var v = dict.c; 6775 var _v1 = dict.d; 6776 var lClr = _v1.a; 6777 var lK = _v1.b; 6778 var lV = _v1.c; 6779 var lLeft = _v1.d; 6780 var lRight = _v1.e; 6781 var _v2 = dict.e; 6782 var rClr = _v2.a; 6783 var rK = _v2.b; 6784 var rV = _v2.c; 6785 var rLeft = _v2.d; 6786 var _v3 = rLeft.a; 6787 var rlK = rLeft.b; 6788 var rlV = rLeft.c; 6789 var rlL = rLeft.d; 6790 var rlR = rLeft.e; 6791 var rRight = _v2.e; 6792 return A5( 6793 $elm$core$Dict$RBNode_elm_builtin, 6794 0, 6795 rlK, 6796 rlV, 6797 A5( 6798 $elm$core$Dict$RBNode_elm_builtin, 6799 1, 6800 k, 6801 v, 6802 A5($elm$core$Dict$RBNode_elm_builtin, 0, lK, lV, lLeft, lRight), 6803 rlL), 6804 A5($elm$core$Dict$RBNode_elm_builtin, 1, rK, rV, rlR, rRight)); 6805 } else { 6806 var clr = dict.a; 6807 var k = dict.b; 6808 var v = dict.c; 6809 var _v4 = dict.d; 6810 var lClr = _v4.a; 6811 var lK = _v4.b; 6812 var lV = _v4.c; 6813 var lLeft = _v4.d; 6814 var lRight = _v4.e; 6815 var _v5 = dict.e; 6816 var rClr = _v5.a; 6817 var rK = _v5.b; 6818 var rV = _v5.c; 6819 var rLeft = _v5.d; 6820 var rRight = _v5.e; 6821 if (clr === 1) { 6822 return A5( 6823 $elm$core$Dict$RBNode_elm_builtin, 6824 1, 6825 k, 6826 v, 6827 A5($elm$core$Dict$RBNode_elm_builtin, 0, lK, lV, lLeft, lRight), 6828 A5($elm$core$Dict$RBNode_elm_builtin, 0, rK, rV, rLeft, rRight)); 6829 } else { 6830 return A5( 6831 $elm$core$Dict$RBNode_elm_builtin, 6832 1, 6833 k, 6834 v, 6835 A5($elm$core$Dict$RBNode_elm_builtin, 0, lK, lV, lLeft, lRight), 6836 A5($elm$core$Dict$RBNode_elm_builtin, 0, rK, rV, rLeft, rRight)); 6837 } 6838 } 6839 } else { 6840 return dict; 6841 } 6842}; 6843var $elm$core$Dict$moveRedRight = function (dict) { 6844 if (((dict.$ === -1) && (dict.d.$ === -1)) && (dict.e.$ === -1)) { 6845 if ((dict.d.d.$ === -1) && (!dict.d.d.a)) { 6846 var clr = dict.a; 6847 var k = dict.b; 6848 var v = dict.c; 6849 var _v1 = dict.d; 6850 var lClr = _v1.a; 6851 var lK = _v1.b; 6852 var lV = _v1.c; 6853 var _v2 = _v1.d; 6854 var _v3 = _v2.a; 6855 var llK = _v2.b; 6856 var llV = _v2.c; 6857 var llLeft = _v2.d; 6858 var llRight = _v2.e; 6859 var lRight = _v1.e; 6860 var _v4 = dict.e; 6861 var rClr = _v4.a; 6862 var rK = _v4.b; 6863 var rV = _v4.c; 6864 var rLeft = _v4.d; 6865 var rRight = _v4.e; 6866 return A5( 6867 $elm$core$Dict$RBNode_elm_builtin, 6868 0, 6869 lK, 6870 lV, 6871 A5($elm$core$Dict$RBNode_elm_builtin, 1, llK, llV, llLeft, llRight), 6872 A5( 6873 $elm$core$Dict$RBNode_elm_builtin, 6874 1, 6875 k, 6876 v, 6877 lRight, 6878 A5($elm$core$Dict$RBNode_elm_builtin, 0, rK, rV, rLeft, rRight))); 6879 } else { 6880 var clr = dict.a; 6881 var k = dict.b; 6882 var v = dict.c; 6883 var _v5 = dict.d; 6884 var lClr = _v5.a; 6885 var lK = _v5.b; 6886 var lV = _v5.c; 6887 var lLeft = _v5.d; 6888 var lRight = _v5.e; 6889 var _v6 = dict.e; 6890 var rClr = _v6.a; 6891 var rK = _v6.b; 6892 var rV = _v6.c; 6893 var rLeft = _v6.d; 6894 var rRight = _v6.e; 6895 if (clr === 1) { 6896 return A5( 6897 $elm$core$Dict$RBNode_elm_builtin, 6898 1, 6899 k, 6900 v, 6901 A5($elm$core$Dict$RBNode_elm_builtin, 0, lK, lV, lLeft, lRight), 6902 A5($elm$core$Dict$RBNode_elm_builtin, 0, rK, rV, rLeft, rRight)); 6903 } else { 6904 return A5( 6905 $elm$core$Dict$RBNode_elm_builtin, 6906 1, 6907 k, 6908 v, 6909 A5($elm$core$Dict$RBNode_elm_builtin, 0, lK, lV, lLeft, lRight), 6910 A5($elm$core$Dict$RBNode_elm_builtin, 0, rK, rV, rLeft, rRight)); 6911 } 6912 } 6913 } else { 6914 return dict; 6915 } 6916}; 6917var $elm$core$Dict$removeHelpPrepEQGT = F7( 6918 function (targetKey, dict, color, key, value, left, right) { 6919 if ((left.$ === -1) && (!left.a)) { 6920 var _v1 = left.a; 6921 var lK = left.b; 6922 var lV = left.c; 6923 var lLeft = left.d; 6924 var lRight = left.e; 6925 return A5( 6926 $elm$core$Dict$RBNode_elm_builtin, 6927 color, 6928 lK, 6929 lV, 6930 lLeft, 6931 A5($elm$core$Dict$RBNode_elm_builtin, 0, key, value, lRight, right)); 6932 } else { 6933 _v2$2: 6934 while (true) { 6935 if ((right.$ === -1) && (right.a === 1)) { 6936 if (right.d.$ === -1) { 6937 if (right.d.a === 1) { 6938 var _v3 = right.a; 6939 var _v4 = right.d; 6940 var _v5 = _v4.a; 6941 return $elm$core$Dict$moveRedRight(dict); 6942 } else { 6943 break _v2$2; 6944 } 6945 } else { 6946 var _v6 = right.a; 6947 var _v7 = right.d; 6948 return $elm$core$Dict$moveRedRight(dict); 6949 } 6950 } else { 6951 break _v2$2; 6952 } 6953 } 6954 return dict; 6955 } 6956 }); 6957var $elm$core$Dict$removeMin = function (dict) { 6958 if ((dict.$ === -1) && (dict.d.$ === -1)) { 6959 var color = dict.a; 6960 var key = dict.b; 6961 var value = dict.c; 6962 var left = dict.d; 6963 var lColor = left.a; 6964 var lLeft = left.d; 6965 var right = dict.e; 6966 if (lColor === 1) { 6967 if ((lLeft.$ === -1) && (!lLeft.a)) { 6968 var _v3 = lLeft.a; 6969 return A5( 6970 $elm$core$Dict$RBNode_elm_builtin, 6971 color, 6972 key, 6973 value, 6974 $elm$core$Dict$removeMin(left), 6975 right); 6976 } else { 6977 var _v4 = $elm$core$Dict$moveRedLeft(dict); 6978 if (_v4.$ === -1) { 6979 var nColor = _v4.a; 6980 var nKey = _v4.b; 6981 var nValue = _v4.c; 6982 var nLeft = _v4.d; 6983 var nRight = _v4.e; 6984 return A5( 6985 $elm$core$Dict$balance, 6986 nColor, 6987 nKey, 6988 nValue, 6989 $elm$core$Dict$removeMin(nLeft), 6990 nRight); 6991 } else { 6992 return $elm$core$Dict$RBEmpty_elm_builtin; 6993 } 6994 } 6995 } else { 6996 return A5( 6997 $elm$core$Dict$RBNode_elm_builtin, 6998 color, 6999 key, 7000 value, 7001 $elm$core$Dict$removeMin(left), 7002 right); 7003 } 7004 } else { 7005 return $elm$core$Dict$RBEmpty_elm_builtin; 7006 } 7007}; 7008var $elm$core$Dict$removeHelp = F2( 7009 function (targetKey, dict) { 7010 if (dict.$ === -2) { 7011 return $elm$core$Dict$RBEmpty_elm_builtin; 7012 } else { 7013 var color = dict.a; 7014 var key = dict.b; 7015 var value = dict.c; 7016 var left = dict.d; 7017 var right = dict.e;
7018 if (_Utils_cmp(targetKey, key) < 0) { 7019 if ((left.$ === -1) && (left.a === 1)) { 7020 var _v4 = left.a; 7021 var lLeft = left.d; 7022 if ((lLeft.$ === -1) && (!lLeft.a)) { 7023 var _v6 = lLeft.a; 7024 return A5( 7025 $elm$core$Dict$RBNode_elm_builtin, 7026 color, 7027 key, 7028 value, 7029 A2($elm$core$Dict$removeHelp, targetKey, left), 7030 right); 7031 } else { 7032 var _v7 = $elm$core$Dict$moveRedLeft(dict); 7033 if (_v7.$ === -1) { 7034 var nColor = _v7.a; 7035 var nKey = _v7.b; 7036 var nValue = _v7.c; 7037 var nLeft = _v7.d; 7038 var nRight = _v7.e; 7039 return A5( 7040 $elm$core$Dict$balance, 7041 nColor, 7042 nKey, 7043 nValue, 7044 A2($elm$core$Dict$removeHelp, targetKey, nLeft), 7045 nRight); 7046 } else { 7047 return $elm$core$Dict$RBEmpty_elm_builtin; 7048 } 7049 } 7050 } else { 7051 return A5( 7052 $elm$core$Dict$RBNode_elm_builtin, 7053 color, 7054 key, 7055 value, 7056 A2($elm$core$Dict$removeHelp, targetKey, left), 7057 right); 7058 } 7059 } else { 7060 return A2( 7061 $elm$core$Dict$removeHelpEQGT, 7062 targetKey, 7063 A7($elm$core$Dict$removeHelpPrepEQGT, targetKey, dict, color, key, value, left, right)); 7064 } 7065 } 7066 }); 7067var $elm$core$Dict$removeHelpEQGT = F2( 7068 function (targetKey, dict) { 7069 if (dict.$ === -1) { 7070 var color = dict.a; 7071 var key = dict.b; 7072 var value = dict.c; 7073 var left = dict.d; 7074 var right = dict.e; 7075 if (_Utils_eq(targetKey, key)) { 7076 var _v1 = $elm$core$Dict$getMin(right); 7077 if (_v1.$ === -1) { 7078 var minKey = _v1.b; 7079 var minValue = _v1.c; 7080 return A5( 7081 $elm$core$Dict$balance, 7082 color, 7083 minKey, 7084 minValue, 7085 left, 7086 $elm$core$Dict$removeMin(right)); 7087 } else { 7088 return $elm$core$Dict$RBEmpty_elm_builtin; 7089 } 7090 } else { 7091 return A5( 7092 $elm$core$Dict$balance, 7093 color, 7094 key, 7095 value, 7096 left, 7097 A2($elm$core$Dict$removeHelp, targetKey, right)); 7098 } 7099 } else { 7100 return $elm$core$Dict$RBEmpty_elm_builtin; 7101 } 7102 }); 7103var $elm$core$Dict$remove = F2( 7104 function (key, dict) { 7105 var _v0 = A2($elm$core$Dict$removeHelp, key, dict); 7106 if ((_v0.$ === -1) && (!_v0.a)) { 7107 var _v1 = _v0.a; 7108 var k = _v0.b; 7109 var v = _v0.c; 7110 var l = _v0.d; 7111 var r = _v0.e; 7112 return A5($elm$core$Dict$RBNode_elm_builtin, 1, k, v, l, r); 7113 } else { 7114 var x = _v0; 7115 return x; 7116 } 7117 }); 7118var $elm$core$Dict$update = F3( 7119 function (targetKey, alter, dictionary) { 7120 var _v0 = alter( 7121 A2($elm$core$Dict$get, targetKey, dictionary)); 7122 if (!_v0.$) { 7123 var value = _v0.a; 7124 return A3($elm$core$Dict$insert, targetKey, value, dictionary); 7125 } else { 7126 return A2($elm$core$Dict$remove, targetKey, dictionary); 7127 } 7128 }); 7129var $lydell$elm_app_url$AppUrl$parseQueryParameter = F2( 7130 function (segment, queryParameters) { 7131 var _v0 = A2($elm$core$String$split, '=', segment); 7132 if (!_v0.b) { 7133 return queryParameters; 7134 } else { 7135 if ((_v0.a === '') && (!_v0.b.b)) { 7136 return queryParameters; 7137 } else { 7138 var rawKey = _v0.a; 7139 var rest = _v0.b; 7140 return A3( 7141 $elm$core$Dict$update, 7142 $lydell$elm_app_url$AppUrl$queryParameterDecode(rawKey), 7143 $lydell$elm_app_url$AppUrl$insert( 7144 $lydell$elm_app_url$AppUrl$queryParameterDecode( 7145 A2($elm$core$String$join, '=', rest))), 7146 queryParameters); 7147 } 7148 } 7149 }); 7150var $lydell$elm_app_url$AppUrl$parseQueryParameters = A2( 7151 $elm$core$Basics$composeR, 7152 $elm$core$String$split('&'), 7153 A2($elm$core$List$foldr, $lydell$elm_app_url$AppUrl$parseQueryParameter, $elm$core$Dict$empty)); 7154var $lydell$elm_app_url$AppUrl$fromUrl = function (url) { 7155 return { 7156 dh: A2($elm$core$Maybe$map, $lydell$elm_app_url$AppUrl$percentDecode, url.dh), 7157 fb: $lydell$elm_app_url$AppUrl$parsePath(url.fb), 7158 fj: A2( 7159 $elm$core$Maybe$withDefault, 7160 $elm$core$Dict$empty, 7161 A2($elm$core$Maybe$map, $lydell$elm_app_url$AppUrl$parseQueryParameters, url.jU)) 7162 }; 7163}; 7164var $elm$json$Json$Decode$value = _Json_decodeValue; 7165var $author$project$Main$groupReceiveTask = _Platform_incomingPort('groupReceiveTask', $elm$json$Json$Decode$value); 7166var $author$project$Main$groupSendTask = _Platform_outgoingPort('groupSendTask', $elm$core$Basics$identity); 7167var $elm$time$Time$Name = function (a) { 7168 return {$: 0, a: a}; 7169}; 7170var $elm$time$Time$Offset = function (a) { 7171 return {$: 1, a: a}; 7172}; 7173var $elm$time$Time$Zone = F2( 7174 function (a, b) { 7175 return {$: 0, a: a, b: b}; 7176 }); 7177var $elm$time$Time$customZone = $elm$time$Time$Zone; 7178var $elm$time$Time$here = _Time_here(0); 7179var $author$project$Infra$IdGen$State = $elm$core$Basics$identity; 7180var $elm$random$Random$Generator = $elm$core$Basics$identity; 7181var $elm$random$Random$Seed = F2( 7182 function (a, b) { 7183 return {$: 0, a: a, b: b}; 7184 }); 7185var $elm$core$Bitwise$and = _Bitwise_and; 7186var $elm$core$Bitwise$shiftRightZfBy = _Bitwise_shiftRightZfBy; 7187var $elm$random$Random$next = function (_v0) { 7188 var state0 = _v0.a; 7189 var incr = _v0.b; 7190 return A2($elm$random$Random$Seed, ((state0 * 1664525) + incr) >>> 0, incr); 7191}; 7192var $elm$core$Bitwise$xor = _Bitwise_xor; 7193var $elm$random$Random$peel = function (_v0) { 7194 var state = _v0.a; 7195 var word = (state ^ (state >>> ((state >>> 28) + 4))) * 277803737; 7196 return ((word >>> 22) ^ word) >>> 0; 7197}; 7198var $elm$random$Random$int = F2( 7199 function (a, b) { 7200 return function (seed0) { 7201 var _v0 = (_Utils_cmp(a, b) < 0) ? _Utils_Tuple2(a, b) : _Utils_Tuple2(b, a); 7202 var lo = _v0.a; 7203 var hi = _v0.b; 7204 var range = (hi - lo) + 1; 7205 if (!((range - 1) & range)) { 7206 return _Utils_Tuple2( 7207 (((range - 1) & $elm$random$Random$peel(seed0)) >>> 0) + lo, 7208 $elm$random$Random$next(seed0)); 7209 } else { 7210 var threshhold = (((-range) >>> 0) % range) >>> 0; 7211 var accountForBias = function (seed) { 7212 accountForBias: 7213 while (true) { 7214 var x = $elm$random$Random$peel(seed); 7215 var seedN = $elm$random$Random$next(seed); 7216 if (_Utils_cmp(x, threshhold) < 0) { 7217 var $temp$seed = seedN; 7218 seed = $temp$seed; 7219 continue accountForBias; 7220 } else { 7221 return _Utils_Tuple2((x % range) + lo, seedN); 7222 } 7223 } 7224 }; 7225 return accountForBias(seed0); 7226 } 7227 }; 7228 }); 7229var $elm$random$Random$map3 = F4( 7230 function (func, _v0, _v1, _v2) { 7231 var genA = _v0; 7232 var genB = _v1; 7233 var genC = _v2; 7234 return function (seed0) { 7235 var _v3 = genA(seed0); 7236 var a = _v3.a; 7237 var seed1 = _v3.b; 7238 var _v4 = genB(seed1); 7239 var b = _v4.a; 7240 var seed2 = _v4.b; 7241 var _v5 = genC(seed2); 7242 var c = _v5.a; 7243 var seed3 = _v5.b; 7244 return _Utils_Tuple2( 7245 A3(func, a, b, c), 7246 seed3); 7247 }; 7248 }); 7249var $elm$core$Bitwise$or = _Bitwise_or; 7250var $elm$random$Random$step = F2( 7251 function (_v0, seed) { 7252 var generator = _v0; 7253 return generator(seed); 7254 }); 7255var $elm$random$Random$independentSeed = function (seed0) { 7256 var makeIndependentSeed = F3( 7257 function (state, b, c) { 7258 return $elm$random$Random$next( 7259 A2($elm$random$Random$Seed, state, (1 | (b ^ c)) >>> 0)); 7260 }); 7261 var gen = A2($elm$random$Random$int, 0, 4294967295); 7262 return A2( 7263 $elm$random$Random$step, 7264 A4($elm$random$Random$map3, makeIndependentSeed, gen, gen, gen), 7265 seed0); 7266}; 7267var $TSFoster$elm_uuid$UUID$V7State = F3( 7268 function (a, b, c) {
7269 return {$: 0, a: a, b: b, c: c}; 7270 }); 7271var $elm$random$Random$map = F2( 7272 function (func, _v0) { 7273 var genA = _v0; 7274 return function (seed0) { 7275 var _v1 = genA(seed0); 7276 var a = _v1.a; 7277 var seed1 = _v1.b; 7278 return _Utils_Tuple2( 7279 func(a), 7280 seed1); 7281 }; 7282 }); 7283var $elm$time$Time$Posix = $elm$core$Basics$identity; 7284var $elm$time$Time$millisToPosix = $elm$core$Basics$identity; 7285var $TSFoster$elm_uuid$UUID$initialV7State = A2( 7286 $elm$random$Random$map, 7287 function (seed) { 7288 return A3( 7289 $TSFoster$elm_uuid$UUID$V7State, 7290 seed, 7291 $elm$time$Time$millisToPosix(0), 7292 0); 7293 }, 7294 $elm$random$Random$independentSeed); 7295var $author$project$Infra$IdGen$fromSeeds = F4( 7296 function (seed1, seed2, seed3, seed4) { 7297 var _v0 = A2($elm$random$Random$step, $elm$random$Random$independentSeed, seed2); 7298 var v7Seed = _v0.a; 7299 var v4Seed2 = _v0.b; 7300 var _v1 = A2($elm$random$Random$step, $TSFoster$elm_uuid$UUID$initialV7State, v7Seed); 7301 var v7State = _v1.a; 7302 var _v2 = A2($elm$random$Random$step, $elm$random$Random$independentSeed, seed1); 7303 var groupIdSeed = _v2.a; 7304 var v4Seed1 = _v2.b; 7305 return { 7306 gr: groupIdSeed, 7307 hy: {hf: v4Seed1, hg: v4Seed2, hh: seed3, hi: seed4}, 7308 hz: v7State 7309 }; 7310 }); 7311var $elm$random$Random$initialSeed = function (x) { 7312 var _v0 = $elm$random$Random$next( 7313 A2($elm$random$Random$Seed, 0, 1013904223)); 7314 var state1 = _v0.a; 7315 var incr = _v0.b; 7316 var state2 = (state1 + x) >>> 0; 7317 return $elm$random$Random$next( 7318 A2($elm$random$Random$Seed, state2, incr)); 7319}; 7320var $author$project$Infra$IdGen$splitInitialSeed = function (value) { 7321 return A2( 7322 $elm$random$Random$step, 7323 $elm$random$Random$independentSeed, 7324 $elm$random$Random$initialSeed(value)); 7325}; 7326var $author$project$Infra$IdGen$init = function (entropy) { 7327 var _v0 = $author$project$Infra$IdGen$splitInitialSeed(entropy.hi); 7328 var mainSeed4 = _v0.a; 7329 var groupSeed4 = _v0.b; 7330 var _v1 = $author$project$Infra$IdGen$splitInitialSeed(entropy.hh); 7331 var mainSeed3 = _v1.a; 7332 var groupSeed3 = _v1.b; 7333 var _v2 = $author$project$Infra$IdGen$splitInitialSeed(entropy.hg); 7334 var mainSeed2 = _v2.a; 7335 var groupSeed2 = _v2.b; 7336 var _v3 = $author$project$Infra$IdGen$splitInitialSeed(entropy.hf); 7337 var mainSeed1 = _v3.a; 7338 var groupSeed1 = _v3.b; 7339 return _Utils_Tuple2( 7340 A4($author$project$Infra$IdGen$fromSeeds, mainSeed1, mainSeed2, mainSeed3, mainSeed4), 7341 A4($author$project$Infra$IdGen$fromSeeds, groupSeed1, groupSeed2, groupSeed3, groupSeed4)); 7342}; 7343var $author$project$Infra$Storage$InitData = function (db) { 7344 return function (identity) { 7345 return function (groups) { 7346 return function (savedLanguage) { 7347 return function (selfProfile) { 7348 return function (devMode) { 7349 return function (activityMarkers) { 7350 return function (pushServerUrl) { 7351 return function (lastSeenChangelog) { 7352 return function (feedbackPrompts) { 7353 return {k8: activityMarkers, de: db, mi: devMode, mB: feedbackPrompts, eN: groups, O: identity, eY: lastSeenChangelog, g7: pushServerUrl, p0: savedLanguage, fr: selfProfile}; 7354 }; 7355 }; 7356 }; 7357 }; 7358 }; 7359 }; 7360 }; 7361 }; 7362 }; 7363}; 7364var $elm$core$Elm$JsArray$appendN = _JsArray_appendN; 7365var $elm$core$Elm$JsArray$slice = _JsArray_slice; 7366var $elm$core$Array$appendHelpBuilder = F2( 7367 function (tail, builder) { 7368 var tailLen = $elm$core$Elm$JsArray$length(tail); 7369 var notAppended = ($elm$core$Array$branchFactor - $elm$core$Elm$JsArray$length(builder.ky)) - tailLen; 7370 var appended = A3($elm$core$Elm$JsArray$appendN, $elm$core$Array$branchFactor, builder.ky, tail); 7371 return (notAppended < 0) ? { 7372 Q: A2( 7373 $elm$core$List$cons, 7374 $elm$core$Array$Leaf(appended), 7375 builder.Q), 7376 I: builder.I + 1, 7377 ky: A3($elm$core$Elm$JsArray$slice, notAppended, tailLen, tail) 7378 } : ((!notAppended) ? { 7379 Q: A2( 7380 $elm$core$List$cons, 7381 $elm$core$Array$Leaf(appended), 7382 builder.Q), 7383 I: builder.I + 1, 7384 ky: $elm$core$Elm$JsArray$empty 7385 } : {Q: builder.Q, I: builder.I, ky: appended}); 7386 }); 7387var $elm$core$Array$bitMask = 4294967295 >>> (32 - $elm$core$Array$shiftStep); 7388var $elm$core$Basics$ge = _Utils_ge; 7389var $elm$core$Elm$JsArray$push = _JsArray_push; 7390var $elm$core$Elm$JsArray$singleton = _JsArray_singleton; 7391var $elm$core$Elm$JsArray$unsafeGet = _JsArray_unsafeGet; 7392var $elm$core$Elm$JsArray$unsafeSet = _JsArray_unsafeSet; 7393var $elm$core$Array$insertTailInTree = F4( 7394 function (shift, index, tail, tree) { 7395 var pos = $elm$core$Array$bitMask & (index >>> shift); 7396 if (_Utils_cmp( 7397 pos,
7398 $elm$core$Elm$JsArray$length(tree)) > -1) { 7399 if (shift === 5) { 7400 return A2( 7401 $elm$core$Elm$JsArray$push, 7402 $elm$core$Array$Leaf(tail), 7403 tree); 7404 } else { 7405 var newSub = $elm$core$Array$SubTree( 7406 A4($elm$core$Array$insertTailInTree, shift - $elm$core$Array$shiftStep, index, tail, $elm$core$Elm$JsArray$empty)); 7407 return A2($elm$core$Elm$JsArray$push, newSub, tree); 7408 } 7409 } else { 7410 var value = A2($elm$core$Elm$JsArray$unsafeGet, pos, tree); 7411 if (!value.$) { 7412 var subTree = value.a; 7413 var newSub = $elm$core$Array$SubTree( 7414 A4($elm$core$Array$insertTailInTree, shift - $elm$core$Array$shiftStep, index, tail, subTree)); 7415 return A3($elm$core$Elm$JsArray$unsafeSet, pos, newSub, tree); 7416 } else { 7417 var newSub = $elm$core$Array$SubTree( 7418 A4( 7419 $elm$core$Array$insertTailInTree, 7420 shift - $elm$core$Array$shiftStep, 7421 index, 7422 tail, 7423 $elm$core$Elm$JsArray$singleton(value))); 7424 return A3($elm$core$Elm$JsArray$unsafeSet, pos, newSub, tree); 7425 } 7426 } 7427 }); 7428var $elm$core$Bitwise$shiftLeftBy = _Bitwise_shiftLeftBy; 7429var $elm$core$Array$unsafeReplaceTail = F2( 7430 function (newTail, _v0) { 7431 var len = _v0.a; 7432 var startShift = _v0.b; 7433 var tree = _v0.c; 7434 var tail = _v0.d; 7435 var originalTailLen = $elm$core$Elm$JsArray$length(tail); 7436 var newTailLen = $elm$core$Elm$JsArray$length(newTail); 7437 var newArrayLen = len + (newTailLen - originalTailLen); 7438 if (_Utils_eq(newTailLen, $elm$core$Array$branchFactor)) { 7439 var overflow = _Utils_cmp(newArrayLen >>> $elm$core$Array$shiftStep, 1 << startShift) > 0; 7440 if (overflow) { 7441 var newShift = startShift + $elm$core$Array$shiftStep; 7442 var newTree = A4( 7443 $elm$core$Array$insertTailInTree, 7444 newShift, 7445 len, 7446 newTail, 7447 $elm$core$Elm$JsArray$singleton( 7448 $elm$core$Array$SubTree(tree))); 7449 return A4($elm$core$Array$Array_elm_builtin, newArrayLen, newShift, newTree, $elm$core$Elm$JsArray$empty); 7450 } else { 7451 return A4( 7452 $elm$core$Array$Array_elm_builtin, 7453 newArrayLen, 7454 startShift, 7455 A4($elm$core$Array$insertTailInTree, startShift, len, newTail, tree), 7456 $elm$core$Elm$JsArray$empty); 7457 } 7458 } else { 7459 return A4($elm$core$Array$Array_elm_builtin, newArrayLen, startShift, tree, newTail); 7460 } 7461 }); 7462var $elm$core$Array$appendHelpTree = F2( 7463 function (toAppend, array) { 7464 var len = array.a; 7465 var tree = array.c; 7466 var tail = array.d; 7467 var itemsToAppend = $elm$core$Elm$JsArray$length(toAppend); 7468 var notAppended = ($elm$core$Array$branchFactor - $elm$core$Elm$JsArray$length(tail)) - itemsToAppend; 7469 var appended = A3($elm$core$Elm$JsArray$appendN, $elm$core$Array$branchFactor, tail, toAppend); 7470 var newArray = A2($elm$core$Array$unsafeReplaceTail, appended, array); 7471 if (notAppended < 0) { 7472 var nextTail = A3($elm$core$Elm$JsArray$slice, notAppended, itemsToAppend, toAppend); 7473 return A2($elm$core$Array$unsafeReplaceTail, nextTail, newArray); 7474 } else { 7475 return newArray; 7476 } 7477 }); 7478var $elm$core$Array$builderFromArray = function (_v0) { 7479 var len = _v0.a; 7480 var tree = _v0.c; 7481 var tail = _v0.d; 7482 var helper = F2( 7483 function (node, acc) { 7484 if (!node.$) { 7485 var subTree = node.a; 7486 return A3($elm$core$Elm$JsArray$foldl, helper, acc, subTree); 7487 } else { 7488 return A2($elm$core$List$cons, node, acc); 7489 } 7490 }); 7491 return { 7492 Q: A3($elm$core$Elm$JsArray$foldl, helper, _List_Nil, tree), 7493 I: (len / $elm$core$Array$branchFactor) | 0, 7494 ky: tail 7495 }; 7496}; 7497var $elm$core$Array$append = F2( 7498 function (a, _v0) { 7499 var aTail = a.d; 7500 var bLen = _v0.a; 7501 var bTree = _v0.c; 7502 var bTail = _v0.d; 7503 if (_Utils_cmp(bLen, $elm$core$Array$branchFactor * 4) < 1) { 7504 var foldHelper = F2( 7505 function (node, array) { 7506 if (!node.$) { 7507 var tree = node.a; 7508 return A3($elm$core$Elm$JsArray$foldl, foldHelper, array, tree); 7509 } else { 7510 var leaf = node.a; 7511 return A2($elm$core$Array$appendHelpTree, leaf, array); 7512 } 7513 }); 7514 return A2( 7515 $elm$core$Array$appendHelpTree, 7516 bTail, 7517 A3($elm$core$Elm$JsArray$foldl, foldHelper, a, bTree)); 7518 } else { 7519 var foldHelper = F2( 7520 function (node, builder) { 7521 if (!node.$) { 7522 var tree = node.a; 7523 return A3($elm$core$Elm$JsArray$foldl, foldHelper, builder, tree); 7524 } else { 7525 var leaf = node.a; 7526 return A2($elm$core$Array$appendHelpBuilder, leaf, builder); 7527 } 7528 }); 7529 return A2( 7530 $elm$core$Array$builderToArray, 7531 true, 7532 A2( 7533 $elm$core$Array$appendHelpBuilder, 7534 bTail, 7535 A3( 7536 $elm$core$Elm$JsArray$foldl, 7537 foldHelper, 7538 $elm$core$Array$builderFromArray(a), 7539 bTree))); 7540 } 7541 }); 7542var $andrewMacmurray$elm_concurrent_task$ConcurrentTask$Internal$Ids$combine = F2( 7543 function (_v0, _v1) { 7544 var a = _v0; 7545 var b = _v1; 7546 return A2($elm$core$Basics$max, a, b); 7547 }); 7548var $andrewMacmurray$elm_concurrent_task$ConcurrentTask$Internal$haltOnError = F2( 7549 function (res, task) { 7550 switch (res.$) { 7551 case 0: 7552 return task; 7553 case 1: 7554 var e = res.a; 7555 return $andrewMacmurray$elm_concurrent_task$ConcurrentTask$Internal$Done( 7556 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$Internal$Error(e)); 7557 default: 7558 var e = res.a; 7559 return $andrewMacmurray$elm_concurrent_task$ConcurrentTask$Internal$Done( 7560 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$Internal$UnexpectedError(e)); 7561 } 7562 }); 7563var $andrewMacmurray$elm_concurrent_task$ConcurrentTask$Internal$map2Response = F3( 7564 function (f, res1, res2) { 7565 var _v0 = _Utils_Tuple2(res1, res2); 7566 _v0$2: 7567 while (true) { 7568 _v0$3: 7569 while (true) { 7570 switch (_v0.a.$) { 7571 case 0: 7572 switch (_v0.b.$) { 7573 case 0: 7574 var a = _v0.a.a; 7575 var b = _v0.b.a; 7576 return $andrewMacmurray$elm_concurrent_task$ConcurrentTask$Internal$Success( 7577 A2(f, a, b)); 7578 case 2: 7579 break _v0$2; 7580 default: 7581 var e = _v0.b.a; 7582 return $andrewMacmurray$elm_concurrent_task$ConcurrentTask$Internal$Error(e); 7583 } 7584 case 2: 7585 var e = _v0.a.a; 7586 return $andrewMacmurray$elm_concurrent_task$ConcurrentTask$Internal$UnexpectedError(e); 7587 default: 7588 switch (_v0.b.$) { 7589 case 2: 7590 break _v0$2; 7591 case 1: 7592 break _v0$3; 7593 default: 7594 break _v0$3; 7595 } 7596 } 7597 } 7598 var e = _v0.a.a; 7599 return $andrewMacmurray$elm_concurrent_task$ConcurrentTask$Internal$Error(e); 7600 } 7601 var e = _v0.b.a; 7602 return $andrewMacmurray$elm_concurrent_task$ConcurrentTask$Internal$UnexpectedError(e); 7603 }); 7604var $andrewMacmurray$elm_concurrent_task$ConcurrentTask$Internal$andMap = F2( 7605 function (task1, task2) { 7606 var run1 = task1; 7607 var run2 = task2; 7608 return F2( 7609 function (res, ids) { 7610 var _v0 = A2(run2, res, ids); 7611 var ids_ = _v0.a; 7612 var task2_ = _v0.b; 7613 var _v1 = A2(run1, res, ids_); 7614 var ids__ = _v1.a; 7615 var task1_ = _v1.b; 7616 return _Utils_Tuple2( 7617 A2($andrewMacmurray$elm_concurrent_task$ConcurrentTask$Internal$Ids$combine, ids_, ids__), 7618 function () { 7619 var _v2 = _Utils_Tuple2(task1_, task2_); 7620 if (!_v2.a.$) { 7621 if (!_v2.b.$) { 7622 var _v3 = _v2.a;
7623 var defs1 = _v3.a; 7624 var next1 = _v3.b; 7625 var _v4 = _v2.b; 7626 var defs2 = _v4.a; 7627 var next2 = _v4.b; 7628 return A2( 7629 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$Internal$Pending, 7630 A2($elm$core$Array$append, defs1, defs2), 7631 A2($andrewMacmurray$elm_concurrent_task$ConcurrentTask$Internal$andMap, next1, next2)); 7632 } else { 7633 var _v5 = _v2.a; 7634 var defs = _v5.a; 7635 var next1 = _v5.b; 7636 var b = _v2.b.a; 7637 return A2( 7638 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$Internal$haltOnError, 7639 b, 7640 A2( 7641 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$Internal$Pending, 7642 defs, 7643 A2($andrewMacmurray$elm_concurrent_task$ConcurrentTask$Internal$andMap, next1, task2))); 7644 } 7645 } else { 7646 if (!_v2.b.$) { 7647 var a = _v2.a.a; 7648 var _v6 = _v2.b; 7649 var defs = _v6.a; 7650 var next2 = _v6.b; 7651 return A2( 7652 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$Internal$haltOnError, 7653 a, 7654 A2( 7655 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$Internal$Pending, 7656 defs, 7657 A2($andrewMacmurray$elm_concurrent_task$ConcurrentTask$Internal$andMap, task1, next2))); 7658 } else { 7659 var a = _v2.a.a; 7660 var b = _v2.b.a; 7661 return $andrewMacmurray$elm_concurrent_task$ConcurrentTask$Internal$Done( 7662 A3($andrewMacmurray$elm_concurrent_task$ConcurrentTask$Internal$map2Response, $elm$core$Basics$apR, a, b)); 7663 } 7664 } 7665 }()); 7666 }); 7667 }); 7668var $andrewMacmurray$elm_concurrent_task$ConcurrentTask$andMap = $andrewMacmurray$elm_concurrent_task$ConcurrentTask$Internal$andMap; 7669var $author$project$Domain$PaymentMethod$empty = $elm$core$Dict$empty; 7670var $author$project$Domain$Member$emptyMetadata = {is: $elm$core$Maybe$Nothing, bu: $elm$core$Maybe$Nothing, jD: $author$project$Domain$PaymentMethod$empty, jF: $elm$core$Maybe$Nothing}; 7671var $author$project$IndexedDb$Store = $elm$core$Basics$identity; 7672var $author$project$IndexedDb$defineStore = function (name) { 7673 return {ek: false, dj: _List_Nil, bS: $elm$core$Maybe$Nothing, bW: name}; 7674}; 7675var $author$project$Infra$Storage$activityMarkersStore = $author$project$IndexedDb$defineStore('activityMarkers'); 7676var $elm$core$List$maybeCons = F3( 7677 function (f, mx, xs) { 7678 var _v0 = f(mx); 7679 if (!_v0.$) { 7680 var x = _v0.a; 7681 return A2($elm$core$List$cons, x, xs); 7682 } else { 7683 return xs; 7684 } 7685 }); 7686var $elm$core$List$filterMap = F2( 7687 function (f, xs) { 7688 return A3( 7689 $elm$core$List$foldr, 7690 $elm$core$List$maybeCons(f), 7691 _List_Nil, 7692 xs); 7693 }); 7694var $elm$core$Dict$fromList = function (assocs) { 7695 return A3( 7696 $elm$core$List$foldl, 7697 F2( 7698 function (_v0, dict) { 7699 var key = _v0.a; 7700 var value = _v0.b; 7701 return A3($elm$core$Dict$insert, key, value, dict); 7702 }), 7703 $elm$core$Dict$empty, 7704 assocs); 7705}; 7706var $andrewMacmurray$elm_concurrent_task$ConcurrentTask$Internal$ErrorsDecoderFailure = function (a) { 7707 return {$: 2, a: a}; 7708}; 7709var $andrewMacmurray$elm_concurrent_task$ConcurrentTask$Internal$InternalError = function (a) { 7710 return {$: 4, a: a}; 7711}; 7712var $andrewMacmurray$elm_concurrent_task$ConcurrentTask$Internal$MissingFunction = function (a) { 7713 return {$: 3, a: a}; 7714}; 7715var $andrewMacmurray$elm_concurrent_task$ConcurrentTask$Internal$ResponseDecoderFailure = function (a) { 7716 return {$: 1, a: a}; 7717}; 7718var $andrewMacmurray$elm_concurrent_task$ConcurrentTask$Internal$UnhandledJsException = function (a) { 7719 return {$: 0, a: a}; 7720}; 7721var $elm$json$Json$Decode$decodeValue = _Json_run; 7722var $elm$json$Json$Decode$string = _Json_decodeString; 7723var $andrewMacmurray$elm_concurrent_task$ConcurrentTask$Internal$decodeResponse = F2( 7724 function (def, val) { 7725 var decodeRunnerSuccess = function () { 7726 var _v12 = def.m; 7727 var expect = _v12; 7728 return A2($elm$json$Json$Decode$field, 'value', expect); 7729 }(); 7730 var decodeRunnerError = A2( 7731 $elm$json$Json$Decode$field, 7732 'error', 7733 A2( 7734 $elm$json$Json$Decode$andThen, 7735 function (reason) { 7736 switch (reason) { 7737 case 'js_exception': 7738 return A3( 7739 $elm$json$Json$Decode$map2, 7740 F2( 7741 function (msg, raw) { 7742 return $andrewMacmurray$elm_concurrent_task$ConcurrentTask$Internal$Unh
7742andledJsException( 7743 {n: def.n, dv: msg, jZ: raw}); 7744 }), 7745 A2($elm$json$Json$Decode$field, 'message', $elm$json$Json$Decode$string), 7746 A2($elm$json$Json$Decode$field, 'raw', $elm$json$Json$Decode$value)); 7747 case 'missing_function': 7748 return A2( 7749 $elm$json$Json$Decode$field, 7750 'message', 7751 A2($elm$json$Json$Decode$map, $andrewMacmurray$elm_concurrent_task$ConcurrentTask$Internal$MissingFunction, $elm$json$Json$Decode$string)); 7752 default: 7753 return $elm$json$Json$Decode$succeed( 7754 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$Internal$InternalError('Unknown runner error reason: ' + reason)); 7755 } 7756 }, 7757 A2($elm$json$Json$Decode$field, 'reason', $elm$json$Json$Decode$string))); 7758 var decodeExpectThrows = function (_catch) { 7759 var _v8 = A2($elm$json$Json$Decode$decodeValue, decodeRunnerError, val); 7760 if (!_v8.$) { 7761 var err = _v8.a; 7762 if (!err.$) { 7763 var e = err.a; 7764 return $andrewMacmurray$elm_concurrent_task$ConcurrentTask$Internal$Error( 7765 _catch(e.dv)); 7766 } else { 7767 return $andrewMacmurray$elm_concurrent_task$ConcurrentTask$Internal$UnexpectedError(err); 7768 } 7769 } else { 7770 var _v10 = A2($elm$json$Json$Decode$decodeValue, decodeRunnerSuccess, val); 7771 if (!_v10.$) { 7772 var a = _v10.a; 7773 return $andrewMacmurray$elm_concurrent_task$ConcurrentTask$Internal$Success(a); 7774 } else { 7775 var e = _v10.a; 7776 return $andrewMacmurray$elm_concurrent_task$ConcurrentTask$Internal$UnexpectedError( 7777 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$Internal$ResponseDecoderFailure( 7778 {gi: e, n: def.n})); 7779 } 7780 } 7781 }; 7782 var decodeExpectNoErrors = function (_v7) { 7783 var _v5 = A2($elm$json$Json$Decode$decodeValue, decodeRunnerError, val); 7784 if (!_v5.$) { 7785 var err = _v5.a; 7786 return $andrewMacmurray$elm_concurrent_task$ConcurrentTask$Internal$UnexpectedError(err); 7787 } else { 7788 var _v6 = A2($elm$json$Json$Decode$decodeValue, decodeRunnerSuccess, val); 7789 if (!_v6.$) { 7790 var a = _v6.a; 7791 return $andrewMacmurray$elm_concurrent_task$ConcurrentTask$Internal$Success(a); 7792 } else { 7793 var e = _v6.a; 7794 return $andrewMacmurray$elm_concurrent_task$ConcurrentTask$Internal$UnexpectedError( 7795 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$Internal$ResponseDecoderFailure( 7796 {gi: e, n: def.n})); 7797 } 7798 } 7799 }; 7800 var decodeExpectErrors = function (expect) { 7801 var decodeExpectErrorField = function (decoder) { 7802 return A2( 7803 $elm$json$Json$Decode$field, 7804 'value', 7805 A2($elm$json$Json$Decode$field, 'error', decoder)); 7806 }; 7807 var _v1 = A2($elm$json$Json$Decode$decodeValue, decodeRunnerError, val); 7808 if (!_v1.$) { 7809 var err = _v1.a; 7810 return $andrewMacmurray$elm_concurrent_task$ConcurrentTask$Internal$UnexpectedError(err); 7811 } else { 7812 var _v2 = A2( 7813 $elm$json$Json$Decode$decodeValue, 7814 decodeExpectErrorField($elm$json$Json$Decode$value), 7815 val); 7816 if (!_v2.$) { 7817 var _v3 = A2( 7818 $elm$json$Json$Decode$decodeValue, 7819 decodeExpectErrorField(expect), 7820 val); 7821 if (!_v3.$) { 7822 var err_ = _v3.a; 7823 return $andrewMacmurray$elm_concurrent_task$ConcurrentTask$Internal$Error(err_); 7824 } else { 7825 var e_ = _v3.a; 7826 return $andrewMacmurray$elm_concurrent_task$ConcurrentTask$Internal$UnexpectedError( 7827 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$Internal$ErrorsDecoderFailure( 7828 {gi: e_, n: def.n})); 7829 } 7830 } else { 7831 var _v4 = A2($elm$json$Json$Decode$decodeValue, decodeRunnerSuccess, val); 7832 if (!_v4.$) { 7833 var a = _v4.a; 7834 return $andrewMacmurray$elm_concurrent_task$ConcurrentTask$Internal$Success(a); 7835 } else { 7836 var e_ = _v4.a; 7837 return $andrewMacmurray$elm_concurrent_task$ConcurrentTask$Internal$UnexpectedError( 7838 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$Internal$ResponseDecoderFailure( 7839 {gi: e_, n: def.n})); 7840 } 7841 } 7842 } 7843 }; 7844 var _v0 = def.l; 7845 switch (_v0.$) { 7846 case 1: 7847 var _catch = _v0.a; 7848 return decodeExpectThrows(_catch); 7849 case 2: 7850 var expect = _v0.a; 7851 return decodeExpectErrors(expect); 7852 default: 7853 return decodeExpectNoErrors(0); 7854 } 7855 }); 7856var $elm$core$Array$fromListHelp = F3( 7857 function (list, nodeList, nodeListSize) { 7858 fromListHelp: 7859 while (true) { 7860 var _v0 = A2($elm$core$Elm$JsArray$initializeFromList, $elm$core$Array$branchFactor, list); 7861 var jsArray = _v0.a; 7862 var remainingItems = _v0.b; 7863 if (_Utils_cmp( 7864 $elm$core$Elm$JsArray$length(jsArray), 7865 $elm$core$Array$branchFactor) < 0) { 7866 return A2( 7867 $elm$core$Array$builderToArray, 7868 true,
7869 {Q: nodeList, I: nodeListSize, ky: jsArray}); 7870 } else { 7871 var $temp$list = remainingItems, 7872 $temp$nodeList = A2( 7873 $elm$core$List$cons, 7874 $elm$core$Array$Leaf(jsArray), 7875 nodeList), 7876 $temp$nodeListSize = nodeListSize + 1; 7877 list = $temp$list; 7878 nodeList = $temp$nodeList; 7879 nodeListSize = $temp$nodeListSize; 7880 continue fromListHelp; 7881 } 7882 } 7883 }); 7884var $elm$core$Array$fromList = function (list) { 7885 if (!list.b) { 7886 return $elm$core$Array$empty; 7887 } else { 7888 return A3($elm$core$Array$fromListHelp, list, _List_Nil, 0); 7889 } 7890}; 7891var $andrewMacmurray$elm_concurrent_task$ConcurrentTask$Internal$runWith = F2( 7892 function (s, _v0) { 7893 var run = _v0; 7894 return F2( 7895 function (res, _v1) { 7896 return A2(run, res, s); 7897 }); 7898 }); 7899var $andrewMacmurray$elm_concurrent_task$ConcurrentTask$Internal$define = function (def) { 7900 return F2( 7901 function (results, ids) { 7902 var taskId = $andrewMacmurray$elm_concurrent_task$ConcurrentTask$Internal$Ids$get(ids); 7903 return _Utils_Tuple2( 7904 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$Internal$Ids$next(ids), 7905 A2( 7906 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$Internal$Pending, 7907 $elm$core$Array$fromList( 7908 _List_fromArray( 7909 [ 7910 {k: def.k, n: def.n, bB: taskId} 7911 ])), 7912 function () { 7913 var _v0 = A2($elm$core$Dict$get, taskId, results); 7914 if (!_v0.$) { 7915 var result = _v0.a; 7916 return $andrewMacmurray$elm_concurrent_task$ConcurrentTask$Internal$wrap( 7917 A2($andrewMacmurray$elm_concurrent_task$ConcurrentTask$Internal$decodeResponse, def, result)); 7918 } else { 7919 return A2( 7920 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$Internal$runWith, 7921 ids, 7922 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$Internal$define(def)); 7923 } 7924 }())); 7925 }); 7926}; 7927var $andrewMacmurray$elm_concurrent_task$ConcurrentTask$define = $andrewMacmurray$elm_concurrent_task$ConcurrentTask$Internal$define; 7928var $author$project$IndexedDb$AlreadyExists = {$: 0}; 7929var $author$project$IndexedDb$DatabaseError = function (a) { 7930 return {$: 3, a: a}; 7931}; 7932var $author$project$IndexedDb$QuotaExceeded = {$: 2}; 7933var $author$project$IndexedDb$TransactionError = function (a) { 7934 return {$: 1, a: a}; 7935}; 7936var $elm$json$Json$Decode$fail = _Json_fail; 7937var $author$project$IndexedDb$splitOnce = F2( 7938 function (sep, str) { 7939 var _v0 = A2($elm$core$String$indexes, sep, str); 7940 if (_v0.b) { 7941 var i = _v0.a; 7942 return $elm$core$Maybe$Just( 7943 _Utils_Tuple2( 7944 A2($elm$core$String$left, i, str), 7945 A2( 7946 $elm$core$String$dropLeft, 7947 i + $elm$core$String$length(sep), 7948 str))); 7949 } else { 7950 return $elm$core$Maybe$Nothing; 7951 } 7952 }); 7953var $author$project$IndexedDb$errorDecoder = A2( 7954 $elm$json$Json$Decode$andThen, 7955 function (err) { 7956 if (err === 'ALREADY_EXISTS') { 7957 return $elm$json$Json$Decode$succeed($author$project$IndexedDb$AlreadyExists); 7958 } else { 7959 if (err === 'QUOTA_EXCEEDED') { 7960 return $elm$json$Json$Decode$succeed($author$project$IndexedDb$QuotaExceeded); 7961 } else { 7962 var _v0 = A2($author$project$IndexedDb$splitOnce, ':', err); 7963 _v0$2: 7964 while (true) { 7965 if (!_v0.$) { 7966 switch (_v0.a.a) { 7967 case 'TRANSACTION_ERROR': 7968 var _v1 = _v0.a; 7969 var msg = _v1.b; 7970 return $elm$json$Json$Decode$succeed( 7971 $author$project$IndexedDb$TransactionError(msg)); 7972 case 'DATABASE_ERROR': 7973 var _v2 = _v0.a; 7974 var msg = _v2.b; 7975 return $elm$json$Json$Decode$succeed( 7976 $author$project$IndexedDb$DatabaseError(msg)); 7977 default: 7978 break _v0$2; 7979 } 7980 } else { 7981 break _v0$2; 7982 } 7983 } 7984 return $elm$json$Json$Decode$fail('Unknown IndexedDB error: ' + err); 7985 } 7986 } 7987 }, 7988 $elm$json$Json$Decode$string); 7989var $andrewMacmurray$elm_concurrent_task$ConcurrentTask$Internal$ExpectErrors = function (a) { 7990 return {$: 2, a: a}; 7991}; 7992var $andrewMacmurray$elm_concurrent_task$ConcurrentTask$expectErrors = $andrewMacmurray$elm_concurrent_task$ConcurrentTask$Internal$ExpectErrors; 7993var $andrewMacmurray$elm_concurrent_task$ConcurrentTask$Internal$ExpectJson = $elm$core$Basics$identity; 7994var $andrewMacmurray$elm_concurrent_task$ConcurrentTask$expectJson = $elm$core$Basics$identity; 7995var $author$project$IndexedDb$getDbName = function (_v0) { 7996 var name = _v0; 7997 return name; 7998}; 7999var $author$project$IndexedDb$getStoreName = function (_v0) { 8000 var config = _v0; 8001 return config.bW; 8002}; 8003var $author$project$IndexedDb$CompoundKey = function (a) { 8004 return {$: 4, a: a}; 8005}; 8006var $author$project$IndexedDb$FloatKey = function (a) { 8007 return {$: 2, a: a}; 8008}; 8009var $author$project$IndexedDb$IntKey = function (a) { 8010 return {$: 1, a: a}; 8011}; 8012var $author$project$IndexedDb$PosixKey = function (a) { 8013 return {$: 3, a: a}; 8014}; 8015var $author$project$IndexedDb$StringKey = function (a) { 8016 return {$: 0, a: a}; 8017}; 8018var $elm$json$Json$Decode$float = _Json_decodeFloat; 8019var $elm$json$Json$Decode$int = _Json_decodeInt; 8020var $elm$json$Json$Decode$lazy = function (thunk) { 8021 return A2( 8022 $elm$json$Json$Decode$andThen, 8023 thunk, 8024 $elm$json$Json$Decode$succeed(0)); 8025}; 8026var $elm$json$Json$Decode$list = _Json_decodeList; 8027function $author$project$IndexedDb$cyclic$keyDecoder() { 8028 return A2( 8029 $elm$json$Json$Decode$andThen, 8030 function (t) { 8031 switch (t) { 8032 case 'string': 8033 return A2( 8034 $elm$json$Json$Decode$map, 8035 $author$project$IndexedDb$StringKey, 8036 A2($elm$json$Json$Decode$field, 'value', $elm$json$Json$Decode$string)); 8037 case 'int': 8038 return A2( 8039 $elm$json$Json$Decode$map, 8040 $author$project$IndexedDb$IntKey, 8041 A2($elm$json$Json$Decode$field, 'value', $elm$json$Json$Decode$int)); 8042 case 'float': 8043 return A2( 8044 $elm$json$Json$Decode$map, 8045 $author$project$IndexedDb$FloatKey, 8046 A2($elm$json$Json$Decode$field, 'value', $elm$json$Json$Decode$float)); 8047 case 'posix': 8048 return A2( 8049 $elm$json$Json$Decode$map, 8050 function (ms) { 8051 return $author$project$IndexedDb$PosixKey( 8052 $elm$time$Time$millisToPosix(ms)); 8053 }, 8054 A2($elm$json$Json$Decode$field, 'value', $elm$json$Json$Decode$int)); 8055 case 'compound': 8056 return A2( 8057 $elm$json$Json$Decode$map, 8058 $author$project$IndexedDb$CompoundKey, 8059 A2( 8060 $elm$json$Json$Decode$field, 8061 'value', 8062 $elm$json$Json$Decode$list( 8063 $elm$json$Json$Decode$lazy( 8064 function (_v1) { 8065 return $author$project$IndexedDb$cyclic$keyDecoder(); 8066 })))); 8067 default: 8068 return $elm$json$Json$Decode$fail('Unknown key type: ' + t); 8069 } 8070 }, 8071 A2($elm$json$Json$Decode$field, 'type', $elm$json$Json$Decode$string)); 8072}
8073var $author$project$IndexedDb$keyDecoder = $author$project$IndexedDb$cyclic$keyDecoder(); 8074$author$project$IndexedDb$cyclic$keyDecoder = function () { 8075 return $author$project$IndexedDb$keyDecoder; 8076}; 8077var $author$project$IndexedDb$getAllKeys = F2( 8078 function (db, store) { 8079 return $andrewMacmurray$elm_concurrent_task$ConcurrentTask$define( 8080 { 8081 k: $elm$json$Json$Encode$object( 8082 _List_fromArray( 8083 [ 8084 _Utils_Tuple2( 8085 'db', 8086 $elm$json$Json$Encode$string( 8087 $author$project$IndexedDb$getDbName(db))), 8088 _Utils_Tuple2( 8089 'store', 8090 $elm$json$Json$Encode$string( 8091 $author$project$IndexedDb$getStoreName(store))) 8092 ])), 8093 l: $andrewMacmurray$elm_concurrent_task$ConcurrentTask$expectErrors($author$project$IndexedDb$errorDecoder), 8094 m: $andrewMacmurray$elm_concurrent_task$ConcurrentTask$expectJson( 8095 $elm$json$Json$Decode$list($author$project$IndexedDb$keyDecoder)), 8096 n: 'indexeddb:getAllKeys' 8097 }); 8098 }); 8099var $elm$core$Tuple$pair = F2( 8100 function (a, b) { 8101 return _Utils_Tuple2(a, b); 8102 }); 8103var $author$project$IndexedDb$getAll = F3( 8104 function (db, store, decoder) { 8105 return $andrewMacmurray$elm_concurrent_task$ConcurrentTask$define( 8106 { 8107 k: $elm$json$Json$Encode$object( 8108 _List_fromArray( 8109 [ 8110 _Utils_Tuple2( 8111 'db', 8112 $elm$json$Json$Encode$string( 8113 $author$project$IndexedDb$getDbName(db))), 8114 _Utils_Tuple2( 8115 'store', 8116 $elm$json$Json$Encode$string( 8117 $author$project$IndexedDb$getStoreName(store))) 8118 ])), 8119 l: $andrewMacmurray$elm_concurrent_task$ConcurrentTask$expectErrors($author$project$IndexedDb$errorDecoder), 8120 m: $andrewMacmurray$elm_concurrent_task$ConcurrentTask$expectJson( 8121 $elm$json$Json$Decode$list( 8122 A3( 8123 $elm$json$Json$Decode$map2, 8124 $elm$core$Tuple$pair, 8125 A2($elm$json$Json$Decode$field, 'key', $author$project$IndexedDb$keyDecoder), 8126 A2($elm$json$Json$Decode$field, 'value', decoder)))), 8127 n: 'indexeddb:getAll' 8128 }); 8129 }); 8130var $author$project$Infra$Storage$notifyTopicsStore = $author$project$IndexedDb$defineStore('notifyTopics'); 8131var $author$project$Infra$Storage$stringKey = function (key) { 8132 if (!key.$) { 8133 var str = key.a; 8134 return $elm$core$Maybe$Just(str); 8135 } else { 8136 return $elm$core$Maybe$Nothing; 8137 } 8138}; 8139var $author$project$Infra$Storage$loadAllNotifyTopics = function (db) { 8140 return A2( 8141 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$map, 8142 $elm$core$List$filterMap( 8143 function (_v0) { 8144 var key = _v0.a; 8145 var topic = _v0.b; 8146 return A2( 8147 $elm$core$Maybe$map, 8148 function (gid) { 8149 return _Utils_Tuple2(gid, topic); 8150 }, 8151 $author$project$Infra$Storage$stringKey(key)); 8152 }), 8153 A3($author$project$IndexedDb$getAll, db, $author$project$Infra$Storage$notifyTopicsStore, $elm$json$Json$Decode$string)); 8154}; 8155var $andrewMacmurray$elm_concurrent_task$ConcurrentTask$map2 = F3( 8156 function (f, t1, t2) { 8157 return A2( 8158 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$andMap, 8159 t2, 8160 A2( 8161 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$andMap, 8162 t1, 8163 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$succeed(f))); 8164 }); 8165var $author$project$Infra$Storage$loadActivityMarkers = function (db) { 8166 return A3( 8167 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$map2, 8168 F2( 8169 function (markerKeys, topics) { 8170 var topicToGroup = $elm$core$Dict$fromList( 8171 A2( 8172 $elm$core$List$map, 8173 function (_v0) { 8174 var gid = _v0.a; 8175 var topic = _v0.b; 8176 return _Utils_Tuple2(topic, gid); 8177 }, 8178 topics)); 8179 return $elm$core$Set$fromList( 8180 A2( 8181 $elm$core$List$map, 8182 function (key) { 8183 return A2( 8184 $elm$core$Maybe$withDefault, 8185 key, 8186 A2($elm$core$Dict$get, key, topicToGroup)); 8187 }, 8188 A2($elm$core$List$filterMap, $author$project$Infra$Storage$stringKey, markerKeys))); 8189 }), 8190 A2($author$project$IndexedDb$getAllKeys, db, $author$project$Infra$Storage$activityMarkersStore), 8191 $author$project$Infra$Storage$loadAllNotifyTopics(db)); 8192}; 8193var $author$project$IndexedDb$withKeyPath = F2( 8194 function (path, _v0) { 8195 var config = _v0; 8196 return _Utils_update( 8197 config, 8198 {
8199 bS: $elm$core$Maybe$Just(path) 8200 }); 8201 }); 8202var $author$project$Infra$Storage$groupsStore = A2( 8203 $author$project$IndexedDb$withKeyPath, 8204 'id', 8205 $author$project$IndexedDb$defineStore('groups')); 8206var $author$project$Domain$Group$andMap = $elm$json$Json$Decode$map2($elm$core$Basics$apR); 8207var $author$project$Domain$Currency$ARS = 9; 8208var $author$project$Domain$Currency$AUD = 5; 8209var $author$project$Domain$Currency$BRL = 8; 8210var $author$project$Domain$Currency$CAD = 6; 8211var $author$project$Domain$Currency$CHF = 3; 8212var $author$project$Domain$Currency$EUR = 1; 8213var $author$project$Domain$Currency$GBP = 2; 8214var $author$project$Domain$Currency$JPY = 4; 8215var $author$project$Domain$Currency$NZD = 7; 8216var $author$project$Domain$Currency$USD = 0; 8217var $author$project$Domain$Currency$currencyDecoder = A2( 8218 $elm$json$Json$Decode$andThen, 8219 function (s) { 8220 switch (s) { 8221 case 'usd': 8222 return $elm$json$Json$Decode$succeed(0); 8223 case 'eur': 8224 return $elm$json$Json$Decode$succeed(1); 8225 case 'gbp': 8226 return $elm$json$Json$Decode$succeed(2); 8227 case 'chf': 8228 return $elm$json$Json$Decode$succeed(3); 8229 case 'jpy': 8230 return $elm$json$Json$Decode$succeed(4); 8231 case 'aud': 8232 return $elm$json$Json$Decode$succeed(5); 8233 case 'cad': 8234 return $elm$json$Json$Decode$succeed(6); 8235 case 'nzd': 8236 return $elm$json$Json$Decode$succeed(7); 8237 case 'brl': 8238 return $elm$json$Json$Decode$succeed(8); 8239 case 'ars': 8240 return $elm$json$Json$Decode$succeed(9); 8241 default: 8242 return $elm$json$Json$Decode$fail('Unknown currency: ' + s); 8243 } 8244 }, 8245 $elm$json$Json$Decode$string); 8246var $elm$json$Json$Decode$oneOf = _Json_oneOf; 8247var $elm$json$Json$Decode$maybe = function (decoder) { 8248 return $elm$json$Json$Decode$oneOf( 8249 _List_fromArray( 8250 [ 8251 A2($elm$json$Json$Decode$map, $elm$core$Maybe$Just, decoder), 8252 $elm$json$Json$Decode$succeed($elm$core$Maybe$Nothing) 8253 ])); 8254}; 8255var $author$project$Domain$Group$summaryDecoder = A2( 8256 $author$project$Domain$Group$andMap, 8257 $elm$json$Json$Decode$maybe( 8258 A2( 8259 $elm$json$Json$Decode$map, 8260 $elm$time$Time$millisToPosix, 8261 A2($elm$json$Json$Decode$field, 'ls', $elm$json$Json$Decode$int))), 8262 A2( 8263 $author$project$Domain$Group$andMap, 8264 A2($elm$json$Json$Decode$field, 'mb', $elm$json$Json$Decode$int), 8265 A2( 8266 $author$project$Domain$Group$andMap, 8267 A2($elm$json$Json$Decode$field, 'mc', $elm$json$Json$Decode$int), 8268 A2( 8269 $author$project$Domain$Group$andMap, 8270 A2( 8271 $elm$json$Json$Decode$map, 8272 $elm$time$Time$millisToPosix, 8273 A2($elm$json$Json$Decode$field, 'ca', $elm$json$Json$Decode$int)), 8274 A2( 8275 $author$project$Domain$Group$andMap, 8276 A2($elm$json$Json$Decode$field, 'ar', $elm$json$Json$Decode$bool), 8277 A2( 8278 $author$project$Domain$Group$andMap, 8279 A2($elm$json$Json$Decode$field, 'sub', $elm$json$Json$Decode$bool), 8280 A2( 8281 $author$project$Domain$Group$andMap, 8282 A2($elm$json$Json$Decode$field, 'dc', $author$project$Domain$Currency$currencyDecoder), 8283 A2( 8284 $author$project$Domain$Group$andMap, 8285 A2($elm$json$Json$Decode$field, 'n', $elm$json$Json$Decode$string), 8286 A2( 8287 $author$project$Domain$Group$andMap, 8288 A2($elm$json$Json$Decode$field, 'id', $elm$json$Json$Decode$string), 8289 $elm$json$Json$Decode$succeed( 8290 F9( 8291 function (id, name, dc, sub, ar, ca, mc, mb, ls) { 8292 return { 8293 f2: ca, 8294 il: dc, 8295 m9: id, 8296 gA: ar, 8297 gC: sub, 8298 gF: A2($elm$core$Maybe$withDefault, ca, ls), 8299 gL: mc, 8300 gS: mb, 8301 bW: name 8302 }; 8303 }))))))))))); 8304var $author$project$Infra$Storage$loadAllGroups = function (db) { 8305 return A2( 8306 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$map, 8307 A2( 8308 $elm$core$Basics$composeR, 8309 $elm$core$List$map( 8310 function (_v0) { 8311 var s = _v0.b; 8312 return _Utils_Tuple2(s.m9, s); 8313 }), 8314 $elm$core$Dict$fromList), 8315 A3($author$project$IndexedDb$getAll, db, $author$project$Infra$Storage$groupsStore, $author$project$Domain$Group$summaryDecoder)); 8316}; 8317var $elm$json$Json$Encode$float = _Json_wrap; 8318var $elm$json$Json$Encode$int = _Json_wrap; 8319var $elm$json$Json$Encode$list = F2( 8320 function (func, entries) { 8321 return _Json_wrap( 8322 A3( 8323 $elm$core$List$foldl, 8324 _Json_addEntry(func), 8325 _Json_emptyArray(0),
8326 entries)); 8327 }); 8328var $elm$time$Time$posixToMillis = function (_v0) { 8329 var millis = _v0; 8330 return millis; 8331}; 8332var $author$project$IndexedDb$encodeKey = function (key) { 8333 switch (key.$) { 8334 case 0: 8335 var s = key.a; 8336 return $elm$json$Json$Encode$object( 8337 _List_fromArray( 8338 [ 8339 _Utils_Tuple2( 8340 'type', 8341 $elm$json$Json$Encode$string('string')), 8342 _Utils_Tuple2( 8343 'value', 8344 $elm$json$Json$Encode$string(s)) 8345 ])); 8346 case 1: 8347 var i = key.a; 8348 return $elm$json$Json$Encode$object( 8349 _List_fromArray( 8350 [ 8351 _Utils_Tuple2( 8352 'type', 8353 $elm$json$Json$Encode$string('int')), 8354 _Utils_Tuple2( 8355 'value', 8356 $elm$json$Json$Encode$int(i)) 8357 ])); 8358 case 2: 8359 var f = key.a; 8360 return $elm$json$Json$Encode$object( 8361 _List_fromArray( 8362 [ 8363 _Utils_Tuple2( 8364 'type', 8365 $elm$json$Json$Encode$string('float')), 8366 _Utils_Tuple2( 8367 'value', 8368 $elm$json$Json$Encode$float(f)) 8369 ])); 8370 case 3: 8371 var time = key.a; 8372 return $elm$json$Json$Encode$object( 8373 _List_fromArray( 8374 [ 8375 _Utils_Tuple2( 8376 'type', 8377 $elm$json$Json$Encode$string('posix')), 8378 _Utils_Tuple2( 8379 'value', 8380 $elm$json$Json$Encode$int( 8381 $elm$time$Time$posixToMillis(time))) 8382 ])); 8383 default: 8384 var keys = key.a; 8385 return $elm$json$Json$Encode$object( 8386 _List_fromArray( 8387 [ 8388 _Utils_Tuple2( 8389 'type', 8390 $elm$json$Json$Encode$string('compound')), 8391 _Utils_Tuple2( 8392 'value', 8393 A2($elm$json$Json$Encode$list, $author$project$IndexedDb$encodeKey, keys)) 8394 ])); 8395 } 8396}; 8397var $elm$json$Json$Decode$null = _Json_decodeNull; 8398var $elm$json$Json$Decode$nullable = function (decoder) { 8399 return $elm$json$Json$Decode$oneOf( 8400 _List_fromArray( 8401 [ 8402 $elm$json$Json$Decode$null($elm$core$Maybe$Nothing), 8403 A2($elm$json$Json$Decode$map, $elm$core$Maybe$Just, decoder) 8404 ])); 8405}; 8406var $author$project$IndexedDb$get = F4( 8407 function (db, store, key, decoder) { 8408 return $andrewMacmurray$elm_concurrent_task$ConcurrentTask$define( 8409 { 8410 k: $elm$json$Json$Encode$object( 8411 _List_fromArray( 8412 [ 8413 _Utils_Tuple2( 8414 'db', 8415 $elm$json$Json$Encode$string( 8416 $author$project$IndexedDb$getDbName(db))), 8417 _Utils_Tuple2( 8418 'store', 8419 $elm$json$Json$Encode$string( 8420 $author$project$IndexedDb$getStoreName(store))), 8421 _Utils_Tuple2( 8422 'key', 8423 $author$project$IndexedDb$encodeKey(key)) 8424 ])), 8425 l: $andrewMacmurray$elm_concurrent_task$ConcurrentTask$expectErrors($author$project$IndexedDb$errorDecoder), 8426 m: $andrewMacmurray$elm_concurrent_task$ConcurrentTask$expectJson( 8427 $elm$json$Json$Decode$nullable(decoder)), 8428 n: 'indexeddb:get' 8429 }); 8430 }); 8431var $author$project$Infra$Storage$identityStore = $author$project$IndexedDb$defineStore('identity'); 8432var $author$project$Infra$Storage$loadDevMode = function (db) { 8433 return A2( 8434 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$map, 8435 $elm$core$Maybe$withDefault(false), 8436 A4( 8437 $author$project$IndexedDb$get, 8438 db, 8439 $author$project$Infra$Storage$identityStore, 8440 $author$project$IndexedDb$StringKey('devMode'), 8441 $elm$json$Json$Decode$bool)); 8442}; 8443var $author$project$Domain$FeedbackMoment$History = $elm$core$Basics$identity; 8444var $elm$json$Json$Decode$keyValuePairs = _Json_decodeKeyValuePairs; 8445var $elm$json$Json$Decode$dict = function (decoder) { 8446 return A2( 8447 $elm$json$Json$Decode$map, 8448 $elm$core$Dict$fromList, 8449 $elm$json$Json$Decode$keyValuePairs(decoder)); 8450}; 8451var $elm$json$Json$Decode$index = _Json_decodeIndex; 8452var $author$project$Domain$FeedbackMoment$decoder = A3( 8453 $elm$json$Json$Decode$map2, 8454 F2( 8455 function (shownAt, asked) { 8456 return {cd: asked, b0: shownAt}; 8457 }), 8458 A2( 8459 $elm$json$Json$Decode$field, 8460 'shownAt', 8461 $elm$json$Json$Decode$dict( 8462 A2($elm$json$Json$Decode$map, $elm$time$Time$millisToPosix, $elm$json$Json$Decode$int))), 8463 A2( 8464 $elm$json$Json$Decode$field, 8465 'asked', 8466 A2( 8467 $elm$json$Json$Decode$map, 8468 $elm$core$Set$fromList, 8469 $elm$json$Json$Decode$list( 8470 A3( 8471 $elm$json$Json$Decode$map2, 8472 $elm$core$Tuple$pair, 8473 A2($elm$json$Json$Decode$index, 0, $elm$json$Json$Decode$string), 8474 A2($elm$json$Json$Decode$index, 1, $elm$json$Json$Decode$string)))))); 8475var $author$project$Domain$FeedbackMoment$empty = {cd: $elm$core$Set$empty, b0: $elm$core$Dict$empty}; 8476var $author$project$Infra$Storage$loadFeedbackPrompts = function (db) { 8477 return A2( 8478 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$map, 8479 $elm$core$Maybe$withDefault($author$project$Domain$FeedbackMoment$empty), 8480 A4( 8481 $author$project$IndexedDb$get, 8482 db, 8483 $author$project$Infra$Storage$identityStore, 8484 $author$project$IndexedDb$StringKey('feedbackPrompts'), 8485 $author$project$Domain$FeedbackMoment$decoder)); 8486}; 8487var $author$project$Infra$Identity$Identity = F3( 8488 function (publicKeyHash, signingKeyPair, previousDeviceIds) { 8489 return {ff: previousDeviceIds, aK: publicKeyHash, dV: signingKeyPair}; 8490 }); 8491var $elm$json$Json$Decode$map3 = _Json_map3; 8492var $author$project$WebCrypto$Signature$SerializedSigningKeyPair = F2( 8493 function (publicKey, privateKey) { 8494 return {fh: privateKey, jO: publicKey}; 8495 }); 8496var $author$project$WebCrypto$Signature$serializedSigningKeyPairDecoder = A3( 8497 $elm$json$Json$Decode$map2, 8498 $author$project$WebCrypto$Signature$SerializedSigningKeyPair, 8499 A2($elm$json$Json$Decode$field, 'publicKey', $elm$json$Json$Decode$string), 8500 A2($elm$json$Json$Decode$field, 'privateKey', $elm$json$Json$Decode$string)); 8501var $author$project$Infra$Identity$decoder = A4( 8502 $elm$json$Json$Decode$map3, 8503 $author$project$Infra$Identity$Identity, 8504 A2($elm$json$Json$Decode$field, 'publicKeyHash', $elm$json$Json$Decode$string), 8505 A2($elm$json$Json$Decode$field, 'signingKeyPair', $author$project$WebCrypto$Signature$serializedSigningKeyPairDecoder), 8506 $elm$json$Json$Decode$oneOf( 8507 _List_fromArray( 8508 [ 8509 A2( 8510 $elm$json$Json$Decode$field, 8511 'previousDeviceIds', 8512 $elm$json$Json$Decode$list($elm$json$Json$Decode$string)), 8513 $elm$json$Json$Decode$succeed(_List_Nil) 8514 ]))); 8515var $author$project$Infra$Storage$loadIdentity = function (db) { 8516 return A4( 8517 $author$project$IndexedDb$get, 8518 db, 8519 $author$project$Infra$Storage$identityStore, 8520 $author$project$IndexedDb$StringKey('default'), 8521 $author$project$Infra$Identity$decoder); 8522}; 8523var $author$project$Infra$Storage$loadLanguage = function (db) { 8524 return A4( 8525 $author$project$IndexedDb$get, 8526 db, 8527 $author$project$Infra$Storage$identityStore, 8528 $author$project$IndexedDb$StringKey('language'), 8529 $elm$json$Json$Decode$string); 8530}; 8531var $author$project$Infra$Storage$loadLastSeenChangelog = function (db) { 8532 return A4( 8533 $author$project$IndexedDb$get, 8534 db, 8535 $author$project$Infra$Storage$identityStore, 8536 $author$project$IndexedDb$StringKey('lastSeenChangelog'), 8537 $elm$json$Json$Decode$string); 8538}; 8539var $author$project$Infra$Storage$nonEmpty = function (text) { 8540 return $elm$core$String$isEmpty(text) ? $elm$core$Maybe$Nothing : $elm$core$Maybe$Just(text); 8541}; 8542var $author$project$Infra$Storage$loadPushServerUrl = function (db) { 8543 return A2( 8544 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$map, 8545 $elm$core$Maybe$andThen($author$project$Infra$Storage$nonEmpty), 8546 A4( 8547 $author$project$IndexedDb$get, 8548 db, 8549 $author$project$Infra$Storage$identityStore, 8550 $author$project$IndexedDb$StringKey('pushServerUrl'), 8551 $elm$json$Json$Decode$string)); 8552}; 8553var $author$project$Domain$Member$Metadata = F4( 8554 function (phone, email, payment, notes) { 8555 return {is: email, bu: notes, jD: payment, jF: phone}; 8556 }); 8557var $elm$core$String$trim = _String_trim; 8558var $author$project$Domain$PaymentMethod$normalize = function (raw) { 8559 var _v0 = $elm$core$String$trim(raw); 8560 if (_v0 === '') { 8561 return $elm$core$Maybe$Nothing; 8562 } else { 8563 var handle = _v0; 8564 return $elm$core$Maybe$Just(handle); 8565 } 8566}; 8567var $author$project$Domain$PaymentMethod$decoder = A2( 8568 $elm$json$Json$Decode$map, 8569 A2( 8570 $elm$core$Basics$composeR, 8571 $elm$core$List$filterMap( 8572 function (_v0) { 8573 var key = _v0.a; 8574 var value = _v0.b; 8575 return A2( 8576 $elm$core$Maybe$map, 8577 $elm$core$Tuple$pair(key), 8578 A2($elm$core$Maybe$andThen, $author$project$Domain$PaymentMethod$normalize, value)); 8579 }), 8580 $elm$core$Dict$fromList),
8581 $elm$json$Json$Decode$keyValuePairs( 8582 $elm$json$Json$Decode$maybe($elm$json$Json$Decode$string))); 8583var $elm$json$Json$Decode$map4 = _Json_map4; 8584var $author$project$Domain$Member$metadataDecoder = A5( 8585 $elm$json$Json$Decode$map4, 8586 $author$project$Domain$Member$Metadata, 8587 $elm$json$Json$Decode$maybe( 8588 A2($elm$json$Json$Decode$field, 'ph', $elm$json$Json$Decode$string)), 8589 $elm$json$Json$Decode$maybe( 8590 A2($elm$json$Json$Decode$field, 'em', $elm$json$Json$Decode$string)), 8591 $elm$json$Json$Decode$oneOf( 8592 _List_fromArray( 8593 [ 8594 A2($elm$json$Json$Decode$field, 'pm', $author$project$Domain$PaymentMethod$decoder), 8595 $elm$json$Json$Decode$succeed($author$project$Domain$PaymentMethod$empty) 8596 ])), 8597 $elm$json$Json$Decode$maybe( 8598 A2($elm$json$Json$Decode$field, 'nt', $elm$json$Json$Decode$string))); 8599var $author$project$Infra$Storage$loadSelfProfile = function (db) { 8600 return A4( 8601 $author$project$IndexedDb$get, 8602 db, 8603 $author$project$Infra$Storage$identityStore, 8604 $author$project$IndexedDb$StringKey('selfProfile'), 8605 $author$project$Domain$Member$metadataDecoder); 8606}; 8607var $author$project$Infra$Storage$init = function (db) { 8608 return A2( 8609 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$andMap, 8610 $author$project$Infra$Storage$loadFeedbackPrompts(db), 8611 A2( 8612 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$andMap, 8613 $author$project$Infra$Storage$loadLastSeenChangelog(db), 8614 A2( 8615 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$andMap, 8616 $author$project$Infra$Storage$loadPushServerUrl(db), 8617 A2( 8618 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$andMap, 8619 $author$project$Infra$Storage$loadActivityMarkers(db), 8620 A2( 8621 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$andMap, 8622 $author$project$Infra$Storage$loadDevMode(db), 8623 A2( 8624 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$andMap, 8625 A2( 8626 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$map, 8627 $elm$core$Maybe$withDefault($author$project$Domain$Member$emptyMetadata), 8628 $author$project$Infra$Storage$loadSelfProfile(db)), 8629 A2( 8630 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$andMap, 8631 $author$project$Infra$Storage$loadLanguage(db), 8632 A2( 8633 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$andMap, 8634 $author$project$Infra$Storage$loadAllGroups(db), 8635 A2( 8636 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$andMap, 8637 $author$project$Infra$Storage$loadIdentity(db), 8638 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$succeed( 8639 $author$project$Infra$Storage$InitData(db))))))))))); 8640}; 8641var $author$project$Page$About$Loading = {$: 0}; 8642var $author$project$Page$About$init = {ch: false, ci: false, ft: $author$project$Page$About$Loading}; 8643var $author$project$Page$Group$OnTaskProgress = function (a) { 8644 return {$: 0, a: a}; 8645}; 8646var $author$project$Page$Group$SyncIdle = {$: 0}; 8647var $author$project$Page$Group$WorkspaceEmpty = {$: 0}; 8648var $author$project$Domain$GroupState$empty = { 8649 eb: _List_Nil, 8650 lp: $elm$core$Dict$empty, 8651 eg: $elm$core$Dict$empty, 8652 ly: $elm$core$Dict$empty, 8653 f3: $elm$core$Maybe$Nothing, 8654 aP: $elm$core$Dict$empty, 8655 E: $elm$core$Dict$empty, 8656 gk: $elm$core$Dict$empty, 8657 iO: { 8658 f2: $elm$time$Time$millisToPosix(0), 8659 il: 1, 8660 eE: $elm$core$Maybe$Nothing, 8661 cz: _List_Nil, 8662 bW: '', 8663 cY: $elm$core$Maybe$Nothing 8664 }, 8665 r: $elm$core$Dict$empty, 8666 cK: _List_Nil, 8667 fl: _List_Nil, 8668 qb: _List_Nil 8669}; 8670var $author$project$Page$Group$ActivityTab$Model = $elm$core$Basics$identity; 8671var $author$project$Domain$Filter$emptyActivityFilters = {ec: $elm$core$Set$empty, ed: $elm$core$Set$empty, i2: $elm$core$Set$empty}; 8672var $author$project$Page$Group$ActivityTab$init = {cq: $elm$core$Set$empty, a5: $author$project$Domain$Filter$emptyActivityFilters, cS: false}; 8673var $author$project$Page$Group$AddMember$Model = $elm$core$Basics$identity; 8674var $author$project$Page$Group$AddMember$init = {bW: '', d_: false}; 8675var $author$project$Page$Group$BalanceTab$AutomaticallySelectOutgoing = {$: 0}; 8676var $author$project$Page$Group$BalanceTab$Model = $elm$core$Basics$identity; 8677var $author$project$Page$Group$BalanceTab$init = {eJ: $elm$core$Maybe$Nothing, dM: $author$project$Page$Group$BalanceTab$AutomaticallySelectOutgoing}; 8678var $author$project$Page$Group$Diagnostics$init = $elm$core$Maybe$Nothing; 8679var $author$project$Page$Group$EditGroupMetadata$Model = $elm$core$Basics$identity; 8680var $dwayne$elm_form$Form$List$Forms = $elm$core$Basics$identity; 8681var $dwayne$elm_form$Form$List$append = F2( 8682 function (x, _v0) { 8683 var c = _v0; 8684 return _Utils_update( 8685 c, 8686 { 8687 _: _Utils_ap( 8688 c._, 8689 _List_fromArray( 8690 [ 8691 _Utils_Tuple2(c.m9, x) 8692 ])), 8693 m9: c.m9 + 1 8694 }); 8695 }); 8696var $dwayne$elm_field$Field$Advanced$Field = F2( 8697 function (a, b) { 8698 return {$: 0, a: a, b: b}; 8699 }); 8700var $dwayne$elm_validation$Validation$Failure = function (a) { 8701 return {$: 1, a: a}; 8702}; 8703var $dwayne$elm_validation$Validation$Success = function (a) { 8704 return {$: 0, a: a}; 8705}; 8706var $dwayne$elm_validation$Validation$fromResult = function (r) { 8707 if (!r.$) { 8708 var a = r.a; 8709 return $dwayne$elm_validation$Validation$Success(a); 8710 } else { 8711 var e = r.a; 8712 return $dwayne$elm_validation$Validation$Failure( 8713 _Utils_Tuple2(e, _List_Nil)); 8714 } 8715}; 8716var $dwayne$elm_field$Field$Advanced$fromString = F2( 8717 function (_v0, raw) { 8718 var converters = _v0; 8719 return A2( 8720 $dwayne$elm_field$Field$Advanced$Field, 8721 converters, 8722 { 8723 aO: true, 8724 ae: $dwayne$elm_validation$Validation$fromResult( 8725 converters.mM(raw)), 8726 jZ: raw 8727 }); 8728 }); 8729var $dwayne$elm_field$Field$Advanced$empty = function (tipe) { 8730 return A2($dwayne$elm_field$Field$Advanced$fromString, tipe, ''); 8731}; 8732var $dwayne$elm_field$Field$empty = $dwayne$elm_field$Field$Advanced$empty; 8733var $dwayne$elm_field$Field$Advanced$Type = $elm$core$Basics$identity; 8734var $dwayne$elm_field$Field$Advanced$customString = function (f) { 8735 var makeFromValue = A2($elm$core$Basics$composeR, $elm$core$String$trim, f); 8736 return {mM: makeFromValue, N: makeFromValue, qU: $elm$core$Basics$identity}; 8737}; 8738var $dwayne$elm_field$Field$Advanced$Blank = {$: 0}; 8739var $dwayne$elm_field$Field$Advanced$customTrim = F3( 8740 function (blank, f, s) { 8741 var t = $elm$core$String$trim(s); 8742 return $elm$core$String$isEmpty(t) ? $elm$core$Result$Err(blank) : f(t); 8743 }); 8744var $dwayne$elm_field$Field$Advanced$trim = $dwayne$elm_field$Field$Advanced$customTrim($dwayne$elm_field$Field$Advanced$Blank); 8745var $dwayne$elm_field$Field$Advanced$nonBlankString = $dwayne$elm_field$Field$Advanced$customString( 8746 $dwayne$elm_field$Field$Advanced$trim($elm$core$Result$Ok)); 8747var $dwayne$elm_field$Field$nonBlankString = $dwayne$elm_field$Field$Advanced$nonBlankString; 8748var $author$project$Form$EditGroupMetadata$emptyLabelField = $dwayne$elm_field$Field$empty($dwayne$elm_field$Field$nonBlankString); 8749var $dwayne$elm_field$Field$Advanced$customType = function (options) { 8750 return {mM: options.mM, N: $elm$core$Result$Ok, qU: options.qU}; 8751}; 8752var $dwayne$elm_field$Field$customType = $dwayne$elm_field$Field$Advanced$customType; 8753var $dwayne$elm_field$Field$trim = $dwayne$elm_field$Field$Advanced$trim; 8754var $dwayne$elm_field$Field$Advanced$ValidationError = function (a) { 8755 return {$: 2, a: a}; 8756}; 8757var $dwayne$elm_field$Field$Advanced$validationError = $dwayne$elm_field$Field$Advanced$ValidationError; 8758var $dwayne$elm_field$Field$validationError = $dwayne$elm_field$Field$Advanced$validationError; 8759var $author$project$Form$EditGroupMetadata$urlString = $dwayne$elm_field$Field$customType( 8760 { 8761 mM: $dwayne$elm_field$Field$trim( 8762 function (s) { 8763 return (A2($elm$core$String$startsWith, 'http://', s) || A2($elm$core$String$startsWith, 'https://', s)) ? $elm$core$Result$Ok(s) : $elm$core$Result$Err( 8764 $dwayne$elm_field$Field$validationError(s)); 8765 }), 8766 qU: $elm$core$Basics$identity 8767 }); 8768var $author$project$Form$EditGroupMetadata$emptyUrlField = $dwayne$elm_field$Field$empty($author$project$Form$EditGroupMetadata$urlString); 8769var $elm$core$List$filter = F2( 8770 function (isGood, list) { 8771 return A3( 8772 $elm$core$List$foldr, 8773 F2( 8774 function (x, xs) { 8775 return isGood(x) ? A2($elm$core$List$cons, x, xs) : xs; 8776 }), 8777 _List_Nil, 8778 list); 8779 }); 8780var $dwayne$elm_form$Form$get = F2( 8781 function (toAccessor, _v0) { 8782 var form = _v0; 8783 return toAccessor(form.hH).bn(form.hp); 8784 }); 8785var $elm$core$Tuple$second = function (_v0) { 8786 var y = _v0.b; 8787 return y; 8788}; 8789var $dwayne$elm_form$Form$List$get = F3( 8790 function (id, toAccessor, _v0) { 8791 var elements = _v0._; 8792 return A2( 8793 $elm$core$Maybe$map, 8794 A2( 8795 $elm$core$Basics$composeR, 8796 $elm$core$Tuple$second, 8797 $dwayne$elm_form$Form$get(toAccessor)), 8798 $elm$core$List$head( 8799 A2( 8800 $elm$core$List$filter, 8801 A2( 8802 $elm$core$Basics$composeR, 8803 $elm$core$Tuple$first, 8804 $elm$core$Basics$eq(id)), 8805 elements))); 8806 }); 8807var $dwayne$elm_validation$Validation$apply = F2( 8808 function (va, vf) { 8809 var _v0 = _Utils_Tuple2(va, vf); 8810 if (!_v0.a.$) { 8811 if (!_v0.b.$) { 8812 var a = _v0.a.a; 8813 var f = _v0.b.a; 8814 return $dwayne$elm_validation$Validation$Success( 8815 f(a)); 8816 } else { 8817 var xs = _v0.b.a; 8818 return $dwayne$elm_validation$Validation$Failure(xs); 8819 } 8820 } else { 8821 if (!_v0.b.$) { 8822 var ys = _v0.a.a; 8823 return $dwayne$elm_validation$Validation$Failure(ys); 8824 } else { 8825 var _v1 = _v0.a.a; 8826 var y = _v1.a; 8827 var ys = _v1.b; 8828 var _v2 = _v0.b.a; 8829 var x = _v2.a; 8830 var xs = _v2.b; 8831 return $dwayne$elm_validation$Validation$Failure( 8832 _Utils_Tuple2( 8833 x, 8834 _Utils_ap( 8835 xs, 8836 A2($elm$core$List$cons, y, ys)))); 8837 } 8838 } 8839 }); 8840var $dwayne$elm_field$Field$Advanced$toValidation = function (_v0) { 8841 var processed = _v0.b.ae; 8842 return processed; 8843}; 8844var $dwayne$elm_field$Field$Advanced$applyValidation = function (field) { 8845 return $dwayne$elm_validation$Validation$apply( 8846 $dwayne$elm_field$Field$Advanced$toValidation(field)); 8847}; 8848var $dwayne$elm_field$Field$applyValidation = $dwayne$elm_field$Field$Advanced$applyValidation; 8849var $dwayne$elm_form$Form$Form = $elm$core$Basics$identity; 8850var $dwayne$elm_form$Form$new = function (options) { 8851 return {hH: options.hH, hp: options.iZ, kT: options.kT}; 8852}; 8853var $dwayne$elm_validation$Validation$succeed = $dwayne$elm_validation$Validation$Success; 8854var $dwayne$elm_field$Field$Advanced$succeed = $dwayne$elm_validation$Validation$succeed; 8855var $dwayne$elm_field$Field$succeed = $dwayne$elm_field$Field$Advanced$succeed; 8856var $author$project$Form$EditGroupMetadata$linkForm = $dwayne$elm_form$Form$new( 8857 { 8858 hH: { 8859 i6: { 8860 bn: function ($) { 8861 return $.i6; 8862 }, 8863 bt: F2( 8864 function (f, state) { 8865 return _Utils_update( 8866 state, 8867 { 8868 i6: f(state.i6) 8869 }); 8870 }) 8871 }, 8872 kS: { 8873 bn: function ($) { 8874 return $.kS; 8875 }, 8876 bt: F2( 8877 function (f, state) { 8878 return _Utils_update( 8879 state, 8880 { 8881 kS: f(state.kS) 8882 }); 8883 }) 8884 } 8885 }, 8886 iZ: { 8887 i6: $dwayne$elm_field$Field$empty($dwayne$elm_field$Field$nonBlankString), 8888 kS: $dwayne$elm_field$Field$empty($author$project$Form$EditGroupMetadata$urlString) 8889 }, 8890 kT: function (state) { 8891 return A2( 8892 $dwayne$elm_field$Field$applyValidation, 8893 state.kS, 8894 A2( 8895 $dwayne$elm_field$Field$applyValidation, 8896 state.i6, 8897 $dwayne$elm_field$Field$succeed( 8898 F2( 8899 function (label, url) { 8900 return {i6: label, kS: url}; 8901 })))); 8902 } 8903 }); 8904var $dwayne$elm_form$Form$modify = F3( 8905 function (toAccessor, t, _v0) { 8906 var form = _v0; 8907 return _Utils_update( 8908 form, 8909 { 8910 hp: A2( 8911 toAccessor(form.hH).bt, 8912 t, 8913 form.hp) 8914 }); 8915 }); 8916var $dwayne$elm_form$Form$List$modify = F4( 8917 function (id, toAccessor, f, _v0) { 8918 var c = _v0; 8919 return _Utils_update( 8920 c, 8921 { 8922 _: A2( 8923 $elm$core$List$map, 8924 function (_v1) { 8925 var currentId = _v1.a; 8926 var element = _v1.b; 8927 return _Utils_Tuple2( 8928 currentId, 8929 _Utils_eq(currentId, id) ? A3($dwayne$elm_form$Form$modify, toAccessor, f, element) : element); 8930 }, 8931 c._) 8932 }); 8933 }); 8934var $elm$core$Basics$neq = _Utils_notEqual; 8935var $dwayne$elm_form$Form$List$remove = F2( 8936 function (id, _v0) { 8937 var c = _v0; 8938 return _Utils_update( 8939 c, 8940 { 8941 _: A2( 8942 $elm$core$List$filter, 8943 A2( 8944 $elm$core$Basics$composeR, 8945 $elm$core$Tuple$first, 8946 $elm$core$Basics$neq(id)), 8947 c._) 8948 }); 8949 }); 8950var $author$project$Form$EditGroupMetadata$accessors = { 8951 hM: function (state) { 8952 return _Utils_update( 8953 state, 8954 { 8955 cz: A2($dwayne$elm_form$Form$List$append, $author$project$Form$EditGroupMetadata$linkForm, state.cz) 8956 }); 8957 }, 8958 eE: { 8959 bn: function ($) { 8960 return $.eE; 8961 }, 8962 bt: F2( 8963 function (f, state) { 8964 return _Utils_update( 8965 state, 8966 { 8967 eE: f(state.eE) 8968 }); 8969 }) 8970 }, 8971 jb: function (id) { 8972 return { 8973 bn: A2( 8974 $elm$core$Basics$composeR, 8975 function ($) { 8976 return $.cz; 8977 }, 8978 A2( 8979 $elm$core$Basics$composeR, 8980 A2( 8981 $dwayne$elm_form$Form$List$get, 8982 id, 8983 function ($) { 8984 return $.i6; 8985 }), 8986 $elm$core$Maybe$withDefault($author$project$Form$EditGroupMetadata$emptyLabelField))), 8987 bt: F2( 8988 function (f, state) { 8989 return _Utils_update( 8990 state, 8991 { 8992 cz: A4( 8993 $dwayne$elm_form$Form$List$modify, 8994 id, 8995 function ($) { 8996 return $.i6; 8997 }, 8998 f, 8999 state.cz) 9000 }); 9001 }) 9002 }; 9003 }, 9004 jc: function (id) { 9005 return { 9006 bn: A2( 9007 $elm$core$Basics$composeR, 9008 function ($) { 9009 return $.cz; 9010 }, 9011 A2( 9012 $elm$core$Basics$composeR, 9013 A2( 9014 $dwayne$elm_form$Form$List$get, 9015 id, 9016 function ($) { 9017 return $.kS; 9018 }), 9019 $elm$core$Maybe$withDefault($author$project$Form$EditGroupMetadata$emptyUrlField))), 9020 bt: F2( 9021 function (f, state) { 9022 return _Utils_update( 9023 state, 9024 { 9025 cz: A4( 9026 $dwayne$elm_form$Form$List$modify, 9027 id, 9028 function ($) { 9029 return $.kS; 9030 }, 9031 f, 9032 state.cz) 9033 }); 9034 }) 9035 }; 9036 }, 9037 cz: { 9038 bn: function ($) { 9039 return $.cz; 9040 }, 9041 bt: F2( 9042 function (f, state) { 9043 return _Utils_update( 9044 state, 9045 { 9046 cz: f(state.cz) 9047 }); 9048 }) 9049 }, 9050 bW: { 9051 bn: function ($) { 9052 return $.bW; 9053 }, 9054 bt: F2( 9055 function (f, state) { 9056 return _Utils_update( 9057 state, 9058 { 9059 bW: f(state.bW) 9060 }); 9061 }) 9062 }, 9063 j1: F2( 9064 function (id, state) { 9065 return _Utils_update( 9066 state, 9067 { 9068 cz: A2($dwayne$elm_form$Form$List$remove, id, state.cz) 9069 }); 9070 }), 9071 cY: { 9072 bn: function ($) { 9073 return $.cY; 9074 }, 9075 bt: F2( 9076 function (f, state) { 9077 return _Utils_update( 9078 state, 9079 { 9080 cY: f(state.cY) 9081 }); 9082 }) 9083 } 9084}; 9085var $dwayne$elm_form$Form$List$empty = {_: _List_Nil, m9: 0}; 9086var $dwayne$elm_field$Field$Advanced$customOptional = F2( 9087 function (isBlankError, _v0) { 9088 var converters = _v0; 9089 return { 9090 mM: function (s) { 9091 var _v1 = converters.mM(s); 9092 if (!_v1.$) { 9093 var value = _v1.a; 9094 return $elm$core$Result$Ok( 9095 $elm$core$Maybe$Just(value)); 9096 } else { 9097 var err = _v1.a; 9098 return isBlankError(err) ? $elm$core$Result$Ok($elm$core$Maybe$Nothing) : $elm$core$Result$Err(err); 9099 } 9100 }, 9101 N: function (maybeValue) { 9102 if (!maybeValue.$) { 9103 var v1 = maybeValue.a; 9104 var _v3 = converters.N(v1); 9105 if (!_v3.$) { 9106 var v2 = _v3.a; 9107 return $elm$core$Result$Ok( 9108 $elm$core$Maybe$Just(v2)); 9109 } else { 9110 var err = _v3.a; 9111 return isBlankError(err) ? $elm$core$Result$Ok($elm$core$Maybe$Nothing) : $elm$core$Result$Err(err); 9112 } 9113 } else { 9114 return $elm$core$Result$Ok($elm$core$Maybe$Nothing); 9115 } 9116 }, 9117 qU: A2( 9118 $elm$core$Basics$composeR, 9119 $elm$core$Maybe$map(converters.qU), 9120 $elm$core$Maybe$withDefault('')) 9121 }; 9122 }); 9123var $dwayne$elm_field$Field$Advanced$optional = $dwayne$elm_field$Field$Advanced$customOptional( 9124 $elm$core$Basics$eq($dwayne$elm_field$Field$Advanced$Blank)); 9125var $dwayne$elm_field$Field$optional = $dwayne$elm_field$Field$Advanced$optional; 9126var $author$project$Form$EditGroupMetadata$optionalString = $dwayne$elm_field$Field$optional($dwayne$elm_field$Field$nonBlankString); 9127var $author$project$Form$EditGroupMetadata$init = { 9128 eE: $dwayne$elm_field$Field$empty($author$project$Form$EditGroupMetadata$optionalString), 9129 cz: $dwayne$elm_form$Form$List$empty, 9130 bW: $dwayne$elm_field$Field$empty($dwayne$elm_field$F
9130ield$nonBlankString), 9131 cY: $dwayne$elm_field$Field$empty($author$project$Form$EditGroupMetadata$optionalString) 9132}; 9133var $author$project$Form$EditGroupMetadata$Output = F4( 9134 function (name, subtitle, description, links) { 9135 return {eE: description, cz: links, bW: name, cY: subtitle}; 9136 }); 9137var $dwayne$elm_validation$Validation$map2 = F3( 9138 function (f, va, vb) { 9139 return A2( 9140 $dwayne$elm_validation$Validation$apply, 9141 vb, 9142 A2( 9143 $dwayne$elm_validation$Validation$apply, 9144 va, 9145 $dwayne$elm_validation$Validation$Success(f))); 9146 }); 9147var $dwayne$elm_validation$Validation$mapError = F2( 9148 function (f, v) { 9149 if (!v.$) { 9150 var a = v.a; 9151 return $dwayne$elm_validation$Validation$Success(a); 9152 } else { 9153 var _v1 = v.a; 9154 var x = _v1.a; 9155 var xs = _v1.b; 9156 return $dwayne$elm_validation$Validation$Failure( 9157 _Utils_Tuple2( 9158 f(x), 9159 A2($elm$core$List$map, f, xs))); 9160 } 9161 }); 9162var $dwayne$elm_form$Form$validate = function (_v0) { 9163 var form = _v0; 9164 return form.kT(form.hp); 9165}; 9166var $dwayne$elm_form$Form$List$validate = F2( 9167 function (f, _v0) { 9168 var c = _v0; 9169 return A3( 9170 $elm$core$List$foldr, 9171 function (_v1) { 9172 var id = _v1.a; 9173 var form = _v1.b; 9174 return A2( 9175 $dwayne$elm_validation$Validation$map2, 9176 $elm$core$List$cons, 9177 A2( 9178 $dwayne$elm_validation$Validation$mapError, 9179 f(id), 9180 $dwayne$elm_form$Form$validate(form))); 9181 }, 9182 $dwayne$elm_validation$Validation$succeed(_List_Nil), 9183 c._); 9184 }); 9185var $author$project$Form$EditGroupMetadata$validate = function (state) { 9186 return A2( 9187 $dwayne$elm_validation$Validation$apply, 9188 A2( 9189 $dwayne$elm_form$Form$List$validate, 9190 F2( 9191 function (_v0, e) { 9192 return e; 9193 }), 9194 state.cz), 9195 A2( 9196 $dwayne$elm_field$Field$applyValidation, 9197 state.eE, 9198 A2( 9199 $dwayne$elm_field$Field$applyValidation, 9200 state.cY, 9201 A2( 9202 $dwayne$elm_field$Field$applyValidation, 9203 state.bW, 9204 $dwayne$elm_field$Field$succeed($author$project$Form$EditGroupMetadata$Output))))); 9205}; 9206var $author$project$Form$EditGroupMetadata$form = $dwayne$elm_form$Form$new( 9207 {hH: $author$project$Form$EditGroupMetadata$accessors, iZ: $author$project$Form$EditGroupMetadata$init, kT: $author$project$Form$EditGroupMetadata$validate}); 9208var $dwayne$elm_form$Form$List$fromListHelper = F3( 9209 function (id, elements, list) { 9210 fromListHelper: 9211 while (true) { 9212 if (!list.b) { 9213 return _Utils_Tuple2( 9214 id, 9215 $elm$core$List$reverse(elements)); 9216 } else { 9217 var x = list.a; 9218 var xs = list.b; 9219 var $temp$id = id + 1, 9220 $temp$elements = A2( 9221 $elm$core$List$cons, 9222 _Utils_Tuple2(id, x), 9223 elements), 9224 $temp$list = xs; 9225 id = $temp$id; 9226 elements = $temp$elements; 9227 list = $temp$list; 9228 continue fromListHelper; 9229 } 9230 } 9231 }); 9232var $dwayne$elm_form$Form$List$fromList = function (list) { 9233 var _v0 = A3($dwayne$elm_form$Form$List$fromListHelper, 0, _List_Nil, list); 9234 var id = _v0.a; 9235 var elements = _v0.b; 9236 return {_: elements, m9: id}; 9237}; 9238var $dwayne$elm_field$Field$Advanced$setFromString = F2( 9239 function (raw, _v0) { 9240 var converters = _v0.a; 9241 var state = _v0.b; 9242 return A2( 9243 $dwayne$elm_field$Field$Advanced$Field, 9244 converters, 9245 { 9246 aO: false, 9247 ae: $dwayne$elm_validation$Validation$fromResult( 9248 converters.mM(raw)), 9249 jZ: raw 9250 }); 9251 }); 9252var $dwayne$elm_field$Field$setFromString = $dwayne$elm_field$Field$Advanced$setFromString; 9253var $author$project$Form$EditGroupMetadata$initLinkForm = function (link) { 9254 return A3( 9255 $dwayne$elm_form$Form$modify, 9256 function ($) { 9257 return $.kS; 9258 }, 9259 $dwayne$elm_field$Field$setFromString(link.kS), 9260 A3( 9261 $dwayne$elm_form$Form$modify, 9262 function ($) { 9263 return $.i6; 9264 }, 9265 $dwayne$elm_field$Field$setFromString(link.i6), 9266 $author$project$Form$EditGroupMetadata$linkForm)); 9267}; 9268var $dwayne$elm_form$Form$update = F2( 9269 function (f, _v0) { 9270 var form = _v0; 9271 return _Utils_update( 9272 form, 9273 { 9274 hp: A2(f, form.hH, form.hp) 9275 }); 9276 }); 9277var $author$project$Form$EditGroupMetadata$initFromMetadata = function (meta) { 9278 return A2( 9279 $elm$core$Basics$composeR, 9280 A2( 9281 $dwayne$elm_form$Form$modify, 9282 function ($) { 9283 return $.bW; 9284 }, 9285 $dwayne$elm_field$Field$setFromString(meta.bW)), 9286 A2( 9287 $elm$core$Basics$composeR, 9288 function () { 9289 var _v0 = meta.cY; 9290 if (!_v0.$) { 9291 var s = _v0.a; 9292 return A2( 9293 $dwayne$elm_form$Form$modify, 9294 function ($) { 9295 return $.cY; 9296 }, 9297 $dwayne$elm_field$Field$setFromString(s)); 9298 } else { 9299 return $elm$core$Basics$identity; 9300 } 9301 }(), 9302 A2( 9303 $elm$core$Basics$composeR, 9304 function () { 9305 var _v1 = meta.eE; 9306 if (!_v1.$) { 9307 var s = _v1.a; 9308 return A2( 9309 $dwayne$elm_form$Form$modify, 9310 function ($) { 9311 return $.eE; 9312 }, 9313 $dwayne$elm_field$Field$setFromString(s)); 9314 } else { 9315 return $elm$core$Basics$identity; 9316 } 9317 }(), 9318 $dwayne$elm_form$Form$update( 9319 F2( 9320 function (_v2, state) { 9321 return _Utils_update( 9322 state, 9323 { 9324 cz: $dwayne$elm_form$Form$List$fromList( 9325 A2($elm$core$List$map, $author$project$Form$EditGroupMetadata$initLinkForm, meta.cz)) 9326 }); 9327 }))))); 9328}; 9329var $author$project$Page$Group$EditGroupMetadata$init = function (meta) { 9330 return { 9331 dc: false, 9332 w: A2($author$project$Form$EditGroupMetadata$initFromMetadata, meta, $author$project$Form$EditGroupMetadata$form), 9333 g_: meta, 9334 d_: false 9335 }; 9336}; 9337var $author$project$Page$Group$EditMemberMetadata$Model = $elm$core$Basics$identity; 9338var $author$project$Page$Group$EditMemberMetadata$NoPanel = {$: 0}; 9339var $author$project$Form$EditMemberMetadata$accessors = { 9340 is: { 9341 bn: function ($) { 9342 return $.is; 9343 }, 9344 bt: F2( 9345 function (f, state) { 9346 return _Utils_update( 9347 state, 9348 { 9349 is: f(state.is) 9350 }); 9351 }) 9352 }, 9353 bW: { 9354 bn: function ($) { 9355 return $.bW; 9356 }, 9357 bt: F2( 9358 function (f, state) { 9359 return _Utils_update( 9360 state, 9361 { 9362 bW: f(state.bW) 9363 }); 9364 }) 9365 }, 9366 bu: { 9367 bn: function ($) { 9368 return $.bu; 9369 }, 9370 bt: F2( 9371 function (f, state) { 9372 return _Utils_update( 9373 state, 9374 { 9375 bu: f(state.bu) 9376 }); 9377 }) 9378 }, 9379 jF: { 9380 bn: function ($) { 9381 return $.jF; 9382 }, 9383 bt: F2( 9384 function (f, state) { 9385 return _Utils_update( 9386 state, 9387 { 9388 jF: f(state.jF) 9389 }); 9390 }) 9391 } 9392}; 9393var $elm$core$Basics$not = _Basics_not; 9394var $author$project$Form$EditMemberMetadata$optionalEmail = $dwayne$elm_field$Field$optional( 9395 $dwayne$elm_field$Field$customType( 9396 { 9397 mM: $dwayne$elm_field$Field$trim( 9398 function (s) { 9399 var _v0 = A2($elm$core$String$split, '@', s); 9400 if ((_v0.b && _v0.b.b) && (!_v0.b.b.b)) { 9401 var local = _v0.a; 9402 var _v1 = _v0.b; 9403 var domain = _v1.a; 9404 return ((!$elm$core$String$isEmpty(local)) && A2($elm$core$String$contains, '.', domain)) ? $elm$core$Result$Ok(s) : $elm$core$Result$Err( 9405 $dwayne$elm_field$Field$validationError(s)); 9406 } else { 9407 return $elm$core$Result$Err( 9408 $dwayne$elm_field$Field$validationError(s)); 9409 } 9410 }), 9411 qU: $elm$core$Basics$identity 9412 })); 9413var $author$project$Form$EditMemberMetadata$optionalString = $dwayne$elm_field$Field$optional($dwayne$elm_field$Field$nonBlankString); 9414var $author$project$Form$EditMemberMetadata$init = { 9415 is: $dwayne$elm_field$Field$empty($author$project$Form$EditMemberMetadata$optionalEmail), 9416 bW: $dwayne$elm_field$Field$empty($dwayne$elm_field$Field$nonBlankString), 9417 bu: $dwayne$elm_field$Field$empty($author$project$Form$EditMemberMetadata$optionalString), 9418 jD: _List_Nil, 9419 jF: $dwayne$elm_field$Field$empty($author$project$Form$EditMemberMetadata$optionalString) 9420}; 9421var $author$project$Form$EditMemberMetadata$Output = F5( 9422 function (name, phone, email, notes, payment) { 9423 return {is: email, bW: name, bu: notes, jD: payment, jF: phone}; 9424 }); 9425var $dwayne$elm_field$Field$toValidation = $dwayne$elm_field$Field$Advanced$toValidation; 9426var $author$project$Form$EditMemberMetadata$validateHandles = A2( 9427 $elm$core$List$foldr, 9428 F2( 9429 function (_v0, acc) { 9430 var method = _v0.a; 9431 var field = _v0.b; 9432 return A3( 9433 $dwayne$elm_validation$Validation$map2, 9434 F2( 9435 function (value, rest) { 9436 return A2( 9437 $elm$core$List$cons, 9438 _Utils_Tuple2(method, value), 9439 rest); 9440 }), 9441 $dwayne$elm_field$Field$toValidation(field), 9442 acc); 9443 }), 9444 $dwayne$elm_field$Field$succeed(_List_Nil)); 9445var $author$project$Form$EditMemberMetadata$validate = function (state) { 9446 return A2( 9447 $dwayne$elm_validation$Validation$apply, 9448 $author$project$Form$EditMemberMetadata$validateHandles(state.jD), 9449 A2( 9450 $dwayne$elm_field$Field$applyValidation, 9451 state.bu, 9452 A2( 9453 $dwayne$elm_field$Field$applyValidation, 9454 state.is, 9455 A2( 9456 $dwayne$elm_field$Field$applyValidation, 9457 state.jF, 9458 A2( 9459 $dwayne$elm_field$Field$applyValidation, 9460 state.bW, 9461 $dwayne$elm_field$Field$succeed($author$project$Form$EditMemberMetadata$Output)))))); 9462}; 9463var $author$project$Form$EditMemberMetadata$form = $dwayne$elm_form$Form$new( 9464 {hH: $author$project$Form$EditMemberMetadata$accessors, iZ: $author$project$Form$EditMemberMetadata$init, kT: $author$project$Form$EditMemberMetadata$validate}); 9465var $author$project$Domain$PaymentMethod$Iban = 0; 9466var $author$project$Domain$PaymentMethod$Ada = 9; 9467var $author$project$Domain$PaymentMethod$Btc = 8; 9468var $author$project$Domain$PaymentMethod$Cashapp = 7; 9469var $author$project$Domain$PaymentMethod$Lydia = 2; 9470var $author$project$Domain$PaymentMethod$Paypal = 5; 9471var $author$project$Domain$PaymentMethod$Revolut = 3; 9472var $author$project$Domain$PaymentMethod$Venmo = 6; 9473var $author$project$Domain$PaymentMethod$Wero = 1; 9474var $author$project$Domain$PaymentMethod$Wise = 4;
9475var $author$project$Domain$PaymentMethod$next = function (method) { 9476 switch (method) { 9477 case 0: 9478 return $elm$core$Maybe$Just(1); 9479 case 1: 9480 return $elm$core$Maybe$Just(2); 9481 case 2: 9482 return $elm$core$Maybe$Just(3); 9483 case 3: 9484 return $elm$core$Maybe$Just(4); 9485 case 4: 9486 return $elm$core$Maybe$Just(5); 9487 case 5: 9488 return $elm$core$Maybe$Just(6); 9489 case 6: 9490 return $elm$core$Maybe$Just(7); 9491 case 7: 9492 return $elm$core$Maybe$Just(8); 9493 case 8: 9494 return $elm$core$Maybe$Just(9); 9495 default: 9496 return $elm$core$Maybe$Nothing; 9497 } 9498}; 9499var $author$project$Domain$PaymentMethod$unfold = F2( 9500 function (method, acc) { 9501 unfold: 9502 while (true) { 9503 var _v0 = $author$project$Domain$PaymentMethod$next(method); 9504 if (!_v0.$) { 9505 var following = _v0.a; 9506 var $temp$method = following, 9507 $temp$acc = A2($elm$core$List$cons, method, acc); 9508 method = $temp$method; 9509 acc = $temp$acc; 9510 continue unfold; 9511 } else { 9512 return $elm$core$List$reverse( 9513 A2($elm$core$List$cons, method, acc)); 9514 } 9515 } 9516 }); 9517var $author$project$Domain$PaymentMethod$all = A2($author$project$Domain$PaymentMethod$unfold, 0, _List_Nil); 9518var $author$project$Domain$PaymentMethod$toKey = function (method) { 9519 switch (method) { 9520 case 0: 9521 return 'ib'; 9522 case 1: 9523 return 'we'; 9524 case 2: 9525 return 'ly'; 9526 case 3: 9527 return 'rv'; 9528 case 4: 9529 return 'wi'; 9530 case 5: 9531 return 'pp'; 9532 case 6: 9533 return 'vn'; 9534 case 7: 9535 return 'ca'; 9536 case 8: 9537 return 'btc'; 9538 default: 9539 return 'ada'; 9540 } 9541}; 9542var $author$project$Domain$PaymentMethod$get = function (method) { 9543 return $elm$core$Dict$get(
9544 $author$project$Domain$PaymentMethod$toKey(method)); 9545}; 9546var $elmcraft$core_extra$List$Extra$find = F2( 9547 function (predicate, list) { 9548 find: 9549 while (true) { 9550 if (!list.b) { 9551 return $elm$core$Maybe$Nothing; 9552 } else { 9553 var first = list.a; 9554 var rest = list.b; 9555 if (predicate(first)) { 9556 return $elm$core$Maybe$Just(first); 9557 } else { 9558 var $temp$predicate = predicate, 9559 $temp$list = rest; 9560 predicate = $temp$predicate; 9561 list = $temp$list; 9562 continue find; 9563 } 9564 } 9565 } 9566 }); 9567var $author$project$Form$EditMemberMetadata$handleField = F2( 9568 function (method, handles) { 9569 return A2( 9570 $elm$core$Maybe$withDefault, 9571 $dwayne$elm_field$Field$empty($author$project$Form$EditMemberMetadata$optionalString), 9572 A2( 9573 $elm$core$Maybe$map, 9574 $elm$core$Tuple$second, 9575 A2( 9576 $elmcraft$core_extra$List$Extra$find, 9577 function (_v0) { 9578 var m = _v0.a; 9579 return _Utils_eq(m, method); 9580 }, 9581 handles))); 9582 }); 9583var $elm$core$List$any = F2( 9584 function (isOkay, list) { 9585 any: 9586 while (true) { 9587 if (!list.b) { 9588 return false; 9589 } else { 9590 var x = list.a; 9591 var xs = list.b; 9592 if (isOkay(x)) { 9593 return true; 9594 } else { 9595 var $temp$isOkay = isOkay, 9596 $temp$list = xs; 9597 isOkay = $temp$isOkay; 9598 list = $temp$list; 9599 continue any; 9600 } 9601 } 9602 } 9603 }); 9604var $author$project$Form$EditMemberMetadata$updateHandle = F3( 9605 function (method, f, handles) { 9606 return A2( 9607 $elm$core$List$any, 9608 function (_v0) { 9609 var m = _v0.a; 9610 return _Utils_eq(m, method); 9611 }, 9612 handles) ? A2( 9613 $elm$core$List$map, 9614 function (entry) { 9615 var m = entry.a; 9616 var field = entry.b; 9617 return _Utils_eq(m, method) ? _Utils_Tuple2( 9618 m, 9619 f(field)) : entry; 9620 }, 9621 handles) : A2( 9622 $elm$core$List$cons, 9623 _Utils_Tuple2( 9624 method, 9625 f( 9626 $dwayne$elm_field$Field$empty($author$project$Form$EditMemberMetadata$optionalString))), 9627 handles); 9628 }); 9629var $author$project$Form$EditMemberMetadata$payment = F2( 9630 function (method, _v0) { 9631 return { 9632 bn: function (state) { 9633 return A2($author$project$Form$EditMemberMetadata$handleField, method, state.jD); 9634 }, 9635 bt: F2( 9636 function (f, state) { 9637 return _Utils_update( 9638 state, 9639 { 9640 jD: A3($author$project$Form$EditMemberMetadata$updateHandle, method, f, state.jD) 9641 }); 9642 }) 9643 }; 9644 }); 9645var $author$project$Form$EditMemberMetadata$initFromMember = F2( 9646 function (name, meta) { 9647 var setField = F3( 9648 function (accessor, maybeValue, f) { 9649 if (!maybeValue.$) { 9650 var v = maybeValue.a; 9651 return A3( 9652 $dwayne$elm_form$Form$modify, 9653 accessor, 9654 $dwayne$elm_field$Field$setFromString(v), 9655 f); 9656 } else { 9657 return f; 9658 } 9659 }); 9660 var setHandle = function (method) { 9661 return A2( 9662 setField, 9663 $author$project$Form$EditMemberMetadata$payment(method), 9664 A2($author$project$Domain$PaymentMethod$get, method, meta.jD)); 9665 }; 9666 return A2( 9667 $elm$core$Basics$composeR, 9668 A2( 9669 $dwayne$elm_form$Form$modify, 9670 function ($) { 9671 return $.bW; 9672 }, 9673 $dwayne$elm_field$Field$setFromString(name)), 9674 A2( 9675 $elm$core$Basics$composeR, 9676 A2( 9677 setField, 9678 function ($) { 9679 return $.jF; 9680 }, 9681 meta.jF), 9682 A2( 9683 $elm$core$Basics$composeR, 9684 A2( 9685 setField, 9686 function ($) { 9687 return $.is; 9688 }, 9689 meta.is), 9690 A2( 9691 $elm$core$Basics$composeR, 9692 A2( 9693 setField, 9694 function ($) { 9695 return $.bu; 9696 }, 9697 meta.bu), 9698 function (f) { 9699 return A3($elm$core$List$foldl, setHandle, f, $author$project$Domain$PaymentMethod$all); 9700 })))); 9701 }); 9702var $author$project$Page$Group$EditMemberMetadata$init = F3( 9703 function (memberId, name, meta) { 9704 return { 9705 fV: meta.jD, 9706 w: A3($author$project$Form$EditMemberMetadata$initFromMember, name, meta, $author$project$Form$EditMemberMetadata$form), 9707 e_: memberId, 9708 dB: name, 9709 au: $author$project$Page$Group$EditMemberMetadata$NoPanel, 9710 d_: false 9711 }; 9712 }); 9713var $author$project$Page$Group$EntriesTab$Model = $elm$core$Basics$identity; 9714var $author$project$Domain$Filter$emptyEntryFilters = {eu: $elm$core$Set$empty, ez: $elm$core$Set$empty, eB: _List_Nil, fc: $elm$core$Set$empty}; 9715var $author$project$Page$Group$EntriesTab$init = {X: $elm$core$Maybe$Nothing, aS: $elm$core$Set$empty, a5: $author$project$Domain$Filter$emptyEntryFilters, dK: '', a0: false, cS: false}; 9716var $author$project$Page$Group$MembersTab$init = {bk: $elm$core$Set$empty, dS: fal
9716se, cU: false}; 9717var $author$project$Page$Group$MergeMember$Model = $elm$core$Basics$identity; 9718var $author$project$Page$Group$MergeMember$init = F2( 9719 function (sourceRootId, targetRootId) { 9720 return {cg: '', dP: false, dR: false, dT: false, dZ: sourceRootId, fA: targetRootId}; 9721 }); 9722var $author$project$Page$Group$NewEntry$Shared$ExpenseKind = 0; 9723var $author$project$Page$Group$NewEntry$Model = $elm$core$Basics$identity; 9724var $author$project$Page$Group$NewEntry$Shared$RateIdle = 0; 9725var $author$project$Page$Group$NewEntry$Shared$ShareSplit = 0; 9726var $author$project$Form$NewEntry$accessors = { 9727 ef: { 9728 bn: function ($) { 9729 return $.ef; 9730 }, 9731 bt: F2( 9732 function (f, state) { 9733 return _Utils_update( 9734 state, 9735 { 9736 ef: f(state.ef) 9737 }); 9738 }) 9739 }, 9740 cj: { 9741 bn: function ($) { 9742 return $.cj; 9743 }, 9744 bt: F2( 9745 function (f, state) { 9746 return _Utils_update( 9747 state, 9748 { 9749 cj: f(state.cj) 9750 }); 9751 }) 9752 }, 9753 eE: { 9754 bn: function ($) { 9755 return $.eE; 9756 }, 9757 bt: F2( 9758 function (f, state) { 9759 return _Utils_update( 9760 state, 9761 { 9762 eE: f(state.eE) 9763 }); 9764 }) 9765 } 9766}; 9767var $author$project$Form$NewEntry$normalizeAmountInput = function (str) { 9768 return A3( 9769 $elm$core$String$replace, 9770 '\u202F', 9771 '', 9772 A3( 9773 $elm$core$String$replace, 9774 '\u00A0', 9775 '', 9776 A3( 9777 $elm$core$String$replace, 9778 ' ', 9779 '', 9780 A3($elm$core$String$replace, ',', '.', str)))); 9781}; 9782var $elm$core$Basics$pow = _Basics_pow; 9783var $author$project$Domain$Currency$precision = function (currency) { 9784 if (currency === 4) { 9785 return 0; 9786 } else { 9787 return 2; 9788 } 9789}; 9790var $elm$core$Basics$round = _Basics_round; 9791var $dwayne$elm_field$Field$Advanced$SyntaxError = function (a) { 9792 return {$: 1, a: a}; 9793}; 9794var $dwayne$elm_field$Field$Advanced$syntaxError = $dwayne$elm_field$Field$Advanced$SyntaxError; 9795var $dwayne$elm_field$Field$syntaxError = $dwayne$elm_field$Field$Advanced$syntaxError; 9796var $elm$core$String$toFloat = _String_toFloat; 9797var $author$project$Form$NewEntry$amountFromString = function (currency) { 9798 return $dwayne$elm_field$Field$trim( 9799 function (s) { 9800 var _v0 = $elm$core$String$toFloat( 9801 $author$project$Form$NewEntry$normalizeAmountInput(s)); 9802 if (!_v0.$) { 9803 var f = _v0.a; 9804 var cents = $elm$core$Basics$round( 9805 f * A2( 9806 $elm$core$Basics$pow, 9807 10, 9808 $author$project$Domain$Currency$precision(currency))); 9809 return (cents > 0) ? $elm$core$Result$Ok(cents) : $elm$core$Result$Err( 9810 $dwayne$elm_field$Field$validationError(s)); 9811 } else { 9812 return $elm$core$Result$Err( 9813 $dwayne$elm_field$Field$syntaxError(s)); 9814 } 9815 }); 9816}; 9817var $elm$core$Basics$abs = function (n) { 9818 return (n < 0) ? (-n) : n; 9819}; 9820var $elm$core$String$right = F2( 9821 function (n, string) { 9822 return (n < 1) ? '' : A3( 9823 $elm$core$String$slice, 9824 -n, 9825 $elm$core$String$length(string), 9826 string); 9827 }); 9828var $author$project$Format$chunksFromRight = F3( 9829 function (size, s, acc) { 9830 chunksFromRight: 9831 while (true) { 9832 if (_Utils_cmp( 9833 $elm$core$String$length(s), 9834 size) < 1) { 9835 return A2($elm$core$List$cons, s, acc); 9836 } else { 9837 var $temp$size = size, 9838 $temp$s = A2($elm$core$String$dropRight, size, s), 9839 $temp$acc = A2( 9840 $elm$core$List$cons, 9841 A2($elm$core$String$right, size, s), 9842 acc); 9843 size = $temp$size; 9844 s = $temp$s; 9845 acc = $temp$acc; 9846 continue chunksFromRight; 9847 } 9848 } 9849 }); 9850var $author$project$Format$addGrouping = F2( 9851 function (sep, digits) { 9852 return A2( 9853 $elm$core$String$join, 9854 sep, 9855 A3($author$project$Format$chunksFromRight, 3, digits, _List_Nil)); 9856 }); 9857var $elm$core$String$cons = _String_cons; 9858var $elm$core$String$fromChar = function (_char) { 9859 return A2($elm$core$String$cons, _char, ''); 9860}; 9861var $elm$core$Bitwise$shiftRightBy = _Bitwise_shiftRightBy; 9862var $elm$core$String$repeatHelp = F3( 9863 function (n, chunk, result) { 9864 return (n <= 0) ? result : A3( 9865 $elm$core$String$repeatHelp, 9866 n >> 1, 9867 _Utils_ap(chunk, chunk), 9868 (!(n & 1)) ? result : _Utils_ap(result, chunk)); 9869 }); 9870var $elm$core$String$repeat = F2( 9871 function (n, chunk) { 9872 return A3($elm$core$String$repeatHelp, n, chunk, ''); 9873 }); 9874var $elm$core$String$padLeft = F3( 9875 function (n, _char, string) { 9876 return _Utils_ap( 9877 A2( 9878 $elm$core$String$repeat, 9879 n - $elm$core$String$length(string), 9880 $elm$core$String$fromChar(_char)), 9881 string); 9882 }); 9883var $author$project$Format$formatMinorUnits = F3( 9884 function (cfg, p, amount) { 9885 var sign = (amount < 0) ? '-' : ''; 9886 var abs_ = $elm$core$Basics$abs(amount); 9887 if (!p) { 9888 return _Utils_ap( 9889 sign, 9890 A2( 9891 $author$project$Format$addGrouping, 9892 cfg.cs, 9893 $elm$core$String$fromInt(abs_))); 9894 } else { 9895 var divisor = A2($elm$core$Basics$pow, 10, p); 9896 var frac = abs_ % divisor; 9897 var whole = (abs_ / divisor) | 0; 9898 return _Utils_ap( 9899 sign, 9900 _Utils_ap( 9901 A2( 9902 $author$project$Format$addGrouping, 9903 cfg.cs, 9904 $elm$core$String$fromInt(whole)), 9905 _Utils_ap( 9906 cfg.eC, 9907 A3( 9908 $elm$core$String$padLeft, 9909 p, 9910 '0', 9911 $elm$core$String$fromInt(frac))))); 9912 } 9913 }); 9914var $author$project$Format$Prefix = 0; 9915var $author$project$Format$SuffixWithSpace = 1; 9916var $author$project$Format$localeConfig = function (lang) { 9917 if (!lang) { 9918 return {eC: '.', cs: ',', fy: 0}; 9919 } else { 9920 return {eC: ',', cs: '\u202F', fy: 1}; 9921 } 9922}; 9923var $author$project$Format$formatCentsForInput = F3( 9924 function (lang, cents, currency) { 9925 var cfg = $author$project$Format$localeConfig(lang); 9926 return A3( 9927 $author$project$Format$formatMinorUnits, 9928 _Utils_update( 9929 cfg, 9930 {cs: ''}), 9931 $author$project$Domain$Currency$precision(currency), 9932 cents); 9933 }); 9934var $author$project$Form$NewEntry$amountType = F2( 9935 function (lang, currency) { 9936 return $dwayne$elm_field$Field$customType( 9937 { 9938 mM: $author$project$Form$NewEntry$amountFromString(currency), 9939 qU: function (cents) { 9940 return A3($author$project$Format$formatCentsForInput, lang, cents, currency); 9941 } 9942 }); 9943 }); 9944var $author$project$Form$NewEntry$dateFromString = $dwayne$elm_field$Field$trim( 9945 function (s) { 9946 var _v0 = A2($elm$core$String$split, '-', s); 9947 if (((_v0.b && _v0.b.b) && _v0.b.b.b) && (!_v0.b.b.b.b)) { 9948 var yearStr = _v0.a; 9949 var _v1 = _v0.b; 9950 var monthStr = _v1.a; 9951 var _v2 = _v1.b; 9952 var dayStr = _v2.a; 9953 var _v3 = _Utils_Tuple3( 9954 $elm$core$String$toInt(yearStr), 9955 $elm$core$String$toInt(monthStr), 9956 $elm$core$String$toInt(dayStr)); 9957 if (((!_v3.a.$) && (!_v3.b.$)) && (!_v3.c.$)) { 9958 var year = _v3.a.a;
9959 var month = _v3.b.a; 9960 var day = _v3.c.a; 9961 return $elm$core$Result$Ok( 9962 {y: day, F: month, C: year}); 9963 } else { 9964 return $elm$core$Result$Err( 9965 $dwayne$elm_field$Field$syntaxError(s)); 9966 } 9967 } else { 9968 return $elm$core$Result$Err( 9969 $dwayne$elm_field$Field$syntaxError(s)); 9970 } 9971 }); 9972var $author$project$Form$NewEntry$dateToString = function (date) { 9973 return $elm$core$String$fromInt(date.C) + ('-' + (A3( 9974 $elm$core$String$padLeft, 9975 2, 9976 '0', 9977 $elm$core$String$fromInt(date.F)) + ('-' + A3( 9978 $elm$core$String$padLeft, 9979 2, 9980 '0', 9981 $elm$core$String$fromInt(date.y))))); 9982}; 9983var $author$project$Form$NewEntry$dateType = $dwayne$elm_field$Field$customType( 9984 {mM: $author$project$Form$NewEntry$dateFromString, qU: $author$project$Form$NewEntry$dateToString}); 9985var $author$project$Form$NewEntry$init = F2( 9986 function (lang, currency) { 9987 return { 9988 ef: $dwayne$elm_field$Field$empty( 9989 A2($author$project$Form$NewEntry$amountType, lang, currency)), 9990 cj: $dwayne$elm_field$Field$empty($author$project$Form$NewEntry$dateType), 9991 eE: $dwayne$elm_field$Field$empty($dwayne$elm_field$Field$nonBlankString) 9992 }; 9993 }); 9994var $author$project$Form$NewEntry$AmountError = 1; 9995var $author$project$Form$NewEntry$DateError = 2; 9996var $author$project$Form$NewEntry$DescriptionError = 0; 9997var $author$project$Form$NewEntry$Output = F3( 9998 function (description, amountCents, date) { 9999 return {lo: amountCents, cj: date, eE: description}; 10000 }); 10001var $elm$core$Result$mapError = F2( 10002 function (f, result) { 10003 if (!result.$) { 10004 var v = result.a; 10005 return $elm$core$Result$Ok(v); 10006 } else { 10007 var e = result.a; 10008 return $elm$core$Result$Err( 10009 f(e)); 10010 } 10011 }); 10012var $dwayne$elm_field$Field$Advanced$mapConvertersError = F2( 10013 function (f, converters) { 10014 return { 10015 mM: A2( 10016 $elm$core$Basics$composeR, 10017 converters.mM, 10018 $elm$core$Result$mapError(f)), 10019 N: A2( 10020 $elm$core$Basics$composeR, 10021 converters.N, 10022 $elm$core$Result$mapError(f)), 10023 qU: converters.qU 10024 }; 10025 }); 10026var $dwayne$elm_field$Field$Advanced$mapError = F2( 10027 function (f, _v0) { 10028 var converters = _v0.a; 10029 var state = _v0.b; 10030 return A2( 10031 $dwayne$elm_field$Field$Advanced$Field, 10032 A2($dwayne$elm_field$Field$Advanced$mapConvertersError, f, converters), 10033 { 10034 aO: state.aO, 10035 ae: A2($dwayne$elm_validation$Validation$mapError, f, state.ae), 10036 jZ: state.jZ 10037 }); 10038 }); 10039var $dwayne$elm_field$Field$mapError = $dwayne$elm_field$Field$Advanced$mapError; 10040var $author$project$Form$NewEntry$validate = function (state) { 10041 return A2( 10042 $dwayne$elm_field$Field$applyValidation, 10043 A2( 10044 $dwayne$elm_field$Field$mapError, 10045 function (_v2) { 10046 return 2; 10047 }, 10048 state.cj), 10049 A2( 10050 $dwayne$elm_field$Field$applyValidation, 10051 A2( 10052 $dwayne$elm_field$Field$mapError, 10053 function (_v1) { 10054 return 1; 10055 }, 10056 state.ef), 10057 A2( 10058 $dwayne$elm_field$Field$applyValidation, 10059 A2( 10060 $dwayne$elm_field$Field$mapError, 10061 function (_v0) { 10062 return 0; 10063 }, 10064 state.eE), 10065 $dwayne$elm_field$Field$succeed($author$project$Form$NewEntry$Output)))); 10066}; 10067var $author$project$Form$NewEntry$form = F2( 10068 function (lang, currency) { 10069 return $dwayne$elm_form$Form$new( 10070 { 10071 hH: $author$project$Form$NewEntry$accessors, 10072 iZ: A2($author$project$Form$NewEntry$init, lang, currency), 10073 kT: $author$project$Form$NewEntry$validate 10074 }); 10075 }); 10076var $author$project$Form$NewEntry$initDate = function (date) { 10077 return A2( 10078 $dwayne$elm_form$Form$modify, 10079 function ($) { 10080 return $.cj; 10081 }, 10082 $dwayne$elm_field$Field$setFromString( 10083 $author$project$Form$NewEntry$dateToString(date))); 10084}; 10085var $elm$core$Dict$singleton = F2( 10086 function (key, value) { 10087 return A5($elm$core$Dict$RBNode_elm_builtin, 1, key, value, $elm$core$Dict$RBEmpty_elm_builtin, $elm$core$Dict$RBEmpty_elm_builtin); 10088 }); 10089var $author$project$Page$Group$NewEntry$init = function (config) { 10090 return { 10091 ce: _List_Nil, 10092 em: $elm$core$Dict$fromList( 10093 A2( 10094 $elm$core$List$map, 10095 function (mid) { 10096 return _Utils_Tuple2(mid, 1); 10097 }, 10098 config.hI)), 10099 h9: $elm$core$Maybe$Nothing, 10100 bg: config.il, 10101 ck: '', 10102 bj: $elm$core$Dict$empty, 10103 w: A2( 10104 $author$project$Form$NewEntry$initDate, 10105 config.qV, 10106 A2($author$project$Form$NewEntry$form, config.eX, config.il)), 10107 mL: $elm$core$Maybe$Just(config.f7), 10108 mS: config.il, 10109 cw: false, 10110 gE: 0, 10111 eW: false, 10112 bu: '',
10113 aB: A2($elm$core$Dict$singleton, config.f7, ''), 10114 bx: 0, 10115 cO: $elm$core$Maybe$Just(config.f7), 10116 b2: 0, 10117 d_: false, 10118 kF: $elm$core$Maybe$Nothing 10119 }; 10120}; 10121var $author$project$Page$JoinGroup$FetchingGroup = {$: 0}; 10122var $author$project$Page$JoinGroup$init = $author$project$Page$JoinGroup$FetchingGroup; 10123var $author$project$Infra$ConcurrentTaskExtra$initTaskRunner = function (config) { 10124 return config; 10125}; 10126var $author$project$Page$Group$init = function (config) { 10127 return { 10128 an: 0, 10129 c4: $author$project$Page$Group$ActivityTab$init, 10130 cb: $author$project$Page$Group$AddMember$init, 10131 c8: $author$project$Page$Group$BalanceTab$init, 10132 cl: $author$project$Page$Group$Diagnostics$init, 10133 cm: $author$project$Page$Group$EditGroupMetadata$init($author$project$Domain$GroupState$empty.iO), 10134 cn: A3($author$project$Page$Group$EditMemberMetadata$init, '', '', $author$project$Domain$Member$emptyMetadata), 10135 cp: $author$project$Page$Group$EntriesTab$init, 10136 s: config.s, 10137 iY: '', 10138 du: $author$project$Page$Group$MembersTab$init, 10139 cD: A2($author$project$Page$Group$MergeMember$init, '', $elm$core$Maybe$Nothing), 10140 a8: $elm$core$Set$empty, 10141 bV: $elm$core$Maybe$Nothing, 10142 bs: $elm$core$Maybe$Nothing, 10143 at: $elm$core$Dict$empty, 10144 ac: $author$project$Page$Group$NewEntry$init( 10145 { 10146 hI: _List_Nil, 10147 f7: '', 10148 il: 1, 10149 eX: 0, 10150 qV: {y: 1, F: 1, C: 2000} 10151 }), 10152 K: $elm$core$Dict$empty, 10153 bv: $elm$core$Maybe$Nothing, 10154 bY: $elm$core$Maybe$Nothing, 10155 ff: _List_Nil, 10156 by: $author$project$Page$JoinGroup$init, 10157 ak: $author$project$Infra$ConcurrentTaskExtra$initTaskRunner( 10158 {dA: $author$project$Page$Group$OnTaskProgress, cL: config.cL, dH: config.dH, b$: config.b$}), 10159 V: $elm$core$Dict$empty, 10160 R: $author$project$Page$Group$SyncIdle, 10161 a: $author$project$Page$Group$WorkspaceEmpty 10162 }; 10163}; 10164var $author$project$Page$Home$Model = $elm$core$Basics$identity; 10165var $author$project$Page$Home$init = {bo: $elm$core$Maybe$Nothing, cy: $elm$core$Maybe$Nothing, bR: '', dO: false, cT: false, dQ: false}; 10166var $author$project$Page$Move$Model = $elm$core$Basics$identity; 10167var $author$project$Page$Move$init = function (groups) { 10168 return { 10169 eD: false, 10170 jC: $elm$core$Maybe$Nothing, 10171 hj: A2( 10172 $elm$core$List$map, 10173 function ($) { 10174 return $.m9; 10175 }, 10176 A2( 10177 $elm$core$List$filter, 10178 function (g) { 10179 return !g.gA; 10180 }, 10181 groups)), 10182 ag: $elm$core$Dict$empty 10183 }; 10184}; 10185var $author$project$Page$NewGroup$Model = F2( 10186 function (a, b) { 10187 return {$: 0, a: a, b: b}; 10188 }); 10189var $author$project$Form$NewGroup$emptyVMName = $dwayne$elm_field$Field$empty($dwayne$elm_field$Field$nonBlankString); 10190var $author$project$Form$NewGroup$VMNameError = 0; 10191var $dwayne$elm_validation$Validation$map = F2( 10192 function (f, v) { 10193 if (!v.$) { 10194 var a = v.a; 10195 return $dwayne$elm_validation$Validation$Success( 10196 f(a)); 10197 } else { 10198 var xs = v.a; 10199 return $dwayne$elm_validation$Validation$Failure(xs); 10200 } 10201 }); 10202var $dwayne$elm_field$Field$Advanced$validate = F2( 10203 function (f, field) { 10204 return A2( 10205 $dwayne$elm_validation$Validation$map, 10206 f, 10207 $dwayne$elm_field$Field$Advanced$toValidation(field)); 10208 }); 10209var $dwayne$elm_field$Field$validate = $dwayne$elm_field$Field$Advanced$validate; 10210var $author$project$Form$NewGroup$virtualMemberForm = $dwayne$elm_form$Form$new( 10211 { 10212 hH: { 10213 bW: { 10214 bn: function ($) { 10215 return $.bW; 10216 }, 10217 bt: F2( 10218 function (f, state) { 10219 return _Utils_update( 10220 state, 10221 { 10222 bW: f(state.bW) 10223 }); 10224 }) 10225 } 10226 }, 10227 iZ: { 10228 bW: $dwayne$elm_field$Field$empty($dwayne$elm_field$Field$nonBlankString) 10229 }, 10230 kT: function (state) { 10231 return A2( 10232 $dwayne$elm_field$Field$validate, 10233 $elm$core$Basics$identity, 10234 A2( 10235 $dwayne$elm_field$Field$mapError, 10236 function (_v0) { 10237 return 0; 10238 }, 10239 state.bW)); 10240 } 10241 }); 10242var $author$project$Form$NewGroup$accessors = { 10243 hN: function (state) { 10244 return _Utils_update( 10245 state, 10246 { 10247 rc: A2($dwayne$elm_form$Form$List$append, $author$project$Form$NewGroup$virtualMemberForm, state.rc) 10248 }); 10249 }, 10250 a4: { 10251 bn: function ($) { 10252 return $.a4; 10253 }, 10254 bt: F2( 10255 function (f, state) { 10256 return _Utils_update( 10257 state, 10258 { 10259 a4: f(state.a4) 10260 }); 10261 }) 10262 }, 10263 bg: { 10264 bn: function ($) { 10265 return $.bg; 10266 }, 10267 bt: F2( 10268 function (f, state) { 10269 return _Utils_update( 10270 state, 10271 { 10272 bg: f(state.bg) 10273 }); 10274 }) 10275 }, 10276 bW: { 10277 bn: function ($) { 10278 return $.bW; 10279 }, 10280 bt: F2( 10281 function (f, state) { 10282 return _Utils_update( 10283 state, 10284 { 10285 bW: f(state.bW) 10286 }); 10287 }) 10288 }, 10289 j2: F2( 10290 function (id, state) { 10291 return _Utils_update( 10292 state, 10293 { 10294 rc: A2($dwayne$elm_form$Form$List$remove, id, state.rc) 10295 }); 10296 }), 10297 kV: function (id) { 10298 return { 10299 bn: A2( 10300 $elm$core$Basics$composeR, 10301 function ($) { 10302 return $.rc; 10303 }, 10304 A2( 10305 $elm$core$Basics$composeR, 10306 A2( 10307 $dwayne$elm_form$Form$List$get, 10308 id, 10309 function ($) { 10310 return $.bW; 10311 }), 10312 $elm$core$Maybe$withDefault($author$project$Form$NewGroup$emptyVMName))), 10313 bt: F2( 10314 function (f, state) { 10315 return _Utils_update( 10316 state, 10317 { 10318 rc: A4( 10319 $dwayne$elm_form$Form$List$modify, 10320 id, 10321 function ($) { 10322 return $.bW; 10323 }, 10324 f, 10325 state.rc) 10326 }); 10327 }) 10328 }; 10329 }, 10330 rc: { 10331 bn: function ($) { 10332 return $.rc; 10333 }, 10334 bt: F2( 10335 function (f, state) { 10336 return _Utils_update( 10337 state, 10338 { 10339 rc: f(state.rc) 10340 }); 10341 }) 10342 } 10343}; 10344var $author$project$Domain$Currency$allCurrencies = _List_fromArray( 10345 [1, 0, 2, 3, 4, 5, 6, 7, 8, 9]); 10346var $author$project$Domain$Currency$currencyCode = function (currency) { 10347 switch (currency) { 10348 case 0: 10349 return 'USD'; 10350 case 1: 10351 return 'EUR'; 10352 case 2: 10353 return 'GBP'; 10354 case 3: 10355 return 'CHF'; 10356 case 4: 10357 return 'JPY'; 10358 case 5: 10359 return 'AUD'; 10360 case 6: 10361 return 'CAD'; 10362 case 7: 10363 return 'NZD'; 10364 case 8: 10365 return 'BRL'; 10366 default: 10367 return 'ARS'; 10368 } 10369}; 10370var $elm$core$String$toLower = _String_toLower; 10371var $author$project$Form$NewGroup$currencyFromString = $dwayne$elm_field$Field$trim( 10372 function (s) { 10373 var _v0 = A2( 10374 $elm$core$List$filter, 10375 function (c) { 10376 return _Utils_eq( 10377 $elm$core$String$toLower( 10378 $author$project$Domain$Currency$currencyCode(c)), 10379 s); 10380 }, 10381 $author$project$Domain$Currency$allCurrencies); 10382 if (_v0.b) { 10383 var c = _v0.a; 10384 return $elm$core$Result$Ok(c); 10385 } else { 10386 return $elm$core$Result$Err( 10387 $dwayne$elm_field$Field$validationError(s)); 10388 } 10389 }); 10390var $author$project$Form$NewGroup$currencyToString = function (c) { 10391 return $elm$core$String$toLower( 10392 $author$project$Domain$Currency$currencyCode(c)); 10393}; 10394var $author$project$Form$NewGroup$currencyType = $dwayne$elm_field$Field$customType( 10395 {mM: $author$project$Form$NewGroup$currencyFromString, qU: $author$project$Form$NewGroup$currencyToString}); 10396var $dwayne$elm_field$Field$fromString = $dwayne$elm_field$Field$Advanced$fromString; 10397var $author$project$Form$NewGroup$init = { 10398 a4: $dwayne$elm_field$Field$empty($dwayne$elm_field$Field$nonBlankString), 10399 bg: A2($dwayne$elm_field$Field$fromString, $author$project$Form$NewGroup$currencyType, 'eur'), 10400 bW: $dwayne$elm_field$Field$empty($dwayne$elm_field$Field$nonBlankString), 10401 rc: $dwayne$elm_form$Form$List$fromList( 10402 _List_fromArray( 10403 [$author$project$Form$NewGroup$virtualMemberForm])) 10404}; 10405var $author$project$Form$NewGroup$CreatorNameError = 1; 10406var $author$project$Form$NewGroup$CurrencyError = 2; 10407var $author$project$Form$NewGroup$NameError = 0; 10408var $author$project$Form$NewGroup$Output = F4( 10409 function (name, creatorName, currency, virtualMembers) { 10410 return {a4: creatorName, bg: currency, bW: name, rc: virtualMembers}; 10411 }); 10412var $dwayne$elm_validation$Validation$map4 = F5( 10413 function (f, va, vb, vc, vd) { 10414 return A2( 10415 $dwayne$elm_validation$Validation$apply, 10416 vd, 10417 A2( 10418 $dwayne$elm_validation$Validation$apply, 10419 vc, 10420 A2( 10421 $dwayne$elm_validation$Validation$apply, 10422 vb, 10423 A2( 10424 $dwayne$elm_validation$Validation$apply, 10425 va, 10426 $dwayne$elm_validation$Validation$Success(f))))); 10427 }); 10428var $author$project$Form$NewGroup$VirtualMemberError = 3; 10429var $dwayne$elm_form$Form$List$toList = function (_v0) { 10430 var elements = _v0._; 10431 return elements; 10432}; 10433var $dwayne$elm_field$Field$Advanced$toRawString = function (_v0) { 10434 var raw = _v0.b.jZ; 10435 return raw; 10436}; 10437var $dwayne$elm_field$Field$toRawString = $dwayne$elm_field$Field$Advanced$toRawString; 10438var $author$project$Form$NewGroup$validateVirtualMembers = function (forms) { 10439 var entries = $dwayne$elm_form$Form$List$toList(forms); 10440 var nonBlankEntries = A2( 10441 $elm$core$List$filter, 10442 function (_v2) { 10443 var f = _v2.b; 10444 var raw = $elm$core$String$trim( 10445 $dwayne$elm_field$Field$toRawString( 10446 A2( 10447 $dwayne$elm_form$Form$get, 10448 function ($) { 10449 return $.bW; 10450 }, 10451 f))); 10452 return !$elm$core$String$isEmpty(raw); 10453 }, 10454 entries); 10455 return A3( 10456 $elm$core$List$foldr, 10457 F2( 10458 function (_v0, acc) { 10459 var f = _v0.b; 10460 return A3( 10461 $dwayne$elm_validation$Validation$map2, 10462 $elm$core$List$cons, 10463 A2( 10464 $dwayne$elm_validation$Validation$mapError, 10465 function (_v1) { 10466 return 3; 10467 }, 10468 $dwayne$elm_form$Form$validate(f)), 10469 acc); 10470 }), 10471 $dwayne$elm_validation$Validation$succeed(_List_Nil), 10472 nonBlankEntries); 10473}; 10474var $author$project$Form$NewGroup$validate = function (state) { 10475 return A5( 10476 $dwayne$elm_validation$Validation$map4, 10477 $author$project$Form$NewGroup$Output, 10478 A2( 10479 $dwayne$elm_field$Field$validate, 10480 $elm$core$Basics$identity, 10481 A2( 10482 $dwayne$elm_field$Field$mapError, 10483 function (_v0) { 10484 return 0; 10485 }, 10486 state.bW)), 10487 A2( 10488 $dwayne$elm_field$Field$validate, 10489 $elm$core$Basics$identity, 10490 A2( 10491 $dwayne$elm_field$Field$mapError, 10492 function (_v1) { 10493 return 1; 10494 }, 10495 state.a4)), 10496 A2( 10497 $dwayne$elm_field$Field$validate, 10498 $elm$core$Basics$identity, 10499 A2( 10500 $dwayne$elm_field$Field$mapError, 10501 function (_v2) { 10502 return 2; 10503 }, 10504 state.bg)), 10505 $author$project$Form$NewGroup$validateVirtualMembers(state.rc)); 10506}; 10507var $author$project$Form$NewGroup$form = $dwayne$elm_form$Form$new( 10508 {hH: $author$project$Form$NewGroup$accessors, iZ: $author$project$Form$NewGroup$init, kT: $author$project$Form$NewGroup$validate}); 10509var $author$project$Page$NewGroup$init = A2($author$project$Page$NewGroup$Model, $author$project$Form$NewGroup$form, false); 10510var $author$project$Page$Receive$Model = $elm$core$Basics$identity; 10511var $author$project$Page$Receive$init = {be: false, gi: $elm$core$Maybe$Nothing, cJ: '', dI: $elm$core$Maybe$Nothing}; 10512var $author$project$PwaState$PushUnconfigured = {$: 0}; 10513var $author$project$Pwa$AlreadyInstalledInBrowser = 6; 10514var $author$project$Pwa$InstallableNow = 1; 10515var $author$project$Pwa$IosInAppBrowser = 5; 10516var $author$project$Pwa$LaunchedAsInstalled = 0; 10517var $author$project$Pwa$ManualAndroidMenu = 4; 10518var $author$project$Pwa$ManualIosSafari = 2; 10519var $author$project$Pwa$ManualMacSafari = 3; 10520var $author$project$Pwa$NoInstallHint = 7; 10521var $author$project$Pwa$installHintFromString = function (tag) { 10522 switch (tag) { 10523 case 'launchedAsInstalled': 10524 return 0; 10525 case 'installableNow': 10526 return 1; 10527 case 'manualIosSafari': 10528 return 2; 10529 case 'manualMacSafari': 10530 return 3; 10531 case 'manualAndroidMenu': 10532 return 4; 10533 case 'iosInAppBrowser': 10534 return 5; 10535 case 'alreadyInstalledInBrowser': 10536 return 6; 10537 default: 10538 return 7; 10539 } 10540}; 10541var $author$project$PwaState$init = function (flags) { 10542 return { 10543 eT: $author$project$Pwa$installHintFromString(flags.eT), 10544 cu: false, 10545 dk: flags.dk, 10546 bq: false, 10547 jr: $elm$core$Maybe$Nothing, 10548 a_: $author$project$PwaState$PushUnconfigured, 10549 jS: $elm$core$Maybe$Nothing,
10550 cQ: false, 10551 d8: false 10552 }; 10553}; 10554var $author$project$Translations$I18n = $elm$core$Basics$identity; 10555var $author$project$Translations$init = $elm$core$Basics$identity; 10556var $author$project$UI$Toast$init = {cG: 0, b8: _List_Nil}; 10557var $author$project$Translations$languageToString = function (lang) { 10558 if (!lang) { 10559 return 'en'; 10560 } else { 10561 return 'fr'; 10562 } 10563}; 10564var $author$project$Translations$Fr = 1; 10565var $author$project$Translations$languages = _List_fromArray( 10566 [0, 1]); 10567var $author$project$Translations$languageFromString = function (lang) { 10568 var helper = function (langs) { 10569 helper: 10570 while (true) { 10571 if (!langs.b) { 10572 return $elm$core$Maybe$Nothing; 10573 } else { 10574 var l = langs.a; 10575 var ls = langs.b; 10576 if (A2( 10577 $elm$core$String$startsWith, 10578 $author$project$Translations$languageToString(l), 10579 lang)) { 10580 return $elm$core$Maybe$Just(l); 10581 } else { 10582 var $temp$langs = ls; 10583 langs = $temp$langs; 10584 continue helper; 10585 } 10586 } 10587 } 10588 }; 10589 return helper( 10590 $elm$core$List$reverse($author$project$Translations$languages)); 10591}; 10592var $elm$core$Platform$Cmd$none = $elm$core$Platform$Cmd$batch(_List_Nil); 10593var $author$project$Translations$activityAmountSuffix = F2( 10594 function (data, _v0) { 10595 var lang = _v0; 10596 if (!lang) { 10597 return data.qI + (' (' + (data.ef + ')')); 10598 } else { 10599 return data.qI + (' (' + (data.ef + ')')); 10600 } 10601 }); 10602var $elm$core$Tuple$mapSecond = F2( 10603 function (func, _v0) { 10604 var x = _v0.a; 10605 var y = _v0.b; 10606 return _Utils_Tuple2( 10607 x, 10608 func(y)); 10609 }); 10610var $author$project$Translations$notificationGeneric = function (_v0) { 10611 var lang = _v0; 10612 if (!lang) { 10613 return 'New activity'; 10614 } else { 10615 return 'Nouvelle activité'; 10616 } 10617}; 10618var $author$project$Translations$notificationLine = F2( 10619 function (data, _v0) { 10620 var lang = _v0; 10621 if (!lang) { 10622 return data.k9 + (' ' + data.ps); 10623 } else { 10624 return data.k9 + (' ' + data.ps); 10625 } 10626 }); 10627var $author$project$ActivityPhrase$key = function (p) { 10628 switch (p.$) { 10629 case 0: 10630 return 'activityUnknown'; 10631 case 1: 10632 return 'activityEntryAdded'; 10633 case 2: 10634 return 'activityEntryModified'; 10635 case 3: 10636 return 'activityEntryDeleted'; 10637 case 4: 10638 return 'activityEntryUndeleted'; 10639 case 5: 10640 return 'activityTransferAdded'; 10641 case 6: 10642 return 'activityTransferModified'; 10643 case 7: 10644 return 'activityIncomeAdded'; 10645 case 8: 10646 return 'activityIncomeModified'; 10647 case 9: 10648 return 'activityMemberCreated'; 10649 case 10: 10650 return 'activityMemberCreatedVirtual'; 10651 case 11: 10652 return 'activityMemberLinked'; 10653 case 12: 10654 return 'activityMemberRenamed'; 10655 case 13: 10656 return 'activityMemberRetired'; 10657 case 14: 10658 return 'activityMemberUnretired'; 10659 case 15: 10660 return 'activityMemberMetadataUpdated'; 10661 case 16: 10662 return 'activityGroupCreated'; 10663 case 17: 10664 return 'activityGroupMetadataUpdated'; 10665 default: 10666 return 'activitySettlementPreferencesUpdated'; 10667 } 10668}; 10669var $author$project$Translations$activityEntryAdded = F2( 10670 function (description, _v0) { 10671 var lang = _v0; 10672 if (!lang) { 10673 return 'added \"' + (description + '\"'); 10674 } else { 10675 return 'a ajouté « ' + (description + ' »'); 10676 } 10677 }); 10678var $author$project$Translations$activityEntryDeleted = F2( 10679 function (description, _v0) { 10680 var lang = _v0; 10681 if (!lang) { 10682 return 'deleted \"' + (description + '\"'); 10683 } else { 10684 return 'a supprimé « ' + (description + ' »'); 10685 } 10686 }); 10687var $author$project$Translations$activityEntryModified = F2( 10688 function (description, _v0) { 10689 var lang = _v0; 10690 if (!lang) { 10691 return 'modified \"' + (description + '\"'); 10692 } else { 10693 return 'a modifié « ' + (description + ' »'); 10694 } 10695 }); 10696var $author$project$Translations$activityEntryUndeleted = F2( 10697 function (description, _v0) { 10698 var lang = _v0; 10699 if (!lang) { 10700 return 'restored \"' + (description + '\"'); 10701 } else { 10702 return 'a restauré « ' + (description + ' »'); 10703 } 10704 }); 10705var $author$project$Translations$activityGroupCreated = function (_v0) { 10706 var lang = _v0; 10707 if (!lang) { 10708 return 'created the group'; 10709 } else { 10710 return 'a créé le groupe'; 10711 } 10712}; 10713var $author$project$Translations$activityGroupMetadataUpdated = function (_v0) { 10714 var lang = _v0; 10715 if (!lang) { 10716 return 'updated group settings'; 10717 } else { 10718 return 'a mis à jour les paramètres du groupe'; 10719 } 10720}; 10721var $author$project$Translations$activityIncomeAdded = F2( 10722 function (description, _v0) { 10723 var lang = _v0; 10724 if (!lang) { 10725 return 'added income \"' + (description + '\"'); 10726 } else { 10727 return 'a ajouté un revenu « ' + (description + ' »'); 10728 } 10729 }); 10730var $author$project$Translations$activityIncomeModified = F2( 10731 function (description, _v0) { 10732 var lang = _v0; 10733 if (!lang) { 10734 return 'modified income \"' + (description + '\"'); 10735 } else { 10736 return 'a modifié un revenu « ' + (description + ' »'); 10737 } 10738 }); 10739var $author$project$Translations$activityMemberCreated = F2( 10740 function (name, _v0) { 10741 var lang = _v0; 10742 if (!lang) { 10743 return 'added member ' + name; 10744 } else { 10745 return 'a ajouté le membre ' + name; 10746 } 10747 }); 10748var $author$project$Translations$activityMemberCreatedVirtual = F2( 10749 function (name, _v0) { 10750 var lang = _v0; 10751 if (!lang) { 10752 return 'added virtual member ' + name; 10753 } else { 10754 return 'a ajouté le membre virtuel ' + name; 10755 } 10756 });
10757var $author$project$Translations$activityMemberLinked = F2( 10758 function (name, _v0) { 10759 var lang = _v0; 10760 if (!lang) { 10761 return 'linked a device for ' + name; 10762 } else { 10763 return 'a lié un appareil pour ' + name; 10764 } 10765 }); 10766var $author$project$Translations$activityMemberMetadataUpdated = F2( 10767 function (name, _v0) { 10768 var lang = _v0; 10769 if (!lang) { 10770 return 'updated contact info for ' + name; 10771 } else { 10772 return 'a mis à jour les coordonnées de ' + name; 10773 } 10774 }); 10775var $author$project$Translations$activityMemberRenamed = F2( 10776 function (data, _v0) { 10777 var lang = _v0; 10778 if (!lang) { 10779 return 'renamed ' + (data.e6 + (' to ' + data.e4)); 10780 } else { 10781 return 'a renommé ' + (data.e6 + (' en ' + data.e4)); 10782 } 10783 }); 10784var $author$project$Translations$activityMemberRetired = F2( 10785 function (name, _v0) { 10786 var lang = _v0; 10787 if (!lang) { 10788 return 'retired ' + name; 10789 } else { 10790 return 'a retiré ' + name; 10791 } 10792 }); 10793var $author$project$Translations$activityMemberUnretired = F2( 10794 function (name, _v0) { 10795 var lang = _v0; 10796 if (!lang) { 10797 return 'reactivated ' + name; 10798 } else { 10799 return 'a réactivé ' + name; 10800 } 10801 }); 10802var $author$project$Translations$activitySettlementPreferencesUpdated = F2( 10803 function (name, _v0) { 10804 var lang = _v0; 10805 if (!lang) { 10806 return 'updated settlement preferences for ' + name; 10807 } else { 10808 return 'a mis à jour les préférences de remboursement pour ' + name; 10809 } 10810 }); 10811var $author$project$Translations$activityTransferAdded = function (_v0) { 10812 var lang = _v0; 10813 if (!lang) { 10814 return 'added a transfer'; 10815 } else { 10816 return 'a ajouté un transfert'; 10817 } 10818}; 10819var $author$project$Translations$activityTransferModified = function (_v0) { 10820 var lang = _v0; 10821 if (!lang) { 10822 return 'modified a transfer'; 10823 } else { 10824 return 'a modifié un transfert'; 10825 } 10826}; 10827var $author$project$Translations$activityUnknown = function (_v0) { 10828 var lang = _v0; 10829 if (!lang) { 10830 return 'made a change this app version can\'t display â update the app to see it'; 10831 } else { 10832 return 'a fait une modification que cette version de l\'application ne peut pas afficher â mets à jour l\'application pour la voir'; 10833 } 10834}; 10835var $author$project$ActivityPhrase$render = F2( 10836 function (i18n, p) { 10837 switch (p.$) { 10838 case 0: 10839 return $author$project$Translations$activityUnknown(i18n); 10840 case 1: 10841 var description = p.a; 10842 return A2($author$project$Translations$activityEntryAdded, description, i18n); 10843 case 2: 10844 var description = p.a; 10845 return A2($author$project$Translations$activityEntryModified, description, i18n); 10846 case 3: 10847 var description = p.a; 10848 return A2($author$project$Translations$activityEntryDeleted, description, i18n); 10849 case 4: 10850 var description = p.a; 10851 return A2($author$project$Translations$activityEntryUndeleted, description, i18n); 10852 case 5: 10853 return $author$project$Translations$activityTransferAdded(i18n); 10854 case 6: 10855 return $author$project$Translations$activityTransferModified(i18n); 10856 case 7: 10857 var description = p.a; 10858 return A2($author$project$Translations$activityIncomeAdded, description, i18n); 10859 case 8: 10860 var description = p.a; 10861 return A2($author$project$Translations$activityIncomeModified, description, i18n); 10862 case 9: 10863 var name = p.a; 10864 return A2($author$project$Translations$activityMemberCreated, name, i18n); 10865 case 10: 10866 var name = p.a; 10867 return A2($author$project$Translations$activityMemberCreatedVirtual, name, i18n); 10868 case 11: 10869 var name = p.a; 10870 return A2($author$project$Translations$activityMemberLinked, name, i18n); 10871 case 12: 10872 var names = p.a; 10873 return A2($author$project$Translations$activityMemberRenamed, names, i18n); 10874 case 13: 10875 var name = p.a; 10876 return A2($author$project$Translations$activityMemberRetired, name, i18n); 10877 case 14: 10878 var name = p.a; 10879 return A2($author$project$Translations$activityMemberUnretired, name, i18n); 10880 case 15: 10881 var name = p.a; 10882 return A2($author$project$Translations$activityMemberMetadataUpdated, name, i18n); 10883 case 16: 10884 return $author$project$Translations$activityGroupCreated(i18n); 10885 case 17: 10886 return $author$project$Translations$activityGroupMetadataUpdated(i18n); 10887 default: 10888 var name = p.a; 10889 return A2($author$project$Translations$activitySettlementPreferencesUpdated, name, i18n); 10890 } 10891 }); 10892var $author$project$ActivityPhrase$EntryAdded = function (a) { 10893 return {$: 1, a: a}; 10894}; 10895var $author$project$ActivityPhrase$EntryDeleted = function (a) { 10896 return {$: 3, a: a}; 10897}; 10898var $author$project$ActivityPhrase$EntryModified = function (a) { 10899 return {$: 2, a: a}; 10900}; 10901var $author$project$ActivityPhrase$EntryUndeleted = function (a) { 10902 return {$: 4, a: a}; 10903}; 10904var $author$project$ActivityPhrase$GroupCreated = {$: 16}; 10905var $author$project$ActivityPhrase$GroupMetadataUpdated = {$: 17}; 10906var $author$project$ActivityPhrase$IncomeAdded = function (a) { 10907 return {$: 7, a: a}; 10908}; 10909var $author$project$ActivityPhrase$IncomeModified = function (a) { 10910 return {$: 8, a: a}; 10911}; 10912var $author$project$ActivityPhrase$MemberCreated = function (a) { 10913 return {$: 9, a: a}; 10914}; 10915var $author$project$ActivityPhrase$MemberCreatedVirtual = function (a) { 10916 return {$: 10, a: a}; 10917};
10918var $author$project$ActivityPhrase$MemberLinked = function (a) { 10919 return {$: 11, a: a}; 10920}; 10921var $author$project$ActivityPhrase$MemberMetadataUpdated = function (a) { 10922 return {$: 15, a: a}; 10923}; 10924var $author$project$ActivityPhrase$MemberRenamed = function (a) { 10925 return {$: 12, a: a}; 10926}; 10927var $author$project$ActivityPhrase$MemberRetired = function (a) { 10928 return {$: 13, a: a}; 10929}; 10930var $author$project$ActivityPhrase$MemberUnretired = function (a) { 10931 return {$: 14, a: a}; 10932}; 10933var $author$project$ActivityPhrase$SettlementPreferencesUpdated = function (a) { 10934 return {$: 18, a: a}; 10935}; 10936var $author$project$ActivityPhrase$TransferAdded = {$: 5}; 10937var $author$project$ActivityPhrase$TransferModified = {$: 6}; 10938var $author$project$ActivityPhrase$Unknown = {$: 0}; 10939var $author$project$ActivityPhrase$samples = _List_fromArray( 10940 [ 10941 $author$project$ActivityPhrase$Unknown, 10942 $author$project$ActivityPhrase$EntryAdded('{description}'), 10943 $author$project$ActivityPhrase$EntryModified('{description}'), 10944 $author$project$ActivityPhrase$EntryDeleted('{description}'), 10945 $author$project$ActivityPhrase$EntryUndeleted('{description}'), 10946 $author$project$ActivityPhrase$TransferAdded, 10947 $author$project$ActivityPhrase$TransferModified, 10948 $author$project$ActivityPhrase$IncomeAdded('{description}'), 10949 $author$project$ActivityPhrase$IncomeModified('{description}'), 10950 $author$project$ActivityPhrase$MemberCreated('{name}'), 10951 $author$project$ActivityPhrase$MemberCreatedVirtual('{name}'), 10952 $author$project$ActivityPhrase$MemberLinked('{name}'), 10953 $author$project$ActivityPhrase$MemberRenamed( 10954 {e4: '{newName}', e6: '{oldName}'}), 10955 $author$project$ActivityPhrase$MemberRetired('{name}'), 10956 $author$project$ActivityPhrase$MemberUnretired('{name}'), 10957 $author$project$ActivityPhrase$MemberMetadataUpdated('{name}'), 10958 $author$project$ActivityPhrase$GroupCreated, 10959 $author$project$ActivityPhrase$GroupMetadataUpdated, 10960 $author$project$ActivityPhrase$SettlementPreferencesUpdated('{name}') 10961 ]); 10962var $author$project$ActivityPhrase$templates = function (i18n) { 10963 return A2( 10964 $elm$core$List$map, 10965 function (p) { 10966 return _Utils_Tuple2( 10967 $author$project$ActivityPhrase$key(p), 10968 A2($author$project$ActivityPhrase$render, i18n, p)); 10969 }, 10970 $author$project$ActivityPhrase$samples); 10971}; 10972var $author$project$Infra$PushServer$notificationBundle = function (lang) { 10973 var i18n = $author$project$Translations$init(lang); 10974 var wrappers = _List_fromArray( 10975 [ 10976 _Utils_Tuple2( 10977 'activityAmountSuffix', 10978 A2( 10979 $author$project$Translations$activityAmountSuffix, 10980 {ef: '{amount}', qI: '{text}'}, 10981 i18n)), 10982 _Utils_Tuple2( 10983 'notificationLine', 10984 A2( 10985 $author$project$Translations$notificationLine, 10986 {k9: '{actor}', ps: '{phrase}'}, 10987 i18n)), 10988 _Utils_Tuple2( 10989 'notificationGeneric', 10990 $author$project$Translations$notificationGeneric(i18n)) 10991 ]); 10992 var cfg = $author$project$Format$localeConfig(lang); 10993 return $elm$json$Json$Encode$object( 10994 _List_fromArray( 10995 [ 10996 _Utils_Tuple2( 10997 't', 10998 $elm$json$Json$Encode$object( 10999 A2( 11000 $elm$core$List$map, 11001 $elm$core$Tuple$mapSecond($elm$json$Json$Encode$string), 11002 _Utils_ap( 11003 $author$project$ActivityPhrase$templates(i18n), 11004 wrappers)))), 11005 _Utils_Tuple2( 11006 'n', 11007 $elm$json$Json$Encode$object( 11008 _List_fromArray( 11009 [ 11010 _Utils_Tuple2( 11011 'decimal', 11012 $elm$json$Json$Encode$string(cfg.eC)), 11013 _Utils_Tuple2( 11014 'group', 11015 $elm$json$Json$Encode$string(cfg.cs)), 11016 _Utils_Tuple2( 11017 'pos', 11018 $elm$json$Json$Encode$string( 11019 function () { 11020 var _v0 = cfg.fy; 11021 if (!_v0) { 11022 return 'prefix'; 11023 } else { 11024 return 'suffix'; 11025 } 11026 }())) 11027 ]))) 11028 ])); 11029}; 11030var $author$project$IndexedDb$Index = $elm$core$Basics$identity; 11031var $author$project$IndexedDb$defineIndex = F2( 11032 function (name, keyPath) { 11033 return {bS: keyPath, e1: false, bW: name, fI: false}; 11034 }); 11035var $author$project$Infra$Storage$byGroupIdIndex = A2($author$project$IndexedDb$defineIndex, 'byGroupId', 'groupId'); 11036var $author$project$IndexedDb$withIndex = F2( 11037 function (_v0, _v1) { 11038 var indexConfig = _v0; 11039 var config = _v1; 11040 return _Utils_update( 11041 config, 11042 { 11043 dj: A2($elm$core$List$cons, indexConfig, config.dj) 11044 }); 11045 }); 11046var $author$project$Infra$Storage$eventsStore = A2( 11047 $author$project$IndexedDb$withIndex, 11048 $author$project$Infra$Storage$byGroupIdIndex, 11049 A2( 11050 $author$project$IndexedDb$withKeyPath, 11051 'id', 11052 $author$project$IndexedDb$defineStore('events'))); 11053var $author$project$Infra$Storage$exchangeRatesStore = $author$project$IndexedDb$defineStore('exchangeRates'); 11054var $author$project$Infra$Storage$groupKeysStore = $author$project$IndexedDb$defineStore('groupKeys'); 11055var $author$project$IndexedDb$Schema = $elm$core$Basics$identity; 11056var $author$project$IndexedDb$schema = F2( 11057 function (name, version) { 11058 return {bW: name, fv: _List_Nil, fK: version}; 11059 }); 11060var $author$project$Infra$Storage$suspicionDismissalsStore = $author$project$IndexedDb$defineStore('suspicionDismissals'); 11061var $author$project$Infra$Storage$syncCursorsStore = $author$project$IndexedDb$defineStore('syncCursors'); 11062var $author$project$Infra$Storage$tamperSignalsStore = $author$project$IndexedDb$defineStore('tamperSignals'); 11063var $author$project$Infra$Storage$usageStatsStore = $author$project$IndexedDb$defineStore('usageStats'); 11064var $author$project$IndexedDb$withStore = F2( 11065 function (_v0, _v1) { 11066 var config = _v0; 11067 var s = _v1; 11068 return _Utils_update( 11069 s, 11070 { 11071 fv: A2($elm$core$List$cons, config, s.fv) 11072 }); 11073 }); 11074var $author$project$Infra$Storage$dbSchema = A2( 11075 $author$project$IndexedDb$withStore, 11076 $author$project$Infra$Storage$activityMarkersStore, 11077 A2( 11078 $author$project$IndexedDb$withStore, 11079 $author$project$Infra$Storage$notifyTopicsStore, 11080 A2( 11081 $author$project$IndexedDb$withStore, 11082 $author$project$Infra$Storage$suspicionDismissalsStore, 11083 A2( 11084 $author$project$IndexedDb$withStore, 11085 $author$project$Infra$Storage$tamperSignalsStore, 11086 A2( 11087 $author$project$IndexedDb$withStore, 11088 $author$project$Infra$Storage$exchangeRatesStore, 11089 A2( 11090 $author$project$IndexedDb$withStore, 11091 $author$project$Infra$Storage$usageStatsStore, 11092 A2( 11093 $author$project$IndexedDb$withStore, 11094 $author$project$Infra$Storage$syncCursorsStore, 11095 A2( 11096 $author$project$IndexedDb$withStore, 11097 $author$project$Infra$Storage$eventsStore, 11098 A2( 11099 $author$project$IndexedDb$withStore, 11100 $author$project$Infra$Storage$groupKeysStore, 11101 A2( 11102 $author$project$IndexedDb$withStore, 11103 $author$project$Infra$Storage$groupsStore, 11104 A2( 11105 $author$project$IndexedDb$withStore, 11106 $author$project$Infra$Storage$identityStore, 11107 A2($author$project$IndexedDb$schema, 'partage', 11)))))))))))); 11108var $author$project$IndexedDb$Db = $elm$core$Basics$identity; 11109var $elm$json$Json$Encode$bool = _Json_wrap; 11110var $author$project$IndexedDb$encodeIndexConfig = function (config) { 11111 return $elm$json$Json$Encode$object( 11112 _List_fromArray( 11113 [ 11114 _Utils_Tuple2( 11115 'name', 11116 $elm$json$Json$Encode$string(config.bW)), 11117 _Utils_Tuple2( 11118 'keyPath', 11119 $elm$json$Json$Encode$string(config.bS)), 11120 _Utils_Tuple2( 11121 'unique', 11122 $elm$json$Json$Encode$bool(config.fI)), 11123 _Utils_Tuple2( 11124 'multiEntry', 11125 $elm$json$Json$Encode$bool(config.e1)) 11126 ])); 11127}; 11128var $elm$json$Json$Encode$null = _Json_encodeNull; 11129var $author$project$IndexedDb$encodeStoreConfig = function (config) { 11130 return $elm$json$Json$Encode$object( 11131 _List_fromArray( 11132 [ 11133 _Utils_Tuple2( 11134 'name', 11135 $elm$json$Json$Encode$string(config.bW)), 11136 _Utils_Tuple2( 11137 'keyPath', 11138 function () { 11139 var _v0 = config.bS; 11140 if (!_v0.$) { 11141 var p = _v0.a; 11142 return $elm$json$Json$Encode$string(p); 11143 } else { 11144 return $elm$json$Json$Encode$null; 11145 } 11146 }()), 11147 _Utils_Tuple2( 11148 'autoIncrement', 11149 $elm$json$Json$Encode$bool(config.ek)), 11150 _Utils_Tuple2( 11151 'indexes', 11152 A2($elm$json$Json$Encode$list, $author$project$IndexedDb$encodeIndexConfig, config.dj)) 11153 ])); 11154}; 11155var $author$project$IndexedDb$encodeSchema = F3( 11156 function (name, version, stores) { 11157 return $elm$json$Json$Encode$object( 11158 _List_fromArray( 11159 [ 11160 _Utils_Tuple2(
11161 'name', 11162 $elm$json$Json$Encode$string(name)), 11163 _Utils_Tuple2( 11164 'version', 11165 $elm$json$Json$Encode$int(version)), 11166 _Utils_Tuple2( 11167 'stores', 11168 A2($elm$json$Json$Encode$list, $author$project$IndexedDb$encodeStoreConfig, stores)) 11169 ])); 11170 }); 11171var $andrewMacmurray$elm_concurrent_task$ConcurrentTask$expectWhatever = $elm$json$Json$Decode$succeed(0); 11172var $andrewMacmurray$elm_concurrent_task$ConcurrentTask$Internal$fail = function (x) { 11173 return $andrewMacmurray$elm_concurrent_task$ConcurrentTask$Internal$wrap( 11174 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$Internal$Error(x)); 11175}; 11176var $andrewMacmurray$elm_concurrent_task$ConcurrentTask$fail = $andrewMacmurray$elm_concurrent_task$ConcurrentTask$Internal$fail; 11177var $elm$core$Dict$member = F2( 11178 function (key, dict) { 11179 var _v0 = A2($elm$core$Dict$get, key, dict); 11180 if (!_v0.$) { 11181 return true; 11182 } else { 11183 return false; 11184 } 11185 }); 11186var $elm$core$Set$member = F2( 11187 function (key, _v0) { 11188 var dict = _v0; 11189 return A2($elm$core$Dict$member, key, dict); 11190 }); 11191var $author$project$IndexedDb$findDuplicates = function (names) { 11192 return $elm$core$Set$toList( 11193 A3( 11194 $elm$core$List$foldl, 11195 F2( 11196 function (name, _v0) { 11197 var seen = _v0.a; 11198 var dupes = _v0.b; 11199 return A2($elm$core$Set$member, name, seen) ? _Utils_Tuple2( 11200 seen, 11201 A2($elm$core$Set$insert, name, dupes)) : _Utils_Tuple2( 11202 A2($elm$core$Set$insert, name, seen), 11203 dupes); 11204 }), 11205 _Utils_Tuple2($elm$core$Set$empty, $elm$core$Set$empty), 11206 names).b); 11207}; 11208var $author$project$IndexedDb$open = function (_v0) { 11209 var s = _v0; 11210 var stores = $elm$core$List$reverse(s.fv); 11211 var names = A2( 11212 $elm$core$List$map, 11213 function ($) { 11214 return $.bW; 11215 }, 11216 stores); 11217 var duplicates = $author$project$IndexedDb$findDuplicates(names); 11218 return $elm$core$List$isEmpty(duplicates) ? A2( 11219 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$map, 11220 function (_v1) { 11221 return s.bW; 11222 }, 11223 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$define( 11224 { 11225 k: A3($author$project$IndexedDb$encodeSchema, s.bW, s.fK, stores), 11226 l: $andrewMacmurray$elm_concurrent_task$ConcurrentTask$expectErrors($author$project$IndexedDb$errorDecoder), 11227 m: $andrewMacmurray$elm_concurrent_task$ConcurrentTask$expectWhatever, 11228 n: 'indexeddb:open' 11229 })) : $andrewMacmurray$elm_concurrent_task$ConcurrentTask$fail( 11230 $author$project$IndexedDb$DatabaseError( 11231 'Duplicate store names in schema: ' + A2($elm$core$String$join, ', ', duplicates))); 11232}; 11233var $author$project$Infra$Storage$open = $author$project$IndexedDb$open($author$project$Infra$Storage$dbSchema); 11234var $andrewMacmurray$elm_concurrent_task$ConcurrentTask$Internal$pool = {cf: $andrewMacmurray$elm_concurrent_task$ConcurrentTask$Internal$Ids$init, ax: $elm$core$Dict$empty, fe: $elm$core$Maybe$Nothing}; 11235var $andrewMacmurray$elm_concurrent_task$ConcurrentTask$pool = $andrewMacmurray$elm_concurrent_task$ConcurrentTask$Internal$pool; 11236var $author$project$Main$receiveTask = _Platform_incomingPort('receiveTask', $elm$json$Json$Decode$value); 11237var $author$project$IndexedDb$putAt = F4( 11238 function (db, store, key, value) { 11239 return $andrewMacmurray$elm_concurrent_task$ConcurrentTask$define( 11240 { 11241 k: $elm$json$Json$Encode$object( 11242 _List_fromArray( 11243 [ 11244 _Utils_Tuple2( 11245 'db', 11246 $elm$json$Json$Encode$string( 11247 $author$project$IndexedDb$getDbName(db))), 11248 _Utils_Tuple2( 11249 'store', 11250 $elm$json$Json$Encode$string( 11251 $author$project$IndexedDb$getStoreName(store))), 11252 _Utils_Tuple2( 11253 'key', 11254 $author$project$IndexedDb$encodeKey(key)), 11255 _Utils_Tuple2('value', value) 11256 ])), 11257 l: $andrewMacmurray$elm_concurrent_task$ConcurrentTask$expectErrors($author$project$IndexedDb$errorDecoder), 11258 m: $andrewMacmurray$elm_concurrent_task$ConcurrentTask$expectWhatever, 11259 n: 'indexeddb:put' 11260 }); 11261 }); 11262var $author$project$Infra$Storage$saveNotificationTranslations = F2( 11263 function (db, translations) { 11264 return A4( 11265 $author$project$IndexedDb$putAt, 11266 db, 11267 $author$project$Infra$Storage$identityStore, 11268 $author$project$IndexedDb$StringKey('notificationTranslations'), 11269 translations); 11270 }); 11271var $author$project$Main$sendTask = _Platform_outgoingPort('sendTask', $elm$core$Basics$identity); 11272var $author$project$Main$setDocumentLang = _Platform_outgoingPort('setDocumentLang', $elm$json$Json$Encode$string); 11273var $elm$time$Time$utc = A2($elm$time$Time$Zone, 0, _List_Nil); 11274var $author$project$Main$init = function (flags) { 11275 var route = A2( 11276 $elm$core$Maybe$withDefault, 11277 $author$project$Route$NotFound, 11278 A2( 11279 $elm$core$Maybe$map, 11280 A2($elm$core$Basics$composeR, $lydell$elm_app_url$AppUrl$fromUrl, $author$project$Route$fromAppUrl), 11281 $elm$url$Url$fromString(flags.gy))); 11282 var language = A2( 11283 $elm$core$Maybe$withDefault, 11284 0, 11285 $author$project$Translations$languageFromString(flags.eX)); 11286 var storeNotificationTranslations = function (initData) { 11287 return A2( 11288 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$map, 11289 function (_v2) { 11290 return initData; 11291 }, 11292 A2( 11293 $author$project$Infra$Storage$saveNotificationTranslations, 11294 initData.de, 11295 $author$project$Infra$PushServer$notificationBundle(language))); 11296 }; 11297 var initStorage = A2($andrewMacmurray$elm_concurrent_task$ConcurrentTask$andThen, $author$project$Infra$Storage$init, $author$project$Infra$Storage$open); 11298 var _v0 = A3( 11299 $author$project$Infra$ConcurrentTaskExtra$andRun, 11300 $author$project$Main$OnInitComplete, 11301 A2($andrewMacmurray$elm_concurrent_task$ConcurrentTask$andThen, storeNotificationTranslations, initStorage), 11302 _Utils_Tuple2( 11303 $author$project$Infra$ConcurrentTaskExtra$initTaskRunner( 11304 {dA: $author$project$Main$OnTaskProgress, cL: $andrewMacmurray$elm_concurrent_task$ConcurrentTask$pool, dH: $author$project$Main$receiveTask, b$: $author$project$Main$sendTask}), 11305 $elm$core$Platform$Cmd$none)); 11306 var runner = _v0.a;
11307 var initCmds = _v0.b; 11308 var _v1 = $author$project$Infra$IdGen$init(flags.gw); 11309 var mainIdState = _v1.a; 11310 var groupIdState = _v1.b; 11311 return _Utils_Tuple2( 11312 { 11313 W: $author$project$Page$About$init, 11314 b: $author$project$Main$Loading, 11315 ap: $elm$time$Time$millisToPosix(flags.ap), 11316 bJ: $author$project$ErrorLog$empty, 11317 mA: $elm$core$Maybe$Nothing, 11318 bL: $elm$core$Maybe$Nothing, 11319 bN: flags.bN, 11320 u: $author$project$Page$Group$init( 11321 {s: groupIdState, cL: $andrewMacmurray$elm_concurrent_task$ConcurrentTask$pool, dH: $author$project$Main$groupReceiveTask, b$: $author$project$Main$groupSendTask}), 11322 ah: $author$project$Page$Home$init, 11323 aJ: $author$project$Translations$init(language), 11324 s: mainIdState, 11325 aT: $author$project$Main$IdentityIdle, 11326 aU: $elm$core$Maybe$Nothing, 11327 bP: flags.bP, 11328 bQ: flags.bQ, 11329 cx: flags.cx, 11330 z: $author$project$Page$JoinGroup$init, 11331 nO: $elm$core$Maybe$Nothing, 11332 nP: $elm$core$Maybe$Nothing, 11333 P: $author$project$Page$Move$init(_List_Nil), 11334 dx: $author$project$Page$NewGroup$init, 11335 aZ: flags.aZ, 11336 G: $author$project$PwaState$init( 11337 {eT: flags.eT, dk: flags.dk}), 11338 av: $author$project$Page$Receive$init, 11339 d: route, 11340 ak: runner, 11341 hl: flags.hl, 11342 al: $elm$time$Time$utc, 11343 b7: $author$project$UI$Toast$init 11344 }, 11345 $elm$core$Platform$Cmd$batch( 11346 _List_fromArray( 11347 [ 11348 initCmds, 11349 A2($elm$core$Task$perform, $author$project$Main$GotTimeZone, $elm$time$Time$here), 11350 $author$project$Main$setDocumentLang( 11351 $author$project$Translations$languageToString(language)) 11352 ]))); 11353}; 11354var $author$project$Main$ClipboardCopied = {$: 42}; 11355var $author$project$Main$GotCurrentTime = function (a) { 11356 return {$: 8, a: a}; 11357}; 11358var $author$project$Main$GroupMsg = function (a) { 11359 return {$: 22, a: a}; 11360}; 11361var $author$project$Main$OnHandoffEvent = function (a) { 11362 return {$: 19, a: a}; 11363}; 11364var $author$project$Main$OnNavEvent = function (a) { 11365 return {$: 1, a: a}; 11366}; 11367var $author$project$Main$PwaStateMsg = function (a) { 11368 return {$: 44, a: a}; 11369}; 11370var $author$project$Main$VisibilityChanged = function (a) { 11371 return {$: 9, a: a}; 11372}; 11373var $elm$core$Platform$Sub$batch = _Platform_batch; 11374var $author$project$Main$clockIntervalMs = 60 * 1000; 11375var $elm$core$Basics$composeL = F3( 11376 function (g, f, x) { 11377 return g( 11378 f(x)); 11379 }); 11380var $elm$time$Time$Every = F2( 11381 function (a, b) { 11382 return {$: 0, a: a, b: b}; 11383 }); 11384var $elm$time$Time$State = F2( 11385 function (taggers, processes) { 11386 return {jL: processes, kx: taggers}; 11387 }); 11388var $elm$time$Time$init = $elm$core$Task$succeed( 11389 A2($elm$time$Time$State, $elm$core$Dict$empty, $elm$core$Dict$empty)); 11390var $elm$time$Time$addMySub = F2( 11391 function (_v0, state) { 11392 var interval = _v0.a; 11393 var tagger = _v0.b; 11394 var _v1 = A2($elm$core$Dict$get, interval, state); 11395 if (_v1.$ === 1) { 11396 return A3( 11397 $elm$core$Dict$insert, 11398 interval, 11399 _List_fromArray( 11400 [tagger]), 11401 state); 11402 } else { 11403 var taggers = _v1.a; 11404 return A3( 11405 $elm$core$Dict$insert, 11406 interval, 11407 A2($elm$core$List$cons, tagger, taggers), 11408 state); 11409 } 11410 }); 11411var $elm$core$Process$kill = _Scheduler_kill; 11412var $elm$core$Dict$merge = F6( 11413 function (leftStep, bothStep, rightStep, leftDict, rightDict, initialResult) { 11414 var stepState = F3( 11415 function (rKey, rValue, _v0) { 11416 stepState: 11417 while (true) { 11418 var list = _v0.a; 11419 var result = _v0.b; 11420 if (!list.b) { 11421 return _Utils_Tuple2( 11422 list, 11423 A3(rightStep, rKey, rValue, result)); 11424 } else { 11425 var _v2 = list.a; 11426 var lKey = _v2.a; 11427 var lValue = _v2.b; 11428 var rest = list.b; 11429 if (_Utils_cmp(lKey, rKey) < 0) { 11430 var $temp$rKey = rKey, 11431 $temp$rValue = rValue, 11432 $temp$_v0 = _Utils_Tuple2( 11433 rest, 11434 A3(leftStep, lKey, lValue, result)); 11435 rKey = $temp$rKey; 11436 rValue = $temp$rValue; 11437 _v0 = $temp$_v0; 11438 continue stepState; 11439 } else { 11440 if (_Utils_cmp(lKey, rKey) > 0) { 11441 return _Utils_Tuple2( 11442 list, 11443 A3(rightStep, rKey, rValue, result)); 11444 } else { 11445 return _Utils_Tuple2( 11446 rest, 11447 A4(bothStep, lKey, lValue, rValue, result)); 11448 } 11449 } 11450 } 11451 } 11452 }); 11453 var _v3 = A3( 11454 $elm$core$Dict$foldl, 11455 stepState, 11456 _Utils_Tuple2( 11457 $elm$core$Dict$toList(leftDict), 11458 initialResult), 11459 rightDict); 11460 var leftovers = _v3.a; 11461 var intermediateResult = _v3.b; 11462 return A3( 11463 $elm$core$List$foldl, 11464 F2( 11465 function (_v4, result) { 11466 var k = _v4.a; 11467 var v = _v4.b; 11468 return A3(leftStep, k, v, result); 11469 }), 11470 intermediateResult, 11471 leftovers); 11472 }); 11473var $elm$core$Platform$sendToSelf = _Platform_sendToSelf; 11474var $elm$time$Time$setInterval = _Time_setInterval; 11475var $elm$core$Process$spawn = _Scheduler_spawn; 11476var $elm$time$Time$spawnHelp = F3( 11477 function (router, intervals, processes) { 11478 if (!intervals.b) { 11479 return $elm$core$Task$succeed(processes); 11480 } else { 11481 var interval = intervals.a; 11482 var rest = intervals.b; 11483 var spawnTimer = $elm$core$Process$spawn( 11484 A2( 11485 $elm$time$Time$setInterval, 11486 interval, 11487 A2($elm$core$Platform$sendToSelf, router, interval))); 11488 var spawnRest = function (id) { 11489 return A3( 11490 $elm$time$Time$spawnHelp, 11491 router, 11492 rest, 11493 A3($elm$core$Dict$insert, interval, id, processes)); 11494 };
11495 return A2($elm$core$Task$andThen, spawnRest, spawnTimer); 11496 } 11497 }); 11498var $elm$time$Time$onEffects = F3( 11499 function (router, subs, _v0) { 11500 var processes = _v0.jL; 11501 var rightStep = F3( 11502 function (_v6, id, _v7) { 11503 var spawns = _v7.a; 11504 var existing = _v7.b; 11505 var kills = _v7.c; 11506 return _Utils_Tuple3( 11507 spawns, 11508 existing, 11509 A2( 11510 $elm$core$Task$andThen, 11511 function (_v5) { 11512 return kills; 11513 }, 11514 $elm$core$Process$kill(id))); 11515 }); 11516 var newTaggers = A3($elm$core$List$foldl, $elm$time$Time$addMySub, $elm$core$Dict$empty, subs); 11517 var leftStep = F3( 11518 function (interval, taggers, _v4) { 11519 var spawns = _v4.a; 11520 var existing = _v4.b; 11521 var kills = _v4.c; 11522 return _Utils_Tuple3( 11523 A2($elm$core$List$cons, interval, spawns), 11524 existing, 11525 kills); 11526 }); 11527 var bothStep = F4( 11528 function (interval, taggers, id, _v3) { 11529 var spawns = _v3.a; 11530 var existing = _v3.b; 11531 var kills = _v3.c; 11532 return _Utils_Tuple3( 11533 spawns, 11534 A3($elm$core$Dict$insert, interval, id, existing), 11535 kills); 11536 }); 11537 var _v1 = A6( 11538 $elm$core$Dict$merge, 11539 leftStep, 11540 bothStep, 11541 rightStep, 11542 newTaggers, 11543 processes, 11544 _Utils_Tuple3( 11545 _List_Nil, 11546 $elm$core$Dict$empty, 11547 $elm$core$Task$succeed(0))); 11548 var spawnList = _v1.a; 11549 var existingDict = _v1.b; 11550 var killTask = _v1.c; 11551 return A2( 11552 $elm$core$Task$andThen, 11553 function (newProcesses) { 11554 return $elm$core$Task$succeed( 11555 A2($elm$time$Time$State, newTaggers, newProcesses)); 11556 }, 11557 A2( 11558 $elm$core$Task$andThen, 11559 function (_v2) { 11560 return A3($elm$time$Time$spawnHelp, router, spawnList, existingDict); 11561 }, 11562 killTask)); 11563 }); 11564var $elm$time$Time$now = _Time_now($elm$time$Time$millisToPosix); 11565var $elm$time$Time$onSelfMsg = F3( 11566 function (router, interval, state) { 11567 var _v0 = A2($elm$core$Dict$get, interval, state.kx); 11568 if (_v0.$ === 1) { 11569 return $elm$core$Task$succeed(state); 11570 } else { 11571 var taggers = _v0.a; 11572 var tellTaggers = function (time) { 11573 return $elm$core$Task$sequence( 11574 A2( 11575 $elm$core$List$map, 11576 function (tagger) { 11577 return A2( 11578 $elm$core$Platform$sendToApp, 11579 router, 11580 tagger(time)); 11581 }, 11582 taggers)); 11583 }; 11584 return A2( 11585 $elm$core$Task$andThen, 11586 function (_v1) { 11587 return $elm$core$Task$succeed(state); 11588 }, 11589 A2($elm$core$Task$andThen, tellTaggers, $elm$time$Time$now)); 11590 } 11591 }); 11592var $elm$time$Time$subMap = F2( 11593 function (f, _v0) { 11594 var interval = _v0.a; 11595 var tagger = _v0.b; 11596 return A2( 11597 $elm$time$Time$Every, 11598 interval, 11599 A2($elm$core$Basics$composeL, f, tagger)); 11600 }); 11601_Platform_effectManagers['Time'] = _Platform_createManager($elm$time$Time$init, $elm$time$Time$onEffects, $elm$time$Time$onSelfMsg, 0, $elm$time$Time$subMap); 11602var $elm$time$Time$subscription = _Platform_leaf('Time'); 11603var $elm$time$Time$every = F2( 11604 function (interval, tagger) { 11605 return $elm$time$Time$subscription( 11606 A2($elm$time$Time$Every, interval, tagger)); 11607 }); 11608var $author$project$Main$handoffIn = _Platform_incomingPort('handoffIn', $elm$json$Json$Decode$value); 11609var $elm$core$Platform$Sub$map = _Platform_map; 11610var $author$project$Main$onClipboardCopy = _Platform_incomingPort( 11611 'onClipboardCopy', 11612 $elm$json$Json$Decode$null(0)); 11613var $mpizenberg$elm_url_navigation_port$Navigation$Event = F2( 11614 function (appUrl, state) { 11615 return {ls: appUrl, hp: state}; 11616 }); 11617var $mpizenberg$elm_url_navigation_port$Navigation$decoder = A3( 11618 $elm$json$Json$Decode$map2, 11619 $mpizenberg$elm_url_navigation_port$Navigation$Event, 11620 A2( 11621 $elm$json$Json$Decode$andThen, 11622 function (href) { 11623 var _v0 = $elm$url$Url$fromString(href); 11624 if (!_v0.$) { 11625 var url = _v0.a; 11626 return $elm$json$Json$Decode$succeed( 11627 $lydell$elm_app_url$AppUrl$fromUrl(url)); 11628 } else { 11629 return $elm$json$Json$Decode$fail('Invalid URL: ' + href); 11630 } 11631 }, 11632 A2($elm$json$Json$Decode$field, 'href', $elm$json$Json$Decode$string)), 11633 A2($elm$json$Json$Decode$field, 'state', $elm$json$Json$Decode$value)); 11634var $lydell$elm_app_url$AppUrl$fromPath = function (path) { 11635 return {dh: $elm$core$Maybe$Nothing, fb: path, fj: $elm$core$Dict$empty}; 11636}; 11637var $mpizenberg$elm_url_navigation_port$Navigation$onEvent = F2( 11638 function (port_, toMsg) { 11639 return port_( 11640 function (value) { 11641 var _v0 = A2($elm$json$Json$Decode$decodeValue, $mpizenberg$elm_url_navigation_port$Navigation$decoder, value); 11642 if (!_v0.$) { 11643 var event = _v0.a; 11644 return toMsg(event); 11645 } else { 11646 return toMsg( 11647 { 11648 ls: $lydell$elm_app_url$AppUrl$fromPath(_List_Nil), 11649 hp: $elm$json$Json$Encode$null 11650 }); 11651 } 11652 }); 11653 }); 11654var $author$project$Main$onNavEvent = _Platform_incomingPort('onNavEvent', $elm$json$Json$Decode$value); 11655var $author$project$Main$onServerEvent = _Platform_incomingPort('onServerEvent', $elm$json$Json$Decode$value); 11656var $elm$browser$Browser$Events$Document = 0; 11657var $elm$browser$Browser$Events$MySub = F3( 11658 function (a, b, c) {
11659 return {$: 0, a: a, b: b, c: c}; 11660 }); 11661var $elm$browser$Browser$Events$State = F2( 11662 function (subs, pids) { 11663 return {jG: pids, kv: subs}; 11664 }); 11665var $elm$browser$Browser$Events$init = $elm$core$Task$succeed( 11666 A2($elm$browser$Browser$Events$State, _List_Nil, $elm$core$Dict$empty)); 11667var $elm$browser$Browser$Events$nodeToKey = function (node) { 11668 if (!node) { 11669 return 'd_'; 11670 } else { 11671 return 'w_'; 11672 } 11673}; 11674var $elm$browser$Browser$Events$addKey = function (sub) { 11675 var node = sub.a; 11676 var name = sub.b; 11677 return _Utils_Tuple2( 11678 _Utils_ap( 11679 $elm$browser$Browser$Events$nodeToKey(node), 11680 name), 11681 sub); 11682}; 11683var $elm$browser$Browser$Events$Event = F2( 11684 function (key, event) { 11685 return {iy: event, i4: key}; 11686 }); 11687var $elm$browser$Browser$Events$spawn = F3( 11688 function (router, key, _v0) { 11689 var node = _v0.a; 11690 var name = _v0.b; 11691 var actualNode = function () { 11692 if (!node) { 11693 return _Browser_doc; 11694 } else { 11695 return _Browser_window; 11696 } 11697 }(); 11698 return A2( 11699 $elm$core$Task$map, 11700 function (value) { 11701 return _Utils_Tuple2(key, value); 11702 }, 11703 A3( 11704 _Browser_on, 11705 actualNode, 11706 name, 11707 function (event) { 11708 return A2( 11709 $elm$core$Platform$sendToSelf, 11710 router, 11711 A2($elm$browser$Browser$Events$Event, key, event)); 11712 })); 11713 }); 11714var $elm$browser$Browser$Events$onEffects = F3( 11715 function (router, subs, state) { 11716 var stepRight = F3( 11717 function (key, sub, _v6) { 11718 var deads = _v6.a; 11719 var lives = _v6.b; 11720 var news = _v6.c; 11721 return _Utils_Tuple3( 11722 deads, 11723 lives, 11724 A2( 11725 $elm$core$List$cons, 11726 A3($elm$browser$Browser$Events$spawn, router, key, sub), 11727 news)); 11728 }); 11729 var stepLeft = F3( 11730 function (_v4, pid, _v5) { 11731 var deads = _v5.a; 11732 var lives = _v5.b; 11733 var news = _v5.c; 11734 return _Utils_Tuple3( 11735 A2($elm$core$List$cons, pid, deads), 11736 lives, 11737 news); 11738 }); 11739 var stepBoth = F4( 11740 function (key, pid, _v2, _v3) { 11741 var deads = _v3.a; 11742 var lives = _v3.b; 11743 var news = _v3.c; 11744 return _Utils_Tuple3( 11745 deads, 11746 A3($elm$core$Dict$insert, key, pid, lives), 11747 news); 11748 }); 11749 var newSubs = A2($elm$core$List$map, $elm$browser$Browser$Events$addKey, subs); 11750 var _v0 = A6( 11751 $elm$core$Dict$merge, 11752 stepLeft, 11753 stepBoth, 11754 stepRight, 11755 state.jG, 11756 $elm$core$Dict$fromList(newSubs), 11757 _Utils_Tuple3(_List_Nil, $elm$core$Dict$empty, _List_Nil)); 11758 var deadPids = _v0.a; 11759 var livePids = _v0.b; 11760 var makeNewPids = _v0.c; 11761 return A2( 11762 $elm$core$Task$andThen, 11763 function (pids) { 11764 return $elm$core$Task$succeed( 11765 A2( 11766 $elm$browser$Browser$Events$State, 11767 newSubs, 11768 A2( 11769 $elm$core$Dict$union, 11770 livePids, 11771 $elm$core$Dict$fromList(pids)))); 11772 }, 11773 A2( 11774 $elm$core$Task$andThen, 11775 function (_v1) { 11776 return $elm$core$Task$sequence(makeNewPids); 11777 }, 11778 $elm$core$Task$sequence( 11779 A2($elm$core$List$map, $elm$core$Process$kill, deadPids)))); 11780 }); 11781var $elm$browser$Browser$Events$onSelfMsg = F3( 11782 function (router, _v0, state) { 11783 var key = _v0.i4; 11784 var event = _v0.iy; 11785 var toMessage = function (_v2) { 11786 var subKey = _v2.a; 11787 var _v3 = _v2.b; 11788 var node = _v3.a; 11789 var name = _v3.b; 11790 var decoder = _v3.c; 11791 return _Utils_eq(subKey, key) ? A2(_Browser_decodeEvent, decoder, event) : $elm$core$Maybe$Nothing; 11792 }; 11793 var messages = A2($elm$core$List$filterMap, toMessage, state.kv); 11794 return A2( 11795 $elm$core$Task$andThen, 11796 function (_v1) { 11797 return $elm$core$Task$succeed(state); 11798 }, 11799 $elm$core$Task$sequence( 11800 A2( 11801 $elm$core$List$map, 11802 $elm$core$Platform$sendToApp(router), 11803 messages))); 11804 }); 11805var $elm$browser$Browser$Events$subMap = F2( 11806 function (func, _v0) { 11807 var node = _v0.a; 11808 var name = _v0.b; 11809 var decoder = _v0.c; 11810 return A3( 11811 $elm$browser$Browser$Events$MySub, 11812 node, 11813 name, 11814 A2($elm$json$Json$Decode$map, func, decoder)); 11815 }); 11816_Platform_effectManagers['Browser.Events'] = _Platform_createManager($elm$browser$Browser$Events$init, $elm$browser$Browser$Events$onEffects, $elm$browser$Browser$Events$onSelfMsg, 0, $elm$browser$Browser$Events$subMap); 11817var $elm$browser$Browser$Events$subscription = _Platform_leaf('Browser.Events'); 11818var $elm$browser$Browser$Events$on = F3( 11819 function (node, name, decoder) { 11820 return $elm$browser$Browser$Events$subscription( 11821 A3($elm$browser$Browser$Events$MySub, node, name, decoder)); 11822 }); 11823var $elm$browser$Browser$Events$Hidden = 1; 11824var $elm$browser$Browser$Events$Visible = 0; 11825var $elm$browser$Browser$Events$withHidden = F2( 11826 function (func, isHidden) { 11827 return func( 11828 isHidden ? 1 : 0); 11829 }); 11830var $elm$browser$Browser$Events$onVisibilityChange = function (func) { 11831 var info = _Browser_visibilityInfo(0); 11832 return A3( 11833 $elm$browser$Browser$Events$on, 11834 0, 11835 info.lO, 11836 A2( 11837 $elm$json$Json$Decode$map, 11838 $elm$browser$Browser$Events$withHidden(func), 11839 A2( 11840 $elm$json$Json$Decode$field, 11841 'target', 11842 A2($elm$json$Json$Decode$field, info.m2, $elm$json$Json$Decode$bool)))); 11843}; 11844var $author$project$Main$pwaIn = _Platform_incomingPort('pwaIn', $elm$json$Json$Decode$value); 11845var $author$project$Page$Group$OnServerEvent = function (a) { 11846 return {$: 44, a: a}; 11847}; 11848var $author$project$Page$Group$serverEventMsg = $author$project$Page$Group$OnServerEvent; 11849var $andrewMacmurray$elm_concurrent_task$ConcurrentTask$Internal$findAttempt = F2( 11850 function (attemptId, _v0) { 11851 var p = _v0; 11852 return A2($elm$core$Dict$get, attemptId, p.ax); 11853 }); 11854var $andrewMacmurray$elm_concurrent_task$ConcurrentTask$Internal$RawResult = F3( 11855 function (attemptId, taskId, result) { 11856 return {hS: attemptId, dI: result, bB: taskId}; 11857 }); 11858var $andrewMacmurray$elm_concurrent_task$ConcurrentTask$Internal$decodeRawResult = A4( 11859 $elm$json$Json$Decode$map3, 11860 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$Internal$RawResult, 11861 A2($elm$json$Json$Decode$field, 'attemptId', $elm$json$Json$Decode$string), 11862 A2($elm$json$Json$Decode$field, 'taskId', $elm$json$Json$Decode$string), 11863 A2($elm$json$Json$Decode$field, 'result', $elm$json$Json$Decode$value)); 11864var $elm$core$Result$map = F2( 11865 function (func, ra) { 11866 if (!ra.$) { 11867 var a = ra.a; 11868 return $elm$core$Result$Ok( 11869 func(a)); 11870 } else { 11871 var e = ra.a; 11872 return $elm$core$Result$Err(e); 11873 } 11874 }); 11875var $elm$core$Result$withDefault = F2( 11876 function (def, result) { 11877 if (!result.$) { 11878 var a = result.a; 11879 return a; 11880 } else { 11881 return def; 11882 } 11883 }); 11884var $andrewMacmurray$elm_concurrent_task$ConcurrentTask$Internal$toBatchResults = function () { 11885 var toBatchResults_ = A2( 11886 $elm$core$List$foldl, 11887 F2( 11888 function (result, batch_) { 11889 return A3( 11890 $elm$core$Dict$update, 11891 result.hS, 11892 function (attempt_) { 11893 if (attempt_.$ === 1) { 11894 return $elm$core$Maybe$Just( 11895 A2($elm$core$Dict$singleton, result.bB, result.dI)); 11896 } else { 11897 var attempt__ = attempt_.a; 11898 return $elm$core$Maybe$Just( 11899 A3($elm$core$Dict$insert, result.bB, result.dI, attempt__)); 11900 } 11901 }, 11902 batch_); 11903 }), 11904 $elm$core$Dict$empty); 11905 return A2( 11906 $elm$core$Basics$composeR, 11907 $elm$json$Json$Decode$decodeValue( 11908 $elm$json$Json$Decode$list($andrewMacmurray$elm_concurrent_task$ConcurrentTask$Internal$decodeRawResult)), 11909 A2( 11910 $elm$core$Basics$composeR, 11911 $elm$core$Result$map(toBatchResults_), 11912 $elm$core$Result$withDefault($elm$core$Dict$empty))); 11913}(); 11914var $elm$core$Array$filter = F2( 11915 function (isGood, array) { 11916 return $elm$core$Array$fromList( 11917 A3( 11918 $elm$core$Array$foldr, 11919 F2( 11920 function (x, xs) { 11921 return isGood(x) ? A2($elm$core$List$cons, x, xs) : xs; 11922 }), 11923 _List_Nil, 11924 array)); 11925 }); 11926var $elm$core$Dict$diff = F2( 11927 function (t1, t2) { 11928 return A3( 11929 $elm$core$Dict$foldl, 11930 F3( 11931 function (k, v, t) { 11932 return A2($elm$core$Dict$remove, k, t); 11933 }), 11934 t1, 11935 t2); 11936 }); 11937var $elm$core$Set$diff = F2( 11938 function (_v0, _v1) { 11939 var dict1 = _v0; 11940 var dict2 = _v1; 11941 return A2($elm$core$Dict$diff, dict1, dict2); 11942 }); 11943var $andrewMacmurray$elm_concurrent_task$ConcurrentTask$Internal$removeCompleted = F2( 11944 function (res, inFlight) { 11945 return A2( 11946 $elm$core$Set$diff, 11947 inFlight, 11948 $elm$core$Set$fromList( 11949 $elm$core$Dict$keys(res))); 11950 }); 11951var $andrewMacmurray$elm_concurrent_task$ConcurrentTask$Internal$removeFromPool = function (attemptId) { 11952 return $andrewMacmurray$elm_concurrent_task$ConcurrentTask$Internal$mapPool( 11953 function (pool_) { 11954 return _Utils_update( 11955 pool_, 11956 { 11957 ax: A2($elm$core$Dict$remove, attemptId, pool_.ax) 11958 }); 11959 }); 11960}; 11961var $elm$core$Basics$always = F2( 11962 function (a, _v0) { 11963 return a; 11964 }); 11965var $andrewMacmurray$elm_concurrent_task$ConcurrentTask$Internal$updateProgressFor = F2( 11966 function (attemptId, progress_) { 11967 return $andrewMacmurray$elm_concurrent_task$ConcurrentTask$Internal$mapPool( 11968 function (pool_) { 11969 return _Utils_update( 11970 pool_, 11971 { 11972 ax: A3( 11973 $elm$core$Dict$update, 11974 attemptId, 11975 $elm$core$Maybe$map( 11976 $elm$core$Basics$always(progress_)), 11977 pool_.ax) 11978 }); 11979 }); 11980 }); 11981var $andrewMacmurray$elm_concurrent_task$ConcurrentTask$Internal$updateAttempt = F4( 11982 function (options, pool_, _v0, progress) { 11983 var attemptId = _v0.a; 11984 var results = _v0.b; 11985 var _v1 = A2($andrewMacmurray$elm_concurrent_task$ConcurrentTask$Internal$stepTask, results, progress.fB); 11986 if (!_v1.b.$) { 11987 var ids_ = _v1.a; 11988 var _v2 = _v1.b; 11989 var next_ = _v2.b; 11990 var notStarted = function (def) { 11991 return !A2($elm$core$Set$member, def.bB, progress.ai); 11992 }; 11993 var nextProgress = _Utils_Tuple2(ids_, next_); 11994 var _v3 = A2($andrewMacmurray$elm_concurrent_task$ConcurrentTask$Internal$stepTask, results, nextProgress); 11995 if (_v3.b.$ === 1) { 11996 var res = _v3.b.a; 11997 return _Utils_Tuple2( 11998 A2($andrewMacmurray$elm_concurrent_task$ConcurrentTask$Internal$removeFromPool, attemptId, pool_), 11999 A2($andrewMacmurray$elm_concurrent_task$ConcurrentTask$Internal$sendResult, progress.ju, res)); 12000 } else { 12001 var _v4 = _v3.b; 12002 var defs = _v4.a; 12003 return _Utils_Tuple2( 12004 A3( 12005 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$Internal$updateProgressFor, 12006 attemptId, 12007 _Utils_update( 12008 progress, 12009 { 12010 ai: A2( 12011 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$Internal$removeCompleted, 12012 results, 12013 A2($andrewMacmurray$elm_concurrent_task$ConcurrentTask$Internal$recordSent, defs, progress.ai)), 12014 fB: nextProgress 12015 }), 12016 pool_), 12017 options.b$( 12018 A2( 12019 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$Internal$encodeDefinitions, 12020 attemptId, 12021 A2($elm$core$Array$filter, notStarted, defs)))); 12022 } 12023 } else { 12024 return _Utils_Tuple2(pool_, $elm$core$Platform$Cmd$none); 12025 } 12026 }); 12027var $andrewMacmurray$elm_concurrent_task$ConcurrentTask$Internal$withCmd = function (cmd) { 12028 return $elm$core$Tuple$mapSecond( 12029 function (c) { 12030 return $elm$core$Platform$Cmd$batch( 12031 _List_fromArray( 12032 [c, cmd])); 12033 }); 12034}; 12035var $andrewMacmurray$elm_concurrent_task$ConcurrentTask$Internal$onProgress = F2( 12036 function (options, pool_) { 12037 return options.dH( 12038 function (rawResults) { 12039 return options.dA( 12040 A3( 12041 $elm$core$List$foldl, 12042 F2( 12043 function (_v0, _v1) { 12044 var attempt_ = _v0.a; 12045 var results = _v0.b; 12046 var p = _v1.a; 12047 var cmd = _v1.b; 12048 var _v2 = A2($andrewMacmurray$elm_concurrent_task$ConcurrentTask$Internal$findAttempt, attempt_, p); 12049 if (_v2.$ === 1) { 12050 return _Utils_Tuple2(p, cmd); 12051 } else { 12052 var progress = _v2.a; 12053 return A2( 12054 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$Internal$withCmd, 12055 cmd, 12056 A4( 12057 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$Internal$updateAttempt, 12058 options, 12059 p, 12060 _Utils_Tuple2(attempt_, results), 12061 progress)); 12062 } 12063 }), 12064 _Utils_Tuple2(pool_, $elm$core$Platform$Cmd$none), 12065 $elm$core$Dict$toList( 12066 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$Internal$toBatchResults(rawResults)))); 12067 }); 12068 }); 12069var $andrewMacmurray$elm_concurrent_task$ConcurrentTask$onProgress = $andrewMacmurray$elm_concurrent_task$ConcurrentTask$Internal$onProgress; 12070var $author$project$Infra$ConcurrentTaskExtra$subscription = function (_v0) { 12071 var r = _v0; 12072 return A2( 12073 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$onProgress, 12074 { 12075 dA: function (_v1) { 12076 var newPool = _v1.a; 12077 var cmd = _v1.b; 12078 return r.dA( 12079 _Utils_Tuple2( 12080 _Utils_update( 12081 r, 12082 {cL: newPool}), 12083 cmd)); 12084 }, 12085 dH: r.dH, 12086 b$: r.b$ 12087 }, 12088 r.cL); 12089}; 12090var $author$project$Page$Group$SyncTick = {$: 45}; 12091var $elm$core$Platform$Sub$none = $elm$core$Platform$Sub$batch(_List_Nil); 12092var $author$project$Page$Group$subscription = function (model) { 12093 return $elm$core$Platform$Sub$batch( 12094 _List_fromArray( 12095 [ 12096 $author$project$Infra$ConcurrentTaskExtra$subscription(model.ak), 12097 function () { 12098 var _v0 = model.a; 12099 if (_v0.$ === 4) { 12100 var loaded = _v0.a; 12101 return loaded.bA.gA ? $elm$core$Platform$Sub$none : A2( 12102 $elm$time$Time$every, 12103 100 * 1000, 12104 function (_v1) { 12105 return $author$project$Page$Group$SyncTick; 12106 }); 12107 } else { 12108 return $elm$core$Platform$Sub$none; 12109 } 12110 }() 12111 ])); 12112}; 12113var $author$project$PwaState$GotPwaEvent = function (a) { 12114 return {$: 0, a: a}; 12115}; 12116var $author$project$Pwa$ConnectionChanged = function (a) { 12117 return {$: 0, a: a}; 12118}; 12119var $author$project$Pwa$InstallHintChanged = function (a) { 12120 return {$: 2, a: a}; 12121}; 12122var $author$project$Pwa$NotificationClicked = function (a) { 12123 return {$: 7, a: a}; 12124}; 12125var $author$project$Pwa$NotificationPermissionChanged = function (a) { 12126 return {$: 3, a: a}; 12127};
12128var $author$project$Pwa$PushSubscription = function (a) { 12129 return {$: 4, a: a}; 12130}; 12131var $author$project$Pwa$PushSubscriptionError = function (a) { 12132 return {$: 5, a: a}; 12133}; 12134var $author$project$Pwa$PushUnsubscribed = {$: 6}; 12135var $author$project$Pwa$UpdateAvailable = {$: 1}; 12136var $author$project$Pwa$Default = 2; 12137var $author$project$Pwa$Denied = 1; 12138var $author$project$Pwa$Granted = 0; 12139var $author$project$Pwa$Unsupported = 3; 12140var $author$project$Pwa$notificationPermissionDecoder = A2( 12141 $elm$json$Json$Decode$andThen, 12142 function (str) { 12143 switch (str) { 12144 case 'granted': 12145 return $elm$json$Json$Decode$succeed(0); 12146 case 'denied': 12147 return $elm$json$Json$Decode$succeed(1); 12148 case 'default': 12149 return $elm$json$Json$Decode$succeed(2); 12150 case 'unsupported': 12151 return $elm$json$Json$Decode$succeed(3); 12152 default: 12153 return $elm$json$Json$Decode$fail('Unknown notification permission: ' + str); 12154 } 12155 }, 12156 $elm$json$Json$Decode$string); 12157var $author$project$Pwa$eventDecoder = A2( 12158 $elm$json$Json$Decode$andThen, 12159 function (tag) { 12160 switch (tag) { 12161 case 'connectionChanged': 12162 return A2( 12163 $elm$json$Json$Decode$map, 12164 $author$project$Pwa$ConnectionChanged, 12165 A2($elm$json$Json$Decode$field, 'online', $elm$json$Json$Decode$bool)); 12166 case 'updateAvailable': 12167 return $elm$json$Json$Decode$succeed($author$project$Pwa$UpdateAvailable); 12168 case 'installHintChanged': 12169 return A2( 12170 $elm$json$Json$Decode$map, 12171 A2($elm$core$Basics$composeR, $author$project$Pwa$installHintFromString, $author$project$Pwa$InstallHintChanged), 12172 A2($elm$json$Json$Decode$field, 'hint', $elm$json$Json$Decode$string)); 12173 case 'notificationPermissionChanged': 12174 return A2( 12175 $elm$json$Json$Decode$map, 12176 $author$project$Pwa$NotificationPermissionChanged, 12177 A2($elm$json$Json$Decode$field, 'permission', $author$project$Pwa$notificationPermissionDecoder)); 12178 case 'pushSubscription': 12179 return A2( 12180 $elm$json$Json$Decode$map, 12181 $author$project$Pwa$PushSubscription, 12182 A2($elm$json$Json$Decode$field, 'subscription', $elm$json$Json$Decode$value)); 12183 case 'pushSubscriptionError': 12184 return A2( 12185 $elm$json$Json$Decode$map, 12186 $author$project$Pwa$PushSubscriptionError, 12187 A2($elm$json$Json$Decode$field, 'error', $elm$json$Json$Decode$string)); 12188 case 'pushUnsubscribed': 12189 return $elm$json$Json$Decode$succeed($author$project$Pwa$PushUnsubscribed); 12190 case 'notificationClicked': 12191 return A2( 12192 $elm$json$Json$Decode$map, 12193 $author$project$Pwa$NotificationClicked, 12194 A2($elm$json$Json$Decode$field, 'data', $elm$json$Json$Decode$value)); 12195 default: 12196 return $elm$json$Json$Decode$fail('Unknown PWA event tag: ' + tag); 12197 } 12198 }, 12199 A2($elm$json$Json$Decode$field, 'tag', $elm$json$Json$Decode$string)); 12200var $author$project$Pwa$decodeEvent = function (value) { 12201 return A2($elm$json$Json$Decode$decodeValue, $author$project$Pwa$eventDecoder, value); 12202}; 12203var $author$project$PwaState$subscription = F2( 12204 function (pwaIn, toMsg) { 12205 return pwaIn( 12206 A2( 12207 $elm$core$Basics$composeL, 12208 A2($elm$core$Basics$composeL, toMsg, $author$project$PwaState$GotPwaEvent), 12209 $author$project$Pwa$decodeEvent)); 12210 }); 12211var $author$project$Main$subscriptions = function (model) { 12212 return $elm$core$Platform$Sub$batch( 12213 _List_fromArray( 12214 [ 12215 A2($mpizenberg$elm_url_navigation_port$Navigation$onEvent, $author$project$Main$onNavEvent, $author$project$Main$OnNavEvent), 12216 $author$project$Infra$ConcurrentTaskExtra$subscription(model.ak), 12217 A2( 12218 $elm$core$Platform$Sub$map, 12219 $author$project$Main$GroupMsg, 12220 $author$project$Page$Group$subscription(model.u)), 12221 $author$project$Main$onClipboardCopy( 12222 function (_v0) { 12223 return $author$project$Main$ClipboardCopied; 12224 }), 12225 $author$project$Main$handoffIn($author$project$Main$OnHandoffEvent), 12226 $author$project$Main$onServerEvent( 12227 A2($elm$core$Basics$composeL, $author$project$Main$GroupMsg, $author$project$Page$Group$serverEventMsg)), 12228 A2($author$project$PwaState$subscription, $author$project$Main$pwaIn, $author$project$Main$PwaStateMsg), 12229 A2($elm$time$Time$every, $author$project$Main$clockIntervalMs, $author$project$Main$GotCurrentTime), 12230 $elm$browser$Browser$Events$onVisibilityChange($author$project$Main$VisibilityChanged) 12231 ])); 12232}; 12233var $author$project$ErrorLog$Err = 0; 12234var $author$project$UI$Toast$Error = 1; 12235var $author$project$Main$HomeMsg = function (a) { 12236 return {$: 29, a: a}; 12237}; 12238var $author$project$Main$IdentityFailed = function (a) { 12239 return {$: 2, a: a}; 12240}; 12241var $author$project$ErrorLog$IdentitySource = 6; 12242var $author$project$Main$ImportExportMsg = function (a) { 12243 return {$: 30, a: a}; 12244}; 12245var $author$project$Main$InitError = function (a) { 12246 return {$: 2, a: a}; 12247}; 12248var $author$project$Main$NewGroupMsg = function (a) { 12249 return {$: 13, a: a}; 12250}; 12251var $author$project$Main$NoOp = {$: 0}; 12252var $author$project$Main$OnAboutStatsReset = function (a) { 12253 return {$: 33, a: a}; 12254}; 12255var $author$project$Main$OnIdentitySaved = F2( 12256 function (a, b) { 12257 return {$: 12, a: a, b: b}; 12258 }); 12259var $author$project$Main$OnImportSplitwiseRate = F2( 12260 function (a, b) { 12261 return {$: 15, a: a, b: b}; 12262 }); 12263var $author$project$Main$OnJoinGroupSaved = function (a) { 12264 return {$: 27, a: a}; 12265}; 12266var $author$project$Main$OnStorageCheckComplete = function (a) { 12267 return {$: 32, a: a}; 12268}; 12269var $author$project$Main$Ready = function (a) { 12270 return {$: 1, a: a}; 12271}; 12272var $author$project$ErrorLog$ServerSource = 2; 12273var $author$project$ErrorLog$StorageSource = 1; 12274var $author$project$UI$Toast$Success = 0; 12275var $author$project$ErrorLog$SyncSource = 0; 12276var $author$project$Domain$GroupState$lookupEntryCurrentVersion = F2( 12277 function (state, rootId) { 12278 return A2( 12279 $elm$core$Maybe$map, 12280 function ($) { 12281 return $.bi; 12282 }, 12283 A2($elm$core$Dict$get, rootId, state.E)); 12284 }); 12285var $author$project$Domain$GroupState$lookupEntryDescription = F2( 12286 function (state, rootId) { 12287 var _v0 = A2($elm$core$Dict$get, rootId, state.E); 12288 if (!_v0.$) { 12289 var entryState = _v0.a; 12290 var _v1 = entryState.bi.gE; 12291 switch (_v1.$) { 12292 case 0: 12293 var data = _v1.a; 12294 return data.eE; 12295 case 1: 12296 return 'Transfer'; 12297 default: 12298 var data = _v1.a; 12299 return data.eE; 12300 } 12301 } else { 12302 return rootId; 12303 } 12304 }); 12305var $author$project$Domain$GroupState$lookupPreviousVersion = F2( 12306 function (state, entry) { 12307 return A2( 12308 $elm$core$Maybe$andThen, 12309 function (prevId) { 12310 return A2( 12311 $elm$core$Maybe$andThen, 12312 function (entryState) { 12313 return A2($elm$core$Dict$get, prevId, entryState.bE); 12314 }, 12315 A2($elm$core$Dict$get, entry.gM.aj, state.E)); 12316 }, 12317 entry.gM.fg); 12318 }); 12319var $author$project$Domain$GroupState$lookupSettlementPreference = F2( 12320 function (state, memberRootId) { 12321 return A2( 12322 $elm$core$Maybe$withDefault, 12323 _List_Nil, 12324 A2( 12325 $elm$core$Maybe$map, 12326 function ($) { 12327 return $.pB; 12328 }, 12329 $elm$core$List$head( 12330 A2( 12331 $elm$core$List$filter, 12332 function (p) { 12333 return _Utils_eq(p.e$, memberRootId); 12334 }, 12335 state.qb)))); 12336 }); 12337var $author$project$Domain$GroupState$resolveMemberRootId = F2( 12338 function (state, memberId) { 12339 var _v0 = A2($elm$core$Dict$get, memberId, state.aP); 12340 if (!_v0.$) { 12341 var link = _v0.a; 12342 return $elm$core$Maybe$Just(link.aj); 12343 } else { 12344 return A2($elm$core$Dict$member, memberId, state.r) ? $elm$core$Maybe$Just(memberId) : $elm$core$Maybe$Nothing; 12345 } 12346 }); 12347var $author$project$Domain$GroupState$resolveMemberName = F2( 12348 function (state, memberId) { 12349 return A2( 12350 $elm$core$Maybe$withDefault, 12351 memberId, 12352 A2( 12353 $elm$core$Maybe$map, 12354 function ($) { 12355 return $.bW; 12356 }, 12357 A2( 12358 $elm$core$Maybe$andThen, 12359 function (rootId) { 12360 return A2($elm$core$Dict$get, rootId, state.r); 12361 }, 12362 A2($author$project$Domain$GroupState$resolveMemberRootId, state, memberId)))); 12363 }); 12364var $author$project$Domain$GroupState$activityContext = function (state) { 12365 return { 12366 eG: $author$project$Domain$GroupState$lookupEntryCurrentVersion(state), 12367 iv: $author$project$Domain$GroupState$lookupEntryDescription(state), 12368 iO: {eE: state.iO.eE, cz: state.iO.cz, bW: state.iO.bW, cY: state.iO.cY}, 12369 jh: function (rootId) { 12370 return A2( 12371 $elm$core$Maybe$withDefault, 12372 $author$project$Domain$Member$emptyMetadata, 12373 A2( 12374 $elm$core$Maybe$map, 12375 function ($) { 12376 return $.ji; 12377 }, 12378 A2($elm$core$Dict$get, rootId, state.r))); 12379 }, 12380 jJ: $author$project$Domain$GroupState$lookupPreviousVersion(state), 12381 bz: $author$project$Domain$GroupState$resolveMemberName(state), 12382 kh: $author$project$Domain$GroupState$lookupSettlementPreference(state) 12383 }; 12384}; 12385var $author$project$Domain$GroupState$applyEntryDeleted = F2( 12386 function (data, state) { 12387 var _v0 = A2($elm$core$Dict$get, data.aj, state.E); 12388 if (_v0.$ === 1) { 12389 return state; 12390 } else { 12391 var entryState = _v0.a; 12392 var updated = _Utils_update( 12393 entryState, 12394 {gB: true}); 12395 return _Utils_update( 12396 state, 12397 { 12398 E: A3($elm$core$Dict$insert, data.aj, updated, state.E) 12399 }); 12400 } 12401 }); 12402var $author$project$Domain$GroupState$applyEntryUndeleted = F2( 12403 function (data, state) { 12404 var _v0 = A2($elm$core$Dict$get, data.aj, state.E); 12405 if (_v0.$ === 1) { 12406 return state; 12407 } else { 12408 var entryState = _v0.a; 12409 var updated = _Utils_update( 12410 entryState,
12411 {gB: false}); 12412 return _Utils_update( 12413 state, 12414 { 12415 E: A3($elm$core$Dict$insert, data.aj, updated, state.E) 12416 }); 12417 } 12418 }); 12419var $author$project$Domain$GroupState$CreatedAtMismatch = 10; 12420var $author$project$Domain$GroupState$CreatedByMismatch = 9; 12421var $author$project$Domain$GroupState$DuplicateEntryId = 1; 12422var $author$project$Domain$GroupState$DuplicateVersionId = 5; 12423var $author$project$Domain$GroupState$InvalidDepth = 7; 12424var $author$project$Domain$GroupState$IsDeletedMismatch = 8; 12425var $author$project$Domain$GroupState$ModificationMissingPreviousVersion = 3; 12426var $author$project$Domain$GroupState$NewEntryHasPreviousVersion = 0; 12427var $author$project$Domain$GroupState$PreviousVersionNotFound = 6; 12428var $author$project$Domain$GroupState$RootEntryNotFound = 2; 12429var $author$project$Domain$GroupState$SelfReferencingPreviousVersion = 4; 12430var $author$project$Domain$GroupState$pickVersion = F2( 12431 function (a, b) { 12432 var _v0 = A2($elm$core$Basics$compare, a.gM.dg, b.gM.dg); 12433 switch (_v0) { 12434 case 2: 12435 return a; 12436 case 0: 12437 return b; 12438 default: 12439 return (_Utils_cmp(a.gM.m9, b.gM.m9) > -1) ? a : b; 12440 } 12441 }); 12442var $author$project$Domain$GroupState$applyEntryUpsert = F2( 12443 function (entry, state) { 12444 var meta = entry.gM; 12445 var reject = function (reason) { 12446 return _Utils_update( 12447 state, 12448 { 12449 fl: A2( 12450 $elm$core$List$cons, 12451 _Utils_Tuple2(entry, reason), 12452 state.fl) 12453 }); 12454 }; 12455 if (_Utils_eq(meta.aj, meta.m9)) { 12456 if (!_Utils_eq(meta.fg, $elm$core$Maybe$Nothing)) { 12457 return reject(0); 12458 } else { 12459 if (A2($elm$core$Dict$member, meta.m9, state.E)) { 12460 return reject(1); 12461 } else { 12462 var entryState = { 12463 bE: A2($elm$core$Dict$singleton, meta.m9, entry), 12464 bi: entry, 12465 gB: meta.gB, 12466 aj: meta.m9 12467 }; 12468 return _Utils_update( 12469 state, 12470 { 12471 E: A3($elm$core$Dict$insert, meta.m9, entryState, state.E) 12472 }); 12473 } 12474 } 12475 } else { 12476 var _v0 = A2($elm$core$Dict$get, meta.aj, state.E); 12477 if (_v0.$ === 1) { 12478 return reject(2); 12479 } else { 12480 var entryState = _v0.a; 12481 var _v1 = meta.fg; 12482 if (_v1.$ === 1) { 12483 return reject(3); 12484 } else { 12485 var prevId = _v1.a; 12486 if (_Utils_eq(prevId, meta.m9)) { 12487 return reject(4); 12488 } else { 12489 if (A2($elm$core$Dict$member, meta.m9, entryState.bE)) { 12490 return reject(5); 12491 } else { 12492 var _v2 = A2($elm$core$Dict$get, prevId, entryState.bE); 12493 if (_v2.$ === 1) { 12494 return reject(6); 12495 } else { 12496 var prev = _v2.a; 12497 if (!_Utils_eq(meta.dg, prev.gM.dg + 1)) { 12498 return reject(7); 12499 } else { 12500 if (!_Utils_eq(meta.gB, prev.gM.gB)) { 12501 return reject(8); 12502 } else { 12503 if (!_Utils_eq(meta.f3, prev.gM.f3)) { 12504 return reject(9); 12505 } else { 12506 if (!_Utils_eq(meta.f2, prev.gM.f2)) { 12507 return reject(10); 12508 } else { 12509 var updatedVersions = A3($elm$core$Dict$insert, meta.m9, entry, entryState.bE); 12510 var current = A2($author$project$Domain$GroupState$pickVersion, entryState.bi, entry); 12511 var updatedEntryState = _Utils_update( 12512 entryState, 12513 {bE: updatedVersions, bi: current, gB: current.gM.gB}); 12514 return _Utils_update( 12515 state, 12516 { 12517 E: A3($elm$core$Dict$insert, meta.aj, updatedEntryState, state.E) 12518 }); 12519 } 12520 } 12521 } 12522 } 12523 } 12524 } 12525 } 12526 } 12527 } 12528 } 12529 }); 12530var $author$project$Domain$GroupState$applyGroupCreated = F4( 12531 function (timestamp, author, data, state) { 12532 return (!_Utils_eq( 12533 state.iO.f2, 12534 $elm$time$Time$millisToPosix(0))) ? state : _Utils_update( 12535 state, 12536 { 12537 f3: $elm$core$Maybe$Just(author), 12538 iO: {f2: timestamp, il: data.il, eE: $elm$core$Maybe$Nothing, cz: _List_Nil, bW: data.bW, cY: $elm$core$Maybe$Nothing} 12539 }); 12540 }); 12541var $author$project$Domain$GroupState$applyGroupMetadataUpdated = F2( 12542 function (change, state) { 12543 var meta = state.iO; 12544 var updated = _Utils_update( 12545 meta, 12546 { 12547 eE: A2($elm$core$Maybe$withDefault, meta.eE, change.eE), 12548 cz: A2($elm$core$Maybe$withDefault, meta.cz, change.cz), 12549 bW: A2($elm$core$Maybe$withDefault, meta.bW, change.bW), 12550 cY: A2($elm$core$Maybe$withDefault, meta.cY, change.cY) 12551 }); 12552 return _Utils_update( 12553 state, 12554 {iO: updated}); 12555 }); 12556var $author$project$Domain$GroupState$introducedKey = F2( 12557 function (holderId, envelope) { 12558 return _Utils_eq(holderId, envelope.q0) ? A2($elm$core$Maybe$withDefault, '', envelope.ej) : ''; 12559 }); 12560var $author$project$Domain$Member$pickLink = F2( 12561 function (a, b) { 12562 return (_Utils_cmp( 12563 _Utils_Tuple3( 12564 a.kg, 12565 $elm$time$Time$posixToMillis(a.kD), 12566 a.iA), 12567 _Utils_Tuple3( 12568 b.kg, 12569 $elm$time$Time$posixToMillis(b.kD), 12570 b.iA)) > -1) ? a : b; 12571 }); 12572var $author$project$Domain$GroupState$applyMemberCreated = F3( 12573 function (envelope, data, state) { 12574 if (A2($elm$core$Dict$member, data.e_, state.r)) { 12575 return state; 12576 } else { 12577 var member = { 12578 nt: false, 12579 nx: envelope.lT, 12580 nL: data.nL, 12581 ji: $author$project$Domain$Member$emptyMetadata, 12582 bW: data.bW, 12583 jO: A2($author$project$Domain$GroupState$introducedKey, data.e_, envelope), 12584 aj: data.e_ 12585 }; 12586 var deviceLinks = function () { 12587 if (_Utils_eq(data.e_, envelope.q0)) { 12588 var selfLink = {iA: envelope.m9, jO: member.jO, aj: data.e_, kg: -1, kD: envelope.lT}; 12589 return A3( 12590 $elm$core$Dict$update, 12591 data.e_, 12592 A2( 12593 $elm$core$Basics$composeR, 12594 $elm$core$Maybe$map( 12595 $author$project$Domain$Member$pickLink(selfLink)), 12596 A2( 12597 $elm$core$Basics$composeR, 12598 $elm$core$Maybe$withDefault(selfLink), 12599 $elm$core$Maybe$Just)), 12600 state.aP); 12601 } else { 12602 return state.aP; 12603 } 12604 }(); 12605 return _Utils_update( 12606 state, 12607 { 12608 aP: deviceLinks, 12609 r: A3($elm$core$Dict$insert, data.e_, member, state.r) 12610 }); 12611 } 12612 }); 12613var $author$project$Domain$Member$Real = 0; 12614var $author$project$Domain$Member$Virtual = 1; 12615var $author$project$Domain$GroupState$refreshEffectiveType = F3( 12616 function (links, rootId, members) { 12617 var isClaimed = A3( 12618 $elm$core$Dict$foldl, 12619 F3( 12620 function (_v0, link, found) { 12621 return found || _Utils_eq(link.aj, rootId); 12622 }), 12623 false, 12624 links); 12625 var effectiveType = function (member) { 12626 return ((member.jO !== '') || isClaimed) ? 0 : 1; 12627 }; 12628 return A3( 12629 $elm$core$Dict$update, 12630 rootId, 12631 $elm$core$Maybe$map( 12632 function (member) { 12633 return _Utils_update( 12634 member, 12635 { 12636 nL: effectiveType(member) 12637 }); 12638 }), 12639 members); 12640 });
12641var $author$project$Domain$GroupState$applyMemberLinked = F5( 12642 function (timestamp, eventId, publicKey, data, state) { 12643 if (!A2($elm$core$Dict$member, data.aj, state.r)) { 12644 return state; 12645 } else { 12646 var previousLink = A2($elm$core$Dict$get, data.gd, state.aP); 12647 var newLink = {iA: eventId, jO: publicKey, aj: data.aj, kg: data.kg, kD: timestamp}; 12648 var winner = A2( 12649 $elm$core$Maybe$withDefault, 12650 newLink, 12651 A2( 12652 $elm$core$Maybe$map, 12653 function (existing) { 12654 return A2($author$project$Domain$Member$pickLink, existing, newLink); 12655 }, 12656 previousLink)); 12657 var updatedLinks = A3($elm$core$Dict$insert, data.gd, winner, state.aP); 12658 var affectedRoots = A2( 12659 $elm$core$List$cons, 12660 winner.aj, 12661 A2( 12662 $elm$core$List$filterMap, 12663 $elm$core$Maybe$map( 12664 function ($) { 12665 return $.aj; 12666 }), 12667 _List_fromArray( 12668 [previousLink]))); 12669 return _Utils_update( 12670 state, 12671 { 12672 aP: updatedLinks, 12673 r: A3( 12674 $elm$core$List$foldl, 12675 $author$project$Domain$GroupState$refreshEffectiveType(updatedLinks), 12676 state.r, 12677 affectedRoots) 12678 }); 12679 } 12680 }); 12681var $author$project$Domain$GroupState$applyMemberMetadataUpdated = F2( 12682 function (data, state) { 12683 var _v0 = A2($elm$core$Dict$get, data.aj, state.r); 12684 if (_v0.$ === 1) { 12685 return state; 12686 } else { 12687 var member = _v0.a; 12688 var updated = _Utils_update( 12689 member, 12690 {ji: data.ji}); 12691 return _Utils_update( 12692 state, 12693 { 12694 r: A3($elm$core$Dict$insert, data.aj, updated, state.r) 12695 }); 12696 } 12697 }); 12698var $author$project$Domain$GroupState$applyMemberRenamed = F2( 12699 function (data, state) { 12700 var _v0 = A2($elm$core$Dict$get, data.aj, state.r); 12701 if (_v0.$ === 1) { 12702 return state; 12703 } else { 12704 var member = _v0.a; 12705 var updated = _Utils_update( 12706 member, 12707 {bW: data.e4}); 12708 return _Utils_update( 12709 state, 12710 { 12711 r: A3($elm$core$Dict$insert, data.aj, updated, state.r) 12712 }); 12713 } 12714 }); 12715var $author$project$Domain$GroupState$applyMemberRetired = F2( 12716 function (data, state) { 12717 var _v0 = A2($elm$core$Dict$get, data.aj, state.r); 12718 if (_v0.$ === 1) { 12719 return state; 12720 } else { 12721 var member = _v0.a; 12722 if (!member.nt) { 12723 var updated = _Utils_update( 12724 member, 12725 {nt: true}); 12726 return _Utils_update( 12727 state, 12728 { 12729 r: A3($elm$core$Dict$insert, data.aj, updated, state.r) 12730 }); 12731 } else { 12732 return state; 12733 } 12734 } 12735 }); 12736var $author$project$Domain$GroupState$applyMemberUnretired = F2( 12737 function (data, state) { 12738 var _v0 = A2($elm$core$Dict$get, data.aj, state.r); 12739 if (_v0.$ === 1) { 12740 return state; 12741 } else { 12742 var member = _v0.a; 12743 if (member.nt) { 12744 var updated = _Utils_update( 12745 member, 12746 {nt: false}); 12747 return _Utils_update( 12748 state, 12749 { 12750 r: A3($elm$core$Dict$insert, data.aj, updated, state.r) 12751 }); 12752 } else { 12753 return state; 12754 } 12755 } 12756 }); 12757var $author$project$Domain$GroupState$applySettlementPreferencesUpdated = F2( 12758 function (data, state) { 12759 var updatedPreferences = function () { 12760 if ($elm$core$List$isEmpty(data.pB)) { 12761 return A2( 12762 $elm$core$List$filter, 12763 function (p) { 12764 return !_Utils_eq(p.e$, data.e$); 12765 }, 12766 state.qb); 12767 } else { 12768 var newPref = {e$: data.e$, pB: data.pB}; 12769 return A2( 12770 $elm$core$List$cons, 12771 newPref, 12772 A2( 12773 $elm$core$List$filter, 12774 function (p) { 12775 return !_Utils_eq(p.e$, data.e$); 12776 }, 12777 state.qb)); 12778 } 12779 }(); 12780 return _Utils_update( 12781 state, 12782 {qb: updatedPreferences}); 12783 }); 12784var $author$project$Domain$GroupState$applyPayload = F2( 12785 function (envelope, state) { 12786 var timestamp = envelope.lT; 12787 var _v0 = envelope.jC; 12788 switch (_v0.$) { 12789 case 0: 12790 return state; 12791 case 1: 12792 var data = _v0.a; 12793 return A3($author$project$Domain$GroupState$applyMemberCreated, envelope, data, state); 12794 case 2: 12795 var data = _v0.a; 12796 return A2($author$project$Domain$GroupState$applyMemberRenamed, data, state); 12797 case 3: 12798 var data = _v0.a; 12799 return A2($author$project$Domain$GroupState$applyMemberRetired, data, state); 12800 case 4: 12801 var data = _v0.a; 12802 return A2($author$project$Domain$GroupState$applyMemberUnretired, data, state); 12803 case 5: 12804 var data = _v0.a; 12805 return A5( 12806 $author$project$Domain$GroupState$applyMemberLinked, 12807 timestamp, 12808 envelope.m9, 12809 A2($author$project$Domain$GroupState$introducedKey, data.gd, envelope), 12810 data, 12811 state); 12812 case 6: 12813 var data = _v0.a; 12814 return A2($author$project$Domain$GroupState$applyMemberMetadataUpdated, data, state); 12815 case 7: 12816 var entry = _v0.a; 12817 return A2($author$project$Domain$GroupState$applyEntryUpsert, entry, state); 12818 case 8: 12819 var entry = _v0.a; 12820 return A2($author$project$Domain$GroupState$applyEntryUpsert, entry, state); 12821 case 9: 12822 var data = _v0.a; 12823 return A2($author$project$Domain$GroupState$applyEntryDeleted, data, state); 12824 case 10: 12825 var data = _v0.a; 12826 return A2($author$project$Domain$GroupState$applyEntryUndeleted, data, state); 12827 case 11: 12828 var data = _v0.a; 12829 return A4($author$project$Domain$GroupState$applyGroupCreated, timestamp, envelope.q0, data, state); 12830 case 12: 12831 var change = _v0.a; 12832 return A2($author$project$Domain$GroupState$applyGroupMetadataUpdated, change, state); 12833 case 13: 12834 var data = _v0.a; 12835 return A2($author$project$Domain$GroupState$applySettlementPreferencesUpdated, data, state); 12836 case 14: 12837 return state; 12838 default: 12839 return state; 12840 } 12841 }); 12842var $author$project$Domain$Entry$beneficiaryMemberId = function (beneficiary) { 12843 if (!beneficiary.$) { 12844 var data = beneficiary.a; 12845 return data.e_; 12846 } else { 12847 var data = beneficiary.a; 12848 return data.e_; 12849 } 12850}; 12851var $author$project$Domain$Entry$involvedMembers = function (entry) { 12852 var _v0 = entry.gE; 12853 switch (_v0.$) { 12854 case 0: 12855 var data = _v0.a; 12856 return _Utils_ap( 12857 A2( 12858 $elm$core$List$map, 12859 function ($) { 12860 return $.e_; 12861 }, 12862 data.jB), 12863 A2($elm$core$List$map, $author$project$Domain$Entry$beneficiaryMemberId, data.em)); 12864 case 1: 12865 var data = _v0.a; 12866 return _List_fromArray( 12867 [data.iH, data.kE]); 12868 default: 12869 var data = _v0.a; 12870 return A2( 12871 $elm$core$List$cons, 12872 data.j$, 12873 A2($elm$core$List$map, $author$project$Domain$Entry$beneficiaryMemberId, data.em)); 12874 } 12875}; 12876var $author$project$Domain$Event$involvedMembers = F2( 12877 function (entryCurrentVersion, payload) { 12878 switch (payload.$) { 12879 case 0: 12880 return _List_Nil; 12881 case 7: 12882 var entry = payload.a; 12883 return $author$project$Domain$Entry$involvedMembers(entry); 12884 case 8: 12885 var entry = payload.a; 12886 return $author$project$Domain$Entry$involvedMembers(entry); 12887 case 9: 12888 var rootId = payload.a.aj; 12889 return A2( 12890 $elm$core$Maybe$withDefault, 12891 _List_Nil, 12892 A2( 12893 $elm$core$Maybe$map, 12894 $author$project$Domain$Entry$involvedMembers, 12895 entryCurrentVersion(rootId))); 12896 case 10: 12897 var rootId = payload.a.aj; 12898 return A2( 12899 $elm$core$Maybe$withDefault, 12900 _List_Nil, 12901 A2( 12902 $elm$core$Maybe$map, 12903 $author$project$Domain$Entry$involvedMembers, 12904 entryCurrentVersion(rootId))); 12905 case 1: 12906 var data = payload.a; 12907 return _List_fromArray( 12908 [data.e_]); 12909 case 5: 12910 var data = payload.a; 12911 return _List_fromArray( 12912 [data.aj]); 12913 case 2: 12914 var data = payload.a; 12915 return _List_fromArray( 12916 [data.aj]); 12917 case 3: 12918 var data = payload.a; 12919 return _List_fromArray( 12920 [data.aj]); 12921 case 4: 12922 var data = payload.a; 12923 return _List_fromArray( 12924 [data.aj]); 12925 case 6: 12926 var data = payload.a; 12927 return _List_fromArray( 12928 [data.aj]); 12929 case 13: 12930 var data = payload.a; 12931 return _List_fromArray( 12932 [data.e$]); 12933 case 11: 12934 return _List_Nil; 12935 case 12: 12936 return _List_Nil; 12937 case 14: 12938 return _List_Nil; 12939 default: 12940 return _List_Nil; 12941 } 12942 }); 12943var $author$project$Domain$Activity$EntryDeletedDetail = function (a) { 12944 return {$: 5, a: a}; 12945}; 12946var $author$project$Domain$Activity$EntryUndeletedDetail = function (a) { 12947 return {$: 6, a: a}; 12948}; 12949var $author$project$Domain$Activity$GroupCreatedDetail = function (a) { 12950 return {$: 13, a: a}; 12951}; 12952var $author$project$Domain$Activity$GroupMetadataUpdatedDetail = function (a) { 12953 return {$: 14, a: a}; 12954}; 12955var $author$project$Domain$Activity$MemberCreatedDetail = function (a) { 12956 return {$: 7, a: a}; 12957}; 12958var $author$project$Domain$Activity$MemberLinkedDetail = function (a) { 12959 return {$: 8, a: a}; 12960}; 12961var $author$project$Domain$Activity$MemberMetadataUpdatedDetail = function (a) { 12962 return {$: 12, a: a}; 12963}; 12964var $author$project$Domain$Activity$MemberRenamedDetail = function (a) { 12965 return {$: 9, a: a}; 12966}; 12967var $author$project$Domain$Activity$MemberRetiredDetail = function (a) { 12968 return {$: 10, a: a}; 12969}; 12970var $author$project$Domain$Activity$MemberUnretiredDetail = function (a) { 12971 return {$: 11, a: a}; 12972}; 12973var $author$project$Domain$Activity$SettlementPreferencesUpdatedDetail = function (a) { 12974 return {$: 15, a: a}; 12975}; 12976var $author$project$Domain$Activity$UnknownDetail = {$: 0}; 12977var $author$project$Domain$Activity$applyGroupMetadataChange = F2( 12978 function (old, change) { 12979 return { 12980 eE: A2($elm$core$Maybe$withDefault, old.eE, change.eE), 12981 cz: A2($elm$core$Maybe$withDefault, old.cz, change.cz),
12982 bW: A2($elm$core$Maybe$withDefault, old.bW, change.bW), 12983 cY: A2($elm$core$Maybe$withDefault, old.cY, change.cY) 12984 }; 12985 }); 12986var $author$project$Domain$Activity$EntryAddedDetail = function (a) { 12987 return {$: 1, a: a}; 12988}; 12989var $author$project$Domain$Activity$TransferAddedDetail = function (a) { 12990 return {$: 3, a: a}; 12991}; 12992var $author$project$Domain$Activity$entryAddedDetail = function (entry) { 12993 var _v0 = entry.gE; 12994 switch (_v0.$) { 12995 case 0: 12996 return $author$project$Domain$Activity$EntryAddedDetail( 12997 {aR: entry}); 12998 case 1: 12999 return $author$project$Domain$Activity$TransferAddedDetail( 13000 {aR: entry}); 13001 default: 13002 return $author$project$Domain$Activity$EntryAddedDetail( 13003 {aR: entry}); 13004 } 13005}; 13006var $author$project$Domain$Activity$EntryModifiedDetail = function (a) { 13007 return {$: 2, a: a}; 13008}; 13009var $author$project$Domain$Activity$TransferModifiedDetail = function (a) { 13010 return {$: 4, a: a}; 13011}; 13012var $author$project$Domain$Activity$AmountField = 1; 13013var $author$project$Domain$Activity$AttachmentsField = 8; 13014var $author$project$Domain$Activity$BeneficiariesField = 4; 13015var $author$project$Domain$Activity$CategoryField = 5; 13016var $author$project$Domain$Activity$DateField = 2; 13017var $author$project$Domain$Activity$DescriptionField = 0; 13018var $author$project$Domain$Activity$LocationField = 6; 13019var $author$project$Domain$Activity$NotesField = 7; 13020var $author$project$Domain$Activity$PayersField = 3; 13021var $author$project$Domain$Activity$expenseChanges = F2( 13022 function (maybePrev, newData) { 13023 if (maybePrev.$ === 1) { 13024 return _List_Nil; 13025 } else { 13026 var prev = maybePrev.a; 13027 var _v1 = prev.gE; 13028 switch (_v1.$) { 13029 case 0: 13030 var oldData = _v1.a; 13031 return A2( 13032 $elm$core$List$filterMap, 13033 $elm$core$Basics$identity, 13034 _List_fromArray( 13035 [ 13036 (!_Utils_eq(oldData.eE, newData.eE)) ? $elm$core$Maybe$Just(0) : $elm$core$Maybe$Nothing, 13037 ((!_Utils_eq(oldData.ef, newData.ef)) || ((!_Utils_eq(oldData.bg, newData.bg)) || (!_Utils_eq(oldData.ck, newData.ck)))) ? $elm$core$Maybe$Just(1) : $elm$core$Maybe$Nothing, 13038 (!_Utils_eq(oldData.cj, newData.cj)) ? $elm$core$Maybe$Just(2) : $elm$core$Maybe$Nothing, 13039 (!_Utils_eq(oldData.jB, newData.jB)) ? $elm$core$Maybe$Just(3) : $elm$core$Maybe$Nothing, 13040 (!_Utils_eq(oldData.em, newData.em)) ? $elm$core$Maybe$Just(4) : $elm$core$Maybe$Nothing, 13041 (!_Utils_eq(oldData.h9, newData.h9)) ? $elm$core$Maybe$Just(5) : $elm$core$Maybe$Nothing, 13042 (!_Utils_eq(oldData.je, newData.je)) ? $elm$core$Maybe$Just(6) : $elm$core$Maybe$Nothing, 13043 (!_Utils_eq(oldData.bu, newData.bu)) ? $elm$core$Maybe$Just(7) : $elm$core$Maybe$Nothing, 13044 (!_Utils_eq(oldData.ce, newData.ce)) ? $elm$core$Maybe$Just(8) : $elm$core$Maybe$Nothing 13045 ])); 13046 case 1: 13047 return _List_Nil; 13048 default: 13049 return _List_Nil; 13050 } 13051 } 13052 }); 13053var $author$project$Domain$Activity$ReceivedByField = 11; 13054var $author$project$Domain$Activity$incomeChanges = F2( 13055 function (maybePrev, newData) { 13056 if (maybePrev.$ === 1) { 13057 return _List_Nil; 13058 } else { 13059 var prev = maybePrev.a; 13060 var _v1 = prev.gE; 13061 if (_v1.$ === 2) { 13062 var oldData = _v1.a; 13063 return A2( 13064 $elm$core$List$filterMap, 13065 $elm$core$Basics$identity, 13066 _List_fromArray( 13067 [ 13068 (!_Utils_eq(oldData.eE, newData.eE)) ? $elm$core$Maybe$Just(0) : $elm$core$Maybe$Nothing, 13069 ((!_Utils_eq(oldData.ef, newData.ef)) || ((!_Utils_eq(oldData.bg, newData.bg)) || (!_Utils_eq(oldData.ck, newData.ck)))) ? $elm$core$Maybe$Just(1) : $elm$core$Maybe$Nothing, 13070 (!_Utils_eq(oldData.cj, newData.cj)) ? $elm$core$Maybe$Just(2) : $elm$core$Maybe$Nothing, 13071 (!_Utils_eq(oldData.j$, newData.j$)) ? $elm$core$Maybe$Just(11) : $elm$core$Maybe$Nothing, 13072 (!_Utils_eq(oldData.em, newData.em)) ? $elm$core$Maybe$Just(4) : $elm$core$Maybe$Nothing, 13073 (!_Utils_eq(oldData.bu, newData.bu)) ? $elm$core$Maybe$Just(7) : $elm$core$Maybe$Nothing, 13074 (!_Utils_eq(oldData.ce, newData.ce)) ? $elm$core$Maybe$Just(8) : $elm$core$Maybe$Nothing 13075 ])); 13076 } else { 13077 return _List_Nil; 13078 } 13079 } 13080 }); 13081var $author$project$Domain$Activity$FromField = 9; 13082var $author$project$Domain$Activity$ToField = 10; 13083var $author$project$Domain$Activity$transferChanges = F2(
13084 function (maybePrev, newData) { 13085 if (maybePrev.$ === 1) { 13086 return _List_Nil; 13087 } else { 13088 var prev = maybePrev.a; 13089 var _v1 = prev.gE; 13090 switch (_v1.$) { 13091 case 1: 13092 var oldData = _v1.a; 13093 return A2( 13094 $elm$core$List$filterMap, 13095 $elm$core$Basics$identity, 13096 _List_fromArray( 13097 [ 13098 (!_Utils_eq(oldData.eE, newData.eE)) ? $elm$core$Maybe$Just(0) : $elm$core$Maybe$Nothing, 13099 ((!_Utils_eq(oldData.ef, newData.ef)) || ((!_Utils_eq(oldData.bg, newData.bg)) || (!_Utils_eq(oldData.ck, newData.ck)))) ? $elm$core$Maybe$Just(1) : $elm$core$Maybe$Nothing, 13100 (!_Utils_eq(oldData.cj, newData.cj)) ? $elm$core$Maybe$Just(2) : $elm$core$Maybe$Nothing, 13101 (!_Utils_eq(oldData.iH, newData.iH)) ? $elm$core$Maybe$Just(9) : $elm$core$Maybe$Nothing, 13102 (!_Utils_eq(oldData.kE, newData.kE)) ? $elm$core$Maybe$Just(10) : $elm$core$Maybe$Nothing, 13103 (!_Utils_eq(oldData.bu, newData.bu)) ? $elm$core$Maybe$Just(7) : $elm$core$Maybe$Nothing, 13104 (!_Utils_eq(oldData.ce, newData.ce)) ? $elm$core$Maybe$Just(8) : $elm$core$Maybe$Nothing 13105 ])); 13106 case 0: 13107 return _List_Nil; 13108 default: 13109 return _List_Nil; 13110 } 13111 } 13112 }); 13113var $author$project$Domain$Activity$entryModifiedDetail = F2( 13114 function (ctx, entry) { 13115 var previousEntry = ctx.jJ(entry); 13116 var _v0 = entry.gE; 13117 switch (_v0.$) { 13118 case 0: 13119 var data = _v0.a; 13120 return $author$project$Domain$Activity$EntryModifiedDetail( 13121 { 13122 f_: A2($author$project$Domain$Activity$expenseChanges, previousEntry, data), 13123 aR: entry, 13124 g4: previousEntry 13125 }); 13126 case 1: 13127 var data = _v0.a; 13128 return $author$project$Domain$Activity$TransferModifiedDetail( 13129 { 13130 f_: A2($author$project$Domain$Activity$transferChanges, previousEntry, data), 13131 aR: entry, 13132 g4: previousEntry 13133 }); 13134 default: 13135 var data = _v0.a; 13136 return $author$project$Domain$Activity$EntryModifiedDetail( 13137 { 13138 f_: A2($author$project$Domain$Activity$incomeChanges, previousEntry, data), 13139 aR: entry, 13140 g4: previousEntry 13141 }); 13142 } 13143 }); 13144var $author$project$Domain$Activity$LinksField = 17; 13145var $author$project$Domain$Activity$NameField = 15; 13146var $author$project$Domain$Activity$SubtitleField = 16; 13147var $author$project$Domain$Activity$groupMetadataChangedFields = F2( 13148 function (oldMeta, change) { 13149 return A2( 13150 $elm$core$List$filterMap, 13151 $elm$core$Basics$identity, 13152 _List_fromArray( 13153 [ 13154 function () { 13155 var _v0 = change.bW; 13156 if (!_v0.$) { 13157 var newName = _v0.a; 13158 return (!_Utils_eq(newName, oldMeta.bW)) ? $elm$core$Maybe$Just(15) : $elm$core$Maybe$Nothing; 13159 } else { 13160 return $elm$core$Maybe$Nothing; 13161 } 13162 }(), 13163 function () { 13164 var _v1 = change.cY; 13165 if (!_v1.$) { 13166 var newSubtitle = _v1.a; 13167 return (!_Utils_eq(newSubtitle, oldMeta.cY)) ? $elm$core$Maybe$Just(16) : $elm$core$Maybe$Nothing; 13168 } else { 13169 return $elm$core$Maybe$Nothing; 13170 } 13171 }(), 13172 function () { 13173 var _v2 = change.eE; 13174 if (!_v2.$) { 13175 var newDesc = _v2.a; 13176 return (!_Utils_eq(newDesc, oldMeta.eE)) ? $elm$core$Maybe$Just(0) : $elm$core$Maybe$Nothing; 13177 } else { 13178 return $elm$core$Maybe$Nothing; 13179 } 13180 }(), 13181 function () { 13182 var _v3 = change.cz; 13183 if (!_v3.$) { 13184 var newLinks = _v3.a; 13185 return (!_Utils_eq(newLinks, oldMeta.cz)) ? $elm$core$Maybe$Just(17) : $elm$core$Maybe$Nothing; 13186 } else { 13187 return $elm$core$Maybe$Nothing; 13188 } 13189 }() 13190 ])); 13191 }); 13192var $author$project$Domain$Activity$EmailField = 13; 13193var $author$project$Domain$Activity$PaymentField = 14; 13194var $author$project$Domain$Activity$PhoneField = 12; 13195var $author$project$Domain$Activity$memberMetadataChanges = F2( 13196 function (oldMeta, newMeta) { 13197 return A2( 13198 $elm$core$List$filterMap, 13199 $elm$core$Basics$identity, 13200 _List_fromArray( 13201 [ 13202 (!_Utils_eq(oldMeta.jF, newMeta.jF)) ? $elm$core$Maybe$Just(12) : $elm$core$Maybe$Nothing, 13203 (!_Utils_eq(oldMeta.is, newMeta.is)) ? $elm$core$Maybe$Just(13) : $elm$core$Maybe$Nothing, 13204 (!_Utils_eq(oldMeta.jD, newMeta.jD)) ? $elm$core$Maybe$Just(14) : $elm$core$Maybe$Nothing, 13205 (!_Utils_eq(oldMeta.bu, newMeta.bu)) ? $elm$core$Maybe$Just(7) : $elm$core$Maybe$Nothing 13206 ])); 13207 }); 13208var $author$project$Domain$Activity$payloadToDetail = F2( 13209 function (ctx, payload) { 13210 switch (payload.$) { 13211 case 14: 13212 return $elm$core$Maybe$Nothing; 13213 case 15: 13214 return $elm$core$Maybe$Nothing; 13215 case 0: 13216 return $elm$core$Maybe$Just($author$project$Domain$Activity$UnknownDetail); 13217 case 7: 13218 var entry = payload.a; 13219 return $elm$core$Maybe$Just( 13220 $author$project$Domain$Activity$entryAddedDetail(entry)); 13221 case 8: 13222 var entry = payload.a; 13223 return $elm$core$Maybe$Just( 13224 A2($author$project$Domain$Activity$entryModifiedDetail, ctx, entry)); 13225 case 9: 13226 var rootId = payload.a.aj; 13227 return $elm$core$Maybe$Just( 13228 $author$project$Domain$Activity$EntryDeletedDetail( 13229 { 13230 aR: ctx.eG(rootId), 13231 iv: ctx.iv(rootId) 13232 })); 13233 case 10: 13234 var rootId = payload.a.aj; 13235 return $elm$core$Maybe$Just( 13236 $author$project$Domain$Activity$EntryUndeletedDetail( 13237 { 13238 aR: ctx.eG(rootId), 13239 iv: ctx.iv(rootId) 13240 })); 13241 case 1: 13242 var data = payload.a; 13243 return $elm$core$Maybe$Just( 13244 $author$project$Domain$Activity$MemberCreatedDetail( 13245 {nL: data.nL, bW: data.bW})); 13246 case 5: 13247 var rootId = payload.a.aj; 13248 return $elm$core$Maybe$Just( 13249 $author$project$Domain$Activity$MemberLinkedDetail( 13250 { 13251 bW: ctx.bz(rootId), 13252 aj: rootId 13253 })); 13254 case 2: 13255 var data = payload.a; 13256 return $elm$core$Maybe$Just( 13257 $author$project$Domain$Activity$MemberRenamedDetail( 13258 {e4: data.e4, e6: data.e6, aj: data.aj})); 13259 case 3: 13260 var rootId = payload.a.aj; 13261 return $elm$core$Maybe$Just( 13262 $author$project$Domain$Activity$MemberRetiredDetail( 13263 { 13264 bW: ctx.bz(rootId), 13265 aj: rootId 13266 })); 13267 case 4: 13268 var rootId = payload.a.aj; 13269 return $elm$core$Maybe$Just( 13270 $author$project$Domain$Activity$MemberUnretiredDetail( 13271 { 13272 bW: ctx.bz(rootId), 13273 aj: rootId 13274 })); 13275 case 6: 13276 var data = payload.a; 13277 var oldMeta = ctx.jh(data.aj); 13278 return $elm$core$Maybe$Just( 13279 $author$project$Domain$Activity$MemberMetadataUpdatedDetail( 13280 { 13281 bW: ctx.bz(data.aj), 13282 n2: data.ji, 13283 oj: oldMeta, 13284 aj: data.aj, 13285 q3: A2($author$project$Domain$Activity$memberMetadataChanges, oldMeta, data.ji) 13286 })); 13287 case 11: 13288 var data = payload.a; 13289 return $elm$core$Maybe$Just( 13290 $author$project$Domain$Activity$GroupCreatedDetail( 13291 {il: data.il, bW: data.bW})); 13292 case 12: 13293 var change = payload.a; 13294 var oldMeta = ctx.iO; 13295 var newMeta = A2($author$project$Domain$Activity$applyGroupMetadataChange, oldMeta, change); 13296 return $elm$core$Maybe$Just( 13297 $author$project$Domain$Activity$GroupMetadataUpdatedDetail( 13298 { 13299 lP: A2($author$project$Domain$Activity$groupMetadataChangedFields, oldMeta, change), 13300 n1: newMeta, 13301 oi: oldMeta 13302 })); 13303 default: 13304 var data = payload.a; 13305 return $elm$core$Maybe$Just( 13306 $author$project$Domain$Activity$SettlementPreferencesUpdatedDetail( 13307 { 13308 e$: data.e$, 13309 bW: ctx.bz(data.e$), 13310 n3: A2($elm$core$List$map, ctx.bz, data.pB), 13311 ok: A2( 13312 $elm$core$List$map, 13313 ctx.bz, 13314 ctx.kh(data.e$)) 13315 })); 13316 } 13317 }); 13318var $author$project$Domain$Activity$fromEnvelope = F2( 13319 function (ctx, envelope) { 13320 return A2( 13321 $elm$core$Maybe$map, 13322 function (detail) { 13323 return { 13324 hJ: envelope.q0, 13325 io: detail, 13326 iA: envelope.m9, 13327 i2: A2($author$project$Domain$Event$involvedMembers, ctx.eG, envelope.jC), 13328 kD: envelope.lT 13329 }; 13330 }, 13331 A2($author$project$Domain$Activity$payloadToDetail, ctx, envelope.jC)); 13332 }); 13333var $author$project$Domain$GroupState$isTransferEntry = function (entry) { 13334 var _v0 = entry.gE; 13335 if (_v0.$ === 1) { 13336 return true; 13337 } else { 13338 return false;
13339 } 13340}; 13341var $author$project$Domain$GroupState$isKnownNonTransfer = F2( 13342 function (state, rootId) { 13343 var _v0 = A2($elm$core$Dict$get, rootId, state.E); 13344 if (!_v0.$) { 13345 var es = _v0.a; 13346 return !$author$project$Domain$GroupState$isTransferEntry(es.bi); 13347 } else { 13348 return false; 13349 } 13350 }); 13351var $author$project$Domain$GroupState$isAnchorMover = F2( 13352 function (payload, state) { 13353 switch (payload.$) { 13354 case 0: 13355 return false; 13356 case 7: 13357 var entry = payload.a; 13358 return !$author$project$Domain$GroupState$isTransferEntry(entry); 13359 case 8: 13360 var entry = payload.a; 13361 return !$author$project$Domain$GroupState$isTransferEntry(entry); 13362 case 9: 13363 var rootId = payload.a.aj; 13364 return A2($author$project$Domain$GroupState$isKnownNonTransfer, state, rootId); 13365 case 10: 13366 var rootId = payload.a.aj; 13367 return A2($author$project$Domain$GroupState$isKnownNonTransfer, state, rootId); 13368 case 13: 13369 return true; 13370 case 1: 13371 return false; 13372 case 2: 13373 return false; 13374 case 3: 13375 return false; 13376 case 4: 13377 return false; 13378 case 5: 13379 return false; 13380 case 6: 13381 return false; 13382 case 11: 13383 return false; 13384 case 12: 13385 return false; 13386 case 14: 13387 return false; 13388 default: 13389 return false; 13390 } 13391 }); 13392var $author$project$Domain$GroupState$isMember = F2( 13393 function (state, memberId) { 13394 return !_Utils_eq( 13395 A2($author$project$Domain$GroupState$resolveMemberRootId, state, memberId), 13396 $elm$core$Maybe$Nothing); 13397 }); 13398var $author$project$Domain$GroupState$isAuthorized = F2( 13399 function (state, envelope) { 13400 var _v0 = envelope.jC; 13401 switch (_v0.$) { 13402 case 11: 13403 return true; 13404 case 1: 13405 var data = _v0.a; 13406 return _Utils_eq(data.e_, envelope.q0) || A2($author$project$Domain$GroupState$isMember, state, envelope.q0); 13407 case 5: 13408 var data = _v0.a; 13409 return _Utils_eq(data.gd, envelope.q0); 13410 default: 13411 return A2($author$project$Domain$GroupState$isMember, state, envelope.q0); 13412 } 13413 }); 13414var $author$project$Domain$GroupState$applyEvent = F2( 13415 function (envelope, state) { 13416 if (!A2($author$project$Domain$GroupState$isAuthorized, state, envelope)) { 13417 return state; 13418 } else { 13419 var newState = A2($author$project$Domain$GroupState$applyPayload, envelope, state); 13420 var anchored = A2($author$project$Domain$GroupState$isAnchorMover, envelope.jC, state); 13421 var withSnapshot = anchored ? _Utils_update( 13422 newState, 13423 {eg: newState.E}) : newState; 13424 var _v0 = A2( 13425 $author$project$Domain$Activity$fromEnvelope, 13426 $author$project$Domain$GroupState$activityContext(state), 13427 envelope); 13428 if (!_v0.$) { 13429 var activity = _v0.a; 13430 return _Utils_update( 13431 withSnapshot, 13432 { 13433 cK: A2($elm$core$List$cons, activity, withSnapshot.cK) 13434 }); 13435 } else { 13436 return withSnapshot; 13437 } 13438 } 13439 }); 13440var $author$project$Domain$GroupState$mergeActivitiesHelp = F3( 13441 function (_new, existing, acc) { 13442 mergeActivitiesHelp: 13443 while (true) { 13444 var _v0 = _Utils_Tuple2(_new, existing); 13445 if (!_v0.a.b) { 13446 return _Utils_ap( 13447 $elm$core$List$reverse(acc), 13448 existing); 13449 } else { 13450 if (!_v0.b.b) { 13451 return _Utils_ap( 13452 $elm$core$List$reverse(acc), 13453 _new); 13454 } else { 13455 var _v1 = _v0.a; 13456 var n = _v1.a; 13457 var ns = _v1.b; 13458 var _v2 = _v0.b; 13459 var e = _v2.a; 13460 var es = _v2.b; 13461 if (_Utils_cmp( 13462 $elm$time$Time$posixToMillis(n.kD), 13463 $elm$time$Time$posixToMillis(e.kD)) > -1) { 13464 var $temp$new = ns, 13465 $temp$existing = existing, 13466 $temp$acc = A2($elm$core$List$cons, n, acc); 13467 _new = $temp$new; 13468 existing = $temp$existing; 13469 acc = $temp$acc; 13470 continue mergeActivitiesHelp; 13471 } else { 13472 var $temp$new = _new, 13473 $temp$existing = es, 13474 $temp$acc = A2($elm$core$List$cons, e, acc); 13475 _new = $temp$new; 13476 existing = $temp$existing; 13477 acc = $temp$acc; 13478 continue mergeActivitiesHelp; 13479 } 13480 } 13481 } 13482 } 13483 }); 13484var $author$project$Domain$GroupState$mergeActivities = F2( 13485 function (_new, existing) { 13486 return A3($author$project$Domain$GroupState$mergeActivitiesHelp, _new, existing, _List_Nil); 13487 }); 13488var $elm$core$Dict$values = function (dict) { 13489 return A3( 13490 $elm$core$Dict$foldr, 13491 F3( 13492 function (key, value, valueList) { 13493 return A2($elm$core$List$cons, value, valueList); 13494 }), 13495 _List_Nil, 13496 dict); 13497}; 13498var $author$project$Domain$GroupState$activeEntriesFrom = function (entriesDict) { 13499 return A2( 13500 $elm$core$List$map, 13501 function ($) { 13502 return $.bi; 13503 }, 13504 A2( 13505 $elm$core$List$filter, 13506 A2( 13507 $elm$core$Basics$composeL, 13508 $elm$core$Basics$not, 13509 function ($) { 13510 return $.gB; 13511 }), 13512 $elm$core$Dict$values(entriesDict))); 13513}; 13514var $author$project$Domain$GroupState$activeEntries = function (state) { 13515 return $author$project$Domain$GroupState$activeEntriesFrom(state.E); 13516}; 13517var $elm$core$Basics$min = F2( 13518 function (x, y) { 13519 return (_Utils_cmp(x, y) < 0) ? x : y; 13520 }); 13521var $author$project$Domain$Balance$distributeRemainder = F3( 13522 function (rem, items, acc) { 13523 distributeRemainder: 13524 while (true) { 13525 if (!items.b) { 13526 return $elm$core$List$reverse(acc); 13527 } else { 13528 var _v1 = items.a; 13529 var mid = _v1.a; 13530 var shares = _v1.b; 13531 var amt = _v1.c; 13532 var rest = items.b; 13533 var extra = A2($elm$core$Basics$min, shares, rem); 13534 var $temp$rem = rem - extra, 13535 $temp$items = rest, 13536 $temp$acc = A2( 13537 $elm$core$List$cons, 13538 _Utils_Tuple2(mid, amt + extra), 13539 acc); 13540 rem = $temp$rem; 13541 items = $temp$items; 13542 acc = $temp$acc; 13543 continue distributeRemainder; 13544 } 13545 } 13546 }); 13547var $elm$core$List$sortBy = _List_sortBy; 13548var $author$project$Domain$Balance$computeSharesSplit = F2( 13549 function (totalAmount, beneficiaries) { 13550 var shareItems = A2( 13551 $elm$core$List$filterMap, 13552 function (b) { 13553 if (!b.$) { 13554 var memberId = b.a.e_; 13555 var shares = b.a.qc; 13556 return $elm$core$Maybe$Just( 13557 _Utils_Tuple2(memberId, shares)); 13558 } else { 13559 return $elm$core$Maybe$Nothing; 13560 } 13561 },
13562 beneficiaries); 13563 var totalShares = A3( 13564 $elm$core$List$foldl, 13565 F2( 13566 function (_v3, acc) { 13567 var s = _v3.b; 13568 return acc + s; 13569 }), 13570 0, 13571 shareItems); 13572 if (!totalShares) { 13573 return _List_Nil; 13574 } else { 13575 var basePerShare = (totalShares > 0) ? ((totalAmount / totalShares) | 0) : 0; 13576 var baseAllocated = A2( 13577 $elm$core$List$map, 13578 function (_v2) { 13579 var mid = _v2.a; 13580 var s = _v2.b; 13581 return _Utils_Tuple3(mid, s, basePerShare * s); 13582 }, 13583 shareItems); 13584 var baseTotal = A3( 13585 $elm$core$List$foldl, 13586 F2( 13587 function (_v1, acc) { 13588 var amt = _v1.c; 13589 return acc + amt; 13590 }), 13591 0, 13592 baseAllocated); 13593 var remainder = totalAmount - baseTotal; 13594 var sorted = A2( 13595 $elm$core$List$sortBy, 13596 function (_v0) { 13597 var mid = _v0.a; 13598 return mid; 13599 }, 13600 baseAllocated); 13601 return A3($author$project$Domain$Balance$distributeRemainder, remainder, sorted, _List_Nil); 13602 } 13603 }); 13604var $author$project$Domain$Balance$distributeExtra = F3( 13605 function (rem, xs, acc) { 13606 distributeExtra: 13607 while (true) { 13608 if (!xs.b) { 13609 return $elm$core$List$reverse(acc); 13610 } else { 13611 var _v1 = xs.a; 13612 var mid = _v1.a; 13613 var amt = _v1.b; 13614 var rest = xs.b; 13615 if (rem > 0) { 13616 var $temp$rem = rem - 1, 13617 $temp$xs = rest, 13618 $temp$acc = A2( 13619 $elm$core$List$cons, 13620 _Utils_Tuple2(mid, amt + 1), 13621 acc); 13622 rem = $temp$rem; 13623 xs = $temp$xs; 13624 acc = $temp$acc; 13625 continue distributeExtra; 13626 } else { 13627 var $temp$rem = 0, 13628 $temp$xs = rest, 13629 $temp$acc = A2( 13630 $elm$core$List$cons, 13631 _Utils_Tuple2(mid, amt), 13632 acc); 13633 rem = $temp$rem; 13634 xs = $temp$xs; 13635 acc = $temp$acc; 13636 continue distributeExtra; 13637 } 13638 } 13639 } 13640 }); 13641var $author$project$Domain$Balance$distributeProportionally = F3( 13642 function (totalAmount, items, itemTotal) { 13643 var baseAllocated = A2( 13644 $elm$core$List$map, 13645 function (_v1) { 13646 var mid = _v1.a; 13647 var amt = _v1.b; 13648 return _Utils_Tuple2(mid, ((amt * totalAmount) / itemTotal) | 0); 13649 }, 13650 items); 13651 var baseTotal = A3( 13652 $elm$core$List$foldl, 13653 F2( 13654 function (_v0, acc) { 13655 var amt = _v0.b; 13656 return acc + amt; 13657 }), 13658 0, 13659 baseAllocated); 13660 var remainder = totalAmount - baseTotal; 13661 var sorted = A2($elm$core$List$sortBy, $elm$core$Tuple$first, baseAllocated); 13662 return A3($author$project$Domain$Balance$distributeExtra, remainder, sorted, _List_Nil); 13663 }); 13664var $author$project$Domain$Balance$computeBeneficiarySplit = F2( 13665 function (totalAmount, beneficiaries) { 13666 if (!beneficiaries.b) { 13667 return _List_Nil; 13668 } else { 13669 if (beneficiaries.a.$ === 1) { 13670 var items = A2( 13671 $elm$core$List$filterMap, 13672 function (b) { 13673 if (b.$ === 1) { 13674 var memberId = b.a.e_; 13675 var amount = b.a.ef; 13676 return $elm$core$Maybe$Just( 13677 _Utils_Tuple2(memberId, amount)); 13678 } else { 13679 return $elm$core$Maybe$Nothing; 13680 } 13681 }, 13682 beneficiaries); 13683 var exactTotal = A3( 13684 $elm$core$List$foldl, 13685 F2( 13686 function (b, acc) { 13687 if (b.$ === 1) { 13688 var amount = b.a.ef; 13689 return acc + amount; 13690 } else { 13691 return acc; 13692 } 13693 }), 13694 0, 13695 beneficiaries); 13696 return ((exactTotal > 0) && (!_Utils_eq(exactTotal, totalAmount))) ? A3($author$project$Domain$Balance$distributeProportionally, totalAmount, items, exactTotal) : items; 13697 } else { 13698 return A2($author$project$Domain$Balance$computeSharesSplit, totalAmount, beneficiaries); 13699 } 13700 } 13701 }); 13702var $author$project$Domain$Balance$entryDefaultCurrencyAmount = function (entry) { 13703 var _v0 = entry.gE; 13704 switch (_v0.$) { 13705 case 0: 13706 var data = _v0.a; 13707 return A2($elm$core$Maybe$withDefault, data.ef, data.ck); 13708 case 1: 13709 var data = _v0.a; 13710 return A2($elm$core$Maybe$withDefault, data.ef, data.ck); 13711 default: 13712 var data = _v0.a; 13713 return A2($elm$core$Maybe$withDefault, data.ef, data.ck); 13714 } 13715}; 13716var $author$project$Domain$Balance$computeEntryOwed = function (entry) { 13717 var totalAmount = $author$project$Domain$Balance$entryDefaultCurrencyAmount(entry); 13718 var _v0 = entry.gE; 13719 switch (_v0.$) { 13720 case 0: 13721 var data = _v0.a; 13722 return A2($author$project$Domain$Balance$computeBeneficiarySplit, totalAmount, data.em); 13723 case 1: 13724 var data = _v0.a; 13725 return _List_fromArray( 13726 [ 13727 _Utils_Tuple2(data.kE, totalAmount) 13728 ]); 13729 default: 13730 var data = _v0.a; 13731 return _List_fromArray( 13732 [ 13733 _Utils_Tuple2(data.j$, totalAmount) 13734 ]); 13735 } 13736}; 13737var $elm$core$List$sum = function (numbers) { 13738 return A3($elm$core$List$foldl, $elm$core$Basics$add, 0, numbers); 13739}; 13740var $author$project$Domain$Balance$computePayerSplit = F2( 13741 function (totalAmount, payers) { 13742 var payerAmounts = A2( 13743 $elm$core$List$map, 13744 function (payer) { 13745 return _Utils_Tuple2(payer.e_, payer.ef); 13746 }, 13747 payers); 13748 var payerTotal = $elm$core$List$sum( 13749 A2($elm$core$List$map, $elm$core$Tuple$second, payerAmounts)); 13750 return ((payerTotal > 0) && (!_Utils_eq(payerTotal, totalAmount))) ? A3($author$project$Domain$Balance$distributeProportionally, totalAmount, payerAmounts, payerTotal) : payerAmounts; 13751 }); 13752var $author$project$Domain$Balance$computeEntryPaid = function (entry) { 13753 var totalAmount = $author$project$Domain$Balance$entryDefaultCurrencyAmount(entry); 13754 var _v0 = entry.gE; 13755 switch (_v0.$) { 13756 case 0: 13757 var data = _v0.a; 13758 return (!_Utils_eq(data.ck, $elm$core$Maybe$Nothing)) ? A2($author$project$Domain$Balance$computePayerSplit, totalAmount, data.jB) : A2( 13759 $elm$core$List$map, 13760 function (p) { 13761 return _Utils_Tuple2(p.e_, p.ef); 13762 }, 13763 data.jB); 13764 case 1: 13765 var data = _v0.a; 13766 return _List_fromArray( 13767 [ 13768 _Utils_Tuple2(data.iH, totalAmount) 13769 ]); 13770 default: 13771 var data = _v0.a; 13772 return A2($author$project$Domain$Balance$computeBeneficiarySplit, totalAmount, data.em); 13773 } 13774}; 13775var $elm$core$Dict$map = F2( 13776 function (func, dict) { 13777 if (dict.$ === -2) { 13778 return $elm$core$Dict$RBEmpty_elm_builtin; 13779 } else { 13780 var color = dict.a; 13781 var key = dict.b; 13782 var value = dict.c; 13783 var left = dict.d; 13784 var right = dict.e; 13785 return A5( 13786 $elm$core$Dict$RBNode_elm_builtin, 13787 color, 13788 key, 13789 A2(func, key, value), 13790 A2($elm$core$Dict$map, func, left), 13791 A2($elm$core$Dict$map, func, right)); 13792 } 13793 }); 13794var $author$project$Domain$Balance$computeBalances = function (entries) { 13795 var emptyAccum = {e9: 0, fa: 0}; 13796 var accumulate = F2( 13797 function (entry, acc) { 13798 var paidUpdates = $author$project$Domain$Balance$computeEntryPaid(entry); 13799 var owedUpdates = $author$project$Domain$Balance$computeEntryOwed(entry); 13800 var addPaid = F2( 13801 function (_v2, d) { 13802 var memberId = _v2.a; 13803 var amount = _v2.b; 13804 return A3( 13805 $elm$core$Dict$update, 13806 memberId, 13807 function (mv) { 13808 var cur = A2($elm$core$Maybe$withDefault, emptyAccum, mv); 13809 return $elm$core$Maybe$Just( 13810 _Utils_update( 13811 cur, 13812 {fa: cur.fa + amount})); 13813 }, 13814 d); 13815 }); 13816 var addOwed = F2( 13817 function (_v1, d) { 13818 var memberId = _v1.a; 13819 var amount = _v1.b; 13820 return A3( 13821 $elm$core$Dict$update, 13822 memberId, 13823 function (mv) { 13824 var cur = A2($elm$core$Maybe$withDefault, emptyAccum, mv); 13825 return $elm$core$Maybe$Just( 13826 _Utils_update( 13827 cur, 13828 {e9: cur.e9 + amount})); 13829 }, 13830 d); 13831 }); 13832 return function (a) { 13833 return A3($elm$core$List$foldl, addOwed, a, owedUpdates); 13834 }( 13835 function (a) { 13836 return A3($elm$core$List$foldl, addPaid, a, paidUpdates); 13837 }(acc)); 13838 }); 13839 var accumulated = A3($elm$core$List$foldl, accumulate, $elm$core$Dict$empty, entr
13839ies); 13840 return A2( 13841 $elm$core$Dict$map, 13842 F2( 13843 function (memberId, _v0) { 13844 var paid = _v0.fa; 13845 var owed = _v0.e9; 13846 return {e$: memberId, e2: paid - owed, kI: owed, kJ: paid}; 13847 }), 13848 accumulated); 13849}; 13850var $author$project$Domain$Balance$computeExpenseShares = function (entries) { 13851 var accumulate = F2( 13852 function (entry, acc) { 13853 var _v0 = entry.gE; 13854 switch (_v0.$) { 13855 case 0: 13856 var data = _v0.a; 13857 return A3( 13858 $elm$core$List$foldl, 13859 function (_v1) { 13860 var memberId = _v1.a; 13861 var amount = _v1.b; 13862 return A2( 13863 $elm$core$Dict$update, 13864 memberId, 13865 function (cur) { 13866 return $elm$core$Maybe$Just( 13867 A2($elm$core$Maybe$withDefault, 0, cur) + amount); 13868 }); 13869 }, 13870 acc, 13871 A2( 13872 $author$project$Domain$Balance$computeBeneficiarySplit, 13873 $author$project$Domain$Balance$entryDefaultCurrencyAmount(entry), 13874 data.em)); 13875 case 1: 13876 return acc; 13877 default: 13878 return acc; 13879 } 13880 }); 13881 return A3($elm$core$List$foldl, accumulate, $elm$core$Dict$empty, entries); 13882}; 13883var $author$project$Domain$GroupState$recomputeBalances = function (state) { 13884 var active = $author$project$Domain$GroupState$activeEntries(state); 13885 return _Utils_update( 13886 state, 13887 { 13888 lp: $author$project$Domain$Balance$computeBalances( 13889 $author$project$Domain$GroupState$activeEntriesFrom(state.eg)), 13890 ly: $author$project$Domain$Balance$computeBalances(active), 13891 gk: $author$project$Domain$Balance$computeExpenseShares(active) 13892 }); 13893}; 13894var $author$project$Domain$Event$compareEnvelopes = F2( 13895 function (a, b) { 13896 var tb = $elm$time$Time$posixToMillis(b.lT); 13897 var ta = $elm$time$Time$posixToMillis(a.lT); 13898 var _v0 = A2($elm$core$Basics$compare, ta, tb); 13899 if (_v0 === 1) { 13900 return A2($elm$core$Basics$compare, a.m9, b.m9); 13901 } else { 13902 var order = _v0; 13903 return order; 13904 } 13905 }); 13906var $elm$core$List$sortWith = _List_sortWith; 13907var $author$project$Domain$Event$sortEvents = $elm$core$List$sortWith($author$project$Domain$Event$compareEnvelopes); 13908var $author$project$Domain$GroupState$applyEvents = F2( 13909 function (events, state) { 13910 var stateAfterFold = A3( 13911 $elm$core$List$foldl, 13912 $author$project$Domain$GroupState$applyEvent, 13913 state, 13914 $author$project$Domain$Event$sortEvents(events)); 13915 return $author$project$Domain$GroupState$recomputeBalances( 13916 _Utils_update( 13917 stateAfterFold, 13918 { 13919 eb: A2($author$project$Domain$GroupState$mergeActivities, stateAfterFold.cK, stateAfterFold.eb), 13920 cK: _List_Nil 13921 })); 13922 }); 13923var $author$project$GroupOps$author = function (ctx) { 13924 return {m9: ctx.O.aK, jO: ctx.O.dV.jO}; 13925}; 13926var $author$project$GroupOps$clampAfterLatest = F2( 13927 function (newestFirst, now) { 13928 if (!newestFirst.b) { 13929 return now; 13930 } else { 13931 var latest = newestFirst.a; 13932 return $elm$time$Time$millisToPosix( 13933 A2( 13934 $elm$core$Basics$max, 13935 $elm$time$Time$posixToMillis(now), 13936 $elm$time$Time$posixToMillis(latest.lT) + 1)); 13937 } 13938 }); 13939var $author$project$WebCrypto$Symmetric$exportKey = function (_v0) { 13940 var base64 = _v0; 13941 return base64; 13942}; 13943var $author$project$WebCrypto$Signature$SigningKeyPair = $elm$core$Basics$identity; 13944var $author$project$WebCrypto$Signature$importSigningKeyPair = $elm$core$Basics$identity; 13945var $author$project$Domain$Event$MemberCreated = function (a) { 13946 return {$: 1, a: a}; 13947};
13948var $author$project$Domain$Event$MemberLinked = function (a) { 13949 return {$: 5, a: a}; 13950}; 13951var $author$project$Domain$GroupState$nextLinkSeq = F2( 13952 function (state, deviceId) { 13953 return A2( 13954 $elm$core$Maybe$withDefault, 13955 0, 13956 A2( 13957 $elm$core$Maybe$map, 13958 function (link) { 13959 return link.kg + 1; 13960 }, 13961 A2($elm$core$Dict$get, deviceId, state.aP))); 13962 }); 13963var $author$project$GroupOps$joinPayload = F4( 13964 function (selfId, action, newMemberName, groupState) { 13965 if (!action.$) { 13966 var rootId = action.a; 13967 return A2($elm$core$Dict$member, rootId, groupState.r) ? $elm$core$Maybe$Just( 13968 $author$project$Domain$Event$MemberLinked( 13969 { 13970 gd: selfId, 13971 aj: rootId, 13972 kg: A2($author$project$Domain$GroupState$nextLinkSeq, groupState, selfId) 13973 })) : $elm$core$Maybe$Nothing; 13974 } else { 13975 return $elm$core$Maybe$Just( 13976 $author$project$Domain$Event$MemberCreated( 13977 {fO: selfId, e_: selfId, nL: 0, bW: newMemberName})); 13978 } 13979 }); 13980var $elm$core$Tuple$mapFirst = F2( 13981 function (func, _v0) { 13982 var x = _v0.a; 13983 var y = _v0.b; 13984 return _Utils_Tuple2( 13985 func(x), 13986 y); 13987 }); 13988var $andrewMacmurray$elm_concurrent_task$ConcurrentTask$Internal$ExpectNoErrors = {$: 0}; 13989var $andrewMacmurray$elm_concurrent_task$ConcurrentTask$expectNoErrors = $andrewMacmurray$elm_concurrent_task$ConcurrentTask$Internal$ExpectNoErrors; 13990var $andrewMacmurray$elm_concurrent_task$ConcurrentTask$Time$now = $andrewMacmurray$elm_concurrent_task$ConcurrentTask$define( 13991 { 13992 k: $elm$json$Json$Encode$null, 13993 l: $andrewMacmurray$elm_concurrent_task$ConcurrentTask$expectNoErrors, 13994 m: $andrewMacmurray$elm_concurrent_task$ConcurrentTask$expectJson( 13995 A2($elm$json$Json$Decode$map, $elm$time$Time$millisToPosix, $elm$json$Json$Decode$int)), 13996 n: 'builtin:timeNow' 13997 }); 13998var $author$project$Infra$Storage$Pushed = 1; 13999var $author$project$Infra$Storage$Unpushed = 0; 14000var $elm$core$List$append = F2( 14001 function (xs, ys) { 14002 if (!ys.b) { 14003 return xs; 14004 } else { 14005 return A3($elm$core$List$foldr, $elm$core$List$cons, ys, xs); 14006 } 14007 }); 14008var $elm$core$List$concat = function (lists) { 14009 return A3($elm$core$List$foldr, $elm$core$List$append, _List_Nil, lists); 14010}; 14011var $andrewMacmurray$elm_concurrent_task$ConcurrentTask$doBatch = A2( 14012 $elm$core$List$foldr, 14013 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$map2($elm$core$List$cons), 14014 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$succeed(_List_Nil)); 14015var $andrewMacmurray$elm_concurrent_task$ConcurrentTask$Internal$List$Done = function (a) { 14016 return {$: 0, a: a}; 14017}; 14018var $andrewMacmurray$elm_concurrent_task$ConcurrentTask$Internal$List$Jump = function (a) { 14019 return {$: 1, a: a}; 14020}; 14021var $elm$core$List$drop = F2( 14022 function (n, list) { 14023 drop: 14024 while (true) { 14025 if (n <= 0) { 14026 return list; 14027 } else { 14028 if (!list.b) { 14029 return list; 14030 } else { 14031 var x = list.a; 14032 var xs = list.b; 14033 var $temp$n = n - 1, 14034 $temp$list = xs; 14035 n = $temp$n; 14036 list = $temp$list; 14037 continue drop; 14038 } 14039 } 14040 } 14041 }); 14042var $elm$core$Array$push = F2( 14043 function (a, array) { 14044 var tail = array.d; 14045 return A2( 14046 $elm$core$Array$unsafeReplaceTail, 14047 A2($elm$core$Elm$JsArray$push, a, tail), 14048 array); 14049 }); 14050var $elm$core$List$takeReverse = F3( 14051 function (n, list, kept) { 14052 takeReverse: 14053 while (true) { 14054 if (n <= 0) { 14055 return kept; 14056 } else { 14057 if (!list.b) { 14058 return kept; 14059 } else { 14060 var x = list.a; 14061 var xs = list.b; 14062 var $temp$n = n - 1, 14063 $temp$list = xs, 14064 $temp$kept = A2($elm$core$List$cons, x, kept); 14065 n = $temp$n; 14066 list = $temp$list; 14067 kept = $temp$kept; 14068 continue takeReverse; 14069 } 14070 } 14071 } 14072 }); 14073var $elm$core$List$takeTailRec = F2( 14074 function (n, list) { 14075 return $elm$core$List$reverse( 14076 A3($elm$core$List$takeReverse, n, list, _List_Nil)); 14077 }); 14078var $elm$core$List$takeFast = F3( 14079 function (ctr, n, list) { 14080 if (n <= 0) { 14081 return _List_Nil; 14082 } else { 14083 var _v0 = _Utils_Tuple2(n, list); 14084 _v0$1: 14085 while (true) { 14086 _v0$5: 14087 while (true) { 14088 if (!_v0.b.b) { 14089 return list; 14090 } else { 14091 if (_v0.b.b.b) { 14092 switch (_v0.a) { 14093 case 1: 14094 break _v0$1; 14095 case 2: 14096 var _v2 = _v0.b; 14097 var x = _v2.a; 14098 var _v3 = _v2.b; 14099 var y = _v3.a; 14100 return _List_fromArray( 14101 [x, y]); 14102 case 3: 14103 if (_v0.b.b.b.b) { 14104 var _v4 = _v0.b; 14105 var x = _v4.a; 14106 var _v5 = _v4.b; 14107 var y = _v5.a; 14108 var _v6 = _v5.b; 14109 var z = _v6.a; 14110 return _List_fromArray( 14111 [x, y, z]); 14112 } else { 14113 break _v0$5; 14114 } 14115 default: 14116 if (_v0.b.b.b.b && _v0.b.b.b.b.b) { 14117 var _v7 = _v0.b; 14118 var x = _v7.a; 14119 var _v8 = _v7.b; 14120 var y = _v8.a; 14121 var _v9 = _v8.b; 14122 var z = _v9.a; 14123 var _v10 = _v9.b; 14124 var w = _v10.a; 14125 var tl = _v10.b; 14126 return (ctr > 1000) ? A2( 14127 $elm$core$List$cons, 14128 x, 14129 A2( 14130 $elm$core$List$cons, 14131 y, 14132 A2( 14133 $elm$core$List$cons, 14134 z, 14135 A2( 14136 $elm$core$List$cons, 14137 w, 14138 A2($elm$core$List$takeTailRec, n - 4, tl))))) : A2( 14139 $elm$core$List$cons, 14140 x, 14141 A2( 14142 $elm$core$List$cons, 14143 y, 14144 A2( 14145 $elm$core$List$cons, 14146 z, 14147 A2( 14148 $elm$core$List$cons, 14149 w, 14150 A3($elm$core$List$takeFast, ctr + 1, n - 4, tl))))); 14151 } else { 14152 break _v0$5; 14153 } 14154 } 14155 } else { 14156 if (_v0.a === 1) { 14157 break _v0$1; 14158 } else { 14159 break _v0$5; 14160 } 14161 } 14162 } 14163 } 14164 return list; 14165 } 14166 var _v1 = _v0.b; 14167 var x = _v1.a; 14168 return _List_fromArray( 14169 [x]); 14170 } 14171 }); 14172var $elm$core$List$take = F2( 14173 function (n, list) { 14174 return A3($elm$core$List$takeFast, 0, n, list); 14175 }); 14176var $andrewMacmurray$elm_concurrent_task$ConcurrentTask$Internal$List$chunkHelp = F3( 14177 function (n, xs, acc) { 14178 return $elm$core$List$isEmpty(xs) ? $andrewMacmurray$elm_concurrent_task$ConcurrentTask$Internal$List$Done( 14179 $elm$core$Array$toList(acc)) : $andrewMacmurray$elm_concurrent_task$ConcurrentTask$Internal$List$Jump( 14180 function (_v0) { 14181 return A3( 14182 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$Internal$List$chunkHelp, 14183 n, 14184 A2($elm$core$List$drop, n, xs), 14185 A2( 14186 $elm$core$Array$push, 14187 A2($elm$core$List$take, n, xs), 14188 acc)); 14189 }); 14190 }); 14191var $andrewMacmurray$elm_concurrent_task$ConcurrentTask$Internal$List$eval = function (trampoline) { 14192 _eval: 14193 while (true) { 14194 if (!trampoline.$) { 14195 var value = trampoline.a; 14196 return value; 14197 } else { 14198 var f = trampoline.a; 14199 var $temp$trampoline = f(0); 14200 trampoline = $temp$trampoline;
14201 continue _eval; 14202 } 14203 } 14204}; 14205var $elm$core$List$singleton = function (value) { 14206 return _List_fromArray( 14207 [value]); 14208}; 14209var $andrewMacmurray$elm_concurrent_task$ConcurrentTask$Internal$List$chunk = F2( 14210 function (n, xs) { 14211 return (n < 1) ? $elm$core$List$singleton(xs) : $andrewMacmurray$elm_concurrent_task$ConcurrentTask$Internal$List$eval( 14212 A3($andrewMacmurray$elm_concurrent_task$ConcurrentTask$Internal$List$chunkHelp, n, xs, $elm$core$Array$empty)); 14213 }); 14214var $andrewMacmurray$elm_concurrent_task$ConcurrentTask$miniBatchesOf = function (n) { 14215 return A2( 14216 $elm$core$Basics$composeR, 14217 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$Internal$List$chunk(n), 14218 $elm$core$List$map($andrewMacmurray$elm_concurrent_task$ConcurrentTask$doBatch)); 14219}; 14220var $andrewMacmurray$elm_concurrent_task$ConcurrentTask$batch = function (tasks) { 14221 return A2( 14222 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$map, 14223 A2( 14224 $elm$core$Basics$composeR, 14225 $elm$core$List$concat, 14226 A2( 14227 $elm$core$Basics$composeR, 14228 $elm$core$List$concat, 14229 A2( 14230 $elm$core$Basics$composeR, 14231 $elm$core$List$concat, 14232 A2( 14233 $elm$core$Basics$composeR, 14234 $elm$core$List$concat, 14235 A2($elm$core$Basics$composeR, $elm$core$List$concat, $elm$core$List$concat))))), 14236 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$doBatch( 14237 A2( 14238 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$miniBatchesOf, 14239 10, 14240 A2( 14241 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$miniBatchesOf, 14242 10, 14243 A2( 14244 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$miniBatchesOf, 14245 10, 14246 A2( 14247 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$miniBatchesOf, 14248 10, 14249 A2( 14250 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$miniBatchesOf, 14251 10, 14252 A2($andrewMacmurray$elm_concurrent_task$ConcurrentTask$miniBatchesOf, 10, tasks)))))))); 14253}; 14254var $author$project$Domain$Event$encodeEnvelope = function (envelope) { 14255 return envelope.jZ; 14256}; 14257var $author$project$Infra$Storage$encodeEventForStorage = F3( 14258 function (groupId, pushState, envelope) { 14259 return $elm$json$Json$Encode$object( 14260 _List_fromArray( 14261 [ 14262 _Utils_Tuple2( 14263 'id', 14264 $elm$json$Json$Encode$string(envelope.m9)), 14265 _Utils_Tuple2( 14266 'groupId', 14267 $elm$json$Json$Encode$string(groupId)), 14268 _Utils_Tuple2( 14269 'env', 14270 $author$project$Domain$Event$encodeEnvelope(envelope)), 14271 _Utils_Tuple2( 14272 'unpushed', 14273 $elm$json$Json$Encode$bool(!pushState)) 14274 ])); 14275 }); 14276var $author$project$IndexedDb$putMany = F3( 14277 function (db, store, values) { 14278 return $andrewMacmurray$elm_concurrent_task$ConcurrentTask$define( 14279 { 14280 k: $elm$json$Json$Encode$object( 14281 _List_fromArray( 14282 [ 14283 _Utils_Tuple2( 14284 'db', 14285 $elm$json$Json$Encode$string( 14286 $author$project$IndexedDb$getDbName(db))), 14287 _Utils_Tuple2( 14288 'store', 14289 $elm$json$Json$Encode$string( 14290 $author$project$IndexedDb$getStoreName(store))), 14291 _Utils_Tuple2( 14292 'entries', 14293 A2( 14294 $elm$json$Json$Encode$list, 14295 function (v) { 14296 return $elm$json$Json$Encode$object( 14297 _List_fromArray( 14298 [ 14299 _Utils_Tuple2('value', v) 14300 ])); 14301 }, 14302 values)) 14303 ])), 14304 l: $andrewMacmurray$elm_concurrent_task$ConcurrentTask$expectErrors($author$project$IndexedDb$errorDecoder), 14305 m: $andrewMacmurray$elm_concurrent_task$ConcurrentTask$expectWhatever, 14306 n: 'indexeddb:putMany' 14307 }); 14308 }); 14309var $author$project$Infra$Storage$saveEventRecords = F3( 14310 function (db, groupId, records) { 14311 return A3( 14312 $author$project$IndexedDb$putMany, 14313 db, 14314 $author$project$Infra$Storage$eventsStore, 14315 A2( 14316 $elm$core$List$map, 14317 function (_v0) { 14318 var pushState = _v0.a; 14319 var envelope = _v0.b; 14320 return A3($author$project$Infra$Storage$encodeEventForStorage, groupId, pushState, envelope); 14321 }, 14322 records)); 14323 }); 14324var $author$project$Infra$Storage$saveGroupKey = F3( 14325 function (db, groupId, key) { 14326 return A4( 14327 $author$project$IndexedDb$putAt, 14328 db, 14329 $author$project$Infra$Storage$groupKeysStore, 14330 $author$project$IndexedDb$StringKey(groupId), 14331 $elm$json$Json$Encode$string(key)); 14332 }); 14333var $author$project$Domain$Currency$encodeCurrency = function (currency) { 14334 return $elm$json$Json$Encode$string( 14335 $elm$core$String$toLower( 14336 $author$project$Domain$Currency$currencyCode(currency))); 14337}; 14338var $author$project$Domain$Group$encodeSummary = function (summary) { 14339 return $elm$json$Json$Encode$object( 14340 _List_fromArray( 14341 [ 14342 _Utils_Tuple2( 14343 'id', 14344 $elm$json$Json$Encode$string(summary.m9)), 14345 _Utils_Tuple2( 14346 'n', 14347 $elm$json$Json$Encode$string(summary.bW)), 14348 _Utils_Tuple2( 14349 'dc', 14350 $author$project$Domain$Currency$encodeCurrency(summary.il)), 14351 _Utils_Tuple2( 14352 'sub', 14353 $elm$json$Json$Encode$bool(summary.gC)), 14354 _Utils_Tuple2( 14355 'ar', 14356 $elm$json$Json$Encode$bool(summary.gA)), 14357 _Utils_Tuple2( 14358 'ca', 14359 $elm$json$Json$Encode$int( 14360 $elm$time$Time$posixToMillis(summary.f2))), 14361 _Utils_Tuple2( 14362 'mc', 14363 $elm$json$Json$Encode$int(summary.gL)), 14364 _Utils_Tuple2( 14365 'mb', 14366 $elm$json$Json$Encode$int(summary.gS)), 14367 _Utils_Tuple2( 14368 'ls', 14369 $elm$json$Json$Encode$int( 14370 $elm$time$Time$posixToMillis(summary.gF))) 14371 ])); 14372}; 14373var $author$project$IndexedDb$put = F3( 14374 function (db, store, value) { 14375 return $andrewMacmurray$elm_concurrent_task$ConcurrentTask$define( 14376 { 14377 k: $elm$json$Json$Encode$object( 14378 _List_fromArray( 14379 [ 14380 _Utils_Tuple2( 14381 'db', 14382 $elm$json$Json$Encode$string( 14383 $author$project$IndexedDb$getDbName(db))), 14384 _Utils_Tuple2( 14385 'store', 14386 $elm$json$Json$Encode$string( 14387 $author$project$IndexedDb$getStoreName(store))), 14388 _Utils_Tuple2('value', value) 14389 ])), 14390 l: $andrewMacmurray$elm_concurrent_task$ConcurrentTask$expectErrors($author$project$IndexedDb$errorDecoder), 14391 m: $andrewMacmurray$elm_concurrent_task$ConcurrentTask$expectJson($author$project$IndexedDb$ke
14391yDecoder), 14392 n: 'indexeddb:put' 14393 }); 14394 }); 14395var $author$project$Infra$Storage$saveGroupSummary = F2( 14396 function (db, summary) { 14397 return A3( 14398 $author$project$IndexedDb$put, 14399 db, 14400 $author$project$Infra$Storage$groupsStore, 14401 $author$project$Domain$Group$encodeSummary(summary)); 14402 }); 14403var $author$project$Infra$Storage$saveSyncCursor = F3( 14404 function (db, groupId, cursor) { 14405 return A4( 14406 $author$project$IndexedDb$putAt, 14407 db, 14408 $author$project$Infra$Storage$syncCursorsStore, 14409 $author$project$IndexedDb$StringKey(groupId), 14410 $elm$json$Json$Encode$object( 14411 _List_fromArray( 14412 [ 14413 _Utils_Tuple2( 14414 'seq', 14415 $elm$json$Json$Encode$int(cursor.kg)), 14416 _Utils_Tuple2( 14417 'epoch', 14418 $elm$json$Json$Encode$string(cursor.mt)) 14419 ]))); 14420 }); 14421var $author$project$Infra$Storage$saveJoinedGroup = F7( 14422 function (db, summary, groupKey, events, unpushedIds, membershipEvent, maybeCursor) { 14423 var saveCursorTask = function () { 14424 if (!maybeCursor.$) { 14425 var cursor = maybeCursor.a; 14426 return A3($author$project$Infra$Storage$saveSyncCursor, db, summary.m9, cursor); 14427 } else { 14428 return $andrewMacmurray$elm_concurrent_task$ConcurrentTask$succeed(0); 14429 } 14430 }(); 14431 var importedRecords = A2( 14432 $elm$core$List$map, 14433 function (envelope) { 14434 return _Utils_Tuple2( 14435 A2($elm$core$Set$member, envelope.m9, unpushedIds) ? 0 : 1, 14436 envelope); 14437 }, 14438 events); 14439 return A2( 14440 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$map, 14441 function (_v1) { 14442 return 0; 14443 }, 14444 A2( 14445 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$andThen, 14446 function (_v0) { 14447 return A2($author$project$Infra$Storage$saveGroupSummary, db, summary); 14448 }, 14449 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$batch( 14450 _List_fromArray( 14451 [ 14452 A3( 14453 $author$project$Infra$Storage$saveEventRecords, 14454 db, 14455 summary.m9, 14456 _Utils_ap( 14457 importedRecords, 14458 _List_fromArray( 14459 [ 14460 _Utils_Tuple2(0, membershipEvent) 14461 ]))), 14462 A3($author$project$Infra$Storage$saveGroupKey, db, summary.m9, groupKey), 14463 saveCursorTask 14464 ])))); 14465 }); 14466var $author$project$Domain$Event$canonicalize = function (envelope) { 14467 var _v0 = A2( 14468 $elm$json$Json$Decode$decodeValue, 14469 $elm$json$Json$Decode$keyValuePairs($elm$json$Json$Decode$value), 14470 envelope.jZ); 14471 if (!_v0.$) { 14472 var fields = _v0.a; 14473 return A2( 14474 $elm$json$Json$Encode$encode, 14475 0, 14476 $elm$json$Json$Encode$object( 14477 A2( 14478 $elm$core$List$filter, 14479 function (_v1) { 14480 var key = _v1.a; 14481 return key !== 'sig'; 14482 }, 14483 fields))); 14484 } else { 14485 return ''; 14486 } 14487}; 14488var $andrewMacmurray$elm_concurrent_task$ConcurrentTask$Internal$mapResponseError = F2( 14489 function (f, res) { 14490 switch (res.$) { 14491 case 0: 14492 var a = res.a; 14493 return $andrewMacmurray$elm_concurrent_task$ConcurrentTask$Internal$Success(a); 14494 case 1: 14495 var e = res.a; 14496 return $andrewMacmurray$elm_concurrent_task$ConcurrentTask$Internal$Error( 14497 f(e)); 14498 default: 14499 var e = res.a; 14500 return $andrewMacmurray$elm_concurrent_task$ConcurrentTask$Internal$UnexpectedError(e); 14501 } 14502 }); 14503var $andrewMacmurray$elm_concurrent_task$ConcurrentTask$Internal$mapError = F2( 14504 function (f, _v0) { 14505 var run = _v0; 14506 return F2( 14507 function (res, ids) { 14508 var _v1 = A2(run, res, ids); 14509 var ids_ = _v1.a; 14510 var task = _v1.b; 14511 return _Utils_Tuple2( 14512 ids_, 14513 function () { 14514 if (!task.$) { 14515 var defs = task.a; 14516 var next = task.b; 14517 return A2( 14518 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$Internal$Pending, 14519 defs, 14520 A2($andrewMacmurray$elm_concurrent_task$ConcurrentTask$Internal$mapError, f, next)); 14521 } else { 14522 var a = task.a; 14523 return $andrewMacmurray$elm_concurrent_task$ConcurrentTask$Internal$Done( 14524 A2($andrewMacmurray$elm_concurrent_task$ConcurrentTask$Internal$mapResponseError, f, a)); 14525 } 14526 }()); 14527 }); 14528 }); 14529var $andrewMacmurray$elm_concurrent_task$ConcurrentTask$mapError = $andrewMacmurray$elm_concurrent_task$ConcurrentTask$Internal$mapError; 14530var $author$project$WebCrypto$DecryptionFailed = function (a) { 14531 return {$: 1, a: a}; 14532}; 14533var $author$project$WebCrypto$EncryptionFailed = function (a) { 14534 return {$: 0, a: a}; 14535}; 14536var $author$project$WebCrypto$HashingFailed = function (a) { 14537 return {$: 7, a: a}; 14538}; 14539var $author$project$WebCrypto$InvalidKey = function (a) { 14540 return {$: 8, a: a}; 14541}; 14542var $author$project$WebCrypto$KeyExportFailed = function (a) { 14543 return {$: 4, a: a}; 14544}; 14545var $author$project$WebCrypto$KeyGenerationFailed = function (a) { 14546 return {$: 2, a: a}; 14547}; 14548var $author$project$WebCrypto$KeyImportFailed = function (a) { 14549 return {$: 3, a: a}; 14550}; 14551var $author$project$WebCrypto$SigningFailed = function (a) { 14552 return {$: 5, a: a}; 14553}; 14554var $author$project$WebCrypto$VerificationFailed = function (a) { 14555 return {$: 6, a: a}; 14556}; 14557var $author$project$WebCrypto$splitOnce = F2( 14558 function (sep, str) { 14559 var _v0 = A2($elm$core$String$indexes, sep, str); 14560 if (_v0.b) { 14561 var first = _v0.a; 14562 return $elm$core$Maybe$Just( 14563 _Utils_Tuple2( 14564 A2($elm$core$String$left, first, str), 14565 A2( 14566 $elm$core$String$dropLeft, 14567 first + $elm$core$String$length(sep), 14568 str))); 14569 } else { 14570 return $elm$core$Maybe$Nothing; 14571 } 14572 }); 14573var $author$project$WebCrypto$errorDecoder = A2( 14574 $elm$json$Json$Decode$andThen, 14575 function (err) { 14576 var _v0 = A2($author$project$WebCrypto$splitOnce, ':', err); 14577 _v0$10: 14578 while (true) { 14579 if (!_v0.$) { 14580 switch (_v0.a.a) { 14581 case 'ENCRYPTION_FAILED': 14582 var _v1 = _v0.a; 14583 var msg = _v1.b; 14584 return $elm$json$Json$Decode$succeed( 14585 $author$project$WebCrypto$EncryptionFailed(msg)); 14586 case 'DECRYPTION_FAILED': 14587 var _v2 = _v0.a; 14588 var msg = _v2.b; 14589 return $elm$json$Json$Decode$succeed( 14590 $author$project$WebCrypto$DecryptionFailed(msg)); 14591 case 'KEY_GENERATION_FAILED': 14592 var _v3 = _v0.a; 14593 var msg = _v3.b; 14594 return $elm$json$Json$Decode$succeed( 14595 $author$project$WebCrypto$KeyGenerationFailed(msg)); 14596 case 'KEY_IMPORT_FAILED': 14597 var _v4 = _v0.a; 14598 var msg = _v4.b; 14599 return $elm$json$Json$Decode$succeed( 14600 $author$project$WebCrypto$KeyImportFailed(msg)); 14601 case 'KEY_EXPORT_FAILED': 14602 var _v5 = _v0.a; 14603 var msg = _v5.b; 14604 return $elm$json$Json$Decode$succeed( 14605 $author$project$WebCrypto$KeyExportFailed(msg));
14606 case 'KEY_DERIVATION_FAILED': 14607 var _v6 = _v0.a; 14608 var msg = _v6.b; 14609 return $elm$json$Json$Decode$succeed( 14610 $author$project$WebCrypto$InvalidKey(msg)); 14611 case 'SIGNING_FAILED': 14612 var _v7 = _v0.a; 14613 var msg = _v7.b; 14614 return $elm$json$Json$Decode$succeed( 14615 $author$project$WebCrypto$SigningFailed(msg)); 14616 case 'VERIFICATION_FAILED': 14617 var _v8 = _v0.a; 14618 var msg = _v8.b; 14619 return $elm$json$Json$Decode$succeed( 14620 $author$project$WebCrypto$VerificationFailed(msg)); 14621 case 'HASHING_FAILED': 14622 var _v9 = _v0.a; 14623 var msg = _v9.b; 14624 return $elm$json$Json$Decode$succeed( 14625 $author$project$WebCrypto$HashingFailed(msg)); 14626 case 'INVALID_KEY': 14627 var _v10 = _v0.a; 14628 var msg = _v10.b; 14629 return $elm$json$Json$Decode$succeed( 14630 $author$project$WebCrypto$InvalidKey(msg)); 14631 default: 14632 break _v0$10; 14633 } 14634 } else { 14635 break _v0$10; 14636 } 14637 } 14638 return $elm$json$Json$Decode$fail('Unknown WebCrypto error: ' + err); 14639 }, 14640 $elm$json$Json$Decode$string); 14641var $andrewMacmurray$elm_concurrent_task$ConcurrentTask$expectString = $elm$json$Json$Decode$string; 14642var $author$project$WebCrypto$Signature$exportSigningKeyPair = function (_v0) { 14643 var skp = _v0; 14644 return skp; 14645}; 14646var $author$project$WebCrypto$Signature$signText = F2( 14647 function (skp, text) { 14648 var serialized = $author$project$WebCrypto$Signature$exportSigningKeyPair(skp); 14649 return $andrewMacmurray$elm_concurrent_task$ConcurrentTask$define( 14650 { 14651 k: $elm$json$Json$Encode$object( 14652 _List_fromArray( 14653 [ 14654 _Utils_Tuple2( 14655 'privateKeyJwk', 14656 $elm$json$Json$Encode$string(serialized.fh)), 14657 _Utils_Tuple2( 14658 'text', 14659 $elm$json$Json$Encode$string(text)) 14660 ])), 14661 l: $andrewMacmurray$elm_concurrent_task$ConcurrentTask$expectErrors($author$project$WebCrypto$errorDecoder), 14662 m: $andrewMacmurray$elm_concurrent_task$ConcurrentTask$expectString, 14663 n: 'webcrypto:sig:signText' 14664 }); 14665 }); 14666var $author$project$Domain$Group$encodeLink = function (link) { 14667 return $elm$json$Json$Encode$object( 14668 _List_fromArray( 14669 [ 14670 _Utils_Tuple2( 14671 'l', 14672 $elm$json$Json$Encode$string(link.i6)), 14673 _Utils_Tuple2( 14674 'u', 14675 $elm$json$Json$Encode$string(link.kS)) 14676 ])); 14677}; 14678var $author$project$Domain$Entry$encodeAttachments = function (attachments) { 14679 return $elm$core$List$isEmpty(attachments) ? $elm$core$Maybe$Nothing : $elm$core$Maybe$Just( 14680 _Utils_Tuple2( 14681 'att', 14682 A2($elm$json$Json$Encode$list, $author$project$Domain$Group$encodeLink, attachments))); 14683}; 14684var $author$project$Domain$Entry$encodeBeneficiary = function (beneficiary) { 14685 if (!beneficiary.$) { 14686 var data = beneficiary.a; 14687 return $elm$json$Json$Encode$object( 14688 _List_fromArray( 14689 [ 14690 _Utils_Tuple2( 14691 't', 14692 $elm$json$Json$Encode$string('share')), 14693 _Utils_Tuple2( 14694 'm', 14695 $elm$json$Json$Encode$string(data.e_)), 14696 _Utils_Tuple2( 14697 's', 14698 $elm$json$Json$Encode$int(data.qc)) 14699 ])); 14700 } else { 14701 var data = beneficiary.a; 14702 return $elm$json$Json$Encode$object( 14703 _List_fromArray( 14704 [ 14705 _Utils_Tuple2( 14706 't', 14707 $elm$json$Json$Encode$string('exact')), 14708 _Utils_Tuple2( 14709 'm', 14710 $elm$json$Json$Encode$string(data.e_)), 14711 _Utils_Tuple2( 14712 'a', 14713 $elm$json$Json$Encode$int(data.ef)) 14714 ])); 14715 } 14716}; 14717var $author$project$Domain$Entry$categoryToString = function (category) { 14718 switch (category) { 14719 case 0: 14720 return 'food'; 14721 case 1: 14722 return 'transport'; 14723 case 2: 14724 return 'accommodation'; 14725 case 3: 14726 return 'entertainment'; 14727 case 4: 14728 return 'shopping'; 14729 case 5: 14730 return 'groceries'; 14731 case 6: 14732 return 'utilities'; 14733 case 7: 14734 return 'healthcare'; 14735 default: 14736 return 'other'; 14737 } 14738}; 14739var $author$project$Domain$Entry$encodeCategory = function (category) { 14740 return $elm$json$Json$Encode$string( 14741 $author$project$Domain$Entry$categoryToString(category)); 14742}; 14743var $author$project$Domain$Date$encodeDate = function (date) { 14744 return $elm$json$Json$Encode$object( 14745 _List_fromArray( 14746 [ 14747 _Utils_Tuple2( 14748 'y', 14749 $elm$json$Json$Encode$int(date.C)), 14750 _Utils_Tuple2( 14751 'mo', 14752 $elm$json$Json$Encode$int(date.F)), 14753 _Utils_Tuple2( 14754 'dy', 14755 $elm$json$Json$Encode$int(date.y)) 14756 ])); 14757}; 14758var $author$project$Domain$Entry$encodePayer = function (payer) { 14759 return $elm$json$Json$Encode$object( 14760 _List_fromArray( 14761 [ 14762 _Utils_Tuple2( 14763 'm', 14764 $elm$json$Json$Encode$string(payer.e_)), 14765 _Utils_Tuple2( 14766 'a', 14767 $elm$json$Json$Encode$int(payer.ef)) 14768 ])); 14769}; 14770var $author$project$Domain$Entry$encodeExpenseData = function (data) { 14771 return $elm$json$Json$Encode$object( 14772 _Utils_ap( 14773 _List_fromArray( 14774 [ 14775 _Utils_Tuple2( 14776 'desc', 14777 $elm$json$Json$Encode$string(data.eE)), 14778 _Utils_Tuple2( 14779 'a', 14780 $elm$json$Json$Encode$int(data.ef)), 14781 _Utils_Tuple2( 14782 'cur', 14783 $author$project$Domain$Currency$encodeCurrency(data.bg)), 14784 _Utils_Tuple2( 14785 'dt', 14786 $author$project$Domain$Date$encodeDate(data.cj)), 14787 _Utils_Tuple2( 14788 'pay', 14789 A2($elm$json$Json$Encode$list, $author$project$Domain$Entry$encodePayer, data.jB)), 14790 _Utils_Tuple2( 14791 'ben', 14792 A2($elm$json$Json$Encode$list, $author$project$Domain$Entry$encodeBeneficiary, data.em)) 14793 ]), 14794 A2( 14795 $elm$core$List$filterMap, 14796 $elm$core$Basics$identity, 14797 _List_fromArray( 14798 [ 14799 A2( 14800 $elm$core$Maybe$map, 14801 function (v) { 14802 return _Utils_Tuple2( 14803 'dca', 14804 $elm$json$Json$Encode$int(v)); 14805 }, 14806 data.ck), 14807 A2( 14808 $elm$core$Maybe$map, 14809 function (v) { 14810 return _Utils_Tuple2( 14811 'cat', 14812 $author$project$Domain$Entry$encodeCategory(v)); 14813 }, 14814 data.h9), 14815 A2( 14816 $elm$core$Maybe$map, 14817 function (v) { 14818 return _Utils_Tuple2( 14819 'loc', 14820 $elm$json$Json$Encode$string(v)); 14821 }, 14822 data.je), 14823 A2( 14824 $elm$core$Maybe$map, 14825 function (v) { 14826 return _Utils_Tuple2( 14827 'nt', 14828 $elm$json$Json$Encode$string(v)); 14829 }, 14830 data.bu), 14831 $author$project$Domain$Entry$encodeAttachments(data.ce) 14832 ])))); 14833}; 14834var $author$project$Domain$Entry$encodeIncomeData = function (data) { 14835 return $elm$json$Json$Encode$object( 14836 _Utils_ap( 14837 _List_fromArray( 14838 [ 14839 _Utils_Tuple2( 14840 'desc', 14841 $elm$json$Json$Encode$string(data.eE)), 14842 _Utils_Tuple2( 14843 'a', 14844 $elm$json$Json$Encode$int(data.ef)), 14845 _Utils_Tuple2( 14846 'cur', 14847 $author$project$Domain$Currency$encodeCurrency(data.bg)), 14848 _Utils_Tuple2( 14849 'dt', 14850 $author$project$Domain$Date$encodeDate(data.cj)), 14851 _Utils_Tuple2( 14852 'rb', 14853 $elm$json$Json$Encode$string(data.j$)), 14854 _Utils_Tuple2( 14855 'ben', 14856 A2($elm$json$Json$Encode$list, $author$project$Domain$Entry$encodeBeneficiary, data.em)) 14857 ]), 14858 A2( 14859 $elm$core$List$filterMap, 14860 $elm$core$Basics$identity, 14861 _List_fromArray( 14862 [ 14863 A2( 14864 $elm$core$Maybe$map, 14865 function (v) { 14866 return _Utils_Tuple2( 14867 'dca', 14868 $elm$json$Json$Encode$int(v)); 14869 }, 14870 data.ck), 14871 A2( 14872 $elm$core$Maybe$map, 14873 function (v) { 14874 return _Utils_Tuple2( 14875 'nt', 14876 $elm$json$Json$Encode$string(v)); 14877 }, 14878 data.bu), 14879 $author$project$Domain$Entry$encodeAttachments(data.ce) 14880 ])))); 14881}; 14882var $author$project$Domain$Entry$encodeTransferData = function (data) { 14883 return $elm$json$Json$Encode$object( 14884 _Utils_ap( 14885 _List_fromArray( 14886 [ 14887 _Utils_Tuple2( 14888 'a', 14889 $elm$json$Json$Encode$int(data.ef)), 14890 _Utils_Tuple2( 14891 'cur', 14892 $author$project$Domain$Currency$encodeCurrency(data.bg)), 14893 _Utils_Tuple2( 14894 'dt', 14895 $author$project$Domain$Date$encodeDate(data.cj)), 14896 _Utils_Tuple2( 14897 'f',
14898 $elm$json$Json$Encode$string(data.iH)), 14899 _Utils_Tuple2( 14900 'to', 14901 $elm$json$Json$Encode$string(data.kE)) 14902 ]), 14903 A2( 14904 $elm$core$List$filterMap, 14905 $elm$core$Basics$identity, 14906 _List_fromArray( 14907 [ 14908 A2( 14909 $elm$core$Maybe$map, 14910 function (v) { 14911 return _Utils_Tuple2( 14912 'desc', 14913 $elm$json$Json$Encode$string(v)); 14914 }, 14915 data.eE), 14916 A2( 14917 $elm$core$Maybe$map, 14918 function (v) { 14919 return _Utils_Tuple2( 14920 'dca', 14921 $elm$json$Json$Encode$int(v)); 14922 }, 14923 data.ck), 14924 A2( 14925 $elm$core$Maybe$map, 14926 function (v) { 14927 return _Utils_Tuple2( 14928 'nt', 14929 $elm$json$Json$Encode$string(v)); 14930 }, 14931 data.bu), 14932 $author$project$Domain$Entry$encodeAttachments(data.ce) 14933 ])))); 14934}; 14935var $author$project$Domain$Entry$encodeKind = function (kind) { 14936 switch (kind.$) { 14937 case 0: 14938 var data = kind.a; 14939 return $elm$json$Json$Encode$object( 14940 _List_fromArray( 14941 [ 14942 _Utils_Tuple2( 14943 't', 14944 $elm$json$Json$Encode$string('expense')), 14945 _Utils_Tuple2( 14946 'd', 14947 $author$project$Domain$Entry$encodeExpenseData(data)) 14948 ])); 14949 case 1: 14950 var data = kind.a; 14951 return $elm$json$Json$Encode$object( 14952 _List_fromArray( 14953 [ 14954 _Utils_Tuple2( 14955 't', 14956 $elm$json$Json$Encode$string('transfer')), 14957 _Utils_Tuple2( 14958 'd', 14959 $author$project$Domain$Entry$encodeTransferData(data)) 14960 ])); 14961 default: 14962 var data = kind.a; 14963 return $elm$json$Json$Encode$object( 14964 _List_fromArray( 14965 [ 14966 _Utils_Tuple2( 14967 't', 14968 $elm$json$Json$Encode$string('income')), 14969 _Utils_Tuple2( 14970 'd', 14971 $author$project$Domain$Entry$encodeIncomeData(data)) 14972 ])); 14973 } 14974}; 14975var $author$project$Domain$Entry$encodeMetadata = function (meta) { 14976 return $elm$json$Json$Encode$object( 14977 _Utils_ap( 14978 _List_fromArray( 14979 [ 14980 _Utils_Tuple2( 14981 'id', 14982 $elm$json$Json$Encode$string(meta.m9)), 14983 _Utils_Tuple2( 14984 'r', 14985 $elm$json$Json$Encode$string(meta.aj)), 14986 _Utils_Tuple2( 14987 'dp', 14988 $elm$json$Json$Encode$int(meta.dg)), 14989 _Utils_Tuple2( 14990 'del', 14991 $elm$json$Json$Encode$bool(meta.gB)), 14992 _Utils_Tuple2( 14993 'cb', 14994 $elm$json$Json$Encode$string(meta.f3)), 14995 _Utils_Tuple2( 14996 'ca', 14997 $elm$json$Json$Encode$int( 14998 $elm$time$Time$posixToMillis(meta.f2))) 14999 ]), 15000 function () { 15001 var _v0 = meta.fg; 15002 if (!_v0.$) { 15003 var prevId = _v0.a; 15004 return _List_fromArray( 15005 [ 15006 _Utils_Tuple2( 15007 'pv', 15008 $elm$json$Json$Encode$string(prevId)) 15009 ]); 15010 } else { 15011 return _List_Nil; 15012 } 15013 }())); 15014}; 15015var $author$project$Domain$Entry$encodeEntry = function (entry) { 15016 return $elm$json$Json$Encode$object( 15017 _List_fromArray( 15018 [ 15019 _Utils_Tuple2( 15020 'm', 15021 $author$project$Domain$Entry$encodeMetadata(entry.gM)), 15022 _Utils_Tuple2( 15023 'k', 15024 $author$project$Domain$Entry$encodeKind(entry.gE)) 15025 ])); 15026}; 15027var $author$project$Domain$Event$encodeMaybeString = F2( 15028 function (fieldName, maybeValue) { 15029 if (maybeValue.$ === 1) { 15030 return _Utils_Tuple2(fieldName, $elm$json$Json$Encode$null); 15031 } else { 15032 var s = maybeValue.a; 15033 return _Utils_Tuple2( 15034 fieldName, 15035 $elm$json$Json$Encode$string(s)); 15036 } 15037 }); 15038var $author$project$Domain$Event$encodeGroupMetadataChange = function (change) { 15039 return $elm$json$Json$Encode$object( 15040 A2( 15041 $elm$core$List$filterMap, 15042 $elm$core$Basics$identity, 15043 _List_fromArray( 15044 [ 15045 A2( 15046 $elm$core$Maybe$map, 15047 function (v) { 15048 return _Utils_Tuple2( 15049 'n', 15050 $elm$json$Json$Encode$string(v)); 15051 }, 15052 change.bW), 15053 A2( 15054 $elm$core$Maybe$map, 15055 $author$project$Domain$Event$encodeMaybeString('sub'), 15056 change.cY), 15057 A2( 15058 $elm$core$Maybe$map, 15059 $author$project$Domain$Event$encodeMaybeString('desc'), 15060 change.eE), 15061 A2( 15062 $elm$core$Maybe$map, 15063 function (links) { 15064 return _Utils_Tuple2( 15065 'lk', 15066 A2($elm$json$Json$Encode$list, $author$project$Domain$Group$encodeLink, links)); 15067 }, 15068 change.cz) 15069 ]))); 15070}; 15071var $elm$json$Json$Encode$dict = F3( 15072 function (toKey, toValue, dictionary) { 15073 return _Json_wrap( 15074 A3( 15075 $elm$core$Dict$foldl, 15076 F3( 15077 function (key, value, obj) { 15078 return A3( 15079 _Json_addField, 15080 toKey(key), 15081 toValue(value), 15082 obj); 15083 }), 15084 _Json_emptyObject(0), 15085 dictionary)); 15086 }); 15087var $author$project$Domain$PaymentMethod$encode = A2($elm$json$Json$Encode$dict, $elm$core$Basics$identity, $elm$json$Json$Encode$string); 15088var $elm$core$Dict$isEmpty = function (dict) { 15089 if (dict.$ === -2) { 15090 return true; 15091 } else { 15092 return false;
15093 } 15094}; 15095var $author$project$Domain$Member$encodeMetadata = function (meta) { 15096 return $elm$json$Json$Encode$object( 15097 A2( 15098 $elm$core$List$filterMap, 15099 $elm$core$Basics$identity, 15100 _List_fromArray( 15101 [ 15102 A2( 15103 $elm$core$Maybe$map, 15104 function (v) { 15105 return _Utils_Tuple2( 15106 'ph', 15107 $elm$json$Json$Encode$string(v)); 15108 }, 15109 meta.jF), 15110 A2( 15111 $elm$core$Maybe$map, 15112 function (v) { 15113 return _Utils_Tuple2( 15114 'em', 15115 $elm$json$Json$Encode$string(v)); 15116 }, 15117 meta.is), 15118 $elm$core$Dict$isEmpty(meta.jD) ? $elm$core$Maybe$Nothing : $elm$core$Maybe$Just( 15119 _Utils_Tuple2( 15120 'pm', 15121 $author$project$Domain$PaymentMethod$encode(meta.jD))), 15122 A2( 15123 $elm$core$Maybe$map, 15124 function (v) { 15125 return _Utils_Tuple2( 15126 'nt', 15127 $elm$json$Json$Encode$string(v)); 15128 }, 15129 meta.bu) 15130 ]))); 15131}; 15132var $author$project$Domain$Member$encodeType = function (memberType) { 15133 return $elm$json$Json$Encode$string( 15134 function () { 15135 if (!memberType) { 15136 return 'real'; 15137 } else { 15138 return 'virtual'; 15139 } 15140 }()); 15141}; 15142var $author$project$Domain$Event$encodePayload = function (payload) { 15143 switch (payload.$) { 15144 case 0: 15145 return $elm$json$Json$Encode$null; 15146 case 1: 15147 var data = payload.a; 15148 return $elm$json$Json$Encode$object( 15149 _List_fromArray( 15150 [ 15151 _Utils_Tuple2( 15152 't', 15153 $elm$json$Json$Encode$string('mc')), 15154 _Utils_Tuple2( 15155 'm', 15156 $elm$json$Json$Encode$string(data.e_)), 15157 _Utils_Tuple2( 15158 'n', 15159 $elm$json$Json$Encode$string(data.bW)), 15160 _Utils_Tuple2( 15161 'mt', 15162 $author$project$Domain$Member$encodeType(data.nL)), 15163 _Utils_Tuple2( 15164 'ab', 15165 $elm$json$Json$Encode$string(data.fO)) 15166 ])); 15167 case 2: 15168 var data = payload.a; 15169 return $elm$json$Json$Encode$object( 15170 _List_fromArray( 15171 [ 15172 _Utils_Tuple2( 15173 't', 15174 $elm$json$Json$Encode$string('mr')), 15175 _Utils_Tuple2( 15176 'r', 15177 $elm$json$Json$Encode$string(data.aj)), 15178 _Utils_Tuple2( 15179 'on', 15180 $elm$json$Json$Encode$string(data.e6)), 15181 _Utils_Tuple2( 15182 'nn', 15183 $elm$json$Json$Encode$string(data.e4)) 15184 ])); 15185 case 3: 15186 var data = payload.a; 15187 return $elm$json$Json$Encode$object( 15188 _List_fromArray( 15189 [ 15190 _Utils_Tuple2( 15191 't', 15192 $elm$json$Json$Encode$string('mrt')), 15193 _Utils_Tuple2( 15194 'r', 15195 $elm$json$Json$Encode$string(data.aj)) 15196 ])); 15197 case 4: 15198 var data = payload.a; 15199 return $elm$json$Json$Encode$object( 15200 _List_fromArray( 15201 [ 15202 _Utils_Tuple2( 15203 't', 15204 $elm$json$Json$Encode$string('mur')), 15205 _Utils_Tuple2( 15206 'r', 15207 $elm$json$Json$Encode$string(data.aj)) 15208 ])); 15209 case 5: 15210 var data = payload.a; 15211 return $elm$json$Json$Encode$object( 15212 _List_fromArray( 15213 [ 15214 _Utils_Tuple2( 15215 't', 15216 $elm$json$Json$Encode$string('ml')), 15217 _Utils_Tuple2( 15218 'r', 15219 $elm$json$Json$Encode$string(data.aj)), 15220 _Utils_Tuple2( 15221 'd', 15222 $elm$json$Json$Encode$string(data.gd)), 15223 _Utils_Tuple2( 15224 'sq', 15225 $elm$json$Json$Encode$int(data.kg)) 15226 ])); 15227 case 6: 15228 var data = payload.a; 15229 return $elm$json$Json$Encode$object( 15230 _List_fromArray( 15231 [ 15232 _Utils_Tuple2( 15233 't', 15234 $elm$json$Json$Encode$string('mmu')), 15235 _Utils_Tuple2( 15236 'r', 15237 $elm$json$Json$Encode$string(data.aj)), 15238 _Utils_Tuple2( 15239 'md', 15240 $author$project$Domain$Member$encodeMetadata(data.ji)) 15241 ])); 15242 case 7: 15243 var entry = payload.a; 15244 return $elm$json$Json$Encode$object( 15245 _List_fromArray( 15246 [ 15247 _Utils_Tuple2( 15248 't', 15249 $elm$json$Json$Encode$string('ea')), 15250 _Utils_Tuple2( 15251 'e', 15252 $author$project$Domain$Entry$encodeEntry(entry)) 15253 ])); 15254 case 8: 15255 var entry = payload.a; 15256 return $elm$json$Json$Encode$object( 15257 _List_fromArray( 15258 [ 15259 _Utils_Tuple2( 15260 't', 15261 $elm$json$Json$Encode$string('em')), 15262 _Utils_Tuple2( 15263 'e', 15264 $author$project$Domain$Entry$encodeEntry(entry)) 15265 ])); 15266 case 9: 15267 var data = payload.a; 15268 return $elm$json$Json$Encode$object( 15269 _List_fromArray( 15270 [ 15271 _Utils_Tuple2( 15272 't', 15273 $elm$json$Json$Encode$string('ed')), 15274 _Utils_Tuple2( 15275 'r', 15276 $elm$json$Json$Encode$string(data.aj)) 15277 ])); 15278 case 10: 15279 var data = payload.a; 15280 return $elm$json$Json$Encode$object( 15281 _List_fromArray( 15282 [ 15283 _Utils_Tuple2( 15284 't', 15285 $elm$json$Json$Encode$string('eu')), 15286 _Utils_Tuple2( 15287 'r', 15288 $elm$json$Json$Encode$string(data.aj)) 15289 ])); 15290 case 11: 15291 var data = payload.a; 15292 return $elm$json$Json$Encode$object( 15293 _List_fromArray( 15294 [ 15295 _Utils_Tuple2( 15296 't', 15297 $elm$json$Json$Encode$string('gc')), 15298 _Utils_Tuple2( 15299 'n', 15300 $elm$json$Json$Encode$string(data.bW)), 15301 _Utils_Tuple2( 15302 'dc', 15303 $author$project$Domain$Currency$encodeCurrency(data.il)) 15304 ])); 15305 case 12: 15306 var change = payload.a; 15307 return $elm$json$Json$Encode$object( 15308 _List_fromArray( 15309 [ 15310 _Utils_Tuple2( 15311 't', 15312 $elm$json$Json$Encode$string('gmu')), 15313 _Utils_Tuple2( 15314 'c',
15315 $author$project$Domain$Event$encodeGroupMetadataChange(change)) 15316 ])); 15317 case 13: 15318 var data = payload.a; 15319 return $elm$json$Json$Encode$object( 15320 _List_fromArray( 15321 [ 15322 _Utils_Tuple2( 15323 't', 15324 $elm$json$Json$Encode$string('spu')), 15325 _Utils_Tuple2( 15326 'mr', 15327 $elm$json$Json$Encode$string(data.e$)), 15328 _Utils_Tuple2( 15329 'pr', 15330 A2($elm$json$Json$Encode$list, $elm$json$Json$Encode$string, data.pB)) 15331 ])); 15332 case 14: 15333 var data = payload.a; 15334 return $elm$json$Json$Encode$object( 15335 _List_fromArray( 15336 [ 15337 _Utils_Tuple2( 15338 't', 15339 $elm$json$Json$Encode$string('cp')), 15340 _Utils_Tuple2( 15341 'u', 15342 $elm$json$Json$Encode$string(data.hx)), 15343 _Utils_Tuple2( 15344 'n', 15345 $elm$json$Json$Encode$int(data.bK)), 15346 _Utils_Tuple2( 15347 'h', 15348 $elm$json$Json$Encode$string(data.gI)) 15349 ])); 15350 default: 15351 var data = payload.a; 15352 return $elm$json$Json$Encode$object( 15353 _List_fromArray( 15354 [ 15355 _Utils_Tuple2( 15356 't', 15357 $elm$json$Json$Encode$string('ca')), 15358 _Utils_Tuple2( 15359 'pid', 15360 $elm$json$Json$Encode$string(data.cN)) 15361 ])); 15362 } 15363}; 15364var $author$project$Domain$Event$refreshRaw = function (envelope) { 15365 return _Utils_update( 15366 envelope, 15367 { 15368 jZ: $elm$json$Json$Encode$object( 15369 _Utils_ap( 15370 _List_fromArray( 15371 [ 15372 _Utils_Tuple2( 15373 'id', 15374 $elm$json$Json$Encode$string(envelope.m9)), 15375 _Utils_Tuple2( 15376 'ts', 15377 $elm$json$Json$Encode$int( 15378 $elm$time$Time$posixToMillis(envelope.lT))), 15379 _Utils_Tuple2( 15380 'by', 15381 $elm$json$Json$Encode$string(envelope.q0)), 15382 _Utils_Tuple2( 15383 'v', 15384 $elm$json$Json$Encode$int(envelope.fK)) 15385 ]), 15386 _Utils_ap( 15387 function () { 15388 var _v0 = envelope.ej; 15389 if (!_v0.$) { 15390 var publicKey = _v0.a; 15391 return _List_fromArray( 15392 [ 15393 _Utils_Tuple2( 15394 'key', 15395 $elm$json$Json$Encode$string(publicKey)) 15396 ]); 15397 } else { 15398 return _List_Nil; 15399 } 15400 }(), 15401 _List_fromArray( 15402 [ 15403 _Utils_Tuple2( 15404 'p', 15405 $author$project$Domain$Event$encodePayload(envelope.jC)), 15406 _Utils_Tuple2( 15407 'sig', 15408 $elm$json$Json$Encode$string(envelope.dU)) 15409 ])))) 15410 }); 15411}; 15412var $author$project$Domain$Event$withSignature = F2( 15413 function (signature, envelope) { 15414 return $author$project$Domain$Event$refreshRaw( 15415 _Utils_update( 15416 envelope, 15417 {dU: signature})); 15418 }); 15419var $author$project$GroupOps$signEnvelope = F2( 15420 function (signingKeyPair, envelope) { 15421 return A2( 15422 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$map, 15423 function (sig) { 15424 return A2($author$project$Domain$Event$withSignature, sig, envelope); 15425 }, 15426 A2( 15427 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$mapError, 15428 function (_v0) { 15429 return $author$project$IndexedDb$DatabaseError('Signing failed'); 15430 }, 15431 A2( 15432 $author$project$WebCrypto$Signature$signText, 15433 signingKeyPair, 15434 $author$project$Domain$Event$canonicalize(envelope)))); 15435 }); 15436var $elm$core$Dict$filter = F2( 15437 function (isGood, dict) { 15438 return A3( 15439 $elm$core$Dict$foldl, 15440 F3( 15441 function (k, v, d) { 15442 return A2(isGood, k, v) ? A3($elm$core$Dict$insert, k, v, d) : d; 15443 }), 15444 $elm$core$Dict$empty, 15445 dict); 15446 }); 15447var $elm$core$Dict$sizeHelp = F2( 15448 function (n, dict) { 15449 sizeHelp: 15450 while (true) { 15451 if (dict.$ === -2) { 15452 return n; 15453 } else { 15454 var left = dict.d; 15455 var right = dict.e; 15456 var $temp$n = A2($elm$core$Dict$sizeHelp, n + 1, right), 15457 $temp$dict = left; 15458 n = $temp$n; 15459 dict = $temp$dict; 15460 continue sizeHelp; 15461 } 15462 } 15463 }); 15464var $elm$core$Dict$size = function (dict) { 15465 return A2($elm$core$Dict$sizeHelp, 0, dict); 15466}; 15467var $author$project$Domain$GroupState$summarize = F4( 15468 function (memberId, groupId, lastSyncedAt, state) { 15469 return { 15470 f2: state.iO.f2, 15471 il: state.iO.il, 15472 m9: groupId, 15473 gA: false, 15474 gC: true, 15475 gF: lastSyncedAt, 15476 gL: $elm$core$Dict$size( 15477 A2( 15478 $elm$core$Dict$filter, 15479 F2( 15480 function (_v0, m) { 15481 return !m.nt; 15482 }), 15483 state.r)), 15484 gS: A2( 15485 $elm$core$Maybe$withDefault, 15486 0, 15487 A2( 15488 $elm$core$Maybe$map, 15489 function ($) { 15490 return $.e2; 15491 }, 15492 A2( 15493 $elm$core$Maybe$andThen, 15494 function (rootId) { 15495 return A2($elm$core$Dict$get, rootId, state.ly); 15496 }, 15497 A2($author$project$Domain$GroupState$resolveMemberRootId, state, memberId)))), 15498 bW: state.iO.bW 15499 }; 15500 }); 15501var $TSFoster$elm_uuid$UUID$UUID = F4( 15502 function (a, b, c, d) {
15503 return {$: 0, a: a, b: b, c: c, d: d}; 15504 }); 15505var $TSFoster$elm_uuid$UUID$forceUnsigned = $elm$core$Bitwise$shiftRightZfBy(0); 15506var $elm$core$Basics$modBy = _Basics_modBy; 15507var $elm$random$Random$maxInt = 2147483647; 15508var $elm$random$Random$minInt = -2147483648; 15509var $TSFoster$elm_uuid$UUID$randomU32 = A2( 15510 $elm$random$Random$map, 15511 $TSFoster$elm_uuid$UUID$forceUnsigned, 15512 A2($elm$random$Random$int, $elm$random$Random$minInt, $elm$random$Random$maxInt)); 15513var $TSFoster$elm_uuid$UUID$toVariant1 = function (_v0) { 15514 var a = _v0.a; 15515 var b = _v0.b; 15516 var c = _v0.c; 15517 var d = _v0.d; 15518 return A4( 15519 $TSFoster$elm_uuid$UUID$UUID, 15520 a, 15521 b, 15522 $TSFoster$elm_uuid$UUID$forceUnsigned(2147483648 | (1073741823 & c)), 15523 d); 15524}; 15525var $TSFoster$elm_uuid$UUID$toVersion = F2( 15526 function (v, _v0) { 15527 var a = _v0.a; 15528 var b = _v0.b; 15529 var c = _v0.c; 15530 var d = _v0.d; 15531 return A4( 15532 $TSFoster$elm_uuid$UUID$UUID, 15533 a, 15534 $TSFoster$elm_uuid$UUID$forceUnsigned((v << 12) | (4294905855 & b)), 15535 c, 15536 d); 15537 }); 15538var $TSFoster$elm_uuid$UUID$stepV7 = F2( 15539 function (posix, _v0) { 15540 var seed = _v0.a; 15541 var previousPosix = _v0.b; 15542 var previousCounter = _v0.c; 15543 var previousMillis = $elm$time$Time$posixToMillis(previousPosix); 15544 var millis = $elm$time$Time$posixToMillis(posix); 15545 var counter = _Utils_eq(millis, previousMillis) ? previousCounter : 0; 15546 var randA = 4095 & counter; 15547 var bUpper = $TSFoster$elm_uuid$UUID$forceUnsigned( 15548 A2($elm$core$Basics$modBy, 65536, millis) << 16); 15549 var b = $TSFoster$elm_uuid$UUID$forceUnsigned(bUpper | randA); 15550 var a = $TSFoster$elm_uuid$UUID$forceUnsigned((millis / 65536) | 0); 15551 var _v1 = A2($elm$random$Random$step, $TSFoster$elm_uuid$UUID$randomU32, seed); 15552 var randInt1 = _v1.a; 15553 var seed1 = _v1.b; 15554 var _v2 = A2($elm$random$Random$step, $TSFoster$elm_uuid$UUID$randomU32, seed1); 15555 var randInt2 = _v2.a; 15556 var seed2 = _v2.b; 15557 var uuid = $TSFoster$elm_uuid$UUID$toVariant1( 15558 A2( 15559 $TSFoster$elm_uuid$UUID$toVersion, 15560 7, 15561 A4($TSFoster$elm_uuid$UUID$UUID, a, b, randInt1, randInt2))); 15562 return _Utils_Tuple2( 15563 uuid, 15564 A3($TSFoster$elm_uuid$UUID$V7State, seed2, posix, counter + 1)); 15565 }); 15566var $elm$core$String$fromList = _String_fromList; 15567var $TSFoster$elm_uuid$UUID$toHex = F2( 15568 function (acc, _int) { 15569 toHex: 15570 while (true) { 15571 if (!_int) { 15572 return $elm$core$String$fromList(acc); 15573 } else { 15574 var _char = function () { 15575 var _v0 = 15 & _int; 15576 switch (_v0) { 15577 case 0: 15578 return '0'; 15579 case 1: 15580 return '1'; 15581 case 2: 15582 return '2'; 15583 case 3: 15584 return '3'; 15585 case 4: 15586 return '4'; 15587 case 5: 15588 return '5'; 15589 case 6: 15590 return '6'; 15591 case 7: 15592 return '7'; 15593 case 8: 15594 return '8'; 15595 case 9: 15596 return '9'; 15597 case 10: 15598 return 'a'; 15599 case 11: 15600 return 'b'; 15601 case 12: 15602 return 'c'; 15603 case 13: 15604 return 'd'; 15605 case 14: 15606 return 'e'; 15607 default: 15608 return 'f'; 15609 } 15610 }(); 15611 var $temp$acc = A2($elm$core$List$cons, _char, acc), 15612 $temp$int = _int >>> 4; 15613 acc = $temp$acc; 15614 _int = $temp$int; 15615 continue toHex; 15616 } 15617 } 15618 }); 15619var $TSFoster$elm_uuid$UUID$toStringWith = F2( 15620 function (sep, _v0) { 15621 var a = _v0.a; 15622 var b = _v0.b; 15623 var c = _v0.c; 15624 var d = _v0.d; 15625 return _Utils_ap( 15626 A3( 15627 $elm$core$String$padLeft, 15628 8, 15629 '0', 15630 A2($TSFoster$elm_uuid$UUID$toHex, _List_Nil, a)), 15631 _Utils_ap( 15632 sep, 15633 _Utils_ap( 15634 A3( 15635 $elm$core$String$padLeft, 15636 4, 15637 '0', 15638 A2($TSFoster$elm_uuid$UUID$toHex, _List_Nil, b >>> 16)), 15639 _Utils_ap( 15640 sep, 15641 _Utils_ap( 15642 A3( 15643 $elm$core$String$padLeft, 15644 4, 15645 '0', 15646 A2($TSFoster$elm_uuid$UUID$toHex, _List_Nil, 65535 & b)), 15647 _Utils_ap( 15648 sep, 15649 _Utils_ap( 15650 A3( 15651 $elm$core$String$padLeft, 15652 4, 15653 '0', 15654 A2($TSFoster$elm_uuid$UUID$toHex, _List_Nil, c >>> 16)), 15655 _Utils_ap( 15656 sep, 15657 _Utils_ap( 15658 A3( 15659 $elm$core$String$padLeft, 15660 4, 15661 '0', 15662 A2($TSFoster$elm_uuid$UUID$toHex, _List_Nil, 65535 & c)), 15663 A3( 15664 $elm$core$String$padLeft, 15665 8, 15666 '0', 15667 A2($TSFoster$elm_uuid$UUID$toHex, _List_Nil, d))))))))))); 15668 }); 15669var $TSFoster$elm_uuid$UUID$toString = $TSFoster$elm_uuid$UUID$toStringWith('-'); 15670var $author$project$Infra$IdGen$v7 = F2( 15671 function (time, _v0) { 15672 var state = _v0; 15673 var _v1 = A2($TSFoster$elm_uuid$UUID$stepV7, time, state.hz); 15674 var uuid = _v1.a; 15675 var nextV7State = _v1.b; 15676 return _Utils_Tuple2( 15677 $TSFoster$elm_uuid$UUID$toString(uuid), 15678 _Utils_update( 15679 state, 15680 {hz: nextV7State})); 15681 }); 15682var $author$project$Domain$Event$currentVersion = 1; 15683var $author$project$Domain$Event$introducesAuthorKey = F2( 15684 function (authorId, payload) { 15685 switch (payload.$) { 15686 case 1: 15687 var data = payload.a; 15688 return _Utils_eq(data.e_, authorId); 15689 case 5: 15690 var data = payload.a; 15691 return _Utils_eq(data.gd, authorId); 15692 default: 15693 return false;
15694 } 15695 }); 15696var $author$project$Domain$Event$wrap = F5( 15697 function (eventId, clientTimestamp, author, payload, signature) { 15698 return $author$project$Domain$Event$refreshRaw( 15699 { 15700 ej: ((author.jO !== '') && A2($author$project$Domain$Event$introducesAuthorKey, author.m9, payload)) ? $elm$core$Maybe$Just(author.jO) : $elm$core$Maybe$Nothing, 15701 lT: clientTimestamp, 15702 m9: eventId, 15703 jC: payload, 15704 jZ: $elm$json$Json$Encode$null, 15705 dU: signature, 15706 q0: author.m9, 15707 fK: $author$project$Domain$Event$currentVersion 15708 }); 15709 }); 15710var $author$project$GroupOps$acceptInvitation = F3( 15711 function (ctx, onComplete, input) { 15712 var groupState = A2($author$project$Domain$GroupState$applyEvents, input.iC, $author$project$Domain$GroupState$empty); 15713 var taskFor = F2( 15714 function (payload, eventId) { 15715 var signingKeyPair = $author$project$WebCrypto$Signature$importSigningKeyPair(ctx.O.dV); 15716 var newestFirst = $elm$core$List$reverse( 15717 $author$project$Domain$Event$sortEvents(input.iC)); 15718 return A2( 15719 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$andThen, 15720 function (membershipEvent) { 15721 var finalState = A2( 15722 $author$project$Domain$GroupState$applyEvents, 15723 _List_fromArray( 15724 [membershipEvent]), 15725 groupState); 15726 var summary = A4($author$project$Domain$GroupState$summarize, ctx.O.aK, input.ct, ctx.ap, finalState); 15727 return A2( 15728 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$map, 15729 function (_v2) { 15730 return summary; 15731 }, 15732 A7( 15733 $author$project$Infra$Storage$saveJoinedGroup, 15734 ctx.de, 15735 summary, 15736 $author$project$WebCrypto$Symmetric$exportKey(input.gs), 15737 input.iC, 15738 input.bC, 15739 membershipEvent, 15740 input.cZ)); 15741 }, 15742 A2( 15743 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$andThen, 15744 $author$project$GroupOps$signEnvelope(signingKeyPair), 15745 A2( 15746 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$map, 15747 function (now) { 15748 return A5( 15749 $author$project$Domain$Event$wrap, 15750 eventId, 15751 A2($author$project$GroupOps$clampAfterLatest, newestFirst, now), 15752 $author$project$GroupOps$author(ctx), 15753 payload, 15754 ''); 15755 }, 15756 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$Time$now))); 15757 }); 15758 var _v0 = A4($author$project$GroupOps$joinPayload, ctx.O.aK, input.k5, input.n0, groupState); 15759 if (!_v0.$) { 15760 var payload = _v0.a; 15761 var _v1 = A2($author$project$Infra$IdGen$v7, ctx.ap, ctx.s); 15762 var eventId = _v1.a; 15763 var idStateAfter = _v1.b; 15764 return A2( 15765 $elm$core$Tuple$mapFirst, 15766 function (runner) { 15767 return {s: idStateAfter, ak: runner}; 15768 }, 15769 A3( 15770 $author$project$Infra$ConcurrentTaskExtra$andRun, 15771 onComplete, 15772 A2(taskFor, payload, eventId), 15773 _Utils_Tuple2(ctx.ak, $elm$core$Platform$Cmd$none))); 15774 } else { 15775 return A2( 15776 $elm$core$Tuple$mapFirst, 15777 function (runner) { 15778 return {s: ctx.s, ak: runner}; 15779 }, 15780 A3( 15781 $author$project$Infra$ConcurrentTaskExtra$andRun, 15782 onComplete, 15783 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$fail( 15784 $author$project$IndexedDb$DatabaseError('Invalid member claim')), 15785 _Utils_Tuple2(ctx.ak, $elm$core$Platform$Cmd$none))); 15786 } 15787 }); 15788var $author$project$Page$JoinGroup$ShowingPreview = function (a) { 15789 return {$: 1, a: a}; 15790}; 15791var $author$project$Page$JoinGroup$acceptanceFailed = function (model) { 15792 if (model.$ === 2) { 15793 var preview = model.a; 15794 return $author$project$Page$JoinGroup$ShowingPreview(preview); 15795 } else { 15796 return model; 15797 } 15798}; 15799var $author$project$Main$activeGroupRoute = function (route) { 15800 if (route.$ === 6) { 15801 var groupId = route.a; 15802 return $elm$core$Maybe$Just(groupId); 15803 } else { 15804 return $elm$core$Maybe$Nothing; 15805 } 15806}; 15807var $author$project$Update$addCmd = F2( 15808 function (newCmd, _v0) { 15809 var model = _v0.a; 15810 var cmd = _v0.b; 15811 return _Utils_Tuple2( 15812 model, 15813 $elm$core$Platform$Cmd$batch( 15814 _List_fromArray( 15815 [cmd, newCmd]))); 15816 }); 15817var $author$project$Main$DismissToast = function (a) { 15818 return {$: 43, a: a}; 15819}; 15820var $elm$core$Process$sleep = _Process_sleep; 15821var $author$project$UI$Toast$push = F4( 15822 function (dismissMsg, level, message, model) { 15823 var toast = {m9: model.cG, gG: level, dv: message}; 15824 var durationMs = function () { 15825 if (level === 1) { 15826 return 6000; 15827 } else { 15828 return 4000; 15829 } 15830 }(); 15831 var cmd = A2( 15832 $elm$core$Task$perform, 15833 function (_v0) { 15834 return dismissMsg(model.cG); 15835 }, 15836 $elm$core$Process$sleep(durationMs)); 15837 return _Utils_Tuple2( 15838 { 15839 cG: model.cG + 1, 15840 b8: _Utils_ap( 15841 model.b8, 15842 _List_fromArray( 15843 [toast])) 15844 }, 15845 cmd); 15846 }); 15847var $author$project$Main$addToast = F3( 15848 function (level, message, model) { 15849 return A2( 15850 $elm$core$Tuple$mapFirst, 15851 function (toast) { 15852 return _Utils_update( 15853 model, 15854 {b7: toast}); 15855 }, 15856 A4($author$project$UI$Toast$push, $author$project$Main$DismissToast, level, message, model.b7)); 15857 }); 15858var $andrewMacmurray$elm_concurrent_task$ConcurrentTask$andThenD
15858o = F2( 15859 function (t2, t1) { 15860 return A2( 15861 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$andThen, 15862 function (_v0) { 15863 return t2; 15864 }, 15865 t1); 15866 }); 15867var $author$project$Page$Receive$applied = F2( 15868 function (result, _v0) { 15869 var data = _v0; 15870 return _Utils_update( 15871 data, 15872 { 15873 be: false, 15874 gi: $elm$core$Maybe$Nothing, 15875 dI: $elm$core$Maybe$Just(result) 15876 }); 15877 }); 15878var $author$project$Page$Receive$ApplyFailed = function (a) { 15879 return {$: 1, a: a}; 15880}; 15881var $author$project$Page$Receive$applyFailed = F2( 15882 function (reason, _v0) { 15883 var data = _v0; 15884 return _Utils_update( 15885 data, 15886 { 15887 be: false, 15888 gi: $elm$core$Maybe$Just( 15889 $author$project$Page$Receive$ApplyFailed(reason)) 15890 }); 15891 }); 15892var $author$project$Translations$load = F2( 15893 function (lang, _v0) { 15894 return $author$project$Translations$init(lang); 15895 }); 15896var $author$project$Main$applyLanguage = F2( 15897 function (language, model) { 15898 return _Utils_Tuple2( 15899 _Utils_update( 15900 model, 15901 { 15902 aJ: A2($author$project$Translations$load, language, model.aJ) 15903 }), 15904 $author$project$Main$setDocumentLang( 15905 $author$project$Translations$languageToString(language))); 15906 }); 15907var $author$project$Main$navCmd = _Platform_outgoingPort('navCmd', $elm$core$Basics$identity); 15908var $lydell$elm_app_url$Escape$Fragment = 2; 15909var $elm$core$String$foldr = _String_foldr; 15910var $lydell$elm_app_url$Escape$forPath = function (_char) { 15911 switch (_char) { 15912 case '/': 15913 return '%2F'; 15914 case '?': 15915 return '%3F'; 15916 case '#': 15917 return '%23'; 15918 default: 15919 return $elm$core$String$fromChar(_char); 15920 } 15921}; 15922var $lydell$elm_app_url$Escape$forQuery = function (_char) { 15923 switch (_char) { 15924 case '=': 15925 return '%3D'; 15926 case '&': 15927 return '%26'; 15928 case '#': 15929 return '%23'; 15930 default: 15931 return $elm$core$String$fromChar(_char); 15932 } 15933}; 15934var $lydell$elm_app_url$Escape$escapePart = function (part) { 15935 switch (part) { 15936 case 0: 15937 return $lydell$elm_app_url$Escape$forPath; 15938 case 1: 15939 return $lydell$elm_app_url$Escape$forQuery; 15940 default: 15941 return $elm$core$String$fromChar; 15942 } 15943}; 15944var $lydell$elm_app_url$Escape$shouldHandlePlusAndSpace = function (part) { 15945 switch (part) { 15946 case 0: 15947 return false; 15948 case 1: 15949 return true; 15950 default: 15951 return false; 15952 } 15953}; 15954var $lydell$elm_app_url$Escape$forAll = F2( 15955 function (part, _char) { 15956 switch (_char) { 15957 case '\u0000': 15958 return '%00'; 15959 case '\u0001': 15960 return '%01'; 15961 case '\u0002': 15962 return '%02'; 15963 case '\u0003': 15964 return '%03'; 15965 case '\u0004': 15966 return '%04'; 15967 case '\u0005': 15968 return '%05'; 15969 case '\u0006': 15970 return '%06'; 15971 case '\u0007': 15972 return '%07'; 15973 case '\u0008': 15974 return '%08'; 15975 case '\t': 15976 return '%09'; 15977 case '\n': 15978 return '%0A'; 15979 case '\u000B': 15980 return '%0B'; 15981 case '\u000C': 15982 return '%0C'; 15983 case '\u000D': 15984 return '%0D'; 15985 case '\u000E': 15986 return '%0E'; 15987 case '\u000F': 15988 return '%0F'; 15989 case '\u0010': 15990 return '%10'; 15991 case '\u0011': 15992 return '%11'; 15993 case '\u0012': 15994 return '%12'; 15995 case '\u0013': 15996 return '%13'; 15997 case '\u0014': 15998 return '%14'; 15999 case '\u0015': 16000 return '%15'; 16001 case '\u0016': 16002 return '%16'; 16003 case '\u0017': 16004 return '%17'; 16005 case '\u0018': 16006 return '%18'; 16007 case '\u0019': 16008 return '%19'; 16009 case '\u001A': 16010 return '%1A'; 16011 case '\u001B': 16012 return '%1B'; 16013 case '\u001C': 16014 return '%1C'; 16015 case '\u001D': 16016 return '%1D'; 16017 case '\u001E': 16018 return '%1E'; 16019 case '\u001F': 16020 return '%1F'; 16021 case ' ': 16022 return $lydell$elm_app_url$Escape$shouldHandlePlusAndSpace(part) ? '+' : '%20'; 16023 case '%': 16024 return '%25'; 16025 case '+': 16026 return $lydell$elm_app_url$Escape$shouldHandlePlusAndSpace(part) ? '%2B' : '+'; 16027 case '\u00A0': 16028 return '%C2%A0'; 16029 case '\u1680': 16030 return '%E1%9A%80'; 16031 case '\u2000': 16032 return '%E2%80%80'; 16033 case '\u2001': 16034 return '%E2%80%81'; 16035 case '\u2002': 16036 return '%E2%80%82'; 16037 case '\u2003': 16038 return '%E2%80%83'; 16039 case '\u2004': 16040 return '%E2%80%84'; 16041 case '\u2005': 16042 return '%E2%80%85'; 16043 case '\u2006': 16044 return '%E2%80%86'; 16045 case '\u2007': 16046 return '%E2%80%87'; 16047 case '\u2008': 16048 return '%E2%80%88'; 16049 case '\u2009': 16050 return '%E2%80%89'; 16051 case '\u200A': 16052 return '%E2%80%8A'; 16053 case '\u2028': 16054 return '%E2%80%A8'; 16055 case '\u2029': 16056 return '%E2%80%A9'; 16057 case '\u202F': 16058 return '%E2%80%AF'; 16059 case '\u205F': 16060 return '%E2%81%9F'; 16061 case '\u3000': 16062 return '%E3%80%80'; 16063 case '\uFEFF': 16064 return '%EF%BB%BF'; 16065 default: 16066 return A2($lydell$elm_app_url$Escape$escapePart, part, _char); 16067 } 16068 }); 16069var $lydell$elm_app_url$AppUrl$percentEncode = F2( 16070 function (part, string) { 16071 return A3( 16072 $elm$core$String$foldr, 16073 F2( 16074 function (_char, acc) { 16075 return _Utils_ap( 16076 A2($lydell$elm_app_url$Escape$forAll, part, _char), 16077 acc); 16078 }), 16079 '', 16080 string); 16081 }); 16082var $lydell$elm_app_url$AppUrl$fragmentToString = function (maybeFragment) { 16083 if (!maybeFragment.$) { 16084 var fragment = maybeFragment.a; 16085 return '#' + A2($lydell$elm_app_url$AppUrl$percentEncode, 2, fragment); 16086 } else { 16087 return ''; 16088 } 16089}; 16090var $lydell$elm_app_url$Escape$Path = 0; 16091var $lydell$elm_app_url$AppUrl$pathToString = function (path) { 16092 return '/' + A2( 16093 $elm$core$String$join, 16094 '/', 16095 A2( 16096 $elm$core$List$map, 16097 $lydell$elm_app_url$AppUrl$percentEncode(0), 16098 path)); 16099}; 16100var $elm$core$List$concatMap = F2( 16101 function (f, list) { 16102 return $elm$core$List$concat( 16103 A2($elm$core$List$map, f, list)); 16104 }); 16105var $lydell$elm_app_url$Escape$Query = 1; 16106var $lydell$elm_app_url$AppUrl$queryParameterToString = function (_v0) { 16107 var key = _v0.a; 16108 var values = _v0.b; 16109 return A2( 16110 $elm$core$List$map, 16111 function (value) { 16112 return ((!$elm$core$String$isEmpty(key)) && $elm$core$String$isEmpty(value)) ? A2($lydell$elm_app_url$AppUrl$percentEncode, 1, key) : (A2($lydell$elm_app_url$AppUrl$percentEncode, 1, key) + ('=' + A2($lydell$elm_app_url$AppUrl$percentEncode, 1, value))); 16113 }, 16114 values); 16115}; 16116var $lydell$elm_app_url$AppUrl$queryParametersToString = function (queryParameters) { 16117 var filteredQueryParameters = A2( 16118 $elm$core$Dict$filter, 16119 F2( 16120 function (_v0, values) { 16121 return !$elm$core$List$isEmpty(values); 16122 }), 16123 queryParameters); 16124 return $elm$core$Dict$isEmpty(filteredQueryParameters) ? '' : ('?' + A2( 16125 $elm$core$String$join, 16126 '&', 16127 A2( 16128 $elm$core$List$concatMap, 16129 $lydell$elm_app_url$AppUrl$queryParameterToString, 16130 $elm$core$Dict$toList(filteredQueryParameters)))); 16131}; 16132var $lydell$elm_app_url$AppUrl$toString = function (url) { 16133 return _Utils_ap( 16134 $lydell$elm_app_url$AppUrl$pathToString(url.fb), 16135 _Utils_ap( 16136 $lydell$elm_app_url$AppUrl$queryParametersToString(url.fj), 16137 $lydell$elm_app_url$AppUrl$fragmentToString(url.dh))); 16138}; 16139var $mpizenberg$elm_url_navigation_port$Navigation$replaceUrl = F2( 16140 function (port_, appUrl) { 16141 return port_( 16142 $elm$json$Json$Encode$object( 16143 _List_fromArray( 16144 [ 16145 _Utils_Tuple2( 16146 'tag', 16147 $elm$json$Json$Encode$string('replaceUrl')), 16148 _Utils_Tuple2( 16149 'url', 16150 $elm$json$Json$Encode$string( 16151 $lydell$elm_app_url$AppUrl$toString(appUrl))) 16152 ]))); 16153 }); 16154var $author$project$Route$joinFragment = function (invite) { 16155 var _v0 = invite.ky; 16156 if (!_v0.$) { 16157 var tail = _v0.a; 16158 return invite.i4 + ('.' + tail); 16159 } else { 16160 return invite.i4; 16161 } 16162}; 16163var $author$project$Route$toPathSegments = function (route) { 16164 switch (route.$) { 16165 case 0: 16166 return _List_fromArray( 16167 ['groups']); 16168 case 1: 16169 return _List_fromArray( 16170 ['groups']); 16171 case 2: 16172 return _List_fromArray( 16173 ['groups', 'new']); 16174 case 3: 16175 return _List_fromArray( 16176 ['groups', 'import-splitwise']); 16177 case 4: 16178 return _List_fromArray( 16179 ['move']); 16180 case 5: 16181 return _List_fromArray( 16182 ['migrate']); 16183 case 6: 16184 switch (route.b.$) { 16185 case 0: 16186 var groupId = route.a; 16187 return _List_fromArray( 16188 ['join', groupId]); 16189 case 2: 16190 var groupId = route.a; 16191 return _List_fromArray( 16192 ['groups', groupId, 'entries']); 16193 case 1: 16194 switch (route.b.a) { 16195 case 0: 16196 var groupId = route.a; 16197 var _v1 = route.b.a; 16198 return _List_fromArray( 16199 ['groups', groupId]); 16200 case 1: 16201 var groupId = route.a; 16202 var _v2 = route.b.a; 16203 return _List_fromArray( 16204 ['groups', groupId, 'entries']); 16205 case 2: 16206 var groupId = route.a; 16207 var _v3 = route.b.a; 16208 return _List_fromArray( 16209 ['groups', groupId, 'members']); 16210 default: 16211 var groupId = route.a; 16212 var _v4 = route.b.a; 16213 return _List_fromArray( 16214 ['groups', groupId, 'activity']); 16215 } 16216 case 3: 16217 var groupId = route.a; 16218 var _v5 = route.b; 16219 return _List_fromArray( 16220 ['groups', groupId, 'new-entry']); 16221 case 4: 16222 var groupId = route.a; 16223 var entryId = route.b.a; 16224 return _List_fromArray( 16225 ['groups', groupId, 'entries', entryId, 'edit']); 16226 case 5: 16227 var groupId = route.a; 16228 var _v6 = route.b; 16229 return _List_fromArray( 16230 ['groups', groupId, 'members', 'new']); 16231 case 6: 16232 var groupId = route.a; 16233 var memberId = route.b.a; 16234 return _List_fromArray( 16235 ['groups', groupId, 'members', memberId, 'edit']); 16236 case 7: 16237 if (route.b.b.$ === 1) { 16238 var groupId = route.a; 16239 var _v7 = route.b; 16240 var sourceId = _v7.a; 16241 var _v8 = _v7.b; 16242 return _List_fromArray( 16243 ['groups', groupId, 'members', sourceId, 'merge']); 16244 } else { 16245 var groupId = route.a; 16246 var _v9 = route.b; 16247 var sourceId = _v9.a; 16248 var targetId = _v9.b.a; 16249 return _List_fromArray( 16250 ['groups', groupId, 'members', sourceId, 'merge', targetId]); 16251 } 16252 case 8: 16253 var groupId = route.a; 16254 var _v10 = route.b; 16255 return _List_fromArray( 16256 ['groups', groupId, 'settings']); 16257 case 9: 16258 var groupId = route.a; 16259 var _v11 = route.b; 16260 return _List_fromArray( 16261 ['groups', groupId, 'rejoin']); 16262 case 10: 16263 var groupId = route.a; 16264 var _v12 = route.b; 16265 return _List_fromArray( 16266 ['groups', groupId, 'migrate']); 16267 default: 16268 var groupId = route.a; 16269 var _v13 = route.b; 16270 return _List_fromArray( 16271 ['groups', groupId, 'diagnostics']); 16272 } 16273 case 7: 16274 return _List_fromArray( 16275 ['about']); 16276 case 8: 16277 return _List_fromArray( 16278 ['error-log']); 16279 default: 16280 return _List_Nil; 16281 } 16282}; 16283var $author$project$Route$toAppUrl = function (route) { 16284 _v0$3: 16285 while (true) { 16286 switch (route.$) { 16287 case 6: 16288 switch (route.b.$) { 16289 case 0: 16290 var groupId = route.a; 16291 var invite = route.b.a; 16292 return { 16293 dh: $elm$core$Maybe$Just( 16294 $author$project$Route$joinFragment(invite)), 16295 fb: _List_fromArray( 16296 ['join', groupId]), 16297 fj: $elm$core$Dict$empty 16298 }; 16299 case 2: 16300 var groupId = route.a; 16301 var entryId = route.b.a; 16302 return { 16303 dh: $elm$core$Maybe$Nothing, 16304 fb: _List_fromArray( 16305 ['groups', groupId, 'entries']), 16306 fj: A2( 16307 $elm$core$Dict$singleton, 16308 'highlight', 16309 _List_fromArray( 16310 [entryId])) 16311 }; 16312 default: 16313 break _v0$3; 16314 } 16315 case 1: 16316 var topic = route.a; 16317 return { 16318 dh: $elm$core$Maybe$Just('n=' + topic), 16319 fb: _List_fromArray( 16320 ['groups']), 16321 fj: $elm$core$Dict$empty 16322 }; 16323 default: 16324 break _v0$3; 16325 } 16326 } 16327 return $lydell$elm_app_url$AppUrl$fromPath( 16328 $author$project$Route$toPathSegments(route)); 16329}; 16330var $author$project$Main$applyRouteGuard = F2( 16331 function (identity, route) { 16332 if (identity.$ === 1) { 16333 _v1$5: 16334 while (true) { 16335 switch (route.$) { 16336 case 7: 16337 return _Utils_Tuple2(route, $elm$core$Platform$Cmd$none); 16338 case 8: 16339 return _Utils_Tuple2(route, $elm$core$Platform$Cmd$none); 16340 case 6: 16341 if (!route.b.$) { 16342 return _Utils_Tuple2(route, $elm$core$Platform$Cmd$none); 16343 } else { 16344 break _v1$5; 16345 } 16346 case 5: 16347 return _Utils_Tuple2(route, $elm$core$Platform$Cmd$none); 16348 case 9: 16349 return _Utils_Tuple2(route, $elm$core$Platform$Cmd$none); 16350 default: 16351 break _v1$5; 16352 } 16353 } 16354 return _Utils_Tuple2( 16355 $author$project$Route$Home, 16356 A2( 16357 $mpizenberg$elm_url_navigation_port$Navigation$replaceUrl, 16358 $author$project$Main$navCmd, 16359 $author$project$Route$toAppUrl($author$project$Route$Home))); 16360 } else { 16361 return _Utils_Tuple2(route, $elm$core$Platform$Cmd$none); 16362 } 16363 }); 16364var $author$project$Main$canReceiveHandoff = function (model) { 16365 return (!model.bQ) || model.cx; 16366}; 16367var $author$project$Main$handoffOut = _Platform_outgoingPort('handoffOut', $elm$core$Basics$identity); 16368var $author$project$Main$armHandoffReceiver = function (model) { 16369 var _v0 = _Utils_Tuple3( 16370 $author$project$Main$canReceiveHandoff(model), 16371 model.d, 16372 model.nO); 16373 if ((_v0.a && (_v0.b.$ === 5)) && (!_v0.c.$)) { 16374 var _v1 = _v0.b; 16375 var source = _v0.c.a; 16376 return $author$project$Main$handoffOut( 16377 $elm$json$Json$Encode$object( 16378 _List_fromArray( 16379 [ 16380 _Utils_Tuple2( 16381 'action', 16382 $elm$json$Json$Encode$string('listen')), 16383 _Utils_Tuple2( 16384 'sourceOrigin', 16385 $elm$json$Json$Encode$string(source)) 16386 ]))); 16387 } else { 16388 return $elm$core$Platform$Cmd$none; 16389 } 16390}; 16391var $mpizenberg$elm_url_navigation_port$Navigation$go = F2( 16392 function (port_, steps) { 16393 return port_( 16394 $elm$json$Json$Encode$object( 16395 _List_fromArray( 16396 [ 16397 _Utils_Tuple2( 16398 'tag', 16399 $elm$json$Json$Encode$string('go')), 16400 _Utils_Tuple2( 16401 'steps', 16402 $elm$json$Json$Encode$int(steps)) 16403 ]))); 16404 }); 16405var $mpizenberg$elm_url_navigation_port$Navigation$back = F2( 16406 function (port_, n) { 16407 return A2( 16408 $mpizenberg$elm_url_navigation_port$Navigation$go, 16409 port_, 16410 -$elm$core$Basics$abs(n)); 16411 }); 16412var $author$project$PwaState$pushServerUrl = function (model) { 16413 var _v0 = model.a_; 16414 switch (_v0.$) { 16415 case 0: 16416 return $elm$core$Maybe$Nothing; 16417 case 1: 16418 var url = _v0.a; 16419 return $elm$core$Maybe$Just(url); 16420 case 2: 16421 var url = _v0.a; 16422 return $elm$core$Maybe$Just(url); 16423 default: 16424 var url = _v0.a; 16425 return $elm$core$Maybe$Just(url); 16426 } 16427}; 16428var $author$project$Main$buildGroupConfig = function (model) { 16429 var _v0 = model.b; 16430 if (_v0.$ === 1) { 16431 var readyData = _v0.a; 16432 return A2( 16433 $elm$core$Maybe$map, 16434 function (identity) { 16435 return { 16436 ap: model.ap, 16437 de: readyData.de, 16438 mi: readyData.mi, 16439 aJ: model.aJ, 16440 O: identity, 16441 g7: $author$project$PwaState$pushServerUrl(model.G), 16442 jS: model.G.jS, 16443 d: model.d, 16444 fr: readyData.fr, 16445 hl: model.hl, 16446 al: model.al 16447 }; 16448 }, 16449 readyData.O); 16450 } else { 16451 return $elm$core$Maybe$Nothing; 16452 } 16453}; 16454var $author$project$Infra$UsageStats$bandwidthCentsPerGb = 10.0; 16455var $author$project$Infra$UsageStats$baseCostCentsPerMonth = 10.0; 16456var $author$project$Infra$UsageStats$bytesPerGb = 1.0e9; 16457var $author$project$Infra$UsageStats$computeMultiplier = 5.0; 16458var $author$project$Infra$UsageStats$calculateCosts = F2( 16459 function (now, stats) { 16460 var storageCostCents = stats.cX / 1.0e9; 16461 var networkCostCents = (stats.qZ / $author$project$Infra$UsageStats$bytesPerGb) * $author$project$Infra$UsageStats$bandwidthCentsPerGb; 16462 var daysBetween = ($elm$time$Time$posixToMillis(now) - $elm$time$Time$posixToMillis(stats.fF)) / (((1000 * 60) * 60) * 24); 16463 var monthsTracked = A2($elm$core$Basics$max, 0, daysBetween / 30.44); 16464 var computeCostCents = storageCostCents * $author$project$Infra$UsageStats$computeMultiplier; 16465 var baseCostCents = monthsTracked * $author$project$Infra$UsageStats$baseCostCentsPerMonth; 16466 var totalCostCents = ((baseCostCents + storageCostCents) + computeCostCents) + networkCostCents; 16467 var avgPerMonthCents = (monthsTracked > 0) ? (totalCostCents / monthsTracked) : totalCostCents; 16468 return {hU: avgPerMonthCents, hY: baseCostCents, ig: computeCostCents, jk: monthsTracked, jl: networkCostCents, kr: storageCostCents, kH: totalCostCents}; 16469 }); 16470var $author$project$Main$OnActivityMarkerCleared = function (a) { 16471 return {$: 45, a: a}; 16472}; 16473var $author$project$IndexedDb$delete = F3( 16474 function (db, store, key) { 16475 return $andrewMacmurray$elm_concurrent_task$ConcurrentTask$define( 16476 { 16477 k: $elm$json$Json$Encode$object( 16478 _List_fromArray( 16479 [ 16480 _Utils_Tuple2( 16481 'db', 16482 $elm$json$Json$Encode$string( 16483 $author$project$IndexedDb$getDbName(db))), 16484 _Utils_Tuple2( 16485 'store', 16486 $elm$json$Json$Encode$string( 16487 $author$project$IndexedDb$get
16487StoreName(store))), 16488 _Utils_Tuple2( 16489 'key', 16490 $author$project$IndexedDb$encodeKey(key)) 16491 ])), 16492 l: $andrewMacmurray$elm_concurrent_task$ConcurrentTask$expectErrors($author$project$IndexedDb$errorDecoder), 16493 m: $andrewMacmurray$elm_concurrent_task$ConcurrentTask$expectWhatever, 16494 n: 'indexeddb:delete' 16495 }); 16496 }); 16497var $author$project$Infra$Storage$loadNotifyTopic = F2( 16498 function (db, groupId) { 16499 return A4( 16500 $author$project$IndexedDb$get, 16501 db, 16502 $author$project$Infra$Storage$notifyTopicsStore, 16503 $author$project$IndexedDb$StringKey(groupId), 16504 $elm$json$Json$Decode$string); 16505 }); 16506var $author$project$Infra$Storage$clearActivityMarker = F2( 16507 function (db, groupId) { 16508 return A2( 16509 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$andThen, 16510 function (maybeTopic) { 16511 return A2( 16512 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$map, 16513 function (_v1) { 16514 return maybeTopic; 16515 }, 16516 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$batch( 16517 A2( 16518 $elm$core$List$cons, 16519 A3( 16520 $author$project$IndexedDb$delete, 16521 db, 16522 $author$project$Infra$Storage$activityMarkersStore, 16523 $author$project$IndexedDb$StringKey(groupId)), 16524 function () { 16525 if (!maybeTopic.$) { 16526 var topic = maybeTopic.a; 16527 return _List_fromArray( 16528 [ 16529 A3( 16530 $author$project$IndexedDb$delete, 16531 db, 16532 $author$project$Infra$Storage$activityMarkersStore, 16533 $author$project$IndexedDb$StringKey(topic)) 16534 ]); 16535 } else { 16536 return _List_Nil; 16537 } 16538 }()))); 16539 }, 16540 A2($author$project$Infra$Storage$loadNotifyTopic, db, groupId)); 16541 }); 16542var $elm$core$Set$remove = F2( 16543 function (key, _v0) { 16544 var dict = _v0; 16545 return A2($elm$core$Dict$remove, key, dict); 16546 }); 16547var $author$project$Main$clearGroupActivity = F2( 16548 function (groupId, model) { 16549 var _v0 = model.b; 16550 if (_v0.$ === 1) { 16551 var readyData = _v0.a; 16552 return function (_v1) { 16553 var runner = _v1.a; 16554 var cmd = _v1.b; 16555 return _Utils_Tuple2( 16556 _Utils_update( 16557 model, 16558 { 16559 b: $author$project$Main$Ready( 16560 _Utils_update( 16561 readyData, 16562 { 16563 k8: A2($elm$core$Set$remove, groupId, readyData.k8) 16564 })), 16565 ak: runner 16566 }), 16567 cmd); 16568 }( 16569 A3( 16570 $author$project$Infra$ConcurrentTaskExtra$andRun, 16571 $author$project$Main$OnActivityMarkerCleared, 16572 A2($author$project$Infra$Storage$clearActivityMarker, readyData.de, groupId), 16573 _Utils_Tuple2(model.ak, $elm$core$Platform$Cmd$none))); 16574 } else { 16575 return _Utils_Tuple2(model, $elm$core$Platform$Cmd$none); 16576 } 16577 }); 16578var $author$project$Pwa$closeNotifications = F2( 16579 function (pwaOut, notificationTag) { 16580 return pwaOut( 16581 $elm$json$Json$Encode$object( 16582 _List_fromArray( 16583 [ 16584 _Utils_Tuple2( 16585 'tag', 16586 $elm$json$Json$Encode$string('closeNotifications')), 16587 _Utils_Tuple2( 16588 'notificationTag', 16589 $elm$json$Json$Encode$string(notificationTag)) 16590 ]))); 16591 }); 16592var $author$project$PwaState$FetchedDeployment = function (a) { 16593 return {$: 0, a: a}; 16594}; 16595var $author$project$PwaState$OfflineFallback = function (a) { 16596 return {$: 1, a: a}; 16597}; 16598var $author$project$PwaState$OnDeploymentConfig = function (a) { 16599 return {$: 6, a: a}; 16600}; 16601var $author$project$Infra$RelayConfig$Config = F5( 16602 function (pushServerUrl, feedbackProjectId, migrationTarget, migrationSource, readOnly) { 16603 return {mA: feedbackProjectId, nO: migrationSource, nP: migrationTarget, g7: pushServerUrl, pL: readOnly}; 16604 }); 16605var $author$project$Infra$RelayConfig$configured = function (field) { 16606 return A2( 16607 $elm$json$Json$Decode$map, 16608 function (value) { 16609 return $elm$core$String$isEmpty(value) ? $elm$core$Maybe$Nothing : $elm$core$Maybe$Just(value); 16610 }, 16611 $elm$json$Json$Decode$oneOf( 16612 _List_fromArray( 16613 [ 16614 A2($elm$json$Json$Decode$field, field, $elm$json$Json$Decode$string), 16615 $elm$json$Json$Decode$succeed('') 16616 ]))); 16617}; 16618var $andrewMacmurray$elm_concurrent_task$ConcurrentTask$Http$ExpectJson = function (a) { 16619 return {$: 0, a: a}; 16620}; 16621var $andrewMacmurray$elm_concurrent_task$ConcurrentTask$Http$expectJson = $andrewMacmurray$elm_concurrent_task$ConcurrentTask$Http$ExpectJson; 16622var $author$project$Infra$RelayConfig$flag = function (field) { 16623 return $elm$json$Json$Decode$oneOf( 16624 _List_fromArray( 16625 [ 16626 A2($elm$json$Json$Decode$field, field, $elm$json$Json$Decode$bool), 16627 $elm$json$Json$Decode$succeed(false) 16628 ])); 16629}; 16630var $andrewMacmurray$elm_concurrent_task$ConcurrentTask$Http$EmptyBody = {$: 0}; 16631var $andrewMacmurray$elm_concurrent_task$ConcurrentTask$Http$emptyBody = $andrewMacmurray$elm_concurrent_task$ConcurrentTask$Http$EmptyBody; 16632var $andrewMacmurray$elm_concurrent_task$ConcurrentTask$Http$BadUrl = function (a) { 16633 return {$: 0, a: a}; 16634}; 16635var $andrewMacmurray$elm_concurrent_task$ConcurrentTask$Http$NetworkError = {$: 2}; 16636var $andrewMacmurray$elm_concurrent_task$ConcurrentTask$Http$Timeout = {$: 1}; 16637var $andrewMacmurray$elm_concurrent_task$ConcurrentTask$Http$decodeError = function (r) { 16638 return A2( 16639 $elm$json$Json$Decode$andThen, 16640 function (code) { 16641 switch (code) { 16642 case 'TIMEOUT': 16643 return $elm$json$Json$Decode$succeed($andrewMacmurray$elm_concurrent_task$ConcurrentTask$Http$Timeout);
16644 case 'NETWORK_ERROR': 16645 return $elm$json$Json$Decode$succeed($andrewMacmurray$elm_concurrent_task$ConcurrentTask$Http$NetworkError); 16646 case 'BAD_URL': 16647 return $elm$json$Json$Decode$succeed( 16648 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$Http$BadUrl(r.kS)); 16649 default: 16650 return $elm$json$Json$Decode$fail('Unknown error code: ' + code); 16651 } 16652 }, 16653 A2($elm$json$Json$Decode$field, 'reason', $elm$json$Json$Decode$string)); 16654}; 16655var $andrewMacmurray$elm_concurrent_task$ConcurrentTask$Http$BadStatus = F2( 16656 function (a, b) { 16657 return {$: 3, a: a, b: b}; 16658 }); 16659var $andrewMacmurray$elm_concurrent_task$ConcurrentTask$Http$Metadata = F4( 16660 function (url, statusCode, statusText, headers) { 16661 return {mY: headers, hr: statusCode, kp: statusText, kS: url}; 16662 }); 16663var $andrewMacmurray$elm_concurrent_task$ConcurrentTask$Http$decodeMetadata = A5( 16664 $elm$json$Json$Decode$map4, 16665 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$Http$Metadata, 16666 A2($elm$json$Json$Decode$field, 'url', $elm$json$Json$Decode$string), 16667 A2($elm$json$Json$Decode$field, 'statusCode', $elm$json$Json$Decode$int), 16668 A2($elm$json$Json$Decode$field, 'statusText', $elm$json$Json$Decode$string), 16669 A2( 16670 $elm$json$Json$Decode$field, 16671 'headers', 16672 $elm$json$Json$Decode$dict($elm$json$Json$Decode$string))); 16673var $andrewMacmurray$elm_concurrent_task$ConcurrentTask$Http$BadBody = F3( 16674 function (a, b, c) { 16675 return {$: 4, a: a, b: b, c: c}; 16676 }); 16677var $elm$bytes$Bytes$Encode$getWidth = function (builder) { 16678 switch (builder.$) { 16679 case 0: 16680 return 1; 16681 case 1: 16682 return 2; 16683 case 2: 16684 return 4; 16685 case 3: 16686 return 1; 16687 case 4: 16688 return 2; 16689 case 5: 16690 return 4; 16691 case 6: 16692 return 4; 16693 case 7: 16694 return 8; 16695 case 8: 16696 var w = builder.a; 16697 return w; 16698 case 9: 16699 var w = builder.a; 16700 return w; 16701 default: 16702 var bs = builder.a; 16703 return _Bytes_width(bs); 16704 } 16705}; 16706var $elm$bytes$Bytes$LE = 0; 16707var $elm$bytes$Bytes$Encode$write = F3( 16708 function (builder, mb, offset) { 16709 switch (builder.$) { 16710 case 0: 16711 var n = builder.a; 16712 return A3(_Bytes_write_i8, mb, offset, n); 16713 case 1: 16714 var e = builder.a; 16715 var n = builder.b; 16716 return A4(_Bytes_write_i16, mb, offset, n, !e); 16717 case 2: 16718 var e = builder.a; 16719 var n = builder.b; 16720 return A4(_Bytes_write_i32, mb, offset, n, !e); 16721 case 3: 16722 var n = builder.a; 16723 return A3(_Bytes_write_u8, mb, offset, n); 16724 case 4: 16725 var e = builder.a; 16726 var n = builder.b; 16727 return A4(_Bytes_write_u16, mb, offset, n, !e); 16728 case 5: 16729 var e = builder.a; 16730 var n = builder.b; 16731 return A4(_Bytes_write_u32, mb, offset, n, !e); 16732 case 6: 16733 var e = builder.a; 16734 var n = builder.b; 16735 return A4(_Bytes_write_f32, mb, offset, n, !e); 16736 case 7: 16737 var e = builder.a; 16738 var n = builder.b; 16739 return A4(_Bytes_write_f64, mb, offset, n, !e); 16740 case 8: 16741 var bs = builder.b; 16742 return A3($elm$bytes$Bytes$Encode$writeSequence, bs, mb, offset); 16743 case 9: 16744 var s = builder.b; 16745 return A3(_Bytes_write_string, mb, offset, s); 16746 default: 16747 var bs = builder.a; 16748 return A3(_Bytes_write_bytes, mb, offset, bs); 16749 } 16750 }); 16751var $elm$bytes$Bytes$Encode$writeSequence = F3( 16752 function (builders, mb, offset) { 16753 writeSequence: 16754 while (true) { 16755 if (!builders.b) { 16756 return offset; 16757 } else { 16758 var b = builders.a; 16759 var bs = builders.b; 16760 var $temp$builders = bs, 16761 $temp$mb = mb, 16762 $temp$offset = A3($elm$bytes$Bytes$Encode$write, b, mb, offset); 16763 builders = $temp$builders; 16764 mb = $temp$mb; 16765 offset = $temp$offset; 16766 continue writeSequence; 16767 } 16768 } 16769 }); 16770var $elm$bytes$Bytes$Decode$decode = F2( 16771 function (_v0, bs) { 16772 var decoder = _v0; 16773 return A2(_Bytes_decode, decoder, bs); 16774 }); 16775var $elm$bytes$Bytes$Encode$encode = _Bytes_encode; 16776var $elm$bytes$Bytes$BE = 1; 16777var $danfishgold$base64_bytes$Encode$isValidChar = function (c) { 16778 if ($elm$core$Char$isAlphaNum(c)) { 16779 return true; 16780 } else { 16781 switch (c) { 16782 case '+': 16783 return true; 16784 case '/': 16785 return true; 16786 default: 16787 return false; 16788 } 16789 } 16790}; 16791var $elm$bytes$Bytes$Encode$Seq = F2( 16792 function (a, b) { 16793 return {$: 8, a: a, b: b}; 16794 });
16795var $elm$bytes$Bytes$Encode$getWidths = F2( 16796 function (width, builders) { 16797 getWidths: 16798 while (true) { 16799 if (!builders.b) { 16800 return width; 16801 } else { 16802 var b = builders.a; 16803 var bs = builders.b; 16804 var $temp$width = width + $elm$bytes$Bytes$Encode$getWidth(b), 16805 $temp$builders = bs; 16806 width = $temp$width; 16807 builders = $temp$builders; 16808 continue getWidths; 16809 } 16810 } 16811 }); 16812var $elm$bytes$Bytes$Encode$sequence = function (builders) { 16813 return A2( 16814 $elm$bytes$Bytes$Encode$Seq, 16815 A2($elm$bytes$Bytes$Encode$getWidths, 0, builders), 16816 builders); 16817}; 16818var $danfishgold$base64_bytes$Encode$unsafeConvertChar = function (_char) { 16819 var key = $elm$core$Char$toCode(_char); 16820 if ((key >= 65) && (key <= 90)) { 16821 return key - 65; 16822 } else { 16823 if ((key >= 97) && (key <= 122)) { 16824 return (key - 97) + 26; 16825 } else { 16826 if ((key >= 48) && (key <= 57)) { 16827 return ((key - 48) + 26) + 26; 16828 } else { 16829 switch (_char) { 16830 case '+': 16831 return 62; 16832 case '/': 16833 return 63; 16834 default: 16835 return -1; 16836 } 16837 } 16838 } 16839 } 16840}; 16841var $elm$bytes$Bytes$Encode$U16 = F2( 16842 function (a, b) { 16843 return {$: 4, a: a, b: b}; 16844 }); 16845var $elm$bytes$Bytes$Encode$unsignedInt16 = $elm$bytes$Bytes$Encode$U16; 16846var $elm$bytes$Bytes$Encode$U8 = function (a) { 16847 return {$: 3, a: a}; 16848}; 16849var $elm$bytes$Bytes$Encode$unsignedInt8 = $elm$bytes$Bytes$Encode$U8; 16850var $danfishgold$base64_bytes$Encode$encodeCharacters = F4( 16851 function (a, b, c, d) { 16852 if ($danfishgold$base64_bytes$Encode$isValidChar(a) && $danfishgold$base64_bytes$Encode$isValidChar(b)) { 16853 var n2 = $danfishgold$base64_bytes$Encode$unsafeConvertChar(b); 16854 var n1 = $danfishgold$base64_bytes$Encode$unsafeConvertChar(a); 16855 if ('=' === d) { 16856 if ('=' === c) { 16857 var n = (n1 << 18) | (n2 << 12); 16858 var b1 = n >> 16; 16859 return $elm$core$Maybe$Just( 16860 $elm$bytes$Bytes$Encode$unsignedInt8(b1)); 16861 } else { 16862 if ($danfishgold$base64_bytes$Encode$isValidChar(c)) { 16863 var n3 = $danfishgold$base64_bytes$Encode$unsafeConvertChar(c); 16864 var n = ((n1 << 18) | (n2 << 12)) | (n3 << 6); 16865 var combined = n >> 8; 16866 return $elm$core$Maybe$Just( 16867 A2($elm$bytes$Bytes$Encode$unsignedInt16, 1, combined)); 16868 } else { 16869 return $elm$core$Maybe$Nothing; 16870 } 16871 } 16872 } else { 16873 if ($danfishgold$base64_bytes$Encode$isValidChar(c) && $danfishgold$base64_bytes$Encode$isValidChar(d)) { 16874 var n4 = $danfishgold$base64_bytes$Encode$unsafeConvertChar(d); 16875 var n3 = $danfishgold$base64_bytes$Encode$unsafeConvertChar(c); 16876 var n = ((n1 << 18) | (n2 << 12)) | ((n3 << 6) | n4); 16877 var combined = n >> 8; 16878 var b3 = n; 16879 return $elm$core$Maybe$Just( 16880 $elm$bytes$Bytes$Encode$sequence( 16881 _List_fromArray( 16882 [ 16883 A2($elm$bytes$Bytes$Encode$unsignedInt16, 1, combined), 16884 $elm$bytes$Bytes$Encode$unsignedInt8(b3) 16885 ]))); 16886 } else { 16887 return $elm$core$Maybe$Nothing; 16888 } 16889 } 16890 } else { 16891 return $elm$core$Maybe$Nothing; 16892 } 16893 }); 16894var $elm$core$String$toList = function (string) { 16895 return A3($elm$core$String$foldr, $elm$core$List$cons, _List_Nil, string); 16896}; 16897var $danfishgold$base64_bytes$Encode$encodeChunks = F2( 16898 function (input, accum) { 16899 encodeChunks: 16900 while (true) { 16901 var _v0 = $elm$core$String$toList( 16902 A2($elm$core$String$left, 4, input)); 16903 _v0$4: 16904 while (true) { 16905 if (!_v0.b) { 16906 return $elm$core$Maybe$Just(accum); 16907 } else { 16908 if (_v0.b.b) { 16909 if (_v0.b.b.b) { 16910 if (_v0.b.b.b.b) { 16911 if (!_v0.b.b.b.b.b) { 16912 var a = _v0.a; 16913 var _v1 = _v0.b; 16914 var b = _v1.a; 16915 var _v2 = _v1.b; 16916 var c = _v2.a; 16917 var _v3 = _v2.b; 16918 var d = _v3.a; 16919 var _v4 = A4($danfishgold$base64_bytes$Encode$encodeCharacters, a, b, c, d); 16920 if (!_v4.$) { 16921 var enc = _v4.a; 16922 var $temp$input = A2($elm$core$String$dropLeft, 4, input), 16923 $temp$accum = A2($elm$core$List$cons, enc, accum); 16924 input = $temp$input; 16925 accum = $temp$accum; 16926 continue encodeChunks; 16927 } else { 16928 return $elm$core$Maybe$Nothing; 16929 } 16930 } else { 16931 break _v0$4; 16932 } 16933 } else { 16934 var a = _v0.a; 16935 var _v5 = _v0.b; 16936 var b = _v5.a; 16937 var _v6 = _v5.b; 16938 var c = _v6.a;
16939 var _v7 = A4($danfishgold$base64_bytes$Encode$encodeCharacters, a, b, c, '='); 16940 if (_v7.$ === 1) { 16941 return $elm$core$Maybe$Nothing; 16942 } else { 16943 var enc = _v7.a; 16944 return $elm$core$Maybe$Just( 16945 A2($elm$core$List$cons, enc, accum)); 16946 } 16947 } 16948 } else { 16949 var a = _v0.a; 16950 var _v8 = _v0.b; 16951 var b = _v8.a; 16952 var _v9 = A4($danfishgold$base64_bytes$Encode$encodeCharacters, a, b, '=', '='); 16953 if (_v9.$ === 1) { 16954 return $elm$core$Maybe$Nothing; 16955 } else { 16956 var enc = _v9.a; 16957 return $elm$core$Maybe$Just( 16958 A2($elm$core$List$cons, enc, accum)); 16959 } 16960 } 16961 } else { 16962 break _v0$4; 16963 } 16964 } 16965 } 16966 return $elm$core$Maybe$Nothing; 16967 } 16968 }); 16969var $danfishgold$base64_bytes$Encode$encoder = function (string) { 16970 return A2( 16971 $elm$core$Maybe$map, 16972 A2($elm$core$Basics$composeR, $elm$core$List$reverse, $elm$bytes$Bytes$Encode$sequence), 16973 A2($danfishgold$base64_bytes$Encode$encodeChunks, string, _List_Nil)); 16974}; 16975var $danfishgold$base64_bytes$Encode$toBytes = function (string) { 16976 return A2( 16977 $elm$core$Maybe$map, 16978 $elm$bytes$Bytes$Encode$encode, 16979 $danfishgold$base64_bytes$Encode$encoder(string)); 16980}; 16981var $danfishgold$base64_bytes$Base64$toBytes = $danfishgold$base64_bytes$Encode$toBytes; 16982var $andrewMacmurray$elm_concurrent_task$ConcurrentTask$Http$decodeBytesBody = F2( 16983 function (decoder, meta) { 16984 return A2( 16985 $elm$json$Json$Decode$map, 16986 function (res) { 16987 var _v0 = $danfishgold$base64_bytes$Base64$toBytes(res); 16988 if (!_v0.$) { 16989 var bytes = _v0.a; 16990 var _v1 = A2( 16991 $elm$bytes$Bytes$Decode$decode, 16992 decoder(bytes), 16993 bytes); 16994 if (!_v1.$) { 16995 var a = _v1.a; 16996 return $elm$core$Result$Ok(a); 16997 } else { 16998 return $elm$core$Result$Err( 16999 A3( 17000 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$Http$BadBody, 17001 meta, 17002 $elm$json$Json$Encode$string(res), 17003 A2($elm$json$Json$Decode$Failure, 'Could not decode Bytes', $elm$json$Json$Encode$null))); 17004 } 17005 } else { 17006 return $elm$core$Result$Err( 17007 A3( 17008 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$Http$BadBody, 17009 meta, 17010 $elm$json$Json$Encode$string(res), 17011 A2($elm$json$Json$Decode$Failure, 'Invalid Bytes body', $elm$json$Json$Encode$null))); 17012 } 17013 }, 17014 $elm$json$Json$Decode$string); 17015 }); 17016var $elm$json$Json$Decode$decodeString = _Json_runOnString; 17017var $andrewMacmurray$elm_concurrent_task$ConcurrentTask$Http$decodeJsonBody = F2( 17018 function (decoder, meta) { 17019 return A2( 17020 $elm$json$Json$Decode$map, 17021 function (res) { 17022 var _v0 = A2($elm$json$Json$Decode$decodeString, decoder, res); 17023 if (!_v0.$) { 17024 var a = _v0.a; 17025 return $elm$core$Result$Ok(a); 17026 } else { 17027 var e = _v0.a; 17028 return $elm$core$Result$Err( 17029 A3( 17030 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$Http$BadBody, 17031 meta, 17032 $elm$json$Json$Encode$string(res), 17033 e)); 17034 } 17035 }, 17036 $elm$json$Json$Decode$string); 17037 }); 17038var $andrewMacmurray$elm_concurrent_task$ConcurrentTask$Http$decodeSuccess = F2( 17039 function (meta, expect) { 17040 decodeSuccess: 17041 while (true) { 17042 switch (expect.$) { 17043 case 0: 17044 var decoder = expect.a; 17045 return A2( 17046 $elm$json$Json$Decode$field, 17047 'body', 17048 A2($andrewMacmurray$elm_concurrent_task$ConcurrentTask$Http$decodeJsonBody, decoder, meta)); 17049 case 1: 17050 var decoder = expect.a; 17051 return A2( 17052 $elm$json$Json$Decode$field, 17053 'body', 17054 A2($elm$json$Json$Decode$map, $elm$core$Result$Ok, decoder)); 17055 case 2: 17056 var decoder = expect.a; 17057 return A2( 17058 $elm$json$Json$Decode$field, 17059 'body', 17060 A2($andrewMacmurray$elm_concurrent_task$ConcurrentTask$Http$decodeBytesBody, decoder, meta)); 17061 case 3: 17062 var decoder = expect.a; 17063 return A2( 17064 $elm$json$Json$Decode$field, 17065 'body', 17066 A2($elm$json$Json$Decode$map, $elm$core$Result$Ok, decoder)); 17067 default: 17068 var toMeta = expect.a; 17069 var $temp$meta = meta, 17070 $temp$expect = toMeta(meta); 17071 meta = $temp$meta; 17072 expect = $temp$expect; 17073 continue decodeSuccess; 17074 } 17075 } 17076 }); 17077var $andrewMacmurray$elm_concurrent_task$ConcurrentTask$Http$withBodyValue = function (decode) { 17078 return A2( 17079 $elm$json$Json$Decode$map, 17080 decode, 17081 A2($elm$json$Json$Decode$field, 'body', $elm$json$Json$Decode$value)); 17082}; 17083var $andrewMacmurray$elm_concurrent_task$ConcurrentTask$Http$decodeExpect = function (expect) { 17084 return A2( 17085 $elm$json$Json$Decode$andThen, 17086 function (meta) { 17087 return ((meta.hr >= 200) && (meta.hr < 300)) ? A2($andrewMacmurray$elm_concurrent_task$ConcurrentTask$Http$decodeSuccess, meta, expect) : $andrewMacmurray$elm_concurrent_task$ConcurrentTask$Http$withBodyValue( 17088 function (body) { 17089 return $elm$core$Result$Err( 17090 A2($andrewMacmurray$elm_concurrent_task$ConcurrentTask$Http$BadStatus, meta, body)); 17091 }); 17092 }, 17093 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$Http$decodeMetadata); 17094}; 17095var $elm$bytes$Bytes$Decode$Decoder = $elm$core$Basics$identity; 17096var $elm$bytes$Bytes$Decode$loopHelp = F4( 17097 function (state, callback, bites, offset) { 17098 loopHelp: 17099 while (true) { 17100 var _v0 = callback(state); 17101 var decoder = _v0; 17102 var _v1 = A2(decoder, bites, offset); 17103 var newOffset = _v1.a; 17104 var step = _v1.b; 17105 if (!step.$) { 17106 var newState = step.a; 17107 var $temp$state = newState, 17108 $temp$callback = callback, 17109 $temp$bites = bites, 17110 $temp$offset = newOffset; 17111 state = $temp$state; 17112 callback = $temp$callback; 17113 bites = $temp$bites; 17114 offset = $temp$offset; 17115 continue loopHelp; 17116 } else { 17117 var result = step.a; 17118 return _Utils_Tuple2(newOffset, result); 17119 } 17120 } 17121 }); 17122var $elm$bytes$Bytes$Decode$loop = F2( 17123 function (state, callback) { 17124 return A2($elm$bytes$Bytes$Decode$loopHelp, state, callback); 17125 }); 17126var $elm$bytes$Bytes$Decode$Done = function (a) { 17127 return {$: 1, a: a}; 17128}; 17129var $elm$bytes$Bytes$Decode$Loop = function (a) { 17130 return {$: 0, a: a}; 17131};
17132var $danfishgold$base64_bytes$Decode$lowest6BitsMask = 63; 17133var $elm$core$Char$fromCode = _Char_fromCode; 17134var $danfishgold$base64_bytes$Decode$unsafeToChar = function (n) { 17135 if (n <= 25) { 17136 return $elm$core$Char$fromCode(65 + n); 17137 } else { 17138 if (n <= 51) { 17139 return $elm$core$Char$fromCode(97 + (n - 26)); 17140 } else { 17141 if (n <= 61) { 17142 return $elm$core$Char$fromCode(48 + (n - 52)); 17143 } else { 17144 switch (n) { 17145 case 62: 17146 return '+'; 17147 case 63: 17148 return '/'; 17149 default: 17150 return '\u0000'; 17151 } 17152 } 17153 } 17154 } 17155}; 17156var $danfishgold$base64_bytes$Decode$bitsToChars = F2( 17157 function (bits, missing) { 17158 var s = $danfishgold$base64_bytes$Decode$unsafeToChar(bits & $danfishgold$base64_bytes$Decode$lowest6BitsMask); 17159 var r = $danfishgold$base64_bytes$Decode$unsafeToChar((bits >>> 6) & $danfishgold$base64_bytes$Decode$lowest6BitsMask); 17160 var q = $danfishgold$base64_bytes$Decode$unsafeToChar((bits >>> 12) & $danfishgold$base64_bytes$Decode$lowest6BitsMask); 17161 var p = $danfishgold$base64_bytes$Decode$unsafeToChar(bits >>> 18); 17162 switch (missing) { 17163 case 0: 17164 return A2( 17165 $elm$core$String$cons, 17166 p, 17167 A2( 17168 $elm$core$String$cons, 17169 q, 17170 A2( 17171 $elm$core$String$cons, 17172 r, 17173 $elm$core$String$fromChar(s)))); 17174 case 1: 17175 return A2( 17176 $elm$core$String$cons, 17177 p, 17178 A2( 17179 $elm$core$String$cons, 17180 q, 17181 A2($elm$core$String$cons, r, '='))); 17182 case 2: 17183 return A2( 17184 $elm$core$String$cons, 17185 p, 17186 A2($elm$core$String$cons, q, '==')); 17187 default: 17188 return ''; 17189 } 17190 }); 17191var $danfishgold$base64_bytes$Decode$bitsToCharSpecialized = F4( 17192 function (bits1, bits2, bits3, accum) { 17193 var z = $danfishgold$base64_bytes$Decode$unsafeToChar((bits3 >>> 6) & $danfishgold$base64_bytes$Decode$lowest6BitsMask); 17194 var y = $danfishgold$base64_bytes$Decode$unsafeToChar((bits3 >>> 12) & $danfishgold$base64_bytes$Decode$lowest6BitsMask); 17195 var x = $danfishgold$base64_bytes$Decode$unsafeToChar(bits3 >>> 18); 17196 var w = $danfishgold$base64_bytes$Decode$unsafeToChar(bits3 & $danfishgold$base64_bytes$Decode$lowest6BitsMask); 17197 var s = $danfishgold$base64_bytes$Decode$unsafeToChar(bits1 & $danfishgold$base64_bytes$Decode$lowest6BitsMask); 17198 var r = $danfishgold$base64_bytes$Decode$unsafeToChar((bits1 >>> 6) & $danfishgold$base64_bytes$Decode$lowest6BitsMask); 17199 var q = $danfishgold$base64_bytes$Decode$unsafeToChar((bits1 >>> 12) & $danfishgold$base64_bytes$Decode$lowest6BitsMask); 17200 var p = $danfishgold$base64_bytes$Decode$unsafeToChar(bits1 >>> 18); 17201 var d = $danfishgold$base64_bytes$Decode$unsafeToChar(bits2 & $danfishgold$base64_bytes$Decode$lowest6BitsMask); 17202 var c = $danfishgold$base64_bytes$Decode$unsafeToChar((bits2 >>> 6) & $danfishgold$base64_bytes$Decode$lowest6BitsMask); 17203 var b = $danfishgold$base64_bytes$Decode$unsafeToChar((bits2 >>> 12) & $danfishgold$base64_bytes$Decode$lowest6BitsMask); 17204 var a = $danfishgold$base64_bytes$Decode$unsafeToChar(bits2 >>> 18); 17205 return A2( 17206 $elm$core$String$cons, 17207 x, 17208 A2( 17209 $elm$core$String$cons, 17210 y, 17211 A2( 17212 $elm$core$String$cons, 17213 z, 17214 A2( 17215 $elm$core$String$cons, 17216 w, 17217 A2( 17218 $elm$core$String$cons, 17219 a, 17220 A2( 17221 $elm$core$String$cons, 17222 b, 17223 A2( 17224 $elm$core$String$cons, 17225 c, 17226 A2( 17227 $elm$core$String$cons, 17228 d, 17229 A2( 17230 $elm$core$String$cons, 17231 p, 17232 A2( 17233 $elm$core$String$cons, 17234 q, 17235 A2( 17236 $elm$core$String$cons, 17237 r, 17238 A2($elm$core$String$cons, s, accum)))))))))))); 17239 }); 17240var $danfishgold$base64_bytes$Decode$decode18Help = F5( 17241 function (a, b, c, d, e) { 17242 var combined6 = ((255 & d) << 16) | e; 17243 var combined5 = d >>> 8; 17244 var combined4 = 16777215 & c; 17245 var combined3 = ((65535 & b) << 8) | (c >>> 24); 17246 var combined2 = ((255 & a) << 16) | (b >>> 16); 17247 var combined1 = a >>> 8; 17248 return A4( 17249 $danfishgold$base64_bytes$Decode$bitsToCharSpecialized, 17250 combined3, 17251 combined2, 17252 combined1, 17253 A4($danfishgold$base64_bytes$Decode$bitsToCharSpecialized, combined6, combined5, combined4, '')); 17254 }); 17255var $elm$bytes$Bytes$Decode$map5 = F6( 17256 function (func, _v0, _v1, _v2, _v3, _v4) { 17257 var decodeA = _v0; 17258 var decodeB = _v1; 17259 var decodeC = _v2; 17260 var decodeD = _v3; 17261 var decodeE = _v4; 17262 return F2( 17263 function (bites, offset) { 17264 var _v5 = A2(decodeA, bites, offset); 17265 var aOffset = _v5.a; 17266 var a = _v5.b; 17267 var _v6 = A2(decodeB, bites, aOffset); 17268 var bOffset = _v6.a; 17269 var b = _v6.b; 17270 var _v7 = A2(decodeC, bites, bOffset); 17271 var cOffset = _v7.a; 17272 var c = _v7.b; 17273 var _v8 = A2(decodeD, bites, cOffset); 17274 var dOffset = _v8.a; 17275 var d = _v8.b; 17276 var _v9 = A2(decodeE, bites, dOffset); 17277 var eOffset = _v9.a; 17278 var e = _v9.b; 17279 return _Utils_Tuple2( 17280 eOffset, 17281 A5(func, a, b, c, d, e)); 17282 }); 17283 }); 17284var $elm$bytes$Bytes$Decode$unsignedInt16 = function (endianness) { 17285 return _Bytes_read_u16(!endianness); 17286};
17287var $danfishgold$base64_bytes$Decode$u16BE = $elm$bytes$Bytes$Decode$unsignedInt16(1); 17288var $elm$bytes$Bytes$Decode$unsignedInt32 = function (endianness) { 17289 return _Bytes_read_u32(!endianness); 17290}; 17291var $danfishgold$base64_bytes$Decode$u32BE = $elm$bytes$Bytes$Decode$unsignedInt32(1); 17292var $danfishgold$base64_bytes$Decode$decode18Bytes = A6($elm$bytes$Bytes$Decode$map5, $danfishgold$base64_bytes$Decode$decode18Help, $danfishgold$base64_bytes$Decode$u32BE, $danfishgold$base64_bytes$Decode$u32BE, $danfishgold$base64_bytes$Decode$u32BE, $danfishgold$base64_bytes$Decode$u32BE, $danfishgold$base64_bytes$Decode$u16BE); 17293var $elm$bytes$Bytes$Decode$map = F2( 17294 function (func, _v0) { 17295 var decodeA = _v0; 17296 return F2( 17297 function (bites, offset) { 17298 var _v1 = A2(decodeA, bites, offset); 17299 var aOffset = _v1.a; 17300 var a = _v1.b; 17301 return _Utils_Tuple2( 17302 aOffset, 17303 func(a)); 17304 }); 17305 }); 17306var $elm$bytes$Bytes$Decode$map2 = F3( 17307 function (func, _v0, _v1) { 17308 var decodeA = _v0; 17309 var decodeB = _v1; 17310 return F2( 17311 function (bites, offset) { 17312 var _v2 = A2(decodeA, bites, offset); 17313 var aOffset = _v2.a; 17314 var a = _v2.b; 17315 var _v3 = A2(decodeB, bites, aOffset); 17316 var bOffset = _v3.a; 17317 var b = _v3.b; 17318 return _Utils_Tuple2( 17319 bOffset, 17320 A2(func, a, b)); 17321 }); 17322 }); 17323var $elm$bytes$Bytes$Decode$map3 = F4( 17324 function (func, _v0, _v1, _v2) { 17325 var decodeA = _v0; 17326 var decodeB = _v1; 17327 var decodeC = _v2; 17328 return F2( 17329 function (bites, offset) { 17330 var _v3 = A2(decodeA, bites, offset); 17331 var aOffset = _v3.a; 17332 var a = _v3.b; 17333 var _v4 = A2(decodeB, bites, aOffset); 17334 var bOffset = _v4.a; 17335 var b = _v4.b; 17336 var _v5 = A2(decodeC, bites, bOffset); 17337 var cOffset = _v5.a; 17338 var c = _v5.b; 17339 return _Utils_Tuple2( 17340 cOffset, 17341 A3(func, a, b, c)); 17342 }); 17343 }); 17344var $elm$bytes$Bytes$Decode$succeed = function (a) { 17345 return F2( 17346 function (_v0, offset) { 17347 return _Utils_Tuple2(offset, a); 17348 }); 17349}; 17350var $elm$bytes$Bytes$Decode$unsignedInt8 = _Bytes_read_u8; 17351var $danfishgold$base64_bytes$Decode$loopHelp = function (_v0) { 17352 var remaining = _v0.fm; 17353 var string = _v0.fw; 17354 if (remaining >= 18) { 17355 return A2( 17356 $elm$bytes$Bytes$Decode$map, 17357 function (result) { 17358 return $elm$bytes$Bytes$Decode$Loop( 17359 { 17360 fm: remaining - 18, 17361 fw: _Utils_ap(string, result) 17362 }); 17363 }, 17364 $danfishgold$base64_bytes$Decode$decode18Bytes); 17365 } else { 17366 if (remaining >= 3) { 17367 var helper = F3( 17368 function (a, b, c) { 17369 var combined = ((a << 16) | (b << 8)) | c; 17370 return $elm$bytes$Bytes$Decode$Loop( 17371 { 17372 fm: remaining - 3, 17373 fw: _Utils_ap( 17374 string, 17375 A2($danfishgold$base64_bytes$Decode$bitsToChars, combined, 0)) 17376 }); 17377 }); 17378 return A4($elm$bytes$Bytes$Decode$map3, helper, $elm$bytes$Bytes$Decode$unsignedInt8, $elm$bytes$Bytes$Decode$unsignedInt8, $elm$bytes$Bytes$Decode$unsignedInt8); 17379 } else { 17380 if (!remaining) { 17381 return $elm$bytes$Bytes$Decode$succeed( 17382 $elm$bytes$Bytes$Decode$Done(string)); 17383 } else { 17384 if (remaining === 2) { 17385 var helper = F2( 17386 function (a, b) { 17387 var combined = (a << 16) | (b << 8); 17388 return $elm$bytes$Bytes$Decode$Done( 17389 _Utils_ap( 17390 string, 17391 A2($danfishgold$base64_bytes$Decode$bitsToChars, combined, 1))); 17392 }); 17393 return A3($elm$bytes$Bytes$Decode$map2, helper, $elm$bytes$Bytes$Decode$unsignedInt8, $elm$bytes$Bytes$Decode$unsignedInt8); 17394 } else { 17395 return A2( 17396 $elm$bytes$Bytes$Decode$map, 17397 function (a) { 17398 return $elm$bytes$Bytes$Decode$Done( 17399 _Utils_ap( 17400 string, 17401 A2($danfishgold$base64_bytes$Decode$bitsToChars, a << 16, 2))); 17402 }, 17403 $elm$bytes$Bytes$Decode$unsignedInt8); 17404 } 17405 } 17406 } 17407 } 17408}; 17409var $danfishgold$base64_bytes$Decode$decoder = function (width) { 17410 return A2( 17411 $elm$bytes$Bytes$Decode$loop, 17412 {fm: width, fw: ''}, 17413 $danfishgold$base64_bytes$Decode$loopHelp); 17414}; 17415var $elm$bytes$Bytes$width = _Bytes_width; 17416var $danfishgold$base64_bytes$Decode$fromBytes = function (bytes) { 17417 return A2( 17418 $elm$bytes$Bytes$Decode$decode,
17419 $danfishgold$base64_bytes$Decode$decoder( 17420 $elm$bytes$Bytes$width(bytes)), 17421 bytes); 17422}; 17423var $danfishgold$base64_bytes$Base64$fromBytes = $danfishgold$base64_bytes$Decode$fromBytes; 17424var $andrewMacmurray$elm_concurrent_task$ConcurrentTask$Http$encodeBody = function (body) { 17425 switch (body.$) { 17426 case 1: 17427 var value = body.b; 17428 return $elm$json$Json$Encode$string(value); 17429 case 0: 17430 return $elm$json$Json$Encode$null; 17431 default: 17432 var bytes = body.b; 17433 return $elm$json$Json$Encode$string( 17434 A2( 17435 $elm$core$Maybe$withDefault, 17436 '', 17437 $danfishgold$base64_bytes$Base64$fromBytes(bytes))); 17438 } 17439}; 17440var $andrewMacmurray$elm_concurrent_task$ConcurrentTask$Http$encodeExpect = function (expect) { 17441 encodeExpect: 17442 while (true) { 17443 switch (expect.$) { 17444 case 1: 17445 return $elm$json$Json$Encode$string('STRING'); 17446 case 0: 17447 return $elm$json$Json$Encode$string('JSON'); 17448 case 2: 17449 return $elm$json$Json$Encode$string('BYTES'); 17450 case 3: 17451 return $elm$json$Json$Encode$string('WHATEVER'); 17452 default: 17453 var toExpect = expect.a; 17454 var fake = {mY: $elm$core$Dict$empty, hr: 123, kp: '', kS: ''}; 17455 var $temp$expect = toExpect(fake); 17456 expect = $temp$expect; 17457 continue encodeExpect; 17458 } 17459 } 17460}; 17461var $andrewMacmurray$elm_concurrent_task$ConcurrentTask$Http$header = $elm$core$Tuple$pair; 17462var $andrewMacmurray$elm_concurrent_task$ConcurrentTask$Http$addContentTypeForBody = F2( 17463 function (body, headers) { 17464 switch (body.$) { 17465 case 0: 17466 return headers; 17467 case 1: 17468 var contentType = body.a; 17469 return A2( 17470 $elm$core$List$cons, 17471 A2($andrewMacmurray$elm_concurrent_task$ConcurrentTask$Http$header, 'Content-Type', contentType), 17472 headers); 17473 default: 17474 var contentType = body.a; 17475 return A2( 17476 $elm$core$List$cons, 17477 A2($andrewMacmurray$elm_concurrent_task$ConcurrentTask$Http$header, 'Content-Type', contentType), 17478 headers); 17479 } 17480 }); 17481var $andrewMacmurray$elm_concurrent_task$ConcurrentTask$Http$encodeHeader = function (_v0) { 17482 var name = _v0.a; 17483 var value = _v0.b; 17484 return A2( 17485 $elm$json$Json$Encode$list, 17486 $elm$core$Basics$identity, 17487 _List_fromArray( 17488 [ 17489 $elm$json$Json$Encode$string(name), 17490 $elm$json$Json$Encode$string(value) 17491 ])); 17492}; 17493var $andrewMacmurray$elm_concurrent_task$ConcurrentTask$Http$encodeHeaders = F2( 17494 function (body, headers) { 17495 return A2( 17496 $elm$json$Json$Encode$list, 17497 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$Http$encodeHeader, 17498 A2($andrewMacmurray$elm_concurrent_task$ConcurrentTask$Http$addContentTypeForBody, body, headers)); 17499 }); 17500var $andrewMacmurray$elm_concurrent_task$ConcurrentTask$Http$encodeTimeout = A2( 17501 $elm$core$Basics$composeR, 17502 $elm$core$Maybe$map($elm$json$Json$Encode$int), 17503 $elm$core$Maybe$withDefault($elm$json$Json$Encode$null)); 17504var $elm$core$String$toUpper = _String_toUpper; 17505var $andrewMacmurray$elm_concurrent_task$ConcurrentTask$Http$encode = function (r) { 17506 return $elm$json$Json$Encode$object( 17507 _List_fromArray( 17508 [ 17509 _Utils_Tuple2( 17510 'url', 17511 $elm$json$Json$Encode$string(r.kS)), 17512 _Utils_Tuple2( 17513 'method', 17514 $elm$json$Json$Encode$string( 17515 $elm$core$String$toUpper(r.nN))), 17516 _Utils_Tuple2( 17517 'headers', 17518 A2($andrewMacmurray$elm_concurrent_task$ConcurrentTask$Http$encodeHeaders, r.fY, r.mY)), 17519 _Utils_Tuple2( 17520 'expect', 17521 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$Http$encodeExpect(r.m)), 17522 _Utils_Tuple2( 17523 'body', 17524 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$Http$encodeBody(r.fY)), 17525 _Utils_Tuple2( 17526 'timeout', 17527 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$Http$encodeTimeout(r.qQ)) 17528 ])); 17529}; 17530var $andrewMacmurray$elm_concurrent_task$ConcurrentTask$Internal$fromResult = function (res) { 17531 return F2( 17532 function (_v0, ids) { 17533 return _Utils_Tuple2( 17534 ids, 17535 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$Internal$Done( 17536 function () { 17537 if (!res.$) { 17538 var a = res.a; 17539 return $andrewMacmurray$elm_concurrent_task$ConcurrentTask$Internal$Success(a); 17540 } else { 17541 var e = res.a; 17542 return $andrewMacmurray$elm_concurrent_task$ConcurrentTask$Internal$Error(e); 17543 } 17544 }())); 17545 }); 17546}; 17547var $andrewMacmurray$elm_concurrent_task$ConcurrentTask$fromResult = $andrewMacmurray$elm_concurrent_task$ConcurrentTask$Internal$fromResult; 17548var $andrewMacmurray$elm_concurrent_task$ConcurrentTask$Http$request = function (r) { 17549 return A2( 17550 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$andThen, 17551 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$fromResult, 17552 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$define( 17553 { 17554 k: $andrewMacmurray$elm_concurrent_task$ConcurrentTask$Http$encode(r), 17555 l: $andrewMacmurray$elm_concurrent_task$ConcurrentTask$expectErrors( 17556 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$Http$decodeError(r)), 17557 m: $andrewMacmurray$elm_concurrent_task$ConcurrentTask$expectJson( 17558 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$Http$decodeExpect(r.m)), 17559 n: 'builtin:http' 17560 })); 17561}; 17562var $andrewMacmurray$elm_concurrent_task$ConcurrentTask$Http$get = function (options) { 17563 return $andrewMacmurray$elm_concurrent_task$ConcurrentTask$Http$request( 17564 {fY: $andrewMacmurray$elm_concurrent_task$ConcurrentTask$Http$emptyBody, m: options.m, mY: options.mY, nN: 'GET', qQ: options.qQ, kS: options.kS}); 17565}; 17566var $elm$json$Json$Decode$map5 = _Json_map5; 17567var $author$project$Infra$RelayConfig$fetch = function (serverUrl) { 17568 return $andrewMacmurray$elm_concurrent_task$ConcurrentTask$Http$get( 17569 { 17570 m: $andrewMacmurray$elm_concurrent_task$ConcurrentTask$Http$expectJson( 17571 A6( 17572 $elm$json$Json$Decode$map5, 17573 $author$project$Infra$RelayConfig$Config, 17574 $author$project$Infra$RelayConfig$configured('pushServerUrl'), 17575 $author$project$Infra$RelayConfig$configured('feedbackProjectId'), 17576 $author$project$Infra$RelayConfig$configured('migrationTarget'), 17577 $author$project$Infra$RelayConfig$configured('migrationSource'), 17578 $author$project$Infra$RelayConfig$flag('readOnly'))), 17579 mY: _List_Nil, 17580 qQ: $elm$core$Maybe$Nothing, 17581 kS: serverUrl + '/api/config' 17582 }); 17583}; 17584var $author$project$PwaState$PushReady = F2( 17585 function (a, b) { 17586 return {$: 3, a: a, b: b}; 17587 }); 17588var $author$project$PwaState$PushUnreachable = function (a) { 17589 return {$: 2, a: a}; 17590}; 17591var $author$project$Infra$PushServer$fetchVapidKey = function (pushServerUrl) { 17592 return $andrewMacmurray$elm_concurrent_task$ConcurrentTask$Http$get( 17593 { 17594 m: $andrewMacmurray$elm_concurrent_task$ConcurrentTask$Http$expectJson( 17595 A2($elm$json$Json$Decode$field, 'vapidPublicKey', $elm$json$Json$Decode$string)), 17596 mY: _List_Nil, 17597 qQ: $elm$core$Maybe$Nothing, 17598 kS: pushServerUrl + '/vapid-public-key' 17599 }); 17600}; 17601var $author$project$PwaState$resolvePush = function (configured) { 17602 if (!configured.$) { 17603 var url = configured.a; 17604 return A2( 17605 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$onError, 17606 function (_v1) { 17607 return $andrewMacmurray$elm_concurrent_task$ConcurrentTask$succeed( 17608 $author$project$PwaState$PushUnreachable(url)); 17609 }, 17610 A2( 17611 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$map, 17612 $author$project$PwaState$PushReady(url), 17613 $author$project$Infra$PushServer$fetchVapidKey(url))); 17614 } else { 17615 return $andrewMacmurray$elm_concurrent_task$ConcurrentTask$succeed($author$project$PwaState$PushUnconfigured); 17616 } 17617}; 17618var $author$project$PwaState$configureTask = F2( 17619 function (_v0, toMsg) { 17620 var serverUrl = _v0.hl; 17621 var cachedPushServerUrl = _v0.h6; 17622 return A2( 17623 $author$project$Infra$ConcurrentTaskExtra$andRun, 17624 A2($elm$core$Basics$composeL, toMsg, $author$project$PwaState$OnDeploymentConfig), 17625 A2( 17626 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$onError, 17627 function (_v1) { 17628 return A2( 17629 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$map, 17630 $author$project$PwaState$OfflineFallback, 17631 $author$project$PwaState$resolvePush(cachedPushServerUrl)); 17632 }, 17633 A2( 17634 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$andThen, 17635 function (config) { 17636 return A2( 17637 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$map, 17638 function (push) { 17639 return $author$project$PwaState$FetchedDeployment( 17640 {mA: config.mA, nO: config.nO, nP: config.nP, jP: push, pL: config.pL}); 17641 }, 17642 $author$project$PwaState$resolvePush(config.g7)); 17643 }, 17644 $author$project$Infra$RelayConfig$fetch(serverUrl)))); 17645 }); 17646var $author$project$Main$currentGroups = function (model) { 17647 var _v0 = model.b; 17648 if (_v0.$ === 1) { 17649 var readyData = _v0.a; 17650 return $elm$core$Dict$values(readyData.eN); 17651 } else { 17652 return _List_Nil; 17653 } 17654}; 17655var $author$project$Domain$Member$ClaimMember = function (a) { 17656 return {$: 0, a: a}; 17657}; 17658var $author$project$Domain$Member$JoinAsNewMember = {$: 1}; 17659var $author$project$Page$JoinGroup$defaultAction = function (groupState) { 17660 return A2( 17661 $elm$core$Maybe$withDefault, 17662 $author$project$Domain$Member$JoinAsNewMember, 17663 A2( 17664 $elm$core$Maybe$map, 17665 function (m) { 17666 return $author$project$Domain$Member$ClaimMember(m.aj); 17667 }, 17668 $elm$core$List$head( 17669 A2( 17670 $elm$core$List$sortBy, 17671 function (m) { 17672 return $elm$core$String$toLower(m.bW); 17673 }, 17674 A2( 17675 $elm$core$List$filter, 17676 function (m) { 17677 return (m.nL === 1) && (!m.nt); 17678 }, 17679 $elm$core$Dict$values(groupState.r)))))); 17680}; 17681var $author$project$Infra$UsageStats$defaultStats = function (now) { 17682 return {b3: 0, cX: 0, b4: '', qZ: 0, fF: now}; 17683}; 17684var $author$project$UI$Toast$dismiss = F2( 17685 function (toastId, model) { 17686 return _Utils_update( 17687 model, 17688 { 17689 b8: A2( 17690 $elm$core$List$filter, 17691 function (t) { 17692 return !_Utils_eq(t.m9, toastId); 17693 }, 17694 model.b8) 17695 }); 17696 }); 17697var $author$project$Main$dropFileExtension = function (name) { 17698 var _v0 = $elm$core$List$reverse( 17699 A2($elm$core$String$split, '.', name)); 17700 if (_v0.b) { 17701 var rest = _v0.b; 17702 return $elm$core$List$isEmpty(rest) ? name : A2( 17703 $elm$core$String$join, 17704 '.', 17705 $elm$core$List$reverse(rest)); 17706 } else { 17707 return name; 17708 } 17709}; 17710var $author$project$WebCrypto$Signature$generateSigningKeyPair = $andrewMacmurray$elm_concurrent_task$ConcurrentTask$define( 17711 { 17712 k: $elm$json$Json$Encode$null, 17713 l: $andrewMacmurray$elm_concurrent_task$ConcurrentTask$expectNoErrors, 17714 m: $andrewMacmurray$elm_concurrent_task$ConcurrentTask$expectJson( 17715 A2($elm$json$Json$Decode$map, $elm$core$Basics$identity, $author$project$WebCrypto$Signature$serializedSigningKeyPairDecoder)), 17716 n: 'webcrypto:sig:generate' 17717 }); 17718var $author$project$WebCrypto$sha256Hex = function (bytes) { 17719 return $andrewMacmurray$elm_concurrent_task$ConcurrentTask$define( 17720 { 17721 k: $elm$json$Json$Encode$object( 17722 _List_fromArray( 17723 [ 17724 _Utils_Tuple2( 17725 'data', 17726 A2($elm$json$Json$Encode$list, $elm$json$Json$Encode$int, bytes)) 17727 ])), 17728 l: $andrewMacmurray$elm_concurrent_task$ConcurrentTask$expectErrors($author$project$WebCrypto$errorDecoder), 17729 m: $andrewMacmurray$elm_concurrent_task$ConcurrentTask$expectString, 17730 n: 'webcrypto:sha256hex' 17731 }); 17732}; 17733var $author$project$WebCrypto$Internal$bytesListStep = function (_v0) { 17734 var remaining = _v0.a; 17735 var acc = _v0.b; 17736 return (remaining <= 0) ? $elm$bytes$Bytes$Decode$succeed( 17737 $elm$bytes$Bytes$Decode$Done( 17738 $elm$core$List$reverse(acc))) : A2( 17739 $elm$bytes$Bytes$Decode$map, 17740 function (_byte) { 17741 return $elm$bytes$Bytes$Decode$Loop( 17742 _Utils_Tuple2( 17743 remaining - 1, 17744 A2($elm$core$List$cons, _byte, acc))); 17745 }, 17746 $elm$bytes$Bytes$Decode$unsignedInt8); 17747}; 17748var $author$project$WebCrypto$Internal$bytesListDecoder = function (width) { 17749 return A2( 17750 $elm$bytes$Bytes$Decode$loop, 17751 _Utils_Tuple2(width, _List_Nil), 17752 $author$project$WebCrypto$Internal$bytesListStep); 17753}; 17754var $elm$bytes$Bytes$Encode$Utf8 = F2( 17755 function (a, b) { 17756 return {$: 9, a: a, b: b}; 17757 }); 17758var $elm$bytes$Bytes$Encode$string = function (str) { 17759 return A2( 17760 $elm$bytes$Bytes$Encode$Utf8, 17761 _Bytes_getStringWidth(str), 17762 str); 17763}; 17764var $author$project$WebCrypto$Internal$stringToBytes = function (str) { 17765 var encoded = $elm$bytes$Bytes$Encode$encode( 17766 $elm$bytes$Bytes$Encode$string(str)); 17767 return A2( 17768 $elm$core$Maybe$withDefault, 17769 _List_Nil, 17770 A2( 17771 $elm$bytes$Bytes$Decode$decode, 17772 $author$project$WebCrypto$Internal$bytesListDecoder( 17773 $elm$bytes$Bytes$width(encoded)), 17774 encoded)); 17775}; 17776var $author$project$WebCrypto$sha256 = function (str) { 17777 return $author$project$WebCrypto$sha256Hex( 17778 $author$project$WebCrypto$Internal$stringToBytes(str)); 17779}; 17780var $author$project$Infra$Identity$generate = A2( 17781 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$andThen, 17782 function (kp) { 17783 var serialized = $author$project$WebCrypto$Signature$exportSigningKeyPair(kp); 17784 return A2( 17785 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$map,
17786 function (hash) { 17787 return {ff: _List_Nil, aK: hash, dV: serialized}; 17788 }, 17789 $author$project$WebCrypto$sha256(serialized.jO)); 17790 }, 17791 A2($andrewMacmurray$elm_concurrent_task$ConcurrentTask$mapError, $elm$core$Basics$never, $author$project$WebCrypto$Signature$generateSigningKeyPair)); 17792var $author$project$Main$IdentityRunning = {$: 1}; 17793var $author$project$Main$OnIdentityGenerated = function (a) { 17794 return {$: 10, a: a}; 17795}; 17796var $author$project$Main$startIdentityTask = F2( 17797 function (task, model) { 17798 var _v0 = model.aT; 17799 if (_v0.$ === 1) { 17800 return _Utils_Tuple2(model, $elm$core$Platform$Cmd$none); 17801 } else { 17802 return A2( 17803 $elm$core$Tuple$mapFirst, 17804 function (runner) { 17805 return _Utils_update( 17806 model, 17807 {aT: $author$project$Main$IdentityRunning, ak: runner}); 17808 }, 17809 A3( 17810 $author$project$Infra$ConcurrentTaskExtra$andRun, 17811 $author$project$Main$OnIdentityGenerated, 17812 task, 17813 _Utils_Tuple2(model.ak, $elm$core$Platform$Cmd$none))); 17814 } 17815 }); 17816var $author$project$Main$ensureHomeIdentity = function (model) { 17817 var _v0 = _Utils_Tuple2(model.d, model.b); 17818 if ((!_v0.a.$) && (_v0.b.$ === 1)) { 17819 var _v1 = _v0.a; 17820 var identity = _v0.b.a.O; 17821 if (identity.$ === 1) { 17822 return A2($author$project$Main$startIdentityTask, $author$project$Infra$Identity$generate, model); 17823 } else { 17824 return _Utils_Tuple2(model, $elm$core$Platform$Cmd$none); 17825 } 17826 } else { 17827 return _Utils_Tuple2(model, $elm$core$Platform$Cmd$none); 17828 } 17829}; 17830var $author$project$Page$JoinGroup$Error = function (a) { 17831 return {$: 3, a: a}; 17832}; 17833var $author$project$Page$JoinGroup$error = $author$project$Page$JoinGroup$Error; 17834var $author$project$Infra$Server$errorToString = function (err) { 17835 switch (err.$) { 17836 case 0: 17837 var httpErr = err.a; 17838 switch (httpErr.$) { 17839 case 0: 17840 var url = httpErr.a; 17841 return 'Bad URL: ' + url; 17842 case 1: 17843 return 'Request timed out'; 17844 case 2: 17845 return 'Network error'; 17846 case 3: 17847 var meta = httpErr.a; 17848 var _v2 = meta.hr; 17849 switch (_v2) { 17850 case 507: 17851 return 'Group storage limit reached (507)'; 17852 case 429: 17853 return 'Data rate limit exceeded (429)'; 17854 case 403: 17855 return 'Relay is read-only (403)'; 17856 default: 17857 var code = _v2;
17858 return 'Server error (' + ($elm$core$String$fromInt(code) + ')'); 17859 } 17860 default: 17861 return 'Invalid server response'; 17862 } 17863 case 1: 17864 var cryptoErr = err.a; 17865 switch (cryptoErr.$) { 17866 case 0: 17867 var msg = cryptoErr.a; 17868 return 'Encryption failed: ' + msg; 17869 case 1: 17870 var msg = cryptoErr.a; 17871 return 'Decryption failed: ' + msg; 17872 default: 17873 return 'Crypto error'; 17874 } 17875 default: 17876 var msg = err.a; 17877 return msg; 17878 } 17879}; 17880var $author$project$Infra$Storage$errorToString = function (err) { 17881 switch (err.$) { 17882 case 0: 17883 return 'Record already exists'; 17884 case 1: 17885 var errMsg = err.a; 17886 return 'Transaction error: ' + errMsg; 17887 case 2: 17888 return 'Storage quota exceeded'; 17889 default: 17890 var errMsg = err.a; 17891 return 'Database error: ' + errMsg; 17892 } 17893}; 17894var $author$project$Translations$errorCrypto = function (_v0) { 17895 var lang = _v0; 17896 if (!lang) { 17897 return 'Encryption error.'; 17898 } else { 17899 return 'Erreur de chiffrement.'; 17900 } 17901}; 17902var $author$project$Translations$errorNetwork = function (_v0) { 17903 var lang = _v0; 17904 if (!lang) { 17905 return 'Network error, check your connection.'; 17906 } else { 17907 return 'Erreur réseau, vérifie ta connexion.'; 17908 } 17909}; 17910var $author$project$Translations$errorServerFrozen = function (_v0) { 17911 var lang = _v0; 17912 if (!lang) { 17913 return 'This server no longer saves changes. Your change stays on this device.'; 17914 } else { 17915 return 'Ce serveur n\'enregistre plus les changements. Ta modification reste sur cet appareil.'; 17916 } 17917}; 17918var $author$project$Translations$errorServerRateLimited = function (_v0) { 17919 var lang = _v0; 17920 if (!lang) { 17921 return 'Too many changes were sent too quickly. Try again shortly.'; 17922 } else { 17923 return 'Trop de modifications envoyées trop vite. Réessaie dans un instant.'; 17924 } 17925}; 17926var $author$project$Translations$errorServerResponse = function (_v0) { 17927 var lang = _v0; 17928 if (!lang) { 17929 return 'The server returned an unexpected response.'; 17930 } else { 17931 return 'Le serveur a renvoyé une réponse inattendue.'; 17932 } 17933}; 17934var $author$project$Translations$errorServerStatus = F2( 17935 function (code, _v0) { 17936 var lang = _v0; 17937 if (!lang) { 17938 return 'Server error (' + (code + ').'); 17939 } else { 17940 return 'Erreur du serveur (' + (code + ').'); 17941 } 17942 }); 17943var $author$project$Translations$errorServerStorageFull = function (_v0) { 17944 var lang = _v0; 17945 if (!lang) { 17946 return 'The server\'s storage limit for this group was reached.'; 17947 } else { 17948 return 'La limite de stockage du serveur pour ce groupe est atteinte.'; 17949 } 17950}; 17951var $author$project$Translations$errorUnexpected = function (_v0) { 17952 var lang = _v0; 17953 if (!lang) { 17954 return 'An unexpected error occurred.'; 17955 } else { 17956 return 'Une erreur inattendue s\'est produite.'; 17957 } 17958}; 17959var $author$project$Infra$Server$errorToText = F2( 17960 function (i18n, err) { 17961 switch (err.$) { 17962 case 0: 17963 var httpErr = err.a; 17964 switch (httpErr.$) { 17965 case 0: 17966 return $author$project$Translations$errorServerResponse(i18n); 17967 case 1: 17968 return $author$project$Translations$errorNetwork(i18n); 17969 case 2: 17970 return $author$project$Translations$errorNetwork(i18n); 17971 case 3: 17972 var meta = httpErr.a; 17973 var _v2 = meta.hr; 17974 switch (_v2) { 17975 case 507: 17976 return $author$project$Translations$errorServerStorageFull(i18n); 17977 case 429: 17978 return $author$project$Translations$errorServerRateLimited(i18n); 17979 case 403: 17980 return $author$project$Translations$errorServerFrozen(i18n); 17981 default: 17982 var code = _v2;
17983 return A2( 17984 $author$project$Translations$errorServerStatus, 17985 $elm$core$String$fromInt(code), 17986 i18n); 17987 } 17988 default: 17989 return $author$project$Translations$errorServerResponse(i18n); 17990 } 17991 case 1: 17992 return $author$project$Translations$errorCrypto(i18n); 17993 default: 17994 return $author$project$Translations$errorUnexpected(i18n); 17995 } 17996 }); 17997var $author$project$Translations$errorStorageDatabase = function (_v0) { 17998 var lang = _v0; 17999 if (!lang) { 18000 return 'Local storage error.'; 18001 } else { 18002 return 'Erreur de stockage local.'; 18003 } 18004}; 18005var $author$project$Translations$errorStorageExists = function (_v0) { 18006 var lang = _v0; 18007 if (!lang) { 18008 return 'This item already exists.'; 18009 } else { 18010 return 'Cet élément existe déjà .'; 18011 } 18012}; 18013var $author$project$Translations$errorStorageQuota = function (_v0) { 18014 var lang = _v0; 18015 if (!lang) { 18016 return 'This device\'s storage is full.'; 18017 } else { 18018 return 'Le stockage de cet appareil est plein.'; 18019 } 18020}; 18021var $author$project$Infra$Storage$errorToText = F2( 18022 function (i18n, err) { 18023 switch (err.$) { 18024 case 0: 18025 return $author$project$Translations$errorStorageExists(i18n); 18026 case 1: 18027 return $author$project$Translations$errorStorageDatabase(i18n); 18028 case 2: 18029 return $author$project$Translations$errorStorageQuota(i18n); 18030 default: 18031 return $author$project$Translations$errorStorageDatabase(i18n); 18032 } 18033 }); 18034var $author$project$Domain$Date$toString = function (date) { 18035 return $elm$core$String$fromInt(date.C) + ('-' + (A3( 18036 $elm$core$String$padLeft, 18037 2, 18038 '0', 18039 $elm$core$String$fromInt(date.F)) + ('-' + A3( 18040 $elm$core$String$padLeft, 18041 2, 18042 '0', 18043 $elm$core$String$fromInt(date.y))))); 18044}; 18045var $author$project$Infra$ExchangeRate$cacheKey = F3( 18046 function (base, quote, today) { 18047 return $author$project$Domain$Currency$currencyCode(base) + ('-' + ($author$project$Domain$Currency$currencyCode(quote) + ('-' + $author$project$Domain$Date$toString(today)))); 18048 }); 18049var $author$project$Infra$ExchangeRate$bestEffort = function (task) { 18050 return A2( 18051 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$onError, 18052 function (_v1) { 18053 return $andrewMacmurray$elm_concurrent_task$ConcurrentTask$succeed(0); 18054 }, 18055 A2( 18056 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$map, 18057 function (_v0) { 18058 return 0; 18059 }, 18060 task)); 18061}; 18062var $elm$json$Json$Decode$at = F2( 18063 function (fields, decoder) { 18064 return A3($elm$core$List$foldr, $elm$json$Json$Decode$field, decoder, fields); 18065 }); 18066var $author$project$Infra$ExchangeRate$fetchRate = F2( 18067 function (base, quote) { 18068 var quoteCode = $author$project$Domain$Currency$currencyCode(quote); 18069 return $andrewMacmurray$elm_concurrent_task$ConcurrentTask$Http$get( 18070 { 18071 m: $andrewMacmurray$elm_concurrent_task$ConcurrentTask$Http$expectJson( 18072 A2( 18073 $elm$json$Json$Decode$at, 18074 _List_fromArray( 18075 ['rates', quoteCode]), 18076 $elm$json$Json$Decode$float)), 18077 mY: _List_Nil, 18078 qQ: $elm$core$Maybe$Just(10000), 18079 kS: 'https://api.frankfurter.dev/v1/latest?base=' + ($author$project$Domain$Currency$currencyCode(base) + ('&symbols=' + quoteCode)) 18080 }); 18081 }); 18082var $author$project$Infra$Storage$saveExchangeRate = F3( 18083 function (db, key, rate) { 18084 return A4( 18085 $author$project$IndexedDb$putAt, 18086 db, 18087 $author$project$Infra$Storage$exchangeRatesStore, 18088 $author$project$IndexedDb$StringKey(key), 18089 $elm$json$Json$Encode$float(rate)); 18090 }); 18091var $author$project$Domain$Date$isLeapYear = function (year) { 18092 return (!A2($elm$core$Basics$modBy, 4, year)) && ((!(!A2($elm$core$Basics$modBy, 100, year))) || (!A2($elm$core$Basics$modBy, 400, year))); 18093}; 18094var $author$project$Domain$Date$daysInMonth = F2( 18095 function (year, month) { 18096 switch (month) { 18097 case 1: 18098 return 31; 18099 case 2: 18100 return $author$project$Domain$Date$isLeapYear(year) ? 29 : 28; 18101 case 3: 18102 return 31; 18103 case 4: 18104 return 30; 18105 case 5: 18106 return 31; 18107 case 6: 18108 return 30; 18109 case 7: 18110 return 31; 18111 case 8: 18112 return 31; 18113 case 9: 18114 return 30; 18115 case 10: 18116 return 31; 18117 case 11: 18118 return 30; 18119 case 12: 18120 return 31; 18121 default: 18122 return 30; 18123 } 18124 }); 18125var $author$project$Domain$Date$addDays = F2( 18126 function (n, date) { 18127 addDays: 18128 while (true) { 18129 if (!n) { 18130 return date; 18131 } else { 18132 if (n > 0) { 18133 var maxDay = A2($author$project$Domain$Date$daysInMonth, date.C, date.F); 18134 if (_Utils_cmp(date.y + n, maxDay) < 1) { 18135 return _Utils_update( 18136 date, 18137 {y: date.y + n}); 18138 } else { 18139 var remaining = (n - (maxDay - date.y)) - 1; 18140 var nextMonth = (date.F === 12) ? {y: 1, F: 1, C: date.C + 1} : {y: 1, F: date.F + 1, C: date.C}; 18141 var $temp$n = remaining, 18142 $temp$date = nextMonth; 18143 n = $temp$n; 18144 date = $temp$date; 18145 continue addDays; 18146 } 18147 } else { 18148 if ((date.y + n) >= 1) { 18149 return _Utils_update( 18150 date, 18151 {y: date.y + n}); 18152 } else { 18153 var remaining = n + date.y; 18154 var prevMonth = (date.F === 1) ? { 18155 y: A2($author$project$Domain$Date$daysInMonth, date.C - 1, 12), 18156 F: 12, 18157 C: date.C - 1 18158 } : { 18159 y: A2($author$project$Domain$Date$daysInMonth, date.C, date.F - 1), 18160 F: date.F - 1, 18161 C: date.C 18162 }; 18163 var $temp$n = remaining, 18164 $temp$date = prevMonth; 18165 n = $temp$n; 18166 date = $temp$date; 18167 continue addDays; 18168 } 18169 } 18170 } 18171 } 18172 }); 18173var $author$project$IndexedDb$deleteMany = F3( 18174 function (db, store, keys) { 18175 return $andrewMacmurray$elm_concurrent_task$ConcurrentTask$define( 18176 { 18177 k: $elm$json$Json$Encode$object( 18178 _List_fromArray( 18179 [ 18180 _Utils_Tuple2( 18181 'db', 18182 $elm$json$Json$Encode$string( 18183 $author$project$IndexedDb$getDbName(db))), 18184 _Utils_Tuple2( 18185 'store', 18186 $elm$json$Json$Encode$string( 18187 $author$project$IndexedDb$getStoreName(store))), 18188 _Utils_Tuple2( 18189 'keys', 18190 A2($elm$json$Json$Encode$list, $author$project$IndexedDb$encodeKey, keys)) 18191 ])), 18192 l: $andrewMacmurray$elm_concurrent_task$ConcurrentTask$expectErrors($author$project$IndexedDb$errorDecoder), 18193 m: $andrewMacmurray$elm_concurrent_task$ConcurrentTask$expectWhatever, 18194 n: 'indexeddb:deleteMany' 18195 }); 18196 }); 18197var $author$project$Infra$Storage$deleteExchangeRates = F2( 18198 function (db, keys) { 18199 return A3( 18200 $author$project$IndexedDb$deleteMany, 18201 db, 18202 $author$project$Infra$Storage$exchangeRatesStore, 18203 A2($elm$core$List$map, $author$project$IndexedDb$StringKey, keys)); 18204 }); 18205var $author$project$Infra$Storage$exchangeRateKeys = function (db) { 18206 return A2( 18207 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$map, 18208 $elm$core$List$filterMap( 18209 function (k) { 18210 if (!k.$) { 18211 var s = k.a; 18212 return $elm$core$Maybe$Just(s); 18213 } else { 18214 return $elm$core$Maybe$Nothing; 18215 } 18216 }), 18217 A2($author$project$IndexedDb$getAllKeys, db, $author$project$Infra$Storage$exchangeRatesStore)); 18218}; 18219var $author$project$Infra$ExchangeRate$maxCacheAgeDays = 3; 18220var $author$project$Infra$ExchangeRate$sweepStale = F2( 18221 function (db, today) { 18222 var cutoff = $author$project$Domain$Date$toString( 18223 A2($author$project$Domain$Date$addDays, -$author$project$Infra$ExchangeRate$maxCacheAgeDays, today)); 18224 return A2( 18225 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$andThen, 18226 function (keys) { 18227 var _v0 = A2( 18228 $elm$core$List$filter, 18229 function (k) { 18230 return _Utils_cmp( 18231 A2($elm$core$String$right, 10, k), 18232 cutoff) < 0; 18233 }, 18234 keys); 18235 if (!_v0.b) { 18236 return $andrewMacmurray$elm_concurrent_task$ConcurrentTask$succeed(0); 18237 } else { 18238 var stale = _v0; 18239 return A2($author$project$Infra$Storage$deleteExchangeRates, db, stale); 18240 } 18241 }, 18242 $author$project$Infra$Storage$exchangeRateKeys(db)); 18243 }); 18244var $author$project$Infra$ExchangeRate$fetchAndCache = F4( 18245 function (db, today, base, quote) { 18246 return A2( 18247 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$andThen, 18248 function (rate) { 18249 return A2( 18250 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$andThenD
18250o, 18251 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$succeed(rate), 18252 A2( 18253 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$andThenDo, 18254 $author$project$Infra$ExchangeRate$bestEffort( 18255 A2($author$project$Infra$ExchangeRate$sweepStale, db, today)), 18256 $author$project$Infra$ExchangeRate$bestEffort( 18257 A3( 18258 $author$project$Infra$Storage$saveExchangeRate, 18259 db, 18260 A3($author$project$Infra$ExchangeRate$cacheKey, base, quote, today), 18261 rate)))); 18262 }, 18263 A2($author$project$Infra$ExchangeRate$fetchRate, base, quote)); 18264 }); 18265var $author$project$Infra$Storage$loadExchangeRate = F2( 18266 function (db, key) { 18267 return A4( 18268 $author$project$IndexedDb$get, 18269 db, 18270 $author$project$Infra$Storage$exchangeRatesStore, 18271 $author$project$IndexedDb$StringKey(key), 18272 $elm$json$Json$Decode$float); 18273 }); 18274var $elm$core$List$maximum = function (list) { 18275 if (list.b) { 18276 var x = list.a; 18277 var xs = list.b; 18278 return $elm$core$Maybe$Just( 18279 A3($elm$core$List$foldl, $elm$core$Basics$max, x, xs)); 18280 } else { 18281 return $elm$core$Maybe$Nothing; 18282 } 18283}; 18284var $author$project$Infra$ExchangeRate$latestCachedRate = F4( 18285 function (db, today, base, quote) { 18286 var prefix = $author$project$Domain$Currency$currencyCode(base) + ('-' + ($author$project$Domain$Currency$currencyCode(quote) + '-')); 18287 var cutoff = $author$project$Domain$Date$toString( 18288 A2($author$project$Domain$Date$addDays, -$author$project$Infra$ExchangeRate$maxCacheAgeDays, today)); 18289 return A2( 18290 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$onError, 18291 function (_v1) { 18292 return $andrewMacmurray$elm_concurrent_task$ConcurrentTask$succeed($elm$core$Maybe$Nothing); 18293 }, 18294 A2( 18295 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$andThen, 18296 function (keys) { 18297 var fresh = A2( 18298 $elm$core$List$filter, 18299 function (k) { 18300 return A2($elm$core$String$startsWith, prefix, k) && (_Utils_cmp( 18301 A2($elm$core$String$right, 10, k), 18302 cutoff) > -1); 18303 }, 18304 keys); 18305 var _v0 = $elm$core$List$maximum(fresh); 18306 if (!_v0.$) { 18307 var key = _v0.a; 18308 return A2($author$project$Infra$Storage$loadExchangeRate, db, key); 18309 } else { 18310 return $andrewMacmurray$elm_concurrent_task$ConcurrentTask$succeed($elm$core$Maybe$Nothing); 18311 } 18312 }, 18313 $author$project$Infra$Storage$exchangeRateKeys(db))); 18314 }); 18315var $author$project$Infra$ExchangeRate$fetchRateCached = F3( 18316 function (db, today, _v0) { 18317 var base = _v0.hX; 18318 var quote = _v0.jY; 18319 return A2( 18320 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$andThen, 18321 function (cached) { 18322 if (!cached.$) { 18323 var rate = cached.a; 18324 return $andrewMacmurray$elm_concurrent_task$ConcurrentTask$succeed(rate); 18325 } else { 18326 return A2( 18327 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$onError, 18328 function (httpError) { 18329 return A2( 18330 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$andThen, 18331 function (fallback) { 18332 if (!fallback.$) { 18333 var rate = fallback.a; 18334 return $andrewMacmurray$elm_concurrent_task$ConcurrentTask$succeed(rate); 18335 } else { 18336 return $andrewMacmurray$elm_concurrent_task$ConcurrentTask$fail(httpError); 18337 } 18338 }, 18339 A4($author$project$Infra$ExchangeRate$latestCachedRate, db, today, base, quote)); 18340 }, 18341 A4($author$project$Infra$ExchangeRate$fetchAndCache, db, today, base, quote)); 18342 } 18343 }, 18344 A2( 18345 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$onError, 18346 function (_v1) { 18347 return $andrewMacmurray$elm_concurrent_task$ConcurrentTask$succeed($elm$core$Maybe$Nothing); 18348 }, 18349 A2( 18350 $author$project$Infra$Storage$loadExchangeRate, 18351 db, 18352 A3($author$project$Infra$ExchangeRate$cacheKey, base, quote, today)))); 18353 }); 18354var $author$project$Page$Move$Failed = function (a) { 18355 return {$: 3, a: a}; 18356}; 18357var $author$project$Page$Move$Seeded = {$: 2}; 18358var $author$project$Page$Move$AllSeeded = function (a) { 18359 return {$: 2, a: a}; 18360}; 18361var $author$project$Page$Move$InFlight = {$: 1}; 18362var $author$project$Page$Move$NoEffect = {$: 0}; 18363var $author$project$Page$Move$Queued = {$: 0}; 18364var $author$project$Page$Move$Seed = function (a) { 18365 return {$: 1, a: a}; 18366}; 18367var $elm$core$List$all = F2( 18368 function (isOkay, list) { 18369 return !A2( 18370 $elm$core$List$any, 18371 A2($elm$core$Basics$composeL, $elm$core$Basics$not, isOkay), 18372 list); 18373 }); 18374var $author$project$Page$Move$launchNext = function (data) { 18375 var statusOf = function (id) { 18376 return A2($elm$core$Dict$get, id, data.ag); 18377 }; 18378 var nextQueued = $elm$core$List$head( 18379 A2( 18380 $elm$core$List$filter, 18381 function (id) { 18382 return _Utils_eq( 18383 statusOf(id), 18384 $elm$core$Maybe$Just($author$project$Page$Move$Queued)); 18385 }, 18386 data.hj)); 18387 if (!nextQueued.$) { 18388 var groupId = nextQueued.a; 18389 return _Utils_Tuple2( 18390 _Utils_update( 18391 data, 18392 { 18393 ag: A3($elm$core$Dict$insert, groupId, $author$project$Page$Move$InFlight, data.ag) 18394 }), 18395 $author$project$Page$Move$Seed(groupId)); 18396 } else { 18397 return A2( 18398 $elm$core$List$any, 18399 function (id) { 18400 return _Utils_eq( 18401 statusOf(id), 18402 $elm$core$Maybe$Just($author$project$Page$Move$InFlight)); 18403 }, 18404 data.hj) ? _Utils_Tuple2(data, $author$project$Page$Move$NoEffect) : (A2( 18405 $elm$core$List$all, 18406 function (id) { 18407 return _Utils_eq( 18408 statusOf(id), 18409 $elm$core$Maybe$Just($author$project$Page$Move$Seeded)); 18410 }, 18411 data.hj) ? _Utils_Tuple2( 18412 data, 18413 $author$project$Page$Move$AllSeeded(data.hj)) : _Utils_Tuple2(data, $author$project$Page$Move$NoEffect)); 18414 } 18415}; 18416var $author$project$Page$Move$groupSeeded = F3( 18417 function (groupId, result, _v0) { 18418 var data = _v0; 18419 var status = function () { 18420 if (!result.$) { 18421 return $author$project$Page$Move$Seeded; 18422 } else { 18423 var reason = result.a; 18424 return $author$project$Page$Move$Failed(reason); 18425 } 18426 }(); 18427 return $author$project$Page$Move$launchNext( 18428 _Utils_update( 18429 data, 18430 { 18431 ag: A3($elm$core$Dict$insert, groupId, status, data.ag) 18432 })); 18433 }); 18434var $author$project$Main$OnJoinGroupFetched = F4( 18435 function (a, b, c, d) {
18436 return {$: 25, a: a, b: b, c: c, d: d}; 18437 }); 18438var $author$project$Main$OnJoinLocalGroupLoaded = F2( 18439 function (a, b) { 18440 return {$: 26, a: a, b: b}; 18441 }); 18442var $author$project$Infra$EventVerification$collectKeyFromEvent = F2( 18443 function (envelope, keys) { 18444 var _v0 = envelope.ej; 18445 if (!_v0.$) { 18446 var publicKey = _v0.a; 18447 return ((publicKey !== '') && (!A2($elm$core$Dict$member, envelope.q0, keys))) ? A3($elm$core$Dict$insert, envelope.q0, publicKey, keys) : keys; 18448 } else { 18449 return keys; 18450 } 18451 }); 18452var $author$project$Infra$EventVerification$collectKeysFromState = function (state) { 18453 var insertKey = F3( 18454 function (memberId, publicKey, acc) { 18455 return (publicKey !== '') ? A3($elm$core$Dict$insert, memberId, publicKey, acc) : acc; 18456 }); 18457 var rootKeys = A3( 18458 $elm$core$Dict$foldl, 18459 F3( 18460 function (rootId, member, acc) { 18461 return A3(insertKey, rootId, member.jO, acc); 18462 }), 18463 $elm$core$Dict$empty, 18464 state.r); 18465 return A3( 18466 $elm$core$Dict$foldl, 18467 F3( 18468 function (deviceId, link, acc) { 18469 return A3(insertKey, deviceId, link.jO, acc); 18470 }), 18471 rootKeys, 18472 state.aP); 18473}; 18474var $author$project$Infra$EventVerification$collectKeys = F2( 18475 function (state, events) { 18476 return A3( 18477 $elm$core$List$foldl, 18478 $author$project$Infra$EventVerification$collectKeyFromEvent, 18479 $author$project$Infra$EventVerification$collectKeysFromState(state), 18480 $author$project$Domain$Event$sortEvents(events)); 18481 }); 18482var $author$project$Infra$EventVerification$isGenesisEvent = function (envelope) { 18483 var _v0 = envelope.jC; 18484 if (_v0.$ === 11) { 18485 return true; 18486 } else { 18487 return false; 18488 } 18489}; 18490var $author$project$WebCrypto$Signature$verifyText = F3( 18491 function (publicKeyJwk, signature, text) { 18492 return $andrewMacmurray$elm_concurrent_task$ConcurrentTask$define( 18493 { 18494 k: $elm$json$Json$Encode$object( 18495 _List_fromArray( 18496 [ 18497 _Utils_Tuple2( 18498 'publicKeyJwk', 18499 $elm$json$Json$Encode$string(publicKeyJwk)), 18500 _Utils_Tuple2( 18501 'signature', 18502 $elm$json$Json$Encode$string(signature)), 18503 _Utils_Tuple2( 18504 'text', 18505 $elm$json$Json$Encode$string(text)) 18506 ])), 18507 l: $andrewMacmurray$elm_concurrent_task$ConcurrentTask$expectErrors($author$project$WebCrypto$errorDecoder), 18508 m: $andrewMacmurray$elm_concurrent_task$ConcurrentTask$expectJson($elm$json$Json$Decode$bool), 18509 n: 'webcrypto:sig:verifyText' 18510 }); 18511 }); 18512var $author$project$Infra$EventVerification$verifyOne = F2( 18513 function (keys, envelope) { 18514 if ($author$project$Infra$EventVerification$isGenesisEvent(envelope)) { 18515 return $andrewMacmurray$elm_concurrent_task$ConcurrentTask$succeed( 18516 $elm$core$Maybe$Just(envelope)); 18517 } else { 18518 var _v0 = A2($elm$core$Dict$get, envelope.q0, keys); 18519 if (_v0.$ === 1) { 18520 return $andrewMacmurray$elm_concurrent_task$ConcurrentTask$succeed($elm$core$Maybe$Nothing); 18521 } else { 18522 var publicKey = _v0.a; 18523 return A2( 18524 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$onError, 18525 function (_v1) { 18526 return $andrewMacmurray$elm_concurrent_task$ConcurrentTask$succeed($elm$core$Maybe$Nothing); 18527 }, 18528 A2( 18529 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$map, 18530 function (valid) { 18531 return valid ? $elm$core$Maybe$Just(envelope) : $elm$core$Maybe$Nothing; 18532 }, 18533 A3( 18534 $author$project$WebCrypto$Signature$verifyText, 18535 publicKey, 18536 envelope.dU, 18537 $author$project$Domain$Event$canonicalize(envelope)))); 18538 } 18539 } 18540 }); 18541var $author$project$Infra$EventVerification$filterVerifiedEvents = F2( 18542 function (state, events) { 18543 return A2( 18544 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$map, 18545 $elm$core$List$filterMap($elm$core$Basics$identity), 18546 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$batch( 18547 A2( 18548 $elm$core$List$map, 18549 $author$project$Infra$EventVerification$verifyOne( 18550 A2($author$project$Infra$EventVerification$collectKeys, state, events)), 18551 events))); 18552 }); 18553var $author$project$WebCrypto$Symmetric$Key = $elm$core$Basics$identity; 18554var $author$project$WebCrypto$Symmetric$importKey = $elm$core$Basics$identity; 18555var $author$project$Infra$Storage$loadGroupKey = F2( 18556 function (db, groupId) { 18557 return A4( 18558 $author$project$IndexedDb$get, 18559 db, 18560 $author$project$Infra$Storage$groupKeysStore, 18561 $author$project$IndexedDb$StringKey(groupId), 18562 $elm$json$Json$Decode$string); 18563 }); 18564var $author$project$Infra$Storage$loadGroupKeyRequired = F2( 18565 function (db, groupId) { 18566 return A2( 18567 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$andThen, 18568 function (maybeKeyStr) { 18569 if (!maybeKeyStr.$) { 18570 var keyStr = maybeKeyStr.a; 18571 return $andrewMacmurray$elm_concurrent_task$ConcurrentTask$succeed( 18572 $author$project$WebCrypto$Symmetric$importKey(keyStr)); 18573 } else { 18574 return $andrewMacmurray$elm_concurrent_task$ConcurrentTask$fail( 18575 $author$project$IndexedDb$DatabaseError('Missing encryption key for group ' + groupId)); 18576 } 18577 }, 18578 A2($author$project$Infra$Storage$loadGroupKey, db, groupId)); 18579 }); 18580var $author$project$IndexedDb$encodeKeyRange = function (range) { 18581 switch (range.$) { 18582 case 0: 18583 var key = range.a; 18584 return $elm$json$Json$Encode$object( 18585 _List_fromArray( 18586 [ 18587 _Utils_Tuple2( 18588 'type', 18589 $elm$json$Json$Encode$string('only')), 18590 _Utils_Tuple2( 18591 'key', 18592 $author$project$IndexedDb$encodeKey(key)) 18593 ])); 18594 case 1: 18595 var key = range.a; 18596 var isOpen = range.b; 18597 return $elm$json$Json$Encode$object( 18598 _List_fromArray( 18599 [ 18600 _Utils_Tuple2( 18601 'type', 18602 $elm$json$Json$Encode$string('lowerBound')), 18603 _Utils_Tuple2( 18604 'key', 18605 $author$project$IndexedDb$encodeKey(key)), 18606 _Utils_Tuple2( 18607 'open', 18608 $elm$json$Json$Encode$bool(isOpen)) 18609 ])); 18610 case 2: 18611 var key = range.a; 18612 var isOpen = range.b; 18613 return $elm$json$Json$Encode$object( 18614 _List_fromArray( 18615 [ 18616 _Utils_Tuple2( 18617 'type', 18618 $elm$json$Json$Encode$string('upperBound')), 18619 _Utils_Tuple2( 18620 'key', 18621 $author$project$IndexedDb$encodeKey(key)), 18622 _Utils_Tuple2( 18623 'open', 18624 $elm$json$Json$Encode$bool(isOpen)) 18625 ])); 18626 default: 18627 var lower = range.a; 18628 var upper = range.b; 18629 var lowerOpen = range.c; 18630 var upperOpen = range.d; 18631 return $elm$json$Json$Encode$object( 18632 _List_fromArray( 18633 [ 18634 _Utils_Tuple2( 18635 'type', 18636 $elm$json$Json$Encode$string('bound')), 18637 _Utils_Tuple2( 18638 'lower', 18639 $author$project$IndexedDb$encodeKey(lower)), 18640 _Utils_Tuple2( 18641 'upper', 18642 $author$project$IndexedDb$encodeKey(upper)), 18643 _Utils_Tuple2( 18644 'lowerOpen', 18645 $elm$json$Json$Encode$bool(lowerOpen)), 18646 _Utils_Tuple2( 18647 'upperOpen', 18648 $elm$json$Json$Encode$bool(upperOpen)) 18649 ])); 18650 } 18651}; 18652var $author$project$IndexedDb$getIndexName = function (_v0) { 18653 var config = _v0; 18654 return config.bW; 18655}; 18656var $author$project$IndexedDb$getByIndex = F5( 18657 function (db, store, index, range, decoder) { 18658 return $andrewMacmurray$elm_concurrent_task$ConcurrentTask$define( 18659 { 18660 k: $elm$json$Json$Encode$object( 18661 _List_fromArray( 18662 [ 18663 _Utils_Tuple2( 18664 'db', 18665 $elm$json$Json$Encode$string( 18666 $author$project$IndexedDb$getDbName(db))), 18667 _Utils_Tuple2( 18668 'store', 18669 $elm$json$Json$Encode$string( 18670 $author$project$IndexedDb$getStoreName(store))), 18671 _Utils_Tuple2( 18672 'index', 18673 $elm$json$Json$Encode$string( 18674 $author$project$IndexedDb$getIndexName(index))), 18675 _Utils_Tuple2( 18676 'range', 18677 $author$project$IndexedDb$encodeKeyRange(range)) 18678 ])), 18679 l: $andrewMacmurray$elm_concurrent_task$ConcurrentTask$expectErrors($author$project$IndexedDb$errorDecoder), 18680 m: $andrewMacmurray$elm_concurrent_task$ConcurrentTask$expectJson( 18681 $elm$json$Json$Decode$list( 18682 A3( 18683 $elm$json$Json$Decode$map2, 18684 $elm$core$Tuple$pair, 18685 A2($elm$json$Json$Decode$field, 'key', $author$project$IndexedDb$ke
18685yDecoder), 18686 A2($elm$json$Json$Decode$field, 'value', decoder)))), 18687 n: 'indexeddb:getAll' 18688 }); 18689 }); 18690var $author$project$IndexedDb$Only = function (a) { 18691 return {$: 0, a: a}; 18692}; 18693var $author$project$IndexedDb$only = function (key) { 18694 return $author$project$IndexedDb$Only(key); 18695}; 18696var $author$project$Domain$Event$Unknown = {$: 0}; 18697var $elm$json$Json$Decode$map6 = _Json_map6; 18698var $author$project$Domain$Event$CompactionApproved = function (a) { 18699 return {$: 15, a: a}; 18700}; 18701var $author$project$Domain$Event$CompactionProposed = function (a) { 18702 return {$: 14, a: a}; 18703}; 18704var $author$project$Domain$Event$EntryAdded = function (a) { 18705 return {$: 7, a: a}; 18706}; 18707var $author$project$Domain$Event$EntryDeleted = function (a) { 18708 return {$: 9, a: a}; 18709}; 18710var $author$project$Domain$Event$EntryModified = function (a) { 18711 return {$: 8, a: a}; 18712}; 18713var $author$project$Domain$Event$EntryUndeleted = function (a) { 18714 return {$: 10, a: a}; 18715}; 18716var $author$project$Domain$Event$GroupCreated = function (a) { 18717 return {$: 11, a: a}; 18718}; 18719var $author$project$Domain$Event$GroupMetadataUpdated = function (a) { 18720 return {$: 12, a: a}; 18721}; 18722var $author$project$Domain$Event$MemberMetadataUpdated = function (a) { 18723 return {$: 6, a: a}; 18724}; 18725var $author$project$Domain$Event$MemberRenamed = function (a) { 18726 return {$: 2, a: a}; 18727}; 18728var $author$project$Domain$Event$MemberRetired = function (a) { 18729 return {$: 3, a: a}; 18730}; 18731var $author$project$Domain$Event$MemberUnretired = function (a) { 18732 return {$: 4, a: a}; 18733}; 18734var $author$project$Domain$Event$SettlementPreferencesUpdated = function (a) { 18735 return {$: 13, a: a}; 18736}; 18737var $author$project$Domain$Entry$Entry = F2( 18738 function (meta, kind) { 18739 return {gE: kind, gM: meta}; 18740 }); 18741var $author$project$Domain$Entry$Metadata = F7( 18742 function (id, rootId, previousVersionId, depth, isDeleted, createdBy, createdAt) { 18743 return {f2: createdAt, f3: createdBy, dg: depth, m9: id, gB: isDeleted, fg: previousVersionId, aj: rootId}; 18744 }); 18745var $elm$json$Json$Decode$map7 = _Json_map7; 18746var $author$project$Domain$Entry$entryMetadataDecoder = A8( 18747 $elm$json$Json$Decode$map7, 18748 $author$project$Domain$Entry$Metadata, 18749 A2($elm$json$Json$Decode$field, 'id', $elm$json$Json$Decode$string), 18750 A2($elm$json$Json$Decode$field, 'r', $elm$json$Json$Decode$string), 18751 $elm$json$Json$Decode$maybe( 18752 A2($elm$json$Json$Decode$field, 'pv', $elm$json$Json$Decode$string)), 18753 A2($elm$json$Json$Decode$field, 'dp', $elm$json$Json$Decode$int), 18754 A2($elm$json$Json$Decode$field, 'del', $elm$json$Json$Decode$bool), 18755 A2($elm$json$Json$Decode$field, 'cb', $elm$json$Json$Decode$string), 18756 A2( 18757 $elm$json$Json$Decode$field, 18758 'ca', 18759 A2($elm$json$Json$Decode$map, $elm$time$Time$millisToPosix, $elm$json$Json$Decode$int))); 18760var $author$project$Domain$Entry$Expense = function (a) { 18761 return {$: 0, a: a}; 18762}; 18763var $author$project$Domain$Entry$Income = function (a) { 18764 return {$: 2, a: a}; 18765}; 18766var $author$project$Domain$Entry$Transfer = function (a) { 18767 return {$: 1, a: a}; 18768}; 18769var $author$project$Domain$Entry$ExpenseData = function (description) { 18770 return function (amount) { 18771 return function (currency) { 18772 return function (defaultCurrencyAmount) { 18773 return function (date) { 18774 return function (payers) { 18775 return function (beneficiaries) { 18776 return function (category) { 18777 return function (location) { 18778 return function (notes) { 18779 return function (attachments) { 18780 return {ef: amount, ce: attachments, em: beneficiaries, h9: category, bg: currency, cj: date, ck: defaultCurrencyAmount, eE: description, je: location, bu: notes, jB: payers}; 18781 }; 18782 }; 18783 }; 18784 }; 18785 }; 18786 }; 18787 }; 18788 }; 18789 }; 18790 }; 18791}; 18792var $author$project$Domain$Entry$andMap = $elm$json$Json$Decode$map2($elm$core$Basics$apR); 18793var $author$project$Domain$Group$Link = F2( 18794 function (label, url) { 18795 return {i6: label, kS: url}; 18796 }); 18797var $author$project$Domain$Group$linkDecoder = A3( 18798 $elm$json$Json$Decode$map2, 18799 $author$project$Domain$Group$Link, 18800 A2($elm$json$Json$Decode$field, 'l', $elm$json$Json$Decode$string), 18801 A2($elm$json$Json$Decode$field, 'u', $elm$json$Json$Decode$string)); 18802var $author$project$Domain$Entry$attachmentsDecoder = A2( 18803 $elm$json$Json$Decode$map, 18804 $elm$core$Maybe$withDefault(_List_Nil), 18805 $elm$json$Json$Decode$maybe( 18806 A2( 18807 $elm$json$Json$Decode$field, 18808 'att', 18809 $elm$json$Json$Decode$list($author$project$Domain$Group$linkDecoder)))); 18810var $author$project$Domain$Entry$ExactBeneficiary = function (a) { 18811 return {$: 1, a: a}; 18812}; 18813var $author$project$Domain$Entry$ShareBeneficiary = function (a) { 18814 return {$: 0, a: a}; 18815}; 18816var $author$project$Domain$Entry$beneficiaryDecoder = A2( 18817 $elm$json$Json$Decode$andThen, 18818 function (t) { 18819 switch (t) { 18820 case 'share': 18821 return A3( 18822 $elm$json$Json$Decode$map2, 18823 F2( 18824 function (mid, s) { 18825 return $author$project$Domain$Entry$ShareBeneficiary( 18826 {e_: mid, qc: s}); 18827 }), 18828 A2($elm$json$Json$Decode$field, 'm', $elm$json$Json$Decode$string), 18829 A2($elm$json$Json$Decode$field, 's', $elm$json$Json$Decode$int)); 18830 case 'exact': 18831 return A3( 18832 $elm$json$Json$Decode$map2, 18833 F2( 18834 function (mid, a) { 18835 return $author$project$Domain$Entry$ExactBeneficiary( 18836 {ef: a, e_: mid}); 18837 }), 18838 A2($elm$json$Json$Decode$field, 'm', $elm$json$Json$Decode$string), 18839 A2($elm$json$Json$Decode$field, 'a', $elm$json$Json$Decode$int)); 18840 default: 18841 return $elm$json$Json$Decode$fail('Unknown beneficiary type: ' + t); 18842 } 18843 }, 18844 A2($elm$json$Json$Decode$field, 't', $elm$json$Json$Decode$string)); 18845var $author$project$Domain$Entry$Accommodation = 2; 18846var $author$project$Domain$Entry$Entertainment = 3; 18847var $author$project$Domain$Entry$Food = 0; 18848var $author$project$Domain$Entry$Groceries = 5; 18849var $author$project$Domain$Entry$Healthcare = 7; 18850var $author$project$Domain$Entry$Other = 8; 18851var $author$project$Domain$Entry$Shopping = 4;
18852var $author$project$Domain$Entry$Transport = 1; 18853var $author$project$Domain$Entry$Utilities = 6; 18854var $author$project$Domain$Entry$categoryDecoder = A2( 18855 $elm$json$Json$Decode$andThen, 18856 function (s) { 18857 switch (s) { 18858 case 'food': 18859 return $elm$json$Json$Decode$succeed(0); 18860 case 'transport': 18861 return $elm$json$Json$Decode$succeed(1); 18862 case 'accommodation': 18863 return $elm$json$Json$Decode$succeed(2); 18864 case 'entertainment': 18865 return $elm$json$Json$Decode$succeed(3); 18866 case 'shopping': 18867 return $elm$json$Json$Decode$succeed(4); 18868 case 'groceries': 18869 return $elm$json$Json$Decode$succeed(5); 18870 case 'utilities': 18871 return $elm$json$Json$Decode$succeed(6); 18872 case 'healthcare': 18873 return $elm$json$Json$Decode$succeed(7); 18874 case 'other': 18875 return $elm$json$Json$Decode$succeed(8); 18876 default: 18877 return $elm$json$Json$Decode$fail('Unknown category: ' + s); 18878 } 18879 }, 18880 $elm$json$Json$Decode$string); 18881var $author$project$Domain$Date$Date = F3( 18882 function (year, month, day) { 18883 return {y: day, F: month, C: year}; 18884 }); 18885var $author$project$Domain$Date$dateDecoder = A4( 18886 $elm$json$Json$Decode$map3, 18887 $author$project$Domain$Date$Date, 18888 A2($elm$json$Json$Decode$field, 'y', $elm$json$Json$Decode$int), 18889 A2($elm$json$Json$Decode$field, 'mo', $elm$json$Json$Decode$int), 18890 A2($elm$json$Json$Decode$field, 'dy', $elm$json$Json$Decode$int)); 18891var $author$project$Domain$Entry$Payer = F2( 18892 function (memberId, amount) { 18893 return {ef: amount, e_: memberId}; 18894 }); 18895var $author$project$Domain$Entry$payerDecoder = A3( 18896 $elm$json$Json$Decode$map2, 18897 $author$project$Domain$Entry$Payer, 18898 A2($elm$json$Json$Decode$field, 'm', $elm$json$Json$Decode$string), 18899 A2($elm$json$Json$Decode$field, 'a', $elm$json$Json$Decode$int)); 18900var $author$project$Domain$Entry$expenseDataDecoder = A2( 18901 $author$project$Domain$Entry$andMap, 18902 $author$project$Domain$Entry$attachmentsDecoder, 18903 A2( 18904 $author$project$Domain$Entry$andMap, 18905 $elm$json$Json$Decode$maybe( 18906 A2($elm$json$Json$Decode$field, 'nt', $elm$json$Json$Decode$string)), 18907 A2( 18908 $author$project$Domain$Entry$andMap, 18909 $elm$json$Json$Decode$maybe( 18910 A2($elm$json$Json$Decode$field, 'loc', $elm$json$Json$Decode$string)), 18911 A2( 18912 $author$project$Domain$Entry$andMap, 18913 $elm$json$Json$Decode$maybe( 18914 A2($elm$json$Json$Decode$field, 'cat', $author$project$Domain$Entry$categoryDecoder)), 18915 A2( 18916 $author$project$Domain$Entry$andMap, 18917 A2( 18918 $elm$json$Json$Decode$field, 18919 'ben', 18920 $elm$json$Json$Decode$list($author$project$Domain$Entry$beneficiaryDecoder)), 18921 A2( 18922 $author$project$Domain$Entry$andMap, 18923 A2( 18924 $elm$json$Json$Decode$field, 18925 'pay', 18926 $elm$json$Json$Decode$list($author$project$Domain$Entry$payerDecoder)), 18927 A2( 18928 $author$project$Domain$Entry$andMap, 18929 A2($elm$json$Json$Decode$field, 'dt', $author$project$Domain$Date$dateDecoder), 18930 A2( 18931 $author$project$Domain$Entry$andMap, 18932 $elm$json$Json$Decode$maybe( 18933 A2($elm$json$Json$Decode$field, 'dca', $elm$json$Json$Decode$int)), 18934 A2( 18935 $author$project$Domain$Entry$andMap, 18936 A2($elm$json$Json$Decode$field, 'cur', $author$project$Domain$Currency$currencyDecoder), 18937 A2( 18938 $author$project$Domain$Entry$andMap, 18939 A2($elm$json$Json$Decode$field, 'a', $elm$json$Json$Decode$int), 18940 A2( 18941 $author$project$Domain$Entry$andMap, 18942 A2($elm$json$Json$Decode$field, 'desc', $elm$json$Json$Decode$string), 18943 $elm$json$Json$Decode$succeed($author$project$Domain$Entry$ExpenseData)))))))))))); 18944var $author$project$Domain$Entry$IncomeData = F9( 18945 function (description, amount, currency, defaultCurrencyAmount, date, receivedBy, beneficiaries, notes, attachments) { 18946 return {ef: amount, ce: attachments, em: beneficiaries, bg: currency, cj: date, ck: defaultCurrencyAmount, eE: description, bu: notes, j$: receivedBy}
18946; 18947 }); 18948var $author$project$Domain$Entry$incomeDataDecoder = A2( 18949 $author$project$Domain$Entry$andMap, 18950 $author$project$Domain$Entry$attachmentsDecoder, 18951 A2( 18952 $author$project$Domain$Entry$andMap, 18953 $elm$json$Json$Decode$maybe( 18954 A2($elm$json$Json$Decode$field, 'nt', $elm$json$Json$Decode$string)), 18955 A2( 18956 $author$project$Domain$Entry$andMap, 18957 A2( 18958 $elm$json$Json$Decode$field, 18959 'ben', 18960 $elm$json$Json$Decode$list($author$project$Domain$Entry$beneficiaryDecoder)), 18961 A2( 18962 $author$project$Domain$Entry$andMap, 18963 A2($elm$json$Json$Decode$field, 'rb', $elm$json$Json$Decode$string), 18964 A2( 18965 $author$project$Domain$Entry$andMap, 18966 A2($elm$json$Json$Decode$field, 'dt', $author$project$Domain$Date$dateDecoder), 18967 A2( 18968 $author$project$Domain$Entry$andMap, 18969 $elm$json$Json$Decode$maybe( 18970 A2($elm$json$Json$Decode$field, 'dca', $elm$json$Json$Decode$int)), 18971 A2( 18972 $author$project$Domain$Entry$andMap, 18973 A2($elm$json$Json$Decode$field, 'cur', $author$project$Domain$Currency$currencyDecoder), 18974 A2( 18975 $author$project$Domain$Entry$andMap, 18976 A2($elm$json$Json$Decode$field, 'a', $elm$json$Json$Decode$int), 18977 A2( 18978 $author$project$Domain$Entry$andMap, 18979 A2($elm$json$Json$Decode$field, 'desc', $elm$json$Json$Decode$string), 18980 $elm$json$Json$Decode$succeed($author$project$Domain$Entry$IncomeData)))))))))); 18981var $author$project$Domain$Entry$TransferData = F9( 18982 function (description, amount, currency, defaultCurrencyAmount, date, from, to, notes, attachments) { 18983 return {ef: amount, ce: attachments, bg: currency, cj: date, ck: defaultCurrencyAmount, eE: description, iH: from, bu: notes, kE: to}; 18984 }); 18985var $author$project$Domain$Entry$transferDataDecoder = A2( 18986 $author$project$Domain$Entry$andMap, 18987 $author$project$Domain$Entry$attachmentsDecoder, 18988 A2( 18989 $author$project$Domain$Entry$andMap, 18990 $elm$json$Json$Decode$maybe( 18991 A2($elm$json$Json$Decode$field, 'nt', $elm$json$Json$Decode$string)), 18992 A2( 18993 $author$project$Domain$Entry$andMap, 18994 A2($elm$json$Json$Decode$field, 'to', $elm$json$Json$Decode$string), 18995 A2( 18996 $author$project$Domain$Entry$andMap, 18997 A2($elm$json$Json$Decode$field, 'f', $elm$json$Json$Decode$string), 18998 A2( 18999 $author$project$Domain$Entry$andMap, 19000 A2($elm$json$Json$Decode$field, 'dt', $author$project$Domain$Date$dateDecoder), 19001 A2( 19002 $author$project$Domain$Entry$andMap, 19003 $elm$json$Json$Decode$maybe( 19004 A2($elm$json$Json$Decode$field, 'dca', $elm$json$Json$Decode$int)), 19005 A2( 19006 $author$project$Domain$Entry$andMap, 19007 A2($elm$json$Json$Decode$field, 'cur', $author$project$Domain$Currency$currencyDecoder), 19008 A2( 19009 $author$project$Domain$Entry$andMap, 19010 A2($elm$json$Json$Decode$field, 'a', $elm$json$Json$Decode$int), 19011 A2( 19012 $author$project$Domain$Entry$andMap, 19013 $elm$json$Json$Decode$maybe( 19014 A2($elm$json$Json$Decode$field, 'desc', $elm$json$Json$Decode$string)), 19015 $elm$json$Json$Decode$succeed($author$project$Domain$Entry$TransferData)))))))))); 19016var $author$project$Domain$Entry$kindDecoder = A2( 19017 $elm$json$Json$Decode$andThen, 19018 function (t) { 19019 switch (t) { 19020 case 'expense': 19021 return A2( 19022 $elm$json$Json$Decode$map, 19023 $author$project$Domain$Entry$Expense, 19024 A2($elm$json$Json$Decode$field, 'd', $author$project$Domain$Entry$expenseDataDecoder)); 19025 case 'transfer': 19026 return A2( 19027 $elm$json$Json$Decode$map, 19028 $author$project$Domain$Entry$Transfer, 19029 A2($elm$json$Json$Decode$field, 'd', $author$project$Domain$Entry$transferDataDecoder)); 19030 case 'income': 19031 return A2( 19032 $elm$json$Json$Decode$map, 19033 $author$project$Domain$Entry$Income, 19034 A2($elm$json$Json$Decode$field, 'd', $author$project$Domain$Entry$incomeDataDecoder)); 19035 default: 19036 return $elm$json$Json$Decode$fail('Unknown entry kind: ' + t); 19037 } 19038 }, 19039 A2($elm$json$Json$Decode$field, 't', $elm$json$Json$Decode$string)); 19040var $author$project$Domain$Entry$entryDecoder = A3( 19041 $elm$json$Json$Decode$map2, 19042 $author$project$Domain$Entry$Entry, 19043 A2($elm$json$Json$Decode$field, 'm', $author$project$Domain$Entry$entryMetadataDecoder), 19044 A2($elm$json$Json$Decode$field, 'k', $author$project$Domain$Entry$kindDecoder)); 19045var $author$project$Domain$Event$GroupMetadataChange = F4( 19046 function (name, subtitle, description, links) { 19047 return {eE: description, cz: links, bW: name, cY: subtitle}; 19048 }); 19049var $author$project$Domain$Event$maybeFieldAsDoubleMaybe = function (fieldName) { 19050 return $elm$json$Json$Decode$maybe( 19051 A2( 19052 $elm$json$Json$Decode$field, 19053 fieldName, 19054 $elm$json$Json$Decode$oneOf( 19055 _List_fromArray( 19056 [ 19057 $elm$json$Json$Decode$null($elm$core$Maybe$Nothing), 19058 A2($elm$json$Json$Decode$map, $elm$core$Maybe$Just, $elm$json$Json$Decode$string) 19059 ])))); 19060}; 19061var $author$project$Domain$Event$groupMetadataChangeDecoder = A5( 19062 $elm$json$Json$Decode$map4, 19063 $author$project$Domain$Event$GroupMetadataChange, 19064 $elm$json$Json$Decode$maybe( 19065 A2($elm$json$Json$Decode$field, 'n', $elm$json$Json$Decode$string)), 19066 $author$project$Domain$Event$maybeFieldAsDoubleMaybe('sub'), 19067 $author$project$Domain$Event$maybeFieldAsDoubleMaybe('desc'), 19068 $elm$json$Json$Decode$maybe( 19069 A2( 19070 $elm$json$Json$Decode$field, 19071 'lk', 19072 $elm$json$Json$Decode$list($author$project$Domain$Group$linkDecoder)))); 19073var $author$project$Domain$Member$typeDecoder = A2( 19074 $elm$json$Json$Decode$andThen, 19075 function (s) { 19076 switch (s) { 19077 case 'real': 19078 return $elm$json$Json$Decode$succeed(0); 19079 case 'virtual': 19080 return $elm$json$Json$Decode$succeed(1); 19081 default: 19082 return $elm$json$Json$Decode$fail('Unknown member type: ' + s); 19083 } 19084 }, 19085 $elm$json$Json$Decode$string); 19086var $author$project$Domain$Event$payloadDecoder = A2( 19087 $elm$json$Json$Decode$andThen, 19088 function (t) { 19089 switch (t) { 19090 case 'mc': 19091 return A5( 19092 $elm$json$Json$Decode$map4, 19093 F4( 19094 function (mid, name, mt, addedBy) { 19095 return $author$project$Domain$Event$MemberCreated( 19096 {fO: addedBy, e_: mid, nL: mt, bW: name}); 19097 }), 19098 A2($elm$json$Json$Decode$field, 'm', $elm$json$Json$Decode$string), 19099 A2($elm$json$Json$Decode$field, 'n', $elm$json$Json$Decode$string), 19100 A2($elm$json$Json$Decode$field, 'mt', $author$project$Domain$Member$typeDecoder), 19101 A2($elm$json$Json$Decode$field, 'ab', $elm$json$Json$Decode$string)); 19102 case 'mr': 19103 return A4( 19104 $elm$json$Json$Decode$map3, 19105 F3( 19106 function (rid, oldN, newN) { 19107 return $author$project$Domain$Event$MemberRenamed( 19108 {e4: newN, e6: oldN, aj: rid}); 19109 }), 19110 A2($elm$json$Json$Decode$field, 'r', $elm$json$Json$Decode$string), 19111 A2($elm$json$Json$Decode$field, 'on', $elm$json$Json$Decode$string), 19112 A2($elm$json$Json$Decode$field, 'nn', $elm$json$Json$Decode$string)); 19113 case 'mrt': 19114 return A2( 19115 $elm$json$Json$Decode$map, 19116 function (rid) { 19117 return $author$project$Domain$Event$MemberRetired( 19118 {aj: rid}); 19119 }, 19120 A2($elm$json$Json$Decode$field, 'r', $elm$json$Json$Decode$string)); 19121 case 'mur': 19122 return A2( 19123 $elm$json$Json$Decode$map, 19124 function (rid) { 19125 return $author$project$Domain$Event$MemberUnretired( 19126 {aj: rid}); 19127 }, 19128 A2($elm$json$Json$Decode$field, 'r', $elm$json$Json$Decode$string)); 19129 case 'ml': 19130 return A4( 19131 $elm$json$Json$Decode$map3, 19132 F3( 19133 function (rid, deviceId, seq) { 19134 return $author$project$Domain$Event$MemberLinked(
19135 {gd: deviceId, aj: rid, kg: seq}); 19136 }), 19137 A2($elm$json$Json$Decode$field, 'r', $elm$json$Json$Decode$string), 19138 A2($elm$json$Json$Decode$field, 'd', $elm$json$Json$Decode$string), 19139 A2($elm$json$Json$Decode$field, 'sq', $elm$json$Json$Decode$int)); 19140 case 'mmu': 19141 return A3( 19142 $elm$json$Json$Decode$map2, 19143 F2( 19144 function (rid, meta) { 19145 return $author$project$Domain$Event$MemberMetadataUpdated( 19146 {ji: meta, aj: rid}); 19147 }), 19148 A2($elm$json$Json$Decode$field, 'r', $elm$json$Json$Decode$string), 19149 A2($elm$json$Json$Decode$field, 'md', $author$project$Domain$Member$metadataDecoder)); 19150 case 'ea': 19151 return A2( 19152 $elm$json$Json$Decode$map, 19153 $author$project$Domain$Event$EntryAdded, 19154 A2($elm$json$Json$Decode$field, 'e', $author$project$Domain$Entry$entryDecoder)); 19155 case 'em': 19156 return A2( 19157 $elm$json$Json$Decode$map, 19158 $author$project$Domain$Event$EntryModified, 19159 A2($elm$json$Json$Decode$field, 'e', $author$project$Domain$Entry$entryDecoder)); 19160 case 'ed': 19161 return A2( 19162 $elm$json$Json$Decode$map, 19163 function (rid) { 19164 return $author$project$Domain$Event$EntryDeleted( 19165 {aj: rid}); 19166 }, 19167 A2($elm$json$Json$Decode$field, 'r', $elm$json$Json$Decode$string)); 19168 case 'eu': 19169 return A2( 19170 $elm$json$Json$Decode$map, 19171 function (rid) { 19172 return $author$project$Domain$Event$EntryUndeleted( 19173 {aj: rid}); 19174 }, 19175 A2($elm$json$Json$Decode$field, 'r', $elm$json$Json$Decode$string)); 19176 case 'gc': 19177 return A3( 19178 $elm$json$Json$Decode$map2, 19179 F2( 19180 function (n, c) { 19181 return $author$project$Domain$Event$GroupCreated( 19182 {il: c, bW: n}); 19183 }), 19184 A2($elm$json$Json$Decode$field, 'n', $elm$json$Json$Decode$string), 19185 A2($elm$json$Json$Decode$field, 'dc', $author$project$Domain$Currency$currencyDecoder)); 19186 case 'gmu': 19187 return A2( 19188 $elm$json$Json$Decode$map, 19189 $author$project$Domain$Event$GroupMetadataUpdated, 19190 A2($elm$json$Json$Decode$field, 'c', $author$project$Domain$Event$groupMetadataChangeDecoder)); 19191 case 'spu': 19192 return A3( 19193 $elm$json$Json$Decode$map2, 19194 F2( 19195 function (rid, prefs) { 19196 return $author$project$Domain$Event$SettlementPreferencesUpdated( 19197 {e$: rid, pB: prefs}); 19198 }), 19199 A2($elm$json$Json$Decode$field, 'mr', $elm$json$Json$Decode$string), 19200 A2( 19201 $elm$json$Json$Decode$field, 19202 'pr', 19203 $elm$json$Json$Decode$list($elm$json$Json$Decode$string))); 19204 case 'cp': 19205 return A4( 19206 $elm$json$Json$Decode$map3, 19207 F3( 19208 function (upto, count, hash) { 19209 return $author$project$Domain$Event$CompactionProposed( 19210 {bK: count, gI: hash, hx: upto}); 19211 }), 19212 A2($elm$json$Json$Decode$field, 'u', $elm$json$Json$Decode$string), 19213 A2($elm$json$Json$Decode$field, 'n', $elm$json$Json$Decode$int), 19214 A2($elm$json$Json$Decode$field, 'h', $elm$json$Json$Decode$string)); 19215 case 'ca': 19216 return A2( 19217 $elm$json$Json$Decode$map, 19218 function (pid) { 19219 return $author$project$Domain$Event$CompactionApproved( 19220 {cN: pid}); 19221 }, 19222 A2($elm$json$Json$Decode$field, 'pid', $elm$json$Json$Decode$string)); 19223 default: 19224 return $elm$json$Json$Decode$fail('Unknown payload type: ' + t); 19225 } 19226 }, 19227 A2($elm$json$Json$Decode$field, 't', $elm$json$Json$Decode$string)); 19228var $author$project$Domain$Event$envelopeDecoder = A2( 19229 $elm$json$Json$Decode$andThen, 19230 function (raw) { 19231 return A7( 19232 $elm$json$Json$Decode$map6, 19233 F6( 19234 function (id, ts, by, v, key, _v0) { 19235 var p = _v0.a; 19236 var sig = _v0.b; 19237 return {ej: key, lT: ts, m9: id, jC: p, jZ: raw, dU: sig, q0: by, fK: v}; 19238 }), 19239 A2($elm$json$Json$Decode$field, 'id', $elm$json$Json$Decode$string), 19240 A2( 19241 $elm$json$Json$Decode$field, 19242 'ts', 19243 A2($elm$json$Json$Decode$map, $elm$time$Time$millisToPosix, $elm$json$Json$Decode$int)), 19244 A2($elm$json$Json$Decode$field, 'by', $elm$json$Json$Decode$string), 19245 $elm$json$Json$Decode$oneOf( 19246 _List_fromArray( 19247 [ 19248 A2($elm$json$Json$Decode$field, 'v', $elm$json$Json$Decode$int), 19249 $elm$json$Json$Decode$succeed(1) 19250 ])), 19251 $elm$json$Json$Decode$oneOf( 19252 _List_fromArray( 19253 [ 19254 A2( 19255 $elm$json$Json$Decode$map, 19256 $elm$core$Maybe$Just, 19257 A2($elm$json$Json$Decode$field, 'key', $elm$json$Json$Decode$string)), 19258 $elm$json$Json$Decode$succeed($elm$core$Maybe$Nothing) 19259 ])), 19260 A3( 19261 $elm$json$Json$Decode$map2, 19262 $elm$core$Tuple$pair, 19263 A2( 19264 $elm$json$Json$Decode$field, 19265 'p', 19266 $elm$json$Json$Decode$oneOf( 19267 _List_fromArray( 19268 [ 19269 $author$project$Domain$Event$payloadDecoder, 19270 $elm$json$Json$Decode$succeed($author$project$Domain$Event$Unknown) 19271 ]))), 19272 A2($elm$json$Json$Decode$field, 'sig', $elm$json$Json$Decode$string))); 19273 }, 19274 $elm$json$Json$Decode$value); 19275var $author$project$Infra$Storage$storedEventDecoder = A3( 19276 $elm$json$Json$Decode$map2, 19277 F2( 19278 function (envelope, pushState) { 19279 return {eH: envelope, jR: pushState}; 19280 }), 19281 A2($elm$json$Json$Decode$field, 'env', $author$project$Domain$Event$envelopeDecoder), 19282 $elm$json$Json$Decode$oneOf( 19283 _List_fromArray( 19284 [ 19285 A2( 19286 $elm$json$Json$Decode$map, 19287 function (unpushed) { 19288 return unpushed ? 0 : 1; 19289 }, 19290 A2($elm$json$Json$Decode$field, 'unpushed', $elm$json$Json$Decode$bool)), 19291 $elm$json$Json$Decode$succeed(1) 19292 ]))); 19293var $author$project$Infra$Storage$loadStoredEvents = F2( 19294 function (db, groupId) { 19295 return A2( 19296 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$map, 19297 $elm$core$List$map($elm$core$Tuple$second), 19298 A5( 19299 $author$project$IndexedDb$getByIndex, 19300 db, 19301 $author$project$Infra$Storage$eventsStore, 19302 $author$project$Infra$Storage$byGroupIdIndex, 19303 $author$project$IndexedDb$only( 19304 $author$project$IndexedDb$StringKey(groupId)), 19305 $author$project$Infra$Storage$storedEventDecoder)); 19306 }); 19307var $author$project$Infra$Storage$loadSuspicionDismissals = F2( 19308 function (db, groupId) { 19309 return A2( 19310 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$map, 19311 A2( 19312 $elm$core$Basics$composeR, 19313 $elm$core$Maybe$map($elm$core$Set$fromList),
19314 $elm$core$Maybe$withDefault($elm$core$Set$empty)), 19315 A4( 19316 $author$project$IndexedDb$get, 19317 db, 19318 $author$project$Infra$Storage$suspicionDismissalsStore, 19319 $author$project$IndexedDb$StringKey(groupId), 19320 $elm$json$Json$Decode$list($elm$json$Json$Decode$string))); 19321 }); 19322var $author$project$Domain$Group$SyncCursor = F2( 19323 function (seq, epoch) { 19324 return {mt: epoch, kg: seq}; 19325 }); 19326var $author$project$Infra$Storage$loadSyncCursor = F2( 19327 function (db, groupId) { 19328 return A2( 19329 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$map, 19330 $elm$core$Maybe$andThen($elm$core$Basics$identity), 19331 A4( 19332 $author$project$IndexedDb$get, 19333 db, 19334 $author$project$Infra$Storage$syncCursorsStore, 19335 $author$project$IndexedDb$StringKey(groupId), 19336 $elm$json$Json$Decode$oneOf( 19337 _List_fromArray( 19338 [ 19339 A2( 19340 $elm$json$Json$Decode$map, 19341 $elm$core$Maybe$Just, 19342 A3( 19343 $elm$json$Json$Decode$map2, 19344 $author$project$Domain$Group$SyncCursor, 19345 A2($elm$json$Json$Decode$field, 'seq', $elm$json$Json$Decode$int), 19346 A2($elm$json$Json$Decode$field, 'epoch', $elm$json$Json$Decode$string))), 19347 $elm$json$Json$Decode$succeed($elm$core$Maybe$Nothing) 19348 ])))); 19349 }); 19350var $author$project$Domain$TamperSignals$TamperSignals = F5( 19351 function (forgedAuthors, rateLimitHits, resetsWithLoss, manifestMismatches, lastDetectedAt) { 19352 return {bm: forgedAuthors, bT: lastDetectedAt, cC: manifestMismatches, bZ: rateLimitHits, cP: resetsWithLoss}; 19353 }); 19354var $author$project$Domain$TamperSignals$optional = F3( 19355 function (key, inner, fallback) { 19356 return $elm$json$Json$Decode$oneOf( 19357 _List_fromArray( 19358 [ 19359 A2($elm$json$Json$Decode$field, key, inner), 19360 $elm$json$Json$Decode$succeed(fallback) 19361 ])); 19362 }); 19363var $author$project$Domain$TamperSignals$decoder = A6( 19364 $elm$json$Json$Decode$map5, 19365 $author$project$Domain$TamperSignals$TamperSignals, 19366 A3( 19367 $author$project$Domain$TamperSignals$optional, 19368 'fa', 19369 $elm$json$Json$Decode$dict($elm$json$Json$Decode$int), 19370 $elm$core$Dict$empty), 19371 A3($author$project$Domain$TamperSignals$optional, 'rl', $elm$json$Json$Decode$int, 0), 19372 A3($author$project$Domain$TamperSignals$optional, 'rw', $elm$json$Json$Decode$int, 0), 19373 A3($author$project$Domain$TamperSignals$optional, 'mm', $elm$json$Json$Decode$int, 0), 19374 $elm$json$Json$Decode$maybe( 19375 A2( 19376 $elm$json$Json$Decode$map, 19377 $elm$time$Time$millisToPosix, 19378 A2($elm$json$Json$Decode$field, 'at', $elm$json$Json$Decode$int)))); 19379var $author$project$Domain$TamperSignals$empty = {bm: $elm$core$Dict$empty, bT: $elm$core$Maybe$Nothing, cC: 0, bZ: 0, cP: 0}; 19380var $author$project$Infra$Storage$loadTamperSignals = F2( 19381 function (db, groupId) { 19382 return A2( 19383 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$map, 19384 $elm$core$Maybe$withDefault($author$project$Domain$TamperSignals$empty), 19385 A4( 19386 $author$project$IndexedDb$get, 19387 db, 19388 $author$project$Infra$Storage$tamperSignalsStore, 19389 $author$project$IndexedDb$StringKey(groupId), 19390 $author$project$Domain$TamperSignals$decoder)); 19391 }); 19392var $andrewMacmurray$elm_concurrent_task$ConcurrentTask$map4 = F5( 19393 function (f, a, b, c, d) { 19394 return A2( 19395 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$andMap, 19396 d, 19397 A2( 19398 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$andMap, 19399 c, 19400 A2( 19401 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$andMap, 19402 b, 19403 A2( 19404 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$andMap, 19405 a, 19406 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$succeed(f))))); 19407 }); 19408var $author$project$Infra$Storage$loadGroup = F2( 19409 function (db, groupId) { 19410 return A5( 19411 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$map4, 19412 F4( 19413 function (stored, key, cursor, _v0) { 19414 var signals = _v0.a; 19415 var dismissals = _v0.b; 19416 return { 19417 iC: A2( 19418 $elm$core$List$map, 19419 function ($) { 19420 return $.eH; 19421 }, 19422 stored), 19423 gs: key, 19424 kw: dismissals, 19425 cZ: cursor, 19426 c_: signals, 19427 bC: $elm$core$Set$fromList( 19428 A2( 19429 $elm$core$List$filterMap, 19430 function (e) { 19431 return (!e.jR) ? $elm$core$Maybe$Just(e.eH.m9) : $elm$core$Maybe$Nothing; 19432 }, 19433 stored)) 19434 }; 19435 }), 19436 A2($author$project$Infra$Storage$loadStoredEvents, db, groupId), 19437 A2($author$project$Infra$Storage$loadGroupKeyRequired, db, groupId), 19438 A2($author$project$Infra$Storage$loadSyncCursor, db, groupId), 19439 A3( 19440 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$map2, 19441 $elm$core$Tuple$pair, 19442 A2($author$project$Infra$Storage$loadTamperSignals, db, groupId), 19443 A2($author$project$Infra$Storage$loadSuspicionDismissals, db, groupId))); 19444 }); 19445var $author$project$Infra$Server$CryptoError = function (a) { 19446 return {$: 1, a: a}; 19447}; 19448var $author$project$Infra$Crypto$base64UrlChar = function (i) { 19449 var _v0 = $elm$core$String$uncons( 19450 A3($elm$core$String$slice, i, i + 1, 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_')); 19451 if (!_v0.$) { 19452 var _v1 = _v0.a; 19453 var c = _v1.a; 19454 return c; 19455 } else { 19456 return 'A'; 19457 } 19458}; 19459var $author$project$Infra$Crypto$encodeBase64UrlHelper = F2( 19460 function (bytes, acc) { 19461 encodeBase64UrlHelper: 19462 while (true) { 19463 if (bytes.b) { 19464 if (bytes.b.b) { 19465 if (bytes.b.b.b) { 19466 var a = bytes.a; 19467 var _v1 = bytes.b; 19468 var b = _v1.a; 19469 var _v2 = _v1.b; 19470 var c = _v2.a; 19471 var rest = _v2.b; 19472 var n = ((a << 16) | (b << 8)) | c; 19473 var $temp$bytes = rest, 19474 $temp$acc = A2( 19475 $elm$core$List$cons, 19476 $author$project$Infra$Crypto$base64UrlChar(n & 63), 19477 A2( 19478 $elm$core$List$cons, 19479 $author$project$Infra$Crypto$base64UrlChar((n >> 6) & 63), 19480 A2( 19481 $elm$core$List$cons, 19482 $author$project$Infra$Crypto$base64UrlChar((n >> 12) & 63), 19483 A2( 19484 $elm$core$List$cons, 19485 $author$project$Infra$Crypto$base64UrlChar((n >> 18) & 63), 19486 acc)))); 19487 bytes = $temp$bytes; 19488 acc = $temp$acc; 19489 continue encodeBase64UrlHelper; 19490 } else { 19491 var a = bytes.a; 19492 var _v3 = bytes.b; 19493 var b = _v3.a; 19494 var n = (a << 16) | (b << 8); 19495 return A2( 19496 $elm$core$List$cons, 19497 $author$project$Infra$Crypto$base64UrlChar((n >> 6) & 63), 19498 A2( 19499 $elm$core$List$cons, 19500 $author$project$Infra$Crypto$base64UrlChar((n >> 12) & 63), 19501 A2( 19502 $elm$core$List$cons, 19503 $author$project$Infra$Crypto$base64UrlChar((n >> 18) & 63), 19504 acc))); 19505 } 19506 } else { 19507 var a = bytes.a; 19508 var n = a << 16; 19509 return A2( 19510 $elm$core$List$cons, 19511 $author$project$Infra$Crypto$base64UrlChar((n >> 12) & 63), 19512 A2( 19513 $elm$core$List$cons, 19514 $author$project$Infra$Crypto$base64UrlChar((n >> 18) & 63), 19515 acc)); 19516 } 19517 } else { 19518 return acc; 19519 } 19520 } 19521 }); 19522var $author$project$Infra$Crypto$bytesToBase64Url = function (bytes) { 19523 return $elm$core$String$fromList( 19524 $elm$core$List$reverse( 19525 A2($author$project$Infra$Crypto$encodeBase64UrlHelper, bytes, _List_Nil))); 19526}; 19527var $author$project$Infra$Crypto$hexCharToInt = function (c) { 19528 return ((c >= '0') && (c <= '9')) ? ($elm$core$Char$toCode(c) - $elm$core$Char$toCode('0')) : (((c >= 'a') && (c <= 'f')) ? ((10 + $elm$core$Char$toCode(c)) - $elm$core$Char$toCode('a')) : (((c >= 'A') && (c <= 'F')) ? ((10 + $elm$core$Char$toCode(c)) - $elm$core$Char$toCode('A')) : 0)); 19529}; 19530var $author$project$Infra$Crypto$hexToByteListHelper = F2( 19531 function (chars, acc) { 19532 hexToByteListHelper: 19533 while (true) { 19534 if (chars.b && chars.b.b) { 19535 var hi = chars.a; 19536 var _v1 = chars.b; 19537 var lo = _v1.a; 19538 var rest = _v1.b; 19539 var $temp$chars = rest, 19540 $temp$acc = A2( 19541 $elm$core$List$cons, 19542 ($author$project$Infra$Crypto$hexCharToInt(hi) * 16) + $author$project$Infra$Crypto$hexCharToInt(lo), 19543 acc); 19544 chars = $temp$chars; 19545 acc = $temp$acc; 19546 continue hexToByteListHelper; 19547 } else { 19548 return acc; 19549 } 19550 } 19551 }); 19552var $author$project$Infra$Crypto$hexToByteList = function (hex) { 19553 return $elm$core$List$reverse( 19554 A2( 19555 $author$project$Infra$Crypto$hexToByteListHelper, 19556 $elm$core$String$toList(hex), 19557 _List_Nil)); 19558}; 19559var $author$project$Infra$Crypto$hexToBase64Url = function (hex) { 19560 return $author$project$Infra$Crypto$bytesToBase64Url( 19561 $author$project$Infra$Crypto$hexToByteList(hex)); 19562}; 19563var $author$project$Infra$Crypto$deriveRelaySecret = function (key) { 19564 return A2( 19565 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$map, 19566 $author$project$Infra$Crypto$hexToBase64Url, 19567 $author$project$WebCrypto$sha256(
19568 $author$project$WebCrypto$Symmetric$exportKey(key))); 19569}; 19570var $author$project$Infra$Crypto$deriveNotifyTopic = F2( 19571 function (key, memberRootId) { 19572 return A2( 19573 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$map, 19574 $author$project$Infra$Crypto$hexToBase64Url, 19575 $author$project$WebCrypto$sha256( 19576 'partage-notify-topic-v1' + ($author$project$WebCrypto$Symmetric$exportKey(key) + memberRootId))); 19577 }); 19578var $author$project$WebCrypto$Symmetric$EncryptedData = F2( 19579 function (ciphertext, iv) { 19580 return {f$: ciphertext, gD: iv}; 19581 }); 19582var $author$project$WebCrypto$Symmetric$encryptedDataDecoder = A3( 19583 $elm$json$Json$Decode$map2, 19584 $author$project$WebCrypto$Symmetric$EncryptedData, 19585 A2($elm$json$Json$Decode$field, 'ciphertext', $elm$json$Json$Decode$string), 19586 A2($elm$json$Json$Decode$field, 'iv', $elm$json$Json$Decode$string)); 19587var $author$project$WebCrypto$Symmetric$encrypt = F2( 19588 function (key, data) { 19589 return $andrewMacmurray$elm_concurrent_task$ConcurrentTask$define( 19590 { 19591 k: $elm$json$Json$Encode$object( 19592 _List_fromArray( 19593 [ 19594 _Utils_Tuple2( 19595 'key', 19596 $elm$json$Json$Encode$string( 19597 $author$project$WebCrypto$Symmetric$exportKey(key))), 19598 _Utils_Tuple2( 19599 'data', 19600 A2($elm$json$Json$Encode$list, $elm$json$Json$Encode$int, data)) 19601 ])), 19602 l: $andrewMacmurray$elm_concurrent_task$ConcurrentTask$expectErrors($author$project$WebCrypto$errorDecoder), 19603 m: $andrewMacmurray$elm_concurrent_task$ConcurrentTask$expectJson($author$project$WebCrypto$Symmetric$encryptedDataDecoder), 19604 n: 'webcrypto:sym:encrypt' 19605 }); 19606 }); 19607var $author$project$WebCrypto$Symmetric$encryptString = F2( 19608 function (key, plaintext) { 19609 return A2( 19610 $author$project$WebCrypto$Symmetric$encrypt, 19611 key, 19612 $author$project$WebCrypto$Internal$stringToBytes(plaintext)); 19613 }); 19614var $andrewMacmurray$elm_concurrent_task$ConcurrentTask$Http$ExpectWhatever = function (a) { 19615 return {$: 3, a: a}; 19616}; 19617var $andrewMacmurray$elm_concurrent_task$ConcurrentTask$Http$expectWhatever = $andrewMacmurray$elm_concurrent_task$ConcurrentTask$Http$ExpectWhatever( 19618 $elm$json$Json$Decode$succeed(0)); 19619var $author$project$Infra$PushServer$fallbackBody = A2( 19620 $elm$core$String$join, 19621 ' · ', 19622 A2( 19623 $elm$core$List$map, 19624 function (lang) { 19625 return $author$project$Translations$notificationGeneric( 19626 $author$project$Translations$init(lang)); 19627 }, 19628 $author$project$Translations$languages)); 19629var $andrewMacmurray$elm_concurrent_task$ConcurrentTask$Http$StringBody = F2( 19630 function (a, b) { 19631 return {$: 1, a: a, b: b}; 19632 }); 19633var $andrewMacmurray$elm_concurrent_task$ConcurrentTask$Http$stringBody = $andrewMacmurray$elm_concurrent_task$ConcurrentTask$Http$StringBody; 19634var $andrewMacmurray$elm_concurrent_task$ConcurrentTask$Http$jsonBody = function (value) { 19635 return A2( 19636 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$Http$stringBody, 19637 'application/json', 19638 A2($elm$json$Json$Encode$encode, 0, value)); 19639}; 19640var $andrewMacmurray$elm_concurrent_task$ConcurrentTask$Http$post = function (options) { 19641 return $andrewMacmurray$elm_concurrent_task$ConcurrentTask$Http$request( 19642 {fY: options.fY, m: options.m, mY: options.mY, nN: 'POST', qQ: options.qQ, kS: options.kS}); 19643}; 19644var $author$project$Translations$shellPartage = function (_v0) { 19645 var lang = _v0; 19646 if (!lang) { 19647 return 'Partage'; 19648 } else { 19649 return 'Partage'; 19650 } 19651}; 19652var $author$project$Infra$PushServer$notifyTopic = F3( 19653 function (pushServerUrl, topic, encrypted) { 19654 return $andrewMacmurray$elm_concurrent_task$ConcurrentTask$Http$post( 19655 { 19656 fY: $andrewMacmurray$elm_concurrent_task$ConcurrentTask$Http$jsonBody( 19657 $elm$json$Json$Encode$object( 19658 _List_fromArray( 19659 [ 19660 _Utils_Tuple2( 19661 'title', 19662 $elm$json$Json$Encode$string( 19663 $author$project$Translations$shellPartage( 19664 $author$project$Translations$init(0)))), 19665 _Utils_Tuple2( 19666 'body', 19667 $elm$json$Json$Encode$string($author$project$Infra$PushServer$fallbackBody)), 19668 _Utils_Tuple2( 19669 'tag', 19670 $elm$json$Json$Encode$string(topic)), 19671 _Utils_Tuple2( 19672 'icon', 19673 $elm$json$Json$Encode$string('/icon-192.png')), 19674 _Utils_Tuple2( 19675 'legacy', 19676 $elm$json$Json$Encode$bool(true)), 19677 _Utils_Tuple2( 19678 'data', 19679 $elm$json$Json$Encode$object( 19680 _List_fromArray( 19681 [ 19682 _Utils_Tuple2( 19683 'v', 19684 $elm$json$Json$Encode$int(1)), 19685 _Utils_Tuple2( 19686 'iv', 19687 $elm$json$Json$Encode$string(encrypted.gD)), 19688 _Utils_Tuple2( 19689 'ct', 19690 $elm$json$Json$Encode$string(encrypted.f$)), 19691 _Utils_Tuple2( 19692 'url', 19693 $elm$json$Json$Encode$string('/groups#n=' + topic)) 19694 ]))) 19695 ]))), 19696 m: $andrewMacmurray$elm_concurrent_task$ConcurrentTask$Http$expectWhatever, 19697 mY: _List_Nil, 19698 qQ: $elm$core$Maybe$Nothing, 19699 kS: pushServerUrl + ('/topics/' + (topic + '/notify')) 19700 }); 19701 }); 19702var $author$project$Domain$Currency$currencySymbol = function (currency) { 19703 switch (currency) { 19704 case 0: 19705 return '$'; 19706 case 1: 19707 return 'â¬'; 19708 case 2: 19709 return '£'; 19710 case 3: 19711 return 'CHF'; 19712 case 4: 19713 return 'Â¥'; 19714 case 5: 19715 return 'A$'; 19716 case 6: 19717 return 'C$'; 19718 case 7: 19719 return 'NZ$'; 19720 case 8: 19721 return 'R$'; 19722 default: 19723 return 'AR$'; 19724 } 19725}; 19726var $author$project$ActivityPhrase$params = function (p) { 19727 switch (p.$) { 19728 case 0: 19729 return _List_Nil; 19730 case 1: 19731 var description = p.a; 19732 return _List_fromArray( 19733 [ 19734 _Utils_Tuple2('description', description) 19735 ]); 19736 case 2: 19737 var description = p.a; 19738 return _List_fromArray( 19739 [ 19740 _Utils_Tuple2('description', description) 19741 ]); 19742 case 3: 19743 var description = p.a; 19744 return _List_fromArray( 19745 [ 19746 _Utils_Tuple2('description', description) 19747 ]); 19748 case 4: 19749 var description = p.a; 19750 return _List_fromArray( 19751 [ 19752 _Utils_Tuple2('description', description) 19753 ]); 19754 case 5: 19755 return _List_Nil; 19756 case 6: 19757 return _List_Nil; 19758 case 7: 19759 var description = p.a; 19760 return _List_fromArray( 19761 [ 19762 _Utils_Tuple2('description', description) 19763 ]); 19764 case 8: 19765 var description = p.a; 19766 return _List_fromArray( 19767 [ 19768 _Utils_Tuple2('description', description) 19769 ]); 19770 case 9: 19771 var name = p.a; 19772 return _List_fromArray( 19773 [ 19774 _Utils_Tuple2('name', name) 19775 ]); 19776 case 10: 19777 var name = p.a; 19778 return _List_fromArray( 19779 [ 19780 _Utils_Tuple2('name', name) 19781 ]); 19782 case 11: 19783 var name = p.a; 19784 return _List_fromArray( 19785 [ 19786 _Utils_Tuple2('name', name) 19787 ]); 19788 case 12: 19789 var names = p.a; 19790 return _List_fromArray( 19791 [ 19792 _Utils_Tuple2('oldName', names.e6), 19793 _Utils_Tuple2('newName', names.e4) 19794 ]); 19795 case 13: 19796 var name = p.a; 19797 return _List_fromArray( 19798 [ 19799 _Utils_Tuple2('name', name) 19800 ]); 19801 case 14: 19802 var name = p.a; 19803 return _List_fromArray( 19804 [ 19805 _Utils_Tuple2('name', name) 19806 ]); 19807 case 15: 19808 var name = p.a; 19809 return _List_fromArray( 19810 [ 19811 _Utils_Tuple2('name', name) 19812 ]); 19813 case 16: 19814 return _List_Nil; 19815 case 17: 19816 return _List_Nil; 19817 default: 19818 var name = p.a; 19819 return _List_fromArray( 19820 [ 19821 _Utils_Tuple2('name', name) 19822 ]); 19823 } 19824}; 19825var $author$project$ActivityPhrase$entryAmount = function (entry) { 19826 var _v0 = entry.gE; 19827 switch (_v0.$) { 19828 case 0: 19829 var data = _v0.a; 19830 return {da: data.ef, bg: data.bg}; 19831 case 1: 19832 var data = _v0.a; 19833 return {da: data.ef, bg: data.bg}; 19834 default: 19835 var data = _v0.a; 19836 return {da: data.ef, bg: data.bg}; 19837 } 19838}; 19839var $author$project$ActivityPhrase$phrase = function (detail) { 19840 switch (detail.$) { 19841 case 0: 19842 return _Utils_Tuple2($author$project$ActivityPhrase$Unknown, $elm$core$Maybe$Nothing); 19843 case 1: 19844 var data = detail.a; 19845 var _v1 = data.aR.gE; 19846 switch (_v1.$) { 19847 case 0: 19848 var exp = _v1.a; 19849 return _Utils_Tuple2( 19850 $author$project$ActivityPhrase$EntryAdded(exp.eE), 19851 $elm$core$Maybe$Just( 19852 $author$project$ActivityPhrase$entryAmount(data.aR))); 19853 case 2: 19854 var inc = _v1.a; 19855 return _Utils_Tuple2( 19856 $author$project$ActivityPhrase$IncomeAdded(inc.eE), 19857 $elm$core$Maybe$Just( 19858 $author$project$ActivityPhrase$entryAmount(data.aR))); 19859 default: 19860 return _Utils_Tuple2( 19861 $author$project$ActivityPhrase$TransferAdded, 19862 $elm$core$Maybe$Just( 19863 $author$project$ActivityPhrase$entryAmount(data.aR))); 19864 } 19865 case 2: 19866 var data = detail.a; 19867 var _v2 = data.aR.gE; 19868 switch (_v2.$) { 19869 case 0: 19870 var exp = _v2.a; 19871 return _Utils_Tuple2( 19872 $author$project$ActivityPhrase$EntryModified(exp.eE), 19873 $elm$core$Maybe$Just( 19874 $author$project$ActivityPhrase$entryAmount(data.aR))); 19875 case 2: 19876 var inc = _v2.a; 19877 return _Utils_Tuple2( 19878 $author$project$ActivityPhrase$IncomeModified(inc.eE), 19879 $elm$core$Maybe$Just( 19880 $author$project$ActivityPhrase$entryAmount(data.aR))); 19881 default: 19882 return _Utils_Tuple2( 19883 $author$project$ActivityPhrase$TransferModified, 19884 $elm$core$Maybe$Just( 19885 $author$project$ActivityPhrase$entryAmount(data.aR))); 19886 } 19887 case 3: 19888 var data = detail.a; 19889 return _Utils_Tuple2( 19890 $author$project$ActivityPhrase$TransferAdded, 19891 $elm$core$Maybe$Just( 19892 $author$project$ActivityPhrase$entryAmount(data.aR))); 19893 case 4: 19894 var data = detail.a; 19895 return _Utils_Tuple2( 19896 $author$project$ActivityPhrase$TransferModified, 19897 $elm$core$Maybe$Just( 19898 $author$project$ActivityPhrase$entryAmount(data.aR))); 19899 case 5: 19900 var data = detail.a; 19901 return _Utils_Tuple2( 19902 $author$project$ActivityPhrase$EntryDeleted(data.iv), 19903 $elm$core$Maybe$Nothing); 19904 case 6: 19905 var data = detail.a; 19906 return _Utils_Tuple2( 19907 $author$project$ActivityPhrase$EntryUndeleted(data.iv), 19908 $elm$core$Maybe$Nothing); 19909 case 7: 19910 var data = detail.a; 19911 var _v3 = data.nL; 19912 if (!_v3) { 19913 return _Utils_Tuple2( 19914 $author$project$ActivityPhrase$MemberCreated(data.bW), 19915 $elm$core$Maybe$Nothing); 19916 } else { 19917 return _Utils_Tuple2( 19918 $author$project$ActivityPhrase$MemberCreatedVirtual(data.bW), 19919 $elm$core$Maybe$Nothing); 19920 } 19921 case 8: 19922 var data = detail.a; 19923 return _Utils_Tuple2( 19924 $author$project$ActivityPhrase$MemberLinked(data.bW), 19925 $elm$core$Maybe$Nothing); 19926 case 9: 19927 var data = detail.a; 19928 return _Utils_Tuple2( 19929 $author$project$ActivityPhrase$MemberRenamed( 19930 {e4: data.e4, e6: data.e6}), 19931 $elm$core$Maybe$Nothing); 19932 case 10: 19933 var data = detail.a; 19934 return _Utils_Tuple2( 19935 $author$project$ActivityPhrase$MemberRetired(data.bW), 19936 $elm$core$Maybe$Nothing); 19937 case 11: 19938 var data = detail.a; 19939 return _Utils_Tuple2( 19940 $author$project$ActivityPhrase$MemberUnretired(data.bW), 19941 $elm$core$Maybe$Nothing); 19942 case 12: 19943 var data = detail.a; 19944 return _Utils_Tuple2( 19945 $author$project$ActivityPhrase$MemberMetadataUpdated(data.bW), 19946 $elm$core$Maybe$Nothing); 19947 case 13: 19948 return _Utils_Tuple2($author$project$ActivityPhrase$GroupCreated, $elm$core$Maybe$Nothing); 19949 case 14: 19950 return _Utils_Tuple2($author$project$ActivityPhrase$GroupMetadataUpdated, $elm$core$Maybe$Nothing); 19951 default: 19952 var data = detail.a; 19953 return _Utils_Tuple2( 19954 $author$project$ActivityPhrase$SettlementPreferencesUpdated(data.bW), 19955 $elm$core$Maybe$Nothing); 19956 } 19957}; 19958var $author$project$Infra$PushServer$truncateParam = function (value) { 19959 return ($elm$core$String$length(value) > 80) ? (A2($elm$core$String$left, 79, value) + 'â¦') : value; 19960}; 19961var $author$project$Infra$PushServer$codePointUtf8Length = function (code) { 19962 return (code < 128) ? 1 : ((code < 2048) ? 2 : ((code < 65536) ? 3 : 4)); 19963}; 19964var $elm$core$String$foldl = _String_foldl; 19965var $author$project$Infra$PushServer$utf8Length = function (s) { 19966 return A3( 19967 $elm$core$String$foldl, 19968 F2( 19969 function (c, acc) { 19970 return acc + $author$project$Infra$PushServer$codePointUtf8Length( 19971 $elm$core$Char$toCode(c)); 19972 }), 19973 0, 19974 s); 19975}; 19976var $author$project$Infra$PushServer$paddedPlaintext = F2( 19977 function (ctx, events) { 19978 var phrases = A2( 19979 $elm$core$List$map, 19980 function (a) { 19981 return $author$project$ActivityPhrase$phrase(a.io); 19982 }, 19983 A2( 19984 $elm$core$List$filterMap, 19985 $author$project$Domain$Activity$fromEnvelope(ctx.hq), 19986 events)); 19987 var _v0 = function () { 19988 var _v1 = $elm$core$List$reverse(phrases); 19989 if (_v1.b) { 19990 var _v2 = _v1.a; 19991 var p = _v2.a; 19992 var a = _v2.b; 19993 var rest = _v1.b; 19994 return _Utils_Tuple3( 19995 _Utils_Tuple2( 19996 $author$project$ActivityPhrase$key(p), 19997 $author$project$ActivityPhrase$params(p)), 19998 a, 19999 $elm$core$List$length(rest)); 20000 } else { 20001 return _Utils_Tuple3( 20002 _Utils_Tuple2('notificationGeneric', _List_Nil), 20003 $elm$core$Maybe$Nothing, 20004 0); 20005 } 20006 }(); 20007 var keyAndParams = _v0.a; 20008 var amount = _v0.b; 20009 var extraCount = _v0.c;
20010 var _v3 = keyAndParams; 20011 var key = _v3.a; 20012 var params = _v3.b; 20013 var paramFields = A2( 20014 $elm$core$List$map, 20015 function (_v5) { 20016 var name = _v5.a; 20017 var value = _v5.b; 20018 return _Utils_Tuple2( 20019 name, 20020 $elm$json$Json$Encode$string( 20021 $author$project$Infra$PushServer$truncateParam(value))); 20022 }, 20023 A2( 20024 $elm$core$List$cons, 20025 _Utils_Tuple2('actor', ctx.hK), 20026 params)); 20027 var json = A2( 20028 $elm$json$Json$Encode$encode, 20029 0, 20030 $elm$json$Json$Encode$object( 20031 _Utils_ap( 20032 _List_fromArray( 20033 [ 20034 _Utils_Tuple2( 20035 't', 20036 $elm$json$Json$Encode$string(ctx.iP)), 20037 _Utils_Tuple2( 20038 'k', 20039 $elm$json$Json$Encode$string(key)), 20040 _Utils_Tuple2( 20041 'p', 20042 $elm$json$Json$Encode$object(paramFields)) 20043 ]), 20044 _Utils_ap( 20045 function () { 20046 if (!amount.$) { 20047 var a = amount.a; 20048 return _List_fromArray( 20049 [ 20050 _Utils_Tuple2( 20051 'a', 20052 $elm$json$Json$Encode$object( 20053 _List_fromArray( 20054 [ 20055 _Utils_Tuple2( 20056 'v', 20057 $elm$json$Json$Encode$int(a.da)), 20058 _Utils_Tuple2( 20059 'sym', 20060 $elm$json$Json$Encode$string( 20061 $author$project$Domain$Currency$currencySymbol(a.bg))), 20062 _Utils_Tuple2( 20063 'prec', 20064 $elm$json$Json$Encode$int( 20065 $author$project$Domain$Currency$precision(a.bg))) 20066 ]))) 20067 ]); 20068 } else { 20069 return _List_Nil; 20070 } 20071 }(), 20072 _Utils_ap( 20073 (extraCount > 0) ? _List_fromArray( 20074 [ 20075 _Utils_Tuple2( 20076 'n', 20077 $elm$json$Json$Encode$int(extraCount)) 20078 ]) : _List_Nil, 20079 _List_fromArray( 20080 [ 20081 _Utils_Tuple2( 20082 'u', 20083 $elm$json$Json$Encode$string(ctx.kS)) 20084 ])))))); 20085 var size = $author$project$Infra$PushServer$utf8Length(json); 20086 var bucket = (((size + 511) / 512) | 0) * 512; 20087 return _Utils_ap( 20088 json, 20089 A2($elm$core$String$repeat, bucket - size, ' ')); 20090 }); 20091var $author$project$Infra$PushServer$notifyAffectedMembers = F2( 20092 function (ctx, events) { 20093 var affectedIds = $elm$core$Set$toList( 20094 A2( 20095 $elm$core$Set$remove, 20096 ctx.hL, 20097 $elm$core$Set$fromList( 20098 A2( 20099 $elm$core$List$concatMap, 20100 function (e) { 20101 return A2($author$project$Domain$Event$involvedMembers, ctx.hq.eG, e.jC); 20102 }, 20103 events)))); 20104 return $elm$core$List$isEmpty(affectedIds) ? $andrewMacmurray$elm_concurrent_task$ConcurrentTask$succeed(0) : A2( 20105 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$onError, 20106 function (_v4) { 20107 return $andrewMacmurray$elm_concurrent_task$ConcurrentTask$succeed(0); 20108 }, 20109 A2( 20110 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$andThen, 20111 function (encrypted) { 20112 return A2( 20113 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$map, 20114 function (_v3) { 20115 return 0; 20116 }, 20117 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$batch( 20118 A2( 20119 $elm$core$List$map, 20120 function (memberId) { 20121 return A2( 20122 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$andThen, 20123 function (topic) { 20124 return A2( 20125 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$mapError, 20126 function (_v2) { 20127 return 0; 20128 }, 20129 A3($author$project$Infra$PushServer$notifyTopic, ctx.g7, topic, encrypted)); 20130 }, 20131 A2( 20132 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$mapError, 20133 function (_v1) { 20134 return 0; 20135 }, 20136 A2($author$project$Infra$Crypto$deriveNotifyTopic, ctx.gs, memberId))); 20137 }, 20138 affectedIds))); 20139 }, 20140 A2( 20141 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$mapError, 20142 function (_v0) { 20143 return 0; 20144 }, 20145 A2( 20146 $author$project$WebCrypto$Symmetric$encryptString, 20147 ctx.gs, 20148 A2($author$project$Infra$PushServer$paddedPlaintext, ctx, events))))); 20149 }); 20150var $author$project$Infra$Server$HttpError = function (a) { 20151 return {$: 0, a: a}; 20152}; 20153var $author$project$Infra$Server$InternalError = function (a) { 20154 return {$: 2, a: a}; 20155}; 20156var $author$project$Infra$Server$authHeader = function (secret) { 20157 return A2($andrewMacmurray$elm_concurrent_task$ConcurrentTask$Http$header, 'Authorization', 'Bearer ' + secret); 20158}; 20159var $author$project$Infra$Compression$decryptJson = F3( 20160 function (key, decoder, batch) { 20161 return A2( 20162 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$andThen, 20163 function (jsonStr) { 20164 var _v0 = A2($elm$json$Json$Decode$decodeString, decoder, jsonStr); 20165 if (!_v0.$) { 20166 var val = _v0.a; 20167 return $andrewMacmurray$elm_concurrent_task$ConcurrentTask$succeed(val); 20168 } else { 20169 var err = _v0.a; 20170 return $andrewMacmurray$elm_concurrent_task$ConcurrentTask$fail( 20171 $author$project$WebCrypto$DecryptionFailed( 20172 'JSON decode error: ' + $elm$json$Json$Decode$errorToString(err))); 20173 } 20174 }, 20175 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$define( 20176 { 20177 k: $elm$json$Json$Encode$object( 20178 _List_fromArray( 20179 [ 20180 _Utils_Tuple2( 20181 'key', 20182 $elm$json$Json$Encode$string(
20183 $author$project$WebCrypto$Symmetric$exportKey(key))), 20184 _Utils_Tuple2( 20185 'ciphertext', 20186 $elm$json$Json$Encode$string(batch.f$)), 20187 _Utils_Tuple2( 20188 'iv', 20189 $elm$json$Json$Encode$string(batch.gD)), 20190 _Utils_Tuple2( 20191 'compressed', 20192 $elm$json$Json$Encode$bool(batch.$8)) 20193 ])), 20194 l: $andrewMacmurray$elm_concurrent_task$ConcurrentTask$expectErrors($author$project$WebCrypto$errorDecoder), 20195 m: $andrewMacmurray$elm_concurrent_task$ConcurrentTask$expectString, 20196 n: 'compression:decryptJson' 20197 })); 20198 }); 20199var $elm$core$Result$toMaybe = function (result) { 20200 if (!result.$) { 20201 var v = result.a; 20202 return $elm$core$Maybe$Just(v); 20203 } else { 20204 return $elm$core$Maybe$Nothing; 20205 } 20206}; 20207var $author$project$Infra$Server$decryptServerEventBatch = F2( 20208 function (key, record) { 20209 var _v0 = A2($elm$json$Json$Decode$decodeString, $author$project$WebCrypto$Symmetric$encryptedDataDecoder, record.iz); 20210 if (!_v0.$) { 20211 var encrypted = _v0.a; 20212 return A2( 20213 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$onError, 20214 function (_v1) { 20215 return $andrewMacmurray$elm_concurrent_task$ConcurrentTask$succeed( 20216 {iC: _List_Nil, aE: 1}); 20217 }, 20218 A2( 20219 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$map, 20220 function (values) { 20221 var decoded = A2( 20222 $elm$core$List$map, 20223 $elm$json$Json$Decode$decodeValue($author$project$Domain$Event$envelopeDecoder), 20224 values); 20225 var events = A2($elm$core$List$filterMap, $elm$core$Result$toMaybe, decoded); 20226 return { 20227 iC: events, 20228 aE: $elm$core$List$length(decoded) - $elm$core$List$length(events) 20229 }; 20230 }, 20231 A3( 20232 $author$project$Infra$Compression$decryptJson, 20233 key, 20234 $elm$json$Json$Decode$list($elm$json$Json$Decode$value), 20235 {f$: encrypted.f$, $8: record.$8, gD: encrypted.gD}))); 20236 } else { 20237 return $andrewMacmurray$elm_concurrent_task$ConcurrentTask$succeed( 20238 {iC: _List_Nil, aE: 1}); 20239 } 20240 }); 20241var $author$project$Infra$Server$decryptServerEvents = F2( 20242 function (key, records) { 20243 return A2( 20244 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$map, 20245 function (results) { 20246 return { 20247 iC: A2( 20248 $elm$core$List$concatMap, 20249 function ($) { 20250 return $.iC; 20251 }, 20252 results), 20253 aE: $elm$core$List$sum( 20254 A2( 20255 $elm$core$List$map, 20256 function ($) { 20257 return $.aE; 20258 }, 20259 results)) 20260 }; 20261 }, 20262 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$batch( 20263 A2( 20264 $elm$core$List$map, 20265 $author$project$Infra$Server$decryptServerEventBatch(key), 20266 records))); 20267 }); 20268var $author$project$Infra$Server$eventsUrl = function (ctx) { 20269 return ctx.hl + ('/api/groups/' + (ctx.ct + '/events')); 20270}; 20271var $author$project$Infra$Server$ServerEventRecord = F3( 20272 function (seq, eventData, compressed) { 20273 return {$8: compressed, iz: eventData, kg: seq}; 20274 }); 20275var $author$project$Infra$Server$serverEventRecordDecoder = A4( 20276 $elm$json$Json$Decode$map3, 20277 $author$project$Infra$Server$ServerEventRecord, 20278 A2($elm$json$Json$Decode$field, 'seq', $elm$json$Json$Decode$int), 20279 A2($elm$json$Json$Decode$field, 'eventData', $elm$json$Json$Decode$string), 20280 A2($elm$json$Json$Decode$field, 'compressed', $elm$json$Json$Decode$bool)); 20281var $author$project$Infra$Server$pullPageDecoder = A6( 20282 $elm$json$Json$Decode$map5, 20283 F5( 20284 function (events, hasMore, resetCursor, recordCount, groupEpoch) { 20285 return {iC: events, gq: groupEpoch, eO: hasMore, pM: recordCount, j5: resetCursor}; 20286 }), 20287 A2( 20288 $elm$json$Json$Decode$field, 20289 'events', 20290 $elm$json$Json$Decode$list($author$project$Infra$Server$serverEventRecordDecoder)), 20291 A2($elm$json$Json$Decode$field, 'hasMore', $elm$json$Json$Decode$bool), 20292 $elm$json$Json$Decode$oneOf( 20293 _List_fromArray( 20294 [ 20295 A2($elm$json$Json$Decode$field, 'resetCursor', $elm$json$Json$Decode$bool), 20296 $elm$json$Json$Decode$succeed(false) 20297 ])), 20298 $elm$json$Json$Decode$oneOf( 20299 _List_fromArray( 20300 [ 20301 A2($elm$json$Json$Decode$field, 'recordCount', $elm$json$Json$Decode$int), 20302 $elm$json$Json$Decode$succeed(0) 20303 ])), 20304 A2($elm$json$Json$Decode$field, 'groupEpoch', $elm$json$Json$Decode$string)); 20305var $author$project$Infra$Server$pullAllPages = F5( 20306 function (ctx, secret, resetCheck, cursor, acc) { 20307 return A2( 20308 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$andThen, 20309 function (page) { 20310 var epochChanged = A2( 20311 $elm$core$Maybe$withDefault, 20312 false, 20313 A2( 20314 $elm$core$Maybe$map, 20315 $elm$core$Basics$neq(page.gq), 20316 resetCheck.ks)); 20317 if (resetCheck.fQ && (page.j5 || epochChanged)) { 20318 return A5( 20319 $author$project$Infra$Server$pullAllPages, 20320 ctx, 20321 secret, 20322 _Utils_update( 20323 resetCheck, 20324 {fQ: false}), 20325 0, 20326 _Utils_update( 20327 acc, 20328 {mk: true})); 20329 } else { 20330 var newCursor = A2( 20331 $elm$core$Maybe$withDefault, 20332 cursor, 20333 A2( 20334 $elm$core$Maybe$map, 20335 function ($) { 20336 return $.kg; 20337 }, 20338 $elm$core$List$head( 20339 $elm$core$List$reverse(page.iC)))); 20340 return (page.eO && (_Utils_cmp(newCursor, cursor) < 1)) ? $andrewMacmurray$elm_concurrent_task$ConcurrentTask$fail( 20341 $author$project$Infra$Server$InternalError('Relay reported more events but the pull cursor did n
20341ot advance')) : A2( 20342 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$andThen, 20343 function (decrypted) { 20344 var newAcc = _Utils_update( 20345 acc, 20346 { 20347 iC: _Utils_ap(acc.iC, decrypted.iC), 20348 aE: acc.aE + decrypted.aE 20349 }); 20350 return page.eO ? A5($author$project$Infra$Server$pullAllPages, ctx, secret, resetCheck, newCursor, newAcc) : $andrewMacmurray$elm_concurrent_task$ConcurrentTask$succeed( 20351 {ij: newCursor, mk: newAcc.mk, mt: page.gq, iC: newAcc.iC, bm: _List_Nil, pM: page.pM, aE: newAcc.aE}); 20352 }, 20353 A2($author$project$Infra$Server$decryptServerEvents, ctx.gs, page.iC)); 20354 } 20355 }, 20356 A2( 20357 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$mapError, 20358 $author$project$Infra$Server$HttpError, 20359 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$Http$get( 20360 { 20361 m: $andrewMacmurray$elm_concurrent_task$ConcurrentTask$Http$expectJson($author$project$Infra$Server$pullPageDecoder), 20362 mY: _List_fromArray( 20363 [ 20364 $author$project$Infra$Server$authHeader(secret) 20365 ]), 20366 qQ: $elm$core$Maybe$Nothing, 20367 kS: $author$project$Infra$Server$eventsUrl(ctx) + ('?since=' + $elm$core$String$fromInt(cursor)) 20368 }
20368))); 20369 }); 20370var $author$project$Infra$Server$pullEvents = F3( 20371 function (ctx, secret, maybeSync) { 20372 return A5( 20373 $author$project$Infra$Server$pullAllPages, 20374 ctx, 20375 secret, 20376 { 20377 fQ: true, 20378 ks: A2( 20379 $elm$core$Maybe$map, 20380 function ($) { 20381 return $.mt; 20382 }, 20383 maybeSync) 20384 }, 20385 A2( 20386 $elm$core$Maybe$withDefault, 20387 0, 20388 A2( 20389 $elm$core$Maybe$map, 20390 function ($) { 20391 return $.kg; 20392 }, 20393 maybeSync)), 20394 {mk: false, iC: _List_Nil, aE: 0}); 20395 }); 20396var $author$project$Domain$Compaction$chunkEnvelopes = F2( 20397 function (maxBytes, envelopes) { 20398 var step = F2( 20399 function (envelope, acc) { 20400 var envelopeSize = $elm$core$String$length( 20401 A2($elm$json$Json$Encode$encode, 0, envelope.jZ)); 20402 return ((_Utils_cmp(acc.dW + envelopeSize, maxBytes) > 0) && (!$elm$core$List$isEmpty(acc.bh))) ? { 20403 bG: A2( 20404 $elm$core$List$cons, 20405 $elm$core$List$reverse(acc.bh), 20406 acc.bG), 20407 bh: _List_fromArray( 20408 [envelope]), 20409 dW: envelopeSize 20410 } : { 20411 bG: acc.bG, 20412 bh: A2($elm$core$List$cons, envelope, acc.bh), 20413 dW: acc.dW + envelopeSize 20414 }; 20415 }); 20416 var _final = A3( 20417 $elm$core$List$foldl, 20418 step, 20419 {bG: _List_Nil, bh: _List_Nil, dW: 0}, 20420 envelopes); 20421 return $elm$core$List$isEmpty(_final.bh) ? $elm$core$List$reverse(_final.bG) : $elm$core$List$reverse( 20422 A2( 20423 $elm$core$List$cons, 20424 $elm$core$List$reverse(_final.bh), 20425 _final.bG)); 20426 }); 20427var $author$project$Infra$Server$maxChunkBytes = 512 * 1024; 20428var $author$project$Infra$Compression$encodeEventData = function (batch) { 20429 return $elm$json$Json$Encode$object( 20430 _List_fromArray( 20431 [ 20432 _Utils_Tuple2( 20433 'ciphertext', 20434 $elm$json$Json$Encode$string(batch.f$)), 20435 _Utils_Tuple2( 20436 'iv', 20437 $elm$json$Json$Encode$string(batch.gD)) 20438 ])); 20439}; 20440var $author$project$Infra$Compression$EncryptedBatch = F3( 20441 function (ciphertext, iv, compressed) { 20442 return {f$: ciphertext, $8: compressed, gD: iv}; 20443 }); 20444var $author$project$Infra$Compression$encryptedBatchDecoder = A4( 20445 $elm$json$Json$Decode$map3, 20446 $author$project$Infra$Compression$EncryptedBatch, 20447 A2($elm$json$Json$Decode$field, 'ciphertext', $elm$json$Json$Decode$string), 20448 A2($elm$json$Json$Decode$field, 'iv', $elm$json$Json$Decode$string), 20449 A2($elm$json$Json$Decode$field, 'compressed', $elm$json$Json$Decode$bool)); 20450var $author$project$Infra$Compression$encryptJson = F2( 20451 function (key, json) { 20452 return $andrewMacmurray$elm_concurrent_task$ConcurrentTask$define( 20453 { 20454 k: $elm$json$Json$Encode$object( 20455 _List_fromArray( 20456 [ 20457 _Utils_Tuple2( 20458 'key', 20459 $elm$json$Json$Encode$string( 20460 $author$project$WebCrypto$Symmetric$exportKey(key))), 20461 _Utils_Tuple2( 20462 'json', 20463 $elm$json$Json$Encode$string( 20464 A2($elm$json$Json$Encode$encode, 0, json))), 20465 _Utils_Tuple2( 20466 'threshold', 20467 $elm$json$Json$Encode$float(0.7)) 20468 ])), 20469 l: $andrewMacmurray$elm_concurrent_task$ConcurrentTask$expectErrors($author$project$WebCrypto$errorDecoder), 20470 m: $andrewMacmurray$elm_concurrent_task$ConcurrentTask$expectJson($author$project$Infra$Compression$encryptedBatchDecoder), 20471 n: 'compression:encryptJson' 20472 }); 20473 }); 20474var $elm$core$List$sort = function (xs) { 20475 return A2($elm$core$List$sortBy, $elm$core$Basics$identity, xs); 20476}; 20477var $author$project$Infra$Server$packRecord = F3( 20478 function (groupKey, actorId, envelopes) { 20479 return A2( 20480 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$mapError, 20481 $author$project$Infra$Server$CryptoError, 20482 A3( 20483 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$map2, 20484 F2( 20485 function (recordId, result) { 20486 return $elm$json$Json$Encode$object( 20487 _List_fromArray( 20488 [ 20489 _Utils_Tuple2( 20490 'actorId', 20491 $elm$json$Json$Encode$string(actorId)), 20492 _Utils_Tuple2( 20493 'recordId', 20494 $elm$json$Json$Encode$string(recordId)), 20495 _Utils_Tuple2( 20496 'eventData', 20497 $elm$json$Json$Encode$string( 20498 A2( 20499 $elm$json$Json$Encode$encode, 20500 0, 20501 $author$project$Infra$Compression$encodeEventData(result)))), 20502 _Utils_Tuple2( 20503 'compressed', 20504 $elm$json$Json$Encode$bool(result.$8)) 20505 ])); 20506 }), 20507 $author$project$WebCrypto$sha256( 20508 A2( 20509 $elm$core$String$join, 20510 '\n', 20511 $elm$core$List$sort( 20512 A2( 20513 $elm$core$List$map, 20514 function ($) { 20515 return $.m9; 20516 },
20517 envelopes)))), 20518 A2( 20519 $author$project$Infra$Compression$encryptJson, 20520 groupKey, 20521 A2($elm$json$Json$Encode$list, $author$project$Domain$Event$encodeEnvelope, envelopes)))); 20522 }); 20523var $author$project$Infra$Server$pushChunk = F4( 20524 function (ctx, secret, actorId, envelopes) { 20525 return A2( 20526 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$andThen, 20527 function (record) { 20528 return A2( 20529 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$mapError, 20530 $author$project$Infra$Server$HttpError, 20531 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$Http$post( 20532 { 20533 fY: $andrewMacmurray$elm_concurrent_task$ConcurrentTask$Http$jsonBody(record), 20534 m: $andrewMacmurray$elm_concurrent_task$ConcurrentTask$Http$expectWhatever, 20535 mY: _List_fromArray( 20536 [ 20537 $author$project$Infra$Server$authHeader(secret) 20538 ]), 20539 qQ: $elm$core$Maybe$Nothing, 20540 kS: $author$project$Infra$Server$eventsUrl(ctx) 20541 })); 20542 }, 20543 A3($author$project$Infra$Server$packRecord, ctx.gs, actorId, envelopes)); 20544 }); 20545var $author$project$Infra$Server$pushEvents = F4( 20546 function (ctx, secret, actorId, envelopes) { 20547 return A2( 20548 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$map, 20549 function (_v0) { 20550 return 0; 20551 }, 20552 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$batch( 20553 A2( 20554 $elm$core$List$map, 20555 A3($author$project$Infra$Server$pushChunk, ctx, secret, actorId), 20556 A2($author$project$Domain$Compaction$chunkEnvelopes, $author$project$Infra$Server$maxChunkBytes, envelopes)))); 20557 }); 20558var $author$project$Infra$Server$sync = F3( 20559 function (ctx, actorId, _v0) { 20560 var unpushedEvents = _v0.kO; 20561 var syncCursor = _v0.cZ; 20562 var notifyContext = _v0.js; 20563 var pushedCount = $elm$core$List$length(unpushedEvents); 20564 var notifyTask = function () { 20565 if (!notifyContext.$) { 20566 var nc = notifyContext.a; 20567 return $elm$core$List$isEmpty(unpushedEvents) ? $andrewMacmurray$elm_concurrent_task$ConcurrentTask$succeed(0) : A2($author$project$Infra$PushServer$notifyAffectedMembers, nc, unpushedEvents); 20568 } else { 20569 return $andrewMacmurray$elm_concurrent_task$ConcurrentTask$succeed(0); 20570 } 20571 }(); 20572 return A2( 20573 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$andThen, 20574 function (secret) { 20575 return A2( 20576 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$andThenDo, 20577 A3( 20578 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$map2, 20579 F2( 20580 function (_v1, pull) { 20581 return {pF: pull, jT: pushedCount}; 20582 }), 20583 notifyTask, 20584 A3($author$project$Infra$Server$pullEvents, ctx, secret, syncCursor)), 20585 A4($author$project$Infra$Server$pushEvents, ctx, secret, actorId, unpushedEvents)); 20586 }, 20587 A2( 20588 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$mapError, 20589 $author$project$Infra$Server$CryptoError, 20590 $author$project$Infra$Crypto$deriveRelaySecret(ctx.gs))); 20591 }); 20592var $elm$core$String$concat = function (strings) { 20593 return A2($elm$core$String$join, '', strings); 20594}; 20595var $author$project$Domain$Compaction$manifestInput = function (prefix) { 20596 return $elm$core$String$concat( 20597 A2( 20598 $elm$core$List$map, 20599 function (envelope) { 20600 return A2($elm$json$Json$Encode$encode, 0, envelope.jZ) + '\n'; 20601 }, 20602 prefix)); 20603}; 20604var $elm$core$Dict$intersect = F2( 20605 function (t1, t2) { 20606 return A2( 20607 $elm$core$Dict$filter, 20608 F2( 20609 function (k, _v0) { 20610 return A2($elm$core$Dict$member, k, t2); 20611 }), 20612 t1); 20613 }); 20614var $elm$core$Set$intersect = F2( 20615 function (_v0, _v1) { 20616 var dict1 = _v0; 20617 var dict2 = _v1; 20618 return A2($elm$core$Dict$intersect, dict1, dict2); 20619 }); 20620var $elm$core$Maybe$map2 = F3( 20621 function (func, ma, mb) { 20622 if (ma.$ === 1) { 20623 return $elm$core$Maybe$Nothing; 20624 } else { 20625 var a = ma.a; 20626 if (mb.$ === 1) { 20627 return $elm$core$Maybe$Nothing; 20628 } else { 20629 var b = mb.a; 20630 return $elm$core$Maybe$Just( 20631 A2(func, a, b)); 20632 } 20633 } 20634 }); 20635var $author$project$Domain$Compaction$takeThrough = F3( 20636 function (boundaryId, remaining, acc) { 20637 takeThrough: 20638 while (true) { 20639 if (!remaining.b) { 20640 return $elm$core$Maybe$Nothing; 20641 } else { 20642 var envelope = remaining.a; 20643 var rest = remaining.b; 20644 if (_Utils_eq(envelope.m9, boundaryId)) { 20645 return $elm$core$Maybe$Just( 20646 A2($elm$core$List$cons, envelope, acc)); 20647 } else { 20648 var $temp$boundaryId = boundaryId, 20649 $temp$remaining = rest, 20650 $temp$acc = A2($elm$core$List$cons, envelope, acc); 20651 boundaryId = $temp$boundaryId; 20652 remaining = $temp$remaining; 20653 acc = $temp$acc; 20654 continue takeThrough; 20655 } 20656 } 20657 } 20658 }); 20659var $author$project$Domain$Compaction$prefixThrough = F2( 20660 function (boundaryId, events) { 20661 return A2( 20662 $elm$core$Maybe$map, 20663 $elm$core$List$reverse, 20664 A3( 20665 $author$project$Domain$Compaction$takeThrough, 20666 boundaryId, 20667 $author$project$Domain$Event$sortEvents(events), 20668 _List_Nil)); 20669 }); 20670var $elm$core$Set$singleton = function (key) {
20671 return A2($elm$core$Dict$singleton, key, 0); 20672}; 20673var $elm$core$Set$size = function (_v0) { 20674 var dict = _v0; 20675 return $elm$core$Dict$size(dict); 20676}; 20677var $author$project$Domain$Compaction$newestQuorumed = F3( 20678 function (_v0, events, toResult) { 20679 var resolveRoot = _v0.pS; 20680 var isRetired = _v0.nt; 20681 var approverRoots = F2( 20682 function (proposalId, proposerRoot) { 20683 return A3( 20684 $elm$core$List$foldl, 20685 F2( 20686 function (envelope, acc) { 20687 var _v3 = envelope.jC; 20688 if (_v3.$ === 15) { 20689 var approval = _v3.a; 20690 if (_Utils_eq(approval.cN, proposalId)) { 20691 var _v4 = resolveRoot(envelope.q0); 20692 if (!_v4.$) { 20693 var root = _v4.a; 20694 return A2($elm$core$Set$insert, root, acc); 20695 } else { 20696 return acc; 20697 } 20698 } else { 20699 return acc; 20700 } 20701 } else { 20702 return acc; 20703 } 20704 }), 20705 $elm$core$Set$singleton(proposerRoot), 20706 events); 20707 }); 20708 var quorumFor = F2( 20709 function (envelope, proposal) { 20710 return A2( 20711 $elm$core$Maybe$andThen, 20712 function (_v2) { 20713 var proposerRoot = _v2.a; 20714 var prefix = _v2.b; 20715 var involved = $elm$core$Set$fromList( 20716 A2( 20717 $elm$core$List$filter, 20718 function (root) { 20719 return !isRetired(root); 20720 }, 20721 A2( 20722 $elm$core$List$filterMap, 20723 function (e) { 20724 return resolveRoot(e.q0); 20725 }, 20726 prefix))); 20727 var signers = $elm$core$Set$size( 20728 A2( 20729 $elm$core$Set$intersect, 20730 A2(approverRoots, envelope.m9, proposerRoot), 20731 involved)); 20732 return (_Utils_cmp( 20733 2 * signers, 20734 $elm$core$Set$size(involved)) > 0) ? A3(toResult, envelope, proposal, prefix) : $elm$core$Maybe$Nothing; 20735 }, 20736 A3( 20737 $elm$core$Maybe$map2, 20738 $elm$core$Tuple$pair, 20739 resolveRoot(envelope.q0), 20740 A2($author$project$Domain$Compaction$prefixThrough, proposal.hx, events))); 20741 }); 20742 return $elm$core$List$head( 20743 A2( 20744 $elm$core$List$filterMap, 20745 function (envelope) { 20746 var _v1 = envelope.jC; 20747 if (_v1.$ === 14) { 20748 var proposal = _v1.a; 20749 return A2(quorumFor, envelope, proposal); 20750 } else { 20751 return $elm$core$Maybe$Nothing; 20752 } 20753 }, 20754 $elm$core$List$reverse( 20755 $author$project$Domain$Event$sortEvents(events)))); 20756 }); 20757var $author$project$Domain$Compaction$quorumedProposal = F2( 20758 function (resolvers, events) { 20759 return A3( 20760 $author$project$Domain$Compaction$newestQuorumed, 20761 resolvers, 20762 events, 20763 F3( 20764 function (_v0, proposal, prefix) { 20765 return $elm$core$Maybe$Just( 20766 { 20767 lS: proposal.bK, 20768 db: proposal.gI, 20769 cB: $author$project$Domain$Compaction$manifestInput(prefix), 20770 pC: $elm$core$List$length(prefix) 20771 }); 20772 })); 20773 }); 20774var $author$project$Main$verifyCompactedHistory = function (verified) { 20775 var state = A2($author$project$Domain$GroupState$applyEvents, verified, $author$project$Domain$GroupState$empty); 20776 var resolvers = { 20777 nt: function (root) { 20778 return A2( 20779 $elm$core$Maybe$withDefault, 20780 false, 20781 A2( 20782 $elm$core$Maybe$map, 20783 function ($) { 20784 return $.nt; 20785 }, 20786 A2($elm$core$Dict$get, root, state.r))); 20787 }, 20788 pS: $author$project$Domain$GroupState$resolveMemberRootId(state) 20789 }; 20790 var _v0 = A2($author$project$Domain$Compaction$quorumedProposal, resolvers, verified); 20791 if (_v0.$ === 1) { 20792 return $andrewMacmurray$elm_concurrent_task$ConcurrentTask$succeed(false); 20793 } else { 20794 var quorumed = _v0.a; 20795 return (!_Utils_eq(quorumed.lS, quorumed.pC)) ? $andrewMacmurray$elm_concurrent_task$ConcurrentTask$succeed(true) : A2( 20796 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$map, 20797 function (hash) { 20798 return !_Utils_eq(hash, quorumed.db); 20799 }, 20800 A2( 20801 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$mapError, 20802 $author$project$Infra$Server$CryptoError, 20803 $author$project$WebCrypto$sha256(quorumed.cB))); 20804 } 20805}; 20806var $author$project$Main$handleJoinRoute = F3( 20807 function (model, route, maybeIdentity) { 20808 var _v0 = _Utils_Tuple2(model.b, route); 20809 if (((_v0.a.$ === 1) && (_v0.b.$ === 6)) && (!_v0.b.b.$)) { 20810 var readyData = _v0.a.a; 20811 var _v1 = _v0.b; 20812 var groupId = _v1.a; 20813 var invite = _v1.b.a; 20814 if (maybeIdentity.$ === 1) { 20815 return A2( 20816 $author$project$Main$startIdentityTask, 20817 $author$project$Infra$Identity$generate, 20818 _Utils_update( 20819 model, 20820 {z: $author$project$Page$JoinGroup$init, d: route})); 20821 } else { 20822 if (A2($elm$core$Dict$member, groupId, readyData.eN)) { 20823 return A2( 20824 $elm$core$Tuple$mapFirst, 20825 function (runner) { 20826 return _Utils_update( 20827 model, 20828 {z: $author$project$Page$JoinGroup$init, d: route, ak: runner}); 20829 }, 20830 A3( 20831 $author$project$Infra$ConcurrentTaskExtra$andRun, 20832 $author$project$Main$OnJoinLocalGroupLoaded(groupId), 20833 A2($author$project$Infra$Storage$loadGroup, readyData.de, groupId), 20834 _Utils_Tuple2(model.ak, $elm$core$Platform$Cmd$none))); 20835 } else { 20836 var serverCtx = { 20837 ct: groupId, 20838 gs: $author$project$WebCrypto$Symmetric$importKey(invite.i4), 20839 hl: model.hl 20840 }; 20841 var _v3 = A3( 20842 $author$project$Infra$ConcurrentTaskExtra$andRun, 20843 A3($author$project$Main$OnJoinGroupFetched, groupId, invite.i4, invite.ky), 20844 A2( 20845 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$andThen, 20846 function (syncResult) { 20847 return A2( 20848 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$andThen, 20849 function (verified) { 20850 var pull = syncResult.pF; 20851 return A2( 20852 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$map, 20853 function (manifestMismatch) { 20854 return { 20855 gJ: manifestMismatch, 20856 fz: _Utils_update( 20857 syncResult, 20858 { 20859 pF: _Utils_update( 20860 pull, 20861 {iC: verified}) 20862 }) 20863 }; 20864 }, 20865 $author$project$Main$verifyCompactedHistory(verified)); 20866 }, 20867 A2($author$project$Infra$EventVerification$filterVerifiedEvents, $author$project$Domain$GroupState$empty, syncResult.pF.iC)); 20868 }, 20869 A3( 20870 $author$project$Infra$Server$sync,
20871 serverCtx, 20872 '', 20873 {js: $elm$core$Maybe$Nothing, cZ: $elm$core$Maybe$Nothing, kO: _List_Nil})), 20874 _Utils_Tuple2(model.ak, $elm$core$Platform$Cmd$none)); 20875 var runner = _v3.a; 20876 var cmd = _v3.b; 20877 return _Utils_Tuple2( 20878 _Utils_update( 20879 model, 20880 {z: $author$project$Page$JoinGroup$init, d: route, ak: runner}), 20881 cmd); 20882 } 20883 } 20884 } else { 20885 return _Utils_Tuple2( 20886 _Utils_update( 20887 model, 20888 {d: route}), 20889 $elm$core$Platform$Cmd$none); 20890 } 20891 }); 20892var $author$project$Page$Group$WorkspaceMissing = {$: 1}; 20893var $author$project$Page$Group$OnGroupEventsLoaded = F2( 20894 function (a, b) { 20895 return {$: 24, a: a, b: b}; 20896 }); 20897var $author$project$Page$Group$WorkspaceLoading = function (a) { 20898 return {$: 2, a: a}; 20899}; 20900var $author$project$Page$Group$loadGroup = F3( 20901 function (config, summary, model) { 20902 return A2( 20903 $elm$core$Tuple$mapFirst, 20904 function (r) { 20905 return _Utils_update( 20906 model, 20907 { 20908 ak: r, 20909 a: $author$project$Page$Group$WorkspaceLoading(summary) 20910 }); 20911 }, 20912 A3( 20913 $author$project$Infra$ConcurrentTaskExtra$andRun, 20914 $author$project$Page$Group$OnGroupEventsLoaded(summary.m9), 20915 A2($author$project$Infra$Storage$loadGroup, config.de, summary.m9), 20916 _Utils_Tuple2(model.ak, $elm$core$Platform$Cmd$none))); 20917 }); 20918var $author$project$Page$Group$ensureGroupLoaded = F3( 20919 function (config, maybeSummary, model) { 20920 if (maybeSummary.$ === 1) { 20921 return _Utils_Tuple2( 20922 _Utils_update( 20923 model, 20924 {a: $author$project$Page$Group$WorkspaceMissing}), 20925 $elm$core$Platform$Cmd$none); 20926 } else { 20927 var summary = maybeSummary.a; 20928 var _v1 = model.a; 20929 switch (_v1.$) { 20930 case 4: 20931 var loaded = _v1.a; 20932 return _Utils_eq(loaded.bA.m9, summary.m9) ? _Utils_Tuple2(model, $elm$core$Platform$Cmd$none) : A3($author$project$Page$Group$loadGroup, config, summary, model); 20933 case 2: 20934 var loadingSummary = _v1.a; 20935 return _Utils_eq(loadingSummary.m9, summary.m9) ? _Utils_Tuple2(model, $elm$core$Platform$Cmd$none) : A3($author$project$Page$Group$loadGroup, config, summary, model); 20936 default: 20937 return A3($author$project$Page$Group$loadGroup, config, summary, model); 20938 } 20939 } 20940 }); 20941var $author$project$Page$Group$OnMigrationOrderFetched = F2( 20942 function (a, b) { 20943 return {$: 38, a: a, b: b}; 20944 }); 20945var $author$project$Page$Group$currentUserRootId = F2( 20946 function (model, loaded) { 20947 return A2($author$project$Domain$GroupState$resolveMemberRootId, loaded.a6, model.iY); 20948 }); 20949var $author$project$Infra$Server$pullTaggedRecords = F4( 20950 function (ctx, secret, cursor, acc) { 20951 return A2( 20952 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$andThen, 20953 function (page) { 20954 return A2( 20955 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$andThen, 20956 function (decrypted) { 20957 var newAcc = _Utils_ap(acc, decrypted); 20958 if (page.eO) { 20959 var newCursor = A2( 20960 $elm$core$Maybe$withDefault, 20961 cursor, 20962 A2( 20963 $elm$core$Maybe$map, 20964 function ($) { 20965 return $.kg; 20966 }, 20967 $elm$core$List$head( 20968 $elm$core$List$reverse(page.iC)))); 20969 return A4($author$project$Infra$Server$pullTaggedRecords, ctx, secret, newCursor, newAcc); 20970 } else { 20971 return $andrewMacmurray$elm_concurrent_task$ConcurrentTask$succeed(newAcc); 20972 } 20973 }, 20974 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$batch( 20975 A2( 20976 $elm$core$List$map, 20977 function (record) { 20978 return A2( 20979 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$map, 20980 function (decrypted) { 20981 return {iC: decrypted.iC, kg: record.kg}; 20982 }, 20983 A2($author$project$Infra$Server$decryptServerEventBatch, ctx.gs, record)); 20984 }, 20985 page.iC))); 20986 }, 20987 A2( 20988 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$mapError, 20989 $author$project$Infra$Server$HttpError, 20990 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$Http$get( 20991 { 20992 m: $andrewMacmurray$elm_concurrent_task$ConcurrentTask$Http$expectJson($author$project$Infra$Server$pullPageDecoder), 20993 mY: _List_fromArray( 20994 [ 20995 $author$project$Infra$Server$authHeader(secret) 20996 ]), 20997 qQ: $elm$core$Maybe$Nothing, 20998 kS: $author$project$Infra$Server$eventsUrl(ctx) + ('?since=' + $elm$core$String$fromInt(cursor)) 20999 }
20999))); 21000 }); 21001var $author$project$Infra$Server$fetchEventOrder = function (ctx) { 21002 return A2( 21003 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$map, 21004 A2( 21005 $elm$core$List$foldl, 21006 F2( 21007 function (record, acc) { 21008 return A3( 21009 $elm$core$List$foldl, 21010 function (envelope) { 21011 return A2( 21012 $elm$core$Dict$update, 21013 envelope.m9, 21014 function (existing) { 21015 return $elm$core$Maybe$Just( 21016 A2( 21017 $elm$core$Basics$min, 21018 record.kg, 21019 A2($elm$core$Maybe$withDefault, record.kg, existing))); 21020 }); 21021 }, 21022 acc, 21023 record.iC); 21024 }), 21025 $elm$core$Dict$empty), 21026 A2( 21027 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$andThen, 21028 function (secret) { 21029 return A4($author$project$Infra$Server$pullTaggedRecords, ctx, secret, 0, _List_Nil); 21030 }, 21031 A2( 21032 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$mapError, 21033 $author$project$Infra$Server$CryptoError, 21034 $author$project$Infra$Crypto$deriveRelaySecret(ctx.gs)))); 21035}; 21036var $author$project$Page$Group$NewEntry$Shared$ExactSplit = 1; 21037var $dwayne$elm_field$Field$Advanced$setFromValue = F2( 21038 function (value, _v0) { 21039 var converters = _v0.a; 21040 var state = _v0.b; 21041 return A2( 21042 $dwayne$elm_field$Field$Advanced$Field, 21043 converters, 21044 { 21045 aO: false, 21046 ae: $dwayne$elm_validation$Validation$fromResult( 21047 converters.N(value)), 21048 jZ: converters.qU(value) 21049 }); 21050 }); 21051var $dwayne$elm_field$Field$setFromValue = $dwayne$elm_field$Field$Advanced$setFromValue; 21052var $author$project$Form$NewEntry$initAmount = function (cents) { 21053 return A2( 21054 $dwayne$elm_form$Form$modify, 21055 function ($) { 21056 return $.ef; 21057 }, 21058 $dwayne$elm_field$Field$setFromValue(cents)); 21059}; 21060var $author$project$Form$NewEntry$initDescription = function (desc) { 21061 return A2( 21062 $dwayne$elm_form$Form$modify, 21063 function ($) { 21064 return $.eE; 21065 }, 21066 $dwayne$elm_field$Field$setFromString(desc)); 21067}; 21068var $author$project$Page$Group$NewEntry$initFromExpenseData = F3( 21069 function (config, editing, data) { 21070 var payerAmountsDict = $elm$core$Dict$fromList( 21071 A2( 21072 $elm$core$List$map, 21073 function (p) { 21074 return _Utils_Tuple2( 21075 p.e_, 21076 A3($author$project$Format$formatCentsForInput, config.eX, p.ef, data.bg)); 21077 }, 21078 data.jB)); 21079 var isExactSplit = A2( 21080 $elm$core$List$any, 21081 function (b) { 21082 if (b.$ === 1) { 21083 return true; 21084 } else { 21085 return false; 21086 } 21087 }, 21088 data.em); 21089 var exactAmountsDict = isExactSplit ? $elm$core$Dict$fromList( 21090 A2( 21091 $elm$core$List$filterMap, 21092 function (b) { 21093 if (b.$ === 1) { 21094 var e = b.a; 21095 return $elm$core$Maybe$Just( 21096 _Utils_Tuple2( 21097 e.e_, 21098 A3($author$project$Format$formatCentsForInput, config.eX, e.ef, data.bg))); 21099 } else { 21100 return $elm$core$Maybe$Nothing; 21101 } 21102 }, 21103 data.em)) : $elm$core$Dict$empty; 21104 var beneficiaryDict = $elm$core$Dict$fromList( 21105 A2( 21106 $elm$core$List$map, 21107 function (b) { 21108 if (!b.$) { 21109 var s = b.a; 21110 return _Utils_Tuple2(s.e_, s.qc); 21111 } else { 21112 var e = b.a; 21113 return _Utils_Tuple2(e.e_, 1); 21114 } 21115 }, 21116 data.em)); 21117 return { 21118 ce: data.ce, 21119 em: beneficiaryDict, 21120 h9: data.h9, 21121 bg: data.bg, 21122 ck: function () { 21123 var _v0 = data.ck; 21124 if (!_v0.$) { 21125 var amt = _v0.a; 21126 return A3($author$project$Format$formatCentsForInput, config.eX, amt, config.il); 21127 } else { 21128 return ''; 21129 } 21130 }(), 21131 bj: exactAmountsDict, 21132 w: A2( 21133 $author$project$Form$NewEntry$initDate, 21134 data.cj, 21135 A2( 21136 $author$project$Form$NewEntry$initAmount, 21137 data.ef, 21138 A2( 21139 $author$project$Form$NewEntry$initDescription, 21140 data.eE, 21141 A2($author$project$Form$NewEntry$form, config.eX, data.bg)))), 21142 mL: $elm$core$Maybe$Nothing, 21143 mS: config.il, 21144 cw: editing, 21145 gE: 0, 21146 eW: editing, 21147 bu: A2($elm$core$Maybe$withDefault, '', data.bu), 21148 aB: payerAmountsDict, 21149 bx: 0, 21150 cO: $elm$core$Maybe$Nothing, 21151 b2: isExactSplit ? 1 : 0, 21152 d_: false, 21153 kF: $elm$core$Maybe$Nothing 21154 }; 21155 }); 21156var $author$project$Page$Group$NewEntry$Shared$IncomeKind = 2; 21157var $author$project$Page$Group$NewEntry$initFromIncomeData = F3( 21158 function (config, editing, data) { 21159 var isExactSplit = A2( 21160 $elm$core$List$any, 21161 function (b) { 21162 if (b.$ === 1) { 21163 return true; 21164 } else { 21165 return false;
21166 } 21167 }, 21168 data.em); 21169 var exactAmountsDict = isExactSplit ? $elm$core$Dict$fromList( 21170 A2( 21171 $elm$core$List$filterMap, 21172 function (b) { 21173 if (b.$ === 1) { 21174 var e = b.a; 21175 return $elm$core$Maybe$Just( 21176 _Utils_Tuple2( 21177 e.e_, 21178 A3($author$project$Format$formatCentsForInput, config.eX, e.ef, data.bg))); 21179 } else { 21180 return $elm$core$Maybe$Nothing; 21181 } 21182 }, 21183 data.em)) : $elm$core$Dict$empty; 21184 var beneficiaryDict = $elm$core$Dict$fromList( 21185 A2( 21186 $elm$core$List$map, 21187 function (b) { 21188 if (!b.$) { 21189 var s = b.a; 21190 return _Utils_Tuple2(s.e_, s.qc); 21191 } else { 21192 var e = b.a; 21193 return _Utils_Tuple2(e.e_, 1); 21194 } 21195 }, 21196 data.em)); 21197 return { 21198 ce: data.ce, 21199 em: beneficiaryDict, 21200 h9: $elm$core$Maybe$Nothing, 21201 bg: data.bg, 21202 ck: function () { 21203 var _v0 = data.ck; 21204 if (!_v0.$) { 21205 var amt = _v0.a; 21206 return A3($author$project$Format$formatCentsForInput, config.eX, amt, config.il); 21207 } else { 21208 return ''; 21209 } 21210 }(), 21211 bj: exactAmountsDict, 21212 w: A2( 21213 $author$project$Form$NewEntry$initDate, 21214 data.cj, 21215 A2( 21216 $author$project$Form$NewEntry$initAmount, 21217 data.ef, 21218 A2( 21219 $author$project$Form$NewEntry$initDescription, 21220 data.eE, 21221 A2($author$project$Form$NewEntry$form, config.eX, data.bg)))), 21222 mL: $elm$core$Maybe$Nothing, 21223 mS: config.il, 21224 cw: editing, 21225 gE: 2, 21226 eW: editing, 21227 bu: A2($elm$core$Maybe$withDefault, '', data.bu), 21228 aB: A2($elm$core$Dict$singleton, config.f7, ''), 21229 bx: 0, 21230 cO: $elm$core$Maybe$Just(data.j$), 21231 b2: isExactSplit ? 1 : 0, 21232 d_: false, 21233 kF: $elm$core$Maybe$Nothing 21234 }; 21235 }); 21236var $author$project$Page$Group$NewEntry$Shared$TransferKind = 1; 21237var $author$project$Page$Group$NewEntry$initFromTransferData = F3( 21238 function (config, editing, data) { 21239 return { 21240 ce: data.ce, 21241 em: $elm$core$Dict$fromList( 21242 A2( 21243 $elm$core$List$map, 21244 function (mid) { 21245 return _Utils_Tuple2(mid, 1); 21246 }, 21247 config.hI)), 21248 h9: $elm$core$Maybe$Nothing, 21249 bg: data.bg, 21250 ck: function () { 21251 var _v0 = data.ck; 21252 if (!_v0.$) { 21253 var amt = _v0.a; 21254 return A3($author$project$Format$formatCentsForInput, config.eX, amt, config.il); 21255 } else { 21256 return ''; 21257 } 21258 }(), 21259 bj: $elm$core$Dict$empty, 21260 w: A2( 21261 $author$project$Form$NewEntry$initDate, 21262 data.cj, 21263 A2( 21264 $author$project$Form$NewEntry$initAmount, 21265 data.ef, 21266 A2( 21267 $author$project$Form$NewEntry$initDescription, 21268 A2($elm$core$Maybe$withDefault, '', data.eE), 21269 A2($author$project$Form$NewEntry$form, config.eX, data.bg)))), 21270 mL: $elm$core$Maybe$Just(data.iH), 21271 mS: config.il, 21272 cw: editing, 21273 gE: 1, 21274 eW: editing, 21275 bu: A2($elm$core$Maybe$withDefault, '', data.bu), 21276 aB: A2($elm$core$Dict$singleton, config.f7, ''), 21277 bx: 0, 21278 cO: $elm$core$Maybe$Nothing, 21279 b2: 0, 21280 d_: false, 21281 kF: $elm$core$Maybe$Just(data.kE) 21282 }; 21283 }); 21284var $author$project$Page$Group$NewEntry$initDuplicate = F2( 21285 function (config, kind) { 21286 switch (kind.$) { 21287 case 0: 21288 var data = kind.a; 21289 return A3($author$project$Page$Group$NewEntry$initFromExpenseData, config, false, data); 21290 case 1: 21291 var data = kind.a; 21292 return A3($author$project$Page$Group$NewEntry$initFromTransferData, config, false, data); 21293 default: 21294 var data = kind.a; 21295 return A3($author$project$Page$Group$NewEntry$initFromIncomeData, config, false, data); 21296 } 21297 }); 21298var $author$project$Page$Group$NewEntry$initFromEntry = F2( 21299 function (config, entry) { 21300 var _v0 = entry.gE; 21301 switch (_v0.$) { 21302 case 0: 21303 var data = _v0.a; 21304 return A3($author$project$Page$Group$NewEntry$initFromExpenseData, config, true, data); 21305 case 1: 21306 var data = _v0.a; 21307 return A3($author$project$Page$Group$NewEntry$initFromTransferData, config, true, data); 21308 default: 21309 var data = _v0.a; 21310 return A3($author$project$Page$Group$NewEntry$initFromIncomeData, config, true, data); 21311 } 21312 }); 21313var $author$project$Page$Group$EntriesTab$initWithHighlight = F2( 21314 function (entryId, isDeleted) { 21315 return { 21316 X: $elm$core$Maybe$Nothing, 21317 aS: $elm$core$Set$singleton(entryId), 21318 a5: $author$project$Domain$Filter$emptyEntryFilters, 21319 dK: '', 21320 a0: isDeleted, 21321 cS: false 21322 }; 21323 }); 21324var $author$project$Domain$GroupState$activeMembers = function (state) { 21325 return A2( 21326 $elm$core$List$filter, 21327 A2( 21328 $elm$core$Basics$composeL, 21329 $elm$core$Basics$not, 21330 function ($) { 21331 return $.nt; 21332 }), 21333 $elm$core$Dict$values(state.r)); 21334}; 21335var $author$project$Translations$currentLanguage = function (_v0) { 21336 var lang = _v0; 21337 return lang; 21338}; 21339var $author$project$Domain$Date$monthToInt = function (month) { 21340 switch (month) { 21341 case 0: 21342 return 1; 21343 case 1: 21344 return 2; 21345 case 2: 21346 return 3; 21347 case 3: 21348 return 4; 21349 case 4: 21350 return 5; 21351 case 5: 21352 return 6; 21353 case 6: 21354 return 7; 21355 case 7: 21356 return 8; 21357 case 8: 21358 return 9; 21359 case 9: 21360 return 10; 21361 case 10: 21362 return 11; 21363 default: 21364 return 12; 21365 } 21366}; 21367var $elm$time$Time$flooredDiv = F2( 21368 function (numerator, denominator) { 21369 return $elm$core$Basics$floor(numerator / denominator); 21370 }); 21371var $elm$time$Time$toAdjustedMinutesHelp = F3( 21372 function (defaultOffset, posixMinutes, eras) { 21373 toAdjustedMinutesHelp: 21374 while (true) { 21375 if (!eras.b) { 21376 return posixMinutes + defaultOffset; 21377 } else { 21378 var era = eras.a; 21379 var olderEras = eras.b; 21380 if (_Utils_cmp(era.qs, posixMinutes) < 0) { 21381 return posixMinutes + era.L; 21382 } else { 21383 var $temp$defaultOffset = defaultOffset, 21384 $temp$posixMinutes = posixMinutes, 21385 $temp$eras = olderEras; 21386 defaultOffset = $temp$defaultOffset; 21387 posixMinutes = $temp$posixMinutes; 21388 eras = $temp$eras; 21389 continue toAdjustedMinutesHelp; 21390 } 21391 } 21392 } 21393 }); 21394var $elm$time$Time$toAdjustedMinutes = F2( 21395 function (_v0, time) { 21396 var defaultOffset = _v0.a; 21397 var eras = _v0.b; 21398 return A3( 21399 $elm$time$Time$toAdjustedMinutesHelp, 21400 defaultOffset, 21401 A2( 21402 $elm$time$Time$flooredDiv, 21403 $elm$time$Time$posixToMillis(time), 21404 60000), 21405 eras); 21406 }); 21407var $elm$time$Time$toCivil = function (minutes) { 21408 var rawDay = A2($elm$time$Time$flooredDiv, minutes, 60 * 24) + 719468; 21409 var era = (((rawDay >= 0) ? rawDay : (rawDay - 146096)) / 146097) | 0; 21410 var dayOfEra = rawDay - (era * 146097); 21411 var yearOfEra = ((((dayOfEra - ((dayOfEra / 1460) | 0)) + ((dayOfEra / 36524) | 0)) - ((dayOfEra / 146096) | 0)) / 365) | 0; 21412 var dayOfYear = dayOfEra - (((365 * yearOfEra) + ((yearOfEra / 4) | 0)) - ((yearOfEra / 100) | 0)); 21413 var mp = (((5 * dayOfYear) + 2) / 153) | 0;
21414 var month = mp + ((mp < 10) ? 3 : (-9)); 21415 var year = yearOfEra + (era * 400); 21416 return { 21417 y: (dayOfYear - ((((153 * mp) + 2) / 5) | 0)) + 1, 21418 F: month, 21419 C: year + ((month <= 2) ? 1 : 0) 21420 }; 21421}; 21422var $elm$time$Time$toDay = F2( 21423 function (zone, time) { 21424 return $elm$time$Time$toCivil( 21425 A2($elm$time$Time$toAdjustedMinutes, zone, time)).y; 21426 }); 21427var $elm$time$Time$Apr = 3; 21428var $elm$time$Time$Aug = 7; 21429var $elm$time$Time$Dec = 11; 21430var $elm$time$Time$Feb = 1; 21431var $elm$time$Time$Jan = 0; 21432var $elm$time$Time$Jul = 6; 21433var $elm$time$Time$Jun = 5; 21434var $elm$time$Time$Mar = 2; 21435var $elm$time$Time$May = 4; 21436var $elm$time$Time$Nov = 10; 21437var $elm$time$Time$Oct = 9; 21438var $elm$time$Time$Sep = 8; 21439var $elm$time$Time$toMonth = F2( 21440 function (zone, time) { 21441 var _v0 = $elm$time$Time$toCivil( 21442 A2($elm$time$Time$toAdjustedMinutes, zone, time)).F; 21443 switch (_v0) { 21444 case 1: 21445 return 0; 21446 case 2: 21447 return 1; 21448 case 3: 21449 return 2; 21450 case 4: 21451 return 3; 21452 case 5: 21453 return 4; 21454 case 6: 21455 return 5; 21456 case 7: 21457 return 6; 21458 case 8: 21459 return 7; 21460 case 9: 21461 return 8; 21462 case 10: 21463 return 9; 21464 case 11: 21465 return 10; 21466 default: 21467 return 11; 21468 } 21469 }); 21470var $elm$time$Time$toYear = F2( 21471 function (zone, time) { 21472 return $elm$time$Time$toCivil( 21473 A2($elm$time$Time$toAdjustedMinutes, zone, time)).C; 21474 }); 21475var $author$project$Domain$Date$posixToDate = F2( 21476 function (zone, posix) { 21477 return { 21478 y: A2($elm$time$Time$toDay, zone, posix), 21479 F: $author$project$Domain$Date$monthToInt( 21480 A2($elm$time$Time$toMonth, zone, posix)), 21481 C: A2($elm$time$Time$toYear, zone, posix) 21482 }; 21483 }); 21484var $author$project$Page$Group$memberEntryFormConfig = F3( 21485 function (config, userRootId, loaded) { 21486 return { 21487 hI: A2( 21488 $elm$core$List$map, 21489 function ($) { 21490 return $.aj; 21491 }, 21492 $author$project$Domain$GroupState$activeMembers(loaded.a6)), 21493 f7: userRootId, 21494 il: loaded.bA.il, 21495 eX: $author$project$Translations$currentLanguage(config.aJ), 21496 qV: A2($author$project$Domain$Date$posixToDate, config.al, config.ap) 21497 }; 21498 }); 21499var $author$project$Page$Group$recoveryRootId = F2( 21500 function (model, loaded) { 21501 return $elm$core$List$head( 21502 A2( 21503 $elm$core$List$filterMap, 21504 $author$project$Domain$GroupState$resolveMemberRootId(loaded.a6), 21505 A2($elm$core$List$cons, model.iY, model.ff))); 21506 }); 21507var $author$project$Page$Group$OnDiagnosticsLoaded = function (a) { 21508 return {$: 43, a: a}; 21509}; 21510var $author$project$Page$Group$Diagnostics$isFresh = F2( 21511 function (loaded, model) { 21512 if (!model.$) { 21513 var stats = model.a; 21514 return _Utils_eq(stats.ct, loaded.bA.m9) && _Utils_eq( 21515 stats.gn, 21516 $elm$core$List$length(loaded.iC)); 21517 } else { 21518 return false; 21519 } 21520 }); 21521var $author$project$Page$Group$Diagnostics$median = function (values) { 21522 var sorted = $elm$core$List$sort(values); 21523 return A2( 21524 $elm$core$Maybe$withDefault, 21525 0, 21526 $elm$core$List$head( 21527 A2( 21528 $elm$core$List$drop, 21529 (($elm$core$List$length(sorted) - 1) / 2) | 0, 21530 sorted))); 21531}; 21532var $author$project$Page$Group$Diagnostics$buildStats = F5( 21533 function (loaded, timings, compression, storage, persistStatus) { 21534 var total = $elm$core$List$sum(compression.fd); 21535 var count = $elm$core$List$length(compression.fd); 21536 return { 21537 fT: (!count) ? 0 : ((total / count) | 0), 21538 gn: count, 21539 ct: loaded.bA.m9, 21540 di: compression.di, 21541 cA: timings.cA, 21542 gK: $author$project$Page$Group$Diagnostics$median(compression.fd), 21543 jE: persistStatus, 21544 hb: timings.fn.iu, 21545 hc: timings.fn.cE, 21546 fu: storage, 21547 hw: total, 21548 c1: timings.c1, 21549 c2: timings.c2 21550 }; 21551 }); 21552var $author$project$Page$Group$Diagnostics$CompressionStats = F2( 21553 function (plaintextBytes, gzip) { 21554 return {di: gzip, fd: plaintextBytes}; 21555 }); 21556var $author$project$Page$Group$Diagnostics$compressionStatsDecoder = A3( 21557 $elm$json$Json$Decode$map2, 21558 $author$project$Page$Group$Diagnostics$CompressionStats, 21559 A2( 21560 $elm$json$Json$Decode$field, 21561 'plaintextBytes', 21562 $elm$json$Json$Decode$list($elm$json$Json$Decode$int)), 21563 A2( 21564 $elm$json$Json$Decode$field, 21565 'gzip', 21566 $elm$json$Json$Decode$nullable( 21567 A3( 21568 $elm$json$Json$Decode$map2, 21569 F2( 21570 function (whole, per) { 21571 return {g3: per, hC: whole}; 21572 }), 21573 A2($elm$json$Json$Decode$field, 'wholeLogBytes', $elm$json$Json$Decode$int), 21574 A2($elm$json$Json$Decode$field, 'perEventBytes', $elm$json$Json$Decode$int))))); 21575var $author$project$Page$Group$Diagnostics$compressionTask = function (envelopes
21575) { 21576 return $andrewMacmurray$elm_concurrent_task$ConcurrentTask$define( 21577 { 21578 k: $elm$json$Json$Encode$object( 21579 _List_fromArray( 21580 [ 21581 _Utils_Tuple2( 21582 'events', 21583 A2( 21584 $elm$json$Json$Encode$list, 21585 A2( 21586 $elm$core$Basics$composeR, 21587 $author$project$Domain$Event$encodeEnvelope, 21588 A2( 21589 $elm$core$Basics$composeR, 21590 $elm$json$Json$Encode$encode(0), 21591 $elm$json$Json$Encode$string)), 21592 envelopes)) 21593 ])), 21594 l: $andrewMacmurray$elm_concurrent_task$ConcurrentTask$expectNoErrors, 21595 m: $andrewMacmurray$elm_concurrent_task$ConcurrentTask$expectJson($author$project$Page$Group$Diagnostics$compressionStatsDecoder), 21596 n: 'diagnostics:compressionStats' 21597 }); 21598}; 21599var $author$project$Infra$UsageStats$StorageEstimate = F2( 21600 function (usage, quota) { 21601 return {pJ: quota, q4: usage}; 21602 }); 21603var $author$project$Infra$UsageStats$estimateStorage = $andrewMacmurray$elm_concurrent_task$ConcurrentTask$define( 21604 { 21605 k: $elm$json$Json$Encode$null, 21606 l: $andrewMacmurray$elm_concurrent_task$ConcurrentTask$expectNoErrors, 21607 m: $andrewMacmurray$elm_concurrent_task$ConcurrentTask$expectJson( 21608 A3( 21609 $elm$json$Json$Decode$map2, 21610 $author$project$Infra$UsageStats$StorageEstimate, 21611 A2($elm$json$Json$Decode$field, 'usage', $elm$json$Json$Decode$int), 21612 A2($elm$json$Json$Decode$field, 'quota', $elm$json$Json$Decode$int))), 21613 n: 'usageStats:estimateStorage' 21614 }); 21615var $author$project$Infra$Storage$loadGroupEvents = F2( 21616 function (db, groupId) { 21617 return A2( 21618 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$map, 21619 $elm$core$List$map( 21620 function ($) { 21621 return $.eH; 21622 }), 21623 A2($author$project$Infra$Storage$loadStoredEvents, db, groupId)); 21624 }); 21625var $andrewMacmurray$elm_concurrent_task$ConcurrentTask$map3 = F4( 21626 function (f, a, b, c) { 21627 return A2( 21628 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$andMap, 21629 c, 21630 A2( 21631 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$andMap, 21632 b, 21633 A2( 21634 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$andMap, 21635 a, 21636 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$succeed(f)))); 21637 }); 21638var $author$project$Infra$UsageStats$NotPersisted = 1; 21639var $author$project$Infra$UsageStats$PersistUnsupported = 2; 21640var $author$project$Infra$UsageStats$Persisted = 0; 21641var $author$project$Infra$UsageStats$persistedTask = function (_function) { 21642 return $andrewMacmurray$elm_concurrent_task$ConcurrentTask$define( 21643 { 21644 k: $elm$json$Json$Encode$null, 21645 l: $andrewMacmurray$elm_concurrent_task$ConcurrentTask$expectNoErrors, 21646 m: $andrewMacmurray$elm_concurrent_task$ConcurrentTask$expectJson( 21647 A3( 21648 $elm$json$Json$Decode$map2, 21649 F2( 21650 function (supported, persisted) { 21651 return (!supported) ? 2 : (persisted ? 0 : 1); 21652 }), 21653 A2($elm$json$Json$Decode$field, 'supported', $elm$json$Json$Decode$bool), 21654 A2($elm$json$Json$Decode$field, 'persisted', $elm$json$Json$Decode$bool))), 21655 n: _function 21656 }); 21657}; 21658var $author$project$Infra$UsageStats$persistedStatus = $author$project$Infra$UsageStats$persistedTask('usageStats:persistedStatus'); 21659var $author$project$Page$Group$Diagnostics$timed = function (task) { 21660 return A2( 21661 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$andThen, 21662 function (before) { 21663 return A2( 21664 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$andThen, 21665 function (value) { 21666 return A2( 21667 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$map, 21668 function (after) { 21669 return { 21670 cE: $elm$time$Time$posixToMillis(after) - $elm$time$Time$posixToMillis(before), 21671 q8: value 21672 }; 21673 }, 21674 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$Time$now); 21675 }, 21676 task); 21677 }, 21678 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$Time$now); 21679}; 21680var $author$project$Page$Group$Diagnostics$replayTask = function (events) { 21681 return A2( 21682 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$map, 21683 function (run) { 21684 return { 21685 iu: $elm$core$Dict$size(run.q8.E), 21686 cE: run.cE 21687 }; 21688 }, 21689 $author$project$Page$Group$Diagnostics$timed( 21690 A2( 21691 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$map, 21692 function (_v0) { 21693 return A2($author$project$Domain$GroupState$applyEvents, events, $author$project$Domain$GroupState$empty); 21694 }, 21695 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$succeed(0)))); 21696}; 21697var $author$project$Page$Group$Diagnostics$load = F2( 21698 function (db, loaded) { 21699 return A2( 21700 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$andThen, 21701 function (loadRun) { 21702 return A2( 21703 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$andThen, 21704 function (verifyRun) { 21705 return A2( 21706 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$andThen, 21707 function (replay) { 21708 return A4( 21709 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$map3, 21710 A2( 21711 $author$project$Page$Group$Diagnostics$buildStats, 21712 loaded, 21713 { 21714 cA: loadRun.cE, 21715 fn: replay, 21716 c1: $elm$core$List$length(verifyRun.q8), 21717 c2: verifyRun.cE 21718 }), 21719 $author$project$Page$Group$Diagnostics$compressionTask(loaded.iC), 21720 A2($andrewMacmurray$elm_concurrent_task$ConcurrentTask$mapError, $elm$core$Basics$never, $author$project$Infra$UsageStats$estimateStorage), 21721 A2($andrewMacmurray$elm_concurrent_task$ConcurrentTask$mapError, $elm$core$Basics$never, $author$project$Infra$UsageStats$persistedStatus)); 21722 }, 21723 $author$project$Page$Group$Diagnostics$replayTask(loaded.iC)); 21724 }, 21725 $author$project$Page$Group$Diagnostics$timed( 21726 A2($author$project$Infra$EventVerification$filterVerifiedEvents, $author$project$Domain$GroupState$empty, loadRun.q8))); 21727 }, 21728 $author$project$Page$Group$Diagnostics$timed( 21729 A2($author$project$Infra$Storage$loadGroupEvents, db, loaded.bA.m9))); 21730 }); 21731var $author$project$Page$Group$reloadDiagnosticsIfStale = F3( 21732 function (config, loaded, model) { 21733 return (config.mi && (!A2($author$project$Page$Group$Diagnostics$isFresh, loaded, model.cl))) ? A2( 21734 $elm$core$Tuple$mapFirst, 21735 function (r) { 21736 return _Utils_update( 21737 model, 21738 {cl: $author$project$Page$Group$Diagnostics$init, ak: r}); 21739 }, 21740 A3( 21741 $author$project$Infra$ConcurrentTaskExtra$andRun, 21742 $author$project$Page$Group$OnDiagnosticsLoaded, 21743 A2($author$project$Page$Group$Diagnostics$load, config.de, loaded), 21744 _Utils_Tuple2(model.ak, $elm$core$Platform$Cmd$none))) : _Utils_Tuple2(model, $elm$core$Platform$Cmd$none); 21745 }); 21746var $author$project$Page$Group$ScrollToEntryResult = {$: 46}; 21747var $elm$core$Task$onError = _Scheduler_onError; 21748var $elm$core$Task$attempt = F2( 21749 function (resultToMessage, task) { 21750 return $elm$core$Task$command( 21751 A2( 21752 $elm$core$Task$onError, 21753 A2( 21754 $elm$core$Basics$composeL, 21755 A2($elm$core$Basics$composeL, $elm$core$Task$succeed, resultToMessage),
21756 $elm$core$Result$Err), 21757 A2( 21758 $elm$core$Task$andThen, 21759 A2( 21760 $elm$core$Basics$composeL, 21761 A2($elm$core$Basics$composeL, $elm$core$Task$succeed, resultToMessage), 21762 $elm$core$Result$Ok), 21763 task))); 21764 }); 21765var $author$project$Page$Group$entryDomId = function (entryId) { 21766 return 'entry-' + entryId; 21767}; 21768var $elm$browser$Browser$Dom$getElement = _Browser_getElement; 21769var $elm$browser$Browser$Dom$setViewport = _Browser_setViewport; 21770var $author$project$Page$Group$scrollToEntryCmd = function (entryId) { 21771 return A2( 21772 $elm$core$Task$attempt, 21773 function (_v1) { 21774 return $author$project$Page$Group$ScrollToEntryResult; 21775 }, 21776 A2( 21777 $elm$core$Task$andThen, 21778 function (el) { 21779 return A2($elm$browser$Browser$Dom$setViewport, 0, el.mr.k0); 21780 }, 21781 A2( 21782 $elm$core$Task$andThen, 21783 function (_v0) { 21784 return $elm$browser$Browser$Dom$getElement( 21785 $author$project$Page$Group$entryDomId(entryId)); 21786 }, 21787 $elm$core$Process$sleep(50)))); 21788}; 21789var $author$project$Page$JoinGroup$showPreview = $author$project$Page$JoinGroup$ShowingPreview; 21790var $author$project$Page$Group$initPagesIfNeeded = F3( 21791 function (config, groupView, model) { 21792 var _v0 = model.a; 21793 if (_v0.$ === 4) { 21794 var loaded = _v0.a; 21795 var _v1 = _Utils_Tuple2( 21796 groupView, 21797 loaded.bA.gA ? $elm$core$Maybe$Nothing : A2($author$project$Page$Group$currentUserRootId, model, loaded)); 21798 _v1$9: 21799 while (true) { 21800 switch (_v1.a.$) { 21801 case 3: 21802 if (!_v1.b.$) { 21803 var _v2 = _v1.a; 21804 var userRootId = _v1.b.a; 21805 var entryFormConfig = A3($author$project$Page$Group$memberEntryFormConfig, config, userRootId, loaded); 21806 var _v3 = model.bv; 21807 if (!_v3.$) { 21808 switch (_v3.a.$) { 21809 case 1: 21810 var data = _v3.a.a; 21811 return _Utils_Tuple2( 21812 _Utils_update( 21813 model, 21814 { 21815 ac: A2( 21816 $author$project$Page$Group$NewEntry$initDuplicate, 21817 entryFormConfig, 21818 $author$project$Domain$Entry$Expense(data)), 21819 bv: $elm$core$Maybe$Nothing 21820 }), 21821 $elm$core$Platform$Cmd$none); 21822 case 0: 21823 var data = _v3.a.a; 21824 return _Utils_Tuple2( 21825 _Utils_update( 21826 model, 21827 { 21828 ac: A2( 21829 $author$project$Page$Group$NewEntry$initDuplicate, 21830 entryFormConfig, 21831 $author$project$Domain$Entry$Transfer(data)), 21832 bv: $elm$core$Maybe$Nothing 21833 }), 21834 $elm$core$Platform$Cmd$none); 21835 default: 21836 var data = _v3.a.a; 21837 return _Utils_Tuple2( 21838 _Utils_update( 21839 model, 21840 { 21841 ac: A2( 21842 $author$project$Page$Group$NewEntry$initDuplicate, 21843 entryFormConfig, 21844 $author$project$Domain$Entry$Income(data)), 21845 bv: $elm$core$Maybe$Nothing 21846 }), 21847 $elm$core$Platform$Cmd$none); 21848 } 21849 } else { 21850 return _Utils_Tuple2( 21851 _Utils_update( 21852 model, 21853 { 21854 ac: $author$project$Page$Group$NewEntry$init(entryFormConfig) 21855 }), 21856 $elm$core$Platform$Cmd$none); 21857 } 21858 } else { 21859 break _v1$9; 21860 } 21861 case 2: 21862 var entryId = _v1.a.a; 21863 var isDeleted = A2( 21864 $elm$core$Maybe$withDefault, 21865 false, 21866 A2( 21867 $elm$core$Maybe$map, 21868 function ($) { 21869 return $.gB; 21870 }, 21871 A2($elm$core$Dict$get, entryId, loaded.a6.E))); 21872 return _Utils_Tuple2( 21873 _Utils_update( 21874 model, 21875 { 21876 an: 1, 21877 cp: A2($author$project$Page$Group$EntriesTab$initWithHighlight, entryId, isDeleted) 21878 }), 21879 $author$project$Page$Group$scrollToEntryCmd(entryId)); 21880 case 4: 21881 if (!_v1.b.$) { 21882 var entryId = _v1.a.a; 21883 var userRootId = _v1.b.a; 21884 var _v4 = A2($elm$core$Dict$get, entryId, loaded.a6.E); 21885 if (!_v4.$) { 21886 var entryState = _v4.a; 21887 return _Utils_Tuple2( 21888 _Utils_update( 21889 model, 21890 { 21891 ac: A2( 21892 $author$project$Page$Group$NewEntry$initFromEntry, 21893 A3($author$project$Page$Group$memberEntryFormConfig, config, userRootId, loaded), 21894 entryState.bi) 21895 }), 21896 $elm$core$Platform$Cmd$none); 21897 } else { 21898 return _Utils_Tuple2(model, $elm$core$Platform$Cmd$none); 21899 } 21900 } else { 21901 break _v1$9; 21902 } 21903 case 6: 21904 if (!_v1.b.$) { 21905 var memberId = _v1.a.a; 21906 var _v5 = A2($elm$core$Dict$get, memberId, loaded.a6.r); 21907 if (!_v5.$) { 21908 var memberState = _v5.a; 21909 return _Utils_Tuple2( 21910 _Utils_update( 21911 model, 21912 { 21913 cn: A3($author$project$Page$Group$EditMemberMetadata$init, memberState.aj, memberState.bW, memberState.ji) 21914 }), 21915 $elm$core$Platform$Cmd$none); 21916 } else { 21917 return _Utils_Tuple2(model, $elm$core$Platform$Cmd$none); 21918 } 21919 } else { 21920 break _v1$9; 21921 } 21922 case 7: 21923 if (!_v1.b.$) { 21924 var _v6 = _v1.a; 21925 var sourceId = _v6.a; 21926 var maybeTargetId = _v6.b; 21927 return _Utils_Tuple2( 21928 _Utils_update( 21929 model, 21930 { 21931 cD: A2($author$project$Page$Group$MergeMember$init, sourceId, maybeTargetId) 21932 }), 21933 $elm$core$Platform$Cmd$none); 21934 } else { 21935 break _v1$9; 21936 } 21937 case 8: 21938 var _v7 = _v1.a; 21939 return _Utils_Tuple2( 21940 _Utils_update( 21941 model, 21942 { 21943 cm: $author$project$Page$Group$EditGroupMetadata$init(loaded.a6.iO) 21944 }), 21945 $elm$core$Platform$Cmd$none); 21946 case 9: 21947 if (_v1.b.$ === 1) { 21948 var _v8 = _v1.a; 21949 var _v9 = _v1.b; 21950 return _Utils_Tuple2( 21951 _Utils_update( 21952 model, 21953 { 21954 by: $author$project$Page$JoinGroup$showPreview( 21955 { 21956 iC: loaded.iC, 21957 ct: loaded.bA.m9, 21958 gs: loaded.gs, 21959 iP: loaded.a6.iO.bW, 21960 a6: loaded.a6, 21961 iU: false, 21962 n0: '', 21963 hk: $author$project$Page$JoinGroup$defaultAction(loaded.a6), 21964 cZ: loaded.cZ, 21965 bC: loaded.bC 21966 }) 21967 }), 21968 $elm$core$Platform$Cmd$none); 21969 } else { 21970 break _v1$9; 21971 } 21972 case 11: 21973 var _v10 = _v1.a; 21974 return A3($author$project$Page$Group$reloadDiagnosticsIfStale, config, loaded, model); 21975 case 10: 21976 var _v11 = _v1.a; 21977 return ((!_Utils_eq( 21978 A2($author$project$Page$Group$recoveryRootId, model, loaded), 21979 $elm$core$Maybe$Nothing)) && ((!loaded.bA.gA) && _Utils_eq(model.bV, $elm$core$Maybe$Nothing))) ? A2( 21980 $elm$core$Tuple$mapFirst, 21981 function (r) { 21982 return _Utils_update( 21983 model, 21984 {ak: r}); 21985 }, 21986 A3( 21987 $author$project$Infra$ConcurrentTaskExtra$andRun, 21988 $author$project$Page$Group$OnMigrationOrderFetched(loaded.bA.m9), 21989 $author$project$Infra$Server$fetchEventOrder( 21990 {ct: loaded.bA.m9, gs: loaded.gs, hl: config.hl}), 21991 _Utils_Tuple2(model.ak, $elm$core$Platform$Cmd$none))) : _Utils_Tuple2(model, $elm$core$Platform$Cmd$none); 21992 default: 21993 break _v1$9; 21994 } 21995 } 21996 return _Utils_Tuple2(model, $elm$core$Platform$Cmd$none); 21997 } else { 21998 return _Utils_Tuple2(model, $elm$core$Platform$Cmd$none); 21999 } 22000 }); 22001var $author$project$Page$Group$handleNavigation = F4( 22002 function (config, maybeSummary, groupView, model) { 22003 var _v0 = A3($author$project$Page$Group$ensureGroupLoaded, config, maybeSummary, model); 22004 var loadedModel = _v0.a;
22005 var loadCmd = _v0.b; 22006 var _v1 = A3($author$project$Page$Group$initPagesIfNeeded, config, groupView, loadedModel); 22007 var initModel = _v1.a; 22008 var initCmd = _v1.b; 22009 return _Utils_Tuple2( 22010 initModel, 22011 $elm$core$Platform$Cmd$batch( 22012 _List_fromArray( 22013 [loadCmd, initCmd]))); 22014 }); 22015var $author$project$Page$Move$handoffDelivered = function (_v0) { 22016 var data = _v0; 22017 return _Utils_update( 22018 data, 22019 {eD: true}); 22020}; 22021var $author$project$Main$HandoffDelivered = {$: 0}; 22022var $author$project$Main$HandoffReceived = function (a) { 22023 return {$: 1, a: a}; 22024}; 22025var $author$project$Main$handoffEventDecoder = A2( 22026 $elm$json$Json$Decode$andThen, 22027 function (event) { 22028 switch (event) { 22029 case 'delivered': 22030 return $elm$json$Json$Decode$succeed($author$project$Main$HandoffDelivered); 22031 case 'received': 22032 return A2( 22033 $elm$json$Json$Decode$map, 22034 $author$project$Main$HandoffReceived, 22035 A2($elm$json$Json$Decode$field, 'payload', $elm$json$Json$Decode$string)); 22036 default: 22037 return $elm$json$Json$Decode$fail('Unknown handoff event: ' + event); 22038 } 22039 }, 22040 A2($elm$json$Json$Decode$field, 'event', $elm$json$Json$Decode$string)); 22041var $author$project$Domain$Compaction$historyReaches = F2( 22042 function (attestation, events) { 22043 return (_Utils_cmp( 22044 $elm$core$List$length(events), 22045 attestation.bK) > -1) && A2( 22046 $elm$core$List$any, 22047 function (envelope) { 22048 return _Utils_eq(envelope.m9, attestation.iS); 22049 }, 22050 events); 22051 }); 22052var $author$project$Translations$homeJoinLinkInvalid = function (_v0) { 22053 var lang = _v0; 22054 if (!lang) { 22055 return 'That doesn\'t look like a valid invite link.'; 22056 } else { 22057 return 'Ce lien d\'invitation n\'est pas valide.'; 22058 } 22059}; 22060var $author$project$Translations$importErrorTooLarge = function (_v0) { 22061 var lang = _v0; 22062 if (!lang) { 22063 return 'This file is too large to import.'; 22064 } else { 22065 return 'Ce fichier est trop volumineux pour être importé.'; 22066 } 22067}; 22068var $author$project$Page$ImportSplitwise$ClaimMember = function (a) { 22069 return {$: 0, a: a}; 22070}; 22071var $author$project$Page$ImportSplitwise$Model = $elm$core$Basics$identity; 22072var $author$project$Page$ImportSplitwise$NewMember = {$: 1}; 22073var $elm$core$List$member = F2( 22074 function (x, xs) { 22075 return A2( 22076 $elm$core$List$any, 22077 function (a) { 22078 return _Utils_eq(a, x); 22079 }, 22080 xs); 22081 }); 22082var $author$project$SplitwiseImport$usedCurrencies = function (parsed) { 22083 return A3( 22084 $elm$core$List$foldr, 22085 F2( 22086 function (row, acc) { 22087 return A2($elm$core$List$member, row.bg, acc) ? acc : A2($elm$core$List$cons, row.bg, acc); 22088 }), 22089 _List_Nil, 22090 parsed.p$); 22091}; 22092var $author$project$Page$ImportSplitwise$mostUsedCurrency = function (parsed) { 22093 var counts = A3( 22094 $elm$core$List$foldl, 22095 F2( 22096 function (row, acc) { 22097 return A3( 22098 $elm$core$Dict$update, 22099 $author$project$Domain$Currency$currencyCode(row.bg), 22100 function (n) { 22101 return $elm$core$Maybe$Just( 22102 1 + A2($elm$core$Maybe$withDefault, 0, n)); 22103 }, 22104 acc); 22105 }), 22106 $elm$core$Dict$empty, 22107 parsed.p$); 22108 return A2( 22109 $elm$core$Maybe$withDefault, 22110 1, 22111 $elm$core$List$head( 22112 A2( 22113 $elm$core$List$sortBy, 22114 function (c) { 22115 return -A2( 22116 $elm$core$Maybe$withDefault, 22117 0, 22118 A2( 22119 $elm$core$Dict$get, 22120 $author$project$Domain$Currency$currencyCode(c), 22121 counts)); 22122 }, 22123 $author$project$SplitwiseImport$usedCurrencies(parsed)))); 22124}; 22125var $author$project$Page$ImportSplitwise$init = function (_v0) { 22126 var groupName = _v0.iP; 22127 var parsed = _v0.g2; 22128 return { 22129 il: $author$project$Page$ImportSplitwise$mostUsedCurrency(parsed), 22130 iP: groupName, 22131 O: $elm$core$List$isEmpty(parsed.nK) ? $author$project$Page$ImportSplitwise$NewMember : $author$project$Page$ImportSplitwise$ClaimMember(0), 22132 n0: '', 22133 g2: parsed, 22134 a$: $elm$core$Dict$empty, 22135 bx: $elm$core$Dict$empty, 22136 d_: false 22137 }; 22138}; 22139var $author$project$Main$isCurrentJoinGroup = F2( 22140 function (groupId, route) { 22141 if ((route.$ === 6) && (!route.b.$)) { 22142 var routeGroupId = route.a; 22143 return _Utils_eq(routeGroupId, groupId); 22144 } else { 22145 return false; 22146 } 22147 }); 22148var $author$project$Main$isCurrentJoinInvite = F4( 22149 function (groupId, groupKey, inviteTail, route) { 22150 if ((route.$ === 6) && (!route.b.$)) { 22151 var routeGroupId = route.a; 22152 var invite = route.b.a; 22153 return _Utils_eq(routeGroupId, groupId) && (_Utils_eq(invite.i4, groupKey) && _Utils_eq(invite.ky, inviteTail)); 22154 } else { 22155 return false;
22156 } 22157 }); 22158var $author$project$Translations$joinGroupTruncated = function (_v0) { 22159 var lang = _v0; 22160 if (!lang) { 22161 return 'The server returned less history than this invite expects â the group\'s data may have been tampered with. Ask the person who invited you for a fresh link.'; 22162 } else { 22163 return 'Le serveur a renvoyé moins d\'historique que cette invitation ne l\'exige â les données du groupe ont peut-être été altérées. Demande un nouveau lien à la personne qui t\'a invité·e.'; 22164 } 22165}; 22166var $author$project$ErrorLog$log = F5( 22167 function (timestamp, source, severity, message, model) { 22168 var _v0 = model.E; 22169 if (_v0.b) { 22170 var head = _v0.a; 22171 var rest = _v0.b; 22172 if (_Utils_eq(head.dY, source) && (_Utils_eq(head.dN, severity) && _Utils_eq(head.dv, message))) { 22173 return _Utils_update( 22174 model, 22175 { 22176 E: A2( 22177 $elm$core$List$cons, 22178 _Utils_update( 22179 head, 22180 {bH: head.bH + 1, kD: timestamp}), 22181 rest) 22182 }); 22183 } else { 22184 var newSize = model.dW + 1; 22185 var newEntries = A2( 22186 $elm$core$List$cons, 22187 {bH: 1, dv: message, dN: severity, dY: source, kD: timestamp}, 22188 model.E); 22189 return (newSize > 1100) ? { 22190 E: A2($elm$core$List$take, 1000, newEntries), 22191 dW: 1000 22192 } : {E: newEntries, dW: newSize}; 22193 } 22194 } else { 22195 return { 22196 E: _List_fromArray( 22197 [ 22198 {bH: 1, dv: message, dN: severity, dY: source, kD: timestamp} 22199 ]), 22200 dW: 1 22201 }; 22202 } 22203 }); 22204var $author$project$Main$logError = F4( 22205 function (source, severity, message, model) { 22206 return _Utils_update( 22207 model, 22208 { 22209 bJ: A5($author$project$ErrorLog$log, model.ap, source, severity, message, model.bJ) 22210 }); 22211 }); 22212var $elm$core$Platform$Cmd$map = _Platform_map; 22213var $author$project$Changelog$Latest$date = '2026-08-27'; 22214var $author$project$Infra$Storage$saveLastSeenChangelog = F2( 22215 function (db, date) { 22216 return A4( 22217 $author$project$IndexedDb$putAt, 22218 db, 22219 $author$project$Infra$Storage$identityStore, 22220 $author$project$IndexedDb$StringKey('lastSeenChangelog'), 22221 $elm$json$Json$Encode$string(date)); 22222 }); 22223var $author$project$Main$markChangelogSeen = function (model) { 22224 var _v0 = model.b; 22225 if (_v0.$ === 1) { 22226 var readyData = _v0.a; 22227 return _Utils_eq( 22228 readyData.eY, 22229 $elm$core$Maybe$Just($author$project$Changelog$Latest$date)) ? _Utils_Tuple2(model, $elm$core$Platform$Cmd$none) : A2( 22230 $elm$core$Tuple$mapFirst, 22231 function (runner) { 22232 return _Utils_update( 22233 model, 22234 { 22235 b: $author$project$Main$Ready( 22236 _Utils_update( 22237 readyData, 22238 { 22239 eY: $elm$core$Maybe$Just($author$project$Changelog$Latest$date) 22240 })), 22241 ak: runner 22242 }); 22243 }, 22244 A3( 22245 $author$project$Infra$ConcurrentTaskExtra$andRun, 22246 function (_v1) { 22247 return $author$project$Main$NoOp; 22248 }, 22249 A2($author$project$Infra$Storage$saveLastSeenChangelog, readyData.de, $author$project$Changelog$Latest$date), 22250 _Utils_Tuple2(model.ak, $elm$core$Platform$Cmd$none))); 22251 } else { 22252 return _Utils_Tuple2(model, $elm$core$Platform$Cmd$none); 22253 } 22254}; 22255var $author$project$Main$navScrollCmd = function (route) { 22256 if ((route.$ === 6) && (route.b.$ === 2)) { 22257 return $elm$core$Platform$Cmd$none; 22258 } else { 22259 return A2( 22260 $elm$core$Task$perform, 22261 function (_v1) { 22262 return $author$project$Main$NoOp; 22263 }, 22264 A2($elm$browser$Browser$Dom$setViewport, 0, 0)); 22265 } 22266}; 22267var $author$project$Main$openFeedback = _Platform_outgoingPort( 22268 'openFeedback', 22269 function ($) { 22270 return $elm$json$Json$Encode$object( 22271 _List_fromArray( 22272 [ 22273 _Utils_Tuple2( 22274 'copyText', 22275 $elm$json$Json$Encode$string($.ih)), 22276 _Utils_Tuple2( 22277 'email', 22278 $elm$json$Json$Encode$string($.is)), 22279 _Utils_Tuple2( 22280 'projectId', 22281 $elm$json$Json$Encode$string($.jM)) 22282 ])); 22283 }); 22284var $author$project$Main$openFeedbackCmd = F2( 22285 function (copyText, model) { 22286 var _v0 = model.mA; 22287 if (!_v0.$) { 22288 var projectId = _v0.a; 22289 return $author$project$Main$openFeedback( 22290 { 22291 ih: copyText, 22292 is: function () { 22293 var _v1 = model.b; 22294 if (_v1.$ === 1) { 22295 var readyData = _v1.a; 22296 return A2($elm$core$Maybe$withDefault, '', readyData.fr.is); 22297 } else { 22298 return ''; 22299 } 22300 }(), 22301 jM: projectId 22302 }); 22303 } else { 22304 return $elm$core$Platform$Cmd$none; 22305 } 22306 }); 22307var $elmcraft$core_extra$Maybe$Extra$orElse = F2( 22308 function (ma, mb) { 22309 if (mb.$ === 1) { 22310 return ma; 22311 } else { 22312 return mb; 22313 } 22314 }); 22315var $author$project$SplitwiseImport$Dropped = {$: 2}; 22316var $author$project$SplitwiseImport$Ignored = {$: 1}; 22317var $author$project$SplitwiseImport$Kept = function (a) { 22318 return {$: 0, a: a}; 22319}; 22320var $author$project$SplitwiseImport$Row = F6( 22321 function (date, description, category, currency, cost, nets) { 22322 return {h9: category, bf: cost, bg: currency, cj: date, eE: description, gT: nets}; 22323 }); 22324var $author$project$SplitwiseImport$allJust = A2( 22325 $elm$core$List$foldr, 22326 F2( 22327 function (m, acc) { 22328 return A3($elm$core$Maybe$map2, $elm$core$List$cons, m, acc); 22329 }), 22330 $elm$core$Maybe$Just(_List_Nil)); 22331var $author$project$Domain$Currency$currencyFromCode = function (s) { 22332 var _v0 = $elm$core$String$toLower(s); 22333 switch (_v0) { 22334 case 'usd': 22335 return $elm$core$Maybe$Just(0); 22336 case 'eur': 22337 return $elm$core$Maybe$Just(1); 22338 case 'gbp': 22339 return $elm$core$Maybe$Just(2); 22340 case 'chf': 22341 return $elm$core$Maybe$Just(3); 22342 case 'jpy': 22343 return $elm$core$Maybe$Just(4); 22344 case 'aud': 22345 return $elm$core$Maybe$Just(5); 22346 case 'cad': 22347 return $elm$core$Maybe$Just(6); 22348 case 'nzd': 22349 return $elm$core$Maybe$Just(7); 22350 case 'brl': 22351 return $elm$core$Maybe$Just(8);
22352 case 'ars': 22353 return $elm$core$Maybe$Just(9); 22354 default: 22355 return $elm$core$Maybe$Nothing; 22356 } 22357}; 22358var $author$project$SplitwiseImport$netsBalance = function (nets) { 22359 return _Utils_cmp( 22360 $elm$core$Basics$abs( 22361 $elm$core$List$sum(nets)), 22362 $elm$core$List$length(nets)) < 1; 22363}; 22364var $elm$core$Maybe$map3 = F4( 22365 function (func, ma, mb, mc) { 22366 if (ma.$ === 1) { 22367 return $elm$core$Maybe$Nothing; 22368 } else { 22369 var a = ma.a; 22370 if (mb.$ === 1) { 22371 return $elm$core$Maybe$Nothing; 22372 } else { 22373 var b = mb.a; 22374 if (mc.$ === 1) { 22375 return $elm$core$Maybe$Nothing; 22376 } else { 22377 var c = mc.a; 22378 return $elm$core$Maybe$Just( 22379 A3(func, a, b, c)); 22380 } 22381 } 22382 } 22383 }); 22384var $author$project$SplitwiseImport$parseDate = function (str) { 22385 var _v0 = A2( 22386 $elm$core$String$split, 22387 '-', 22388 $elm$core$String$trim(str)); 22389 if (((_v0.b && _v0.b.b) && _v0.b.b.b) && (!_v0.b.b.b.b)) { 22390 var y = _v0.a; 22391 var _v1 = _v0.b; 22392 var m = _v1.a; 22393 var _v2 = _v1.b; 22394 var d = _v2.a; 22395 return A4( 22396 $elm$core$Maybe$map3, 22397 $author$project$Domain$Date$Date, 22398 $elm$core$String$toInt(y), 22399 $elm$core$String$toInt(m), 22400 $elm$core$String$toInt(d)); 22401 } else { 22402 return $elm$core$Maybe$Nothing; 22403 } 22404}; 22405var $author$project$SplitwiseImport$orZero = function (s) { 22406 return (s === '') ? '0' : s; 22407}; 22408var $elm$core$String$padRight = F3( 22409 function (n, _char, string) { 22410 return _Utils_ap( 22411 string, 22412 A2( 22413 $elm$core$String$repeat, 22414 n - $elm$core$String$length(string), 22415 $elm$core$String$fromChar(_char))); 22416 }); 22417var $author$project$SplitwiseImport$roundedFraction = F2( 22418 function (prec, fracStr) { 22419 if (A2($elm$core$String$all, $elm$core$Char$isDigit, fracStr)) { 22420 var padded = A3($elm$core$String$padRight, prec + 1, '0', fracStr); 22421 var roundUp = A3($elm$core$String$slice, prec, prec + 1, padded) >= '5'; 22422 var kept = A2( 22423 $elm$core$Maybe$withDefault, 22424 0, 22425 $elm$core$String$toInt( 22426 $author$project$SplitwiseImport$orZero( 22427 A2($elm$core$String$left, prec, padded)))); 22428 return $elm$core$Maybe$Just( 22429 roundUp ? (kept + 1) : kept); 22430 } else { 22431 return $elm$core$Maybe$Nothing; 22432 } 22433 }); 22434var $author$project$SplitwiseImport$parseDecimal = F2( 22435 function (prec, raw) { 22436 var trimmed = $elm$core$String$trim(raw); 22437 if (trimmed === '') { 22438 return $elm$core$Maybe$Nothing; 22439 } else { 22440 var scale = A2($elm$core$Basics$pow, 10, prec); 22441 var _v0 = function () { 22442 var _v1 = $elm$core$String$uncons(trimmed); 22443 _v1$2: 22444 while (true) { 22445 if (!_v1.$) { 22446 switch (_v1.a.a) { 22447 case '-': 22448 var _v2 = _v1.a; 22449 var rest = _v2.b; 22450 return _Utils_Tuple2(-1, rest); 22451 case '+': 22452 var _v3 = _v1.a; 22453 var rest = _v3.b; 22454 return _Utils_Tuple2(1, rest); 22455 default: 22456 break _v1$2; 22457 } 22458 } else { 22459 break _v1$2; 22460 } 22461 } 22462 return _Utils_Tuple2(1, trimmed); 22463 }(); 22464 var sign = _v0.a; 22465 var body = _v0.b; 22466 var _v4 = A2($elm$core$String$split, '.', body); 22467 _v4$2: 22468 while (true) { 22469 if (_v4.b) { 22470 if (!_v4.b.b) { 22471 var intStr = _v4.a; 22472 return A2( 22473 $elm$core$Maybe$map, 22474 function (i) { 22475 return (sign * i) * scale; 22476 }, 22477 $elm$core$String$toInt( 22478 $author$project$SplitwiseImport$orZero(intStr))); 22479 } else { 22480 if (!_v4.b.b.b) { 22481 var intStr = _v4.a; 22482 var _v5 = _v4.b; 22483 var fracStr = _v5.a; 22484 return A3( 22485 $elm$core$Maybe$map2, 22486 F2( 22487 function (i, f) { 22488 return sign * ((i * scale) + f); 22489 }), 22490 $elm$core$String$toInt( 22491 $author$project$SplitwiseImport$orZero(intStr)), 22492 A2($author$project$SplitwiseImport$roundedFraction, prec, fracStr)); 22493 } else { 22494 break _v4$2; 22495 } 22496 } 22497 } else { 22498 break _v4$2; 22499 } 22500 } 22501 return $elm$core$Maybe$Nothing; 22502 } 22503 }); 22504var $author$project$SplitwiseImport$classifyRow = F2( 22505 function (memberCount, fields) { 22506 if ((((fields.b && fields.b.b) && fields.b.b.b) && fields.b.b.b.b) && fields.b.b.b.b.b) { 22507 var dateStr = fields.a; 22508 var _v1 = fields.b; 22509 var description = _v1.a; 22510 var _v2 = _v1.b; 22511 var category = _v2.a; 22512 var _v3 = _v2.b; 22513 var costStr = _v3.a; 22514 var _v4 = _v3.b; 22515 var currencyStr = _v4.a; 22516 var netFields = _v4.b; 22517 if ((description === 'Total balance') || ($elm$core$String$trim(costStr) === '')) { 22518 return $author$project$SplitwiseImport$Ignored; 22519 } else { 22520 var _v5 = _Utils_Tuple2( 22521 $author$project$SplitwiseImport$parseDate(dateStr), 22522 $author$project$Domain$Currency$currencyFromCode( 22523 $elm$core$String$trim(currencyStr))); 22524 if ((!_v5.a.$) && (!_v5.b.$)) { 22525 var date = _v5.a.a; 22526 var currency = _v5.b.a; 22527 var prec = $author$project$Domain$Currency$precision(currency); 22528 var maybeNets = _Utils_eq( 22529 $elm$core$List$length(netFields), 22530 memberCount) ? $author$project$SplitwiseImport$allJust( 22531 A2( 22532 $elm$core$List$map, 22533 $author$project$SplitwiseImport$parseDecimal(prec), 22534 netFields)) : $elm$core$Maybe$Nothing; 22535 var _v6 = A3( 22536 $elm$core$Maybe$map2, 22537 A4($author$project$SplitwiseImport$Row, date, description, category, currency), 22538 A2($author$project$SplitwiseImport$parseDecimal, prec, costStr), 22539 maybeNets); 22540 if (!_v6.$) { 22541 var row = _v6.a; 22542 return $author$project$SplitwiseImport$netsBalance(row.gT) ? $author$project$SplitwiseImport$Kept(row) : $author$project$SplitwiseImport$Dropped; 22543 } else { 22544 return $author$project$SplitwiseImport$Dropped; 22545 } 22546 } else { 22547 return $author$project$SplitwiseImport$Dropped; 22548 } 22549 } 22550 } else { 22551 return $author$project$SplitwiseImport$Dropped; 22552 } 22553 }); 22554var $author$project$SplitwiseImport$closeField = function (st) { 22555 return A2( 22556 $elm$core$List$cons, 22557 $elm$core$String$fromList( 22558 $elm$core$List$reverse(st.aA)), 22559 st.p_); 22560}; 22561var $author$project$SplitwiseImport$closeRow = function (st) { 22562 return $elm$core$List$reverse( 22563 $author$project$SplitwiseImport$closeField(st)); 22564}; 22565var $author$project$SplitwiseImport$consume = F2( 22566 function (chars, st) { 22567 consume: 22568 while (true) { 22569 if (!chars.b) { 22570 return st; 22571 } else { 22572 var c = chars.a; 22573 var rest = chars.b; 22574 if (st.dG) { 22575 var _v1 = _Utils_Tuple2(c, rest); 22576 if ('\"' === _v1.a) { 22577 if (_v1.b.b && ('\"' === _v1.b.a)) { 22578 var _v2 = _v1.b; 22579 var rest2 = _v2.b; 22580 var $temp$chars = rest2, 22581 $temp$st = _Utils_update( 22582 st, 22583 { 22584 aA: A2($elm$core$List$cons, '\"', st.aA) 22585 }); 22586 chars = $temp$chars; 22587 st = $temp$st; 22588 continue consume; 22589 } else { 22590 var $temp$chars = rest, 22591 $temp$st = _Utils_update( 22592 st, 22593 {dG: false}); 22594 chars = $temp$chars; 22595 st = $temp$st; 22596 continue consume; 22597 } 22598 } else { 22599 var $temp$chars = rest, 22600 $temp$st = _Utils_update( 22601 st, 22602 { 22603 aA: A2($elm$core$List$cons, c, st.aA) 22604 }); 22605 chars = $temp$chars; 22606 st = $temp$st; 22607 continue consume; 22608 } 22609 } else { 22610 switch (c) { 22611 case '\"': 22612 var $temp$chars = rest, 22613 $temp$st = _Utils_update( 22614 st, 22615 {dG: true}); 22616 chars = $temp$chars; 22617 st = $temp$st; 22618 continue consume; 22619 case ',': 22620 var $temp$chars = rest, 22621 $temp$st = _Utils_update( 22622 st, 22623 { 22624 aA: _List_Nil, 22625 p_: $author$project$SplitwiseImport$closeField(st) 22626 }); 22627 chars = $temp$chars; 22628 st = $temp$st; 22629 continue consume; 22630 case '\n': 22631 var $temp$chars = rest, 22632 $temp$st = _Utils_update( 22633 st, 22634 { 22635 aA: _List_Nil, 22636 p_: _List_Nil, 22637 p$: A2( 22638 $elm$core$List$cons, 22639 $author$project$SplitwiseImport$closeRow(st),
22640 st.p$) 22641 }); 22642 chars = $temp$chars; 22643 st = $temp$st; 22644 continue consume; 22645 case '\u000D': 22646 var $temp$chars = rest, 22647 $temp$st = st; 22648 chars = $temp$chars; 22649 st = $temp$st; 22650 continue consume; 22651 default: 22652 var $temp$chars = rest, 22653 $temp$st = _Utils_update( 22654 st, 22655 { 22656 aA: A2($elm$core$List$cons, c, st.aA) 22657 }); 22658 chars = $temp$chars; 22659 st = $temp$st; 22660 continue consume; 22661 } 22662 } 22663 } 22664 } 22665 }); 22666var $author$project$SplitwiseImport$flush = function (st) { 22667 return ($elm$core$List$isEmpty(st.aA) && $elm$core$List$isEmpty(st.p_)) ? $elm$core$List$reverse(st.p$) : $elm$core$List$reverse( 22668 A2( 22669 $elm$core$List$cons, 22670 $author$project$SplitwiseImport$closeRow(st), 22671 st.p$)); 22672}; 22673var $author$project$SplitwiseImport$splitRows = function (text) { 22674 return A2( 22675 $elm$core$List$filter, 22676 $elm$core$List$any( 22677 function (f) { 22678 return $elm$core$String$trim(f) !== ''; 22679 }), 22680 $author$project$SplitwiseImport$flush( 22681 A2( 22682 $author$project$SplitwiseImport$consume, 22683 $elm$core$String$toList(text), 22684 {aA: _List_Nil, dG: false, p_: _List_Nil, p$: _List_Nil}))); 22685}; 22686var $author$project$SplitwiseImport$parse = function (text) { 22687 var _v0 = $author$project$SplitwiseImport$splitRows(text); 22688 if (!_v0.b) { 22689 return $elm$core$Result$Err('The file is empty.'); 22690 } else { 22691 var header = _v0.a; 22692 var dataRows = _v0.b; 22693 var _v1 = A2($elm$core$List$drop, 5, header); 22694 if (!_v1.b) { 22695 return $elm$core$Result$Err('No member columns found in the CSV header.'); 22696 } else { 22697 var memberNames = _v1; 22698 var _v2 = A3( 22699 $elm$core$List$foldr, 22700 F2( 22701 function (fields, _v3) { 22702 var kept = _v3.a; 22703 var dropped = _v3.b; 22704 var _v4 = A2( 22705 $author$project$SplitwiseImport$classifyRow, 22706 $elm$core$List$length(memberNames), 22707 fields); 22708 switch (_v4.$) { 22709 case 0: 22710 var row = _v4.a; 22711 return _Utils_Tuple2( 22712 A2($elm$core$List$cons, row, kept), 22713 dropped); 22714 case 2: 22715 return _Utils_Tuple2(kept, dropped + 1); 22716 default: 22717 return _Utils_Tuple2(kept, dropped); 22718 } 22719 }), 22720 _Utils_Tuple2(_List_Nil, 0), 22721 dataRows); 22722 var rows = _v2.a; 22723 var skipped = _v2.b; 22724 return $elm$core$Result$Ok( 22725 {nK: memberNames, p$: rows, qg: skipped}); 22726 } 22727 } 22728}; 22729var $author$project$Domain$Compaction$parseAttestation = function (tail) { 22730 var _v0 = A2($elm$core$String$split, '-', tail); 22731 if (_v0.b) { 22732 var countPart = _v0.a; 22733 var rest = _v0.b; 22734 var _v1 = _Utils_Tuple2( 22735 $elm$core$String$toInt(countPart), 22736 rest); 22737 if ((!_v1.a.$) && _v1.b.b) { 22738 var count = _v1.a.a; 22739 var _v2 = _v1.b; 22740 return $elm$core$Maybe$Just( 22741 { 22742 bK: count, 22743 iS: A2($elm$core$String$join, '-', rest) 22744 }); 22745 } else { 22746 return $elm$core$Maybe$Nothing; 22747 } 22748 } else { 22749 return $elm$core$Maybe$Nothing; 22750 } 22751}; 22752var $author$project$Page$Receive$Apply = function (a) { 22753 return {$: 1, a: a}; 22754}; 22755var $author$project$Page$Receive$NoEffect = {$: 0}; 22756var $author$project$Page$Receive$canApply = function (data) { 22757 return (!data.be) && _Utils_eq(data.dI, $elm$core$Maybe$Nothing); 22758}; 22759var $author$project$Infra$Handoff$GroupHandoff = F2( 22760 function (summary, key) { 22761 return {i4: key, bA: summary}; 22762 }); 22763var $author$project$Infra$Handoff$Payload = F5( 22764 function (identity, groups, selfProfile, language, lastSeenChangelog) { 22765 return {eN: groups, O: identity, eX: language, eY: lastSeenChangelog, fr: selfProfile}; 22766 }); 22767var $author$project$Infra$Handoff$format = 'partage-handoff-v1'; 22768var $author$project$Infra$Handoff$decoder = A2( 22769 $elm$json$Json$Decode$andThen, 22770 function (fmt) { 22771 return _Utils_eq(fmt, $author$project$Infra$Handoff$format) ? A6( 22772 $elm$json$Json$Decode$map5, 22773 $author$project$Infra$Handoff$Payload, 22774 A2($elm$json$Json$Decode$field, 'identity', $author$project$Infra$Identity$decoder), 22775 A2( 22776 $elm$json$Json$Decode$field, 22777 'groups', 22778 $elm$json$Json$Decode$list( 22779 A3( 22780 $elm$json$Json$Decode$map2, 22781 $author$project$Infra$Handoff$GroupHandoff, 22782 A2($elm$json$Json$Decode$field, 'summary', $author$project$Domain$Group$summaryDecoder), 22783 A2($elm$json$Json$Decode$field, 'key', $elm$json$Json$Decode$string)))), 22784 A2($elm$json$Json$Decode$field, 'selfProfile', $author$project$Domain$Member$metadataDecoder), 22785 A2( 22786 $elm$json$Json$Decode$field, 22787 'language', 22788 $elm$json$Json$Decode$nullable($elm$json$Json$Decode$string)), 22789 A2( 22790 $elm$json$Json$Decode$field, 22791 'lastSeenChangelog', 22792 $elm$json$Json$Decode$nullable($elm$json$Json$Decode$string))) : $elm$json$Json$Decode$fail('Unknown format: ' + fmt); 22793 }, 22794 A2($elm$json$Json$Decode$field, 'format', $elm$json$Json$Decode$string)); 22795var $author$project$Infra$Handoff$fromString = function (raw) { 22796 return A2( 22797 $elm$core$Result$mapError, 22798 function (_v0) { 22799 return 'Unrecognized handoff payload'; 22800 }, 22801 A2( 22802 $elm$json$Json$Decode$decodeString, 22803 $author$project$Infra$Handoff$decoder, 22804 $elm$core$String$trim(raw))); 22805}; 22806var $author$project$Page$Receive$payloadArrived = F2( 22807 function (raw, model) { 22808 var data = model; 22809 if ($author$project$Page$Receive$canApply(data)) { 22810 var _v0 = $author$project$Infra$Handoff$fromString(raw); 22811 if (!_v0.$) { 22812 var payload = _v0.a; 22813 return _Utils_Tuple2( 22814 _Utils_update( 22815 data, 22816 {be: true, gi: $elm$core$Maybe$Nothing}), 22817 $author$project$Page$Receive$Apply(payload)); 22818 } else { 22819 return _Utils_Tuple2(model, $author$project$Page$Receive$NoEffect); 22820 } 22821 } else { 22822 return _Utils_Tuple2(model, $author$project$Page$Receive$NoEffect); 22823 } 22824 }); 22825var $author$project$Page$Move$payloadReady = F2( 22826 function (payload, _v0) { 22827 var data = _v0; 22828 return _Utils_update( 22829 data, 22830 { 22831 jC: $elm$core$Maybe$Just(payload) 22832 }); 22833 }); 22834var $author$project$Main$OnSelfProfileSaved = function (a) { 22835 return {$: 34, a: a}; 22836}; 22837var $author$project$Domain$FeedbackMoment$dayMs = ((24 * 60) * 60) * 1000; 22838var $author$project$Domain$FeedbackMoment$triggerKey = function (trigger) { 22839 switch (trigger) { 22840 case 0: 22841 return 'concluded'; 22842 case 1: 22843 return 'prolific'; 22844 default: 22845 return 'refusal'; 22846 } 22847}; 22848var $author$project$Domain$FeedbackMoment$allow = F4(
22849 function (now, groupId, trigger, _v0) { 22850 var history = _v0; 22851 var elapsedSince = function (shown) { 22852 return $elm$time$Time$posixToMillis(now) - $elm$time$Time$posixToMillis(shown); 22853 }; 22854 var quietFor = F2( 22855 function (days, shown) { 22856 return _Utils_cmp( 22857 elapsedSince(shown), 22858 days * $author$project$Domain$FeedbackMoment$dayMs) > -1; 22859 }); 22860 return (!A2( 22861 $elm$core$Set$member, 22862 _Utils_Tuple2( 22863 groupId, 22864 $author$project$Domain$FeedbackMoment$triggerKey(trigger)), 22865 history.cd)) && (A2( 22866 $elm$core$List$all, 22867 quietFor(7), 22868 $elm$core$Dict$values(history.b0)) && A2( 22869 $elm$core$Maybe$withDefault, 22870 true, 22871 A2( 22872 $elm$core$Maybe$map, 22873 quietFor(30), 22874 A2( 22875 $elm$core$Dict$get, 22876 $author$project$Domain$FeedbackMoment$triggerKey(trigger), 22877 history.b0)))); 22878 }); 22879var $author$project$Main$feedbackEnabled = function (model) { 22880 return (!_Utils_eq(model.mA, $elm$core$Maybe$Nothing)) && function () { 22881 var _v0 = model.d; 22882 _v0$2: 22883 while (true) { 22884 switch (_v0.$) { 22885 case 6: 22886 if (!_v0.b.$) { 22887 return false; 22888 } else { 22889 break _v0$2; 22890 } 22891 case 1: 22892 return false; 22893 default: 22894 break _v0$2; 22895 } 22896 } 22897 return true; 22898 }(); 22899}; 22900var $mpizenberg$elm_url_navigation_port$Navigation$pushUrl = F2( 22901 function (port_, appUrl) { 22902 return port_( 22903 $elm$json$Json$Encode$object( 22904 _List_fromArray( 22905 [ 22906 _Utils_Tuple2( 22907 'tag', 22908 $elm$json$Json$Encode$string('pushUrl')), 22909 _Utils_Tuple2( 22910 'url', 22911 $elm$json$Json$Encode$string( 22912 $lydell$elm_app_url$AppUrl$toString(appUrl))) 22913 ]))); 22914 }); 22915var $author$project$Domain$FeedbackMoment$record = F4( 22916 function (now, groupId, trigger, _v0) { 22917 var history = _v0; 22918 return { 22919 cd: A2( 22920 $elm$core$Set$insert, 22921 _Utils_Tuple2( 22922 groupId, 22923 $author$project$Domain$FeedbackMoment$triggerKey(trigger)), 22924 history.cd), 22925 b0: A3( 22926 $elm$core$Dict$insert, 22927 $author$project$Domain$FeedbackMoment$triggerKey(trigger), 22928 now, 22929 history.b0) 22930 }; 22931 }); 22932var $elm$core$Set$foldl = F3( 22933 function (func, initialState, _v0) { 22934 var dict = _v0; 22935 return A3( 22936 $elm$core$Dict$foldl, 22937 F3( 22938 function (key, _v1, state) { 22939 return A2(func, key, state); 22940 }), 22941 initialState, 22942 dict); 22943 }); 22944var $elm$json$Json$Encode$set = F2( 22945 function (func, entries) { 22946 return _Json_wrap( 22947 A3( 22948 $elm$core$Set$foldl, 22949 _Json_addEntry(func), 22950 _Json_emptyArray(0), 22951 entries)); 22952 }); 22953var $author$project$Domain$FeedbackMoment$encode = function (_v0) { 22954 var history = _v0; 22955 return $elm$json$Json$Encode$object( 22956 _List_fromArray( 22957 [ 22958 _Utils_Tuple2( 22959 'shownAt', 22960 A3( 22961 $elm$json$Json$Encode$dict, 22962 $elm$core$Basics$identity, 22963 A2($elm$core$Basics$composeR, $elm$time$Time$posixToMillis, $elm$json$Json$Encode$int), 22964 history.b0)), 22965 _Utils_Tuple2( 22966 'asked', 22967 A2( 22968 $elm$json$Json$Encode$set, 22969 function (_v1) { 22970 var groupId = _v1.a; 22971 var key = _v1.b; 22972 return A2( 22973 $elm$json$Json$Encode$list, 22974 $elm$json$Json$Encode$string, 22975 _List_fromArray( 22976 [groupId, key])); 22977 }, 22978 history.cd)) 22979 ])); 22980}; 22981var $author$project$Infra$Storage$saveFeedbackPrompts = F2( 22982 function (db, history) { 22983 return A4( 22984 $author$project$IndexedDb$putAt, 22985 db, 22986 $author$project$Infra$Storage$identityStore, 22987 $author$project$IndexedDb$StringKey('feedbackPrompts'),
22988 $author$project$Domain$FeedbackMoment$encode(history)); 22989 }); 22990var $author$project$Infra$Storage$saveSelfProfile = F2( 22991 function (db, meta) { 22992 return A4( 22993 $author$project$IndexedDb$putAt, 22994 db, 22995 $author$project$Infra$Storage$identityStore, 22996 $author$project$IndexedDb$StringKey('selfProfile'), 22997 $author$project$Domain$Member$encodeMetadata(meta)); 22998 }); 22999var $author$project$Main$processGroupOutputs = F3( 23000 function (model, groupCmd, outputs) { 23001 var _v0 = A3( 23002 $elm$core$List$foldl, 23003 F2( 23004 function (output, _v1) { 23005 var m = _v1.a; 23006 var cmds = _v1.b; 23007 switch (output.$) { 23008 case 0: 23009 var route = output.a; 23010 return _Utils_Tuple2( 23011 m, 23012 A2( 23013 $elm$core$List$cons, 23014 A2( 23015 $mpizenberg$elm_url_navigation_port$Navigation$pushUrl, 23016 $author$project$Main$navCmd, 23017 $author$project$Route$toAppUrl(route)), 23018 cmds)); 23019 case 1: 23020 var level = output.a; 23021 var message = output.b; 23022 var _v3 = A3($author$project$Main$addToast, level, message, m); 23023 var modelWithToast = _v3.a; 23024 var toastCmd = _v3.b; 23025 return _Utils_Tuple2( 23026 modelWithToast, 23027 A2($elm$core$List$cons, toastCmd, cmds)); 23028 case 2: 23029 var summary = output.a; 23030 var _v4 = m.b; 23031 if (_v4.$ === 1) { 23032 var readyData = _v4.a; 23033 return _Utils_Tuple2( 23034 _Utils_update( 23035 m, 23036 { 23037 b: $author$project$Main$Ready( 23038 _Utils_update( 23039 readyData, 23040 { 23041 eN: A3($elm$core$Dict$insert, summary.m9, summary, readyData.eN) 23042 })) 23043 }), 23044 cmds); 23045 } else { 23046 return _Utils_Tuple2(m, cmds); 23047 } 23048 case 3: 23049 var groupId = output.a; 23050 var _v5 = m.b; 23051 if (_v5.$ === 1) { 23052 var readyData = _v5.a; 23053 return _Utils_Tuple2( 23054 _Utils_update( 23055 m, 23056 { 23057 b: $author$project$Main$Ready( 23058 _Utils_update( 23059 readyData, 23060 { 23061 eN: A2($elm$core$Dict$remove, groupId, readyData.eN) 23062 })) 23063 }), 23064 cmds); 23065 } else { 23066 return _Utils_Tuple2(m, cmds); 23067 } 23068 case 4: 23069 var source = output.a; 23070 var severity = output.b; 23071 var message = output.c; 23072 return _Utils_Tuple2( 23073 A4($author$project$Main$logError, source, severity, message, m), 23074 cmds); 23075 case 6: 23076 var groupId = output.a; 23077 var trigger = output.b; 23078 var _v6 = m.b; 23079 if (_v6.$ === 1) { 23080 var readyData = _v6.a; 23081 if ($author$project$Main$feedbackEnabled(m) && (m.G.dk && A4($author$project$Domain$FeedbackMoment$allow, m.ap, groupId, trigger, readyData.mB))) { 23082 var history = A4($author$project$Domain$FeedbackMoment$record, m.ap, groupId, trigger, readyData.mB); 23083 var _v7 = A3( 23084 $author$project$Infra$ConcurrentTaskExtra$andRun, 23085 function (_v8) { 23086 return $author$project$Main$NoOp; 23087 }, 23088 A2($author$project$Infra$Storage$saveFeedbackPrompts, readyData.de, history), 23089 _Utils_Tuple2(m.ak, $elm$core$Platform$Cmd$none)); 23090 var runner = _v7.a; 23091 var saveCmd = _v7.b; 23092 return _Utils_Tuple2( 23093 _Utils_update( 23094 m, 23095 { 23096 b: $author$project$Main$Ready( 23097 _Utils_update( 23098 readyData, 23099 {mB: history})), 23100 bL: $elm$core$Maybe$Just( 23101 {ct: groupId, a2: trigger}), 23102 ak: runner 23103 }), 23104 A2($elm$core$List$cons, saveCmd, cmds)); 23105 } else { 23106 return _Utils_Tuple2(m, cmds); 23107 } 23108 } else { 23109 return _Utils_Tuple2(m, cmds); 23110 } 23111 default: 23112 var meta = output.a; 23113 var _v9 = m.b; 23114 if (_v9.$ === 1) { 23115 var readyData = _v9.a; 23116 var _v10 = A3( 23117 $author$project$Infra$ConcurrentTaskExtra$andRun, 23118 $author$project$Main$OnSelfProfileSaved, 23119 A2($author$project$Infra$Storage$saveSelfProfile, readyData.de, meta), 23120 _Utils_Tuple2(m.ak, $elm$core$Platform$Cmd$none)); 23121 var runner = _v10.a; 23122 var saveCmd = _v10.b; 23123 return _Utils_Tuple2( 23124 _Utils_update( 23125 m, 23126 { 23127 b: $author$project$Main$Ready( 23128 _Utils_update( 23129 readyData, 23130 {fr: meta})), 23131 ak: runner 23132 }), 23133 A2($elm$core$List$cons, saveCmd, cmds)); 23134 } else { 23135 return _Utils_Tuple2(m, cmds); 23136 } 23137 } 23138 }), 23139 _Utils_Tuple2(model, _List_Nil), 23140 outputs); 23141 var finalModel = _v0.a; 23142 var extraCmds = _v0.b; 23143 return _Utils_Tuple2( 23144 finalModel, 23145 $elm$core$Platform$Cmd$batch( 23146 A2( 23147 $elm$core$List$cons, 23148 A2($elm$core$Platform$Cmd$map, $author$project$Main$GroupMsg, groupCmd), 23149 extraCmds))); 23150 }); 23151var $author$project$ErrorLog$ImportExportSource = 5; 23152var $author$project$Page$Home$setImportError = F2( 23153 function (err, _v0) { 23154 var data = _v0; 23155 return _Utils_update( 23156 data, 23157 { 23158 bo: $elm$core$Maybe$Just(err) 23159 }); 23160 }); 23161var $author$project$Translations$toastImportSuccess = function (_v0) { 23162 var lang = _v0; 23163 if (!lang) { 23164 return 'Group imported successfully.'; 23165 } else { 23166 return 'Groupe importé avec succès.'; 23167 } 23168}; 23169var $author$project$Translations$toastImportTampered = F2( 23170 function (count, _v0) { 23171 var lang = _v0; 23172 if (!lang) { 23173 return 'Group imported, but ' + (count + ' event(s) failed signature verification and were removed.'); 23174 } else { 23175 return 'Groupe importé, mais ' + (count + ' événement(s) ont échoué la vérification de signature et ont été retirés.'); 23176 } 23177 }); 23178var $author$project$Main$processImportExportOutMsg = F3( 23179 function (model, ieCmd, maybeOutMsg) { 23180 if (maybeOutMsg.$ === 1) { 23181 return _Utils_Tuple2(model, ieCmd); 23182 } else { 23183 switch (maybeOutMsg.a.$) { 23184 case 0: 23185 var _v1 = maybeOutMsg.a; 23186 var level = _v1.a; 23187 var message = _v1.b; 23188 return A2( 23189 $author$project$Update$addCmd, 23190 ieCmd, 23191 A3( 23192 $author$project$Main$addToast, 23193 level, 23194 message, 23195 function () { 23196 if (level === 1) { 23197 return A4($author$project$Main$logError, 5, 0, message, model); 23198 } else { 23199 return model; 23200 } 23201 }())); 23202 case 1: 23203 var errorMsg = maybeOutMsg.a.a; 23204 return _Utils_Tuple2( 23205 _Utils_update( 23206 model, 23207 { 23208 ah: A2($author$project$Page$Home$setImportError, errorMsg, model.ah) 23209 }), 23210 ieCmd); 23211 default: 23212 var _v3 = maybeOutMsg.a; 23213 var summary = _v3.a; 23214 var droppedCount = _v3.b; 23215 var _v4 = model.b; 23216 if (_v4.$ === 1) { 23217 var readyData = _v4.a; 23218 var importedModel = _Utils_update( 23219 model, 23220 { 23221 b: $author$project$Main$Ready( 23222 _Utils_update( 23223 readyData, 23224 { 23225 eN: A3($elm$core$Dict$insert, summary.m9, summary, readyData.eN) 23226 })), 23227 ah: $author$project$Page$Home$init 23228 }); 23229 return A2( 23230 $author$project$Update$addCmd, 23231 A2( 23232 $mpizenberg$elm_url_navigation_port$Navigation$pushUrl, 23233 $author$project$Main$navCmd, 23234 $author$project$Route$toAppUrl( 23235 A2( 23236 $author$project$Route$GroupRoute, 23237 summary.m9, 23238 $author$project$Route$Tab(0)))), 23239 A2( 23240 $author$project$Update$addCmd, 23241 ieCmd, 23242 function () { 23243 if (droppedCount > 0) { 23244 var warning = A2( 23245 $author$project$Translations$toastImportTampered, 23246 $elm$core$String$fromInt(droppedCount), 23247 model.aJ); 23248 return A3( 23249 $author$project$Main$addToast, 23250 1, 23251 warning, 23252 A4($author$project$Main$logError, 5, 0, warning, importedModel)); 23253 } else { 23254 return A3( 23255 $author$project$Main$addToast, 23256 0, 23257 $author$project$Translations$toastImportSuccess(model.aJ), 23258 importedModel); 23259 } 23260 }())); 23261 } else { 23262 return _Utils_Tuple2(model, ieCmd); 23263 } 23264 } 23265 } 23266 }); 23267var $author$project$Page$Group$SyncFollowUpRequested = {$: 2}; 23268var $author$project$Page$Group$OnGroupSynced = F3( 23269 function (a, b, c) {
23270 return {$: 25, a: a, b: b, c: c}; 23271 }); 23272var $author$project$Page$Group$SyncRunning = {$: 1}; 23273var $author$project$GroupOps$needsRelaySync = function (loaded) { 23274 return (!loaded.bA.gA) || ($elm$core$List$isEmpty(loaded.iC) && _Utils_eq(loaded.cZ, $elm$core$Maybe$Nothing)); 23275}; 23276var $author$project$Route$toPath = function (route) { 23277 switch (route.$) { 23278 case 0: 23279 return '/groups'; 23280 case 1: 23281 var topic = route.a; 23282 return '/groups#n=' + topic; 23283 case 2: 23284 return '/groups/new'; 23285 case 3: 23286 return '/groups/import-splitwise'; 23287 case 4: 23288 return '/move'; 23289 case 5: 23290 return '/migrate'; 23291 case 6: 23292 switch (route.b.$) { 23293 case 0: 23294 var groupId = route.a; 23295 var invite = route.b.a; 23296 return '/join/' + (groupId + ('#' + $author$project$Route$joinFragment(invite))); 23297 case 2: 23298 var groupId = route.a; 23299 var entryId = route.b.a; 23300 return '/groups/' + (groupId + ('/entries?highlight=' + entryId)); 23301 case 1: 23302 switch (route.b.a) { 23303 case 0: 23304 var groupId = route.a; 23305 var _v1 = route.b.a; 23306 return '/groups/' + groupId; 23307 case 1: 23308 var groupId = route.a; 23309 var _v2 = route.b.a; 23310 return '/groups/' + (groupId + '/entries'); 23311 case 2: 23312 var groupId = route.a; 23313 var _v3 = route.b.a; 23314 return '/groups/' + (groupId + '/members'); 23315 default: 23316 var groupId = route.a; 23317 var _v4 = route.b.a; 23318 return '/groups/' + (groupId + '/activity'); 23319 } 23320 case 3: 23321 var groupId = route.a; 23322 var _v5 = route.b; 23323 return '/groups/' + (groupId + '/new-entry'); 23324 case 4: 23325 var groupId = route.a; 23326 var entryId = route.b.a; 23327 return '/groups/' + (groupId + ('/entries/' + (entryId + '/edit'))); 23328 case 5: 23329 var groupId = route.a; 23330 var _v6 = route.b; 23331 return '/groups/' + (groupId + '/members/new'); 23332 case 6: 23333 var groupId = route.a; 23334 var memberId = route.b.a; 23335 return '/groups/' + (groupId + ('/members/' + (memberId + '/edit'))); 23336 case 7: 23337 if (route.b.b.$ === 1) { 23338 var groupId = route.a; 23339 var _v7 = route.b; 23340 var sourceId = _v7.a; 23341 var _v8 = _v7.b; 23342 return '/groups/' + (groupId + ('/members/' + (sourceId + '/merge'))); 23343 } else { 23344 var groupId = route.a; 23345 var _v9 = route.b; 23346 var sourceId = _v9.a; 23347 var targetId = _v9.b.a; 23348 return '/groups/' + (groupId + ('/members/' + (sourceId + ('/merge/' + targetId)))); 23349 } 23350 case 8: 23351 var groupId = route.a; 23352 var _v10 = route.b; 23353 return '/groups/' + (groupId + '/settings'); 23354 case 9: 23355 var groupId = route.a; 23356 var _v11 = route.b; 23357 return '/groups/' + (groupId + '/rejoin'); 23358 case 10: 23359 var groupId = route.a; 23360 var _v12 = route.b; 23361 return '/groups/' + (groupId + '/migrate'); 23362 default: 23363 var groupId = route.a; 23364 var _v13 = route.b; 23365 return '/groups/' + (groupId + '/diagnostics'); 23366 } 23367 case 7: 23368 return '/about'; 23369 case 8: 23370 return '/error-log'; 23371 default: 23372 return '/'; 23373 } 23374}; 23375var $author$project$Page$Group$startSync = F3( 23376 function (config, groupId, model) { 23377 var _v0 = model.a; 23378 if (_v0.$ === 4) { 23379 var loaded = _v0.a; 23380 if (_Utils_eq(loaded.bA.m9, groupId) && $author$project$GroupOps$needsRelaySync(loaded)) { 23381 var verifySignatures = function (syncResult) { 23382 return A2( 23383 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$map, 23384 function (verifiedEvents) { 23385 var verifiedIds = $elm$core$Set$fromList( 23386 A2( 23387 $elm$core$List$map, 23388 function ($) { 23389 return $.m9; 23390 }, 23391 verifiedEvents)); 23392 var pull = syncResult.pF; 23393 var forgedAuthors = A2( 23394 $elm$core$List$map, 23395 function ($) { 23396 return $.q0; 23397 }, 23398 A2( 23399 $elm$core$List$filter, 23400 function (e) { 23401 return !A2($elm$core$Set$member, e.m9, verifiedIds); 23402 }, 23403 pull.iC)); 23404 return _Utils_update( 23405 syncResult, 23406 { 23407 pF: _Utils_update( 23408 pull, 23409 {iC: verifiedEvents, bm: forgedAuthors}) 23410 }); 23411 }, 23412 A2( 23413 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$mapError, 23414 $elm$core$Basics$never, 23415 A2($author$project$Infra$EventVerification$filterVerifiedEvents, loaded.a6, syncResult.pF.iC))); 23416 }; 23417 var unpushedEvents = $elm$core$List$reverse( 23418 A2( 23419 $elm$core$List$filter, 23420 function (e) { 23421 return A2($elm$core$Set$member, e.m9, loaded.bC); 23422 }, 23423 loaded.iC)); 23424 var notifyContext = function () { 23425 var _v1 = _Utils_Tuple3( 23426 config.g7, 23427 $elm$core$List$isEmpty(unpushedEvents), 23428 A2($author$project$Page$Group$currentUserRootId, model, loaded)); 23429 if (((!_v1.a.$) && (!_v1.b)) && (!_v1.c.$)) { 23430 var pushServerUrl = _v1.a.a; 23431 var actorId = _v1.c.a; 23432 return $elm$core$Maybe$Just( 23433 { 23434 hK: A2($author$project$Domain$GroupState$resolveMemberName, loaded.a6, actorId), 23435 hL: actorId, 23436 gs: loaded.gs, 23437 iP: loaded.a6.iO.bW, 23438 g7: pushServerUrl, 23439 hq: $author$project$Domain$GroupState$activityContext(loaded.a6), 23440 kS: $author$project$Route$toPath( 23441 A2( 23442 $author$project$Route$GroupRoute, 23443 groupId, 23444 $author$project$Route$Tab(3))) 23445 }); 23446 } else { 23447 return $elm$core$Maybe$Nothing; 23448 } 23449 }(); 23450 return A2( 23451 $elm$core$Tuple$mapFirst, 23452 function (r) { 23453 return _Utils_update( 23454 model, 23455 {ak: r, R: $author$project$Page$Group$SyncRunning}); 23456 }, 23457 A3( 23458 $author$project$Infra$ConcurrentTaskExtra$andRun, 23459 A2($author$project$Page$Group$OnGroupSynced, groupId, loaded.bC), 23460 A2( 23461 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$andThen, 23462 verifySignatures, 23463 A3( 23464 $author$project$Infra$Server$sync,
23465 {ct: groupId, gs: loaded.gs, hl: config.hl}, 23466 config.O.aK, 23467 {js: notifyContext, cZ: loaded.cZ, kO: unpushedEvents})), 23468 _Utils_Tuple2(model.ak, $elm$core$Platform$Cmd$none))); 23469 } else { 23470 return _Utils_Tuple2(model, $elm$core$Platform$Cmd$none); 23471 } 23472 } else { 23473 return _Utils_Tuple2(model, $elm$core$Platform$Cmd$none); 23474 } 23475 }); 23476var $author$project$Page$Group$triggerSyncInternal = F3( 23477 function (config, groupId, model) { 23478 var _v0 = model.R; 23479 switch (_v0.$) { 23480 case 0: 23481 return A3($author$project$Page$Group$startSync, config, groupId, model); 23482 case 1: 23483 return _Utils_Tuple2( 23484 _Utils_update( 23485 model, 23486 {R: $author$project$Page$Group$SyncFollowUpRequested}), 23487 $elm$core$Platform$Cmd$none); 23488 case 2: 23489 return _Utils_Tuple2(model, $elm$core$Platform$Cmd$none); 23490 default: 23491 var creatingGroupId = _v0.a; 23492 return _Utils_eq(creatingGroupId, groupId) ? _Utils_Tuple2(model, $elm$core$Platform$Cmd$none) : _Utils_Tuple2( 23493 _Utils_update( 23494 model, 23495 {R: $author$project$Page$Group$SyncFollowUpRequested}), 23496 $elm$core$Platform$Cmd$none); 23497 } 23498 }); 23499var $author$project$Page$Group$connectivityRestored = F2( 23500 function (config, model) { 23501 var _v0 = model.a; 23502 if (_v0.$ === 4) { 23503 var loaded = _v0.a; 23504 return A3($author$project$Page$Group$triggerSyncInternal, config, loaded.bA.m9, model); 23505 } else { 23506 return _Utils_Tuple2(model, $elm$core$Platform$Cmd$none); 23507 } 23508 }); 23509var $author$project$Infra$Storage$savePushServerUrl = F2( 23510 function (db, url) { 23511 return A4( 23512 $author$project$IndexedDb$putAt, 23513 db, 23514 $author$project$Infra$Storage$identityStore, 23515 $author$project$IndexedDb$StringKey('pushServerUrl'), 23516 $elm$json$Json$Encode$string( 23517 A2($elm$core$Maybe$withDefault, '', url))); 23518 }); 23519var $author$project$Infra$PushServer$register = F2( 23520 function (pushServerUrl, _v0) { 23521 var topic = _v0.d4; 23522 var subscription = _v0.d$; 23523 return $andrewMacmurray$elm_concurrent_task$ConcurrentTask$Http$post( 23524 { 23525 fY: $andrewMacmurray$elm_concurrent_task$ConcurrentTask$Http$jsonBody( 23526 $elm$json$Json$Encode$object( 23527 _List_fromArray( 23528 [ 23529 _Utils_Tuple2('subscription', subscription), 23530 _Utils_Tuple2( 23531 'topic', 23532 $elm$json$Json$Encode$string(topic)) 23533 ]))), 23534 m: $andrewMacmurray$elm_concurrent_task$ConcurrentTask$Http$expectWhatever, 23535 mY: _List_Nil, 23536 qQ: $elm$core$Maybe$Nothing, 23537 kS: pushServerUrl + '/subscriptions' 23538 }); 23539 }); 23540var $author$project$Infra$PushServer$unregisterEndpoint = function (subscription) { 23541 return A2( 23542 $elm$core$Result$withDefault, 23543 '', 23544 A2( 23545 $elm$json$Json$Decode$decodeValue, 23546 A2($elm$json$Json$Decode$field, 'endpoint', $elm$json$Json$Decode$string), 23547 subscription)); 23548}; 23549var $author$project$Infra$PushServer$unregister = F2( 23550 function (pushServerUrl, _v0) { 23551 var topic = _v0.d4; 23552 var subscription = _v0.d$; 23553 return $andrewMacmurray$elm_concurrent_task$ConcurrentTask$Http$request( 23554 { 23555 fY: $andrewMacmurray$elm_concurrent_task$ConcurrentTask$Http$jsonBody( 23556 $elm$json$Json$Encode$object( 23557 _List_fromArray( 23558 [ 23559 _Utils_Tuple2( 23560 'endpoint', 23561 $elm$json$Json$Encode$string( 23562 $author$project$Infra$PushServer$unregisterEndpoint(subscription))), 23563 _Utils_Tuple2( 23564 'topic', 23565 $elm$json$Json$Encode$string(topic)) 23566 ]))), 23567 m: $andrewMacmurray$elm_concurrent_task$ConcurrentTask$Http$expectWhatever, 23568 mY: _List_Nil, 23569 nN: 'DELETE', 23570 qQ: $elm$core$Maybe$Nothing, 23571 kS: pushServerUrl + '/subscriptions' 23572 }); 23573 }); 23574var $author$project$Infra$PushServer$setGroupNotification = function (_v0) { 23575 var pushServerUrl = _v0.g7; 23576 var topic = _v0.d4; 23577 var subscription = _v0.d$; 23578 var isSubscribed = _v0.gC; 23579 return isSubscribed ? A2( 23580 $author$project$Infra$PushServer$register, 23581 pushServerUrl, 23582 {d$: subscription, d4: topic}) : A2( 23583 $author$project$Infra$PushServer$unregister, 23584 pushServerUrl, 23585 {d$: subscription, d4: topic}); 23586}; 23587var $author$project$Translations$toastPushError = function (_v0) { 23588 var lang = _v0; 23589 if (!lang) { 23590 return 'Failed to update notification settings'; 23591 } else { 23592 return 'Ãchec de la mise à jour des notifications'; 23593 } 23594}; 23595var $author$project$Update$wrap = F3( 23596 function (tag, f, _v0) { 23597 var subModel = _v0.a; 23598 var subCmd = _v0.b; 23599 return _Utils_Tuple2( 23600 f(subModel), 23601 A2($elm$core$Platform$Cmd$map, tag, subCmd)); 23602 }); 23603var $author$project$Main$processPwaOutMsgs = F3( 23604 function (model, pwaCmd, outMsgs) { 23605 var _v0 = A3( 23606 $elm$core$List$foldl, 23607 F2( 23608 function (outMsg, _v1) { 23609 var m = _v1.a; 23610 var cmds = _v1.b; 23611 switch (outMsg.$) { 23612 case 0: 23613 return A2( 23614 $elm$core$Tuple$mapSecond, 23615 function (toastCmd) { 23616 return A2($elm$core$List$cons, toastCmd, cmds); 23617 }, 23618 A3( 23619 $author$project$Main$addToast, 23620 1, 23621 $author$project$Translations$toastPushError(m.aJ), 23622 m)); 23623 case 1: 23624 var url = outMsg.a; 23625 var _v3 = $elm$url$Url$fromString( 23626 _Utils_ap(m.aZ, url)); 23627 if (!_v3.$) { 23628 var parsedUrl = _v3.a; 23629 var route = $author$project$Route$fromAppUrl( 23630 $lydell$elm_app_url$AppUrl$fromUrl(parsedUrl)); 23631 return _Utils_Tuple2( 23632 m, 23633 A2( 23634 $elm$core$List$cons, 23635 A2( 23636 $mpizenberg$elm_url_navigation_port$Navigation$pushUrl, 23637 $author$project$Main$navCmd, 23638 $author$project$Route$toAppUrl(route)), 23639 cmds)); 23640 } else { 23641 return _Utils_Tuple2(m, cmds); 23642 } 23643 case 7: 23644 var source = outMsg.a; 23645 var severity = outMsg.b; 23646 var message = outMsg.c; 23647 return _Utils_Tuple2( 23648 A4($author$project$Main$logError, source, severity, message, m), 23649 cmds); 23650 case 3: 23651 var pushServerUrl = outMsg.a.g7; 23652 var subscription = outMsg.a.d$; 23653 var _v4 = m.b; 23654 if (_v4.$ === 1) { 23655 var readyData = _v4.a; 23656 return function (_v11) { 23657 var runner = _v11.a; 23658 var cmd = _v11.b; 23659 return _Utils_Tuple2( 23660 _Utils_update( 23661 m, 23662 {ak: runner}), 23663 A2($elm$core$List$cons, cmd, cmds)); 23664 }( 23665 A3( 23666 $author$project$Infra$ConcurrentTaskExtra$andRun, 23667 function (_v5) { 23668 return $author$project$Main$NoOp; 23669 }, 23670 A2( 23671 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$onError, 23672 function (_v10) { 23673 return $andrewMacmurray$elm_concurrent_task$ConcurrentTask$succeed(0); 23674 }, 23675 A2( 23676 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$andThen, 23677 function (topics) { 23678 return A2( 23679 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$map, 23680 function (_v9) { 23681 return 0; 23682 }, 23683 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$batch( 23684 A2( 23685 $elm$core$List$map, 23686 function (_v7) { 23687 var topic = _v7.b; 23688 return A2( 23689 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$mapError, 23690 function (_v8) { 23691 return 0; 23692 }, 23693 $author$project$Infra$PushServer$setGroupNotification( 23694 {gC: true, g7: pushServerUrl, d$: subscription, d4: topic})); 23695 }, 23696 topics))); 23697 }, 23698 A2( 23699 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$mapError, 23700 function (_v6) { 23701 return 0; 23702 }, 23703 $author$project$Infra$Storage$loadAllNotifyTopics(readyData.de)))), 23704 _Utils_Tuple2(m.ak, $elm$core$Platform$Cmd$none))); 23705 } else { 23706 return _Utils_Tuple2(m, cmds); 23707 } 23708 case 5: 23709 var projectId = outMsg.a; 23710 return _Utils_Tuple2( 23711 _Utils_update( 23712 m, 23713 {mA: projectId}), 23714 cmds); 23715 case 6: 23716 var target = outMsg.a.kz; 23717 var source = outMsg.a.dY; 23718 var resolved = _Utils_update( 23719 m, 23720 {nO: source, nP: target}); 23721 return _Utils_Tuple2( 23722 resolved, 23723 A2( 23724 $elm$core$List$cons, 23725 $author$project$Main$armHandoffReceiver(resolved), 23726 cmds)); 23727 case 4: 23728 var url = outMsg.a; 23729 var _v12 = m.b; 23730 if (_v12.$ === 1) { 23731 var readyData = _v12.a; 23732 return function (_v14) { 23733 var runner = _v14.a; 23734 var cmd = _v14.b; 23735 return _Utils_Tuple2( 23736 _Utils_update( 23737 m, 23738 {ak: runner}), 23739 A2($elm$core$List$cons, cmd, cmds)); 23740 }( 23741 A3( 23742 $author$project$Infra$ConcurrentTaskExtra$andRun, 23743 function (_v13) { 23744 return $author$project$Main$NoOp; 23745 }, 23746 A2($author$project$Infra$Storage$savePushServerUrl, readyData.de, url), 23747 _Utils_Tuple2(m.ak, $elm$core$Platform$Cmd$none))); 23748 } else { 23749 return _Utils_Tuple2(m, cmds); 23750 } 23751 default: 23752 var _v15 = function () {
23753 var _v16 = $author$project$Main$buildGroupConfig(m); 23754 if (!_v16.$) { 23755 var config = _v16.a; 23756 return A2( 23757 $elm$core$Tuple$mapSecond, 23758 function (cmd) { 23759 return A2($elm$core$List$cons, cmd, cmds); 23760 }, 23761 A3( 23762 $author$project$Update$wrap, 23763 $author$project$Main$GroupMsg, 23764 function (gm) { 23765 return _Utils_update( 23766 m, 23767 {u: gm}); 23768 }, 23769 A2($author$project$Page$Group$connectivityRestored, config, m.u))); 23770 } else { 23771 return _Utils_Tuple2(m, cmds); 23772 } 23773 }(); 23774 var connectedModel = _v15.a; 23775 var connectionCmds = _v15.b; 23776 var _v17 = connectedModel.b; 23777 if (_v17.$ === 1) { 23778 return function (_v18) { 23779 var runner = _v18.a; 23780 var cmd = _v18.b; 23781 return _Utils_Tuple2( 23782 _Utils_update( 23783 connectedModel, 23784 {ak: runner}), 23785 A2($elm$core$List$cons, cmd, connectionCmds)); 23786 }( 23787 A3( 23788 $author$project$PwaState$configureTask, 23789 { 23790 h6: $author$project$PwaState$pushServerUrl(connectedModel.G), 23791 hl: connectedModel.hl 23792 }, 23793 $author$project$Main$PwaStateMsg, 23794 _Utils_Tuple2(connectedModel.ak, $elm$core$Platform$Cmd$none))); 23795 } else { 23796 return _Utils_Tuple2(connectedModel, connectionCmds); 23797 } 23798 } 23799 }), 23800 _Utils_Tuple2(model, _List_Nil), 23801 outMsgs); 23802 var finalModel = _v0.a; 23803 var extraCmds = _v0.b; 23804 return _Utils_Tuple2( 23805 finalModel, 23806 $elm$core$Platform$Cmd$batch( 23807 A2($elm$core$List$cons, pwaCmd, extraCmds))); 23808 }); 23809var $author$project$Main$pwaOut = _Platform_outgoingPort('pwaOut', $elm$core$Basics$identity); 23810var $author$project$Page$ImportSplitwise$RateFailed = 2; 23811var $author$project$Page$ImportSplitwise$RateIdle = 0; 23812var $elm$core$String$fromFloat = _String_fromNumber; 23813var $author$project$Page$ImportSplitwise$rateFetched = F3( 23814 function (currency, result, _v0) { 23815 var data = _v0; 23816 var code = $author$project$Domain$Currency$currencyCode(currency); 23817 if (!result.$) { 23818 var rate = result.a; 23819 return _Utils_update( 23820 data, 23821 { 23822 a$: A3( 23823 $elm$core$Dict$insert, 23824 code, 23825 $elm$core$String$fromFloat(rate), 23826 data.a$), 23827 bx: A3($elm$core$Dict$insert, code, 0, data.bx) 23828 }); 23829 } else { 23830 return _Utils_update( 23831 data, 23832 { 23833 bx: A3($elm$core$Dict$insert, code, 2, data.bx) 23834 }); 23835 } 23836 }); 23837var $author$project$Page$Move$Choosing = 0; 23838var $author$project$Page$Move$Done = 2; 23839var $author$project$Page$Move$Working = 1; 23840var $author$project$Page$Move$phase = function (data) { 23841 return $elm$core$Dict$isEmpty(data.ag) ? 0 : (A2( 23842 $elm$core$List$all, 23843 function (id) { 23844 return _Utils_eq( 23845 A2($elm$core$Dict$get, id, data.ag), 23846 $elm$core$Maybe$Just($author$project$Page$Move$Seeded)); 23847 }, 23848 data.hj) ? 2 : 1); 23849}; 23850var $author$project$Page$Move$refresh = F2( 23851 function (groups, model) { 23852 var data = model; 23853 var _v0 = $author$project$Page$Move$phase(data); 23854 if (!_v0) { 23855 return $author$project$Page$Move$init(groups); 23856 } else { 23857 return model; 23858 } 23859 }); 23860var $author$project$Infra$Identity$rekey = function (current) { 23861 return A2( 23862 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$map, 23863 function (fresh) { 23864 return _Utils_update( 23865 fresh, 23866 { 23867 ff: A2($elm$core$List$cons, current.aK, current.ff) 23868 }); 23869 }, 23870 $author$project$Infra$Identity$generate); 23871}; 23872var $author$project$Main$OnActivityMarkersLoaded = function (a) { 23873 return {$: 46, a: a}; 23874}; 23875var $author$project$Main$reloadActivityMarkers = function (model) { 23876 var _v0 = model.b; 23877 if (_v0.$ === 1) { 23878 var readyData = _v0.a; 23879 return A2( 23880 $elm$core$Tuple$mapFirst, 23881 function (runner) { 23882 return _Utils_update( 23883 model, 23884 {ak: runner}); 23885 }, 23886 A3( 23887 $author$project$Infra$ConcurrentTaskExtra$andRun, 23888 $author$project$Main$OnActivityMarkersLoaded, 23889 $author$project$Infra$Storage$loadActivityMarkers(readyData.de), 23890 _Utils_Tuple2(model.ak, $elm$core$Platform$Cmd$none))); 23891 } else { 23892 return _Utils_Tuple2(model, $elm$core$Platform$Cmd$none); 23893 } 23894}; 23895var $author$project$Infra$UsageStats$requestPersistentStorage = $author$project$Infra$UsageStats$persistedTask('usageStats:persistStorage'); 23896var $author$project$Main$requestPersistOnFirstGroup = F2( 23897 function (groupsBefore, _v0) { 23898 var model = _v0.a; 23899 var cmd = _v0.b; 23900 return $elm$core$Dict$isEmpty(groupsBefore) ? A2( 23901 $elm$core$Tuple$mapFirst, 23902 function (runner) { 23903 return _Utils_update( 23904 model, 23905 {ak: runner}); 23906 }, 23907 A3( 23908 $author$project$Infra$ConcurrentTaskExtra$andRun, 23909 function (_v1) { 23910 return $author$project$Main$NoOp; 23911 }, 23912 $author$project$Infra$UsageStats$requestPersistentStorage, 23913 _Utils_Tuple2(model.ak, cmd))) : _Utils_Tuple2(model, cmd); 23914 }); 23915var $author$project$Main$ScheduleStorageCheck = {$: 35}; 23916var $author$project$Main$rescheduleStorageCheckTomorrow = A2( 23917 $elm$core$Task$perform, 23918 function (_v0) { 23919 return $author$project$Main$ScheduleStorageCheck; 23920 }, 23921 $elm$core$Process$sleep(((24 * 60) * 60) * 1000)); 23922var $author$project$Infra$Storage$resetUsageStats = function (db) { 23923 return A2(
23924 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$andThenDo, 23925 A3( 23926 $author$project$IndexedDb$delete, 23927 db, 23928 $author$project$Infra$Storage$usageStatsStore, 23929 $author$project$IndexedDb$StringKey('transfer')), 23930 A3( 23931 $author$project$IndexedDb$delete, 23932 db, 23933 $author$project$Infra$Storage$usageStatsStore, 23934 $author$project$IndexedDb$StringKey('stats'))); 23935}; 23936var $author$project$Page$Group$resetWorkspace = function (model) { 23937 return _Utils_update( 23938 model, 23939 {a: $author$project$Page$Group$WorkspaceEmpty}); 23940}; 23941var $author$project$Main$OnNotificationTopicResolved = function (a) { 23942 return {$: 47, a: a}; 23943}; 23944var $author$project$Main$resolveNotificationTopic = F2( 23945 function (topic, model) { 23946 var _v0 = model.b; 23947 if (_v0.$ === 1) { 23948 var readyData = _v0.a; 23949 return A2( 23950 $elm$core$Tuple$mapFirst, 23951 function (runner) { 23952 return _Utils_update( 23953 model, 23954 {ak: runner}); 23955 }, 23956 A3( 23957 $author$project$Infra$ConcurrentTaskExtra$andRun, 23958 $author$project$Main$OnNotificationTopicResolved, 23959 A2( 23960 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$map, 23961 function (topics) { 23962 return A2( 23963 $elm$core$Maybe$map, 23964 $elm$core$Tuple$first, 23965 $elm$core$List$head( 23966 A2( 23967 $elm$core$List$filter, 23968 function (_v1) { 23969 var registered = _v1.b; 23970 return _Utils_eq(registered, topic); 23971 }, 23972 topics))); 23973 }, 23974 $author$project$Infra$Storage$loadAllNotifyTopics(readyData.de)), 23975 _Utils_Tuple2(model.ak, $elm$core$Platform$Cmd$none))); 23976 } else { 23977 return _Utils_Tuple2(model, $elm$core$Platform$Cmd$none); 23978 } 23979 }); 23980var $author$project$Main$OnHandoffBuilt = function (a) { 23981 return {$: 18, a: a}; 23982}; 23983var $author$project$Main$OnMoveGroupSeeded = F2( 23984 function (a, b) { 23985 return {$: 17, a: a, b: b}; 23986 }); 23987var $author$project$WebCrypto$Signature$encodeSerializedSigningKeyPair = function (skp) { 23988 return $elm$json$Json$Encode$object( 23989 _List_fromArray( 23990 [ 23991 _Utils_Tuple2( 23992 'publicKey', 23993 $elm$json$Json$Encode$string(skp.jO)), 23994 _Utils_Tuple2( 23995 'privateKey', 23996 $elm$json$Json$Encode$string(skp.fh)) 23997 ])); 23998}; 23999var $author$project$Infra$Identity$encode = function (identity) { 24000 return $elm$json$Json$Encode$object( 24001 _List_fromArray( 24002 [ 24003 _Utils_Tuple2( 24004 'publicKeyHash', 24005 $elm$json$Json$Encode$string(identity.aK)), 24006 _Utils_Tuple2( 24007 'signingKeyPair', 24008 $author$project$WebCrypto$Signature$encodeSerializedSigningKeyPair(identity.dV)), 24009 _Utils_Tuple2( 24010 'previousDeviceIds', 24011 A2($elm$json$Json$Encode$list, $elm$json$Json$Encode$string, identity.ff)) 24012 ])); 24013}; 24014var $author$project$Infra$Handoff$maybeEncode = F2( 24015 function (enc, maybe) { 24016 return A2( 24017 $elm$core$Maybe$withDefault, 24018 $elm$json$Json$Encode$null, 24019 A2($elm$core$Maybe$map, enc, maybe)); 24020 }); 24021var $author$project$Infra$Handoff$encode = function (payload) { 24022 return $elm$json$Json$Encode$object( 24023 _List_fromArray( 24024 [ 24025 _Utils_Tuple2( 24026 'format', 24027 $elm$json$Json$Encode$string($author$project$Infra$Handoff$format)), 24028 _Utils_Tuple2( 24029 'identity', 24030 $author$project$Infra$Identity$encode(payload.O)), 24031 _Utils_Tuple2( 24032 'groups', 24033 A2( 24034 $elm$json$Json$Encode$list, 24035 function (g) { 24036 return $elm$json$Json$Encode$object( 24037 _List_fromArray( 24038 [ 24039 _Utils_Tuple2( 24040 'summary', 24041 $author$project$Domain$Group$encodeSummary(g.bA)), 24042 _Utils_Tuple2( 24043 'key', 24044 $elm$json$Json$Encode$string(g.i4)) 24045 ])); 24046 }, 24047 payload.eN)), 24048 _Utils_Tuple2( 24049 'selfProfile', 24050 $author$project$Domain$Member$encodeMetadata(payload.fr)), 24051 _Utils_Tuple2( 24052 'language', 24053 A2($author$project$Infra$Handoff$maybeEncode, $elm$json$Json$Encode$string, payload.eX)), 24054 _Utils_Tuple2( 24055 'lastSeenChangelog', 24056 A2($author$project$Infra$Handoff$maybeEncode, $elm$json$Json$Encode$string, payload.eY)) 24057 ])); 24058}; 24059var $author$project$Main$buildHandoff = F3( 24060 function (readyData, identity, groupIds) { 24061 var loadGroup = function (groupId) { 24062 var _v0 = A2($elm$core$Dict$get, groupId, readyData.eN); 24063 if (!_v0.$) { 24064 var summary = _v0.a; 24065 return A2( 24066 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$map, 24067 function (key) { 24068 return {
24069 i4: $author$project$WebCrypto$Symmetric$exportKey(key), 24070 bA: summary 24071 }; 24072 }, 24073 A2($author$project$Infra$Storage$loadGroupKeyRequired, readyData.de, groupId)); 24074 } else { 24075 return $andrewMacmurray$elm_concurrent_task$ConcurrentTask$fail( 24076 $author$project$IndexedDb$DatabaseError('Missing summary for group ' + groupId)); 24077 } 24078 }; 24079 return A2( 24080 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$map, 24081 function (groups) { 24082 return A2( 24083 $elm$json$Json$Encode$encode, 24084 0, 24085 $author$project$Infra$Handoff$encode( 24086 {eN: groups, O: identity, eX: readyData.p0, eY: readyData.eY, fr: readyData.fr})); 24087 }, 24088 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$batch( 24089 A2($elm$core$List$map, loadGroup, groupIds))); 24090 }); 24091var $author$project$WebCrypto$ProofOfWork$Challenge = F4( 24092 function (challenge, timestamp, difficulty, signature) { 24093 return {fZ: challenge, ge: difficulty, dU: signature, kD: timestamp}; 24094 }); 24095var $author$project$WebCrypto$ProofOfWork$challengeDecoder = A5( 24096 $elm$json$Json$Decode$map4, 24097 $author$project$WebCrypto$ProofOfWork$Challenge, 24098 A2($elm$json$Json$Decode$field, 'challenge', $elm$json$Json$Decode$string), 24099 A2($elm$json$Json$Decode$field, 'timestamp', $elm$json$Json$Decode$int), 24100 A2($elm$json$Json$Decode$field, 'difficulty', $elm$json$Json$Decode$int), 24101 A2($elm$json$Json$Decode$field, 'signature', $elm$json$Json$Decode$string)); 24102var $author$project$Infra$Crypto$deriveAuthVerifier = function (key) { 24103 return A2( 24104 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$map, 24105 $author$project$Infra$Crypto$hexToBase64Url, 24106 A2( 24107 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$andThen, 24108 $author$project$WebCrypto$sha256, 24109 $author$project$Infra$Crypto$deriveRelaySecret(key))); 24110}; 24111var $author$project$WebCrypto$ProofOfWork$solveChallenge = function (challenge) { 24112 return A2( 24113 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$map, 24114 function (nonce) { 24115 return {pw: challenge.fZ, px: challenge.ge, py: challenge.dU, pz: nonce, pA: challenge.kD}; 24116 }, 24117 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$define( 24118 { 24119 k: $elm$json$Json$Encode$object( 24120 _List_fromArray( 24121 [ 24122 _Utils_Tuple2( 24123 'challenge', 24124 $elm$json$Json$Encode$string(challenge.fZ)), 24125 _Utils_Tuple2( 24126 'difficulty', 24127 $elm$json$Json$Encode$int(challenge.ge)) 24128 ])), 24129 l: $andrewMacmurray$elm_concurrent_task$ConcurrentTask$expectErrors($author$project$WebCrypto$errorDecoder), 24130 m: $andrewMacmurray$elm_concurrent_task$ConcurrentTask$expectString, 24131 n: 'webcrypto:pow:solve' 24132 })); 24133}; 24134var $author$project$Infra$Server$createGroupOnServer = function (_v0) { 24135 var serverUrl = _v0.hl; 24136 var groupId = _v0.ct; 24137 var groupKey = _v0.gs; 24138 var createdBy = _v0.f3; 24139 var solvedChallenge = A2( 24140 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$andThen, 24141 function (challenge) { 24142 return A2( 24143 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$mapError, 24144 $author$project$Infra$Server$CryptoError, 24145 $author$project$WebCrypto$ProofOfWork$solveChallenge(challenge)); 24146 }, 24147 A2( 24148 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$mapError, 24149 $author$project$Infra$Server$HttpError, 24150 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$Http$get( 24151 { 24152 m: $andrewMacmurray$elm_concurrent_task$ConcurrentTask$Http$expectJson($author$project$WebCrypto$ProofOfWork$challengeDecoder), 24153 mY: _List_Nil, 24154 qQ: $elm$core$Maybe$Nothing, 24155 kS: serverUrl + ('/api/pow/challenge?groupId=' + groupId) 24156 }))); 24157 return A2( 24158 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$andThen, 24159 function (_v1) { 24160 var solution = _v1.a; 24161 var verifier = _v1.b; 24162 return A2( 24163 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$mapError, 24164 $author$project$Infra$Server$HttpError, 24165 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$Http$post( 24166 { 24167 fY: $andrewMacmurray$elm_concurrent_task$ConcurrentTask$Http$jsonBody( 24168 $elm$json$Json$Encode$object( 24169 _List_fromArray( 24170 [ 24171 _Utils_Tuple2( 24172 'groupId', 24173 $elm$json$Json$Encode$string(groupId)), 24174 _Utils_Tuple2( 24175 'createdBy', 24176 $elm$json$Json$Encode$string(createdBy)), 24177 _Utils_Tuple2( 24178 'authVerifier', 24179 $elm$json$Json$Encode$string(verifier)), 24180 _Utils_Tuple2( 24181 'pow_challenge', 24182 $elm$json$Json$Encode$string(solution.pw)), 24183 _Utils_Tuple2( 24184 'pow_timestamp', 24185 $elm$json$Json$Encode$int(solution.pA)), 24186 _Utils_Tuple2( 24187 'pow_difficulty', 24188 $elm$json$Json$Encode$int(solution.px)), 24189 _Utils_Tuple2( 24190 'pow_signature', 24191 $elm$json$Json$Encode$string(solution.py)), 24192 _Utils_Tuple2( 24193 'pow_solution', 24194 $elm$json$Json$Encode$string(solution.pz)) 24195 ]))), 24196 m: $andrewMacmurray$elm_concurrent_task$ConcurrentTask$Http$expectWhatever, 24197 mY: _List_Nil, 24198 qQ: $elm$core$Maybe$Nothing, 24199 kS: serverUrl + '/api/groups' 24200 })); 24201 }, 24202 A3( 24203 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$map2, 24204 $elm$core$Tuple$pair, 24205 solvedChallenge, 24206 A2( 24207 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$mapError, 24208 $author$project$Infra$Server$CryptoError, 24209 $author$project$Infra$Crypto$deriveAuthVerifier(groupKey)))); 24210}; 24211var $author$project$Infra$Server$isStatus = F2( 24212 function (code, err) { 24213 if ((!err.$) && (err.a.$ === 3)) { 24214 var _v1 = err.a; 24215 var meta = _v1.a; 24216 return _Utils_eq(meta.hr, code); 24217 } else { 24218 return false;
24219 } 24220 }); 24221var $author$project$Infra$Server$isConflict = $author$project$Infra$Server$isStatus(409); 24222var $author$project$GroupOps$seedGroup = F3( 24223 function (db, _v0, groupId) { 24224 var serverUrl = _v0.hl; 24225 var actorId = _v0.hJ; 24226 return A2( 24227 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$andThen, 24228 function (loaded) { 24229 var ctx = {ct: groupId, gs: loaded.gs, hl: serverUrl}; 24230 var push = function (envelopes) { 24231 return $elm$core$List$isEmpty(envelopes) ? $andrewMacmurray$elm_concurrent_task$ConcurrentTask$succeed(0) : A2( 24232 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$andThen, 24233 function (secret) { 24234 return A4( 24235 $author$project$Infra$Server$pushEvents, 24236 ctx, 24237 secret, 24238 actorId, 24239 $author$project$Domain$Event$sortEvents(envelopes)); 24240 }, 24241 A2( 24242 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$mapError, 24243 $author$project$Infra$Server$CryptoError, 24244 $author$project$Infra$Crypto$deriveRelaySecret(loaded.gs))); 24245 }; 24246 return A2( 24247 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$andThen, 24248 push, 24249 A2( 24250 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$onError, 24251 function (err) { 24252 return $author$project$Infra$Server$isConflict(err) ? A2( 24253 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$map, 24254 function (known) { 24255 return A2( 24256 $elm$core$List$filter, 24257 function (e) { 24258 return !A2($elm$core$Dict$member, e.m9, known); 24259 }, 24260 loaded.iC); 24261 }, 24262 $author$project$Infra$Server$fetchEventOrder(ctx)) : $andrewMacmurray$elm_concurrent_task$ConcurrentTask$fail(err); 24263 }, 24264 A2( 24265 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$map, 24266 function (_v1) { 24267 return loaded.iC; 24268 }, 24269 $author$project$Infra$Server$createGroupOnServer( 24270 {f3: actorId, ct: groupId, gs: loaded.gs, hl: serverUrl})))); 24271 }, 24272 A2( 24273 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$mapError, 24274 function (e) { 24275 return $author$project$Infra$Server$InternalError( 24276 'Storage: ' + $author$project$Infra$Storage$errorToString(e)); 24277 }, 24278 A2($author$project$Infra$Storage$loadGroup, db, groupId))); 24279 }); 24280var $author$project$Main$failSeed = F2( 24281 function (groupId, model) { 24282 var _v6 = A3( 24283 $author$project$Page$Move$groupSeeded, 24284 groupId, 24285 $elm$core$Result$Err( 24286 $author$project$Translations$errorUnexpected(model.aJ)), 24287 model.P); 24288 var moveModel = _v6.a; 24289 var effect = _v6.b; 24290 return A2( 24291 $author$project$Main$runMoveEffect, 24292 effect, 24293 _Utils_update( 24294 model, 24295 {P: moveModel})); 24296 }); 24297var $author$project$Main$runMoveEffect = F2( 24298 function (effect, model) { 24299 switch (effect.$) { 24300 case 0: 24301 return _Utils_Tuple2(model, $elm$core$Platform$Cmd$none); 24302 case 2: 24303 var groupIds = effect.a; 24304 var _v1 = model.b; 24305 if (_v1.$ === 1) { 24306 var readyData = _v1.a; 24307 var _v2 = readyData.O; 24308 if (!_v2.$) { 24309 var identity = _v2.a; 24310 return A2( 24311 $elm$core$Tuple$mapFirst, 24312 function (r) { 24313 return _Utils_update( 24314 model, 24315 {ak: r}); 24316 }, 24317 A3( 24318 $author$project$Infra$ConcurrentTaskExtra$andRun, 24319 $author$project$Main$OnHandoffBuilt, 24320 A3($author$project$Main$buildHandoff, readyData, identity, groupIds), 24321 _Utils_Tuple2(model.ak, $elm$core$Platform$Cmd$none))); 24322 } else { 24323 return _Utils_Tuple2(model, $elm$core$Platform$Cmd$none); 24324 } 24325 } else { 24326 return _Utils_Tuple2(model, $elm$core$Platform$Cmd$none); 24327 } 24328 case 3: 24329 var payload = effect.a; 24330 var _v3 = model.nP; 24331 if (!_v3.$) { 24332 var target = _v3.a; 24333 return _Utils_Tuple2( 24334 model, 24335 $author$project$Main$handoffOut( 24336 $elm$json$Json$Encode$object( 24337 _List_fromArray( 24338 [ 24339 _Utils_Tuple2( 24340 'action', 24341 $elm$json$Json$Encode$string('send')), 24342 _Utils_Tuple2( 24343 'targetOrigin', 24344 $elm$json$Json$Encode$string(target)), 24345 _Utils_Tuple2( 24346 'payload', 24347 $elm$json$Json$Encode$string(payload)) 24348 ])))); 24349 } else { 24350 return _Utils_Tuple2(model, $elm$core$Platform$Cmd$none); 24351 } 24352 default: 24353 var groupId = effect.a; 24354 var _v4 = _Utils_Tuple2(model.b, model.nP); 24355 if ((_v4.a.$ === 1) && (!_v4.b.$)) { 24356 var readyData = _v4.a.a; 24357 var target = _v4.b.a; 24358 var _v5 = readyData.O; 24359 if (!_v5.$) { 24360 var identity = _v5.a; 24361 return A2( 24362 $elm$core$Tuple$mapFirst, 24363 function (r) { 24364 return _Utils_update( 24365 model, 24366 {ak: r}); 24367 }, 24368 A3( 24369 $author$project$Infra$ConcurrentTaskExtra$andRun, 24370 $author$project$Main$OnMoveGroupSeeded(groupId), 24371 A3( 24372 $author$project$GroupOps$seedGroup, 24373 readyData.de, 24374 {hJ: identity.aK, hl: target}, 24375 groupId), 24376 _Utils_Tuple2(model.ak, $elm$core$Platform$Cmd$none))); 24377 } else { 24378 return A2($author$project$Main$failSeed, groupId, model); 24379 } 24380 } else { 24381 return A2($author$project$Main$failSeed, groupId, model); 24382 } 24383 } 24384 }); 24385var $author$project$Main$OnHandoffApplied = F2( 24386 function (a, b) { 24387 return {$: 21, a: a, b: b}; 24388 }); 24389var $author$project$Infra$Storage$saveEvents = F4(
24390 function (db, groupId, pushState, envelopes) { 24391 return A3( 24392 $author$project$Infra$Storage$saveEventRecords, 24393 db, 24394 groupId, 24395 A2( 24396 $elm$core$List$map, 24397 $elm$core$Tuple$pair(pushState), 24398 envelopes)); 24399 }); 24400var $author$project$Infra$Storage$saveGroup = F6( 24401 function (db, summary, maybeKey, pushState, events, maybeCursor) { 24402 var saveKeyTask = function () { 24403 if (!maybeKey.$) { 24404 var key = maybeKey.a; 24405 return A3($author$project$Infra$Storage$saveGroupKey, db, summary.m9, key); 24406 } else { 24407 return $andrewMacmurray$elm_concurrent_task$ConcurrentTask$succeed(0); 24408 } 24409 }(); 24410 var saveCursorTask = function () { 24411 if (!maybeCursor.$) { 24412 var cursor = maybeCursor.a; 24413 return A3($author$project$Infra$Storage$saveSyncCursor, db, summary.m9, cursor); 24414 } else { 24415 return $andrewMacmurray$elm_concurrent_task$ConcurrentTask$succeed(0); 24416 } 24417 }(); 24418 return A2( 24419 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$map, 24420 function (_v1) { 24421 return 0; 24422 }, 24423 A2( 24424 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$andThen, 24425 function (_v0) { 24426 return A2($author$project$Infra$Storage$saveGroupSummary, db, summary); 24427 }, 24428 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$batch( 24429 _List_fromArray( 24430 [ 24431 A4($author$project$Infra$Storage$saveEvents, db, summary.m9, pushState, events), 24432 saveKeyTask, 24433 saveCursorTask 24434 ])))); 24435 }); 24436var $author$project$Infra$Storage$saveIdentity = F2( 24437 function (db, identity) { 24438 return A4( 24439 $author$project$IndexedDb$putAt, 24440 db, 24441 $author$project$Infra$Storage$identityStore, 24442 $author$project$IndexedDb$StringKey('default'), 24443 $author$project$Infra$Identity$encode(identity)); 24444 }); 24445var $author$project$Infra$Storage$saveLanguage = F2( 24446 function (db, lang) { 24447 return A4( 24448 $author$project$IndexedDb$putAt, 24449 db, 24450 $author$project$Infra$Storage$identityStore, 24451 $author$project$IndexedDb$StringKey('language'), 24452 $elm$json$Json$Encode$string(lang)); 24453 }); 24454var $author$project$Main$applyHandoffPlan = F2( 24455 function (db, plan) { 24456 var saveMaybe = F2( 24457 function (save, maybeValue) { 24458 if (!maybeValue.$) { 24459 var value = maybeValue.a; 24460 return A2(save, db, value); 24461 } else { 24462 return $andrewMacmurray$elm_concurrent_task$ConcurrentTask$succeed(0); 24463 } 24464 }); 24465 var saveAdoption = function () { 24466 var _v3 = plan.fP; 24467 if (!_v3.$) { 24468 var adoption = _v3.a; 24469 return A2( 24470 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$map, 24471 function (_v4) { 24472 return 0; 24473 }, 24474 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$batch( 24475 _List_fromArray( 24476 [ 24477 A2($author$project$Infra$Storage$saveSelfProfile, db, adoption.fr), 24478 A2(saveMaybe, $author$project$Infra$Storage$saveLanguage, adoption.eX), 24479 A2(saveMaybe, $author$project$Infra$Storage$saveLastSeenChangelog, adoption.eY) 24480 ]))); 24481 } else { 24482 return $andrewMacmurray$elm_concurrent_task$ConcurrentTask$succeed(0); 24483 } 24484 }(); 24485 return A2( 24486 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$map, 24487 function (_v2) { 24488 return 0; 24489 }, 24490 A2( 24491 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$andThen, 24492 function (_v1) { 24493 return saveAdoption; 24494 }, 24495 A2( 24496 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$andThen, 24497 function (_v0) { 24498 return $andrewMacmurray$elm_concurrent_task$ConcurrentTask$batch( 24499 A2( 24500 $elm$core$List$map, 24501 function (g) { 24502 return A6( 24503 $author$project$Infra$Storage$saveGroup, 24504 db, 24505 g.bA, 24506 $elm$core$Maybe$Just(g.i4), 24507 1, 24508 _List_Nil, 24509 $elm$core$Maybe$Nothing); 24510 }, 24511 plan.gt)); 24512 }, 24513 A2($author$project$Infra$Storage$saveIdentity, db, plan.O)))); 24514 }); 24515var $elmcraft$core_extra$List$Extra$uniqueHelp = F4( 24516 function (f, existing, remaining, accumulator) { 24517 uniqueHelp: 24518 while (true) { 24519 if (!remaining.b) { 24520 return $elm$core$List$reverse(accumulator); 24521 } else { 24522 var first = remaining.a; 24523 var rest = remaining.b; 24524 var computedFirst = f(first); 24525 if (A2($elm$core$List$member, computedFirst, existing)) { 24526 var $temp$f = f, 24527 $temp$existing = existing, 24528 $temp$remaining = rest, 24529 $temp$accumulator = accumulator; 24530 f = $temp$f; 24531 existing = $temp$existing; 24532 remaining = $temp$remaining; 24533 accumulator = $temp$accumulator; 24534 continue uniqueHelp; 24535 } else { 24536 var $temp$f = f, 24537 $temp$existing = A2($elm$core$List$cons, computedFirst, existing), 24538 $temp$remaining = rest, 24539 $temp$accumulator = A2($elm$core$List$cons, first, accumulator); 24540 f = $temp$f; 24541 existing = $temp$existing; 24542 remaining = $temp$remaining; 24543 accumulator = $temp$accumulator; 24544 continue uniqueHelp; 24545 } 24546 } 24547 } 24548 }); 24549var $elmcraft$core_extra$List$Extra$unique = function (list) { 24550 return A4($elmcraft$core_extra$List$Extra$uniqueHelp, $elm$core$Basics$identity, _List_Nil, list, _List_Nil); 24551}; 24552var $author$project$Infra$Handoff$appendNewDeviceIds = F2( 24553 function (own, incoming) { 24554 var known = $elm$core$Set$fromList( 24555 A2($elm$core$List$cons, own.aK, own.ff)); 24556 return _Utils_ap( 24557 own.ff, 24558 A2( 24559 $elm$core$List$filter, 24560 function (id) { 24561 return !A2($elm$core$Set$member, id, known); 24562 }, 24563 $elmcraft$core_extra$List$Extra$unique(incoming))); 24564 }); 24565var $elm$core$Set$isEmpty = function (_v0) { 24566 var dict = _v0; 24567 return $elm$core$Dict$isEmpty(dict); 24568}; 24569var $elm$core$List$partition = F2( 24570 function (pred, list) { 24571 var step = F2( 24572 function (x, _v0) { 24573 var trues = _v0.a; 24574 var falses = _v0.b; 24575 return pred(x) ? _Utils_Tuple2( 24576 A2($elm$core$List$cons, x, trues), 24577 falses) : _Utils_Tuple2( 24578 trues, 24579 A2($elm$core$List$cons, x, falses)); 24580 }); 24581 return A3( 24582 $elm$core$List$foldr, 24583 step, 24584 _Utils_Tuple2(_List_Nil, _List_Nil), 24585 list); 24586 }); 24587var $author$project$Infra$Handoff$merge = F2( 24588 function (payload, destination) { 24589 var adopting = $elm$core$Set$isEmpty(destination.gj); 24590 var _v0 = A2( 24591 $elm$core$List$partition, 24592 function (g) { 24593 return !A2($elm$core$Set$member, g.bA.m9, destination.gj); 24594 }, 24595 payload.eN); 24596 var groupsToAdd = _v0.a; 24597 var skippedGroups = _v0.b; 24598 var skippedGroupIds = A2( 24599 $elm$core$List$map, 24600 A2( 24601 $elm$core$Basics$composeR, 24602 function ($) { 24603 return $.bA; 24604 }, 24605 function ($) { 24606 return $.m9; 24607 }), 24608 skippedGroups); 24609 var _v1 = _Utils_Tuple2(adopting, destination.O); 24610 if ((!_v1.a) && (!_v1.b.$)) { 24611 var own = _v1.b.a; 24612 return { 24613 fP: $elm$core$Maybe$Nothing, 24614 gt: groupsToAdd, 24615 O: _Utils_update( 24616 own, 24617 { 24618 ff: A2( 24619 $author$project$Infra$Handoff$appendNewDeviceIds,
24620 own, 24621 A2($elm$core$List$cons, payload.O.aK, payload.O.ff)) 24622 }), 24623 hn: skippedGroupIds 24624 }; 24625 } else { 24626 return { 24627 fP: $elm$core$Maybe$Just( 24628 {eX: payload.eX, eY: payload.eY, fr: payload.fr}), 24629 gt: groupsToAdd, 24630 O: payload.O, 24631 hn: skippedGroupIds 24632 }; 24633 } 24634 }); 24635var $author$project$Main$runReceiveEffect = F2( 24636 function (effect, model) { 24637 if (!effect.$) { 24638 return _Utils_Tuple2(model, $elm$core$Platform$Cmd$none); 24639 } else { 24640 var payload = effect.a; 24641 var _v1 = _Utils_Tuple2( 24642 $author$project$Main$canReceiveHandoff(model), 24643 model.b); 24644 if (_v1.a && (_v1.b.$ === 1)) { 24645 var readyData = _v1.b.a; 24646 var plan = A2( 24647 $author$project$Infra$Handoff$merge, 24648 payload, 24649 { 24650 gj: $elm$core$Set$fromList( 24651 $elm$core$Dict$keys(readyData.eN)), 24652 O: readyData.O 24653 }); 24654 return A2( 24655 $elm$core$Tuple$mapFirst, 24656 function (r) { 24657 return _Utils_update( 24658 model, 24659 {ak: r}); 24660 }, 24661 A3( 24662 $author$project$Infra$ConcurrentTaskExtra$andRun, 24663 $author$project$Main$OnHandoffApplied(plan), 24664 A2($author$project$Main$applyHandoffPlan, readyData.de, plan), 24665 _Utils_Tuple2(model.ak, $elm$core$Platform$Cmd$none))); 24666 } else { 24667 return _Utils_Tuple2( 24668 _Utils_update( 24669 model, 24670 { 24671 av: A2( 24672 $author$project$Page$Receive$applyFailed, 24673 $author$project$Translations$errorUnexpected(model.aJ), 24674 model.av) 24675 }), 24676 $elm$core$Platform$Cmd$none); 24677 } 24678 } 24679 }); 24680var $author$project$Infra$Storage$saveDevMode = F2( 24681 function (db, enabled) { 24682 return A4( 24683 $author$project$IndexedDb$putAt, 24684 db, 24685 $author$project$Infra$Storage$identityStore, 24686 $author$project$IndexedDb$StringKey('devMode'), 24687 $elm$json$Json$Encode$bool(enabled)); 24688 }); 24689var $author$project$Infra$UsageStats$encode = function (stats) { 24690 return $elm$json$Json$Encode$object( 24691 _List_fromArray( 24692 [ 24693 _Utils_Tuple2( 24694 'trackingStartDate', 24695 $elm$json$Json$Encode$int( 24696 $elm$time$Time$posixToMillis(stats.fF))), 24697 _Utils_Tuple2( 24698 'storageBytes', 24699 $elm$json$Json$Encode$int(stats.b3)), 24700 _Utils_Tuple2( 24701 'storageLastCheckedDate', 24702 $elm$json$Json$Encode$string(stats.b4)), 24703 _Utils_Tuple2( 24704 'storageCostAccumulatorCentNanos', 24705 $elm$json$Json$Encode$int(stats.cX)) 24706 ])); 24707}; 24708var $author$project$Infra$Storage$saveUsageStats = F2( 24709 function (db, stats) { 24710 return A4( 24711 $author$project$IndexedDb$putAt, 24712 db, 24713 $author$project$Infra$Storage$usageStatsStore, 24714 $author$project$IndexedDb$StringKey('stats'), 24715 $author$project$Infra$UsageStats$encode(stats)); 24716 }); 24717var $author$project$Main$selectedGroupSummary = F2( 24718 function (groupId, model) { 24719 var _v0 = model.b; 24720 if (_v0.$ === 1) { 24721 var readyData = _v0.a; 24722 return A2($elm$core$Dict$get, groupId, readyData.eN); 24723 } else { 24724 return $elm$core$Maybe$Nothing; 24725 } 24726 }); 24727var $author$project$Page$Group$setIdentity = F3( 24728 function (hash, previousDeviceIds, model) { 24729 return _Utils_update( 24730 model, 24731 {iY: hash, ff: previousDeviceIds}); 24732 }); 24733var $author$project$Page$Home$setJoinError = F2( 24734 function (err, _v0) { 24735 var data = _v0; 24736 return _Utils_update( 24737 data, 24738 { 24739 cy: $elm$core$Maybe$Just(err) 24740 }); 24741 }); 24742var $author$project$Translations$splitwiseImportParseError = function (_v0) { 24743 var lang = _v0; 24744 if (!lang) { 24745 return 'Could not read this file as a Splitwise CSV export.'; 24746 } else { 24747 return 'Impossible de lire ce fichier comme un export CSV Splitwise.'; 24748 } 24749}; 24750var $author$project$ImportExport$OnImportDecompressed = function (a) { 24751 return {$: 5, a: a}; 24752}; 24753var $author$project$Infra$Compression$decompress = function (base64) { 24754 return $andrewMacmurray$elm_concurrent_task$ConcurrentTask$define( 24755 { 24756 k: $elm$json$Json$Encode$object( 24757 _List_fromArray( 24758 [ 24759 _Utils_Tuple2( 24760 'base64', 24761 $elm$json$Json$Encode$string(base64)) 24762 ])), 24763 l: $andrewMacmurray$elm_concurrent_task$ConcurrentTask$expectErrors($elm$json$Json$Decode$string), 24764 m: $andrewMacmurray$elm_concurrent_task$ConcurrentTask$expectString, 24765 n: 'export:decompress' 24766 }); 24767}; 24768var $author$project$ImportExport$startImport = F2( 24769 function (toMsg, base64) { 24770 return A2( 24771 $author$project$Infra$ConcurrentTaskExtra$andRun, 24772 A2($elm$core$Basics$composeL, toMsg, $author$project$ImportExport$OnImportDecompressed), 24773 $author$project$Infra$Compression$decompress(base64)); 24774 }); 24775var $author$project$Page$About$StatsLoaded = F3( 24776 function (a, b, c) {
24777 return {$: 0, a: a, b: b, c: c}; 24778 }); 24779var $author$project$Page$About$statsLoaded = $author$project$Page$About$StatsLoaded; 24780var $author$project$Infra$UsageStats$UsageStats = F5( 24781 function (trackingStartDate, totalBytesTransferred, storageBytes, storageLastCheckedDate, storageCostAccumulatorCentNanos) { 24782 return {b3: storageBytes, cX: storageCostAccumulatorCentNanos, b4: storageLastCheckedDate, qZ: totalBytesTransferred, fF: trackingStartDate}; 24783 }); 24784var $author$project$Infra$UsageStats$decoder = A6( 24785 $elm$json$Json$Decode$map5, 24786 $author$project$Infra$UsageStats$UsageStats, 24787 A2( 24788 $elm$json$Json$Decode$field, 24789 'trackingStartDate', 24790 A2($elm$json$Json$Decode$map, $elm$time$Time$millisToPosix, $elm$json$Json$Decode$int)), 24791 $elm$json$Json$Decode$succeed(0), 24792 A2($elm$json$Json$Decode$field, 'storageBytes', $elm$json$Json$Decode$int), 24793 A2($elm$json$Json$Decode$field, 'storageLastCheckedDate', $elm$json$Json$Decode$string), 24794 A2($elm$json$Json$Decode$field, 'storageCostAccumulatorCentNanos', $elm$json$Json$Decode$int)); 24795var $author$project$Infra$Storage$loadUsageStats = function (db) { 24796 return A3( 24797 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$map2, 24798 F2( 24799 function (maybeStats, transferred) { 24800 return A2( 24801 $elm$core$Maybe$map, 24802 function (stats) { 24803 return _Utils_update( 24804 stats, 24805 {qZ: transferred}); 24806 }, 24807 maybeStats); 24808 }), 24809 A4( 24810 $author$project$IndexedDb$get, 24811 db, 24812 $author$project$Infra$Storage$usageStatsStore, 24813 $author$project$IndexedDb$StringKey('stats'), 24814 $author$project$Infra$UsageStats$decoder), 24815 A2( 24816 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$map, 24817 $elm$core$Maybe$withDefault(0), 24818 A4( 24819 $author$project$IndexedDb$get, 24820 db, 24821 $author$project$Infra$Storage$usageStatsStore, 24822 $author$project$IndexedDb$StringKey('transfer'), 24823 $elm$json$Json$Decode$int))); 24824}; 24825var $author$project$Main$storageCheckTask = function (db) { 24826 return A4( 24827 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$map3, 24828 F3( 24829 function (stats, estimate, persisted) { 24830 return _Utils_Tuple3(stats, estimate, persisted); 24831 }), 24832 A2( 24833 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$onError, 24834 function (_v0) { 24835 return $andrewMacmurray$elm_concurrent_task$ConcurrentTask$succeed($elm$core$Maybe$Nothing); 24836 }, 24837 $author$project$Infra$Storage$loadUsageStats(db)), 24838 $author$project$Infra$UsageStats$estimateStorage, 24839 $author$project$Infra$UsageStats$persistedStatus); 24840}; 24841var $author$project$Main$OnGroupCreated = function (a) { 24842 return {$: 28, a: a}; 24843}; 24844var $author$project$Domain$Event$createGroup = function (_v0) { 24845 var name = _v0.bW; 24846 var defaultCurrency = _v0.il; 24847 var creator = _v0.l6; 24848 var virtualMembers = _v0.rc; 24849 var memberPayload = F2( 24850 function (memberType, _v1) { 24851 var memberId = _v1.a; 24852 var memberName = _v1.b; 24853 return $author$project$Domain$Event$MemberCreated( 24854 {fO: creator.a, e_: memberId, nL: memberType, bW: memberName}); 24855 }); 24856 return A2( 24857 $elm$core$List$cons, 24858 $author$project$Domain$Event$GroupCreated( 24859 {il: defaultCurrency, bW: name}), 24860 A2( 24861 $elm$core$List$cons, 24862 A2(memberPayload, 0, creator), 24863 A2( 24864 $elm$core$List$map, 24865 memberPayload(1), 24866 virtualMembers))); 24867}; 24868var $elm$random$Random$addOne = function (value) { 24869 return _Utils_Tuple2(1, value); 24870}; 24871var $elm$random$Random$float = F2( 24872 function (a, b) { 24873 return function (seed0) { 24874 var seed1 = $elm$random$Random$next(seed0); 24875 var range = $elm$core$Basics$abs(b - a); 24876 var n1 = $elm$random$Random$peel(seed1); 24877 var n0 = $elm$random$Random$peel(seed0); 24878 var lo = (134217727 & n1) * 1.0; 24879 var hi = (67108863 & n0) * 1.0; 24880 var val = ((hi * 134217728.0) + lo) / 9007199254740992.0; 24881 var scaled = (val * range) + a; 24882 return _Utils_Tuple2( 24883 scaled, 24884 $elm$random$Random$next(seed1)); 24885 }; 24886 }); 24887var $elm$random$Random$getByWeight = F3( 24888 function (_v0, others, countdown) { 24889 getByWeight: 24890 while (true) { 24891 var weight = _v0.a; 24892 var value = _v0.b; 24893 if (!others.b) { 24894 return value; 24895 } else { 24896 var second = others.a; 24897 var otherOthers = others.b; 24898 if (_Utils_cmp( 24899 countdown, 24900 $elm$core$Basics$abs(weight)) < 1) { 24901 return value; 24902 } else { 24903 var $temp$_v0 = second, 24904 $temp$others = otherOthers, 24905 $temp$countdown = countdown - $elm$core$Basics$abs(weight); 24906 _v0 = $temp$_v0; 24907 others = $temp$others; 24908 countdown = $temp$countdown; 24909 continue getByWeight; 24910 } 24911 } 24912 } 24913 }); 24914var $elm$random$Random$weighted = F2( 24915 function (first, others) { 24916 var normalize = function (_v0) { 24917 var weight = _v0.a; 24918 return $elm$core$Basics$abs(weight); 24919 }; 24920 var total = normalize(first) + $elm$core$List$sum( 24921 A2($elm$core$List$map, normalize, others)); 24922 return A2( 24923 $elm$random$Random$map, 24924 A2($elm$random$Random$getByWeight, first, others), 24925 A2($elm$random$Random$float, 0, total)); 24926 }); 24927var $elm$random$Random$uniform = F2( 24928 function (value, valueList) { 24929 return A2( 24930 $elm$random$Random$weighted, 24931 $elm$random$Random$addOne(value), 24932 A2($elm$core$List$map, $elm$random$Random$addOne, valueList)); 24933 }); 24934var $author$project$Infra$IdGen$idCharGenerator = A2( 24935 $elm$random$Random$uniform, 24936 'a', 24937 _List_fromArray( 24938 ['b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9'])); 24939var $elm$random$Random$listHelp = F4( 24940 function (revList, n, gen, seed) { 24941 listHelp: 24942 while (true) { 24943 if (n < 1) { 24944 return _Utils_Tuple2(revList, seed); 24945 } else { 24946 var _v0 = gen(seed); 24947 var value = _v0.a; 24948 var newSeed = _v0.b; 24949 var $temp$revList = A2($elm$core$List$cons, value, revList), 24950 $temp$n = n - 1, 24951 $temp$gen = gen, 24952 $temp$seed = newSeed; 24953 revList = $temp$revList; 24954 n = $temp$n; 24955 gen = $temp$gen; 24956 seed = $temp$seed; 24957 continue listHelp; 24958 } 24959 } 24960 }); 24961var $elm$random$Random$list = F2( 24962 function (n, _v0) { 24963 var gen = _v0; 24964 return function (seed) { 24965 return A4($elm$random$Random$listHelp, _List_Nil, n, gen, seed); 24966 }; 24967 }); 24968var $author$project$Infra$IdGen$groupIdGenerator = A2( 24969 $elm$random$Random$map, 24970 $elm$core$String$fromList, 24971 A2($elm$random$Random$list, 15, $author$project$Infra$IdGen$idCharGenerator)); 24972var $author$project$Infra$IdGen$groupId = function (_v0) { 24973 var state = _v0; 24974 var _v1 = A2($elm$random$Random$step, $author$project$Infra$IdGen$groupIdGenerator, state.gr); 24975 var id = _v1.a; 24976 var nextSeed = _v1.b; 24977 return _Utils_Tuple2( 24978 id, 24979 _Utils_update( 24980 state, 24981 {gr: nextSeed})); 24982}; 24983var $author$project$WebCrypto$Symmetric$generateKey = A2( 24984 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$map, 24985 $elm$core$Basics$identity, 24986 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$define( 24987 {k: $elm$json$Json$Encode$null, l: $andrewMacmurray$elm_concurrent_task$ConcurrentTask$expectNoErrors, m: $andrewMacmurray$elm_concurrent_task$ConcurrentTask$expectString, n: 'webcrypto:sym:generateKey'})); 24988var $author$project$Infra$Crypto$generateGroupKey = A2($andrewMacmurray$elm_concurrent_task$ConcurrentTask$mapError, $elm$core$Basics$never, $author$project$WebCrypto$Symmetric$generateKey); 24989var $author$project$GroupOps$saveNewGroup = F3( 24990 function (ctx, groupId, events) { 24991 var summary = A4( 24992 $author$project$Domain$GroupState$summarize, 24993 ctx.O.aK, 24994 groupId, 24995 ctx.ap, 24996 A2($author$project$Domain$GroupState$applyEvents, events, $author$project$Domain$GroupState$empty)); 24997 return A2( 24998 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$andThen, 24999 function (key) { 25000 return A2( 25001 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$map, 25002 function (_v0) { 25003 return summary; 25004 }, 25005 A6( 25006 $author$project$Infra$Storage$saveGroup, 25007 ctx.de, 25008 summary, 25009 $elm$core$Maybe$Just(
25010 $author$project$WebCrypto$Symmetric$exportKey(key)), 25011 0, 25012 events, 25013 $elm$core$Maybe$Nothing)); 25014 }, 25015 $author$project$Infra$Crypto$generateGroupKey); 25016 }); 25017var $author$project$Infra$IdGen$batchHelp = F4( 25018 function (remaining, generate, state, acc) { 25019 batchHelp: 25020 while (true) { 25021 if (remaining <= 0) { 25022 return _Utils_Tuple2( 25023 $elm$core$List$reverse(acc), 25024 state); 25025 } else { 25026 var _v0 = generate(state); 25027 var id = _v0.a; 25028 var nextState = _v0.b; 25029 var $temp$remaining = remaining - 1, 25030 $temp$generate = generate, 25031 $temp$state = nextState, 25032 $temp$acc = A2($elm$core$List$cons, id, acc); 25033 remaining = $temp$remaining; 25034 generate = $temp$generate; 25035 state = $temp$state; 25036 acc = $temp$acc; 25037 continue batchHelp; 25038 } 25039 } 25040 }); 25041var $author$project$Infra$IdGen$batch = F3( 25042 function (count, generate, state) { 25043 return A4($author$project$Infra$IdGen$batchHelp, count, generate, state, _List_Nil); 25044 }); 25045var $TSFoster$elm_uuid$UUID$Seeds = F4( 25046 function (seed1, seed2, seed3, seed4) { 25047 return {hf: seed1, hg: seed2, hh: seed3, hi: seed4}; 25048 }); 25049var $TSFoster$elm_uuid$UUID$step = function (s) { 25050 var _v0 = A2($elm$random$Random$step, $TSFoster$elm_uuid$UUID$randomU32, s.hi); 25051 var int4 = _v0.a; 25052 var seed4 = _v0.b; 25053 var _v1 = A2($elm$random$Random$step, $TSFoster$elm_uuid$UUID$randomU32, s.hh); 25054 var int3 = _v1.a; 25055 var seed3 = _v1.b; 25056 var _v2 = A2($elm$random$Random$step, $TSFoster$elm_uuid$UUID$randomU32, s.hg); 25057 var int2 = _v2.a; 25058 var seed2 = _v2.b; 25059 var _v3 = A2($elm$random$Random$step, $TSFoster$elm_uuid$UUID$randomU32, s.hf); 25060 var int1 = _v3.a; 25061 var seed1 = _v3.b; 25062 var uuid = $TSFoster$elm_uuid$UUID$toVariant1( 25063 A2( 25064 $TSFoster$elm_uuid$UUID$toVersion, 25065 4, 25066 A4($TSFoster$elm_uuid$UUID$UUID, int1, int2, int3, int4))); 25067 return _Utils_Tuple2( 25068 uuid, 25069 A4($TSFoster$elm_uuid$UUID$Seeds, seed1, seed2, seed3, seed4)); 25070}; 25071var $author$project$Infra$IdGen$v4 = function (_v0) { 25072 var state = _v0; 25073 var _v1 = $TSFoster$elm_uuid$UUID$step(state.hy); 25074 var uuid = _v1.a; 25075 var nextSeeds = _v1.b; 25076 return _Utils_Tuple2( 25077 $TSFoster$elm_uuid$UUID$toString(uuid), 25078 _Utils_update( 25079 state, 25080 {hy: nextSeeds})); 25081}; 25082var $author$project$Infra$IdGen$v4batch = function (count) { 25083 return A2($author$project$Infra$IdGen$batch, count, $author$project$Infra$IdGen$v4); 25084}; 25085var $author$project$Infra$IdGen$v7batch = F2( 25086 function (count, time) { 25087 return A2( 25088 $author$project$Infra$IdGen$batch, 25089 count, 25090 $author$project$Infra$IdGen$v7(time)); 25091 }); 25092var $author$project$GroupOps$newGroup = F3( 25093 function (ctx, onComplete, output) { 25094 var signingKeyPair = $author$project$WebCrypto$Signature$importSigningKeyPair(ctx.O.dV); 25095 var _v0 = $author$project$Infra$IdGen$groupId(ctx.s); 25096 var groupId = _v0.a; 25097 var idState1 = _v0.b; 25098 var _v1 = A2( 25099 $author$project$Infra$IdGen$v4batch, 25100 $elm$core$List$length(output.rc), 25101 idState1); 25102 var virtualMemberIds = _v1.a; 25103 var idState2 = _v1.b; 25104 var _v2 = A3( 25105 $author$project$Infra$IdGen$v7batch, 25106 2 + $elm$core$List$length(output.rc), 25107 ctx.ap, 25108 idState2); 25109 var eventIds = _v2.a; 25110 var idStateAfter = _v2.b; 25111 var payloads = $author$project$Domain$Event$createGroup( 25112 { 25113 l6: _Utils_Tuple2(ctx.O.aK, output.a4), 25114 il: output.bg, 25115 bW: output.bW, 25116 rc: A3($elm$core$List$map2, $elm$core$Tuple$pair, virtualMemberIds, output.rc) 25117 }); 25118 var generateEnvelopes = A2( 25119 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$andThen, 25120 function (unsignedEnvelopes) { 25121 return $andrewMacmurray$elm_concurrent_task$ConcurrentTask$batch( 25122 A2( 25123 $elm$core$List$map, 25124 $author$project$GroupOps$signEnvelope(signingKeyPair), 25125 unsignedEnvelopes)); 25126 }, 25127 A2( 25128 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$map, 25129 function (now) { 25130 return A3( 25131 $elm$core$List$map2, 25132 F2( 25133 function (eventId, payload) { 25134 return A5( 25135 $author$project$Domain$Event$wrap, 25136 eventId, 25137 now, 25138 $author$project$GroupOps$author(ctx), 25139 payload, 25140 ''); 25141 }), 25142 eventIds, 25143 payloads); 25144 }, 25145 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$Time$now)); 25146 return A2( 25147 $elm$core$Tuple$mapFirst, 25148 function (r) { 25149 return {s: idStateAfter, ak: r}; 25150 }, 25151 A3( 25152 $author$project$Infra$ConcurrentTaskExtra$andRun, 25153 onComplete, 25154 A2( 25155 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$andThen, 25156 A2($author$project$GroupOps$saveNewGroup, ctx, groupId), 25157 generateEnvelopes), 25158 _Utils_Tuple2(ctx.ak, $elm$core$Platform$Cmd$none))); 25159 }); 25160var $author$project$Main$submitNewGroup = F3( 25161 function (model, readyData, output) { 25162 var _v0 = readyData.O; 25163 if (!_v0.$) { 25164 var identity = _v0.a; 25165 var ctx = { 25166 ap: model.ap, 25167 de: readyData.de, 25168 s: model.s, 25169 O: identity, 25170 ju: function (_v2) { 25171 return $author$project$Main$OnGroupCreated( 25172 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$UnexpectedError( 25173 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$InternalError('unused'))); 25174 }, 25175 ak: model.ak 25176 }; 25177 var _v1 = A3($author$project$GroupOps$newGroup, ctx, $author$project$Main$OnGroupCreated, output); 25178 var state = _v1.a; 25179 var cmd = _v1.b; 25180 return _Utils_Tuple2( 25181 _Utils_update( 25182 model, 25183 {s: state.s, ak: state.ak}), 25184 cmd); 25185 } else { 25186 return _Utils_Tuple2(model, $elm$core$Platform$Cmd$none); 25187 } 25188 }); 25189var $author$project$Domain$Entry$newMetadata = F3( 25190 function (id, memberId, creationTime) { 25191 return {f2: creationTime, f3: memberId, dg: 0, m9: id, gB: fal
25191se, fg: $elm$core$Maybe$Nothing, aj: id}; 25192 }); 25193var $author$project$Domain$Currency$convertCents = F4( 25194 function (rate, amountCents, from, to) { 25195 var realAmount = amountCents / A2( 25196 $elm$core$Basics$pow, 25197 10, 25198 $author$project$Domain$Currency$precision(from)); 25199 return $elm$core$Basics$round( 25200 (realAmount * rate) * A2( 25201 $elm$core$Basics$pow, 25202 10, 25203 $author$project$Domain$Currency$precision(to))); 25204 }); 25205var $author$project$SplitwiseImport$isPayment = function (category) { 25206 return $elm$core$String$toLower( 25207 $elm$core$String$trim(category)) === 'payment'; 25208}; 25209var $author$project$SplitwiseImport$mapCategory = function (raw) { 25210 var c = $elm$core$String$toLower( 25211 $elm$core$String$trim(raw)); 25212 var has = function (needle) { 25213 return A2($elm$core$String$contains, needle, c); 25214 }; 25215 return has('grocer') ? $elm$core$Maybe$Just(5) : ((has('dining') || (has('liquor') || (has('restaurant') || (has('food') || has('drink'))))) ? $elm$core$Maybe$Just(0) : ((has('plane') || (has('car') || (has('bus') || (has('train') || (has('taxi') || (has('fuel') || (has('gas') || (has('parking') || (has('transport') || has('flight')))))))))) ? $elm$core$Maybe$Just(1) : ((has('rent') || (has('hotel') || (has('accommodation') || (has('housing') || has('lodging'))))) ? $elm$core$Maybe$Just(2) : ((has('entertain') || (has('movie') || (has('game') || has('music')))) ? $elm$core$Maybe$Just(3) : ((has('shop') || (has('clothing') || has('electronic'))) ? $elm$core$Maybe$Just(4) : ((has('utilit') || (has('electric') || (has('water') || (has('internet') || (has('phone') || has('heat')))))) ? $elm$core$Maybe$Just(6) : ((has('medical') || (has('health') || (has('doctor') || has('pharma')))) ? $elm$core$Maybe$Just(7) : $elm$core$Maybe$Nothing))))))); 25216}; 25217var $author$project$SplitwiseImport$makeExpense = F5( 25218 function (row, amount, payers, beneficiaries, dca) { 25219 return $author$project$Domain$Entry$Expense( 25220 { 25221 ef: amount, 25222 ce: _List_Nil, 25223 em: beneficiaries, 25224 h9: $author$project$SplitwiseImport$mapCategory(row.h9), 25225 bg: row.bg, 25226 cj: row.cj, 25227 ck: dca, 25228 eE: row.eE, 25229 je: $elm$core$Maybe$Nothing, 25230 bu: $elm$core$Maybe$Nothing, 25231 jB: payers 25232 }); 25233 }); 25234var $author$project$SplitwiseImport$netOnlyExpense = F4( 25235 function (row, positives, negatives, dcaFor) { 25236 if ($elm$core$List$isEmpty(positives) || $elm$core$List$isEmpty(negatives)) { 25237 return $elm$core$Maybe$Nothing; 25238 } else { 25239 var amount = $elm$core$List$sum( 25240 A2($elm$core$List$map, $elm$core$Tuple$second, positives)); 25241 return $elm$core$Maybe$Just( 25242 A5( 25243 $author$project$SplitwiseImport$makeExpense, 25244 row, 25245 amount, 25246 A2( 25247 $elm$core$List$map, 25248 function (_v0) { 25249 var id = _v0.a; 25250 var n = _v0.b; 25251 return {ef: n, e_: id}; 25252 }, 25253 positives), 25254 A2( 25255 $elm$core$List$map, 25256 function (_v1) { 25257 var id = _v1.a; 25258 var n = _v1.b; 25259 return $author$project$Domain$Entry$ExactBeneficiary( 25260 {ef: -n, e_: id}); 25261 }, 25262 negatives), 25263 dcaFor(amount))); 25264 } 25265 }); 25266var $author$project$SplitwiseImport$allEqual = function (xs) { 25267 if (!xs.b) { 25268 return true; 25269 } else { 25270 var x = xs.a; 25271 var rest = xs.b; 25272 return A2( 25273 $elm$core$List$all, 25274 $elm$core$Basics$eq(x), 25275 rest); 25276 } 25277}; 25278var $author$project$SplitwiseImport$isEqualSplit = F3( 25279 function (cost, owedAmounts, involvedCount) { 25280 if (!owedAmounts.b) { 25281 return false; 25282 } else { 25283 var x = owedAmounts.a; 25284 return $author$project$SplitwiseImport$allEqual(owedAmounts) && _Utils_eq(cost, x * involvedCount); 25285 } 25286 }); 25287var $author$project$SplitwiseImport$singlePayerExpense = F5( 25288 function (row, payerId, payerNet, negatives, dcaFor) { 25289 var payers = _List_fromArray( 25290 [ 25291 {ef: row.bf, e_: payerId} 25292 ]); 25293 var owed = A2( 25294 $elm$core$List$map, 25295 function (_v1) { 25296 var id = _v1.a; 25297 var n = _v1.b; 25298 return _Utils_Tuple2(id, -n); 25299 }, 25300 negatives); 25301 var owedAmounts = A2($elm$core$List$map, $elm$core$Tuple$second, owed); 25302 var involvedCount = 1 + $elm$core$List$length(owed); 25303 if (A3($author$project$SplitwiseImport$isEqualSplit, row.bf, owedAmounts, involvedCount)) { 25304 return A5( 25305 $author$project$SplitwiseImport$makeExpense, 25306 row, 25307 row.bf, 25308 payers, 25309 A2( 25310 $elm$core$List$map, 25311 function (id) { 25312 return $author$project$Domain$Entry$ShareBeneficiary( 25313 {e_: id, qc: 1}); 25314 }, 25315 A2( 25316 $elm$core$List$cons, 25317 payerId, 25318 A2($elm$core$List$map, $elm$core$Tuple$first, owed))), 25319 dcaFor(row.bf)); 25320 } else { 25321 var payerOwed = row.bf - payerNet;
25322 var beneficiaries = _Utils_ap( 25323 A2( 25324 $elm$core$List$map, 25325 function (_v0) { 25326 var id = _v0.a; 25327 var a = _v0.b; 25328 return $author$project$Domain$Entry$ExactBeneficiary( 25329 {ef: a, e_: id}); 25330 }, 25331 owed), 25332 (payerOwed > 0) ? _List_fromArray( 25333 [ 25334 $author$project$Domain$Entry$ExactBeneficiary( 25335 {ef: payerOwed, e_: payerId}) 25336 ]) : _List_Nil); 25337 return A5( 25338 $author$project$SplitwiseImport$makeExpense, 25339 row, 25340 row.bf, 25341 payers, 25342 beneficiaries, 25343 dcaFor(row.bf)); 25344 } 25345 }); 25346var $author$project$SplitwiseImport$reconstruct = F2( 25347 function (config, row) { 25348 var pairs = A3($elm$core$List$map2, $elm$core$Tuple$pair, config.nJ, row.gT); 25349 var positives = A2( 25350 $elm$core$List$filter, 25351 function (_v8) { 25352 var n = _v8.b; 25353 return n > 0; 25354 }, 25355 pairs); 25356 var negatives = A2( 25357 $elm$core$List$filter, 25358 function (_v7) { 25359 var n = _v7.b; 25360 return n < 0; 25361 }, 25362 pairs); 25363 var dcaFor = function (amount) { 25364 return _Utils_eq(row.bg, config.il) ? $elm$core$Maybe$Nothing : $elm$core$Maybe$Just( 25365 A4( 25366 $author$project$Domain$Currency$convertCents, 25367 config.g8(row.bg), 25368 amount, 25369 row.bg, 25370 config.il)); 25371 }; 25372 if ($author$project$SplitwiseImport$isPayment(row.h9)) { 25373 var _v0 = _Utils_Tuple2(positives, negatives); 25374 if (((_v0.a.b && (!_v0.a.b.b)) && _v0.b.b) && (!_v0.b.b.b)) { 25375 var _v1 = _v0.a; 25376 var _v2 = _v1.a; 25377 var fromId = _v2.a; 25378 var amt = _v2.b; 25379 var _v3 = _v0.b; 25380 var _v4 = _v3.a; 25381 var toId = _v4.a; 25382 return $elm$core$Maybe$Just( 25383 $author$project$Domain$Entry$Transfer( 25384 { 25385 ef: amt, 25386 ce: _List_Nil, 25387 bg: row.bg, 25388 cj: row.cj, 25389 ck: dcaFor(amt), 25390 eE: $elm$core$String$isEmpty(row.eE) ? $elm$core$Maybe$Nothing : $elm$core$Maybe$Just(row.eE), 25391 iH: fromId, 25392 bu: $elm$core$Maybe$Nothing, 25393 kE: toId 25394 })); 25395 } else { 25396 return $elm$core$Maybe$Nothing; 25397 } 25398 } else { 25399 if (positives.b && (!positives.b.b)) { 25400 var _v6 = positives.a; 25401 var payerId = _v6.a; 25402 var payerNet = _v6.b; 25403 return $elm$core$Maybe$Just( 25404 A5($author$project$SplitwiseImport$singlePayerExpense, row, payerId, payerNet, negatives, dcaFor)); 25405 } else { 25406 return A4($author$project$SplitwiseImport$netOnlyExpense, row, positives, negatives, dcaFor); 25407 } 25408 } 25409 }); 25410var $author$project$GroupOps$importSplitwiseGroup = F3( 25411 function (ctx, onComplete, cfg) { 25412 var signingKeyPair = $author$project$WebCrypto$Signature$importSigningKeyPair(ctx.O.dV); 25413 var memberNames = cfg.g2.nK; 25414 var isClaimed = function (index) { 25415 return _Utils_eq( 25416 cfg.ib, 25417 $elm$core$Maybe$Just(index)); 25418 }; 25419 var _v0 = $author$project$Infra$IdGen$groupId(ctx.s); 25420 var groupId = _v0.a; 25421 var idState1 = _v0.b; 25422 var _v1 = A2( 25423 $author$project$Infra$IdGen$v4batch, 25424 $elm$core$List$length(memberNames), 25425 idState1); 25426 var virtualMemberIds = _v1.a; 25427 var idState2 = _v1.b; 25428 var memberIds = A2( 25429 $elm$core$List$indexedMap, 25430 F2( 25431 function (index, virtualId) { 25432 return isClaimed(index) ? ctx.O.aK : virtualId; 25433 }), 25434 virtualMemberIds); 25435 var kinds = A2( 25436 $elm$core$List$filterMap, 25437 $author$project$SplitwiseImport$reconstruct( 25438 {il: cfg.il, nJ: memberIds, g8: cfg.g8}), 25439 cfg.g2.p$); 25440 var _v2 = A2( 25441 $author$project$Infra$IdGen$v4batch, 25442 $elm$core$List$length(kinds), 25443 idState2); 25444 var entryIds = _v2.a; 25445 var idState3 = _v2.b; 25446 var virtualMembers = A2( 25447 $elm$core$List$filterMap, 25448 function (_v4) { 25449 var index = _v4.a; 25450 var idName = _v4.b; 25451 return isClaimed(index) ? $elm$core$Maybe$Nothing : $elm$core$Maybe$Just(idName); 25452 }, 25453 A2( 25454 $elm$core$List$indexedMap, 25455 $elm$core$Tuple$pair, 25456 A3($elm$core$List$map2, $elm$core$Tuple$pair, virtualMemberIds, memberNames))); 25457 var _v3 = A3( 25458 $author$project$Infra$IdGen$v7batch, 25459 (2 + $elm$core$List$length(virtualMembers)) + $elm$core$List$length(kinds), 25460 ctx.ap, 25461 idState3); 25462 var eventIds = _v3.a; 25463 var idStateAfter = _v3.b; 25464 var payloads = _Utils_ap( 25465 $author$project$Domain$Event$createGroup( 25466 { 25467 l6: _Utils_Tuple2(ctx.O.aK, cfg.a4), 25468 il: cfg.il, 25469 bW: cfg.iP, 25470 rc: virtualMembers 25471 }), 25472 A3( 25473 $elm$core$List$map2, 25474 F2( 25475 function (entryId, kind) { 25476 return $author$project$Domain$Event$EntryAdded( 25477 { 25478 gE: kind, 25479 gM: A3($author$project$Domain$Entry$newMetadata, entryId, ctx.O.aK, ctx.ap) 25480 }); 25481 }), 25482 entryIds, 25483 kinds)); 25484 var generateEnvelopes = A2( 25485 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$andThen, 25486 function (unsignedEnvelopes) { 25487 return $andrewMacmurray$elm_concurrent_task$ConcurrentTask$batch( 25488 A2( 25489 $elm$core$List$map, 25490 $author$project$GroupOps$signEnvelope(signingKeyPair), 25491 unsignedEnvelopes)); 25492 }, 25493 A2( 25494 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$map, 25495 function (now) { 25496 return A3( 25497 $elm$core$List$map2, 25498 F2( 25499 function (eventId, payload) { 25500 return A5( 25501 $author$project$Domain$Event$wrap, 25502 eventId, 25503 now, 25504 $author$project$GroupOps$author(ctx), 25505 payload, 25506 ''); 25507 }), 25508 eventIds, 25509 payloads); 25510 }, 25511 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$Time$now)); 25512 return A2( 25513 $elm$core$Tuple$mapFirst, 25514 function (r) { 25515 return {s: idStateAfter, ak: r}; 25516 }, 25517 A3( 25518 $author$project$Infra$ConcurrentTaskExtra$andRun, 25519 onComplete, 25520 A2( 25521 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$andThen, 25522 A2($author$project$GroupOps$saveNewGroup, ctx, groupId), 25523 generateEnvelopes), 25524 _Utils_Tuple2(ctx.ak, $elm$core$Platform$Cmd$none))); 25525 }); 25526var $author$project$Main$submitSplitwiseImport = F3( 25527 function (model, readyData, output) { 25528 var _v0 = readyData.O; 25529 if (!_v0.$) { 25530 var identity = _v0.a; 25531 var ctx = { 25532 ap: model.ap, 25533 de: readyData.de, 25534 s: model.s, 25535 O: identity, 25536 ju: function (_v2) { 25537 return $author$project$Main$OnGroupCreated( 25538 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$UnexpectedError( 25539 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$InternalError('unused'))); 25540 }, 25541 ak: model.ak 25542 }; 25543 var _v1 = A3( 25544 $author$project$GroupOps$importSplitwiseGroup, 25545 ctx, 25546 $author$project$Main$OnGroupCreated, 25547 { 25548 ib: output.ib, 25549 a4: output.a4, 25550 il: output.il, 25551 iP: output.iP, 25552 g2: output.g2, 25553 g8: function (c) { 25554 return A2( 25555 $elm$core$Maybe$withDefault, 25556 1, 25557 A2( 25558 $elm$core$Dict$get, 25559 $author$project$Domain$Currency$currencyCode(c), 25560 output.pK)); 25561 } 25562 }); 25563 var state = _v1.a; 25564 var cmd = _v1.b; 25565 return _Utils_Tuple2( 25566 _Utils_update( 25567 model, 25568 {s: state.s, ak: state.ak}), 25569 cmd); 25570 } else { 25571 return _Utils_Tuple2(model, $elm$core$Platform$Cmd$none); 25572 } 25573 }); 25574var $author$project$Translations$toastAlreadyInGroup = function (_v0) { 25575 var lang = _v0; 25576 if (!lang) { 25577 return 'You are already in this group.'; 25578 } else { 25579 return 'Tu es déjà dans ce groupe.'; 25580 } 25581}; 25582var $author$project$Translations$toastCopied = function (_v0) { 25583 var lang = _v0; 25584 if (!lang) { 25585 return 'Copied to clipboard.'; 25586 } else { 25587 return 'Copié dans le presse-papiers.'; 25588 } 25589}; 25590var $author$project$Translations$toastFeedbackPromptsReset = function (_v0) { 25591 var lang = _v0; 25592 if (!lang) { 25593 return 'Feedback prompts reset â every question can be asked again.'; 25594 } else { 25595 return 'Demandes d\'avis réinitialisées â chaque question peut être reposée.'; 25596 } 25597}; 25598var $author$project$Translations$toastGroupCreateError = function (_v0) { 25599 var lang = _v0; 25600 if (!lang) { 25601 return 'Failed to create group.'; 25602 } else { 25603 return 'Ãchec de la création du groupe.'; 25604 } 25605}; 25606var $author$project$Translations$toastIdentitySaveError = function (_v0) { 25607 var lang = _v0; 25608 if (!lang) { 25609 return 'Could not save your device identity. Check your available storage and try again.'; 25610 } else { 25611 return 'Impossible d\'enregistrer l\'identité de ton appareil. Vérifie l\'espace de stockage disponible et réessaie.'; 25612 } 25613}; 25614var $author$project$Translations$toastJoinError = function (_v0) { 25615 var lang = _v0; 25616 if (!lang) { 25617 return 'Failed to join group.'; 25618 } else { 25619 return 'Ãchec de l\'adhésion au groupe.'; 25620 } 25621}; 25622var $author$project$Translations$toastJoinedGroup = function (_v0) { 25623 var lang = _v0; 25624 if (!lang) { 25625 return 'Joined group!'; 25626 } else { 25627 return 'Groupe rejoint !'; 25628 } 25629}; 25630var $author$project$ImportExport$GroupImported = F2( 25631 function (a, b) { 25632 return {$: 2, a: a, b: b}; 25633 }); 25634var $author$project$ImportExport$OnExportCompressed = function (a) { 25635 return {$: 4, a: a}; 25636}; 25637var $author$project$ImportExport$OnExportCsvDataLoaded = F2( 25638 function (a, b) { 25639 return {$: 3, a: a, b: b}; 25640 }); 25641var $author$project$ImportExport$OnExportDataLoaded = F2( 25642 function (a, b) { 25643 return {$: 2, a: a, b: b}; 25644 }); 25645var $author$project$ImportExport$OnGroupImported = function (a) { 25646 return {$: 6, a: a}; 25647}; 25648var $author$project$ImportExport$SetImportError = function (a) { 25649 return {$: 1, a: a}; 25650}; 25651var $author$project$ImportExport$ShowToast = F2( 25652 function (a, b) { 25653 return {$: 0, a: a, b: b}; 25654 }); 25655var $author$project$Infra$ConcurrentTaskExtra$andCmd = F2( 25656 function (extraCmd, _v0) { 25657 var runner = _v0.a; 25658 var cmd = _v0.b; 25659 return _Utils_Tuple2( 25660 runner, 25661 $elm$core$Platform$Cmd$batch( 25662 _List_fromArray( 25663 [cmd, extraCmd]))); 25664 }); 25665var $author$project$Infra$Compression$compressAndDownload = F2( 25666 function (json, filename) { 25667 return A2( 25668 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$map, 25669 function (_v0) { 25670 return 0; 25671 }, 25672 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$define( 25673 { 25674 k: $elm$json$Json$Encode$object( 25675 _List_fromArray( 25676 [ 25677 _Utils_Tuple2( 25678 'json', 25679 $elm$json$Json$Encode$string(json)), 25680 _Utils_Tuple2( 25681 'filename', 25682 $elm$json$Json$Encode$string(filename)) 25683 ])), 25684 l: $andrewMacmurray$elm_concurrent_task$ConcurrentTask$expectErrors($elm$json$Json$Decode$string), 25685 m: $andrewMacmurray$elm_concurrent_task$ConcurrentTask$expectString, 25686 n: 'export:compressAndDownload' 25687 })); 25688 }); 25689var $elm$core$String$any = _String_any; 25690var $author$project$GroupCsvExport$needsQuoting = function (c) { 25691 return (c === ',') || ((c === '\"') || ((c === '\n') || (c === '\u000D'))); 25692}; 25693var $author$project$GroupCsvExport$startsWithFormulaChar = function (value) { 25694 var _v0 = $elm$core$String$uncons(value); 25695 if (!_v0.$) { 25696 var _v1 = _v0.a; 25697 var c = _v1.a; 25698 return (c === '=') || ((c === '+') || ((c === '@') || ((c === '-') || ((c === '\t') || (c === '\u000D'))))); 25699 } else { 25700 return false;
25701 } 25702}; 25703var $author$project$GroupCsvExport$csvField = function (value) { 25704 var guarded = $author$project$GroupCsvExport$startsWithFormulaChar(value) ? ('\'' + value) : value; 25705 return A2($elm$core$String$any, $author$project$GroupCsvExport$needsQuoting, guarded) ? ('\"' + (A3($elm$core$String$replace, '\"', '\"\"', guarded) + '\"')) : guarded; 25706}; 25707var $author$project$GroupCsvExport$entryDate = function (entry) { 25708 var _v0 = entry.gE; 25709 switch (_v0.$) { 25710 case 0: 25711 var data = _v0.a; 25712 return data.cj; 25713 case 1: 25714 var data = _v0.a; 25715 return data.cj; 25716 default: 25717 var data = _v0.a; 25718 return data.cj; 25719 } 25720}; 25721var $author$project$GroupCsvExport$escapeToken = function (name) { 25722 return A3( 25723 $elm$core$String$replace, 25724 ';', 25725 '\\;', 25726 A3( 25727 $elm$core$String$replace, 25728 ':', 25729 '\\:', 25730 A3($elm$core$String$replace, '\\', '\\\\', name))); 25731}; 25732var $author$project$GroupCsvExport$formatAmount = F2( 25733 function (currency, minor) { 25734 var sign = (minor < 0) ? '-' : ''; 25735 var digits = $author$project$Domain$Currency$precision(currency); 25736 var absMinor = $elm$core$Basics$abs(minor); 25737 if (!digits) { 25738 return _Utils_ap( 25739 sign, 25740 $elm$core$String$fromInt(absMinor)); 25741 } else { 25742 var divisor = A2($elm$core$Basics$pow, 10, digits); 25743 var major = (absMinor / divisor) | 0; 25744 var remainder = A2($elm$core$Basics$modBy, divisor, absMinor); 25745 return sign + ($elm$core$String$fromInt(major) + ('.' + A3( 25746 $elm$core$String$padLeft, 25747 digits, 25748 '0', 25749 $elm$core$String$fromInt(remainder)))); 25750 } 25751 }); 25752var $author$project$GroupCsvExport$formatBeneficiaries = F3( 25753 function (tokenName, beneficiaries, currency) { 25754 return A2( 25755 $elm$core$String$join, 25756 ';', 25757 A2( 25758 $elm$core$List$map, 25759 function (b) { 25760 if (!b.$) { 25761 var data = b.a; 25762 return tokenName(data.e_) + (':' + ($elm$core$String$fromInt(data.qc) + 's')); 25763 } else { 25764 var data = b.a; 25765 return tokenName(data.e_) + (':' + A2($author$project$GroupCsvExport$formatAmount, currency, data.ef)); 25766 } 25767 }, 25768 beneficiaries)); 25769 }); 25770var $author$project$GroupCsvExport$formatPayers = F3( 25771 function (tokenName, payers, currency) { 25772 return A2( 25773 $elm$core$String$join, 25774 ';', 25775 A2( 25776 $elm$core$List$map, 25777 function (p) { 25778 return tokenName(p.e_) + (':' + A2($author$project$GroupCsvExport$formatAmount, currency, p.ef)); 25779 }, 25780 payers)); 25781 }); 25782var $author$project$GroupCsvExport$maybeFormatDefault = F2( 25783 function (defaultCurrency, maybeAmount) { 25784 if (!maybeAmount.$) { 25785 var amount = maybeAmount.a; 25786 return A2($author$project$GroupCsvExport$formatAmount, defaultCurrency, amount); 25787 } else { 25788 return ''; 25789 } 25790 }); 25791var $author$project$GroupCsvExport$entryRow = F2( 25792 function (state, entry) { 25793 var memberName = function (id) { 25794 return A2($author$project$Domain$GroupState$resolveMemberName, state, id); 25795 }; 25796 var tokenName = function (id) { 25797 return $author$project$GroupCsvExport$escapeToken( 25798 memberName(id)); 25799 }; 25800 var common = function () { 25801 var _v0 = entry.gE; 25802 switch (_v0.$) { 25803 case 0: 25804 var data = _v0.a; 25805 return { 25806 ef: A2($author$project$GroupCsvExport$formatAmount, data.bg, data.ef), 25807 em: A3($author$project$GroupCsvExport$formatBeneficiaries, tokenName, data.em, data.bg), 25808 h9: A2( 25809 $elm$core$Maybe$withDefault, 25810 '', 25811 A2($elm$core$Maybe$map, $author$project$Domain$Entry$categoryToString, data.h9)), 25812 bg: $author$project$Domain$Currency$currencyCode(data.bg), 25813 df: A2($author$project$GroupCsvExport$maybeFormatDefault, state.iO.il, data.ck), 25814 eE: data.eE, 25815 gE: 'expense', 25816 je: A2($elm$core$Maybe$withDefault, '', data.je), 25817 bu: A2($elm$core$Maybe$withDefault, '', data.bu), 25818 jB: A3($author$project$GroupCsvExport$formatPayers, tokenName, data.jB, data.bg) 25819 }; 25820 case 1: 25821 var data = _v0.a; 25822 return { 25823 ef: A2($author$project$GroupCsvExport$formatAmount, data.bg, data.ef), 25824 em: tokenName(data.kE) + (':' + A2($author$project$GroupCsvExport$formatAmount, data.bg, data.ef)), 25825 h9: '', 25826 bg: $author$project$Domain$Currency$currencyCode(data.bg), 25827 df: A2($author$project$GroupCsvExport$maybeFormatDefault, state.iO.il, data.ck), 25828 eE: A2($elm$core$Maybe$withDefault, '', data.eE), 25829 gE: 'transfer', 25830 je: '', 25831 bu: A2($elm$core$Maybe$withDefault, '', data.bu), 25832 jB: tokenName(data.iH) + (':' + A2($author$project$GroupCsvExport$formatAmou
25832nt, data.bg, data.ef)) 25833 }; 25834 default: 25835 var data = _v0.a; 25836 return { 25837 ef: A2($author$project$GroupCsvExport$formatAmount, data.bg, data.ef), 25838 em: A3($author$project$GroupCsvExport$formatBeneficiaries, tokenName, data.em, data.bg), 25839 h9: '', 25840 bg: $author$project$Domain$Currency$currencyCode(data.bg), 25841 df: A2($author$project$GroupCsvExport$maybeFormatDefault, state.iO.il, data.ck), 25842 eE: data.eE, 25843 gE: 'income', 25844 je: '', 25845 bu: A2($elm$core$Maybe$withDefault, '', data.bu), 25846 jB: tokenName(data.j$) + (':' + A2($author$project$GroupCsvExport$formatAmount, data.bg, data.ef)) 25847 }; 25848 } 25849 }(); 25850 return A2( 25851 $elm$core$String$join, 25852 ',', 25853 _List_fromArray( 25854 [ 25855 $author$project$GroupCsvExport$csvField( 25856 $author$project$Domain$Date$toString( 25857 $author$project$GroupCsvExport$entryDate(entry))), 25858 $author$project$GroupCsvExport$csvField(common.gE), 25859 $author$project$GroupCsvExport$csvField(common.eE), 25860 $author$project$GroupCsvExport$csvField(common.ef), 25861 $author$project$GroupCsvExport$csvField(common.bg), 25862 $author$project$GroupCsvExport$csvField(common.df), 25863 $author$project$GroupCsvExport$csvField(common.jB), 25864 $author$project$GroupCsvExport$csvField(common.em), 25865 $author$project$GroupCsvExport$csvField(common.h9), 25866 $author$project$GroupCsvExport$csvField(common.je), 25867 $author$project$GroupCsvExport$csvField(common.bu), 25868 $author$project$GroupCsvExport$csvField( 25869 memberName(entry.gM.f3)) 25870 ])); 25871 }); 25872var $author$project$Domain$Date$toComparable = function (date) { 25873 return ((date.C * 10000) + (date.F * 100)) + date.y; 25874}; 25875var $author$project$GroupCsvExport$entrySortKey = function (entry) { 25876 return _Utils_Tuple2( 25877 -$author$project$Domain$Date$toComparable( 25878 $author$project$GroupCsvExport$entryDate(entry)), 25879 entry.gM.m9); 25880}; 25881var $author$project$GroupCsvExport$header = A2( 25882 $elm$core$String$join, 25883 ',', 25884 _List_fromArray( 25885 ['date', 'kind', 'description', 'amount', 'currency', 'default_currency_amount', 'payers', 'beneficiaries', 'category', 'location', 'notes', 'created_by'])); 25886var $author$project$GroupCsvExport$encode = function (state) { 25887 var rows = A2( 25888 $elm$core$List$map, 25889 $author$project$GroupCsvExport$entryRow(state), 25890 A2( 25891 $elm$core$List$sortBy, 25892 $author$project$GroupCsvExport$entrySortKey, 25893 $author$project$Domain$GroupState$activeEntries(state))); 25894 return '\uFEFF' + (A2( 25895 $elm$core$String$join, 25896 '\n', 25897 A2($elm$core$List$cons, $author$project$GroupCsvExport$header, rows)) + '\n'); 25898}; 25899var $author$project$GroupExport$maybeEncode = F2( 25900 function (enc, maybe) { 25901 if (!maybe.$) { 25902 var val = maybe.a; 25903 return enc(val); 25904 } else { 25905 return $elm$json$Json$Encode$null; 25906 } 25907 }); 25908var $author$project$GroupExport$encode = F2( 25909 function (now, data) { 25910 return A2( 25911 $elm$json$Json$Encode$encode, 25912 2, 25913 $elm$json$Json$Encode$object( 25914 _List_fromArray( 25915 [ 25916 _Utils_Tuple2( 25917 'format', 25918 $elm$json$Json$Encode$string('partage-group-v1')), 25919 _Utils_Tuple2( 25920 'exportedAt', 25921 $elm$json$Json$Encode$int( 25922 $elm$time$Time$posixToMillis(now))), 25923 _Utils_Tuple2( 25924 'group', 25925 $author$project$Domain$Group$encodeSummary(data.cs)), 25926 _Utils_Tuple2( 25927 'groupKey', 25928 A2($author$project$GroupExport$maybeEncode, $elm$json$Json$Encode$string, data.gs)), 25929 _Utils_Tuple2( 25930 'events', 25931 A2($elm$json$Json$Encode$list, $author$project$Domain$Event$encodeEnvelope, data.iC)) 25932 ]))); 25933 }); 25934var $author$project$GroupExport$encodeExport = F4( 25935 function (now, summary, events, maybeKey) { 25936 return A2( 25937 $author$project$GroupExport$encode, 25938 now, 25939 {iC: events, cs: summary, gs: maybeKey}); 25940 }); 25941var $author$project$GroupCsvExport$sanitizeFilename = function (name) { 25942 return $elm$core$String$fromList( 25943 A2( 25944 $elm$core$List$map, 25945 function (c) { 25946 return $elm$core$Char$isAlphaNum(c) ? c : '-'; 25947 }, 25948 $elm$core$String$toList(name))); 25949}; 25950var $author$project$GroupCsvExport$exportFilename = function (summary) { 25951 return 'partage-' + ($author$project$GroupCsvExport$sanitizeFilename(summary.bW) + '.csv'); 25952}; 25953var $author$project$GroupExport$sanitizeFilename = function (name) { 25954 return $elm$core$String$fromList( 25955 A2( 25956 $elm$core$List$map, 25957 function (c) { 25958 return $elm$core$Char$isAlphaNum(c) ? c : '-'; 25959 }, 25960 $elm$core$String$toList(name))); 25961}; 25962var $author$project$GroupExport$exportFilename = function (summary) { 25963 return 'partage-' + ($author$project$GroupExport$sanitizeFilename(summary.bW) + '.partage'); 25964}; 25965var $author$project$Translations$importErrorAlreadyExists = function (_v0) { 25966 var lang = _v0; 25967 if (!lang) { 25968 return 'This group already exists on your device.'; 25969 } else { 25970 return 'Ce groupe existe déjà sur ton appareil.'; 25971 } 25972}; 25973var $author$project$Translations$importErrorInvalidFile = function (_v0) { 25974 var lang = _v0; 25975 if (!lang) { 25976 return 'Invalid file format.'; 25977 } else {
25978 return 'Format de fichier invalide.'; 25979 } 25980}; 25981var $elm$file$File$Download$string = F3( 25982 function (name, mime, content) { 25983 return A2( 25984 $elm$core$Task$perform, 25985 $elm$core$Basics$never, 25986 A3(_File_download, name, mime, content)); 25987 }); 25988var $author$project$Translations$toastExportError = function (_v0) { 25989 var lang = _v0; 25990 if (!lang) { 25991 return 'Failed to export group.'; 25992 } else { 25993 return 'Ãchec de l\'exportation du groupe.'; 25994 } 25995}; 25996var $author$project$Translations$toastImportError = function (_v0) { 25997 var lang = _v0; 25998 if (!lang) { 25999 return 'Failed to import group.'; 26000 } else { 26001 return 'Ãchec de l\'importation du groupe.'; 26002 } 26003}; 26004var $author$project$GroupExport$AlreadyExists = 0; 26005var $author$project$GroupExport$InvalidFile = 1; 26006var $author$project$GroupExport$ExportData = F3( 26007 function (group, groupKey, events) { 26008 return {iC: events, cs: group, gs: groupKey}; 26009 }); 26010var $author$project$GroupExport$decoder = A2( 26011 $elm$json$Json$Decode$andThen, 26012 function (format) { 26013 return (format === 'partage-group-v1') ? A4( 26014 $elm$json$Json$Decode$map3, 26015 $author$project$GroupExport$ExportData, 26016 A2($elm$json$Json$Decode$field, 'group', $author$project$Domain$Group$summaryDecoder), 26017 A2( 26018 $elm$json$Json$Decode$field, 26019 'groupKey', 26020 $elm$json$Json$Decode$nullable($elm$json$Json$Decode$string)), 26021 A2( 26022 $elm$json$Json$Decode$field, 26023 'events', 26024 $elm$json$Json$Decode$list($author$project$Domain$Event$envelopeDecoder))) : $elm$json$Json$Decode$fail('Unknown format: ' + format); 26025 }, 26026 A2($elm$json$Json$Decode$field, 'format', $elm$json$Json$Decode$string)); 26027var $author$project$GroupExport$validateImport = F2( 26028 function (existingGroupIds, jsonString) { 26029 var _v0 = A2($elm$json$Json$Decode$decodeString, $author$project$GroupExport$decoder, jsonString); 26030 if (_v0.$ === 1) { 26031 return $elm$core$Result$Err(1); 26032 } else { 26033 var exportData = _v0.a; 26034 return A2($elm$core$Set$member, exportData.cs.m9, existingGroupIds) ? $elm$core$Result$Err(0) : $elm$core$Result$Ok(exportData); 26035 } 26036 }); 26037var $author$project$ImportExport$update = F3( 26038 function (config, msg, runnerCmd) { 26039 _v0$10: 26040 while (true) { 26041 switch (msg.$) { 26042 case 0: 26043 var groupId = msg.a; 26044 return _Utils_Tuple2( 26045 A3( 26046 $author$project$Infra$ConcurrentTaskExtra$andRun, 26047 A2( 26048 $elm$core$Basics$composeL, 26049 config.d3, 26050 $author$project$ImportExport$OnExportDataLoaded(groupId)), 26051 A3( 26052 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$map2, 26053 $elm$core$Tuple$pair, 26054 A2($author$project$Infra$Storage$loadGroupEvents, config.de, groupId), 26055 A2($author$project$Infra$Storage$loadGroupKey, config.de, groupId)), 26056 runnerCmd), 26057 $elm$core$Maybe$Nothing); 26058 case 2: 26059 if (!msg.b.$) { 26060 var groupId = msg.a; 26061 var _v1 = msg.b.a; 26062 var events = _v1.a; 26063 var maybeKey = _v1.b; 26064 var _v2 = A2($elm$core$Dict$get, groupId, config.eN); 26065 if (!_v2.$) { 26066 var summary = _v2.a; 26067 var json = A4($author$project$GroupExport$encodeExport, config.ap, summary, events, maybeKey); 26068 var filename = $author$project$GroupExport$exportFilename(summary); 26069 return _Utils_Tuple2( 26070 A3( 26071 $author$project$Infra$ConcurrentTaskExtra$andRun, 26072 A2($elm$core$Basics$composeL, config.d3, $author$project$ImportExport$OnExportCompressed), 26073 A2($author$project$Infra$Compression$compressAndDownload, json, filename), 26074 runnerCmd), 26075 $elm$core$Maybe$Nothing); 26076 } else { 26077 return _Utils_Tuple2( 26078 runnerCmd, 26079 $elm$core$Maybe$Just( 26080 A2( 26081 $author$project$ImportExport$ShowToast, 26082 1, 26083 $author$project$Translations$toastExportError(config.aJ)))); 26084 } 26085 } else { 26086 return _Utils_Tuple2( 26087 runnerCmd, 26088 $elm$core$Maybe$Just( 26089 A2( 26090 $author$project$ImportExport$ShowToast, 26091 1, 26092 $author$project$Translations$toastExportError(config.aJ)))); 26093 } 26094 case 4: 26095 if (msg.a.$ === 1) { 26096 return _Utils_Tuple2( 26097 runnerCmd, 26098 $elm$core$Maybe$Just( 26099 A2( 26100 $author$project$ImportExport$ShowToast, 26101 1, 26102 $author$project$Translations$toastExportError(config.aJ)))); 26103 } else { 26104 return _Utils_Tuple2(runnerCmd, $elm$core$Maybe$Nothing); 26105 } 26106 case 1: 26107 var groupId = msg.a; 26108 return _Utils_Tuple2( 26109 A3( 26110 $author$project$Infra$ConcurrentTaskExtra$andRun, 26111 A2( 26112 $elm$core$Basics$composeL, 26113 config.d3, 26114 $author$project$ImportExport$OnExportCsvDataLoaded(groupId)), 26115 A2($author$project$Infra$Storage$loadGroupEvents, config.de, groupId), 26116 runnerCmd), 26117 $elm$core$Maybe$Nothing); 26118 case 3: 26119 if (!msg.b.$) { 26120 var groupId = msg.a; 26121 var events = msg.b.a; 26122 var _v3 = A2($elm$core$Dict$get, groupId, config.eN); 26123 if (!_v3.$) { 26124 var summary = _v3.a; 26125 var csvDownloadCmd = A3( 26126 $elm$file$File$Download$string, 26127 $author$project$GroupCsvExport$exportFilename(summary), 26128 'text/csv;charset=utf-8', 26129 $author$project$GroupCsvExport$encode( 26130 A2($author$project$Domain$GroupState$applyEvents, events, $author$project$Domain$GroupState$empty))); 26131 return _Utils_Tuple2( 26132 A2($author$project$Infra$ConcurrentTaskExtra$andCmd, csvDownloadCmd, runnerCmd), 26133 $elm$core$Maybe$Nothing); 26134 } else { 26135 return _Utils_Tuple2( 26136 runnerCmd, 26137 $elm$core$Maybe$Just( 26138 A2( 26139 $author$project$ImportExport$ShowToast, 26140 1, 26141 $author$project$Translations$toastExportError(config.aJ)))); 26142 } 26143 } else { 26144 return _Utils_Tuple2( 26145 runnerCmd, 26146 $elm$core$Maybe$Just( 26147 A2( 26148 $author$project$ImportExport$ShowToast, 26149 1, 26150 $author$project$Translations$toastExportError(config.aJ)))); 26151 } 26152 case 5: 26153 switch (msg.a.$) { 26154 case 0: 26155 var jsonString = msg.a.a; 26156 var existingIds = $elm$core$Set$fromList( 26157 $elm$core$Dict$keys(config.eN)); 26158 var _v4 = A2($author$project$GroupExport$validateImport, existingIds, jsonString); 26159 if (_v4.$ === 1) { 26160 if (_v4.a === 1) { 26161 var _v5 = _v4.a; 26162 return _Utils_Tuple2( 26163 runnerCmd, 26164 $elm$core$Maybe$Just( 26165 $author$project$ImportExport$SetImportError( 26166 $author$project$Translations$importErrorInvalidFile(config.aJ)))); 26167 } else { 26168 var _v6 = _v4.a; 26169 return _Utils_Tuple2( 26170 runnerCmd, 26171 $elm$core$Maybe$Just( 26172 $author$project$ImportExport$SetImportError( 26173 $author$project$Translations$importErrorAlreadyExists(config.aJ)))); 26174 } 26175 } else { 26176 var exportData = _v4.a; 26177 return _Utils_Tuple2( 26178 A3( 26179 $author$project$Infra$ConcurrentTaskExtra$andRun, 26180 A2($elm$core$Basics$composeL, config.d3, $author$project$ImportExport$OnGroupImported), 26181 A2( 26182 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$andThen, 26183 function (verified) { 26184 var summary = A4( 26185 $author$project$Domain$GroupState$summarize, 26186 config.iY, 26187 exportData.cs.m9, 26188 config.ap, 26189 A2($author$project$Domain$GroupState$applyEvents, verified, $author$project$Domain$GroupState$empty)); 26190 var result = { 26191 gf: $elm$core$List$length(exportData.iC) - $elm$core$List$length(verified), 26192 bA: summary 26193 }; 26194 return A2( 26195 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$map, 26196 function (_v7) { 26197 return result; 26198 }, 26199 A6($author$project$Infra$Storage$saveGroup, config.de, summary, exportData.gs, 1, verified, $elm$core$Maybe$Nothing)); 26200 }, 26201 A2($author$project$Infra$EventVerification$filterVerifiedEvents, $author$project$Domain$GroupState$empty, exportData.iC)), 26202 runnerCmd), 26203 $elm$core$Maybe$Nothing); 26204 } 26205 case 1: 26206 if (msg.a.a === 'DECOMPRESSION_TOO_LARGE') { 26207 return _Utils_Tuple2( 26208 runnerCmd, 26209 $elm$core$Maybe$Just( 26210 $author$project$ImportExport$SetImportError( 26211 $author$project$Translations$importErrorTooLarge(config.aJ)))); 26212 } else { 26213 break _v0$10; 26214 } 26215 default: 26216 break _v0$10; 26217 } 26218 default: 26219 if (!msg.a.$) { 26220 var result = msg.a.a; 26221 return _Utils_Tuple2( 26222 runnerCmd, 26223 $elm$core$Maybe$Just( 26224 A2($author$project$ImportExport$GroupImported, result.bA, result.gf))); 26225 } else { 26226 return _Utils_Tuple2( 26227 runnerCmd, 26228 $elm$core$Maybe$Just( 26229 A2( 26230 $author$project$ImportExport$ShowToast, 26231 1, 26232 $author$project$Translations$toastImportError(config.aJ)))); 26233 } 26234 } 26235 } 26236 return _Utils_Tuple2( 26237 runnerCmd, 26238 $elm$core$Maybe$Just( 26239 $author$project$ImportExport$SetImportError( 26240 $author$project$Translations$importErrorInvalidFile(config.aJ)))); 26241 }); 26242var $author$project$Page$About$Loaded = function (a) { 26243 return {$: 1, a: a}; 26244}; 26245var $author$project$Page$About$RequestRekeyIdentity = 1; 26246var $author$project$Page$About$RequestResetStats = 0; 26247var $author$project$Page$About$update = F2( 26248 function (msg, model) { 26249 switch (msg.$) { 26250 case 0: 26251 var breakdown = msg.a; 26252 var trackingSince = msg.b; 26253 var persistStatus = msg.c; 26254 return _Utils_Tuple2( 26255 _Utils_update( 26256 model, 26257 { 26258 ci: false, 26259 ft: $author$project$Page$About$Loaded( 26260 {h4: breakdown, jE: persistStatus, kK: trackingSince}) 26261 }), 26262 $elm$core$Maybe$Nothing); 26263 case 1: 26264 return _Utils_Tuple2( 26265 _Utils_update( 26266 model, 26267 {ci: !model.ci}), 26268 $elm$core$Maybe$Nothing); 26269 case 2: 26270 return _Utils_Tuple2( 26271 model, 26272 $elm$core$Maybe$Just(0)); 26273 case 3: 26274 return _Utils_Tuple2( 26275 _Utils_update( 26276 model, 26277 {ch: !model.ch}), 26278 $elm$core$Maybe$Nothing); 26279 default: 26280 return _Utils_Tuple2( 26281 _Utils_update( 26282 model, 26283 {ch: false}), 26284 $elm$core$Maybe$Just(1)); 26285 } 26286 }); 26287var $author$project$Domain$MigrationCuration$All = {$: 0}; 26288var $author$project$Page$Group$LogError = F3( 26289 function (a, b, c) {
26290 return {$: 4, a: a, b: b, c: c}; 26291 }); 26292var $author$project$Page$Group$NavigateTo = function (a) { 26293 return {$: 0, a: a}; 26294}; 26295var $author$project$GroupOps$NoCompactionStep = {$: 0}; 26296var $author$project$Page$Group$NoOp = {$: 42}; 26297var $author$project$Page$Group$OnCompactionEventSaved = F2( 26298 function (a, b) { 26299 return {$: 29, a: a, b: b}; 26300 }); 26301var $author$project$Page$Group$OnCompactionStep = F2( 26302 function (a, b) { 26303 return {$: 28, a: a, b: b}; 26304 }); 26305var $author$project$Page$Group$OnEntryActionSaved = F2( 26306 function (a, b) { 26307 return {$: 19, a: a, b: b}; 26308 }); 26309var $author$project$Page$Group$OnFullLogRequeued = F2( 26310 function (a, b) { 26311 return {$: 27, a: a, b: b}; 26312 }); 26313var $author$project$Page$Group$OnGroupMetadataActionSaved = F2( 26314 function (a, b) { 26315 return {$: 21, a: a, b: b}; 26316 }); 26317var $author$project$Page$Group$OnGroupMigrated = function (a) { 26318 return {$: 41, a: a}; 26319}; 26320var $author$project$Page$Group$OnMemberActionSaved = F2( 26321 function (a, b) { 26322 return {$: 20, a: a, b: b}; 26323 }); 26324var $author$project$Page$Group$OnSuspicionDismissalsSaved = function (a) { 26325 return {$: 34, a: a}; 26326}; 26327var $author$project$Page$Group$OnTamperSignalsSaved = function (a) { 26328 return {$: 32, a: a}; 26329}; 26330var $author$project$Page$Group$PendingTransfer = function (a) { 26331 return {$: 0, a: a}; 26332}; 26333var $author$project$Page$Group$PostSyncTasksDone = function (a) { 26334 return {$: 30, a: a}; 26335}; 26336var $author$project$Page$Group$NewEntry$Shared$RateFetchFailed = {$: 22}; 26337var $author$project$Page$Group$NewEntry$Shared$RateFetched = F2( 26338 function (a, b) { 26339 return {$: 21, a: a, b: b}; 26340 }); 26341var $author$project$Page$Group$SaveSelfProfile = function (a) { 26342 return {$: 5, a: a}; 26343}; 26344var $author$project$Page$Group$SaveSummary = function (a) { 26345 return {$: 0, a: a}; 26346}; 26347var $author$project$Page$Group$ShowToast = F2( 26348 function (a, b) { 26349 return {$: 1, a: a, b: b}; 26350 }); 26351var $author$project$Page$Group$UpdateGroupSummary = function (a) { 26352 return {$: 2, a: a}; 26353}; 26354var $author$project$Page$Group$WorkspaceLoaded = function (a) { 26355 return {$: 4, a: a}; 26356}; 26357var $author$project$Page$Group$activeMemberNames = function (model) { 26358 var _v0 = model.a; 26359 if (_v0.$ === 4) { 26360 var loaded = _v0.a; 26361 return A2( 26362 $elm$core$List$map, 26363 function ($) { 26364 return $.bW; 26365 }, 26366 $author$project$Domain$GroupState$activeMembers(loaded.a6)); 26367 } else { 26368 return _List_Nil; 26369 } 26370}; 26371var $author$project$GroupOps$attempt = F3( 26372 function (ctx, makeUnsignedEnvelope, loaded) { 26373 var signingKeyPair = $author$project$WebCrypto$Signature$importSigningKeyPair(ctx.O.dV); 26374 var groupId = loaded.bA.m9; 26375 var task = A2( 26376 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$andThen, 26377 function (envelope) { 26378 return A2( 26379 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$map, 26380 function (_v0) { 26381 return envelope; 26382 }, 26383 A4( 26384 $author$project$Infra$Storage$saveEvents, 26385 ctx.de, 26386 groupId, 26387 0, 26388 _List_fromArray( 26389 [envelope]))); 26390 }, 26391 A2( 26392 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$andThen, 26393 $author$project$GroupOps$signEnvelope(signingKeyPair), 26394 A2( 26395 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$map, 26396 A2( 26397 $elm$core$Basics$composeR, 26398 $author$project$GroupOps$clampAfterLatest(loaded.iC), 26399 makeUnsignedEnvelope), 26400 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$Time$now))); 26401 return A2( 26402 $elm$core$Tuple$mapFirst, 26403 function (r) { 26404 return {s: ctx.s, ak: r}; 26405 }, 26406 A3( 26407 $author$project$Infra$ConcurrentTaskExtra$andRun, 26408 ctx.ju, 26409 task, 26410 _Utils_Tuple2(ctx.ak, $elm$core$Platform$Cmd$none))); 26411 }); 26412var $author$project$GroupOps$addMember = F3( 26413 function (ctx, loaded, output) { 26414 var _v0 = $author$project$Infra$IdGen$v4(ctx.s); 26415 var newMemberId = _v0.a; 26416 var idState1 = _v0.b; 26417 var _v1 = A2($author$project$Infra$IdGen$v7, ctx.ap, idState1); 26418 var eventId = _v1.a; 26419 var idStateAfter = _v1.b; 26420 var payload = $author$project$Domain$Event$MemberCreated( 26421 {fO: ctx.O.aK, e_: newMemberId, nL: 1, bW: output.bW}); 26422 return A3( 26423 $author$project$GroupOps$attempt, 26424 _Utils_update( 26425 ctx, 26426 {s: idStateAfter}), 26427 function (now) { 26428 return A5( 26429 $author$project$Domain$Event$wrap, 26430 eventId, 26431 now, 26432 $author$project$GroupOps$author(ctx), 26433 payload, 26434 ''); 26435 }, 26436 loaded); 26437 }); 26438var $author$project$GroupOps$addUnpushedId = F2( 26439 function (eventId, loaded) { 26440 return _Utils_update( 26441 loaded, 26442 { 26443 bC: A2($elm$core$Set$insert, eventId, loaded.bC) 26444 }); 26445 }); 26446var $author$project$Page$Group$addUnpushedIdToModel = F2( 26447 function (eventId, model) { 26448 var _v0 = model.a; 26449 if (_v0.$ === 4) { 26450 var loaded = _v0.a; 26451 return _Utils_update( 26452 model, 26453 {
26454 a: $author$project$Page$Group$WorkspaceLoaded( 26455 A2($author$project$GroupOps$addUnpushedId, eventId, loaded)) 26456 }); 26457 } else { 26458 return model; 26459 } 26460 }); 26461var $author$project$GroupOps$appendEvent = F2( 26462 function (envelope, loaded) { 26463 return _Utils_update( 26464 loaded, 26465 { 26466 iC: A2($elm$core$List$cons, envelope, loaded.iC), 26467 a6: A2( 26468 $author$project$Domain$GroupState$applyEvents, 26469 _List_fromArray( 26470 [envelope]), 26471 loaded.a6) 26472 }); 26473 }); 26474var $author$project$Page$Group$mapLoadedGroup = F3( 26475 function (f, groupId, model) { 26476 var _v0 = model.a; 26477 if (_v0.$ === 4) { 26478 var loaded = _v0.a; 26479 return _Utils_eq(loaded.bA.m9, groupId) ? $elm$core$Maybe$Just( 26480 _Utils_update( 26481 model, 26482 { 26483 a: $author$project$Page$Group$WorkspaceLoaded( 26484 f(loaded)) 26485 })) : $elm$core$Maybe$Nothing; 26486 } else { 26487 return $elm$core$Maybe$Nothing; 26488 } 26489 }); 26490var $author$project$Page$Group$appendEventAndRecompute = F3( 26491 function (model, groupId, envelope) { 26492 return A3( 26493 $author$project$Page$Group$mapLoadedGroup, 26494 $author$project$GroupOps$appendEvent(envelope), 26495 groupId, 26496 model); 26497 }); 26498var $author$project$Page$Group$RequestFeedback = F2( 26499 function (a, b) { 26500 return {$: 6, a: a, b: b}; 26501 }); 26502var $author$project$Domain$FeedbackMoment$Concluded = 0; 26503var $author$project$Domain$FeedbackMoment$Prolific = 1; 26504var $author$project$Domain$FeedbackMoment$Refusal = 2; 26505var $author$project$Domain$FeedbackMoment$isFresh = F2( 26506 function (now, entries) { 26507 return A2( 26508 $elm$core$Maybe$withDefault, 26509 false, 26510 A2( 26511 $elm$core$Maybe$map, 26512 function (newest) { 26513 return _Utils_cmp( 26514 $elm$time$Time$posixToMillis(now) - newest, 26515 7 * $author$project$Domain$FeedbackMoment$dayMs) < 1; 26516 }, 26517 $elm$core$List$maximum( 26518 A2( 26519 $elm$core$List$map, 26520 A2( 26521 $elm$core$Basics$composeR, 26522 function ($) { 26523 return $.gM; 26524 }, 26525 A2( 26526 $elm$core$Basics$composeR, 26527 function ($) { 26528 return $.f2; 26529 }, 26530 $elm$time$Time$posixToMillis)), 26531 entries)))); 26532 }); 26533var $author$project$Domain$FeedbackMoment$prolificEntries = 100; 26534var $author$project$Domain$StableSettlement$applyDrainByIdx = F2( 26535 function (drainByIdx, edges) { 26536 return A2( 26537 $elm$core$List$indexedMap, 26538 F2( 26539 function (i, e) { 26540 var f = e.a; 26541 var t = e.b; 26542 var amt = e.c; 26543 var _v0 = A2($elm$core$Dict$get, i, drainByIdx); 26544 if (!_v0.$) { 26545 var take = _v0.a; 26546 return _Utils_Tuple3(f, t, amt - take); 26547 } else { 26548 return e; 26549 } 26550 }), 26551 edges); 26552 }); 26553var $author$project$Domain$StableSettlement$setDelta = F3( 26554 function (k, v, d) { 26555 return (!v) ? A2($elm$core$Dict$remove, k, d) : A3($elm$core$Dict$insert, k, v, d); 26556 }); 26557var $author$project$Domain$StableSettlement$cancelOne = F2( 26558 function (_v0, _v2) { 26559 var idx = _v0.a; 26560 var _v1 = _v0.b; 26561 var f = _v1.a; 26562 var t = _v1.b; 26563 var amt = _v1.c; 26564 var drainByIdx = _v2.a; 26565 var delta = _v2.b; 26566 var dt = A2( 26567 $elm$core$Maybe$withDefault, 26568 0, 26569 A2($elm$core$Dict$get, t, delta)); 26570 var df = A2( 26571 $elm$core$Maybe$withDefault, 26572 0, 26573 A2($elm$core$Dict$get, f, delta)); 26574 if ((df > 0) && (dt < 0)) { 26575 var take = A2( 26576 $elm$core$Basics$min, 26577 A2($elm$core$Basics$min, df, -dt), 26578 amt); 26579 return _Utils_Tuple2( 26580 A3($elm$core$Dict$insert, idx, take, drainByIdx), 26581 A3( 26582 $author$project$Domain$StableSettlement$setDelta, 26583 t, 26584 dt + take, 26585 A3($author$project$Domain$StableSettlement$setDelta, f, df - take, delta))); 26586 } else { 26587 return _Utils_Tuple2(drainByIdx, delta); 26588 } 26589 }); 26590var $author$project$Domain$StableSettlement$edgeOrder = F2( 26591 function (_v0, _v1) { 26592 var f1 = _v0.a; 26593 var t1 = _v0.b; 26594 var f2 = _v1.a; 26595 var t2 = _v1.b; 26596 var _v2 = A2($elm$core$Basics$compare, f1, f2); 26597 if (_v2 === 1) { 26598 return A2($elm$core$Basics$compare, t1, t2); 26599 } else { 26600 var o = _v2; 26601 return o; 26602 } 26603 }); 26604var $author$project$Domain$StableSettlement$cancelDirectPairs = F2( 26605 function (edges, delta) { 26606 var indexed = A2($elm$core$List$indexedMap, $elm$core$Tuple$pair, edges); 26607 var sorted = A2( 26608 $elm$core$List$sortWith, 26609 F2( 26610 function (_v1, _v2) { 26611 var e1 = _v1.b; 26612 var e2 = _v2.b; 26613 return A2($author$project$Domain$StableSettlement$edgeOrder, e1, e2); 26614 }), 26615 indexed); 26616 var _v0 = A3( 26617 $elm$core$List$foldl, 26618 $author$project$Domain$StableSettlement$cancelOne, 26619 _Utils_Tuple2($elm$core$Dict$empty, delta), 26620 sorted); 26621 var drainByIdx = _v0.a; 26622 var finalDelta = _v0.b; 26623 return _Utils_Tuple2( 26624 A2($author$project$Domain$StableSettlement$applyDrainByIdx, drainByIdx, edges), 26625 finalDelta); 26626 }); 26627var $author$project$Domain$StableSettlement$consolidateEdges = function (edges) { 26628 var totals = A3( 26629 $elm$core$List$foldl, 26630 F2( 26631 function (_v3, acc) { 26632 var f = _v3.a; 26633 var t = _v3.b; 26634 var amt = _v3.c; 26635 return A3( 26636 $elm$core$Dict$update, 26637 _Utils_Tuple2(f, t), 26638 function (mv) { 26639 if (!mv.$) { 26640 var cur = mv.a; 26641 return $elm$core$Maybe$Just(cur + amt); 26642 } else { 26643 return $elm$core$Maybe$Just(amt); 26644 } 26645 }, 26646 acc); 26647 }), 26648 $elm$core$Dict$empty, 26649 edges); 26650 var firstOccurrences = $elm$core$List$reverse( 26651 A3( 26652 $elm$core$List$foldl, 26653 F2( 26654 function (_v1, _v2) { 26655 var f = _v1.a; 26656 var t = _v1.b; 26657 var seen = _v2.a; 26658 var acc = _v2.b; 26659 return A2( 26660 $elm$core$Dict$member, 26661 _Utils_Tuple2(f, t), 26662 seen) ? _Utils_Tuple2(seen, acc) : _Utils_Tuple2( 26663 A3( 26664 $elm$core$Dict$insert, 26665 _Utils_Tuple2(f, t), 26666 0, 26667 seen), 26668 A2( 26669 $elm$core$List$cons, 26670 _Utils_Tuple2(f, t), 26671 acc)); 26672 }), 26673 _Utils_Tuple2($elm$core$Dict$empty, _List_Nil), 26674 edges).b); 26675 return A2( 26676 $elm$core$List$filterMap, 26677 function (_v0) { 26678 var f = _v0.a; 26679 var t = _v0.b; 26680 return A2( 26681 $elm$core$Maybe$andThen, 26682 function (amt) { 26683 return (amt > 0) ? $elm$core$Maybe$Just( 26684 {ef: amt, iH: f, kE: t}) : $elm$core$Maybe$Nothing; 26685 }, 26686 A2( 26687 $elm$core$Dict$get, 26688 _Utils_Tuple2(f, t), 26689 totals)); 26690 }, 26691 firstOccurrences); 26692}; 26693var $author$project$Domain$StableSettlement$addAmount = F2( 26694 function (k, v) { 26695 return A2( 26696 $elm$core$Dict$update, 26697 k, 26698 function (mv) { 26699 if (!mv.$) { 26700 var cur = mv.a; 26701 return $elm$core$Maybe$Just(cur + v); 26702 } else { 26703 return $elm$core$Maybe$Just(v); 26704 } 26705 }); 26706 }); 26707var $author$project$Domain$StableSettlement$drainIncoming = F2( 26708 function (_v0, _v1) { 26709 var n = _v0.a; 26710 var dn = _v0.b; 26711 var edges = _v1.a; 26712 var lostOutgoing = _v1.b; 26713 var newDebtors = _v1.c; 26714 var nIn = A2( 26715 $elm$core$List$sortBy, 26716 function (_v9) { 26717 var _v10 = _v9.b; 26718 var f = _v10.a; 26719 return f; 26720 }, 26721 A2( 26722 $elm$core$List$filter, 26723 function (_v7) { 26724 var _v8 = _v7.b; 26725 var t = _v8.b; 26726 return _Utils_eq(t, n); 26727 }, 26728 A2($elm$core$List$indexedMap, $elm$core$Tuple$pair, edges))); 26729 var _v2 = A3( 26730 $elm$core$List$foldl, 26731 F2( 26732 function (_v3, _v5) { 26733 var idx = _v3.a; 26734 var _v4 = _v3.b; 26735 var f = _v4.a; 26736 var amt = _v4.c; 26737 var dict = _v5.a; 26738 var rem = _v5.b; 26739 var accDrained = _v5.c; 26740 if (rem <= 0) { 26741 return _Utils_Tuple3(dict, rem, accDrained); 26742 } else { 26743 var take = A2($elm$core$Basics$min, rem, amt); 26744 return _Utils_Tuple3( 26745 A3($elm$core$Dict$insert, idx, take, dict), 26746 rem - take, 26747 A2( 26748 $elm$core$List$cons, 26749 _Utils_Tuple2(f, take), 26750 accDrained)); 26751 } 26752 }), 26753 _Utils_Tuple3($elm$core$Dict$empty, -dn, _List_Nil), 26754 nIn); 26755 var drainByIdx = _v2.a; 26756 var remaining = _v2.b; 26757 var drained = _v2.c; 26758 return _Utils_Tuple3( 26759 A2($author$project$Domain$StableSettlement$applyDrainByIdx, drainByIdx, edges), 26760 A3( 26761 $elm$core$List$foldl, 26762 function (_v6) { 26763 var did = _v6.a; 26764 var amt = _v6.b; 26765 return A2($author$project$Domain$StableSettlement$addAmount, did, amt); 26766 }, 26767 lostOutgoing, 26768 drained), 26769 (remaining > 0) ? A3($elm$core$Dict$insert, n, remaining, newDebtors) : newDebtors); 26770 }); 26771var $author$project$Domain$StableSettlement$drainOutgoing = F2( 26772 function (_v0, _v1) { 26773 var n = _v0.a; 26774 var dn = _v0.b; 26775 var edges = _v1.a; 26776 var lostIncoming = _v1.b; 26777 var newCreditors = _v1.c; 26778 var nOut = A2( 26779 $elm$core$List$sortBy, 26780 function (_v9) { 26781 var _v10 = _v9.b; 26782 var t = _v10.b; 26783 return t; 26784 }, 26785 A2( 26786 $elm$core$List$filter, 26787 function (_v7) { 26788 var _v8 = _v7.b; 26789 var f = _v8.a; 26790 return _Utils_eq(f, n); 26791 }, 26792 A2($elm$core$List$indexedMap, $elm$core$Tuple$pair, edges))); 26793 var _v2 = A3( 26794 $elm$core$List$foldl, 26795 F2( 26796 function (_v3, _v5) { 26797 var idx = _v3.a; 26798 var _v4 = _v3.b; 26799 var t = _v4.b; 26800 var amt = _v4.c; 26801 var dict = _v5.a; 26802 var rem = _v5.b; 26803 var accDrained = _v5.c; 26804 if (rem <= 0) { 26805 return _Utils_Tuple3(dict, rem, accDrained); 26806 } else { 26807 var take = A2($elm$core$Basics$min, rem, amt); 26808 return _Utils_Tuple3( 26809 A3($elm$core$Dict$insert, idx, take, dict), 26810 rem - take, 26811 A2( 26812 $elm$core$List$cons, 26813 _Utils_Tuple2(t, take), 26814 accDrained)); 26815 } 26816 }), 26817 _Utils_Tuple3($elm$core$Dict$empty, dn, _List_Nil), 26818 nOut); 26819 var drainByIdx = _v2.a; 26820 var remaining = _v2.b; 26821 var drained = _v2.c; 26822 return _Utils_Tuple3( 26823 A2($author$project$Domain$StableSettlement$applyDrainByIdx, drainByIdx, edges), 26824 A3( 26825 $elm$core$List$foldl, 26826 function (_v6) { 26827 var cid = _v6.a; 26828 var amt = _v6.b; 26829 return A2($author$project$Domain$StableSettlement$addAmount, cid, amt); 26830 }, 26831 lostIncoming, 26832 drained), 26833 (remaining > 0) ? A3($elm$core$Dict$insert, n, remaining, newCreditors) : newCreditors); 26834 }); 26835var $author$project$Domain$StableSettlement$matchResiduals = F3( 26836 function (supply, demand, acc) { 26837 matchResiduals: 26838 while (true) { 26839 var _v0 = _Utils_Tuple2(supply, demand); 26840 if (!_v0.a.b) { 26841 return $elm$core$List$reverse(acc); 26842 } else { 26843 if (!_v0.b.b) { 26844 return $elm$core$List$reverse(acc); 26845 } else { 26846 var _v1 = _v0.a; 26847 var _v2 = _v1.a; 26848 var s = _v2.a; 26849 var sAmt = _v2.b; 26850 var restS = _v1.b; 26851 var _v3 = _v0.b; 26852 var _v4 = _v3.a; 26853 var d = _v4.a; 26854 var dAmt = _v4.b; 26855 var restD = _v3.b; 26856 var take = A2($elm$core$Basics$min, sAmt, dAmt); 26857 var edge = _Utils_Tuple3(s, d, take); 26858 var _v5 = A2($elm$core$Basics$compare, sAmt, dAmt); 26859 switch (_v5) { 26860 case 1: 26861 var $temp$supply = restS, 26862 $temp$demand = restD, 26863 $temp$acc = A2($elm$core$List$cons, edge, acc); 26864 supply = $temp$supply; 26865 demand = $temp$demand; 26866 acc = $temp$acc; 26867 continue matchResiduals; 26868 case 0: 26869 var $temp$supply = restS, 26870 $temp$demand = A2( 26871 $elm$core$List$cons, 26872 _Utils_Tuple2(d, dAmt - take), 26873 restD), 26874 $temp$acc = A2($elm$core$List$cons, edge, acc); 26875 supply = $temp$supply; 26876 demand = $temp$demand; 26877 acc = $temp$acc; 26878 continue matchResiduals; 26879 default: 26880 var $temp$supply = A2( 26881 $elm$core$List$cons, 26882 _Utils_Tuple2(s, sAmt - take), 26883 restS), 26884 $temp$demand = restD, 26885 $temp$acc = A2($elm$core$List$cons, edge, acc); 26886 supply = $temp$supply; 26887 demand = $temp$demand; 26888 acc = $temp$acc; 26889 continue matchResiduals; 26890 } 26891 } 26892 } 26893 } 26894 }); 26895var $author$project$Domain$StableSettlement$mergeAmountDicts = F2( 26896 function (a, b) { 26897 return A3($elm$core$Dict$foldl, $author$project$Domain$StableSettlement$addAmount, a, b); 26898 }); 26899var $author$project$Domain$StableSettlement$applyVectorUpdate = F2( 26900 function (plan, delta0) { 26901 var edges0 = A2( 26902 $elm$core$List$map, 26903 function (t) { 26904 return _Utils_Tuple3(t.iH, t.kE, t.ef); 26905 }, 26906 plan); 26907 var _v0 = A2($author$project$Domain$StableSettlement$cancelDirectPairs, edges0, delta0); 26908 var edgesA = _v0.a; 26909 var deltaADict = _v0.b; 26910 var sortedDeltaA = $elm$core$Dict$toList(deltaADict); 26911 var payers = A2( 26912 $elm$core$List$filter, 26913 function (_v4) { 26914 var d = _v4.b; 26915 return d > 0; 26916 }, 26917 sortedDeltaA); 26918 var receivers = A2( 26919 $elm$core$List$filter, 26920 function (_v3) { 26921 var d = _v3.b; 26922 return d < 0; 26923 }, 26924 sortedDeltaA); 26925 var _v1 = A3( 26926 $elm$core$List$foldl, 26927 $author$project$Domain$StableSettlement$drainOutgoing, 26928 _Utils_Tuple3(edgesA, $elm$core$Dict$empty, $elm$core$Dict$empty), 26929 payers); 26930 var edgesP1 = _v1.a; 26931 var lostIncoming = _v1.b; 26932 var newCreditors = _v1.c; 26933 var _v2 = A3( 26934 $elm$core$List$foldl, 26935 $author$project$Domain$StableSettlement$drainIncoming, 26936 _Utils_Tuple3(edgesP1, $elm$core$Dict$empty, $elm$core$Dict$empty), 26937 receivers); 26938 var edgesP2 = _v2.a; 26939 var lostOutgoing = _v2.b; 26940 var newDebtors = _v2.c; 26941 var supply = $elm$core$Dict$toList( 26942 A2($author$project$Domain$StableSettlement$mergeAmountDicts, lostOutgoing, newDebtors)); 26943 var demand = $elm$core$Dict$toList( 26944 A2($author$project$Domain$StableSettlement$mergeAmountDicts, lostIncoming, newCreditors)); 26945 var bypassEdges = A3($author$project$Domain$StableSettlement$matchResiduals, supply, demand, _List_Nil); 26946 return $author$project$Domain$StableSettlement$consolidateEdges( 26947 _Utils_ap(edgesP2, bypassEdges)); 26948 }); 26949var $author$project$Domain$StableSettlement$balanceDelta = F2( 26950 function (anchor, current) { 26951 var netAt = F2( 26952 function (d, k) { 26953 return A2( 26954 $elm$core$Maybe$withDefault, 26955 0, 26956 A2( 26957 $elm$core$Maybe$map, 26958 function ($) { 26959 return $.e2; 26960 }, 26961 A2($elm$core$Dict$get, k, d))); 26962 }); 26963 var keys = A2( 26964 $elm$core$Set$union, 26965 $elm$core$Set$fromList( 26966 $elm$core$Dict$keys(anchor)), 26967 $elm$core$Set$fromList( 26968 $elm$core$Dict$keys(current))); 26969 return A3( 26970 $elm$core$Set$foldl, 26971 F2( 26972 function (k, acc) { 26973 var d = A2(netAt, current, k) - A2(netAt, anchor, k); 26974 return (!d) ? acc : A3($elm$core$Dict$insert, k, d, acc); 26975 }), 26976 $elm$core$Dict$empty, 26977 keys); 26978 }); 26979var $author$project$Domain$Settlement$largestCreditor = function (creditors) { 26980 return A3( 26981 $elm$core$List$foldl, 26982 F2( 26983 function (_v0, acc) { 26984 var cid = _v0.a; 26985 var amt = _v0.b; 26986 if (acc.$ === 1) { 26987 return $elm$core$Maybe$Just( 26988 _Utils_Tuple2(cid, amt)); 26989 } else { 26990 var _v2 = acc.a; 26991 var bestAmt = _v2.b; 26992 return (_Utils_cmp(amt, bestAmt) > 0) ? $elm$core$Maybe$Just( 26993 _Utils_Tuple2(cid, amt)) : acc; 26994 } 26995 }), 26996 $elm$core$Maybe$Nothing,
26997 creditors); 26998}; 26999var $author$project$Domain$Settlement$removeCreditor = F2( 27000 function (targetId, creditors) { 27001 return A2( 27002 $elm$core$List$filter, 27003 function (_v0) { 27004 var cid = _v0.a; 27005 return !_Utils_eq(cid, targetId); 27006 }, 27007 creditors); 27008 }); 27009var $author$project$Domain$Settlement$updateCreditor = F3( 27010 function (targetId, newAmt, creditors) { 27011 return A2( 27012 $elm$core$List$map, 27013 function (_v0) { 27014 var cid = _v0.a; 27015 var amt = _v0.b; 27016 return _Utils_eq(cid, targetId) ? _Utils_Tuple2(cid, newAmt) : _Utils_Tuple2(cid, amt); 27017 }, 27018 creditors); 27019 }); 27020var $author$project$Domain$Settlement$processGreedyPass = F2( 27021 function (debtors, creditors) { 27022 processGreedyPass: 27023 while (true) { 27024 if (!debtors.b) { 27025 return _Utils_Tuple3(_List_Nil, _List_Nil, creditors); 27026 } else { 27027 var _v1 = debtors.a; 27028 var debtorId = _v1.a; 27029 var debtorAmt = _v1.b; 27030 var restDebtors = debtors.b; 27031 if (debtorAmt <= 0) { 27032 var $temp$debtors = restDebtors, 27033 $temp$creditors = creditors; 27034 debtors = $temp$debtors; 27035 creditors = $temp$creditors; 27036 continue processGreedyPass; 27037 } else { 27038 var _v2 = $author$project$Domain$Settlement$largestCreditor(creditors); 27039 if (_v2.$ === 1) { 27040 return _Utils_Tuple3(_List_Nil, debtors, _List_Nil); 27041 } else { 27042 var _v3 = _v2.a; 27043 var creditorId = _v3.a; 27044 var creditorAmt = _v3.b; 27045 var transferAmt = A2($elm$core$Basics$min, debtorAmt, creditorAmt); 27046 var transaction = {ef: transferAmt, iH: debtorId, kE: creditorId}; 27047 var newDebtorAmt = debtorAmt - transferAmt; 27048 var updatedDebtors = (newDebtorAmt > 0) ? A2( 27049 $elm$core$List$cons, 27050 _Utils_Tuple2(debtorId, newDebtorAmt), 27051 restDebtors) : restDebtors; 27052 var newCreditorAmt = creditorAmt - transferAmt; 27053 var updatedCreditors = (newCreditorAmt > 0) ? A3($author$project$Domain$Settlement$updateCreditor, creditorId, newCreditorAmt, creditors) : A2($author$project$Domain$Settlement$removeCreditor, creditorId, creditors); 27054 var _v4 = A2($author$project$Domain$Settlement$processGreedyPass, updatedDebtors, updatedCreditors); 27055 var restTransactions = _v4.a; 27056 var finalDebtors = _v4.b; 27057 var finalCreditors = _v4.c; 27058 return _Utils_Tuple3( 27059 A2($elm$core$List$cons, transaction, restTransactions), 27060 finalDebtors, 27061 finalCreditors); 27062 } 27063 } 27064 } 27065 } 27066 }); 27067var $author$project$Domain$Settlement$findCreditor = F2( 27068 function (targetId, creditors) { 27069 findCreditor: 27070 while (true) { 27071 if (!creditors.b) { 27072 return $elm$core$Maybe$Nothing; 27073 } else { 27074 var _v1 = creditors.a; 27075 var cid = _v1.a; 27076 var amt = _v1.b; 27077 var rest = creditors.b; 27078 if (_Utils_eq(cid, targetId)) { 27079 return $elm$core$Maybe$Just(amt); 27080 } else { 27081 var $temp$targetId = targetId, 27082 $temp$creditors = rest; 27083 targetId = $temp$targetId; 27084 creditors = $temp$creditors; 27085 continue findCreditor; 27086 } 27087 } 27088 } 27089 }); 27090var $author$project$Domain$Settlement$matchWithPreferred = F4( 27091 function (debtorId, debtorAmt, preferredIds, creditors) { 27092 matchWithPreferred: 27093 while (true) { 27094 if (!preferredIds.b) { 27095 return _Utils_Tuple3(_List_Nil, debtorAmt, creditors); 27096 } else { 27097 var prefId = preferredIds.a; 27098 var restPrefs = preferredIds.b; 27099 if (debtorAmt <= 0) { 27100 return _Utils_Tuple3(_List_Nil, 0, creditors); 27101 } else { 27102 var _v1 = A2($author$project$Domain$Settlement$findCreditor, prefId, creditors); 27103 if (_v1.$ === 1) { 27104 var $temp$debtorId = debtorId, 27105 $temp$debtorAmt = debtorAmt, 27106 $temp$preferredIds = restPrefs, 27107 $temp$creditors = creditors; 27108 debtorId = $temp$debtorId; 27109 debtorAmt = $temp$debtorAmt; 27110 preferredIds = $temp$preferredIds; 27111 creditors = $temp$creditors; 27112 continue matchWithPreferred; 27113 } else { 27114 var creditorAmt = _v1.a; 27115 var transferAmt = A2($elm$core$Basics$min, debtorAmt, creditorAmt); 27116 var transaction = {ef: transferAmt, iH: debtorId, kE: prefId}; 27117 var newDebtorAmt = debtorAmt - transferAmt; 27118 var newCreditorAmt = creditorAmt - transferAmt; 27119 var updatedCreditors = (newCreditorAmt > 0) ? A3($author$project$Domain$Settlement$updateCreditor, prefId, newCreditorAmt, creditors) : A2($author$project$Domain$Settlement$removeCreditor, prefId, creditors); 27120 var _v2 = A4($author$project$Domain$Settlement$matchWithPreferred, debtorId, newDebtorAmt, restPrefs, updatedCreditors); 27121 var restTransactions = _v2.a; 27122 var finalAmt = _v2.b; 27123 var finalCreditors = _v2.c; 27124 return _Utils_Tuple3( 27125 A2($elm$core$List$cons, transaction, restTransactions), 27126 finalAmt, 27127 finalCreditors); 27128 } 27129 } 27130 } 27131 } 27132 }); 27133var $author$project$Domain$Settlement$processPreferencePass = F3( 27134 function (debtors, creditors, prefMap) { 27135 if (!debtors.b) { 27136 return _Utils_Tuple3(_List_Nil, _List_Nil, creditors); 27137 } else { 27138 var _v1 = debtors.a; 27139 var debtorId = _v1.a; 27140 var debtorAmt = _v1.b; 27141 var restDebtors = debtors.b; 27142 var preferredIds = A3( 27143 $elm$core$List$foldl, 27144 F2( 27145 function (_v4, acc) { 27146 var mid = _v4.a; 27147 var prefs = _v4.b; 27148 return _Utils_eq(mid, debtorId) ? prefs : acc; 27149 }), 27150 _List_Nil, 27151 prefMap); 27152 var _v2 = A4($author$project$Domain$Settlement$matchWithPreferred, debtorId, debtorAmt, preferredIds, creditors); 27153 var transactions = _v2.a; 27154 var remainingAmt = _v2.b; 27155 var updatedCreditors = _v2.c; 27156 var _v3 = A3($author$project$Domain$Settlement$processPreferencePass, restDebtors, updatedCreditors, prefMap); 27157 var restTransactions = _v3.a; 27158 var remainingDebtors = _v3.b; 27159 var finalCreditors = _v3.c; 27160 var allRemainingDebtors = (remainingAmt > 0) ? A2( 27161 $elm$core$List$cons, 27162 _Utils_Tuple2(debtorId, remainingAmt), 27163 remainingDebtors) : remainingDebtors; 27164 return _Utils_Tuple3( 27165 _Utils_ap(transactions, restTransactions), 27166 allRemainingDebtors, 27167 finalCreditors); 27168 } 27169 }); 27170var $author$project$Domain$Settlement$computeSettlement = F2( 27171 function (balances, preferences) { 27172 var prefMap = A3( 27173 $elm$core$List$foldl, 27174 F2( 27175 function (p, acc) { 27176 return A2( 27177 $elm$core$List$cons, 27178 _Utils_Tuple2(p.e$, p.pB), 27179 acc); 27180 }), 27181 _List_Nil, 27182 preferences); 27183 var _v0 = A3( 27184 $elm$core$Dict$foldl, 27185 F3( 27186 function (_v1, b, _v2) { 27187 var ds = _v2.a; 27188 var cs = _v2.b; 27189 return (b.e2 < 0) ? _Utils_Tuple2( 27190 A2( 27191 $elm$core$List$cons, 27192 _Utils_Tuple2( 27193 b.e$, 27194 $elm$core$Basics$abs(b.e2)), 27195 ds), 27196 cs) : ((b.e2 > 0) ? _Utils_Tuple2( 27197 ds, 27198 A2( 27199 $elm$core$List$cons, 27200 _Utils_Tuple2(b.e$, b.e2), 27201 cs)) : _Utils_Tuple2(ds, cs)); 27202 }), 27203 _Utils_Tuple2(_List_Nil, _List_Nil), 27204 balances); 27205 var debtors = _v0.a; 27206 var creditors = _v0.b; 27207 var debtorsWithPrefs = A2( 27208 $elm$core$List$sortBy, 27209 $elm$core$Tuple$second, 27210 A2( 27211 $elm$core$List$filter, 27212 function (_v6) { 27213 var mid = _v6.a; 27214 return A2( 27215 $elm$core$List$any, 27216 function (p) { 27217 return _Utils_eq(p.e$, mid); 27218 }, 27219 preferences); 27220 }, 27221 debtors)); 27222 var _v3 = A3($author$project$Domain$Settlement$processPreferencePass, debtorsWithPrefs, creditors, prefMap); 27223 var pass1Transactions = _v3.a; 27224 var remainingDebtors1 = _v3.b; 27225 var remainingCreditors1 = _v3.c; 27226 var debtorsWithoutPrefs = A2( 27227 $elm$core$List$filter, 27228 function (_v5) { 27229 var mid = _v5.a; 27230 return !A2( 27231 $elm$core$List$any, 27232 function (p) { 27233 return _Utils_eq(p.e$, mid); 27234 }, 27235 preferences); 27236 }, 27237 debtors); 27238 var allRemainingDebtors = $elm$core$List$reverse( 27239 A2( 27240 $elm$core$List$sortBy, 27241 $elm$core$Tuple$second, 27242 _Utils_ap(remainingDebtors1, debtorsWithoutPrefs))); 27243 var _v4 = A2($author$project$Domain$Settlement$processGreedyPass, allRemainingDebtors, remainingCreditors1); 27244 var pass2Transactions = _v4.a; 27245 return _Utils_ap(pass1Transactions, pass2Transactions); 27246 }); 27247var $author$project$Domain$StableSettlement$stablePlan = F3( 27248 function (anchorBalances, preferences, currentBalances) { 27249 var delta = A2($author$project$Domain$StableSettlement$balanceDelta, anchorBalances, currentBalances); 27250 var anchorPlan = A2($author$project$Domain$Settlement$computeSettlement, anch
27250orBalances, preferences); 27251 return A2($author$project$Domain$StableSettlement$applyVectorUpdate, anchorPlan, delta); 27252 }); 27253var $author$project$Domain$FeedbackMoment$topAuthor = F2( 27254 function (state, entries) { 27255 var counts = A2( 27256 $elm$core$List$sortBy, 27257 A2($elm$core$Basics$composeR, $elm$core$Tuple$second, $elm$core$Basics$negate), 27258 $elm$core$Dict$toList( 27259 A3( 27260 $elm$core$List$foldl, 27261 F2( 27262 function (entry, acc) { 27263 var _v5 = A2($author$project$Domain$GroupState$resolveMemberRootId, state, entry.gM.f3); 27264 if (!_v5.$) { 27265 var rootId = _v5.a; 27266 return A3( 27267 $elm$core$Dict$update, 27268 rootId, 27269 function (count) { 27270 return $elm$core$Maybe$Just( 27271 A2($elm$core$Maybe$withDefault, 0, count) + 1); 27272 }, 27273 acc); 27274 } else { 27275 return acc; 27276 } 27277 }), 27278 $elm$core$Dict$empty, 27279 entries))); 27280 if (counts.b) { 27281 if (counts.b.b) { 27282 var _v1 = counts.a; 27283 var winner = _v1.a; 27284 var count = _v1.b; 27285 var _v2 = counts.b; 27286 var _v3 = _v2.a; 27287 var runnerUp = _v3.b; 27288 return (_Utils_cmp(count, runnerUp) > 0) ? $elm$core$Maybe$Just(winner) : $elm$core$Maybe$Nothing; 27289 } else { 27290 var _v4 = counts.a; 27291 var winner = _v4.a; 27292 return $elm$core$Maybe$Just(winner); 27293 } 27294 } else { 27295 return $elm$core$Maybe$Nothing; 27296 } 27297 }); 27298var $author$project$Domain$FeedbackMoment$detect = F2( 27299 function (_v0, state) { 27300 var now = _v0.cH; 27301 var selfRootId = _v0.p8; 27302 var justAddedTransfer = _v0.ny; 27303 var members = $author$project$Domain$GroupState$activeMembers(state); 27304 var entries = $author$project$Domain$GroupState$activeEntries(state); 27305 if ((!A2( 27306 $elm$core$List$any, 27307 function (member) { 27308 return _Utils_eq(member.aj, selfRootId); 27309 }, 27310 members)) || (!A2($author$project$Domain$FeedbackMoment$isFresh, now, entries))) { 27311 return $elm$core$Maybe$Nothing; 27312 } else { 27313 var plan = $elm$core$List$length( 27314 A3($author$project$Domain$StableSettlement$stablePlan, state.lp, state.qb, state.ly)); 27315 var isCreator = _Utils_eq( 27316 A2( 27317 $elm$core$Maybe$andThen, 27318 $author$project$Domain$GroupState$resolveMemberRootId(state), 27319 state.f3), 27320 $elm$core$Maybe$Just(selfRootId)); 27321 var entryCount = $elm$core$List$length(entries); 27322 var claimed = $elm$core$List$length( 27323 A2( 27324 $elm$core$List$filter, 27325 function (member) { 27326 return !member.nL; 27327 }, 27328 members)); 27329 return (isCreator && ((claimed >= 4) && ((entryCount >= 10) && ((!plan) && A2( 27330 $elm$core$List$any, 27331 function (member) { 27332 return member.nL === 1; 27333 }, 27334 members))))) ? $elm$core$Maybe$Just(2) : ((justAddedTransfer && ((claimed >
27334= 5) && ((entryCount >= 10) && (_Utils_cmp(plan, ((claimed + 4) / 5) | 0) < 1)))) ? $elm$core$Maybe$Just(0) : (((claimed >= 5) && ((_Utils_cmp(entryCount, $author$project$Domain$FeedbackMoment$prolificEntries) > -1) && _Utils_eq( 27335 A2($author$project$Domain$FeedbackMoment$topAuthor, state, entries), 27336 $elm$core$Maybe$Just(selfRootId)))) ? $elm$core$Maybe$Just(1) : $elm$core$Maybe$Nothing)); 27337 } 27338 }); 27339var $author$project$Page$Group$feedbackOutputs = F3( 27340 function (config, justAddedTransfer, model) { 27341 var _v0 = model.a; 27342 if (_v0.$ === 4) { 27343 var loaded = _v0.a; 27344 var _v1 = A2($author$project$Page$Group$currentUserRootId, model, loaded); 27345 if (!_v1.$) { 27346 var selfRootId = _v1.a; 27347 return A2( 27348 $elm$core$Maybe$withDefault, 27349 _List_Nil, 27350 A2( 27351 $elm$core$Maybe$map, 27352 A2( 27353 $elm$core$Basics$composeR, 27354 $author$project$Page$Group$RequestFeedback(loaded.bA.m9), 27355 $elm$core$List$singleton), 27356 A2( 27357 $author$project$Domain$FeedbackMoment$detect, 27358 {ny: justAddedTransfer, cH: config.ap, p8: selfRootId}, 27359 loaded.a6))); 27360 } else { 27361 return _List_Nil; 27362 } 27363 } else { 27364 return _List_Nil; 27365 } 27366 }); 27367var $author$project$Page$Group$isTransferAdded = function (envelope) { 27368 var _v0 = envelope.jC; 27369 if (_v0.$ === 7) { 27370 var entry = _v0.a; 27371 var _v1 = entry.gE; 27372 if (_v1.$ === 1) { 27373 return true; 27374 } else { 27375 return false; 27376 } 27377 } else { 27378 return false; 27379 } 27380}; 27381var $author$project$Page$Group$OnSummaryMutationCompleted = F2( 27382 function (a, b) { 27383 return {$: 22, a: a, b: b}; 27384 }); 27385var $author$project$IndexedDb$getKeysByIndex = F4( 27386 function (db, store, index, range) { 27387 return $andrewMacmurray$elm_concurrent_task$ConcurrentTask$define( 27388 { 27389 k: $elm$json$Json$Encode$object( 27390 _List_fromArray( 27391 [ 27392 _Utils_Tuple2( 27393 'db', 27394 $elm$json$Json$Encode$string( 27395 $author$project$IndexedDb$getDbName(db))), 27396 _Utils_Tuple2( 27397 'store', 27398 $elm$json$Json$Encode$string( 27399 $author$project$IndexedDb$getStoreName(store))), 27400 _Utils_Tuple2( 27401 'index', 27402 $elm$json$Json$Encode$string( 27403 $author$project$IndexedDb$getIndexName(index))), 27404 _Utils_Tuple2( 27405 'range', 27406 $author$project$IndexedDb$encodeKeyRange(range)) 27407 ])), 27408 l: $andrewMacmurray$elm_concurrent_task$ConcurrentTask$expectErrors($author$project$IndexedDb$errorDecoder), 27409 m: $andrewMacmurray$elm_concurrent_task$ConcurrentTask$expectJson( 27410 $elm$json$Json$Decode$list($author$project$IndexedDb$keyDecoder)), 27411 n: 'indexeddb:getAllKeys' 27412 }); 27413 }); 27414var $author$project$Infra$Storage$deleteGroup = F2( 27415 function (db, groupId) { 27416 return A2( 27417 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$map, 27418 function (_v1) { 27419 return 0; 27420 }, 27421 A2( 27422 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$andThen, 27423 function (_v0) { 27424 return $andrewMacmurray$elm_concurrent_task$ConcurrentTask$batch( 27425 _List_fromArray( 27426 [ 27427 A3( 27428 $author$project$IndexedDb$delete, 27429 db, 27430 $author$project$Infra$Storage$groupKeysStore, 27431 $author$project$IndexedDb$StringKey(groupId)), 27432 A3( 27433 $author$project$IndexedDb$delete, 27434 db, 27435 $author$project$Infra$Storage$syncCursorsStore, 27436 $author$project$IndexedDb$StringKey(groupId)), 27437 A3( 27438 $author$project$IndexedDb$delete, 27439 db, 27440 $author$project$Infra$Storage$tamperSignalsStore, 27441 $author$project$IndexedDb$StringKey(groupId)), 27442 A3( 27443 $author$project$IndexedDb$delete, 27444 db, 27445 $author$project$Infra$Storage$suspicionDismissalsStore, 27446 $author$project$IndexedDb$StringKey(groupId)), 27447 A3( 27448 $author$project$IndexedDb$delete, 27449 db, 27450 $author$project$Infra$Storage$notifyTopicsStore, 27451 $author$project$IndexedDb$StringKey(groupId)), 27452 A3( 27453 $author$project$IndexedDb$delete, 27454 db, 27455 $author$project$Infra$Storage$activityMarkersStore, 27456 $author$project$IndexedDb$StringKey(groupId)), 27457 A2( 27458 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$andThen, 27459 function (keys) { 27460 return A3($author$project$IndexedDb$deleteMany, db, $author$project$Infra$Storage$eventsStore, keys); 27461 }, 27462 A4( 27463 $author$project$IndexedDb$getKeysByIndex, 27464 db, 27465 $author$project$Infra$Storage$eventsStore, 27466 $author$project$Infra$Storage$byGroupIdIndex, 27467 $author$project$IndexedDb$only( 27468 $author$project$IndexedDb$StringKey(groupId)))) 27469 ])); 27470 }, 27471 A3( 27472 $author$project$IndexedDb$delete, 27473 db, 27474 $author$project$Infra$Storage$groupsStore, 27475 $author$project$IndexedDb$StringKey(groupId)))); 27476 }); 27477var $author$project$Page$Group$summaryOperationTask = F2( 27478 function (db, operation) { 27479 switch (operation.$) { 27480 case 0: 27481 var summary = operation.a; 27482 return A2( 27483 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$map, 27484 function (_v1) { 27485 return 0; 27486 }, 27487 A2($author$project$Infra$Storage$saveGroupSummary, db, summary)); 27488 case 1: 27489 var summary = operation.b; 27490 return A2( 27491 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$map, 27492 function (_v2) { 27493 return 0; 27494 }, 27495 A2($author$project$Infra$Storage$saveGroupSummary, db, summary)); 27496 default: 27497 var groupId = operation.a; 27498 return A2($author$project$Infra$Storage$deleteGroup, db, groupId); 27499 } 27500 }); 27501var $author$project$Page$Group$runSummaryOperation = F4( 27502 function (config, groupId, mutation, model) { 27503 return A2( 27504 $elm$core$Tuple$mapFirst, 27505 function (runner) { 27506 return _Utils_update( 27507 model, 27508 { 27509 ak: runner, 27510 V: A3($elm$core$Dict$insert, groupId, mutation, model.V) 27511 }); 27512 }, 27513 A3( 27514 $author$project$Infra$ConcurrentTaskExtra$andRun, 27515 $author$project$Page$Group$OnSummaryMutationCompleted(groupId), 27516 A2($author$project$Page$Group$summaryOperationTask, config.de, mutation.ai), 27517 _Utils_Tuple2(model.ak, $elm$core$Platform$Cmd$none))); 27518 }); 27519var $author$project$Page$Group$summaryOperationGroupId = function (operation) { 27520 switch (operation.$) { 27521 case 0: 27522 var summary = operation.a; 27523 return summary.m9; 27524 case 1: 27525 var summary = operation.b; 27526 return summary.m9; 27527 default: 27528 var groupId = operation.a; 27529 return groupId; 27530 } 27531}; 27532var $author$project$Page$Group$queueSummaryOperation = F3( 27533 function (config, operation, model) { 27534 var groupId = $author$project$Page$Group$summaryOperationGroupId(operation); 27535 var _v0 = A2($elm$core$Dict$get, groupId, model.V); 27536 if (_v0.$ === 1) { 27537 return A4( 27538 $author$project$Page$Group$runSummaryOperation, 27539 config, 27540 groupId, 27541 {U: operation, ai: operation}, 27542 model); 27543 } else { 27544 var mutation = _v0.a; 27545 var _v1 = mutation.U; 27546 if (_v1.$ === 2) { 27547 return _Utils_Tuple2(model, $elm$core$Platform$Cmd$none); 27548 } else { 27549 return _Utils_Tuple2( 27550 _Utils_update( 27551 model, 27552 { 27553 V: A3( 27554 $elm$core$Dict$insert, 27555 groupId, 27556 _Utils_update( 27557 mutation, 27558 {U: operation}), 27559 model.V) 27560 }), 27561 $elm$core$Platform$Cmd$none); 27562 } 27563 } 27564 }); 27565var $author$project$Page$Group$syncGroupSummaryName = F3( 27566 function (config, groupId, model) { 27567 var _v0 = model.a; 27568 if (_v0.$ === 4) { 27569 var loaded = _v0.a; 27570 var updatedSummary = { 27571 f2: loaded.a6.iO.f2, 27572 il: loaded.bA.il, 27573 m9: groupId, 27574 gA: loaded.bA.gA, 27575 gC: loaded.bA.gC, 27576 gF: config.ap, 27577 gL: $elm$core$Dict$size(loaded.a6.r), 27578 gS: A2( 27579 $elm$core$Maybe$withDefault, 27580 0, 27581 A2( 27582 $elm$core$Maybe$map, 27583 function ($) { 27584 return $.e2; 27585 }, 27586 A2( 27587 $elm$core$Maybe$andThen, 27588 function (rid) { 27589 return A2($elm$core$Dict$get, rid, loaded.a6.ly); 27590 }, 27591 A2($author$project$Page$Group$currentUserRootId, model, loaded)))), 27592 bW: loaded.a6.iO.bW 27593 }; 27594 var updatedModel = _Utils_update( 27595 model, 27596 {
27597 a: $author$project$Page$Group$WorkspaceLoaded( 27598 _Utils_update( 27599 loaded, 27600 {bA: updatedSummary})) 27601 }); 27602 return function (_v1) { 27603 var queuedModel = _v1.a; 27604 var cmd = _v1.b; 27605 return _Utils_Tuple3( 27606 queuedModel, 27607 cmd, 27608 _List_fromArray( 27609 [ 27610 $author$project$Page$Group$UpdateGroupSummary(updatedSummary) 27611 ])); 27612 }( 27613 A3( 27614 $author$project$Page$Group$queueSummaryOperation, 27615 config, 27616 $author$project$Page$Group$SaveSummary(updatedSummary), 27617 updatedModel)); 27618 } else { 27619 return _Utils_Tuple3(model, $elm$core$Platform$Cmd$none, _List_Nil); 27620 } 27621 }); 27622var $author$project$Page$Group$applyAndSync = F4( 27623 function (config, groupId, envelope, model) { 27624 return A2( 27625 $elm$core$Maybe$map, 27626 function (m) { 27627 var _v0 = A3($author$project$Page$Group$syncGroupSummaryName, config, groupId, m); 27628 var summaryModel = _v0.a; 27629 var summaryCmd = _v0.b; 27630 var summaryOutputs = _v0.c; 27631 var _v1 = A3($author$project$Page$Group$triggerSyncInternal, config, groupId, summaryModel); 27632 var syncModel = _v1.a; 27633 var syncCmd = _v1.b; 27634 return _Utils_Tuple3( 27635 syncModel, 27636 $elm$core$Platform$Cmd$batch( 27637 _List_fromArray( 27638 [summaryCmd, syncCmd])), 27639 _Utils_ap( 27640 summaryOutputs, 27641 A3( 27642 $author$project$Page$Group$feedbackOutputs, 27643 config, 27644 $author$project$Page$Group$isTransferAdded(envelope), 27645 syncModel))); 27646 }, 27647 A2( 27648 $elm$core$Maybe$map, 27649 $author$project$Page$Group$addUnpushedIdToModel(envelope.m9), 27650 A3($author$project$Page$Group$appendEventAndRecompute, model, groupId, envelope))); 27651 }); 27652var $author$project$GroupOps$initLoadedGroup = F7( 27653 function (events, summary, key, cursor, unpushed, tamperSignals, suspicionDismissals) { 27654 return { 27655 iC: $elm$core$List$reverse(events), 27656 gs: key, 27657 a6: A2($author$project$Domain$GroupState$applyEvents, events, $author$project$Domain$GroupState$empty), 27658 bA: summary, 27659 kw: suspicionDismissals, 27660 cZ: cursor, 27661 c_: tamperSignals, 27662 bC: unpushed, 27663 kP: $elm$core$Set$empty 27664 }; 27665 }); 27666var $author$project$Page$Group$applyLoadedGroup = F8( 27667 function (groupId, events, groupKey, syncCursor, unpushedIds, tamperSignals, suspicionDismissals, model) { 27668 var _v0 = model.a; 27669 if (_v0.$ === 2) { 27670 var summary = _v0.a; 27671 return _Utils_eq(summary.m9, groupId) ? $elm$core$Maybe$Just( 27672 _Utils_update( 27673 model, 27674 { 27675 a: $author$project$Page$Group$WorkspaceLoaded( 27676 A7($author$project$GroupOps$initLoadedGroup, events, summary, groupKey, syncCursor, unpushedIds, tamperSignals, suspicionDismissals)) 27677 })) : $elm$core$Maybe$Nothing; 27678 } else { 27679 return $elm$core$Maybe$Nothing; 27680 } 27681 }); 27682var $author$project$GroupOps$orderDependent = F2( 27683 function (a, b) { 27684 var _v0 = _Utils_Tuple2(a, b); 27685 _v0$19: 27686 while (true) { 27687 switch (_v0.a.$) { 27688 case 2: 27689 if (_v0.b.$ === 2) { 27690 var r1 = _v0.a.a; 27691 var r2 = _v0.b.a; 27692 return _Utils_eq(r1.aj, r2.aj); 27693 } else { 27694 break _v0$19; 27695 } 27696 case 3: 27697 if (_v0.b.$ === 4) { 27698 var r1 = _v0.a.a; 27699 var r2 = _v0.b.a; 27700 return _Utils_eq(r1.aj, r2.aj); 27701 } else { 27702 break _v0$19; 27703 } 27704 case 6: 27705 if (_v0.b.$ === 6) { 27706 var r1 = _v0.a.a; 27707 var r2 = _v0.b.a; 27708 return _Utils_eq(r1.aj, r2.aj); 27709 } else { 27710 break _v0$19; 27711 } 27712 case 12: 27713 if (_v0.b.$ === 12) { 27714 return true; 27715 } else { 27716 break _v0$19; 27717 } 27718 case 11: 27719 switch (_v0.b.$) { 27720 case 11: 27721 return true; 27722 case 12: 27723 return true; 27724 default: 27725 break _v0$19; 27726 } 27727 case 13: 27728 if (_v0.b.$ === 13) { 27729 var r1 = _v0.a.a; 27730 var r2 = _v0.b.a; 27731 return _Utils_eq(r1.e$, r2.e$); 27732 } else { 27733 break _v0$19; 27734 } 27735 case 9: 27736 if (_v0.b.$ === 10) { 27737 var r1 = _v0.a.a; 27738 var r2 = _v0.b.a; 27739 return _Utils_eq(r1.aj, r2.aj); 27740 } else { 27741 break _v0$19; 27742 } 27743 case 8: 27744 switch (_v0.b.$) { 27745 case 9: 27746 var e1 = _v0.a.a; 27747 var r2 = _v0.b.a; 27748 return _Utils_eq(e1.gM.aj, r2.aj); 27749 case 10: 27750 var e1 = _v0.a.a; 27751 var r2 = _v0.b.a; 27752 return _Utils_eq(e1.gM.aj, r2.aj); 27753 case 8: 27754 var e1 = _v0.a.a; 27755 var e2 = _v0.b.a; 27756 return _Utils_eq(e1.gM.aj, e2.gM.aj); 27757 default: 27758 break _v0$19; 27759 } 27760 case 7: 27761 switch (_v0.b.$) { 27762 case 8: 27763 var e1 = _v0.a.a; 27764 var e2 = _v0.b.a; 27765 return _Utils_eq(e1.gM.aj, e2.gM.aj); 27766 case 9: 27767 var e1 = _v0.a.a; 27768 var r2 = _v0.b.a; 27769 return _Utils_eq(e1.gM.aj, r2.aj); 27770 case 10: 27771 var e1 = _v0.a.a; 27772 var r2 = _v0.b.a; 27773 return _Utils_eq(e1.gM.aj, r2.aj); 27774 default: 27775 break _v0$19; 27776 } 27777 case 1: 27778 switch (_v0.b.$) { 27779 case 2: 27780 var m1 = _v0.a.a; 27781 var r2 = _v0.b.a; 27782 return _Utils_eq(m1.e_, r2.aj); 27783 case 3: 27784 var m1 = _v0.a.a; 27785 var r2 = _v0.b.a; 27786 return _Utils_eq(m1.e_, r2.aj); 27787 case 4: 27788 var m1 = _v0.a.a; 27789 var r2 = _v0.b.a; 27790 return _Utils_eq(m1.e_, r2.aj); 27791 case 6: 27792 var m1 = _v0.a.a; 27793 var r2 = _v0.b.a; 27794 return _Utils_eq(m1.e_, r2.aj); 27795 case 5: 27796 var m1 = _v0.a.a; 27797 var l2 = _v0.b.a; 27798 return _Utils_eq(m1.e_, l2.aj); 27799 default: 27800 break _v0$19; 27801 } 27802 default: 27803 break _v0$19; 27804 } 27805 } 27806 return false;
27807 }); 27808var $author$project$GroupOps$areConflicting = F2( 27809 function (a, b) { 27810 return A2($author$project$GroupOps$orderDependent, a.jC, b.jC) || A2($author$project$GroupOps$orderDependent, b.jC, a.jC); 27811 }); 27812var $author$project$GroupOps$hasConflicts = F2( 27813 function (newEvents, overlapEvents) { 27814 return A2( 27815 $elm$core$List$any, 27816 function (_new) { 27817 return A2( 27818 $elm$core$List$any, 27819 $author$project$GroupOps$areConflicting(_new), 27820 overlapEvents); 27821 }, 27822 newEvents); 27823 }); 27824var $author$project$GroupOps$mergeEventsHelp = F3( 27825 function (xs, ys, acc) { 27826 mergeEventsHelp: 27827 while (true) { 27828 var _v0 = _Utils_Tuple2(xs, ys); 27829 if (!_v0.a.b) { 27830 return _Utils_ap( 27831 $elm$core$List$reverse(acc), 27832 ys); 27833 } else { 27834 if (!_v0.b.b) { 27835 return _Utils_ap( 27836 $elm$core$List$reverse(acc), 27837 xs); 27838 } else { 27839 var _v1 = _v0.a; 27840 var x = _v1.a; 27841 var xr = _v1.b; 27842 var _v2 = _v0.b; 27843 var y = _v2.a; 27844 var yr = _v2.b; 27845 var _v3 = A2($author$project$Domain$Event$compareEnvelopes, x, y); 27846 if (!_v3) { 27847 var $temp$xs = xs, 27848 $temp$ys = yr, 27849 $temp$acc = A2($elm$core$List$cons, y, acc); 27850 xs = $temp$xs; 27851 ys = $temp$ys; 27852 acc = $temp$acc; 27853 continue mergeEventsHelp; 27854 } else { 27855 var $temp$xs = xr, 27856 $temp$ys = ys, 27857 $temp$acc = A2($elm$core$List$cons, x, acc); 27858 xs = $temp$xs; 27859 ys = $temp$ys; 27860 acc = $temp$acc; 27861 continue mergeEventsHelp; 27862 } 27863 } 27864 } 27865 } 27866 }); 27867var $author$project$GroupOps$mergeEventsNewestFirst = F2( 27868 function (xs, ys) { 27869 return A3($author$project$GroupOps$mergeEventsHelp, xs, ys, _List_Nil); 27870 }); 27871var $author$project$Domain$TamperSignals$recordForgedAuthors = F3( 27872 function (authors, at, s) { 27873 if (!authors.b) { 27874 return s; 27875 } else { 27876 return _Utils_update( 27877 s, 27878 { 27879 bm: A3( 27880 $elm$core$List$foldl, 27881 F2( 27882 function (a, d) { 27883 return A3( 27884 $elm$core$Dict$update, 27885 a, 27886 function (c) { 27887 return $elm$core$Maybe$Just( 27888 A2($elm$core$Maybe$withDefault, 0, c) + 1); 27889 }, 27890 d); 27891 }), 27892 s.bm, 27893 authors), 27894 bT: $elm$core$Maybe$Just(at) 27895 }); 27896 } 27897 }); 27898var $author$project$Domain$TamperSignals$recordResetWithLoss = F2( 27899 function (at, s) { 27900 return _Utils_update( 27901 s, 27902 { 27903 bT: $elm$core$Maybe$Just(at), 27904 cP: s.cP + 1 27905 }); 27906 }); 27907var $author$project$GroupOps$applySyncResult = F4( 27908 function (now, pushedIds, syncResult, loaded) { 27909 var pullResult = syncResult.pF; 27910 var existingIds = $elm$core$Set$fromList( 27911 A2( 27912 $elm$core$List$map, 27913 function ($) { 27914 return $.m9; 27915 }, 27916 loaded.iC)); 27917 var lostOnReset = pullResult.mk ? A2( 27918 $elm$core$Set$diff, 27919 existingIds, 27920 $elm$core$Set$fromList( 27921 A2( 27922 $elm$core$List$map, 27923 function ($) { 27924 return $.m9; 27925 }, 27926 pullResult.iC))) : $elm$core$Set$empty; 27927 var remainingUnpushedIds = A2( 27928 $elm$core$Set$union, 27929 A2($elm$core$Set$diff, loaded.bC, pushedIds), 27930 lostOnReset); 27931 var tamperSignals = ($elm$core$Set$isEmpty(lostOnReset) ? $elm$core$Basics$identity : $author$project$Domain$TamperSignals$recordResetWithLoss(now))( 27932 A3($author$project$Domain$TamperSignals$recordForgedAuthors, pullResult.bm, now, loaded.c_)); 27933 var newEvents = A2( 27934 $elm$core$List$filter, 27935 function (e) { 27936 return !A2($elm$core$Set$member, e.m9, existingIds); 27937 }, 27938 pullResult.iC); 27939 var sortedNewEvents = $author$project$Domain$Event$sortEvents(newEvents); 27940 var mergedEventsNewestFirst = A2( 27941 $author$project$GroupOps$mergeEventsNewestFirst, 27942 $elm$core$List$reverse(sortedNewEvents), 27943 loaded.iC); 27944 var oldestNewTimestamp = A2( 27945 $elm$core$Maybe$map, 27946 A2( 27947 $elm$core$Basics$composeR, 27948 function ($) { 27949 return $.lT; 27950 }, 27951 $elm$time$Time$posixToMillis), 27952 $elm$core$List$head(sortedNewEvents)); 27953 var overlapEvents = function () { 27954 if (!oldestNewTimestamp.$) { 27955 var ts = oldestNewTimestamp.a; 27956 return A2( 27957 $elm$core$List$filter, 27958 function (e) { 27959 return _Utils_cmp( 27960 $elm$time$Time$posixToMillis(e.lT), 27961 ts) > -1; 27962 }, 27963 loaded.iC); 27964 } else { 27965 return _List_Nil; 27966 } 27967 }(); 27968 var needsRebuild = A2($author$project$GroupOps$hasConflicts, sortedNewEvents, overlapEvents); 27969 var updatedGroupState = needsRebuild ? A2( 27970 $author$project$Domain$GroupState$applyEvents, 27971 $elm$core$List$reverse(mergedEventsNewestFirst), 27972 $author$project$Domain$GroupState$empty) : A2($author$project$Domain$GroupState$applyEvents, sortedNewEvents, loaded.a6); 27973 return { 27974 fN: A2( 27975 $elm$core$List$filter, 27976 function (e) { 27977 return A2($elm$core$Set$member, e.m9, pushedIds) && (!A2($elm$core$Set$member, e.m9, remainingUnpushedIds)); 27978 }, 27979 loaded.iC), 27980 gU: sortedNewEvents, 27981 g5: {mt: pullResult.mt, kg: pullResult.ij}, 27982 g9: A2( 27983 $elm$core$List$filter, 27984 function (e) { 27985 return A2($elm$core$Set$member, e.m9, lostOnReset); 27986 }, 27987 loaded.iC), 27988 d9: _Utils_update( 27989 loaded, 27990 { 27991 iC: mergedEventsNewestFirst, 27992 a6: updatedGroupState, 27993 cZ: $elm$core$Maybe$Just( 27994 {mt: pullResult.mt, kg: pullResult.ij}), 27995 c_: tamperSignals, 27996 bC: remainingUnpushedIds 27997 }) 27998 }; 27999 }); 28000var $author$project$GroupOps$ApproveProposals = function (a) { 28001 return {$: 1, a: a}; 28002}; 28003var $author$project$GroupOps$ExecutedCompaction = function (a) { 28004 return {$: 3, a: a}; 28005}; 28006var $author$project$GroupOps$ProposalReady = function (a) { 28007 return {$: 2, a: a}; 28008}; 28009var $author$project$Infra$Server$CompactRaced = {$: 1}; 28010var $author$project$Infra$Server$dedupById = function (envelopes
28010) { 28011 return $elm$core$List$reverse( 28012 A3( 28013 $elm$core$List$foldl, 28014 F2( 28015 function (envelope, _v0) { 28016 var seen = _v0.a; 28017 var kept = _v0.b; 28018 return A2($elm$core$Set$member, envelope.m9, seen) ? _Utils_Tuple2(seen, kept) : _Utils_Tuple2( 28019 A2($elm$core$Set$insert, envelope.m9, seen), 28020 A2($elm$core$List$cons, envelope, kept)); 28021 }), 28022 _Utils_Tuple2($elm$core$Set$empty, _List_Nil), 28023 envelopes).b); 28024}; 28025var $author$project$Infra$Server$Compacted = function (a) { 28026 return {$: 0, a: a}; 28027}; 28028var $author$project$Infra$Server$postCompact = F4( 28029 function (ctx, secret, _v0, records) { 28030 var uptoSeq = _v0.kR; 28031 var expectedCount = _v0.iE; 28032 return A2( 28033 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$onError, 28034 function (err) { 28035 return $author$project$Infra$Server$isConflict(err) ? $andrewMacmurray$elm_concurrent_task$ConcurrentTask$succeed($author$project$Infra$Server$CompactRaced) : $andrewMacmurray$elm_concurrent_task$ConcurrentTask$fail(err); 28036 }, 28037 A2( 28038 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$map, 28039 $author$project$Infra$Server$Compacted, 28040 A2( 28041 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$mapError, 28042 $author$project$Infra$Server$HttpError, 28043 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$Http$post( 28044 { 28045 fY: $andrewMacmurray$elm_concurrent_task$ConcurrentTask$Http$jsonBody( 28046 $elm$json$Json$Encode$object( 28047 _List_fromArray( 28048 [ 28049 _Utils_Tuple2( 28050 'uptoSeq', 28051 $elm$json$Json$Encode$int(uptoSeq)), 28052 _Utils_Tuple2( 28053 'expectedCount', 28054 $elm$json$Json$Encode$int(expectedCount)), 28055 _Utils_Tuple2( 28056 'records', 28057 A2($elm$json$Json$Encode$list, $elm$core$Basics$identity, records)) 28058 ]))), 28059 m: $andrewMacmurray$elm_concurrent_task$ConcurrentTask$Http$expectJson( 28060 A2($elm$json$Json$Decode$field, 'maxSeq', $elm$json$Json$Decode$int)), 28061 mY: _List_fromArray( 28062 [ 28063 $author$project$Infra$Server$authHeader(secret) 28064 ]), 28065 qQ: $elm$core$Maybe$Nothing, 28066 kS: ctx.hl + ('/api/groups/' + (ctx.ct + '/compact')) 28067 })))); 28068 }); 28069var $author$project$Infra$Server$compact = F3( 28070 function (ctx, actorId, prefix) { 28071 var manifestIds = $elm$core$Set$fromList( 28072 A2( 28073 $elm$core$List$map, 28074 function ($) { 28075 return $.m9; 28076 }, 28077 prefix)); 28078 return A2( 28079 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$andThen, 28080 function (secret) { 28081 return A2( 28082 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$andThen, 28083 function (records) { 28084 var _v0 = $elm$core$List$maximum( 28085 A2( 28086 $elm$core$List$map, 28087 function ($) { 28088 return $.kg; 28089 }, 28090 records)); 28091 if (_v0.$ === 1) { 28092 return $andrewMacmurray$elm_concurrent_task$ConcurrentTask$succeed($author$project$Infra$Server$CompactRaced); 28093 } else { 28094 var uptoSeq = _v0.a; 28095 var riders = $author$project$Domain$Event$sortEvents( 28096 $author$project$Infra$Server$dedupById( 28097 A2( 28098 $elm$core$List$filter, 28099 function (e) { 28100 return !A2($elm$core$Set$member, e.m9, manifestIds); 28101 }, 28102 A2( 28103 $elm$core$List$concatMap, 28104 function ($) { 28105 return $.iC; 28106 }, 28107 records)))); 28108 return A2( 28109 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$andThen, 28110 A3( 28111 $author$project$Infra$Server$postCompact, 28112 ctx, 28113 secret, 28114 { 28115 iE: $elm$core$List$length(records), 28116 kR: uptoSeq 28117 }), 28118 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$batch( 28119 A2( 28120 $elm$core$List$map, 28121 A2($author$project$Infra$Server$packRecord, ctx.gs, actorId), 28122 _Utils_ap( 28123 A2($author$project$Domain$Compaction$chunkEnvelopes, $author$project$Infra$Server$maxChunkBytes, prefix), 28124 A2($author$project$Domain$Compaction$chunkEnvelopes, $author$project$Infra$Server$maxChunkBytes, riders))))); 28125 } 28126 }, 28127 A4($author$project$Infra$Server$pullTaggedRecords, ctx, secret, 0, _List_Nil)); 28128 }, 28129 A2( 28130 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$mapError, 28131 $author$project$Infra$Server$CryptoError, 28132 $author$project$Infra$Crypto$deriveRelaySecret(ctx.gs))); 28133 }); 28134var $author$project$Domain$Compaction$pendingApprovals = F3( 28135 function (resolveRoot, myRoot, events) { 28136 var isMine = function (envelope) { 28137 return _Utils_eq( 28138 resolveRoot(envelope.q0), 28139 $elm$core$Maybe$Just(myRoot)); 28140 }; 28141 var approvedByMe = function (proposalId) { 28142 return A2( 28143 $elm$core$List$any, 28144 function (envelope) { 28145 var _v1 = envelope.jC; 28146 if (_v1.$ === 15) { 28147 var approval = _v1.a; 28148 return _Utils_eq(approval.cN, proposalId) && isMine(envelope); 28149 } else { 28150 return false;
28151 } 28152 }, 28153 events); 28154 }; 28155 var toPending = F2( 28156 function (envelope, proposal) { 28157 return (isMine(envelope) || approvedByMe(envelope.m9)) ? $elm$core$Maybe$Nothing : A2( 28158 $elm$core$Maybe$andThen, 28159 function (prefix) { 28160 return (_Utils_eq( 28161 $elm$core$List$length(prefix), 28162 proposal.bK) && A2($elm$core$List$any, isMine, prefix)) ? $elm$core$Maybe$Just( 28163 { 28164 db: proposal.gI, 28165 cB: $author$project$Domain$Compaction$manifestInput(prefix), 28166 cN: envelope.m9 28167 }) : $elm$core$Maybe$Nothing; 28168 }, 28169 A2($author$project$Domain$Compaction$prefixThrough, proposal.hx, events)); 28170 }); 28171 return A2( 28172 $elm$core$List$filterMap, 28173 function (envelope) { 28174 var _v0 = envelope.jC; 28175 if (_v0.$ === 14) { 28176 var proposal = _v0.a; 28177 return A2(toPending, envelope, proposal); 28178 } else { 28179 return $elm$core$Maybe$Nothing; 28180 } 28181 }, 28182 events); 28183 }); 28184var $author$project$GroupOps$compactionApprovalsDue = F2( 28185 function (myRoot, loaded) { 28186 return A2( 28187 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$onError, 28188 function (_v0) { 28189 return $andrewMacmurray$elm_concurrent_task$ConcurrentTask$succeed(_List_Nil); 28190 }, 28191 A2( 28192 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$map, 28193 $elm$core$List$filterMap($elm$core$Basics$identity), 28194 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$batch( 28195 A2( 28196 $elm$core$List$map, 28197 function (pending) { 28198 return A2( 28199 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$map, 28200 function (hash) { 28201 return _Utils_eq(hash, pending.db) ? $elm$core$Maybe$Just(pending.cN) : $elm$core$Maybe$Nothing; 28202 }, 28203 $author$project$WebCrypto$sha256(pending.cB)); 28204 }, 28205 A3( 28206 $author$project$Domain$Compaction$pendingApprovals, 28207 $author$project$Domain$GroupState$resolveMemberRootId(loaded.a6), 28208 myRoot, 28209 loaded.iC))))); 28210 }); 28211var $author$project$Domain$Compaction$executableProposal = F2( 28212 function (resolvers, events) { 28213 return A3( 28214 $author$project$Domain$Compaction$newestQuorumed, 28215 resolvers, 28216 events, 28217 F3( 28218 function (envelope, proposal, prefix) { 28219 return _Utils_eq( 28220 $elm$core$List$length(prefix), 28221 proposal.bK) ? $elm$core$Maybe$Just( 28222 { 28223 db: proposal.gI, 28224 cB: $author$project$Domain$Compaction$manifestInput(prefix), 28225 jI: prefix, 28226 cN: envelope.m9 28227 }) : $elm$core$Maybe$Nothing; 28228 })); 28229 }); 28230var $author$project$Domain$Compaction$proposalCooldownMs = (((7 * 24) * 60) * 60) * 1000; 28231var $author$project$Domain$Compaction$proposalDraft = F2( 28232 function (now, events) { 28233 var sorted = $author$project$Domain$Event$sortEvents(events); 28234 var newestProposalMs = $elm$core$List$maximum( 28235 A2( 28236 $elm$core$List$filterMap, 28237 function (envelope) { 28238 var _v3 = envelope.jC; 28239 if (_v3.$ === 14) { 28240 return $elm$core$Maybe$Just( 28241 $elm$time$Time$posixToMillis(envelope.lT)); 28242 } else { 28243 return $elm$core$Maybe$Nothing; 28244 } 28245 }, 28246 events)); 28247 var coolingDown = function () { 28248 if (!newestProposalMs.$) { 28249 var ms = newestProposalMs.a; 28250 return _Utils_cmp( 28251 $elm$time$Time$posixToMillis(now) - ms, 28252 $author$project$Domain$Compaction$proposalCooldownMs) < 0; 28253 } else { 28254 return false; 28255 } 28256 }(); 28257 var _v0 = _Utils_Tuple2( 28258 coolingDown, 28259 $elm$core$List$reverse(sorted)); 28260 if ((!_v0.a) && _v0.b.b) { 28261 var _v1 = _v0.b; 28262 var newest = _v1.a; 28263 return $elm$core$Maybe$Just( 28264 { 28265 bK: $elm$core$List$length(sorted), 28266 cB: $author$project$Domain$Compaction$manifestInput(sorted), 28267 hx: newest.m9 28268 }); 28269 } else { 28270 return $elm$core$Maybe$Nothing; 28271 } 28272 }); 28273var $author$project$Domain$Compaction$recordCountTrigger = 500; 28274var $author$project$GroupOps$compactionStep = F2( 28275 function (cfg, loaded) { 28276 var state = loaded.a6; 28277 var resolvers = { 28278 nt: function (root) { 28279 return A2( 28280 $elm$core$Maybe$withDefault, 28281 false, 28282 A2( 28283 $elm$core$Maybe$map, 28284 function ($) { 28285 return $.nt; 28286 }, 28287 A2($elm$core$Dict$get, root, state.r))); 28288 }, 28289 pS: $author$project$Domain$GroupState$resolveMemberRootId(state) 28290 }; 28291 var relayWorthCompacting = _Utils_cmp(cfg.pM, $author$project$Domain$Compaction$recordCountTrigger) > -1; 28292 var clean = function (step) { 28293 return {gJ: false, hs: step}; 28294 }; 28295 var approveOrPropose = A2( 28296 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$andThen, 28297 function (proposalIds) { 28298 var _v1 = _Utils_Tuple3( 28299 proposalIds, 28300 relayWorthCompacting, 28301 A2($author$project$Domain$Compaction$proposalDraft, cfg.cH, loaded.iC)); 28302 if (_v1.a.b) { 28303 var _v2 = _v1.a; 28304 return $andrewMacmurray$elm_concurrent_task$ConcurrentTask$succeed( 28305 $author$project$GroupOps$ApproveProposals(proposalIds)); 28306 } else { 28307 if (_v1.b && (!_v1.c.$)) { 28308 var draft = _v1.c.a; 28309 return A2( 28310 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$map,
28311 function (hash) { 28312 return $author$project$GroupOps$ProposalReady( 28313 {bK: draft.bK, gI: hash, hx: draft.hx}); 28314 }, 28315 A2( 28316 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$mapError, 28317 $author$project$Infra$Server$CryptoError, 28318 $author$project$WebCrypto$sha256(draft.cB))); 28319 } else { 28320 return $andrewMacmurray$elm_concurrent_task$ConcurrentTask$succeed($author$project$GroupOps$NoCompactionStep); 28321 } 28322 } 28323 }, 28324 A2($author$project$GroupOps$compactionApprovalsDue, cfg.nZ, loaded)); 28325 var _v0 = _Utils_Tuple2( 28326 A2($author$project$Domain$Compaction$executableProposal, resolvers, loaded.iC), 28327 relayWorthCompacting); 28328 if ((!_v0.a.$) && _v0.b) { 28329 var executable = _v0.a.a; 28330 return A2( 28331 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$andThen, 28332 function (hash) { 28333 return _Utils_eq(hash, executable.db) ? A2( 28334 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$map, 28335 function (outcome) { 28336 return clean( 28337 $author$project$GroupOps$ExecutedCompaction(outcome)); 28338 }, 28339 A3($author$project$Infra$Server$compact, cfg.p9, cfg.hJ, executable.jI)) : A2( 28340 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$map, 28341 function (step) { 28342 return {gJ: true, hs: step}; 28343 }, 28344 approveOrPropose); 28345 }, 28346 A2( 28347 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$mapError, 28348 $author$project$Infra$Server$CryptoError, 28349 $author$project$WebCrypto$sha256(executable.cB))); 28350 } else { 28351 return A2($andrewMacmurray$elm_concurrent_task$ConcurrentTask$map, clean, approveOrPropose); 28352 } 28353 }); 28354var $author$project$Page$Group$curationOrder = function (model) { 28355 return A2($elm$core$Maybe$withDefault, $elm$core$Dict$empty, model.bV); 28356}; 28357var $author$project$Domain$MigrationCuration$After = function (a) { 28358 return {$: 1, a: a}; 28359}; 28360var $author$project$Domain$SuspicionAudit$ForeignPaymentEdit = function (a) { 28361 return {$: 0, a: a}; 28362}; 28363var $author$project$Domain$SuspicionAudit$foreignPaymentFindings = F3( 28364 function (state, authorsByRoot, ordered) { 28365 var selfPresent = $elm$core$Set$fromList( 28366 $elm$core$Dict$keys(authorsByRoot)); 28367 var step = F2( 28368 function (e, _v1) { 28369 var prior = _v1.a; 28370 var acc = _v1.b; 28371 var _v0 = e.jC; 28372 if (_v0.$ === 6) { 28373 var data = _v0.a; 28374 var newPayment = data.ji.jD; 28375 var foreign = !_Utils_eq( 28376 A2($author$project$Domain$GroupState$resolveMemberRootId, state, e.q0), 28377 $elm$core$Maybe$Just(data.aj)); 28378 var flagged = (!_Utils_eq( 28379 newPayment, 28380 A2( 28381 $elm$core$Maybe$withDefault, 28382 $author$project$Domain$PaymentMethod$empty, 28383 A2($elm$core$Dict$get, data.aj, prior)))) && (foreign && A2($elm$core$Set$member, data.aj, selfPresent)); 28384 return _Utils_Tuple2( 28385 A3($elm$core$Dict$insert, data.aj, newPayment, prior), 28386 flagged ? A2( 28387 $elm$core$List$cons, 28388 { 28389 ii: e.q0, 28390 f5: A2($author$project$Domain$GroupState$resolveMemberName, state, e.q0), 28391 iB: _List_fromArray( 28392 [e.m9]), 28393 gE: $author$project$Domain$SuspicionAudit$ForeignPaymentEdit( 28394 {kz: data.aj}) 28395 }, 28396 acc) : acc); 28397 } else { 28398 return _Utils_Tuple2(prior, acc); 28399 } 28400 }); 28401 return $elm$core$List$reverse( 28402 A3( 28403 $elm$core$List$foldl, 28404 step, 28405 _Utils_Tuple2($elm$core$Dict$empty, _List_Nil), 28406 ordered).b); 28407 }); 28408var $author$project$Domain$SuspicionAudit$GraftedDeviceTamper = function (a) { 28409 return {$: 1, a: a}; 28410}; 28411var $author$project$Domain$SuspicionAudit$isLink = function (payload) { 28412 if (payload.$ === 5) { 28413 return true; 28414 } else { 28415 return false; 28416 } 28417}; 28418var $author$project$Domain$SuspicionAudit$isTamperKind = function (payload) { 28419 switch (payload.$) { 28420 case 8: 28421 return true; 28422 case 9: 28423 return true; 28424 case 10: 28425 return true; 28426 case 6: 28427 return true; 28428 default: 28429 return false; 28430 } 28431}; 28432var $author$project$Domain$SuspicionAudit$graftedDeviceFindings = F3( 28433 function (state, authorsByRoot, ordered) { 28434 var eventsByAuthor = A3( 28435 $elm$core$List$foldl, 28436 function (e) { 28437 return A2( 28438 $elm$core$Dict$update, 28439 e.q0, 28440 A2( 28441 $elm$core$Basics$composeR, 28442 $elm$core$Maybe$withDefault(_List_Nil), 28443 A2( 28444 $elm$core$Basics$composeR, 28445 $elm$core$List$cons(e), 28446 $elm$core$Maybe$Just))); 28447 }, 28448 $elm$core$Dict$empty, 28449 ordered); 28450 var toFinding = F2( 28451 function (deviceId, link) { 28452 var others = A2( 28453 $elm$core$Set$remove, 28454 deviceId, 28455 A2( 28456 $elm$core$Maybe$withDefault, 28457 $elm$core$Set$empty, 28458 A2($elm$core$Dict$get, link.aj, authorsByRoot))); 28459 var footprint = $elm$core$List$reverse( 28460 A2( 28461 $elm$core$List$filter, 28462 A2( 28463 $elm$core$Basics$composeR, 28464 function ($) { 28465 return $.jC; 28466 }, 28467 A2($elm$core$Basics$composeR, $author$project$Domain$SuspicionAudit$isLink, $elm$core$Basics$not)), 28468 A2( 28469 $elm$core$Maybe$withDefault, 28470 _List_Nil, 28471 A2($elm$core$Dict$get, deviceId, eventsByAuthor)))); 28472 return ($elm$core$Set$isEmpty(others) || ($elm$core$List$isEmpty(footprint) || (!A2( 28473 $elm$core$List$all, 28474 A2( 28475 $elm$core$Basics$composeR, 28476 function ($) { 28477 return $.jC; 28478 }, 28479 $author$project$Domain$SuspicionAudit$isTamperKind), 28480 footprint)))) ? $elm$core$Maybe$Nothing : $elm$core$Maybe$Just( 28481 { 28482 ii: deviceId, 28483 f5: A2($author$project$Domain$GroupState$resolveMemberName, state, deviceId),
28484 iB: A2( 28485 $elm$core$List$map, 28486 function ($) { 28487 return $.m9; 28488 }, 28489 footprint), 28490 gE: $author$project$Domain$SuspicionAudit$GraftedDeviceTamper( 28491 {mP: link.kg, j7: link.aj}) 28492 }); 28493 }); 28494 return A2( 28495 $elm$core$List$filterMap, 28496 function (_v0) { 28497 var deviceId = _v0.a; 28498 var link = _v0.b; 28499 return A2(toFinding, deviceId, link); 28500 }, 28501 $elm$core$Dict$toList(state.aP)); 28502 }); 28503var $author$project$Domain$SuspicionAudit$audit = F3( 28504 function (viewer, state, events) { 28505 var ordered = $author$project$Domain$Event$sortEvents(events); 28506 var authorsByRoot = A3( 28507 $elm$core$List$foldl, 28508 F2( 28509 function (e, acc) { 28510 var _v0 = A2($author$project$Domain$GroupState$resolveMemberRootId, state, e.q0); 28511 if (!_v0.$) { 28512 var root = _v0.a; 28513 return A3( 28514 $elm$core$Dict$update, 28515 root, 28516 A2( 28517 $elm$core$Basics$composeR, 28518 $elm$core$Maybe$withDefault($elm$core$Set$empty), 28519 A2( 28520 $elm$core$Basics$composeR, 28521 $elm$core$Set$insert(e.q0), 28522 $elm$core$Maybe$Just)), 28523 acc); 28524 } else { 28525 return acc; 28526 } 28527 }), 28528 $elm$core$Dict$empty, 28529 ordered); 28530 return A2( 28531 $elm$core$List$filter, 28532 function (f) { 28533 return !_Utils_eq(f.ii, viewer); 28534 }, 28535 _Utils_ap( 28536 A3($author$project$Domain$SuspicionAudit$foreignPaymentFindings, state, authorsByRoot, ordered), 28537 A3($author$project$Domain$SuspicionAudit$graftedDeviceFindings, state, authorsByRoot, ordered))); 28538 }); 28539var $author$project$Domain$SuspicionAudit$dismissKey = function (finding) { 28540 var tag = function () { 28541 var _v0 = finding.gE; 28542 if (!_v0.$) { 28543 var target = _v0.a.kz; 28544 return 'fpe:' + target; 28545 } else { 28546 var root = _v0.a.j7; 28547 return 'gdt:' + root; 28548 } 28549 }(); 28550 return A2( 28551 $elm$core$String$join, 28552 ':', 28553 _List_fromArray( 28554 [ 28555 tag, 28556 finding.ii, 28557 A2( 28558 $elm$core$String$join, 28559 ',', 28560 $elm$core$List$sort(finding.iB)) 28561 ])); 28562}; 28563var $author$project$Page$Group$activeFindings = F2( 28564 function (viewer, loaded) { 28565 return A2( 28566 $elm$core$List$filter, 28567 function (f) { 28568 return !A2( 28569 $elm$core$Set$member, 28570 $author$project$Domain$SuspicionAudit$dismissKey(f), 28571 loaded.kw); 28572 }, 28573 A3($author$project$Domain$SuspicionAudit$audit, viewer, loaded.a6, loaded.iC)); 28574 }); 28575var $author$project$Domain$MigrationCuration$FindingReason = function (a) { 28576 return {$: 0, a: a}; 28577}; 28578var $author$project$Domain$MigrationCuration$FloodReason = function (a) { 28579 return {$: 1, a: a}; 28580}; 28581var $author$project$Domain$MigrationCuration$authorBatches = F3( 28582 function (order, memberId, events) { 28583 var seqAuthors = A3( 28584 $elm$core$List$foldl, 28585 F2( 28586 function (e, acc) { 28587 var _v2 = A2($elm$core$Dict$get, e.m9, order); 28588 if (!_v2.$) { 28589 var seq = _v2.a; 28590 return A3( 28591 $elm$core$Dict$update, 28592 seq, 28593 A2( 28594 $elm$core$Basics$composeR, 28595 $elm$core$Maybe$withDefault($elm$core$Set$empty), 28596 A2( 28597 $elm$core$Basics$composeR, 28598 $elm$core$Set$insert(e.q0), 28599 $elm$core$Maybe$Just)), 28600 acc); 28601 } else { 28602 return acc; 28603 } 28604 }), 28605 $elm$core$Dict$empty, 28606 events); 28607 var ownSeqCounts = A3( 28608 $elm$core$List$foldl, 28609 F2( 28610 function (e, acc) { 28611 if (_Utils_eq(e.q0, memberId)) { 28612 var _v1 = A2($elm$core$Dict$get, e.m9, order); 28613 if (!_v1.$) { 28614 var seq = _v1.a; 28615 return A3( 28616 $elm$core$Dict$update, 28617 seq, 28618 A2( 28619 $elm$core$Basics$composeR, 28620 $elm$core$Maybe$withDefault(0), 28621 A2( 28622 $elm$core$Basics$composeR, 28623 $elm$core$Basics$add(1), 28624 $elm$core$Maybe$Just)), 28625 acc); 28626 } else { 28627 return acc; 28628 } 28629 } else { 28630 return acc; 28631 } 28632 }), 28633 $elm$core$Dict$empty, 28634 events); 28635 return $elm$core$List$reverse( 28636 A3( 28637 $elm$core$Dict$foldl, 28638 F3( 28639 function (seq, count, _v0) { 28640 var acc = _v0.a; 28641 var before = _v0.b; 28642 return _Utils_Tuple2( 28643 A2( 28644 $elm$core$List$cons, 28645 { 28646 g0: before, 28647 dC: count, 28648 kg: seq, 28649 ho: A2( 28650 $elm$core$Maybe$withDefault, 28651 true, 28652 A2( 28653 $elm$core$Maybe$map, 28654 A2( 28655 $elm$core$Basics$composeR, 28656 $elm$core$Set$size, 28657 $elm$core$Basics$eq(1)), 28658 A2($elm$core$Dict$get, seq, seqAuthors))) 28659 }, 28660 acc), 28661 before + count); 28662 }), 28663 _Utils_Tuple2(_List_Nil, 0), 28664 ownSeqCounts).a); 28665 }); 28666var $author$project$Domain$MigrationCuration$floodMinBatch = 20; 28667var $elm$core$List$minimum = function (list) { 28668 if (list.b) { 28669 var x = list.a; 28670 var xs = list.b; 28671 return $elm$core$Maybe$Just( 28672 A3($elm$core$List$foldl, $elm$core$Basics$min, x, xs)); 28673 } else { 28674 return $elm$core$Maybe$Nothing; 28675 } 28676}; 28677var $author$project$Domain$MigrationCuration$prevSeqOf = F2( 28678 function (seq, batches) { 28679 return $elm$core$List$maximum( 28680 A2( 28681 $elm$core$List$map, 28682 function ($) { 28683 return $.kg; 28684 }, 28685 A2( 28686 $elm$core$List$filter, 28687 function (b) { 28688 return _Utils_cmp(b.kg, seq) < 0; 28689 }, 28690 batches))); 28691 }); 28692var $author$project$Domain$MigrationCuration$anchorsFor = F4( 28693 function (order, findings, memberId, events) { 28694 var totalOwn = $elm$core$List$length( 28695 A2( 28696 $elm$core$List$filter, 28697 function (e) { 28698 return _Utils_eq(e.q0, memberId); 28699 }, 28700 events)); 28701 var batches = A3($author$project$Domain$MigrationCuration$authorBatches, order, memberId, events); 28702 var noSeq = totalOwn - $elm$core$List$sum( 28703 A2( 28704 $elm$core$List$map, 28705 function ($) { 28706 return $.dC; 28707 }, 28708 batches)); 28709 var cutBeforeSeq = F2( 28710 function (seq, reason) { 28711 return A3( 28712 $elm$core$Maybe$map2, 28713 F2( 28714 function (b, prev) { 28715 var kept = b.g0 + noSeq; 28716 return { 28717 eo: $author$project$Domain$MigrationCuration$After(prev), 28718 eF: totalOwn - kept, 28719 dn: kept, 28720 j_: reason 28721 }; 28722 }), 28723 $elm$core$List$head( 28724 A2( 28725 $elm$core$List$filter, 28726 function (b) { 28727 return _Utils_eq(b.kg, seq); 28728 }, 28729 batches)), 28730 A2($author$project$Domain$MigrationCuration$prevSeqOf, seq, batches)); 28731 }); 28732 var findingAnchors = A2( 28733 $elm$core$List$filterMap, 28734 function (f) { 28735 return A2( 28736 $elm$core$Maybe$andThen, 28737 function (seq) { 28738 return A2( 28739 cutBeforeSeq, 28740 seq, 28741 $author$project$Domain$MigrationCuration$FindingReason(f)); 28742 }, 28743 $elm$core$List$minimum( 28744 A2( 28745 $elm$core$List$filterMap, 28746 function (id) { 28747 return A2($elm$core$Dict$get, id, order); 28748 }, 28749 f.iB))); 28750 }, 28751 A2( 28752 $elm$core$List$filter, 28753 function (f) { 28754 return _Utils_eq(f.ii, memberId); 28755 }, 28756 findings)); 28757 var floodAnchors = A2( 28758 $elm$core$Maybe$withDefault, 28759 _List_Nil, 28760 A2( 28761 $elm$core$Maybe$map, 28762 $elm$core$List$singleton, 28763 A2( 28764 $elm$core$Maybe$andThen, 28765 function (b) { 28766 return A2( 28767 cutBeforeSeq, 28768 b.kg, 28769 $author$project$Domain$MigrationCuration$FloodReason(b.dC)); 28770 }, 28771 $elm$core$List$head( 28772 A2( 28773 $elm$core$List$filter, 28774 function (b) { 28775 return b.ho && (_Utils_cmp(b.dC, $author$project$Domain$MigrationCuration$floodMinBatch) > -1); 28776 }, 28777 batches))))); 28778 return A2( 28779 $elm$core$List$sortBy, 28780 function ($) { 28781 return $.dn; 28782 }, 28783 A3( 28784 $elm$core$List$foldl, 28785 F2( 28786 function (anchor, acc) { 28787 return A2( 28788 $elm$core$List$any, 28789 function (x) { 28790 return _Utils_eq(x.eo, anchor.eo); 28791 }, 28792 acc) ? acc : _Utils_ap( 28793 acc, 28794 _List_fromArray( 28795 [anchor])); 28796 }), 28797 _List_Nil, 28798 _Utils_ap(findingAnchors, floodAnchors))); 28799 }); 28800var $author$project$Domain$MigrationCuration$isGenesis = function (envelope) { 28801 var _v0 = envelope.jC; 28802 if (_v0.$ === 11) { 28803 return true; 28804 } else { 28805 return false;
28806 } 28807}; 28808var $author$project$Domain$MigrationCuration$identities = F4( 28809 function (order, selfRoot, state, events) { 28810 var seqsByAuthor = A3( 28811 $elm$core$List$foldl, 28812 F2( 28813 function (envelope, acc) { 28814 var _v0 = A2($elm$core$Dict$get, envelope.m9, order); 28815 if (!_v0.$) { 28816 var seq = _v0.a; 28817 return A3( 28818 $elm$core$Dict$update, 28819 envelope.q0, 28820 function (ms) { 28821 return $elm$core$Maybe$Just( 28822 A2( 28823 $elm$core$List$cons, 28824 seq, 28825 A2($elm$core$Maybe$withDefault, _List_Nil, ms))); 28826 }, 28827 acc); 28828 } else { 28829 return acc; 28830 } 28831 }), 28832 $elm$core$Dict$empty, 28833 events); 28834 var creator = A2( 28835 $elm$core$Maybe$withDefault, 28836 '', 28837 A2( 28838 $elm$core$Maybe$map, 28839 function ($) { 28840 return $.q0; 28841 }, 28842 $elm$core$List$head( 28843 A2($elm$core$List$filter, $author$project$Domain$MigrationCuration$isGenesis, events)))); 28844 var boundariesFor = F2( 28845 function (id, count) { 28846 var seqs = A2( 28847 $elm$core$Maybe$withDefault, 28848 _List_Nil, 28849 A2($elm$core$Dict$get, id, seqsByAuthor)); 28850 var noSeqCount = count - $elm$core$List$length(seqs); 28851 var distinct = $elm$core$Set$toList( 28852 $elm$core$Set$fromList(seqs)); 28853 return A2( 28854 $elm$core$List$map, 28855 function (b) { 28856 return { 28857 dn: noSeqCount + $elm$core$List$length( 28858 A2( 28859 $elm$core$List$filter, 28860 function (s) { 28861 return _Utils_cmp(s, b) < 1; 28862 }, 28863 seqs)), 28864 kg: b 28865 }; 28866 }, 28867 A2( 28868 $elm$core$List$take, 28869 A2( 28870 $elm$core$Basics$max, 28871 0, 28872 $elm$core$List$length(distinct) - 1), 28873 distinct)); 28874 }); 28875 var toIdentity = F2( 28876 function (id, count) { 28877 var root = A2($author$project$Domain$GroupState$resolveMemberRootId, state, id); 28878 return { 28879 h3: A2(boundariesFor, id, count), 28880 bK: count, 28881 m9: id, 28882 i3: A2($elm$core$Dict$member, id, state.aP), 28883 dl: _Utils_eq( 28884 root, 28885 $elm$core$Maybe$Just(selfRoot)), 28886 i6: A2($author$project$Domain$GroupState$resolveMemberName, state, id), 28887 jd: A2( 28888 $elm$core$Maybe$map, 28889 function ($) { 28890 return $.kD; 28891 }, 28892 A2($elm$core$Dict$get, id, state.aP)), 28893 j0: (!_Utils_eq( 28894 root, 28895 $elm$core$Maybe$Just(selfRoot))) && (!_Utils_eq(id, creator)) 28896 }; 28897 }); 28898 return A2( 28899 $elm$core$List$sortBy, 28900 function (identity) { 28901 return -identity.bK; 28902 }, 28903 $elm$core$Dict$values( 28904 A2( 28905 $elm$core$Dict$map, 28906 toIdentity, 28907 A3( 28908 $elm$core$List$foldl, 28909 function (envelope) { 28910 return A2( 28911 $elm$core$Dict$update, 28912 envelope.q0, 28913 A2( 28914 $elm$core$Basics$composeR, 28915 $elm$core$Maybe$withDefault(0), 28916 A2( 28917 $elm$core$Basics$composeR, 28918 $elm$core$Basics$add(1), 28919 $elm$core$Maybe$Just))); 28920 }, 28921 $elm$core$Dict$empty, 28922 events)))); 28923 }); 28924var $author$project$Page$Group$defaultMigrationBound = F3( 28925 function (model, loaded, memberId) { 28926 var anchorBound = A2( 28927 $elm$core$Maybe$map, 28928 function ($) { 28929 return $.eo; 28930 }, 28931 $elm$core$List$head( 28932 A4( 28933 $author$project$Domain$MigrationCuration$anchorsFor, 28934 $author$project$Page$Group$curationOrder(model), 28935 A2($author$project$Page$Group$activeFindings, model.iY, loaded), 28936 memberId, 28937 loaded.iC))); 28938 if (!anchorBound.$) { 28939 var bound = anchorBound.a; 28940 return bound; 28941 } else { 28942 var selfRoot = A2( 28943 $elm$core$Maybe$withDefault, 28944 model.iY, 28945 A2($author$project$Page$Group$recoveryRootId, model, loaded)); 28946 return A2( 28947 $elm$core$Maybe$withDefault, 28948 $author$project$Domain$MigrationCuration$All, 28949 A2( 28950 $elm$core$Maybe$map, 28951 function (identity) { 28952 var _v1 = _Utils_Tuple2(identity.j0, identity.h3); 28953 if ((!_v1.a) && _v1.b.b) { 28954 var _v2 = _v1.b; 28955 var first = _v2.a; 28956 return $author$project$Domain$MigrationCuration$After(first.kg); 28957 } else { 28958 return $author$project$Domain$MigrationCuration$All; 28959 } 28960 }, 28961 $elm$core$List$head( 28962 A2( 28963 $elm$core$List$filter, 28964 function (identity) { 28965 return _Utils_eq(identity.m9, memberId); 28966 }, 28967 A4( 28968 $author$project$Domain$MigrationCuration$identities, 28969 $author$project$Page$Group$curationOrder(model), 28970 selfRoot, 28971 loaded.a6, 28972 loaded.iC))))); 28973 } 28974 }); 28975var $author$project$Page$Group$DeleteGroup = F2( 28976 function (a, b) { 28977 return {$: 2, a: a, b: b}; 28978 }); 28979var $author$project$Infra$Server$unsubscribeFromGroup = function (groupId) { 28980 return $andrewMacmurray$elm_concurrent_task$ConcurrentTask$define( 28981 { 28982 k: $elm$json$Json$Encode$object( 28983 _List_fromArray( 28984 [ 28985 _Utils_Tuple2( 28986 'groupId', 28987 $elm$json$Json$Encode$string(groupId)) 28988 ])), 28989 l: $andrewMacmurray$elm_concurrent_task$ConcurrentTask$expectNoErrors, 28990 m: $andrewMacmurray$elm_concurrent_task$ConcurrentTask$expectWhatever, 28991 n: 'relay:unsubscribe' 28992 }); 28993}; 28994var $author$project$Page$Group$deleteGroup = F3( 28995 function (config, model, loaded) { 28996 var groupId = loaded.bA.m9; 28997 var _v0 = A3( 28998 $author$project$Page$Group$queueSummaryOperation, 28999 config, 29000 A2( 29001 $author$project$Page$Group$DeleteGroup, 29002 groupId, 29003 A2( 29004 $elm$core$Maybe$map, 29005 $elm$core$Tuple$pair(loaded.gs), 29006 A2($author$project$Page$Group$currentUserRootId, model, loaded))), 29007 model); 29008 var deletingModel = _v0.a; 29009 var deleteCmd = _v0.b; 29010 return function (_v2) { 29011 var r = _v2.a; 29012 var cmd = _v2.b; 29013 return _Utils_Tuple3( 29014 _Utils_update( 29015 deletingModel, 29016 {ak: r}), 29017 cmd, 29018 _List_Nil); 29019 }( 29020 A3( 29021 $author$project$Infra$ConcurrentTaskExtra$andRun, 29022 function (_v1) { 29023 return $author$project$Page$Group$NoOp; 29024 }, 29025 $author$project$Infra$Server$unsubscribeFromGroup(groupId), 29026 _Utils_Tuple2(deletingModel.ak, deleteCmd))); 29027 }); 29028var $author$project$Translations$toastEntryDeleted = function (_v0) { 29029 var lang = _v0; 29030 if (!lang) { 29031 return 'Entry deleted.'; 29032 } else { 29033 return 'Ãcriture supprimée.'; 29034 } 29035}; 29036var $author$project$Translations$toastEntryRestored = function (_v0) { 29037 var lang = _v0; 29038 if (!lang) { 29039 return 'Entry restored.'; 29040 } else { 29041 return 'Ãcriture restaurée.'; 29042 } 29043}; 29044var $author$project$UI$Toast$entryActionMessage = F2( 29045 function (i18n, payload) { 29046 switch (payload.$) { 29047 case 9: 29048 return $elm$core$Maybe$Just( 29049 $author$project$Translations$toastEntryDeleted(i18n)); 29050 case 10: 29051 return $elm$core$Maybe$Just( 29052 $author$project$Translations$toastEntryRestored(i18n)); 29053 default: 29054 return $elm$core$Maybe$Nothing; 29055 } 29056 }); 29057var $author$project$GroupOps$simpleEvent = F3( 29058 function (ctx, loaded, payload) { 29059 var _v0 = A2($author$project$Infra$IdGen$v7, ctx.ap, ctx.s); 29060 var eventId = _v0.a; 29061 var idStateAfter = _v0.b; 29062 return A3( 29063 $author$project$GroupOps$attempt, 29064 _Utils_update( 29065 ctx, 29066 {s: idStateAfter}), 29067 function (now) { 29068 return A5( 29069 $author$project$Domain$Event$wrap, 29070 eventId, 29071 now, 29072 $author$project$GroupOps$author(ctx), 29073 payload, 29074 ''); 29075 }, 29076 loaded); 29077 }); 29078var $author$project$GroupOps$event = $author$project$GroupOps$simpleEvent; 29079var $author$project$Page$Group$OnRateFetched = F2( 29080 function (a, b) { 29081 return {$: 47, a: a, b: b}; 29082 }); 29083var $author$project$Page$Group$fetchExchangeRate = F3( 29084 function (config, model, pair) { 29085 var _v0 = A3( 29086 $author$project$Infra$ConcurrentTaskExtra$andRun, 29087 $author$project$Page$Group$OnRateFetched(pair.hX), 29088 A3( 29089 $author$project$Infra$ExchangeRate$fetchRateCached, 29090 config.de, 29091 A2($author$project$Domain$Date$posixToDate, config.al, config.ap), 29092 pair), 29093 _Utils_Tuple2(model.ak, $elm$core$Platform$Cmd$none)); 29094 var runner = _v0.a; 29095 var cmd = _v0.b; 29096 return _Utils_Tuple3( 29097 _Utils_update( 29098 model, 29099 {ak: runner}), 29100 cmd, 29101 _List_Nil); 29102 }); 29103var $author$project$Page$Group$SaveNotificationSummary = F2( 29104 function (a, b) { 29105 return {$: 1, a: a, b: b}; 29106 }); 29107var $author$project$Infra$Storage$deleteNotifyTopic = F2( 29108 function (db, groupId) { 29109 return A3( 29110 $author$project$IndexedDb$delete, 29111 db, 29112 $author$project$Infra$Storage$notifyTopicsStore, 29113 $author$project$IndexedDb$StringKey(groupId)); 29114 }); 29115var $author$project$Infra$Storage$saveNotifyTopic = F3( 29116 function (db, groupId, topic) { 29117 return A4( 29118 $author$project$IndexedDb$putAt, 29119 db, 29120 $author$project$Infra$Storage$notifyTopicsStore, 29121 $author$project$IndexedDb$StringKey(groupId), 29122 $elm$json$Json$Encode$string(topic)); 29123 });
29124var $author$project$Page$Group$WorkspaceLoadFailed = function (a) { 29125 return {$: 3, a: a}; 29126}; 29127var $author$project$Page$Group$updateLoadedSummary = F2( 29128 function (summary, model) { 29129 var _v0 = model.a; 29130 switch (_v0.$) { 29131 case 2: 29132 var loadingSummary = _v0.a; 29133 return _Utils_eq(loadingSummary.m9, summary.m9) ? _Utils_update( 29134 model, 29135 { 29136 a: $author$project$Page$Group$WorkspaceLoading(summary) 29137 }) : model; 29138 case 3: 29139 var failedSummary = _v0.a; 29140 return _Utils_eq(failedSummary.m9, summary.m9) ? _Utils_update( 29141 model, 29142 { 29143 a: $author$project$Page$Group$WorkspaceLoadFailed(summary) 29144 }) : model; 29145 case 4: 29146 var loaded = _v0.a; 29147 return _Utils_eq(loaded.bA.m9, summary.m9) ? _Utils_update( 29148 model, 29149 { 29150 a: $author$project$Page$Group$WorkspaceLoaded( 29151 _Utils_update( 29152 loaded, 29153 {bA: summary})) 29154 }) : model; 29155 default: 29156 return model; 29157 } 29158 }); 29159var $author$project$Page$Group$workspaceSummaryFor = F2( 29160 function (groupId, model) { 29161 var _v0 = model.a; 29162 switch (_v0.$) { 29163 case 2: 29164 var summary = _v0.a; 29165 return _Utils_eq(summary.m9, groupId) ? $elm$core$Maybe$Just(summary) : $elm$core$Maybe$Nothing; 29166 case 3: 29167 var summary = _v0.a; 29168 return _Utils_eq(summary.m9, groupId) ? $elm$core$Maybe$Just(summary) : $elm$core$Maybe$Nothing; 29169 case 4: 29170 var loaded = _v0.a; 29171 return _Utils_eq(loaded.bA.m9, groupId) ? $elm$core$Maybe$Just(loaded.bA) : $elm$core$Maybe$Nothing; 29172 default: 29173 return $elm$core$Maybe$Nothing; 29174 } 29175 }); 29176var $author$project$Page$Group$completeNotificationMutation = F5( 29177 function (config, groupId, topic, intent, model) { 29178 if (!intent.$) { 29179 var isSubscribed = intent.a; 29180 var fallbackSummary = intent.b; 29181 var topicRecordTask = isSubscribed ? A3($author$project$Infra$Storage$saveNotifyTopic, config.de, groupId, topic) : A2($author$project$Infra$Storage$deleteNotifyTopic, config.de, groupId); 29182 var completedModel = _Utils_update( 29183 model, 29184 { 29185 K: A2($elm$core$Dict$remove, groupId, model.K) 29186 }); 29187 var currentSummary = A2( 29188 $elm$core$Maybe$withDefault, 29189 fallbackSummary, 29190 A2($author$project$Page$Group$workspaceSummaryFor, groupId, completedModel)); 29191 var updatedSummary = _Utils_update( 29192 currentSummary, 29193 {gC: isSubscribed}); 29194 return function (_v1) { 29195 var savedModel = _v1.a; 29196 var cmd = _v1.b; 29197 return function (_v3) { 29198 var runner = _v3.a; 29199 var cmds = _v3.b; 29200 return _Utils_Tuple3( 29201 _Utils_update( 29202 savedModel, 29203 {ak: runner}), 29204 cmds, 29205 _List_Nil); 29206 }( 29207 A3( 29208 $author$project$Infra$ConcurrentTaskExtra$andRun, 29209 function (_v2) { 29210 return $author$project$Page$Group$NoOp; 29211 }, 29212 topicRecordTask, 29213 _Utils_Tuple2(savedModel.ak, cmd))); 29214 }( 29215 A3( 29216 $author$project$Page$Group$queueSummaryOperation, 29217 config, 29218 A2($author$project$Page$Group$SaveNotificationSummary, currentSummary.gC, updatedSummary), 29219 A2($author$project$Page$Group$updateLoadedSummary, updatedSummary, completedModel))); 29220 } else { 29221 return function (_v5) { 29222 var runner = _v5.a; 29223 var cmd = _v5.b; 29224 return _Utils_Tuple3( 29225 _Utils_update( 29226 model, 29227 { 29228 K: A2($elm$core$Dict$remove, groupId, model.K), 29229 ak: runner 29230 }), 29231 cmd, 29232 _List_Nil); 29233 }( 29234 A3( 29235 $author$project$Infra$ConcurrentTaskExtra$andRun, 29236 function (_v4) { 29237 return $author$project$Page$Group$NoOp; 29238 }, 29239 A2($author$project$Infra$Storage$deleteNotifyTopic, config.de, groupId), 29240 _Utils_Tuple2(model.ak, $elm$core$Platform$Cmd$none))); 29241 } 29242 }); 29243var $author$project$Page$Group$notificationTarget = function (intent) { 29244 if (!intent.$) { 29245 var isSubscribed = intent.a; 29246 return isSubscribed; 29247 } else { 29248 return false; 29249 } 29250}; 29251var $author$project$Page$Group$OnNotificationChanged = F3( 29252 function (a, b, c) { 29253 return {$: 23, a: a, b: b, c: c}; 29254 }); 29255var $author$project$Page$Group$runNotificationRequest = F5( 29256 function (pushServerUrl, pushSubscription, groupId, mutation, model) { 29257 return A2( 29258 $elm$core$Tuple$mapFirst, 29259 function (runner) { 29260 return _Utils_update( 29261 model, 29262 { 29263 K: A3($elm$core$Dict$insert, groupId, mutation, model.K), 29264 ak: runner 29265 }); 29266 }, 29267 A3( 29268 $author$project$Infra$ConcurrentTaskExtra$andRun, 29269 A2($author$project$Page$Group$OnNotificationChanged, groupId, mutation.ai), 29270 A2( 29271 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$andThen, 29272 function (topic) { 29273 return A2( 29274 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$map, 29275 function (_v2) { 29276 return topic; 29277 }, 29278 A2( 29279 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$mapError, 29280 function (_v1) { 29281 return 0; 29282 }, 29283 $author$project$Infra$PushServer$setGroupNotification( 29284 {gC: mutation.ai, g7: pushServerUrl, d$: pushSubscription, d4: topic}))); 29285 }, 29286 A2( 29287 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$mapError, 29288 function (_v0) { 29289 return 0; 29290 }, 29291 A2($author$project$Infra$Crypto$deriveNotifyTopic, mutation.gs, mutation.e$))), 29292 _Utils_Tuple2(model.ak, $elm$core$Platform$Cmd$none))); 29293 }); 29294var $author$project$Page$Group$finishNotificationMutation = F5( 29295 function (config, groupId, attempted, response, model) { 29296 var _v0 = A2($elm$core$Dict$get, groupId, model.K); 29297 if (_v0.$ === 1) { 29298 return _Utils_Tuple3(model, $elm$core$Platform$Cmd$none, _List_Nil); 29299 } else { 29300 var mutation = _v0.a; 29301 if (!_Utils_eq(mutation.ai, attempted)) { 29302 return _Utils_Tuple3(model, $elm$core$Platform$Cmd$none, _List_Nil); 29303 } else { 29304 if (!_Utils_eq( 29305 $author$project$Page$Group$notificationTarget(mutation.U), 29306 attempted)) { 29307 var _v1 = _Utils_Tuple2(config.g7, config.jS); 29308 if ((!_v1.a.$) && (!_v1.b.$)) { 29309 var pushServerUrl = _v1.a.a; 29310 var pushSubscription = _v1.b.a; 29311 return function (_v2) { 29312 var nextModel = _v2.a; 29313 var cmd = _v2.b; 29314 return _Utils_Tuple3(nextModel, cmd, _List_Nil); 29315 }( 29316 A5( 29317 $author$project$Page$Group$runNotificationRequest, 29318 pushServerUrl, 29319 pushSubscription, 29320 groupId, 29321 _Utils_update( 29322 mutation, 29323 { 29324 ai: $author$project$Page$Group$notificationTarget(mutation.U) 29325 }), 29326 model)); 29327 } else { 29328 return _Utils_Tuple3( 29329 _Utils_update( 29330 model, 29331 { 29332 K: A2($elm$core$Dict$remove, groupId, model.K) 29333 }), 29334 $elm$core$Platform$Cmd$none, 29335 _List_Nil); 29336 } 29337 } else { 29338 if (!response.$) { 29339 var topic = response.a; 29340 return A5($author$project$Page$Group$completeNotificationMutation, config, groupId, topic, mutation.U, model); 29341 } else { 29342 return _Utils_Tuple3( 29343 _Utils_update( 29344 model, 29345 { 29346 K: A2($elm$core$Dict$remove, groupId, model.K) 29347 }), 29348 $elm$core$Platform$Cmd$none, 29349 function () { 29350 var _v4 = mutation.U; 29351 if (!_v4.$) { 29352 return _List_fromArray( 29353 [ 29354 A2( 29355 $author$project$Page$Group$ShowToast, 29356 1, 29357 $author$project$Translations$toastPushError(config.aJ)) 29358 ]); 29359 } else { 29360 return _List_Nil; 29361 } 29362 }()); 29363 } 29364 } 29365 } 29366 } 29367 }); 29368var $author$project$Page$Group$finishStaleConnectivity = F2( 29369 function (config, model) { 29370 var idleModel = _Utils_update( 29371 model, 29372 {R: $author$project$Page$Group$SyncIdle}); 29373 if (_Utils_eq(model.R, $author$project$Page$Group$SyncFollowUpRequested)) { 29374 var _v0 = A2($author$project$Page$Group$connectivityRestored, config, idleModel); 29375 var syncModel = _v0.a; 29376 var syncCmd = _v0.b; 29377 return _Utils_Tuple3(syncModel, syncCmd, _List_Nil); 29378 } else { 29379 return _Utils_Tuple3(idleModel, $elm$core$Platform$Cmd$none, _List_Nil); 29380 } 29381 }); 29382var $author$project$Page$Group$RemoveGroup = function (a) { 29383 return {$: 3, a: a}; 29384}; 29385var $author$project$Page$Group$UnsubscribeBestEffort = {$: 1}; 29386var $author$project$Page$Group$routeTargetsGroup = F2( 29387 function (groupId, route) { 29388 if (route.$ === 6) { 29389 var routeGroupId = route.a; 29390 return _Utils_eq(routeGroupId, groupId); 29391 } else { 29392 return false;
29393 } 29394 }); 29395var $author$project$Page$Group$removeDeletedWorkspace = F3( 29396 function (groupId, route, model) { 29397 var isDeletedWorkspace = function () { 29398 var _v0 = model.a; 29399 switch (_v0.$) { 29400 case 1: 29401 return A2($author$project$Page$Group$routeTargetsGroup, groupId, route); 29402 case 2: 29403 var summary = _v0.a; 29404 return _Utils_eq(summary.m9, groupId); 29405 case 3: 29406 var summary = _v0.a; 29407 return _Utils_eq(summary.m9, groupId); 29408 case 4: 29409 var loaded = _v0.a; 29410 return _Utils_eq(loaded.bA.m9, groupId); 29411 default: 29412 return false; 29413 } 29414 }(); 29415 return isDeletedWorkspace ? _Utils_update( 29416 model, 29417 {a: $author$project$Page$Group$WorkspaceEmpty}) : model; 29418 }); 29419var $author$project$Page$Group$requestNotification = F5( 29420 function (config, groupId, _v0, intent, model) { 29421 var groupKey = _v0.a; 29422 var memberRootId = _v0.b; 29423 var _v1 = A2($elm$core$Dict$get, groupId, model.K); 29424 if (!_v1.$) { 29425 var mutation = _v1.a; 29426 return _Utils_Tuple2( 29427 _Utils_update( 29428 model, 29429 { 29430 K: A3( 29431 $elm$core$Dict$insert, 29432 groupId, 29433 _Utils_update( 29434 mutation, 29435 {U: intent, gs: groupKey, e$: memberRootId}), 29436 model.K) 29437 }), 29438 $elm$core$Platform$Cmd$none); 29439 } else { 29440 var _v2 = _Utils_Tuple2(config.g7, config.jS); 29441 if ((!_v2.a.$) && (!_v2.b.$)) { 29442 var pushServerUrl = _v2.a.a; 29443 var pushSubscription = _v2.b.a; 29444 return A5( 29445 $author$project$Page$Group$runNotificationRequest, 29446 pushServerUrl, 29447 pushSubscription, 29448 groupId, 29449 { 29450 U: intent, 29451 gs: groupKey, 29452 ai: $author$project$Page$Group$notificationTarget(intent), 29453 e$: memberRootId 29454 }, 29455 model); 29456 } else { 29457 return _Utils_Tuple2(model, $elm$core$Platform$Cmd$none); 29458 } 29459 } 29460 }); 29461var $author$project$Translations$toastGroupRemoved = function (_v0) { 29462 var lang = _v0; 29463 if (!lang) { 29464 return 'Group removed.'; 29465 } else { 29466 return 'Groupe supprimé.'; 29467 } 29468}; 29469var $author$project$Page$Group$finishGroupDeletion = F4( 29470 function (config, groupId, keyAndRoot, model) { 29471 var navigationOutputs = A2($author$project$Page$Group$routeTargetsGroup, groupId, config.d) ? _List_fromArray( 29472 [ 29473 $author$project$Page$Group$NavigateTo($author$project$Route$Home) 29474 ]) : _List_Nil; 29475 var _v0 = function () { 29476 if (!keyAndRoot.$) { 29477 var keyRoot = keyAndRoot.a; 29478 return A5($author$project$Page$Group$requestNotification, config, groupId, keyRoot, $author$project$Page$Group$UnsubscribeBestEffort, model); 29479 } else { 29480 return _Utils_Tuple2(model, $elm$core$Platform$Cmd$none); 29481 } 29482 }(); 29483 var notificationModel = _v0.a; 29484 var notificationCmd = _v0.b; 29485 return _Utils_Tuple3( 29486 A3($author$project$Page$Group$removeDeletedWorkspace, groupId, config.d, notificationModel), 29487 notificationCmd, 29488 _Utils_ap( 29489 _List_fromArray( 29490 [ 29491 $author$project$Page$Group$RemoveGroup(groupId), 29492 A2( 29493 $author$project$Page$Group$ShowToast, 29494 0, 29495 $author$project$Translations$toastGroupRemoved(config.aJ)) 29496 ]), 29497 navigationOutputs)); 29498 }); 29499var $author$project$Page$Group$sameSummaryOperation = F2( 29500 function (left, right) { 29501 var _v0 = _Utils_Tuple2(left, right); 29502 _v0$3: 29503 while (true) { 29504 switch (_v0.a.$) { 29505 case 0: 29506 if (!_v0.b.$) { 29507 var leftSummary = _v0.a.a; 29508 var rightSummary = _v0.b.a; 29509 return _Utils_eq(leftSummary, rightSummary); 29510 } else { 29511 break _v0$3; 29512 } 29513 case 1: 29514 if (_v0.b.$ === 1) { 29515 var _v1 = _v0.a; 29516 var leftPrevious = _v1.a; 29517 var leftSummary = _v1.b; 29518 var _v2 = _v0.b; 29519 var rightPrevious = _v2.a; 29520 var rightSummary = _v2.b; 29521 return _Utils_eq(leftPrevious, rightPrevious) && _Utils_eq(leftSummary, rightSummary); 29522 } else { 29523 break _v0$3; 29524 } 29525 default: 29526 if (_v0.b.$ === 2) { 29527 var _v3 = _v0.a; 29528 var leftId = _v3.a; 29529 var _v4 = _v0.b; 29530 var rightId = _v4.a; 29531 return _Utils_eq(leftId, rightId); 29532 } else { 29533 break _v0$3; 29534 } 29535 } 29536 } 29537 return false; 29538 }); 29539var $author$project$Page$Group$setWorkspaceSubscription = F3( 29540 function (groupId, isSubscribed, model) { 29541 var _v0 = A2($author$project$Page$Group$workspaceSummaryFor, groupId, model); 29542 if (!_v0.$) { 29543 var summary = _v0.a; 29544 return A2( 29545 $author$project$Page$Group$updateLoadedSummary, 29546 _Utils_update( 29547 summary, 29548 {gC: isSubscribed}), 29549 model); 29550 } else { 29551 return model; 29552 } 29553 }); 29554var $author$project$Page$Group$finishNotificationSummarySave = F7( 29555 function (config, groupId, previousSubscription, summary, response, mutation, model) { 29556 if (A2($author$project$Page$Group$sameSummaryOperation, mutation.ai, mutation.U)) { 29557 var completedModel = _Utils_update( 29558 model, 29559 { 29560 V: A2($elm$core$Dict$remove, groupId, model.V) 29561 }); 29562 if (!response.$) { 29563 return _Utils_Tuple3( 29564 completedModel, 29565 $elm$core$Platform$Cmd$none, 29566 _List_fromArray( 29567 [ 29568 $author$project$Page$Group$UpdateGroupSummary(summary) 29569 ])); 29570 } else { 29571 return _Utils_Tuple3( 29572 A3($author$project$Page$Group$setWorkspaceSubscription, groupId, previousSubscription, completedModel), 29573 $elm$core$Platform$Cmd$none, 29574 _List_fromArray( 29575 [ 29576 A2( 29577 $author$project$Page$Group$ShowToast, 29578 1, 29579 $author$project$Translations$toastPushError(config.aJ)) 29580 ])); 29581 } 29582 } else { 29583 return function (_v1) { 29584 var nextModel = _v1.a; 29585 var cmd = _v1.b; 29586 return _Utils_Tuple3(nextModel, cmd, _List_Nil); 29587 }( 29588 A4( 29589 $author$project$Page$Group$runSummaryOperation, 29590 config, 29591 groupId, 29592 _Utils_update( 29593 mutation, 29594 {ai: mutation.U}), 29595 model)); 29596 } 29597 }); 29598var $author$project$Page$Group$finishSummarySave = F4( 29599 function (config, groupId, mutation, model) { 29600 return A2($author$project$Page$Group$sameSummaryOperation, mutation.ai, mutation.U) ? _Utils_Tuple3( 29601 _Utils_update( 29602 model, 29603 { 29604 V: A2($elm$core$Dict$remove, groupId, model.V) 29605 }), 29606 $elm$core$Platform$Cmd$none, 29607 _List_Nil) : function (_v0) { 29608 var nextModel = _v0.a; 29609 var cmd = _v0.b; 29610 return _Utils_Tuple3(nextModel, cmd, _List_Nil); 29611 }( 29612 A4( 29613 $author$project$Page$Group$runSummaryOperation, 29614 config, 29615 groupId, 29616 _Utils_update( 29617 mutation, 29618 {ai: mutation.U}), 29619 model)); 29620 }); 29621var $author$project$Translations$toastGroupRemoveError = function (_v0) { 29622 var lang = _v0; 29623 if (!lang) { 29624 return 'Failed to remove group.'; 29625 } else { 29626 return 'Ãchec de la suppression du groupe.'; 29627 } 29628}; 29629var $author$project$Page$Group$finishSummaryMutation = F4( 29630 function (config, groupId, response, model) { 29631 var _v0 = A2($elm$core$Dict$get, groupId, model.V); 29632 if (_v0.$ === 1) { 29633 return _Utils_Tuple3(model, $elm$core$Platform$Cmd$none, _List_Nil); 29634 } else { 29635 var mutation = _v0.a; 29636 var _v1 = mutation.ai; 29637 switch (_v1.$) { 29638 case 0: 29639 return A4($author$project$Page$Group$finishSummarySave, config, groupId, mutation, model); 29640 case 1: 29641 var previousSubscription = _v1.a; 29642 var summary = _v1.b; 29643 return A7($author$project$Page$Group$finishNotificationSummarySave, config, groupId, previousSubscription, summary, response, mutation, model); 29644 default: 29645 var keyAndRoot = _v1.b; 29646 if (!response.$) { 29647 return A4( 29648 $author$project$Page$Group$finishGroupDeletion, 29649 config, 29650 groupId, 29651 keyAndRoot, 29652 _Utils_update( 29653 model, 29654 { 29655 V: A2($elm$core$Dict$remove, groupId, model.V) 29656 })); 29657 } else { 29658 return _Utils_Tuple3( 29659 _Utils_update( 29660 model, 29661 { 29662 V: A2($elm$core$Dict$remove, groupId, model.V) 29663 }), 29664 $elm$core$Platform$Cmd$none, 29665 _List_fromArray( 29666 [ 29667 A2( 29668 $author$project$Page$Group$ShowToast, 29669 1, 29670 $author$project$Translations$toastGroupRemoveError(config.aJ)) 29671 ])); 29672 } 29673 } 29674 } 29675 }); 29676var $author$project$Translations$toastGroupLoadError = function (_v0) { 29677 var lang = _v0; 29678 if (!lang) { 29679 return 'Failed to load this group\'s data on this device.'; 29680 } else { 29681 return 'Ãchec du chargement des données de ce groupe sur cet appareil.'; 29682 } 29683}; 29684var $author$project$Page$Group$finishWorkspaceLoadFailure = F4( 29685 function (config, groupId, logMessage, model) { 29686 var _v0 = model.a; 29687 if (_v0.$ === 2) { 29688 var summary = _v0.a; 29689 return _Utils_eq(summary.m9, groupId) ? _Utils_Tuple3( 29690 _Utils_update( 29691 model, 29692 {
29693 a: $author$project$Page$Group$WorkspaceLoadFailed(summary) 29694 }), 29695 $elm$core$Platform$Cmd$none, 29696 _List_fromArray( 29697 [ 29698 A2( 29699 $author$project$Page$Group$ShowToast, 29700 1, 29701 $author$project$Translations$toastGroupLoadError(config.aJ)), 29702 A3($author$project$Page$Group$LogError, 1, 0, logMessage) 29703 ])) : _Utils_Tuple3(model, $elm$core$Platform$Cmd$none, _List_Nil); 29704 } else { 29705 return _Utils_Tuple3(model, $elm$core$Platform$Cmd$none, _List_Nil); 29706 } 29707 }); 29708var $author$project$Page$Group$OnEntrySaved = F2( 29709 function (a, b) { 29710 return {$: 18, a: a, b: b}; 29711 }); 29712var $author$project$Page$Group$NewEntry$Shared$TransferOutput = function (a) { 29713 return {$: 1, a: a}; 29714}; 29715var $author$project$Page$Group$NewEntry$outputToKind = function (output) { 29716 switch (output.$) { 29717 case 0: 29718 var data = output.a; 29719 return $author$project$Domain$Entry$Expense( 29720 { 29721 ef: data.lo, 29722 ce: data.ce, 29723 em: function () { 29724 var _v1 = data.fs; 29725 if (!_v1.$) { 29726 var items = _v1.a; 29727 return A2( 29728 $elm$core$List$map, 29729 function (b) { 29730 return $author$project$Domain$Entry$ShareBeneficiary( 29731 {e_: b.e_, qc: b.qc}); 29732 }, 29733 items); 29734 } else { 29735 var items = _v1.a; 29736 return A2( 29737 $elm$core$List$map, 29738 function (b) { 29739 return $author$project$Domain$Entry$ExactBeneficiary( 29740 {ef: b.ef, e_: b.e_}); 29741 }, 29742 items); 29743 } 29744 }(), 29745 h9: data.h9, 29746 bg: data.bg, 29747 cj: data.cj, 29748 ck: data.ck, 29749 eE: data.eE, 29750 je: $elm$core$Maybe$Nothing, 29751 bu: data.bu, 29752 jB: data.jB 29753 }); 29754 case 1: 29755 var data = output.a; 29756 return $author$project$Domain$Entry$Transfer( 29757 {ef: data.lo, ce: data.ce, bg: data.bg, cj: data.cj, ck: data.ck, eE: data.eE, iH: data.mL, bu: data.bu, kE: data.kF}); 29758 default: 29759 var data = output.a; 29760 return $author$project$Domain$Entry$Income( 29761 { 29762 ef: data.lo, 29763 ce: data.ce, 29764 em: function () { 29765 var _v2 = data.fs; 29766 if (!_v2.$) { 29767 var items = _v2.a; 29768 return A2( 29769 $elm$core$List$map, 29770 function (b) { 29771 return $author$project$Domain$Entry$ShareBeneficiary( 29772 {e_: b.e_, qc: b.qc}); 29773 }, 29774 items); 29775 } else { 29776 var items = _v2.a; 29777 return A2( 29778 $elm$core$List$map, 29779 function (b) { 29780 return $author$project$Domain$Entry$ExactBeneficiary( 29781 {ef: b.ef, e_: b.e_}); 29782 }, 29783 items); 29784 } 29785 }(), 29786 bg: data.bg, 29787 cj: data.cj, 29788 ck: data.ck, 29789 eE: data.eE, 29790 bu: data.bu, 29791 j$: data.j$ 29792 }); 29793 } 29794}; 29795var $author$project$GroupOps$newEntry = F3( 29796 function (ctx, loaded, output) { 29797 var _v0 = $author$project$Infra$IdGen$v4(ctx.s); 29798 var entryId = _v0.a; 29799 var idState1 = _v0.b; 29800 var payload = function (now) { 29801 return $author$project$Domain$Event$EntryAdded( 29802 { 29803 gE: $author$project$Page$Group$NewEntry$outputToKind(output), 29804 gM: A3($author$project$Domain$Entry$newMetadata, entryId, ctx.O.aK, now) 29805 }); 29806 }; 29807 var _v1 = A2($author$project$Infra$IdGen$v7, ctx.ap, idState1); 29808 var eventId = _v1.a; 29809 var idStateAfter = _v1.b; 29810 return A3( 29811 $author$project$GroupOps$attempt, 29812 _Utils_update( 29813 ctx, 29814 {s: idStateAfter}), 29815 function (now) { 29816 return A5( 29817 $author$project$Domain$Event$wrap, 29818 eventId, 29819 now, 29820 $author$project$GroupOps$author(ctx), 29821 payload(now), 29822 ''); 29823 }, 29824 loaded); 29825 }); 29826var $author$project$Page$Group$submitContext = F3( 29827 function (onComplete, config, model) { 29828 return {ap: config.ap, de: config.de, s: model.s, O: config.O, ju: onComplete, ak: model.ak}; 29829 }); 29830var $author$project$Page$Group$runSubmit = F4( 29831 function (onComplete, config, model, submitFn) { 29832 var _v0 = submitFn( 29833 A3($author$project$Page$Group$submitContext, onComplete, config, model)); 29834 var state = _v0.a; 29835 var cmd = _v0.b; 29836 return _Utils_Tuple3( 29837 _Utils_update( 29838 model, 29839 {s: state.s, ak: state.ak}), 29840 cmd, 29841 _List_Nil); 29842 }); 29843var $author$project$Page$Group$handleBalanceTabOutput = F3( 29844 function (config, model, output) { 29845 var _v0 = _Utils_Tuple2(output, model.a); 29846 if (_v0.b.$ === 4) { 29847 var transaction = _v0.a; 29848 var loaded = _v0.b.a; 29849 var entryOutput = $author$project$Page$Group$NewEntry$Shared$TransferOutput( 29850 { 29851 lo: transaction.ef, 29852 ce: _List_Nil, 29853 bg: loaded.bA.il, 29854 cj: A2($author$project$Domain$Date$posixToDate, config.al, config.ap), 29855 ck: $elm$core$Maybe$Nothing, 29856 eE: $elm$core$Maybe$Nothing, 29857 mL: transaction.iH, 29858 bu: $elm$core$Maybe$Nothing, 29859 kF: transaction.kE 29860 }); 29861 return A4( 29862 $author$project$Page$Group$runSubmit, 29863 $author$project$Page$Group$OnEntrySaved(loaded.bA.m9), 29864 config, 29865 model, 29866 function (ctx) { 29867 return A3($author$project$GroupOps$newEntry, ctx, loaded, entryOutput); 29868 }); 29869 } else { 29870 return _Utils_Tuple3(model, $elm$core$Platform$Cmd$none, _List_Nil); 29871 } 29872 }); 29873var $author$project$Page$Group$PendingExpense = function (a) { 29874 return {$: 1, a: a}; 29875}; 29876var $author$project$Page$Group$PendingIncome = function (a) { 29877 return {$: 2, a: a}; 29878}; 29879var $author$project$GroupOps$deleteEntry = F3( 29880 function (ctx, loaded, rootId) { 29881 return A3( 29882 $author$project$GroupOps$simpleEvent, 29883 ctx, 29884 loaded, 29885 $author$project$Domain$Event$EntryDeleted( 29886 {aj: rootId})); 29887 }); 29888var $author$project$GroupOps$restoreEntry = F3( 29889 function (ctx, loaded, rootId) { 29890 return A3( 29891 $author$project$GroupOps$simpleEvent, 29892 ctx, 29893 loaded, 29894 $author$project$Domain$Event$EntryUndeleted( 29895 {aj: rootId})); 29896 }); 29897var $author$project$Page$Group$submitEntryAction = F3( 29898 function (config, model, action) { 29899 var _v0 = model.a; 29900 if (_v0.$ === 4) { 29901 var loaded = _v0.a; 29902 return A4( 29903 $author$project$Page$Group$runSubmit, 29904 $author$project$Page$Group$OnEntryActionSaved(loaded.bA.m9), 29905 config, 29906 model, 29907 function (ctx) { 29908 return A2(action, ctx, loaded); 29909 }); 29910 } else { 29911 return _Utils_Tuple3(model, $elm$core$Platform$Cmd$none, _List_Nil); 29912 } 29913 }); 29914var $author$project$Page$Group$handleEntriesTabOutput = F3( 29915 function (config, model, output) { 29916 switch (output.$) { 29917 case 2: 29918 var entryId = output.a; 29919 return A3( 29920 $author$project$Page$Group$submitEntryAction, 29921 config, 29922 model, 29923 F2( 29924 function (ctx, ld) { 29925 return A3($author$project$GroupOps$deleteEntry, ctx, ld, entryId); 29926 })); 29927 case 3: 29928 var entryId = output.a; 29929 return A3( 29930 $author$project$Page$Group$submitEntryAction, 29931 config, 29932 model, 29933 F2( 29934 function (ctx, ld) { 29935 return A3($author$project$GroupOps$restoreEntry, ctx, ld, entryId); 29936 })); 29937 case 0: 29938 var entryId = output.a; 29939 var _v1 = config.d; 29940 if (_v1.$ === 6) { 29941 var groupId = _v1.a; 29942 return _Utils_Tuple3( 29943 model, 29944 $elm$core$Platform$Cmd$none, 29945 _List_fromArray( 29946 [ 29947 $author$project$Page$Group$NavigateTo( 29948 A2( 29949 $author$project$Route$GroupRoute, 29950 groupId, 29951 $author$project$Route$EditEntry(entryId))) 29952 ])); 29953 } else { 29954 return _Utils_Tuple3(model, $elm$core$Platform$Cmd$none, _List_Nil); 29955 } 29956 default: 29957 var entryId = output.a; 29958 var _v2 = _Utils_Tuple2(config.d, model.a); 29959 if ((_v2.a.$ === 6) && (_v2.b.$ === 4)) { 29960 var _v3 = _v2.a; 29961 var groupId = _v3.a; 29962 var loaded = _v2.b.a; 29963 var _v4 = A2($elm$core$Dict$get, entryId, loaded.a6.E); 29964 if (!_v4.$) { 29965 var entryState = _v4.a; 29966 var pending = function () { 29967 var _v5 = entryState.bi.gE; 29968 switch (_v5.$) { 29969 case 0: 29970 var data = _v5.a; 29971 return $author$project$Page$Group$PendingExpense(data); 29972 case 1: 29973 var data = _v5.a; 29974 return $author$project$Page$Group$PendingTransfer(data); 29975 default: 29976 var data = _v5.a; 29977 return $author$project$Page$Group$PendingIncome(data); 29978 } 29979 }(); 29980 return _Utils_Tuple3( 29981 _Utils_update( 29982 model, 29983 { 29984 bv: $elm$core$Maybe$Just(pending) 29985 }), 29986 $elm$core$Platform$Cmd$none, 29987 _List_fromArray( 29988 [ 29989 $author$project$Page$Group$NavigateTo( 29990 A2($author$project$Route$GroupRoute, groupId, $author$project$Route$NewEntry)) 29991 ])); 29992 } else { 29993 return _Utils_Tuple3(model, $elm$core$Platform$Cmd$none, _List_Nil); 29994 } 29995 } else { 29996 return _Utils_Tuple3(model, $elm$core$Platform$Cmd$none, _List_Nil); 29997 } 29998 } 29999 }); 30000var $author$project$Page$Group$handleMembersTabOutput = F3( 30001 function (config, model, output) { 30002 var _v0 = model.a; 30003 if (_v0.$ === 4) { 30004 var loaded = _v0.a; 30005 var submit = function (payload) { 30006 return A4( 30007 $author$project$Page$Group$runSubmit, 30008 $author$project$Page$Group$OnMemberActionSaved(loaded.bA.m9), 30009 config, 30010 model, 30011 function (ctx) { 30012 return A3($author$project$GroupOps$event, ctx, loaded, payload); 30013 }); 30014 }; 30015 switch (output.$) { 30016 case 0: 30017 var memberId = output.a; 30018 return submit( 30019 $author$project$Domain$Event$MemberRetired( 30020 {aj: memberId})); 30021 case 1: 30022 var memberId = output.a; 30023 return submit( 30024 $author$project$Domain$Event$MemberUnretired( 30025 {aj: memberId})); 30026 case 2: 30027 var memberId = output.a; 30028 var _v2 = config.d; 30029 if (_v2.$ === 6) { 30030 var groupId = _v2.a; 30031 return _Utils_Tuple3( 30032 model, 30033 $elm$core$Platform$Cmd$none, 30034 _List_fromArray( 30035 [ 30036 $author$project$Page$Group$NavigateTo( 30037 A2( 30038 $author$project$Route$GroupRoute, 30039 groupId, 30040 $author$project$Route$EditMemberMetadata(memberId))) 30041 ])); 30042 } else { 30043 return _Utils_Tuple3(model, $elm$core$Platform$Cmd$none, _List_Nil); 30044 } 30045 case 3: 30046 var memberId = output.a; 30047 var _v3 = config.d; 30048 if (_v3.$ === 6) { 30049 var groupId = _v3.a; 30050 return _Utils_Tuple3( 30051 model, 30052 $elm$core$Platform$Cmd$none, 30053 _List_fromArray( 30054 [ 30055 $author$project$Page$Group$NavigateTo( 30056 A2( 30057 $author$project$Route$GroupRoute, 30058 groupId, 30059 A2($author$project$Route$MergeMember, memberId, $elm$core$Maybe$Nothing))) 30060 ])); 30061 } else { 30062 return _Utils_Tuple3(model, $elm$core$Platform$Cmd$none, _List_Nil); 30063 } 30064 default: 30065 var memberId = output.a; 30066 var deviceId = config.O.aK; 30067 return submit( 30068 $author$project$Domain$Event$MemberLinked( 30069 { 30070 gd: deviceId, 30071 aj: memberId, 30072 kg: A2($author$project$Domain$GroupState$nextLinkSeq, loaded.a6, deviceId) 30073 })); 30074 } 30075 } else { 30076 return _Utils_Tuple3(model, $elm$core$Platform$Cmd$none, _List_Nil); 30077 } 30078 }); 30079var $author$project$Page$Group$MergeCompleted = 2; 30080var $author$project$Page$Group$MergeStillPending = 1; 30081var $author$project$Page$Group$NotMergeEvent = 0; 30082var $author$project$Translations$toastMergeSuccess = F2( 30083 function (data, _v0) { 30084 var lang = _v0; 30085 if (!lang) { 30086 return 'Merged ' + (data.dY + (' into ' + (data.kz + '.'))); 30087 } else { 30088 return data.dY + (' a été fusionné dans ' + (data.kz + '.')); 30089 } 30090 }); 30091var $author$project$Page$Group$mergeSuccessOutputs = F3( 30092 function (config, model, pm) { 30093 var navOutputs = function () { 30094 var _v1 = config.d; 30095 if ((_v1.$ === 6) && (_v1.b.$ === 7)) { 30096 var gid = _v1.a; 30097 var _v2 = _v1.b; 30098 return _List_fromArray( 30099 [ 30100 $author$project$Page$Group$NavigateTo( 30101 A2( 30102 $author$project$Route$GroupRoute, 30103 gid, 30104 $author$project$Route$Tab(2))) 30105 ]); 30106 } else { 30107 return _List_Nil; 30108 } 30109 }(); 30110 var nameFor = function (mid) { 30111 var _v0 = model.a; 30112 if (_v0.$ === 4) { 30113 var lg = _v0.a; 30114 return A2($author$project$Domain$GroupState$resolveMemberName, lg.a6, mid); 30115 } else { 30116 return mid; 30117 } 30118 }; 30119 var toast = A2( 30120 $author$project$Page$Group$ShowToast, 30121 0, 30122 A2( 30123 $author$project$Translations$toastMergeSuccess, 30124 { 30125 dY: nameFor(pm.dZ), 30126 kz: nameFor(pm.fA) 30127 }, 30128 config.aJ)); 30129 return A2($elm$core$List$cons, toast, navOutputs); 30130 }); 30131var $author$project$Page$Group$handleMergeCompletion = F3( 30132 function (config, envelope, model) { 30133 var _v0 = model.bY; 30134 if (!_v0.$) { 30135 var pm = _v0.a; 30136 if (A2($elm$core$Set$member, envelope.m9, pm.dD)) { 30137 var remainingIds = A2($elm$core$Set$remove, envelope.m9, pm.dD); 30138 return $elm$core$Set$isEmpty(remainingIds) ? _Utils_Tuple3( 30139 _Utils_update( 30140 model, 30141 {bY: $elm$core$Maybe$Nothing}), 30142 2, 30143 A3($author$project$Page$Group$mergeSuccessOutputs, config, model, pm)) : _Utils_Tuple3( 30144 _Utils_update( 30145 model, 30146 { 30147 bY: $elm$core$Maybe$Just( 30148 _Utils_update( 30149 pm, 30150 {dD: remainingIds})) 30151 }), 30152 1, 30153 _List_Nil); 30154 } else { 30155 return _Utils_Tuple3(model, 0, _List_Nil); 30156 } 30157 } else { 30158 return _Utils_Tuple3(model, 0, _List_Nil); 30159 } 30160 }); 30161var $author$project$Domain$Entry$replace = F3( 30162 function (previousMetadata, newId, modified) { 30163 return { 30164 gE: modified, 30165 gM: _Utils_update( 30166 previousMetadata, 30167 { 30168 dg: previousMetadata.dg + 1, 30169 m9: newId, 30170 fg: $elm$core$Maybe$Just(previousMetadata.m9) 30171 }) 30172 }; 30173 }); 30174var $author$project$GroupOps$editEntry = F4( 30175 function (ctx, loaded, originalEntryId, output) { 30176 var _v0 = A2($elm$core$Dict$get, originalEntryId, loaded.a6.E); 30177 if (_v0.$ === 1) { 30178 return $elm$core$Maybe$Nothing; 30179 } else { 30180 var entryState = _v0.a; 30181 var _v1 = $author$project$Infra$IdGen$v4(ctx.s); 30182 var newEntryId = _v1.a; 30183 var idState1 = _v1.b; 30184 var _v2 = A2($author$project$Infra$IdGen$v7, ctx.ap, idState1); 30185 var eventId = _v2.a; 30186 var idStateAfter = _v2.b; 30187 var entry = A3( 30188 $author$project$Domain$Entry$replace, 30189 entryState.bi.gM, 30190 newEntryId, 30191 $author$project$Page$Group$NewEntry$outputToKind(output)); 30192 return $elm$core$Maybe$Just( 30193 A3( 30194 $author$project$GroupOps$attempt, 30195 _Utils_update( 30196 ctx, 30197 {s: idStateAfter}), 30198 function (now) { 30199 return A5( 30200 $author$project$Domain$Event$wrap, 30201 eventId, 30202 now, 30203 $author$project$GroupOps$author(ctx), 30204 $author$project$Domain$Event$EntryModified(entry), 30205 ''); 30206 }, 30207 loaded)); 30208 } 30209 }); 30210var $author$project$Page$Group$handleNewEntryOutput = F3( 30211 function (config, model, entryOutput) { 30212 var _v0 = model.a; 30213 if (_v0.$ === 4) { 30214 var loaded = _v0.a; 30215 var _v1 = config.d; 30216 if ((_v1.$ === 6) && (_v1.b.$ === 4)) { 30217 var entryId = _v1.b.a; 30218 var _v2 = A4( 30219 $author$project$GroupOps$editEntry, 30220 A3( 30221 $author$project$Page$Group$submitContext, 30222 $author$project$Page$Group$OnEntrySaved(loaded.bA.m9), 30223 config, 30224 model), 30225 loaded, 30226 entryId, 30227 entryOutput); 30228 if (!_v2.$) { 30229 var _v3 = _v2.a; 30230 var state = _v3.a; 30231 var cmd = _v3.b; 30232 return _Utils_Tuple3( 30233 _Utils_update( 30234 model, 30235 {s: state.s, ak: state.ak}), 30236 cmd, 30237 _List_Nil); 30238 } else { 30239 return _Utils_Tuple3(model, $elm$core$Platform$Cmd$none, _List_Nil); 30240 } 30241 } else { 30242 return A4( 30243 $author$project$Page$Group$runSubmit, 30244 $author$project$Page$Group$OnEntrySaved(loaded.bA.m9), 30245 config, 30246 model, 30247 function (ctx) { 30248 return A3($author$project$GroupOps$newEntry, ctx, loaded, entryOutput); 30249 }); 30250 } 30251 } else { 30252 return _Utils_Tuple3(model, $elm$core$Platform$Cmd$none, _List_Nil); 30253 } 30254 }); 30255var $author$project$Page$Group$hasLoadedGroup = F2( 30256 function (groupId, model) { 30257 var _v0 = model.a; 30258 if (_v0.$ === 4) { 30259 var loaded = _v0.a; 30260 return _Utils_eq(loaded.bA.m9, groupId); 30261 } else { 30262 return false;
30263 } 30264 }); 30265var $author$project$Infra$Server$isFrozen = $author$project$Infra$Server$isStatus(403); 30266var $author$project$Infra$Server$isNetworkError = function (err) { 30267 _v0$2: 30268 while (true) { 30269 if (!err.$) { 30270 switch (err.a.$) { 30271 case 2: 30272 var _v1 = err.a; 30273 return true; 30274 case 1: 30275 var _v2 = err.a; 30276 return true; 30277 default: 30278 break _v0$2; 30279 } 30280 } else { 30281 break _v0$2; 30282 } 30283 } 30284 return false; 30285}; 30286var $author$project$Infra$Server$isNotFound = $author$project$Infra$Server$isStatus(404); 30287var $author$project$Infra$Server$isQuotaExceeded = $author$project$Infra$Server$isStatus(507); 30288var $author$project$Infra$Server$isRateLimited = $author$project$Infra$Server$isStatus(429); 30289var $author$project$Infra$Server$isUnauthorized = $author$project$Infra$Server$isStatus(401); 30290var $author$project$Page$Group$markUnseenEvents = F2( 30291 function (model, result) { 30292 var group = result.d9; 30293 var viewerRoot = A2($author$project$Page$Group$currentUserRootId, model, group); 30294 var foreignIds = A2( 30295 $elm$core$List$map, 30296 function ($) { 30297 return $.m9; 30298 }, 30299 A2( 30300 $elm$core$List$filter, 30301 function (e) { 30302 return _Utils_eq(viewerRoot, $elm$core$Maybe$Nothing) || (!_Utils_eq( 30303 A2($author$project$Domain$GroupState$resolveMemberRootId, group.a6, e.q0), 30304 viewerRoot)); 30305 }, 30306 result.gU)); 30307 return $elm$core$List$isEmpty(foreignIds) ? result : _Utils_update( 30308 result, 30309 { 30310 d9: _Utils_update( 30311 group, 30312 { 30313 kP: A2( 30314 $elm$core$Set$union, 30315 group.kP, 30316 $elm$core$Set$fromList(foreignIds)) 30317 }) 30318 }); 30319 }); 30320var $author$project$Domain$MigrationCuration$keep = F3( 30321 function (order, selection, envelope) { 30322 if ($author$project$Domain$MigrationCuration$isGenesis(envelope)) { 30323 return true; 30324 } else { 30325 var _v0 = A2($elm$core$Dict$get, envelope.q0, selection); 30326 if (_v0.$ === 1) { 30327 return true; 30328 } else { 30329 if (!_v0.a.$) { 30330 var _v1 = _v0.a; 30331 return false; 30332 } else { 30333 var boundary = _v0.a.a; 30334 var _v2 = A2($elm$core$Dict$get, envelope.m9, order); 30335 if (!_v2.$) { 30336 var seq = _v2.a; 30337 return _Utils_cmp(seq, boundary) < 1; 30338 } else { 30339 return true; 30340 } 30341 } 30342 } 30343 } 30344 }); 30345var $author$project$Domain$MigrationCuration$curateEvents = F3( 30346 function (order, selection, events) { 30347 return A2( 30348 $elm$core$List$filter, 30349 A2($author$project$Domain$MigrationCuration$keep, order, selection), 30350 events); 30351 }); 30352var $author$project$GroupOps$migrateGroup = F5( 30353 function (ctx, onComplete, order, selection, loaded) { 30354 var loadedSummary = loaded.bA; 30355 var oldSummary = _Utils_update( 30356 loadedSummary, 30357 {gA: true}); 30358 var _v0 = $author$project$Infra$IdGen$groupId(ctx.s); 30359 var newId = _v0.a; 30360 var idStateAfter = _v0.b; 30361 var task = A2( 30362 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$andThen, 30363 function (_v1) { 30364 var verified = _v1.a; 30365 var key = _v1.b; 30366 var newSummary = A4( 30367 $author$project$Domain$GroupState$summarize, 30368 ctx.O.aK, 30369 newId, 30370 ctx.ap, 30371 A2($author$project$Domain$GroupState$applyEvents, verified, $author$project$Domain$GroupState$empty)); 30372 return A2( 30373 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$map, 30374 function (_v2) { 30375 return {jp: newSummary, jt: oldSummary}; 30376 }, 30377 A6( 30378 $author$project$Infra$Storage$saveGroup, 30379 ctx.de, 30380 newSummary, 30381 $elm$core$Maybe$Just( 30382 $author$project$WebCrypto$Symmetric$exportKey(key)), 30383 0, 30384 verified, 30385 $elm$core$Maybe$Nothing)); 30386 }, 30387 A3( 30388 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$map2, 30389 $elm$core$Tuple$pair, 30390 A2( 30391 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$map, 30392 A2($author$project$Domain$MigrationCuration$curateEvents, order, selection), 30393 A2($author$project$Infra$EventVerification$filterVerifiedEvents, $author$project$Domain$GroupState$empty, loaded.iC)), 30394 $author$project$Infra$Crypto$generateGroupKey)); 30395 return A2( 30396 $elm$core$Tuple$mapFirst, 30397 function (r) { 30398 return {s: idStateAfter, ak: r}; 30399 }, 30400 A3( 30401 $author$project$Infra$ConcurrentTaskExtra$andRun, 30402 onComplete, 30403 task, 30404 _Utils_Tuple2(ctx.ak, $elm$core$Platform$Cmd$none))); 30405 }); 30406var $author$project$Domain$TamperSignals$isClean = function (s) { 30407 return $elm$core$Dict$isEmpty(s.bm) && ((!s.bZ) && ((!s.cP) && (!s.cC))); 30408}; 30409var $author$project$Domain$TamperSignals$encode = function (s) { 30410 return $elm$json$Json$Encode$object( 30411 _Utils_ap( 30412 _List_fromArray( 30413 [ 30414 _Utils_Tuple2( 30415 'fa', 30416 A3($elm$json$Json$Encode$dict, $elm$core$Basics$identity, $elm$json$Json$Encode$int, s.bm)), 30417 _Utils_Tuple2( 30418 'rl', 30419 $elm$json$Json$Encode$int(s.bZ)), 30420 _Utils_Tuple2( 30421 'rw', 30422 $elm$json$Json$Encode$int(s.cP)), 30423 _Utils_Tuple2( 30424 'mm', 30425 $elm$json$Json$Encode$int(s.cC)) 30426 ]), 30427 function () { 30428 var _v0 = s.bT; 30429 if (!_v0.$) { 30430 var t = _v0.a; 30431 return _List_fromArray( 30432 [ 30433 _Utils_Tuple2( 30434 'at', 30435 $elm$json$Json$Encode$int( 30436 $elm$time$Time$posixToMillis(t))) 30437 ]); 30438 } else { 30439 return _List_Nil; 30440 } 30441 }())); 30442}; 30443var $author$project$Infra$Storage$saveTamperSignals = F3( 30444 function (db, groupId, signals) { 30445 return A4( 30446 $author$project$IndexedDb$putAt, 30447 db, 30448 $author$project$Infra$Storage$tamperSignalsStore, 30449 $author$project$IndexedDb$StringKey(groupId),
30450 $author$project$Domain$TamperSignals$encode(signals)); 30451 }); 30452var $author$project$Infra$Server$subscribeToGroup = function (ctx) { 30453 return A2( 30454 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$andThen, 30455 function (secret) { 30456 return $andrewMacmurray$elm_concurrent_task$ConcurrentTask$define( 30457 { 30458 k: $elm$json$Json$Encode$object( 30459 _List_fromArray( 30460 [ 30461 _Utils_Tuple2( 30462 'url', 30463 $elm$json$Json$Encode$string(ctx.hl)), 30464 _Utils_Tuple2( 30465 'groupId', 30466 $elm$json$Json$Encode$string(ctx.ct)), 30467 _Utils_Tuple2( 30468 'secret', 30469 $elm$json$Json$Encode$string(secret)) 30470 ])), 30471 l: $andrewMacmurray$elm_concurrent_task$ConcurrentTask$expectNoErrors, 30472 m: $andrewMacmurray$elm_concurrent_task$ConcurrentTask$expectWhatever, 30473 n: 'relay:subscribe' 30474 }); 30475 }, 30476 A2( 30477 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$mapError, 30478 $author$project$Infra$Server$CryptoError, 30479 $author$project$Infra$Crypto$deriveRelaySecret(ctx.gs))); 30480}; 30481var $author$project$GroupOps$postSyncTasks = F3( 30482 function (db, ctx, result) { 30483 var write = F2( 30484 function (pushState, events) { 30485 return $elm$core$List$isEmpty(events) ? $andrewMacmurray$elm_concurrent_task$ConcurrentTask$succeed(0) : A4($author$project$Infra$Storage$saveEvents, db, ctx.ct, pushState, events); 30486 }); 30487 var persistEventsThenCursor = A2( 30488 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$andThen, 30489 function (_v3) { 30490 return A3($author$project$Infra$Storage$saveSyncCursor, db, ctx.ct, result.g5); 30491 }, 30492 A2( 30493 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$andThen, 30494 function (_v2) { 30495 return A2(write, 0, result.g9); 30496 }, 30497 A2( 30498 write, 30499 1, 30500 _Utils_ap(result.gU, result.fN)))); 30501 return A2( 30502 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$map, 30503 function (_v1) { 30504 return 0; 30505 }, 30506 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$batch( 30507 A2( 30508 $elm$core$List$filterMap, 30509 $elm$core$Basics$identity, 30510 _List_fromArray( 30511 [ 30512 $author$project$Domain$TamperSignals$isClean(result.d9.c_) ? $elm$core$Maybe$Nothing : $elm$core$Maybe$Just( 30513 A3($author$project$Infra$Storage$saveTamperSignals, db, ctx.ct, result.d9.c_)), 30514 $elm$core$Maybe$Just(persistEventsThenCursor), 30515 result.d9.bA.gA ? $elm$core$Maybe$Nothing : $elm$core$Maybe$Just( 30516 A2( 30517 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$onError, 30518 function (_v0) { 30519 return $andrewMacmurray$elm_concurrent_task$ConcurrentTask$succeed(0); 30520 }, 30521 $author$project$Infra$Server$subscribeToGroup(ctx))) 30522 ])))); 30523 }); 30524var $author$project$Domain$MigrationCuration$preview = F4( 30525 function (order, self, selection, events) { 30526 var netOf = F2( 30527 function (st, rootId) { 30528 return A2( 30529 $elm$core$Maybe$withDefault, 30530 0, 30531 A2( 30532 $elm$core$Maybe$map, 30533 function ($) { 30534 return $.e2; 30535 }, 30536 A2($elm$core$Dict$get, rootId, st.ly))); 30537 }); 30538 var kept = A3($author$project$Domain$MigrationCuration$curateEvents, order, selection, events); 30539 var state = A2($author$project$Domain$GroupState$applyEvents, kept, $author$project$Domain$GroupState$empty); 30540 var selfRoot = A2($author$project$Domain$GroupState$resolveMemberRootId, state, self); 30541 var baseline = A2($author$project$Domain$GroupState$applyEvents, events, $author$project$Domain$GroupState$empty); 30542 var rows = A2( 30543 $elm$core$List$sortBy, 30544 function (row) { 30545 return _Utils_Tuple2( 30546 row.dl ? 0 : 1, 30547 -$elm$core$Basics$abs(row.gb)); 30548 }, 30549 A2( 30550 $elm$core$List$filterMap, 30551 function (_v3) { 30552 var rootId = _v3.a; 30553 var isSelf = _Utils_eq( 30554 $elm$core$Maybe$Just(rootId), 30555 selfRoot); 30556 var delta = A2(netOf, state, rootId) - A2(netOf, baseline, rootId); 30557 return ((!(!delta)) || isSelf) ? $elm$core$Maybe$Just( 30558 { 30559 hW: A2(netOf, state, rootId), 30560 gb: delta, 30561 m9: rootId, 30562 dl: isSelf, 30563 i6: A2($author$project$Domain$GroupState$resolveMemberName, state, rootId) 30564 }) : $elm$core$Maybe$Nothing; 30565 }, 30566 $elm$core$Dict$toList( 30567 A2( 30568 $elm$core$Dict$filter, 30569 F2( 30570 function (_v2, member) { 30571 return !member.nt; 30572 }), 30573 state.r)))); 30574 return { 30575 ly: rows, 30576 h8: $elm$core$List$length(kept),
30577 eF: $elm$core$List$length(events) - $elm$core$List$length(kept), 30578 E: $elm$core$Dict$size( 30579 A2( 30580 $elm$core$Dict$filter, 30581 F2( 30582 function (_v0, entry) { 30583 return !entry.gB; 30584 }), 30585 state.E)), 30586 r: $elm$core$Dict$size( 30587 A2( 30588 $elm$core$Dict$filter, 30589 F2( 30590 function (_v1, member) { 30591 return !member.nt; 30592 }), 30593 state.r)) 30594 }; 30595 }); 30596var $author$project$Domain$TamperSignals$recordManifestMismatch = F2( 30597 function (at, s) { 30598 return _Utils_update( 30599 s, 30600 { 30601 bT: $elm$core$Maybe$Just(at), 30602 cC: s.cC + 1 30603 }); 30604 }); 30605var $author$project$Domain$TamperSignals$recordRateLimitHit = F2( 30606 function (at, s) { 30607 return _Utils_update( 30608 s, 30609 { 30610 bT: $elm$core$Maybe$Just(at), 30611 bZ: s.bZ + 1 30612 }); 30613 }); 30614var $author$project$Page$Group$recordTamper = F4( 30615 function (config, bump, loaded, model) { 30616 var bumped = bump(loaded.c_); 30617 return A2( 30618 $elm$core$Tuple$mapFirst, 30619 function (r) { 30620 return _Utils_update( 30621 model, 30622 { 30623 ak: r, 30624 a: $author$project$Page$Group$WorkspaceLoaded( 30625 _Utils_update( 30626 loaded, 30627 {c_: bumped})) 30628 }); 30629 }, 30630 A3( 30631 $author$project$Infra$ConcurrentTaskExtra$andRun, 30632 $author$project$Page$Group$OnTamperSignalsSaved, 30633 A3($author$project$Infra$Storage$saveTamperSignals, config.de, loaded.bA.m9, bumped), 30634 _Utils_Tuple2(model.ak, $elm$core$Platform$Cmd$none))); 30635 }); 30636var $author$project$Page$Group$routeToGroupView = function (route) { 30637 if (route.$ === 6) { 30638 var groupView = route.b; 30639 return groupView; 30640 } else { 30641 return $author$project$Route$Tab(0); 30642 } 30643}; 30644var $author$project$Page$Group$refreshPagesAfterSync = F2( 30645 function (config, model) { 30646 var _v0 = _Utils_Tuple2( 30647 $author$project$Page$Group$routeToGroupView(config.d), 30648 model.a); 30649 if ((_v0.a.$ === 11) && (_v0.b.$ === 4)) { 30650 var _v1 = _v0.a; 30651 var loaded = _v0.b.a; 30652 return A3($author$project$Page$Group$reloadDiagnosticsIfStale, config, loaded, model); 30653 } else { 30654 return _Utils_Tuple2(model, $elm$core$Platform$Cmd$none); 30655 } 30656 }); 30657var $author$project$Page$Group$registerNotifyTopic = F2( 30658 function (config, model) { 30659 var _v0 = _Utils_Tuple3(model.a, config.g7, config.jS); 30660 if (((_v0.a.$ === 4) && (!_v0.b.$)) && (!_v0.c.$)) { 30661 var loaded = _v0.a.a; 30662 var pushServerUrl = _v0.b.a; 30663 var pushSubscription = _v0.c.a; 30664 var _v1 = _Utils_Tuple2( 30665 loaded.bA.gC, 30666 A2($author$project$Page$Group$currentUserRootId, model, loaded)); 30667 if (_v1.a && (!_v1.b.$)) { 30668 var rootId = _v1.b.a; 30669 var register = A2( 30670 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$andThen, 30671 function (topic) { 30672 return A2( 30673 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$andThenDo, 30674 A2( 30675 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$mapError, 30676 function (_v8) { 30677 return 0; 30678 }, 30679 A3($author$project$Infra$Storage$saveNotifyTopic, config.de, loaded.bA.m9, topic)), 30680 A2( 30681 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$mapError, 30682 function (_v7) { 30683 return 0; 30684 }, 30685 $author$project$Infra$PushServer$setGroupNotification( 30686 {gC: true, g7: pushServerUrl, d$: pushSubscription, d4: topic}))); 30687 }, 30688 A2( 30689 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$mapError, 30690 function (_v6) { 30691 return 0; 30692 }, 30693 A2($author$project$Infra$Crypto$deriveNotifyTopic, loaded.gs, rootId))); 30694 return A2( 30695 $elm$core$Tuple$mapFirst, 30696 function (runner) { 30697 return _Utils_update( 30698 model, 30699 {ak: runner}); 30700 }, 30701 A3( 30702 $author$project$Infra$ConcurrentTaskExtra$andRun, 30703 function (_v2) { 30704 return $author$project$Page$Group$NoOp; 30705 }, 30706 A2( 30707 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$onError, 30708 function (_v5) { 30709 return $andrewMacmurray$elm_concurrent_task$ConcurrentTask$succeed(0); 30710 }, 30711 A2( 30712 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$andThen, 30713 function (existing) { 30714 if (!existing.$) { 30715 return $andrewMacmurray$elm_concurrent_task$ConcurrentTask$succeed(0); 30716 } else { 30717 return register; 30718 } 30719 }, 30720 A2( 30721 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$mapError, 30722 function (_v3) { 30723 return 0; 30724 }, 30725 A2($author$project$Infra$Storage$loadNotifyTopic, config.de, loaded.bA.m9)))), 30726 _Utils_Tuple2(model.ak, $elm$core$Platform$Cmd$none))); 30727 } else { 30728 return _Utils_Tuple2(model, $elm$core$Platform$Cmd$none); 30729 } 30730 } else { 30731 return _Utils_Tuple2(model, $elm$core$Platform$Cmd$none); 30732 } 30733 }); 30734var $author$project$Infra$Storage$clearSyncCursor = F2( 30735 function (db, groupId) { 30736 return A3( 30737 $author$project$IndexedDb$delete, 30738 db, 30739 $author$project$Infra$Storage$syncCursorsStore, 30740 $author$project$IndexedDb$StringKey(groupId)); 30741 }); 30742var $author$project$GroupOps$requeueFullLog = F2( 30743 function (db, loaded) { 30744 return _Utils_Tuple2( 30745 _Utils_update( 30746 loaded, 30747 { 30748 cZ: $elm$core$Maybe$Nothing, 30749 bC: $elm$core$Set$fromList( 30750 A2( 30751 $elm$core$List$map, 30752 function ($) { 30753 return $.m9; 30754 }, 30755 loaded.iC)) 30756 }), 30757 A2( 30758 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$andThen, 30759 function (_v0) { 30760 return A2($author$project$Infra$Storage$clearSyncCursor, db, loaded.bA.m9); 30761 }, 30762 A4($author$project$Infra$Storage$saveEvents, db, loaded.bA.m9, 0, loaded.iC))); 30763 }); 30764var $author$project$Infra$Storage$saveSuspicionDismissals = F3( 30765 function (db, groupId, keys) { 30766 return A4( 30767 $author$project$IndexedDb$putAt, 30768 db, 30769 $author$project$Infra$Storage$suspicionDismissalsStore, 30770 $author$project$IndexedDb$StringKey(groupId), 30771 A2($elm$json$Json$Encode$set, $elm$json$Json$Encode$string, keys)); 30772 }); 30773var $author$project$Infra$Server$serverEventDecoder = A2( 30774 $elm$json$Json$Decode$map, 30775 function (gid) { 30776 return {ct: gid}; 30777 }, 30778 A2($elm$json$Json$Decode$field, 'groupId', $elm$json$Json$Decode$string)); 30779var $author$project$Page$Group$OnServerGroupCreated = F2( 30780 function (a, b) { 30781 return {$: 26, a: a, b: b}; 30782 });
30783var $author$project$Page$Group$SyncCreatingRelay = function (a) { 30784 return {$: 3, a: a}; 30785}; 30786var $author$project$Page$Group$startServerGroupCreation = F3( 30787 function (config, loaded, model) { 30788 return A2( 30789 $elm$core$Tuple$mapFirst, 30790 function (runner) { 30791 return _Utils_update( 30792 model, 30793 { 30794 ak: runner, 30795 R: $author$project$Page$Group$SyncCreatingRelay(loaded.bA.m9) 30796 }); 30797 }, 30798 A3( 30799 $author$project$Infra$ConcurrentTaskExtra$andRun, 30800 $author$project$Page$Group$OnServerGroupCreated(loaded.bA.m9), 30801 $author$project$Infra$Server$createGroupOnServer( 30802 {f3: config.O.aK, ct: loaded.bA.m9, gs: loaded.gs, hl: config.hl}), 30803 _Utils_Tuple2(model.ak, $elm$core$Platform$Cmd$none))); 30804 }); 30805var $author$project$Page$Group$submitMemberMetadata = F4( 30806 function (config, model, loaded, output) { 30807 var onSaved = $author$project$Page$Group$OnMemberActionSaved(loaded.bA.m9); 30808 var submitIf = F3( 30809 function (condition, makeEvent, _v1) { 30810 var mdl = _v1.a; 30811 var cmd = _v1.b; 30812 var outs = _v1.c; 30813 if (condition) { 30814 var _v0 = A4($author$project$Page$Group$runSubmit, onSaved, config, mdl, makeEvent); 30815 var mdl2 = _v0.a; 30816 var cmd2 = _v0.b; 30817 var outs2 = _v0.c; 30818 return _Utils_Tuple3( 30819 mdl2, 30820 $elm$core$Platform$Cmd$batch( 30821 _List_fromArray( 30822 [cmd, cmd2])), 30823 _Utils_ap(outs, outs2)); 30824 } else { 30825 return _Utils_Tuple3(mdl, cmd, outs); 30826 } 30827 }); 30828 var oldMetadata = A2( 30829 $elm$core$Maybe$withDefault, 30830 $author$project$Domain$Member$emptyMetadata, 30831 A2( 30832 $elm$core$Maybe$map, 30833 function ($) { 30834 return $.ji; 30835 }, 30836 A2($elm$core$Dict$get, output.e_, loaded.a6.r))); 30837 var nameChanged = !_Utils_eq(output.e4, output.e6); 30838 var metadataChanged = !_Utils_eq(output.ji, oldMetadata); 30839 return ((!metadataChanged) && (!nameChanged)) ? _Utils_Tuple3( 30840 model, 30841 $elm$core$Platform$Cmd$none, 30842 _List_fromArray( 30843 [ 30844 $author$project$Page$Group$NavigateTo( 30845 A2( 30846 $author$project$Route$GroupRoute, 30847 loaded.bA.m9, 30848 $author$project$Route$Tab(2))) 30849 ])) : A3( 30850 submitIf, 30851 nameChanged, 30852 function (ctx) { 30853 return A3( 30854 $author$project$GroupOps$event, 30855 ctx, 30856 loaded, 30857 $author$project$Domain$Event$MemberRenamed( 30858 {e4: output.e4, e6: output.e6, aj: output.e_})); 30859 }, 30860 A3( 30861 submitIf, 30862 metadataChanged, 30863 function (ctx) { 30864 return A3( 30865 $author$project$GroupOps$event, 30866 ctx, 30867 loaded, 30868 $author$project$Domain$Event$MemberMetadataUpdated( 30869 {ji: output.ji, aj: output.e_})); 30870 }, 30871 _Utils_Tuple3(model, $elm$core$Platform$Cmd$none, _List_Nil))); 30872 }); 30873var $author$project$GroupOps$eventWithId = F3( 30874 function (ctx, loaded, payload) { 30875 var _v0 = A2($author$project$Infra$IdGen$v7, ctx.ap, ctx.s); 30876 var eventId = _v0.a; 30877 var idStateAfter = _v0.b; 30878 var _v1 = A3( 30879 $author$project$GroupOps$attempt, 30880 _Utils_update( 30881 ctx, 30882 {s: idStateAfter}), 30883 function (now) { 30884 return A5( 30885 $author$project$Domain$Event$wrap, 30886 eventId, 30887 now, 30888 $author$project$GroupOps$author(ctx), 30889 payload, 30890 ''); 30891 }, 30892 loaded); 30893 var state = _v1.a; 30894 var cmd = _v1.b; 30895 return _Utils_Tuple3(state, cmd, eventId); 30896 }); 30897var $author$project$Page$Group$submitModifyEntry = F4( 30898 function (ctx, loaded, original, rewritten) { 30899 var _v0 = $author$project$Infra$IdGen$v4(ctx.s); 30900 var newEntryId = _v0.a; 30901 var idStateAfter = _v0.b; 30902 var modifiedEntry = A3($author$project$Domain$Entry$replace, original.gM, newEntryId, rewritten.gE); 30903 return A3( 30904 $author$project$GroupOps$eventWithId, 30905 _Utils_update( 30906 ctx, 30907 {s: idStateAfter}), 30908 loaded, 30909 $author$project$Domain$Event$EntryModified(modifiedEntry)); 30910 }); 30911var $author$project$Page$Group$submitMerge = F4( 30912 function (config, model, loaded, mergeData) { 30913 var onSaved = $author$project$Page$Group$OnMemberActionSaved(loaded.bA.m9); 30914 var submitOne = F2( 30915 function (makeEvent, _v3) { 30916 var mdl = _v3.a; 30917 var accCmds = _v3.b; 30918 var accIds = _v3.c; 30919 var _v2 = makeEvent( 30920 A3($author$project$Page$Group$submitContext, onSaved, config, mdl)); 30921 var state = _v2.a; 30922 var cmd = _v2.b; 30923 var eventId = _v2.c; 30924 return _Utils_Tuple3( 30925 _Utils_update( 30926 mdl, 30927 {s: state.s, ak: state.ak}), 30928 A2($elm$core$List$cons, cmd, accCmds), 30929 A2($elm$core$Set$insert, eventId, accIds)); 30930 }); 30931 var runAction = F2( 30932 function (action, acc) { 30933 switch (action.$) { 30934 case 0: 30935 var original = action.a.jA; 30936 var rewritten = action.a.pV; 30937 return A2( 30938 submitOne, 30939 function (ctx) { 30940 return A4($author$project$Page$Group$submitModifyEntry, ctx, loaded, original, rewritten); 30941 }, 30942 acc); 30943 case 1: 30944 var original = action.a.jA; 30945 return A2( 30946 submitOne, 30947 function (ctx) { 30948 return A3( 30949 $author$project$GroupOps$eventWithId, 30950 ctx, 30951 loaded, 30952 $author$project$Domain$Event$EntryDeleted( 30953 {aj: original.gM.aj})); 30954 }, 30955 acc); 30956 case 2: 30957 var pref = action.a; 30958 return A2( 30959 submitOne, 30960 function (ctx) { 30961 return A3( 30962 $author$project$GroupOps$eventWithId, 30963 ctx, 30964 loaded, 30965 $author$project$Domain$Event$SettlementPreferencesUpdated(pref)); 30966 }, 30967 acc); 30968 default: 30969 return A2( 30970 submitOne, 30971 function (ctx) { 30972 return A3( 30973 $author$project$GroupOps$eventWithId, 30974 ctx, 30975 loaded, 30976 $author$project$Domain$Event$MemberRetired( 30977 {aj: mergeData.dZ})); 30978 }, 30979 acc); 30980 } 30981 }); 30982 var _v0 = A3( 30983 $elm$core$List$foldl, 30984 runAction, 30985 _Utils_Tuple3(model, _List_Nil, $elm$core$Set$empty), 30986 mergeData.pu); 30987 var finalModel = _v0.a; 30988 var cmds = _v0.b; 30989 var ids = _v0.c; 30990 return _Utils_Tuple3( 30991 _Utils_update( 30992 finalModel, 30993 { 30994 bY: $elm$core$Maybe$Just( 30995 {dD: ids, dZ: mergeData.dZ, fA: mergeData.fA}) 30996 }), 30997 $elm$core$Platform$Cmd$batch(cmds), 30998 _List_Nil); 30999 }); 31000var $author$project$Translations$toastEntryActionError = function (_v0) { 31001 var lang = _v0; 31002 if (!lang) { 31003 return 'Failed to update entry.'; 31004 } else { 31005 return 'Ãchec de la mise à jour.'; 31006 } 31007}; 31008var $author$project$Translations$toastEntrySaveError = function (_v0) { 31009 var lang = _v0; 31010 if (!lang) { 31011 return 'Failed to save entry.'; 31012 } else { 31013 return 'Ãchec de l\'enregistrement.'; 31014 } 31015}; 31016var $author$project$Translations$toastGroupFull = function (_v0) { 31017 var lang = _v0; 31018 if (!lang) { 31019 return 'This group reached the server\'s storage limit â new changes can\'t sync. Your data is safe on this device; export a backup.'; 31020 } else { 31021 return 'Ce groupe a atteint la limite de stockage du serveur â les nouvelles modifications ne peuvent plus se synchroniser. Tes données sont en sécurité sur cet appareil ; exporte une sauvegarde.'; 31022 } 31023}; 31024var $author$project$Translations$toastGroupSettingsError = function (_v0) { 31025 var lang = _v0; 31026 if (!lang) { 31027 return 'Failed to save group settings.'; 31028 } else { 31029 return 'Ãchec de la sauvegarde des paramètres.'; 31030 } 31031}; 31032var $author$project$Translations$toastMemberActionError = function (_v0) { 31033 var lang = _v0; 31034 if (!lang) { 31035 return 'Failed to update member.'; 31036 } else { 31037 return 'Ãchec de la mise à jour du membre.'; 31038 } 31039}; 31040var $author$project$Translations$toastMigrated = function (_v0) { 31041 var lang = _v0; 31042 if (!lang) { 31043 return 'Migrated to a new group. Share the new invite link with trusted members only.'; 31044 } else { 31045 return 'Migration effectuée. Partage le nouveau lien d\'invitation uniquement avec des membres de confiance.'; 31046 } 31047}; 31048var $author$project$Translations$toastRateLimited = function (_v0) { 31049 var lang = _v0; 31050 if (!lang) { 31051 return 'Too much data synced recently. New changes will sync again later.'; 31052 } else { 31053 return 'Trop de données synchronisées récemment. Les nouvelles modifications se synchroniseront à nouveau plus tard.'; 31054 } 31055}; 31056var $author$project$Translations$toastSettlementRecorded = function (_v0) { 31057 var lang = _v0; 31058 if (!lang) { 31059 return 'Settlement recorded.'; 31060 } else { 31061 return 'Règlement enregistré.'; 31062 } 31063}; 31064var $author$project$Translations$toastSyncError = F2( 31065 function (details, _v0) { 31066 var lang = _v0; 31067 if (!lang) { 31068 return 'Sync failed: ' + details; 31069 } else { 31070 return 'Ãchec de la synchronisation : ' + details; 31071 } 31072 }); 31073var $author$project$Translations$toastSyncSaveError = function (_v0) { 31074 var lang = _v0; 31075 if (!lang) { 31076 return 'Failed to save synced changes on this device.'; 31077 } else { 31078 return 'Ãchec de l\'enregistrement des modifications synchronisées sur cet appareil.'; 31079 } 31080}; 31081var $author$project$Page$Group$toggleArchiveGroup = F3( 31082 function (config, model, loaded) { 31083 var archiving = !loaded.bA.gA; 31084 var updatedSummary = {f2: loaded.bA.f2, il: loaded.bA.il, m9: loaded.bA.m9, gA: archiving, gC: loaded.bA.gC && (!archiving), gF: loaded.bA.gF, gL: loaded.bA.gL, gS: loaded.bA.gS, bW: loaded.bA.bW}; 31085 var _v0 = A3( 31086 $author$project$Page$Group$queueSummaryOperation, 31087 config, 31088 $author$project$Page$Group$SaveSummary(updatedSummary), 31089 _Utils_update( 31090 model, 31091 {
31092 a: $author$project$Page$Group$WorkspaceLoaded( 31093 _Utils_update( 31094 loaded, 31095 {bA: updatedSummary})) 31096 })); 31097 var savedModel = _v0.a; 31098 var saveCmd = _v0.b; 31099 if (archiving) { 31100 var shouldUnsubscribe = loaded.bA.gC || A2($elm$core$Dict$member, loaded.bA.m9, model.K); 31101 var _v1 = function () { 31102 var _v2 = _Utils_Tuple2( 31103 shouldUnsubscribe, 31104 A2($author$project$Page$Group$currentUserRootId, model, loaded)); 31105 if (_v2.a && (!_v2.b.$)) { 31106 var rootId = _v2.b.a; 31107 return A5( 31108 $author$project$Page$Group$requestNotification, 31109 config, 31110 updatedSummary.m9, 31111 _Utils_Tuple2(loaded.gs, rootId), 31112 $author$project$Page$Group$UnsubscribeBestEffort, 31113 savedModel); 31114 } else { 31115 return _Utils_Tuple2(savedModel, $elm$core$Platform$Cmd$none); 31116 } 31117 }(); 31118 var notificationModel = _v1.a; 31119 var notificationCmd = _v1.b; 31120 return function (_v4) { 31121 var r = _v4.a; 31122 var cmd = _v4.b; 31123 return _Utils_Tuple3( 31124 _Utils_update( 31125 notificationModel, 31126 {ak: r}), 31127 cmd, 31128 _List_fromArray( 31129 [ 31130 $author$project$Page$Group$UpdateGroupSummary(updatedSummary), 31131 $author$project$Page$Group$NavigateTo($author$project$Route$Home) 31132 ])); 31133 }( 31134 A3( 31135 $author$project$Infra$ConcurrentTaskExtra$andRun, 31136 function (_v3) { 31137 return $author$project$Page$Group$NoOp; 31138 }, 31139 $author$project$Infra$Server$unsubscribeFromGroup(updatedSummary.m9), 31140 _Utils_Tuple2( 31141 notificationModel.ak, 31142 $elm$core$Platform$Cmd$batch( 31143 _List_fromArray( 31144 [saveCmd, notificationCmd]))))); 31145 } else { 31146 var _v5 = A3($author$project$Page$Group$triggerSyncInternal, config, updatedSummary.m9, savedModel); 31147 var syncModel = _v5.a; 31148 var syncCmd = _v5.b; 31149 return _Utils_Tuple3( 31150 syncModel, 31151 $elm$core$Platform$Cmd$batch( 31152 _List_fromArray( 31153 [saveCmd, syncCmd])), 31154 _List_fromArray( 31155 [ 31156 $author$project$Page$Group$UpdateGroupSummary(updatedSummary) 31157 ])); 31158 } 31159 }); 31160var $author$project$Page$Group$PersistNotification = F2( 31161 function (a, b) { 31162 return {$: 0, a: a, b: b}; 31163 }); 31164var $author$project$Page$Group$toggleGroupNotification = F4( 31165 function (config, model, loaded, memberRootId) { 31166 var currentDesired = A2( 31167 $elm$core$Maybe$withDefault, 31168 loaded.bA.gC, 31169 A2( 31170 $elm$core$Maybe$map, 31171 A2( 31172 $elm$core$Basics$composeR, 31173 function ($) { 31174 return $.U; 31175 }, 31176 $author$project$Page$Group$notificationTarget), 31177 A2($elm$core$Dict$get, loaded.bA.m9, model.K))); 31178 var intent = A2($author$project$Page$Group$PersistNotification, !currentDesired, loaded.bA); 31179 return function (_v0) { 31180 var nextModel = _v0.a; 31181 var cmd = _v0.b; 31182 return _Utils_Tuple3(nextModel, cmd, _List_Nil); 31183 }( 31184 A5( 31185 $author$project$Page$Group$requestNotification, 31186 config, 31187 loaded.bA.m9, 31188 _Utils_Tuple2(loaded.gs, memberRootId), 31189 intent, 31190 model)); 31191 }); 31192var $author$project$Page$Group$ActivityTab$toggleSet = F2( 31193 function (item, set) { 31194 return A2($elm$core$Set$member, item, set) ? A2($elm$core$Set$remove, item, set) : A2($elm$core$Set$insert, item, set); 31195 }); 31196var $author$project$Page$Group$ActivityTab$updateFilters = F2( 31197 function (transform, data) { 31198 return _Utils_update( 31199 data, 31200 { 31201 a5: transform(data.a5) 31202 }); 31203 }); 31204var $author$project$Page$Group$ActivityTab$update = F2( 31205 function (msg, _v0) { 31206 var data = _v0; 31207 switch (msg.$) { 31208 case 0: 31209 return _Utils_update( 31210 data, 31211 {cS: !data.cS}); 31212 case 1: 31213 var typeStr = msg.a; 31214 return A2( 31215 $author$project$Page$Group$ActivityTab$updateFilters, 31216 function (f) { 31217 return _Utils_update( 31218 f, 31219 { 31220 ec: A2($author$project$Page$Group$ActivityTab$toggleSet, typeStr, f.ec) 31221 }); 31222 }, 31223 data); 31224 case 2: 31225 var memberId = msg.a; 31226 return A2( 31227 $author$project$Page$Group$ActivityTab$updateFilters, 31228 function (f) { 31229 return _Utils_update( 31230 f, 31231 { 31232 ed: A2($author$project$Page$Group$ActivityTab$toggleSet, memberId, f.ed) 31233 }); 31234 }, 31235 data); 31236 case 3: 31237 var memberId = msg.a; 31238 return A2( 31239 $author$project$Page$Group$ActivityTab$updateFilters, 31240 function (f) { 31241 return _Utils_update( 31242 f, 31243 { 31244 i2: A2($author$project$Page$Group$ActivityTab$toggleSet, memberId, f.i2) 31245 }); 31246 }, 31247 data); 31248 case 4: 31249 return _Utils_update( 31250 data, 31251 {a5: $author$project$Domain$Filter$emptyActivityFilters}); 31252 default: 31253 var eventId = msg.a; 31254 return _Utils_update( 31255 data, 31256 { 31257 cq: A2($elm$core$Set$member, eventId, data.cq) ? A2($elm$core$Set$remove, eventId, data.cq) : A2($elm$core$Set$insert, eventId, data.cq) 31258 }); 31259 } 31260 }); 31261var $author$project$Page$Group$AddMember$update = F3( 31262 function (existingNames, msg, _v0) { 31263 var data = _v0; 31264 if (!msg.$) { 31265 var s = msg.a; 31266 return _Utils_Tuple2( 31267 _Utils_update( 31268 data, 31269 {bW: s}), 31270 $elm$core$Maybe$Nothing); 31271 } else { 31272 var trimmed = $elm$core$String$trim(data.bW); 31273 var isDuplicate = A2( 31274 $elm$core$List$any, 31275 function (n) { 31276 return _Utils_eq( 31277 $elm$core$String$toLower(n), 31278 $elm$core$String$toLower(trimmed)); 31279 }, 31280 existingNames); 31281 return ($elm$core$String$isEmpty(trimmed) || isDuplicate) ? _Utils_Tuple2( 31282 _Utils_update( 31283 data, 31284 {d_: true}), 31285 $elm$core$Maybe$Nothing) : _Utils_Tuple2( 31286 _Utils_update( 31287 data, 31288 {d_: false}), 31289 $elm$core$Maybe$Just( 31290 {bW: trimmed})); 31291 } 31292 }); 31293var $author$project$Page$Group$BalanceTab$RecordTransferOutput = $elm$core$Basics$identity; 31294var $author$project$Page$Group$BalanceTab$SelectedSettlement = function (a) { 31295 return {$: 1, a: a}; 31296}; 31297var $author$project$Page$Group$BalanceTab$SettlementsCollapsed = {$: 2}; 31298var $author$project$Page$Group$BalanceTab$update = F2( 31299 function (msg, _v0) { 31300 var data = _v0; 31301 switch (msg.$) { 31302 case 0: 31303 var memberId = msg.a; 31304 return _Utils_Tuple2( 31305 _Utils_update( 31306 data, 31307 { 31308 eJ: _Utils_eq( 31309 data.eJ, 31310 $elm$core$Maybe$Just(memberId)) ? $elm$core$Maybe$Nothing : $elm$core$Maybe$Just(memberId) 31311 }), 31312 $elm$core$Maybe$Nothing); 31313 case 1: 31314 var transaction = msg.a; 31315 return _Utils_Tuple2( 31316 _Utils_update( 31317 data, 31318 { 31319 dM: $author$project$Page$Group$BalanceTab$SelectedSettlement(transaction) 31320 }), 31321 $elm$core$Maybe$Nothing); 31322 case 2: 31323 return _Utils_Tuple2( 31324 _Utils_update( 31325 data, 31326 {dM: $author$project$Page$Group$BalanceTab$SettlementsCollapsed}), 31327 $elm$core$Maybe$Nothing); 31328 default: 31329 var transaction = msg.a; 31330 return _Utils_Tuple2( 31331 _Utils_update( 31332 data, 31333 {dM: $author$project$Page$Group$BalanceTab$SettlementsCollapsed}), 31334 $elm$core$Maybe$Just(transaction)); 31335 } 31336 }); 31337var $author$project$Page$Group$EditGroupMetadata$buildChange = F2( 31338 function (original, output) { 31339 return { 31340 eE: (!_Utils_eq(output.eE, original.eE)) ? $elm$core$Maybe$Just(output.eE) : $elm$core$Maybe$Nothing, 31341 cz: (!_Utils_eq(output.cz, original.cz)) ? $elm$core$Maybe$Just(output.cz) : $elm$core$Maybe$Nothing, 31342 bW: (!_Utils_eq(output.bW, original.bW)) ? $elm$core$Maybe$Just(output.bW) : $elm$core$Maybe$Nothing, 31343 cY: (!_Utils_eq(output.cY, original.cY)) ? $elm$core$Maybe$Just(output.cY) : $elm$core$Maybe$Nothing 31344 }; 31345 }); 31346var $author$project$Page$Group$EditGroupMetadata$noOutput = function (model) { 31347 return {lt: false, mg: false, nM: $elm$core$Maybe$Nothing, nS: model}; 31348}; 31349var $dwayne$elm_validation$Validation$toMaybe = function (v) { 31350 if (!v.$) { 31351 var a = v.a; 31352 return $elm$core$Maybe$Just(a); 31353 } else { 31354 return $elm$core$Maybe$Nothing; 31355 } 31356}; 31357var $dwayne$elm_form$Form$validateAsMaybe = A2($elm$core$Basics$composeR, $dwayne$elm_form$Form$validate, $dwayne$elm_validation$Validation$toMaybe); 31358var $author$project$Page$Group$EditGroupMetadata$update = F2( 31359 function (msg, _v0) { 31360 var data = _v0; 31361 switch (msg.$) { 31362 case 0: 31363 var s = msg.a; 31364 return $author$project$Page$Group$EditGroupMetadata$noOutput( 31365 _Utils_update( 31366 data, 31367 { 31368 w: A3( 31369 $dwayne$elm_form$Form$modify, 31370 function ($) { 31371 return $.bW; 31372 }, 31373 $dwayne$elm_field$Field$setFromString(s), 31374 data.w) 31375 })); 31376 case 1: 31377 var s = msg.a; 31378 return $author$project$Page$Group$EditGroupMetadata$noOutput( 31379 _Utils_update( 31380 data, 31381 { 31382 w: A3( 31383 $dwayne$elm_form$Form$modify, 31384 function ($) { 31385 return $.cY; 31386 }, 31387 $dwayne$elm_field$Field$setFromString(s), 31388 data.w) 31389 })); 31390 case 2: 31391 var s = msg.a; 31392 return $author$project$Page$Group$EditGroupMetadata$noOutput( 31393 _Utils_update( 31394 data, 31395 { 31396 w: A3( 31397 $dwayne$elm_form$Form$modify, 31398 function ($) { 31399 return $.eE; 31400 }, 31401 $dwayne$elm_field$Field$setFromString(s), 31402 data.w) 31403 })); 31404 case 3: 31405 var id = msg.a; 31406 var s = msg.b; 31407 return $author$project$Page$Group$EditGroupMetadata$noOutput( 31408 _Utils_update( 31409 data, 31410 { 31411 w: A3( 31412 $dwayne$elm_form$Form$modify, 31413 function (a) { 31414 return a.jb(id); 31415 }, 31416 $dwayne$elm_field$Field$setFromString(s), 31417 data.w) 31418 })); 31419 case 4: 31420 var id = msg.a; 31421 var s = msg.b; 31422 return $author$project$Page$Group$EditGroupMetadata$noOutput( 31423 _Utils_update( 31424 data, 31425 { 31426 w: A3( 31427 $dwayne$elm_form$Form$modify, 31428 function (a) { 31429 return a.jc(id); 31430 }, 31431 $dwayne$elm_field$Field$setFromString(s), 31432 data.w) 31433 })); 31434 case 5: 31435 return $author$project$Page$Group$EditGroupMetadata$noOutput( 31436 _Utils_update( 31437 data, 31438 { 31439 w: A2( 31440 $dwayne$elm_form$Form$update, 31441 function ($) { 31442 return $.hM; 31443 }, 31444 data.w) 31445 })); 31446 case 6: 31447 var id = msg.a; 31448 return $author$project$Page$Group$EditGroupMetadata$noOutput( 31449 _Utils_update( 31450 data, 31451 { 31452 w: A2( 31453 $dwayne$elm_form$Form$update, 31454 function (a) { 31455 return a.j1(id); 31456 }, 31457 data.w) 31458 })); 31459 case 7: 31460 var _v2 = $dwayne$elm_form$Form$validateAsMaybe(data.w); 31461 if (!_v2.$) { 31462 var output = _v2.a; 31463 return { 31464 lt: false, 31465 mg: false, 31466 nM: $elm$core$Maybe$Just( 31467 A2($author$project$Page$Group$EditGroupMetadata$buildChange, data.g_, output)), 31468 nS: data 31469 }; 31470 } else { 31471 return $author$project$Page$Group$EditGroupMetadata$noOutput( 31472 _Utils_update( 31473 data, 31474 {d_: true})); 31475 } 31476 case 9: 31477 return $author$project$Page$Group$EditGroupMetadata$noOutput( 31478 _Utils_update( 31479 data, 31480 {dc: !data.dc})); 31481 case 8: 31482 return {lt: true, mg: false, nM: $elm$core$Maybe$Nothing, nS: data}; 31483 default: 31484 return {lt: false, mg: true, nM: $elm$core$Maybe$Nothing, nS: data}; 31485 } 31486 }); 31487var $author$project$Page$Group$EditMemberMetadata$FillPanel = function (a) { 31488 return {$: 1, a: a}; 31489}; 31490var $author$project$Page$Group$EditMemberMetadata$SavePanel = function (a) { 31491 return {$: 2, a: a}; 31492}; 31493var $author$project$Page$Group$EditMemberMetadata$SaveProfile = function (a) { 31494 return {$: 1, a: a}; 31495}; 31496var $author$project$Page$Group$EditMemberMetadata$Submitted = function (a) { 31497 return {$: 0, a: a}; 31498}; 31499var $author$project$Page$Group$EditMemberMetadata$accessorFor = function (field) { 31500 switch (field.$) { 31501 case 0: 31502 return function ($) { 31503 return $.jF; 31504 };
31505 case 1: 31506 return function ($) { 31507 return $.is; 31508 }; 31509 case 2: 31510 return function ($) { 31511 return $.bu; 31512 }; 31513 default: 31514 var method = field.a; 31515 return $author$project$Form$EditMemberMetadata$payment(method); 31516 } 31517}; 31518var $author$project$Page$Group$EditMemberMetadata$profileValue = F2( 31519 function (field, meta) { 31520 switch (field.$) { 31521 case 0: 31522 return meta.jF; 31523 case 1: 31524 return meta.is; 31525 case 2: 31526 return meta.bu; 31527 default: 31528 var method = field.a; 31529 return A2($author$project$Domain$PaymentMethod$get, method, meta.jD); 31530 } 31531 }); 31532var $author$project$Page$Group$EditMemberMetadata$applyFillToForm = F3( 31533 function (sel, profile, form) { 31534 var fill = F2( 31535 function (field, f) { 31536 var _v0 = A2($author$project$Page$Group$EditMemberMetadata$profileValue, field, profile); 31537 if (!_v0.$) { 31538 var value = _v0.a; 31539 return A3( 31540 $dwayne$elm_form$Form$modify, 31541 $author$project$Page$Group$EditMemberMetadata$accessorFor(field), 31542 $dwayne$elm_field$Field$setFromString(value), 31543 f); 31544 } else { 31545 return f; 31546 } 31547 }); 31548 return A3($elm$core$List$foldl, fill, form, sel); 31549 }); 31550var $author$project$Page$Group$EditMemberMetadata$EmailField = {$: 1}; 31551var $author$project$Page$Group$EditMemberMetadata$NotesField = {$: 2}; 31552var $author$project$Page$Group$EditMemberMetadata$PaymentField = function (a) { 31553 return {$: 3, a: a}; 31554}; 31555var $author$project$Page$Group$EditMemberMetadata$PhoneField = {$: 0}; 31556var $author$project$Page$Group$EditMemberMetadata$allFields = _Utils_ap( 31557 _List_fromArray( 31558 [$author$project$Page$Group$EditMemberMetadata$PhoneField, $author$project$Page$Group$EditMemberMetadata$EmailField, $author$project$Page$Group$EditMemberMetadata$NotesField]), 31559 A2($elm$core$List$map, $author$project$Page$Group$EditMemberMetadata$PaymentField, $author$project$Domain$PaymentMethod$all)); 31560var $author$project$Page$Group$EditMemberMetadata$formValue = F2( 31561 function (field, form) { 31562 return $dwayne$elm_field$Field$toRawString( 31563 A2( 31564 $dwayne$elm_form$Form$get, 31565 $author$project$Page$Group$EditMemberMetadata$accessorFor(field), 31566 form)); 31567 }); 31568var $author$project$Page$Group$EditMemberMetadata$defaultFillSelections = function (form) { 31569 return A2( 31570 $elm$core$List$filter, 31571 function (field) { 31572 return $elm$core$String$isEmpty( 31573 $elm$core$String$trim( 31574 A2($author$project$Page$Group$EditMemberMetadata$formValue, field, form))); 31575 }, 31576 $author$project$Page$Group$EditMemberMetadata$allFields); 31577}; 31578var $author$project$Page$Group$EditMemberMetadata$defaultSaveSelections = function (form) { 31579 return A2( 31580 $elm$core$List$filter, 31581 function (field) { 31582 return !$elm$core$String$isEmpty( 31583 $elm$core$String$trim( 31584 A2($author$project$Page$Group$EditMemberMetadata$formValue, field, form))); 31585 }, 31586 $author$project$Page$Group$EditMemberMetadata$allFields); 31587}; 31588var $author$project$Page$Group$EditMemberMetadata$mergeMetadata = F2( 31589 function (delta, base) { 31590 var pickFirst = F2( 31591 function (d, b) { 31592 if (!d.$) { 31593 return d; 31594 } else { 31595 return b; 31596 } 31597 }); 31598 return { 31599 is: A2(pickFirst, delta.is, base.is), 31600 bu: A2(pickFirst, delta.bu, base.bu), 31601 jD: A2($elm$core$Dict$union, delta.jD, base.jD), 31602 jF: A2(pickFirst, delta.jF, base.jF) 31603 }; 31604 }); 31605var $author$project$Domain$PaymentMethod$set = F3( 31606 function (method, value, info) { 31607 var _v0 = A2($elm$core$Maybe$andThen, $author$project$Domain$PaymentMethod$normalize, value); 31608 if (!_v0.$) { 31609 var handle = _v0.a; 31610 return A3( 31611 $elm$core$Dict$insert,
31612 $author$project$Domain$PaymentMethod$toKey(method), 31613 handle, 31614 info); 31615 } else { 31616 return A2( 31617 $elm$core$Dict$remove, 31618 $author$project$Domain$PaymentMethod$toKey(method), 31619 info); 31620 } 31621 }); 31622var $author$project$Page$Group$EditMemberMetadata$metadataFromOutput = F2( 31623 function (basePayment, output) { 31624 return { 31625 is: output.is, 31626 bu: output.bu, 31627 jD: A3( 31628 $elm$core$List$foldl, 31629 function (_v0) { 31630 var method = _v0.a; 31631 var value = _v0.b; 31632 return A2($author$project$Domain$PaymentMethod$set, method, value); 31633 }, 31634 basePayment, 31635 output.jD), 31636 jF: output.jF 31637 }; 31638 }); 31639var $author$project$Page$Group$EditMemberMetadata$selectedMetadataFromRawForm = F2( 31640 function (sel, form) { 31641 var pick = function (field) { 31642 if (A2($elm$core$List$member, field, sel)) { 31643 var _v0 = $elm$core$String$trim( 31644 A2($author$project$Page$Group$EditMemberMetadata$formValue, field, form)); 31645 if (_v0 === '') { 31646 return $elm$core$Maybe$Nothing; 31647 } else { 31648 var raw = _v0; 31649 return $elm$core$Maybe$Just(raw); 31650 } 31651 } else { 31652 return $elm$core$Maybe$Nothing; 31653 } 31654 }; 31655 return { 31656 is: pick($author$project$Page$Group$EditMemberMetadata$EmailField), 31657 bu: pick($author$project$Page$Group$EditMemberMetadata$NotesField), 31658 jD: A3( 31659 $elm$core$List$foldl, 31660 function (method) { 31661 return A2( 31662 $author$project$Domain$PaymentMethod$set, 31663 method, 31664 pick( 31665 $author$project$Page$Group$EditMemberMetadata$PaymentField(method))); 31666 }, 31667 $author$project$Domain$PaymentMethod$empty, 31668 $author$project$Domain$PaymentMethod$all), 31669 jF: pick($author$project$Page$Group$EditMemberMetadata$PhoneField) 31670 }; 31671 }); 31672var $author$project$Page$Group$EditMemberMetadata$toggleField = F2( 31673 function (field, sel) { 31674 return A2($elm$core$List$member, field, sel) ? A2( 31675 $elm$core$List$filter, 31676 $elm$core$Basics$neq(field), 31677 sel) : A2($elm$core$List$cons, field, sel); 31678 }); 31679var $author$project$Page$Group$EditMemberMetadata$update = F3( 31680 function (config, msg, _v0) { 31681 var data = _v0; 31682 switch (msg.$) { 31683 case 0: 31684 var s = msg.a; 31685 return _Utils_Tuple2( 31686 _Utils_update( 31687 data, 31688 { 31689 w: A3( 31690 $dwayne$elm_form$Form$modify, 31691 function ($) { 31692 return $.bW; 31693 }, 31694 $dwayne$elm_field$Field$setFromString(s), 31695 data.w) 31696 }), 31697 $elm$core$Maybe$Nothing); 31698 case 1: 31699 var s = msg.a; 31700 return _Utils_Tuple2( 31701 _Utils_update( 31702 data, 31703 { 31704 w: A3( 31705 $dwayne$elm_form$Form$modify, 31706 function ($) { 31707 return $.jF; 31708 }, 31709 $dwayne$elm_field$Field$setFromString(s), 31710 data.w) 31711 }), 31712 $elm$core$Maybe$Nothing); 31713 case 2: 31714 var s = msg.a; 31715 return _Utils_Tuple2( 31716 _Utils_update( 31717 data, 31718 { 31719 w: A3( 31720 $dwayne$elm_form$Form$modify, 31721 function ($) { 31722 return $.is; 31723 }, 31724 $dwayne$elm_field$Field$setFromString(s), 31725 data.w) 31726 }), 31727 $elm$core$Maybe$Nothing); 31728 case 3: 31729 var s = msg.a; 31730 return _Utils_Tuple2( 31731 _Utils_update( 31732 data, 31733 { 31734 w: A3( 31735 $dwayne$elm_form$Form$modify, 31736 function ($) { 31737 return $.bu; 31738 }, 31739 $dwayne$elm_field$Field$setFromString(s), 31740 data.w) 31741 }), 31742 $elm$core$Maybe$Nothing); 31743 case 4: 31744 var method = msg.a; 31745 var s = msg.b; 31746 return _Utils_Tuple2( 31747 _Utils_update( 31748 data, 31749 { 31750 w: A3( 31751 $dwayne$elm_form$Form$modify, 31752 $author$project$Form$EditMemberMetadata$payment(method), 31753 $dwayne$elm_field$Field$setFromString(s), 31754 data.w) 31755 }), 31756 $elm$core$Maybe$Nothing); 31757 case 5: 31758 var _v2 = $dwayne$elm_form$Form$validateAsMaybe(data.w); 31759 if (!_v2.$) { 31760 var output = _v2.a; 31761 return ((!_Utils_eq( 31762 $elm$core$String$toLower(output.bW), 31763 $elm$core$String$toLower(data.dB))) && A2( 31764 $elm$core$List$any, 31765 function (n) { 31766 return _Utils_eq( 31767 $elm$core$String$toLower(n), 31768 $elm$core$String$toLower(output.bW)); 31769 }, 31770 config.iD)) ? _Utils_Tuple2( 31771 _Utils_update( 31772 data, 31773 {d_: true}), 31774 $elm$core$Maybe$Nothing) : _Utils_Tuple2( 31775 data, 31776 $elm$core$Maybe$Just( 31777 $author$project$Page$Group$EditMemberMetadata$Submitted( 31778 { 31779 e_: data.e_, 31780 ji: A2($author$project$Page$Group$EditMemberMetadata$metadataFromOutput, data.fV, output), 31781 e4: output.bW, 31782 e6: data.dB 31783 }))); 31784 } else { 31785 return _Utils_Tuple2( 31786 _Utils_update( 31787 data, 31788 {d_: true}), 31789 $elm$core$Maybe$Nothing); 31790 } 31791 case 6: 31792 return _Utils_Tuple2( 31793 _Utils_update( 31794 data, 31795 {
31796 au: $author$project$Page$Group$EditMemberMetadata$FillPanel( 31797 $author$project$Page$Group$EditMemberMetadata$defaultFillSelections(data.w)) 31798 }), 31799 $elm$core$Maybe$Nothing); 31800 case 7: 31801 return _Utils_Tuple2( 31802 _Utils_update( 31803 data, 31804 { 31805 au: $author$project$Page$Group$EditMemberMetadata$SavePanel( 31806 $author$project$Page$Group$EditMemberMetadata$defaultSaveSelections(data.w)) 31807 }), 31808 $elm$core$Maybe$Nothing); 31809 case 8: 31810 return _Utils_Tuple2( 31811 _Utils_update( 31812 data, 31813 {au: $author$project$Page$Group$EditMemberMetadata$NoPanel}), 31814 $elm$core$Maybe$Nothing); 31815 case 9: 31816 var field = msg.a; 31817 var _v3 = data.au; 31818 switch (_v3.$) { 31819 case 1: 31820 var sel = _v3.a; 31821 return _Utils_Tuple2( 31822 _Utils_update( 31823 data, 31824 { 31825 au: $author$project$Page$Group$EditMemberMetadata$FillPanel( 31826 A2($author$project$Page$Group$EditMemberMetadata$toggleField, field, sel)) 31827 }), 31828 $elm$core$Maybe$Nothing); 31829 case 2: 31830 var sel = _v3.a; 31831 return _Utils_Tuple2( 31832 _Utils_update( 31833 data, 31834 { 31835 au: $author$project$Page$Group$EditMemberMetadata$SavePanel( 31836 A2($author$project$Page$Group$EditMemberMetadata$toggleField, field, sel)) 31837 }), 31838 $elm$core$Maybe$Nothing); 31839 default: 31840 return _Utils_Tuple2(data, $elm$core$Maybe$Nothing); 31841 } 31842 case 10: 31843 var _v4 = data.au; 31844 if (_v4.$ === 1) { 31845 var sel = _v4.a; 31846 return _Utils_Tuple2( 31847 _Utils_update( 31848 data, 31849 { 31850 w: A3($author$project$Page$Group$EditMemberMetadata$applyFillToForm, sel, config.kc, data.w), 31851 au: $author$project$Page$Group$EditMemberMetadata$NoPanel 31852 }), 31853 $elm$core$Maybe$Nothing); 31854 } else { 31855 return _Utils_Tuple2(data, $elm$core$Maybe$Nothing); 31856 } 31857 default: 31858 var _v5 = data.au; 31859 if (_v5.$ === 2) { 31860 var sel = _v5.a; 31861 var delta = A2($author$project$Page$Group$EditMemberMetadata$selectedMetadataFromRawForm, sel, data.w); 31862 var merged = A2($author$project$Page$Group$EditMemberMetadata$mergeMetadata, delta, config.kc); 31863 return _Utils_Tuple2( 31864 _Utils_update( 31865 data, 31866 {au: $author$project$Page$Group$EditMemberMetadata$NoPanel}), 31867 $elm$core$Maybe$Just( 31868 $author$project$Page$Group$EditMemberMetadata$SaveProfile(merged))); 31869 } else { 31870 return _Utils_Tuple2(data, $elm$core$Maybe$Nothing); 31871 } 31872 } 31873 }); 31874var $author$project$Page$Group$EntriesTab$ConfirmDelete = 0; 31875var $author$project$Page$Group$EntriesTab$ConfirmRestore = 1; 31876var $author$project$Page$Group$EntriesTab$DeleteOutput = function (a) { 31877 return {$: 2, a: a}; 31878}; 31879var $author$project$Page$Group$EntriesTab$DuplicateOutput = function (a) { 31880 return {$: 1, a: a}; 31881}; 31882var $author$project$Page$Group$EntriesTab$EditOutput = function (a) { 31883 return {$: 0, a: a}; 31884}; 31885var $author$project$Page$Group$EntriesTab$RestoreOutput = function (a) { 31886 return {$: 3, a: a}; 31887}; 31888var $author$project$Page$Group$EntriesTab$toggleSet = F2( 31889 function (item, set) { 31890 return A2($elm$core$Set$member, item, set) ? A2($elm$core$Set$remove, item, set) : A2($elm$core$Set$insert, item, set); 31891 }); 31892var $author$project$Page$Group$EntriesTab$updateFilters = F2( 31893 function (transform, data) { 31894 return _Utils_update( 31895 data, 31896 { 31897 a5: transform(data.a5) 31898 }); 31899 }); 31900var $author$project$Page$Group$EntriesTab$update = F2( 31901 function (msg, _v0) { 31902 var data = _v0; 31903 switch (msg.$) { 31904 case 0: 31905 return _Utils_Tuple2( 31906 _Utils_update( 31907 data, 31908 {a0: !data.a0}), 31909 $elm$core$Maybe$Nothing); 31910 case 1: 31911 return _Utils_Tuple2( 31912 _Utils_update( 31913 data, 31914 {cS: !data.cS}), 31915 $elm$core$Maybe$Nothing); 31916 case 2: 31917 var memberId = msg.a; 31918 return _Utils_Tuple2( 31919 A2( 31920 $author$project$Page$Group$EntriesTab$updateFilters, 31921 function (f) { 31922 return _Utils_update( 31923 f, 31924 { 31925 fc: A2($author$project$Page$Group$EntriesTab$toggleSet, memberId, f.fc) 31926 }); 31927 }, 31928 data), 31929 $elm$core$Maybe$Nothing); 31930 case 3: 31931 var catStr = msg.a; 31932 return _Utils_Tuple2( 31933 A2( 31934 $author$project$Page$Group$EntriesTab$updateFilters, 31935 function (f) { 31936 return _Utils_update( 31937 f, 31938 { 31939 eu: A2($author$project$Page$Group$EntriesTab$toggleSet, catStr, f.eu) 31940 }); 31941 }, 31942 data), 31943 $elm$core$Maybe$Nothing); 31944 case 4: 31945 var currStr = msg.a; 31946 return _Utils_Tuple2( 31947 A2( 31948 $author$project$Page$Group$EntriesTab$updateFilters, 31949 function (f) { 31950 return _Utils_update( 31951 f, 31952 { 31953 ez: A2($author$project$Page$Group$EntriesTab$toggleSet, currStr, f.ez) 31954 }); 31955 }, 31956 data), 31957 $elm$core$Maybe$Nothing); 31958 case 5: 31959 var range = msg.a; 31960 return _Utils_Tuple2( 31961 A2( 31962 $author$project$Page$Group$EntriesTab$updateFilters, 31963 function (f) { 31964 return A2($elm$core$List$member, range, f.eB) ? _Utils_update( 31965 f, 31966 { 31967 eB: A2( 31968 $elm$core$List$filter, 31969 function (r) { 31970 return !_Utils_eq(r, range); 31971 }, 31972 f.eB) 31973 }) : _Utils_update( 31974 f, 31975 { 31976 eB: A2($elm$core$List$cons, range, f.eB) 31977 }); 31978 }, 31979 data), 31980 $elm$core$Maybe$Nothing); 31981 case 6: 31982 return _Utils_Tuple2( 31983 _Utils_update( 31984 data, 31985 {a5: $author$project$Domain$Filter$emptyEntryFilters, a0: false}), 31986 $elm$core$Maybe$Nothing); 31987 case 7: 31988 var query = msg.a; 31989 return _Utils_Tuple2( 31990 _Utils_update( 31991 data, 31992 {dK: query}), 31993 $elm$core$Maybe$Nothing); 31994 case 8: 31995 var entryId = msg.a; 31996 return _Utils_Tuple2( 31997 _Utils_update( 31998 data, 31999 { 32000 X: function () { 32001 var _v2 = data.X; 32002 if (!_v2.$) { 32003 var _v3 = _v2.a; 32004 var id = _v3.a; 32005 return _Utils_eq(id, entryId) ? $elm$core$Maybe$Nothing : data.X; 32006 } else { 32007 return $elm$core$Maybe$Nothing; 32008 } 32009 }(), 32010 aS: A2($elm$core$Set$member, entryId, data.aS) ? A2($elm$core$Set$remove, entryId, data.aS) : A2($elm$core$Set$insert, entryId, data.aS) 32011 }), 32012 $elm$core$Maybe$Nothing); 32013 case 9: 32014 var entryId = msg.a; 32015 return _Utils_Tuple2( 32016 data, 32017 $elm$core$Maybe$Just( 32018 $author$project$Page$Group$EntriesTab$EditOutput(entryId))); 32019 case 10: 32020 var entryId = msg.a; 32021 return _Utils_Tuple2( 32022 data, 32023 $elm$core$Maybe$Just( 32024 $author$project$Page$Group$EntriesTab$DuplicateOutput(entryId))); 32025 case 11: 32026 var entryId = msg.a; 32027 return _Utils_Tuple2( 32028 _Utils_update( 32029 data, 32030 { 32031 X: $elm$core$Maybe$Just(
32032 _Utils_Tuple2(entryId, 0)) 32033 }), 32034 $elm$core$Maybe$Nothing); 32035 case 12: 32036 var entryId = msg.a; 32037 return _Utils_Tuple2( 32038 _Utils_update( 32039 data, 32040 { 32041 X: $elm$core$Maybe$Just( 32042 _Utils_Tuple2(entryId, 1)) 32043 }), 32044 $elm$core$Maybe$Nothing); 32045 case 13: 32046 var _v4 = data.X; 32047 if (!_v4.$) { 32048 if (!_v4.a.b) { 32049 var _v5 = _v4.a; 32050 var entryId = _v5.a; 32051 var _v6 = _v5.b; 32052 return _Utils_Tuple2( 32053 _Utils_update( 32054 data, 32055 {X: $elm$core$Maybe$Nothing}), 32056 $elm$core$Maybe$Just( 32057 $author$project$Page$Group$EntriesTab$DeleteOutput(entryId))); 32058 } else { 32059 var _v7 = _v4.a; 32060 var entryId = _v7.a; 32061 var _v8 = _v7.b; 32062 return _Utils_Tuple2( 32063 _Utils_update( 32064 data, 32065 {X: $elm$core$Maybe$Nothing}), 32066 $elm$core$Maybe$Just( 32067 $author$project$Page$Group$EntriesTab$RestoreOutput(entryId))); 32068 } 32069 } else { 32070 return _Utils_Tuple2(data, $elm$core$Maybe$Nothing); 32071 } 32072 default: 32073 return _Utils_Tuple2( 32074 _Utils_update( 32075 data, 32076 {X: $elm$core$Maybe$Nothing}), 32077 $elm$core$Maybe$Nothing); 32078 } 32079 }); 32080var $author$project$Page$Group$MembersTab$EditMetadataOutput = function (a) { 32081 return {$: 2, a: a}; 32082}; 32083var $author$project$Page$Group$MembersTab$LinkSelfOutput = function (a) { 32084 return {$: 4, a: a}; 32085}; 32086var $author$project$Page$Group$MembersTab$MergeOutput = function (a) { 32087 return {$: 3, a: a}; 32088}; 32089var $author$project$Page$Group$MembersTab$RetireOutput = function (a) { 32090 return {$: 0, a: a}; 32091}; 32092var $author$project$Page$Group$MembersTab$UnretireOutput = function (a) { 32093 return {$: 1, a: a}; 32094}; 32095var $author$project$Page$Group$MembersTab$update = F2( 32096 function (msg, model) { 32097 switch (msg.$) { 32098 case 0: 32099 return _Utils_Tuple2( 32100 _Utils_update( 32101 model, 32102 {dS: !model.dS}), 32103 $elm$core$Maybe$Nothing); 32104 case 1: 32105 var memberId = msg.a; 32106 return _Utils_Tuple2( 32107 _Utils_update( 32108 model, 32109 { 32110 bk: A2($elm$core$Set$member, memberId, model.bk) ? A2($elm$core$Set$remove, memberId, model.bk) : A2($elm$core$Set$insert, memberId, model.bk) 32111 }), 32112 $elm$core$Maybe$Nothing); 32113 case 2: 32114 return _Utils_Tuple2( 32115 _Utils_update( 32116 model, 32117 {cU: !model.cU}), 32118 $elm$core$Maybe$Nothing); 32119 case 3: 32120 var memberId = msg.a; 32121 return _Utils_Tuple2( 32122 model, 32123 $elm$core$Maybe$Just( 32124 $author$project$Page$Group$MembersTab$RetireOutput(memberId))); 32125 case 4: 32126 var memberId = msg.a; 32127 return _Utils_Tuple2( 32128 model, 32129 $elm$core$Maybe$Just( 32130 $author$project$Page$Group$MembersTab$UnretireOutput(memberId))); 32131 case 5: 32132 var memberId = msg.a; 32133 return _Utils_Tuple2( 32134 model, 32135 $elm$core$Maybe$Just( 32136 $author$project$Page$Group$MembersTab$EditMetadataOutput(memberId))); 32137 case 6: 32138 var memberId = msg.a; 32139 return _Utils_Tuple2( 32140 model, 32141 $elm$core$Maybe$Just( 32142 $author$project$Page$Group$MembersTab$MergeOutput(memberId))); 32143 default: 32144 var memberId = msg.a; 32145 return _Utils_Tuple2( 32146 model, 32147 $elm$core$Maybe$Just( 32148 $author$project$Page$Group$MembersTab$LinkSelfOutput(memberId))); 32149 } 32150 }); 32151var $author$project$Page$Group$MergeMember$CommitMerge = function (a) { 32152 return {$: 2, a: a}; 32153}; 32154var $author$project$Page$Group$MergeMember$NavigateToStep1 = function (a) { 32155 return {$: 0, a: a}; 32156}; 32157var $author$project$Page$Group$MergeMember$NavigateToStep2 = F2( 32158 function (a, b) { 32159 return {$: 1, a: a, b: b}; 32160 }); 32161var $author$project$Domain$MemberMerge$RetireSource = {$: 3}; 32162var $author$project$Domain$MemberMerge$Rewritten = function (a) { 32163 return {$: 0, a: a}; 32164}; 32165var $author$project$Domain$MemberMerge$SelfTransfer = {$: 1}; 32166var $author$project$Domain$MemberMerge$beneficiaryHas = F2( 32167 function (memberRootId, b) { 32168 if (!b.$) { 32169 var d = b.a; 32170 return _Utils_eq(d.e_, memberRootId); 32171 } else { 32172 var d = b.a; 32173 return _Utils_eq(d.e_, memberRootId); 32174 } 32175 }); 32176var $author$project$Domain$MemberMerge$isAffectedEntry = F2( 32177 function (memberRootId, entry) { 32178 var _v0 = entry.gE; 32179 switch (_v0.$) { 32180 case 0: 32181 var data = _v0.a; 32182 return A2( 32183 $elm$core$List$any, 32184 function (p) { 32185 return _Utils_eq(p.e_, memberRootId); 32186 }, 32187 data.jB) || A2( 32188 $elm$core$List$any, 32189 $author$project$Domain$MemberMerge$beneficiaryHas(memberRootId), 32190 data.em); 32191 case 1: 32192 var data = _v0.a; 32193 return _Utils_eq(data.iH, memberRootId) || _Utils_eq(data.kE, memberRootId); 32194 default: 32195 var data = _v0.a; 32196 return _Utils_eq(data.j$, memberRootId) || A2( 32197 $elm$core$List$any, 32198 $author$project$Domain$MemberMerge$beneficiaryHas(memberRootId), 32199 data.em); 32200 } 32201 }); 32202var $author$project$Domain$MemberMerge$emitCombinedOnce = F3( 32203 function (pred, replacement, items) { 32204 var _v0 = A3( 32205 $elm$core$List$foldl, 32206 F2( 32207 function (item, _v1) { 32208 var emitted = _v1.a; 32209 var out = _v1.b; 32210 return pred(item) ? (emitted ? _Utils_Tuple2(true, out) : _Utils_Tuple2( 32211 true, 32212 A2($elm$core$List$cons, replacement, out))) : _Utils_Tuple2( 32213 emitted, 32214 A2($elm$core$List$cons, item, out)); 32215 }), 32216 _Utils_Tuple2(false, _List_Nil), 32217 items); 32218 var acc = _v0.b; 32219 return $elm$core$List$reverse(acc); 32220 }); 32221var $author$project$Domain$MemberMerge$matchExactSource = F2( 32222 function (sourceRootId, b) { 32223 if (b.$ === 1) { 32224 var d = b.a; 32225 return _Utils_eq(d.e_, sourceRootId); 32226 } else { 32227 return false;
32228 } 32229 }); 32230var $author$project$Domain$MemberMerge$matchExactSourceOrTarget = F3( 32231 function (sourceRootId, targetRootId, b) { 32232 if (b.$ === 1) { 32233 var d = b.a; 32234 return _Utils_eq(d.e_, sourceRootId) || _Utils_eq(d.e_, targetRootId); 32235 } else { 32236 return false; 32237 } 32238 }); 32239var $author$project$Domain$MemberMerge$matchShareSource = F2( 32240 function (sourceRootId, b) { 32241 if (!b.$) { 32242 var d = b.a; 32243 return _Utils_eq(d.e_, sourceRootId); 32244 } else { 32245 return false; 32246 } 32247 }); 32248var $author$project$Domain$MemberMerge$matchShareSourceOrTarget = F3( 32249 function (sourceRootId, targetRootId, b) { 32250 if (!b.$) { 32251 var d = b.a; 32252 return _Utils_eq(d.e_, sourceRootId) || _Utils_eq(d.e_, targetRootId); 32253 } else { 32254 return false; 32255 } 32256 }); 32257var $author$project$Domain$MemberMerge$sumBeneficiaries = F2( 32258 function (pick, beneficiaries) { 32259 return A3( 32260 $elm$core$List$foldl, 32261 F2( 32262 function (b, acc) { 32263 var _v0 = pick(b); 32264 if (!_v0.$) { 32265 var n = _v0.a; 32266 return acc + n; 32267 } else { 32268 return acc; 32269 } 32270 }), 32271 0, 32272 beneficiaries); 32273 }); 32274var $author$project$Domain$MemberMerge$rewriteBeneficiaries = F3( 32275 function (sourceRootId, targetRootId, beneficiaries) { 32276 var afterShareRewrite = function () { 32277 if (A2( 32278 $elm$core$List$any, 32279 $author$project$Domain$MemberMerge$matchShareSource(sourceRootId), 32280 beneficiaries)) { 32281 var shareTotal = A2( 32282 $author$project$Domain$MemberMerge$sumBeneficiaries, 32283 function (b) { 32284 if (!b.$) { 32285 var d = b.a; 32286 return (_Utils_eq(d.e_, sourceRootId) || _Utils_eq(d.e_, targetRootId)) ? $elm$core$Maybe$Just(d.qc) : $elm$core$Maybe$Nothing; 32287 } else { 32288 return $elm$core$Maybe$Nothing; 32289 } 32290 }, 32291 beneficiaries); 32292 return A3( 32293 $author$project$Domain$MemberMerge$emitCombinedOnce, 32294 A2($author$project$Domain$MemberMerge$matchShareSourceOrTarget, sourceRootId, targetRootId), 32295 $author$project$Domain$Entry$ShareBeneficiary( 32296 {e_: targetRootId, qc: shareTotal}), 32297 beneficiaries); 32298 } else { 32299 return beneficiaries; 32300 } 32301 }(); 32302 if (A2( 32303 $elm$core$List$any, 32304 $author$project$Domain$MemberMerge$matchExactSource(sourceRootId), 32305 beneficiaries)) { 32306 var exactTotal = A2( 32307 $author$project$Domain$MemberMerge$sumBeneficiaries, 32308 function (b) { 32309 if (b.$ === 1) { 32310 var d = b.a; 32311 return (_Utils_eq(d.e_, sourceRootId) || _Utils_eq(d.e_, targetRootId)) ? $elm$core$Maybe$Just(d.ef) : $elm$core$Maybe$Nothing; 32312 } else { 32313 return $elm$core$Maybe$Nothing; 32314 } 32315 }, 32316 beneficiaries); 32317 return A3( 32318 $author$project$Domain$MemberMerge$emitCombinedOnce, 32319 A2($author$project$Domain$MemberMerge$matchExactSourceOrTarget, sourceRootId, targetRootId), 32320 $author$project$Domain$Entry$ExactBeneficiary( 32321 {ef: exactTotal, e_: targetRootId}), 32322 afterShareRewrite); 32323 } else { 32324 return afterShareRewrite; 32325 } 32326 }); 32327var $author$project$Domain$MemberMerge$rewritePayers = F3( 32328 function (sourceRootId, targetRootId, payers) { 32329 var sourceIsPayer = A2( 32330 $elm$core$List$any, 32331 function (p) { 32332 return _Utils_eq(p.e_, sourceRootId); 32333 }, 32334 payers); 32335 if (!sourceIsPayer) { 32336 return payers; 32337 } else { 32338 var combinedAmount = A3( 32339 $elm$core$List$foldl, 32340 F2( 32341 function (p, acc) { 32342 return (_Utils_eq(p.e_, sourceRootId) || _Utils_eq(p.e_, targetRootId)) ? (acc + p.ef) : acc; 32343 }), 32344 0, 32345 payers); 32346 return A3( 32347 $author$project$Domain$MemberMerge$emitCombinedOnce, 32348 function (p) { 32349 return _Utils_eq(p.e_, sourceRootId) || _Utils_eq(p.e_, targetRootId); 32350 }, 32351 {ef: combinedAmount, e_: targetRootId}, 32352 payers); 32353 } 32354 }); 32355var $author$project$Domain$MemberMerge$rewriteEntry = F3( 32356 function (sourceRootId, targetRootId, entry) { 32357 if (!A2($author$project$Domain$MemberMerge$isAffectedEntry, sourceRootId, entry)) { 32358 return $elm$core$Maybe$Nothing; 32359 } else { 32360 var _v0 = entry.gE; 32361 switch (_v0.$) { 32362 case 0: 32363 var data = _v0.a; 32364 return $elm$core$Maybe$Just( 32365 $author$project$Domain$MemberMerge$Rewritten( 32366 _Utils_update( 32367 entry, 32368 { 32369 gE: $author$project$Domain$Entry$Expense( 32370 _Utils_update( 32371 data, 32372 { 32373 em: A3($author$project$Domain$MemberMerge$rewriteBeneficiaries, sourceRootId, targetRootId, data.em), 32374 jB: A3($author$project$Domain$MemberMerge$rewritePayers, sourceRootId, targetRootId, data.jB) 32375 })) 32376 }))); 32377 case 1: 32378 var data = _v0.a; 32379 var newTo = _Utils_eq(data.kE, sourceRootId) ? targetRootId : data.kE; 32380 var newFrom = _Utils_eq(data.iH, sourceRootId) ? targetRootId : data.iH; 32381 return _Utils_eq(newFrom, newTo) ? $elm$core$Maybe$Just($author$project$Domain$MemberMerge$SelfTransfer) : $elm$core$Maybe$Just( 32382 $author$project$Domain$MemberMerge$Rewritten( 32383 _Utils_update( 32384 entry, 32385 { 32386 gE: $author$project$Domain$Entry$Transfer( 32387 _Utils_update( 32388 data, 32389 {iH: newFrom, kE: newTo})) 32390 }))); 32391 default: 32392 var data = _v0.a; 32393 var newReceivedBy = _Utils_eq(data.j$, sourceRootId) ? targetRootId : data.j$; 32394 return $elm$core$Maybe$Just( 32395 $author$project$Domain$MemberMerge$Rewritten( 32396 _Utils_update( 32397 entry, 32398 { 32399 gE: $author$project$Domain$Entry$Income( 32400 _Utils_update( 32401 data, 32402 { 32403 em: A3($author$project$Domain$MemberMerge$rewriteBeneficiaries, sourceRootId, targetRootId, data.em), 32404 j$: newReceivedBy 32405 })) 32406 }))); 32407 } 32408 } 32409 }); 32410var $author$project$Domain$MemberMerge$UpdateSettlementPref = function (a) { 32411 return {$: 2, a: a}; 32412}; 32413var $author$project$Domain$MemberMerge$dedupeKeepFirst = function (ids) { 32414 var _v0 = A3( 32415 $elm$core$List$foldl, 32416 F2( 32417 function (id, _v1) { 32418 var seen = _v1.a; 32419 var out = _v1.b; 32420 return A2($elm$core$List$member, id, seen) ? _Utils_Tuple2(seen, out) : _Utils_Tuple2( 32421 A2($elm$core$List$cons, id, seen), 32422 A2($elm$core$List$cons, id, out)); 32423 }), 32424 _Utils_Tuple2(_List_Nil, _List_Nil), 32425 ids); 32426 var acc = _v0.b; 32427 return $elm$core$List$reverse(acc); 32428}; 32429var $author$project$Domain$MemberMerge$firstMatching = F2( 32430 function (pred, items) { 32431 firstMatching: 32432 while (true) { 32433 if (!items.b) { 32434 return $elm$core$Maybe$Nothing; 32435 } else { 32436 var x = items.a; 32437 var rest = items.b; 32438 if (pred(x)) { 32439 return $elm$core$Maybe$Just(x); 32440 } else { 32441 var $temp$pred = pred, 32442 $temp$items = rest; 32443 pred = $temp$pred; 32444 items = $temp$items; 32445 continue firstMatching; 32446 } 32447 } 32448 } 32449 }); 32450var $author$project$Domain$MemberMerge$rewriteSettlementPrefs = F3( 32451 function (sourceRootId, targetRootId, prefs) { 32452 var targetPref = A2( 32453 $author$project$Domain$MemberMerge$firstMatching, 32454 function (p) { 32455 return _Utils_eq(p.e$, targetRootId); 32456 }, 32457 prefs); 32458 var targetRecipients = A2( 32459 $elm$core$Maybe$withDefault, 32460 _List_Nil, 32461 A2( 32462 $elm$core$Maybe$map, 32463 function ($) { 32464 return $.pB; 32465 }, 32466 targetPref)); 32467 var sourcePref = A2( 32468 $author$project$Domain$MemberMerge$firstMatching, 32469 function (p) { 32470 return _Utils_eq(p.e$, sourceRootId); 32471 }, 32472 prefs); 32473 var sourceRecipients = A2( 32474 $elm$core$Maybe$withDefault, 32475 _List_Nil, 32476 A2( 32477 $elm$core$Maybe$map, 32478 function ($) { 32479 return $.pB; 32480 }, 32481 sourcePref)); 32482 var rewriteRecipientList = F2( 32483 function (ownerId, ids) { 32484 return $author$project$Domain$MemberMerge$dedupeKeepFirst( 32485 A2( 32486 $elm$core$List$filter, 32487 $elm$core$Basics$neq(ownerId), 32488 A2( 32489 $elm$core$List$map, 32490 function (id) { 32491 return _Utils_eq(id, sourceRootId) ? targetRootId : id; 32492 }, 32493 ids))); 32494 }); 32495 var targetMergedRecipients = A2( 32496 rewriteRecipientList, 32497 targetRootId, 32498 _Utils_ap(targetRecipients, sourceRecipients)); 32499 var targetAction = function () { 32500 var _v0 = _Utils_Tuple2(sourcePref, targetPref); 32501 if (_v0.a.$ === 1) { 32502 if (_v0.b.$ === 1) { 32503 var _v1 = _v0.a; 32504 var _v2 = _v0.b; 32505 return _List_Nil; 32506 } else { 32507 var _v3 = _v0.a; 32508 var tp = _v0.b.a; 32509 return (!_Utils_eq(targetMergedRecipients, tp.pB)) ? _List_fromArray( 32510 [ 32511 $author$project$Domain$MemberMerge$UpdateSettlementPref( 32512 {e$: targetRootId, pB: targetMergedRecipients}) 32513 ]) : _List_Nil; 32514 } 32515 } else { 32516 return _List_fromArray( 32517 [ 32518 $author$project$Domain$MemberMerge$UpdateSettlementPref( 32519 {e$: targetRootId, pB: targetMergedRecipients}) 32520 ]); 32521 } 32522 }(); 32523 var otherActions = A2( 32524 $elm$core$List$filterMap, 32525 function (p) { 32526 return A2($elm$core$List$member, sourceRootId, p.pB) ? $elm$core$Maybe$Just( 32527 $author$project$Domain$MemberMerge$UpdateSettlementPref( 32528 { 32529 e$: p.e$, 32530 pB: A2(rewriteRecipientList, p.e$, p.pB) 32531 })) : $elm$core$Maybe$Nothing; 32532 }, 32533 A2( 32534 $elm$core$List$filter, 32535 function (p) { 32536 return (!_Utils_eq(p.e$, sourceRootId)) && (!_Utils_eq(p.e$, targetRootId)); 32537 }, 32538 prefs)); 32539 return _Utils_ap(targetAction, otherActions); 32540 }); 32541var $author$project$Domain$MemberMerge$DeleteSelfTransfer = function (a) { 32542 return {$: 1, a: a}; 32543}; 32544var $author$project$Domain$MemberMerge$ModifyEntry = function (a) { 32545 return {$: 0, a: a}; 32546}; 32547var $author$project$Domain$MemberMerge$toEntryAction = F2( 32548 function (original, result) { 32549 if (!result.$) { 32550 var newEntry = result.a; 32551 return $author$project$Domain$MemberMerge$ModifyEntry( 32552 {jA: original, pV: newEntry}); 32553 } else { 32554 return $author$project$Domain$MemberMerge$DeleteSelfTransfer( 32555 {jA: original}); 32556 } 32557 }); 32558var $author$project$Domain$MemberMerge$plan = F3( 32559 function (sourceRootId, targetRootId, state) { 32560 if (_Utils_eq(sourceRootId, targetRootId)) { 32561 return _List_Nil; 32562 } else { 32563 var prefActions = A3($author$project$Domain$MemberMerge$rewriteSettlementPrefs, sourceRootId, targetRootId, state.qb); 32564 var entryActions = A2( 32565 $elm$core$List$filterMap, 32566 function (es) { 32567 return A2( 32568 $elm$core$Maybe$map, 32569 $author$project$Domain$MemberMerge$toEntryAction(es.bi), 32570 A3($author$project$Domain$MemberMerge$rewriteEntry, sourceRootId, targetRootId, es.bi)); 32571 }, 32572 A2( 32573 $elm$core$List$filter, 32574 A2( 32575 $elm$core$Basics$composeL, 32576 $elm$core$Basics$not, 32577 function ($) { 32578 return $.gB; 32579 }), 32580 $elm$core$Dict$values(state.E))); 32581 return _Utils_ap( 32582 entryActions, 32583 _Utils_ap( 32584 prefActions, 32585 _List_fromArray( 32586 [$author$project$Domain$MemberMerge$RetireSource]))); 32587 } 32588 }); 32589var $author$project$Page$Group$MergeMember$update = F3( 32590 function (state, msg, _v0) { 32591 var data = _v0; 32592 switch (msg.$) { 32593 case 0: 32594 var targetId = msg.a; 32595 return _Utils_Tuple2( 32596 data, 32597 $elm$core$Maybe$Just( 32598 A2($author$project$Page$Group$MergeMember$NavigateToStep2, data.dZ, targetId))); 32599 case 1: 32600 var _v2 = data.fA; 32601 if (!_v2.$) { 32602 var targetId = _v2.a; 32603 return _Utils_Tuple2( 32604 data, 32605 $elm$core$Maybe$Just( 32606 A2($author$project$Page$Group$MergeMember$NavigateToStep2, targetId, data.dZ))); 32607 } else { 32608 return _Utils_Tuple2(data, $elm$core$Maybe$Nothing); 32609 } 32610 case 2: 32611 return _Utils_Tuple2( 32612 data, 32613 $elm$core$Maybe$Just( 32614 $author$project$Page$Group$MergeMember$NavigateToStep1(data.dZ))); 32615 case 3: 32616 var s = msg.a; 32617 return _Utils_Tuple2( 32618 _Utils_update( 32619 data, 32620 {cg: s}), 32621 $elm$core$Maybe$Nothing); 32622 case 4: 32623 return _Utils_Tuple2( 32624 _Utils_update( 32625 data, 32626 {dP: !data.dP}), 32627 $elm$core$Maybe$Nothing); 32628 case 5: 32629 return _Utils_Tuple2( 32630 _Utils_update( 32631 data, 32632 {dT: !data.dT}), 32633 $elm$core$Maybe$Nothing); 32634 case 6: 32635 return _Utils_Tuple2( 32636 _Utils_update( 32637 data, 32638 {dR: !data.dR}), 32639 $elm$core$Maybe$Nothing); 32640 default: 32641 var _v3 = data.fA; 32642 if (!_v3.$) { 32643 var targetId = _v3.a; 32644 var sourceMember = A2($elm$core$Dict$get, data.dZ, state.r); 32645 var expectedConfirm = A2( 32646 $elm$core$Maybe$withDefault, 32647 '', 32648 A2( 32649 $elm$core$Maybe$map, 32650 function ($) { 32651 return $.bW; 32652 }, 32653 sourceMember)); 32654 return ((!_Utils_eq( 32655 $elm$core$String$trim(data.cg), 32656 expectedConfirm)) || (expectedConfirm === '')) ? _Utils_Tuple2(data, $elm$core$Maybe$Nothing) : _Utils_Tuple2( 32657 data, 32658 $elm$core$Maybe$Just( 32659 $author$project$Page$Group$MergeMember$CommitMerge( 32660 { 32661 pu: A3($author$project$Domain$MemberMerge$plan, data.dZ, targetId, state), 32662 dZ: data.dZ, 32663 fA: targetId 32664 }))); 32665 } else { 32666 return _Utils_Tuple2(data, $elm$core$Maybe$Nothing); 32667 } 32668 } 32669 }); 32670var $author$project$Page$Group$NewEntry$Shared$NoEffect = {$: 0}; 32671var $author$project$Page$Group$NewEntry$Shared$RateFailed = 2;
32672var $author$project$Page$Group$NewEntry$Shared$RateLoading = 1; 32673var $author$project$Page$Group$NewEntry$Shared$RequestRate = function (a) { 32674 return {$: 2, a: a}; 32675}; 32676var $elmcraft$core_extra$List$Extra$removeAt = F2( 32677 function (index, l) { 32678 if (index < 0) { 32679 return l; 32680 } else { 32681 var _v0 = A2($elm$core$List$drop, index, l); 32682 if (!_v0.b) { 32683 return l; 32684 } else { 32685 var rest = _v0.b; 32686 return _Utils_ap( 32687 A2($elm$core$List$take, index, l), 32688 rest); 32689 } 32690 } 32691 }); 32692var $dwayne$elm_field$Field$Advanced$isClean = function (_v0) { 32693 var clean = _v0.b.aO; 32694 return clean; 32695}; 32696var $dwayne$elm_field$Field$Advanced$isDirty = A2($elm$core$Basics$composeL, $elm$core$Basics$not, $dwayne$elm_field$Field$Advanced$isClean); 32697var $dwayne$elm_field$Field$isDirty = $dwayne$elm_field$Field$Advanced$isDirty; 32698var $author$project$Form$NewEntry$setAmountCurrency = F2( 32699 function (lang, currency) { 32700 return A2( 32701 $dwayne$elm_form$Form$modify, 32702 function ($) { 32703 return $.ef; 32704 }, 32705 function (f) { 32706 var raw = $dwayne$elm_field$Field$toRawString(f); 32707 var rebuilt = A2( 32708 $dwayne$elm_field$Field$fromString, 32709 A2($author$project$Form$NewEntry$amountType, lang, currency), 32710 raw); 32711 return $dwayne$elm_field$Field$isDirty(f) ? A2($dwayne$elm_field$Field$setFromString, raw, rebuilt) : rebuilt; 32712 }); 32713 }); 32714var $author$project$Page$Group$NewEntry$Shared$ExactSplitData = function (a) { 32715 return {$: 1, a: a}; 32716}; 32717var $author$project$Page$Group$NewEntry$Shared$ExpenseOutput = function (a) { 32718 return {$: 0, a: a}; 32719}; 32720var $author$project$Page$Group$NewEntry$Shared$ShareSplitData = function (a) { 32721 return {$: 0, a: a}; 32722}; 32723var $author$project$Page$Group$NewEntry$Shared$isValidAttachmentUrl = function (url) { 32724 return A2($elm$core$String$startsWith, 'http://', url) || A2($elm$core$String$startsWith, 'https://', url); 32725}; 32726var $author$project$Page$Group$NewEntry$Shared$cleanAttachments = function (raw) { 32727 var kept = A2( 32728 $elm$core$List$filter, 32729 function (a) { 32730 return !_Utils_eq( 32731 a, 32732 {i6: '', kS: ''}); 32733 }, 32734 A2( 32735 $elm$core$List$map, 32736 function (a) { 32737 return { 32738 i6: $elm$core$String$trim(a.i6), 32739 kS: $elm$core$String$trim(a.kS) 32740 }; 32741 }, 32742 raw)); 32743 return A2( 32744 $elm$core$List$all, 32745 function (a) { 32746 return $author$project$Page$Group$NewEntry$Shared$isValidAttachmentUrl(a.kS); 32747 }, 32748 kept) ? $elm$core$Result$Ok(kept) : $elm$core$Result$Err(0); 32749}; 32750var $elm$core$Result$map2 = F3( 32751 function (func, ra, rb) { 32752 if (ra.$ === 1) { 32753 var x = ra.a; 32754 return $elm$core$Result$Err(x); 32755 } else { 32756 var a = ra.a; 32757 if (rb.$ === 1) { 32758 var x = rb.a; 32759 return $elm$core$Result$Err(x); 32760 } else { 32761 var b = rb.a; 32762 return $elm$core$Result$Ok( 32763 A2(func, a, b)); 32764 } 32765 } 32766 }); 32767var $author$project$Page$Group$NewEntry$Shared$parseAmountCents = F2( 32768 function (currency, s) { 32769 return A2( 32770 $elm$core$Maybe$andThen, 32771 function (cents) { 32772 return (cents >= 0) ? $elm$core$Maybe$Just(cents) : $elm$core$Maybe$Nothing; 32773 }, 32774 A2( 32775 $elm$core$Maybe$map, 32776 function (f) { 32777 return $elm$core$Basics$round( 32778 f * A2( 32779 $elm$core$Basics$pow, 32780 10, 32781 $author$project$Domain$Currency$precision(currency))); 32782 }, 32783 $elm$core$String$toFloat( 32784 $author$project$Form$NewEntry$normalizeAmountInput(s)))); 32785 }); 32786var $dwayne$elm_validation$Validation$toResult = function (v) { 32787 if (!v.$) { 32788 var a = v.a; 32789 return $elm$core$Result$Ok(a); 32790 } else { 32791 var _v1 = v.a; 32792 var e = _v1.a; 32793 var es = _v1.b; 32794 return $elm$core$Result$Err( 32795 A2($elm$core$List$cons, e, es)); 32796 } 32797}; 32798var $author$project$Page$Group$NewEntry$submitExpense = function (data) { 32799 var _v0 = $dwayne$elm_validation$Validation$toResult( 32800 $dwayne$elm_form$Form$validate(data.w)); 32801 if (!_v0.$) { 32802 var formOutput = _v0.a; 32803 if ($elm$core$Dict$isEmpty(data.em)) { 32804 return _Utils_Tuple2( 32805 _Utils_update( 32806 data, 32807 {d_: true}), 32808 $elm$core$Maybe$Nothing); 32809 } else { 32810 var splitResult = function () { 32811 var _v6 = data.b2; 32812 if (!_v6) { 32813 return $elm$core$Result$Ok( 32814 $author$project$Page$Group$NewEntry$Shared$ShareSplitData( 32815 A2( 32816 $elm$core$List$map, 32817 function (_v7) { 32818 var mid = _v7.a; 32819 var shares = _v7.b; 32820 return {e_: mid, qc: shares}; 32821 }, 32822 $elm$core$Dict$toList(data.em)))); 32823 } else { 32824 var selectedIds = $elm$core$Dict$keys(data.em); 32825 var parsedAmounts = A2( 32826 $elm$core$List$filterMap, 32827 function (mid) { 32828 return A2( 32829 $elm$core$Maybe$map, 32830 function (cents) { 32831 return {ef: cents, e_: mid}; 32832 }, 32833 A2( 32834 $elm$core$Maybe$andThen, 32835 $author$project$Page$Group$NewEntry$Shared$parseAmountCents(data.bg), 32836 A2($elm$core$Dict$get, mid, data.bj))); 32837 }, 32838 selectedIds); 32839 if (!_Utils_eq( 32840 $elm$core$List$length(parsedAmounts), 32841 $elm$core$List$length(selectedIds))) { 32842 return $elm$core$Result$Err(0); 32843 } else { 32844 var totalExact = A3( 32845 $elm$core$List$foldl, 32846 F2( 32847 function (b, acc) { 32848 return acc + b.ef; 32849 }), 32850 0, 32851 parsedAmounts); 32852 return (!_Utils_eq(totalExact, formOutput.lo)) ? $elm$core$Result$Err(0) : $elm$core$Result$Ok( 32853 $author$project$Page$Group$NewEntry$Shared$ExactSplitData(parsedAmounts)); 32854 } 32855 } 32856 }(); 32857 var payersResult = function () { 32858 var selectedPayers = $elm$core$Dict$keys(data.aB); 32859 if (!selectedPayers.b) { 32860 return $elm$core$Result$Err(0); 32861 } else { 32862 if (!selectedPayers.b.b) { 32863 var singlePayerId = selectedPayers.a; 32864 return $elm$core$Result$Ok( 32865 _List_fromArray( 32866 [ 32867 {ef: formOutput.lo, e_: singlePayerId} 32868 ])); 32869 } else { 32870 var parsed = A2( 32871 $elm$core$List$filterMap, 32872 function (_v5) { 32873 var mid = _v5.a; 32874 var s = _v5.b; 32875 return A2( 32876 $elm$core$Maybe$map, 32877 function (cents) { 32878 return {ef: cents, e_: mid}; 32879 }, 32880 A2($author$project$Page$Group$NewEntry$Shared$parseAmountCents, data.bg, s)); 32881 }, 32882 $elm$core$Dict$toList(data.aB)); 32883 if (!_Utils_eq( 32884 $elm$core$List$length(parsed), 32885 $elm$core$List$length(selectedPayers))) { 32886 return $elm$core$Result$Err(0); 32887 } else { 32888 var totalPayer = A3( 32889 $elm$core$List$foldl, 32890 F2( 32891 function (p, acc) { 32892 return acc + p.ef; 32893 }), 32894 0, 32895 parsed); 32896 return (!_Utils_eq(totalPayer, formOutput.lo)) ? $elm$core$Result$Err(0) : $elm$core$Result$Ok(parsed); 32897 } 32898 } 32899 } 32900 }(); 32901 var defaultCurrencyAmountResult = function () { 32902 if (!_Utils_eq(data.bg, data.mS)) { 32903 var _v3 = A2( 32904 $author$project$Page$Group$NewEntry$Shared$parseAmountCents, 32905 data.mS, 32906 $elm$core$String$trim(data.ck)); 32907 if (!_v3.$) { 32908 var amt = _v3.a; 32909 return $elm$core$Result$Ok( 32910 $elm$core$Maybe$Just(amt)); 32911 } else { 32912 return $elm$core$Result$Err(0); 32913 } 32914 } else { 32915 return $elm$core$Result$Ok($elm$core$Maybe$Nothing); 32916 } 32917 }(); 32918 var _v1 = _Utils_Tuple3( 32919 splitResult, 32920 payersResult, 32921 A3( 32922 $elm$core$Result$map2, 32923 $elm$core$Tuple$pair, 32924 defaultCurrencyAmountResult, 32925 $author$project$Page$Group$NewEntry$Shared$cleanAttachments(data.ce))); 32926 if (((!_v1.a.$) && (!_v1.b.$)) && (!_v1.c.$)) { 32927 var splitData = _v1.a.a; 32928 var payers = _v1.b.a; 32929 var _v2 = _v1.c.a; 32930 var defaultCurrencyAmount = _v2.a; 32931 var attachments = _v2.b; 32932 var notes = $elm$core$String$isEmpty( 32933 $elm$core$String$trim(data.bu)) ? $elm$core$Maybe$Nothing : $elm$core$Maybe$Just( 32934 $elm$core$String$trim(data.bu)); 32935 return _Utils_Tuple2( 32936 _Utils_update( 32937 data, 32938 {d_: false}), 32939 $elm$core$Maybe$Just( 32940 $author$project$Page$Group$NewEntry$Shared$ExpenseOutput( 32941 {lo: formOutput.lo, ce: attachments, h9: data.h9, bg: data.bg, cj: formOutput.cj, ck: defaultCurrencyAmount, eE: formOutput.eE, bu: notes, jB: payers, fs: splitData}))); 32942 } else { 32943 return _Utils_Tuple2( 32944 _Utils_update( 32945 data, 32946 {d_: true}), 32947 $elm$core$Maybe$Nothing); 32948 } 32949 } 32950 } else { 32951 return _Utils_Tuple2( 32952 _Utils_update( 32953 data, 32954 {d_: true}), 32955 $elm$core$Maybe$Nothing); 32956 } 32957}; 32958var $author$project$Page$Group$NewEntry$Shared$IncomeOutput = function (a) { 32959 return {$: 2, a: a}; 32960}; 32961var $author$project$Page$Group$NewEntry$submitIncome = function (data) { 32962 var _v0 = $dwayne$elm_validation$Validation$toResult( 32963 $dwayne$elm_form$Form$validate(data.w)); 32964 if (!_v0.$) { 32965 var formOutput = _v0.a; 32966 if ($elm$core$Dict$isEmpty(data.em)) { 32967 return _Utils_Tuple2( 32968 _Utils_update( 32969 data, 32970 {d_: true}), 32971 $elm$core$Maybe$Nothing); 32972 } else { 32973 var splitResult = function () { 32974 var _v4 = data.b2; 32975 if (!_v4) { 32976 return $elm$core$Result$Ok( 32977 $author$project$Page$Group$NewEntry$Shared$ShareSplitData( 32978 A2( 32979 $elm$core$List$map, 32980 function (_v5) { 32981 var mid = _v5.a; 32982 var shares = _v5.b; 32983 return {e_: mid, qc: shares}; 32984 }, 32985 $elm$core$Dict$toList(data.em)))); 32986 } else { 32987 var selectedIds = $elm$core$Dict$keys(data.em); 32988 var parsedAmounts = A2( 32989 $elm$core$List$filterMap, 32990 function (mid) { 32991 return A2( 32992 $elm$core$Maybe$map, 32993 function (cents) { 32994 return {ef: cents, e_: mid}; 32995 }, 32996 A2( 32997 $elm$core$Maybe$andThen, 32998 $author$project$Page$Group$NewEntry$Shared$parseAmountCents(data.bg), 32999 A2($elm$core$Dict$get, mid, data.bj))); 33000 }, 33001 selectedIds); 33002 if (!_Utils_eq( 33003 $elm$core$List$length(parsedAmounts), 33004 $elm$core$List$length(selectedIds))) { 33005 return $elm$core$Result$Err(0); 33006 } else { 33007 var totalExact = A3( 33008 $elm$core$List$foldl, 33009 F2( 33010 function (b, acc) { 33011 return acc + b.ef; 33012 }), 33013 0, 33014 parsedAmounts); 33015 return (!_Utils_eq(totalExact, formOutput.lo)) ? $elm$core$Result$Err(0) : $elm$core$Result$Ok( 33016 $author$project$Page$Group$NewEntry$Shared$ExactSplitData(parsedAmounts)); 33017 } 33018 } 33019 }(); 33020 var defaultCurrencyAmountResult = function () { 33021 if (!_Utils_eq(data.bg, data.mS)) { 33022 var _v3 = A2( 33023 $author$project$Page$Group$NewEntry$Shared$parseAmountCents, 33024 data.mS, 33025 $elm$core$String$trim(data.ck)); 33026 if (!_v3.$) { 33027 var amt = _v3.a; 33028 return $elm$core$Result$Ok( 33029 $elm$core$Maybe$Just(amt)); 33030 } else { 33031 return $elm$core$Result$Err(0); 33032 } 33033 } else { 33034 return $elm$core$Result$Ok($elm$core$Maybe$Nothing); 33035 } 33036 }(); 33037 var _v1 = _Utils_Tuple3( 33038 splitResult, 33039 data.cO, 33040 A3( 33041 $elm$core$Result$map2, 33042 $elm$core$Tuple$pair, 33043 defaultCurrencyAmountResult, 33044 $author$project$Page$Group$NewEntry$Shared$cleanAttachments(data.ce))); 33045 if (((!_v1.a.$) && (!_v1.b.$)) && (!_v1.c.$)) { 33046 var splitData = _v1.a.a; 33047 var receiverId = _v1.b.a; 33048 var _v2 = _v1.c.a; 33049 var defaultCurrencyAmount = _v2.a; 33050 var attachments = _v2.b; 33051 var notes = $elm$core$String$isEmpty( 33052 $elm$core$String$trim(data.bu)) ? $elm$core$Maybe$Nothing : $elm$core$Maybe$Just( 33053 $elm$core$String$trim(data.bu)); 33054 return _Utils_Tuple2( 33055 _Utils_update( 33056 data, 33057 {d_: false}), 33058 $elm$core$Maybe$Just( 33059 $author$project$Page$Group$NewEntry$Shared$IncomeOutput( 33060 {lo: formOutput.lo, ce: attachments, bg: data.bg, cj: formOutput.cj, ck: defaultCurrencyAmount, eE: formOutput.eE, bu: notes, j$: receiverId, fs: splitData}))); 33061 } else { 33062 return _Utils_Tuple2( 33063 _Utils_update( 33064 data, 33065 {d_: true}), 33066 $elm$core$Maybe$Nothing); 33067 } 33068 } 33069 } else { 33070 return _Utils_Tuple2( 33071 _Utils_update( 33072 data, 33073 {d_: true}), 33074 $elm$core$Maybe$Nothing); 33075 } 33076}; 33077var $dwayne$elm_field$Field$Advanced$toMaybe = A2($elm$core$Basics$composeL, $dwayne$elm_validation$Validation$toMaybe, $dwayne$elm_field$Field$Advanced$toValidation); 33078var $dwayne$elm_field$Field$toMaybe = $dwayne$elm_field$Field$Advanced$toMaybe; 33079var $author$project$Page$Group$NewEntry$submitTransfer = function (data) { 33080 var amountAndDate = A2( 33081 $elm$core$Maybe$andThen, 33082 function (amountCents) { 33083 return A2( 33084 $elm$core$Maybe$map, 33085 function (date) { 33086 return _Utils_Tuple2(amountCents, date); 33087 }, 33088 $dwayne$elm_field$Field$toMaybe( 33089 A2( 33090 $dwayne$elm_form$Form$get, 33091 function ($) { 33092 return $.cj; 33093 }, 33094 data.w))); 33095 }, 33096 $dwayne$elm_field$Field$toMaybe( 33097 A2( 33098 $dwayne$elm_form$Form$get, 33099 function ($) { 33100 return $.ef; 33101 }, 33102 data.w))); 33103 var _v0 = _Utils_Tuple3(amountAndDate, data.mL, data.kF); 33104 if (((!_v0.a.$) && (!_v0.b.$)) && (!_v0.c.$)) { 33105 var _v1 = _v0.a.a; 33106 var amountCents = _v1.a; 33107 var date = _v1.b; 33108 var fromId = _v0.b.a; 33109 var toId = _v0.c.a; 33110 if (_Utils_eq(fromId, toId)) { 33111 return _Utils_Tuple2( 33112 _Utils_update( 33113 data, 33114 {d_: true}), 33115 $elm$core$Maybe$Nothing); 33116 } else { 33117 var defaultCurrencyAmountResult = function () { 33118 if (!_Utils_eq(data.bg, data.mS)) { 33119 var _v5 = A2( 33120 $author$project$Page$Group$NewEntry$Shared$parseAmountCents, 33121 data.mS, 33122 $elm$core$String$trim(data.ck)); 33123 if (!_v5.$) { 33124 var amt = _v5.a; 33125 return $elm$core$Result$Ok( 33126 $elm$core$Maybe$Just(amt)); 33127 } else { 33128 return $elm$core$Result$Err(0); 33129 } 33130 } else { 33131 return $elm$core$Result$Ok($elm$core$Maybe$Nothing); 33132 } 33133 }(); 33134 var _v2 = A3( 33135 $elm$core$Result$map2, 33136 $elm$core$Tuple$pair, 33137 defaultCurrencyAmountResult, 33138 $author$project$Page$Group$NewEntry$Shared$cleanAttachments(data.ce)); 33139 if (!_v2.$) { 33140 var _v3 = _v2.a; 33141 var defaultCurrencyAmount = _v3.a; 33142 var attachments = _v3.b; 33143 var notes = $elm$core$String$isEmpty( 33144 $elm$core$String$trim(data.bu)) ? $elm$core$Maybe$Nothing : $elm$core$Maybe$Just( 33145 $elm$core$String$trim(data.bu)); 33146 var description = function () { 33147 var _v4 = $elm$core$String$trim( 33148 $dwayne$elm_field$Field$toRawString( 33149 A2( 33150 $dwayne$elm_form$Form$get, 33151 function ($) { 33152 return $.eE; 33153 }, 33154 data.w))); 33155 if (_v4 === '') { 33156 return $elm$core$Maybe$Nothing; 33157 } else { 33158 var trimmed = _v4; 33159 return $elm$core$Maybe$Just(trimmed); 33160 } 33161 }(); 33162 return _Utils_Tuple2( 33163 _Utils_update( 33164 data, 33165 {d_: false}), 33166 $elm$core$Maybe$Just( 33167 $author$project$Page$Group$NewEntry$Shared$TransferOutput( 33168 {lo: amountCents, ce: attachments, bg: data.bg, cj: date, ck: defaultCurrencyAmount, eE: description, mL: fromId, bu: notes, kF: toId}))); 33169 } else { 33170 return _Utils_Tuple2( 33171 _Utils_update( 33172 data, 33173 {d_: true}), 33174 $elm$core$Maybe$Nothing); 33175 } 33176 } 33177 } else { 33178 return _Utils_Tuple2( 33179 _Utils_update( 33180 data, 33181 {d_: true}), 33182 $elm$core$Maybe$Nothing); 33183 } 33184}; 33185var $author$project$Page$Group$NewEntry$Shared$SubmitEntry = function (a) { 33186 return {$: 1, a: a}; 33187}; 33188var $author$project$Page$Group$NewEntry$toSubmitEffect = function (maybeOutput) { 33189 if (!maybeOutput.$) { 33190 var output = maybeOutput.a; 33191 return $author$project$Page$Group$NewEntry$Shared$SubmitEntry(output); 33192 } else { 33193 return $author$project$Page$Group$NewEntry$Shared$NoEffect; 33194 } 33195}; 33196var $elmcraft$core_extra$List$Extra$updateAt = F3( 33197 function (index, fn, list) { 33198 if (index < 0) { 33199 return list; 33200 } else { 33201 var tail = A2($elm$core$List$drop, index, list); 33202 if (tail.b) { 33203 var x = tail.a; 33204 var xs = tail.b; 33205 return _Utils_ap( 33206 A2($elm$core$List$take, index, list), 33207 A2( 33208 $elm$core$List$cons, 33209 fn(x), 33210 xs)); 33211 } else { 33212 return list; 33213 } 33214 } 33215 }); 33216var $author$project$Page$Group$NewEntry$update = F3( 33217 function (language, msg, _v0) { 33218 var data = _v0; 33219 switch (msg.$) { 33220 case 1: 33221 var s = msg.a; 33222 return _Utils_Tuple2( 33223 _Utils_update( 33224 data, 33225 { 33226 w: A3( 33227 $dwayne$elm_form$Form$modify, 33228 function ($) { 33229 return $.eE; 33230 }, 33231 $dwayne$elm_field$Field$setFromString(s), 33232 data.w) 33233 }), 33234 $author$project$Page$Group$NewEntry$Shared$NoEffect); 33235 case 2: 33236 var s = msg.a; 33237 return _Utils_Tuple2( 33238 _Utils_update( 33239 data, 33240 { 33241 w: A3( 33242 $dwayne$elm_form$Form$modify, 33243 function ($) { 33244 return $.ef; 33245 }, 33246 $dwayne$elm_field$Field$setFromString(s), 33247 data.w) 33248 }), 33249 $author$project$Page$
33249Group$NewEntry$Shared$NoEffect); 33250 case 3: 33251 var s = msg.a; 33252 return _Utils_Tuple2( 33253 _Utils_update( 33254 data, 33255 {bu: s}), 33256 $author$project$Page$Group$NewEntry$Shared$NoEffect); 33257 case 4: 33258 return _Utils_Tuple2( 33259 _Utils_update( 33260 data, 33261 { 33262 ce: _Utils_ap( 33263 data.ce, 33264 _List_fromArray( 33265 [ 33266 {i6: '', kS: ''} 33267 ])) 33268 }), 33269 $author$project$Page$Group$NewEntry$Shared$NoEffect); 33270 case 5: 33271 var index = msg.a; 33272 return _Utils_Tuple2( 33273 _Utils_update( 33274 data, 33275 { 33276 ce: A2($elmcraft$core_extra$List$Extra$removeAt, index, data.ce) 33277 }), 33278 $author$project$Page$Group$NewEntry$Shared$NoEffect); 33279 case 6: 33280 var index = msg.a; 33281 var s = msg.b; 33282 return _Utils_Tuple2( 33283 _Utils_update( 33284 data, 33285 { 33286 ce: A3( 33287 $elmcraft$core_extra$List$Extra$updateAt, 33288 index, 33289 function (a) { 33290 return _Utils_update( 33291 a, 33292 {i6: s}); 33293 }, 33294 data.ce) 33295 }), 33296 $author$project$Page$Group$NewEntry$Shared$NoEffect); 33297 case 7: 33298 var index = msg.a; 33299 var s = msg.b; 33300 return _Utils_Tuple2( 33301 _Utils_update( 33302 data, 33303 { 33304 ce: A3( 33305 $elmcraft$core_extra$List$Extra$updateAt, 33306 index, 33307 function (a) { 33308 return _Utils_update( 33309 a, 33310 {kS: s}); 33311 }, 33312 data.ce) 33313 }), 33314 $author$project$Page$Group$NewEntry$Shared$NoEffect); 33315 case 0: 33316 var kind = msg.a; 33317 return _Utils_Tuple2( 33318 _Utils_update( 33319 data, 33320 {gE: kind}), 33321 $author$project$Page$Group$NewEntry$Shared$NoEffect); 33322 case 8: 33323 var memberId = msg.a; 33324 var newDict = A2($elm$core$Dict$member, memberId, data.aB) ? A2($elm$core$Dict$remove, memberId, data.aB) : A3($elm$core$Dict$insert, memberId, '', data.aB); 33325 return _Utils_Tuple2( 33326 _Utils_update( 33327 data, 33328 {aB: newDict}), 33329 $author$project$Page$Group$NewEntry$Shared$NoEffect); 33330 case 9: 33331 var memberId = msg.a; 33332 var s = msg.b; 33333 return _Utils_Tuple2( 33334 _Utils_update( 33335 data, 33336 { 33337 aB: A3($elm$core$Dict$insert, memberId, s, data.aB) 33338 }), 33339 $author$project$Page$Group$NewEntry$Shared$NoEffect); 33340 case 10: 33341 var memberId = msg.a; 33342 var newDict = A2($elm$core$Dict$member, memberId, data.em) ? A2($elm$core$Dict$remove, memberId, data.em) : A3($elm$core$Dict$insert, memberId, 1, data.em); 33343 return _Utils_Tuple2( 33344 _Utils_update( 33345 data, 33346 {em: newDict}), 33347 $author$project$Page$Group$NewEntry$Shared$NoEffect); 33348 case 11: 33349 var memberId = msg.a; 33350 var newDict = function () { 33351 var _v2 = A2($elm$core$Dict$get, memberId, data.em); 33352 if (!_v2.$) { 33353 var s = _v2.a; 33354 return A3($elm$core$Dict$insert, memberId, s + 1, data.em); 33355 } else { 33356 return A3($elm$core$Dict$insert, memberId, 1, data.em); 33357 } 33358 }(); 33359 return _Utils_Tuple2( 33360 _Utils_update( 33361 data, 33362 {em: newDict}), 33363 $author$project$Page$Group$NewEntry$Shared$NoEffect); 33364 case 12: 33365 var memberId = msg.a; 33366 var newDict = A3( 33367 $elm$core$Dict$update, 33368 memberId, 33369 $elm$core$Maybe$andThen( 33370 function (s) { 33371 return (s <= 1) ? $elm$core$Maybe$Nothing : $elm$core$Maybe$Just(s - 1); 33372 }), 33373 data.em); 33374 return _Utils_Tuple2( 33375 _Utils_update( 33376 data, 33377 {em: newDict}), 33378 $author$project$Page$Group$NewEntry$Shared$NoEffect); 33379 case 13: 33380 var mode = msg.a; 33381 return _Utils_Tuple2( 33382 _Utils_update( 33383 data, 33384 {b2: mode}), 33385 $author$project$Page$Group$NewEntry$Shared$NoEffect); 33386 case 14: 33387 var memberId = msg.a; 33388 var s = msg.b; 33389 return _Utils_Tuple2( 33390 _Utils_update( 33391 data, 33392 { 33393 bj: A3($elm$core$Dict$insert, memberId, s, data.bj) 33394 }), 33395 $author$project$Page$Group$NewEntry$Shared$NoEffect); 33396 case 15: 33397 var memberId = msg.a; 33398 return _Utils_eq( 33399 data.mL, 33400 $elm$core$Maybe$Just(memberId)) ? _Utils_Tuple2( 33401 _Utils_update( 33402 data, 33403 {mL: $elm$core$Maybe$Nothing}), 33404 $author$project$Page$Group$NewEntry$Shared$NoEffect) : (_Utils_eq( 33405 data.kF, 33406 $elm$core$Maybe$Just(memberId)) ? _Utils_Tuple2( 33407 _Utils_update( 33408 data, 33409 {kF: $elm$core$Maybe$Nothing}), 33410 $author$project$Page$Group$NewEntry$Shared$NoEffect) : (_Utils_eq(data.mL, $elm$core$Maybe$Nothing) ? _Utils_Tuple2( 33411 _Utils_update( 33412 data, 33413 { 33414 mL: $elm$core$Maybe$Just(memberId) 33415 }), 33416 $author$project$Page$Group$NewEntry$Shared$NoEffect) : (_Utils_eq(data.kF, $elm$core$Maybe$Nothing) ? _Utils_Tuple2( 33417 _Utils_update( 33418 data, 33419 { 33420 kF: $elm$core$Maybe$Just(memberId) 33421 }), 33422 $author$project$Page$Group$NewEntry$Shared$NoEffect) : _Utils_Tuple2(data, $author$project$Page$Group$NewEntry$Shared$NoEffect)))); 33423 case 16: 33424 var memberId = msg.a; 33425 return _Utils_Tuple2( 33426 _Utils_update( 33427 data, 33428 { 33429 cO: $elm$core$Maybe$Just(memberId) 33430 }), 33431 $author$project$Page$Group$NewEntry$Shared$NoEffect); 33432 case 17: 33433 var cat = msg.a; 33434 return _Utils_Tuple2( 33435 _Utils_update( 33436 data, 33437 {h9: cat}), 33438 $author$project$Page$Group$NewEntry$Shared$NoEffect); 33439 case 18: 33440 var c = msg.a; 33441 return _Utils_Tuple2( 33442 _Utils_update( 33443 data, 33444 { 33445 bg: c, 33446 w: A3($author$project$Form$NewEntry$setAmountCurrency, language, c, data.w), 33447 bx: 0 33448 }), 33449 $author$project$Page$Group$NewEntry$Shared$NoEffect); 33450 case 19: 33451 var s = msg.a; 33452 return _Utils_Tuple2( 33453 _Utils_update( 33454 data, 33455 {ck: s}), 33456 $author$project$Page$Group$NewEntry$Shared$NoEffect); 33457 case 20: 33458 var pair = msg.a; 33459 return _Utils_Tuple2( 33460 _Utils_update( 33461 data, 33462 {bx: 1}), 33463 $author$project$Page$Group$NewEntry$Shared$RequestRate(pair)); 33464 case 21: 33465 var fetchedBase = msg.a; 33466 var rate = msg.b; 33467 if (!_Utils_eq(fetchedBase, data.bg)) { 33468 return _Utils_Tuple2(data, $author$project$Page$Group$NewEntry$Shared$NoEffect); 33469 } else { 33470 var converted = function () { 33471 var _v3 = $dwayne$elm_field$Field$toMaybe( 33472 A2( 33473 $dwayne$elm_form$Form$get, 33474 function ($) { 33475 return $.ef; 33476 }, 33477 data.w)); 33478 if (!_v3.$) { 33479 var baseCents = _v3.a; 33480 return A3( 33481 $author$project$Format$formatCentsForInput, 33482 language, 33483 A4($author$project$Domain$Currency$convertCents, rate, baseCents, data.bg, data.mS), 33484 data.mS); 33485 } else { 33486 return data.ck; 33487 } 33488 }(); 33489 return _Utils_Tuple2( 33490 _Utils_update( 33491 data, 33492 {ck: converted, bx: 0}), 33493 $author$project$Page$Group$NewEntry$Shared$NoEffect); 33494 } 33495 case 22: 33496 return _Utils_Tuple2( 33497 _Utils_update( 33498 data, 33499 {bx: 2}), 33500 $author$project$Page$Group$NewEntry$Shared$NoEffect); 33501 case 23: 33502 var s = msg.a; 33503 return _Utils_Tuple2( 33504 _Utils_update( 33505 data, 33506 { 33507 w: A3( 33508 $dwayne$elm_form$Form$modify, 33509 function ($) { 33510 return $.cj; 33511 }, 33512 $dwayne$elm_field$Field$setFromString(s), 33513 data.w) 33514 }), 33515 $author$project$Page$Group$NewEntry$Shared$NoEffect); 33516 default: 33517 return A2( 33518 $elm$core$Tuple$mapSecond, 33519 $author$project$Page$Group$NewEntry$toSubmitEffect, 33520 function () { 33521 var _v4 = data.gE; 33522 switch (_v4) { 33523 case 0: 33524 return $author$project$Page$Group$NewEntry$submitExpense(data); 33525 case 1: 33526 return $author$project$Page$Group$NewEntry$submitTransfer(data); 33527 default: 33528 return $author$project$Page$Group$NewEntry$submitIncome(data); 33529 } 33530 }()); 33531 } 33532 }); 33533var $author$project$Page$JoinGroup$Accepting = function (a) { 33534 return {$: 2, a: a}; 33535}; 33536var $author$project$Page$JoinGroup$JoinConfirmed = $elm$core$Basics$identity; 33537var $author$project$Page$JoinGroup$update = F2( 33538 function (msg, model) { 33539 var _v0 = _Utils_Tuple2(msg, model); 33540 if (_v0.b.$ === 1) { 33541 switch (_v0.a.$) { 33542 case 0: 33543 var memberId = _v0.a.a; 33544 var preview = _v0.b.a; 33545 return _Utils_Tuple2( 33546 $author$project$Page$JoinGroup$ShowingPreview( 33547 _Utils_update( 33548 preview, 33549 { 33550 hk: $author$project$Domain$Member$ClaimMember(memberId) 33551 })), 33552 $elm$core$Maybe$Nothing); 33553 case 1: 33554 var _v1 = _v0.a; 33555 var preview = _v0.b.a; 33556 return _Utils_Tuple2( 33557 $author$project$Page$JoinGroup$ShowingPreview( 33558 _Utils_update( 33559 preview, 33560 {hk: $author$project$Domain$Member$JoinAsNewMember})), 33561 $elm$core$Maybe$Nothing); 33562 case 2: 33563 var name = _v0.a.a; 33564 var preview = _v0.b.a; 33565 return _Utils_Tuple2( 33566 $author$project$Page$JoinGroup$ShowingPreview( 33567 _Utils_update( 33568 preview, 33569 {n0: name})), 33570 $elm$core$Maybe$Nothing); 33571 default: 33572 var _v2 = _v0.a; 33573 var preview = _v0.b.a; 33574 var _v3 = preview.hk; 33575 if (_v3.$ === 1) { 33576 var trimmed = $elm$core$String$trim(preview.n0); 33577 var nameExists = A2( 33578 $elm$core$List$any, 33579 function (m) { 33580 return _Utils_eq( 33581 $elm$core$String$toLower(m.bW), 33582 $elm$core$String$toLower(trimmed)); 33583 }, 33584 A2( 33585 $elm$core$List$filter, 33586 A2( 33587 $elm$core$Basics$composeL, 33588 $elm$core$Basics$not, 33589 function ($) { 33590 return $.nt; 33591 }), 33592 $elm$core$Dict$values(preview.a6.r))); 33593 return ($elm$core$String$isEmpty(trimmed) || nameExists) ? _Utils_Tuple2(model, $elm$core$Maybe$Nothing) : _Utils_Tuple2( 33594 $author$project$Page$JoinGroup$Accepting(preview), 33595 $elm$core$Maybe$Just( 33596 _Utils_update( 33597 preview, 33598 {n0: trimmed}))); 33599 } else { 33600 return _Utils_Tuple2( 33601 $author$project$Page$JoinGroup$Accepting(preview), 33602 $elm$core$Maybe$Just(preview)); 33603 } 33604 } 33605 } else { 33606 return _Utils_Tuple2(model, $elm$core$Maybe$Nothing); 33607 } 33608 }); 33609var $author$project$Page$Group$update = F3( 33610 function (config, msg, model) { 33611 switch (msg.$) { 33612 case 0: 33613 var _v1 = msg.a; 33614 var runner = _v1.a; 33615 var cmd = _v1.b; 33616 return _Utils_Tuple3( 33617 _Utils_update( 33618 model, 33619 {ak: runner}), 33620 cmd, 33621 _List_Nil); 33622 case 1: 33623 var groupView = msg.a; 33624 var _v2 = config.d; 33625 if (_v2.$ === 6) { 33626 var groupId = _v2.a; 33627 return _Utils_Tuple3( 33628 _Utils_update( 33629 model, 33630 {a8: $elm$core$Set$empty, bV: $elm$core$Maybe$Nothing, bs: $elm$core$Maybe$Nothing, at: $elm$core$Dict$empty}), 33631 $elm$core$Platform$Cmd$none, 33632 _List_fromArray( 33633 [ 33634 $author$project$Page$Group$NavigateTo( 33635 A2($author$project$Route$GroupRoute, groupId, groupView)) 33636 ])); 33637 } else { 33638 return _Utils_Tuple3(model, $elm$core$Platform$Cmd$none, _List_Nil); 33639 } 33640 case 2: 33641 var _v3 = model.a; 33642 if (_v3.$ === 3) { 33643 var summary = _v3.a; 33644 return function (_v4) { 33645 var updatedModel = _v4.a; 33646 var cmd = _v4.b; 33647 return _Utils_Tuple3(updatedModel, cmd, _List_Nil); 33648 }( 33649 A3($author$project$Page$Group$loadGroup, config, summary, model)); 33650 } else { 33651 return _Utils_Tuple3(model, $elm$core$Platform$Cmd$none, _List_Nil); 33652 } 33653 case 3: 33654 var payData = msg.a; 33655 var _v5 = _Utils_Tuple2(config.d, model.a); 33656 if ((_v5.a.$ === 6) && (_v5.b.$ === 4)) { 33657 var _v6 = _v5.a; 33658 var groupId = _v6.a; 33659 var loaded = _v5.b.a; 33660 var transferData = { 33661 ef: payData.lo, 33662 ce: _List_Nil, 33663 bg: loaded.bA.il, 33664 cj: A2($author$project$Domain$Date$posixToDate, config.al, config.ap), 33665 ck: $elm$core$Maybe$Nothing, 33666 eE: $elm$core$Maybe$Nothing, 33667 iH: A2( 33668 $elm$core$Maybe$withDefault, 33669 '', 33670 A2($author$project$Page$Group$currentUserRootId, model, loaded)), 33671 bu: $elm$core$Maybe$Nothing, 33672 kE: payData.kF 33673 }; 33674 return _Utils_Tuple3( 33675 _Utils_update( 33676 model, 33677 { 33678 bv: $elm$core$Maybe$Just( 33679 $author$project$Page$Group$PendingTransfer(transferData)) 33680 }), 33681 $elm$core$Platform$Cmd$none, 33682 _List_fromArray( 33683 [ 33684 $author$project$Page$Group$NavigateTo( 33685 A2($author$project$Route$GroupRoute, groupId, $author$project$Route$NewEntry)) 33686 ])); 33687 } else { 33688 return _Utils_Tuple3(model, $elm$core$Platform$Cmd$none, _List_Nil); 33689 } 33690 case 4: 33691 var rootId = msg.a; 33692 var _v7 = model.a; 33693 if (_v7.$ === 4) { 33694 var loaded = _v7.a; 33695 var deviceId = config.O.aK; 33696 return A4( 33697 $author$project$Page$Group$runSubmit, 33698 $author$project$Page$Group$OnMemberActionSaved(loaded.bA.m9), 33699 config, 33700 model, 33701 function (ctx) { 33702 return A3( 33703 $author$project$GroupOps$event, 33704 ctx, 33705 loaded, 33706 $author$project$Domain$Event$MemberLinked( 33707 { 33708 gd: deviceId, 33709 aj: rootId, 33710 kg: A2($author$project$Domain$GroupState$nextLinkSeq, loaded.a6, deviceId) 33711 })); 33712 }); 33713 } else { 33714 return _Utils_Tuple3(model, $elm$core$Platform$Cmd$none, _List_Nil); 33715 } 33716 case 5: 33717 var subMsg = msg.a; 33718 var _v8 = A2($author$project$Page$Group$EntriesTab$update, subMsg, model.cp); 33719 var newEntriesTabModel = _v8.a; 33720 var maybeOutput = _v8.b; 33721 var modelWithTab = _Utils_update( 33722 model, 33723 {cp: newEntriesTabModel}); 33724 if (!maybeOutput.$) { 33725 var output = maybeOutput.a; 33726 return A3($author$project$Page$Group$handleEntriesTabOutput,
33726config, modelWithTab, output); 33727 } else { 33728 return _Utils_Tuple3(modelWithTab, $elm$core$Platform$Cmd$none, _List_Nil); 33729 } 33730 case 6: 33731 var subMsg = msg.a; 33732 var _v10 = A2($author$project$Page$Group$BalanceTab$update, subMsg, model.c8); 33733 var newBalanceTabModel = _v10.a; 33734 var maybeOutput = _v10.b; 33735 var modelWithTab = _Utils_update( 33736 model, 33737 {c8: newBalanceTabModel}); 33738 if (!maybeOutput.$) { 33739 var output = maybeOutput.a; 33740 return A3($author$project$Page$Group$handleBalanceTabOutput, config, modelWithTab, output); 33741 } else { 33742 return _Utils_Tuple3(modelWithTab, $elm$core$Platform$Cmd$none, _List_Nil); 33743 } 33744 case 7: 33745 var subMsg = msg.a; 33746 return _Utils_Tuple3( 33747 _Utils_update( 33748 model, 33749 { 33750 c4: A2($author$project$Page$Group$ActivityTab$update, subMsg, model.c4) 33751 }), 33752 $elm$core$Platform$Cmd$none, 33753 _List_Nil); 33754 case 8: 33755 var subMsg = msg.a; 33756 var _v12 = A2($author$project$Page$Group$MembersTab$update, subMsg, model.du); 33757 var newMembersTabModel = _v12.a; 33758 var maybeOutput = _v12.b; 33759 var modelWithTab = _Utils_update( 33760 model, 33761 {du: newMembersTabModel}); 33762 if (!maybeOutput.$) { 33763 var output = maybeOutput.a; 33764 return A3($author$project$Page$Group$handleMembersTabOutput, config, modelWithTab, output); 33765 } else { 33766 return _Utils_Tuple3(modelWithTab, $elm$core$Platform$Cmd$none, _List_Nil); 33767 } 33768 case 9: 33769 var subMsg = msg.a; 33770 var existingNames = $author$project$Page$Group$activeMemberNames(model); 33771 var _v14 = A2( 33772 $elm$core$Tuple$mapFirst, 33773 function (subModel) { 33774 return _Utils_update( 33775 model, 33776 {cb: subModel}); 33777 }, 33778 A3($author$project$Page$Group$AddMember$update, existingNames, subMsg, model.cb)); 33779 var modelWithPage = _v14.a; 33780 var maybeOutput = _v14.b; 33781 var _v15 = _Utils_Tuple2(maybeOutput, model.a); 33782 if ((!_v15.a.$) && (_v15.b.$ === 4)) { 33783 var addOutput = _v15.a.a; 33784 var loaded = _v15.b.a; 33785 return A4( 33786 $author$project$Page$Group$runSubmit, 33787 $author$project$Page$Group$OnMemberActionSaved(loaded.bA.m9), 33788 config, 33789 modelWithPage, 33790 function (ctx) { 33791 return A3($author$project$GroupOps$addMember, ctx, loaded, addOutput); 33792 }); 33793 } else { 33794 return _Utils_Tuple3(modelWithPage, $elm$core$Platform$Cmd$none, _List_Nil); 33795 } 33796 case 10: 33797 var subMsg = msg.a; 33798 var existingNames = $author$project$Page$Group$activeMemberNames(model); 33799 var _v16 = A2( 33800 $elm$core$Tuple$mapFirst, 33801 function (subModel) { 33802 return _Utils_update( 33803 model, 33804 {cn: subModel}); 33805 }, 33806 A3( 33807 $author$project$Page$Group$EditMemberMetadata$update, 33808 {iD: existingNames, kc: config.fr}, 33809 subMsg, 33810 model.cn)); 33811 var modelWithPage = _v16.a; 33812 var maybeOutput = _v16.b; 33813 if (!maybeOutput.$) { 33814 if (!maybeOutput.a.$) { 33815 var submitted = maybeOutput.a.a; 33816 var _v18 = model.a; 33817 if (_v18.$ === 4) { 33818 var loaded = _v18.a; 33819 return A4($author$project$Page$Group$submitMemberMetadata, config, modelWithPage, loaded, submitted); 33820 } else { 33821 return _Utils_Tuple3(modelWithPage, $elm$core$Platform$Cmd$none, _List_Nil); 33822 } 33823 } else { 33824 var meta = maybeOutput.a.a; 33825 return _Utils_Tuple3( 33826 modelWithPage, 33827 $elm$core$Platform$Cmd$none, 33828 _List_fromArray( 33829 [ 33830 $author$project$Page$Group$SaveSelfProfile(meta) 33831 ])); 33832 } 33833 } else { 33834 return _Utils_Tuple3(modelWithPage, $elm$core$Platform$Cmd$none, _List_Nil); 33835 } 33836 case 11: 33837 var subMsg = msg.a; 33838 var _v19 = model.a; 33839 if (_v19.$ === 4) { 33840 var loaded = _v19.a; 33841 var _v20 = A2( 33842 $elm$core$Tuple$mapFirst, 33843 function (subModel) { 33844 return _Utils_update( 33845 model, 33846 {cD: subModel}); 33847 }, 33848 A3($author$project$Page$Group$MergeMember$update, loaded.a6, subMsg, model.cD)); 33849 var modelWithPage = _v20.a; 33850 var maybeOutput = _v20.b; 33851 var _v21 = _Utils_Tuple2(maybeOutput, config.d); 33852 _v21$3: 33853 while (true) { 33854 if (!_v21.a.$) { 33855 switch (_v21.a.a.$) { 33856 case 0: 33857 if (_v21.b.$ === 6) { 33858 var sourceId = _v21.a.a.a; 33859 var _v22 = _v21.b; 33860 var gid = _v22.a; 33861 return _Utils_Tuple3( 33862 modelWithPage, 33863 $elm$core$Platform$Cmd$none, 33864 _List_fromArray( 33865 [ 33866 $author$project$Page$Group$NavigateTo( 33867 A2( 33868 $author$project$Route$GroupRoute, 33869 gid, 33870 A2($author$project$Route$MergeMember, sourceId, $elm$core$Maybe$Nothing))) 33871 ])); 33872 } else { 33873 break _v21$3; 33874 } 33875 case 1: 33876 if (_v21.b.$ === 6) { 33877 var _v23 = _v21.a.a; 33878 var sourceId = _v23.a; 33879 var targetId = _v23.b; 33880 var _v24 = _v21.b; 33881 var gid = _v24.a; 33882 return _Utils_Tuple3( 33883 modelWithPage, 33884 $elm$core$Platform$Cmd$none, 33885 _List_fromArray( 33886 [ 33887 $author$project$Page$Group$NavigateTo( 33888 A2( 33889 $author$project$Route$GroupRoute, 33890 gid, 33891 A2( 33892 $author$project$Route$MergeMember, 33893 sourceId, 33894 $elm$core$Maybe$Just(targetId)))) 33895 ])); 33896 } else { 33897 break _v21$3; 33898 } 33899 default: 33900 var mergeData = _v21.a.a.a; 33901 return A4($author$project$Page$Group$submitMerge, config, modelWithPage, loaded, mergeData); 33902 } 33903 } else { 33904 break _v21$3; 33905 } 33906 } 33907 return _Utils_Tuple3(modelWithPage, $elm$core$Platform$Cmd$none, _List_Nil); 33908 } else { 33909 return _Utils_Tuple3(model, $elm$core$Platform$Cmd$none, _List_Nil); 33910 } 33911 case 12: 33912 var subMsg = msg.a; 33913 var _v25 = A2( 33914 $elm$core$Tuple$mapFirst, 33915 function (subModel) { 33916 return _Utils_update( 33917 model, 33918 {ac: subModel}); 33919 }, 33920 A3( 33921 $author$project$Page$Group$NewEntry$update, 33922 $author$project$Translations$currentLanguage(config.aJ), 33923 subMsg, 33924 model.ac)); 33925 var modelWithPage = _v25.a; 33926 var effect = _v25.b; 33927 switch (effect.$) { 33928 case 0: 33929 return _Utils_Tuple3(modelWithPage, $elm$core$Platform$Cmd$none, _List_Nil); 33930 case 1: 33931 var output = effect.a; 33932 return A3($author$project$Page$Group$handleNewEntryOutput, config, modelWithPage, output); 33933 default: 33934 var pair = effect.a; 33935 return A3($author$project$Page$Group$fetchExchangeRate, config, modelWithPage, pair); 33936 } 33937 case 47: 33938 var base = msg.a; 33939 var response = msg.b; 33940 var rateMsg = function () { 33941 if (!response.$) { 33942 var rate = response.a; 33943 return A2($author$project$Page$Group$NewEntry$Shared$RateFetched, base, rate); 33944 } else { 33945 return $author$project$Page$Group$NewEntry$Shared$RateFetchFailed; 33946 } 33947 }(); 33948 return _Utils_Tuple3( 33949 _Utils_update( 33950 model, 33951 { 33952 ac: A3( 33953 $author$project$Page$Group$NewEntry$update, 33954 $author$project$Translations$currentLanguage(config.aJ), 33955 rateMsg, 33956 model.ac).a 33957 }), 33958 $elm$core$Platform$Cmd$none, 33959 _List_Nil); 33960 case 13: 33961 var subMsg = msg.a; 33962 var result = A2($author$project$Page$Group$EditGroupMetadata$update, subMsg, model.cm); 33963 var modelWithPage = _Utils_update( 33964 model, 33965 {cm: result.nS}); 33966 if (result.mg) { 33967 var _v28 = _Utils_Tuple2(config.d, model.a); 33968 if ((_v28.a.$ === 6) && (_v28.b.$ === 4)) { 33969 var _v29 = _v28.a; 33970 var groupId = _v29.a; 33971 var loaded = _v28.b.a; 33972 return _Utils_eq(loaded.bA.m9, groupId) ? A3($author$project$Page$Group$deleteGroup, config, modelWithPage, loaded) : _Utils_Tuple3(modelWithPage, $elm$core$Platform$Cmd$none, _List_Nil); 33973 } else { 33974 return _Utils_Tuple3(modelWithPage, $elm$core$Platform$Cmd$none, _List_Nil); 33975 } 33976 } else { 33977 if (result.lt) { 33978 var _v30 = model.a; 33979 if (_v30.$ === 4) { 33980 var loaded = _v30.a; 33981 return A3($author$project$Page$Group$toggleArchiveGroup, config, modelWithPage, loaded); 33982 } else { 33983 return _Utils_Tuple3(modelWithPage, $elm$core$Platform$Cmd$none, _List_Nil); 33984 } 33985 } else { 33986 var _v31 = _Utils_Tuple2(result.nM, model.a); 33987 if ((!_v31.a.$) && (_v31.b.$ === 4)) { 33988 var change = _v31.a.a; 33989 var loaded = _v31.b.a; 33990 return A4( 33991 $author$project$Page$Group$runSubmit, 33992 $author$project$Page$Group$OnGroupMetadataActionSaved(loaded.bA.m9), 33993 config, 33994 modelWithPage, 33995 function (ctx) { 33996 return A3( 33997 $author$project$GroupOps$event, 33998 ctx, 33999 loaded, 34000 $author$project$Domain$Event$GroupMetadataUpdated(change)); 34001 }); 34002 } else { 34003 return _Utils_Tuple3(modelWithPage, $elm$core$Platform$Cmd$none, _List_Nil); 34004 } 34005 } 34006 } 34007 case 14: 34008 var subMsg = msg.a; 34009 var _v32 = A2($author$project$Page$JoinGroup$update, subMsg, model.by); 34010 var rejoinModel = _v32.a; 34011 var maybeOutput = _v32.b; 34012 var modelWithPage = _Utils_update( 34013 model, 34014 {by: rejoinModel}); 34015 var _v33 = _Utils_Tuple2(maybeOutput, model.a); 34016 if ((!_v33.a.$) && (_v33.b.$ === 4)) { 34017 var joinData = _v33.a.a; 34018 var loaded = _v33.b.a; 34019 var _v34 = A4($author$project$GroupOps$joinPayload, config.O.aK, joinData.hk, joinData.n0, loaded.a6); 34020 if (!_v34.$) { 34021 var payload = _v34.a; 34022 var _v35 = A4( 34023 $author$project$Page$Group$runSubmit, 34024 $author$project$Page$Group$OnMemberActionSaved(loaded.bA.m9), 34025 config, 34026 modelWithPage, 34027 function (ctx) { 34028 return A3($author$project$GroupOps$event, ctx, loaded, payload); 34029 }); 34030 var submittedModel = _v35.a; 34031 var cmd = _v35.b; 34032 var outputs = _v35.c; 34033 return _Utils_Tuple3( 34034 submittedModel, 34035 cmd, 34036 _Utils_ap( 34037 outputs, 34038 _List_fromArray( 34039 [ 34040 $author$project$Page$Group$NavigateTo( 34041 A2( 34042 $author$project$Route$GroupRoute, 34043 loaded.bA.m9, 34044 $author$project$Route$Tab(2))) 34045 ]))); 34046 } else { 34047 return _Utils_Tuple3(modelWithPage, $elm$core$Platform$Cmd$none, _List_Nil); 34048 } 34049 } else { 34050 return _Utils_Tuple3(modelWithPage, $elm$core$Platform$Cmd$none, _List_Nil); 34051 } 34052 case 15: 34053 var prefData = msg.a; 34054 var _v36 = model.a; 34055 if (_v36.$ === 4) { 34056 var loaded = _v36.a; 34057 return A4( 34058 $author$project$Page$Group$runSubmit, 34059 $author$project$Page$Group$OnEntryActionSaved(loaded.bA.m9), 34060 config, 34061 model, 34062 function (ctx) { 34063 return A3( 34064 $author$project$GroupOps$event, 34065 ctx, 34066 loaded, 34067 $author$project$Domain$Event$SettlementPreferencesUpdated(prefData)); 34068 }); 34069 } else { 34070 return _Utils_Tuple3(model, $elm$core$Platform$Cmd$none, _List_Nil); 34071 } 34072 case 17: 34073 var _v37 = model.a; 34074 if (_v37.$ === 4) { 34075 var loaded = _v37.a; 34076 return loaded.bA.gA ? A3($author$project$Page$Group$toggleArchiveGroup, config, model, loaded) : _Utils_Tuple3(model, $elm$core$Platform$Cmd$none, _List_Nil); 34077 } else { 34078 return _Utils_Tuple3(model, $elm$core$Platform$Cmd$none, _List_Nil); 34079 } 34080 case 16: 34081 var _v38 = model.a; 34082 if (_v38.$ === 4) { 34083 var loaded = _v38.a; 34084 var _v39 = A2($author$project$Page$Group$currentUserRootId, model, loaded); 34085 if (!_v39.$) { 34086 var userRootId = _v39.a; 34087 return A4($author$project$Page$Group$toggleGroupNotification, config, model, loaded, userRootId); 34088 } else { 34089 return _Utils_Tuple3(model, $elm$core$Platform$Cmd$none, _List_Nil); 34090 } 34091 } else { 34092 return _Utils_Tuple3(model, $elm$core$Platform$Cmd$none, _List_Nil); 34093 } 34094 case 18: 34095 if (!msg.b.$) { 34096 var groupId = msg.a; 34097 var envelope = msg.b.a; 34098 var _v40 = A4($author$project$Page$Group$applyAndSync, config, groupId, envelope, model); 34099 if (!_v40.$) { 34100 var _v41 = _v40.a; 34101 var syncModel = _v41.a; 34102 var syncCmd = _v41.b; 34103 var timeOutputs = _v41.c; 34104 var _v42 = config.d; 34105 if (((_v42.$ === 6) && (_v42.b.$ === 1)) && (!_v42.b.a)) { 34106 var _v43 = _v42.b.a; 34107 return _Utils_Tuple3( 34108 syncModel, 34109 syncCmd, 34110 A2( 34111 $elm$core$List$cons, 34112 A2( 34113 $author$project$Page$Group$ShowToast, 34114 0, 34115 $author$project$Translations$toastSettlementRecorded(config.aJ)), 34116 timeOutputs)); 34117 } else { 34118 return _Utils_Tuple3( 34119 syncModel, 34120 syncCmd, 34121 A2( 34122 $elm$core$List$cons, 34123 $author$project$Page$Group$NavigateTo( 34124 A2( 34125 $author$project$Route$GroupRoute, 34126 groupId, 34127 $author$project$Route$Tab(1))), 34128 timeOutputs)); 34129 } 34130 } else { 34131 return _Utils_Tuple3(model, $elm$core$Platform$Cmd$none, _List_Nil); 34132 } 34133 } else { 34134 return _Utils_Tuple3( 34135 model, 34136 $elm$core$Platform$Cmd$none, 34137 _List_fromArray( 34138 [ 34139 A2( 34140 $author$project$Page$Group$ShowToast, 34141 1, 34142 $author$project$Translations$toastEntrySaveError(config.aJ)), 34143 A3($author$project$Page$Group$LogError, 1, 0, 'Failed to save entry') 34144 ])); 34145 } 34146 case 19: 34147 if (!msg.b.$) { 34148 var groupId = msg.a; 34149 var envelope = msg.b.a; 34150 var _v44 = A2( 34151 $elm$core$Maybe$withDefault, 34152 _Utils_Tuple3(model, $elm$core$Platform$Cmd$none, _List_Nil), 34153 A4($author$project$Page$Group$applyAndSync, config, groupId, envelope, model)); 34154 var syncModel = _v44.a; 34155 var syncCmd = _v44.b; 34156 var timeOutputs = _v44.c; 34157 var _v45 = A2($author$project$UI$Toast$entryActionMessage, config.aJ, envelope.jC); 34158 if (!_v45.$) { 34159 var message = _v45.a; 34160 return _Utils_Tuple3( 34161 syncModel, 34162 syncCmd, 34163 A2( 34164 $elm$core$List$cons, 34165 A2($author$project$Page$Group$ShowToast, 0, message), 34166 timeOutputs)); 34167 } else { 34168 return _Utils_Tuple3(syncModel, syncCmd, timeOutputs); 34169 } 34170 } else { 34171 return _Utils_Tuple3( 34172 model, 34173 $elm$core$Platform$Cmd$none, 34174 _List_fromArray( 34175 [ 34176 A2( 34177 $author$project$Page$Group$ShowToast, 34178 1, 34179 $author$project$Translations$toastEntryActionError(config.aJ)), 34180 A3($author$project$Page$Group$LogError, 1, 0, 'Failed to update entry') 34181 ])); 34182 } 34183 case 20: 34184 if (!msg.b.$) { 34185 var groupId = msg.a; 34186 var envelope = msg.b.a; 34187 var _v46 = A4($author$project$Page$Group$applyAndSync, config, groupId, envelope, model); 34188 if (!_v46.$) { 34189 var _v47 = _v46.a; 34190 var syncModel = _v47.a; 34191 var syncCmd = _v47.b; 34192 var timeOutputs = _v47.c; 34193 var _v48 = A3($author$project$Page$Group$handleMergeCompletion, config, envelope, syncModel); 34194 var mergeModel = _v48.a; 34195 var mergeStatus = _v48.b; 34196 var mergeOutputs = _v48.c; 34197 var _v49 = _Utils_Tuple2(mergeStatus, config.d);
34198 _v49$2: 34199 while (true) { 34200 _v49$3: 34201 while (true) { 34202 if (_v49.b.$ === 6) { 34203 switch (_v49.b.b.$) { 34204 case 5: 34205 var _v50 = _v49.b; 34206 var gid = _v50.a; 34207 var _v51 = _v50.b; 34208 return _Utils_Tuple3( 34209 _Utils_update( 34210 mergeModel, 34211 {cb: $author$project$Page$Group$AddMember$init}), 34212 syncCmd, 34213 A2( 34214 $elm$core$List$cons, 34215 $author$project$Page$Group$NavigateTo( 34216 A2( 34217 $author$project$Route$GroupRoute, 34218 gid, 34219 $author$project$Route$Tab(2))), 34220 _Utils_ap(mergeOutputs, timeOutputs))); 34221 case 6: 34222 var _v52 = _v49.b; 34223 var gid = _v52.a; 34224 return _Utils_Tuple3( 34225 mergeModel, 34226 syncCmd, 34227 A2( 34228 $elm$core$List$cons, 34229 $author$project$Page$Group$NavigateTo( 34230 A2( 34231 $author$project$Route$GroupRoute, 34232 gid, 34233 $author$project$Route$Tab(2))), 34234 _Utils_ap(mergeOutputs, timeOutputs))); 34235 default: 34236 if (!_v49.a) { 34237 break _v49$2; 34238 } else { 34239 break _v49$3; 34240 } 34241 } 34242 } else { 34243 if (!_v49.a) { 34244 break _v49$2; 34245 } else { 34246 break _v49$3; 34247 } 34248 } 34249 } 34250 return _Utils_Tuple3( 34251 mergeModel, 34252 syncCmd, 34253 _Utils_ap(mergeOutputs, timeOutputs)); 34254 } 34255 var _v53 = _v49.a; 34256 var _v54 = A3( 34257 $author$project$Page$Group$initPagesIfNeeded, 34258 config, 34259 $author$project$Page$Group$routeToGroupView(config.d), 34260 mergeModel); 34261 var initModel = _v54.a; 34262 var initCmd = _v54.b; 34263 return _Utils_Tuple3( 34264 initModel, 34265 $elm$core$Platform$Cmd$batch( 34266 _List_fromArray( 34267 [syncCmd, initCmd])), 34268 timeOutputs); 34269 } else { 34270 return _Utils_Tuple3(model, $elm$core$Platform$Cmd$none, _List_Nil); 34271 } 34272 } else { 34273 return _Utils_Tuple3( 34274 _Utils_update( 34275 model, 34276 { 34277 bY: $elm$core$Maybe$Nothing, 34278 by: $author$project$Page$JoinGroup$acceptanceFailed(model.by) 34279 }), 34280 $elm$core$Platform$Cmd$none, 34281 _List_fromArray( 34282 [ 34283 A2( 34284 $author$project$Page$Group$ShowToast, 34285 1, 34286 $author$project$Translations$toastMemberActionError(config.aJ)), 34287 A3($author$project$Page$Group$LogError, 1, 0, 'Failed to update member') 34288 ])); 34289 } 34290 case 21: 34291 if (!msg.b.$) { 34292 var groupId = msg.a; 34293 var envelope = msg.b.a; 34294 var _v55 = A3($author$project$Page$Group$appendEventAndRecompute, model, groupId, envelope); 34295 if (!_v55.$) { 34296 var updatedModel = _v55.a; 34297 var modelWithUnpushed = A2($author$project$Page$Group$addUnpushedIdToModel, envelope.m9, updatedModel); 34298 var _v56 = A3($author$project$Page$Group$syncGroupSummaryName, config, groupId, modelWithUnpushed); 34299 var modelAfterSummary = _v56.a; 34300 var summaryCmd = _v56.b; 34301 var summaryOutputs = _v56.c; 34302 var _v57 = A3($author$project$Page$Group$triggerSyncInternal, config, groupId, modelAfterSummary); 34303 var syncModel = _v57.a; 34304 var syncCmd = _v57.b; 34305 return _Utils_Tuple3( 34306 syncModel, 34307 $elm$core$Platform$Cmd$batch( 34308 _List_fromArray( 34309 [summaryCmd, syncCmd])), 34310 A2( 34311 $elm$core$List$cons, 34312 $author$project$Page$Group$NavigateTo( 34313 A2( 34314 $author$project$Route$GroupRoute, 34315 groupId, 34316 $author$project$Route$Tab(2))), 34317 summaryOutputs)); 34318 } else { 34319 return _Utils_Tuple3(model, $elm$core$Platform$Cmd$none, _List_Nil); 34320 } 34321 } else { 34322 return _Utils_Tuple3( 34323 model, 34324 $elm$core$Platform$Cmd$none, 34325 _List_fromArray( 34326 [ 34327 A2( 34328 $author$project$Page$Group$ShowToast, 34329 1, 34330 $author$project$Translations$toastGroupSettingsError(config.aJ)), 34331 A3($author$project$Page$Group$LogError, 1, 0, 'Failed to save group settings') 34332 ])); 34333 } 34334 case 22: 34335 var groupId = msg.a; 34336 var response = msg.b; 34337 return A4($author$project$Page$Group$finishSummaryMutation, config, groupId, response, model); 34338 case 23: 34339 var groupId = msg.a; 34340 var attempted = msg.b; 34341 var response = msg.c; 34342 return A5($author$project$Page$Group$finishNotificationMutation, config, groupId, attempted, response, model); 34343 case 24: 34344 switch (msg.b.$) { 34345 case 0: 34346 var groupId = msg.a; 34347 var result = msg.b.a; 34348 var _v58 = A8($author$project$Page$Group$applyLoadedGroup, groupId, result.iC, result.gs, result.cZ, result.bC, result.c_, result.kw, model); 34349 if (!_v58.$) { 34350 var loadedModel = _v58.a; 34351 var _v59 = A3( 34352 $author$project$Page$Group$initPagesIfNeeded, 34353 config, 34354 $author$project$Page$Group$routeToGroupView(config.d), 34355 loadedModel); 34356 var initializedModel = _v59.a; 34357 var initCmd = _v59.b; 34358 var _v60 = A2($author$project$Page$Group$registerNotifyTopic, config, initializedModel); 34359 var notifiedModel = _v60.a; 34360 var notifyCmd = _v60.b; 34361 var _v61 = A3($author$project$Page$Group$triggerSyncInternal, config, groupId, notifiedModel); 34362 var syncModel = _v61.a; 34363 var syncCmd = _v61.b; 34364 return _Utils_Tuple3( 34365 syncModel, 34366 $elm$core$Platform$Cmd$batch( 34367 _List_fromArray( 34368 [syncCmd, initCmd, notifyCmd])), 34369 A3($author$project$Page$Group$feedbackOutputs, config, false, syncModel)); 34370 } else { 34371 return _Utils_Tuple3(model, $elm$core$Platform$Cmd$none, _List_Nil); 34372 } 34373 case 1: 34374 var groupId = msg.a; 34375 var err = msg.b.a; 34376 return A4( 34377 $author$project$Page$Group$finishWorkspaceLoadFailure, 34378 config, 34379 groupId, 34380 'Load group: ' + $author$project$Infra$Storage$errorToString(err), 34381 model); 34382 default: 34383 var groupId = msg.a; 34384 return A4($author$project$Page$Group$finishWorkspaceLoadFailure, config, groupId, 'Unexpected error loading group events', model); 34385 } 34386 case 25: 34387 switch (msg.c.$) { 34388 case 0: 34389 var groupId = msg.a; 34390 var pushedIds = msg.b; 34391 var syncResult = msg.c.a; 34392 var _v62 = model.a; 34393 if (_v62.$ === 4) { 34394 var loaded = _v62.a; 34395 if (_Utils_eq(loaded.bA.m9, groupId)) { 34396 var result = A2( 34397 $author$project$Page$Group$markUnseenEvents, 34398 model, 34399 A4($author$project$GroupOps$applySyncResult, config.ap, pushedIds, syncResult, loaded)); 34400 var followUpRequested = _Utils_eq(model.R, $author$project$Page$Group$SyncFollowUpRequested); 34401 var _v63 = A3( 34402 $author$project$Infra$ConcurrentTaskExtra$andRun, 34403 $author$project$Page$Group$OnCompactionStep(groupId), 34404 function () { 34405 var _v64 = _Utils_Tuple2( 34406 loaded.bA.gA, 34407 A2($author$project$Page$Group$currentUserRootId, model, result.d9)); 34408 if ((!_v64.a) && (!_v64.b.$)) { 34409 var myRoot = _v64.b.a; 34410 return A2( 34411 $author$project$GroupOps$compactionStep, 34412 { 34413 hJ: model.iY, 34414 nZ: myRoot, 34415 cH: config.ap, 34416 pM: syncResult.pF.pM, 34417 p9: {ct: groupId, gs: loaded.gs, hl: config.hl} 34418 }, 34419 result.d9); 34420 } else { 34421 return $andrewMacmurray$elm_concurrent_task$ConcurrentTask$succeed( 34422 {gJ: false, hs: $author$project$GroupOps$NoCompactionStep}); 34423 } 34424 }(), 34425 A3( 34426 $author$project$Infra$ConcurrentTaskExtra$andRun, 34427 $author$project$Page$Group$PostSyncTasksDone, 34428 A3( 34429 $author$project$GroupOps$postSyncTasks, 34430 config.de, 34431 {ct: groupId, gs: loaded.gs, hl: config.hl}, 34432 result), 34433 _Utils_Tuple2(model.ak, $elm$core$Platform$Cmd$none))); 34434 var runner = _v63.a; 34435 var taskCmds = _v63.b; 34436 var _v65 = A2( 34437 $author$project$Page$Group$refreshPagesAfterSync, 34438 config, 34439 _Utils_update( 34440 model, 34441 { 34442 ak: runner, 34443 R: $author$project$Page$Group$SyncIdle,
34444 a: $author$project$Page$Group$WorkspaceLoaded(result.d9) 34445 })); 34446 var modelAfterSync = _v65.a; 34447 var initCmd = _v65.b; 34448 var _v66 = A3($author$project$Page$Group$syncGroupSummaryName, config, groupId, modelAfterSync); 34449 var summaryModel = _v66.a; 34450 var summaryCmd = _v66.b; 34451 var summaryOutputs = _v66.c; 34452 var outputs = (syncResult.pF.aE > 0) ? A2( 34453 $elm$core$List$cons, 34454 A3( 34455 $author$project$Page$Group$LogError, 34456 0, 34457 0, 34458 'Sync: skipped ' + ($elm$core$String$fromInt(syncResult.pF.aE) + ' undecodable record(s)')), 34459 summaryOutputs) : summaryOutputs; 34460 if ($elm$core$Set$isEmpty(result.d9.bC) && (!followUpRequested)) { 34461 return _Utils_Tuple3( 34462 summaryModel, 34463 $elm$core$Platform$Cmd$batch( 34464 _List_fromArray( 34465 [taskCmds, summaryCmd, initCmd])), 34466 outputs); 34467 } else { 34468 var _v67 = A3($author$project$Page$Group$triggerSyncInternal, config, groupId, summaryModel); 34469 var followUpModel = _v67.a; 34470 var followUpCmd = _v67.b; 34471 return _Utils_Tuple3( 34472 followUpModel, 34473 $elm$core$Platform$Cmd$batch( 34474 _List_fromArray( 34475 [taskCmds, summaryCmd, followUpCmd, initCmd])), 34476 outputs); 34477 } 34478 } else { 34479 return A2($author$project$Page$Group$finishStaleConnectivity, config, model); 34480 } 34481 } else { 34482 return A2($author$project$Page$Group$finishStaleConnectivity, config, model); 34483 } 34484 case 1: 34485 var groupId = msg.a; 34486 var err = msg.c.a; 34487 var _v68 = model.a; 34488 if (_v68.$ === 4) { 34489 var loaded = _v68.a; 34490 if (!_Utils_eq(loaded.bA.m9, groupId)) { 34491 return A2($author$project$Page$Group$finishStaleConnectivity, config, model); 34492 } else { 34493 if ($author$project$Infra$Server$isNotFound(err) || ($author$project$Infra$Server$isUnauthorized(err) && _Utils_eq(loaded.cZ, $elm$core$Maybe$Nothing))) { 34494 var _v69 = A3($author$project$Page$Group$startServerGroupCreation, config, loaded, model); 34495 var creationModel = _v69.a; 34496 var creationCmd = _v69.b; 34497 return _Utils_Tuple3(creationModel, creationCmd, _List_Nil); 34498 } else { 34499 var failureOutputs = function () { 34500 if ($author$project$Infra$Server$isNetworkError(err) || $author$project$Infra$Server$isFrozen(err)) { 34501 return _List_Nil; 34502 } else { 34503 var toastMessage = $author$project$Infra$Server$isQuotaExceeded(err) ? $author$project$Translations$toastGroupFull(config.aJ) : ($author$project$Infra$Server$isRateLimited(err) ? $author$project$Translations$toastRateLimited(config.aJ) : A2( 34504 $author$project$Translations$toastSyncError, 34505 A2($author$project$Infra$Server$errorToText, config.aJ, err), 34506 config.aJ)); 34507 return _List_fromArray( 34508 [ 34509 A2($author$project$Page$Group$ShowToast, 1, toastMessage), 34510 A3( 34511 $author$project$Page$Group$LogError, 34512 0, 34513 0, 34514 'Sync: ' + $author$project$Infra$Server$errorToString(err)) 34515 ]); 34516 } 34517 }(); 34518 if ($author$project$Infra$Server$isRateLimited(err)) { 34519 var _v70 = A4( 34520 $author$project$Page$Group$recordTamper, 34521 config, 34522 $author$project$Domain$TamperSignals$recordRateLimitHit(config.ap), 34523 loaded, 34524 model); 34525 var bumpedModel = _v70.a; 34526 var saveCmd = _v70.b; 34527 return _Utils_Tuple3( 34528 _Utils_update( 34529 bumpedModel, 34530 {R: $author$project$Page$Group$SyncIdle}), 34531 saveCmd, 34532 failureOutputs); 34533 } else { 34534 return _Utils_Tuple3( 34535 _Utils_update( 34536 model, 34537 {R: $author$project$Page$Group$SyncIdle}), 34538 $elm$core$Platform$Cmd$none, 34539 failureOutputs); 34540 } 34541 } 34542 } 34543 } else { 34544 return A2($author$project$Page$Group$finishStaleConnectivity, config, model); 34545 } 34546 default: 34547 var groupId = msg.a; 34548 return A2($author$project$Page$Group$hasLoadedGroup, groupId, model) ? _Utils_Tuple3( 34549 _Utils_update( 34550 model, 34551 {R: $author$project$Page$Group$SyncIdle}), 34552 $elm$core$Platform$Cmd$none, 34553 _List_fromArray( 34554 [ 34555 A3($author$project$Page$Group$LogError, 0, 0, 'Unexpected error during group sync') 34556 ])) : A2($author$project$Page$Group$finishStaleConnectivity, config, model); 34557 } 34558 case 27: 34559 var groupId = msg.a; 34560 var result = msg.b; 34561 var outputs = function () { 34562 if (!result.$) { 34563 return _List_Nil; 34564 } else { 34565 return _List_fromArray( 34566 [ 34567 A3($author$project$Page$Group$LogError, 1, 0, 'Failed to persist the re-queued log after relay group creation') 34568 ]); 34569 } 34570 }(); 34571 if (A2($author$project$Page$Group$hasLoadedGroup, groupId, model)) { 34572 var _v74 = A3($author$project$Page$Group$triggerSyncInternal, config, groupId, model); 34573 var syncModel = _v74.a; 34574 var syncCmd = _v74.b; 34575 return _Utils_Tuple3(syncModel, syncCmd, outputs); 34576 } else { 34577 return function (_v75) { 34578 var m = _v75.a; 34579 var c = _v75.b; 34580 var o = _v75.c; 34581 return _Utils_Tuple3( 34582 m, 34583 c, 34584 _Utils_ap(outputs, o)); 34585 }( 34586 A2($author$project$Page$Group$finishStaleConnectivity, config, model)); 34587 } 34588 case 26: 34589 switch (msg.b.$) { 34590 case 0: 34591 var groupId = msg.a; 34592 var _v71 = model.a; 34593 if (_v71.$ === 4) { 34594 var loaded = _v71.a; 34595 if (_Utils_eq(loaded.bA.m9, groupId)) { 34596 var _v72 = A2($author$project$GroupOps$requeueFullLog, config.de, loaded); 34597 var requeuedLoaded = _v72.a; 34598 var persistTask = _v72.b; 34599 var _v73 = A3( 34600 $author$project$Infra$ConcurrentTaskExtra$andRun, 34601 $author$project$Page$Group$OnFullLogRequeued(groupId), 34602 persistTask, 34603 _Utils_Tuple2(model.ak, $elm$core$Platform$Cmd$none)); 34604 var runner = _v73.a;
34605 var persistCmd = _v73.b; 34606 return _Utils_Tuple3( 34607 _Utils_update( 34608 model, 34609 { 34610 ak: runner, 34611 R: $author$project$Page$Group$SyncIdle, 34612 a: $author$project$Page$Group$WorkspaceLoaded(requeuedLoaded) 34613 }), 34614 persistCmd, 34615 _List_Nil); 34616 } else { 34617 return A2($author$project$Page$Group$finishStaleConnectivity, config, model); 34618 } 34619 } else { 34620 return A2($author$project$Page$Group$finishStaleConnectivity, config, model); 34621 } 34622 case 1: 34623 var groupId = msg.a; 34624 var err = msg.b.a; 34625 return A2($author$project$Page$Group$hasLoadedGroup, groupId, model) ? _Utils_Tuple3( 34626 _Utils_update( 34627 model, 34628 {R: $author$project$Page$Group$SyncIdle}), 34629 $elm$core$Platform$Cmd$none, 34630 ($author$project$Infra$Server$isNetworkError(err) || $author$project$Infra$Server$isFrozen(err)) ? _List_Nil : _List_fromArray( 34631 [ 34632 A2( 34633 $author$project$Page$Group$ShowToast, 34634 1, 34635 A2( 34636 $author$project$Translations$toastSyncError, 34637 A2($author$project$Infra$Server$errorToText, config.aJ, err), 34638 config.aJ)) 34639 ])) : A2($author$project$Page$Group$finishStaleConnectivity, config, model); 34640 default: 34641 var groupId = msg.a; 34642 return A2($author$project$Page$Group$hasLoadedGroup, groupId, model) ? _Utils_Tuple3( 34643 _Utils_update( 34644 model, 34645 {R: $author$project$Page$Group$SyncIdle}), 34646 $elm$core$Platform$Cmd$none, 34647 _List_fromArray( 34648 [ 34649 A3($author$project$Page$Group$LogError, 2, 0, 'Unexpected error creating server group') 34650 ])) : A2($author$project$Page$Group$finishStaleConnectivity, config, model); 34651 } 34652 case 28: 34653 switch (msg.b.$) { 34654 case 0: 34655 var groupId = msg.a; 34656 var outcome = msg.b.a; 34657 var _v77 = model.a; 34658 if (_v77.$ === 4) { 34659 var loaded = _v77.a; 34660 if (_Utils_eq(loaded.bA.m9, groupId)) { 34661 var _v78 = function () { 34662 var _v79 = outcome.hs; 34663 switch (_v79.$) { 34664 case 0: 34665 return _Utils_Tuple3(model, $elm$core$Platform$Cmd$none, _List_Nil); 34666 case 1: 34667 var proposalIds = _v79.a; 34668 return A3( 34669 $elm$core$List$foldl, 34670 F2( 34671 function (proposalId, _v80) { 34672 var mdl = _v80.a; 34673 var cmd = _v80.b; 34674 var outs = _v80.c; 34675 var _v81 = A4( 34676 $author$project$Page$Group$runSubmit, 34677 $author$project$Page$Group$OnCompactionEventSaved(groupId), 34678 config, 34679 mdl, 34680 function (ctx) { 34681 return A3( 34682 $author$project$GroupOps$event, 34683 ctx, 34684 loaded, 34685 $author$project$Domain$Event$CompactionApproved( 34686 {cN: proposalId})); 34687 }); 34688 var mdl2 = _v81.a; 34689 var cmd2 = _v81.b; 34690 var outs2 = _v81.c; 34691 return _Utils_Tuple3( 34692 mdl2, 34693 $elm$core$Platform$Cmd$batch( 34694 _List_fromArray( 34695 [cmd, cmd2])), 34696 _Utils_ap(outs, outs2)); 34697 }), 34698 _Utils_Tuple3(model, $elm$core$Platform$Cmd$none, _List_Nil), 34699 proposalIds); 34700 case 2: 34701 var proposal = _v79.a; 34702 return A4( 34703 $author$project$Page$Group$runSubmit, 34704 $author$project$Page$Group$OnCompactionEventSaved(groupId), 34705 config, 34706 model, 34707 function (ctx) { 34708 return A3( 34709 $author$project$GroupOps$event, 34710 ctx, 34711 loaded, 34712 $author$project$Domain$Event$CompactionProposed(proposal)); 34713 }); 34714 default: 34715 if (!_v79.a.$) { 34716 var maxSeq = _v79.a.a; 34717 var _v82 = loaded.cZ; 34718 if (!_v82.$) { 34719 var cursor = _v82.a; 34720 var forwarded = _Utils_update( 34721 cursor, 34722 {kg: maxSeq}); 34723 var _v83 = A3( 34724 $author$project$Infra$ConcurrentTaskExtra$andRun, 34725 $author$project$Page$Group$PostSyncTasksDone, 34726 A3($author$project$Infra$Storage$saveSyncCursor, config.de, groupId, forwarded), 34727 _Utils_Tuple2(model.ak, $elm$core$Platform$Cmd$none)); 34728 var runner = _v83.a; 34729 var cursorCmd = _v83.b; 34730 return _Utils_Tuple3( 34731 _Utils_update( 34732 model, 34733 { 34734 ak: runner,
34735 a: $author$project$Page$Group$WorkspaceLoaded( 34736 _Utils_update( 34737 loaded, 34738 { 34739 cZ: $elm$core$Maybe$Just(forwarded) 34740 })) 34741 }), 34742 cursorCmd, 34743 _List_Nil); 34744 } else { 34745 return _Utils_Tuple3(model, $elm$core$Platform$Cmd$none, _List_Nil); 34746 } 34747 } else { 34748 var _v84 = _v79.a; 34749 return _Utils_Tuple3(model, $elm$core$Platform$Cmd$none, _List_Nil); 34750 } 34751 } 34752 }(); 34753 var stepModel = _v78.a; 34754 var stepCmd = _v78.b; 34755 var stepOutputs = _v78.c; 34756 var _v85 = function () { 34757 var _v86 = _Utils_Tuple2(outcome.gJ, stepModel.a); 34758 if (_v86.a && (_v86.b.$ === 4)) { 34759 var loadedAfter = _v86.b.a; 34760 return A4( 34761 $author$project$Page$Group$recordTamper, 34762 config, 34763 $author$project$Domain$TamperSignals$recordManifestMismatch(config.ap), 34764 loadedAfter, 34765 stepModel); 34766 } else { 34767 return _Utils_Tuple2(stepModel, $elm$core$Platform$Cmd$none); 34768 } 34769 }(); 34770 var finalModel = _v85.a; 34771 var mismatchCmd = _v85.b; 34772 return _Utils_Tuple3( 34773 finalModel, 34774 $elm$core$Platform$Cmd$batch( 34775 _List_fromArray( 34776 [stepCmd, mismatchCmd])), 34777 stepOutputs); 34778 } else { 34779 return _Utils_Tuple3(model, $elm$core$Platform$Cmd$none, _List_Nil); 34780 } 34781 } else { 34782 return _Utils_Tuple3(model, $elm$core$Platform$Cmd$none, _List_Nil); 34783 } 34784 case 1: 34785 var err = msg.b.a; 34786 return ($author$project$Infra$Server$isNetworkError(err) || $author$project$Infra$Server$isFrozen(err)) ? _Utils_Tuple3(model, $elm$core$Platform$Cmd$none, _List_Nil) : _Utils_Tuple3( 34787 model, 34788 $elm$core$Platform$Cmd$none, 34789 _List_fromArray( 34790 [ 34791 A3( 34792 $author$project$Page$Group$LogError, 34793 0, 34794 0, 34795 'Compaction: ' + $author$project$Infra$Server$errorToString(err)) 34796 ])); 34797 default: 34798 return _Utils_Tuple3( 34799 model, 34800 $elm$core$Platform$Cmd$none, 34801 _List_fromArray( 34802 [ 34803 A3($author$project$Page$Group$LogError, 0, 0, 'Unexpected error during compaction') 34804 ])); 34805 } 34806 case 29: 34807 if (!msg.b.$) { 34808 var groupId = msg.a; 34809 var envelope = msg.b.a; 34810 return A2( 34811 $elm$core$Maybe$withDefault, 34812 _Utils_Tuple3(model, $elm$core$Platform$Cmd$none, _List_Nil), 34813 A4($author$project$Page$Group$applyAndSync, config, groupId, envelope, model)); 34814 } else { 34815 return _Utils_Tuple3( 34816 model, 34817 $elm$core$Platform$Cmd$none, 34818 _List_fromArray( 34819 [ 34820 A3($author$project$Page$Group$LogError, 1, 0, 'Failed to save compaction event') 34821 ])); 34822 } 34823 case 30: 34824 switch (msg.a.$) { 34825 case 0: 34826 return _Utils_Tuple3(model, $elm$core$Platform$Cmd$none, _List_Nil); 34827 case 1: 34828 var err = msg.a.a; 34829 return _Utils_Tuple3( 34830 model, 34831 $elm$core$Platform$Cmd$none, 34832 _List_fromArray( 34833 [ 34834 A2( 34835 $author$project$Page$Group$ShowToast, 34836 1, 34837 $author$project$Translations$toastSyncSaveError(config.aJ)), 34838 A3( 34839 $author$project$Page$Group$LogError, 34840 1, 34841 0, 34842 'Post-sync persistence: ' + $author$project$Infra$Storage$errorToString(err)) 34843 ])); 34844 default: 34845 return _Utils_Tuple3( 34846 model, 34847 $elm$core$Platform$Cmd$none, 34848 _List_fromArray( 34849 [ 34850 A2( 34851 $author$project$Page$Group$ShowToast, 34852 1, 34853 $author$project$Translations$toastSyncSaveError(config.aJ)), 34854 A3($author$project$Page$Group$LogError, 1, 0, 'Unexpected error persisting synced data') 34855 ])); 34856 } 34857 case 31: 34858 var _v87 = model.a; 34859 if (_v87.$ === 4) { 34860 var loaded = _v87.a; 34861 return function (_v88) { 34862 var m = _v88.a; 34863 var cmd = _v88.b; 34864 return _Utils_Tuple3(m, cmd, _List_Nil); 34865 }( 34866 A2( 34867 $elm$core$Tuple$mapFirst, 34868 function (r) { 34869 return _Utils_update( 34870 model, 34871 { 34872 ak: r,
34873 a: $author$project$Page$Group$WorkspaceLoaded( 34874 _Utils_update( 34875 loaded, 34876 {c_: $author$project$Domain$TamperSignals$empty})) 34877 }); 34878 }, 34879 A3( 34880 $author$project$Infra$ConcurrentTaskExtra$andRun, 34881 $author$project$Page$Group$OnTamperSignalsSaved, 34882 A3($author$project$Infra$Storage$saveTamperSignals, config.de, loaded.bA.m9, $author$project$Domain$TamperSignals$empty), 34883 _Utils_Tuple2(model.ak, $elm$core$Platform$Cmd$none)))); 34884 } else { 34885 return _Utils_Tuple3(model, $elm$core$Platform$Cmd$none, _List_Nil); 34886 } 34887 case 32: 34888 if (!msg.a.$) { 34889 return _Utils_Tuple3(model, $elm$core$Platform$Cmd$none, _List_Nil); 34890 } else { 34891 return _Utils_Tuple3( 34892 model, 34893 $elm$core$Platform$Cmd$none, 34894 _List_fromArray( 34895 [ 34896 A3($author$project$Page$Group$LogError, 1, 0, 'Failed to save tamper signals') 34897 ])); 34898 } 34899 case 33: 34900 var key = msg.a; 34901 var _v89 = model.a; 34902 if (_v89.$ === 4) { 34903 var loaded = _v89.a; 34904 var dismissed = A2($elm$core$Set$insert, key, loaded.kw); 34905 return function (_v90) { 34906 var m = _v90.a; 34907 var cmd = _v90.b; 34908 return _Utils_Tuple3(m, cmd, _List_Nil); 34909 }( 34910 A2( 34911 $elm$core$Tuple$mapFirst, 34912 function (r) { 34913 return _Utils_update( 34914 model, 34915 { 34916 ak: r, 34917 a: $author$project$Page$Group$WorkspaceLoaded( 34918 _Utils_update( 34919 loaded, 34920 {kw: dismissed})) 34921 }); 34922 }, 34923 A3( 34924 $author$project$Infra$ConcurrentTaskExtra$andRun, 34925 $author$project$Page$Group$OnSuspicionDismissalsSaved, 34926 A3($author$project$Infra$Storage$saveSuspicionDismissals, config.de, loaded.bA.m9, dismissed), 34927 _Utils_Tuple2(model.ak, $elm$core$Platform$Cmd$none)))); 34928 } else { 34929 return _Utils_Tuple3(model, $elm$core$Platform$Cmd$none, _List_Nil); 34930 } 34931 case 34: 34932 if (!msg.a.$) { 34933 return _Utils_Tuple3(model, $elm$core$Platform$Cmd$none, _List_Nil); 34934 } else { 34935 return _Utils_Tuple3( 34936 model, 34937 $elm$core$Platform$Cmd$none, 34938 _List_fromArray( 34939 [ 34940 A3($author$project$Page$Group$LogError, 1, 0, 'Failed to save suspicion dismissals') 34941 ])); 34942 } 34943 case 35: 34944 var memberId = msg.a; 34945 var selection = function () { 34946 if (A2($elm$core$Dict$member, memberId, model.at)) { 34947 return A2($elm$core$Dict$remove, memberId, model.at); 34948 } else { 34949 var defaultBound = function () { 34950 var _v91 = model.a; 34951 if (_v91.$ === 4) { 34952 var loaded = _v91.a; 34953 return A3($author$project$Page$Group$defaultMigrationBound, model, loaded, memberId); 34954 } else { 34955 return $author$project$Domain$MigrationCuration$All; 34956 } 34957 }(); 34958 return A3($elm$core$Dict$insert, memberId, defaultBound, model.at); 34959 } 34960 }(); 34961 return _Utils_Tuple3( 34962 _Utils_update( 34963 model, 34964 {bs: $elm$core$Maybe$Nothing, at: selection}), 34965 $elm$core$Platform$Cmd$none, 34966 _List_Nil); 34967 case 37: 34968 var memberId = msg.a; 34969 return _Utils_Tuple3( 34970 _Utils_update( 34971 model, 34972 { 34973 a8: A2($elm$core$Set$member, memberId, model.a8) ? A2($elm$core$Set$remove, memberId, model.a8) : A2($elm$core$Set$insert, memberId, model.a8) 34974 }), 34975 $elm$core$Platform$Cmd$none, 34976 _List_Nil); 34977 case 36: 34978 var memberId = msg.a; 34979 var bound = msg.b; 34980 return _Utils_Tuple3( 34981 _Utils_update( 34982 model, 34983 { 34984 bs: $elm$core$Maybe$Nothing, 34985 at: A3($elm$core$Dict$insert, memberId, bound, model.at) 34986 }), 34987 $elm$core$Platform$Cmd$none, 34988 _List_Nil); 34989 case 38: 34990 if (!msg.b.$) { 34991 var groupId = msg.a; 34992 var order = msg.b.a; 34993 var _v92 = model.a; 34994 if (_v92.$ === 4) { 34995 var loaded = _v92.a; 34996 return _Utils_eq(loaded.bA.m9, groupId) ? _Utils_Tuple3( 34997 _Utils_update( 34998 model, 34999 { 35000 bV: $elm$core$Maybe$Just(order) 35001 }), 35002 $elm$core$Platform$Cmd$none, 35003 _List_Nil) : _Utils_Tuple3(model, $elm$core$Platform$Cmd$none, _List_Nil); 35004 } else { 35005 return _Utils_Tuple3(model, $elm$core$Platform$Cmd$none, _List_Nil); 35006 } 35007 } else { 35008 return _Utils_Tuple3(model, $elm$core$Platform$Cmd$none, _List_Nil); 35009 } 35010 case 39: 35011 var _v93 = model.a; 35012 if (_v93.$ === 4) { 35013 var loaded = _v93.a; 35014 return _Utils_Tuple3( 35015 _Utils_update( 35016 model, 35017 { 35018 bs: $elm$core$Maybe$Just( 35019 A4( 35020 $author$project$Domain$MigrationCuration$preview, 35021 $author$project$Page$Group$curationOrder(model), 35022 config.O.aK, 35023 model.at, 35024 loaded.iC)) 35025 }), 35026 $elm$core$Platform$Cmd$none, 35027 _List_Nil); 35028 } else { 35029 return _Utils_Tuple3(model, $elm$core$Platform$Cmd$none, _List_Nil); 35030 } 35031 case 40: 35032 var _v94 = model.a; 35033 if (_v94.$ === 4) { 35034 var loaded = _v94.a; 35035 var _v95 = A5( 35036 $author$project$GroupOps$migrateGroup, 35037 A3( 35038 $author$project$Page$Group$submitContext, 35039 function (_v96) { 35040 return $author$project$Page$Group$NoOp; 35041 }, 35042 config, 35043 model), 35044 $author$project$Page$Group$OnGroupMigrated, 35045 $author$project$Page$Group$curationOrder(model), 35046 model.at, 35047 loaded); 35048 var state = _v95.a; 35049 var cmd = _v95.b; 35050 return _Utils_Tuple3( 35051 _Utils_update( 35052 model, 35053 {s: state.s, ak: state.ak}), 35054 cmd, 35055 _List_Nil); 35056 } else { 35057 return _Utils_Tuple3(model, $elm$core$Platform$Cmd$none, _List_Nil); 35058 } 35059 case 41: 35060 if (!msg.a.$) { 35061 var result = msg.a.a; 35062 var clearedModel = _Utils_update( 35063 model, 35064 {a8: $elm$core$Set$empty, bV: $elm$core$Maybe$Nothing, bs: $elm$core$Maybe$Nothing, at: $elm$core$Dict$empty}); 35065 var _v97 = A3( 35066 $author$project$Page$Group$queueSummaryOperation, 35067 config, 35068 $author$project$Page$Group$SaveSummary(result.jt), 35069 clearedModel); 35070 var savedModel = _v97.a; 35071 var saveCmd = _v97.b; 35072 return _Utils_Tuple3( 35073 savedModel, 35074 saveCmd, 35075 _List_fromArray( 35076 [ 35077 $author$project$Page$Group$UpdateGroupSummary(result.jt), 35078 $author$project$Page$Group$UpdateGroupSummary(result.jp), 35079 A2( 35080 $author$project$Page$Group$ShowToast, 35081 0, 35082 $author$project$Translations$toastMigrated(config.aJ)), 35083 $author$project$Page$Group$NavigateTo( 35084 A2( 35085 $author$project$Route$GroupRoute, 35086 result.jp.m9, 35087 $author$project$Route$Tab(0))) 35088 ])); 35089 } else { 35090 return _Utils_Tuple3( 35091 model, 35092 $elm$core$Platform$Cmd$none, 35093 _List_fromArray( 35094 [ 35095 A2( 35096 $author$project$Page$Group$ShowToast, 35097 1, 35098 $author$project$Translations$toastGroupCreateError(config.aJ)), 35099 A3($author$project$Page$Group$LogError, 1, 0, 'Group migration failed') 35100 ])); 35101 } 35102 case 42: 35103 return _Utils_Tuple3(model, $elm$core$Platform$Cmd$none, _List_Nil); 35104 case 43: 35105 if (!msg.a.$) { 35106 var stats = msg.a.a; 35107 var _v98 = model.a; 35108 if (_v98.$ === 4) { 35109 var loaded = _v98.a; 35110 return _Utils_eq(loaded.bA.m9, stats.ct) ? _Utils_Tuple3( 35111 _Utils_update( 35112 model, 35113 { 35114 cl: $elm$core$Maybe$Just(stats) 35115 }), 35116 $elm$core$Platform$Cmd$none, 35117 _List_Nil) : _Utils_Tuple3(model, $elm$core$Platform$Cmd$none, _List_Nil); 35118 } else { 35119 return _Utils_Tuple3(model, $elm$core$Platform$Cmd$none, _List_Nil); 35120 } 35121 } else { 35122 return _Utils_Tuple3( 35123 model, 35124 $elm$core$Platform$Cmd$none, 35125 _List_fromArray( 35126 [ 35127 A3($author$project$Page$Group$LogError, 1, 0, 'Unexpected error measuring group diagnostics') 35128 ])); 35129 } 35130 case 44: 35131 var value = msg.a; 35132 var _v99 = _Utils_Tuple2( 35133 model.a, 35134 A2($elm$json$Json$Decode$decodeValue, $author$project$Infra$Server$serverEventDecoder, value)); 35135 if ((_v99.a.$ === 4) && (!_v99.b.$)) { 35136 var loaded = _v99.a.a; 35137 var serverEvt = _v99.b.a; 35138 if (_Utils_eq(serverEvt.ct, loaded.bA.m9)) { 35139 var _v100 = A3($author$project$Page$Group$triggerSyncInternal, config, loaded.bA.m9, model); 35140 var syncModel = _v100.a; 35141 var syncCmd = _v100.b;
35142 return _Utils_Tuple3(syncModel, syncCmd, _List_Nil); 35143 } else { 35144 return _Utils_Tuple3(model, $elm$core$Platform$Cmd$none, _List_Nil); 35145 } 35146 } else { 35147 return _Utils_Tuple3(model, $elm$core$Platform$Cmd$none, _List_Nil); 35148 } 35149 case 45: 35150 var _v101 = model.a; 35151 if (_v101.$ === 4) { 35152 var loaded = _v101.a; 35153 var _v102 = A3($author$project$Page$Group$triggerSyncInternal, config, loaded.bA.m9, model); 35154 var syncModel = _v102.a; 35155 var syncCmd = _v102.b; 35156 return _Utils_Tuple3(syncModel, syncCmd, _List_Nil); 35157 } else { 35158 return _Utils_Tuple3(model, $elm$core$Platform$Cmd$none, _List_Nil); 35159 } 35160 default: 35161 return _Utils_Tuple3(model, $elm$core$Platform$Cmd$none, _List_Nil); 35162 } 35163 }); 35164var $author$project$Page$Home$FileLoaded = function (a) { 35165 return {$: 3, a: a}; 35166}; 35167var $author$project$Page$Home$FileSelected = function (a) { 35168 return {$: 2, a: a}; 35169}; 35170var $author$project$Page$Home$ImportFileLoaded = function (a) { 35171 return {$: 0, a: a}; 35172}; 35173var $author$project$Page$Home$ImportTooLarge = {$: 1}; 35174var $author$project$Page$Home$JoinLink = function (a) { 35175 return {$: 3, a: a}; 35176}; 35177var $author$project$Page$Home$SplitwiseContentLoaded = F2( 35178 function (a, b) { 35179 return {$: 6, a: a, b: b}; 35180 }); 35181var $author$project$Page$Home$SplitwiseFileLoaded = function (a) { 35182 return {$: 2, a: a}; 35183}; 35184var $author$project$Page$Home$SplitwiseFileSelected = function (a) { 35185 return {$: 5, a: a}; 35186}; 35187var $elm$file$File$Select$file = F2( 35188 function (mimes, toMsg) { 35189 return A2( 35190 $elm$core$Task$perform, 35191 toMsg, 35192 _File_uploadOne(mimes)); 35193 }); 35194var $author$project$Page$Home$maxCompressedImportBytes = (64 * 1024) * 1024; 35195var $elm$file$File$name = _File_name; 35196var $elm$file$File$size = _File_size; 35197var $elm$file$File$toString = _File_toString; 35198var $elm$file$File$toUrl = _File_toUrl; 35199var $author$project$Page$Home$update = F2( 35200 function (msg, _v0) { 35201 var data = _v0; 35202 switch (msg.$) { 35203 case 0: 35204 return _Utils_Tuple3( 35205 _Utils_update( 35206 data, 35207 {bo: $elm$core$Maybe$Nothing, cT: !data.cT}), 35208 $elm$core$Platform$Cmd$none, 35209 $elm$core$Maybe$Nothing); 35210 case 1: 35211 return _Utils_Tuple3( 35212 _Utils_update( 35213 data, 35214 {bo: $elm$core$Maybe$Nothing, cT: false}), 35215 A2( 35216 $elm$file$File$Select$file, 35217 _List_fromArray( 35218 ['application/gzip', '.partage']), 35219 $author$project$Page$Home$FileSelected), 35220 $elm$core$Maybe$Nothing); 35221 case 2: 35222 var file = msg.a; 35223 return (_Utils_cmp( 35224 $elm$file$File$size(file), 35225 $author$project$Page$Home$maxCompressedImportBytes) > 0) ? _Utils_Tuple3( 35226 data, 35227 $elm$core$Platform$Cmd$none, 35228 $elm$core$Maybe$Just($author$project$Page$Home$ImportTooLarge)) : _Utils_Tuple3( 35229 data, 35230 A2( 35231 $elm$core$Task$perform, 35232 $author$project$Page$Home$FileLoaded, 35233 $elm$file$File$toUrl(file)), 35234 $elm$core$Maybe$Nothing); 35235 case 3: 35236 var dataUrl = msg.a; 35237 var base64 = function () { 35238 var _v2 = A2($elm$core$String$split, ',', dataUrl); 35239 if (_v2.b) { 35240 var rest = _v2.b; 35241 return A2($elm$core$String$join, ',', rest); 35242 } else { 35243 return dataUrl; 35244 } 35245 }(); 35246 return _Utils_Tuple3( 35247 _Utils_update( 35248 data, 35249 {bo: $elm$core$Maybe$Nothing}), 35250 $elm$core$Platform$Cmd$none, 35251 $elm$core$Maybe$Just( 35252 $author$project$Page$Home$ImportFileLoaded(base64))); 35253 case 4: 35254 return _Utils_Tuple3( 35255 _Utils_update( 35256 data, 35257 {bo: $elm$core$Maybe$Nothing, cT: false}), 35258 A2( 35259 $elm$file$File$Select$file, 35260 _List_fromArray( 35261 ['text/csv', '.csv']), 35262 $author$project$Page$Home$SplitwiseFileSelected), 35263 $elm$core$Maybe$Nothing); 35264 case 5: 35265 var file = msg.a; 35266 return _Utils_Tuple3( 35267 data, 35268 A2( 35269 $elm$core$Task$perform, 35270 $author$project$Page$Home$SplitwiseContentLoaded( 35271 $elm$file$File$name(file)), 35272 $elm$file$File$toString(file)), 35273 $elm$core$Maybe$Nothing); 35274 case 6: 35275 var filename = msg.a; 35276 var content = msg.b; 35277 return _Utils_Tuple3( 35278 _Utils_update( 35279 data, 35280 {bo: $elm$core$Maybe$Nothing}), 35281 $elm$core$Platform$Cmd$none, 35282 $elm$core$Maybe$Just( 35283 $author$project$Page$Home$SplitwiseFileLoaded( 35284 {ew: content, mD: filename}))); 35285 case 7: 35286 return _Utils_Tuple3( 35287 _Utils_update( 35288 data, 35289 {cy: $elm$core$Maybe$Nothing, bR: '', dQ: !data.dQ}), 35290 $elm$core$Platform$Cmd$none, 35291 $elm$core$Maybe$Nothing); 35292 case 8: 35293 var link = msg.a; 35294 return _Utils_Tuple3( 35295 _Utils_update( 35296 data, 35297 {cy: $elm$core$Maybe$Nothing, bR: link}), 35298 $elm$core$Platform$Cmd$none, 35299 $elm$core$Maybe$Nothing); 35300 case 9: 35301 return $elm$core$String$isEmpty( 35302 $elm$core$String$trim(data.bR)) ? _Utils_Tuple3(data, $elm$core$Platform$Cmd$none, $elm$core$Maybe$Nothing) : _Utils_Tuple3( 35303 _Utils_update( 35304 data, 35305 {cy: $elm$core$Maybe$Nothing, bR: '', dQ: false}), 35306 $elm$core$Platform$Cmd$none, 35307 $elm$core$Maybe$Just( 35308 $author$project$Page$Home$JoinLink( 35309 $elm$core$String$trim(data.bR)))); 35310 default: 35311 return _Utils_Tuple3( 35312 _Utils_update( 35313 data, 35314 {dO: !data.dO}), 35315 $elm$core$Platform$Cmd$none, 35316 $elm$core$Maybe$Nothing); 35317 } 35318 }); 35319var $author$project$Page$ImportSplitwise$Done = function (a) { 35320 return {$: 2, a: a}; 35321}; 35322var $author$project$Page$ImportSplitwise$NoEffect = {$: 0}; 35323var $author$project$Page$ImportSplitwise$RateLoading = 1; 35324var $author$project$Page$ImportSplitwise$RequestRate = function (a) { 35325 return {$: 1, a: a}; 35326}; 35327var $author$project$Infra$ExchangeRate$supports = function (currency) { 35328 if (currency === 9) { 35329 return false;
35330 } else { 35331 return true; 35332 } 35333}; 35334var $author$project$Page$ImportSplitwise$allJust = A2( 35335 $elm$core$List$foldr, 35336 F2( 35337 function (m, acc) { 35338 return A3($elm$core$Maybe$map2, $elm$core$List$cons, m, acc); 35339 }), 35340 $elm$core$Maybe$Just(_List_Nil)); 35341var $author$project$Page$ImportSplitwise$otherCurrencies = function (data) { 35342 return A2( 35343 $elm$core$List$filter, 35344 function (c) { 35345 return !_Utils_eq(c, data.il); 35346 }, 35347 $author$project$SplitwiseImport$usedCurrencies(data.g2)); 35348}; 35349var $author$project$Page$ImportSplitwise$parseRate = function (raw) { 35350 return A2( 35351 $elm$core$Maybe$andThen, 35352 function (r) { 35353 return (r > 0) ? $elm$core$Maybe$Just(r) : $elm$core$Maybe$Nothing; 35354 }, 35355 $elm$core$String$toFloat( 35356 A3( 35357 $elm$core$String$replace, 35358 ',', 35359 '.', 35360 $elm$core$String$trim(raw)))); 35361}; 35362var $author$project$Page$ImportSplitwise$memberNameAt = F2( 35363 function (i, names) { 35364 return $elm$core$List$head( 35365 A2($elm$core$List$drop, i, names)); 35366 }); 35367var $author$project$Page$ImportSplitwise$resolveIdentity = function (data) { 35368 var _v0 = data.O; 35369 if (!_v0.$) { 35370 var i = _v0.a; 35371 return A2( 35372 $elm$core$Maybe$map, 35373 function (name) { 35374 return _Utils_Tuple2( 35375 $elm$core$Maybe$Just(i), 35376 name); 35377 }, 35378 A2($author$project$Page$ImportSplitwise$memberNameAt, i, data.g2.nK)); 35379 } else { 35380 var trimmed = $elm$core$String$trim(data.n0); 35381 var clashes = A2( 35382 $elm$core$List$any, 35383 function (m) { 35384 return _Utils_eq( 35385 $elm$core$String$toLower(m), 35386 $elm$core$String$toLower(trimmed)); 35387 }, 35388 data.g2.nK); 35389 return ($elm$core$String$isEmpty(trimmed) || clashes) ? $elm$core$Maybe$Nothing : $elm$core$Maybe$Just( 35390 _Utils_Tuple2($elm$core$Maybe$Nothing, trimmed)); 35391 } 35392}; 35393var $author$project$Page$ImportSplitwise$validate = function (data) { 35394 var trimmedName = $elm$core$String$trim(data.iP); 35395 if ($elm$core$String$isEmpty(trimmedName)) { 35396 return $elm$core$Maybe$Nothing; 35397 } else { 35398 var parsedRates = A2( 35399 $elm$core$List$map, 35400 function (c) { 35401 return A2( 35402 $elm$core$Maybe$andThen, 35403 A2( 35404 $elm$core$Basics$composeR, 35405 $author$project$Page$ImportSplitwise$parseRate, 35406 $elm$core$Maybe$map( 35407 $elm$core$Tuple$pair( 35408 $author$project$Domain$Currency$currencyCode(c)))), 35409 A2( 35410 $elm$core$Dict$get, 35411 $author$project$Domain$Currency$currencyCode(c), 35412 data.a$)); 35413 }, 35414 $author$project$Page$ImportSplitwise$otherCurrencies(data)); 35415 var rates = A2( 35416 $elm$core$Maybe$map, 35417 $elm$core$Dict$fromList, 35418 $author$project$Page$ImportSplitwise$allJust(parsedRates)); 35419 return A3( 35420 $elm$core$Maybe$map2, 35421 F2( 35422 function (_v0, rateDict) { 35423 var claimedIndex = _v0.a; 35424 var creatorName = _v0.b; 35425 return {ib: claimedIndex, a4: creatorName, il: data.il, iP: trimmedName, g2: data.g2, pK: rateDict}; 35426 }), 35427 $author$project$Page$ImportSplitwise$resolveIdentity(data), 35428 rates); 35429 } 35430}; 35431var $author$project$Page$ImportSplitwise$update = F2( 35432 function (msg, _v0) { 35433 var data = _v0; 35434 switch (msg.$) { 35435 case 0: 35436 var s = msg.a; 35437 return _Utils_Tuple2( 35438 _Utils_update( 35439 data, 35440 {iP: s}), 35441 $author$project$Page$ImportSplitwise$NoEffect); 35442 case 1: 35443 var i = msg.a; 35444 return _Utils_Tuple2( 35445 _Utils_update( 35446 data, 35447 { 35448 O: $author$project$Page$ImportSplitwise$ClaimMember(i) 35449 }), 35450 $author$project$Page$ImportSplitwise$NoEffect); 35451 case 2: 35452 return _Utils_Tuple2( 35453 _Utils_update( 35454 data, 35455 {O: $author$project$Page$ImportSplitwise$NewMember}), 35456 $author$project$Page$ImportSplitwise$NoEffect); 35457 case 3: 35458 var s = msg.a; 35459 return _Utils_Tuple2( 35460 _Utils_update( 35461 data, 35462 {n0: s}), 35463 $author$project$Page$ImportSplitwise$NoEffect); 35464 case 4: 35465 var c = msg.a; 35466 return _Utils_Tuple2( 35467 _Utils_update( 35468 data, 35469 {il: c, a$: $elm$core$Dict$empty, bx: $elm$core$Dict$empty}), 35470 $author$project$Page$ImportSplitwise$NoEffect); 35471 case 5: 35472 var currency = msg.a; 35473 var s = msg.b; 35474 return _Utils_Tuple2( 35475 _Utils_update( 35476 data, 35477 { 35478 a$: A3( 35479 $elm$core$Dict$insert, 35480 $author$project$Domain$Currency$currencyCode(currency), 35481 s, 35482 data.a$) 35483 }), 35484 $author$project$Page$ImportSplitwise$NoEffect); 35485 case 6: 35486 var currency = msg.a; 35487 return ($author$project$Infra$ExchangeRate$supports(currency) && $author$project$Infra$ExchangeRate$supports(data.il)) ? _Utils_Tuple2( 35488 _Utils_update( 35489 data, 35490 { 35491 bx: A3( 35492 $elm$core$Dict$insert, 35493 $author$project$Domain$Currency$currencyCode(currency), 35494 1, 35495 data.bx) 35496 }), 35497 $author$project$Page$ImportSplitwise$RequestRate( 35498 {hX: currency, jY: data.il})) : _Utils_Tuple2( 35499 _Utils_update( 35500 data, 35501 { 35502 bx: A3( 35503 $elm$core$Dict$insert, 35504 $author$project$Domain$Currency$currencyCode(currency), 35505 2, 35506 data.bx) 35507 }), 35508 $author$project$Page$ImportSplitwise$NoEffect); 35509 default: 35510 var _v2 = $author$project$Page$ImportSplitwise$validate(data); 35511 if (!_v2.$) { 35512 var output = _v2.a; 35513 return _Utils_Tuple2( 35514 data, 35515 $author$project$Page$ImportSplitwise$Done(output)); 35516 } else { 35517 return _Utils_Tuple2( 35518 _Utils_update( 35519 data, 35520 {d_: true}), 35521 $author$project$Page$ImportSplitwise$NoEffect); 35522 } 35523 } 35524 }); 35525var $author$project$Page$Move$SendHandoff = function (a) { 35526 return {$: 3, a: a}; 35527}; 35528var $author$project$Page$Move$update = F2( 35529 function (msg, _v0) { 35530 var data = _v0; 35531 switch (msg.$) { 35532 case 0: 35533 var groupId = msg.a; 35534 var _v2 = $author$project$Page$Move$phase(data); 35535 if (!_v2) { 35536 return _Utils_Tuple2( 35537 _Utils_update( 35538 data, 35539 { 35540 hj: A2($elm$core$List$member, groupId, data.hj) ? A2( 35541 $elm$core$List$filter, 35542 $elm$core$Basics$neq(groupId), 35543 data.hj) : _Utils_ap( 35544 data.hj, 35545 _List_fromArray( 35546 [groupId])) 35547 }), 35548 $author$project$Page$Move$NoEffect); 35549 } else { 35550 return _Utils_Tuple2(data, $author$project$Page$Move$NoEffect); 35551 } 35552 case 1: 35553 var _v3 = _Utils_Tuple2( 35554 $author$project$Page$Move$phase(data), 35555 data.hj); 35556 if ((!_v3.a) && _v3.b.b) { 35557 var _v4 = _v3.a; 35558 var _v5 = _v3.b; 35559 var first = _v5.a; 35560 var rest = _v5.b; 35561 return _Utils_Tuple2( 35562 _Utils_update( 35563 data, 35564 { 35565 ag: $elm$core$Dict$fromList( 35566 A2( 35567 $elm$core$List$cons, 35568 _Utils_Tuple2(first, $author$project$Page$Move$InFlight),
35569 A2( 35570 $elm$core$List$map, 35571 function (id) { 35572 return _Utils_Tuple2(id, $author$project$Page$Move$Queued); 35573 }, 35574 rest))) 35575 }), 35576 $author$project$Page$Move$Seed(first)); 35577 } else { 35578 return _Utils_Tuple2(data, $author$project$Page$Move$NoEffect); 35579 } 35580 case 3: 35581 var _v6 = data.jC; 35582 if (!_v6.$) { 35583 var payload = _v6.a; 35584 return _Utils_Tuple2( 35585 data, 35586 $author$project$Page$Move$SendHandoff(payload)); 35587 } else { 35588 return _Utils_Tuple2(data, $author$project$Page$Move$NoEffect); 35589 } 35590 default: 35591 var requeued = A2( 35592 $elm$core$Dict$map, 35593 F2( 35594 function (_v7, status) { 35595 if (status.$ === 3) { 35596 return $author$project$Page$Move$Queued; 35597 } else { 35598 var other = status; 35599 return other; 35600 } 35601 }), 35602 data.ag); 35603 return $author$project$Page$Move$launchNext( 35604 _Utils_update( 35605 data, 35606 {ag: requeued})); 35607 } 35608 }); 35609var $author$project$Page$NewGroup$NoOp = {$: 7}; 35610var $elm$browser$Browser$Dom$focus = _Browser_call('focus'); 35611var $elmcraft$core_extra$List$Extra$last = function (items) { 35612 last: 35613 while (true) { 35614 if (!items.b) { 35615 return $elm$core$Maybe$Nothing; 35616 } else { 35617 if (!items.b.b) { 35618 var x = items.a; 35619 return $elm$core$Maybe$Just(x); 35620 } else { 35621 var rest = items.b; 35622 var $temp$items = rest; 35623 items = $temp$items; 35624 continue last; 35625 } 35626 } 35627 } 35628}; 35629var $dwayne$elm_form$Form$toState = function (_v0) { 35630 var state = _v0.hp; 35631 return state; 35632}; 35633var $author$project$Page$NewGroup$virtualMemberInputId = function (id) { 35634 return 'virtual-member-' + $elm$core$String$fromInt(id); 35635}; 35636var $author$project$Page$NewGroup$update = F2( 35637 function (msg, _v0) { 35638 var form = _v0.a; 35639 var submitted = _v0.b; 35640 switch (msg.$) { 35641 case 0: 35642 var s = msg.a; 35643 return _Utils_Tuple3( 35644 A2( 35645 $author$project$Page$NewGroup$Model, 35646 A3( 35647 $dwayne$elm_form$Form$modify, 35648 function ($) { 35649 return $.bW; 35650 }, 35651 $dwayne$elm_field$Field$setFromString(s), 35652 form), 35653 submitted), 35654 $elm$core$Platform$Cmd$none, 35655 $elm$core$Maybe$Nothing); 35656 case 1: 35657 var s = msg.a; 35658 return _Utils_Tuple3( 35659 A2( 35660 $author$project$Page$NewGroup$Model, 35661 A3( 35662 $dwayne$elm_form$Form$modify, 35663 function ($) { 35664 return $.a4; 35665 }, 35666 $dwayne$elm_field$Field$setFromString(s), 35667 form), 35668 submitted), 35669 $elm$core$Platform$Cmd$none, 35670 $elm$core$Maybe$Nothing); 35671 case 2: 35672 var s = msg.a; 35673 return _Utils_Tuple3( 35674 A2( 35675 $author$project$Page$NewGroup$Model, 35676 A3( 35677 $dwayne$elm_form$Form$modify, 35678 function ($) { 35679 return $.bg; 35680 }, 35681 $dwayne$elm_field$Field$setFromString(s), 35682 form), 35683 submitted), 35684 $elm$core$Platform$Cmd$none, 35685 $elm$core$Maybe$Nothing); 35686 case 3: 35687 var id = msg.a; 35688 var s = msg.b; 35689 return _Utils_Tuple3( 35690 A2( 35691 $author$project$Page$NewGroup$Model, 35692 A3( 35693 $dwayne$elm_form$Form$modify, 35694 function (a) { 35695 return a.kV(id); 35696 }, 35697 $dwayne$elm_field$Field$setFromString(s), 35698 form), 35699 submitted), 35700 $elm$core$Platform$Cmd$none, 35701 $elm$core$Maybe$Nothing); 35702 case 4: 35703 var updatedForm = A2( 35704 $dwayne$elm_form$Form$update, 35705 function ($) { 35706 return $.hN; 35707 }, 35708 form); 35709 var lastMemberId = A2( 35710 $elm$core$Maybe$map, 35711 $elm$core$Tuple$first, 35712 $elmcraft$core_extra$List$Extra$last( 35713 $dwayne$elm_form$Form$List$toList( 35714 $dwayne$elm_form$Form$toState(updatedForm).rc))); 35715 var focusCmd = function () { 35716 if (!lastMemberId.$) { 35717 var id = lastMemberId.a; 35718 return A2( 35719 $elm$core$Task$attempt, 35720 function (_v3) { 35721 return $author$project$Page$NewGroup$NoOp; 35722 }, 35723 $elm$browser$Browser$Dom$focus( 35724 $author$project$Page$NewGroup$virtualMemberInputId(id))); 35725 } else { 35726 return $elm$core$Platform$Cmd$none; 35727 } 35728 }(); 35729 return _Utils_Tuple3( 35730 A2($author$project$Page$NewGroup$Model, updatedForm, submitted), 35731 focusCmd, 35732 $elm$core$Maybe$Nothing); 35733 case 5: 35734 var id = msg.a; 35735 return _Utils_Tuple3( 35736 A2( 35737 $author$project$Page$NewGroup$Model, 35738 A2( 35739 $dwayne$elm_form$Form$update, 35740 function (a) { 35741 return a.j2(id); 35742 }, 35743 form), 35744 submitted), 35745 $elm$core$Platform$Cmd$none, 35746 $elm$core$Maybe$Nothing); 35747 case 6: 35748 var _v4 = $dwayne$elm_validation$Validation$toResult( 35749 $dwayne$elm_form$Form$validate(form)); 35750 if (!_v4.$) { 35751 var output = _v4.a; 35752 return _Utils_Tuple3( 35753 $author$project$Page$NewGroup$init, 35754 $elm$core$Platform$Cmd$none, 35755 $elm$core$Maybe$Just(output)); 35756 } else { 35757 return _Utils_Tuple3( 35758 A2($author$project$Page$NewGroup$Model, form, true), 35759 $elm$core$Platform$Cmd$none, 35760 $elm$core$Maybe$Nothing); 35761 } 35762 default: 35763 return _Utils_Tuple3( 35764 A2($author$project$Page$NewGroup$Model, form, submitted), 35765 $elm$core$Platform$Cmd$none, 35766 $elm$core$Maybe$Nothing); 35767 } 35768 }); 35769var $author$project$Page$Receive$InvalidCode = {$: 0}; 35770var $author$project$Page$Receive$update = F2( 35771 function (msg, _v0) { 35772 var data = _v0; 35773 if (!msg.$) { 35774 var text = msg.a; 35775 return _Utils_Tuple2( 35776 _Utils_update( 35777 data, 35778 {gi: $elm$core$Maybe$Nothing, cJ: text}), 35779 $author$project$Page$Receive$NoEffect); 35780 } else { 35781 if ($author$project$Page$Receive$canApply(data)) { 35782 var _v2 = $author$project$Infra$Handoff$fromString(data.cJ); 35783 if (!_v2.$) { 35784 var payload = _v2.a; 35785 return _Utils_Tuple2( 35786 _Utils_update( 35787 data, 35788 {be: true, gi: $elm$core$Maybe$Nothing}), 35789 $author$project$Page$Receive$Apply(payload)); 35790 } else { 35791 return _Utils_Tuple2( 35792 _Utils_update( 35793 data, 35794 { 35795 gi: $elm$core$String$isEmpty( 35796 $elm$core$String$trim(data.cJ)) ? $elm$core$Maybe$Nothing : $elm$core$Maybe$Just($author$project$Page$Receive$InvalidCode) 35797 }), 35798 $author$project$Page$Receive$NoEffect); 35799 } 35800 } else { 35801 return _Utils_Tuple2(data, $author$project$Page$Receive$NoEffect); 35802 } 35803 } 35804 }); 35805var $author$project$PwaState$FeedbackProjectIdResolved = function (a) { 35806 return {$: 5, a: a}; 35807}; 35808var $author$project$PwaState$LogError = F3( 35809 function (a, b, c) {
35810 return {$: 7, a: a, b: b, c: c}; 35811 }); 35812var $author$project$PwaState$MigrationConfigResolved = function (a) { 35813 return {$: 6, a: a}; 35814}; 35815var $author$project$PwaState$PushServerUrlResolved = function (a) { 35816 return {$: 4, a: a}; 35817}; 35818var $author$project$ErrorLog$PwaSource = 4; 35819var $author$project$Pwa$acceptUpdate = function (pwaOut) { 35820 return pwaOut( 35821 $elm$json$Json$Encode$object( 35822 _List_fromArray( 35823 [ 35824 _Utils_Tuple2( 35825 'tag', 35826 $elm$json$Json$Encode$string('acceptUpdate')) 35827 ]))); 35828}; 35829var $author$project$PwaState$CameOnline = {$: 2}; 35830var $author$project$PwaState$NavigateToUrl = function (a) { 35831 return {$: 1, a: a}; 35832}; 35833var $author$project$ErrorLog$PushSource = 3; 35834var $author$project$PwaState$ShowToastError = {$: 0}; 35835var $author$project$PwaState$RegisterPushTopics = function (a) { 35836 return {$: 3, a: a}; 35837}; 35838var $author$project$PwaState$registerTopics = function (model) { 35839 var _v0 = _Utils_Tuple2( 35840 $author$project$PwaState$pushServerUrl(model), 35841 model.jS); 35842 if ((!_v0.a.$) && (!_v0.b.$)) { 35843 var url = _v0.a.a; 35844 var sub = _v0.b.a; 35845 return _List_fromArray( 35846 [ 35847 $author$project$PwaState$RegisterPushTopics( 35848 {g7: url, d$: sub}) 35849 ]); 35850 } else { 35851 return _List_Nil; 35852 } 35853}; 35854var $author$project$Pwa$subscribePush = F2( 35855 function (pwaOut, vapidPublicKey) { 35856 return pwaOut( 35857 $elm$json$Json$Encode$object( 35858 _List_fromArray( 35859 [ 35860 _Utils_Tuple2( 35861 'tag', 35862 $elm$json$Json$Encode$string('subscribePush')), 35863 _Utils_Tuple2( 35864 'vapidPublicKey', 35865 $elm$json$Json$Encode$string(vapidPublicKey)) 35866 ]))); 35867 }); 35868var $author$project$PwaState$handleEvent = F3( 35869 function (pwaOut, event, model) { 35870 switch (event.$) { 35871 case 0: 35872 var online = event.a; 35873 return _Utils_Tuple3( 35874 _Utils_update( 35875 model, 35876 {dk: online}), 35877 $elm$core$Platform$Cmd$none, 35878 online ? _List_fromArray( 35879 [$author$project$PwaState$CameOnline]) : _List_Nil); 35880 case 1: 35881 return _Utils_Tuple3( 35882 _Utils_update( 35883 model, 35884 {d8: true}), 35885 $elm$core$Platform$Cmd$none, 35886 _List_Nil); 35887 case 2: 35888 var newHint = event.a; 35889 var justInstalled = (!newHint) && (!(!model.eT)); 35890 return _Utils_Tuple3( 35891 _Utils_update( 35892 model, 35893 { 35894 eT: newHint, 35895 cu: model.cu && _Utils_eq(newHint, model.eT), 35896 bq: model.bq || justInstalled 35897 }), 35898 $elm$core$Platform$Cmd$none, 35899 _List_Nil); 35900 case 3: 35901 var permission = event.a; 35902 var newModel = _Utils_update( 35903 model, 35904 { 35905 jr: $elm$core$Maybe$Just(permission) 35906 }); 35907 var _v1 = _Utils_Tuple2(permission, model.a_); 35908 if ((!_v1.a) && (_v1.b.$ === 3)) { 35909 var _v2 = _v1.a; 35910 var _v3 = _v1.b; 35911 var key = _v3.b; 35912 return _Utils_Tuple3( 35913 newModel, 35914 A2($author$project$Pwa$subscribePush, pwaOut, key), 35915 _List_Nil); 35916 } else { 35917 return _Utils_Tuple3(newModel, $elm$core$Platform$Cmd$none, _List_Nil); 35918 } 35919 case 4: 35920 var sub = event.a; 35921 var newModel = _Utils_update( 35922 model, 35923 { 35924 jS: $elm$core$Maybe$Just(sub) 35925 }); 35926 return _Utils_Tuple3( 35927 newModel, 35928 $elm$core$Platform$Cmd$none, 35929 $author$project$PwaState$registerTopics(newModel)); 35930 case 5: 35931 var error = event.a; 35932 return _Utils_Tuple3( 35933 model, 35934 $elm$core$Platform$Cmd$none, 35935 _List_fromArray( 35936 [ 35937 $author$project$PwaState$ShowToastError, 35938 A3($author$project$PwaState$LogError, 3, 0, 'Push subscription error: ' + error) 35939 ])); 35940 case 6: 35941 return _Utils_Tuple3( 35942 _Utils_update( 35943 model, 35944 {jS: $elm$core$Maybe$Nothing}), 35945 $elm$core$Platform$Cmd$none, 35946 _List_Nil); 35947 default: 35948 var data = event.a; 35949 var _v4 = A2( 35950 $elm$json$Json$Decode$decodeValue, 35951 A2($elm$json$Json$Decode$field, 'url', $elm$json$Json$Decode$string), 35952 data); 35953 if (!_v4.$) { 35954 var url = _v4.a; 35955 return _Utils_Tuple3( 35956 model, 35957 $elm$core$Platform$Cmd$none, 35958 _List_fromArray( 35959 [ 35960 $author$project$PwaState$NavigateToUrl(url) 35961 ])); 35962 } else { 35963 return _Utils_Tuple3(model, $elm$core$Platform$Cmd$none, _List_Nil); 35964 } 35965 } 35966 }); 35967var $author$project$Pwa$requestInstall = function (pwaOut) { 35968 return pwaOut( 35969 $elm$json$Json$Encode$object( 35970 _List_fromArray( 35971 [ 35972 _Utils_Tuple2( 35973 'tag', 35974 $elm$json$Json$Encode$string('requestInstall')) 35975 ]))); 35976}; 35977var $author$project$Pwa$requestNotificationPermission = function (pwaOut) { 35978 return pwaOut( 35979 $elm$json$Json$Encode$object( 35980 _List_fromArray( 35981 [ 35982 _Utils_Tuple2( 35983 'tag', 35984 $elm$json$Json$Encode$string('requestNotificationPermission')) 35985 ]))); 35986}; 35987var $author$project$PwaState$update = F3( 35988 function (pwaOut, msg, model) { 35989 switch (msg.$) { 35990 case 0: 35991 if (!msg.a.$) { 35992 var event = msg.a.a; 35993 return A3($author$project$PwaState$handleEvent, pwaOut, event, model); 35994 } else { 35995 return _Utils_Tuple3(model, $elm$core$Platform$Cmd$none, _List_Nil); 35996 } 35997 case 1: 35998 return _Utils_Tuple3( 35999 model, 36000 $author$project$Pwa$acceptUpdate(pwaOut), 36001 _List_Nil); 36002 case 2: 36003 return _Utils_Tuple3( 36004 model, 36005 $author$project$Pwa$requestInstall(pwaOut), 36006 _List_Nil); 36007 case 3: 36008 return _Utils_Tuple3( 36009 _Utils_update( 36010 model, 36011 {cu: true}), 36012 $elm$core$Platform$Cmd$none, 36013 _List_Nil); 36014 case 4: 36015 return _Utils_Tuple3( 36016 _Utils_update( 36017 model, 36018 {bq: false}), 36019 $elm$core$Platform$Cmd$none, 36020 _List_Nil); 36021 case 5: 36022 var _v1 = _Utils_Tuple2(model.a_, model.jr); 36023 _v1$3: 36024 while (true) { 36025 switch (_v1.a.$) { 36026 case 0: 36027 var _v2 = _v1.a; 36028 return _Utils_Tuple3(model, $elm$core$Platform$Cmd$none, _List_Nil); 36029 case 2: 36030 return _Utils_Tuple3(model, $elm$core$Platform$Cmd$none, _List_Nil); 36031 case 3: 36032 if ((!_v1.b.$) && (!_v1.b.a)) { 36033 var _v3 = _v1.a; 36034 var key = _v3.b; 36035 var _v4 = _v1.b.a; 36036 return _Utils_Tuple3( 36037 model, 36038 A2($author$project$Pwa$subscribePush, pwaOut, key), 36039 _List_Nil); 36040 } else { 36041 break _v1$3; 36042 } 36043 default: 36044 break _v1$3; 36045 } 36046 } 36047 return _Utils_Tuple3( 36048 model, 36049 $author$project$Pwa$requestNotificationPermission(pwaOut), 36050 _List_Nil); 36051 default: 36052 if (!msg.a.$) { 36053 var deployment = msg.a.a; 36054 var _v5 = function () { 36055 if (!deployment.$) { 36056 var config = deployment.a; 36057 return _Utils_Tuple3( 36058 config.jP, 36059 config.pL, 36060 _List_fromArray( 36061 [ 36062 $author$project$PwaState$FeedbackProjectIdResolved(config.mA), 36063 $author$project$PwaState$MigrationConfigResolved( 36064 {dY: config.nO, kz: config.nP}) 36065 ])); 36066 } else { 36067 var cachedPush = deployment.a; 36068 return _Utils_Tuple3(cachedPush, model.cQ, _List_Nil); 36069 } 36070 }(); 36071 var push = _v5.a; 36072 var serverReadOnly = _v5.b; 36073 var deploymentOut = _v5.c; 36074 var pushChanged = !_Utils_eq(push, model.a_); 36075 var newModel = _Utils_update( 36076 model, 36077 {a_: push, cQ: serverReadOnly}); 36078 var pushUrlOut = (!_Utils_eq( 36079 $author$project$PwaState$pushServerUrl(newModel), 36080 $author$project$PwaState$pushServerUrl(model))) ? _List_fromArray( 36081 [ 36082 $author$project$PwaState$PushServerUrlResolved( 36083 $author$project$PwaState$pushServerUrl(newModel)) 36084 ]) : _List_Nil; 36085 return _Utils_Tuple3( 36086 newModel, 36087 function () { 36088 var _v7 = _Utils_Tuple3(pushChanged, push, model.jr); 36089 if (((_v7.a && (_v7.b.$ === 3)) && (!_v7.c.$)) && (!_v7.c.a)) { 36090 var _v8 = _v7.b; 36091 var key = _v8.b; 36092 var _v9 = _v7.c.a; 36093 return A2($author$project$Pwa$subscribePush, pwaOut, key); 36094 } else { 36095 return $elm$core$Platform$Cmd$none; 36096 } 36097 }(), 36098 _Utils_ap( 36099 pushUrlOut, 36100 _Utils_ap( 36101 deploymentOut, 36102 pushChanged ? $author$project$PwaState$registerTopics(newModel) : _List_Nil))); 36103 } else { 36104 return _Utils_Tuple3( 36105 _Utils_update( 36106 model, 36107 { 36108 a_: function () { 36109 var _v10 = $author$project$PwaState$pushServerUrl(model); 36110 if (!_v10.$) { 36111 var url = _v10.a; 36112 return $author$project$PwaState$PushUnreachable(url); 36113 } else { 36114 return $author$project$PwaState$PushUnconfigured; 36115 } 36116 }() 36117 }), 36118 $elm$core$Platform$Cmd$none, 36119 _List_fromArray( 36120 [ 36121 A3($author$project$PwaState$LogError, 4, 0, 'Failed to resolve the deployment c
36121onfiguration') 36122 ])); 36123 } 36124 } 36125 }); 36126var $author$project$Infra$UsageStats$isLeapYear = function (year) { 36127 return (!(year % 4)) && ((!(!(year % 100))) || (!(year % 400))); 36128}; 36129var $author$project$Infra$UsageStats$daysInMonth = F2( 36130 function (year, month) { 36131 switch (month) { 36132 case 2: 36133 return $author$project$Infra$UsageStats$isLeapYear(year) ? 29 : 28; 36134 case 4: 36135 return 30; 36136 case 6: 36137 return 30; 36138 case 9: 36139 return 30; 36140 case 11: 36141 return 30; 36142 default: 36143 return 31; 36144 } 36145 }); 36146var $author$project$Infra$UsageStats$dateToApproxMillis = function (date) { 36147 var yearDays = ((date.C - 1970) * 365) + (((date.C - 1969) / 4) | 0); 36148 var monthDays = $elm$core$List$sum( 36149 A2( 36150 $elm$core$List$map, 36151 $author$project$Infra$UsageStats$daysInMonth(date.C), 36152 A2($elm$core$List$range, 1, date.F - 1))); 36153 return (((yearDays + monthDays) + date.y) - 1) * 86400000; 36154}; 36155var $author$project$Infra$UsageStats$parseDateString = function (str) { 36156 var _v0 = A2( 36157 $elm$core$List$filterMap, 36158 $elm$core$String$toInt, 36159 A2($elm$core$String$split, '-', str)); 36160 if (((_v0.b && _v0.b.b) && _v0.b.b.b) && (!_v0.b.b.b.b)) { 36161 var y = _v0.a; 36162 var _v1 = _v0.b; 36163 var m = _v1.a; 36164 var _v2 = _v1.b; 36165 var d = _v2.a; 36166 return {y: d, F: m, C: y}; 36167 } else { 36168 return {y: 1, F: 1, C: 2000}; 36169 } 36170}; 36171var $author$project$Infra$UsageStats$storageCentsPerGbPerMonth = 10.0; 36172var $author$project$Infra$UsageStats$updateStorageCost = F4( 36173 function (zone, now, storageUsageBytes, stats) { 36174 var todayDate = A2($author$project$Domain$Date$posixToDate, zone, now); 36175 var todayStr = $author$project$Domain$Date$toString(todayDate); 36176 if (stats.b4 === '') { 36177 return _Utils_update( 36178 stats, 36179 {b3: storageUsageBytes, b4: todayStr}); 36180 } else { 36181 var todayComparable = $author$project$Domain$Date$toComparable(todayDate); 36182 var lastDate = $author$project$Infra$UsageStats$parseDateString(stats.b4); 36183 var lastComparable = $author$project$Domain$Date$toComparable(lastDate); 36184 if (_Utils_cmp(todayComparable, lastComparable) > 0) { 36185 var daysSince = ($elm$time$Time$posixToMillis(now) - $author$project$Infra$UsageStats$dateToApproxMillis(lastDate)) / (((1000 * 60) * 60) * 24); 36186 var dailyStorageCostCentNanos = (((stats.b3 / $author$project$Infra$UsageStats$bytesPerGb) * $author$project$Infra$UsageStats$storageCentsPerGbPerMonth) / 30.44) * 1.0e9; 36187 var additionalCentNanos = $elm$core$Basics$round(daysSince * dailyStorageCostCentNanos); 36188 return _Utils_update( 36189 stats, 36190 {b3: storageUsageBytes, cX: stats.cX + additionalCentNanos, b4: todayStr}); 36191 } else { 36192 return _Utils_update( 36193 stats, 36194 {b3: storageUsageBytes}); 36195 } 36196 } 36197 }); 36198var $author$project$PwaState$PushPending = function (a) { 36199 return {$: 1, a: a}; 36200}; 36201var $author$project$PwaState$withCachedPushServer = F2( 36202 function (cached, model) { 36203 if (!cached.$) { 36204 var url = cached.a; 36205 return _Utils_update( 36206 model, 36207 { 36208 a_: $author$project$PwaState$PushPending(url) 36209 }); 36210 } else { 36211 return model; 36212 } 36213 }); 36214var $author$project$Main$update = F2( 36215 function (msg, model) { 36216 switch (msg.$) { 36217 case 0: 36218 return _Utils_Tuple2(model, $elm$core$Platform$Cmd$none); 36219 case 7: 36220 var zone = msg.a; 36221 return _Utils_Tuple2( 36222 _Utils_update( 36223 model, 36224 {al: zone}), 36225 $elm$core$Platform$Cmd$none); 36226 case 8: 36227 var time = msg.a; 36228 return _Utils_Tuple2( 36229 _Utils_update( 36230 model, 36231 {ap: time}), 36232 $elm$core$Platform$Cmd$none); 36233 case 9: 36234 var visibility = msg.a; 36235 if (!visibility) { 36236 return _Utils_Tuple2( 36237 model, 36238 A2($elm$core$Task$perform, $author$project$Main$GotCurrentTime, $elm$time$Time$now)); 36239 } else { 36240 return _Utils_Tuple2(model, $elm$core$Platform$Cmd$none); 36241 } 36242 case 45: 36243 if ((!msg.a.$) && (!msg.a.a.$)) { 36244 var topic = msg.a.a.a; 36245 return _Utils_Tuple2( 36246 model, 36247 A2($author$project$Pwa$closeNotifications, $author$project$Main$pwaOut, topic)); 36248 } else { 36249 return _Utils_Tuple2(model, $elm$core$Platform$Cmd$none); 36250 } 36251 case 46: 36252 if (!msg.a.$) { 36253 var markers = msg.a.a; 36254 var _v2 = model.b; 36255 if (_v2.$ === 1) { 36256 var readyData = _v2.a; 36257 return _Utils_Tuple2( 36258 _Utils_update( 36259 model, 36260 { 36261 b: $author$project$Main$Ready( 36262 _Utils_update( 36263 readyData, 36264 {k8: markers})) 36265 }), 36266 $elm$core$Platform$Cmd$none); 36267 } else { 36268 return _Utils_Tuple2(model, $elm$core$Platform$Cmd$none); 36269 } 36270 } else { 36271 return _Utils_Tuple2(model, $elm$core$Platform$Cmd$none); 36272 } 36273 case 47: 36274 if ((!msg.a.$) && (!msg.a.a.$)) { 36275 var groupId = msg.a.a.a; 36276 return _Utils_Tuple2( 36277 model, 36278 A2( 36279 $mpizenberg$elm_url_navigation_port$Navigation$replaceUrl, 36280 $author$project$Main$navCmd, 36281 $author$project$Route$toAppUrl( 36282 A2( 36283 $author$project$Route$GroupRoute, 36284 groupId,
36285 $author$project$Route$Tab(3))))); 36286 } else { 36287 return _Utils_Tuple2( 36288 model, 36289 A2( 36290 $mpizenberg$elm_url_navigation_port$Navigation$replaceUrl, 36291 $author$project$Main$navCmd, 36292 $author$project$Route$toAppUrl($author$project$Route$Home))); 36293 } 36294 case 1: 36295 var event = msg.a; 36296 var maybeIdentity = function () { 36297 var _v9 = model.b; 36298 if (_v9.$ === 1) { 36299 var data = _v9.a; 36300 return data.O; 36301 } else { 36302 return $elm$core$Maybe$Nothing; 36303 } 36304 }(); 36305 var _v3 = A2( 36306 $author$project$Main$applyRouteGuard, 36307 maybeIdentity, 36308 $author$project$Route$fromAppUrl(event.ls)); 36309 if (_v3.a.$ === 6) { 36310 if (!_v3.a.b.$) { 36311 var route = _v3.a; 36312 var guardCmd = _v3.b; 36313 return A2( 36314 $author$project$Update$addCmd, 36315 $author$project$Main$navScrollCmd(route), 36316 A2( 36317 $author$project$Update$addCmd, 36318 guardCmd, 36319 A3($author$project$Main$handleJoinRoute, model, route, maybeIdentity))); 36320 } else { 36321 var route = _v3.a; 36322 var groupId = route.a; 36323 var groupView = route.b; 36324 var guardCmd = _v3.b; 36325 var _v4 = _Utils_eq( 36326 $author$project$Main$activeGroupRoute(model.d), 36327 $elm$core$Maybe$Just(groupId)) ? _Utils_Tuple2(model, $elm$core$Platform$Cmd$none) : A2($author$project$Main$clearGroupActivity, groupId, model); 36328 var markerModel = _v4.a; 36329 var markerCmd = _v4.b; 36330 var routedModel = _Utils_update( 36331 markerModel, 36332 {d: route}); 36333 var _v5 = $author$project$Main$buildGroupConfig(routedModel); 36334 if (!_v5.$) { 36335 var config = _v5.a; 36336 return A2( 36337 $author$project$Update$addCmd, 36338 markerCmd, 36339 A2( 36340 $author$project$Update$addCmd, 36341 $author$project$Main$navScrollCmd(route), 36342 A2( 36343 $author$project$Update$addCmd, 36344 guardCmd, 36345 A3( 36346 $author$project$Update$wrap, 36347 $author$project$Main$GroupMsg, 36348 function (gm) { 36349 return _Utils_update( 36350 routedModel, 36351 {u: gm}); 36352 }, 36353 A4( 36354 $author$project$Page$Group$handleNavigation, 36355 config, 36356 A2($author$project$Main$selectedGroupSummary, groupId, routedModel), 36357 groupView, 36358 routedModel.u))))); 36359 } else { 36360 return _Utils_Tuple2( 36361 routedModel, 36362 $elm$core$Platform$Cmd$batch( 36363 _List_fromArray( 36364 [ 36365 guardCmd, 36366 $author$project$Main$navScrollCmd(route), 36367 markerCmd 36368 ]))); 36369 } 36370 } 36371 } else { 36372 var route = _v3.a; 36373 var guardCmd = _v3.b; 36374 var _v6 = function () { 36375 switch (route.$) { 36376 case 0: 36377 return $author$project$Main$reloadActivityMarkers(model); 36378 case 1: 36379 var topic = route.a; 36380 return A2($author$project$Main$resolveNotificationTopic, topic, model); 36381 case 4: 36382 return _Utils_Tuple2( 36383 _Utils_update( 36384 model, 36385 { 36386 P: A2( 36387 $author$project$Page$Move$refresh, 36388 $author$project$Main$currentGroups(model), 36389 model.P) 36390 }), 36391 $elm$core$Platform$Cmd$none); 36392 case 5: 36393 return _Utils_Tuple2( 36394 model, 36395 $author$project$Main$armHandoffReceiver( 36396 _Utils_update( 36397 model, 36398 {d: route}))); 36399 default: 36400 return _Utils_Tuple2(model, $elm$core$Platform$Cmd$none); 36401 } 36402 }(); 36403 var refreshedModel = _v6.a; 36404 var refreshCmd = _v6.b; 36405 var _v8 = $author$project$Main$ensureHomeIdentity( 36406 _Utils_update( 36407 refreshedModel, 36408 {d: route})); 36409 var identityModel = _v8.a; 36410 var identityCmd = _v8.b; 36411 return _Utils_Tuple2( 36412 identityModel, 36413 $elm$core$Platform$Cmd$batch( 36414 _List_fromArray( 36415 [ 36416 guardCmd, 36417 $author$project$Main$navScrollCmd(route), 36418 refreshCmd, 36419 identityCmd 36420 ]))); 36421 } 36422 case 2: 36423 var route = msg.a; 36424 return _Utils_Tuple2( 36425 model, 36426 A2( 36427 $mpizenberg$elm_url_navigation_port$Navigation$pushUrl, 36428 $author$project$Main$navCmd, 36429 $author$project$Route$toAppUrl(route))); 36430 case 3: 36431 return _Utils_Tuple2( 36432 model, 36433 A2($mpizenberg$elm_url_navigation_port$Navigation$back, $author$project$Main$navCmd, 1)); 36434 case 4: 36435 var lang = msg.a; 36436 var _v10 = A2($author$project$Main$applyLanguage, lang, model); 36437 var updatedModel = _v10.a; 36438 var langCmd = _v10.b; 36439 var _v11 = model.b; 36440 if (_v11.$ === 1) { 36441 var readyData = _v11.a; 36442 return A2( 36443 $elm$core$Tuple$mapSecond, 36444 function (c) { 36445 return $elm$core$Platform$Cmd$batch( 36446 _List_fromArray( 36447 [c, langCmd])); 36448 }, 36449 A2( 36450 $elm$core$Tuple$mapFirst, 36451 function (r) { 36452 return _Utils_update( 36453 updatedModel, 36454 {ak: r}); 36455 }, 36456 A3( 36457 $author$project$Infra$ConcurrentTaskExtra$andRun, 36458 function (_v12) { 36459 return $author$project$Main$NoOp; 36460 }, 36461 A3( 36462 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$map2, 36463 F2( 36464 function (_v13, _v14) { 36465 return 0; 36466 }), 36467 A2( 36468 $author$project$Infra$Storage$saveLanguage, 36469 readyData.de, 36470 $author$project$Translations$languageToString(lang)), 36471 A2( 36472 $author$project$Infra$Storage$saveNotificationTranslations, 36473 readyData.de, 36474 $author$project$Infra$PushServer$notificationBundle(lang))), 36475 _Utils_Tuple2(model.ak, $elm$core$Platform$Cmd$none)))); 36476 } else { 36477 return _Utils_Tuple2(updatedModel, langCmd); 36478 } 36479 case 5: 36480 return A2($author$project$Main$startIdentityTask, $author$project$Infra$Identity$generate, model); 36481 case 6: 36482 var _v15 = msg.a; 36483 var runner = _v15.a; 36484 var cmd = _v15.b; 36485 return _Utils_Tuple2( 36486 _Utils_update( 36487 model, 36488 {ak: runner}), 36489 cmd); 36490 case 10: 36491 if (!msg.a.$) { 36492 var identity = msg.a.a;
36493 var _v16 = model.b; 36494 if (_v16.$ === 1) { 36495 var readyData = _v16.a; 36496 return A2( 36497 $elm$core$Tuple$mapFirst, 36498 function (r) { 36499 return _Utils_update( 36500 model, 36501 {ak: r}); 36502 }, 36503 A3( 36504 $author$project$Infra$ConcurrentTaskExtra$andRun, 36505 $author$project$Main$OnIdentitySaved(identity), 36506 A2($author$project$Infra$Storage$saveIdentity, readyData.de, identity), 36507 _Utils_Tuple2(model.ak, $elm$core$Platform$Cmd$none))); 36508 } else { 36509 return _Utils_Tuple2( 36510 _Utils_update( 36511 model, 36512 {aT: $author$project$Main$IdentityIdle}), 36513 $elm$core$Platform$Cmd$none); 36514 } 36515 } else { 36516 var message = $author$project$Translations$errorUnexpected(model.aJ); 36517 return A3( 36518 $author$project$Main$addToast, 36519 1, 36520 message, 36521 A4( 36522 $author$project$Main$logError, 36523 6, 36524 0, 36525 'Unexpected error generating identity', 36526 _Utils_update( 36527 model, 36528 { 36529 aT: $author$project$Main$IdentityFailed(message) 36530 }))); 36531 } 36532 case 11: 36533 switch (msg.a.$) { 36534 case 0: 36535 var readyData = msg.a.a; 36536 var modelWithPushServer = _Utils_update( 36537 model, 36538 { 36539 G: A2($author$project$PwaState$withCachedPushServer, readyData.g7, model.G) 36540 }); 36541 var _v17 = function () { 36542 var _v18 = A2($elm$core$Maybe$andThen, $author$project$Translations$languageFromString, readyData.p0); 36543 if (!_v18.$) { 36544 var savedLang = _v18.a; 36545 return A2($author$project$Main$applyLanguage, savedLang, modelWithPushServer); 36546 } else { 36547 return _Utils_Tuple2(modelWithPushServer, $elm$core$Platform$Cmd$none); 36548 } 36549 }(); 36550 var modelWithLanguage = _v17.a; 36551 var languageCmd = _v17.b; 36552 var _v19 = A2($author$project$Main$applyRouteGuard, readyData.O, modelWithLanguage.d); 36553 var guardedRoute = _v19.a; 36554 var guardCmd = _v19.b; 36555 var modelWithReadyData = _Utils_update( 36556 modelWithLanguage, 36557 { 36558 b: $author$project$Main$Ready(readyData), 36559 u: function () { 36560 var _v26 = readyData.O; 36561 if (!_v26.$) { 36562 var identity = _v26.a; 36563 return A3($author$project$Page$Group$setIdentity, identity.aK, identity.ff, model.u); 36564 } else { 36565 return model.u; 36566 } 36567 }(), 36568 d: guardedRoute 36569 }); 36570 var _v20 = function () { 36571 switch (guardedRoute.$) { 36572 case 6: 36573 if (!guardedRoute.b.$) { 36574 return A3($author$project$Main$handleJoinRoute, modelWithReadyData, guardedRoute, readyData.O); 36575 } else { 36576 var groupId = guardedRoute.a; 36577 var groupView = guardedRoute.b; 36578 var _v22 = A2($author$project$Main$clearGroupActivity, groupId, modelWithReadyData); 36579 var markerModel = _v22.a; 36580 var markerCmd = _v22.b; 36581 var _v23 = $author$project$Main$buildGroupConfig(markerModel); 36582 if (!_v23.$) { 36583 var config = _v23.a; 36584 return A2( 36585 $author$project$Update$addCmd, 36586 markerCmd, 36587 A3( 36588 $author$project$Update$wrap, 36589 $author$project$Main$GroupMsg, 36590 function (gm) { 36591 return _Utils_update( 36592 markerModel, 36593 {u: gm}); 36594 }, 36595 A4( 36596 $author$project$Page$Group$handleNavigation, 36597 config, 36598 A2($author$project$Main$selectedGroupSummary, groupId, markerModel), 36599 groupView, 36600 markerModel.u))); 36601 } else { 36602 return _Utils_Tuple2(markerModel, markerCmd); 36603 } 36604 } 36605 case 1: 36606 var topic = guardedRoute.a; 36607 return A2($author$project$Main$resolveNotificationTopic, topic, modelWithReadyData); 36608 case 4: 36609 return _Utils_Tuple2( 36610 _Utils_update( 36611 modelWithReadyData, 36612 { 36613 P: A2( 36614 $author$project$Page$Move$refresh, 36615 $author$project$Main$currentGroups(modelWithReadyData), 36616 modelWithReadyData.P) 36617 }), 36618 $elm$core$Platform$Cmd$none); 36619 default: 36620 return _Utils_Tuple2(modelWithReadyData, $elm$core$Platform$Cmd$none); 36621 } 36622 }(); 36623 var modelAfterNav = _v20.a; 36624 var navCmd_ = _v20.b; 36625 var _v24 = $author$project$Main$ensureHomeIdentity(modelAfterNav); 36626 var modelAfterIdentity = _v24.a; 36627 var identityCmd = _v24.b; 36628 var _v25 = _Utils_eq(readyData.eY, $elm$core$Maybe$Nothing) ? $author$project$Main$markChangelogSeen(modelAfterIdentity) : _Utils_Tuple2(modelAfterIdentity, $elm$core$Platform$Cmd$none); 36629 var modelAfterChangelog = _v25.a; 36630 var changelogCmd = _v25.b; 36631 return A2( 36632 $elm$core$Tuple$mapFirst, 36633 function (r) { 36634 return _Utils_update( 36635 modelAfterChangelog, 36636 {ak: r}); 36637 }, 36638 A3( 36639 $author$project$PwaState$configureTask, 36640 {h6: readyData.g7, hl: modelAfterChangelog.hl}, 36641 $author$project$Main$PwaStateMsg, 36642 A3( 36643 $author$project$Infra$ConcurrentTaskExtra$andRun, 36644 $author$project$Main$OnStorageCheckComplete, 36645 $author$project$Main$storageCheckTask(readyData.de), 36646 _Utils_Tuple2( 36647 modelAfterChangelog.ak, 36648 $elm$core$Platform$Cmd$batch( 36649 _List_fromArray( 36650 [languageCmd, guardCmd, navCmd_, identityCmd, changelogCmd, $author$project$Main$rescheduleStorageCheckTomorrow])))))); 36651 case 1: 36652 var err = msg.a.a; 36653 return _Utils_Tuple2( 36654 _Utils_update( 36655 model, 36656 { 36657 b: $author$project$Main$InitError( 36658 A2($author$project$Infra$Storage$errorToText, model.aJ, err)) 36659 }), 36660 $elm$core$Platform$Cmd$none); 36661 default: 36662 return _Utils_Tuple2( 36663 A4( 36664 $author$project$Main$logError, 36665 1, 36666 0, 36667 'Unexpected error during initialization', 36668 _Utils_update( 36669 model, 36670 { 36671 b: $author$project$Main$InitError('Unexpected error during initialization') 36672 })), 36673 $elm$core$Platform$Cmd$none); 36674 } 36675 case 12: 36676 if (!msg.b.$) { 36677 var identity = msg.a; 36678 var _v27 = model.b; 36679 if (_v27.$ === 1) { 36680 var readyData = _v27.a; 36681 var _v28 = A2( 36682 $author$project$Main$applyRouteGuard, 36683 $elm$core$Maybe$Just(identity), 36684 model.d); 36685 var guardedRoute = _v28.a; 36686 var navCmd_ = _v28.b; 36687 var modelWithIdentity = _Utils_update( 36688 model, 36689 { 36690 b: $author$project$Main$Ready( 36691 _Utils_update( 36692 readyData, 36693 { 36694 O: $elm$core$Maybe$Just(identity) 36695 })), 36696 u: A3($author$project$Page$Group$setIdentity, identity.aK, identity.ff, model.u), 36697 aT: $author$project$Main$IdentityIdle, 36698 d: guardedRoute 36699 }); 36700 var _v29 = model.d; 36701 if ((_v29.$ === 6) && (!_v29.b.$)) { 36702 return A2( 36703 $author$project$Update$addCmd, 36704 navCmd_, 36705 A3( 36706 $author$project$Main$handleJoinRoute, 36707 modelWithIdentity, 36708 model.d, 36709 $elm$core$Maybe$Just(identity))); 36710 } else { 36711 return _Utils_Tuple2(modelWithIdentity, navCmd_); 36712 } 36713 } else { 36714 return _Utils_Tuple2( 36715 _Utils_update( 36716 model, 36717 {aT: $author$project$Main$IdentityIdle}), 36718 $elm$core$Platform$Cmd$none); 36719 } 36720 } else { 36721 var message = $author$project$Translations$toastIdentitySaveError(model.aJ); 36722 return A3( 36723 $author$project$Main$addToast, 36724 1, 36725 message, 36726 A4( 36727 $author$project$Main$logError, 36728 6, 36729 0, 36730 'Failed to save identity', 36731 _Utils_update( 36732 model, 36733 { 36734 aT: $author$project$Main$IdentityFailed(message) 36735 }))); 36736 } 36737 case 13: 36738 var subMsg = msg.a; 36739 var _v30 = A2($author$project$Page$NewGroup$update, subMsg, model.dx); 36740 var newGroupModel = _v30.a; 36741 var pageCmd = _v30.b; 36742 var maybeOutput = _v30.c; 36743 var modelWithForm = _Utils_update( 36744 model, 36745 {dx: newGroupModel}); 36746 var _v31 = _Utils_Tuple2(maybeOutput, model.b); 36747 if ((!_v31.a.$) && (_v31.b.$ === 1)) { 36748 var output = _v31.a.a; 36749 var readyData = _v31.b.a; 36750 return A3($author$project$Main$submitNewGroup, modelWithForm, readyData, output); 36751 } else { 36752 return _Utils_Tuple2( 36753 modelWithForm, 36754 A2($elm$core$Platform$Cmd$map, $author$project$Main$NewGroupMsg, pageCmd)); 36755 } 36756 case 28: 36757 if (!msg.a.$) { 36758 var summary = msg.a.a; 36759 var _v32 = model.b; 36760 if (_v32.$ === 1) { 36761 var readyData = _v32.a; 36762 var newRoute = A2( 36763 $author$project$Route$GroupRoute, 36764 summary.m9, 36765 $author$project$Route$Tab(1)); 36766 var modelWithGroup = _Utils_update( 36767 model, 36768 { 36769 b: $author$project$Main$Ready( 36770 _Utils_update( 36771 readyData, 36772 { 36773 eN: A3($elm$core$Dict$insert, summary.m9, summary, readyData.eN) 36774 })) 36775 }); 36776 return A2( 36777 $author$project$Main$requestPersistOnFirstGroup, 36778 readyData.eN, 36779 _Utils_Tuple2( 36780 modelWithGroup, 36781 A2( 36782 $mpizenberg$elm_url_navigation_port$Navigation$pushUrl, 36783 $author$project$Main$navCmd, 36784 $author$project$Route$toAppUrl(newRoute)))); 36785 } else { 36786 return _Utils_Tuple2(model, $elm$core$Platform$Cmd$none); 36787 } 36788 } else { 36789 return A3( 36790 $author$project$Main$addToast, 36791 1, 36792 $author$project$Translations$toastGroupCreateError(model.aJ), 36793 model); 36794 } 36795 case 14: 36796 var subMsg = msg.a; 36797 var _v33 = _Utils_Tuple2(model.aU, model.b); 36798 if ((!_v33.a.$) && (_v33.b.$ === 1)) { 36799 var pageModel = _v33.a.a; 36800 var readyData = _v33.b.a; 36801 var _v34 = A2($author$project$Page$ImportSplitwise$update, subMsg, pageModel); 36802 var newPageModel = _v34.a; 36803 var effect = _v34.b; 36804 switch (effect.$) { 36805 case 0: 36806 return _Utils_Tuple2( 36807 _Utils_update( 36808 model, 36809 { 36810 aU: $elm$core$Maybe$Just(newPageModel) 36811 }), 36812 $elm$core$Platform$Cmd$none); 36813 case 1: 36814 var pair = effect.a; 36815 return A2( 36816 $elm$core$Tuple$mapFirst, 36817 function (r) { 36818 return _Utils_update( 36819 model, 36820 { 36821 aU: $elm$core$Maybe$Just(newPageModel), 36822 ak: r 36823 }); 36824 }, 36825 A3( 36826 $author$project$Infra$ConcurrentTaskExtra$andRun, 36827 $author$project$Main$OnImportSplitwiseRate(pair.hX), 36828 A3( 36829 $author$project$Infra$ExchangeRate$fetchRateCached, 36830 readyData.de, 36831 A2($author$project$Domain$Date$posixToDate, model.al, model.ap), 36832 pair), 36833 _Utils_Tuple2(model.ak, $elm$core$Platform$Cmd$none))); 36834 default: 36835 var output = effect.a; 36836 return A3( 36837 $author$project$Main$submitSplitwiseImport, 36838 _Utils_update( 36839 model, 36840 {aU: $elm$core$Maybe$Nothing}), 36841 readyData, 36842 output); 36843 } 36844 } else { 36845 return _Utils_Tuple2(model, $elm$core$Platform$Cmd$none); 36846 } 36847 case 16: 36848 var subMsg = msg.a; 36849 var _v36 = A2($author$project$Page$Move$update, subMsg, model.P); 36850 var moveModel = _v36.a; 36851 var effect = _v36.b; 36852 return A2( 36853 $author$project$Main$runMoveEffect, 36854 effect, 36855 _Utils_update( 36856 model, 36857 {P: moveModel})); 36858 case 17: 36859 var groupId = msg.a; 36860 var response = msg.b; 36861 var _v37 = function () { 36862 switch (response.$) { 36863 case 0: 36864 return _Utils_Tuple2( 36865 $elm$core$Result$Ok(0), 36866 model); 36867 case 1: 36868 var err = response.a; 36869 return _Utils_Tuple2( 36870 $elm$core$Result$Err( 36871 A2($author$project$Infra$Server$errorToText, model.aJ, err)), 36872 A4( 36873 $author$project$Main$logError, 36874 2, 36875 0, 36876 'Seeding: ' + $author$project$Infra$Server$errorToString(err), 36877 model)); 36878 default: 36879 return _Utils_Tuple2( 36880 $elm$core$Result$Err( 36881 $author$project$Translations$errorUnexpected(model.aJ)), 36882 A4($author$project$Main$logError, 2, 0, 'Seeding: unexpected error', model)); 36883 } 36884 }(); 36885 var result = _v37.a; 36886 var failedModel = _v37.b; 36887 var _v39 = A3($author$project$Page$Move$groupSeeded, groupId, result, failedModel.P); 36888 var moveModel = _v39.a; 36889 var effect = _v39.b; 36890 return A2( 36891 $author$project$Main$runMoveEffect, 36892 effect, 36893 _Utils_update( 36894 failedModel, 36895 {P: moveModel})); 36896 case 18: 36897 if (!msg.a.$) { 36898 var payload = msg.a.a; 36899 return _Utils_Tuple2( 36900 _Utils_update( 36901 model, 36902 { 36903 P: A2($author$project$Page$Move$payloadReady, payload, model.P) 36904 }), 36905 $elm$core$Platform$Cmd$none); 36906 } else { 36907 return A3( 36908 $author$project$Main$addToast, 36909 1, 36910 $author$project$Translations$errorUnexpected(model.aJ), 36911 A4($author$project$Main$logError, 1, 0, 'Failed to build the handoff payload', model)); 36912 } 36913 case 19: 36914 var value = msg.a; 36915 var _v40 = A2($elm$json$Json$Decode$decodeValue, $author$project$Main$handoffEventDecoder, value); 36916 if (!_v40.$) { 36917 if (!_v40.a.$) { 36918 var _v41 = _v40.a; 36919 return _Utils_Tuple2( 36920 _Utils_update( 36921 model, 36922 { 36923 P: $author$project$Page$Move$handoffDelivered(model.P) 36924 }), 36925 $elm$core$Platform$Cmd$none); 36926 } else { 36927 var payload = _v40.a.a; 36928 if (_Utils_eq(model.d, $author$project$Route$Receive)) { 36929 var _v42 = A2($author$project$Page$Receive$payloadArrived, payload, model.av); 36930 var receiveModel = _v42.a; 36931 var effect = _v42.b; 36932 return A2( 36933 $author$project$Main$runReceiveEffect, 36934 effect, 36935 _Utils_update( 36936 model, 36937 {av: receiveModel})); 36938 } else { 36939 return _Utils_Tuple2(model, $elm$core$Platform$Cmd$none); 36940 } 36941 } 36942 } else { 36943 return _Utils_Tuple2(model, $elm$core$Platform$Cmd$none); 36944 } 36945 case 20: 36946 var subMsg = msg.a; 36947 var _v43 = A2($author$project$Page$Receive$update, subMsg, model.av); 36948 var receiveModel = _v43.a; 36949 var effect = _v43.b; 36950 return A2( 36951 $author$project$Main$runReceiveEffect, 36952 effect, 36953 _Utils_update( 36954 model, 36955 {av: receiveModel})); 36956 case 21: 36957 if (!msg.b.$) { 36958 var plan = msg.a; 36959 var _v44 = model.b; 36960 if (_v44.$ === 1) { 36961 var readyData = _v44.a; 36962 var newGroups = A3( 36963 $elm$core$List$foldl, 36964 F2( 36965 function (g, acc) { 36966 return A3($elm$core$Dict$insert, g.bA.m9, g.bA, acc); 36967 }), 36968 readyData.eN, 36969 plan.gt); 36970 var adoptedLanguage = A2( 36971 $elm$core$Maybe$andThen, 36972 function ($) { 36973 return $.eX; 36974 }, 36975 plan.fP); 36976 var adoptedChangelog = A2( 36977 $elm$core$Maybe$andThen, 36978 function ($) { 36979 return $.eY; 36980 }, 36981 plan.fP); 36982 var appliedModel = _Utils_update( 36983 model, 36984 { 36985 b: $author$project$Main$Ready( 36986 _Utils_update( 36987 readyData, 36988 { 36989 eN: newGroups, 36990 O: $elm$core$Maybe$Just(plan.O), 36991 eY: function () { 36992 if (!adoptedChangelog.$) { 36993 var seen = adoptedChangelog.a; 36994 return $elm$core$Maybe$Just(seen); 36995 } else { 36996 return readyData.eY; 36997 } 36998 }(), 36999 p0: function () { 37000 if (!adoptedLanguage.$) { 37001 var lang = adoptedLanguage.a; 37002 return $elm$core$Maybe$Just(lang); 37003 } else { 37004 return readyData.p0; 37005 } 37006 }(), 37007 fr: A2( 37008 $elm$core$Maybe$withDefault, 37009 readyData.fr, 37010 A2( 37011 $elm$core$Maybe$map, 37012 function ($) { 37013 return $.fr; 37014 }, 37015 plan.fP)) 37016 })), 37017 u: A3($author$project$Page$Group$setIdentity, plan.O.aK, plan.O.ff, model.u), 37018 av: A2( 37019 $author$project$Page$Receive$applied, 37020 { 37021 bc: $elm$core$List$length(plan.gt), 37022 ld: !_Utils_eq(plan.fP, $elm$core$Maybe$Nothing), 37023 qg: $elm$core$List$length(plan.hn) 37024 }, 37025 model.av) 37026 }); 37027 var _v45 = function () { 37028 var _v46 = A2($elm$core$Maybe$andThen, $author$project$Translations$languageFromString, adoptedLanguage); 37029 if (!_v46.$) { 37030 var lang = _v46.a; 37031 return A2($au
37031thor$project$Main$applyLanguage, lang, appliedModel); 37032 } else { 37033 return _Utils_Tuple2(appliedModel, $elm$core$Platform$Cmd$none); 37034 } 37035 }(); 37036 var languagedModel = _v45.a; 37037 var langCmd = _v45.b; 37038 return A2( 37039 $author$project$Main$requestPersistOnFirstGroup, 37040 readyData.eN, 37041 _Utils_Tuple2(languagedModel, langCmd)); 37042 } else { 37043 return _Utils_Tuple2(model, $elm$core$Platform$Cmd$none); 37044 } 37045 } else { 37046 var response = msg.b; 37047 var reason = function () { 37048 if (response.$ === 1) { 37049 var err = response.a; 37050 return A2($author$project$Infra$Storage$errorToText, model.aJ, err); 37051 } else { 37052 return $author$project$Translations$errorUnexpected(model.aJ); 37053 } 37054 }(); 37055 return _Utils_Tuple2( 37056 A4( 37057 $author$project$Main$logError, 37058 1, 37059 0, 37060 'Failed to apply the migration handoff', 37061 _Utils_update( 37062 model, 37063 { 37064 av: A2($author$project$Page$Receive$applyFailed, reason, model.av) 37065 })), 37066 $elm$core$Platform$Cmd$none); 37067 } 37068 case 15: 37069 var currency = msg.a; 37070 var response = msg.b; 37071 var _v50 = model.aU; 37072 if (!_v50.$) { 37073 var pageModel = _v50.a; 37074 var result = function () { 37075 if (!response.$) { 37076 var rate = response.a; 37077 return $elm$core$Maybe$Just(rate); 37078 } else { 37079 return $elm$core$Maybe$Nothing; 37080 } 37081 }(); 37082 return _Utils_Tuple2( 37083 _Utils_update( 37084 model, 37085 { 37086 aU: $elm$core$Maybe$Just( 37087 A3($author$project$Page$ImportSplitwise$rateFetched, currency, result, pageModel)) 37088 }), 37089 $elm$core$Platform$Cmd$none); 37090 } else { 37091 return _Utils_Tuple2(model, $elm$core$Platform$Cmd$none); 37092 } 37093 case 22: 37094 var subMsg = msg.a; 37095 var _v52 = $author$project$Main$buildGroupConfig(model); 37096 if (!_v52.$) { 37097 var config = _v52.a; 37098 var _v53 = A3($author$project$Page$Group$update, config, subMsg, model.u); 37099 var groupModel = _v53.a; 37100 var groupCmd = _v53.b; 37101 var outputs = _v53.c; 37102 return A3( 37103 $author$project$Main$processGroupOutputs, 37104 _Utils_update( 37105 model, 37106 {u: groupModel}), 37107 groupCmd, 37108 outputs); 37109 } else { 37110 return _Utils_Tuple2(model, $elm$core$Platform$Cmd$none); 37111 } 37112 case 23: 37113 var subMsg = msg.a; 37114 var _v54 = A2($author$project$Page$JoinGroup$update, subMsg, model.z); 37115 var joinModel = _v54.a; 37116 var maybeOutput = _v54.b; 37117 if (!maybeOutput.$) { 37118 var joinData = maybeOutput.a; 37119 var _v56 = _Utils_Tuple2(model.b, model.d); 37120 if (((_v56.a.$ === 1) && (_v56.b.$ === 6)) && (!_v56.b.b.$)) { 37121 var readyData = _v56.a.a; 37122 var _v57 = _v56.b; 37123 var groupId = _v57.a; 37124 var _v58 = readyData.O; 37125 if (!_v58.$) { 37126 var identity = _v58.a; 37127 if (!_Utils_eq(groupId, joinData.ct)) { 37128 return _Utils_Tuple2( 37129 _Utils_update( 37130 model, 37131 {z: joinModel}), 37132 $elm$core$Platform$Cmd$none); 37133 } else { 37134 var ctx = { 37135 ap: model.ap, 37136 de: readyData.de, 37137 s: model.s, 37138 O: identity, 37139 ju: function (_v60) { 37140 return $author$project$Main$NoOp; 37141 }, 37142 ak: model.ak 37143 }; 37144 var _v59 = A3( 37145 $author$project$GroupOps$acceptInvitation, 37146 ctx, 37147 $author$project$Main$OnJoinGroupSaved, 37148 {k5: joinData.hk, iC: joinData.iC, ct: joinData.ct, gs: joinData.gs, n0: joinData.n0, cZ: joinData.cZ, bC: joinData.bC}); 37149 var state = _v59.a; 37150 var cmd = _v59.b; 37151 return _Utils_Tuple2( 37152 _Utils_update( 37153 model, 37154 {s: state.s, z: joinModel, ak: state.ak}), 37155 cmd); 37156 } 37157 } else { 37158 return _Utils_Tuple2( 37159 _Utils_update( 37160 model, 37161 {z: joinModel}), 37162 $elm$core$Platform$Cmd$none); 37163 } 37164 } else { 37165 return _Utils_Tuple2( 37166 _Utils_update( 37167 model, 37168 {z: joinModel}), 37169 $elm$core$Platform$Cmd$none); 37170 } 37171 } else { 37172 return _Utils_Tuple2( 37173 _Utils_update( 37174 model, 37175 {z: joinModel}), 37176 $elm$core$Platform$Cmd$none); 37177 } 37178 case 24: 37179 var maybeIdentity = function () { 37180 var _v61 = model.b; 37181 if (_v61.$ === 1) { 37182 var data = _v61.a; 37183 return data.O; 37184 } else { 37185 return $elm$core$Maybe$Nothing; 37186 } 37187 }(); 37188 return A3($author$project$Main$handleJoinRoute, model, model.d, maybeIdentity); 37189 case 26: 37190 switch (msg.b.$) { 37191 case 0: 37192 var groupId = msg.a; 37193 var groupData = msg.b.a; 37194 var _v62 = _Utils_Tuple2(model.b, model.d); 37195 if (((_v62.a.$ === 1) && (_v62.b.$ === 6)) && (!_v62.b.b.$)) { 37196 var readyData = _v62.a.a; 37197 var _v63 = _v62.b; 37198 var routeGroupId = _v63.a; 37199 if (!_Utils_eq(routeGroupId, groupId)) { 37200 return _Utils_Tuple2(model, $elm$core$Platform$Cmd$none); 37201 } else { 37202 var groupState = A2($author$project$Domain$GroupState$applyEvents, groupData.iC, $author$project$Domain$GroupState$empty); 37203 var isMember = !_Utils_eq( 37204 $elm$core$Maybe$Nothing, 37205 A2( 37206 $elm$core$Maybe$andThen, 37207 function (identity) { 37208 return A2($author$project$Domain$GroupState$resolveMemberRootId, groupState, identity.aK); 37209 }, 37210 readyData.O)); 37211 if (isMember) { 37212 var balanceTab = $author$project$Route$Tab(0); 37213 var balanceRoute = A2($author$project$Route$GroupRoute, groupId, balanceTab); 37214 var _v64 = A3( 37215 $author$project$Main$addToast, 37216 0, 37217 $author$project$Translations$toastAlreadyInGroup(model.aJ), 37218 _Utils_update( 37219 model, 37220 {d: balanceRoute})); 37221 var toastedModel = _v64.a; 37222 var toastCmd = _v64.b; 37223 var _v65 = function () { 37224 var _v66 = $author$project$Main$buildGroupConfig(toastedModel); 37225 if (!_v66.$) { 37226 var config = _v66.a; 37227 return A3( 37228 $author$project$Update$wrap, 37229 $author$project$Main$GroupMsg, 37230 function (gm) { 37231 return _Utils_update( 37232 toastedModel, 37233 {u: gm}); 37234 }, 37235 A4( 37236 $author$project$Page$Group$handleNavigation, 37237 config, 37238 A2($author$project$Main$selectedGroupSummary, groupId, toastedModel), 37239 balanceTab, 37240 toastedModel.u)); 37241 } else { 37242 return _Utils_Tuple2(toastedModel, $elm$core$Platform$Cmd$none); 37243 } 37244 }(); 37245 var loadedModel = _v65.a;
37246 var loadCmd = _v65.b; 37247 return _Utils_Tuple2( 37248 loadedModel, 37249 $elm$core$Platform$Cmd$batch( 37250 _List_fromArray( 37251 [ 37252 toastCmd, 37253 loadCmd, 37254 A2( 37255 $mpizenberg$elm_url_navigation_port$Navigation$replaceUrl, 37256 $author$project$Main$navCmd, 37257 $author$project$Route$toAppUrl(balanceRoute)) 37258 ]))); 37259 } else { 37260 return _Utils_Tuple2( 37261 _Utils_update( 37262 model, 37263 { 37264 z: $author$project$Page$JoinGroup$showPreview( 37265 { 37266 iC: groupData.iC, 37267 ct: groupId, 37268 gs: groupData.gs, 37269 iP: groupState.iO.bW, 37270 a6: groupState, 37271 iU: false, 37272 n0: '', 37273 hk: $author$project$Page$JoinGroup$defaultAction(groupState), 37274 cZ: groupData.cZ, 37275 bC: groupData.bC 37276 }) 37277 }), 37278 $elm$core$Platform$Cmd$none); 37279 } 37280 } 37281 } else { 37282 return _Utils_Tuple2(model, $elm$core$Platform$Cmd$none); 37283 } 37284 case 1: 37285 var groupId = msg.a; 37286 var err = msg.b.a; 37287 return A2($author$project$Main$isCurrentJoinGroup, groupId, model.d) ? _Utils_Tuple2( 37288 A4( 37289 $author$project$Main$logError, 37290 1, 37291 0, 37292 'Join: load local group: ' + $author$project$Infra$Storage$errorToString(err), 37293 _Utils_update( 37294 model, 37295 { 37296 z: $author$project$Page$JoinGroup$error( 37297 A2($author$project$Infra$Storage$errorToText, model.aJ, err)) 37298 })), 37299 $elm$core$Platform$Cmd$none) : _Utils_Tuple2(model, $elm$core$Platform$Cmd$none); 37300 default: 37301 var groupId = msg.a; 37302 return A2($author$project$Main$isCurrentJoinGroup, groupId, model.d) ? _Utils_Tuple2( 37303 A4( 37304 $author$project$Main$logError, 37305 1, 37306 0, 37307 'Unexpected error loading local group for join', 37308 _Utils_update( 37309 model, 37310 { 37311 z: $author$project$Page$JoinGroup$error('Unexpected error') 37312 })), 37313 $elm$core$Platform$Cmd$none) : _Utils_Tuple2(model, $elm$core$Platform$Cmd$none); 37314 } 37315 case 25: 37316 switch (msg.d.$) { 37317 case 0: 37318 var groupId = msg.a; 37319 var groupKey = msg.b; 37320 var inviteTail = msg.c; 37321 var fetched = msg.d.a; 37322 if (!A4($author$project$Main$isCurrentJoinInvite, groupId, groupKey, inviteTail, model.d)) { 37323 return _Utils_Tuple2(model, $elm$core$Platform$Cmd$none); 37324 } else { 37325 var verified = fetched.fz.pF.iC; 37326 var attestationOk = function () { 37327 var _v67 = A2($elm$core$Maybe$andThen, $author$project$Domain$Compaction$parseAttestation, inviteTail); 37328 if (!_v67.$) { 37329 var attestation = _v67.a; 37330 return A2($author$project$Domain$Compaction$historyReaches, attestation, verified); 37331 } else { 37332 return true; 37333 } 37334 }(); 37335 if (!attestationOk) { 37336 return _Utils_Tuple2( 37337 _Utils_update( 37338 model, 37339 { 37340 z: $author$project$Page$JoinGroup$error( 37341 $author$project$Translations$joinGroupTruncated(model.aJ)) 37342 }), 37343 $elm$core$Platform$Cmd$none); 37344 } else { 37345 var groupState = A2($author$project$Domain$GroupState$applyEvents, verified, $author$project$Domain$GroupState$empty); 37346 return _Utils_Tuple2( 37347 _Utils_update( 37348 model, 37349 { 37350 z: $author$project$Page$JoinGroup$showPreview( 37351 { 37352 iC: verified, 37353 ct: groupId, 37354 gs: $author$project$WebCrypto$Symmetric$importKey(groupKey), 37355 iP: groupState.iO.bW, 37356 a6: groupState, 37357 iU: fetched.gJ, 37358 n0: '', 37359 hk: $author$project$Page$JoinGroup$defaultAction(groupState), 37360 cZ: $elm$core$Maybe$Just( 37361 {mt: fetched.fz.pF.mt, kg: fetched.fz.pF.ij}), 37362 bC: $elm$core$Set$empty 37363 }) 37364 }), 37365 $elm$core$Platform$Cmd$none); 37366 } 37367 } 37368 case 1: 37369 var groupId = msg.a; 37370 var groupKey = msg.b; 37371 var inviteTail = msg.c; 37372 var err = msg.d.a; 37373 return A4($author$project$Main$isCurrentJoinInvite, groupId, groupKey, inviteTail, model.d) ? _Utils_Tuple2( 37374 _Utils_update( 37375 model, 37376 { 37377 z: $author$project$Page$JoinGroup$error( 37378 A2($author$project$Infra$Server$errorToText, model.aJ, err)) 37379 }), 37380 $elm$core$Platform$Cmd$none) : _Utils_Tuple2(model, $elm$core$Platform$Cmd$none); 37381 default: 37382 var groupId = msg.a; 37383 var groupKey = msg.b; 37384 var inviteTail = msg.c; 37385 return A4($author$project$Main$isCurrentJoinInvite, groupId, groupKey, inviteTail, model.d) ? _Utils_Tuple2( 37386 A4( 37387 $author$project$Main$logError, 37388 0, 37389 0, 37390 'Unexpected error fetching join group', 37391 _Utils_update( 37392 model, 37393 { 37394 z: $author$project$Page$JoinGroup$error('Unexpected error') 37395 })), 37396 $elm$core$Platform$Cmd$none) : _Utils_Tuple2(model, $elm$core$Platform$Cmd$none); 37397 } 37398 case 27: 37399 if (!msg.a.$) { 37400 var summary = msg.a.a; 37401 var _v68 = model.b; 37402 if (_v68.$ === 1) { 37403 var readyData = _v68.a; 37404 var balanceTabRoute = A2( 37405 $author$project$Route$GroupRoute, 37406 summary.m9, 37407 $author$project$Route$Tab(0)); 37408 return A2( 37409 $author$project$Main$requestPersistOnFirstGroup, 37410 readyData.eN, 37411 A2( 37412 $author$project$Update$addCmd, 37413 A2( 37414 $mpizenberg$elm_url_navigation_port$Navigation$pushUrl, 37415 $author$project$Main$navCmd, 37416 $author$project$Route$toAppUrl(balanceTabRoute)), 37417 A3( 37418 $author$project$Main$addToast, 37419 0, 37420 $author$project$Translations$toastJoinedGroup(model.aJ), 37421 _Utils_update( 37422 model, 37423 { 37424 b: $author$project$Main$Ready( 37425 _Utils_update( 37426 readyData, 37427 { 37428 eN: A3($elm$core$Dict$insert, summary.m9, summary, readyData.eN) 37429 })), 37430 u: $author$project$Page$Group$resetWorkspace(model.u) 37431 })))); 37432 } else { 37433 return _Utils_Tuple2(model, $elm$core$Platform$Cmd$none); 37434 } 37435 } else { 37436 return A3( 37437 $author$project$Main$addToast, 37438 1, 37439 $author$project$Translations$toastJoinError(model.aJ), 37440 _Utils_update( 37441 model, 37442 { 37443 z: $author$project$Page$JoinGroup$acceptanceFailed(model.z) 37444 })); 37445 } 37446 case 30: 37447 var ieMsg = msg.a; 37448 var _v69 = model.b; 37449 if (_v69.$ === 1) { 37450 var readyData = _v69.a; 37451 var _v70 = readyData.O; 37452 if (!_v70.$) { 37453 var identity = _v70.a; 37454 var config = {ap: model.ap, de: readyData.de, eN: readyData.eN, aJ: model.aJ, iY: identity.aK, d3: $author$project$Main$ImportExportMsg}; 37455 var _v71 = A3( 37456 $author$project$ImportExport$update, 37457 config, 37458 ieMsg, 37459 _Utils_Tuple2(model.ak, $elm$core$Platform$Cmd$none)); 37460 var _v72 = _v71.a; 37461 var runner = _v72.a; 37462 var cmd = _v72.b; 37463 var maybeOutMsg = _v71.b;
37464 return A3( 37465 $author$project$Main$processImportExportOutMsg, 37466 _Utils_update( 37467 model, 37468 {ak: runner}), 37469 cmd, 37470 maybeOutMsg); 37471 } else { 37472 return _Utils_Tuple2(model, $elm$core$Platform$Cmd$none); 37473 } 37474 } else { 37475 return _Utils_Tuple2(model, $elm$core$Platform$Cmd$none); 37476 } 37477 case 29: 37478 var homeMsg = msg.a; 37479 var _v73 = model.b; 37480 if (_v73.$ === 1) { 37481 var _v74 = A2($author$project$Page$Home$update, homeMsg, model.ah); 37482 var homeModel = _v74.a; 37483 var homeCmd = _v74.b; 37484 var maybeOutput = _v74.c; 37485 var _v75 = _Utils_Tuple2( 37486 _Utils_update( 37487 model, 37488 {ah: homeModel}), 37489 A2($elm$core$Platform$Cmd$map, $author$project$Main$HomeMsg, homeCmd)); 37490 var updatedModel = _v75.a; 37491 var cmd = _v75.b; 37492 if (!maybeOutput.$) { 37493 switch (maybeOutput.a.$) { 37494 case 0: 37495 var base64 = maybeOutput.a.a; 37496 return A2( 37497 $elm$core$Tuple$mapFirst, 37498 function (r) { 37499 return _Utils_update( 37500 updatedModel, 37501 {ak: r}); 37502 }, 37503 A3( 37504 $author$project$ImportExport$startImport, 37505 $author$project$Main$ImportExportMsg, 37506 base64, 37507 _Utils_Tuple2(updatedModel.ak, cmd))); 37508 case 1: 37509 var _v77 = maybeOutput.a; 37510 return _Utils_Tuple2( 37511 _Utils_update( 37512 updatedModel, 37513 { 37514 ah: A2( 37515 $author$project$Page$Home$setImportError, 37516 $author$project$Translations$importErrorTooLarge(model.aJ), 37517 updatedModel.ah) 37518 }), 37519 cmd); 37520 case 2: 37521 var filename = maybeOutput.a.a.mD; 37522 var content = maybeOutput.a.a.ew; 37523 var _v78 = $author$project$SplitwiseImport$parse(content); 37524 if (!_v78.$) { 37525 var parsed = _v78.a; 37526 return _Utils_Tuple2( 37527 _Utils_update( 37528 updatedModel, 37529 { 37530 aU: $elm$core$Maybe$Just( 37531 $author$project$Page$ImportSplitwise$init( 37532 { 37533 iP: $author$project$Main$dropFileExtension(filename), 37534 g2: parsed 37535 })) 37536 }), 37537 $elm$core$Platform$Cmd$batch( 37538 _List_fromArray( 37539 [ 37540 cmd, 37541 A2( 37542 $mpizenberg$elm_url_navigation_port$Navigation$pushUrl, 37543 $author$project$Main$navCmd, 37544 $author$project$Route$toAppUrl($author$project$Route$ImportSplitwise)) 37545 ]))); 37546 } else { 37547 return _Utils_Tuple2( 37548 _Utils_update( 37549 updatedModel, 37550 { 37551 ah: A2( 37552 $author$project$Page$Home$setImportError, 37553 $author$project$Translations$splitwiseImportParseError(model.aJ), 37554 updatedModel.ah) 37555 }), 37556 cmd); 37557 } 37558 default: 37559 var url = maybeOutput.a.a; 37560 var parsedUrl = A2( 37561 $elmcraft$core_extra$Maybe$Extra$orElse, 37562 $elm$url$Url$fromString( 37563 _Utils_ap(model.aZ, url)), 37564 $elm$url$Url$fromString(url)); 37565 var _v79 = A2( 37566 $elm$core$Maybe$map, 37567 A2($elm$core$Basics$composeR, $lydell$elm_app_url$AppUrl$fromUrl, $author$project$Route$fromAppUrl), 37568 parsedUrl); 37569 if (((!_v79.$) && (_v79.a.$ === 6)) && (!_v79.a.b.$)) { 37570 var route = _v79.a; 37571 return _Utils_Tuple2( 37572 updatedModel, 37573 $elm$core$Platform$Cmd$batch( 37574 _List_fromArray( 37575 [ 37576 cmd, 37577 A2( 37578 $mpizenberg$elm_url_navigation_port$Navigation$pushUrl, 37579 $author$project$Main$navCmd, 37580 $author$project$Route$toAppUrl(route)) 37581 ]))); 37582 } else { 37583 return _Utils_Tuple2( 37584 _Utils_update( 37585 updatedModel, 37586 { 37587 ah: A2( 37588 $author$project$Page$Home$setJoinError, 37589 $author$project$Translations$homeJoinLinkInvalid(model.aJ), 37590 updatedModel.ah) 37591 }), 37592 cmd); 37593 } 37594 } 37595 } else { 37596 return _Utils_Tuple2(updatedModel, cmd); 37597 } 37598 } else { 37599 return _Utils_Tuple2(model, $elm$core$Platform$Cmd$none); 37600 } 37601 case 42: 37602 return A3( 37603 $author$project$Main$addToast, 37604 0, 37605 $author$project$Translations$toastCopied(model.aJ), 37606 model); 37607 case 43: 37608 var toastId = msg.a; 37609 return _Utils_Tuple2( 37610 _Utils_update( 37611 model, 37612 { 37613 b7: A2($author$project$UI$Toast$dismiss, toastId, model.b7) 37614 }), 37615 $elm$core$Platform$Cmd$none); 37616 case 31: 37617 var aboutMsg = msg.a; 37618 var _v80 = A2($author$project$Page$About$update, aboutMsg, model.W); 37619 var aboutModel = _v80.a; 37620 var maybeOutput = _v80.b; 37621 if (!maybeOutput.$) { 37622 if (!maybeOutput.a) { 37623 var _v82 = maybeOutput.a; 37624 var _v83 = model.b; 37625 if (_v83.$ === 1) { 37626 var readyData = _v83.a; 37627 return A2( 37628 $elm$core$Tuple$mapFirst, 37629 function (r) { 37630 return _Utils_update( 37631 model, 37632 {W: aboutModel, ak: r}); 37633 }, 37634 A3( 37635 $author$project$Infra$ConcurrentTaskExtra$andRun, 37636 $author$project$Main$OnAboutStatsReset, 37637 A2( 37638 $andrewMacmurray$elm_concurrent_task$ConcurrentTask$andThenD
37638o, 37639 A2($andrewMacmurray$elm_concurrent_task$ConcurrentTask$mapError, $elm$core$Basics$never, $author$project$Infra$UsageStats$persistedStatus), 37640 $author$project$Infra$Storage$resetUsageStats(readyData.de)), 37641 _Utils_Tuple2(model.ak, $elm$core$Platform$Cmd$none))); 37642 } else { 37643 return _Utils_Tuple2( 37644 _Utils_update( 37645 model, 37646 {W: aboutModel}), 37647 $elm$core$Platform$Cmd$none); 37648 } 37649 } else { 37650 var _v84 = maybeOutput.a; 37651 var _v85 = model.b; 37652 if (_v85.$ === 1) { 37653 var identity = _v85.a.O; 37654 if (!identity.$) { 37655 var current = identity.a; 37656 return A2( 37657 $author$project$Main$startIdentityTask, 37658 $author$project$Infra$Identity$rekey(current), 37659 _Utils_update( 37660 model, 37661 {W: aboutModel})); 37662 } else { 37663 return _Utils_Tuple2( 37664 _Utils_update( 37665 model, 37666 {W: aboutModel}), 37667 $elm$core$Platform$Cmd$none); 37668 } 37669 } else { 37670 return _Utils_Tuple2( 37671 _Utils_update( 37672 model, 37673 {W: aboutModel}), 37674 $elm$core$Platform$Cmd$none); 37675 } 37676 } 37677 } else { 37678 return _Utils_Tuple2( 37679 _Utils_update( 37680 model, 37681 {W: aboutModel}), 37682 $elm$core$Platform$Cmd$none); 37683 } 37684 case 32: 37685 if (!msg.a.$) { 37686 var _v87 = msg.a.a; 37687 var maybeStats = _v87.a; 37688 var storageEstimate = _v87.b; 37689 var persistStatus = _v87.c; 37690 var _v88 = model.b; 37691 if (_v88.$ === 1) { 37692 var readyData = _v88.a; 37693 var stats = A2( 37694 $elm$core$Maybe$withDefault, 37695 $author$project$Infra$UsageStats$defaultStats(model.ap), 37696 maybeStats); 37697 var updatedStats = A4($author$project$Infra$UsageStats$updateStorageCost, model.al, model.ap, storageEstimate.q4, stats); 37698 var trackingSince = $author$project$Domain$Date$toString( 37699 A2($author$project$Domain$Date$posixToDate, model.al, updatedStats.fF)); 37700 var breakdown = A2($author$project$Infra$UsageStats$calculateCosts, model.ap, updatedStats); 37701 var _v89 = A2( 37702 $author$project$Page$About$update, 37703 A3($author$project$Page$About$statsLoaded, breakdown, trackingSince, persistStatus), 37704 model.W); 37705 var aboutModel = _v89.a; 37706 return ((!_Utils_eq(updatedStats, stats)) || _Utils_eq(maybeStats, $elm$core$Maybe$Nothing)) ? A2( 37707 $elm$core$Tuple$mapFirst, 37708 function (r) { 37709 return _Utils_update( 37710 model, 37711 {W: aboutModel, ak: r}); 37712 }, 37713 A3( 37714 $author$project$Infra$ConcurrentTaskExtra$andRun, 37715 function (_v90) { 37716 return $author$project$Main$NoOp; 37717 }, 37718 A2($author$project$Infra$Storage$saveUsageStats, readyData.de, updatedStats), 37719 _Utils_Tuple2(model.ak, $elm$core$Platform$Cmd$none))) : _Utils_Tuple2( 37720 _Utils_update( 37721 model, 37722 {W: aboutModel}), 37723 $elm$core$Platform$Cmd$none); 37724 } else { 37725 return _Utils_Tuple2(model, $elm$core$Platform$Cmd$none); 37726 } 37727 } else { 37728 return _Utils_Tuple2(model, $elm$core$Platform$Cmd$none); 37729 } 37730 case 33: 37731 if (!msg.a.$) { 37732 var persistStatus = msg.a.a; 37733 var _v91 = model.b; 37734 if (_v91.$ === 1) { 37735 var readyData = _v91.a; 37736 var freshStats = $author$project$Infra$UsageStats$defaultStats(model.ap); 37737 return A2( 37738 $elm$core$Tuple$mapFirst, 37739 function (r) { 37740 var _v93 = A2( 37741 $author$project$Page$About$update, 37742 A3( 37743 $author$project$Page$About$statsLoaded, 37744 A2($author$project$Infra$UsageStats$calculateCosts, model.ap, freshStats), 37745 $author$project$Domain$Date$toString( 37746 A2($author$project$Domain$Date$posixToDate, model.al, freshStats.fF)), 37747 persistStatus), 37748 model.W); 37749 var aboutModel = _v93.a; 37750 return _Utils_update( 37751 model, 37752 {W: aboutModel, ak: r}); 37753 }, 37754 A3( 37755 $author$project$Infra$ConcurrentTaskExtra$andRun, 37756 function (_v92) { 37757 return $author$project$Main$NoOp; 37758 }, 37759 A2($author$project$Infra$Storage$saveUsageStats, readyData.de, freshStats), 37760 _Utils_Tuple2(model.ak, $elm$core$Platform$Cmd$none))); 37761 } else { 37762 return _Utils_Tuple2(model, $elm$core$Platform$Cmd$none); 37763 } 37764 } else { 37765 return _Utils_Tuple2( 37766 A4($author$project$Main$logError, 1, 0, 'Unexpected error resetting usage stats', model), 37767 $elm$core$Platform$Cmd$none); 37768 } 37769 case 34: 37770 if (!msg.a.$) { 37771 return _Utils_Tuple2(model, $elm$core$Platform$Cmd$none); 37772 } else { 37773 return _Utils_Tuple2( 37774 A4($author$project$Main$logError, 1, 0, 'Unexpected error saving self profile', model), 37775 $elm$core$Platform$Cmd$none); 37776 } 37777 case 36: 37778 var _v94 = model.b; 37779 if (_v94.$ === 1) { 37780 var readyData = _v94.a; 37781 var updatedReadyData = _Utils_update( 37782 readyData, 37783 {mi: !readyData.mi}); 37784 return A2( 37785 $elm$core$Tuple$mapFirst, 37786 function (r) { 37787 return _Utils_update( 37788 model, 37789 { 37790 b: $author$project$Main$Ready(updatedReadyData), 37791 ak: r 37792 }); 37793 }, 37794 A3( 37795 $author$project$Infra$ConcurrentTaskExtra$andRun, 37796 function (_v95) { 37797 return $author$project$Main$NoOp; 37798 }, 37799 A2($author$project$Infra$Storage$saveDevMode, readyData.de, updatedReadyData.mi), 37800 _Utils_Tuple2(model.ak, $elm$core$Platform$Cmd$none))); 37801 } else { 37802 return _Utils_Tuple2(model, $elm$core$Platform$Cmd$none); 37803 } 37804 case 37: 37805 var _v96 = model.b; 37806 if (_v96.$ === 1) { 37807 var readyData = _v96.a; 37808 var _v97 = A3( 37809 $author$project$Main$addToast, 37810 0, 37811 $author$project$Translations$toastFeedbackPromptsReset(model.aJ), 37812 model); 37813 var toasted = _v97.a; 37814 var toastCmd = _v97.b; 37815 return A2( 37816 $elm$core$Tuple$mapFirst, 37817 function (r) { 37818 return _Utils_update( 37819 toasted, 37820 { 37821 b: $author$project$Main$Ready( 37822 _Utils_update( 37823 readyData, 37824 {mB: $author$project$Domain$FeedbackMoment$empty})), 37825 ak: r 37826 }); 37827 }, 37828 A3( 37829 $author$project$Infra$ConcurrentTaskExtra$andRun, 37830 function (_v98) { 37831 return $author$project$Main$NoOp; 37832 }, 37833 A2($author$project$Infra$Storage$saveFeedbackPrompts, readyData.de, $author$project$Domain$FeedbackMoment$empty),
37834 _Utils_Tuple2(toasted.ak, toastCmd))); 37835 } else { 37836 return _Utils_Tuple2(model, $elm$core$Platform$Cmd$none); 37837 } 37838 case 38: 37839 return $author$project$Main$markChangelogSeen(model); 37840 case 39: 37841 return _Utils_Tuple2( 37842 _Utils_update( 37843 model, 37844 {bL: $elm$core$Maybe$Nothing}), 37845 A2($author$project$Main$openFeedbackCmd, '', model)); 37846 case 40: 37847 var report = msg.a; 37848 return _Utils_Tuple2( 37849 _Utils_update( 37850 model, 37851 {bL: $elm$core$Maybe$Nothing}), 37852 A2($author$project$Main$openFeedbackCmd, report, model)); 37853 case 41: 37854 return _Utils_Tuple2( 37855 _Utils_update( 37856 model, 37857 {bL: $elm$core$Maybe$Nothing}), 37858 $elm$core$Platform$Cmd$none); 37859 case 35: 37860 var _v99 = model.b; 37861 if (_v99.$ === 1) { 37862 var readyData = _v99.a; 37863 return A2( 37864 $elm$core$Tuple$mapFirst, 37865 function (r) { 37866 return _Utils_update( 37867 model, 37868 {ak: r}); 37869 }, 37870 A3( 37871 $author$project$Infra$ConcurrentTaskExtra$andRun, 37872 $author$project$Main$OnStorageCheckComplete, 37873 $author$project$Main$storageCheckTask(readyData.de), 37874 _Utils_Tuple2(model.ak, $author$project$Main$rescheduleStorageCheckTomorrow))); 37875 } else { 37876 return _Utils_Tuple2(model, $author$project$Main$rescheduleStorageCheckTomorrow); 37877 } 37878 default: 37879 var pwaMsg = msg.a; 37880 var _v100 = A3($author$project$PwaState$update, $author$project$Main$pwaOut, pwaMsg, model.G); 37881 var pwaState = _v100.a; 37882 var pwaCmd = _v100.b; 37883 var outMsgs = _v100.c; 37884 return A3( 37885 $author$project$Main$processPwaOutMsgs, 37886 _Utils_update( 37887 model, 37888 {G: pwaState}), 37889 pwaCmd, 37890 outMsgs); 37891 } 37892 }); 37893var $author$project$Main$NavigateTo = function (a) { 37894 return {$: 2, a: a}; 37895}; 37896var $author$project$Main$OpenFeedback = {$: 39}; 37897var $elm$svg$Svg$Attributes$d = _VirtualDom_attribute('d'); 37898var $elm$svg$Svg$trustedNode = _VirtualDom_nodeNS('http://www.w3.org/2000/svg'); 37899var $elm$svg$Svg$line = $elm$svg$Svg$trustedNode('line'); 37900var $feathericons$elm_feather$FeatherIcons$Icon = $elm$core$Basics$identity; 37901var $feathericons$elm_feather$FeatherIcons$defaultAttributes = function (name) { 37902 return { 37903 f: $elm$core$Maybe$Just('feather feather-' + name), 37904 dW: 24, 37905 dX: '', 37906 fx: 2, 37907 fL: '0 0 24 24' 37908 }; 37909}; 37910var $feathericons$elm_feather$FeatherIcons$makeBuilder = F2( 37911 function (name, src) { 37912 return { 37913 ei: $feathericons$elm_feather$FeatherIcons$defaultAttributes(name), 37914 aw: src 37915 }; 37916 }); 37917var $elm$svg$Svg$path = $elm$svg$Svg$trustedNode('path'); 37918var $elm$svg$Svg$Attributes$x1 = _VirtualDom_attribute('x1'); 37919var $elm$svg$Svg$Attributes$x2 = _VirtualDom_attribute('x2'); 37920var $elm$svg$Svg$Attributes$y1 = _VirtualDom_attribute('y1'); 37921var $elm$svg$Svg$Attributes$y2 = _VirtualDom_attribute('y2'); 37922var $feathericons$elm_feather$FeatherIcons$alertTriangle = A2( 37923 $feathericons$elm_feather$FeatherIcons$makeBuilder, 37924 'alert-triangle', 37925 _List_fromArray( 37926 [ 37927 A2( 37928 $elm$svg$Svg$path, 37929 _List_fromArray( 37930 [ 37931 $elm$svg$Svg$Attributes$d('M10.29 3.86L1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z') 37932 ]), 37933 _List_Nil), 37934 A2( 37935 $elm$svg$Svg$line, 37936 _List_fromArray( 37937 [ 37938 $elm$svg$Svg$Attributes$x1('12'), 37939 $elm$svg$Svg$Attributes$y1('9'), 37940 $elm$svg$Svg$Attributes$x2('12'), 37941 $elm$svg$Svg$Attributes$y2('13') 37942 ]), 37943 _List_Nil), 37944 A2( 37945 $elm$svg$Svg$line, 37946 _List_fromArray( 37947 [ 37948 $elm$svg$Svg$Attributes$x1('12'), 37949 $elm$svg$Svg$Attributes$y1('17'), 37950 $elm$svg$Svg$Attributes$x2('12.01'), 37951 $elm$svg$Svg$Attributes$y2('17') 37952 ]), 37953 _List_Nil) 37954 ])); 37955var $author$project$Internal$Model2$Attribute = $elm$core$Basics$identity; 37956var $author$project$Internal$Model2$NodeAsDiv = {$: 0}; 37957var $author$project$Internal$Model2$noStyles = F2( 37958 function (inheritance, encoded) { 37959 return _List_Nil; 37960 }); 37961var $author$project$Internal$BitField$none = 0; 37962var $author$project$Internal$Model2$classWith = F2( 37963 function (flag, cls) { 37964 return _List_fromArray( 37965 [ 37966 { 37967 g: { 37968 q: $author$project$Internal$BitField$none, 37969 ei: _List_Nil, 37970 f: $elm$core$Maybe$Just(cls), 37971 j: _List_Nil, 37972 o: $author$project$Internal$Model2$NodeAsDiv, 37973 p: $author$project$Internal$Model2$noStyles 37974 }, 37975 h: flag 37976 } 37977 ]); 37978 }); 37979var $author$project$Internal$Style$Generated$classes = {k2: 'a', k6: 'atv', le: 'ab', lf: 'cx', lg: 'cy', lh: 'al', li: 'ar', lj: 'at', lk: 'ah', bd: 's', lz: 'bh', lA: 'b', lM: 'cpe', lU: 'cp', lV: 'cpx', lW: 'cpy', lZ: 'c', l$: 'cb', l0: 'ccx', l1: 'ccy', l2: 'cl', l3: 'cr', l4: 'ct', l8: 'grab', l9: 'grabbing', ma: 'cptr', mb: 'ctxt', gg: 'e', ms: 'ellip', mF: 'fcs', mG: 'focus-within', mH: 'f-adj', mN: 'fs', mR: 'g', mW: 'hbh', iQ: 'hnb', m_: 'hb', m$: 'hc', m0: 'he', iT: 'hf', m6: 'hv', nb: 'ic', nd: 'fr', ng: 'lbl', nh: 'iml', ni: 'imlf', nj: 'imlp', nk: 'implw', nl: 'irs', nm: 'it', nn: 'itw', no: 'itp', nv: 'i', nC: 'lh', nE: 'lnk', j: 'nb', n6: 'notxt', og: 'nowrp', ox: 'on-dismount', oE: 'on-focused', oF: 'on-focused-within', oI: 'on-hovered', oK: 'ol', oT: 'on-activated', oX: 'on-rendered', o0: 'or', pe: 'oq', ph: 'o
37979h', pm: 'pad', pn: 'pg', po: 'p', pp: 'ppe', j7: 'elm-ui-root', p_: 'r', p4: 'sb', p5: 'sbx', p6: 'sby', qf: 'cap', qh: 'sldr', qm: 'sev', qp: 'spc', qu: 'stick-bottom', qv: 'stick-left', qw: 'stick-top', qy: 'sk', qI: 't', qJ: 'tc', qK: 'tgrd', qL: 'tj', qM: 'tja', qN: 'tl', qO: 'tr', kL: 'move', kM: 'ts', q$: 'clr', a2: 'ui-trigger', q1: 'u', rh: 'wb', ri: 'wc', rj: 'we', k_: 'wf'}; 37980var $author$project$Internal$Style2$classes = $author$project$Internal$Style$Generated$classes; 37981var $author$project$Internal$BitField$BitField = $elm$core$Basics$identity; 37982var $elm$core$Bitwise$complement = _Bitwise_complement; 37983var $author$project$Internal$BitField$ones = ~0; 37984var $author$project$Internal$BitField$custom = function (details) { 37985 if ((!details.L) && (!details.J)) { 37986 return {bp: $author$project$Internal$BitField$ones, J: 0, aV: 0, L: 0}; 37987 } else { 37988 var offset = A2( 37989 $elm$core$Basics$min, 37990 A2($elm$core$Basics$max, 0, details.L), 37991 31); 37992 var length = ((details.J + offset) > 32) ? (32 - offset) : details.J; 37993 var mask = ($author$project$Internal$BitField$ones >>> (32 - length)) << offset; 37994 return {bp: ~mask, J: length, aV: mask, L: offset}; 37995 } 37996}; 37997var $author$project$Internal$BitField$next = F2( 37998 function (nextLength, _v0) { 37999 var existing = _v0; 38000 return $author$project$Internal$BitField$custom( 38001 {J: nextLength, L: existing.L + existing.J}); 38002 }); 38003var $author$project$Internal$BitField$first = function (len) { 38004 return $author$project$Internal$BitField$custom( 38005 {J: len, L: 0}); 38006}; 38007var $author$project$Internal$Flag$skip = $author$project$Internal$BitField$first(0); 38008var $author$project$Internal$Flag$padding = A2($author$project$Internal$BitField$next, 1, $author$project$Internal$Flag$skip); 38009var $author$project$Internal$Flag$spacing = A2($author$project$Internal$BitField$next, 1, $author$project$Internal$Flag$padding); 38010var $author$project$Internal$Flag$fontSize = A2($author$project$Internal$BitField$next, 1, $author$project$Internal$Flag$spacing); 38011var $author$project$Internal$Flag$fontFamily = A2($author$project$Internal$BitField$next, 1, $author$project$Internal$Flag$fontSize); 38012var $author$project$Internal$Flag$width = A2($author$project$Internal$BitField$next, 1, $author$project$Internal$Flag$fontFamily); 38013var $author$project$Internal$Flag$height = A2($author$project$Internal$BitField$next, 1, $author$project$Internal$Flag$width); 38014var $author$project$Internal$Flag$fontAlignment = A2($author$project$Internal$BitField$next, 1, $author$project$Internal$Flag$height); 38015var $author$project$Internal$Flag$fontWeight = A2($author$project$Internal$BitField$next, 1, $author$project$Internal$Flag$fontAlignment); 38016var $author$project$Internal$Flag$fontColor = A2($author$project$Internal$BitField$next, 1, $author$project$Internal$Flag$fontWeight); 38017var $author$project$Internal$Flag$fontGradient = A2($author$project$Internal$BitField$next, 1, $author$project$Internal$Flag$fontColor); 38018var $author$project$Internal$Flag$fontAdjustment = A2($author$project$Internal$BitField$next, 1, $author$project$Internal$Flag$fontGradient); 38019var $author$project$Internal$Flag$fontEllipsis = A2($author$project$Internal$BitField$next, 1, $author$project$Internal$Flag$fontAdjustment); 38020var $author$project$Internal$Flag$id = A2($author$project$Internal$BitField$next, 1, $author$project$Internal$Flag$fontEllipsis); 38021var $author$project$Internal$Flag$txtShadows = A2($author$project$Internal$BitField$next, 1, $author$project$Internal$Flag$id); 38022var $author$project$Internal$Flag$shadows = A2($author$project$Internal$BitField$next, 1, $author$project$Internal$Flag$txtShadows); 38023var $author$project$Internal$Flag$overflow = A2($author$project$Internal$BitField$next, 1, $author$project$Internal$Flag$shadows); 38024var $author$project$Internal$Flag$cursor = A2($author$project$Internal$BitField$next, 1, $author$project$Internal$Flag$overflow); 38025var $author$project$Internal$Flag$transform = A2($author$project$Internal$BitField$next, 1, $author$project$Internal$Flag$cursor); 38026var $author$project$Internal$Flag$borderWidth = A2($author$project$Internal$BitField$next, 1, $author$project$Internal$Flag$transform); 38027var $author$project$Internal$Flag$yAlign = A2($author$project$Internal$BitField$next, 1, $author$project$Internal$Flag$borderWidth); 38028var $author$project$Ui$alignBottom = A2($author$project$Internal$Model2$classWith, $author$project$Internal$Flag$yAlign, $author$project$Internal$Style2$classes.le); 38029var $author$project$Internal$Flag$xAlign = A2($author$project$Internal$BitField$next, 1, $author$project$Internal$Flag$yAlign); 38030var $author$project$Ui$alignRight = A2($author$project$Internal$Model2$classWith, $author$project$Internal$Flag$xAlign, $author$project$Internal$Style2$classes.li); 38031var $author$project$Internal$Flag$xContentAlign = A2($author$project$Internal$BitField$next, 1, $author$project$Internal$Flag$xAlign); 38032var $author$project$Internal$Flag$yContentAlign = A2($author$project$Internal$BitField$next, 1, $author$project$Internal$Flag$xContentAlign); 38033var $author$project$Internal$Flag$focus = A2($author$project$Internal$BitField$next, 1, $author$project$Internal$Flag$yContentAlign); 38034var $author$project$Internal$Flag$active = A2($author$project$Internal$BitField$next, 1, $author$project$Internal$Flag$focus); 38035var $author$project$Internal$Flag$hover = A2($author$project$Internal$BitField$next, 1, $author$project$Internal$Flag$active); 38036var $author$project$Internal$Flag$gridTemplate = A2($author$project$Internal$BitField$next, 1, $author$project$Internal$Flag$hover); 38037var $author$project$Internal$Flag$gridPosition = A2($author$project$Internal$BitField$next, 1, $author$project$Internal$Flag$gridTemplate); 38038var $author$project$Internal$Flag$widthBetween = A2($author$project$Internal$BitField$next, 1, $author$project$Internal$Flag$gridPosition); 38039var $author$project$Internal$Flag$heightBetween = A2($author$project$Internal$BitField$next, 1, $author$project$Internal$Flag$widthBetween); 38040var $author$project$Internal$Flag$background = A2($author$project$Internal$BitField$next, 1, $author$project$Internal$Flag$heightBetween); 38041var $avh4$elm_color$Color$toCssString = function (_v0) { 38042 var r = _v0.a; 38043 var g = _v0.b; 38044 var b = _v0.c; 38045 var a = _v0.d; 38046 var roundTo = function (x) { 38047 return $elm$core$Basics$round(x * 1000) / 1000; 38048 }; 38049 var pct = function (x) { 38050 return $elm$core$Basics$round(x * 10000) / 100; 38051 }; 38052 return $elm$core$String$concat( 38053 _List_fromArray( 38054 [ 38055 'rgba(', 38056 $elm$core$String$fromFloat( 38057 pct(r)), 38058 '%,', 38059 $elm$core$String$fromFloat( 38060 pct(g)), 38061 '%,', 38062 $elm$core$String$fromFloat( 38063 pct(b)), 38064 '%,', 38065 $elm$core$String$fromFloat( 38066 roundTo(a)), 38067 ')' 38068 ])); 38069}; 38070var $author$project$Internal$Style2$color = function (colorDetails) { 38071 return $avh4$elm_color$Color$toCssString(colorDetails); 38072}; 38073var $author$project$Internal$Model2$styleWith = F3( 38074 function (flag, name, val) { 38075 return _List_fromArray( 38076 [ 38077 { 38078 g: { 38079 q: $author$project$Internal$BitField$none, 38080 ei: _List_Nil, 38081 f: $elm$core$Maybe$Nothing, 38082 j: _List_Nil, 38083 o: $author$project$Internal$Model2$NodeAsDiv, 38084 p: F2( 38085 function (_v0, _v1) { 38086 return _List_fromArray( 38087 [ 38088 _Utils_Tuple2(name, val) 38089 ]); 38090 }) 38091 }, 38092 h: flag 38093 } 38094 ]); 38095 }); 38096var $author$project$Ui$background = function (color) { 38097 return A3( 38098 $author$project$Internal$Model2$styleWith, 38099 $author$project$Internal$Flag$background, 38100 'background-color', 38101 $author$project$Internal$Style2$color(color)); 38102}; 38103var $author$project$Internal$Style2$anchorXToString = F2( 38104 function (anchorX, x) { 38105 switch (anchorX) { 38106 case 0: 38107 return 'left calc(50% + ' + ($elm$core$String$fromInt(x) + 'px)'); 38108 case 1: 38109 return 'left'; 38110 default: 38111 return 'right'; 38112 } 38113 }); 38114var $author$project$Internal$Style2$anchorYToString = F2( 38115 function (anchorY, y) { 38116 switch (anchorY) { 38117 case 0: 38118 return 'top calc(50% - ' + ($elm$core$String$fromInt(y) + 'px)'); 38119 case 1: 38120 return 'top ' + ($elm$core$String$fromInt(y) + 'px'); 38121 default: 38122 return 'bottom ' + ($elm$core$String$fromInt(y) + 'px'); 38123 } 38124 }); 38125var $author$project$Internal$Style2$anchorToString = function (anchor) { 38126 if ((((!anchor.a) && (!anchor.b)) && (!anchor.c)) && (!anchor.d)) { 38127 var _v1 = anchor.a; 38128 var _v2 = anchor.b; 38129 return 'center'; 38130 } else { 38131 var anchorX = anchor.a; 38132 var anchorY = anchor.b; 38133 var x = anchor.c; 38134 var y = anchor.d; 38135 return A2($author$project$Internal$Style2$anchorXToString, anchorX, x) + (' ' + A2($author$project$Internal$Style2$anchorYToString, anchorY, y)); 38136 } 38137};
38138var $author$project$Internal$Style2$renderStep = function (step) { 38139 if (!step.$) { 38140 var perc = step.a; 38141 var clr = step.b; 38142 return $author$project$Internal$Style2$color(clr) + (' ' + ($elm$core$String$fromInt(perc) + '%')); 38143 } else { 38144 var pixel = step.a; 38145 var clr = step.b; 38146 return $author$project$Internal$Style2$color(clr) + (' ' + ($elm$core$String$fromInt(pixel) + 'px')); 38147 } 38148}; 38149var $author$project$Internal$Style2$toRadians = function (_v0) { 38150 var r = _v0; 38151 return r; 38152}; 38153var $author$project$Internal$Style2$toCssGradient = function (grad) { 38154 switch (grad.$) { 38155 case 0: 38156 var clr = grad.a; 38157 return $author$project$Internal$Style2$color(clr); 38158 case 1: 38159 var angle = grad.a; 38160 var steps = grad.b; 38161 return 'linear-gradient(' + (A2( 38162 $elm$core$String$join, 38163 ', ', 38164 A2( 38165 $elm$core$List$cons, 38166 $elm$core$String$fromFloat( 38167 $author$project$Internal$Style2$toRadians(angle)) + 'rad', 38168 A2($elm$core$List$map, $author$project$Internal$Style2$renderStep, steps))) + ')'); 38169 case 2: 38170 var isCircle = grad.a; 38171 var anchor = grad.b; 38172 var steps = grad.c; 38173 return 'repeating-radial-gradient(' + ((isCircle ? 'circle at ' : 'ellipse at ') + (A2( 38174 $elm$core$String$join, 38175 ', ', 38176 A2( 38177 $elm$core$List$cons, 38178 $author$project$Internal$Style2$anchorToString(anchor), 38179 A2($elm$core$List$map, $author$project$Internal$Style2$renderStep, steps))) + ')')); 38180 default: 38181 var anchor = grad.a; 38182 var angle = grad.b; 38183 var steps = grad.c; 38184 return 'repeating-conic-gradient(' + (A2( 38185 $elm$core$String$join, 38186 ', ', 38187 A2( 38188 $elm$core$List$cons, 38189 $elm$core$String$fromFloat( 38190 $author$project$Internal$Style2$toRadians(angle)) + 'rad', 38191 A2( 38192 $elm$core$List$cons, 38193 $author$project$Internal$Style2$anchorToString(anchor), 38194 A2( 38195 $elm$core$List$map, 38196 function (_v1) { 38197 var ang = _v1.a; 38198 var clr = _v1.b; 38199 return $author$project$Internal$Style2$color(clr) + (' ' + ($elm$core$String$fromFloat( 38200 $author$project$Internal$Style2$toRadians(ang)) + 'rad')); 38201 }, 38202 steps)))) + ')'); 38203 } 38204}; 38205var $author$project$Ui$backgroundGradient = function (gradient) { 38206 return A3( 38207 $author$project$Internal$Model2$styleWith, 38208 $author$project$Internal$Flag$background, 38209 'background-image', 38210 A2( 38211 $elm$core$String$join, 38212 ', ', 38213 A2($elm$core$List$map, $author$project$Internal$Style2$toCssGradient, gradient))); 38214}; 38215var $avh4$elm_color$Color$RgbaSpace = F4( 38216 function (a, b, c, d) { 38217 return {$: 0, a: a, b: b, c: c, d: d}; 38218 }); 38219var $avh4$elm_color$Color$scaleFrom255 = function (c) { 38220 return c / 255; 38221}; 38222var $avh4$elm_color$Color$rgb255 = F3( 38223 function (r, g, b) { 38224 return A4( 38225 $avh4$elm_color$Color$RgbaSpace, 38226 $avh4$elm_color$Color$scaleFrom255(r), 38227 $avh4$elm_color$Color$scaleFrom255(g), 38228 $avh4$elm_color$Color$scaleFrom255(b), 38229 1.0); 38230 }); 38231var $author$project$Ui$rgb = F3( 38232 function (r, g, b) { 38233 return A3($avh4$elm_color$Color$rgb255, r, g, b); 38234 }); 38235var $avh4$elm_color$Color$rgba = F4( 38236 function (r, g, b, a) { 38237 return A4($avh4$elm_color$Color$RgbaSpace, r, g, b, a); 38238 }); 38239var $author$project$Ui$rgba = F4( 38240 function (r, g, b, a) { 38241 return A4($avh4$elm_color$Color$rgba, r / 255, g / 255, b / 255, a); 38242 }); 38243var $author$project$UI$Theme$base = { 38244 k3: A3($author$project$Ui$rgb, 237, 232, 225), 38245 k4: A3($author$project$Ui$rgb, 224, 218, 210), 38246 hG: A3($author$project$Ui$rgb, 243, 238, 231), 38247 h$: A3($author$project$Ui$rgb, 255, 248, 240), 38248 en: A3($author$project$Ui$rgb, 247, 240, 232), 38249 cR: A3($author$project$Ui$rgb, 45, 45, 45), 38250 kl: A3($author$project$Ui$rgb, 122, 117, 112), 38251 ql: A3($author$project$Ui$rgb, 137, 132, 127), 38252 cW: A3($author$project$Ui$rgb, 107, 102, 97), 38253 km: A3($author$project$Ui$rgb, 255, 255, 255), 38254 qI: A3($author$project$Ui$rgb, 45, 45, 45), 38255 aM: A3($author$project$Ui$rgb, 122, 117, 112), 38256 qR: A4($author$project$Ui$rgba, 176, 168, 159, 0.1), 38257 qS: A4($author$project$Ui$rgba, 176, 168, 159, 0.16), 38258 c0: A4($author$project$Ui$rgba, 176, 168, 159, 0.06) 38259}; 38260var $author$project$UI$Theme$Compact = 0; 38261var $author$project$UI$Theme$Wide = 1; 38262var $author$project$Internal$Model2$Responsive = $elm$core$Basics$identity; 38263var $author$project$Internal$Model2$toBreakpoints = function (details) { 38264 return { 38265 c9: A2($elm$core$List$map, $elm$core$Tuple$first, details.ep), 38266 ep: details.ep, 38267 f9: details.f9, 38268 kG: details.kG 38269 }; 38270}; 38271var $author$project$Ui$Responsive$breakpoints = F2( 38272 function (def, breaks) { 38273 return $author$project$Internal$Model2$toBreakpoints( 38274 { 38275 ep: A2($elm$core$List$sortBy, $elm$core$Tuple$first, breaks), 38276 f9: def, 38277 kG: $elm$core$List$length(breaks) 38278 }); 38279 }); 38280var $author$project$UI$Theme$contentMaxWidth = 430; 38281var $author$project$UI$Theme$breakpoints = A2( 38282 $author$project$Ui$Responsive$breakpoints, 38283 0, 38284 _List_fromArray( 38285 [ 38286 _Utils_Tuple2($author$project$UI$Theme$contentMaxWidth, 1) 38287 ])); 38288var $author$project$Ui$centerX = A2($author$project$Internal$Model2$classWith, $author$project$Internal$Flag$xAlign, $author$project$Internal$Style2$classes.lf); 38289var $author$project$Ui$centerY = A2($author$project$Internal$Model2$classWith, $author$project$Internal$Flag$yAlign, $author$project$Internal$Style2$classes.lg); 38290var $author$project$Internal$Model2$style = F2( 38291 function (name, val) { 38292 return _List_fromArray( 38293 [ 38294 { 38295 g: { 38296 q: $author$project$Internal$BitField$none, 38297 ei: _List_Nil, 38298 f: $elm$core$Maybe$Nothing, 38299 j: _List_Nil, 38300 o: $author$project$Internal$Model2$NodeAsDiv, 38301 p: F2( 38302 function (_v0, _v1) { 38303 return _List_fromArray( 38304 [ 38305 _Utils_Tuple2(name, val) 38306 ]); 38307 }) 38308 }, 38309 h: $author$project$Internal$Flag$skip 38310 } 38311 ]); 38312 }); 38313var $author$project$Ui$Font$color = function (fontColor) { 38314 return A2( 38315 $author$project$Internal$Model2$style, 38316 'color', 38317 $author$project$Internal$Style2$color(fontColor)); 38318}; 38319var $author$project$Internal$Model2$AsColumn = 1; 38320var $author$project$Internal$Model2$Element = $elm$core$Basics$identity; 38321var $author$project$Internal$Model2$NodeAsImage = {$: 30}; 38322var $elm$html$Html$a = _VirtualDom_node('a'); 38323var $author$project$Internal$Model2$NodeAsButton = {$: 4}; 38324var $author$project$Internal$Model2$NodeAsLink = {$: 2}; 38325var $author$project$Internal$BitField$flipIf = F3( 38326 function (_v0, bool, bits) { 38327 var mask = _v0.aV; 38328 return bool ? (bits | mask) : bits; 38329 }); 38330var $author$project$Internal$Flag$add = F2( 38331 function (myFlag, myField) { 38332 return A3($author$project$Internal$BitField$flipIf, myFlag, true, myField); 38333 }); 38334var $author$project$Internal$Bits$Analyze$cssVars = $author$project$Internal$BitField$first(1); 38335var $author$project$Internal$BitField$has = F2( 38336 function (_v0, base) { 38337 var mask = _v0.aV; 38338 return !(!(mask & base)); 38339 }); 38340var $author$project$Internal$Bits$Inheritance$isRow = $author$project$Internal$BitField$first(1); 38341var $author$project$Internal$Bits$Inheritance$isColumn = A2($author$project$Internal$BitField$next, 1, $author$project$Internal$Bits$Inheritance$isRow); 38342var $author$project$Internal$Bits$Inheritance$isTextLayout = A2($author$project$Internal$BitField$next, 1, $author$project$Internal$Bits$Inheritance$isColumn); 38343var $author$project$Internal$Bits$Inheritance$hasTextModification = A2($author$project$Internal$BitField$next, 1, $author$project$Internal$Bits$Inheritance$isTextLayout); 38344var $author$project$Internal$Bits$Analyze$transforms = A2($author$project$Internal$BitField$next, 1, $author$project$Internal$Bits$Analyze$cssVars); 38345var $author$project$Internal$Bits$Analyze$nearbys = A2($author$project$Internal$BitField$next, 1, $author$project$Internal$Bits$Analyze$transforms); 38346var $author$project$Internal$Bits$Analyze$isLink = A2($author$project$Internal$BitField$next, 1, $author$project$Internal$Bits$Analyze$nearbys); 38347var $author$project$Internal$Bits$Analyze$isButton = A2($author$project$Internal$BitField$next, 1, $author$project$Internal$Bits$Analyze$isLink); 38348var $author$project$Internal$BitField$merge = F2( 38349 function (one, two) { 38350 return one | two; 38351 }); 38352var $author$project$Internal$BitField$fieldEqual = F2( 38353 function (_v0, _v1) { 38354 var one = _v0; 38355 var two = _v1; 38356 return _Utils_eq(one.L, two.L) && _Utils_eq(one.J, two.J); 38357 }); 38358var $author$project$Internal$Model2$shouldAlwaysRender = function (bits) { 38359 return A2($author$project$Internal$BitField$fieldEqual, bits, $author$project$Internal$Flag$skip) || A2($author$project$Internal$BitField$fieldEqual, bits, $author$project$Internal$Flag$padding); 38360}; 38361var $author$project$Internal$Model2$analyze = F4( 38362 function (has, encoded, inheritance, attrList) { 38363 analyze: 38364 while (true) { 38365 if (!attrList.b) { 38366 return _Utils_Tuple3( 38367 A3( 38368 $author$project$Internal$BitField$flipIf, 38369 $author$project$Internal$Bits$Analyze$cssVars, 38370 A2($author$project$Internal$BitField$has, $author$project$Internal$Flag$fontGradient, has), 38371 encoded), 38372 A3( 38373 $author$project$Internal$BitField$flipIf, 38374 $author$project$Internal$Bits$Inheritance$hasTextModification, 38375 A2($author$project$Internal$BitField$has, $author$project$Internal$Flag$fontGradient, has) || A2($author$project$Internal$BitField$has, $author$project$Internal$Flag$fontEllipsis, has), 38376 inheritance), 38377 has); 38378 } else { 38379 var flag = attrList.a.h; 38380 var attr = attrList.a.g; 38381 var remain = attrList.b; 38382 var previouslyRendered = $author$project$Internal$Model2$shouldAlwaysRender(flag) ? false : A2($author$project$Internal$BitField$has, flag, has); 38383 if (previouslyRendered) { 38384 var $temp$has = has, 38385 $temp$encoded = encoded, 38386 $temp$inheritance = inheritance, 38387 $temp$attrList = remain; 38388 has = $temp$has; 38389 encoded = $temp$encoded; 38390 inheritance = $temp$inheritance; 38391 attrList = $temp$attrList; 38392 continue analyze; 38393 } else { 38394 var newInheritance = A2($author$project$Internal$BitField$merge, attr.q, inheritance); 38395 var newEncoded = A3( 38396 $author$project$Internal$BitField$flipIf, 38397 $author$project$Internal$Bits$Analyze$isButton, 38398 _Utils_eq($author$project$Internal$Model2$NodeAsButton, attr.o), 38399 A3( 38400 $author$project$Internal$BitField$flipIf, 38401 $author$project$Internal$Bits$Analyze$isLink, 38402 _Utils_eq($author$project$Internal$Model2$NodeAsLink, attr.o), 38403 A3( 38404 $author$project$Internal$BitField$flipIf, 38405 $author$project$Internal$Bits$Analyze$nearbys, 38406 !_Utils_eq(attr.j, _List_Nil), 38407 encoded))); 38408 var $temp$has = A2($author$project$Internal$Flag$add, flag, has), 38409 $temp$encoded = newEncoded, 38410 $temp$inheritance = newInheritance, 38411 $temp$attrList = remain; 38412 has = $temp$has; 38413 encoded = $temp$encoded; 38414 inheritance = $temp$inheritance; 38415 attrList = $temp$attrList; 38416 continue analyze; 38417 } 38418 } 38419 } 38420 }); 38421var $elm$html$Html$article = _VirtualDom_node('article'); 38422var $elm$html$Html$aside = _VirtualDom_node('aside'); 38423var $elm$html$Html$button = _VirtualDom_node('button'); 38424var $author$project$Internal$BitField$clear = F2( 38425 function (_v0, bits) { 38426 var inverseMask = _v0.bp; 38427 return inverseMask & bits; 38428 }); 38429var $author$project$Internal$Bits$Inheritance$fontHeight = A2($author$project$Internal$BitField$next, 7, $author$project$Internal$Bits$Inheritance$hasTextModification); 38430var $author$project$Internal$Bits$Inheritance$spacingX = A2($author$project$Internal$BitField$next, 9, $author$project$Internal$Bits$Inheritance$fontHeight); 38431var $author$project$Internal$Bits$Inheritance$spacingY = A2($author$project$Internal$BitField$next, 9, $author$project$Internal$Bits$Inheritance$spacingX);
38432var $author$project$Internal$Bits$Inheritance$clearParentValues = function (bits) { 38433 return A2( 38434 $author$project$Internal$BitField$clear, 38435 $author$project$Internal$Bits$Inheritance$isTextLayout, 38436 A2( 38437 $author$project$Internal$BitField$clear, 38438 $author$project$Internal$Bits$Inheritance$isColumn, 38439 A2( 38440 $author$project$Internal$BitField$clear, 38441 $author$project$Internal$Bits$Inheritance$isRow, 38442 A2( 38443 $author$project$Internal$BitField$clear, 38444 $author$project$Internal$Bits$Inheritance$spacingY, 38445 A2($author$project$Internal$BitField$clear, $author$project$Internal$Bits$Inheritance$spacingX, bits))))); 38446}; 38447var $author$project$Internal$Model2$columnClass = $author$project$Internal$Style2$classes.bd + (' ' + $author$project$Internal$Style2$classes.lZ); 38448var $author$project$Internal$Model2$gridClass = $author$project$Internal$Style2$classes.bd + (' ' + $author$project$Internal$Style2$classes.mR); 38449var $author$project$Internal$Model2$paragraphClass = $author$project$Internal$Style2$classes.bd + (' ' + $author$project$Internal$Style2$classes.po); 38450var $author$project$Internal$Model2$rootClass = $author$project$Internal$Style2$classes.j7 + (' ' + ($author$project$Internal$Style2$classes.bd + (' ' + $author$project$Internal$Style2$classes.gg))); 38451var $author$project$Internal$Model2$rowClass = $author$project$Internal$Style2$classes.bd + (' ' + ($author$project$Internal$Style2$classes.p_ + (' ' + $author$project$Internal$Style2$classes.og))); 38452var $author$project$Internal$Model2$singleClass = $author$project$Internal$Style2$classes.bd + (' ' + $author$project$Internal$Style2$classes.gg); 38453var $author$project$Internal$Model2$textColumnClass = $author$project$Internal$Style2$classes.bd + (' ' + $author$project$Internal$Style2$classes.pn); 38454var $author$project$Internal$Model2$contextClasses = function (context) { 38455 switch (context) { 38456 case 0: 38457 return $author$project$Internal$Model2$rowClass; 38458 case 1: 38459 return $author$project$Internal$Model2$columnClass; 38460 case 6: 38461 return $author$project$Internal$Model2$rootClass; 38462 case 2: 38463 return $author$project$Internal$Model2$singleClass; 38464 case 3: 38465 return $author$project$Internal$Model2$gridClass; 38466 case 4: 38467 return $author$project$Internal$Model2$paragraphClass; 38468 default: 38469 return $author$project$Internal$Model2$textColumnClass; 38470 } 38471}; 38472var $elm$html$Html$div = _VirtualDom_node('div'); 38473var $author$project$Internal$Model2$flatten = F2( 38474 function (attrList, gathered) { 38475 flatten: 38476 while (true) { 38477 if (!attrList.b) { 38478 return gathered; 38479 } else { 38480 if (!attrList.a.b) { 38481 var remain = attrList.b; 38482 var $temp$attrList = remain, 38483 $temp$gathered = gathered; 38484 attrList = $temp$attrList; 38485 gathered = $temp$gathered; 38486 continue flatten; 38487 } else { 38488 if (!attrList.a.b.b) { 38489 var _v1 = attrList.a; 38490 var attr = _v1.a; 38491 var remain = attrList.b; 38492 var $temp$attrList = remain, 38493 $temp$gathered = A2($elm$core$List$cons, attr, gathered); 38494 attrList = $temp$attrList; 38495 gathered = $temp$gathered; 38496 continue flatten; 38497 } else { 38498 var attrDetailsList = attrList.a; 38499 var remain = attrList.b; 38500 var newGathered = A3( 38501 $elm$core$List$foldl, 38502 F2( 38503 function (attr, innerGathered) { 38504 return A2($elm$core$List$cons, attr, innerGathered); 38505 }), 38506 gathered, 38507 attrDetailsList); 38508 var $temp$attrList = remain, 38509 $temp$gathered = newGathered; 38510 attrList = $temp$attrList; 38511 gathered = $temp$gathered; 38512 continue flatten; 38513 } 38514 } 38515 } 38516 } 38517 }); 38518var $author$project$Internal$BitField$flip = F3( 38519 function (_v0, bool, innerBits) { 38520 var mask = _v0.aV; 38521 var inverseMask = _v0.bp; 38522 return bool ? (innerBits | mask) : (innerBits & inverseMask); 38523 }); 38524var $elm$html$Html$footer = _VirtualDom_node('footer'); 38525var $author$project$Internal$BitField$get = F2( 38526 function (_v0, bits) { 38527 var length = _v0.J; 38528 var offset = _v0.L; 38529 var top = $author$project$Internal$BitField$ones >>> (32 - length); 38530 return top & (bits >>> offset); 38531 }); 38532var $elm$html$Html$h1 = _VirtualDom_node('h1'); 38533var $elm$html$Html$h2 = _VirtualDom_node('h2'); 38534var $elm$html$Html$h3 = _VirtualDom_node('h3'); 38535var $elm$html$Html$h4 = _VirtualDom_node('h4'); 38536var $elm$html$Html$h5 = _VirtualDom_node('h5'); 38537var $elm$html$Html$h6 = _VirtualDom_node('h6'); 38538var $elm$html$Html$img = _VirtualDom_node('img'); 38539var $author$project$Internal$BitField$init = 0; 38540var $elm$html$Html$input = _VirtualDom_node('input'); 38541var $elm$html$Html$label = _VirtualDom_node('label'); 38542var $elm$html$Html$li = _VirtualDom_node('li'); 38543var $elm$html$Html$main_ = _VirtualDom_node('main'); 38544var $elm$html$Html$nav = _VirtualDom_node('nav');
38545var $elm$virtual_dom$VirtualDom$node = function (tag) { 38546 return _VirtualDom_node( 38547 _VirtualDom_noScript(tag)); 38548}; 38549var $elm$html$Html$node = $elm$virtual_dom$VirtualDom$node; 38550var $author$project$Internal$Flag$none = $author$project$Internal$BitField$init; 38551var $elm$html$Html$ol = _VirtualDom_node('ol'); 38552var $elm$html$Html$p = _VirtualDom_node('p'); 38553var $elm$html$Html$section = _VirtualDom_node('section'); 38554var $elm$html$Html$span = _VirtualDom_node('span'); 38555var $elm$virtual_dom$VirtualDom$style = _VirtualDom_style; 38556var $elm$html$Html$Attributes$style = $elm$virtual_dom$VirtualDom$style; 38557var $elm$html$Html$table = _VirtualDom_node('table'); 38558var $elm$html$Html$tbody = _VirtualDom_node('tbody'); 38559var $elm$html$Html$td = _VirtualDom_node('td'); 38560var $elm$html$Html$textarea = _VirtualDom_node('textarea'); 38561var $elm$html$Html$tfoot = _VirtualDom_node('tfoot'); 38562var $elm$html$Html$th = _VirtualDom_node('th'); 38563var $elm$html$Html$thead = _VirtualDom_node('thead'); 38564var $author$project$Internal$Model2$toAttrs = F5( 38565 function (parentBits, myBits, has, htmlAttrs, attrList) { 38566 toAttrs: 38567 while (true) { 38568 if (!attrList.b) { 38569 return htmlAttrs; 38570 } else { 38571 var flag = attrList.a.h; 38572 var attr = attrList.a.g; 38573 var remain = attrList.b; 38574 var previouslyRendered = $author$project$Internal$Model2$shouldAlwaysRender(flag) ? false : A2($author$project$Internal$BitField$has, flag, has); 38575 if (previouslyRendered) { 38576 var $temp$parentBits = parentBits, 38577 $temp$myBits = myBits, 38578 $temp$has = has, 38579 $temp$htmlAttrs = htmlAttrs, 38580 $temp$attrList = remain; 38581 parentBits = $temp$parentBits; 38582 myBits = $temp$myBits; 38583 has = $temp$has; 38584 htmlAttrs = $temp$htmlAttrs; 38585 attrList = $temp$attrList; 38586 continue toAttrs; 38587 } else { 38588 var _v1 = attr.ei; 38589 if (!_v1.b) { 38590 var $temp$parentBits = parentBits, 38591 $temp$myBits = myBits, 38592 $temp$has = has, 38593 $temp$htmlAttrs = htmlAttrs, 38594 $temp$attrList = remain; 38595 parentBits = $temp$parentBits; 38596 myBits = $temp$myBits; 38597 has = $temp$has; 38598 htmlAttrs = $temp$htmlAttrs; 38599 attrList = $temp$attrList; 38600 continue toAttrs; 38601 } else { 38602 var newAttrs = function () { 38603 var _v2 = attr.ei; 38604 if (!_v2.b) { 38605 return htmlAttrs; 38606 } else { 38607 if (!_v2.b.b) { 38608 var single = _v2.a; 38609 return A2($elm$core$List$cons, single, htmlAttrs); 38610 } else { 38611 if (!_v2.b.b.b) { 38612 var first = _v2.a; 38613 var _v3 = _v2.b; 38614 var second = _v3.a; 38615 return A2( 38616 $elm$core$List$cons, 38617 first, 38618 A2($elm$core$List$cons, second, htmlAttrs)); 38619 } else { 38620 var list = _v2; 38621 return _Utils_ap(list, htmlAttrs); 38622 } 38623 } 38624 } 38625 }(); 38626 var $temp$parentBits = parentBits, 38627 $temp$myBits = myBits, 38628 $temp$has = A2($author$project$Internal$Flag$add, flag, has), 38629 $temp$htmlAttrs = newAttrs, 38630 $temp$attrList = remain; 38631 parentBits = $temp$parentBits; 38632 myBits = $temp$myBits; 38633 has = $temp$has; 38634 htmlAttrs = $temp$htmlAttrs; 38635 attrList = $temp$attrList; 38636 continue toAttrs; 38637 } 38638 } 38639 } 38640 } 38641 }); 38642var $author$project$Internal$Model2$Behind = 5; 38643var $author$project$Internal$Model2$Trigger = 6; 38644var $elm$html$Html$Attributes$stringProperty = F2( 38645 function (key, string) { 38646 return A2( 38647 _VirtualDom_property, 38648 key, 38649 $elm$json$Json$Encode$string(string)); 38650 }); 38651var $elm$html$Html$Attributes$class = $elm$html$Html$Attributes$stringProperty('className'); 38652var $author$project$Internal$Model2$nearbyToHtml = F3( 38653 function (inheritance, location, _v0) { 38654 var elem = _v0; 38655 return (location === 6) ? elem(inheritance) : A2( 38656 $elm$html$Html$div, 38657 _List_fromArray( 38658 [ 38659 $elm$html$Html$Attributes$class( 38660 _Utils_ap( 38661 $author$project$Internal$Style2$classes.j, 38662 _Utils_ap( 38663 ' ' + ($author$project$Internal$Style2$classes.gg + ' '), 38664 function () { 38665 switch (location) { 38666 case 0: 38667 return $author$project$Internal$Style2$classes.k2; 38668 case 1: 38669 return $author$project$Internal$Style2$classes.lA; 38670 case 2: 38671 return $author$project$Internal$Style2$classes.o0; 38672 case 3: 38673 return $author$project$Internal$Style2$classes.oK; 38674 case 4: 38675 return $author$project$Internal$Style2$classes.nd; 38676 case 5: 38677 return $author$project$Internal$Style2$classes.lz; 38678 default: 38679 return $author$project$Internal$Style2$classes.a2; 38680 } 38681 }()))) 38682 ]), 38683 _List_fromArray( 38684 [ 38685 elem(inheritance) 38686 ])); 38687 }); 38688var $author$project$Internal$Model2$toBehindElements = F3( 38689 function (inheritance, foundElems, attrList) { 38690 toBehindElements: 38691 while (true) { 38692 if (!attrList.b) { 38693 return foundElems; 38694 } else { 38695 var attr = attrList.a.g; 38696 var remain = attrList.b; 38697 var _v1 = attr.j; 38698 if (!_v1.b) { 38699 var $temp$inheritance = inheritance, 38700 $temp$foundElems = foundElems, 38701 $temp$attrList = remain; 38702 inheritance = $temp$inheritance; 38703 foundElems = $temp$foundElems; 38704 attrList = $temp$attrList; 38705 continue toBehindElements; 38706 } else { 38707 if (!_v1.b.b) { 38708 switch (_v1.a.a) { 38709 case 5: 38710 var _v2 = _v1.a; 38711 var _v3 = _v2.a; 38712 var behindElem = _v2.b; 38713 var $temp$inheritance = inheritance, 38714 $temp$foundElems = A2( 38715 $elm$core$List$cons, 38716 A3($author$project$Internal$Model2$nearbyToHtml, inheritance, 5, behindElem), 38717 foundElems), 38718 $temp$attrList = remain; 38719 inheritance = $temp$inheritance; 38720 foundElems = $temp$foundElems; 38721 attrList = $temp$attrList; 38722 continue toBehindElements; 38723 case 6: 38724 var _v4 = _v1.a; 38725 var _v5 = _v4.a; 38726 var triggerElem = _v4.b; 38727 var $temp$inheritance = inheritance, 38728 $temp$foundElems = A2( 38729 $elm$core$List$cons, 38730 A3($author$project$Internal$Model2$nearbyToHtml, inheritance, 6, triggerElem), 38731 foundElems), 38732 $temp$attrList = remain; 38733 inheritance = $temp$inheritance; 38734 foundElems = $temp$foundElems; 38735 attrList = $temp$attrList; 38736 continue toBehindElements; 38737 default: 38738 var _v6 = _v1.a; 38739 var $temp$inheritance = inheritance, 38740 $temp$foundElems = foundElems, 38741 $temp$attrList = remain; 38742 inheritance = $temp$inheritance; 38743 foundElems = $temp$foundElems; 38744 attrList = $temp$attrList; 38745 continue toBehindElements; 38746 } 38747 } else { 38748 var nearbys = _v1; 38749 var renderedNearbys = A2( 38750 $elm$core$List$filterMap, 38751 function (_v7) { 38752 var location = _v7.a; 38753 var nearbyElem = _v7.b; 38754 return ((location === 5) || (location === 6)) ? $elm$core$Maybe$Just( 38755 A3($author$project$Internal$Model2$nearbyToHtml, inheritance, location, nearbyElem)) : $elm$core$Maybe$Nothing; 38756 }, 38757 nearbys); 38758 var $temp$inheritance = inheritance, 38759 $temp$foundElems = _Utils_ap(renderedNearbys, foundElems), 38760 $temp$attrList = remain; 38761 inheritance = $temp$inheritance; 38762 foundElems = $temp$foundElems; 38763 attrList = $temp$attrList; 38764 continue toBehindElements; 38765 } 38766 } 38767 } 38768 } 38769 }); 38770var $author$project$Internal$Model2$toNearbyElements = F3( 38771 function (inheritance, foundElems, attrList) { 38772 toNearbyElements: 38773 while (true) { 38774 if (!attrList.b) { 38775 return foundElems; 38776 } else { 38777 var attr = attrList.a.g; 38778 var remain = attrList.b; 38779 var _v1 = attr.j; 38780 if (!_v1.b) { 38781 var $temp$inheritance = inheritance, 38782 $temp$foundElems = foundElems, 38783 $temp$attrList = remain; 38784 inheritance = $temp$inheritance; 38785 foundElems = $temp$foundElems; 38786 attrList = $temp$attrList; 38787 continue toNearbyElements; 38788 } else { 38789 if (!_v1.b.b) { 38790 switch (_v1.a.a) { 38791 case 5: 38792 var _v2 = _v1.a; 38793 var _v3 = _v2.a; 38794 var $temp$inheritance = inheritance, 38795 $temp$foundElems = foundElems, 38796 $temp$attrList = remain; 38797 inheritance = $temp$inheritance; 38798 foundElems = $temp$foundElems; 38799 attrList = $temp$attrList; 38800 continue toNearbyElements; 38801 case 6: 38802 var _v4 = _v1.a; 38803 var _v5 = _v4.a; 38804 var $temp$inheritance = inheritance, 38805 $temp$foundElems = foundElems, 38806 $temp$attrList = remain; 38807 inheritance = $temp$inheritance; 38808 foundElems = $temp$foundElems; 38809 attrList = $temp$attrList; 38810 continue toNearbyElements; 38811 default: 38812 var _v6 = _v1.a; 38813 var location = _v6.a; 38814 var nearbyElem = _v6.b; 38815 var $temp$inheritance = inheritance, 38816 $temp$foundElems = A2( 38817 $elm$core$List$cons, 38818 A3($author$project$Internal$Model2$nearbyToHtml, inheritance, location, nearbyElem), 38819 foundElems), 38820 $temp$attrList = remain; 38821 inheritance = $temp$inheritance; 38822 foundElems = $temp$foundElems; 38823 attrList = $temp$attrList; 38824 continue toNearbyElements; 38825 } 38826 } else { 38827 var nearbys = _v1; 38828 var renderedNearbys = A2( 38829 $elm$core$List$filterMap, 38830 function (_v7) { 38831 var location = _v7.a; 38832 var nearbyElem = _v7.b; 38833 return ((location === 5) || (location === 6)) ? $elm$core$Maybe$Nothing : $elm$core$Maybe$Just( 38834 A3($author$project$Internal$Model2$nearbyToHtml, inheritance, location, nearbyElem)); 38835 }, 38836 nearbys); 38837 var $temp$inheritance = inheritance, 38838 $temp$foundElems = _Utils_ap(renderedNearbys, foundElems), 38839 $temp$attrList = remain; 38840 inheritance = $temp$inheritance; 38841 foundElems = $temp$foundElems; 38842 attrList = $temp$attrList; 38843 continue toNearbyElements; 38844 } 38845 } 38846 } 38847 } 38848 }); 38849var $author$project$Internal$Model2$toChildren = F4( 38850 function (myBits, analyzedBits, attrList, children) { 38851 if (A2($author$project$Internal$BitField$has, $author$project$Internal$Bits$Analyze$nearbys, analyzedBits)) { 38852 var behind = A3($author$project$Internal$Model2$toBehindElements, myBits, _List_Nil, attrList); 38853 var after = A3($author$project$Internal$Model2$toNearbyElements, myBits, _List_Nil, attrList); 38854 return _Utils_ap( 38855 behind, 38856 _Utils_ap( 38857 A2( 38858 $elm$core$List$map, 38859 function (_v0) {
38860 var toChild = _v0; 38861 return toChild(myBits); 38862 }, 38863 children), 38864 after)); 38865 } else { 38866 return A2( 38867 $elm$core$List$map, 38868 function (_v1) { 38869 var toChild = _v1; 38870 return toChild(myBits); 38871 }, 38872 children); 38873 } 38874 }); 38875var $author$project$Internal$Model2$addStyles = F2( 38876 function (styles, attrList) { 38877 addStyles: 38878 while (true) { 38879 if (!styles.b) { 38880 return attrList; 38881 } else { 38882 var _v1 = styles.a; 38883 var name = _v1.a; 38884 var val = _v1.b; 38885 var remain = styles.b; 38886 var $temp$styles = remain, 38887 $temp$attrList = A2( 38888 $elm$core$List$cons, 38889 A2($elm$html$Html$Attributes$style, name, val), 38890 attrList); 38891 styles = $temp$styles; 38892 attrList = $temp$attrList; 38893 continue addStyles; 38894 } 38895 } 38896 }); 38897var $author$project$Internal$Model2$toStyle = F7( 38898 function (parentBits, myBits, analyzedBits, has, htmlAttrs, classes, attrList) { 38899 toStyle: 38900 while (true) { 38901 if (!attrList.b) { 38902 return A2($author$project$Internal$BitField$has, $author$project$Internal$Bits$Analyze$nearbys, analyzedBits) ? A2( 38903 $elm$core$List$cons, 38904 $elm$html$Html$Attributes$class(classes + (' ' + $author$project$Internal$Style2$classes.iQ)), 38905 htmlAttrs) : A2( 38906 $elm$core$List$cons, 38907 $elm$html$Html$Attributes$class(classes), 38908 htmlAttrs); 38909 } else { 38910 var flag = attrList.a.h; 38911 var attr = attrList.a.g; 38912 var remain = attrList.b; 38913 var previouslyRendered = $author$project$Internal$Model2$shouldAlwaysRender(flag) ? false : A2($author$project$Internal$BitField$has, flag, has); 38914 if (previouslyRendered) { 38915 var $temp$parentBits = parentBits, 38916 $temp$myBits = myBits, 38917 $temp$analyzedBits = analyzedBits, 38918 $temp$has = has, 38919 $temp$htmlAttrs = htmlAttrs, 38920 $temp$classes = classes, 38921 $temp$attrList = remain; 38922 parentBits = $temp$parentBits; 38923 myBits = $temp$myBits; 38924 analyzedBits = $temp$analyzedBits; 38925 has = $temp$has; 38926 htmlAttrs = $temp$htmlAttrs; 38927 classes = $temp$classes; 38928 attrList = $temp$attrList; 38929 continue toStyle; 38930 } else { 38931 var newClasses = function () { 38932 var _v6 = attr.f; 38933 if (_v6.$ === 1) { 38934 return classes; 38935 } else { 38936 var classStr = _v6.a; 38937 return classes + (' ' + classStr); 38938 } 38939 }(); 38940 var _v1 = A2(attr.p, parentBits, analyzedBits); 38941 if (!_v1.b) { 38942 var $temp$parentBits = parentBits, 38943 $temp$myBits = myBits, 38944 $temp$analyzedBits = analyzedBits, 38945 $temp$has = A2($author$project$Internal$Flag$add, flag, has), 38946 $temp$htmlAttrs = htmlAttrs, 38947 $temp$classes = newClasses, 38948 $temp$attrList = remain; 38949 parentBits = $temp$parentBits; 38950 myBits = $temp$myBits; 38951 analyzedBits = $temp$analyzedBits; 38952 has = $temp$has; 38953 htmlAttrs = $temp$htmlAttrs; 38954 classes = $temp$classes; 38955 attrList = $temp$attrList; 38956 continue toStyle; 38957 } else { 38958 if (!_v1.b.b) { 38959 var _v2 = _v1.a; 38960 var name = _v2.a; 38961 var val = _v2.b; 38962 var $temp$parentBits = parentBits, 38963 $temp$myBits = myBits, 38964 $temp$analyzedBits = analyzedBits, 38965 $temp$has = A2($author$project$Internal$Flag$add, flag, has), 38966 $temp$htmlAttrs = A2( 38967 $elm$core$List$cons, 38968 A2($elm$html$Html$Attributes$style, name, val), 38969 htmlAttrs), 38970 $temp$classes = newClasses, 38971 $temp$attrList = remain; 38972 parentBits = $temp$parentBits; 38973 myBits = $temp$myBits; 38974 analyzedBits = $temp$analyzedBits; 38975 has = $temp$has; 38976 htmlAttrs = $temp$htmlAttrs; 38977 classes = $temp$classes; 38978 attrList = $temp$attrList; 38979 continue toStyle; 38980 } else { 38981 if (!_v1.b.b.b) { 38982 var _v3 = _v1.a; 38983 var name = _v3.a; 38984 var val = _v3.b; 38985 var _v4 = _v1.b; 38986 var _v5 = _v4.a; 38987 var twoName = _v5.a; 38988 var twoVal = _v5.b; 38989 var $temp$parentBits = parentBits, 38990 $temp$myBits = myBits, 38991 $temp$analyzedBits = analyzedBits, 38992 $temp$has = A2($author$project$Internal$Flag$add, flag, has), 38993 $temp$htmlAttrs = A2( 38994 $elm$core$List$cons, 38995 A2($elm$html$Html$Attributes$style, name, val), 38996 A2( 38997 $elm$core$List$cons, 38998 A2($elm$html$Html$Attributes$style, twoName, twoVal), 38999 htmlAttrs)), 39000 $temp$classes = newClasses, 39001 $temp$attrList = remain; 39002 parentBits = $temp$parentBits; 39003 myBits = $temp$myBits; 39004 analyzedBits = $temp$analyzedBits; 39005 has = $temp$has; 39006 htmlAttrs = $temp$htmlAttrs; 39007 classes = $temp$classes; 39008 attrList = $temp$attrList; 39009 continue toStyle; 39010 } else { 39011 var list = _v1; 39012 var $temp$parentBits = parentBits, 39013 $temp$myBits = myBits,
39014 $temp$analyzedBits = analyzedBits, 39015 $temp$has = A2($author$project$Internal$Flag$add, flag, has), 39016 $temp$htmlAttrs = A2($author$project$Internal$Model2$addStyles, list, htmlAttrs), 39017 $temp$classes = newClasses, 39018 $temp$attrList = remain; 39019 parentBits = $temp$parentBits; 39020 myBits = $temp$myBits; 39021 analyzedBits = $temp$analyzedBits; 39022 has = $temp$has; 39023 htmlAttrs = $temp$htmlAttrs; 39024 classes = $temp$classes; 39025 attrList = $temp$attrList; 39026 continue toStyle; 39027 } 39028 } 39029 } 39030 } 39031 } 39032 } 39033 }); 39034var $author$project$Internal$Model2$addStylesToString = F2( 39035 function (styles, attrList) { 39036 addStylesToString: 39037 while (true) { 39038 if (!styles.b) { 39039 return attrList; 39040 } else { 39041 var _v1 = styles.a; 39042 var name = _v1.a; 39043 var val = _v1.b; 39044 var remain = styles.b; 39045 var $temp$styles = remain, 39046 $temp$attrList = name + (':' + (val + (';' + attrList))); 39047 styles = $temp$styles; 39048 attrList = $temp$attrList; 39049 continue addStylesToString; 39050 } 39051 } 39052 }); 39053var $elm$virtual_dom$VirtualDom$property = F2( 39054 function (key, value) { 39055 return A2( 39056 _VirtualDom_property, 39057 _VirtualDom_noInnerHtmlOrFormAction(key), 39058 _VirtualDom_noJavaScriptOrHtmlJson(value)); 39059 }); 39060var $elm$html$Html$Attributes$property = $elm$virtual_dom$VirtualDom$property; 39061var $author$project$Internal$Model2$toStyleAsEncodedProperty = F8( 39062 function (parentBits, myBits, analyzed, has, classesString, htmlAttrs, str, attrList) { 39063 toStyleAsEncodedProperty: 39064 while (true) { 39065 if (!attrList.b) { 39066 return A2( 39067 $elm$core$List$cons, 39068 A2($author$project$Internal$BitField$has, $author$project$Internal$Bits$Analyze$nearbys, analyzed) ? $elm$html$Html$Attributes$class(classesString + (' ' + $author$project$Internal$Style2$classes.iQ)) : $elm$html$Html$Attributes$class(classesString), 39069 A2( 39070 $elm$core$List$cons, 39071 A2( 39072 $elm$html$Html$Attributes$property, 39073 'style', 39074 $elm$json$Json$Encode$string(str)), 39075 htmlAttrs)); 39076 } else { 39077 var flag = attrList.a.h; 39078 var attr = attrList.a.g; 39079 var remain = attrList.b; 39080 var previouslyRendered = $author$project$Internal$Model2$shouldAlwaysRender(flag) ? false : A2($author$project$Internal$BitField$has, flag, has); 39081 if (previouslyRendered) { 39082 var $temp$parentBits = parentBits, 39083 $temp$myBits = myBits, 39084 $temp$analyzed = analyzed, 39085 $temp$has = has, 39086 $temp$classesString = classesString, 39087 $temp$htmlAttrs = htmlAttrs, 39088 $temp$str = str, 39089 $temp$attrList = remain; 39090 parentBits = $temp$parentBits; 39091 myBits = $temp$myBits; 39092 analyzed = $temp$analyzed; 39093 has = $temp$has; 39094 classesString = $temp$classesString; 39095 htmlAttrs = $temp$htmlAttrs; 39096 str = $temp$str; 39097 attrList = $temp$attrList; 39098 continue toStyleAsEncodedProperty; 39099 } else { 39100 var newClasses = function () { 39101 var _v6 = attr.f; 39102 if (_v6.$ === 1) { 39103 return classesString; 39104 } else { 39105 var moreClasses = _v6.a; 39106 return classesString + (' ' + moreClasses); 39107 } 39108 }(); 39109 var _v1 = A2(attr.p, parentBits, analyzed); 39110 if (!_v1.b) { 39111 var $temp$parentBits = parentBits, 39112 $temp$myBits = myBits, 39113 $temp$analyzed = analyzed, 39114 $temp$has = A2($author$project$Internal$Flag$add, flag, has), 39115 $temp$classesString = newClasses, 39116 $temp$htmlAttrs = htmlAttrs, 39117 $temp$str = str, 39118 $temp$attrList = remain; 39119 parentBits = $temp$parentBits; 39120 myBits = $temp$myBits; 39121 analyzed = $temp$analyzed; 39122 has = $temp$has; 39123 classesString = $temp$classesString; 39124 htmlAttrs = $temp$htmlAttrs; 39125 str = $temp$str; 39126 attrList = $temp$attrList; 39127 continue toStyleAsEncodedProperty; 39128 } else { 39129 if (!_v1.b.b) { 39130 var _v2 = _v1.a; 39131 var name = _v2.a; 39132 var val = _v2.b; 39133 var $temp$parentBits = parentBits, 39134 $temp$myBits = myBits, 39135 $temp$analyzed = analyzed, 39136 $temp$has = A2($author$project$Internal$Flag$add, flag, has), 39137 $temp$classesString = newClasses, 39138 $temp$htmlAttrs = htmlAttrs, 39139 $temp$str = name + (':' + (val + (';' + str))), 39140 $temp$attrList = remain; 39141 parentBits = $temp$parentBits; 39142 myBits = $temp$myBits; 39143 analyzed = $temp$analyzed; 39144 has = $temp$has; 39145 classesString = $temp$classesString; 39146 htmlAttrs = $temp$htmlAttrs; 39147 str = $temp$str; 39148 attrList = $temp$attrList; 39149 continue toStyleAsEncodedProperty; 39150 } else { 39151 if (!_v1.b.b.b) { 39152 var _v3 = _v1.a; 39153 var name = _v3.a; 39154 var val = _v3.b; 39155 var _v4 = _v1.b; 39156 var _v5 = _v4.a; 39157 var twoName = _v5.a; 39158 var twoVal = _v5.b; 39159 var $temp$parentBits = parentBits, 39160 $temp$myBits = myBits, 39161 $temp$analyzed = analyzed, 39162 $temp$has = A2($author$project$Internal$Flag$add, flag, has), 39163 $temp$classesString = newClasses, 39164 $temp$htmlAttrs = htmlAttrs, 39165 $temp$str = name + (':' + (val + (';' + (twoName + (':' + (twoVal + (';' + str))))))), 39166 $temp$attrList = remain; 39167 parentBits = $temp$parentBits; 39168 myBits = $temp$myBits; 39169 analyzed = $temp$analyzed; 39170 has = $temp$has; 39171 classesString = $temp$classesString; 39172 htmlAttrs = $temp$htmlAttrs; 39173 str = $temp$str; 39174 attrList = $temp$attrList; 39175 continue toStyleAsEncodedProperty; 39176 } else { 39177 var list = _v1; 39178 var $temp$parentBits = parentBits, 39179 $temp$myBits = myBits, 39180 $temp$analyzed = analyzed, 39181 $temp$has = A2($author$project$Internal$Flag$add, flag, has), 39182 $temp$classesString = newClasses, 39183 $temp$htmlAttrs = htmlAttrs, 39184 $temp$str = A2($author$project$Internal$Model2$addStylesToString, list, str), 39185 $temp$attrList = remain; 39186 parentBits = $temp$parentBits; 39187 myBits = $temp$myBits; 39188 analyzed = $temp$analyzed; 39189 has = $temp$has; 39190 classesString = $temp$classesString; 39191 htmlAttrs = $temp$htmlAttrs; 39192 str = $temp$str; 39193 attrList = $temp$attrList; 39194 continue toStyleAsEncodedProperty; 39195 } 39196 } 39197 } 39198 } 39199 } 39200 } 39201 }); 39202var $elm$html$Html$tr = _VirtualDom_node('tr'); 39203var $elm$html$Html$ul = _VirtualDom_node('ul'); 39204var $author$project$Internal$Model2$element = F4( 39205 function (node, layout, attrList, children) { 39206 return function (parentBits) { 39207 var myBaseBits = function () { 39208 switch (layout) { 39209 case 0: 39210 return A2($author$project$Internal$BitField$flip, $author$project$Internal$Bits$Inheritance$isRow, true); 39211 case 1: 39212 return A2($author$project$Internal$BitField$flip, $author$project$Internal$Bits$Inheritance$isColumn, true); 39213 case 4: 39214 return A2($author$project$Internal$BitField$flip, $author$project$Internal$Bits$Inheritance$isTextLayout, true); 39215 case 5: 39216 return A2($author$project$Internal$BitField$flip, $author$project$Internal$Bits$Inheritance$isTextLayout, true); 39217 default: 39218 return $elm$core$Basics$identity; 39219 } 39220 }()(
39221 $author$project$Internal$Bits$Inheritance$clearParentValues(parentBits)); 39222 var flattened = A2($author$project$Internal$Model2$flatten, attrList, _List_Nil); 39223 var _v0 = A4($author$project$Internal$Model2$analyze, $author$project$Internal$Flag$none, $author$project$Internal$BitField$init, myBaseBits, flattened); 39224 var analyzedBits = _v0.a; 39225 var myBits = _v0.b; 39226 var iHave = _v0.c; 39227 var finalChildren = A4($author$project$Internal$Model2$toChildren, myBits, analyzedBits, flattened, children); 39228 var htmlAttrs = function () { 39229 if (A2($author$project$Internal$BitField$has, $author$project$Internal$Bits$Inheritance$isTextLayout, parentBits) && A2($author$project$Internal$BitField$has, $author$project$Internal$Flag$xAlign, iHave)) { 39230 var spacingY = A2($author$project$Internal$BitField$get, $author$project$Internal$Bits$Inheritance$spacingY, parentBits); 39231 var spacingX = A2($author$project$Internal$BitField$get, $author$project$Internal$Bits$Inheritance$spacingX, parentBits); 39232 var margin = A2( 39233 $elm$html$Html$Attributes$style, 39234 'margin', 39235 $elm$core$String$fromInt(spacingY) + ('px' + (' ' + ($elm$core$String$fromInt(spacingX) + 'px')))); 39236 return A5( 39237 $author$project$Internal$Model2$toAttrs, 39238 parentBits, 39239 myBits, 39240 $author$project$Internal$Flag$none, 39241 _List_fromArray( 39242 [margin]), 39243 flattened); 39244 } else { 39245 return A5($author$project$Internal$Model2$toAttrs, parentBits, myBits, $author$project$Internal$Flag$none, _List_Nil, flattened); 39246 } 39247 }(); 39248 var styleAttrs = A2($author$project$Internal$BitField$has, $author$project$Internal$Bits$Analyze$cssVars, analyzedBits) ? A8( 39249 $author$project$Internal$Model2$toStyleAsEncodedProperty, 39250 parentBits, 39251 myBits, 39252 analyzedBits, 39253 $author$project$Internal$Flag$none, 39254 $author$project$Internal$Model2$contextClasses(layout), 39255 htmlAttrs, 39256 '', 39257 flattened) : A7( 39258 $author$project$Internal$Model2$toStyle, 39259 parentBits, 39260 myBits, 39261 analyzedBits, 39262 $author$project$Internal$Flag$none, 39263 htmlAttrs, 39264 $author$project$Internal$Model2$contextClasses(layout), 39265 flattened); 39266 if (_Utils_eq(node, $author$project$Internal$Model2$NodeAsImage)) { 39267 return A2($elm$html$Html$img, styleAttrs, finalChildren); 39268 } else { 39269 if (A2($author$project$Internal$BitField$has, $author$project$Internal$Bits$Analyze$isLink, analyzedBits)) { 39270 return A2($elm$html$Html$a, styleAttrs, finalChildren); 39271 } else { 39272 if (A2($author$project$Internal$BitField$has, $author$project$Internal$Bits$Analyze$isButton, analyzedBits)) { 39273 return A2($elm$html$Html$button, styleAttrs, finalChildren); 39274 } else { 39275 switch (node.$) { 39276 case 0: 39277 return A2($elm$html$Html$div, styleAttrs, finalChildren); 39278 case 1: 39279 return A2($elm$html$Html$span, styleAttrs, finalChildren); 39280 case 2: 39281 return A2($elm$html$Html$a, styleAttrs, finalChildren); 39282 case 3: 39283 return A2($elm$html$Html$p, styleAttrs, finalChildren); 39284 case 4: 39285 return A2($elm$html$Html$button, styleAttrs, finalChildren); 39286 case 5: 39287 return A2($elm$html$Html$table, styleAttrs, finalChildren); 39288 case 6: 39289 return A2($elm$html$Html$thead, styleAttrs, finalChildren); 39290 case 7: 39291 return A2($elm$html$Html$th, styleAttrs, finalChildren); 39292 case 8: 39293 return A2($elm$html$Html$tr, styleAttrs, finalChildren); 39294 case 11: 39295 return A2($elm$html$Html$tbody, styleAttrs, finalChildren); 39296 case 9: 39297 return A2($elm$html$Html$td, styleAttrs, finalChildren); 39298 case 10: 39299 return A2($elm$html$Html$tfoot, styleAttrs, finalChildren); 39300 case 12: 39301 return A2($elm$html$Html$label, styleAttrs, finalChildren); 39302 case 13: 39303 return A2($elm$html$Html$input, styleAttrs, finalChildren); 39304 case 14: 39305 return A2($elm$html$Html$textarea, styleAttrs, finalChildren); 39306 case 30: 39307 return A2($elm$html$Html$img, styleAttrs, finalChildren); 39308 case 15: 39309 return A2($elm$html$Html$h1, styleAttrs, finalChildren); 39310 case 16: 39311 return A2($elm$html$Html$h2, styleAttrs, finalChildren); 39312 case 17: 39313 return A2($elm$html$Html$h3, styleAttrs, finalChildren); 39314 case 18: 39315 return A2($elm$html$Html$h4, styleAttrs, finalChildren); 39316 case 19: 39317 return A2($elm$html$Html$h5, styleAttrs, finalChildren); 39318 case 20: 39319 return A2($elm$html$Html$h6, styleAttrs, finalChildren); 39320 case 21: 39321 return A2($elm$html$Html$nav, styleAttrs, finalChildren); 39322 case 22: 39323 return A2($elm$html$Html$main_, styleAttrs, finalChildren); 39324 case 23: 39325 return A2($elm$html$Html$aside, styleAttrs, finalChildren); 39326 case 24: 39327 return A2($elm$html$Html$section, styleAttrs, finalChildren); 39328 case 25: 39329 return A2($elm$html$Html$article, styleAttrs, finalChildren); 39330 case 26: 39331 return A2($elm$html$Html$footer, styleAttrs, finalChildren); 39332 case 27: 39333 return A2($elm$html$Html$ol, styleAttrs, finalChildren); 39334 case 28: 39335 return A2($elm$html$Html$ul, styleAttrs, finalChildren); 39336 case 29: 39337 return A2($elm$html$Html$li, styleAttrs, finalChildren); 39338 default: 39339 var nodeName = node.a; 39340 return A3($elm$html$Html$node, nodeName, styleAttrs, finalChildren); 39341 } 39342 } 39343 } 39344 } 39345 }; 39346 }); 39347var $author$project$Ui$Fill = function (a) { 39348 return {$: 1, a: a}; 39349}; 39350var $author$project$Ui$fill = $author$project$Ui$Fill(1); 39351var $author$project$Internal$Style2$px = function (x) { 39352 return $elm$core$String$fromInt(x) + 'px'; 39353}; 39354var $author$project$Internal$Model2$styleAndClass = F2( 39355 function (flag, v) { 39356 return _List_fromArray( 39357 [ 39358 { 39359 g: { 39360 q: $author$project$Internal$BitField$none, 39361 ei: _List_Nil, 39362 f: $elm$core$Maybe$Just(v.f), 39363 j: _List_Nil, 39364 o: $author$project$Internal$Model2$NodeAsDiv, 39365 p: F2( 39366 function (_v0, _v1) { 39367 return _List_fromArray( 39368 [ 39369 _Utils_Tuple2(v.qz, v.qA) 39370 ]); 39371 }) 39372 }, 39373 h: flag 39374 } 39375 ]); 39376 }); 39377var $author$project$Ui$width = function (len) { 39378 switch (len.$) { 39379 case 2: 39380 return A2($author$project$Internal$Model2$classWith, $author$project$Internal$Flag$width, $author$project$Internal$Style2$classes.ri); 39381 case 0: 39382 var x = len.a; 39383 return A2( 39384 $author$project$Internal$Model2$styleAndClass, 39385 $author$project$Internal$Flag$width, 39386 { 39387 f: $author$project$Internal$Style2$classes.rj, 39388 qz: 'width', 39389 qA: $author$project$Internal$Style2$px(x) 39390 }); 39391 default: 39392 if (len.a === 1) { 39393 return A2($author$project$Internal$Model2$classWith, $author$project$Internal$Flag$width, $author$project$Internal$Style2$classes.k_); 39394 } else { 39395 var portionSize = len.a; 39396 return _List_fromArray( 39397 [ 39398 { 39399 g: { 39400 q: $author$project$Internal$BitField$none, 39401 ei: _List_Nil, 39402 f: $elm$core$Maybe$Just($author$project$Internal$Style2$classes.k_), 39403 j: _List_Nil, 39404 o: $author$project$Internal$Model2$NodeAsDiv, 39405 p: F2( 39406 function (inheritance, _v1) { 39407 return A2($author$project$Internal$BitField$has, $author$project$Internal$Bits$Inheritance$isRow, inheritance) ? _List_fromArray( 39408 [ 39409 A2( 39410 $elm$core$Tuple$pair, 39411 'flex-grow',
39412 $elm$core$String$fromInt(portionSize)) 39413 ]) : _List_Nil; 39414 }) 39415 }, 39416 h: $author$project$Internal$Flag$width 39417 } 39418 ]); 39419 } 39420 } 39421}; 39422var $author$project$Ui$column = F2( 39423 function (attrList, children) { 39424 return A4( 39425 $author$project$Internal$Model2$element, 39426 $author$project$Internal$Model2$NodeAsDiv, 39427 1, 39428 A2( 39429 $elm$core$List$cons, 39430 $author$project$Ui$width($author$project$Ui$fill), 39431 attrList), 39432 children); 39433 }); 39434var $author$project$UI$Theme$danger = { 39435 k3: A3($author$project$Ui$rgb, 196, 101, 90), 39436 k4: A3($author$project$Ui$rgb, 176, 85, 74), 39437 hG: A3($author$project$Ui$rgb, 216, 135, 125), 39438 h$: A3($author$project$Ui$rgb, 254, 246, 244), 39439 en: A3($author$project$Ui$rgb, 252, 234, 230), 39440 cR: A3($author$project$Ui$rgb, 160, 60, 48), 39441 kl: A3($author$project$Ui$rgb, 196, 101, 90), 39442 ql: A3($author$project$Ui$rgb, 216, 117, 106), 39443 cW: A3($author$project$Ui$rgb, 176, 85, 74), 39444 km: A3($author$project$Ui$rgb, 255, 255, 255), 39445 qI: A3($author$project$Ui$rgb, 160, 60, 48), 39446 aM: A3($author$project$Ui$rgb, 196, 101, 90), 39447 qR: A4($author$project$Ui$rgba, 196, 101, 90, 0.1), 39448 qS: A4($author$project$Ui$rgba, 196, 101, 90, 0.16), 39449 c0: A4($author$project$Ui$rgba, 196, 101, 90, 0.06) 39450}; 39451var $author$project$Internal$Model2$Options = $elm$core$Basics$identity; 39452var $author$project$Internal$Model2$defaultOptions = {cc: $elm$core$Maybe$Nothing, c9: $elm$core$Maybe$Nothing, eQ: true}; 39453var $author$project$Ui$default = $author$project$Internal$Model2$defaultOptions; 39454var $elm$virtual_dom$VirtualDom$Normal = function (a) { 39455 return {$: 0, a: a}; 39456}; 39457var $elm$virtual_dom$VirtualDom$on = _VirtualDom_on; 39458var $elm$html$Html$Events$on = F2( 39459 function (event, decoder) { 39460 return A2( 39461 $elm$virtual_dom$VirtualDom$on, 39462 event, 39463 $elm$virtual_dom$VirtualDom$Normal(decoder)); 39464 }); 39465var $elm$html$Html$Events$onClick = function (msg) { 39466 return A2( 39467 $elm$html$Html$Events$on, 39468 'click', 39469 $elm$json$Json$Decode$succeed(msg)); 39470}; 39471var $author$project$Internal$Model2$onPress = function (msg) { 39472 return _List_fromArray( 39473 [ 39474 { 39475 g: { 39476 q: $author$project$Internal$BitField$none, 39477 ei: _List_fromArray( 39478 [ 39479 $elm$html$Html$Events$onClick(msg) 39480 ]), 39481 f: $elm$core$Maybe$Just($author$project$Internal$Style2$classes.ma), 39482 j: _List_Nil, 39483 o: $author$project$Internal$Model2$NodeAsButton, 39484 p: $author$project$Internal$Model2$noStyles 39485 }, 39486 h: $author$project$Internal$Flag$skip 39487 } 39488 ]); 39489}; 39490var $author$project$Ui$Input$button = $author$project$Internal$Model2$onPress; 39491var $elm$virtual_dom$VirtualDom$attribute = F2( 39492 function (key, value) { 39493 return A2( 39494 _VirtualDom_attribute, 39495 _VirtualDom_noOnOrFormAction(key), 39496 _VirtualDom_noJavaScriptOrHtmlUri(value)); 39497 }); 39498var $elm$html$Html$Attributes$attribute = $elm$virtual_dom$VirtualDom$attribute; 39499var $author$project$Internal$Model2$attribute = function (a) { 39500 return _List_fromArray( 39501 [ 39502 { 39503 g: { 39504 q: $author$project$Internal$BitField$none, 39505 ei: _List_fromArray( 39506 [a]), 39507 f: $elm$core$Maybe$Nothing, 39508 j: _List_Nil, 39509 o: $author$project$Internal$Model2$NodeAsDiv, 39510 p: $author$project$Internal$Model2$noStyles 39511 }, 39512 h: $author$project$Internal$Flag$skip 39513 } 39514 ]); 39515}; 39516var $author$project$Ui$Accessibility$description = function (label) { 39517 return $author$project$Internal$Model2$attribute( 39518 A2($elm$html$Html$Attributes$attribute, 'aria-label', label)); 39519}; 39520var $author$project$Internal$Model2$AsEl = 2; 39521var $author$project$Ui$el = F2( 39522 function (attrList, child) { 39523 return A4( 39524 $author$project$Internal$Model2$element, 39525 $author$project$Internal$Model2$NodeAsDiv, 39526 2, 39527 A2( 39528 $elm$core$List$cons, 39529 $author$project$Ui$width($author$project$Ui$fill), 39530 attrList), 39531 _List_fromArray( 39532 [child])); 39533 }); 39534var $author$project$Ui$html = function (x) { 39535 return function (_v0) { 39536 return x; 39537 }; 39538}; 39539var $elm$svg$Svg$Attributes$stroke = _VirtualDom_attribute('stroke'); 39540var $elm$svg$Svg$Attributes$class = _VirtualDom_attribute('class'); 39541var $elm$svg$Svg$Attributes$fill = _VirtualDom_attribute('fill'); 39542var $elm$svg$Svg$Attributes$height = _VirtualDom_attribute('height'); 39543var $elm$virtual_dom$VirtualDom$map = _VirtualDom_map; 39544var $elm$svg$Svg$map = $elm$virtual_dom$VirtualDom$map; 39545var $elm$svg$Svg$Attributes$strokeLinecap = _VirtualDom_attribute('stroke-linecap'); 39546var $elm$svg$Svg$Attributes$strokeLinejoin = _VirtualDom_attribute('stroke-linejoin'); 39547var $elm$svg$Svg$Attributes$strokeWidth = _VirtualDom_attribute('stroke-width'); 39548var $elm$svg$Svg$svg = $elm$svg$Svg$trustedNode('svg'); 39549var $elm$svg$Svg$Attributes$viewBox = _VirtualDom_attribute('viewBox'); 39550var $elm$svg$Svg$Attributes$width = _VirtualDom_attribute('width'); 39551var $feathericons$elm_feather$FeatherIcons$toHtml = F2( 39552 function (attributes, _v0) { 39553 var src = _v0.aw; 39554 var attrs = _v0.ei; 39555 var strSize = $elm$core$String$fromFloat(attrs.dW); 39556 var baseAttributes = _List_fromArray( 39557 [ 39558 $elm$svg$Svg$Attributes$fill('none'), 39559 $elm$svg$Svg$Attributes$height( 39560 _Utils_ap(strSize, attrs.dX)), 39561 $elm$svg$Svg$Attributes$width( 39562 _Utils_ap(strSize, attrs.dX)), 39563 $elm$svg$Svg$Attributes$stroke('currentColor'),
39564 $elm$svg$Svg$Attributes$strokeLinecap('round'), 39565 $elm$svg$Svg$Attributes$strokeLinejoin('round'), 39566 $elm$svg$Svg$Attributes$strokeWidth( 39567 $elm$core$String$fromFloat(attrs.fx)), 39568 $elm$svg$Svg$Attributes$viewBox(attrs.fL) 39569 ]); 39570 var combinedAttributes = _Utils_ap( 39571 function () { 39572 var _v1 = attrs.f; 39573 if (!_v1.$) { 39574 var c = _v1.a; 39575 return A2( 39576 $elm$core$List$cons, 39577 $elm$svg$Svg$Attributes$class(c), 39578 baseAttributes); 39579 } else { 39580 return baseAttributes; 39581 } 39582 }(), 39583 attributes); 39584 return A2( 39585 $elm$svg$Svg$svg, 39586 combinedAttributes, 39587 A2( 39588 $elm$core$List$map, 39589 $elm$svg$Svg$map($elm$core$Basics$never), 39590 src)); 39591 }); 39592var $feathericons$elm_feather$FeatherIcons$withSize = F2( 39593 function (size, _v0) { 39594 var attrs = _v0.ei; 39595 var src = _v0.aw; 39596 return { 39597 ei: _Utils_update( 39598 attrs, 39599 {dW: size}), 39600 aw: src 39601 }; 39602 }); 39603var $author$project$UI$Components$featherIconColored = F3( 39604 function (strokeColor, size, icon) { 39605 return $author$project$Ui$html( 39606 A2( 39607 $feathericons$elm_feather$FeatherIcons$toHtml, 39608 _List_fromArray( 39609 [ 39610 $elm$svg$Svg$Attributes$stroke(strokeColor) 39611 ]), 39612 A2($feathericons$elm_feather$FeatherIcons$withSize, size, icon))); 39613 }); 39614var $author$project$Ui$htmlAttribute = function (a) { 39615 return $author$project$Internal$Model2$attribute(a); 39616}; 39617var $author$project$Ui$padding = function (x) { 39618 return A3( 39619 $author$project$Internal$Model2$styleWith, 39620 $author$project$Internal$Flag$padding, 39621 'padding', 39622 $elm$core$String$fromInt(x) + 'px'); 39623}; 39624var $author$project$Internal$Model2$class = function (cls) { 39625 return _List_fromArray( 39626 [ 39627 { 39628 g: { 39629 q: $author$project$Internal$BitField$none, 39630 ei: _List_Nil, 39631 f: $elm$core$Maybe$Just(cls), 39632 j: _List_Nil, 39633 o: $author$project$Internal$Model2$NodeAsDiv, 39634 p: $author$project$Internal$Model2$noStyles 39635 }, 39636 h: $author$project$Internal$Flag$skip 39637 } 39638 ]); 39639}; 39640var $author$project$Ui$pointer = $author$project$Internal$Model2$class($author$project$Internal$Style2$classes.ma); 39641var $author$project$UI$Theme$radius = {i8: 14, aW: 10, qk: 6, hE: 20, bb: 4, rn: 28, hF: 999}; 39642var $author$project$Ui$rounded = function (radius) { 39643 return A2( 39644 $author$project$Internal$Model2$style, 39645 'border-radius', 39646 $elm$core$String$fromInt(radius) + 'px'); 39647}; 39648var $author$project$UI$Theme$spacing = {i8: 16, aW: 12, qk: 8, hE: 24, bb: 4, rn: 32, hF: 48}; 39649var $author$project$Main$edgeTab = function (config) { 39650 return A2( 39651 $author$project$Ui$el, 39652 _List_fromArray( 39653 [ 39654 $author$project$Ui$Input$button(config.e7), 39655 $author$project$Ui$Accessibility$description(config.i6), 39656 $author$project$Ui$pointer, 39657 config.fU, 39658 $author$project$Ui$rounded($author$project$UI$Theme$radius.aW), 39659 $author$project$Ui$padding($author$project$UI$Theme$spacing.aW), 39660 $author$project$Ui$htmlAttribute( 39661 A2($elm$html$Html$Attributes$style, 'border-top-right-radius', '0')), 39662 $author$project$Ui$htmlAttribute( 39663 A2($elm$html$Html$Attributes$style, 'border-bottom-right-radius', '0')) 39664 ]), 39665 A3($author$project$UI$Components$featherIconColored, 'white', 20, config.gv)); 39666}; 39667var $author$project$Translations$errorLogOpenLabel = function (_v0) { 39668 var lang = _v0; 39669 if (!lang) { 39670 return 'Open error log'; 39671 } else { 39672 return 'Ouvrir le journal d\'erreurs'; 39673 } 39674}; 39675var $author$project$Translations$feedbackOpenLabel = function (_v0) { 39676 var lang = _v0; 39677 if (!lang) { 39678 return 'Send feedback'; 39679 } else { 39680 return 'Donner ton avis'; 39681 } 39682}; 39683var $author$project$UI$Theme$font = {i8: 18, aW: 16, qk: 13, hE: 22, bb: 11, rn: 28, hF: 32}; 39684var $author$project$Internal$Font$render = F2( 39685 function (faces, str) { 39686 render: 39687 while (true) { 39688 if (!faces.b) { 39689 return str; 39690 } else { 39691 switch (faces.a.$) { 39692 case 0: 39693 var _v1 = faces.a; 39694 var remain = faces.b; 39695 if (str === '') { 39696 var $temp$faces = remain, 39697 $temp$str = 'serif'; 39698 faces = $temp$faces; 39699 str = $temp$str; 39700 continue render; 39701 } else { 39702 var $temp$faces = remain, 39703 $temp$str = str + ', serif'; 39704 faces = $temp$faces; 39705 str = $temp$str; 39706 continue render; 39707 } 39708 case 1: 39709 var _v3 = faces.a; 39710 var remain = faces.b; 39711 if (str === '') { 39712 var $temp$faces = remain, 39713 $temp$str = 'sans-serif'; 39714 faces = $temp$faces; 39715 str = $temp$str; 39716 continue render; 39717 } else { 39718 var $temp$faces = remain, 39719 $temp$str = str + ', sans-serif'; 39720 faces = $temp$faces; 39721 str = $temp$str; 39722 continue render; 39723 } 39724 case 2: 39725 var _v5 = faces.a; 39726 var remain = faces.b; 39727 if (str === '') { 39728 var $temp$faces = remain, 39729 $temp$str = 'monospace'; 39730 faces = $temp$faces; 39731 str = $temp$str; 39732 continue render; 39733 } else { 39734 var $temp$faces = remain, 39735 $temp$str = str + ', monospace'; 39736 faces = $temp$faces; 39737 str = $temp$str; 39738 continue render; 39739 } 39740 default: 39741 var name = faces.a.a; 39742 var remain = faces.b; 39743 if (str === '') { 39744 var $temp$faces = remain, 39745 $temp$str = '\"' + (name + '\"'); 39746 faces = $temp$faces; 39747 str = $temp$str; 39748 continue render; 39749 } else { 39750 var $temp$faces = remain, 39751 $temp$str = str + (', \"' + (name + '\"')); 39752 faces = $temp$faces; 39753 str = $temp$str; 39754 continue render; 39755 } 39756 } 39757 } 39758 } 39759 }); 39760var $author$project$Ui$Font$family = function (typefaces) { 39761 return A2( 39762 $author$project$Internal$Model2$style, 39763 'font-family', 39764 A2($author$project$Internal$Font$render, typefaces, '')); 39765}; 39766var $author$project$Internal$Font$SansSerif = {$: 1}; 39767var $author$project$Ui$Font$sansSerif = $author$project$Internal$Font$SansSerif; 39768var $author$project$Internal$Font$Typeface = function (a) { 39769 return {$: 3, a: a}; 39770}; 39771var $author$project$Ui$Font$typeface = $author$project$Internal$Font$Typeface; 39772var $author$project$UI$Theme$fontFamily = $author$project$Ui$Font$family( 39773 _List_fromArray( 39774 [ 39775 $author$project$Ui$Font$typeface('Inter'), 39776 $author$project$Ui$Font$typeface('-apple-system'), 39777 $author$project$Ui$Font$typeface('BlinkMacSystemFont'), 39778 $author$project$Ui$Font$typeface('Segoe UI'), 39779 $author$project$Ui$Font$typeface('system-ui'), 39780 $author$project$Ui$Font$sansSerif 39781 ])); 39782var $author$project$Internal$Model2$InFront = 4; 39783var $author$project$Internal$Model2$nearby = F2( 39784 function (loc, el) { 39785 return _List_fromArray( 39786 [ 39787 { 39788 g: { 39789 q: $author$project$Internal$BitField$none, 39790 ei: _List_Nil, 39791 f: $elm$core$Maybe$Nothing, 39792 j: _List_fromArray( 39793 [ 39794 _Utils_Tuple2(loc, el) 39795 ]), 39796 o: $author$project$Internal$Model2$NodeAsDiv, 39797 p: $author$project$Internal$Model2$noStyles 39798 }, 39799 h: $author$project$Internal$Flag$skip 39800 } 39801 ]); 39802 }); 39803var $author$project$Ui$inFront = function (element) { 39804 return A2($author$project$Internal$Model2$nearby, 4, element); 39805}; 39806var $author$project$Internal$Model2$AsRoot = 6; 39807var $elm$html$Html$Attributes$id = $elm$html$Html$Attributes$stringProperty('id'); 39808var $elm$virtual_dom$VirtualDom$text = _VirtualDom_text; 39809var $elm$html$Html$text = $elm$virtual_dom$VirtualDom$text; 39810var $author$project$Internal$Model2$keyframeRules = function (styleStr) { 39811 return A2( 39812 $elm$html$Html$div, 39813 _List_fromArray( 39814 [ 39815 $elm$html$Html$Attributes$id('elm-ui-keyframe-rules') 39816 ]), 39817 _List_fromArray( 39818 [ 39819 A3( 39820 $elm$html$Html$node, 39821 'style', 39822 _List_Nil, 39823 _List_fromArray( 39824 [ 39825 $elm$html$Html$text( 39826 A2($elm$core$String$join, '\n', styleStr)) 39827 ])) 39828 ])); 39829}; 39830var $elm$virtual_dom$VirtualDom$lazy = _VirtualDom_lazy; 39831var $elm$html$Html$Lazy$lazy = $elm$virtual_dom$VirtualDom$lazy; 39832var $elm$virtual_dom$VirtualDom$keyedNode = function (tag) { 39833 return _VirtualDom_keyedNode( 39834 _VirtualDom_noScript(tag)); 39835}; 39836var $elm$html$Html$Keyed$node = $elm$virtual_dom$VirtualDom$keyedNode; 39837var $author$project$Internal$Model2$Teleported = F2( 39838 function (a, b) { 39839 return {$: 1, a: a, b: b}; 39840 }); 39841var $author$project$Internal$Teleport$Event = F2( 39842 function (timestamp, data) { 39843 return {f8: data, kD: timestamp}; 39844 }); 39845var $author$project$Internal$Teleport$ParentTrigger = function (a) { 39846 return {$: 1, a: a}; 39847}; 39848var $author$project$Internal$Teleport$ParentTriggerDetails = F3( 39849 function (trigger, identifierClass, children) { 39850 return {lR: children, eP: identifierClass, a2: trigger}; 39851 }); 39852var $author$project$Internal$Teleport$CssAnimation = F6( 39853 function (trigger, hash, keyframesHash, keyframes, transition, props) { 39854 return {iR: hash, $7: keyframes, eV: keyframesHash, fi: props, kM: transition, a2: trigger}; 39855 }); 39856var $author$project$Internal$Teleport$decodeProp = A3( 39857 $elm$json$Json$Decode$map2, 39858 F2( 39859 function (key, value) { 39860 return _Utils_Tuple2(key, value); 39861 }), 39862 A2($elm$json$Json$Decode$field, 'key', $elm$json$Json$Decode$string), 39863 A2($elm$json$Json$Decode$field, 'value', $elm$json$Json$Decode$string)); 39864var $author$project$Internal$Teleport$decodeCss = A7( 39865 $elm$json$Json$Decode$map6, 39866 $author$project$Internal$Teleport$CssAnimation, 39867 A2($elm$json$Json$Decode$field, 'trigger', $elm$json$Json$Decode$string), 39868 A2($elm$json$Json$Decode$field, 'hash', $elm$json$Json$Decode$string), 39869 A2($elm$json$Json$Decode$field, 'keyframesHash', $elm$json$Json$Decode$string), 39870 A2($elm$json$Json$Decode$field, 'keyframes', $elm$json$Json$Decode$string), 39871 A2($elm$json$Json$Decode$field, 'transition', $elm$json$Json$Decode$string), 39872 A2( 39873 $elm$json$Json$Decode$field, 39874 'props', 39875 $elm$json$Json$Decode$list($author$project$Internal$Teleport$decodeProp))); 39876var $author$project$Internal$Teleport$reactionPropertyName = function (identifier) { 39877 return 'data-elm-ui-reaction-' + identifier; 39878}; 39879var $author$project$Internal$Teleport$decodeTriggeredChild = function (identifier) { 39880 return $elm$json$Json$Decode$oneOf( 39881 _List_fromArray( 39882 [ 39883 A2( 39884 $elm$json$Json$Decode$field, 39885 $author$project$Internal$Teleport$reactionPropertyName(identifier), 39886 $elm$json$Json$Decode$list($author$project$Internal$Teleport$decodeCss)), 39887 $elm$json$Json$Decode$succeed(_List_Nil) 39888 ])); 39889}; 39890var $author$project$Internal$Teleport$decodeCssChildren = function (identifier) { 39891 return A2( 39892 $elm$json$Json$Decode$andThen, 39893 function (triggeredChildren) { 39894 if (!triggeredChildren.b) { 39895 return A3( 39896 $elm$json$Json$Decode$map2, 39897 $elm$core$Basics$append, 39898 A2( 39899 $elm$json$Json$Decode$field, 39900 'nextElementSibling', 39901 $elm$json$Json$Decode$oneOf( 39902 _List_fromArray( 39903 [ 39904 $elm$json$Json$Decode$null(_List_Nil), 39905 $elm$json$Json$Decode$lazy( 39906 function (_v1) { 39907 return $author$project$Internal$Teleport$decodeCssChildren(identifier); 39908 }) 39909 ]))), 39910 A2( 39911 $elm$json$Json$Decode$field, 39912 'firstElementChild', 39913 $elm$json$Json$Decode$oneOf( 39914 _List_fromArray( 39915 [ 39916 $elm$json$Json$Decode$null(_List_Nil), 39917 $elm$json$Json$Decode$lazy( 39918 function (_v2) { 39919 return $author$project$Internal$Teleport$decodeCssChildren(identifier); 39920 }) 39921 ])))); 39922 } else { 39923 var nonEmpty = triggeredChildren; 39924 return A2( 39925 $elm$json$Json$Decode$map, 39926 function (next) { 39927 return _Utils_ap(nonEmpty, next); 39928 }, 39929 A2( 39930 $elm$json$Json$Decode$field, 39931 'nextElementSibling', 39932 $elm$json$Json$Decode$oneOf( 39933 _List_fromArray( 39934 [ 39935 $elm$json$Json$Decode$null(_List_Nil), 39936 $elm$json$Json$Decode$lazy( 39937 function (_v3) { 39938 return $author$project$Internal$Teleport$decodeCssChildren(identifier); 39939 }) 39940 ])))); 39941 } 39942 }, 39943 $author$project$Internal$Teleport$decodeTriggeredChild(identifier)); 39944}; 39945var $author$project$Internal$Teleport$Css = function (a) { 39946 return {$: 0, a: a}; 39947}; 39948var $author$project$Internal$Teleport$decodeCssData = A2( 39949 $elm$json$Json$Decode$andThen, 39950 function (str) { 39951 if (str === 'css') { 39952 return A2($elm$json$Json$Decode$map, $author$project$Internal$Teleport$Css, $author$project$Internal$Teleport$decodeCss); 39953 } else { 39954 return $elm$json$Json$Decode$fail('Unknown type: ' + str); 39955 } 39956 }, 39957 A2($elm$json$Json$Decode$field, 'type', $elm$json$Json$Decode$string)); 39958var $author$project$Internal$Teleport$decode = A3( 39959 $elm$json$Json$Decode$map2, 39960 $author$project$Internal$Teleport$Event, 39961 A2($elm$json$Json$Decode$field, 'timeStamp', $elm$json$Json$Decode$float), 39962 $elm$json$Json$Decode$oneOf( 39963 _List_fromArray( 39964 [ 39965 A2( 39966 $elm$json$Json$Decode$field, 39967 'target', 39968 A2( 39969 $elm$json$Json$Decode$field, 39970 'data-elm-ui', 39971 $elm$json$Json$Decode$list($author$project$Internal$Teleport$decodeCssData))), 39972 A2( 39973 $elm$json$Json$Decode$field, 39974 'target', 39975 A2( 39976 $elm$json$Json$Decode$andThen, 39977 function (idents) { 39978 return A2( 39979 $elm$json$Json$Decode$map, 39980 function (cssChildren) { 39981 return _List_fromArray( 39982 [ 39983 $author$project$Internal$Teleport$ParentTrigger( 39984 A3($author$project$Internal$Teleport$ParentTriggerDetails, idents.a2, idents.eP, cssChildren)) 39985 ]); 39986 }, 39987 A2( 39988 $elm$json$Json$Decode$field, 39989 'parentNode', 39990 $author$project$Internal$Teleport$decodeCssChildren(idents.eP))); 39991 }, 39992 A2( 39993 $elm$json$Json$Decode$field, 39994 'data-elm-ui', 39995 A3( 39996 $elm$json$Json$Decode$map2, 39997 F2( 39998 function (trigger, identifierClass) { 39999 return {eP: identifierClass, a2: trigger}; 40000 }), 40001 A2($elm$json$Json$Decode$field, 'trigger', $elm$json$Json$Decode$string), 40002 A2($elm$json$Json$Decode$field, 'identifierClass', $elm$json$Json$Decode$string))))) 40003 ]))); 40004var $author$project$Internal$Teleport$OnFocusWithin = 3; 40005var $author$project$Internal$Teleport$OnHover = 0; 40006var $author$project$Internal$Teleport$OnRender = 1; 40007var $author$project$Internal$Teleport$stringToTrigger = function (str) { 40008 switch (str) { 40009 case 'on-rendered': 40010 return $elm$core$Maybe$Just(1); 40011 case 'on-focused': 40012 return $elm$core$Maybe$Just(1); 40013 case 'on-hovered': 40014 return $elm$core$Maybe$Just(0); 40015 case 'on-focused-within': 40016 return $elm$core$Maybe$Just(3); 40017 default: 40018 return $elm$core$Maybe$Nothing; 40019 } 40020}; 40021var $author$project$Internal$Model2$onAnimationStart = function (onMsg) { 40022 return $author$project$Internal$Model2$attribute( 40023 A2( 40024 $elm$html$Html$Events$on, 40025 'animationstart', 40026 A2( 40027 $elm$json$Json$Decode$andThen, 40028 function (name) { 40029 var _v0 = $author$project$Internal$Teleport$stringToTrigger(name); 40030 if (!_v0.$) { 40031 var trigger = _v0.a; 40032 return A2( 40033 $elm$json$Json$Decode$map, 40034 A2( 40035 $elm$core$Basics$composeL, 40036 onMsg, 40037 $author$project$Internal$Model2$Teleported(trigger)), 40038 $author$project$Internal$Teleport$decode); 40039 } else { 40040 return $elm$json$Json$Decode$fail('Nonmatching animation'); 40041 } 40042 }, 40043 A2($elm$json$Json$Decode$field, 'animationName', $elm$json$Json$Decode$string)))); 40044}; 40045var $author$project$Internal$Teleport$OnDismount = 5; 40046var $author$project$Internal$Model2$onAnimationUnmount = function (onMsg) { 40047 return $author$project$Internal$Model2$attribute( 40048 A2( 40049 $elm$html$Html$Events$on, 40050 'animationcancel', 40051 A2( 40052 $elm$json$Json$Decode$andThen, 40053 function (name) { 40054 return (name === 'on-dismount') ? A2( 40055 $elm$json$Json$Decode$map, 40056 A2( 40057 $elm$core$Basics$composeL, 40058 onMsg, 40059 $author$project$Internal$Model2$Teleported(5)), 40060 $author$project$Internal$Teleport$decode) : $elm$json$Json$Decode$fail('Nonmatching animation'); 40061 }, 40062 A2($elm$json$Json$Decode$field, 'animationName', $elm$json$Json$Decode$string)))); 40063}; 40064var $author$project$Internal$Model2$maxWidth = function (_int) { 40065 return '(max-width:' + ($elm$core$String$fromInt(_int) + 'px)'); 40066}; 40067var $author$project$Internal$Model2$renderMediaProps = function (i) { 40068 return (':root {--ui-bp-' + ($elm$core$String$fromInt(i) + ': 1;}')) + (('.s.ui-bp-' + ($elm$core$String$fromInt(i) + '-hidden {display:none !important;}')) + ('.s.r.ui-bp-' + ($elm$core$String$fromInt(i) + '-as-col {flex-direction: column; align-content: flex-start;}'))); 40069}; 40070var $author$project$Internal$Model2$maxWidthMediaQuery = F2( 40071 function (i, upperBound) { 40072 return '@media ' + ($author$project$Internal$Model2$maxWidth(upperBound) + (' { ' + ($author$project$Internal$Model2$renderMediaProps(i) + ' }'))); 40073 }); 40074var $au
40074thor$project$Internal$Model2$renderResponsiveCssVars = F3( 40075 function (i, lower, upper) { 40076 return ('--ui-bp-' + ($elm$core$String$fromInt(i) + ': 0;')) + (('--ui-bp-' + ($elm$core$String$fromInt(i) + ('-lower: ' + ($elm$core$String$fromInt(lower) + 'px;')))) + (('--ui-bp-' + ($elm$core$String$fromInt(i) + ('-upper: ' + ($elm$core$String$fromInt(upper) + 'px;')))) + ('--ui-bp-' + ($elm$core$String$fromInt(i) + ('-progress: calc(calc(100vw - ' + ($elm$core$String$fromInt(lower) + ('px) / ' + ($elm$core$String$fromInt(upper - lower) + ');')))))))); 40077 }); 40078var $author$project$Internal$Model2$minWidth = function (_int) { 40079 return '(min-width:' + ($elm$core$String$fromInt(_int + 1) + 'px)'); 40080}; 40081var $author$project$Internal$Model2$minWidthMediaQuery = F2( 40082 function (i, lowerBound) { 40083 return '@media' + ($author$project$Internal$Model2$minWidth(lowerBound) + (' { ' + ($author$project$Internal$Model2$renderMediaProps(i) + ' }'))); 40084 }); 40085var $author$project$Internal$Model2$renderBoundedMediaQuery = F3( 40086 function (upper, lower, i) { 40087 return '@media ' + ($author$project$Internal$Model2$minWidth(lower) + (' and ' + ($author$project$Internal$Model2$maxWidth(upper) + (' { ' + ($author$project$Internal$Model2$renderMediaProps(i) + ' }'))))); 40088 }); 40089var $author$project$Internal$Model2$toBoundedMediaQuery = F3( 40090 function (breaks, i, rendered) { 40091 toBoundedMediaQuery: 40092 while (true) { 40093 if (!breaks.b) { 40094 return rendered; 40095 } else { 40096 if (!breaks.b.b) { 40097 var upper = breaks.a; 40098 return _Utils_ap( 40099 rendered, 40100 A2($author$project$Internal$Model2$minWidthMediaQuery, i, upper)); 40101 } else { 40102 var lower = breaks.a; 40103 var tail = breaks.b; 40104 var upper = tail.a; 40105 var $temp$breaks = tail, 40106 $temp$i = i + 1, 40107 $temp$rendered = _Utils_ap( 40108 rendered, 40109 A3($author$project$Internal$Model2$renderBoundedMediaQuery, upper, lower, i)); 40110 breaks = $temp$breaks; 40111 i = $temp$i; 40112 rendered = $temp$rendered; 40113 continue toBoundedMediaQuery; 40114 } 40115 } 40116 } 40117 }); 40118var $author$project$Internal$Model2$toRoot = F3( 40119 function (breaks, i, rendered) { 40120 toRoot: 40121 while (true) { 40122 if (!breaks.b) { 40123 return rendered; 40124 } else { 40125 if (!breaks.b.b) { 40126 var upper = breaks.a; 40127 return _Utils_ap( 40128 rendered, 40129 A3($author$project$Internal$Model2$renderResponsiveCssVars, i, upper, upper + 1000)); 40130 } else { 40131 var lower = breaks.a; 40132 var tail = breaks.b; 40133 var upper = tail.a; 40134 var $temp$breaks = tail, 40135 $temp$i = i + 1, 40136 $temp$rendered = _Utils_ap( 40137 rendered, 40138 A3($author$project$Internal$Model2$renderResponsiveCssVars, i, lower, upper)); 40139 breaks = $temp$breaks; 40140 i = $temp$i; 40141 rendered = $temp$rendered; 40142 continue toRoot; 40143 } 40144 } 40145 } 40146 }); 40147var $author$project$Internal$Model2$toMediaQuery = function (breaks) { 40148 if (!breaks.b) { 40149 return $elm$html$Html$text(''); 40150 } else { 40151 var lowerBound = breaks.a; 40152 var remain = breaks.b; 40153 return $elm$html$Html$text( 40154 ':root {' + (A3( 40155 $author$project$Internal$Model2$toRoot, 40156 breaks, 40157 1, 40158 A3($author$project$Internal$Model2$renderResponsiveCssVars, 0, 0, lowerBound)) + (' }' + A3( 40159 $author$project$Internal$Model2$toBoundedMediaQuery, 40160 breaks, 40161 1, 40162 A2($author$project$Internal$Model2$maxWidthMediaQuery, 0, lowerBound))))); 40163 } 40164}; 40165var $author$project$Internal$Model2$renderOptions = function (opts) { 40166 var _v0 = opts.c9; 40167 if (_v0.$ === 1) { 40168 return $elm$html$Html$text(''); 40169 } else { 40170 var breakpoints = _v0.a; 40171 return A2( 40172 $elm$html$Html$div, 40173 _List_fromArray( 40174 [ 40175 $elm$html$Html$Attributes$id('elm-ui-responsiveness') 40176 ]), 40177 _List_fromArray( 40178 [ 40179 A3( 40180 $elm$html$Html$node, 40181 'style', 40182 _List_Nil, 40183 _List_fromArray( 40184 [ 40185 $author$project$Internal$Model2$toMediaQuery(breakpoints) 40186 ])) 40187 ])); 40188 } 40189}; 40190var $author$project$Internal$Style$Generated$stylesheet = 'input[type="search"],\ninput[type="search"]::-webkit-search-decoration,\ninput[type="search"]::-webkit-search-cancel-button,\ninput[type="search"]::-webkit-search-results-button,\ninput[type="search"]::-webkit-search-results-decoration {\n -webkit-appearance:none;\n}\ninput[type=range].sldr {\n -webkit-appearance: none;\n background: transparent;\n opacity: 0;\n}\n \ninput[type=range].sldr::-moz-range-track {\n background: transparent;\n}\ninput[type=range].sldr::-ms-track {\n background: transparent;\n}\ninput[type=range].sldr::-webkit-slider-runnable-track {\n background: transparent;\n}\n @keyframes show-redraw { 0% { background-color:red; }}@keyframes on-hovered { from {} to {} }\n@keyframes on-focused { from {} to {} }\n@keyframes on-activated { from {} to {} }\n@keyframes on-rendered { from {} to {} }\n@keyframes on-dismount { from {} to {} }html,body{height:100%;padding:0;margin:0;}.irs{appearance:none;-webkit-appearance:none;-moz-appearance:none;}.s.e.ic{display:block;object-fit:cover;width:max-content;}.s:focus{outline:none;}
40190.explain{outline:6px solid rgb(174, 121, 15) !important;}.explain > .s{outline:4px dashed rgb(0, 151, 167) !important;}.explain *{animation:show-redraw 0.4s ease;}.elm-ui-root{width:100%;height:auto;min-height:100%;font-size:16px;font-family:"Open Sans", sans-serif;line-height:1.4;}.elm-ui-root{position:relative;z-index:0;}.elm-ui-root.s.hf{height:100%;}.elm-ui-root.s.hf > .hf{height:100%;}.elm-ui-root > .fr.nb{position:fixed;z-index:20;}.hnb{position:relative;}.hnb > .s{position:relative;}li.s.e{display:list-item;}.ui-trigger{position:absolute;}.nb{position:relative;border:none;display:flex;flex-direction:row;flex-basis:auto;border-radius:inherit;}.nb.e{display:flex;flex-direction:column;}.nb.e.hbh{z-index:0;}.nb.e.hbh > .bh{z-index:-1;}.nb.e > .hc{height:auto;}.nb.e > .hf{flex-grow:1;max-height:100%;}.nb.e > .he{flex-shrink:0;}.nb.e > .wf:not(.ar, .al, .cx){width:100%;}.nb.e > .wf.wb{width:100%;}.nb.e > .wc{align-self:flex-start;}.nb.e.ccx{align-items:center;}.nb.e > .s.cx{align-self:center;}.nb.e.ccy{justify-content:center;}.nb.e > .s.cy{margin-top:auto !important;margin-bottom:auto !important;}.nb.e.ct{justify-content:flex-start;}.nb.e > .s.at{margin-bottom:auto !important;margin-top:0 !important;}.nb.e.cb{justify-content:flex-end;}.nb.e > .s.ab{margin-top:auto !important;margin-bottom:0 !important;}.nb.e.cr{align-items:flex-end;}.nb.e > .s.ar{align-self:flex-end;}.nb.e.cl{align-items:flex-start;}.nb.e > .s.al{align-self:flex-start;}.nb.a{position:absolute;bottom:100%;left:0;width:100%;z-index:20;margin:0 !important;pointer-events:none;}.nb.a > .hf{height:auto;}.nb.a > .wf:not(.ar, .al, .cx){width:100%;}.nb.a > *{pointer-events:auto;}.nb.b{position:absolute;bottom:0;left:0;height:0;width:100%;z-index:20;margin:0 !important;pointer-events:none;}.nb.b > *{pointer-events:auto;}.nb.b > .hf{height:auto;}.nb.or{position:absolute;left:100%;top:0;height:100%;margin:0 !important;z-index:20;pointer-events:none;}.nb.or > *{pointer-events:auto;}.nb.ol{position:absolute;right:100%;top:0;height:100%;margin:0 !important;z-index:20;pointer-events:none;}.nb.ol > *{pointer-events:auto;}.nb.fr{position:absolute;width:100%;height:100%;left:0;top:0;margin:0 !important;pointer-events:none;}.nb.fr > *{pointer-events:auto;}.nb.bh{position:absolute;width:100%;height:100%;left:0;top:0;margin:0 !important;z-index:0;pointer-events:none;}.nb.bh > *{pointer-events:auto;}.e{flex:0 0 0px;align-items:flex-start;min-height:min-content;display:flex;flex-direction:column;}.e.we{flex-shrink:0;}button.s{background-color:transparent;text-align:start;}.s{border:none;flex-shrink:1;flex-basis:auto;display:flex;flex-direction:row;resize:none;box-sizing:border-box;margin:0;padding:0;border-width:0;border-style:solid;min-width:0;font-size:inherit;color:inherit;font-family:inherit;font-weight:inherit;font-feature-settings:inherit;text-decoration:none;font-style:inherit;}.s.on-hovered:hover > .ui-trigger{animation:on-hovered 1ms;}.s.on-focused:focus > .ui-trigger{animation:on-focused 1ms;}.s.on-focused-within:focus-within > .ui-trigger{animation:on-focused 1ms;}.s.on-activated:active > .ui-trigger{animation:on-activated 1ms;}.s.on-rendered > .ui-trigger{animation:on-rendered 1ms;}.s.on-dismount > .ui-trigger{animation:on-dismount 31449600s;}.s.stick-top{position:sticky;top:0;}.s.stick-bottom{position:sticky;bottom:-1px;}.s.stick-left{position:sticky;left:0;}.s.tgrd{-webkit-background-clip:text;-webkit-text-fill-color:transparent;}.s.f-adj{font-size:calc(1em * var(--font-size-factor));}.s.ellip .t{text-overflow:ellipsis;white-space:nowrap;overflow:hidden;}.s.notxt{user-select:none;}.s.cptr{cursor:pointer;}.s.grab{cursor:grab;}.s.grabbing{cursor:grabbing;}.s.ctxt{cursor:text;}.s.ppe{pointer-events:none !important;}.s.cpe{pointer-events:auto !important;}.s.clr{opacity:0;}.s.oq{opacity:1;}.s.hvclr:hover{opacity:0;}.s.hvoq:hover{opacity:1;}.s.fcsclr:focus{opacity:0;}.s.fcsoq:focus{opacity:1;}.s.atvclr:active{opacity:0;}.s.atvoq:active{opacity:1;}.s.ts{transition:transform 160ms, opacity 160ms, filter 160ms, background-color 160ms, color 160ms, font-size 160ms;}.s.sb{overflow:auto;flex-shrink:1;}.s.sb.c{flex-shrink:1;flex-basis:auto;}.s.sb.e{flex-shrink:1;flex-basis:auto;}.s.sbx{overflow-x:auto;}.s.sbx.r{flex-shrink:1;}.s.sby{overflow-y:auto;}.s.sby.c{flex-shrink:1;flex-basis:auto;}.s.sby.e{flex-shrink:1;flex-basis:auto;}.s.cp{overflow:hidden;}.s.cpx{overflow-x:hidden;}.s.cpy{overflow-y:hidden;}.s.wc{width:auto;}.s.t{display:inline-block;max-width:100%;}.s.e{display:flex;flex-direction:column;}.s.e.hbh{z-index:0;}.s.e.hbh > .bh{z-index:-1;}.s.e > .hc{height:auto;}.s.e > .hf{flex-grow:1;max-height:100%;}.s.e > .he{flex-shrink:0;}.s.e > .wf:not(.ar, .al, .cx){width:100%;}.s.e > .wf.wb{width:100%;}.s.e > .wc{align-self:flex-start;}.s.e.ccx{align-items:center;}.s.e > .s.cx{align-self:center;}.s.e.ccy{justify-content:center;}.s.e > .s.cy{margin-top:auto !important;margin-bottom:auto !important;}.s.e.ct{justify-content:flex-start;}.s.e > .s.at{margin-bottom:auto !important;margin-top:0 !important;}.s.e.cb{justify-content:flex-end;}.s.e > .s.ab{margin-top:auto !important;margin-bottom:0 !important;}.s.e.cr{align-items:flex-end;}.s.e > .s.ar{align-self:flex-end;}.s.e.cl{align-items:flex-start;}.s.e > .s.al{align-self:flex-start;}.s.r{display:flex;flex-direction:row;align-items:center;}.s.r.wf:not(.ar, .al, .cx) > .wf:not(.ar, .al, .cx){flex-basis:0%;}.s.r > .s{flex-basis:auto;flex-shrink:1;}.s.r > .s.wf:not(.ar, .al, .cx){flex-grow:1;}.s.r > .s.wf:has(> :where(.we, .wb)){min-width:min-content;}.s.r > .s.cp.wf:not(.ar, .al, .cx){min-width:auto;}.s.r > .s.cpx.wf:not(.ar, .al, .cx){min-width:auto;}.s.r > .s.we{flex-shrink:0;}.s.r > .hf:not(.at, .ab, .cy, .hb){align-self:stretch;}.s.r > .hf.hb{height:max(2000px, 100vh);}.s.r.ccx{justify-content:center;}.s.r > .s.cx{margin:0 auto;}.s.r.ccy{align-items:center;}.s.r > .s.cy{margin:auto 0;}.s.r.ct{align-items:flex-start;}.s.r > .s.at{margin-bottom:auto;}.s.r.cb{align-items:flex-end;}.s.r > .s.ab{margin-top:auto;}.s.r.cr{justify-content:flex-end;}.s.r > .s.ar{margin-left:auto;}.s.r.cl{justify-content:flex-start;}.s.r > .s.al{margin-right:auto;}.s.r.sev{justify-content:space-between;}.s.r.lbl{align-items:baseline;}.s.c{display:flex;flex-direction:column;align-content:flex-start;}.s.c.we{flex-shrink:0;}.s.c > .s{min-height:min-content;}.s.c > .s.he{flex-basis:auto;flex-shrink:0;}.s.c > .s.cp{flex-basis:auto;}.s.c > .s.sb{flex-basis:auto;}.s.c > .s.wb.wf{width:100%;}.s.c > .hf{flex-grow:1;max-height:100%;}.s.c > .wf:not(.ar, .al, .cx){width:100%;}.s.c > .wc{align-self:flex-start;}.s.c.ccx{align-items:center;}.s.c > .s.cx{align-self:center;}.s.c.ccy{justify-content:center;}.s.c > .s.cy{margin:auto 0;}.s.c.ct{justify-content:flex-start;}.s.c > .s.at{margin-bottom:auto;}.s.c.cb{justify-content:flex-end;}.s.c > .s.ab{margin-top:auto;}.s.c.cr{align-items:flex-end;}.s.c > .s.ar{align-self:flex-end;}.s.c.cl{align-items:flex-start;}.s.c > .s.al{align-self:flex-start;}.s.c.sev{justify-content:space-between;}
40190.s.g{display:-ms-grid;display:grid;}.s.g > .gp > .s{width:100%;}.s.g > .s.cx{align-items:center;}.s.g > .s.cy{justify-content:center;}.s.g > .s.at{justify-content:flex-start;}.s.g > .s.ab{justify-content:flex-end;}.s.g > .s.ar{align-items:flex-end;}.s.g > .s.al{align-items:flex-start;}.s.pg{display:block;}.s.pg > .s:first-child{margin:0 !important;}.s.pg > .s.al:first-child + .s{margin:0 !important;}.s.pg > .s.ar:first-child + .s{margin:0 !important;}.s.pg > .s.ar{float:right;}.s.pg > .s.ar::after{content:"";display:table;clear:both;}.s.pg > .s.al{float:left;}.s.pg > .s.al::after{content:"";display:table;clear:both;}.s.iml{white-space:pre-wrap !important;height:100%;width:100%;background-color:transparent !important;border-color:transparent !important;}.s.implw.e{flex-basis:auto;}.s.imlp{white-space:pre-wrap !important;cursor:text;}.s.imlp > .imlf{white-space:pre-wrap !important;color:transparent;}.s.p{display:block;overflow-wrap:break-word;}.s.p .t{display:inline;}.s.p .t::after{content:none;}.s.p .t::before{content:none;}.s.p::after{content:" ";margin-top:calc((1lh - 1cap) / -2);display:table;}.s.p::before{content:" ";margin-bottom:calc((1lh - 1cap) / -2);display:table;}.s.p.hbh{z-index:0;}.s.p.hbh > .bh{z-index:-1;}.s.p .t{display:inline;}.s.p > .p{display:inline;}.s.p > .p::after{content:none;}.s.p > .p::before{content:none;}.s.p .e{display:inline;}.s.p .e.we{display:inline-block;}.s.p .e.nb{display:flex;}.s.p .e > .t{display:inline;}.s.p > .r{display:inline;}.s.p > .c{display:inline-flex;}.s.p > .g{display:inline-grid;}.s.p > .s.ar{float:right;}.s.p > .s.al{float:left;}.s.hidden{display:none;}.s.tj{text-align:justify;}.s.tja{text-align:justify-all;}.s.tc{text-align:center;align-items:center;}.s.tr{text-align:end;align-items:flex-end;}.s.tl{text-align:start;}.s.i{font-style:italic;}.s.sk{text-decoration:line-through;}.s.u{text-decoration:underline;text-decoration-skip-ink:auto;text-decoration-skip:ink;}.s.u.sk{text-decoration:line-through underline;text-decoration-skip-ink:auto;text-decoration-skip:ink;}.itp{padding:0 !important;border-width:0 !important;transform:none;}.it{background-color:rgba(255,255,255,0);}.sldr{flex:none;flex-direction:unset;padding:0;margin:0;}input[type="range"].sldr::-moz-range-thumb{width:16px;height:16px;}input[type="range"].sldr::-webkit-slider-thumb{width:16px;height:16px;}input[type="range"].sldr::-ms-thumb{width:16px;height:16px;}'; 40191var $author$project$Internal$Style2$rules = $author$project$Internal$Style$Generated$stylesheet; 40192var $author$project$Internal$Model2$staticStyles = A2( 40193 $elm$html$Html$div, 40194 _List_fromArray( 40195 [ 40196 $elm$html$Html$Attributes$id('elm-ui-static-styles') 40197 ]), 40198 _List_fromArray( 40199 [ 40200 A3( 40201 $elm$html$Html$node, 40202 'style', 40203 _List_Nil, 40204 _List_fromArray( 40205 [ 40206 $elm$html$Html$text($author$project$Internal$Style2$rules) 40207 ])) 40208 ])); 40209var $author$project$Internal$Model2$styleRules = function (styleStr) { 40210 return A2( 40211 $elm$html$Html$div, 40212 _List_fromArray( 40213 [ 40214 $elm$html$Html$Attributes$id('elm-ui-dynamic-styles') 40215 ]), 40216 _List_fromArray( 40217 [ 40218 A3( 40219 $elm$html$Html$node, 40220 'style', 40221 _List_Nil, 40222 _List_fromArray( 40223 [ 40224 $elm$html$Html$text( 40225 A2($elm$core$String$join, '\n', styleStr)) 40226 ])) 40227 ])); 40228}; 40229var $author$project$Internal$Model2$zero = $author$project$Internal$BitField$init; 40230var $author$project$Internal$Model2$renderLayout = F3( 40231 function (_v0, attrList, content) { 40232 var options = _v0; 40233 var _v1 = A4( 40234 $author$project$Internal$Model2$element, 40235 $author$project$Internal$Model2$NodeAsDiv, 40236 6, 40237 function () { 40238 var _v2 = options.cc; 40239 if (_v2.$ === 1) { 40240 return attrList; 40241 } else { 40242 var anim = _v2.a; 40243 return A2( 40244 $elm$core$List$cons, 40245 $author$project$Internal$Model2$onAnimationStart(anim.d3), 40246 A2( 40247 $elm$core$List$cons, 40248 $author$project$Internal$Model2$onAnimationUnmount(anim.d3), 40249 attrList)); 40250 } 40251 }(), 40252 _List_fromArray( 40253 [ 40254 function (_v3) { 40255 return A3( 40256 $elm$html$Html$Keyed$node, 40257 'div', 40258 _List_Nil, 40259 _List_fromArray( 40260 [ 40261 _Utils_Tuple2( 40262 'options', 40263 A2($elm$html$Html$Lazy$lazy, $author$project$Internal$Model2$renderOptions, options)), 40264 _Utils_Tuple2( 40265 'static', 40266 options.eQ ? $author$project$Internal$Model2$staticStyles : $elm$html$Html$text('')), 40267 _Utils_Tuple2( 40268 'keyframes', 40269 A2( 40270 $elm$html$Html$Lazy$lazy, 40271 $author$project$Internal$Model2$keyframeRules, 40272 function () { 40273 var _v4 = options.cc; 40274 if (_v4.$ === 1) { 40275 return _List_Nil; 40276 } else { 40277 var anim = _v4.a; 40278 var _v5 = anim.hp; 40279 var state = _v5; 40280 return state.$7; 40281 } 40282 }())), 40283 _Utils_Tuple2( 40284 'animations', 40285 A2( 40286 $elm$html$Html$Lazy$lazy, 40287 $author$project$Internal$Model2$styleRules, 40288 function () { 40289 var _v6 = options.cc; 40290 if (_v6.$ === 1) { 40291 return _List_Nil; 40292 } else { 40293 var animation = _v6.a; 40294 var _v7 = animation.hp; 40295 var state = _v7; 40296 return state.dJ; 40297 } 40298 }())) 40299 ])); 40300 }, 40301 content 40302 ])); 40303 var toFinalLayout = _v1; 40304 return toFinalLayout($author$project$Internal$Model2$zero); 40305 }); 40306var $author$project$Ui$layout = F3( 40307 function (opts, attrList, content) { 40308 return A3($author$project$Internal$Model2$renderLayout, opts, attrList, content); 40309 }); 40310var $author$project$Internal$Style2$Linear = F2( 40311 function (a, b) { 40312 return {$: 1, a: a, b: b}; 40313 }); 40314var $author$project$Ui$Gradient$linear = F2( 40315 function (angle, steps) { 40316 if (steps.b && (!steps.b.b)) { 40317 var single = steps.a; 40318 return A2( 40319 $author$project$Internal$Style2$Linear, 40320 angle, 40321 _List_fromArray( 40322 [single, single])); 40323 } else { 40324 return A2($author$project$Internal$Style2$Linear, angle, steps); 40325 } 40326 }); 40327var $elm$html$Html$map = $elm$virtual_dom$VirtualDom$map; 40328var $author$project$Internal$Model2$map = F2( 40329 function (fn, el) { 40330 var elem = el; 40331 return function (s) { 40332 return A2( 40333 $elm$html$Html$map, 40334 fn, 40335 elem(s)); 40336 }; 40337 }); 40338var $author$project$Ui$map = $author$project$Internal$Model2$map; 40339var $feathericons$elm_feather$FeatherIcons$messageSquare = A2( 40340 $feathericons$elm_feather$FeatherIcons$makeBuilder, 40341 'message-square', 40342 _List_fromArray( 40343 [ 40344 A2( 40345 $elm$svg$Svg$path, 40346 _List_fromArray( 40347 [ 40348 $elm$svg$Svg$Attributes$d('M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z') 40349 ]), 40350 _List_Nil) 40351 ])); 40352var $author$project$Internal$Model2$noAttr = _List_fromArray( 40353 [ 40354 { 40355 g: {q: $author$project$Internal$BitField$none, ei: _List_Nil, f: $elm$core$Maybe$Nothing, j: _List_Nil, o: $author$project$Internal$Model2$NodeAsDiv, p: $author$project$Internal$Model2$noStyles}, 40356 h: $author$project$Internal$Flag$skip 40357 } 40358 ]); 40359var $author$project$Ui$noAttr = $author$project$Internal$Model2$noAttr; 40360var $author$project$Internal$Model2$none = function (_v0) { 40361 return $elm$html$Html$text(''); 40362}; 40363var $author$project$Ui$none = $author$project$Internal$Model2$none; 40364var $author$project$Internal$Model2$calc = function (str) { 40365 return 'calc(' + (str + ')'); 40366}; 40367var $author$project$Internal$Model2$foldBreakpointsHelper = F4( 40368 function (fn, cursor, i, breaks) { 40369 foldBreakpointsHelper: 40370 while (true) { 40371 if (!breaks.b) { 40372 return cursor; 40373 } else { 40374 var _v1 = breaks.a; 40375 var label = _v1.b; 40376 var remain = breaks.b; 40377 var $temp$fn = fn, 40378 $temp$cursor = A3(fn, i, label, cursor), 40379 $temp$i = i + 1, 40380 $temp$breaks = remain; 40381 fn = $temp$fn; 40382 cursor = $temp$cursor; 40383 i = $temp$i; 40384 breaks = $temp$breaks; 40385 continue foldBreakpointsHelper; 40386 } 40387 } 40388 }); 40389var $author$project$Internal$Model2$foldBreakpoints = F3( 40390 function (fn, initial, _v0) { 40391 var resp = _v0; 40392 return A4( 40393 $author$project$Internal$Model2$foldBreakpointsHelper, 40394 fn, 40395 A3(fn, 0, resp.f9, initial), 40396 1, 40397 resp.ep); 40398 }); 40399var $author$project$Internal$Model2$breakpointString = function (i) { 40400 return '--ui-bp-' + $elm$core$String$fromInt(i); 40401}; 40402var $author$project$Internal$Model2$renderResponsiveValue = F2( 40403 function (i, v) { 40404 return _Utils_ap( 40405 'var(' + ($author$project$Internal$Model2$breakpointString(i) + ') * '), 40406 function () { 40407 if (v.$ === 1) { 40408 var val = v.a; 40409 return $elm$core$String$fromInt(val) + 'px'; 40410 } else { 40411 var bottom = v.a; 40412 var top = v.b; 40413 var diff = top - bottom; 40414 return $author$project$Internal$Model2$calc( 40415 $author$project$Internal$Model2$calc( 40416 'var(' + ($author$project$Internal$Model2$breakpointString(i) + ('-progress) * ' + $elm$core$String$fromInt(diff)))) + (' + ' + ($elm$core$String$fromInt(bottom) + 'px'))); 40417 } 40418 }()); 40419 }); 40420var $author$project$Internal$Model2$responsiveCssValue = F2( 40421 function (resp, toValue) { 40422 return $author$project$Internal$Model2$calc( 40423 A3( 40424 $author$project$Internal$Model2$foldBreakpoints, 40425 F3( 40426 function (i, lab, str) { 40427 if (str === '') { 40428 return $author$project$Internal$Model2$calc( 40429 A2( 40430 $author$project$Internal$Model2$renderResponsiveValue, 40431 i, 40432 toValue(lab))); 40433 } else { 40434 return str + (' + ' + $author$project$Internal$Model2$calc( 40435 A2( 40436 $author$project$Internal$Model2$renderResponsiveValue, 40437 i, 40438 toValue(lab)))); 40439 } 40440 }), 40441 '', 40442 resp)); 40443 }); 40444var $author$project$Ui$Responsive$varStyle = F2( 40445 function (name, val) { 40446 return A2( 40447 $author$project$Internal$Model2$styleAndClass, 40448 $author$project$Internal$Flag$skip, 40449 {f: 'ui-rs', qz: name, qA: val}); 40450 }); 40451var $author$project$Ui$Responsive$paddingEach = F2( 40452 function (resp, toValue) { 40453 return A2( 40454 $author$project$Ui$Responsive$varStyle, 40455 'padding', 40456 A2( 40457 $author$project$Internal$Model2$responsiveCssValue, 40458 resp, 40459 A2( 40460 $elm$core$Basics$composeR, 40461 toValue, 40462 function ($) { 40463 return $.qW; 40464 })) + ((' ' + A2( 40465 $author$project$Internal$Model2$responsiveCssValue, 40466 resp, 40467 A2( 40468 $elm$core$Basics$composeR, 40469 toValue, 40470 function ($) { 40471 return $.pW; 40472 }
40472))) + ((' ' + A2( 40473 $author$project$Internal$Model2$responsiveCssValue, 40474 resp, 40475 A2( 40476 $elm$core$Basics$composeR, 40477 toValue, 40478 function ($) { 40479 return $.lI; 40480 }))) + (' ' + A2( 40481 $author$project$Internal$Model2$responsiveCssValue, 40482 resp, 40483 A2( 40484 $elm$core$Basics$composeR, 40485 toValue, 40486 function ($) { 40487 return $.nz; 40488 })))))); 40489 }); 40490var $author$project$Ui$Responsive$paddingXY = F2( 40491 function (resp, toValue) { 40492 return A2( 40493 $author$project$Ui$Responsive$varStyle, 40494 'padding', 40495 A2( 40496 $author$project$Internal$Model2$responsiveCssValue, 40497 resp, 40498 A2( 40499 $elm$core$Basics$composeR, 40500 toValue, 40501 function ($) { 40502 return $.k0; 40503 })) + (' ' + A2( 40504 $author$project$Internal$Model2$responsiveCssValue, 40505 resp, 40506 A2( 40507 $elm$core$Basics$composeR, 40508 toValue, 40509 function ($) { 40510 return $.rm; 40511 })))); 40512 }); 40513var $author$project$Internal$Style2$Percent = F2( 40514 function (a, b) { 40515 return {$: 0, a: a, b: b}; 40516 }); 40517var $author$project$Ui$Gradient$percent = $author$project$Internal$Style2$Percent; 40518var $author$project$Ui$Shrink = {$: 2}; 40519var $author$project$Ui$shrink = $author$project$Ui$Shrink; 40520var $author$project$Internal$Model2$styleDynamic = F2( 40521 function (name, toVal) { 40522 return _List_fromArray( 40523 [ 40524 { 40525 g: { 40526 q: $author$project$Internal$BitField$none, 40527 ei: _List_Nil, 40528 f: $elm$core$Maybe$Nothing, 40529 j: _List_Nil, 40530 o: $author$project$Internal$Model2$NodeAsDiv, 40531 p: F2( 40532 function (inheritance, _v0) { 40533 return _List_fromArray( 40534 [ 40535 _Utils_Tuple2( 40536 name, 40537 toVal(inheritance)) 40538 ]); 40539 }) 40540 }, 40541 h: $author$project$Internal$Flag$skip 40542 } 40543 ]); 40544 }); 40545var $author$project$Ui$Font$toFontPixels = function (f) { 40546 var rem = f / 16; 40547 return $elm$core$String$fromFloat(rem) + 'rem'; 40548}; 40549var $author$project$Ui$Font$size = function (i) { 40550 return A2( 40551 $author$project$Internal$Model2$styleDynamic, 40552 'font-size', 40553 function (inheritance) { 40554 var modificationInt = A2($author$project$Internal$BitField$get, $author$project$Internal$Bits$Inheritance$fontHeight, inheritance); 40555 var baseSize = i; 40556 var modification = (modificationInt / 100) * baseSize; 40557 return $author$project$Ui$Font$toFontPixels(baseSize - modification); 40558 }); 40559}; 40560var $author$project$Internal$BitField$set = F3( 40561 function (_v0, unboundedVal, bits) { 40562 var inverseMask = _v0.bp; 40563 var offset = _v0.L; 40564 var length = _v0.J; 40565 var val = A2( 40566 $elm$core$Basics$min, 40567 A2($elm$core$Basics$pow, 2, length) - 1, 40568 A2($elm$core$Basics$max, 0, unboundedVal)); 40569 var top = $author$project$Internal$BitField$ones >>> (32 - length); 40570 return ((top & val) << offset) | (inverseMask & bits); 40571 }); 40572var $author$project$Ui$spacing = function (x) { 40573 return _List_fromArray( 40574 [ 40575 { 40576 g: { 40577 q: A3( 40578 $author$project$Internal$BitField$set, 40579 $author$project$Internal$Bits$Inheritance$spacingY, 40580 x, 40581 A3($author$project$Internal$BitField$set, $author$project$Internal$Bits$Inheritance$spacingX, x, $author$project$Internal$BitField$none)), 40582 ei: _List_Nil, 40583 f: $elm$core$Maybe$Nothing, 40584 j: _List_Nil, 40585 o: $author$project$Internal$Model2$NodeAsDiv, 40586 p: F2( 40587 function (inheritance, _v0) { 40588 return A2($author$project$Internal$BitField$has, $author$project$Internal$Bits$Inheritance$isTextLayout, inheritance) ? _List_Nil : _List_fromArray( 40589 [ 40590 A2( 40591 $elm$core$Tuple$pair, 40592 'gap', 40593 $elm$core$String$fromInt(x) + 'px') 40594 ]); 40595 }) 40596 }, 40597 h: $author$project$Internal$Flag$spacing 40598 } 40599 ]); 40600}; 40601var $author$project$Internal$Style2$Angle = $elm$core$Basics$identity; 40602var $elm$core$Basics$pi = _Basics_pi; 40603var $author$project$Ui$turns = function (t) { 40604 return (t * 2) * $elm$core$Basics$pi; 40605}; 40606var $author$project$Internal$Model2$Exactly = function (a) { 40607 return {$: 1, a: a}; 40608}; 40609var $author$project$Ui$Responsive$value = $author$project$Internal$Model2$Exactly; 40610var $author$project$Ui$Accessibility$announce = $author$project$Internal$Model2$attribute( 40611 A2($elm$html$Html$Attributes$attribute, 'aria-live', 'polite')); 40612var $author$project$UI$Toast$keyframesStyle = $author$project$Ui$html( 40613 A3( 40614 $elm$html$Html$node, 40615 'style', 40616 _List_Nil, 40617 _List_fromArray( 40618 [ 40619 $elm$html$Html$text('@keyframes toast-slide-in { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }') 40620 ]))); 40621var $author$project$Ui$height = function (len) { 40622 switch (len.$) { 40623 case 2: 40624 return A2($author$project$Internal$Model2$classWith, $author$project$Internal$Flag$height, $author$project$Internal$Style2$classes.m$); 40625 case 0: 40626 var x = len.a; 40627 return A2( 40628 $author$project$Internal$Model2$styleAndClass, 40629 $author$project$Internal$Flag$height, 40630 { 40631 f: $author$project$Internal$Style2$classes.m0, 40632 qz: 'height', 40633 qA: $author$project$Internal$Style2$px(x) 40634 }); 40635 default: 40636 if (len.a === 1) { 40637 return A2($author$project$Internal$Model2$classWith, $author$project$Internal$Flag$height, $author$project$Internal$Style2$classes.iT); 40638 } else { 40639 var portionSize = len.a; 40640 return _List_fromArray( 40641 [ 40642 { 40643 g: { 40644 q: $author$project$Internal$BitField$none, 40645 ei: _List_Nil, 40646 f: $elm$core$Maybe$Just($author$project$Internal$Style2$classes.iT), 40647 j: _List_Nil, 40648 o: $author$project$Internal$Model2$NodeAsDiv, 40649 p: F2( 40650 function (inheritance, _v1) { 40651 return A2($author$project$Internal$BitField$has, $author$project$Internal$Bits$Inheritance$isColumn, inheritance) ? _List_fromArray( 40652 [ 40653 A2( 40654 $elm$core$Tuple$pair, 40655 'flex-grow',
40656 $elm$core$String$fromInt(portionSize)) 40657 ]) : _List_Nil; 40658 }) 40659 }, 40660 h: $author$project$Internal$Flag$width 40661 } 40662 ]); 40663 } 40664 } 40665}; 40666var $author$project$Ui$Px = function (a) { 40667 return {$: 0, a: a}; 40668}; 40669var $author$project$Ui$px = $author$project$Ui$Px; 40670var $author$project$UI$Theme$sizing = {i8: 40, aW: 32, qk: 24, hE: 48, bb: 16, rn: 56, hF: 72}; 40671var $author$project$UI$Toast$tabBarSpacer = A2( 40672 $author$project$Ui$el, 40673 _List_fromArray( 40674 [ 40675 $author$project$Ui$height( 40676 $author$project$Ui$px($author$project$UI$Theme$sizing.rn)) 40677 ]), 40678 $author$project$Ui$none); 40679var $author$project$UI$Theme$success = { 40680 k3: A3($author$project$Ui$rgb, 107, 144, 128), 40681 k4: A3($author$project$Ui$rgb, 82, 122, 106), 40682 hG: A3($author$project$Ui$rgb, 140, 170, 157), 40683 h$: A3($author$project$Ui$rgb, 244, 250, 247), 40684 en: A3($author$project$Ui$rgb, 232, 244, 238), 40685 cR: A3($author$project$Ui$rgb, 45, 90, 74), 40686 kl: A3($author$project$Ui$rgb, 82, 122, 106), 40687 ql: A3($author$project$Ui$rgb, 99, 139, 123), 40688 cW: A3($author$project$Ui$rgb, 65, 105, 89), 40689 km: A3($author$project$Ui$rgb, 255, 255, 255), 40690 qI: A3($author$project$Ui$rgb, 45, 90, 74), 40691 aM: A3($author$project$Ui$rgb, 82, 122, 106), 40692 qR: A4($author$project$Ui$rgba, 107, 144, 128, 0.1), 40693 qS: A4($author$project$Ui$rgba, 107, 144, 128, 0.16), 40694 c0: A4($author$project$Ui$rgba, 107, 144, 128, 0.06) 40695}; 40696var $author$project$Internal$Model2$textElementClasses = $author$project$Internal$Style2$classes.bd + (' ' + $author$project$Internal$Style2$classes.qI); 40697var $author$project$Internal$Model2$text = function (str) { 40698 return function (encoded) { 40699 return ((!A2($author$project$Internal$BitField$has, $author$project$Internal$Bits$Inheritance$isTextLayout, encoded)) || A2($author$project$Internal$BitField$has, $author$project$Internal$Bits$Inheritance$hasTextModification, encoded)) ? A2( 40700 $elm$html$Html$span, 40701 _List_fromArray( 40702 [ 40703 $elm$html$Html$Attributes$class($author$project$Internal$Model2$textElementClasses) 40704 ]), 40705 _List_fromArray( 40706 [ 40707 $elm$html$Html$text(str) 40708 ])) : $elm$html$Html$text(str); 40709 }; 40710}; 40711var $author$project$Ui$text = $author$project$Internal$Model2$text; 40712var $author$project$UI$Toast$viewToast = function (toast) { 40713 var _v0 = function () { 40714 var _v1 = toast.gG; 40715 if (!_v1) { 40716 return _Utils_Tuple2($author$project$UI$Theme$success.en, $author$project$UI$Theme$success.qI); 40717 } else { 40718 return _Utils_Tuple2($author$project$UI$Theme$danger.en, $author$project$UI$Theme$danger.qI); 40719 } 40720 }(); 40721 var bgColor = _v0.a; 40722 var fgColor = _v0.b; 40723 return A2( 40724 $author$project$Ui$el, 40725 _List_fromArray( 40726 [ 40727 $author$project$Ui$width($author$project$Ui$fill), 40728 $author$project$Ui$padding($author$project$UI$Theme$spacing.aW), 40729 $author$project$Ui$rounded($author$project$UI$Theme$radius.aW), 40730 $author$project$Ui$background(bgColor), 40731 $author$project$Ui$Font$color(fgColor), 40732 $author$project$Ui$Font$size($author$project$UI$Theme$font.qk), 40733 $author$project$Ui$htmlAttribute( 40734 A2($elm$html$Html$Attributes$style, 'animation', 'toast-slide-in 0.3s ease-out')), 40735 $author$project$Ui$htmlAttribute( 40736 A2($elm$html$Html$Attributes$style, 'box-shadow', '0 2px 8px rgba(0,0,0,0.15)')), 40737 $author$project$Ui$htmlAttribute( 40738 A2($elm$html$Html$Attributes$style, 'pointer-events', 'auto')) 40739 ]), 40740 $author$project$Ui$text(toast.dv)); 40741}; 40742var $author$project$UI$Toast$view = function (model) { 40743 return A2( 40744 $author$project$Ui$column, 40745 _List_fromArray( 40746 [ 40747 $author$project$Ui$spacing($author$project$UI$Theme$spacing.i8) 40748 ]), 40749 _List_fromArray( 40750 [ 40751 A2( 40752 $author$project$Ui$column, 40753 _List_fromArray( 40754 [ 40755 $author$project$Ui$centerX, 40756 $author$project$Ui$spacing($author$project$UI$Theme$spacing.qk), 40757 $author$project$Ui$width($author$project$Ui$shrink), 40758 $author$project$Ui$Accessibility$announce 40759 ]), 40760 A2( 40761 $elm$core$List$cons, 40762 $author$project$UI$Toast$keyframesStyle, 40763 A2($elm$core$List$map, $author$project$UI$Toast$viewToast, model.b8))), 40764 $author$project$UI$Toast$tabBarSpacer 40765 ])); 40766}; 40767var $author$project$PwaState$AcceptUpdate = {$: 1}; 40768var $author$project$PwaState$DismissInstallHint = {$: 3}; 40769var $author$project$PwaState$DismissJustInstalled = {$: 4}; 40770var $author$project$PwaState$RequestInstall = {$: 2}; 40771var $author$project$Translations$pwaAlreadyInstalled = function (_v0) { 40772 var lang = _v0; 40773 if (!lang) { 40774 return 'Partage is already installed, open it from your home screen'; 40775 } else { 40776 return 'Partage est déjà installée ! Ouvre lâappli depuis ton écran dâaccueil'; 40777 } 40778}; 40779var $author$project$Ui$contentCenterX = A2($author$project$Internal$Model2$classWith, $author$project$Internal$Flag$xContentAlign, $author$project$Internal$Style2$classes.l0); 40780var $author$project$Ui$contentCenterY = A2($author$project$Internal$Model2$classWith, $author$project$Internal$Flag$yContentAlign, $author$project$Internal$Style2$classes.l1); 40781var $author$project$UI$Components$featherIcon = F2( 40782 function (size, icon) { 40783 return $author$project$Ui$html( 40784 A2( 40785 $feathericons$elm_feather$FeatherIcons$toHtml, 40786 _List_Nil, 40787 A2($feathericons$elm_feather$FeatherIcons$withSize, size, icon))); 40788 });
40789var $author$project$UI$Theme$fontWeight = {lD: 700, nI: 500, pP: 400, dL: 600}; 40790var $author$project$Ui$paddingXY = F2( 40791 function (x, y) { 40792 return A3( 40793 $author$project$Internal$Model2$styleWith, 40794 $author$project$Internal$Flag$padding, 40795 'padding', 40796 ($elm$core$String$fromInt(y) + 'px ') + ($elm$core$String$fromInt(x) + 'px')); 40797 }); 40798var $author$project$UI$Theme$primary = { 40799 k3: A3($author$project$Ui$rgb, 232, 114, 92), 40800 k4: A3($author$project$Ui$rgb, 212, 98, 78), 40801 hG: A3($author$project$Ui$rgb, 240, 150, 133), 40802 h$: A3($author$project$Ui$rgb, 255, 246, 244), 40803 en: A3($author$project$Ui$rgb, 253, 237, 233), 40804 cR: A3($author$project$Ui$rgb, 232, 114, 92), 40805 kl: A3($author$project$Ui$rgb, 232, 114, 92), 40806 ql: A3($author$project$Ui$rgb, 245, 130, 110), 40807 cW: A3($author$project$Ui$rgb, 212, 98, 78), 40808 km: A3($author$project$Ui$rgb, 255, 255, 255), 40809 qI: A3($author$project$Ui$rgb, 196, 80, 60), 40810 aM: A3($author$project$Ui$rgb, 218, 105, 85), 40811 qR: A4($author$project$Ui$rgba, 232, 114, 92, 0.1), 40812 qS: A4($author$project$Ui$rgba, 232, 114, 92, 0.16), 40813 c0: A4($author$project$Ui$rgba, 232, 114, 92, 0.06) 40814}; 40815var $author$project$Internal$Model2$AsRow = 0;
40816var $author$project$Ui$row = F2( 40817 function (attrList, children) { 40818 return A4( 40819 $author$project$Internal$Model2$element, 40820 $author$project$Internal$Model2$NodeAsDiv, 40821 0, 40822 A2( 40823 $elm$core$List$cons, 40824 $author$project$Ui$width($author$project$Ui$fill), 40825 attrList), 40826 children); 40827 }); 40828var $author$project$Ui$Font$weight = function (i) { 40829 return A2( 40830 $author$project$Internal$Model2$style, 40831 'font-weight', 40832 $elm$core$String$fromInt(i)); 40833}; 40834var $feathericons$elm_feather$FeatherIcons$x = A2( 40835 $feathericons$elm_feather$FeatherIcons$makeBuilder, 40836 'x', 40837 _List_fromArray( 40838 [ 40839 A2( 40840 $elm$svg$Svg$line, 40841 _List_fromArray( 40842 [ 40843 $elm$svg$Svg$Attributes$x1('18'), 40844 $elm$svg$Svg$Attributes$y1('6'), 40845 $elm$svg$Svg$Attributes$x2('6'), 40846 $elm$svg$Svg$Attributes$y2('18') 40847 ]), 40848 _List_Nil), 40849 A2( 40850 $elm$svg$Svg$line, 40851 _List_fromArray( 40852 [ 40853 $elm$svg$Svg$Attributes$x1('6'), 40854 $elm$svg$Svg$Attributes$y1('6'), 40855 $elm$svg$Svg$Attributes$x2('18'), 40856 $elm$svg$Svg$Attributes$y2('18') 40857 ]), 40858 _List_Nil) 40859 ])); 40860var $author$project$UI$Components$pwaBanner = F2( 40861 function (message, _v0) { 40862 var bgColor = _v0.fW; 40863 var textColor = _v0.hv; 40864 var action = _v0.k5; 40865 var dismiss = _v0.Y; 40866 return A2( 40867 $author$project$Ui$row, 40868 _List_fromArray( 40869 [ 40870 $author$project$Ui$width($author$project$Ui$fill), 40871 A2($author$project$Ui$paddingXY, $author$project$UI$Theme$spacing.aW, $author$project$UI$Theme$spacing.qk), 40872 $author$project$Ui$background(bgColor), 40873 $author$project$Ui$spacing($author$project$UI$Theme$spacing.aW), 40874 $author$project$Ui$Font$size($author$project$UI$Theme$font.qk) 40875 ]), 40876 _List_fromArray( 40877 [ 40878 A2( 40879 $author$project$Ui$el, 40880 _List_fromArray( 40881 [ 40882 $author$project$Ui$Font$color(textColor), 40883 $author$project$Ui$width($author$project$Ui$fill) 40884 ]), 40885 $author$project$Ui$text(message)), 40886 function () { 40887 if (!action.$) { 40888 var _v2 = action.a; 40889 var label = _v2.a; 40890 var attrs = _v2.b; 40891 return A2( 40892 $author$project$Ui$el, 40893 A2( 40894 $elm$core$List$cons, 40895 A2($author$project$Ui$paddingXY, $author$project$UI$Theme$spacing.aW, $author$project$UI$Theme$spacing.qk), 40896 A2( 40897 $elm$core$List$cons, 40898 $author$project$Ui$rounded($author$project$UI$Theme$radius.qk), 40899 A2( 40900 $elm$core$List$cons, 40901 $author$project$Ui$background(textColor), 40902 A2( 40903 $elm$core$List$cons, 40904 $author$project$Ui$Font$color($author$project$UI$Theme$primary.km), 40905 A2( 40906 $elm$core$List$cons, 40907 $author$project$Ui$Font$weight($author$project$UI$Theme$fontWeight.dL), 40908 A2( 40909 $elm$core$List$cons, 40910 $author$project$Ui$pointer, 40911 A2( 40912 $elm$core$List$cons, 40913 $author$project$Ui$width($author$project$Ui$shrink), 40914 attrs))))))), 40915 $author$project$Ui$text(label)); 40916 } else { 40917 return $author$project$Ui$none; 40918 } 40919 }(), 40920 function () { 40921 if (!dismiss.$) { 40922 var msg = dismiss.a; 40923 return A2( 40924 $author$project$Ui$el, 40925 _List_fromArray( 40926 [ 40927 $author$project$Ui$Input$button(msg), 40928 $author$project$Ui$Font$size($author$project$UI$Theme$font.aW), 40929 $author$project$Ui$Font$color($author$project$UI$Theme$base.aM), 40930 $author$project$Ui$pointer, 40931 $author$project$Ui$alignRight, 40932 $author$project$Ui$height( 40933 $author$project$Ui$px($author$project$UI$Theme$sizing.aW)), 40934 $author$project$Ui$width( 40935 $author$project$Ui$px($author$project$UI$Theme$sizing.aW)), 40936 $author$project$Ui$contentCenterX, 40937 $author$project$Ui$contentCenterY 40938 ]), 40939 A2($author$project$UI$Components$featherIcon, 18, $feathericons$elm_feather$FeatherIcons$x)); 40940 } else { 40941 return $author$project$Ui$none; 40942 } 40943 }() 40944 ])); 40945 }); 40946var $author$project$Translations$pwaInstallButton = function (_v0) { 40947 var lang = _v0; 40948 if (!lang) { 40949 return 'Install'; 40950 } else { 40951 return 'Installer'; 40952 } 40953}; 40954var $author$project$Translations$pwaInstallHintAndroid = function (_v0) { 40955 var lang = _v0; 40956 if (!lang) { 40957 return 'Install Partage: open the browser menu, then âAdd to Home screenâ'; 40958 } else { 40959 return 'Installe Partage : ouvre le menu du navigateur, puis « Ajouter à lâécran dâaccueil »'; 40960 } 40961}; 40962var $author$project$Translations$pwaInstallHintIos = function (_v0) { 40963 var lang = _v0; 40964 if (!lang) { 40965 return 'Install Partage: tap Share, then âAdd to Home Screenâ'; 40966 } else { 40967 return 'Installer Partage : clique sur Partager, puis « Sur lâécran dâaccueil »'; 40968 } 40969}; 40970var $author$project$Translations$pwaInstallHintIosWebview = function (_v0) { 40971 var lang = _v0; 40972 if (!lang) { 40973 return 'To install Partage, first open this page directly in Safari (not in this in-app browser), then add it to your home screen.'; 40974 } else { 40975 return 'Pour installer Partage, ouvre dâabord cette page directement dans Safari (pas dans ce navigateur intégré), puis ajoute-la à ton écran dâaccueil.'; 40976 } 40977}; 40978var $author$project$Translations$pwaInstallHintMac = function (_v0) { 40979 var lang = _v0; 40980 if (!lang) { 40981 return 'Install Partage: click Share, then âAdd to Dockâ'; 40982 } else { 40983 return 'Installer Partage : clique sur Partager, puis « Ajouter au Dock »'; 40984 } 40985}; 40986var $author$project$Translations$pwaInstallPrompt = function (_v0) { 40987 var lang = _v0; 40988 if (!lang) { 40989 return 'Install Partage for a better experience'; 40990 } else { 40991 return 'Installe Partage pour une meilleure expérience'; 40992 } 40993}; 40994var $author$project$UI$Theme$warning = { 40995 k3: A3($author$project$Ui$rgb, 217, 160, 6), 40996 k4: A3($author$project$Ui$rgb, 196, 140, 0), 40997 hG: A3($author$project$Ui$rgb, 230, 180, 50), 40998 h$: A3($author$project$Ui$rgb, 255, 250, 240), 40999 en: A3($author$project$Ui$rgb, 254, 243, 220), 41000 cR: A3($author$project$Ui$rgb, 140, 100, 0), 41001 kl: A3($author$project$Ui$rgb, 196, 140, 0), 41002 ql: A3($author$project$Ui$rgb, 216, 156, 10), 41003 cW: A3($author$project$Ui$rgb, 176, 124, 0), 41004 km: A3($author$project$Ui$rgb, 255, 255, 255), 41005 qI: A3($author$project$Ui$rgb, 140, 100, 0), 41006 aM: A3($author$project$Ui$rgb, 176, 124, 0), 41007 qR: A4($author$project$Ui$rgba, 217, 160, 6, 0.1), 41008 qS: A4($author$project$Ui$rgba, 217, 160, 6, 0.16), 41009 c0: A4($author$project$Ui$rgba, 217, 160, 6, 0.06) 41010}; 41011var $author$project$UI$Components$installHintBanner = F2( 41012 function (i18n, config) { 41013 var manual = function (message) { 41014 return A2( 41015 $author$project$UI$Components$pwaBanner, 41016 message, 41017 { 41018 k5: $elm$core$Maybe$Nothing, 41019 fW: $author$project$UI$Theme$warning.qR, 41020 Y: $elm$core$Maybe$Just(config.ov), 41021 hv: $author$project$UI$Theme$warning.qI 41022 }); 41023 }; 41024 var _v0 = config.eT; 41025 switch (_v0) { 41026 case 1: 41027 return $elm$core$Maybe$Just( 41028 A2( 41029 $author$project$UI$Components$pwaBanner, 41030 $author$project$Translations$pwaInstallPrompt(i18n), 41031 { 41032 k5: $elm$core$Maybe$Just( 41033 _Utils_Tuple2( 41034 $author$project$Translations$pwaInstallButton(i18n), 41035 _List_fromArray( 41036 [ 41037 $author$project$Ui$Input$button(config.oJ) 41038 ]))), 41039 fW: $author$project$UI$Theme$warning.qR, 41040 Y: $elm$core$Maybe$Just(config.ov), 41041 hv: $author$project$UI$Theme$warning.qI 41042 })); 41043 case 2: 41044 return $elm$core$Maybe$Just( 41045 manual( 41046 $author$project$Translations$pwaInstallHintIos(i18n))); 41047 case 3: 41048 return $elm$core$Maybe$Just( 41049 manual( 41050 $author$project$Translations$pwaInstallHintMac(i18n))); 41051 case 4: 41052 return $elm$core$Maybe$Just( 41053 manual( 41054 $author$project$Translations$pwaInstallHintAndroid(i18n))); 41055 case 5: 41056 return $elm$core$Maybe$Just( 41057 manual( 41058 $author$project$Translations$pwaInstallHintIosWebview(i18n))); 41059 case 6: 41060 return $elm$core$Maybe$Just( 41061 manual( 41062 $author$project$Translations$pwaAlreadyInstalled(i18n))); 41063 case 0: 41064 return $elm$core$Maybe$Nothing; 41065 default: 41066 return $elm$core$Maybe$Nothing; 41067 } 41068 }); 41069var $author$project$Translations$pwaJustInstalled = function (_v0) { 41070 var lang = _v0; 41071 if (!lang) { 41072 return 'Partage installed! Open it from your home screen for the best experience.'; 41073 } else { 41074 return 'Partage est installée ! Ouvre lâappli depuis ton écran dâaccueil pour une meilleure expérience.'; 41075 } 41076}; 41077var $author$project$Translations$pwaOffline = function (_v0) { 41078 var lang = _v0; 41079 if (!lang) { 41080 return 'You are offline'; 41081 } else { 41082 return 'Tu es hors-ligne'; 41083 } 41084}; 41085var $author$project$Translations$pwaUpdateAvailable = function (_v0) { 41086 var lang = _v0; 41087 if (!lang) { 41088 return 'A new version is available'; 41089 } else { 41090 return 'Une nouvelle version est disponible'; 41091 } 41092}; 41093var $author$project$Translations$pwaUpdateButton = function (_v0) { 41094 var lang = _v0; 41095 if (!lang) { 41096 return 'Update';
41097 } else { 41098 return 'Mettre à jour'; 41099 } 41100}; 41101var $author$project$Translations$serverFrozenBanner = function (_v0) { 41102 var lang = _v0; 41103 if (!lang) { 41104 return 'This server no longer saves changes. What you add stays on this device.'; 41105 } else { 41106 return 'Ce serveur n\'enregistre plus les changements. Ce que tu ajoutes reste sur cet appareil.'; 41107 } 41108}; 41109var $author$project$UI$Components$pwaBanners = F2( 41110 function (i18n, config) { 41111 var showIf = F2( 41112 function (condition, elem) { 41113 return condition ? $elm$core$Maybe$Just(elem) : $elm$core$Maybe$Nothing; 41114 }); 41115 var banners = A2( 41116 $elm$core$List$filterMap, 41117 $elm$core$Basics$identity, 41118 _List_fromArray( 41119 [ 41120 A2( 41121 showIf, 41122 config.cQ, 41123 A2( 41124 $author$project$UI$Components$pwaBanner, 41125 $author$project$Translations$serverFrozenBanner(i18n), 41126 {k5: $elm$core$Maybe$Nothing, fW: $author$project$UI$Theme$warning.qR, Y: $elm$core$Maybe$Nothing, hv: $author$project$UI$Theme$warning.qI})), 41127 A2( 41128 showIf, 41129 !config.dk, 41130 A2( 41131 $author$project$UI$Components$pwaBanner, 41132 $author$project$Translations$pwaOffline(i18n), 41133 {k5: $elm$core$Maybe$Nothing, fW: $author$project$UI$Theme$warning.qR, Y: $elm$core$Maybe$Nothing, hv: $author$project$UI$Theme$warning.qI})), 41134 A2( 41135 showIf, 41136 config.d8, 41137 A2( 41138 $author$project$UI$Components$pwaBanner, 41139 $author$project$Translations$pwaUpdateAvailable(i18n), 41140 { 41141 k5: $elm$core$Maybe$Just( 41142 _Utils_Tuple2( 41143 $author$project$Translations$pwaUpdateButton(i18n), 41144 _List_fromArray( 41145 [ 41146 $author$project$Ui$Input$button(config.o9) 41147 ]))), 41148 fW: $author$project$UI$Theme$warning.qR, 41149 Y: $elm$core$Maybe$Nothing, 41150 hv: $author$project$UI$Theme$warning.qI 41151 })), 41152 A2( 41153 showIf, 41154 config.bq, 41155 A2( 41156 $author$project$UI$Components$pwaBanner, 41157 $author$project$Translations$pwaJustInstalled(i18n), 41158 { 41159 k5: $elm$core$Maybe$Nothing, 41160 fW: $author$project$UI$Theme$success.qR, 41161 Y: $elm$core$Maybe$Just(config.ow), 41162 hv: $author$project$UI$Theme$success.qI 41163 })), 41164 A2($author$project$UI$Components$installHintBanner, i18n, config) 41165 ])); 41166 return $elm$core$List$isEmpty(banners) ? $author$project$Ui$none : A2( 41167 $author$project$Ui$column, 41168 _List_fromArray( 41169 [ 41170 $author$project$Ui$spacing($author$project$UI$Theme$spacing.aW) 41171 ]), 41172 banners); 41173 }); 41174var $author$project$PwaState$viewBanners = F2( 41175 function (i18n, model) { 41176 return A2( 41177 $author$project$UI$Components$pwaBanners, 41178 i18n, 41179 { 41180 eT: (model.cu || model.bq) ? 7 : model.eT, 41181 dk: model.dk, 41182 bq: model.bq, 41183 ov: $author$project$PwaState$DismissInstallHint, 41184 ow: $author$project$PwaState$DismissJustInstalled, 41185 oJ: $author$project$PwaState$RequestInstall, 41186 o9: $author$project$PwaState$AcceptUpdate, 41187 cQ: model.cQ, 41188 d8: model.d8 41189 }); 41190 }); 41191var $author$project$Main$GoBack = {$: 3}; 41192var $author$project$Main$ReportIssue = function (a) { 41193 return {$: 40, a: a}; 41194}; 41195var $author$project$Translations$errorLogTitle = function (_v0) { 41196 var lang = _v0; 41197 if (!lang) { 41198 return 'Error Log'; 41199 } else { 41200 return 'Journal d\'erreurs'; 41201 } 41202}; 41203var $author$project$Ui$paddingBottom = function (x) { 41204 return A3( 41205 $author$project$Internal$Model2$styleWith, 41206 $author$project$Internal$Flag$padding, 41207 'padding-bottom', 41208 $elm$core$String$fromInt(x) + 'px'); 41209}; 41210var $elm$svg$Svg$Attributes$points = _VirtualDom_attribute('points'); 41211var $elm$svg$Svg$polyline = $elm$svg$Svg$trustedNode('polyline'); 41212var $feathericons$elm_feather$FeatherIcons$chevronLeft = A2( 41213 $feathericons$elm_feather$FeatherIcons$makeBuilder, 41214 'chevron-left', 41215 _List_fromArray( 41216 [ 41217 A2( 41218 $elm$svg$Svg$polyline, 41219 _List_fromArray( 41220 [ 41221 $elm$svg$Svg$Attributes$points('15 18 9 12 15 6') 41222 ]), 41223 _List_Nil) 41224 ])); 41225var $author$project$Ui$paddingWith = function (pad) { 41226 return A2( 41227 $author$project$Internal$Model2$style, 41228 'padding', 41229 ($elm$core$String$fromInt(pad.qW) + 'px ') + (($elm$core$String$fromInt(pad.pW) + 'px ') + (($elm$core$String$fromInt(pad.lI) + 'px ') + ($elm$core$String$fromInt(pad.nz) + 'px')))); 41230}; 41231var $author$project$UI$Shell$pageHeader = function (config) { 41232 return A2( 41233 $author$project$Ui$row, 41234 _List_fromArray( 41235 [ 41236 $author$project$Ui$width($author$project$Ui$fill), 41237 $author$project$Ui$paddingWith( 41238 {lI: $author$project$UI$Theme$spacing.i8, nz: 0, pW: 0, qW: $author$project$UI$Theme$spacing.i8}), 41239 $author$project$Ui$contentCenterY 41240 ]), 41241 _List_fromArray( 41242 [ 41243 A2( 41244 $author$project$Ui$row, 41245 _List_fromArray( 41246 [ 41247 $author$project$Ui$spacing($author$project$UI$Theme$spacing.aW), 41248 $author$project$Ui$contentCenterY, 41249 $author$project$Ui$width($author$project$Ui$shrink), 41250 $author$project$Ui$Input$button(config.a9), 41251 $author$project$Ui$pointer 41252 ]), 41253 _List_fromArray( 41254 [ 41255 A2( 41256 $author$project$Ui$el, 41257 _List_Nil, 41258 A2($author$project$UI$Components$featherIcon, $author$project$UI$Theme$sizing.qk, $feathericons$elm_feather$FeatherIcons$chevronLeft)), 41259 A2( 41260 $author$project$Ui$el, 41261 _List_fromArray( 41262 [ 41263 $author$project$Ui$Font$size($author$project$UI$Theme$font.hE), 41264 $author$project$Ui$Font$weight($author$project$UI$Theme$fontWeight.lD) 41265 ]), 41266 $author$project$Ui$text(config.ba)) 41267 ])), 41268 (config.cY === '') ? $author$project$Ui$none : A2( 41269 $author$project$Ui$el, 41270 _List_fromArray( 41271 [ 41272 $author$project$Ui$alignRight, 41273 $author$project$Ui$Font$size($author$project$UI$Theme$font.qk), 41274 $author$project$Ui$Font$color($author$project$UI$Theme$base.aM) 41275 ]), 41276 $author$project$Ui$text(config.cY)) 41277 ])); 41278}; 41279var $author$project$UI$Shell$pageShell = F2( 41280 function (config, content) { 41281 return A2( 41282 $author$project$Ui$column, 41283 _List_fromArray( 41284 [ 41285 $author$project$Ui$height($author$project$Ui$fill), 41286 $author$project$Ui$paddingBottom($author$project$UI$Theme$spacing.hE) 41287 ]), 41288 _List_fromArray( 41289 [ 41290 $author$project$UI$Shell$pageHeader( 41291 {a9: config.a9, cY: '', ba: config.ba}), 41292 content 41293 ])); 41294 }); 41295var $author$project$Ui$Font$center = A2($author$project$Internal$Model2$classWith, $author$project$Internal$Flag$fontAlignment, $author$project$Internal$Style2$classes.qJ); 41296var $author$project$UI$Components$btnPrimary = F2( 41297 function (attrs, config) { 41298 return A2( 41299 $author$project$Ui$el, 41300 A2( 41301 $elm$core$List$cons, 41302 $author$project$Ui$Input$button(config.e7), 41303 A2( 41304 $elm$core$List$cons, 41305 $author$project$Ui$width($author$project$Ui$fill), 41306 A2( 41307 $elm$core$List$cons, 41308 $author$project$Ui$background($author$project$UI$Theme$primary.kl), 41309 A2( 41310 $elm$core$List$cons, 41311 $author$project$Ui$rounded($author$project$UI$Theme$radiu
41311s.aW), 41312 A2( 41313 $elm$core$List$cons, 41314 A2($author$project$Ui$paddingXY, $author$project$UI$Theme$spacing.hE, $author$project$UI$Theme$spacing.aW), 41315 A2( 41316 $elm$core$List$cons, 41317 $author$project$Ui$Font$size($author$project$UI$Theme$font.aW), 41318 A2( 41319 $elm$core$List$cons, 41320 $author$project$Ui$Font$weight($author$project$UI$Theme$fontWeight.dL), 41321 A2( 41322 $elm$core$List$cons, 41323 $author$project$Ui$Font$color($author$project$UI$Theme$primary.km), 41324 A2( 41325 $elm$core$List$cons, 41326 $author$project$Ui$Font$center, 41327 A2($elm$core$List$cons, $author$project$Ui$pointer, attrs)))))))))), 41328 $author$project$Ui$text(config.i6)); 41329 }); 41330var $author$project$UI$Theme$border = 1; 41331var $author$project$Ui$border = function (options) { 41332 return A3( 41333 $author$project$Internal$Model2$styleWith, 41334 $author$project$Internal$Flag$skip, 41335 'border-width', 41336 $elm$core$String$fromInt(options) + 'px'); 41337}; 41338var $author$project$Ui$borderColor = function (color) { 41339 return A3( 41340 $author$project$Internal$Model2$styleWith, 41341 $author$project$Internal$Flag$skip, 41342 'border-color', 41343 $author$project$Internal$Style2$color(color)); 41344}; 41345var $author$project$UI$Components$btnOutlineAttrs = _List_fromArray( 41346 [ 41347 $author$project$Ui$spacing($author$project$UI$Theme$spacing.qk), 41348 $author$project$Ui$contentCenterX, 41349 $author$project$Ui$contentCenterY, 41350 $author$project$Ui$background($author$project$UI$Theme$base.h$), 41351 $author$project$Ui$border($author$project$UI$Theme$border), 41352 $author$project$Ui$borderColor($author$project$UI$Theme$base.k3), 41353 $author$project$Ui$rounded($author$project$UI$Theme$radius.aW), 41354 A2($author$project$Ui$paddingXY, $author$project$UI$Theme$spacing.i8, $author$project$UI$Theme$spacing.aW), 41355 $author$project$Ui$Font$size($author$project$UI$Theme$font.aW), 41356 $author$project$Ui$Font$weight($author$project$UI$Theme$fontWeight.nI), 41357 $author$project$Ui$Font$color($author$project$UI$Theme$base.qI), 41358 $author$project$Ui$pointer 41359 ]); 41360var $elm$svg$Svg$rect = $elm$svg$Svg$trustedNode('rect'); 41361var $elm$svg$Svg$Attributes$rx = _VirtualDom_attribute('rx'); 41362var $elm$svg$Svg$Attributes$ry = _VirtualDom_attribute('ry'); 41363var $elm$svg$Svg$Attributes$x = _VirtualDom_attribute('x'); 41364var $elm$svg$Svg$Attributes$y = _VirtualDom_attribute('y'); 41365var $feathericons$elm_feather$FeatherIcons$copy = A2( 41366 $feathericons$elm_feather$FeatherIcons$makeBuilder, 41367 'copy', 41368 _List_fromArray( 41369 [ 41370 A2( 41371 $elm$svg$Svg$rect, 41372 _List_fromArray( 41373 [ 41374 $elm$svg$Svg$Attributes$x('9'), 41375 $elm$svg$Svg$Attributes$y('9'), 41376 $elm$svg$Svg$Attributes$width('13'), 41377 $elm$svg$Svg$Attributes$height('13'), 41378 $elm$svg$Svg$Attributes$rx('2'), 41379 $elm$svg$Svg$Attributes$ry('2') 41380 ]), 41381 _List_Nil), 41382 A2( 41383 $elm$svg$Svg$path, 41384 _List_fromArray( 41385 [ 41386 $elm$svg$Svg$Attributes$d('M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1') 41387 ]), 41388 _List_Nil) 41389 ])); 41390var $author$project$Ui$Font$noWrap = A2($author$project$Internal$Model2$style, 'white-space', 'nowrap'); 41391var $author$project$Page$ErrorLog$copyReportButton = F2( 41392 function (copyText, label) { 41393 return A2( 41394 $author$project$Ui$row, 41395 A2( 41396 $elm$core$List$cons, 41397 $author$project$Ui$width($author$project$Ui$shrink), 41398 A2( 41399 $elm$core$List$cons, 41400 $author$project$Ui$Font$noWrap, 41401 A2( 41402 $elm$core$List$cons, 41403 $author$project$Ui$inFront( 41404 A2( 41405 $author$project$Ui$el, 41406 _List_fromArray( 41407 [ 41408 $author$project$Ui$width($author$project$Ui$fill), 41409 $author$project$Ui$height($author$project$Ui$fill) 41410 ]), 41411 $author$project$Ui$html( 41412 A3( 41413 $elm$html$Html$node, 41414 'copy-button', 41415 _List_fromArray( 41416 [ 41417 A2($elm$html$Html$Attributes$attribute, 'data-copy', copyText), 41418 A2($elm$html$Html$Attributes$style, 'display', 'block'), 41419 A2($elm$html$Html$Attributes$style, 'width', '100%'), 41420 A2($elm$html$Html$Attributes$style, 'height', '100%'),
41421 A2($elm$html$Html$Attributes$style, 'cursor', 'pointer') 41422 ]), 41423 _List_Nil)))), 41424 $author$project$UI$Components$btnOutlineAttrs))), 41425 _List_fromArray( 41426 [ 41427 A2( 41428 $author$project$Ui$el, 41429 _List_fromArray( 41430 [ 41431 $author$project$Ui$width($author$project$Ui$shrink) 41432 ]), 41433 A2($author$project$UI$Components$featherIcon, 16, $feathericons$elm_feather$FeatherIcons$copy)), 41434 $author$project$Ui$text(label) 41435 ])); 41436 }); 41437var $author$project$Page$ErrorLog$encodeGroupSummary = function (summary) { 41438 return $elm$json$Json$Encode$object( 41439 _List_fromArray( 41440 [ 41441 _Utils_Tuple2( 41442 'id', 41443 $elm$json$Json$Encode$string(summary.m9)), 41444 _Utils_Tuple2( 41445 'name', 41446 $elm$json$Json$Encode$string(summary.bW)), 41447 _Utils_Tuple2( 41448 'memberCount', 41449 $elm$json$Json$Encode$int(summary.gL)), 41450 _Utils_Tuple2( 41451 'currency', 41452 $elm$json$Json$Encode$string( 41453 $author$project$Domain$Currency$currencyCode(summary.il))) 41454 ])); 41455}; 41456var $author$project$ErrorLog$severityToString = function (severity) { 41457 return 'error'; 41458}; 41459var $author$project$ErrorLog$sourceToString = function (source) { 41460 switch (source) { 41461 case 0: 41462 return 'sync'; 41463 case 1: 41464 return 'storage'; 41465 case 2: 41466 return 'server'; 41467 case 3: 41468 return 'push'; 41469 case 4: 41470 return 'pwa'; 41471 case 5: 41472 return 'import-export'; 41473 default: 41474 return 'identity'; 41475 } 41476}; 41477var $author$project$ErrorLog$encodeEntry = function (entry) { 41478 var base = _List_fromArray( 41479 [ 41480 _Utils_Tuple2( 41481 'timestamp', 41482 $elm$json$Json$Encode$int( 41483 $elm$time$Time$posixToMillis(entry.kD))), 41484 _Utils_Tuple2( 41485 'source', 41486 $elm$json$Json$Encode$string( 41487 $author$project$ErrorLog$sourceToString(entry.dY))), 41488 _Utils_Tuple2( 41489 'severity', 41490 $elm$json$Json$Encode$string( 41491 $author$project$ErrorLog$severityToString(entry.dN))), 41492 _Utils_Tuple2( 41493 'message', 41494 $elm$json$Json$Encode$string(entry.dv)) 41495 ]); 41496 return (entry.bH > 1) ? $elm$json$Json$Encode$object( 41497 A2( 41498 $elm$core$List$cons, 41499 _Utils_Tuple2( 41500 'count', 41501 $elm$json$Json$Encode$int(entry.bH)), 41502 base)) : $elm$json$Json$Encode$object(base); 41503}; 41504var $author$project$ErrorLog$toJsonValue = function (model) { 41505 return A2($elm$json$Json$Encode$list, $author$project$ErrorLog$encodeEntry, model.E); 41506}; 41507var $author$project$Page$ErrorLog$encodeDebugReport = function (config) { 41508 return $elm$json$Json$Encode$object( 41509 _List_fromArray( 41510 [ 41511 _Utils_Tuple2( 41512 'exportedAt', 41513 $elm$json$Json$Encode$int( 41514 $elm$time$Time$posixToMillis(config.ap))), 41515 _Utils_Tuple2( 41516 'errors', 41517 $author$project$ErrorLog$toJsonValue(config.bJ)), 41518 _Utils_Tuple2( 41519 'groups', 41520 A2($elm$json$Json$Encode$list, $author$project$Page$ErrorLog$encodeGroupSummary, config.eN)), 41521 _Utils_Tuple2( 41522 'language', 41523 $elm$json$Json$Encode$string( 41524 $author$project$Translations$languageToString( 41525 $author$project$Translations$currentLanguage(config.aJ)))), 41526 _Utils_Tuple2( 41527 'appState', 41528 $elm$json$Json$Encode$string(config.b)) 41529 ])); 41530}; 41531var $author$project$Translations$errorLogCopyReport = function (_v0) { 41532 var lang = _v0; 41533 if (!lang) { 41534 return 'Copy Debug Report'; 41535 } else { 41536 return 'Copier le rapport de debug'; 41537 } 41538}; 41539var $author$project$Translations$errorLogPrivacyNotice = function (_v0) { 41540 var lang = _v0; 41541 if (!lang) { 41542 return 'This debug report contains information about your groups (names, members, settings). By copying and sending it to the developer, you acknowledge this data will be visible to them.'; 41543 } else { 41544 return 'Ce rapport contient des informations sur tes groupes (noms, membres, paramètres). En le copiant et en l\'envoyant au développeur, tu reconnais que ces données lui seront visibles.'; 41545 } 41546}; 41547var $author$project$Translations$errorLogReportHint = function (_v0) { 41548 var lang = _v0; 41549 if (!lang) { 41550 return 'Copies the report to your clipboard and opens the feedback form â paste it into the description.'; 41551 } else { 41552 return 'Copie le rapport dans ton presse-papiers et ouvre le formulaire â colle-le dans la description.'; 41553 } 41554}; 41555var $author$project$Translations$errorLogReportIssue = function (_v0) { 41556 var lang = _v0; 41557 if (!lang) { 41558 return 'Report this issue'; 41559 } else { 41560 return 'Signaler ce problème'; 41561 } 41562}; 41563var $author$project$Translations$errorLogShareReport = function (_v0) { 41564 var lang = _v0; 41565 if (!lang) { 41566 return 'Share Debug Report'; 41567 } else { 41568 return 'Partager le rapport de debug'; 41569 } 41570}; 41571var $elm$svg$Svg$circle = $elm$svg$Svg$trustedNode('circle'); 41572var $elm$svg$Svg$Attributes$cx = _VirtualDom_attribute('cx'); 41573var $elm$svg$Svg$Attributes$cy = _VirtualDom_attribute('cy'); 41574var $elm$svg$Svg$Attributes$r = _VirtualDom_attribute('r'); 41575var $feathericons$elm_feather$FeatherIcons$share2 = A2( 41576 $feathericons$elm_feather$FeatherIcons$makeBuilder, 41577 'share-2', 41578 _List_fromArray( 41579 [ 41580 A2( 41581 $elm$svg$Svg$circle, 41582 _List_fromArray( 41583 [ 41584 $elm$svg$Svg$Attributes$cx('18'), 41585 $elm$svg$Svg$Attributes$cy('5'), 41586 $elm$svg$Svg$Attributes$r('3') 41587 ]), 41588 _List_Nil), 41589 A2( 41590 $elm$svg$Svg$circle, 41591 _List_fromArray( 41592 [ 41593 $elm$svg$Svg$Attributes$cx('6'), 41594 $elm$svg$Svg$Attributes$cy('12'), 41595 $elm$svg$Svg$Attributes$r('3') 41596 ]), 41597 _List_Nil), 41598 A2( 41599 $elm$svg$Svg$circle, 41600 _List_fromArray( 41601 [ 41602 $elm$svg$Svg$Attributes$cx('18'), 41603 $elm$svg$Svg$Attributes$cy('19'), 41604 $elm$svg$Svg$Attributes$r('3') 41605 ]), 41606 _List_Nil), 41607 A2( 41608 $elm$svg$Svg$line, 41609 _List_fromArray( 41610 [ 41611 $elm$svg$Svg$Attributes$x1('8.59'), 41612 $elm$svg$Svg$Attributes$y1('13.51'), 41613 $elm$svg$Svg$Attributes$x2('15.42'), 41614 $elm$svg$Svg$Attributes$y2('17.49') 41615 ]), 41616 _List_Nil), 41617 A2( 41618 $elm$svg$Svg$line, 41619 _List_fromArray( 41620 [ 41621 $elm$svg$Svg$Attributes$x1('15.41'), 41622 $elm$svg$Svg$Attributes$y1('6.51'), 41623 $elm$svg$Svg$Attributes$x2('8.59'), 41624 $elm$svg$Svg$Attributes$y2('10.49') 41625 ]), 41626 _List_Nil) 41627 ])); 41628var $author$project$Ui$withNoStylesheet = function (_v0) { 41629 var opts = _v0; 41630 return _Utils_update( 41631 opts, 41632 {eQ: false}); 41633}; 41634var $author$project$Page$ErrorLog$shareReportButton = F2( 41635 function (shareText, label) { 41636 return $author$project$Ui$html( 41637 A3( 41638 $elm$html$Html$node, 41639 'share-button', 41640 _List_fromArray( 41641 [ 41642 A2($elm$html$Html$Attributes$attribute, 'data-share-title', 'Partage Debug Report'), 41643 A2($elm$html$Html$Attributes$attribute, 'data-share-text', shareText) 41644 ]), 41645 _List_fromArray( 41646 [ 41647 A3( 41648 $author$project$Ui$layout, 41649 $author$project$Ui$withNoStylesheet($author$project$Ui$default), 41650 _List_Nil, 41651 A2( 41652 $author$project$Ui$row, 41653 A2( 41654 $elm$core$List$cons, 41655 $author$project$Ui$width($author$project$Ui$shrink), 41656 A2($elm$core$List$cons, $author$project$Ui$Font$noWrap, $author$project$UI$Components$btnOutlineAttrs)), 41657 _List_fromArray( 41658 [ 41659 A2( 41660 $author$project$Ui$el, 41661 _List_fromArray( 41662 [ 41663 $author$project$Ui$width($author$project$Ui$shrink) 41664 ]), 41665 A2($author$project$UI$Components$featherIcon, 16, $feathericons$elm_feather$FeatherIcons$share2)), 41666 $author$project$Ui$text(label) 41667 ]))) 41668 ]))); 41669 }); 41670var $author$project$Ui$wrap = A2($author$project$Internal$Model2$style, 'flex-wrap', 'wrap'); 41671var $author$project$Page$ErrorLog$debugReportSection = function (config) { 41672 var reportJson = A2( 41673 $elm$json$Json$Encode$encode, 41674 2, 41675 $author$project$Page$ErrorLog$encodeDebugReport(config)); 41676 return A2( 41677 $author$project$Ui$column, 41678 _List_fromArray( 41679 [ 41680 $author$project$Ui$spacing($author$project$UI$Theme$spacing.qk), 41681 $author$project$Ui$width($author$project$Ui$fill) 41682 ]), 41683 _List_fromArray( 41684 [ 41685 function () { 41686 var _v0 = config.oY; 41687 if (!_v0.$) { 41688 var onReport = _v0.a; 41689 return A2( 41690 $author$project$Ui$column, 41691 _List_fromArray( 41692 [ 41693 $author$project$Ui$spacing($author$project$UI$Theme$spacing.bb), 41694 $author$project$Ui$width($author$project$Ui$fill) 41695 ]), 41696 _List_fromArray( 41697 [ 41698 A2( 41699 $author$project$UI$Components$btnPrimary, 41700 _List_Nil, 41701 { 41702 i6: $author$project$Translations$errorLogReportIssue(config.aJ), 41703 e7: onReport(reportJson) 41704 }), 41705 A2( 41706 $author$project$Ui$el, 41707 _List_fromArray( 41708 [ 41709 $author$project$Ui$Font$size($author$project$UI$Theme$font.bb), 41710 $author$project$Ui$Font$color($author$project$UI$Theme$base.aM) 41711 ]), 41712 $author$project$Ui$text( 41713 $author$project$Translations$errorLogReportHint(config.aJ))) 41714 ])); 41715 } else { 41716 return $author$project$Ui$none; 41717 } 41718 }(), 41719 A2( 41720 $author$project$Ui$row, 41721 _List_fromArray( 41722 [ 41723 $author$project$Ui$wrap, 41724 $author$project$Ui$spacing($author$project$UI$Theme$spacing.qk), 41725 $author$project$Ui$width($author$project$Ui$fill) 41726 ]), 41727 _List_fromArray( 41728 [ 41729 A2( 41730 $author$project$Page$ErrorLog$copyReportButton, 41731 reportJson, 41732 $author$project$Translations$errorLogCopyReport(config.aJ)), 41733 A2( 41734 $author$project$Page$ErrorLog$shareReportButton, 41735 reportJson, 41736 $author$project$Translations$errorLogShareReport(config.aJ)) 41737 ])), 41738 A2( 41739 $author$project$Ui$el, 41740 _List_fromArray( 41741 [ 41742 $author$project$Ui$Font$size($author$project$UI$Theme$font.bb), 41743 $author$project$Ui$Font$color($author$project$UI$Theme$base.aM) 41744 ]), 41745 $author$project$Ui$text( 41746 $author$project$Translations$errorLogPrivacyNotice(config.aJ))) 41747 ])); 41748}; 41749var $author$project$Translations$errorLogEmpty = function (_v0) { 41750 var lang = _v0; 41751 if (!lang) { 41752 return 'No errors recorded.'; 41753 } else { 41754 return 'Aucune erreur enregistrée.'; 41755 } 41756}; 41757var $author$project$Internal$Style2$floatPx = function (x) { 41758 return $elm$core$String$fromFloat(x) + 'px'; 41759}; 41760var $author$project$Internal$Style2$pent = F5( 41761 function (one, two, three, four, five) { 41762 return one + (' ' + (two + (' ' + (three + (' ' + (four + (' ' + five))))))); 41763 }); 41764var $author$project$Internal$Style2$singleShadow = function (shadow) { 41765 return A5( 41766 $author$project$Internal$Style2$pent, 41767 $author$project$Internal$Style2$floatPx(shadow.rm), 41768 $author$project$Internal$Style2$floatPx(shadow.k0), 41769 $author$project$Internal$Style2$floatPx(shadow.h1), 41770 $author$project$Internal$Style2$floatPx(shadow.dW), 41771 $author$project$Internal$Style2$color(shadow.ic)); 41772}; 41773var $author$project$Ui$Shadow$shadows = function (shades) { 41774 return A2( 41775 $author$project$Internal$Model2$style, 41776 'box-shadow', 41777 A2( 41778 $elm$core$String$join, 41779 ', ', 41780 A2($elm$core$List$map, $author$project$Internal$Style2$singleShadow, shades))); 41781}; 41782var $author$project$UI$Theme$shadow = $author$project$Ui$Shadow$shadows( 41783 _List_fromArray( 41784 [ 41785 {
41786 h1: 12, 41787 ic: A4($author$project$Ui$rgba, 45, 45, 45, 0.06), 41788 dW: 0, 41789 rm: 0, 41790 k0: 2 41791 }, 41792 { 41793 h1: 3, 41794 ic: A4($author$project$Ui$rgba, 45, 45, 45, 0.04), 41795 dW: 0, 41796 rm: 0, 41797 k0: 1 41798 } 41799 ])); 41800var $author$project$UI$Components$card = F2( 41801 function (attrs, children) { 41802 return A2( 41803 $author$project$Ui$column, 41804 _Utils_ap( 41805 _List_fromArray( 41806 [ 41807 $author$project$Ui$background( 41808 A3($author$project$Ui$rgb, 255, 255, 255)), 41809 $author$project$Ui$rounded($author$project$UI$Theme$radius.i8), 41810 $author$project$UI$Theme$shadow, 41811 $author$project$Ui$border($author$project$UI$Theme$border), 41812 $author$project$Ui$borderColor($author$project$UI$Theme$base.k3), 41813 $author$project$Ui$width($author$project$Ui$fill) 41814 ]), 41815 attrs), 41816 children); 41817 }); 41818var $elm$time$Time$toHour = F2( 41819 function (zone, time) { 41820 return A2( 41821 $elm$core$Basics$modBy, 41822 24, 41823 A2( 41824 $elm$time$Time$flooredDiv, 41825 A2($elm$time$Time$toAdjustedMinutes, zone, time), 41826 60)); 41827 }); 41828var $elm$time$Time$toMinute = F2( 41829 function (zone, time) { 41830 return A2( 41831 $elm$core$Basics$modBy, 41832 60, 41833 A2($elm$time$Time$toAdjustedMinutes, zone, time)); 41834 }); 41835var $elm$time$Time$toSecond = F2( 41836 function (_v0, time) { 41837 return A2( 41838 $elm$core$Basics$modBy, 41839 60, 41840 A2( 41841 $elm$time$Time$flooredDiv, 41842 $elm$time$Time$posixToMillis(time), 41843 1000)); 41844 }); 41845var $author$project$Page$ErrorLog$formatTimestamp = F2( 41846 function (zone, posix) { 41847 var pad = function (n) { 41848 return A3( 41849 $elm$core$String$padLeft, 41850 2, 41851 '0', 41852 $elm$core$String$fromInt(n)); 41853 }; 41854 return pad( 41855 A2($elm$time$Time$toHour, zone, posix)) + (':' + (pad( 41856 A2($elm$time$Time$toMinute, zone, posix)) + (':' + pad( 41857 A2($elm$time$Time$toSecond, zone, posix))))); 41858 }); 41859var $author$project$Page$ErrorLog$severityDot = function (severity) { 41860 var color = $author$project$UI$Theme$danger.kl; 41861 return A2( 41862 $author$project$Ui$el, 41863 _List_fromArray( 41864 [ 41865 $author$project$Ui$width( 41866 $author$project$Ui$px(8)), 41867 $author$project$Ui$height( 41868 $author$project$Ui$px(8)), 41869 $author$project$Ui$rounded(4), 41870 $author$project$Ui$background(color), 41871 $author$project$Ui$width($author$project$Ui$shrink) 41872 ]), 41873 $author$project$Ui$none); 41874}; 41875var $author$project$Page$ErrorLog$sourceBadge = function (source) { 41876 return A2( 41877 $author$project$Ui$el, 41878 _List_fromArray( 41879 [ 41880 $author$project$Ui$Font$size($author$project$UI$Theme$font.bb), 41881 $author$project$Ui$Font$color($author$project$UI$Theme$primary.qI), 41882 $author$project$Ui$Font$weight($author$project$UI$Theme$fontWeight.dL) 41883 ]), 41884 $author$project$Ui$text( 41885 $author$project$ErrorLog$sourceToString(source))); 41886}; 41887var $author$project$Page$ErrorLog$viewEntry = F2( 41888 function (zone, entry) { 41889 return A2( 41890 $author$project$UI$Components$card, 41891 _List_fromArray( 41892 [ 41893 $author$project$Ui$padding($author$project$UI$Theme$spacing.aW) 41894 ]), 41895 _List_fromArray( 41896 [ 41897 A2( 41898 $author$project$Ui$column, 41899 _List_fromArray( 41900 [ 41901 $author$project$Ui$spacing($author$project$UI$Theme$spacing.bb), 41902 $author$project$Ui$width($author$project$Ui$fill) 41903 ]), 41904 _List_fromArray( 41905 [ 41906 A2( 41907 $author$project$Ui$row, 41908 _List_fromArray( 41909 [ 41910 $author$project$Ui$spacing($author$project$UI$Theme$spacing.qk), 41911 $author$project$Ui$width($author$project$Ui$fill), 41912 $author$project$Ui$contentCenterY 41913 ]), 41914 _List_fromArray( 41915 [ 41916 $author$project$Page$ErrorLog$severityDot(entry.dN), 41917 $author$project$Page$ErrorLog$sourceBadge(entry.dY), 41918 A2( 41919 $author$project$Ui$el, 41920 _List_fromArray( 41921 [ 41922 $author$project$Ui$Font$size($author$project$UI$Theme$font.bb), 41923 $author$project$Ui$Font$color($author$project$UI$Theme$base.aM), 41924 $author$project$Ui$alignRight 41925 ]), 41926 $author$project$Ui$text( 41927 A2($author$project$Page$ErrorLog$formatTimestamp, zone, entry.kD))) 41928 ])), 41929 A2( 41930 $author$project$Ui$row, 41931 _List_fromArray( 41932 [ 41933 $author$project$Ui$spacing($author$project$UI$Theme$spacing.qk), 41934 $author$project$Ui$width($author$project$Ui$fill) 41935 ]), 41936 _List_fromArray( 41937 [ 41938 A2( 41939 $author$project$Ui$el, 41940 _List_fromArray( 41941 [ 41942 $author$project$Ui$Font$size($author$project$UI$Theme$font.qk), 41943 $author$project$Ui$Font$color($author$project$UI$Theme$base.qI), 41944 $author$project$Ui$width($author$project$Ui$fill) 41945 ]), 41946 $author$project$Ui$text(entry.dv)), 41947 (entry.bH > 1) ? A2( 41948 $author$project$Ui$el, 41949 _List_fromArray( 41950 [ 41951 $author$project$Ui$Font$size($author$project$UI$Theme$font.bb), 41952 $author$project$Ui$Font$color($author$project$UI$Theme$base.aM), 41953 $author$project$Ui$alignRight, 41954 $author$project$Ui$width($author$project$Ui$shrink) 41955 ]), 41956 $author$project$Ui$text( 41957 'Ã' + $elm$core$String$fromInt(entry.bH))) : $author$project$Ui$none 41958 ])) 41959 ])) 41960 ])); 41961 }); 41962var $author$project$Page$ErrorLog$entriesSection = function (config) { 41963 return $elm$core$List$isEmpty(config.bJ.E) ? A2( 41964 $author$project$Ui$el, 41965 _List_fromArray( 41966 [ 41967 $author$project$Ui$Font$size($author$project$UI$Theme$font.qk), 41968 $author$project$Ui$Font$color($author$project$UI$Theme$base.aM), 41969 $author$project$Ui$centerX, 41970 $author$project$Ui$padding($author$project$UI$Theme$spacing.hE) 41971 ]), 41972 $author$project$Ui$text( 41973 $author$project$Translations$errorLogEmpty(config.aJ))) : A2( 41974 $author$project$Ui$column, 41975 _List_fromArray( 41976 [ 41977 $author$project$Ui$spacing($author$project$UI$Theme$spacing.qk), 41978 $author$project$Ui$width($author$project$Ui$fill) 41979 ]), 41980 A2( 41981 $elm$core$List$map, 41982 $author$project$Page$ErrorLog$viewEntry(config.al),
41983 config.bJ.E)); 41984}; 41985var $author$project$Page$ErrorLog$view = function (config) { 41986 return A2( 41987 $author$project$Ui$column, 41988 _List_fromArray( 41989 [ 41990 $author$project$Ui$spacing($author$project$UI$Theme$spacing.hE), 41991 $author$project$Ui$width($author$project$Ui$fill), 41992 A2($author$project$Ui$paddingXY, 0, $author$project$UI$Theme$spacing.aW) 41993 ]), 41994 _List_fromArray( 41995 [ 41996 $author$project$Page$ErrorLog$debugReportSection(config), 41997 $author$project$Page$ErrorLog$entriesSection(config) 41998 ])); 41999}; 42000var $author$project$Translations$initErrorTitle = function (_v0) { 42001 var lang = _v0; 42002 if (!lang) { 42003 return 'Error'; 42004 } else { 42005 return 'Erreur'; 42006 } 42007}; 42008var $author$project$Page$InitError$view = F2( 42009 function (i18n, errorMsg) { 42010 return A2( 42011 $author$project$Ui$column, 42012 _List_fromArray( 42013 [ 42014 $author$project$Ui$spacing($author$project$UI$Theme$spacing.i8), 42015 $author$project$Ui$centerX, 42016 A2($author$project$Ui$paddingXY, 0, $author$project$UI$Theme$spacing.rn) 42017 ]), 42018 _List_fromArray( 42019 [ 42020 A2( 42021 $author$project$Ui$el, 42022 _List_fromArray( 42023 [ 42024 $author$project$Ui$Font$size($author$project$UI$Theme$font.rn), 42025 $author$project$Ui$Font$weight($author$project$UI$Theme$fontWeight.lD), 42026 $author$project$Ui$Font$color($author$project$UI$Theme$danger.qI), 42027 $author$project$Ui$centerX 42028 ]), 42029 $author$project$Ui$text( 42030 $author$project$Translations$initErrorTitle(i18n))), 42031 A2( 42032 $author$project$UI$Components$card, 42033 _List_fromArray( 42034 [ 42035 $author$project$Ui$padding($author$project$UI$Theme$spacing.i8) 42036 ]), 42037 _List_fromArray( 42038 [ 42039 A2( 42040 $author$project$Ui$el, 42041 _List_fromArray( 42042 [ 42043 $author$project$Ui$Font$size($author$project$UI$Theme$font.aW), 42044 $author$project$Ui$Font$color($author$project$UI$Theme$base.qI) 42045 ]), 42046 $author$project$Ui$text(errorMsg)) 42047 ])) 42048 ])); 42049 }); 42050var $author$project$Translations$loadingApp = function (_v0) { 42051 var lang = _v0; 42052 if (!lang) { 42053 return 'Loading...'; 42054 } else { 42055 return 'Chargement...'; 42056 } 42057}; 42058var $author$project$Page$Loading$view = function (i18n) { 42059 return A2( 42060 $author$project$Ui$el, 42061 _List_fromArray( 42062 [ 42063 $author$project$Ui$width($author$project$Ui$fill), 42064 $author$project$Ui$height($author$project$Ui$fill) 42065 ]), 42066 A2( 42067 $author$project$Ui$el, 42068 _List_fromArray( 42069 [ 42070 $author$project$Ui$centerX, 42071 $author$project$Ui$centerY, 42072 $author$project$Ui$Font$size($author$project$UI$Theme$font.i8), 42073 $author$project$Ui$Font$color($author$project$UI$Theme$base.aM) 42074 ]), 42075 $author$project$Ui$text( 42076 $author$project$Translations$loadingApp(i18n)))); 42077}; 42078var $author$project$Main$AboutMsg = function (a) { 42079 return {$: 31, a: a}; 42080}; 42081var $author$project$Main$ImportSplitwiseMsg = function (a) { 42082 return {$: 14, a: a}; 42083}; 42084var $author$project$Main$JoinGroupMsg = function (a) { 42085 return {$: 23, a: a}; 42086}; 42087var $author$project$Main$MarkChangelogSeen = {$: 38}; 42088var $author$project$Main$MoveMsg = function (a) { 42089 return {$: 16, a: a}; 42090}; 42091var $author$project$Main$ReceiveMsg = function (a) { 42092 return {$: 20, a: a}; 42093}; 42094var $author$project$Main$ResetFeedbackPrompts = {$: 37}; 42095var $author$project$Main$RetryJoinFetch = {$: 24}; 42096var $author$project$Main$SwitchLanguage = function (a) { 42097 return {$: 4, a: a}; 42098}; 42099var $author$project$Main$ToggleDevMode = {$: 36}; 42100var $author$project$Translations$aboutTitle = function (_v0) { 42101 var lang = _v0; 42102 if (!lang) { 42103 return 'About Partage'; 42104 } else { 42105 return 'à propos de Partage'; 42106 } 42107}; 42108var $author$project$Main$displayDomain = function (url) { 42109 return A2( 42110 $elm$core$Maybe$withDefault, 42111 url, 42112 A2( 42113 $elm$core$Maybe$map, 42114 function ($) { 42115 return $.m5; 42116 }, 42117 $elm$url$Url$fromString(url))); 42118}; 42119var $author$project$PwaState$EnableNotifications = {$: 5}; 42120var $author$project$PwaState$enableNotificationsMsg = $author$project$PwaState$EnableNotifications; 42121var $author$project$ImportExport$ExportGroupCsv = function (a) { 42122 return {$: 1, a: a}; 42123}; 42124var $author$project$ImportExport$exportCsvMsg = $author$project$ImportExport$ExportGroupCsv; 42125var $author$project$ImportExport$ExportGroup = function (a) { 42126 return {$: 0, a: a}; 42127}; 42128var $author$project$ImportExport$exportMsg = $author$project$ImportExport$ExportGroup; 42129var $author$project$Main$GenerateIdentity = {$: 5}; 42130var $author$project$Translations$joinGroupRetry = function (_v0) { 42131 var lang = _v0; 42132 if (!lang) { 42133 return 'Try again'; 42134 } else { 42135 return 'Réessayer'; 42136 } 42137}; 42138var $author$project$Main$identityBootstrapView = F2( 42139 function (i18n, identityTask) { 42140 if (identityTask.$ === 2) { 42141 var message = identityTask.a; 42142 return A2( 42143 $author$project$Ui$column, 42144 _List_fromArray( 42145 [ 42146 $author$project$Ui$centerX, 42147 $author$project$Ui$spacing($author$project$UI$Theme$spacing.i8), 42148 A2($author$project$Ui$paddingXY, 0, $author$project$UI$Theme$spacing.rn) 42149 ]), 42150 _List_fromArray( 42151 [ 42152 A2( 42153 $author$project$UI$Components$card, 42154 _List_fromArray( 42155 [ 42156 $author$project$Ui$padding($author$project$UI$Theme$spacing.i8) 42157 ]), 42158 _List_fromArray( 42159 [ 42160 A2( 42161 $author$project$Ui$el, 42162 _List_fromArray( 42163 [ 42164 $author$project$Ui$Font$size($author$project$UI$Theme$font.aW), 42165 $author$project$Ui$Font$color($author$project$UI$Theme$danger.qI) 42166 ]), 42167 $author$project$Ui$text(message)) 42168 ])), 42169 A2( 42170 $author$project$UI$Components$btnPrimary, 42171 _List_fromArray( 42172 [$author$project$Ui$centerX]), 42173 { 42174 i6: $author$project$Translations$joinGroupRetry(i18n), 42175 e7: $author$project$Main$GenerateIdentity 42176 }) 42177 ])); 42178 } else { 42179 return $author$project$Page$Loading$view(i18n); 42180 } 42181 }); 42182var $author$project$Translations$moveNoTarget = function (_v0) { 42183 var lang = _v0; 42184 if (!lang) { 42185 return 'This deployment is not moving anywhere; there is nothing to do here.'; 42186 } else { 42187 return 'Cette instance ne migre nulle part ; il n\'y a rien à faire ici.'; 42188 } 42189}; 42190var $author$project$Translations$moveTitle = function (_v0) { 42191 var lang = _v0; 42192 if (!lang) { 42193 return 'Moving out'; 42194 } else { 42195 return 'Migration'; 42196 } 42197}; 42198var $author$project$PwaState$notificationUnavailable = function (model) { 42199 var _v0 = model.a_; 42200 if (_v0.$ === 2) { 42201 return true; 42202 } else { 42203 return false;
42204 } 42205}; 42206var $author$project$PwaState$pushIsActive = function (model) { 42207 return _Utils_eq( 42208 model.jr, 42209 $elm$core$Maybe$Just(0)) && (!_Utils_eq(model.jS, $elm$core$Maybe$Nothing)); 42210}; 42211var $author$project$Translations$receiveTitle = function (_v0) { 42212 var lang = _v0; 42213 if (!lang) { 42214 return 'Moving in'; 42215 } else { 42216 return 'Migration'; 42217 } 42218}; 42219var $author$project$Translations$shellJoinGroup = function (_v0) { 42220 var lang = _v0; 42221 if (!lang) { 42222 return 'Join Group'; 42223 } else { 42224 return 'Rejoindre'; 42225 } 42226}; 42227var $author$project$Translations$shellNewGroup = function (_v0) { 42228 var lang = _v0; 42229 if (!lang) { 42230 return 'New Group'; 42231 } else { 42232 return 'Nouveau groupe'; 42233 } 42234}; 42235var $author$project$Translations$splitwiseImportTitle = function (_v0) { 42236 var lang = _v0; 42237 if (!lang) { 42238 return 'Import from Splitwise'; 42239 } else { 42240 return 'Importer depuis Splitwise'; 42241 } 42242}; 42243var $author$project$UI$Components$changelogPath = function (i18n) { 42244 return '/' + ($author$project$Translations$languageToString( 42245 $author$project$Translations$currentLanguage(i18n)) + '/changelog/'); 42246}; 42247var $author$project$Translations$changelogTitle = function (_v0) { 42248 var lang = _v0; 42249 if (!lang) { 42250 return 'What\'s new'; 42251 } else { 42252 return 'Nouveautés'; 42253 } 42254}; 42255var $feathericons$elm_feather$FeatherIcons$gift = A2( 42256 $feathericons$elm_feather$FeatherIcons$makeBuilder, 42257 'gift', 42258 _List_fromArray( 42259 [ 42260 A2( 42261 $elm$svg$Svg$polyline, 42262 _List_fromArray( 42263 [ 42264 $elm$svg$Svg$Attributes$points('20 12 20 22 4 22 4 12') 42265 ]), 42266 _List_Nil), 42267 A2( 42268 $elm$svg$Svg$rect, 42269 _List_fromArray( 42270 [ 42271 $elm$svg$Svg$Attributes$x('2'), 42272 $elm$svg$Svg$Attributes$y('7'), 42273 $elm$svg$Svg$Attributes$width('20'), 42274 $elm$svg$Svg$Attributes$height('5') 42275 ]), 42276 _List_Nil), 42277 A2( 42278 $elm$svg$Svg$line, 42279 _List_fromArray( 42280 [ 42281 $elm$svg$Svg$Attributes$x1('12'), 42282 $elm$svg$Svg$Attributes$y1('22'), 42283 $elm$svg$Svg$Attributes$x2('12'), 42284 $elm$svg$Svg$Attributes$y2('7') 42285 ]), 42286 _List_Nil), 42287 A2( 42288 $elm$svg$Svg$path, 42289 _List_fromArray( 42290 [ 42291 $elm$svg$Svg$Attributes$d('M12 7H7.5a2.5 2.5 0 0 1 0-5C11 2 12 7 12 7z') 42292 ]), 42293 _List_Nil), 42294 A2( 42295 $elm$svg$Svg$path, 42296 _List_fromArray( 42297 [ 42298 $elm$svg$Svg$Attributes$d('M12 7h4.5a2.5 2.5 0 0 0 0-5C13 2 12 7 12 7z') 42299 ]), 42300 _List_Nil) 42301 ])); 42302var $author$project$Ui$Events$onClick = function (msg) { 42303 return $author$project$Internal$Model2$attribute( 42304 $elm$html$Html$Events$onClick(msg)); 42305}; 42306var $elm$html$Html$Attributes$rel = _VirtualDom_attribute('rel'); 42307var $author$project$UI$Components$keepOriginReferrer = _List_fromArray( 42308 [ 42309 $author$project$Ui$htmlAttribute( 42310 $elm$html$Html$Attributes$rel('noopener')), 42311 $author$project$Ui$htmlAttribute( 42312 A2($elm$html$Html$Attributes$attribute, 'referrerpolicy', 'origin')) 42313 ]); 42314var $elm$html$Html$Attributes$download = function (fileName) { 42315 return A2($elm$html$Html$Attributes$stringProperty, 'download', fileName); 42316}; 42317var $elm$html$Html$Attributes$href = function (url) { 42318 return A2( 42319 $elm$html$Html$Attributes$stringProperty, 42320 'href', 42321 _VirtualDom_noJavaScriptUri(url)); 42322}; 42323var $elm$html$Html$Attributes$target = $elm$html$Html$Attributes$stringProperty('target'); 42324var $author$project$Internal$Model2$link = function (details) { 42325 return _List_fromArray( 42326 [ 42327 { 42328 g: { 42329 q: $author$project$Internal$BitField$none, 42330 ei: _List_fromArray( 42331 [ 42332 $elm$html$Html$Attributes$href(details.kS), 42333 function () { 42334 var _v0 = details.iq; 42335 if (_v0.$ === 1) { 42336 return $elm$html$Html$Attributes$rel('noopener noreferrer'); 42337 } else { 42338 return $elm$html$Html$Attributes$class(''); 42339 } 42340 }(), 42341 function () { 42342 var _v1 = details.iq; 42343 if (_v1.$ === 1) { 42344 return details.n4 ? $elm$html$Html$Attributes$target('_blank') : $elm$html$Html$Attributes$class(''); 42345 } else { 42346 var downloadName = _v1.a; 42347 return $elm$html$Html$Attributes$download(downloadName); 42348 } 42349 }() 42350 ]), 42351 f: $elm$core$Maybe$Nothing, 42352 j: _List_Nil, 42353 o: $author$project$Internal$Model2$NodeAsLink, 42354 p: $author$project$Internal$Model2$noStyles 42355 }, 42356 h: $author$project$Internal$Flag$skip 42357 } 42358 ]); 42359}; 42360var $author$project$Ui$linkNewTab = function (uri) { 42361 return $author$project$Internal$Model2$link( 42362 {iq: $elm$core$Maybe$Nothing, n4: true, kS: uri}); 42363}; 42364var $author$project$UI$Components$staticPageNewTabLinkAttrs = function (href) { 42365 return A2( 42366 $elm$core$List$cons, 42367 $author$project$Ui$linkNewTab(href), 42368 $author$project$UI$Components$keepOriginReferrer); 42369}; 42370var $author$project$Page$About$changelogLink = F2( 42371 function (i18n, onOpen) { 42372 return A2( 42373 $author$project$Ui$row, 42374 A2( 42375 $elm$core$List$cons, 42376 $author$project$Ui$centerX, 42377 A2( 42378 $elm$core$List$cons, 42379 $author$project$Ui$spacing($author$project$UI$Theme$spacing.bb), 42380 A2( 42381 $elm$core$List$cons, 42382 $author$project$Ui$Font$size($author$project$UI$Theme$font.qk), 42383 A2( 42384 $elm$core$List$cons, 42385 $author$project$Ui$Font$weight($author$project$UI$Theme$fontWeight.dL), 42386 A2( 42387 $elm$core$List$cons, 42388 $author$project$Ui$Font$color($author$project$UI$Theme$primary.qI), 42389 A2( 42390 $elm$core$List$cons, 42391 $author$project$Ui$contentCenterY, 42392 A2( 42393 $elm$core$List$cons, 42394 $author$project$Ui$pointer, 42395 A2( 42396 $elm$core$List$cons, 42397 $author$project$Ui$Events$onClick(onOpen), 42398 $author$project$UI$Components$staticPageNewTabLinkAttrs( 42399 $author$project$UI$Components$changelogPath(i18n)))))))))), 42400 _List_fromArray( 42401 [ 42402 A2($author$project$UI$Components$featherIcon, 16, $feathericons$elm_feather$FeatherIcons$gift), 42403 $author$project$Ui$text( 42404 $author$project$Translations$changelogTitle(i18n)) 42405 ])); 42406 }); 42407var $author$project$Translations$aboutDescription = function (_v0) { 42408 var lang = _v0; 42409 if (!lang) { 42410 return 'A fully encrypted, local-first bill-splitting application for trusted groups.'; 42411 } else { 42412 return 'Une application libre de partage de frais, chiffrée de bout en bout, pour gérer tes dépenses de groupe sans prise de tête.'; 42413 } 42414}; 42415var $author$project$Page$About$descriptionSection = function (i18n) { 42416 return A2( 42417 $author$project$Ui$el, 42418 _List_fromArray( 42419 [ 42420 $author$project$Ui$centerX, 42421 $author$project$Ui$Font$size($author$project$UI$Theme$font.aW), 42422 $author$project$Ui$Font$color($author$project$UI$Theme$base.qI), 42423 $author$project$Ui$Font$center 42424 ]), 42425 $author$project$Ui$text( 42426 $author$project$Translations$aboutDescription(i18n))); 42427}; 42428var $author$project$Translations$aboutDevModeHint = function (_v0) { 42429 var lang = _v0; 42430 if (!lang) { 42431 return 'Reveals the notification server, the sections below, and a diagnostics view in each group\'s settings.'; 42432 } else { 42433 return 'Révèle le serveur de notifications, les sections ci-dessous et une vue diagnostics dans les paramètres de chaque groupe.'; 42434 } 42435}; 42436var $author$project$Translations$aboutDevModeLabel = function (_v0) { 42437 var lang = _v0; 42438 if (!lang) { 42439 return 'Developer mode'; 42440 } else { 42441 return 'Mode développeur'; 42442 } 42443}; 42444var $author$project$UI$Theme$letterSpacing = {oe: 0, qP: -0.02, kY: 0.06}; 42445var $author$project$Ui$Font$letterSpacing = function (offset) { 42446 return A2( 42447 $author$project$Internal$Model2$style, 42448 'letter-spacing', 42449 $elm$core$String$fromFloat(offset) + 'px'); 42450}; 42451var $author$project$UI$Components$sectionLabelAttrs = _List_fromArray( 42452 [ 42453 $author$project$Ui$Font$size($author$project$UI$Theme$font.bb), 42454 $author$project$Ui$Font$weight($author$project$UI$Theme$fontWeight.dL), 42455 $author$project$Ui$Font$letterSpacing($author$project$UI$Theme$letterSpacing.kY), 42456 $author$project$Ui$Font$color($author$project$UI$Theme$base.aM), 42457 $author$project$Ui$paddingBottom($author$project$UI$Theme$spacing.aW) 42458 ]); 42459var $author$project$UI$Components$sectionLabel = function (label) { 42460 return A2( 42461 $author$project$Ui$el, 42462 $author$project$UI$Components$sectionLabelAttrs, 42463 $author$project$Ui$text( 42464 $elm$core$String$toUpper(label))); 42465}; 42466var $author$project$InternalAnim$Css$ColorProp = F2( 42467 function (a, b) { 42468 return {$: 1, a: a, b: b}; 42469 }); 42470var $author$project$InternalAnim$Move$Pos = F3( 42471 function (a, b, c) {
42472 return {$: 0, a: a, b: b, c: c}; 42473 }); 42474var $author$project$InternalAnim$Transition$Transition = function (a) { 42475 return {$: 0, a: a}; 42476}; 42477var $mdgriffith$elm_bezier$Bezier$Spline = F4( 42478 function (a, b, c, d) { 42479 return {$: 0, a: a, b: b, c: c, d: d}; 42480 }); 42481var $mdgriffith$elm_bezier$Bezier$fromPoints = $mdgriffith$elm_bezier$Bezier$Spline; 42482var $mdgriffith$elm_bezier$Bezier$standard = A4( 42483 $mdgriffith$elm_bezier$Bezier$fromPoints, 42484 {rm: 0, k0: 0}, 42485 {rm: 0.4, k0: 0}, 42486 {rm: 0.2, k0: 1}, 42487 {rm: 1, k0: 1}); 42488var $author$project$InternalAnim$Transition$standard = $author$project$InternalAnim$Transition$Transition($mdgriffith$elm_bezier$Bezier$standard); 42489var $author$project$InternalAnim$Move$to = function (v) { 42490 return A3($author$project$InternalAnim$Move$Pos, $author$project$InternalAnim$Transition$standard, v, _List_Nil); 42491}; 42492var $author$project$Animator$color = F2( 42493 function (name, colorValue) { 42494 return A2( 42495 $author$project$InternalAnim$Css$ColorProp, 42496 name, 42497 $author$project$InternalAnim$Move$to(colorValue)); 42498 }); 42499var $author$project$Ui$Anim$backgroundColor = function (clr) { 42500 return A2($author$project$Animator$color, 'background-color', clr); 42501}; 42502var $author$project$InternalAnim$Transition$bezier = F4( 42503 function (one, two, three, four) { 42504 return $author$project$InternalAnim$Transition$Transition( 42505 A4( 42506 $mdgriffith$elm_bezier$Bezier$fromPoints, 42507 {rm: 0, k0: 0}, 42508 {rm: one, k0: two}, 42509 {rm: three, k0: four}, 42510 {rm: 1, k0: 1})); 42511 }); 42512var $author$project$Animator$Transition$bezier = $author$project$InternalAnim$Transition$bezier; 42513var $author$project$Ui$Anim$bezier = F4( 42514 function (one, two, three, four) { 42515 return A4($author$project$Animator$Transition$bezier, one, two, three, four); 42516 }); 42517var $author$project$InternalAnim$Quantity$Quantity = $elm$core$Basics$identity; 42518var $author$project$InternalAnim$Duration$milliseconds = function (numMilliseconds) { 42519 return 0.001 * numMilliseconds; 42520}; 42521var $author$project$Animator$ms = $author$project$InternalAnim$Duration$milliseconds; 42522var $author$project$Ui$Anim$ms = $author$project$Animator$ms; 42523var $author$project$UI$Theme$shadowKnob = $author$project$Ui$Shadow$shadows( 42524 _List_fromArray( 42525 [ 42526 { 42527 h1: 3, 42528 ic: A4($author$project$Ui$rgba, 0, 0, 0, 0.15), 42529 dW: 0, 42530 rm: 0, 42531 k0: 1 42532 } 42533 ])); 42534var $author$project$Internal$Model2$styleList = function (props) { 42535 return _List_fromArray( 42536 [ 42537 { 42538 g: { 42539 q: $author$project$Internal$BitField$none, 42540 ei: _List_Nil, 42541 f: $elm$core$Maybe$Nothing, 42542 j: _List_Nil, 42543 o: $author$project$Internal$Model2$NodeAsDiv, 42544 p: F2( 42545 function (_v0, _v1) { 42546 return props; 42547 }) 42548 }, 42549 h: $author$project$Internal$Flag$skip 42550 } 42551 ]); 42552}; 42553var $author$project$Animator$joinOn = F3( 42554 function (divider, f, list) { 42555 if (!list.b) { 42556 return ''; 42557 } else { 42558 if (!list.b.b) { 42559 var fst = list.a; 42560 return f(fst); 42561 } else { 42562 var fst = list.a; 42563 var rest = list.b; 42564 return _Utils_ap( 42565 f(fst), 42566 _Utils_ap( 42567 divider, 42568 A3($author$project$Animator$joinOn, divider, f, rest))); 42569 } 42570 } 42571 }); 42572var $author$project$InternalAnim$Css$emptyAnim = {cc: '', iR: '', $7: '', fi: _List_Nil, kM: ''}; 42573var $author$project$InternalAnim$Css$Props$ones = ~0; 42574var $author$project$InternalAnim$Css$Props$top8 = $author$project$InternalAnim$Css$Props$ones >>> (32 - 8); 42575var $author$project$InternalAnim$Css$Props$encode4 = F4( 42576 function (one, two, three, four) { 42577 return (($author$project$InternalAnim$Css$Props$top8 & $elm$core$Basics$round(four * 255)) << 24) | ((($author$project$InternalAnim$Css$Props$top8 & $elm$core$Basics$round(three * 255)) << 16) | ((($author$project$InternalAnim$Css$Props$top8 & $elm$core$Basics$round(two * 255)) << 8) | ($author$project$InternalAnim$Css$Props$top8 & $elm$core$Basics$round(one * 255)))); 42578 }); 42579var $avh4$elm_color$Color$toRgba = function (_v0) { 42580 var r = _v0.a; 42581 var g = _v0.b; 42582 var b = _v0.c; 42583 var a = _v0.d; 42584 return {lm: a, lC: b, mQ: g, pN: r}; 42585}; 42586var $author$project$InternalAnim$Css$Props$colorHash = function (color) { 42587 var rgba = $avh4$elm_color$Color$toRgba(color); 42588 return $elm$core$String$fromInt( 42589 A4($author$project$InternalAnim$Css$Props$encode4, rgba.pN, rgba.mQ, rgba.lC, rgba.lm)); 42590}; 42591var $author$project$InternalAnim$Css$combine = F2( 42592 function (one, two) { 42593 return ($elm$core$String$isEmpty(one.iR) && $elm$core$List$isEmpty(one.fi)) ? two : (($elm$core$String$isEmpty(two.iR) && $elm$core$List$isEmpty(two.fi)) ? one : { 42594 cc: function () { 42595 var _v0 = one.cc; 42596 if (_v0 === '') { 42597 return two.cc; 42598 } else { 42599 var _v1 = two.cc; 42600 if (_v1 === '') { 42601 return two.cc; 42602 } else { 42603 return two.cc + (', ' + one.cc); 42604 } 42605 } 42606 }(), 42607 iR: _Utils_ap(one.iR, two.iR), 42608 $7: function () { 42609 var _v2 = one.$7; 42610 if (_v2 === '') { 42611 return two.$7; 42612 } else { 42613 var _v3 = two.$7; 42614 if (_v3 === '') { 42615 return two.$7; 42616 } else { 42617 return two.$7 + ('\n' + one.$7); 42618 } 42619 } 42620 }(), 42621 fi: _Utils_ap(one.fi, two.fi), 42622 kM: function () { 42623 var _v4 = one.kM; 42624 if (_v4 === '') { 42625 return two.kM; 42626 } else { 42627 var _v5 = two.kM; 42628 if (_v5 === '') { 42629 return two.kM; 42630 } else { 42631 return two.kM + (', ' + one.kM); 42632 } 42633 } 42634 }() 42635 }); 42636 }); 42637var $author$project$InternalAnim$Duration$inSeconds = function (_v0) { 42638 var secs = _v0; 42639 return secs; 42640}; 42641var $author$project$InternalAnim$Move$hashDuration = F2( 42642 function (prefix, dur) { 42643 var seconds = $author$project$InternalAnim$Duration$inSeconds(dur); 42644 return (!seconds) ? '' : _Utils_ap( 42645 prefix, 42646 $elm$core$String$fromInt( 42647 $elm$core$Basics$round( 42648 $author$project$InternalAnim$Duration$inSeconds(dur)))); 42649 }); 42650var $author$project$InternalAnim$Time$inMilliseconds = function (_v0) { 42651 var ms = _v0; 42652 return ms; 42653}; 42654var $mdgriffith$elm_bezier$Bezier$controlOne = function (_v0) { 42655 var c = _v0.b; 42656 return c; 42657}; 42658var $mdgriffith$elm_bezier$Bezier$controlTwo = function (_v0) { 42659 var c = _v0.c; 42660 return c; 42661}; 42662var $author$project$InternalAnim$Bits$Bits = $elm$core$Basics$identity; 42663var $author$project$InternalAnim$Bits$zeroes = 0 | 0; 42664var $author$project$InternalAnim$Bits$ones = ~$author$project$InternalAnim$Bits$zeroes; 42665var $author$project$InternalAnim$Bits$top8 = $author$project$InternalAnim$Bits$ones >>> (32 - 8); 42666var $author$project$InternalAnim$Bits$store4Float = F4( 42667 function (one, two, three, four) { 42668 return (($author$project$InternalAnim$Bits$top8 & $elm$core$Basics$round(four)) << 24) | ((($author$project$InternalAnim$Bits$top8 & $elm$core$Basics$round(three)) << 16) | ((($author$project$InternalAnim$Bits$top8 & $elm$core$Basics$round(two)) << 8) | ($author$project$InternalAnim$Bits$top8 & $elm$core$Basics$round(one)))); 42669 }); 42670var $author$project$InternalAnim$Bits$value = function (_v0) { 42671 var val = _v0; 42672 return val; 42673}; 42674var $author$project$InternalAnim$Hash$bezierNormalized = function (spline) { 42675 var two = $mdgriffith$elm_bezier$Bezier$controlOne(spline); 42676 var three = $mdgriffith$elm_bezier$Bezier$controlTwo(spline); 42677 return 'b' + $elm$core$String$fromInt( 42678 $author$project$InternalAnim$Bits$value( 42679 A4($author$project$InternalAnim$Bits$store4Float, two.rm, two.k0, three.rm, three.k0))); 42680}; 42681var $author$project$InternalAnim$Hash$float = function (f) { 42682 return $elm$core$String$fromInt( 42683 $elm$core$Basics$round(f * 100)); 42684}; 42685var $author$project$InternalAnim$Transition$hash = function (transition) { 42686 if (!transition.$) { 42687 var spline = transition.a; 42688 return $author$project$InternalAnim$Hash$bezierNormalized(spline); 42689 } else { 42690 var f = transition.a; 42691 return 'wob' + $author$project$InternalAnim$Hash$float(f.k$); 42692 } 42693}; 42694var $author$project$InternalAnim$Move$stepHash = F3( 42695 function (steps, toString, hashed) { 42696 stepHash: 42697 while (true) { 42698 if (!steps.b) { 42699 return hashed; 42700 } else { 42701 var _v1 = steps.a; 42702 var dur = _v1.a; 42703 var trans = _v1.b; 42704 var v = _v1.c; 42705 var remain = steps.b; 42706 var $temp$steps = remain, 42707 $temp$toString = toString, 42708 $temp$hashed = hashed + (A2($author$project$InternalAnim$Move$hashDuration, 'd', dur) + ($author$project$InternalAnim$Transition$hash(trans) + ('-' + toString(v)))); 42709 steps = $temp$steps; 42710 toString = $temp$toString; 42711 hashed = $temp$hashed; 42712 continue stepHash; 42713 } 42714 } 42715 }); 42716var $author$project$InternalAnim$Move$hash = F4( 42717 function (now, name, _v0, toString) { 42718 var n = _v0.a;
42719 var delay = _v0.b; 42720 var dur = _v0.c; 42721 var steps = _v0.d; 42722 return _Utils_ap( 42723 name, 42724 _Utils_ap( 42725 $elm$core$String$fromInt( 42726 $elm$core$Basics$round( 42727 $author$project$InternalAnim$Time$inMilliseconds(now))), 42728 _Utils_ap( 42729 (n === 1) ? '' : ('n' + $elm$core$String$fromInt(n)), 42730 _Utils_ap( 42731 A2($author$project$InternalAnim$Move$hashDuration, 'dl', delay), 42732 _Utils_ap( 42733 A2($author$project$InternalAnim$Move$hashDuration, 'd', dur), 42734 A3($author$project$InternalAnim$Move$stepHash, steps, toString, '')))))); 42735 }); 42736var $author$project$InternalAnim$Duration$inMilliseconds = function (_v0) { 42737 var secs = _v0; 42738 return secs * 1000; 42739}; 42740var $author$project$InternalAnim$Time$durationToString = function (dur) { 42741 return function (s) { 42742 return s + 'ms'; 42743 }( 42744 $elm$core$String$fromInt( 42745 $elm$core$Basics$round( 42746 $author$project$InternalAnim$Duration$inMilliseconds(dur)))); 42747}; 42748var $mdgriffith$elm_bezier$Bezier$comma = ','; 42749var $mdgriffith$elm_bezier$Bezier$normalize = function (untouched) { 42750 var c0 = untouched.a; 42751 var c1 = untouched.b; 42752 var c2 = untouched.c; 42753 var c3 = untouched.d; 42754 if ((!c0.rm) && ((!c0.k0) && ((c3.rm === 1) && (c3.k0 === 1)))) { 42755 return untouched; 42756 } else { 42757 var factorY = c3.k0 - c0.k0; 42758 var factorX = c3.rm - c0.rm; 42759 return A4( 42760 $mdgriffith$elm_bezier$Bezier$Spline, 42761 {rm: 0, k0: 0}, 42762 {rm: (c1.rm - c0.rm) / factorX, k0: (c1.k0 - c0.k0) / factorY}, 42763 {rm: (c2.rm - c0.rm) / factorX, k0: (c2.k0 - c0.k0) / factorY}, 42764 {rm: 1, k0: 1}); 42765 } 42766}; 42767var $mdgriffith$elm_bezier$Bezier$roundFloat = function (f) { 42768 return $elm$core$Basics$round(f * 100) / 100; 42769}; 42770var $mdgriffith$elm_bezier$Bezier$toCss = function (spline) { 42771 var _v0 = $mdgriffith$elm_bezier$Bezier$normalize(spline); 42772 var c0 = _v0.a; 42773 var c1 = _v0.b; 42774 var c2 = _v0.c; 42775 var c3 = _v0.d; 42776 return 'cubic-bezier(' + (_Utils_ap( 42777 $elm$core$String$fromFloat( 42778 $mdgriffith$elm_bezier$Bezier$roundFloat(c1.rm)), 42779 $mdgriffith$elm_bezier$Bezier$comma) + (_Utils_ap( 42780 $elm$core$String$fromFloat( 42781 $mdgriffith$elm_bezier$Bezier$roundFloat(c1.k0)), 42782 $mdgriffith$elm_bezier$Bezier$comma) + (_Utils_ap( 42783 $elm$core$String$fromFloat( 42784 $mdgriffith$elm_bezier$Bezier$roundFloat(c2.rm)), 42785 $mdgriffith$elm_bezier$Bezier$comma) + ($elm$core$String$fromFloat( 42786 $mdgriffith$elm_bezier$Bezier$roundFloat(c2.k0)) + ')')))); 42787}; 42788var $author$project$InternalAnim$Move$renderTransition = F4( 42789 function (prop, delay, duration, spline) { 42790 return prop + (' ' + ($author$project$InternalAnim$Time$durationToString(duration) + (' ' + ($mdgriffith$elm_bezier$Bezier$toCss(spline) + (' ' + $author$project$InternalAnim$Time$durationToString(delay)))))); 42791 }); 42792var $author$project$InternalAnim$Move$combine = F2( 42793 function (one, two) { 42794 return ($elm$core$String$isEmpty(one.iR) && $elm$core$List$isEmpty(one.fi)) ? two : (($elm$core$String$isEmpty(two.iR) && $elm$core$List$isEmpty(two.fi)) ? one : { 42795 cc: function () { 42796 var _v0 = one.cc; 42797 if (_v0 === '') { 42798 return two.cc; 42799 } else { 42800 var _v1 = two.cc; 42801 if (_v1 === '') { 42802 return two.cc; 42803 } else { 42804 return two.cc + (', ' + one.cc); 42805 } 42806 } 42807 }(), 42808 iR: _Utils_ap(one.iR, two.iR), 42809 $7: function () { 42810 var _v2 = one.$7; 42811 if (_v2 === '') { 42812 return two.$7; 42813 } else { 42814 var _v3 = two.$7; 42815 if (_v3 === '') { 42816 return two.$7; 42817 } else { 42818 return two.$7 + ('\n' + one.$7); 42819 } 42820 } 42821 }(), 42822 fi: _Utils_ap(one.fi, two.fi), 42823 kM: function () { 42824 var _v4 = one.kM; 42825 if (_v4 === '') { 42826 return two.kM; 42827 } else { 42828 var _v5 = two.kM; 42829 if (_v5 === '') { 42830 return two.kM; 42831 } else { 42832 return two.kM + (', ' + one.kM); 42833 } 42834 } 42835 }() 42836 }); 42837 }); 42838var $author$project$InternalAnim$Duration$isZero = function (_v0) { 42839 var secs = _v0; 42840 return !secs; 42841}; 42842var $author$project$InternalAnim$Move$initialProps = F4( 42843 function (name, toString, startPos, _v0) { 42844 var steps = _v0.d; 42845 if (!steps.b) { 42846 return _List_Nil; 42847 } else { 42848 var _v2 = steps.a; 42849 var dur = _v2.a; 42850 var val = _v2.c; 42851 return $author$project$InternalAnim$Duration$isZero(dur) ? _List_fromArray( 42852 [ 42853 _Utils_Tuple2( 42854 name, 42855 toString(val)) 42856 ]) : _List_Nil; 42857 } 42858 }); 42859var $author$project$InternalAnim$Quantity$plus = F2( 42860 function (_v0, _v1) { 42861 var y = _v0; 42862 var x = _v1; 42863 return x + y; 42864 }); 42865var $author$project$InternalAnim$Time$expand = F2( 42866 function (one, two) { 42867 return A2($author$project$InternalAnim$Quantity$plus, one, two); 42868 }); 42869var $mdgriffith$elm_bezier$Bezier$first = function (_v0) { 42870 var f = _v0.a; 42871 return f; 42872}; 42873var $author$project$InternalAnim$Transition$keyframeFromSpline = F4( 42874 function (percent, start, toString, spline) { 42875 return (percent === 100) ? ($elm$core$String$fromInt( 42876 $elm$core$Basics$floor(percent)) + ('% {' + (toString(start) + ';}'))) : ($elm$core$String$fromInt( 42877 $elm$core$Basics$floor(percent)) + ('% {' + (toString(start) + (';animation-timing-function:' + ($mdgriffith$elm_bezier$Bezier$toCss(spline) + ';}'))))); 42878 }); 42879var $mdgriffith$elm_bezier$Bezier$last = function (_v0) { 42880 var l = _v0.d; 42881 return l; 42882}; 42883var $author$project$InternalAnim$Transition$keyframeListFromNonNormalizedBezier = F3( 42884 function (steps, toString, str) { 42885 keyframeListFromNonNormalizedBezier: 42886 while (true) { 42887 if (!steps.b) { 42888 return str; 42889 } else { 42890 if (!steps.b.b) { 42891 var top = steps.a; 42892 var value = toString( 42893 $mdgriffith$elm_bezier$Bezier$first(top).k0 / 1000); 42894 var percent = $mdgriffith$elm_bezier$Bezier$first(top).rm / 1000; 42895 var normalizedSpline = $mdgriffith$elm_bezier$Bezier$normalize(top); 42896 var finalValue = toString( 42897 $mdgriffith$elm_bezier$Bezier$last(top).k0); 42898 var finalPercent = $mdgriffith$elm_bezier$Bezier$last(top).rm / 1000; 42899 return _Utils_ap( 42900 str, 42901 _Utils_ap( 42902 A4($author$project$InternalAnim$Transition$keyframeFromSpline, percent * 100, value, $elm$core$Basics$identity, normalizedSpline), 42903 A4($author$project$InternalAnim$Transition$keyframeFromSpline, finalPercent * 100, finalValue, $elm$core$Basics$identity, normalizedSpline))); 42904 } else { 42905 var top = steps.a; 42906 var remain = steps.b; 42907 var value = toString( 42908 $mdgriffith$elm_bezier$Bezier$first(top).k0 / 1000); 42909 var percent = $mdgriffith$elm_bezier$Bezier$first(top).rm / 1000; 42910 var normalizedSpline = $mdgriffith$elm_bezier$Bezier$normalize(top); 42911 var $temp$steps = remain, 42912 $temp$toString = toString, 42913 $temp$str = _Utils_ap( 42914 str, 42915 A4($author$project$InternalAnim$Transition$keyframeFromSpline, percent * 100, value, $elm$core$Basics$identity, normalizedSpline)); 42916 steps = $temp$steps; 42917 toString = $temp$toString; 42918 str = $temp$str; 42919 continue keyframeListFromNonNormalizedBezier; 42920 } 42921 } 42922 } 42923 }); 42924var $author$project$InternalAnim$Transition$kf = F3( 42925 function (percent, prop, spline) { 42926 return (percent === 100) ? ($elm$core$String$fromInt( 42927 $elm$core$Basics$floor(percent)) + ('% {' + (prop + ';}'))) : ($elm$core$String$fromInt( 42928 $elm$core$Basics$floor(percent)) + ('% {' + (prop + (';animation-timing-function:' + ($mdgriffith$elm_bezier$Bezier$toCss(spline) + ';}'))))); 42929 }); 42930var $mdgriffith$elm_bezier$Bezier$Spring$clampToPortion = function (x) { 42931 return A2( 42932 $elm$core$Basics$max, 42933 0, 42934 A2($elm$core$Basics$min, 1, x)); 42935}; 42936var $mdgriffith$elm_bezier$Bezier$Spring$mapToRange = F3( 42937 function (minimum, maximum, x) { 42938 var total = maximum - minimum; 42939 return minimum + (x * total); 42940 }); 42941var $elm$core$Basics$sqrt = _Basics_sqrt; 42942var $mdgriffith$elm_bezier$Bezier$Spring$criticalDamping = F2( 42943 function (k, m) { 42944 return 2 * $elm$core$Basics$sqrt(k * m); 42945 }); 42946var $elm$core$Basics$e = _Basics_e; 42947var $mdgriffith$elm_bezier$Bezier$Spring$toleranceForSpringSettleTimeCalculation = (-1) * A2($elm$core$Basics$logBase, $elm$core$Basics$e, 0.005); 42948var $mdgriffith$elm_bezier$Bezier$Spring$settlesAt = function (_v0) { 42949 var stiffness = _v0.B; 42950 var damping = _v0.D; 42951 var mass = _v0.A; 42952 var m = mass; 42953 var k = stiffness; 42954 var springAspect = $elm$core$Basics$sqrt(k / m); 42955 var cCritical = A2($mdgriffith$elm_bezier$Bezier$Spring$criticalDamping, k, m); 42956 var c = damping; 42957 if (_Utils_eq( 42958 $elm$core$Basics$round(c), 42959 $elm$core$Basics$round(cCritical))) { 42960 return 1000 * (8.5 / springAspect); 42961 } else { 42962 if ((c - cCritical) > 0) { 42963 var dampingAspect = c / cCritical; 42964 return 1000 * ($mdgriffith$elm_bezier$Bezier$Spring$toleranceForSpringSettleTimeCalculation / (dampingAspect * springAspect)); 42965 } else { 42966 var dampingAspect = c / cCritical; 42967 return 1000 * ($mdgriffith$elm_bezier$Bezier$Spring$toleranceForSpringSettleTimeCalculation / (dampingAspect * springAspect)); 42968 } 42969 } 42970}; 42971var $mdgriffith$elm_bezier$Bezier$Spring$wobble2Ratio = F2( 42972 function (wobble, msDuration) { 42973 var scalingBelowDur = msDuration / 350; 42974 var top = A2( 42975 $elm$core$Basics$max, 42976 0.43, 42977 0.9 * A2($elm$core$Basics$min, 1, scalingBelowDur)); 42978 var bounded = $mdgriffith$elm_bezier$Bezier$Spring$clampToPortion(wobble); 42979 return A3($mdgriffith$elm_bezier$Bezier$Spring$mapToRange, 0.43, top, 1 - bounded); 42980 }); 42981var $mdgriffith$elm_bezier$Bezier$Spring$wobble2Damping = F4( 42982 function (wobble, k, m, duration) { 42983 return A2($mdgriffith$elm_bezier$Bezier$Spring$wobble2Ratio, wobble, duration) * A2($mdgriffith$elm_bezier$Bezier$Spring$criticalDamping, k, m); 42984 }); 42985var $mdgriffith$elm_bezier$Bezier$Spring$new = function (options) { 42986 var k = A3( 42987 $mdgriffith$elm_bezier$Bezier$Spring$mapToRange, 42988 120, 42989 210, 42990 $mdgriffith$elm_bezier$Bezier$Spring$clampToPortion(options.jW)); 42991 var damping = A4($mdgriffith$elm_bezier$Bezier$Spring$wobble2Damping, options.k$, k, 1, options.qa); 42992 var initiallySettlesAt = $mdgriffith$elm_bezier$Bezier$Spring$settlesAt( 42993 {D: damping, A: 1, B: k}); 42994 return (_Utils_cmp(initiallySettlesAt, options.qa) > 0) ? {D: damping, A: options.qa / initiallySettlesAt, B: k} : {D: damping, A: 1, B: k}; 42995}; 42996var $mdgriffith$elm_bezier$Bezier$Point = F2( 42997 function (x, y) { 42998 return {rm: x, k0: y}; 42999 }); 43000var $elm$core$Basics$cos = _Basics_cos; 43001var $elm$core$Basics$sin = _Basics_sin; 43002var $mdgriffith$elm_bezier$Bezier$Spring$at = F2( 43003 function (_v0, duration) { 43004 var spring = _v0.qr; 43005 var target = _v0.kz; 43006 var initial = _v0.i_; 43007 var magicNumber = $elm$core$Basics$sqrt(spring.B / spring.A); 43008 var t = (duration * magicNumber) / 1000; 43009 var dampingRatio = spring.D / (2 * $elm$core$Basics$sqrt(spring.A * spring.B)); 43010 var inner = $elm$core$Basics$sqrt( 43011 1 - A2($elm$core$Basics$pow, dampingRatio, 2)); 43012 var c1 = target - initial.cM; 43013 var c2 = dampingRatio * (c1 / inner); 43014 var sinElement = c2 * $elm$core$Basics$sin(inner * t); 43015 var cosinElement = c1 * $elm$core$Basics$cos(inner * t); 43016 var newPosition = A2($elm$core$Basics$pow, $elm$core$Basics$e,
43016((-1) * dampingRatio) * t) * (cosinElement + sinElement); 43017 var firstFactor = ((dampingRatio * c1) - (c2 * inner)) * $elm$core$Basics$cos(inner * t); 43018 var secondFactor = ((dampingRatio * c2) + (c1 * inner)) * $elm$core$Basics$sin(inner * t); 43019 var attentuationFactor = A2($elm$core$Basics$pow, $elm$core$Basics$e, ((-1) * dampingRatio) * t); 43020 var newVelocity = attentuationFactor * (firstFactor + secondFactor); 43021 return {cM: target - newPosition, q9: newVelocity * magicNumber}; 43022 }); 43023var $elm$core$Basics$atan = _Basics_atan; 43024var $mdgriffith$elm_bezier$Bezier$Spring$isCriticallyDamped = function (_v0) { 43025 var stiffness = _v0.B; 43026 var damping = _v0.D; 43027 var mass = _v0.A; 43028 var cCritical = A2($mdgriffith$elm_bezier$Bezier$Spring$criticalDamping, stiffness, mass); 43029 return _Utils_eq( 43030 $elm$core$Basics$round(damping), 43031 $elm$core$Basics$round(cCritical)); 43032}; 43033var $mdgriffith$elm_bezier$Bezier$Spring$magicNumberHelper = F3( 43034 function (options, i, captured) { 43035 magicNumberHelper: 43036 while (true) { 43037 var newNum = (options.qE(i) * 1000) / options.gH; 43038 if ((_Utils_cmp(newNum, options.kz) > -1) || (i > 8)) { 43039 return $elm$core$List$reverse( 43040 A2($elm$core$List$cons, newNum, captured)); 43041 } else { 43042 var $temp$options = options, 43043 $temp$i = i + 1, 43044 $temp$captured = A2($elm$core$List$cons, newNum, captured); 43045 options = $temp$options; 43046 i = $temp$i; 43047 captured = $temp$captured; 43048 continue magicNumberHelper; 43049 } 43050 } 43051 }); 43052var $mdgriffith$elm_bezier$Bezier$Spring$peaks = F4( 43053 function (spring, ms, target, initial) { 43054 if ($mdgriffith$elm_bezier$Bezier$Spring$isCriticallyDamped(spring)) { 43055 return _List_fromArray( 43056 [0, target]); 43057 } else { 43058 var magicNumber = $elm$core$Basics$sqrt(spring.B / spring.A); 43059 var dampingRatio = spring.D / (2 * $elm$core$Basics$sqrt(spring.A * spring.B)); 43060 var inner = $elm$core$Basics$sqrt( 43061 1 - A2($elm$core$Basics$pow, dampingRatio, 2)); 43062 var c1 = target - initial.cM; 43063 var c2 = dampingRatio * (c1 / inner); 43064 var top = (dampingRatio * c1) - (c2 * inner); 43065 var bottom = (dampingRatio * c2) + (c1 * inner); 43066 var t = function (k) { 43067 return ((-1) / inner) * ($elm$core$Basics$atan(top / bottom) - (k * $elm$core$Basics$pi)); 43068 }; 43069 return A3( 43070 $mdgriffith$elm_bezier$Bezier$Spring$magicNumberHelper, 43071 {gH: magicNumber, qE: t, kz: target}, 43072 0, 43073 _List_Nil); 43074 } 43075 }); 43076var $mdgriffith$elm_bezier$Bezier$atXTolerance = 0.0005; 43077var $mdgriffith$elm_bezier$Bezier$atXHelper = F5( 43078 function (spline, desiredX, jumpSize, t, depth) { 43079 atXHelper: 43080 while (true) { 43081 var p1 = spline.a; 43082 var p2 = spline.b; 43083 var p3 = spline.c; 43084 var p4 = spline.d; 43085 var point = function () { 43086 if (t <= 0.5) { 43087 var q3 = {rm: p3.rm + (t * (p4.rm - p3.rm)), k0: p3.k0 + (t * (p4.k0 - p3.k0))}; 43088 var q2 = {rm: p2.rm + (t * (p3.rm - p2.rm)), k0: p2.k0 + (t * (p3.k0 - p2.k0))}; 43089 var r2 = {rm: q2.rm + (t * (q3.rm - q2.rm)), k0: q2.k0 + (t * (q3.k0 - q2.k0))}; 43090 var q1 = {rm: p1.rm + (t * (p2.rm - p1.rm)), k0: p1.k0 + (t * (p2.k0 - p1.k0))}; 43091 var r1 = {rm: q1.rm + (t * (q2.rm - q1.rm)), k0: q1.k0 + (t * (q2.k0 - q1.k0))}; 43092 return {rm: r1.rm + (t * (r2.rm - r1.rm)), k0: r1.k0 + (t * (r2.k0 - r1.k0))}; 43093 } else { 43094 var q3 = {rm: p4.rm + ((1 - t) * (p3.rm - p4.rm)), k0: p4.k0 + ((1 - t) * (p3.k0 - p4.k0))}; 43095 var q2 = {rm: p3.rm + ((1 - t) * (p2.rm - p3.rm)), k0: p3.k0 + ((1 - t) * (p2.k0 - p3.k0))}; 43096 var r2 = {rm: q3.rm + ((1 - t) * (q2.rm - q3.rm)), k0: q3.k0 + ((1 - t) * (q2.k0 - q3.k0))}; 43097 var q1 = {rm: p2.rm + ((1 - t) * (p1.rm - p2.rm)), k0: p2.k0 + ((1 - t) * (p1.k0 - p2.k0))}; 43098 var r1 = {rm: q2.rm + ((1 - t) * (q1.rm - q2.rm)), k0: q2.k0 + ((1 - t) * (q1.k0 - q2.k0))}; 43099 return {rm: r2.rm + ((1 - t) * (r1.rm - r2.rm)), k0: r2.k0 + ((1 - t) * (r1.k0 - r2.k0))}; 43100 } 43101 }(); 43102 if (depth === 10) { 43103 return {pv: point, qE: t}; 43104 } else { 43105 if ((_Utils_cmp( 43106 $elm$core$Basics$abs(point.rm - desiredX), 43107 $mdgriffith$elm_bezier$Bezier$atXTolerance) < 0) && ($elm$core$Basics$abs(point.rm - desiredX) >= 0)) { 43108 return {pv: point, qE: t}; 43109 } else { 43110 if ((point.rm - desiredX) > 0) { 43111 var $temp$spline = spline, 43112 $temp$desiredX = desiredX, 43113 $temp$jumpSize = jumpSize / 2, 43114 $temp$t = t - jumpSize, 43115 $temp$depth = depth + 1; 43116 spline = $temp$spline; 43117 desiredX = $temp$desiredX; 43118 jumpSize = $temp$jumpSize; 43119 t = $temp$t; 43120 depth = $temp$depth; 43121 continue atXHelper; 43122 } else { 43123 var $temp$spline = spline, 43124 $temp$desiredX = desiredX, 43125 $temp$jumpSize = jumpSize / 2, 43126 $temp$t = t + jumpSize, 43127 $temp$depth = depth + 1; 43128 spline = $temp$spline; 43129 desiredX = $temp$desiredX; 43130 jumpSize = $temp$jumpSize; 43131 t = $temp$t; 43132 depth = $temp$depth; 43133 continue atXHelper; 43134 } 43135 } 43136 } 43137 } 43138 }); 43139var $mdgriffith$elm_bezier$Bezier$guessTime = F2( 43140 function (now, _v0) { 43141 var one = _v0.a; 43142 var two = _v0.b; 43143 var three = _v0.c; 43144 var four = _v0.d; 43145 return (!(four.rm - one.rm)) ? 0.5 : ((now - one.rm) / (four.rm - one.rm)); 43146 }); 43147var $mdgriffith$elm_bezier$Bezier$atX = F2( 43148 function (x, spline) { 43149 return A5( 43150 $mdgriffith$elm_bezier$Bezier$atXHelper, 43151 spline, 43152 x, 43153 0.25, 43154 A2($mdgriffith$elm_bezier$Bezier$guessTime, x, spline), 43155 0); 43156 }); 43157var $mdgriffith$elm_bezier$Bezier$interpolatePoints = F3( 43158 function (p1, p2, t) { 43159 return (t <= 0.5) ? {rm: p1.rm + (t * (p2.rm - p1.rm)), k0: p1.k0 + (t * (p2.k0 - p1.k0))} : {rm: p2.rm + ((1 - t) * (p1.rm - p2.rm)), k0: p2.k0 + ((1 - t) * (p1.k0 - p2.k0))}; 43160 }); 43161var $mdgriffith$elm_bezier$Bezier$splitAt = F2( 43162 function (parameterValue, _v0) { 43163 var p1 = _v0.a; 43164 var p2 = _v0.b; 43165 var p3 = _v0.c; 43166 var p4 = _v0.d; 43167 var q3 = A3($mdgriffith$elm_bezier$Bezier$interpolatePoints, p3, p4, parameterValue); 43168 var q2 = A3($mdgriffith$elm_bezier$Bezier$interpolatePoints, p2, p3, parameterValue); 43169 var r2 = A3($mdgriffith$elm_bezier$Bezier$interpolatePoints, q2, q3, parameterValue); 43170 var q1 = A3($mdgriffith$elm_bezier$Bezier$interpolatePoints, p1, p2, parameterValue); 43171 var r1 = A3($mdgriffith$elm_bezier$Bezier$interpolatePoints, q1, q2, parameterValue); 43172 var s = A3($mdgriffith$elm_bezier$Bezier$interpolatePoints, r1, r2, parameterValue); 43173 return _Utils_Tuple2( 43174 A4($mdgriffith$elm_bezier$Bezier$Spline, p1, q1, r1, s), 43175 A4($mdgriffith$elm_bezier$Bezier$Spline, s, r2, q3, p4)); 43176 }); 43177var $mdgriffith$elm_bezier$Bezier$splitAtX = F2( 43178 function (x, spline) { 43179 var _v0 = A2($mdgriffith$elm_bezier$Bezier$atX, x, spline); 43180 var t = _v0.qE; 43181 return A2($mdgriffith$elm_bezier$Bezier$splitAt, t, spline); 43182 }); 43183var $mdgriffith$elm_bezier$Bezier$fromCatmullRom = F4( 43184 function (p0, p1, p2, p3) { 43185 var b3 = p2; 43186 var b2 = {rm: p2.rm - ((p3.rm - p1.rm) / 6), k0: p2.k0 - ((p3.k0 - p1.k0) / 6)}; 43187 var b1 = {rm: p1.rm + ((p2.rm - p0.rm) / 6), k0: p1.k0 + ((p2.k0 - p0.k0) / 6)}; 43188 var b0 = p1; 43189 return A4($mdgriffith$elm_bezier$Bezier$Spline, b0, b1, b2, b3); 43190 }); 43191var $mdgriffith$elm_bezier$Bezier$traceHelper = F4( 43192 function (toPoint, t, stepSize, captured) { 43193 traceHelper: 43194 while (true) { 43195 var smallStepSize = stepSize * 0.8; 43196 var pastT = (!t) ? 0 : (t - smallStepSize); 43197 var nextT = t + stepSize; 43198 var futureT = (t + stepSize) + smallStepSize; 43199 if (t >= 1) { 43200 return $elm$core$List$reverse(captured); 43201 } else { 43202 var $temp$toPoint = toPoint, 43203 $temp$t = nextT, 43204 $temp$stepSize = stepSize, 43205 $temp$captured = A2( 43206 $elm$core$List$cons, 43207 A4( 43208 $mdgriffith$elm_bezier$Bezier$fromCatmullRom, 43209 toPoint(pastT), 43210 toPoint(t), 43211 toPoint(nextT), 43212 toPoint(futureT)), 43213 captured); 43214 toPoint = $temp$toPoint; 43215 t = $temp$t; 43216 stepSize = $temp$stepSize; 43217 captured = $temp$captured; 43218 continue traceHelper; 43219 } 43220 } 43221 }); 43222var $mdgriffith$elm_bezier$Bezier$trace = function (options) { 43223 var stepSize = 1 / options.qt; 43224 return A4($mdgriffith$elm_bezier$Bezier$traceHelper, options.qT, 0, stepSize, _List_Nil); 43225}; 43226var $mdgriffith$elm_bezier$Bezier$Spring$segments = F3( 43227 function (spring, initialState, targetPos) { 43228 var pks = A4($mdgriffith$elm_bezier$Bezier$Spring$peaks, spring, 0, targetPos, initialState); 43229 var needsDirectPathing = (A2($mdgriffith$elm_bezier$Bezier$Spring$criticalDamping, spring.B, spring.A) - spring.D) < 12; 43230 var crit = A2($mdgriffith$elm_bezier$Bezier$Spring$criticalDamping, spring.B, spring.A); 43231 if (needsDirectPathing) { 43232 var onSpring = $mdgriffith$elm_bezier$Bezier$Spring$at( 43233 {i_: initialState, qr: spring, kz: targetPos}); 43234 var toPoint = function (factor) { 43235 var x = factor * targetPos; 43236 return { 43237 rm: x, 43238 k0: onSpring(x).cM 43239 }; 43240 }; 43241 return $mdgriffith$elm_bezier$Bezier$trace( 43242 {qt: 8, qT: toPoint}); 43243 } else { 43244 var toPos = $mdgriffith$elm_bezier$Bezier$Spring$at( 43245 {i_: initialState, qr: spring, kz: targetPos}); 43246 return A3( 43247 $elm$core$List$map2, 43248 F2( 43249 function (one, two) { 43250 var spread = 0; 43251 var posTwo = toPos(two); 43252 var posOne = toPos(one); 43253 var factor = 0; 43254 var offsetOne = (two - one) * ((0.33 - factor) - spread); 43255 var offsetTwo = (two - one) * ((0.55 + factor) - spread); 43256 var ctrlTwo = A2($mdgriffith$elm_bezier$Bezier$Point, two - offsetTwo, posTwo.cM); 43257 var ctrlOne = A2($mdgriffith$elm_bezier$Bezier$Point, one + offsetOne, posOne.cM); 43258 var result = A4( 43259 $mdgriffith$elm_bezier$Bezier$fromPoints, 43260 A2($mdgriffith$elm_bezier$Bezier$Point, one, posOne.cM), 43261 ctrlOne, 43262 ctrlTwo, 43263 A2($mdgriffith$elm_bezier$Bezier$Point, two, posTwo.cM)); 43264 return (_Utils_cmp(two, targetPos) > 0) ? A2($mdgriffith$elm_bezier$Bezier$splitAtX, targetPos, result).a : result; 43265 }), 43266 pks, 43267 A2($elm$core$List$drop, 1, pks)); 43268 } 43269 }); 43270var $author$project$InternalAnim$Transition$keyframes = F4( 43271 function (interpolate, startPercent, endPercent, transition) { 43272 if (_Utils_eq(startPercent, endPercent)) { 43273 return ''; 43274 } else { 43275 if (!transition.$) { 43276 var spline = transition.a; 43277 return _Utils_ap( 43278 A3( 43279 $author$project$InternalAnim$Transition$kf, 43280 startPercent, 43281 interpolate(0), 43282 spline), 43283 (endPercent === 100) ? A3( 43284 $author$project$InternalAnim$Transition$kf, 43285 endPercent, 43286 interpolate(1), 43287 spline) : ''); 43288 } else { 43289 var wob = transition.a; 43290 var splines = A3( 43291 $mdgriffith$elm_bezier$Bezier$Spring$segments, 43292 $mdgriffith$elm_bezier$Bezier$Spring$new( 43293 {jW: wob.jW, qa: 1000, k$: wob.k$}), 43294 {cM: 0, q9: wob.eU}, 43295 1000); 43296 return A3($author$project$InternalAnim$Transition$keyframeListFromNonNormalizedBezier, splines, interpolate, ''); 43297 } 43298 } 43299 }); 43300var $author$project$InternalAnim$Time$progressWithin = F2( 43301 function (_v0, _v1) { 43302 var current = _v0; 43303 var total = _v1; 43304 return (!total) ? 0 : A2( 43305 $elm$core$Basics$min, 43306 1, 43307 A2($elm$core$Basics$max, 0, current / total)); 43308 }); 43309var $author$project$InternalAnim$Move$keyframeHelper = F7( 43310 function (name, lerp, startPos, sequenceDuration, currentDur, steps, rendered) { 43311 keyframeHelper: 43312 while (true) { 43313 if (!steps.b) { 43314 return rendered; 43315 } else { 43316 var _v1 = steps.a; 43317 var dur = _v1.a; 43318 var transition = _v1.b; 43319 var val = _v1.c; 43320 var remaining = steps.b; 43321 var startPercent = A2($author$project$InternalAnim$Time$progressWithin, currentDur, sequenceDuration) * 100; 43322 var nextCurrent = A2($author$project$InternalAnim$Time$expand, currentDur, dur); 43323 var endPercent = A2($author$project$InternalAnim$Time$progressWithin, nextCurrent, sequenceDuration) * 100; 43324 var frames = A4( 43325 $author$project$InternalAnim$Transition$keyframes, 43326 function (t) { 43327 return A3(lerp, t, startPos, val); 43328 }, 43329 startPercent, 43330 endPercent, 43331 transition); 43332 var $temp$name = name, 43333 $temp$lerp = lerp, 43334 $temp$startPos = val, 43335 $temp$sequenceDuration = sequenceDuration, 43336 $temp$currentDur = nextCurrent, 43337 $temp$steps = remaining, 43338 $temp$rendered = _Utils_ap(rendered, frames); 43339 name = $temp$name; 43340 lerp = $temp$lerp; 43341 startPos = $temp$startPos; 43342 sequenceDuration = $temp$sequenceDuration; 43343 currentDur = $temp$currentDur; 43344 steps = $temp$steps; 43345 rendered = $temp$rendered; 43346 continue keyframeHelper; 43347 } 43348 } 43349 }); 43350var $author$project$InternalAnim$Move$zeroDuration = $author$project$InternalAnim$Duration$milliseconds(0); 43351var $author$project$InternalAnim$Move$keyframes = F5( 43352 function (name, lerp, startPos, _v0, rendered) { 43353 var dur = _v0.c; 43354 var steps = _v0.d; 43355 return A7($author$project$InternalAnim$Move$keyframeHelper, name, lerp, startPos, dur, $author$project$InternalAnim$Move$zeroDuration, steps, rendered); 43356 }); 43357var $author$project$InternalAnim$Move$css = F7( 43358 function (now, startPos, name, lerp, toString, toHashString, seq) { 43359 var n = function () { 43360 var i = seq.a; 43361 return _Utils_eq(i, -1) ? 'infinite' : ((i <= 0) ? '1' : $elm$core$String$fromInt(i)); 43362 }(); 43363 var durationStr = function () { 43364 var dur = seq.c; 43365 return $author$project$InternalAnim$Time$durationToString(dur); 43366 }(); 43367 var delayStr = function () {
43368 var delay = seq.b; 43369 return $author$project$InternalAnim$Time$durationToString(delay); 43370 }(); 43371 var animationName = A4($author$project$InternalAnim$Move$hash, now, name, seq, toHashString); 43372 return { 43373 cc: durationStr + (' linear ' + (delayStr + (' ' + (n + (' normal forwards running ' + animationName))))), 43374 iR: animationName, 43375 $7: ('@keyframes ' + (animationName + ' {\n')) + (A5($author$project$InternalAnim$Move$keyframes, name, lerp, startPos, seq, '') + '\n}'), 43376 fi: A4($author$project$InternalAnim$Move$initialProps, name, toString, startPos, seq), 43377 kM: '' 43378 }; 43379 }); 43380var $author$project$InternalAnim$Move$toCssKeyframes = F8( 43381 function (now, startPos, name, lerp, toString, toHashString, sections, anim) { 43382 toCssKeyframes: 43383 while (true) { 43384 if (!sections.b) { 43385 return anim; 43386 } else { 43387 var seq = sections.a; 43388 var remain = sections.b; 43389 var $temp$now = now, 43390 $temp$startPos = startPos, 43391 $temp$name = name, 43392 $temp$lerp = lerp, 43393 $temp$toString = toString, 43394 $temp$toHashString = toHashString, 43395 $temp$sections = remain, 43396 $temp$anim = A2( 43397 $author$project$InternalAnim$Move$combine, 43398 A7($author$project$InternalAnim$Move$css, now, startPos, name, lerp, toString, toHashString, seq), 43399 anim); 43400 now = $temp$now; 43401 startPos = $temp$startPos; 43402 name = $temp$name; 43403 lerp = $temp$lerp; 43404 toString = $temp$toString; 43405 toHashString = $temp$toHashString; 43406 sections = $temp$sections; 43407 anim = $temp$anim; 43408 continue toCssKeyframes; 43409 } 43410 } 43411 }); 43412var $author$project$InternalAnim$Move$cssForSections = F9( 43413 function (now, allowTransitions, startPos, name, lerp, toString, toHashString, sections, anim) { 43414 if (!sections.b) { 43415 return anim; 43416 } else { 43417 if (((((sections.a.a === 1) && sections.a.d.b) && (!sections.a.d.a.b.$)) && (!sections.a.d.b.b)) && (!sections.b.b)) { 43418 var seq = sections.a; 43419 var delay = seq.b; 43420 var _v1 = seq.d; 43421 var _v2 = _v1.a; 43422 var stepDur = _v2.a; 43423 var spline = _v2.b.a; 43424 var v = _v2.c; 43425 if (!allowTransitions) { 43426 return _Utils_update( 43427 anim, 43428 { 43429 iR: function () { 43430 var _v4 = anim.iR; 43431 if (_v4 === '') { 43432 return A4($author$project$InternalAnim$Move$hash, now, name, seq, toHashString); 43433 } else { 43434 return _Utils_ap( 43435 anim.iR, 43436 A4($author$project$InternalAnim$Move$hash, now, name, seq, toHashString)); 43437 } 43438 }(), 43439 fi: A2( 43440 $elm$core$List$cons, 43441 _Utils_Tuple2( 43442 name, 43443 toString(v)), 43444 anim.fi), 43445 kM: function () { 43446 var _v5 = anim.kM; 43447 if (_v5 === '') { 43448 return A4($author$project$InternalAnim$Move$renderTransition, name, delay, stepDur, spline); 43449 } else { 43450 return A4($author$project$InternalAnim$Move$renderTransition, name, delay, stepDur, spline) + (', ' + anim.kM); 43451 } 43452 }() 43453 }); 43454 } else { 43455 return A8($author$project$InternalAnim$Move$toCssKeyframes, now, startPos, name, lerp, toString, toHashString, sections, anim); 43456 } 43457 } else { 43458 return A8($author$project$InternalAnim$Move$toCssKeyframes, now, startPos, name, lerp, toString, toHashString, sections, anim); 43459 } 43460 } 43461 }); 43462var $author$project$InternalAnim$Css$Props$roundFloat = function (f) { 43463 return $elm$core$Basics$round(f * 100) / 100; 43464}; 43465var $author$project$InternalAnim$Css$Props$floatToString = function (f) { 43466 return $elm$core$String$fromFloat( 43467 $author$project$InternalAnim$Css$Props$roundFloat(f)); 43468}; 43469var $author$project$InternalAnim$Css$Props$vectorToCssString = function (_v0) { 43470 var x = _v0.rm; 43471 var y = _v0.k0; 43472 var z = _v0.k1; 43473 return $author$project$InternalAnim$Css$Props$floatToString(x) + (' ' + ($author$project$InternalAnim$Css$Props$floatToString(y) + (' ' + $author$project$InternalAnim$Css$Props$floatToString(z)))); 43474}; 43475var $author$project$InternalAnim$Css$Props$format = F2( 43476 function (form, num) { 43477 switch (form.$) { 43478 case 0: 43479 return $elm$core$String$fromFloat( 43480 $author$project$InternalAnim$Css$Props$roundFloat(num)); 43481 case 1: 43482 return $elm$core$String$fromInt( 43483 $elm$core$Basics$round(num)); 43484 case 2: 43485 return $elm$core$String$fromInt( 43486 $elm$core$Basics$round(num)) + 'px'; 43487 default: 43488 var vec = form.a; 43489 return $author$project$InternalAnim$Css$Props$vectorToCssString(vec) + (' ' + ($elm$core$String$fromFloat(num / 1000) + 'turn')); 43490 } 43491 }); 43492var $author$project$InternalAnim$Css$Props$hashFormat = F2( 43493 function (form, num) { 43494 switch (form.$) { 43495 case 0: 43496 return $author$project$InternalAnim$Hash$float(num); 43497 case 1: 43498 return $elm$core$String$fromInt( 43499 $elm$core$Basics$round(num)); 43500 case 2: 43501 return $elm$core$String$fromInt( 43502 $elm$core$Basics$round(num)) + 'px'; 43503 default: 43504 return $elm$core$String$fromInt( 43505 $elm$core$Basics$round(num)); 43506 } 43507 }); 43508var $author$project$InternalAnim$Css$Props$hashId = function (id) { 43509 switch (id) { 43510 case 0: 43511 return 'x'; 43512 case 1: 43513 return 'y'; 43514 case 2: 43515 return 'z'; 43516 case 3: 43517 return 'r'; 43518 case 4: 43519 return 's'; 43520 case 5: 43521 return 'sx'; 43522 case 6: 43523 return 'sy'; 43524 case 13: 43525 return 'o'; 43526 case 14: 43527 return 'bgc'; 43528 default: 43529 return 'unknown'; 43530 } 43531};
43532var $author$project$InternalAnim$Css$Props$known = function (id) { 43533 switch (id) { 43534 case 0: 43535 return true; 43536 case 1: 43537 return true; 43538 case 2: 43539 return true; 43540 case 3: 43541 return true; 43542 case 4: 43543 return true; 43544 case 5: 43545 return true; 43546 case 6: 43547 return true; 43548 case 13: 43549 return true; 43550 case 14: 43551 return true; 43552 default: 43553 return false; 43554 } 43555}; 43556var $author$project$InternalAnim$Css$Props$hash = F2( 43557 function (p, val) { 43558 return $author$project$InternalAnim$Css$Props$known(p.m9) ? _Utils_ap( 43559 $author$project$InternalAnim$Css$Props$hashId(p.m9), 43560 A2($author$project$InternalAnim$Css$Props$hashFormat, p.aa, val)) : _Utils_ap( 43561 p.bW, 43562 A2($author$project$InternalAnim$Css$Props$hashFormat, p.aa, val)); 43563 }); 43564var $author$project$InternalAnim$Units$inPixels = function (_v0) { 43565 var pixs = _v0; 43566 return pixs; 43567}; 43568var $author$project$InternalAnim$Move$average = F3( 43569 function (x, y, progress) { 43570 return $elm$core$Basics$sqrt(((x * x) * (1 - progress)) + ((y * y) * progress)); 43571 }); 43572var $author$project$InternalAnim$Move$lerpColor = F3( 43573 function (progress, from, target) { 43574 var two = $avh4$elm_color$Color$toRgba(target); 43575 var one = $avh4$elm_color$Color$toRgba(from); 43576 return A4( 43577 $avh4$elm_color$Color$rgba, 43578 A3($author$project$InternalAnim$Move$average, one.pN, two.pN, progress), 43579 A3($author$project$InternalAnim$Move$average, one.mQ, two.mQ, progress), 43580 A3($author$project$InternalAnim$Move$average, one.lC, two.lC, progress), 43581 A3($author$project$InternalAnim$Move$average, one.lm, two.lm, progress)); 43582 }); 43583var $author$project$InternalAnim$Move$lerpFloat = F3( 43584 function (t, one, two) { 43585 return one + ((two - one) * t); 43586 }); 43587var $author$project$InternalAnim$Move$lerpVector = F3( 43588 function (t, one, two) { 43589 return { 43590 rm: A3($author$project$InternalAnim$Move$lerpFloat, t, one.rm, two.rm), 43591 k0: A3($author$project$InternalAnim$Move$lerpFloat, t, one.k0, two.k0), 43592 k1: A3($author$project$InternalAnim$Move$lerpFloat, t, one.k1, two.k1) 43593 }; 43594 }); 43595var $author$project$InternalAnim$Css$vectorStateToVector = function (state) { 43596 return { 43597 rm: $author$project$InternalAnim$Units$inPixels(state.rm.cM), 43598 k0: $author$project$InternalAnim$Units$inPixels(state.k0.cM), 43599 k1: $author$project$InternalAnim$Units$inPixels(state.k1.cM) 43600 }; 43601}; 43602var $author$project$InternalAnim$Css$vectorToHash = F2( 43603 function (group, vec) { 43604 if ((!vec.rm) && ((!vec.k0) && (!vec.k1))) { 43605 return ''; 43606 } else { 43607 var tag = function () { 43608 switch (group) { 43609 case 10: 43610 return 't'; 43611 case 20: 43612 return 's'; 43613 default: 43614 return 'v'; 43615 } 43616 }(); 43617 return tag + ($author$project$InternalAnim$Hash$float(vec.rm) + ('-' + ($author$project$InternalAnim$Hash$float(vec.k0) + ('-' + $author$project$InternalAnim$Hash$float(vec.k1))))); 43618 } 43619 }); 43620var $author$project$InternalAnim$Css$Props$scaleToString = function (vec) { 43621 return $author$project$InternalAnim$Css$Props$vectorToCssString(vec); 43622}; 43623var $author$project$InternalAnim$Css$Props$translateToString = function (_v0) { 43624 var x = _v0.rm; 43625 var y = _v0.k0; 43626 var z = _v0.k1; 43627 return $author$project$InternalAnim$Css$Props$floatToString(x) + ('px ' + ($author$project$InternalAnim$Css$Props$floatToString(y) + ('px ' + ($author$project$InternalAnim$Css$Props$floatToString(z) + 'px')))); 43628}; 43629var $author$project$InternalAnim$Css$Props$vectorToString = F2( 43630 function (id, vec) { 43631 switch (id) { 43632 case 10: 43633 return $author$project$InternalAnim$Css$Props$translateToString(vec); 43634 case 20: 43635 return $author$project$InternalAnim$Css$Props$scaleToString(vec); 43636 default: 43637 return $author$project$InternalAnim$Css$Props$vectorToCssString(vec); 43638 } 43639 }); 43640var $author$project$InternalAnim$Css$props2Css = F4( 43641 function (allowTransitions, now, renderedProps, anim) { 43642 props2Css: 43643 while (true) { 43644 if (!renderedProps.b) { 43645 return anim; 43646 } else { 43647 switch (renderedProps.a.$) { 43648 case 0: 43649 var details = renderedProps.a.a; 43650 var remain = renderedProps.b; 43651 var $temp$allowTransitions = allowTransitions, 43652 $temp$now = now, 43653 $temp$renderedProps = remain, 43654 $temp$anim = function () { 43655 var _v1 = details.i; 43656 if (!_v1.b) { 43657 var val = $author$project$InternalAnim$Units$inPixels(detail
43657s.hp.cM); 43658 var value = A2($author$project$InternalAnim$Css$Props$format, details.aa, val); 43659 return _Utils_update( 43660 anim, 43661 { 43662 iR: _Utils_ap( 43663 A2($author$project$InternalAnim$Css$Props$hash, details, val), 43664 anim.iR), 43665 fi: A2( 43666 $elm$core$List$cons, 43667 _Utils_Tuple2(details.bW, value), 43668 anim.fi) 43669 }); 43670 } else { 43671 return A2( 43672 $author$project$InternalAnim$Css$combine, 43673 anim, 43674 A9( 43675 $author$project$InternalAnim$Move$cssForSections, 43676 now, 43677 allowTransitions, 43678 $author$project$InternalAnim$Units$inPixels(details.hp.cM), 43679 details.bW, 43680 F3( 43681 function (t, one, two) { 43682 return details.bW + (': ' + A2( 43683 $author$project$InternalAnim$Css$Props$format, 43684 details.aa, 43685 A3($author$project$InternalAnim$Move$lerpFloat, t, one, two))); 43686 }), 43687 $author$project$InternalAnim$Css$Props$format(details.aa), 43688 $author$project$InternalAnim$Css$Props$hash(details), 43689 $elm$core$List$reverse(details.i), 43690 $author$project$InternalAnim$Css$emptyAnim)); 43691 } 43692 }(); 43693 allowTransitions = $temp$allowTransitions; 43694 now = $temp$now; 43695 renderedProps = $temp$renderedProps; 43696 anim = $temp$anim; 43697 continue props2Css; 43698 case 1: 43699 var details = renderedProps.a.a; 43700 var remain = renderedProps.b; 43701 var $temp$allowTransitions = allowTransitions, 43702 $temp$now = now, 43703 $temp$renderedProps = remain, 43704 $temp$anim = function () { 43705 var _v2 = details.i; 43706 if (!_v2.b) { 43707 return _Utils_update( 43708 anim, 43709 { 43710 iR: details.bW + ('-' + ($author$project$InternalAnim$Css$Props$colorHash(details.ic) + anim.iR)), 43711 fi: A2( 43712 $elm$core$List$cons, 43713 _Utils_Tuple2( 43714 details.bW, 43715 $avh4$elm_color$Color$toCssString(details.ic)), 43716 anim.fi) 43717 }); 43718 } else { 43719 return A2( 43720 $author$project$InternalAnim$Css$combine, 43721 anim, 43722 A9( 43723 $author$project$InternalAnim$Move$cssForSections, 43724 now, 43725 allowTransitions, 43726 details.ic, 43727 details.bW, 43728 F3( 43729 function (t, one, two) { 43730 return details.bW + (': ' + $avh4$elm_color$Color$toCssString( 43731 A3($author$project$InternalAnim$Move$lerpColor, t, one, two))); 43732 }), 43733 $avh4$elm_color$Color$toCssString, 43734 $author$project$InternalAnim$Css$Props$colorHash, 43735 $elm$core$List$reverse(details.i), 43736 $author$project$InternalAnim$Css$emptyAnim)); 43737 } 43738 }(); 43739 allowTransitions = $temp$allowTransitions; 43740 now = $temp$now; 43741 renderedProps = $temp$renderedProps; 43742 anim = $temp$anim; 43743 continue props2Css; 43744 default: 43745 var details = renderedProps.a.a; 43746 var remain = renderedProps.b; 43747 var $temp$allowTransitions = allowTransitions, 43748 $temp$now = now, 43749 $temp$renderedProps = remain, 43750 $temp$anim = function () { 43751 var _v3 = details.i; 43752 if (!_v3.b) { 43753 return _Utils_update( 43754 anim, 43755 { 43756 iR: _Utils_ap( 43757 A2( 43758 $author$project$InternalAnim$Css$vectorToHash, 43759 details.cs, 43760 $author$project$InternalAnim$Css$vectorStateToVector(details.hp)), 43761 anim.iR), 43762 fi: A2( 43763 $elm$core$List$cons, 43764 _Utils_Tuple2( 43765 details.bW, 43766 A2( 43767 $author$project$InternalAnim$Css$Props$vectorToString, 43768 details.cs, 43769 $author$project$InternalAnim$Css$vectorStateToVector(details.hp))), 43770 anim.fi) 43771 }); 43772 } else { 43773 return A2( 43774 $author$project$InternalAnim$Css$combine, 43775 anim, 43776 A9( 43777 $author$project$InternalAnim$Move$cssForSections, 43778 now, 43779 allowTransitions, 43780 $author$project$InternalAnim$Css$vectorStateToVector(details.hp), 43781 details.bW, 43782 F3( 43783 function (t, one, two) { 43784 return details.bW + (': ' + A2( 43785 $author$project$InternalAnim$Css$Props$vectorToString, 43786 details.cs, 43787 A3($author$project$InternalAnim$Move$lerpVector, t, one, two))); 43788 }), 43789 $author$project$InternalAnim$Css$Props$vectorToString(details.cs),
43790 $author$project$InternalAnim$Css$vectorToHash(details.cs), 43791 $elm$core$List$reverse(details.i), 43792 $author$project$InternalAnim$Css$emptyAnim)); 43793 } 43794 }(); 43795 allowTransitions = $temp$allowTransitions; 43796 now = $temp$now; 43797 renderedProps = $temp$renderedProps; 43798 anim = $temp$anim; 43799 continue props2Css; 43800 } 43801 } 43802 } 43803 }); 43804var $author$project$InternalAnim$Css$toCss = function (_v0) { 43805 var allowTransitions = _v0.ee; 43806 var now = _v0.cH; 43807 var attrs = _v0.ei; 43808 var cssDetails = A4($author$project$InternalAnim$Css$props2Css, allowTransitions, now, attrs, $author$project$InternalAnim$Css$emptyAnim); 43809 return { 43810 iR: cssDetails.iR, 43811 $7: cssDetails.$7, 43812 fi: function () { 43813 var _v1 = cssDetails.cc; 43814 if (_v1 === '') { 43815 var _v2 = cssDetails.kM; 43816 if (_v2 === '') { 43817 return cssDetails.fi; 43818 } else { 43819 var trans = _v2; 43820 return A2( 43821 $elm$core$List$cons, 43822 _Utils_Tuple2('transition', trans), 43823 cssDetails.fi); 43824 } 43825 } else { 43826 var anim = _v1; 43827 var _v3 = cssDetails.kM; 43828 if (_v3 === '') { 43829 return A2( 43830 $elm$core$List$cons, 43831 _Utils_Tuple2('animation', anim), 43832 cssDetails.fi); 43833 } else { 43834 var trans = _v3; 43835 return A2( 43836 $elm$core$List$cons, 43837 _Utils_Tuple2('animation', anim), 43838 A2( 43839 $elm$core$List$cons, 43840 _Utils_Tuple2('transition', trans), 43841 cssDetails.fi)); 43842 } 43843 } 43844 }(), 43845 kM: cssDetails.kM 43846 }; 43847}; 43848var $author$project$InternalAnim$Render$toInitialProp = function (key) { 43849 switch (key.$) { 43850 case 0: 43851 return _Utils_Tuple2('translate', '0% 0'); 43852 case 1: 43853 return _Utils_Tuple2('scale', '1'); 43854 case 2: 43855 var name = key.a; 43856 return _Utils_Tuple2(name, 'rgba(0,0,0,0)'); 43857 default: 43858 var name = key.b; 43859 var format = key.d; 43860 var value = key.e; 43861 return _Utils_Tuple2( 43862 name, 43863 A2($author$project$InternalAnim$Css$Props$format, format, value)); 43864 } 43865}; 43866var $author$project$Animator$toCss = function (opt) { 43867 if (!opt.$) { 43868 var anim = opt.a; 43869 return $author$project$InternalAnim$Css$toCss(anim); 43870 } else { 43871 var anims = opt.a.hR; 43872 var styles = A2( 43873 $elm$core$List$filterMap, 43874 function (_v1) { 43875 var key = _v1.a; 43876 var keyframeList = _v1.b; 43877 if (!keyframeList.b) { 43878 return $elm$core$Maybe$Just( 43879 $author$project$InternalAnim$Render$toInitialProp(key)); 43880 } else { 43881 return $elm$core$Maybe$Nothing; 43882 } 43883 }, 43884 anims); 43885 return { 43886 iR: '', 43887 $7: A3( 43888 $author$project$Animator$joinOn, 43889 '', 43890 A2( 43891 $elm$core$Basics$composeR, 43892 $elm$core$Tuple$second, 43893 A2( 43894 $author$project$Animator$joinOn, 43895 '', 43896 function ($) { 43897 return $.$7; 43898 })), 43899 anims), 43900 fi: A2( 43901 $elm$core$List$cons, 43902 _Utils_Tuple2( 43903 'animation', 43904 A3( 43905 $author$project$Animator$joinOn, 43906 ',', 43907 A2( 43908 $elm$core$Basics$composeR, 43909 $elm$core$Tuple$second, 43910 A2( 43911 $author$project$Animator$joinOn, 43912 ',', 43913 function ($) { 43914 return $.lr; 43915 })), 43916 anims)), 43917 styles), 43918 kM: '' 43919 }; 43920 } 43921}; 43922var $author$project$InternalAnim$Move$AllowTransitions = 0; 43923var $author$project$Animator$Animation = function (a) { 43924 return {$: 0, a: a}; 43925}; 43926var $author$project$InternalAnim$Timeline$Line = F3( 43927 function (a, b, c) { 43928 return {$: 0, a: a, b: b, c: c}; 43929 }); 43930var $author$project$InternalAnim$Timeline$Occurring = F3( 43931 function (a, b, c) { 43932 return {$: 0, a: a, b: b, c: c}; 43933 }); 43934var $author$project$InternalAnim$Timeline$Timeline = $elm$core$Basics$identity; 43935var $author$project$InternalAnim$Timeline$Timetable = $elm$core$Basics$identity; 43936var $author$project$InternalAnim$Time$absolute = function (posix) { 43937 return $elm$time$Time$posixToMillis(posix); 43938}; 43939var $author$project$InternalAnim$Time$advanceBy = F2( 43940 function (dur, time) { 43941 return A2( 43942 $author$project$InternalAnim$Quantity$plus, 43943 time, 43944 $author$project$InternalAnim$Duration$inMilliseconds(dur)); 43945 }); 43946var $author$project$InternalAnim$Timeline$getUpdatedAt = function (_v0) { 43947 var details = _v0; 43948 return details.kQ; 43949}; 43950var $author$project$InternalAnim$Timeline$endTime = function (_v0) { 43951 var end = _v0.c; 43952 return end; 43953}; 43954var $author$project$InternalAnim$Timeline$startTime = function (_v0) { 43955 var time = _v0.b; 43956 return time; 43957}; 43958var $author$project$InternalAnim$Time$thisBeforeThat = F2( 43959 function (_v0, _v1) { 43960 var _this = _v0; 43961 var that = _v1; 43962 return (_this - that) < 0; 43963 }); 43964var $author$project$InternalAnim$Timeline$visitAll = F8( 43965 function (now, toAnchor, transitionTo, details, prev, queue, future, state) { 43966 visitAll: 43967 while (true) { 43968 if (!queue.b) { 43969 if (!future.b) { 43970 return state; 43971 } else { 43972 if (!future.b.b) { 43973 var _v2 = future.a; 43974 var futureStart = _v2.a; 43975 var futureEvent = _v2.b; 43976 var futureRemain = _v2.c; 43977 var _new = A7( 43978 transitionTo, 43979 toAnchor, 43980 futureEvent, 43981 now, 43982 futureStart, 43983 $author$project$InternalAnim$Timeline$startTime(futureEvent), 43984 futureRemain, 43985 state); 43986 var $temp$now = now, 43987 $temp$toAnchor = toAnchor,
43988 $temp$transitionTo = transitionTo, 43989 $temp$details = details, 43990 $temp$prev = futureEvent, 43991 $temp$queue = futureRemain, 43992 $temp$future = _List_Nil, 43993 $temp$state = _new; 43994 now = $temp$now; 43995 toAnchor = $temp$toAnchor; 43996 transitionTo = $temp$transitionTo; 43997 details = $temp$details; 43998 prev = $temp$prev; 43999 queue = $temp$queue; 44000 future = $temp$future; 44001 state = $temp$state; 44002 continue visitAll; 44003 } else { 44004 var _v3 = future.a; 44005 var futureStart = _v3.a; 44006 var futureEvent = _v3.b; 44007 var futureRemain = _v3.c; 44008 var allFuture = future.b; 44009 var _v4 = allFuture.a; 44010 var nextStart = _v4.a; 44011 var nextEvent = _v4.b; 44012 var nextRemain = _v4.c; 44013 if (A2( 44014 $author$project$InternalAnim$Time$thisBeforeThat, 44015 nextStart, 44016 $author$project$InternalAnim$Timeline$endTime(futureEvent))) { 44017 var _new = A7(transitionTo, toAnchor, futureEvent, now, futureStart, nextStart, futureRemain, state); 44018 var $temp$now = now, 44019 $temp$toAnchor = toAnchor, 44020 $temp$transitionTo = transitionTo, 44021 $temp$details = details, 44022 $temp$prev = nextEvent, 44023 $temp$queue = nextRemain, 44024 $temp$future = allFuture, 44025 $temp$state = _new; 44026 now = $temp$now; 44027 toAnchor = $temp$toAnchor; 44028 transitionTo = $temp$transitionTo; 44029 details = $temp$details; 44030 prev = $temp$prev; 44031 queue = $temp$queue; 44032 future = $temp$future; 44033 state = $temp$state; 44034 continue visitAll; 44035 } else { 44036 var _new = A7( 44037 transitionTo, 44038 toAnchor, 44039 futureEvent, 44040 now, 44041 $author$project$InternalAnim$Timeline$endTime(prev), 44042 nextStart, 44043 futureRemain, 44044 state); 44045 var $temp$now = now, 44046 $temp$toAnchor = toAnchor, 44047 $temp$transitionTo = transitionTo, 44048 $temp$details = details, 44049 $temp$prev = futureEvent, 44050 $temp$queue = futureRemain, 44051 $temp$future = allFuture, 44052 $temp$state = _new; 44053 now = $temp$now; 44054 toAnchor = $temp$toAnchor; 44055 transitionTo = $temp$transitionTo; 44056 details = $temp$details; 44057 prev = $temp$prev; 44058 queue = $temp$queue; 44059 future = $temp$future; 44060 state = $temp$state; 44061 continue visitAll; 44062 } 44063 } 44064 } 44065 } else { 44066 var top = queue.a; 44067 var remain = queue.b; 44068 if (!future.b) { 44069 var _new = A7( 44070 transitionTo, 44071 toAnchor, 44072 top, 44073 now, 44074 $author$project$InternalAnim$Timeline$endTime(prev), 44075 $author$project$InternalAnim$Timeline$startTime(top), 44076 remain, 44077 state); 44078 var $temp$now = now, 44079 $temp$toAnchor = toAnchor, 44080 $temp$transitionTo = transitionTo, 44081 $temp$details = details, 44082 $temp$prev = top, 44083 $temp$queue = remain, 44084 $temp$future = future, 44085 $temp$state = _new; 44086 now = $temp$now; 44087 toAnchor = $temp$toAnchor; 44088 transitionTo = $temp$transitionTo; 44089 details = $temp$details; 44090 prev = $temp$prev; 44091 queue = $temp$queue; 44092 future = $temp$future; 44093 state = $temp$state; 44094 continue visitAll; 44095 } else { 44096 var _v6 = future.a; 44097 var futureStart = _v6.a; 44098 var futureEvent = _v6.b; 44099 var futureRemain = _v6.c; 44100 var restOfFuture = future.b; 44101 if (A2( 44102 $author$project$InternalAnim$Time$thisBeforeThat, 44103 futureStart, 44104 $author$project$InternalAnim$Timeline$endTime(top))) { 44105 var _new = A7( 44106 transitionTo, 44107 toAnchor, 44108 futureEvent, 44109 now, 44110 futureStart, 44111 $author$project$InternalAnim$Timeline$endTime(futureEvent), 44112 futureRemain, 44113 A7( 44114 transitionTo, 44115 toAnchor, 44116 top, 44117 now, 44118 $author$project$InternalAnim$Timeline$endTime(prev), 44119 futureStart, 44120 remain, 44121 state)); 44122 var $temp$now = now, 44123 $temp$toAnchor = toAnchor, 44124 $temp$transitionTo = transitionTo, 44125 $temp$details = details, 44126 $temp$prev = futureEvent, 44127 $temp$queue = futureRemain, 44128 $temp$future = restOfFuture, 44129 $temp$state = _new; 44130 now = $temp$now; 44131 toAnchor = $temp$toAnchor;
44132 transitionTo = $temp$transitionTo; 44133 details = $temp$details; 44134 prev = $temp$prev; 44135 queue = $temp$queue; 44136 future = $temp$future; 44137 state = $temp$state; 44138 continue visitAll; 44139 } else { 44140 var _new = A7( 44141 transitionTo, 44142 toAnchor, 44143 top, 44144 now, 44145 $author$project$InternalAnim$Timeline$endTime(prev), 44146 $author$project$InternalAnim$Timeline$endTime(top), 44147 remain, 44148 state); 44149 var $temp$now = now, 44150 $temp$toAnchor = toAnchor, 44151 $temp$transitionTo = transitionTo, 44152 $temp$details = details, 44153 $temp$prev = top, 44154 $temp$queue = remain, 44155 $temp$future = future, 44156 $temp$state = _new; 44157 now = $temp$now; 44158 toAnchor = $temp$toAnchor; 44159 transitionTo = $temp$transitionTo; 44160 details = $temp$details; 44161 prev = $temp$prev; 44162 queue = $temp$queue; 44163 future = $temp$future; 44164 state = $temp$state; 44165 continue visitAll; 44166 } 44167 } 44168 } 44169 } 44170 }); 44171var $author$project$InternalAnim$Timeline$foldpAll = F5( 44172 function (now, lookup, toStart, transitionTo, _v0) { 44173 var timelineDetails = _v0; 44174 var _v1 = timelineDetails.iC; 44175 var timetable = _v1; 44176 var start = toStart( 44177 lookup(timelineDetails.i_)); 44178 if (!timetable.b) { 44179 return start; 44180 } else { 44181 var _v3 = timetable.a; 44182 var lineStart = _v3.a; 44183 return A8( 44184 $author$project$InternalAnim$Timeline$visitAll, 44185 now, 44186 lookup, 44187 transitionTo, 44188 timelineDetails, 44189 A3($author$project$InternalAnim$Timeline$Occurring, timelineDetails.i_, lineStart, lineStart), 44190 _List_Nil, 44191 timetable, 44192 start); 44193 } 44194 }); 44195var $author$project$InternalAnim$Css$RenderedColorProp = function (a) { 44196 return {$: 1, a: a}; 44197}; 44198var $author$project$InternalAnim$Css$RenderedProp = function (a) { 44199 return {$: 0, a: a}; 44200}; 44201var $author$project$InternalAnim$Css$Props$zero = $author$project$InternalAnim$Move$to(0); 44202var $author$project$InternalAnim$Css$Props$default = function (id) { 44203 switch (id) { 44204 case 13: 44205 return $author$project$InternalAnim$Move$to(1); 44206 case 4: 44207 return $author$project$InternalAnim$Move$to(1); 44208 case 5: 44209 return $author$project$InternalAnim$Move$to(1); 44210 case 6: 44211 return $author$project$InternalAnim$Move$to(1); 44212 default: 44213 return $author$project$InternalAnim$Css$Props$zero; 44214 } 44215}; 44216var $author$project$InternalAnim$Css$Props$groups = {kd: 20, x: 10}; 44217var $author$project$InternalAnim$Units$pixels = function (ps) { 44218 return ps; 44219}; 44220var $author$project$InternalAnim$Units$pixelsPerSecond = function (ps) { 44221 return ps; 44222}; 44223var $author$project$InternalAnim$Move$init = function (movement) { 44224 return { 44225 cM: function () { 44226 var x = movement.b; 44227 return $author$project$InternalAnim$Units$pixels(x); 44228 }(), 44229 q9: $author$project$InternalAnim$Units$pixelsPerSecond(0) 44230 }; 44231}; 44232var $author$project$InternalAnim$Css$initState = function (x) { 44233 return { 44234 cM: $author$project$InternalAnim$Units$pixels(x), 44235 q9: $author$project$InternalAnim$Units$pixelsPerSecond(0) 44236 }; 44237}; 44238var $author$project$InternalAnim$Css$initVector = function (i) { 44239 return { 44240 rm: $author$project$InternalAnim$Css$initState(i), 44241 k0: $author$project$InternalAnim$Css$initState(i), 44242 k1: $author$project$InternalAnim$Css$initState(i) 44243 }; 44244}; 44245var $author$project$InternalAnim$Css$Props$isScaleId = function (id) { 44246 return (id === 4) || ((id === 5) || ((id === 6) || (id === 7))); 44247}; 44248var $author$project$InternalAnim$Css$Props$isTranslateId = function (id) { 44249 return id < 3; 44250}; 44251var $author$project$InternalAnim$Css$matchColor = F2( 44252 function (name, renderedProp) { 44253 switch (renderedProp.$) { 44254 case 0: 44255 return false; 44256 case 1: 44257 var details = renderedProp.a; 44258 return _Utils_eq(details.bW, name); 44259 default: 44260 return false; 44261 } 44262 }); 44263var $author$project$InternalAnim$Css$matchProp = F2( 44264 function (id, renderedProp) { 44265 switch (renderedProp.$) { 44266 case 0: 44267 var details = renderedProp.a; 44268 return !(details.m9 - id); 44269 case 1: 44270 return false; 44271 default: 44272 return false; 44273 } 44274 }); 44275var $author$project$InternalAnim$Css$addInitialProps = F2( 44276 function (props, rendered) { 44277 addInitialProps: 44278 while (true) { 44279 if (!props.b) { 44280 return rendered; 44281 } else { 44282 if (!props.a.$) { 44283 var _v1 = props.a; 44284 var id = _v1.a; 44285 var name = _v1.b; 44286 var format = _v1.d; 44287 var remaining = props.b; 44288 var _new = function () { 44289 if ($author$project$InternalAnim$Css$Props$isTranslateId(id)) { 44290 var _v2 = rendered.x; 44291 if (_v2.$ === 1) { 44292 return { 44293 fi: rendered.fi, 44294 he: rendered.he, 44295 x: $elm$core$Maybe$Just( 44296 { 44297 aa: format, 44298 cs: $author$project$InternalAnim$Css$Props$groups.x,
44299 bW: name, 44300 i: _List_Nil, 44301 hp: $author$project$InternalAnim$Css$initVector(0) 44302 }) 44303 }; 44304 } else { 44305 return rendered; 44306 } 44307 } else { 44308 if ($author$project$InternalAnim$Css$Props$isScaleId(id)) { 44309 var _v3 = rendered.he; 44310 if (_v3.$ === 1) { 44311 return { 44312 fi: rendered.fi, 44313 he: $elm$core$Maybe$Just( 44314 { 44315 aa: format, 44316 cs: $author$project$InternalAnim$Css$Props$groups.kd, 44317 bW: name, 44318 i: _List_Nil, 44319 hp: $author$project$InternalAnim$Css$initVector(1) 44320 }), 44321 x: rendered.he 44322 }; 44323 } else { 44324 return rendered; 44325 } 44326 } else { 44327 if (A2( 44328 $elm$core$List$any, 44329 function (renderedProp) { 44330 return A2($author$project$InternalAnim$Css$matchProp, id, renderedProp); 44331 }, 44332 rendered.fi)) { 44333 return rendered; 44334 } else { 44335 return { 44336 fi: A2( 44337 $elm$core$List$cons, 44338 $author$project$InternalAnim$Css$RenderedProp( 44339 { 44340 aa: format, 44341 m9: id, 44342 bW: name, 44343 i: _List_Nil, 44344 hp: $author$project$InternalAnim$Move$init( 44345 $author$project$InternalAnim$Css$Props$default(id)) 44346 }), 44347 rendered.fi), 44348 he: rendered.he, 44349 x: rendered.x 44350 }; 44351 } 44352 } 44353 } 44354 }(); 44355 var $temp$props = remaining, 44356 $temp$rendered = _new; 44357 props = $temp$props; 44358 rendered = $temp$rendered; 44359 continue addInitialProps; 44360 } else { 44361 var _v4 = props.a; 44362 var name = _v4.a; 44363 var _v5 = _v4.b; 44364 var color = _v5.b; 44365 var remaining = props.b; 44366 var _new = A2( 44367 $elm$core$List$any, 44368 function (renderedProp) { 44369 return A2($author$project$InternalAnim$Css$matchColor, name, renderedProp); 44370 }, 44371 rendered.fi) ? rendered : { 44372 fi: A2( 44373 $elm$core$List$cons, 44374 $author$project$InternalAnim$Css$RenderedColorProp( 44375 {ic: color, bW: name, i: _List_Nil}), 44376 rendered.fi), 44377 he: rendered.he, 44378 x: rendered.x 44379 }; 44380 var $temp$props = remaining, 44381 $temp$rendered = _new; 44382 props = $temp$props; 44383 rendered = $temp$rendered; 44384 continue addInitialProps; 44385 } 44386 } 44387 } 44388 }); 44389var $author$project$InternalAnim$Css$VectorProp = function (a) { 44390 return {$: 2, a: a}; 44391}; 44392var $author$project$InternalAnim$Css$addMaybeVector = F2( 44393 function (maybeVector, renderedProps) { 44394 if (maybeVector.$ === 1) { 44395 return renderedProps; 44396 } else { 44397 var vector = maybeVector.a; 44398 return A2( 44399 $elm$core$List$cons, 44400 $author$project$InternalAnim$Css$VectorProp(vector), 44401 renderedProps); 44402 } 44403 }); 44404var $author$project$InternalAnim$Timeline$getEvent = function (_v0) { 44405 var ev = _v0.a; 44406 return ev; 44407}; 44408var $author$project$InternalAnim$Move$toState = function (x) { 44409 return { 44410 cM: $author$project$InternalAnim$Units$pixels(x), 44411 q9: $author$project$InternalAnim$Units$pixelsPerSecond(0) 44412 }; 44413}; 44414var $author$project$InternalAnim$Css$Props$initVectorState = F2( 44415 function (id, state) { 44416 switch (id) { 44417 case 0: 44418 return { 44419 rm: state, 44420 k0: $author$project$InternalAnim$Move$toState(0), 44421 k1: $author$project$InternalAnim$Move$toState(0) 44422 }; 44423 case 1: 44424 return { 44425 rm: $author$project$InternalAnim$Move$toState(0), 44426 k0: state, 44427 k1: $author$project$InternalAnim$Move$toState(0) 44428 }; 44429 case 2: 44430 return { 44431 rm: $author$project$InternalAnim$Move$toState(0), 44432 k0: $author$project$InternalAnim$Move$toState(0), 44433 k1: state 44434 }; 44435 case 4: 44436 return {rm: state, k0: state, k1: state}; 44437 case 5: 44438 return { 44439 rm: state, 44440 k0: $author$project$InternalAnim$Move$toState(1), 44441 k1: $author$project$InternalAnim$Move$toState(1) 44442 }; 44443 case 6: 44444 return { 44445 rm: $author$project$InternalAnim$Move$toState(1), 44446 k0: state, 44447 k1: $author$project$InternalAnim$Move$toState(1) 44448 }; 44449 case 7: 44450 return { 44451 rm: $author$project$InternalAnim$Move$toState(1), 44452 k0: $author$project$InternalAnim$Move$toState(1), 44453 k1: state 44454 }; 44455 default: 44456 return { 44457 rm: $author$project$InternalAnim$Move$toState(0), 44458 k0: $author$project$InternalAnim$Move$toState(0), 44459 k1: $author$project$InternalAnim$Move$toState(0) 44460 }; 44461 } 44462 }); 44463var $author$project$InternalAnim$Css$Props$updateVectorById = F3( 44464 function (id, val, vec) { 44465 switch (id) { 44466 case 0: 44467 return _Utils_update( 44468 vec, 44469 {rm: val}); 44470 case 1: 44471 return _Utils_update( 44472 vec, 44473 {k0: val}); 44474 case 2: 44475 return _Utils_update( 44476 vec, 44477 {k1: val}); 44478 case 4: 44479 return {rm: val, k0: val, k1: val}; 44480 case 5: 44481 return _Utils_update( 44482 vec, 44483 {rm: val}); 44484 case 6: 44485 return _Utils_update( 44486 vec, 44487 {k0: val}); 44488 case 7: 44489 return _Utils_update( 44490 vec, 44491 {k1: val}); 44492 default: 44493 return vec; 44494 } 44495 }); 44496var $author$project$InternalAnim$Css$toInitialProps = F2( 44497 function (props, rendered) { 44498 toInitialProps: 44499 while (true) { 44500 if (!props.b) { 44501 return rendered; 44502 } else { 44503 if (!props.a.$) { 44504 var _v1 = props.a; 44505 var id = _v1.a; 44506 var name = _v1.b; 44507 var movement = _v1.c; 44508 var format = _v1.d; 44509 var remaining = props.b; 44510 var $temp$props = remaining, 44511 $temp$rendered = function () { 44512 if ($author$project$InternalAnim$Css$Props$isTranslateId(id)) { 44513 var _v2 = rendered.x; 44514 if (_v2.$ === 1) { 44515 return { 44516 fi: rendered.fi, 44517 he: rendered.he, 44518 x: $elm$core$Maybe$Just( 44519 { 44520 aa: format, 44521 cs: $author$project$InternalAnim$Css$Props$groups.x,
44522 bW: name, 44523 i: _List_Nil, 44524 hp: A2( 44525 $author$project$InternalAnim$Css$Props$initVectorState, 44526 id, 44527 $author$project$InternalAnim$Move$init(movement)) 44528 }) 44529 }; 44530 } else { 44531 var translation = _v2.a; 44532 return { 44533 fi: rendered.fi, 44534 he: rendered.he, 44535 x: $elm$core$Maybe$Just( 44536 _Utils_update( 44537 translation, 44538 { 44539 hp: A3( 44540 $author$project$InternalAnim$Css$Props$updateVectorById, 44541 id, 44542 $author$project$InternalAnim$Move$init(movement), 44543 translation.hp) 44544 })) 44545 }; 44546 } 44547 } else { 44548 if ($author$project$InternalAnim$Css$Props$isScaleId(id)) { 44549 var _v3 = rendered.he; 44550 if (_v3.$ === 1) { 44551 return { 44552 fi: rendered.fi, 44553 he: $elm$core$Maybe$Just( 44554 { 44555 aa: format, 44556 cs: $author$project$InternalAnim$Css$Props$groups.kd, 44557 bW: name, 44558 i: _List_Nil, 44559 hp: A2( 44560 $author$project$InternalAnim$Css$Props$initVectorState, 44561 id, 44562 $author$project$InternalAnim$Move$init(movement)) 44563 }), 44564 x: rendered.he 44565 }; 44566 } else { 44567 var scale = _v3.a; 44568 return { 44569 fi: rendered.fi, 44570 he: $elm$core$Maybe$Just( 44571 _Utils_update( 44572 scale, 44573 { 44574 hp: A3( 44575 $author$project$InternalAnim$Css$Props$updateVectorById, 44576 id, 44577 $author$project$InternalAnim$Move$init(movement), 44578 scale.hp) 44579 })), 44580 x: rendered.x 44581 }; 44582 } 44583 } else { 44584 var state = $author$project$InternalAnim$Move$init( 44585 $author$project$InternalAnim$Css$Props$default(id)); 44586 return { 44587 fi: A2( 44588 $elm$core$List$cons, 44589 $author$project$InternalAnim$Css$RenderedProp( 44590 {aa: format, m9: id, bW: name, i: _List_Nil, hp: state}), 44591 rendered.fi), 44592 he: rendered.he, 44593 x: rendered.x 44594 }; 44595 } 44596 } 44597 }(); 44598 props = $temp$props; 44599 rendered = $temp$rendered; 44600 continue toInitialProps; 44601 } else { 44602 var _v4 = props.a; 44603 var name = _v4.a; 44604 var _v5 = _v4.b; 44605 var color = _v5.b; 44606 var remaining = props.b; 44607 var $temp$props = remaining, 44608 $temp$rendered = { 44609 fi: A2( 44610 $elm$core$List$cons, 44611 $author$project$InternalAnim$Css$RenderedColorProp( 44612 {ic: color, bW: name, i: _List_Nil}), 44613 rendered.fi), 44614 he: rendered.he, 44615 x: rendered.x 44616 }; 44617 props = $temp$props; 44618 rendered = $temp$rendered; 44619 continue toInitialProps; 44620 } 44621 } 44622 } 44623 }); 44624var $author$project$InternalAnim$Css$getInitial = F2( 44625 function (timeline, lookup) { 44626 var rendered = A5( 44627 $author$project$InternalAnim$Timeline$foldpAll, 44628 $author$project$InternalAnim$Timeline$getUpdatedAt(timeline), 44629 lookup, 44630 function (props) { 44631 return A2( 44632 $author$project$InternalAnim$Css$toInitialProps, 44633 props, 44634 {fi: _List_Nil, he: $elm$core$Maybe$Nothing, x: $elm$core$Maybe$Nothing}); 44635 }, 44636 F7( 44637 function (get, target, _v0, _v1, _v2, _v3, cursor) { 44638 return A2( 44639 $author$project$InternalAnim$Css$addInitialProps, 44640 get( 44641 $author$project$InternalAnim$Timeline$getEvent(target)), 44642 cursor); 44643 }), 44644 timeline); 44645 return A2( 44646 $author$project$InternalAnim$Css$addMaybeVector, 44647 rendered.he, 44648 A2($author$project$InternalAnim$Css$addMaybeVector, rendered.x, rendered.fi)); 44649 }); 44650var $author$project$InternalAnim$Css$Props$X = 0; 44651var $author$project$InternalAnim$Css$Props$Y = 1; 44652var $author$project$InternalAnim$Css$Props$Z = 2; 44653var $author$project$InternalAnim$Quantity$greaterThan = F2( 44654 function (_v0, _v1) { 44655 var y = _v0; 44656 var x = _v1; 44657 return _Utils_cmp(x, y) > 0; 44658 }); 44659var $author$project$InternalAnim$Time$duration = F2( 44660 function (one, two) { 44661 return A2($author$project$InternalAnim$Quantity$greaterThan, two, one) ? $author$project$InternalAnim$Duration$milliseconds( 44662 A2( 44663 $elm$core$Basics$max, 44664 0, 44665 $author$project$InternalAnim$Time$inMilliseconds(one) - $author$project$InternalAnim$Time$inMilliseconds(two
44665))) : $author$project$InternalAnim$Duration$milliseconds( 44666 A2( 44667 $elm$core$Basics$max, 44668 0, 44669 $author$project$InternalAnim$Time$inMilliseconds(two) - $author$project$InternalAnim$Time$inMilliseconds(one))); 44670 }); 44671var $mdgriffith$elm_bezier$Bezier$interpolateValue = F3( 44672 function (start, end, t) { 44673 return (t <= 0.5) ? (start + (t * (end - start))) : (end + ((1 - t) * (start - end))); 44674 }); 44675var $mdgriffith$elm_bezier$Bezier$firstDerivative = F2( 44676 function (_v0, proportion) { 44677 var p1 = _v0.a; 44678 var p2 = _v0.b; 44679 var p3 = _v0.c; 44680 var p4 = _v0.d; 44681 var vy3 = p4.k0 - p3.k0; 44682 var vy2 = p3.k0 - p2.k0; 44683 var wy2 = A3($mdgriffith$elm_bezier$Bezier$interpolateValue, vy2, vy3, proportion); 44684 var vy1 = p2.k0 - p1.k0; 44685 var wy1 = A3($mdgriffith$elm_bezier$Bezier$interpolateValue, vy1, vy2, proportion); 44686 var vx3 = p4.rm - p3.rm; 44687 var vx2 = p3.rm - p2.rm; 44688 var wx2 = A3($mdgriffith$elm_bezier$Bezier$interpolateValue, vx2, vx3, proportion); 44689 var vx1 = p2.rm - p1.rm; 44690 var wx1 = A3($mdgriffith$elm_bezier$Bezier$interpolateValue, vx1, vx2, proportion); 44691 return { 44692 rm: 3 * A3($mdgriffith$elm_bezier$Bezier$interpolateValue, wx1, wx2, proportion), 44693 k0: 3 * A3($mdgriffith$elm_bezier$Bezier$interpolateValue, wy1, wy2, proportion) 44694 }; 44695 }); 44696var $author$project$InternalAnim$Units$inPixelsPerSecond = function (_v0) { 44697 var pps = _v0; 44698 return pps; 44699}; 44700var $elm$core$Basics$isNaN = _Basics_isNaN; 44701var $author$project$InternalAnim$Transition$toReal = F3( 44702 function (start, end, t) { 44703 return start + (t * (end - start)); 44704 }); 44705var $author$project$InternalAnim$Transition$atX = F6( 44706 function (progress, startTime, targetTime, transition, current, target) { 44707 if (!transition.$) { 44708 var spline = transition.a; 44709 var startingPosition = $author$project$InternalAnim$Units$inPixels(current.cM); 44710 var pos = A2($mdgriffith$elm_bezier$Bezier$atX, progress, spline); 44711 return { 44712 cM: $author$project$InternalAnim$Units$pixels( 44713 A3($author$project$InternalAnim$Transition$toReal, startingPosition, target, pos.pv.k0)), 44714 q9: function () { 44715 var normalizedVelocity = A2($mdgriffith$elm_bezier$Bezier$firstDerivative, spline, pos.qE); 44716 var scaledX = normalizedVelocity.rm * $author$project$InternalAnim$Duration$inSeconds( 44717 A2($author$project$InternalAnim$Time$duration, startTime, targetTime)); 44718 var scaledY = normalizedVelocity.k0 * (target - startingPosition); 44719 return ((!scaledX) || $elm$core$Basics$isNaN(scaledX)) ? $author$project$InternalAnim$Units$pixelsPerSecond(0) : $author$project$InternalAnim$Units$pixelsPerSecond(scaledY / scaledX); 44720 }() 44721 }; 44722 } else { 44723 var wob = transition.a; 44724 var totalDuration = $author$project$InternalAnim$Duration$inMilliseconds( 44725 A2($author$project$InternalAnim$Time$duration, startTime, targetTime)); 44726 var params = $mdgriffith$elm_bezier$Bezier$Spring$new( 44727 {jW: wob.jW, qa: totalDuration, k$: wob.k$}); 44728 var durationMilliseconds = totalDuration * progress; 44729 var currentVelocity = $author$project$InternalAnim$Units$inPixelsPerSecond(current.q9); 44730 var sprung = A2( 44731 $mdgriffith$elm_bezier$Bezier$Spring$at, 44732 { 44733 i_: { 44734 cM: $author$project$InternalAnim$Units$inPixels(current.cM), 44735 q9: (!progress) ? wob.eU : currentVelocity 44736 }, 44737 qr: params, 44738 kz: target 44739 }, 44740 durationMilliseconds); 44741 return { 44742 cM: $author$project$InternalAnim$Units$pixels(sprung.cM), 44743 q9: $author$project$InternalAnim$Units$pixelsPerSecond(sprung.q9) 44744 }; 44745 } 44746 }); 44747var $author$project$InternalAnim$Move$at = F5( 44748 function (progress, startTime, targetTime, _v0, current) { 44749 var transition = _v0.a; 44750 var targetPosition = _v0.b; 44751 var dwell = _v0.c; 44752 return A6($author$project$InternalAnim$Transition$atX, progress, startTime, targetTime, transition, current, targetPosition); 44753 }); 44754var $author$project$InternalAnim$Css$colorOrDefault = F3( 44755 function (targetName, _default, props) { 44756 colorOrDefault: 44757 while (true) { 44758 if (!props.b) { 44759 return _default; 44760 } else { 44761 if (!props.a.$) { 44762 var _v1 = props.a; 44763 var remain = props.b; 44764 var $temp$targetName = targetName, 44765 $temp$default = _default, 44766 $temp$props = remain; 44767 targetName = $temp$targetName; 44768 _default = $temp$default; 44769 props = $temp$props; 44770 continue colorOrDefault; 44771 } else { 44772 var _v2 = props.a; 44773 var name = _v2.a; 44774 var _v3 = _v2.b; 44775 var clr = _v3.b; 44776 var remain = props.b; 44777 if (_Utils_eq(targetName, name)) { 44778 return clr; 44779 } else { 44780 var $temp$targetName = targetName, 44781 $temp$default = _default, 44782 $temp$props = remain; 44783 targetName = $temp$targetName; 44784 _default = $temp$default; 44785 props = $temp$props; 44786 continue colorOrDefault; 44787 } 44788 } 44789 } 44790 } 44791 }); 44792var $author$project$InternalAnim$Transition$toBezierPoints = function (spline) { 44793 return { 44794 iG: $mdgriffith$elm_bezier$Bezier$last(spline), 44795 jx: $mdgriffith$elm_bezier$Bezier$first(spline), 44796 kC: $mdgriffith$elm_bezier$Bezier$controlTwo(spline), 44797 kN: $mdgriffith$elm_bezier$Bezier$controlOne(spline) 44798 }; 44799}; 44800var $author$project$InternalAnim$Transition$isStandard = function (trans) { 44801 if (!trans.$) { 44802 var spline = trans.a; 44803 var _v1 = $author$project$InternalAnim$Transition$toBezierPoints(spline); 44804 var one = _v1.jx; 44805 var two = _v1.kN;
44806 var three = _v1.kC; 44807 var four = _v1.iG; 44808 return _Utils_eq( 44809 one, 44810 {rm: 0, k0: 0}) && (_Utils_eq( 44811 two, 44812 {rm: 0.4, k0: 0}) && (_Utils_eq( 44813 three, 44814 {rm: 0.2, k0: 1}) && _Utils_eq( 44815 four, 44816 {rm: 1, k0: 1}))); 44817 } else { 44818 return false; 44819 } 44820}; 44821var $author$project$InternalAnim$Css$getCommonTransformTransition = F2( 44822 function (props, currentTrans) { 44823 getCommonTransformTransition: 44824 while (true) { 44825 if (!props.b) { 44826 return currentTrans; 44827 } else { 44828 if (!props.a.$) { 44829 var _v1 = props.a; 44830 var _v2 = _v1.c; 44831 var trans = _v2.a; 44832 var remain = props.b; 44833 if ($author$project$InternalAnim$Transition$isStandard(trans)) { 44834 var $temp$props = remain, 44835 $temp$currentTrans = currentTrans; 44836 props = $temp$props; 44837 currentTrans = $temp$currentTrans; 44838 continue getCommonTransformTransition; 44839 } else { 44840 var $temp$props = remain, 44841 $temp$currentTrans = trans; 44842 props = $temp$props; 44843 currentTrans = $temp$currentTrans; 44844 continue getCommonTransformTransition; 44845 } 44846 } else { 44847 var _v3 = props.a; 44848 var _v4 = _v3.b; 44849 var trans = _v4.a; 44850 var remain = props.b; 44851 var $temp$props = remain, 44852 $temp$currentTrans = trans; 44853 props = $temp$props; 44854 currentTrans = $temp$currentTrans; 44855 continue getCommonTransformTransition; 44856 } 44857 } 44858 } 44859 }); 44860var $author$project$InternalAnim$Move$Sequence = F4( 44861 function (a, b, c, d) { 44862 return {$: 0, a: a, b: b, c: c, d: d}; 44863 }); 44864var $author$project$InternalAnim$Move$Step = F3( 44865 function (a, b, c) { 44866 return {$: 0, a: a, b: b, c: c}; 44867 }); 44868var $author$project$InternalAnim$Css$Props$defaultPosition = function (id) { 44869 switch (id) { 44870 case 13: 44871 return 1; 44872 case 3: 44873 return 0; 44874 case 4: 44875 return 1; 44876 case 5: 44877 return 1; 44878 case 6: 44879 return 1; 44880 case 7: 44881 return 1; 44882 default: 44883 return 0; 44884 } 44885}; 44886var $author$project$InternalAnim$Css$getAt = F2( 44887 function (i, list) { 44888 getAt: 44889 while (true) { 44890 if (!list.b) { 44891 return $elm$core$Maybe$Nothing; 44892 } else { 44893 var top = list.a; 44894 var remain = list.b; 44895 if (!i) { 44896 return $elm$core$Maybe$Just(top); 44897 } else { 44898 var $temp$i = i - 1, 44899 $temp$list = remain; 44900 i = $temp$i; 44901 list = $temp$list; 44902 continue getAt; 44903 } 44904 } 44905 } 44906 }); 44907var $author$project$InternalAnim$Css$getTransformSequenceValueAt = F6( 44908 function (seqLevel, stepLevel, maybeDefaultId, targetId, props, defaultValue) { 44909 getTransformSequenceValueAt: 44910 while (true) { 44911 if (!props.b) { 44912 if (defaultValue.$ === 1) { 44913 return $author$project$InternalAnim$Css$Props$defaultPosition(targetId); 44914 } else { 44915 var _default = defaultValue.a; 44916 return _default; 44917 } 44918 } else { 44919 if (!props.a.$) { 44920 var _v2 = props.a; 44921 var id = _v2.a; 44922 var move = _v2.c; 44923 var remain = props.b; 44924 if (!(id - targetId)) { 44925 var v = move.b; 44926 var seq = move.c; 44927 var _v4 = A2($author$project$InternalAnim$Css$getAt, seqLevel, seq); 44928 if (_v4.$ === 1) { 44929 return v; 44930 } else { 44931 var _v5 = _v4.a; 44932 var seqSteps = _v5.d; 44933 var _v6 = A2($author$project$InternalAnim$Css$getAt, stepLevel, seqSteps); 44934 if (_v6.$ === 1) { 44935 return v; 44936 } else { 44937 var _v7 = _v6.a; 44938 var stepValue = _v7.c; 44939 return stepValue; 44940 } 44941 } 44942 } else { 44943 if (maybeDefaultId.$ === 1) { 44944 var $temp$seqLevel = seqLevel, 44945 $temp$stepLevel = stepLevel, 44946 $temp$maybeDefaultId = maybeDefaultId, 44947 $temp$targetId = targetId, 44948 $temp$props = remain, 44949 $temp$defaultValue = defaultValue; 44950 seqLevel = $temp$seqLevel; 44951 stepLevel = $temp$stepLevel; 44952 maybeDefaultId = $temp$maybeDefaultId; 44953 targetId = $temp$targetId; 44954 props = $temp$props; 44955 defaultValue = $temp$defaultValue; 44956 continue getTransformSequenceValueAt; 44957 } else { 44958 var defaultId = maybeDefaultId.a; 44959 if (!(id - defaultId)) { 44960 var newDefaultValue = function () { 44961 var v = move.b; 44962 var seq = move.c; 44963 var _v10 = A2($author$project$InternalAnim$Css$getAt, seqLevel, seq); 44964 if (_v10.$ === 1) { 44965 return v; 44966 } else { 44967 var _v11 = _v10.a; 44968 var seqSteps = _v11.d; 44969 var _v12 = A2($author$project$InternalAnim$Css$getAt, stepLevel, seqSteps); 44970 if (_v12.$ === 1) { 44971 return v; 44972 } else { 44973 var _v13 = _v12.a; 44974 var stepValue = _v13.c; 44975 return stepValue; 44976 } 44977 } 44978 }(); 44979 var $temp$seqLevel = seqLevel, 44980 $temp$stepLevel = stepLevel, 44981 $temp$maybeDefaultId = $elm$core$Maybe$Nothing, 44982 $temp$targetId = targetId, 44983 $temp$props = remain, 44984 $temp$defaultValue = $elm$core$Maybe$Just(newDefaultValue); 44985 seqLevel = $temp$seqLevel; 44986 stepLevel = $temp$stepLevel; 44987 maybeDefaultId = $temp$maybeDefaultId; 44988 targetId = $temp$targetId; 44989 props = $temp$props; 44990 defaultValue = $temp$defaultValue; 44991 continue getTransformSequenceValueAt; 44992 } else { 44993 var $temp$seqLevel = seqLevel, 44994 $temp$stepLevel = stepLevel, 44995 $temp$maybeDefaultId = maybeDefaultId, 44996 $temp$targetId = targetId, 44997 $temp$props = remain, 44998 $temp$defaultValue = defaultValue; 44999 seqLevel = $temp$seqLevel; 45000 stepLevel = $temp$stepLevel; 45001 maybeDefaultId = $temp$maybeDefaultId; 45002 targetId = $temp$targetId; 45003 props = $temp$props; 45004 defaultValue = $temp$defaultValue; 45005 continue getTransformSequenceValueAt; 45006 } 45007 } 45008 } 45009 } else { 45010 var _v14 = props.a; 45011 var remain = props.b; 45012 var $temp$seqLevel = seqLevel, 45013 $temp$stepLevel = stepLevel, 45014 $temp$maybeDefaultId = maybeDefaultId, 45015 $temp$targetId = targetId, 45016 $temp$props = remain, 45017 $temp$defaultValue = defaultValue; 45018 seqLevel = $temp$seqLevel; 45019 stepLevel = $temp$stepLevel; 45020 maybeDefaultId = $temp$maybeDefaultId; 45021 targetId = $temp$targetId; 45022 props = $temp$props; 45023 defaultValue = $temp$defaultValue; 45024 continue getTransformSequenceValueAt; 45025 } 45026 } 45027 } 45028 }); 45029var $author$project$InternalAnim$Css$Props$groupToCompoundId = function (groupId) { 45030 switch (groupId) { 45031 case 10: 45032 return $elm$core$Maybe$Nothing; 45033 case 20: 45034 return $elm$core$Maybe$Just(4); 45035 default: 45036 return $elm$core$Maybe$Nothing; 45037 } 45038}; 45039var $author$project$InternalAnim$Css$Props$vectorSlotToId = F2( 45040 function (id, slot) { 45041 switch (id) { 45042 case 10: 45043 switch (slot) { 45044 case 0: 45045 return 0; 45046 case 1: 45047 return 1; 45048 default: 45049 return 2; 45050 } 45051 case 20: 45052 switch (slot) { 45053 case 0: 45054 return 5; 45055 case 1: 45056 return 6; 45057 default: 45058 return 7; 45059 } 45060 default: 45061 return 0; 45062 } 45063 }); 45064var $author$project$InternalAnim$Css$getVectorStepAt = F6( 45065 function (groupId, dur, trans, seqLevel, stepLevel, props) { 45066 var z = A2($author$project$InternalAnim$Css$Props$vectorSlotToId, groupId, 2); 45067 var y = A2($author$project$InternalAnim$Css$Props$vectorSlotToId, groupId, 1); 45068 var x = A2($author$project$InternalAnim$Css$Props$vectorSlotToId, groupId, 0); 45069 return A3( 45070 $author$project$InternalAnim$Move$Step, 45071 dur, 45072 trans, 45073 { 45074 rm: A6( 45075 $author$project$InternalAnim$Css$getTransformSequenceValueAt, 45076 seqLevel, 45077 stepLevel, 45078 $author$project$InternalAnim$Css$Props$groupToCompoundId(groupId), 45079 x, 45080 props, 45081 $elm$core$Maybe$Nothing), 45082 k0: A6( 45083 $author$project$InternalAnim$Css$getTransformSequenceValueAt, 45084 seqLevel, 45085 stepLevel, 45086 $author$project$InternalAnim$Css$Props$groupToCompoundId(groupId), 45087 y, 45088 props, 45089 $elm$core$Maybe$Nothing), 45090 k1: A6( 45091 $author$project$InternalAnim$Css$getTransformSequenceValueAt, 45092 seqLevel, 45093 stepLevel, 45094 $author$project$InternalAnim$Css$Props$groupToCompoundId(groupId), 45095 z, 45096 props, 45097 $elm$core$Maybe$Nothing) 45098 }); 45099 }); 45100var $author$project$InternalAnim$Css$gatherVectorSteps = F6( 45101 function (groupId, seqLevel, stepLevel, steps, props, transforms) { 45102 gatherVectorSteps: 45103 while (true) { 45104 if (!steps.b) { 45105 return transforms; 45106 } else { 45107 var _v1 = steps.a; 45108 var dur = _v1.a; 45109 var trans = _v1.b; 45110 var remainingSteps = steps.b; 45111 var $temp$groupId = groupId, 45112 $temp$seqLevel = seqLevel, 45113 $temp$stepLevel = stepLevel + 1, 45114 $temp$steps = remainingSteps, 45115 $temp$props = props, 45116 $temp$transforms = A2( 45117 $elm$core$List$cons, 45118 A6($author$project$InternalAnim$Css$getVectorStepAt, groupId, dur, trans, seqLevel, stepLevel, props), 45119 transforms); 45120 groupId = $temp$groupId; 45121 seqLevel = $temp$seqLevel; 45122 stepLevel = $temp$stepLevel; 45123 steps = $temp$steps; 45124 props = $temp$props; 45125 transforms = $temp$transforms; 45126 continue gatherVectorSteps; 45127 } 45128 } 45129 }); 45130var $author$project$InternalAnim$Css$vectorSeq = F5( 45131 function (groupId, props, pilotSequence, seqLevel, renderedSeq) { 45132 vectorSeq: 45133 while (true) { 45134 if (!pilotSequence.b) { 45135 return renderedSeq; 45136 } else { 45137 var _v1 = pilotSequence.a; 45138 var n = _v1.a;
45139 var delay = _v1.b; 45140 var dur = _v1.c; 45141 var steps = _v1.d; 45142 var remain = pilotSequence.b; 45143 var $temp$groupId = groupId, 45144 $temp$props = props, 45145 $temp$pilotSequence = remain, 45146 $temp$seqLevel = seqLevel + 1, 45147 $temp$renderedSeq = A2( 45148 $elm$core$List$cons, 45149 A4( 45150 $author$project$InternalAnim$Move$Sequence, 45151 n, 45152 delay, 45153 dur, 45154 A6($author$project$InternalAnim$Css$gatherVectorSteps, groupId, seqLevel, 0, steps, props, _List_Nil)), 45155 renderedSeq); 45156 groupId = $temp$groupId; 45157 props = $temp$props; 45158 pilotSequence = $temp$pilotSequence; 45159 seqLevel = $temp$seqLevel; 45160 renderedSeq = $temp$renderedSeq; 45161 continue vectorSeq; 45162 } 45163 } 45164 }); 45165var $author$project$InternalAnim$Css$getCommonVectorSequence = F3( 45166 function (groupId, props, sequences) { 45167 if (props.b && (!props.a.$)) { 45168 var _v1 = props.a; 45169 var _v2 = _v1.c; 45170 var propSeq = _v2.c; 45171 return A5($author$project$InternalAnim$Css$vectorSeq, groupId, props, propSeq, 0, _List_Nil); 45172 } else { 45173 return sequences; 45174 } 45175 }); 45176var $author$project$InternalAnim$Css$valueOrDefault = F4( 45177 function (maybeDefaultid, targetId, props, defaultVal) { 45178 valueOrDefault: 45179 while (true) { 45180 if (!props.b) { 45181 if (defaultVal.$ === 1) { 45182 return $author$project$InternalAnim$Css$Props$defaultPosition(targetId); 45183 } else { 45184 var val = defaultVal.a; 45185 return val; 45186 } 45187 } else { 45188 if (!props.a.$) { 45189 var _v2 = props.a; 45190 var id = _v2.a; 45191 var move = _v2.c; 45192 var remain = props.b; 45193 if (!(id - targetId)) { 45194 var v = move.b; 45195 return v; 45196 } else { 45197 if (maybeDefaultid.$ === 1) { 45198 var $temp$maybeDefaultid = maybeDefaultid, 45199 $temp$targetId = targetId, 45200 $temp$props = remain, 45201 $temp$defaultVal = defaultVal; 45202 maybeDefaultid = $temp$maybeDefaultid; 45203 targetId = $temp$targetId; 45204 props = $temp$props; 45205 defaultVal = $temp$defaultVal; 45206 continue valueOrDefault; 45207 } else { 45208 var defaultId = maybeDefaultid.a; 45209 if (!(id - defaultId)) { 45210 var v = move.b; 45211 var $temp$maybeDefaultid = $elm$core$Maybe$Nothing, 45212 $temp$targetId = targetId, 45213 $temp$props = remain, 45214 $temp$defaultVal = $elm$core$Maybe$Just(v); 45215 maybeDefaultid = $temp$maybeDefaultid; 45216 targetId = $temp$targetId; 45217 props = $temp$props; 45218 defaultVal = $temp$defaultVal; 45219 continue valueOrDefault; 45220 } else { 45221 var $temp$maybeDefaultid = maybeDefaultid, 45222 $temp$targetId = targetId, 45223 $temp$props = remain, 45224 $temp$defaultVal = defaultVal; 45225 maybeDefaultid = $temp$maybeDefaultid; 45226 targetId = $temp$targetId; 45227 props = $temp$props; 45228 defaultVal = $temp$defaultVal; 45229 continue valueOrDefault; 45230 } 45231 } 45232 } 45233 } else { 45234 var _v6 = props.a; 45235 var remain = props.b; 45236 var $temp$maybeDefaultid = maybeDefaultid, 45237 $temp$targetId = targetId, 45238 $temp$props = remain, 45239 $temp$defaultVal = defaultVal; 45240 maybeDefaultid = $temp$maybeDefaultid; 45241 targetId = $temp$targetId; 45242 props = $temp$props; 45243 defaultVal = $temp$defaultVal; 45244 continue valueOrDefault; 45245 } 45246 } 45247 } 45248 }); 45249var $author$project$InternalAnim$Css$getVectorSlot = F3( 45250 function (groupId, slot, props) { 45251 return A4( 45252 $author$project$InternalAnim$Css$valueOrDefault, 45253 $author$project$InternalAnim$Css$Props$groupToCompoundId(groupId), 45254 A2($author$project$InternalAnim$Css$Props$vectorSlotToId, groupId, slot), 45255 props, 45256 $elm$core$Maybe$Nothing); 45257 }); 45258var $author$project$InternalAnim$Css$Props$isGroup = F2( 45259 function (groupId, id) { 45260 switch (groupId) { 45261 case 10: 45262 switch (id) { 45263 case 0: 45264 return true; 45265 case 1: 45266 return true; 45267 case 3: 45268 return true; 45269 default: 45270 return false; 45271 } 45272 case 20: 45273 switch (id) { 45274 case 4: 45275 return true; 45276 case 5: 45277 return true; 45278 case 6: 45279 return true; 45280 case 7: 45281 return true; 45282 default: 45283 return false; 45284 } 45285 default: 45286 return false; 45287 } 45288 }); 45289var $author$project$InternalAnim$Css$isGroupProp = F2( 45290 function (groupId, prop) { 45291 if (!prop.$) { 45292 var id = prop.a; 45293 return A2($author$project$InternalAnim$Css$Props$isGroup, groupId, id); 45294 } else { 45295 return false;
45296 } 45297 }); 45298var $author$project$InternalAnim$Transition$linear = $author$project$InternalAnim$Transition$Transition( 45299 A4( 45300 $mdgriffith$elm_bezier$Bezier$fromPoints, 45301 {rm: 0, k0: 0}, 45302 {rm: 0.2, k0: 0.2}, 45303 {rm: 0.8, k0: 0.8}, 45304 {rm: 1, k0: 1})); 45305var $author$project$InternalAnim$Move$move = $author$project$InternalAnim$Move$Pos; 45306var $author$project$InternalAnim$Time$progress = F3( 45307 function (_v0, _v1, _v2) { 45308 var start = _v0; 45309 var end = _v1; 45310 var current = _v2; 45311 var total = $elm$core$Basics$abs(end - start); 45312 return (!total) ? 0 : A2( 45313 $elm$core$Basics$min, 45314 1, 45315 A2($elm$core$Basics$max, 0, (current - start) / total)); 45316 }); 45317var $author$project$InternalAnim$Move$getSequenceDuration = function (_v0) { 45318 var i = _v0.a; 45319 var delay = _v0.b; 45320 var dur = _v0.c; 45321 var steps = _v0.d; 45322 return dur; 45323}; 45324var $author$project$InternalAnim$Quantity$equalWithin = F3( 45325 function (_v0, _v1, _v2) { 45326 var tolerance = _v0; 45327 var x = _v1; 45328 var y = _v2; 45329 return _Utils_cmp( 45330 $elm$core$Basics$abs(x - y), 45331 tolerance) < 1; 45332 }); 45333var $author$project$InternalAnim$Move$push = F2( 45334 function (top, stack) { 45335 var topI = top.a; 45336 var topDelay = top.b; 45337 var topDuration = top.c; 45338 var topSteps = top.d; 45339 if (!stack.b) { 45340 return A2($elm$core$List$cons, top, stack); 45341 } else { 45342 var _v1 = stack.a; 45343 var seqI = _v1.a; 45344 var seqDelay = _v1.b; 45345 var seqDuration = _v1.c; 45346 var steps = _v1.d; 45347 var others = stack.b; 45348 if ((!(topI - seqI)) && A3($author$project$InternalAnim$Quantity$equalWithin, 0.1, topDelay, seqDuration)) { 45349 var transitionDuration = A2($author$project$InternalAnim$Time$expand, seqDuration, topDuration); 45350 return A2( 45351 $elm$core$List$cons, 45352 A4( 45353 $author$project$InternalAnim$Move$Sequence, 45354 seqI, 45355 seqDelay, 45356 transitionDuration, 45357 _Utils_ap(steps, topSteps)), 45358 others); 45359 } else { 45360 return A2($elm$core$List$cons, top, stack); 45361 } 45362 } 45363 }); 45364var $author$project$InternalAnim$Move$withSequenceDelay = F2( 45365 function (delay, _v0) { 45366 var i = _v0.a; 45367 var dur = _v0.c; 45368 var steps = _v0.d; 45369 return A4($author$project$InternalAnim$Move$Sequence, i, delay, dur, steps); 45370 }); 45371var $author$project$InternalAnim$Move$addDelayToSequence = F3( 45372 function (delay, seqs, captured) { 45373 addDelayToSequence: 45374 while (true) { 45375 if (!seqs.b) { 45376 return $elm$core$List$reverse(captured); 45377 } else { 45378 var seq = seqs.a; 45379 var remain = seqs.b; 45380 var $temp$delay = A2( 45381 $author$project$InternalAnim$Time$expand, 45382 delay, 45383 $author$project$InternalAnim$Move$getSequenceDuration(seq)), 45384 $temp$seqs = remain, 45385 $temp$captured = A2( 45386 $author$project$InternalAnim$Move$push, 45387 A2($author$project$InternalAnim$Move$withSequenceDelay, delay, seq), 45388 captured); 45389 delay = $temp$delay; 45390 seqs = $temp$seqs; 45391 captured = $temp$captured; 45392 continue addDelayToSequence; 45393 } 45394 } 45395 }); 45396var $author$project$InternalAnim$Quantity$greaterThanOrEqualTo = F2( 45397 function (_v0, _v1) { 45398 var y = _v0; 45399 var x = _v1; 45400 return _Utils_cmp(x, y) > -1; 45401 }); 45402var $elm$core$Basics$isInfinite = _Basics_isInfinite; 45403var $author$project$InternalAnim$Quantity$multiplyBy = F2( 45404 function (scale, _v0) { 45405 var value = _v0; 45406 return scale * value; 45407 }); 45408var $author$project$InternalAnim$Move$afterSequence = F2( 45409 function (durationTillNow, _v0) { 45410 var n = _v0.a; 45411 var delay = _v0.b; 45412 var duration = _v0.c; 45413 var steps = _v0.d; 45414 var floatN = n; 45415 if ($elm$core$Basics$isInfinite(floatN)) { 45416 return false; 45417 } else { 45418 var fullDuration = A2($author$project$InternalAnim$Quantity$multiplyBy, floatN, duration); 45419 return A2($author$project$InternalAnim$Quantity$greaterThanOrEqualTo, fullDuration, durationTillNow); 45420 } 45421 }); 45422var $author$project$InternalAnim$Quantity$minus = F2( 45423 function (_v0, _v1) { 45424 var y = _v0; 45425 var x = _v1; 45426 return x - y; 45427 }); 45428var $author$project$InternalAnim$Move$afterSequenceList = F3( 45429 function (durationTillNow, seq, remaining) { 45430 afterSequenceList: 45431 while (true) { 45432 if (A2($author$project$InternalAnim$Move$afterSequence, durationTillNow, seq)) { 45433 if (!remaining.b) { 45434 return true; 45435 } else { 45436 var top = remaining.a; 45437 var n = top.a; 45438 var duration = top.c; 45439 var rest = remaining.b; 45440 var durationOfUnrolledSeq = A2($author$project$InternalAnim$Quantity$multiplyBy, n, duration); 45441 var $temp$durationTillNow = A2($author$project$InternalAnim$Quantity$minus, durationOfUnrolledSeq, durationTillNow), 45442 $temp$seq = top, 45443 $temp$remaining = rest; 45444 durationTillNow = $temp$durationTillNow; 45445 seq = $temp$seq; 45446 remaining = $temp$remaining; 45447 continue afterSequenceList; 45448 } 45449 } else { 45450 return false;
45451 } 45452 } 45453 }); 45454var $author$project$InternalAnim$Time$thisAfterThat = F2( 45455 function (_v0, _v1) { 45456 var _this = _v0; 45457 var that = _v1; 45458 return (_this - that) > 0; 45459 }); 45460var $author$project$InternalAnim$Move$after = F4( 45461 function (startTime, stopTime, now, movement) { 45462 if (!movement.c.b) { 45463 return A2($author$project$InternalAnim$Time$thisAfterThat, now, stopTime); 45464 } else { 45465 var _v1 = movement.c; 45466 var seq = _v1.a; 45467 var remaining = _v1.b; 45468 return A3( 45469 $author$project$InternalAnim$Move$afterSequenceList, 45470 A2($author$project$InternalAnim$Time$duration, startTime, now), 45471 seq, 45472 remaining); 45473 } 45474 }); 45475var $author$project$InternalAnim$Move$append = F2( 45476 function (first, stack) { 45477 if (!first.b) { 45478 return stack; 45479 } else { 45480 if (!first.b.b) { 45481 var top = first.a; 45482 return A2($author$project$InternalAnim$Move$push, top, stack); 45483 } else { 45484 return _Utils_ap(first, stack); 45485 } 45486 } 45487 }); 45488var $author$project$InternalAnim$Time$equal = F2( 45489 function (_v0, _v1) { 45490 var _this = _v0; 45491 var that = _v1; 45492 return !(_this - that); 45493 }); 45494var $author$project$InternalAnim$Time$isZeroDuration = function (_v0) { 45495 var dur = _v0; 45496 return !dur; 45497}; 45498var $author$project$InternalAnim$Quantity$lessThanOrEqualTo = F2( 45499 function (_v0, _v1) { 45500 var y = _v0; 45501 var x = _v1; 45502 return _Utils_cmp(x, y) < 1; 45503 }); 45504var $author$project$InternalAnim$Transition$Wobble = function (a) { 45505 return {$: 1, a: a}; 45506}; 45507var $author$project$InternalAnim$Transition$takeAfter = F2( 45508 function (t, transition) { 45509 if (!transition.$) { 45510 var spline = transition.a; 45511 var _v1 = A2($mdgriffith$elm_bezier$Bezier$splitAtX, t, spline); 45512 var afterT = _v1.b; 45513 return $author$project$InternalAnim$Transition$Transition( 45514 $mdgriffith$elm_bezier$Bezier$normalize(afterT)); 45515 } else { 45516 var wob = transition.a; 45517 return $author$project$InternalAnim$Transition$Wobble(wob); 45518 } 45519 }); 45520var $author$project$InternalAnim$Move$takeStepsAfter = F2( 45521 function (durationToNow, steps) { 45522 takeStepsAfter: 45523 while (true) { 45524 if (!steps.b) { 45525 return _List_Nil; 45526 } else { 45527 var _v1 = steps.a; 45528 var duration = _v1.a; 45529 var transition = _v1.b; 45530 var value = _v1.c; 45531 var remain = steps.b; 45532 if (A2($author$project$InternalAnim$Quantity$greaterThan, durationToNow, duration)) { 45533 var progress = A2($author$project$InternalAnim$Time$progressWithin, durationToNow, duration); 45534 return A2( 45535 $elm$core$List$cons, 45536 A3( 45537 $author$project$InternalAnim$Move$Step, 45538 A2($author$project$InternalAnim$Quantity$minus, durationToNow, duration), 45539 A2($author$project$InternalAnim$Transition$takeAfter, progress, transition), 45540 value), 45541 remain); 45542 } else { 45543 var $temp$durationToNow = A2($author$project$InternalAnim$Quantity$minus, duration, durationToNow), 45544 $temp$steps = remain; 45545 durationToNow = $temp$durationToNow; 45546 steps = $temp$steps; 45547 continue takeStepsAfter; 45548 } 45549 } 45550 } 45551 }); 45552var $author$project$InternalAnim$Quantity$zero = 0; 45553var $author$project$InternalAnim$Move$takeAfter = F2( 45554 function (durationToNow, seq) { 45555 var n = seq.a; 45556 var delay = seq.b; 45557 var duration = seq.c; 45558 var steps = seq.d; 45559 if (A2($author$project$InternalAnim$Quantity$lessThanOrEqualTo, $author$project$InternalAnim$Move$zeroDuration, durationToNow)) { 45560 return {hX: seq, bl: $elm$core$Maybe$Nothing}; 45561 } else { 45562 if (A2($author$project$InternalAnim$Quantity$lessThanOrEqualTo, delay, durationToNow)) { 45563 return { 45564 hX: A4( 45565 $author$project$InternalAnim$Move$Sequence, 45566 n, 45567 A2($author$project$InternalAnim$Quantity$minus, durationToNow, delay), 45568 duration, 45569 steps), 45570 bl: $elm$core$Maybe$Nothing 45571 }; 45572 } else { 45573 var seqDurInMs = $elm$core$Basics$round( 45574 $author$project$InternalAnim$Duration$inMilliseconds(duration)); 45575 var durationToNowMs = $elm$core$Basics$round( 45576 $author$project$InternalAnim$Duration$inMilliseconds(durationToNow)); 45577 var newN = (durationToNowMs / seqDurInMs) | 0; 45578 var durationOfUnrolledSeq = $author$project$InternalAnim$Duration$milliseconds( 45579 A2($elm$core$Basics$modBy, seqDurInMs, durationToNowMs)); 45580 var remainingDuration = A2($author$project$InternalAnim$Quantity$minus, durationOfUnrolledSeq, duration); 45581 return { 45582 hX: A4( 45583 $author$project$InternalAnim$Move$Sequence, 45584 1, 45585 $author$project$InternalAnim$Quantity$zero, 45586 remainingDuration, 45587 A2($author$project$InternalAnim$Move$takeStepsAfter, durationOfUnrolledSeq, steps)), 45588 bl: ((newN - 1) <= 0) ? $elm$core$Maybe$Nothing : $elm$core$Maybe$Just( 45589 A4($author$project$InternalAnim$Move$Sequence, newN - 1, remainingDuration, duration, steps)) 45590 }; 45591 } 45592 } 45593 }); 45594var $author$project$InternalAnim$Move$takeAfterSequenceList = F2( 45595 function (durationToNow, seqs) { 45596 takeAfterSequenceList: 45597 while (true) { 45598 if (!seqs.b) { 45599 return _List_Nil; 45600 } else { 45601 var top = seqs.a; 45602 var n = top.a; 45603 var duration = top.c; 45604 var remain = seqs.b; 45605 var floatN = n; 45606 if ($elm$core$Basics$isInfinite(floatN)) { 45607 if (A2($author$project$InternalAnim$Quantity$greaterThan, durationToNow, duration)) { 45608 var _new = A2($author$project$InternalAnim$Move$takeAfter, durationToNow, top); 45609 var _v1 = _new.bl; 45610 if (_v1.$ === 1) { 45611 return A2( 45612 $elm$core$List$cons, 45613 _new.hX, 45614 A3( 45615 $author$project$InternalAnim$Move$addDelayToSequence, 45616 $author$project$InternalAnim$Move$getSequenceDuration(_new.hX), 45617 remain, 45618 _List_Nil)); 45619 } else { 45620 var following = _v1.a; 45621 var delayToFollowing = $author$project$InternalAnim$Move$getSequenceDuration(_new.hX); 45622 return A2( 45623 $elm$core$List$cons, 45624 _new.hX, 45625 A2( 45626 $elm$core$List$cons, 45627 A2($author$project$InternalAnim$Move$withSequenceDelay, delayToFollowing, following), 45628 A3( 45629 $author$project$InternalAnim$Move$addDelayToSequence, 45630 A2( 45631 $author$project$InternalAnim$Time$expand, 45632 $author$project$InternalAnim$Move$getSequenceDuration(following), 45633 delayToFollowing), 45634 remain, 45635 _List_Nil))); 45636 } 45637 } else { 45638 var $temp$durationToNow = A2($author$project$InternalAnim$Quantity$minus, duration, durationToNow), 45639 $temp$seqs = remain; 45640 durationToNow = $temp$durationToNow; 45641 seqs = $temp$seqs; 45642 continue takeAfterSequenceList; 45643 } 45644 } else { 45645 var fullSeqDuration = A2($author$project$InternalAnim$Quantity$multiplyBy, floatN, duration); 45646 if (A2($author$project$InternalAnim$Quantity$greaterThan, durationToNow, fullSeqDuration)) { 45647 var _new = A2($author$project$InternalAnim$Move$takeAfter, durationToNow, top); 45648 var _v2 = _new.bl; 45649 if (_v2.$ === 1) { 45650 return A2( 45651 $elm$core$List$cons, 45652 _new.hX, 45653 A3( 45654 $author$project$InternalAnim$Move$addDelayToSequence, 45655 $author$project$InternalAnim$Move$getSequenceDuration(_new.hX), 45656 remain, 45657 _List_Nil)); 45658 } else { 45659 var following = _v2.a; 45660 var delayToFollowing = $author$project$InternalAnim$Move$getSequenceDuration(_new.hX); 45661 return A2( 45662 $elm$core$List$cons, 45663 _new.hX, 45664 A2( 45665 $elm$core$List$cons, 45666 A2($author$project$InternalAnim$Move$withSequenceDelay, delayToFollowing, following), 45667 A3( 45668 $author$project$InternalAnim$Move$addDelayToSequence, 45669 A2( 45670 $author$project$InternalAnim$Time$expand, 45671 $author$project$InternalAnim$Move$getSequenceDuration(following), 45672 delayToFollowing), 45673 remain, 45674 _List_Nil))); 45675 } 45676 } else { 45677 var $temp$durationToNow = A2($author$project$InternalAnim$Quantity$minus, fullSeqDuration, durationToNow), 45678 $temp$seqs = remain; 45679 durationToNow = $temp$durationToNow; 45680 seqs = $temp$seqs; 45681 continue takeAfterSequenceList; 45682 } 45683 } 45684 } 45685 } 45686 }); 45687var $author$project$InternalAnim$Time$thisAfterOrEqualThat = F2( 45688 function (_v0, _v1) { 45689 var _this = _v0; 45690 var that = _v1; 45691 return (_this - that) >= 0; 45692 }); 45693var $author$project$InternalAnim$Move$sequences = F6( 45694 function (startTime, targetTime, now, stopTime, movement, existingSequence) { 45695 if (A2($author$project$InternalAnim$Time$equal, now, stopTime) && (!A2($author$project$InternalAnim$Time$equal, targetTime, stopTime))) { 45696 return _List_Nil; 45697 } else { 45698 var durationToNow = A2($author$project$InternalAnim$Time$duration, startTime, now); 45699 if (A2($author$project$InternalAnim$Time$thisAfterOrEqualThat, startTime, now)) { 45700 if (!movement.c.b) { 45701 var trans = movement.a; 45702 var value = movement.b; 45703 var transitionDuration = A2($author$project$InternalAnim$Time$duration, startTime, targetTime); 45704 var seq = A4( 45705 $author$project$InternalAnim$Move$Sequence, 45706 1, 45707 durationToNow, 45708 transitionDuration, 45709 _List_fromArray( 45710 [ 45711 A3($author$project$InternalAnim$Move$Step, transitionDuration, trans, value) 45712 ])); 45713 return A2($author$project$InternalAnim$Move$push, seq, existingSequence); 45714 } else { 45715 if ((movement.c.a.a === 1) && (!movement.c.b.b)) { 45716 var trans = movement.a; 45717 var value = movement.b; 45718 var _v1 = movement.c; 45719 var _v2 = _v1.a;
45720 var delay = _v2.b; 45721 var dur = _v2.c; 45722 var steps = _v2.d; 45723 var stepDuration = A2($author$project$InternalAnim$Time$duration, startTime, targetTime); 45724 var transitionDuration = A2($author$project$InternalAnim$Time$expand, dur, stepDuration); 45725 var transitionSequence = A4( 45726 $author$project$InternalAnim$Move$Sequence, 45727 1, 45728 A2($author$project$InternalAnim$Time$expand, durationToNow, delay), 45729 transitionDuration, 45730 A2( 45731 $elm$core$List$cons, 45732 A3($author$project$InternalAnim$Move$Step, stepDuration, trans, value), 45733 steps)); 45734 return A2($author$project$InternalAnim$Move$push, transitionSequence, existingSequence); 45735 } else { 45736 var trans = movement.a; 45737 var value = movement.b; 45738 var dwell = movement.c; 45739 var transitionDuration = A2($author$project$InternalAnim$Time$duration, startTime, targetTime); 45740 if ($author$project$InternalAnim$Time$isZeroDuration(transitionDuration) && (!$elm$core$List$isEmpty(dwell))) { 45741 return A2( 45742 $author$project$InternalAnim$Move$append, 45743 A3($author$project$InternalAnim$Move$addDelayToSequence, durationToNow, dwell, _List_Nil), 45744 existingSequence); 45745 } else { 45746 var transitionSequence = A4( 45747 $author$project$InternalAnim$Move$Sequence, 45748 1, 45749 durationToNow, 45750 transitionDuration, 45751 _List_fromArray( 45752 [ 45753 A3($author$project$InternalAnim$Move$Step, transitionDuration, trans, value) 45754 ])); 45755 return A2( 45756 $author$project$InternalAnim$Move$append, 45757 A3( 45758 $author$project$InternalAnim$Move$addDelayToSequence, 45759 A2($author$project$InternalAnim$Time$expand, durationToNow, transitionDuration), 45760 dwell, 45761 _List_Nil), 45762 A2($author$project$InternalAnim$Move$push, transitionSequence, existingSequence)); 45763 } 45764 } 45765 } 45766 } else { 45767 if (A4($author$project$InternalAnim$Move$after, startTime, stopTime, now, movement)) { 45768 return _List_Nil; 45769 } else { 45770 if (!movement.c.b) { 45771 var trans = movement.a; 45772 var value = movement.b; 45773 var transitionDuration = A2($author$project$InternalAnim$Time$duration, startTime, targetTime); 45774 var newSequence = A2( 45775 $author$project$InternalAnim$Move$takeAfter, 45776 durationToNow, 45777 A4( 45778 $author$project$InternalAnim$Move$Sequence, 45779 1, 45780 $author$project$InternalAnim$Quantity$zero, 45781 transitionDuration, 45782 _List_fromArray( 45783 [ 45784 A3($author$project$InternalAnim$Move$Step, transitionDuration, trans, value) 45785 ]))); 45786 var _v4 = newSequence.bl; 45787 if (_v4.$ === 1) { 45788 return _List_fromArray( 45789 [newSequence.hX]); 45790 } else { 45791 var following = _v4.a; 45792 return A2( 45793 $author$project$InternalAnim$Move$push, 45794 A2( 45795 $author$project$InternalAnim$Move$withSequenceDelay, 45796 $author$project$InternalAnim$Move$getSequenceDuration(newSequence.hX), 45797 following), 45798 _List_fromArray( 45799 [newSequence.hX])); 45800 } 45801 } else { 45802 if ((movement.c.a.a === 1) && (!movement.c.b.b)) { 45803 var trans = movement.a; 45804 var value = movement.b; 45805 var _v5 = movement.c; 45806 var _v6 = _v5.a; 45807 var dur = _v6.c; 45808 var steps = _v6.d; 45809 var stepDuration = A2($author$project$InternalAnim$Time$duration, startTime, targetTime); 45810 var transitionDuration = A2($author$project$InternalAnim$Time$expand, dur, stepDuration); 45811 var _new = A2( 45812 $author$project$InternalAnim$Move$takeAfter, 45813 durationToNow, 45814 A4( 45815 $author$project$InternalAnim$Move$Sequence, 45816 1, 45817 $author$project$InternalAnim$Quantity$zero, 45818 transitionDuration, 45819 A2( 45820 $elm$core$List$cons, 45821 A3($author$project$InternalAnim$Move$Step, stepDuration, trans, value), 45822 steps))); 45823 var _v7 = _new.bl; 45824 if (_v7.$ === 1) { 45825 return _List_fromArray( 45826 [_new.hX]); 45827 } else { 45828 var following = _v7.a; 45829 return A2( 45830 $author$project$InternalAnim$Move$push, 45831 A2( 45832 $author$project$InternalAnim$Move$withSequenceDelay, 45833 $author$project$InternalAnim$Move$getSequenceDuration(_new.hX), 45834 following), 45835 _List_fromArray( 45836 [_new.hX])); 45837 } 45838 } else { 45839 var trans = movement.a; 45840 var value = movement.b; 45841 var dwell = movement.c; 45842 if (A2($author$project$InternalAnim$Time$thisAfterThat, now, targetTime)) { 45843 return A2($author$project$InternalAnim$Move$takeAfterSequenceList, durationToNow, dwell); 45844 } else { 45845 var transitionDuration = A2($author$project$InternalAnim$Time$duration, startTime, targetTime); 45846 var _new = A2( 45847 $author$project$InternalAnim$Move$takeAfter, 45848 durationToNow, 45849 A4( 45850 $author$project$InternalAnim$Move$Sequence, 45851 1, 45852 $author$project$InternalAnim$Quantity$zero, 45853 transitionDuration, 45854 _List_fromArray( 45855 [ 45856 A3($author$project$InternalAnim$Move$Step, transitionDuration, trans, value) 45857 ]))); 45858 var _v8 = _new.bl; 45859 if (_v8.$ === 1) { 45860 return A2( 45861 $elm$core$List$cons, 45862 _new.hX, 45863 A3( 45864 $author$project$InternalAnim$Move$addDelayToSequence, 45865 $author$project$InternalAnim$Move$getSequenceDuration(_new.hX), 45866 dwell, 45867 _List_Nil)); 45868 } else { 45869 var following = _v8.a; 45870 var delayToFollowing = $author$project$InternalAnim$Move$getSequenceDuration(_new.hX); 45871 return A2( 45872 $author$project$InternalAnim$Move$append, 45873 A3( 45874 $author$project$InternalAnim$Move$addDelayToSequence, 45875 A2( 45876 $author$project$InternalAnim$Time$expand, 45877 $author$project$InternalAnim$Move$getSequenceDuration(following), 45878 delayToFollowing), 45879 dwell, 45880 _List_Nil), 45881 A2( 45882 $author$project$InternalAnim$Move$push, 45883 A2($author$project$InternalAnim$Move$withSequenceDelay, delayToFollowing, following), 45884 _List_fromArray( 45885 [_new.hX]))); 45886 } 45887 } 45888 } 45889 } 45890 } 45891 } 45892 } 45893 }); 45894var $author$project$InternalAnim$Css$Props$noId = 100000; 45895var $author$project$InternalAnim$Css$stateOrDefault = F3( 45896 function (targetId, targetName, props) { 45897 stateOrDefault: 45898 while (true) { 45899 if (!props.b) { 45900 return $author$project$InternalAnim$Css$Props$default(targetId); 45901 } else { 45902 if (!props.a.$) { 45903 var _v1 = props.a; 45904 var id = _v1.a; 45905 var name = _v1.b; 45906 var move = _v1.c; 45907 var remain = props.b; 45908 if (!(targetId - $author$project$InternalAnim$Css$Props$noId)) { 45909 if (_Utils_eq(name, targetName)) { 45910 return move; 45911 } else { 45912 var $temp$targetId = targetId, 45913 $temp$targetName = targetName, 45914 $temp$props = remain; 45915 targetId = $temp$targetId; 45916 targetName = $temp$targetName; 45917 props = $temp$props; 45918 continue stateOrDefault; 45919 } 45920 } else { 45921 if (_Utils_eq(id, targetId)) { 45922 return move; 45923 } else { 45924 var $temp$targetId = targetId, 45925 $temp$targetName = targetName, 45926 $temp$props = remain; 45927 targetId = $temp$targetId; 45928 targetName = $temp$targetName; 45929 props = $temp$props; 45930 continue stateOrDefault; 45931 } 45932 } 45933 } else { 45934 var _v2 = props.a; 45935 var remain = props.b; 45936 var $temp$targetId = targetId, 45937 $temp$targetName = targetName, 45938 $temp$props = remain; 45939 targetId = $temp$targetId; 45940 targetName = $temp$targetName; 45941 props = $temp$props; 45942 continue stateOrDefault; 45943 } 45944 } 45945 } 45946 }); 45947var $author$project$InternalAnim$Move$toWith = F2( 45948 function (t, v) { 45949 return A3($author$project$InternalAnim$Move$Pos, t, v, _List_Nil); 45950 }); 45951var $author$project$InternalAnim$Css$Props$transparent = A4($avh4$elm_color$Color$rgba, 0, 0, 0, 0); 45952var $author$project$InternalAnim$Css$toPropCurves = F7( 45953 function (lookup, target, now, startTime, endTime, future, cursor) { 45954 var targetTime = $author$project$InternalAnim$Timeline$startTime(target); 45955 var progress = A3($author$project$InternalAnim$Time$progress, startTime, targetTime, now); 45956 var finished = A2( 45957 $author$project$InternalAnim$Time$thisAfterThat, 45958 now, 45959 $author$project$InternalAnim$Timeline$endTime(target)); 45960 return A2( 45961 $elm$core$List$map, 45962 function (prop) { 45963 switch (prop.$) { 45964 case 1: 45965 var details = prop.a; 45966 var targetColor = A3( 45967 $author$project$InternalAnim$Css$colorOrDefault, 45968 details.bW, 45969 $author$project$InternalAnim$Css$Props$transparent, 45970 lookup( 45971 $author$project$InternalAnim$Timeline$getEvent(target))); 45972 return $author$project$InternalAnim$Css$RenderedColorProp( 45973 { 45974 ic: A3($author$project$InternalAnim$Move$lerpColor, progress, details.ic, targetColor), 45975 bW: details.bW, 45976 i: finished ? details.i : A6( 45977 $author$project$InternalAnim$Move$sequences, 45978 startTime, 45979 targetTime, 45980 now, 45981 endTime, 45982 A2($author$project$InternalAnim$Move$toWith, $author$project$InternalAnim$Transition$linear, targetColor), 45983 details.i) 45984 }); 45985 case 0: 45986 var rendered = prop.a; 45987 var targetProp = A3( 45988 $author$project$InternalAnim$Css$stateOrDefault, 45989 rendered.m9, 45990 rendered.bW, 45991 lookup( 45992 $author$project$InternalAnim$Timeline$getEvent(target))); 45993 return $author$project$InternalAnim$Css$RenderedProp( 45994 { 45995 aa: rendered.aa, 45996 m9: rendered.m9, 45997 bW: rendered.bW, 45998 i: function () { 45999 if (finished) { 46000 return rendered.i; 46001 } else { 46002 var finalProp = targetProp; 46003 return A6($author$project$InternalAnim$Move$sequences, startTime, targetTime, now, endTime, finalProp, rendered.i); 46004 } 46005 }(), 46006 hp: A5($author$project$InternalAnim$Move$at, progress, startTime, targetTime, targetProp, rendered.hp) 46007 }); 46008 default: 46009 var details = prop.a; 46010 var targetProps = A2( 46011 $elm$core$List$filter,
46012 $author$project$InternalAnim$Css$isGroupProp(details.cs), 46013 lookup( 46014 $author$project$InternalAnim$Timeline$getEvent(target))); 46015 var targets = { 46016 rm: A3($author$project$InternalAnim$Css$getVectorSlot, details.cs, 0, targetProps), 46017 k0: A3($author$project$InternalAnim$Css$getVectorSlot, details.cs, 1, targetProps), 46018 k1: A3($author$project$InternalAnim$Css$getVectorSlot, details.cs, 2, targetProps) 46019 }; 46020 var commonTransition = A2($author$project$InternalAnim$Css$getCommonTransformTransition, targetProps, $author$project$InternalAnim$Transition$standard); 46021 return $author$project$InternalAnim$Css$VectorProp( 46022 { 46023 aa: details.aa, 46024 cs: details.cs, 46025 bW: details.bW, 46026 i: function () { 46027 if (finished) { 46028 return details.i; 46029 } else { 46030 var commonSequence = A3($author$project$InternalAnim$Css$getCommonVectorSequence, details.cs, targetProps, _List_Nil); 46031 var commonMovement = A3($author$project$InternalAnim$Move$move, commonTransition, targets, commonSequence); 46032 return A6($author$project$InternalAnim$Move$sequences, startTime, targetTime, now, endTime, commonMovement, details.i); 46033 } 46034 }(), 46035 hp: { 46036 rm: A5( 46037 $author$project$InternalAnim$Move$at, 46038 progress, 46039 startTime, 46040 targetTime, 46041 A2($author$project$InternalAnim$Move$toWith, commonTransition, targets.rm), 46042 details.hp.rm), 46043 k0: A5( 46044 $author$project$InternalAnim$Move$at, 46045 progress, 46046 startTime, 46047 targetTime, 46048 A2($author$project$InternalAnim$Move$toWith, commonTransition, targets.k0), 46049 details.hp.k0), 46050 k1: A5( 46051 $author$project$InternalAnim$Move$at, 46052 progress, 46053 startTime, 46054 targetTime, 46055 A2($author$project$InternalAnim$Move$toWith, commonTransition, targets.k1), 46056 details.hp.k1) 46057 } 46058 }); 46059 } 46060 }, 46061 cursor); 46062 }); 46063var $author$project$InternalAnim$Css$propsToRenderedProps = F2( 46064 function (timeline, lookup) { 46065 var present = A2($author$project$InternalAnim$Css$getInitial, timeline, lookup); 46066 return A5( 46067 $author$project$InternalAnim$Timeline$foldpAll, 46068 $author$project$InternalAnim$Timeline$getUpdatedAt(timeline), 46069 lookup, 46070 function (_v0) { 46071 return present; 46072 }, 46073 $author$project$InternalAnim$Css$toPropCurves, 46074 timeline); 46075 }); 46076var $author$project$InternalAnim$Time$zeroDuration = 0; 46077var $author$project$Animator$transition = F2( 46078 function (transitionDuration, props) { 46079 var imminent = $author$project$InternalAnim$Time$absolute( 46080 $elm$time$Time$millisToPosix(1)); 46081 var startTime = A2($author$project$InternalAnim$Time$advanceBy, transitionDuration, imminent); 46082 var timeline = { 46083 $9: $author$project$InternalAnim$Time$zeroDuration, 46084 iC: _List_fromArray( 46085 [ 46086 A3( 46087 $author$project$InternalAnim$Timeline$Line, 46088 imminent, 46089 A3($author$project$InternalAnim$Timeline$Occurring, props, startTime, startTime), 46090 _List_Nil) 46091 ]), 46092 i_: _List_Nil, 46093 i1: _List_Nil, 46094 cH: imminent, 46095 jV: $elm$core$Maybe$Nothing, 46096 j9: true, 46097 he: 1, 46098 kQ: $author$project$InternalAnim$Time$absolute( 46099 $elm$time$Time$millisToPosix(0)) 46100 }; 46101 var renderedProps = A2($author$project$InternalAnim$Css$propsToRenderedProps, timeline, $elm$core$Basics$identity); 46102 return $author$project$Animator$Animation( 46103 { 46104 ee: 0, 46105 ei: renderedProps, 46106 cH: $author$project$InternalAnim$Timeline$getUpdatedAt(timeline) 46107 }); 46108 }); 46109var $author$project$Ui$Anim$transition = F2( 46110 function (dur, attrs) { 46111 return $author$project$Internal$Model2$styleList( 46112 $author$project$Animator$toCss( 46113 A2($author$project$Animator$transition, dur, attrs)).fi); 46114 }); 46115var $author$project$InternalAnim$Css$Prop = F4( 46116 function (a, b, c, d) { 46117 return {$: 0, a: a, b: b, c: c, d: d}; 46118 }); 46119var $author$project$InternalAnim$Move$withTransition = F2( 46120 function (trans, _v0) { 46121 var value = _v0.b; 46122 var sequence = _v0.c; 46123 return A3($author$project$InternalAnim$Move$Pos, trans, value, sequence); 46124 }); 46125var $author$project$Animator$withTransition = F2( 46126 function (trans, prop) { 46127 if (!prop.$) { 46128 var id = prop.a; 46129 var name = prop.b; 46130 var move = prop.c; 46131 var format = prop.d; 46132 return A4( 46133 $author$project$InternalAnim$Css$Prop, 46134 id, 46135 name, 46136 A2($author$project$InternalAnim$Move$withTransition, trans, move), 46137 format); 46138 } else { 46139 var name = prop.a; 46140 var move = prop.b; 46141 return A2( 46142 $author$project$InternalAnim$Css$ColorProp, 46143 name, 46144 A2($author$project$InternalAnim$Move$withTransition, trans, move)); 46145 } 46146 }); 46147var $author$project$Ui$Anim$withTransition = $author$project$Animator$withTransition; 46148var $author$project$InternalAnim$Css$Props$Px = {$: 2}; 46149var $author$project$InternalAnim$Css$Props$px = $author$project$InternalAnim$Css$Props$Px; 46150var $author$project$Animator$px = F2( 46151 function (name, n) { 46152 return A4( 46153 $author$project$InternalAnim$Css$Prop, 46154 $author$project$InternalAnim$Css$Props$noId, 46155 name, 46156 $author$project$InternalAnim$Move$to(n), 46157 $author$project$InternalAnim$Css$Props$px); 46158 }); 46159var $author$project$Animator$x = function (n) { 46160 return A2($author$project$Animator$px, 'translate', n); 46161}; 46162var $author$project$Ui$Anim$x = $author$project$Animator$x; 46163var $author$project$UI$Components$toggle = function (config) { 46164 var _v0 = config.nr ? _Utils_Tuple2(21, $author$project$UI$Theme$primary.kl) : _Utils_Tuple2(3, $author$project$UI$Theme$base.k3); 46165 var knobX = _v0.a; 46166 var bgColor = _v0.b; 46167 return A2( 46168 $author$project$Ui$el, 46169 _List_fromArray( 46170 [ 46171 $author$project$Ui$Input$button(config.e7), 46172 $author$project$Ui$alignRight, 46173 $author$project$Ui$width( 46174 $author$project$Ui$px(44)), 46175 $author$project$Ui$height( 46176 $author$project$Ui$px(26)), 46177 $author$project$Ui$rounded(13), 46178 $author$project$Ui$pointer, 46179 $author$project$Ui$contentCenterY, 46180 A2( 46181 $author$project$Ui$Anim$transition, 46182 $author$project$Ui$Anim$ms(250), 46183 _List_fromArray( 46184 [ 46185 $author$project$Ui$Anim$backgroundColor(bgColor) 46186 ])) 46187 ]), 46188 A2( 46189 $author$project$Ui$el, 46190 _List_fromArray( 46191 [ 46192 $author$project$Ui$width( 46193 $author$project$Ui$px(20)), 46194 $author$project$Ui$height( 46195 $author$project$Ui$px(20)),
46196 $author$project$Ui$rounded($author$project$UI$Theme$radius.hF), 46197 $author$project$Ui$background($author$project$UI$Theme$base.km), 46198 $author$project$UI$Theme$shadowKnob, 46199 A2( 46200 $author$project$Ui$Anim$transition, 46201 $author$project$Ui$Anim$ms(250), 46202 _List_fromArray( 46203 [ 46204 A2( 46205 $author$project$Ui$Anim$withTransition, 46206 A4($author$project$Ui$Anim$bezier, 0.16, 1, 0.3, 1), 46207 $author$project$Ui$Anim$x(knobX)) 46208 ])) 46209 ]), 46210 $author$project$Ui$none)); 46211}; 46212var $author$project$Page$About$devModeSection = F2( 46213 function (i18n, config) { 46214 return A2( 46215 $author$project$Ui$column, 46216 _List_fromArray( 46217 [ 46218 $author$project$Ui$spacing($author$project$UI$Theme$spacing.bb), 46219 $author$project$Ui$width($author$project$Ui$fill) 46220 ]), 46221 _List_fromArray( 46222 [ 46223 $author$project$UI$Components$sectionLabel( 46224 $author$project$Translations$aboutDevModeLabel(i18n)), 46225 A2( 46226 $author$project$Ui$row, 46227 _List_fromArray( 46228 [ 46229 $author$project$Ui$width($author$project$Ui$fill), 46230 $author$project$Ui$spacing($author$project$UI$Theme$spacing.qk) 46231 ]), 46232 _List_fromArray( 46233 [ 46234 A2( 46235 $author$project$Ui$el, 46236 _List_fromArray( 46237 [ 46238 $author$project$Ui$Font$size($author$project$UI$Theme$font.qk), 46239 $author$project$Ui$Font$color($author$project$UI$Theme$base.aM) 46240 ]), 46241 $author$project$Ui$text( 46242 $author$project$Translations$aboutDevModeHint(i18n))), 46243 $author$project$UI$Components$toggle( 46244 {nr: config.mi, e7: config.o5}) 46245 ])) 46246 ])); 46247 }); 46248var $author$project$Page$About$ConfirmRekey = {$: 4}; 46249var $author$project$Page$About$ToggleRekeyConfirm = {$: 3}; 46250var $author$project$Translations$aboutDeviceIdLabel = function (_v0) { 46251 var lang = _v0; 46252 if (!lang) { 46253 return 'This device'; 46254 } else { 46255 return 'Cet appareil'; 46256 } 46257}; 46258var $author$project$Translations$aboutDeviceSecurityLabel = function (_v0) { 46259 var lang = _v0; 46260 if (!lang) { 46261 return 'Device security'; 46262 } else { 46263 return 'Sécurité de lâappareil'; 46264 } 46265}; 46266var $author$project$Translations$aboutRekeyButton = function (_v0) { 46267 var lang = _v0; 46268 if (!lang) { 46269 return 'Change device key'; 46270 } else { 46271 return 'Changer la clé de lâappareil'; 46272 } 46273}; 46274var $author$project$Translations$aboutRekeyConfirm = function (_v0) { 46275 var lang = _v0; 46276 if (!lang) { 46277 return 'This replaces this device\'s key. Every group must then be migrated and this device re-linked before you can post in it again. The old key stays valid in groups you don\'t migrate.'; 46278 } else { 46279 return 'Cela remplace la clé de cet appareil. Chaque groupe devra ensuite être migré et cet appareil rattaché avant de pouvoir y publier à nouveau. Lâancienne clé reste valide dans les groupes non migrés.'; 46280 } 46281}; 46282var $author$project$Translations$aboutRekeyHint = function (_v0) { 46283 var lang = _v0; 46284 if (!lang) { 46285 return 'Generate a new signing key for this device if it may have been compromised. You\'ll then appear as a stranger in each group until you migrate it and re-link this device.'; 46286 } else { 46287 return 'Génère une nouvelle clé de signature pour cet appareil sâil a pu être compromis. Tu apparaîtras alors comme inconnu dans chaque groupe jusquâà ce que tu le migres et rattaches cet appareil.'; 46288 } 46289}; 46290var $author$project$UI$Components$btnDanger = F2( 46291 function (attrs, config) { 46292 return A2( 46293 $author$project$Ui$row, 46294 A2( 46295 $elm$core$List$cons, 46296 $author$project$Ui$Input$button(config.e7), 46297 A2( 46298 $elm$core$List$cons, 46299 $author$project$Ui$width($author$project$Ui$fill), 46300 A2( 46301 $elm$core$List$cons, 46302 $author$project$Ui$spacing($author$project$UI$Theme$spacing.qk), 46303 A2( 46304 $elm$core$List$cons, 46305 $author$project$Ui$contentCenterX, 46306 A2( 46307 $elm$core$List$cons, 46308 $author$project$Ui$contentCenterY, 46309 A2( 46310 $elm$core$List$cons, 46311 $author$project$Ui$padding($author$project$UI$Theme$spacing.aW), 46312 A2( 46313 $elm$core$List$cons, 46314 $author$project$Ui$rounded($author$project$UI$Theme$radius.aW), 46315 A2( 46316 $elm$core$List$cons, 46317 $author$project$Ui$background($author$project$UI$Theme$danger.kl), 46318 A2( 46319 $elm$core$List$cons, 46320 $author$project$Ui$Font$color($author$project$UI$Theme$danger.km), 46321 A2( 46322 $elm$core$List$cons, 46323 $author$project$Ui$Font$weight($author$project$UI$Theme$fontWeight.dL), 46324 A2($elm$core$List$cons, $author$project$Ui$pointer, attrs))))))))))), 46325 _List_fromArray( 46326 [ 46327 A2($author$project$UI$Components$featherIcon, 16, config.gv), 46328 $author$project$Ui$text(config.i6) 46329 ])); 46330 }); 46331var $author$project$UI$Components$btnOutline = F2( 46332 function (attrs, config) { 46333 return A2( 46334 $author$project$Ui$row, 46335 A2( 46336 $elm$core$List$cons, 46337 $author$project$Ui$Input$button(config.e7), 46338 A2( 46339 $elm$core$List$cons, 46340 $author$project$Ui$width($author$project$Ui$fill), 46341 _Utils_ap($author$project$UI$Components$btnOutlineAttrs, attrs))), 46342 function () { 46343 var _v0 = config.gv; 46344 if (!_v0.$) { 46345 var icon = _v0.a; 46346 return _List_fromArray( 46347 [ 46348 icon, 46349 $author$project$Ui$text(config.i6) 46350 ]); 46351 } else { 46352 return _List_fromArray( 46353 [ 46354 $author$project$Ui$text(config.i6) 46355 ]); 46356 } 46357 }()); 46358 }); 46359var $author$project$Page$About$fingerprint = function (deviceId) { 46360 return ($elm$core$String$length(deviceId) <= 20) ? deviceId : (A2($elm$core$String$left, 10, deviceId) + ('â¦' + A2($elm$core$String$right, 10, deviceId))); 46361}; 46362var $feathericons$elm_feather$FeatherIcons$key = A2( 46363 $feathericons$elm_feather$FeatherIcons$makeBuilder, 46364 'key', 46365 _List_fromArray( 46366 [ 46367 A2( 46368 $elm$svg$Svg$path, 46369 _List_fromArray( 46370 [ 46371 $elm$svg$Svg$Attributes$d('M21 2l-2 2m-7.61 7.61a5.5 5.5 0 1 1-7.778 7.778 5.5 5.5 0 0 1 7.777-7.777zm0 0L15.5 7.5m0 0l3 3L22 7l-3-3m-3.5 3.5L19 4') 46372 ]), 46373 _List_Nil) 46374 ])); 46375var $author$project$Page$About$deviceSecuritySection = F3( 46376 function (i18n, deviceId, confirmingRekey) { 46377 return A2( 46378 $author$project$Ui$column, 46379 _List_fromArray( 46380 [ 46381 $author$project$Ui$spacing($author$project$UI$Theme$spacing.qk), 46382 $author$project$Ui$width($author$project$Ui$fill) 46383 ]), 46384 _List_fromArray( 46385 [ 46386 $author$project$UI$Components$sectionLabel( 46387 $author$project$Translations$aboutDeviceSecurityLabel(i18n)), 46388 A2( 46389 $author$project$Ui$row, 46390 _List_fromArray( 46391 [ 46392 $author$project$Ui$width($author$project$Ui$fill), 46393 $author$project$Ui$spacing($author$project$UI$Theme$spacing.qk) 46394 ]), 46395 _List_fromArray( 46396 [ 46397 A2( 46398 $author$project$Ui$el, 46399 _List_fromArray( 46400 [ 46401 $author$project$Ui$Font$size($author$project$UI$Theme$font.qk), 46402 $author$project$Ui$Font$color($author$project$UI$Theme$base.qI) 46403 ]), 46404 $author$project$Ui$text( 46405 $author$project$Translations$aboutDeviceIdLabel(i18n))), 46406 A2( 46407 $author$project$Ui$el, 46408 _List_fromArray( 46409 [ 46410 $author$project$Ui$Font$size($author$project$UI$Theme$font.qk), 46411 $author$project$Ui$Font$weight($author$project$UI$Theme$fontWeight.dL), 46412 $author$project$Ui$alignRight 46413 ]), 46414 $author$project$Ui$text( 46415 $author$project$Page$About$fingerprint(deviceId))) 46416 ])), 46417 A2( 46418 $author$project$Ui$el, 46419 _List_fromArray( 46420 [ 46421 $author$project$Ui$Font$size($author$project$UI$Theme$font.qk), 46422 $author$project$Ui$Font$color($author$project$UI$Theme$base.aM) 46423 ]), 46424 $author$project$Ui$text( 46425 $author$project$Translations$aboutRekeyHint(i18n))), 46426 confirmingRekey ? A2( 46427 $author$project$Ui$column, 46428 _List_fromArray( 46429 [ 46430 $author$project$Ui$spacing($author$project$UI$Theme$spacing.qk), 46431 $author$project$Ui$width($author$project$Ui$fill) 46432 ]), 46433 _List_fromArray( 46434 [ 46435 A2( 46436 $author$project$UI$Components$card, 46437 _List_fromArray( 46438 [ 46439 $author$project$Ui$padding($author$project$UI$Theme$spacing.aW) 46440 ]), 46441 _List_fromArray( 46442 [ 46443 A2( 46444 $author$project$Ui$el, 46445 _List_fromArray( 46446 [ 46447 $author$project$Ui$Font$size($author$project$UI$Theme$font.qk), 46448 $author$project$Ui$Font$color($author$project$UI$Theme$danger.qI) 46449 ]), 46450 $author$project$Ui$text( 46451 $author$project$Translations$aboutRekeyConfirm(i18n))) 46452 ])), 46453 A2( 46454 $author$project$UI$Components$btnDanger, 46455 _List_Nil, 46456 { 46457 gv: $feathericons$elm_feather$FeatherIcons$key, 46458 i6: $author$project$Translations$aboutRekeyButton(i18n), 46459 e7: $author$project$Page$About$ConfirmRekey 46460 }) 46461 ])) : A2( 46462 $author$project$UI$Components$btnOutline, 46463 _List_Nil, 46464 { 46465 gv: $elm$core$Maybe$Nothing, 46466 i6: $author$project$Translations$aboutRekeyButton(i18n), 46467 e7: $author$project$Page$About$ToggleRekeyConfirm 46468 }) 46469 ])); 46470 }); 46471var $author$project$Translations$aboutFeedbackPromptsHint = function (_v0) { 46472 var lang = _v0; 46473 if (!lang) { 46474 return 'Each question is asked at most once, then never again; resetting makes them all askable.'; 46475 } else { 46476 return 'Chaque question est posée une fois au plus, puis plus jamais ; la réinitialisation permet de toutes les reposer.'; 46477 } 46478}; 46479var $author$project$Translations$aboutFeedbackPromptsLabel = function (_v0) { 46480 var lang = _v0; 46481 if (!lang) { 46482 return 'Feedback prompts'; 46483 } else { 46484 return 'Demandes d\'avis'; 46485 } 46486}; 46487var $author$project$Translations$aboutResetFeedbackPrompts = function (_v0) { 46488 var lang = _v0; 46489 if (!lang) { 46490 return 'Reset feedback prompts'; 46491 } else { 46492 return 'Réinitialiser les demandes d\'avis'; 46493 } 46494};
46495var $feathericons$elm_feather$FeatherIcons$refreshCw = A2( 46496 $feathericons$elm_feather$FeatherIcons$makeBuilder, 46497 'refresh-cw', 46498 _List_fromArray( 46499 [ 46500 A2( 46501 $elm$svg$Svg$polyline, 46502 _List_fromArray( 46503 [ 46504 $elm$svg$Svg$Attributes$points('23 4 23 10 17 10') 46505 ]), 46506 _List_Nil), 46507 A2( 46508 $elm$svg$Svg$polyline, 46509 _List_fromArray( 46510 [ 46511 $elm$svg$Svg$Attributes$points('1 20 1 14 7 14') 46512 ]), 46513 _List_Nil), 46514 A2( 46515 $elm$svg$Svg$path, 46516 _List_fromArray( 46517 [ 46518 $elm$svg$Svg$Attributes$d('M3.51 9a9 9 0 0 1 14.85-3.36L23 10M1 14l4.64 4.36A9 9 0 0 0 20.49 15') 46519 ]), 46520 _List_Nil) 46521 ])); 46522var $author$project$Page$About$feedbackPromptsSection = F2( 46523 function (i18n, config) { 46524 return A2( 46525 $author$project$Ui$column, 46526 _List_fromArray( 46527 [ 46528 $author$project$Ui$spacing($author$project$UI$Theme$spacing.qk), 46529 $author$project$Ui$width($author$project$Ui$fill) 46530 ]), 46531 _List_fromArray( 46532 [ 46533 $author$project$UI$Components$sectionLabel( 46534 $author$project$Translations$aboutFeedbackPromptsLabel(i18n)), 46535 A2( 46536 $author$project$Ui$el, 46537 _List_fromArray( 46538 [ 46539 $author$project$Ui$Font$size($author$project$UI$Theme$font.qk), 46540 $author$project$Ui$Font$color($author$project$UI$Theme$base.aM) 46541 ]), 46542 $author$project$Ui$text( 46543 $author$project$Translations$aboutFeedbackPromptsHint(i18n))), 46544 A2( 46545 $author$project$UI$Components$btnOutline, 46546 _List_Nil, 46547 { 46548 gv: $elm$core$Maybe$Just( 46549 A2($author$project$UI$Components$featherIcon, 16, $feathericons$elm_feather$FeatherIcons$refreshCw)), 46550 i6: $author$project$Translations$aboutResetFeedbackPrompts(i18n), 46551 e7: config.oZ 46552 }) 46553 ])); 46554 }); 46555var $author$project$Translations$aboutLanguageTitle = function (_v0) { 46556 var lang = _v0; 46557 if (!lang) { 46558 return 'Language'; 46559 } else { 46560 return 'Choix de la langue'; 46561 } 46562}; 46563var $author$project$UI$Components$languageFlag = function (lang) { 46564 if (!lang) { 46565 return 'ð¬ð§'; 46566 } else { 46567 return 'ð«ð·'; 46568 } 46569}; 46570var $author$project$Ui$opacity = function (o) { 46571 return A2( 46572 $author$project$Internal$Model2$style, 46573 'opacity', 46574 $elm$core$String$fromFloat(o)); 46575}; 46576var $author$project$UI$Components$languageSelector = F2( 46577 function (onSwitch, current) { 46578 return A2( 46579 $author$project$Ui$row, 46580 _List_fromArray( 46581 [ 46582 $author$project$Ui$spacing($author$project$UI$Theme$spacing.i8), 46583 $author$project$Ui$centerX 46584 ]), 46585 A2( 46586 $elm$core$List$map, 46587 function (lang) { 46588 return A2( 46589 $author$project$Ui$el, 46590 _List_fromArray( 46591 [ 46592 $author$project$Ui$pointer, 46593 $author$project$Ui$width($author$project$Ui$shrink), 46594 $author$project$Ui$Font$size($author$project$UI$Theme$font.i8), 46595 $author$project$Ui$Events$onClick( 46596 onSwitch(lang)), 46597 _Utils_eq(lang, current) ? $author$project$Ui$opacity(1.0) : $author$project$Ui$opacity(0.5) 46598 ]), 46599 $author$project$Ui$text( 46600 $author$project$UI$Components$languageFlag(lang))); 46601 }, 46602 $author$project$Translations$languages)); 46603 }); 46604var $author$project$Page$About$languageSection = F2( 46605 function (i18n, onSwitchLanguage) { 46606 return A2( 46607 $author$project$Ui$column, 46608 _List_fromArray( 46609 [ 46610 $author$project$Ui$spacing($author$project$UI$Theme$spacing.bb), 46611 $author$project$Ui$centerX 46612 ]), 46613 _List_fromArray( 46614 [ 46615 $author$project$UI$Components$sectionLabel( 46616 $author$project$Translations$aboutLanguageTitle(i18n)), 46617 A2( 46618 $author$project$UI$Components$languageSelector, 46619 onSwitchLanguage, 46620 $author$project$Translations$currentLanguage(i18n)) 46621 ])); 46622 }); 46623var $author$project$Translations$aboutNotificationsActive = function (_v0) { 46624 var lang = _v0; 46625 if (!lang) { 46626 return 'Enabled on this device. Turn them on group by group from each group\'s members tab.'; 46627 } else { 46628 return 'Activées sur cet appareil. Choisis ensuite groupe par groupe depuis l\'onglet membres.'; 46629 } 46630}; 46631var $author$project$Translations$aboutNotificationsInactive = function (_v0) { 46632 var lang = _v0; 46633 if (!lang) { 46634 return 'Available on this server, but not yet enabled on this device.'; 46635 } else { 46636 return 'Disponibles sur ce serveur, mais pas encore activées sur cet appareil.'; 46637 } 46638}; 46639var $author$project$Translations$aboutNotificationsNoServer = function (_v0) { 46640 var lang = _v0; 46641 if (!lang) { 46642 return 'This server does not offer push notifications, so the per-group notification controls are hidden.'; 46643 } else { 46644 return 'Ce serveur ne propose pas de notifications push, les réglages par groupe sont donc masqués.'; 46645 } 46646}; 46647var $author$project$Translations$aboutNotificationsServer = F2( 46648 function (url, _v0) { 46649 var lang = _v0; 46650 if (!lang) { 46651 return 'Notification server: ' + url; 46652 } else { 46653 return 'Serveur de notifications : ' + url; 46654 } 46655 }); 46656var $author$project$Translations$aboutNotificationsTitle = function (_v0) { 46657 var lang = _v0; 46658 if (!lang) { 46659 return 'Notifications'; 46660 } else { 46661 return 'Notifications'; 46662 } 46663}; 46664var $author$project$Translations$aboutNotificationsUnreachable = function (_v0) { 46665 var lang = _v0; 46666 if (!lang) { 46667 return 'The notification server did not answer, so notifications cannot be enabled right now.'; 46668 } else { 46669 return 'Le serveur de notifications n\'a pas répondu, impossible de les activer pour le moment.'; 46670 } 46671}; 46672var $author$project$Page$About$notificationsSection = F2( 46673 function (i18n, config) { 46674 var status = function () { 46675 var _v1 = config.g7; 46676 if (_v1.$ === 1) { 46677 return $author$project$Translations$aboutNotificationsNoServer(i18n); 46678 } else { 46679 return config.pG ? $author$project$Translations$aboutNotificationsUnreachable(i18n) : (config.g6 ? $author$project$Translations$aboutNotificationsActive(i18n) : $author$project$Translations$aboutNotificationsInactive(i18n)); 46680 } 46681 }(); 46682 return A2( 46683 $author$project$Ui$column, 46684 _List_fromArray( 46685 [ 46686 $author$project$Ui$spacing($author$project$UI$Theme$spacing.bb), 46687 $author$project$Ui$width($author$project$Ui$fill) 46688 ]), 46689 _List_fromArray( 46690 [ 46691 $author$project$UI$Components$sectionLabel( 46692 $author$project$Translations$aboutNotificationsTitle(i18n)), 46693 A2( 46694 $author$project$Ui$el, 46695 _List_fromArray( 46696 [ 46697 $author$project$Ui$Font$size($author$project$UI$Theme$font.qk), 46698 $author$project$Ui$Font$color($author$project$UI$Theme$base.aM) 46699 ]), 46700 $author$project$Ui$text(status)), 46701 function () { 46702 var _v0 = _Utils_Tuple2(config.mi, config.g7); 46703 if (_v0.a && (!_v0.b.$)) { 46704 var url = _v0.b.a; 46705 return A2( 46706 $author$project$Ui$el, 46707 _List_fromArray( 46708 [ 46709 $author$project$Ui$Font$size($author$project$UI$Theme$font.bb), 46710 $author$project$Ui$Font$color($author$project$UI$Theme$base.aM) 46711 ]), 46712 $author$project$Ui$text( 46713 A2($author$project$Translations$aboutNotificationsServer, url, i18n))); 46714 } else { 46715 return $author$project$Ui$none; 46716 } 46717 }() 46718 ])); 46719 }); 46720var $author$project$Translations$aboutSourceCode = function (_v0) { 46721 var lang = _v0; 46722 if (!lang) { 46723 return 'Source code'; 46724 } else { 46725 return 'Code source'; 46726 } 46727}; 46728var $author$project$Translations$aboutVersion = F2( 46729 function (version, _v0) { 46730 var lang = _v0; 46731 if (!lang) { 46732 return 'Version ' + version; 46733 } else { 46734 return 'Version ' + version; 46735 } 46736 }); 46737var $feathericons$elm_feather$FeatherIcons$github = A2( 46738 $feathericons$elm_feather$FeatherIcons$makeBuilder, 46739 'github', 46740 _List_fromArray( 46741 [ 46742 A2( 46743 $elm$svg$Svg$path, 46744 _List_fromArray( 46745 [ 46746 $elm$svg$Svg$Attributes$d('M9 19c-5 1.5-5-2.5-7-3m14 6v-3.87a3.37 3.37 0 0 0-.94-2.61c3.14-.35 6.44-1.54 6.44-7A5.44 5.44 0 0 0 20 4.77 5.07 5.07 0 0 0 19.91 1S18.73.65 16 2.48a13.38 13.38 0 0 0-7 0C6.27.65 5.09 1 5.09 1A5.07 5.07 0 0 0 5 4.77a5.44 5.44 0 0 0-1.5 3.78c0 5.42 3.3 6.61 6.44 7A3.37 3.37 0 0 0 9 18.13V22') 46747 ]), 46748 _List_Nil) 46749 ])); 46750var $author$project$Page$About$sourceUrl = 'https://github.com/mpizenberg/partage-elm'; 46751var $author$project$Page$About$versionAttrs = _List_fromArray( 46752 [ 46753 $author$project$Ui$centerX, 46754 $author$project$Ui$Font$size($author$project$UI$Theme$font.bb), 46755 $author$project$Ui$Font$color($author$project$UI$Theme$base.aM) 46756 ]); 46757var $author$project$Page$About$sourceSection = F2( 46758 function (i18n, gitSha) { 46759 return A2( 46760 $author$project$Ui$column, 46761 _List_fromArray( 46762 [ 46763 $author$project$Ui$spacing($author$project$UI$Theme$spacing.qk), 46764 $author$project$Ui$centerX, 46765 $author$project$Ui$contentCenterX 46766 ]), 46767 _List_fromArray( 46768 [ 46769 A2( 46770 $author$project$Ui$row, 46771 _List_fromArray( 46772 [ 46773 $author$project$Ui$centerX, 46774 $author$project$Ui$spacing($author$project$UI$Theme$spacing.bb), 46775 $author$project$Ui$Font$size($author$project$UI$Theme$font.qk), 46776 $author$project$Ui$Font$color($author$project$UI$Theme$primary.qI), 46777 $author$project$Ui$contentCenterY, 46778 $author$project$Ui$linkNewTab($author$project$Page$About$sourceUrl), 46779 $author$project$Ui$pointer 46780 ]), 46781 _List_fromArray( 46782 [ 46783 A2($author$project$UI$Components$featherIcon, 14, $feathericons$elm_feather$FeatherIcons$github), 46784 $author$project$Ui$text( 46785 $author$project$Translations$aboutSourceCode(i18n)) 46786 ])), 46787 (gitSha === '') ? A2( 46788 $author$project$Ui$el, 46789 $author$project$Page$About$versionAttrs, 46790 $author$project$Ui$text( 46791 A2($author$project$Translations$aboutVersion, 'dev', i18n))) : A2( 46792 $author$project$Ui$el, 46793 A2( 46794 $elm$core$List$cons, 46795 $author$project$Ui$linkNewTab($author$project$Page$About$sourceUrl + ('/commit/' + gitSha)), 46796 A2($elm$core$List$cons, $author$project$Ui$pointer, $author$project$Page$About$versionAttrs)), 46797 $author$project$Ui$text( 46798 A2( 46799 $author$project$Translations$aboutVersion, 46800 A2($elm$core$String$left, 7, gitSha), 46801 i18n))) 46802 ])); 46803 }); 46804var $author$project$Translations$aboutUsageHint = function (_v0) { 46805 var lang = _v0; 46806 if (!lang) { 46807 return 'Estimated server cost based on your sync activity. Measured locally on your device, nothing is tracked remotely.'; 46808 } else { 46809 return 'Coût serveur estimé à partir de ton activité de synchronisation. Mesuré localement sur ton appareil, rien n\'est tracé à distance.'; 46810 } 46811}; 46812var $author$project$Translations$aboutUsageLoading = function (_v0) { 46813 var lang = _v0; 46814 if (!lang) { 46815 return 'Loading usage data...'; 46816 } else { 46817 return 'Chargement des données...'; 46818 } 46819}; 46820var $author$project$Translations$aboutUsageTitle = function (_v0) { 46821 var lang = _v0; 46822 if (!lang) { 46823 return 'Usage Statistics'; 46824 } else { 46825 return 'Statistiques d\'utilisation'; 46826 } 46827}; 46828var $author$project$Translations$aboutUsageTrackingSince = F2( 46829 function (date, _v0) { 46830 var lang = _v0; 46831 if (!lang) { 46832 return 'Tracking since ' + date; 46833 } else { 46834 return 'Suivi depuis le ' + date; 46835 } 46836 }); 46837var $author$project$Translations$aboutCostAvgPerMonth = function (_v0) { 46838 var lang = _v0; 46839 if (!lang) { 46840 return 'Average per month'; 46841 } else { 46842 return 'Moyenne par mois'; 46843 } 46844}; 46845var $author$project$Translations$aboutCostBase = function (_v0) { 46846 var lang = _v0; 46847 if (!lang) { 46848 return 'Base cost ($0.10/mo)'; 46849 } else { 46850 return 'Coût de base (0,10 $/mois)'; 46851 } 46852}; 46853var $author$project$Translations$aboutCostCompute = function (_v0) { 46854 var lang = _v0; 46855 if (!lang) { 46856 return 'Compute'; 46857 } else { 46858 return 'Calcul'; 46859 } 46860}; 46861var $author$project$Translations$aboutCostNetwork = function (_v0) { 46862 var lang = _v0; 46863 if (!lang) { 46864 return 'Network'; 46865 } else { 46866 return 'Réseau'; 46867 } 46868}; 46869var $author$project$Translations$aboutCostStorage = function (_v0) { 46870 var lang = _v0; 46871 if (!lang) { 46872 return 'Storage'; 46873 } else { 46874 return 'Stockage';
46875 } 46876}; 46877var $author$project$Translations$aboutCostTotal = function (_v0) { 46878 var lang = _v0; 46879 if (!lang) { 46880 return 'Total'; 46881 } else { 46882 return 'Total'; 46883 } 46884}; 46885var $author$project$Page$About$costRow = F2( 46886 function (label, value) { 46887 return A2( 46888 $author$project$Ui$row, 46889 _List_fromArray( 46890 [ 46891 $author$project$Ui$width($author$project$Ui$fill), 46892 $author$project$Ui$spacing($author$project$UI$Theme$spacing.qk) 46893 ]), 46894 _List_fromArray( 46895 [ 46896 A2( 46897 $author$project$Ui$el, 46898 _List_fromArray( 46899 [ 46900 $author$project$Ui$Font$size($author$project$UI$Theme$font.qk), 46901 $author$project$Ui$Font$color($author$project$UI$Theme$base.qI) 46902 ]), 46903 $author$project$Ui$text(label)), 46904 A2( 46905 $author$project$Ui$el, 46906 _List_fromArray( 46907 [ 46908 $author$project$Ui$Font$size($author$project$UI$Theme$font.qk), 46909 $author$project$Ui$Font$weight($author$project$UI$Theme$fontWeight.dL), 46910 $author$project$Ui$alignRight 46911 ]), 46912 $author$project$Ui$text(value)) 46913 ])); 46914 }); 46915var $author$project$Infra$UsageStats$formatDollars = function (cents) { 46916 var dollars = cents / 100.0; 46917 var rounded = $elm$core$Basics$round(dollars * 100); 46918 var frac = $elm$core$Basics$abs(rounded % 100); 46919 var whole = (rounded / 100) | 0; 46920 return '$' + ($elm$core$String$fromInt(whole) + ('.' + A3( 46921 $elm$core$String$padLeft, 46922 2, 46923 '0', 46924 $elm$core$String$fromInt(frac)))); 46925}; 46926var $author$project$UI$Components$horizontalSeparator = A2( 46927 $author$project$Ui$el, 46928 _List_fromArray( 46929 [ 46930 $author$project$Ui$width($author$project$Ui$fill), 46931 $author$project$Ui$height( 46932 $author$project$Ui$px(1)), 46933 $author$project$Ui$background($author$project$UI$Theme$base.k3) 46934 ]), 46935 $author$project$Ui$none); 46936var $author$project$Page$About$costTable = F2( 46937 function (i18n, breakdown) { 46938 return A2( 46939 $author$project$Ui$column, 46940 _List_fromArray( 46941 [ 46942 $author$project$Ui$spacing($author$project$UI$Theme$spacing.qk), 46943 $author$project$Ui$width($author$project$Ui$fill) 46944 ]), 46945 _List_fromArray( 46946 [ 46947 A2( 46948 $author$project$Page$About$costRow, 46949 $author$project$Translations$aboutCostBase(i18n), 46950 $author$project$Infra$UsageStats$formatDollars(breakdown.hY)), 46951 A2( 46952 $author$project$Page$About$costRow, 46953 $author$project$Translations$aboutCostStorage(i18n), 46954 $author$project$Infra$UsageStats$formatDollars(breakdown.kr)), 46955 A2( 46956 $author$project$Page$About$costRow, 46957 $author$project$Translations$aboutCostCompute(i18n), 46958 $author$project$Infra$UsageStats$formatDollars(breakdown.ig)), 46959 A2( 46960 $author$project$Page$About$costRow, 46961 $author$project$Translations$aboutCostNetwork(i18n), 46962 $author$project$Infra$UsageStats$formatDollars(breakdown.jl)), 46963 $author$project$UI$Components$horizontalSeparator, 46964 A2( 46965 $author$project$Page$About$costRow, 46966 $author$project$Translations$aboutCostTotal(i18n), 46967 $author$project$Infra$UsageStats$formatDollars(breakdown.kH)), 46968 (_Utils_cmp(breakdown.jk, 10 / 30.44) > -1) ? A2( 46969 $author$project$Page$About$costRow, 46970 $author$project$Translations$aboutCostAvgPerMonth(i18n), 46971 $author$project$Infra$UsageStats$formatDollars(breakdown.hU)) : $author$project$Ui$none 46972 ])); 46973 }); 46974var $author$project$Translations$aboutFundingBody = function (_v0) { 46975 var lang = _v0; 46976 if (!lang) { 46977 return 'That number above is roughly what your usage costs to run on the server. Partage has no ads and no paid tier. If you can, please chip in to keep it running for everyone.'; 46978 } else { 46979 return 'Le montant ci-dessus correspond à peu près à ce que ton usage coûte à faire tourner. Partage nâa ni pub ni offre payante. Un petit coup de pouce aide à garder lâappli ouverte à toutes et tous.'; 46980 } 46981}; 46982var $author$project$Translations$aboutFundingCta = function (_v0) { 46983 var lang = _v0; 46984 if (!lang) { 46985 return 'Support Partage'; 46986 } else { 46987 return 'Soutenir Partage'; 46988 } 46989}; 46990var $author$project$Translations$aboutFundingTitle = function (_v0) { 46991 var lang = _v0; 46992 if (!lang) { 46993 return 'Help cover the cost'; 46994 } else { 46995 return 'Aider à couvrir les frais'; 46996 } 46997}; 46998var $author$project$Page$About$fundingUrl = 'https://github.com/sponsors/mpizenberg'; 46999var $feathericons$elm_feather$FeatherIcons$heart = A2( 47000 $feathericons$elm_feather$FeatherIcons$makeBuilder, 47001 'heart', 47002 _List_fromArray( 47003 [ 47004 A2( 47005 $elm$svg$Svg$path, 47006 _List_fromArray( 47007 [ 47008 $elm$svg$Svg$Attributes$d('M20.84 4.61a5.5 5.5 0 0 0-7.78 0L12 5.67l-1.06-1.06a5.5 5.5 0 0 0-7.78 7.78l1.06 1.06L12 21.23l7.78-7.78 1.06-1.06a5.5 5.5 0 0 0 0-7.78z') 47009 ]), 47010 _List_Nil) 47011 ])); 47012var $author$project$Page$About$fundingSection = function (i18n) { 47013 return A2( 47014 $author$project$UI$Components$card, 47015 _List_fromArray( 47016 [ 47017 $author$project$Ui$padding($author$project$UI$Theme$spacing.i8) 47018 ]), 47019 _List_fromArray( 47020 [ 47021 A2( 47022 $author$project$Ui$column, 47023 _List_fromArray( 47024 [ 47025 $author$project$Ui$spacing($author$project$UI$Theme$spacing.aW), 47026 $author$project$Ui$width($author$project$Ui$fill) 47027 ]), 47028 _List_fromArray( 47029 [ 47030 A2( 47031 $author$project$Ui$el, 47032 _List_fromArray( 47033 [ 47034 $author$project$Ui$Font$size($author$project$UI$Theme$font.qk), 47035 $author$project$Ui$Font$weight($author$project$UI$Theme$fontWeight.dL) 47036 ]), 47037 $author$project$Ui$text( 47038 $author$project$Translations$aboutFundingTitle(i18n))), 47039 A2( 47040 $author$project$Ui$el, 47041 _List_fromArray( 47042 [ 47043 $author$project$Ui$Font$size($author$project$UI$Theme$font.qk), 47044 $author$project$Ui$Font$color($author$project$UI$Theme$base.qI) 47045 ]), 47046 $author$project$Ui$text( 47047 $author$project$Translations$aboutFundingBody(i18n))), 47048 A2( 47049 $author$project$Ui$row, 47050 _List_fromArray( 47051 [ 47052 $author$project$Ui$centerX, 47053 $author$project$Ui$spacing($author$project$UI$Theme$spacing.bb), 47054 $author$project$Ui$Font$size($author$project$UI$Theme$font.qk), 47055 $author$project$Ui$Font$weight($author$project$UI$Theme$fontWeight.dL), 47056 $author$project$Ui$Font$color($author$project$UI$Theme$primary.qI), 47057 $author$project$Ui$contentCenterY, 47058 $author$project$Ui$linkNewTab($author$project$Page$About$fundingUrl), 47059 $author$project$Ui$pointer 47060 ]), 47061 _List_fromArray( 47062 [ 47063 A2($author$project$UI$Components$featherIcon, 16, $feathericons$elm_feather$FeatherIcons$heart), 47064 $author$project$Ui$text( 47065 $author$project$Translations$aboutFundingCta(i18n)) 47066 ])) 47067 ])) 47068 ])); 47069};
47070var $author$project$Translations$aboutPersistDenied = function (_v0) { 47071 var lang = _v0; 47072 if (!lang) { 47073 return 'Persistent storage: not granted â the browser may delete local data under storage pressure. On iPhone/iPad, install the app to your home screen to protect it.'; 47074 } else { 47075 return 'Stockage persistant : non accordé â le navigateur peut supprimer les données locales s\'il manque de place. Sur iPhone/iPad, installe l\'appli sur l\'écran d\'accueil pour les protéger.'; 47076 } 47077}; 47078var $author$project$Translations$aboutPersistGranted = function (_v0) { 47079 var lang = _v0; 47080 if (!lang) { 47081 return 'Persistent storage: granted â the browser will not evict your data.'; 47082 } else { 47083 return 'Stockage persistant : accordé â le navigateur ne supprimera pas tes données.'; 47084 } 47085}; 47086var $author$project$Translations$aboutPersistUnsupported = function (_v0) { 47087 var lang = _v0; 47088 if (!lang) { 47089 return 'Persistent storage: not supported by this browser.'; 47090 } else { 47091 return 'Stockage persistant : non pris en charge par ce navigateur.'; 47092 } 47093}; 47094var $author$project$Page$About$persistRow = F2( 47095 function (i18n, status) { 47096 return A2( 47097 $author$project$Ui$el, 47098 _List_fromArray( 47099 [ 47100 $author$project$Ui$Font$size($author$project$UI$Theme$font.qk), 47101 $author$project$Ui$Font$color($author$project$UI$Theme$base.aM) 47102 ]), 47103 $author$project$Ui$text( 47104 function () { 47105 switch (status) { 47106 case 0: 47107 return $author$project$Translations$aboutPersistGranted(i18n); 47108 case 1: 47109 return $author$project$Translations$aboutPersistDenied(i18n); 47110 default: 47111 return $author$project$Translations$aboutPersistUnsupported(i18n); 47112 } 47113 }())); 47114 }); 47115var $author$project$Page$About$ConfirmReset = {$: 2}; 47116var $author$project$Page$About$ToggleResetConfirm = {$: 1}; 47117var $author$project$Translations$aboutResetConfirm = function (_v0) { 47118 var lang = _v0; 47119 if (!lang) { 47120 return 'This will reset all usage statistics. This cannot be undone.'; 47121 } else { 47122 return 'Cela réinitialisera toutes les statistiques d\'utilisation. Irréversible.'; 47123 } 47124}; 47125var $author$project$Translations$aboutResetStats = function (_v0) { 47126 var lang = _v0; 47127 if (!lang) { 47128 return 'Reset statistics'; 47129 } else { 47130 return 'Réinitialiser les statistiques'; 47131 } 47132}; 47133var $feathericons$elm_feather$FeatherIcons$trash2 = A2( 47134 $feathericons$elm_feather$FeatherIcons$makeBuilder, 47135 'trash-2', 47136 _List_fromArray( 47137 [ 47138 A2( 47139 $elm$svg$Svg$polyline, 47140 _List_fromArray( 47141 [ 47142 $elm$svg$Svg$Attributes$points('3 6 5 6 21 6') 47143 ]), 47144 _List_Nil), 47145 A2( 47146 $elm$svg$Svg$path, 47147 _List_fromArray( 47148 [ 47149 $elm$svg$Svg$Attributes$d('M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2') 47150 ]), 47151 _List_Nil), 47152 A2( 47153 $elm$svg$Svg$line, 47154 _List_fromArray( 47155 [ 47156 $elm$svg$Svg$Attributes$x1('10'), 47157 $elm$svg$Svg$Attributes$y1('11'), 47158 $elm$svg$Svg$Attributes$x2('10'), 47159 $elm$svg$Svg$Attributes$y2('17') 47160 ]), 47161 _List_Nil), 47162 A2( 47163 $elm$svg$Svg$line, 47164 _List_fromArray( 47165 [ 47166 $elm$svg$Svg$Attributes$x1('14'), 47167 $elm$svg$Svg$Attributes$y1('11'), 47168 $elm$svg$Svg$Attributes$x2('14'), 47169 $elm$svg$Svg$Attributes$y2('17') 47170 ]), 47171 _List_Nil) 47172 ])); 47173var $author$project$Page$About$resetSection = F2( 47174 function (i18n, confirmingReset) { 47175 return confirmingReset ? A2( 47176 $author$project$Ui$column, 47177 _List_fromArray( 47178 [ 47179 $author$project$Ui$spacing($author$project$UI$Theme$spacing.qk), 47180 $author$project$Ui$width($author$project$Ui$fill) 47181 ]), 47182 _List_fromArray( 47183 [ 47184 A2( 47185 $author$project$UI$Components$card, 47186 _List_fromArray( 47187 [ 47188 $author$project$Ui$padding($author$project$UI$Theme$spacing.aW) 47189 ]), 47190 _List_fromArray( 47191 [ 47192 A2( 47193 $author$project$Ui$el, 47194 _List_fromArray( 47195 [ 47196 $author$project$Ui$Font$size($author$project$UI$Theme$font.qk), 47197 $author$project$Ui$Font$color($author$project$UI$Theme$danger.qI) 47198 ]), 47199 $author$project$Ui$text( 47200 $author$project$Translations$aboutResetConfirm(i18n))) 47201 ])), 47202 A2( 47203 $author$project$UI$Components$btnDanger, 47204 _List_Nil, 47205 { 47206 gv: $feathericons$elm_feather$FeatherIcons$trash2, 47207 i6: $author$project$Translations$aboutResetStats(i18n), 47208 e7: $author$project$Page$About$ConfirmReset 47209 }) 47210 ])) : A2( 47211 $author$project$UI$Components$btnOutline, 47212 _List_Nil, 47213 { 47214 gv: $elm$core$Maybe$Nothing, 47215 i6: $author$project$Translations$aboutResetStats(i18n), 47216 e7: $author$project$Page$About$ToggleResetConfirm 47217 }); 47218 }); 47219var $author$project$Translations$aboutRetentionNotice = function (_v0) { 47220 var lang = _v0; 47221 if (!lang) { 47222 return 'Your groups live on this device. The server only relays encrypted events, and deletes its copy of a group left untouched by every member for 12 months â any sync resets that clock. Your copy stays on this device, but export a backup of important groups so it isn\'t the only one.'; 47223 } else { 47224 return 'Tes groupes résident sur cet appareil. Le serveur ne fait que relayer des événements chiffrés, et supprime sa copie d\'un groupe laissé inactif par tous ses membres pendant 12 mois â toute synchronisation réinitialise ce délai. Ta copie reste sur cet appareil, mais exporte une sauvegarde des groupes importants pour qu\'elle ne soit pas la seule.'; 47225 } 47226}; 47227var $author$project$Page$About$retentionRow = function (i18n) { 47228 return A2( 47229 $author$project$Ui$el, 47230 _List_fromArray( 47231 [ 47232 $author$project$Ui$Font$size($author$project$UI$Theme$font.qk), 47233 $author$project$Ui$Font$color($author$project$UI$Theme$base.aM) 47234 ]), 47235 $author$project$Ui$text( 47236 $author$project$Translations$aboutRetentionNotice(i18n))); 47237}; 47238var $author$project$Page$About$usageSection = F2( 47239 function (i18n, model) { 47240 return A2( 47241 $author$project$Ui$column, 47242 _List_fromArray( 47243 [ 47244 $author$project$Ui$spacing($author$project$UI$Theme$spacing.bb), 47245 $author$project$Ui$width($author$project$Ui$fill) 47246 ]), 47247 _List_fromArray( 47248 [ 47249 $author$project$UI$Components$sectionLabel( 47250 $author$project$Translations$aboutUsageTitle(i18n)), 47251 A2( 47252 $author$project$Ui$el, 47253 _List_fromArray( 47254 [ 47255 $author$project$Ui$Font$size($author$project$UI$Theme$font.qk), 47256 $author$project$Ui$Font$color($author$project$UI$Theme$base.aM), 47257 $author$project$Ui$paddingBottom($author$project$UI$Theme$spacing.aW) 47258 ]), 47259 $author$project$Ui$text( 47260 $author$project$Translations$aboutUsageHint(i18n))), 47261 function () { 47262 var _v0 = model.ft; 47263 if (!_v0.$) { 47264 return A2( 47265 $author$project$Ui$el, 47266 _List_fromArray( 47267 [ 47268 $author$project$Ui$Font$size($author$project$UI$Theme$font.qk), 47269 $author$project$Ui$Font$color($author$project$UI$Theme$base.aM) 47270 ]), 47271 $author$project$Ui$text( 47272 $author$project$Translations$aboutUsageLoading(i18n))); 47273 } else { 47274 var breakdown = _v0.a.h4; 47275 var trackingSince = _v0.a.kK; 47276 var persistStatus = _v0.a.jE; 47277 return A2( 47278 $author$project$Ui$column, 47279 _List_fromArray( 47280 [ 47281 $author$project$Ui$spacing($author$project$UI$Theme$spacing.aW), 47282 $author$project$Ui$width($author$project$Ui$fill) 47283 ]), 47284 _List_fromArray( 47285 [ 47286 A2( 47287 $author$project$UI$Components$card, 47288 _List_fromArray( 47289 [ 47290 $author$project$Ui$padding($author$project$UI$Theme$spacing.i8) 47291 ]), 47292 _List_fromArray( 47293 [ 47294 A2($author$project$Page$About$costTable, i18n, breakdown) 47295 ])), 47296 A2( 47297 $author$project$Ui$el, 47298 _List_fromArray( 47299 [ 47300 $author$project$Ui$Font$size($author$project$UI$Theme$font.qk), 47301 $author$project$Ui$Font$color($author$project$UI$Theme$base.aM) 47302 ]), 47303 $author$project$Ui$text( 47304 A2($author$project$Translations$aboutUsageTrackingSince, trackingSince, i18n))), 47305 A2($author$project$Page$About$persistRow, i18n, persistStatus), 47306 $author$project$Page$About$retentionRow(i18n), 47307 $author$project$Page$About$fundingSection(i18n), 47308 A2($author$project$Page$About$resetSection, i18n, model.ci) 47309 ])); 47310 } 47311 }() 47312 ])); 47313 }); 47314var $author$project$Page$About$view = F3( 47315 function (i18n, config, model) { 47316 return A2( 47317 $author$project$Ui$column, 47318 _List_fromArray( 47319 [ 47320 $author$project$Ui$spacing($author$project$UI$Theme$spacing.hE), 47321 $author$project$Ui$width($author$project$Ui$fill), 47322 A2($author$project$Ui$paddingXY, 0, $author$project$UI$Theme$spacing.aW) 47323 ]), 47324 _List_fromArray( 47325 [ 47326 $author$project$Page$About$descriptionSection(i18n), 47327 A2($author$project$Page$About$changelogLink, i18n, config.oM), 47328 A2($author$project$Page$About$languageSection, i18n, config.gY), 47329 A2($author$project$Page$About$notificationsSection, i18n, config), 47330 A2( 47331 $author$project$Ui$map, 47332 config.d3, 47333 A2($author$project$Page$About$usageSection, i18n, model)), 47334 A2($author$project$Page$About$devModeSection, i18n, config), 47335 config.mi ? A2( 47336 $author$project$Ui$column, 47337 _List_fromArray( 47338 [ 47339 $author$project$Ui$spacing($author$project$UI$Theme$spacing.hE), 47340 $author$project$Ui$width($author$project$Ui$fill) 47341 ]), 47342 _List_fromArray( 47343 [ 47344 A2($author$project$Page$About$feedbackPromptsSection, i18n, config), 47345 function () { 47346 var _v0 = config.gd; 47347 if (!_v0.$) { 47348 var deviceId = _v0.a; 47349 return A2( 47350 $author$project$Ui$map, 47351 config.d3, 47352 A3($author$project$Page$About$deviceSecuritySection, i18n, deviceId, model.ch)
47352); 47353 } else { 47354 return $author$project$Ui$none; 47355 } 47356 }() 47357 ])) : $author$project$Ui$none, 47358 A2($author$project$Page$About$sourceSection, i18n, config.bN) 47359 ])); 47360 }); 47361var $author$project$Page$Group$AddMemberMsg = function (a) { 47362 return {$: 9, a: a}; 47363}; 47364var $author$project$Page$Group$EditGroupMetadataMsg = function (a) { 47365 return {$: 13, a: a}; 47366}; 47367var $author$project$Page$Group$EditMemberMetadataMsg = function (a) { 47368 return {$: 10, a: a}; 47369}; 47370var $author$project$Page$Group$MergeMemberMsg = function (a) { 47371 return {$: 11, a: a}; 47372}; 47373var $author$project$Page$Group$NewEntryMsg = function (a) { 47374 return {$: 12, a: a}; 47375}; 47376var $author$project$Page$Group$RejoinMsg = function (a) { 47377 return {$: 14, a: a}; 47378}; 47379var $author$project$Page$Group$RequestNavigation = function (a) { 47380 return {$: 1, a: a}; 47381}; 47382var $author$project$Translations$diagTitle = function (_v0) { 47383 var lang = _v0; 47384 if (!lang) { 47385 return 'Diagnostics'; 47386 } else { 47387 return 'Diagnostics'; 47388 } 47389}; 47390var $author$project$Translations$entryNotFound = function (_v0) { 47391 var lang = _v0; 47392 if (!lang) { 47393 return 'This entry no longer exists.'; 47394 } else { 47395 return 'Cette entrée n\'existe plus.'; 47396 } 47397}; 47398var $author$project$Page$JoinGroup$getPreview = function (model) { 47399 switch (model.$) { 47400 case 1: 47401 var preview = model.a; 47402 return $elm$core$Maybe$Just(preview); 47403 case 2: 47404 var preview = model.a; 47405 return $elm$core$Maybe$Just(preview); 47406 default: 47407 return $elm$core$Maybe$Nothing; 47408 } 47409}; 47410var $author$project$Translations$groupSettingsTitle = function (_v0) { 47411 var lang = _v0; 47412 if (!lang) { 47413 return 'Group Settings'; 47414 } else { 47415 return 'Paramètres du groupe'; 47416 } 47417}; 47418var $author$project$Translations$memberAddTitle = function (_v0) { 47419 var lang = _v0; 47420 if (!lang) { 47421 return 'Add Member'; 47422 } else { 47423 return 'Ajouter un membre'; 47424 } 47425}; 47426var $author$project$Translations$memberEditMetadataButton = function (_v0) { 47427 var lang = _v0; 47428 if (!lang) { 47429 return 'Edit Member Info'; 47430 } else { 47431 return 'Modifier les infos du membre'; 47432 } 47433}; 47434var $author$project$Translations$memberNotFound = function (_v0) { 47435 var lang = _v0; 47436 if (!lang) { 47437 return 'This member no longer exists.'; 47438 } else { 47439 return 'Ce membre n\'existe plus.'; 47440 } 47441}; 47442var $author$project$Translations$mergePageTitle = function (_v0) { 47443 var lang = _v0; 47444 if (!lang) { 47445 return 'Merge members'; 47446 } else { 47447 return 'Fusionner des membres'; 47448 } 47449}; 47450var $author$project$Translations$migrateTitle = function (_v0) { 47451 var lang = _v0; 47452 if (!lang) { 47453 return 'Migrate to a new group'; 47454 } else { 47455 return 'Migrer vers un nouveau groupe'; 47456 } 47457}; 47458var $author$project$Page$Group$ConfirmMigration = {$: 40}; 47459var $author$project$Page$Group$DismissSuspicion = function (a) { 47460 return {$: 33, a: a}; 47461}; 47462var $author$project$Page$Group$PreviewMigration = {$: 39}; 47463var $author$project$Page$Group$SetMigrationBound = F2( 47464 function (a, b) { 47465 return {$: 36, a: a, b: b}; 47466 }); 47467var $author$project$Page$Group$ToggleMigrationExclude = function (a) { 47468 return {$: 35, a: a}; 47469}; 47470var $author$project$Page$Group$ToggleMigrationManual = function (a) { 47471 return {$: 37, a: a}; 47472}; 47473var $author$project$Domain$MigrationCuration$cutBeforeFinding = F3( 47474 function (order, finding, events) { 47475 return A2( 47476 $elm$core$Maybe$withDefault, 47477 $author$project$Domain$MigrationCuration$All, 47478 A2( 47479 $elm$core$Maybe$map, 47480 $author$project$Domain$MigrationCuration$After, 47481 A2( 47482 $elm$core$Maybe$andThen, 47483 function (seq) { 47484 return A2( 47485 $author$project$Domain$MigrationCuration$prevSeqOf, 47486 seq, 47487 A3($author$project$Domain$MigrationCuration$authorBatches, order, finding.ii, events)); 47488 }, 47489 $elm$core$List$minimum( 47490 A2( 47491 $elm$core$List$filterMap, 47492 function (id) { 47493 return A2($elm$core$Dict$get, id, order); 47494 }, 47495 finding.iB))))); 47496 }); 47497var $author$project$Page$Group$pageShell = F3( 47498 function (config, title, content) { 47499 return A2( 47500 $author$project$UI$Shell$pageShell, 47501 {a9: config.oG, ba: title}, 47502 content); 47503 }); 47504var $author$project$Page$Group$Migrate$body = function (text) { 47505 return A2( 47506 $author$project$Ui$el, 47507 _List_fromArray( 47508 [ 47509 $author$project$Ui$Font$size($author$project$UI$Theme$font.qk), 47510 $author$project$Ui$Font$color($author$project$UI$Theme$base.qI) 47511 ]), 47512 $author$project$Ui$text(text)); 47513}; 47514var $author$project$Translations$migrateSuspicionForeignPayment = F2( 47515 function (data, _v0) { 47516 var lang = _v0; 47517 if (!lang) { 47518 return data.ii + (' changed ' + (data.kz + '\'s payment info.')); 47519 } else { 47520 return data.ii + (' a modifié les informations de paiement de ' + (data.kz + '.')); 47521 } 47522 }); 47523var $author$project$Translations$migrateSuspicionGraftedDevice = F2( 47524 function (name, _v0) { 47525 var lang = _v0; 47526 if (!lang) { 47527 return 'A device linked as ' + (name + ' only altered existing entries or payment info.'); 47528 } else { 47529 return 'Un appareil lié en tant que ' + (name + ' n\'a fait que modifier des écritures existantes ou des informations de paiement.'); 47530 } 47531 }); 47532var $author$project$Page$Group$Migrate$findingText = F3( 47533 function (i18n, resolveName, finding) { 47534 var _v0 = finding.gE; 47535 if (!_v0.$) { 47536 var target = _v0.a.kz; 47537 return A2( 47538 $author$project$Translations$migrateSuspicionForeignPayment, 47539 { 47540 ii: finding.f5, 47541 kz: resolveName(target) 47542 }, 47543 i18n); 47544 } else { 47545 return A2($author$project$Translations$migrateSuspicionGraftedDevice, finding.f5, i18n); 47546 } 47547 }); 47548var $author$project$Translations$migrateSuspicionDismiss = function (_v0) { 47549 var lang = _v0; 47550 if (!lang) { 47551 return 'Dismiss'; 47552 } else { 47553 return 'Ignorer'; 47554 } 47555}; 47556var $author$project$Translations$migrateSuspicionExclude = function (_v0) { 47557 var lang = _v0; 47558 if (!lang) { 47559 return 'Exclude'; 47560 } else { 47561 return 'Exclure'; 47562 } 47563}; 47564var $author$project$Page$Group$Migrate$findingRow = F3( 47565 function (i18n, config, finding) { 47566 return A2( 47567 $author$project$Ui$column, 47568 _List_fromArray( 47569 [ 47570 $author$project$Ui$width($author$project$Ui$fill), 47571 $author$project$Ui$spacing($author$project$UI$Theme$spacing.qk) 47572 ]), 47573 _List_fromArray( 47574 [ 47575 $author$project$Page$Group$Migrate$body( 47576 A3($author$project$Page$Group$Migrate$findingText, i18n, config.bz, finding)), 47577 A2( 47578 $author$project$Ui$row, 47579 _List_fromArray( 47580 [ 47581 $author$project$Ui$spacing($author$project$UI$Theme$spacing.qk) 47582 ]), 47583 _List_fromArray( 47584 [ 47585 A2( 47586 $author$project$UI$Components$btnOutline, 47587 _List_Nil, 47588 { 47589 gv: $elm$core$Maybe$Nothing, 47590 i6: $author$project$Translations$migrateSuspicionExclude(i18n), 47591 e7: config.oA(finding) 47592 }), 47593 A2( 47594 $author$project$UI$Components$btnOutline, 47595 _List_Nil, 47596 { 47597 gv: $elm$core$Maybe$Nothing, 47598 i6: $author$project$Translations$migrateSuspicionDismiss(i18n), 47599 e7: config.ou(finding) 47600 }) 47601 ])) 47602 ])); 47603 }); 47604var $author$project$Translations$migrateSuspicionTitle = function (_v0) { 47605 var lang = _v0; 47606 if (!lang) { 47607 return 'Suspicious activity'; 47608 } else { 47609 return 'Activité suspecte'; 47610 } 47611}; 47612var $author$project$Page$Group$Migrate$findingsCard = F2( 47613 function (i18n, config) { 47614 return $elm$core$List$isEmpty(config.mE) ? $author$project$Ui$none : A2( 47615 $author$project$UI$Components$card, 47616 _List_fromArray( 47617 [ 47618 $author$project$Ui$padding($author$project$UI$Theme$spacing.i8) 47619 ]), 47620 _List_fromArray( 47621 [ 47622 A2( 47623 $author$project$Ui$column, 47624 _List_fromArray( 47625 [ 47626 $author$project$Ui$spacing($author$project$UI$Theme$spacing.aW), 47627 $author$project$Ui$width($author$project$Ui$fill) 47628 ]), 47629 A2( 47630 $elm$core$List$cons, 47631 $author$project$UI$Components$sectionLabel( 47632 $author$project$Translations$migrateSuspicionTitle(i18n)), 47633 A2( 47634 $elm$core$List$map, 47635 A2($author$project$Page$Group$Migrate$findingRow, i18n, config), 47636 config.mE))) 47637 ])); 47638 }); 47639var $author$project$Translations$migrateAnchorFlood = F2( 47640 function (count, _v0) { 47641 var lang = _v0; 47642 if (!lang) { 47643 return 'Flood â ' + (count + ' events in one sync'); 47644 } else { 47645 return 'Afflux â ' + (count + ' événements en une synchro'); 47646 } 47647 }); 47648var $author$project$Page$Group$Migrate$anchorTitle = F3(
47649 function (i18n, resolveName, anchor) { 47650 var _v0 = anchor.j_; 47651 if (!_v0.$) { 47652 var finding = _v0.a; 47653 return A3($author$project$Page$Group$Migrate$findingText, i18n, resolveName, finding); 47654 } else { 47655 var count = _v0.a; 47656 return A2( 47657 $author$project$Translations$migrateAnchorFlood, 47658 $elm$core$String$fromInt(count), 47659 i18n); 47660 } 47661 }); 47662var $author$project$Page$Group$Migrate$radioDot = function (selected) { 47663 return A2( 47664 $author$project$Ui$el, 47665 _List_fromArray( 47666 [ 47667 $author$project$Ui$width( 47668 $author$project$Ui$px(16)), 47669 $author$project$Ui$height( 47670 $author$project$Ui$px(16)), 47671 $author$project$Ui$rounded($author$project$UI$Theme$radius.hF), 47672 $author$project$Ui$border(2), 47673 $author$project$Ui$borderColor($author$project$UI$Theme$warning.k3), 47674 $author$project$Ui$contentCenterX, 47675 $author$project$Ui$contentCenterY 47676 ]), 47677 selected ? A2( 47678 $author$project$Ui$el, 47679 _List_fromArray( 47680 [ 47681 $author$project$Ui$width( 47682 $author$project$Ui$px(8)), 47683 $author$project$Ui$height( 47684 $author$project$Ui$px(8)), 47685 $author$project$Ui$rounded($author$project$UI$Theme$radius.hF), 47686 $author$project$Ui$background($author$project$UI$Theme$warning.k3) 47687 ]), 47688 $author$project$Ui$none) : $author$project$Ui$none); 47689}; 47690var $author$project$Page$Group$Migrate$cutOption = F4( 47691 function (title, maybeSubtitle, selected, onPress) { 47692 return A2( 47693 $author$project$Ui$row, 47694 _Utils_ap( 47695 _List_fromArray( 47696 [ 47697 $author$project$Ui$Input$button(onPress), 47698 $author$project$Ui$pointer, 47699 $author$project$Ui$spacing($author$project$UI$Theme$spacing.qk), 47700 $author$project$Ui$contentCenterY, 47701 $author$project$Ui$width($author$project$Ui$fill), 47702 A2($author$project$Ui$paddingXY, $author$project$UI$Theme$spacing.qk, $author$project$UI$Theme$spacing.bb), 47703 $author$project$Ui$rounded($author$project$UI$Theme$radius.qk) 47704 ]), 47705 selected ? _List_fromArray( 47706 [ 47707 $author$project$Ui$background( 47708 A3($author$project$Ui$rgb, 255, 255, 255)) 47709 ]) : _List_Nil), 47710 _List_fromArray( 47711 [ 47712 $author$project$Page$Group$Migrate$radioDot(selected), 47713 A2( 47714 $author$project$Ui$column, 47715 _List_fromArray( 47716 [ 47717 $author$project$Ui$spacing($author$project$UI$Theme$spacing.bb), 47718 $author$project$Ui$width($author$project$Ui$fill) 47719 ]), 47720 A2( 47721 $elm$core$List$cons, 47722 A2( 47723 $author$project$Ui$el, 47724 _List_fromArray( 47725 [ 47726 $author$project$Ui$Font$size($author$project$UI$Theme$font.qk), 47727 $author$project$Ui$Font$color($author$project$UI$Theme$base.qI) 47728 ]), 47729 $author$project$Ui$text(title)), 47730 function () { 47731 if (!maybeSubtitle.$) { 47732 var subtitle = maybeSubtitle.a; 47733 return _List_fromArray( 47734 [ 47735 A2( 47736 $author$project$Ui$el, 47737 _List_fromArray( 47738 [ 47739 $author$project$Ui$Font$size($author$project$UI$Theme$font.bb), 47740 $author$project$Ui$Font$color($author$project$UI$Theme$base.aM) 47741 ]), 47742 $author$project$Ui$text(subtitle)) 47743 ]); 47744 } else { 47745 return _List_Nil; 47746 } 47747 }())) 47748 ])); 47749 }); 47750var $author$project$Translations$migrateCurateHeading = function (_v0) { 47751 var lang = _v0; 47752 if (!lang) { 47753 return 'Keep some of this identity\'s earlier history?'; 47754 } else { 47755 return 'Conserver une partie de l\'historique antérieur de cette identité ?'; 47756 } 47757}; 47758var $author$project$Translations$migrateCurateKeep = F2( 47759 function (data, _v0) { 47760 var lang = _v0; 47761 if (!lang) { 47762 return 'Keep the first ' + (data.dn + (', drop ' + data.eF)); 47763 } else { 47764 return 'Garder les ' + (data.dn + (' premiers, retirer ' + data.eF)); 47765 } 47766 }); 47767var $author$project$Translations$migrateCurateOrderNote = function (_v0) { 47768 var lang = _v0; 47769 if (!lang) { 47770 return 'Split points follow the order events reached the server â an order a tampered event can\'t back-date, unlike its own timestamp.'; 47771 } else { 47772 return 'Les points de coupe suivent l\'ordre d\'arrivée des événements sur le serveur â un ordre qu\'un événement falsifié ne peut pas antidater, contrairement à son propre horodatage.'; 47773 } 47774}; 47775var $author$project$Translations$migrateCurateRemoveAll = F2( 47776 function (count, _v0) { 47777 var lang = _v0; 47778 if (!lang) { 47779 return 'Remove everything (' + (count + ' events)'); 47780 } else { 47781 return 'Tout retirer (' + (count + ' événements)'); 47782 } 47783 }); 47784var $author$project$Translations$migrateCutManual = function (_v0) { 47785 var lang = _v0; 47786 if (!lang) { 47787 return 'Place the cut manually'; 47788 } else { 47789 return 'Placer la coupe manuellement'; 47790 } 47791}; 47792var $author$project$Page$Group$Migrate$curationBox = F4( 47793 function (i18n, config, identity, current) { 47794 var removeAllOption = identity.j0 ? _List_fromArray( 47795 [ 47796 A4( 47797 $author$project$Page$Group$Migrate$cutOption, 47798 A2( 47799 $author$project$Translations$migrateCurateRemoveAll, 47800 $elm$core$String$fromInt(identity.bK), 47801 i18n), 47802 $elm$core$Maybe$Nothing, 47803 _Utils_eq(current, $author$project$Domain$MigrationCuration$All), 47804 A2(config.o2, identity.m9, $author$project$Domain$MigrationCuration$All)) 47805 ]) : _List_Nil; 47806 var keepDrop = F2( 47807 function (kept, dropped) { 47808 return A2( 47809 $author$project$Translations$migrateCurateKeep, 47810 { 47811 eF: $elm$core$String$fromInt(dropped), 47812 dn: $elm$core$String$fromInt(kept) 47813 }, 47814 i18n); 47815 }); 47816 var expanded = A2($elm$core$Set$member, identity.m9, config.mu); 47817 var manualOptions = expanded ? A2( 47818 $elm$core$List$map, 47819 function (b) { 47820 return A4( 47821 $author$project$Page$Group$Migrate$cutOption, 47822 A2(keepDrop, b.dn, identity.bK - b.dn), 47823 $elm$core$Maybe$Nothing, 47824 _Utils_eq( 47825 current, 47826 $author$project$Domain$MigrationCuration$After(b.kg)), 47827 A2( 47828 config.o2, 47829 identity.m9, 47830 $author$project$Domain$MigrationCuration$After(b.kg))); 47831 }, 47832 identity.h3) : _List_Nil; 47833 var manualToggle = A2( 47834 $author$project$Ui$row, 47835 _List_fromArray( 47836 [ 47837 $author$project$Ui$Input$button( 47838 config.o6(identity.m9)), 47839 $author$project$Ui$pointer, 47840 $author$project$Ui$spacing($author$project$UI$Theme$spacing.bb), 47841 $author$project$Ui$contentCenterY, 47842 A2($author$project$Ui$paddingXY, $author$project$UI$Theme$spacing.qk, $author$project$UI$Theme$spacing.bb) 47843 ]), 47844 _List_fromArray( 47845 [ 47846 A2( 47847 $author$project$Ui$el, 47848 _List_fromArray( 47849 [ 47850 $author$project$Ui$Font$size($author$project$UI$Theme$font.bb), 47851 $author$project$Ui$Font$color($author$project$UI$Theme$warning.qI) 47852 ]), 47853 $author$project$Ui$text( 47854 expanded ? 'â¾' : 'â¸')), 47855 A2( 47856 $author$project$Ui$el, 47857 _List_fromArray( 47858 [ 47859 $author$project$Ui$Font$size($author$project$UI$Theme$font.bb), 47860 $author$project$Ui$Font$weight($author$project$UI$Theme$fontWeight.nI), 47861 $author$project$Ui$Font$color($author$project$UI$Theme$warning.qI) 47862 ]), 47863 $author$project$Ui$text( 47864 $author$project$Translations$migrateCutManual(i18n))) 47865 ])); 47866 var anchors = config.lq(identity.m9); 47867 var anchorOptions = A2( 47868 $elm$core$List$map, 47869 function (anchor) { 47870 return A4( 47871 $author$project$Page$Group$Migrate$cutOption, 47872 A3($author$project$Page$Group$Migrate$anchorTitle, i18n, config.bz, anchor), 47873 $elm$core$Maybe$Just( 47874 A2(keepDrop, anchor.dn, anchor.eF)),
47875 _Utils_eq(current, anchor.eo), 47876 A2(config.o2, identity.m9, anchor.eo)); 47877 }, 47878 anchors); 47879 return A2( 47880 $author$project$Ui$column, 47881 _List_fromArray( 47882 [ 47883 $author$project$Ui$width($author$project$Ui$fill), 47884 $author$project$Ui$spacing($author$project$UI$Theme$spacing.bb), 47885 $author$project$Ui$padding($author$project$UI$Theme$spacing.qk), 47886 $author$project$Ui$rounded($author$project$UI$Theme$radius.qk), 47887 $author$project$Ui$background($author$project$UI$Theme$warning.en), 47888 $author$project$Ui$border($author$project$UI$Theme$border), 47889 $author$project$Ui$borderColor($author$project$UI$Theme$warning.qS) 47890 ]), 47891 A2( 47892 $elm$core$List$cons, 47893 A2( 47894 $author$project$Ui$el, 47895 _List_fromArray( 47896 [ 47897 $author$project$Ui$Font$size($author$project$UI$Theme$font.bb), 47898 $author$project$Ui$Font$weight($author$project$UI$Theme$fontWeight.dL), 47899 $author$project$Ui$Font$color($author$project$UI$Theme$warning.qI) 47900 ]), 47901 $author$project$Ui$text( 47902 $author$project$Translations$migrateCurateHeading(i18n))), 47903 _Utils_ap( 47904 anchorOptions, 47905 _Utils_ap( 47906 removeAllOption, 47907 _Utils_ap( 47908 _List_fromArray( 47909 [manualToggle]), 47910 _Utils_ap( 47911 manualOptions, 47912 _List_fromArray( 47913 [ 47914 A2( 47915 $author$project$Ui$el, 47916 _List_fromArray( 47917 [ 47918 $author$project$Ui$width($author$project$Ui$fill), 47919 $author$project$Ui$Font$size($author$project$UI$Theme$font.bb), 47920 $author$project$Ui$Font$color($author$project$UI$Theme$warning.aM) 47921 ]), 47922 $author$project$Ui$text( 47923 $author$project$Translations$migrateCurateOrderNote(i18n))) 47924 ]))))))); 47925 }); 47926var $author$project$Translations$migrateEventsUnit = function (_v0) { 47927 var lang = _v0; 47928 if (!lang) { 47929 return 'events'; 47930 } else { 47931 return 'événements'; 47932 } 47933}; 47934var $author$project$Page$Group$Migrate$eventCountText = F2( 47935 function (i18n, identity) { 47936 return $elm$core$String$fromInt(identity.bK) + (' ' + $author$project$Translations$migrateEventsUnit(i18n)); 47937 }); 47938var $author$project$Ui$clip = A2($author$project$Internal$Model2$classWith, $author$project$Internal$Flag$overflow, $author$project$Internal$Style2$classes.lU); 47939var $author$project$Translations$migrateToggleKeep = function (_v0) { 47940 var lang = _v0; 47941 if (!lang) { 47942 return 'Keep'; 47943 } else { 47944 return 'Garder'; 47945 } 47946}; 47947var $author$project$Page$Group$Migrate$segment = F4( 47948 function (label, active, activeBg, onPress) { 47949 return A2( 47950 $author$project$Ui$el, 47951 _Utils_ap( 47952 _List_fromArray( 47953 [ 47954 A2($author$project$Ui$paddingXY, $author$project$UI$Theme$spacing.aW, $author$project$UI$Theme$spacing.qk), 47955 $author$project$Ui$Font$size($author$project$UI$Theme$font.qk), 47956 $author$project$Ui$Font$weight($author$project$UI$Theme$fontWeight.nI) 47957 ]), 47958 active ? _List_fromArray( 47959 [ 47960 $author$project$Ui$background(activeBg), 47961 $author$project$Ui$Font$color($author$project$UI$Theme$base.km) 47962 ]) : _List_fromArray( 47963 [ 47964 $author$project$Ui$Input$button(onPress), 47965 $author$project$Ui$pointer, 47966 $author$project$Ui$Font$color($author$project$UI$Theme$base.aM) 47967 ])), 47968 $author$project$Ui$text(label)); 47969 }); 47970var $author$project$Page$Group$Migrate$keepToggle = F6( 47971 function (i18n, actionLabel, actionBg, onToggle, memberId, keeping) { 47972 return A2( 47973 $author$project$Ui$row, 47974 _List_fromArray( 47975 [ 47976 $author$project$Ui$width($author$project$Ui$shrink), 47977 $author$project$Ui$alignRight, 47978 $author$project$Ui$border($author$project$UI$Theme$border), 47979 $author$project$Ui$borderColor($author$project$UI$Theme$base.k3), 47980 $author$project$Ui$rounded($author$project$UI$Theme$radius.rn), 47981 $author$project$Ui$clip 47982 ]), 47983 _List_fromArray( 47984 [ 47985 A4( 47986 $author$project$Page$Group$Migrate$segment, 47987 $author$project$Translations$migrateToggleKeep(i18n), 47988 keeping, 47989 $author$project$UI$Theme$primary.kl, 47990 onToggle(memberId)), 47991 A4( 47992 $author$project$Page$Group$Migrate$segment, 47993 actionLabel, 47994 !keeping, 47995 actionBg, 47996 onToggle(memberId)) 47997 ])); 47998 }); 47999var $author$project$Translations$memberDeviceLinkedDate = F2( 48000 function (date, _v0) { 48001 var lang = _v0; 48002 if (!lang) { 48003 return 'Linked ' + date; 48004 } else { 48005 return 'Lié le ' + date; 48006 } 48007 }); 48008var $author$project$Translations$migrateActionCut = function (_v0) { 48009 var lang = _v0; 48010 if (!lang) { 48011 return 'Cut history'; 48012 } else { 48013 return 'Couper lâhistorique'; 48014 } 48015}; 48016var $author$project$Translations$migrateActionRemove = function (_v0) { 48017 var lang = _v0; 48018 if (!lang) { 48019 return 'Remove'; 48020 } else { 48021 return 'Retirer'; 48022 } 48023}; 48024var $author$project$Translations$migrateDeviceTag = function (_v0) { 48025 var lang = _v0; 48026 if (!lang) { 48027 return 'device'; 48028 } else { 48029 return 'appareil'; 48030 } 48031}; 48032var $author$project$Translations$migrateKept = function (_v0) { 48033 var lang = _v0; 48034 if (!lang) { 48035 return 'kept'; 48036 } else { 48037 return 'conservé'; 48038 } 48039}; 48040var $author$project$Translations$migrateRoleYou = function (_v0) { 48041 var lang = _v0; 48042 if (!lang) { 48043 return 'you'; 48044 } else { 48045 return 'toi'; 48046 } 48047}; 48048var $author$project$Page$Group$Migrate$pill = F3( 48049 function (bg, fg, text) { 48050 return A2( 48051 $author$project$Ui$el, 48052 _List_fromArray( 48053 [ 48054 $author$project$Ui$Font$size($author$project$UI$Theme$font.bb), 48055 $author$project$Ui$Font$weight($author$project$UI$Theme$fontWeight.dL), 48056 $author$project$Ui$Font$color(fg), 48057 $author$project$Ui$background(bg), 48058 A2($author$project$Ui$paddingXY, $author$project$UI$Theme$spacing.qk, $author$project$UI$Theme$spacing.bb),
48059 $author$project$Ui$rounded($author$project$UI$Theme$radius.hF), 48060 $author$project$Ui$width($author$project$Ui$shrink) 48061 ]), 48062 $author$project$Ui$text(text)); 48063 }); 48064var $author$project$Domain$Member$shortId = function (id) { 48065 return A2($elm$core$String$left, 12, id); 48066}; 48067var $author$project$Page$Group$Migrate$identityCard = F3( 48068 function (i18n, config, identity) { 48069 var nameRow = A2( 48070 $author$project$Ui$row, 48071 _List_fromArray( 48072 [ 48073 $author$project$Ui$spacing($author$project$UI$Theme$spacing.qk), 48074 $author$project$Ui$contentCenterY, 48075 $author$project$Ui$width($author$project$Ui$shrink) 48076 ]), 48077 A2( 48078 $elm$core$List$cons, 48079 A2( 48080 $author$project$Ui$el, 48081 _List_fromArray( 48082 [ 48083 $author$project$Ui$Font$size($author$project$UI$Theme$font.aW), 48084 $author$project$Ui$Font$color($author$project$UI$Theme$base.qI) 48085 ]), 48086 $author$project$Ui$text(identity.i6)), 48087 identity.i3 ? _List_fromArray( 48088 [ 48089 A3( 48090 $author$project$Page$Group$Migrate$pill, 48091 $author$project$UI$Theme$warning.en, 48092 $author$project$UI$Theme$warning.qI, 48093 $author$project$Translations$migrateDeviceTag(i18n)) 48094 ]) : _List_Nil)); 48095 var metaLine = A2( 48096 $elm$core$String$join, 48097 ' · ', 48098 function () { 48099 var _v1 = identity.jd; 48100 if (!_v1.$) { 48101 var ts = _v1.a; 48102 return _List_fromArray( 48103 [ 48104 A2( 48105 $author$project$Translations$memberDeviceLinkedDate, 48106 $author$project$Domain$Date$toString( 48107 A2($author$project$Domain$Date$posixToDate, config.ro, ts)), 48108 i18n), 48109 A2($author$project$Page$Group$Migrate$eventCountText, i18n, identity) 48110 ]); 48111 } else { 48112 return _List_fromArray( 48113 [ 48114 A2($author$project$Page$Group$Migrate$eventCountText, i18n, identity) 48115 ]); 48116 } 48117 }()); 48118 var meta = A2( 48119 $author$project$Ui$el, 48120 _List_fromArray( 48121 [ 48122 $author$project$Ui$Font$size($author$project$UI$Theme$font.bb), 48123 $author$project$Ui$Font$color($author$project$UI$Theme$base.aM) 48124 ]), 48125 $author$project$Ui$text(metaLine)); 48126 var cuttable = !$elm$core$List$isEmpty(identity.h3); 48127 var interactive = identity.j0 || cuttable; 48128 var bound = A2($elm$core$Dict$get, identity.m9, config.p7); 48129 var control = identity.j0 ? A6( 48130 $author$project$Page$Group$Migrate$keepToggle, 48131 i18n, 48132 $author$project$Translations$migrateActionRemove(i18n), 48133 $author$project$UI$Theme$danger.kl, 48134 config.o4, 48135 identity.m9, 48136 _Utils_eq(bound, $elm$core$Maybe$Nothing)) : (cuttable ? A6( 48137 $author$project$Page$Group$Migrate$keepToggle, 48138 i18n, 48139 $author$project$Translations$migrateActionCut(i18n), 48140 $author$project$UI$Theme$warning.kl, 48141 config.o4, 48142 identity.m9, 48143 _Utils_eq(bound, $elm$core$Maybe$Nothing)) : (identity.dl ? A3( 48144 $author$project$Page$Group$Migrate$pill, 48145 $author$project$UI$Theme$success.en, 48146 $author$project$UI$Theme$success.qI, 48147 $author$project$Translations$migrateRoleYou(i18n)) : A3( 48148 $author$project$Page$Group$Migrate$pill, 48149 $author$project$UI$Theme$base.k3, 48150 $author$project$UI$Theme$base.aM, 48151 $author$project$Translations$migrateKept(i18n)))); 48152 var header = A2( 48153 $author$project$Ui$row, 48154 _List_fromArray( 48155 [ 48156 $author$project$Ui$width($author$project$Ui$fill), 48157 $author$project$Ui$spacing($author$project$UI$Theme$spacing.qk), 48158 $author$project$Ui$contentCenterY 48159 ]), 48160 _List_fromArray( 48161 [ 48162 A2( 48163 $author$project$Ui$column, 48164 _List_fromArray( 48165 [ 48166 $author$project$Ui$width($author$project$Ui$fill), 48167 $author$project$Ui$spacing($author$project$UI$Theme$spacing.bb) 48168 ]), 48169 _List_fromArray( 48170 [ 48171 nameRow, 48172 A2( 48173 $author$project$Ui$el, 48174 _List_fromArray( 48175 [ 48176 $author$project$Ui$Font$size($author$project$UI$Theme$font.bb), 48177 $author$project$Ui$Font$color($author$project$UI$Theme$base.aM) 48178 ]), 48179 $author$project$Ui$text( 48180 $author$project$Domain$Member$shortId(identity.m9))) 48181 ])), 48182 control 48183 ])); 48184 var refine = function () { 48185 if (!bound.$) { 48186 var current = bound.a; 48187 return cuttable ? _List_fromArray( 48188 [ 48189 A4($author$project$Page$Group$Migrate$curationBox, i18n, config, identity, current) 48190 ]) : _List_Nil; 48191 } else { 48192 return _List_Nil; 48193 } 48194 }(); 48195 return A2( 48196 $author$project$Ui$column, 48197 _Utils_ap( 48198 _List_fromArray( 48199 [ 48200 $author$project$Ui$width($author$project$Ui$fill), 48201 $author$project$Ui$spacing($author$project$UI$Theme$spacing.qk), 48202 $author$project$Ui$padding($author$project$UI$Theme$spacing.aW),
48203 $author$project$Ui$rounded($author$project$UI$Theme$radius.aW) 48204 ]), 48205 interactive ? _List_fromArray( 48206 [ 48207 $author$project$Ui$border($author$project$UI$Theme$border), 48208 $author$project$Ui$borderColor($author$project$UI$Theme$base.k3) 48209 ]) : _List_fromArray( 48210 [ 48211 $author$project$Ui$background($author$project$UI$Theme$base.qR) 48212 ])), 48213 _Utils_ap( 48214 _List_fromArray( 48215 [header, meta]), 48216 refine)); 48217 }); 48218var $author$project$Translations$migrateCancel = function (_v0) { 48219 var lang = _v0; 48220 if (!lang) { 48221 return 'Cancel'; 48222 } else { 48223 return 'Annuler'; 48224 } 48225}; 48226var $author$project$Translations$migrateCarries = function (_v0) { 48227 var lang = _v0; 48228 if (!lang) { 48229 return 'Your full verified history is carried over, so balances and members stay identical in the new group.'; 48230 } else { 48231 return 'L\'intégralité de ton historique vérifié est transférée : les soldes et les membres restent identiques dans le nouveau groupe.'; 48232 } 48233}; 48234var $author$project$Translations$migrateConfirm = function (_v0) { 48235 var lang = _v0; 48236 if (!lang) { 48237 return 'Create the new group'; 48238 } else { 48239 return 'Créer le nouveau groupe'; 48240 } 48241}; 48242var $author$project$Translations$migrateCoordinate = function (_v0) { 48243 var lang = _v0; 48244 if (!lang) { 48245 return 'If several members see this warning, agree together first: only one person should migrate and share the new link â everyone else simply waits for it.'; 48246 } else { 48247 return 'Si plusieurs membres voient cet avertissement, mets-toi d\'accord avec eux d\'abord : une seule personne effectue la migration et partage le nouveau lien â les autres n\'ont plus qu\'à l\'attendre.'; 48248 } 48249}; 48250var $author$project$Translations$migrateExposure = function (_v0) { 48251 var lang = _v0; 48252 if (!lang) { 48253 return 'Migration protects future history. It cannot undo past exposure: whoever already had the old key can still read everything shared here before.'; 48254 } else { 48255 return 'La migration protège l\'historique futur. Elle ne peut pas annuler l\'exposition passée : quiconque possédait déjà l\'ancienne clé peut toujours lire tout ce qui a été partagé auparavant.'; 48256 } 48257}; 48258var $author$project$Translations$migrateIntro = function (_v0) { 48259 var lang = _v0; 48260 if (!lang) { 48261 return 'Migration creates a brand-new group with a new encryption key and moves your verified history into it. Use this if this group shows signs of tampering you didn\'t expect.'; 48262 } else { 48263 return 'La migration crée un tout nouveau groupe avec une nouvelle clé de chiffrement et y transfère ton historique vérifié. à utiliser si ce groupe présente des signes de falsification inattendus.'; 48264 } 48265}; 48266var $author$project$Translations$migratePreview = function (_v0) { 48267 var lang = _v0; 48268 if (!lang) { 48269 return 'Preview the result'; 48270 } else { 48271 return 'Prévisualiser le résultat'; 48272 } 48273}; 48274var $author$project$Translations$migrateReadonly = function (_v0) { 48275 var lang = _v0; 48276 if (!lang) { 48277 return 'The old group is archived, read-only; the server copy expires on its own.'; 48278 } else { 48279 return 'L\'ancien groupe est archivé, en lecture seule ; la copie sur le serveur expire d\'elle-même.'; 48280 } 48281}; 48282var $author$project$Translations$migrateReinvite = function (_v0) { 48283 var lang = _v0; 48284 if (!lang) { 48285 return 'You must share the new group\'s invite link again â with trusted members only, and not over a channel that may be compromised. Anyone you don\'t re-invite is left behind.'; 48286 } else { 48287 return 'Tu dois repartager le lien d\'invitation du nouveau groupe â uniquement avec les membres de confiance, et pas via un canal potentiellement compromis. Toute personne non réinvitée est laissée de côté.'; 48288 } 48289}; 48290var $author$project$Translations$migrateReviewIntro = function (_v0) { 48291 var lang = _v0; 48292 if (!lang) { 48293 return 'Turn off anyone you don\'t recognize â an injected flood usually comes from a single identity, or a device claiming to be a member you didn\'t add. Your own identity and the group\'s creator can\'t be removed.'; 48294 } else { 48295 return 'Désactive toute personne que tu ne reconnais pas â un afflux injecté provient généralement d\'une seule identité, ou d\'un appareil se faisant passer pour un membre que tu n\'as pas ajouté. Ta propre identité et le créateur du groupe ne peuvent pas être retirés.'; 48296 } 48297}; 48298var $author$project$Translations$migrateReviewTitle = function (_v0) { 48299 var lang = _v0; 48300 if (!lang) { 48301 return 'Who is in this group'; 48302 } else { 48303 return 'Qui est dans ce groupe'; 48304 } 48305}; 48306var $author$project$Page$Group$Migrate$amountColor = function (cents) { 48307 return (cents > 0) ? $author$project$UI$Theme$success.qI : ((cents < 0) ? $author$project$UI$Theme$danger.qI : $author$project$UI$Theme$base.aM); 48308}; 48309var $author$project$Format$formatCentsWithCurrency = F3( 48310 function (lang, amount, currency) { 48311 var symbol = $author$project$Domain$Currency$currencySymbol(currency); 48312 var cfg = $author$project$Format$localeConfig(lang); 48313 var number = A3( 48314 $author$project$Format$formatMinorUnits, 48315 cfg, 48316 $author$project$Domain$Currency$precision(currency), 48317 amount); 48318 var _v0 = cfg.fy; 48319 if (!_v0) { 48320 return (amount < 0) ? ('-' + (symbol + A2($elm$core$String$dropLeft, 1, number))) : _Utils_ap(symbol, number); 48321 } else { 48322 return number + ('\u00A0' + symbol); 48323 } 48324 }); 48325var $author$project$Format$formatCentsSigned = F3( 48326 function (lang, amount, currency) { 48327 return (amount > 0) ? ('+' + A3($author$project$Format$formatCentsWithCurrency, lang, amount, currency)) : A3($author$project$Format$formatCentsWithCurrency, lang, amount, currency); 48328 }); 48329var $author$project$Page$Group$Migrate$balanceRow = F3( 48330 function (i18n, currency, row) { 48331 var lang = $author$project$Translations$currentLanguage(i18n); 48332 var label = row.dl ? (row.i6 + (' (' + ($author$project$Translations$migrateRoleYou(i18n) + ')'))) : row.i6; 48333 return A2( 48334 $author$project$Ui$row, 48335 _List_fromArray( 48336 [ 48337 $author$project$Ui$width($author$project$Ui$fill), 48338 $author$project$Ui$spacing($author$project$UI$Theme$spacing.qk), 48339 $author$project$Ui$contentCenterY 48340 ]), 48341 _List_fromArray( 48342 [ 48343 A2( 48344 $author$project$Ui$el, 48345 _List_fromArray( 48346 [ 48347 $author$project$Ui$Font$size($author$project$UI$Theme$font.qk), 48348 $author$project$Ui$Font$color($author$project$UI$Theme$base.qI), 48349 $author$project$Ui$width($author$project$Ui$fill) 48350 ]), 48351 $author$project$Ui$text(label)), 48352 A2( 48353 $author$project$Ui$el, 48354 _List_fromArray( 48355 [ 48356 $author$project$Ui$Font$size($author$project$UI$Theme$font.qk), 48357 $author$project$Ui$Font$color( 48358 $author$project$Page$Group$Migrate$amountColor(row.hW)) 48359 ]), 48360 $author$project$Ui$text( 48361 A3($author$project$Format$formatCentsSigned, lang, row.hW, currency))), 48362 (!row.gb) ? $author$project$Ui$none : A2( 48363 $author$project$Ui$el, 48364 _List_fromArray( 48365 [ 48366 $author$project$Ui$Font$size($author$project$UI$Theme$font.bb), 48367 $author$project$Ui$Font$color( 48368 $author$project$Page$Group$Migrate$amountColor(row.gb)) 48369 ]), 48370 $author$project$Ui$text( 48371 'Î ' + A3($author$project$Format$formatCentsSigned, lang, row.gb, currency))) 48372 ])); 48373 }); 48374var $author$project$Translations$migrateStatBalances = function (_v0) { 48375 var lang = _v0; 48376 if (!lang) { 48377 return 'Balances after the cut'; 48378 } else { 48379 return 'Soldes après la coupe'; 48380 } 48381}; 48382var $author$project$Translations$migrateStatCarried = function (_v0) { 48383 var lang = _v0; 48384 if (!lang) { 48385 return 'Events carried over'; 48386 } else { 48387 return 'Ãvénements transférés'; 48388 } 48389}; 48390var $author$project$Translations$migrateStatDropped = function (_v0) { 48391 var lang = _v0; 48392 if (!lang) { 48393 return 'Events dropped'; 48394 } else { 48395 return 'Ãvénements supprimés'; 48396 } 48397}; 48398var $author$project$Translations$migrateStatEntries = function (_v0) { 48399 var lang = _v0; 48400 if (!lang) { 48401 return 'Entries'; 48402 } else { 48403 return 'Ãcritures'; 48404 } 48405}; 48406var $author$project$Translations$migrateStatMembers = function (_v0) { 48407 var lang = _v0; 48408 if (!lang) { 48409 return 'Members'; 48410 } else { 48411 return 'Membres'; 48412 } 48413}; 48414var $author$project$Page$Group$Migrate$statRow = F2( 48415 function (label, value) { 48416 return A2( 48417 $author$project$Ui$row, 48418 _List_fromArray( 48419 [ 48420 $author$project$Ui$width($author$project$Ui$fill), 48421 $author$project$Ui$spacing($author$project$UI$Theme$spacing.aW) 48422 ]), 48423 _List_fromArray( 48424 [ 48425 A2( 48426 $author$project$Ui$el, 48427 _List_fromArray( 48428 [ 48429 $author$project$Ui$Font$size($author$project$UI$Theme$font.qk), 48430 $author$project$Ui$Font$color($author$project$UI$Theme$base.aM), 48431 $author$project$Ui$width($author$project$Ui$fill) 48432 ]), 48433 $author$project$Ui$text(label)), 48434 A2( 48435 $author$project$Ui$el, 48436 _List_fromArray( 48437 [ 48438 $author$project$Ui$alignRight, 48439 $author$project$Ui$Font$size($author$project$UI$Theme$font.qk), 48440 $author$project$Ui$Font$color($author$project$UI$Theme$base.qI) 48441 ]), 48442 $author$project$Ui$text(value)) 48443 ])); 48444 }); 48445var $author$project$Page$Group$Migrate$previewBlock = F3( 48446 function (i18n, currency, result) { 48447 return A2( 48448 $author$project$UI$Components$card, 48449 _List_fromArray( 48450 [ 48451 $author$project$Ui$padding($author$project$UI$Theme$spacing.aW) 48452 ]), 48453 _List_fromArray( 48454 [ 48455 A2( 48456 $author$project$Ui$column, 48457 _List_fromArray( 48458 [ 48459 $author$project$Ui$spacing($author$project$UI$Theme$spacing.qk), 48460 $author$project$Ui$width($author$project$Ui$fill) 48461 ]), 48462 _Utils_ap( 48463 _List_fromArray( 48464 [ 48465 A2( 48466 $author$project$Page$Group$Migrate$statRow,
48467 $author$project$Translations$migrateStatCarried(i18n), 48468 $elm$core$String$fromInt(result.h8)), 48469 A2( 48470 $author$project$Page$Group$Migrate$statRow, 48471 $author$project$Translations$migrateStatDropped(i18n), 48472 $elm$core$String$fromInt(result.eF)), 48473 A2( 48474 $author$project$Page$Group$Migrate$statRow, 48475 $author$project$Translations$migrateStatMembers(i18n), 48476 $elm$core$String$fromInt(result.r)), 48477 A2( 48478 $author$project$Page$Group$Migrate$statRow, 48479 $author$project$Translations$migrateStatEntries(i18n), 48480 $elm$core$String$fromInt(result.E)), 48481 $author$project$UI$Components$sectionLabel( 48482 $author$project$Translations$migrateStatBalances(i18n)) 48483 ]), 48484 A2( 48485 $elm$core$List$map, 48486 A2($author$project$Page$Group$Migrate$balanceRow, i18n, currency), 48487 result.ly))) 48488 ])); 48489 }); 48490var $author$project$Page$Group$Migrate$view = F3( 48491 function (i18n, currency, config) { 48492 return A2( 48493 $author$project$Ui$column, 48494 _List_fromArray( 48495 [ 48496 $author$project$Ui$spacing($author$project$UI$Theme$spacing.i8), 48497 $author$project$Ui$width($author$project$Ui$fill), 48498 A2($author$project$Ui$paddingXY, 0, $author$project$UI$Theme$spacing.aW) 48499 ]), 48500 _List_fromArray( 48501 [ 48502 A2( 48503 $author$project$UI$Components$card, 48504 _List_fromArray( 48505 [ 48506 $author$project$Ui$padding($author$project$UI$Theme$spacing.i8) 48507 ]), 48508 _List_fromArray( 48509 [ 48510 A2( 48511 $author$project$Ui$column, 48512 _List_fromArray( 48513 [ 48514 $author$project$Ui$spacing($author$project$UI$Theme$spacing.aW), 48515 $author$project$Ui$width($author$project$Ui$fill) 48516 ]), 48517 A2( 48518 $elm$core$List$map, 48519 $author$project$Page$Group$Migrate$body, 48520 _List_fromArray( 48521 [ 48522 $author$project$Translations$migrateIntro(i18n), 48523 $author$project$Translations$migrateCarries(i18n), 48524 $author$project$Translations$migrateCoordinate(i18n), 48525 $author$project$Translations$migrateReinvite(i18n), 48526 $author$project$Translations$migrateReadonly(i18n), 48527 $author$project$Translations$migrateExposure(i18n) 48528 ]))) 48529 ])), 48530 A2($author$project$Page$Group$Migrate$findingsCard, i18n, config), 48531 A2( 48532 $author$project$UI$Components$card, 48533 _List_fromArray( 48534 [ 48535 $author$project$Ui$padding($author$project$UI$Theme$spacing.i8) 48536 ]), 48537 _List_fromArray( 48538 [ 48539 A2( 48540 $author$project$Ui$column, 48541 _List_fromArray( 48542 [ 48543 $author$project$Ui$spacing($author$project$UI$Theme$spacing.aW), 48544 $author$project$Ui$width($author$project$Ui$fill) 48545 ]), 48546 A2( 48547 $elm$core$List$cons, 48548 $author$project$UI$Components$sectionLabel( 48549 $author$project$Translations$migrateReviewTitle(i18n)), 48550 A2( 48551 $elm$core$List$cons, 48552 $author$project$Page$Group$Migrate$body( 48553 $author$project$Translations$migrateReviewIntro(i18n)), 48554 A2( 48555 $elm$core$List$map, 48556 A2($author$project$Page$Group$Migrate$identityCard, i18n, config), 48557 config.na)))) 48558 ])), 48559 A2( 48560 $author$project$Ui$column, 48561 _List_fromArray( 48562 [ 48563 $author$project$Ui$spacing($author$project$UI$Theme$spacing.aW), 48564 $author$project$Ui$width($author$project$Ui$fill) 48565 ]), 48566 _List_fromArray( 48567 [ 48568 A2( 48569 $author$project$UI$Components$btnOutline, 48570 _List_fromArray( 48571 [ 48572 $author$project$Ui$width($author$project$Ui$fill) 48573 ]), 48574 { 48575 gv: $elm$core$Maybe$Nothing, 48576 i6: $author$project$Translations$migratePreview(i18n), 48577 e7: config.oU 48578 }), 48579 function () { 48580 var _v0 = config.pE; 48581 if (!_v0.$) { 48582 var result = _v0.a; 48583 return A3($author$project$Page$Group$Migrate$previewBlock, i18n, currency, result); 48584 } else { 48585 return $author$project$Ui$none; 48586 } 48587 }() 48588 ])), 48589 A2( 48590 $author$project$UI$Components$btnPrimary, 48591 _List_fromArray( 48592 [ 48593 $author$project$Ui$width($author$project$Ui$fill) 48594 ]), 48595 { 48596 i6: $author$project$Translations$migrateConfirm(i18n), 48597 e7: config.or 48598 }), 48599 A2( 48600 $author$project$UI$Components$btnOutline, 48601 _List_fromArray( 48602 [ 48603 $author$project$Ui$width($author$project$Ui$fill) 48604 ]), 48605 { 48606 gv: $elm$core$Maybe$Nothing, 48607 i6: $author$project$Translations$migrateCancel(i18n), 48608 e7: config.op 48609 }) 48610 ])); 48611 }); 48612var $author$project$Page$Group$migrateView = F4( 48613 function (config, loaded, model, selfRoot) { 48614 return { 48615 ew: A3( 48616 $author$project$Page$Group$pageShell, 48617 config, 48618 $author$project$Translations$migrateTitle(config.aJ), 48619 A3( 48620 $author$project$Page$Group$Migrate$view, 48621 config.aJ, 48622 loaded.bA.il, 48623 { 48624 lq: function (memberId) { 48625 return A4( 48626 $author$project$Domain$MigrationCuration$anchorsFor, 48627 $author$project$Page$Group$curationOrder(model), 48628 A2($author$project$Page$Group$activeFindings, model.iY, loaded), 48629 memberId, 48630 loaded.iC); 48631 }, 48632 mu: model.a8, 48633 mE: A2($author$project$Page$Group$activeFindings, model.iY, loaded), 48634 na: A4( 48635 $author$project$Domain$MigrationCuration$identities, 48636 $author$project$Page$Group$curationOrder(model), 48637 selfRoot, 48638 loaded.a6, 48639 loaded.iC), 48640 op: config.d3( 48641 $author$project$Page$Group$RequestNavigation( 48642 $author$project$Route$Tab(0))), 48643 or: config.d3($author$project$Page$Group$ConfirmMigration), 48644 ou: function (finding) { 48645 return config.d3( 48646 $author$project$Page$Group$DismissSuspicion( 48647 $author$project$Domain$SuspicionAudit$dismissKey(finding))); 48648 }, 48649 oA: function (finding) { 48650 return config.d3( 48651 A2( 48652 $author$project$Page$Group$SetMigrationBound, 48653 finding.ii, 48654 A3( 48655 $author$project$Domain$MigrationCuration$cutBeforeFinding, 48656 $author$project$Page$Group$curationOrder(model), 48657 finding, 48658 loaded.iC))); 48659 }, 48660 oU: config.d3($author$project$Page$Group$PreviewMigration), 48661 o2: F2( 48662 function (memberId, bound) { 48663 return config.d3( 48664 A2($author$project$Page$Group$SetMigrationBound, memberId, bound)); 48665 }), 48666 o4: A2($elm$core$Basics$composeL, config.d3, $author$project$Page$Group$ToggleMigrationExclude), 48667 o6: A2($elm$core$Basics$composeL, config.d3, $author$project$Page$Group$ToggleMigrationManual), 48668 pE: model.bs, 48669 bz: $author$project$Domain$GroupState$resolveMemberName(loaded.a6), 48670 p7: model.at, 48671 ro: config.al 48672 })), 48673 g$: $elm$core$Maybe$Nothing 48674 }; 48675 }); 48676var $author$project$Translations$notFoundTitle = function (_v0) { 48677 var lang = _v0; 48678 if (!lang) { 48679 return 'Not found'; 48680 } else { 48681 return 'Introuvable'; 48682 } 48683}; 48684var $author$project$Page$Group$notFoundShell = F2( 48685 function (config, message) { 48686 return A3( 48687 $author$project$Page$Group$pageShell, 48688 config, 48689 $author$project$Translations$notFoundTitle(config.aJ), 48690 A2( 48691 $author$project$Ui$el, 48692 _List_fromArray( 48693 [ 48694 $author$project$Ui$Font$size($author$project$UI$Theme$font.aW), 48695 $author$project$Ui$Font$color($author$project$UI$Theme$base.aM), 48696 A2($author$project$Ui$paddingXY, 0, $author$project$UI$Theme$spacing.rn) 48697 ]), 48698 $author$project$Ui$text(message))); 48699 }); 48700var $author$project$Translations$editEntryTitle = F2( 48701 function (kind, _v0) { 48702 var lang = _v0; 48703 if (!lang) { 48704 switch (kind) { 48705 case 'income': 48706 return 'Edit Income'; 48707 case 'transfer': 48708 return 'Edit Transfer'; 48709 default: 48710 return 'Edit Expense'; 48711 } 48712 } else { 48713 switch (kind) { 48714 case 'income': 48715 return 'Modifier le revenu'; 48716 case 'transfer': 48717 return 'Modifier le transfert'; 48718 default: 48719 return 'Modifier la dépense'; 48720 } 48721 } 48722 }); 48723var $author$project$Page$Group$NewEntry$kindParam = function (kind) { 48724 switch (kind) { 48725 case 0: 48726 return 'expense'; 48727 case 1: 48728 return 'transfer'; 48729 default: 48730 return 'income'; 48731 } 48732}; 48733var $author$project$Translations$newEntryTitle = F2( 48734 function (kind, _v0) { 48735 var lang = _v0; 48736 if (!lang) { 48737 switch (kind) { 48738 case 'income': 48739 return 'New Income'; 48740 case 'transfer': 48741 return 'New Transfer'; 48742 default: 48743 return 'New Expense'; 48744 } 48745 } else { 48746 switch (kind) { 48747 case 'income': 48748 return 'Nouveau revenu'; 48749 case 'transfer': 48750 return 'Nouveau transfert'; 48751 default: 48752 return 'Nouvelle dépense'; 48753 } 48754 } 48755 }); 48756var $author$project$Page$Group$NewEntry$pageTitle = F2( 48757 function (i18n, _v0) { 48758 var data = _v0; 48759 return data.cw ? A2( 48760 $author$project$Translations$editEntryTitle, 48761 $author$project$Page$Group$NewEntry$kindParam(data.gE), 48762 i18n) : A2( 48763 $author$project$Translations$newEntryTitle, 48764 $author$project$Page$Group$NewEntry$kindParam(data.gE), 48765 i18n); 48766 }); 48767var $author$project$Translations$rejoinTitle = function (_v0) { 48768 var lang = _v0; 48769 if (!lang) { 48770 return 'Re-join group'; 48771 } else { 48772 return 'Rejoindre le groupe'; 48773 } 48774}; 48775var $author$project$Page$Group$AddMember$InputName = function (a) { 48776 return {$: 0, a: a}; 48777}; 48778var $author$project$Page$Group$AddMember$Submit = {$: 1}; 48779var $author$project$Translations$fieldRequired = function (_v0) { 48780 var lang = _v0; 48781 if (!lang) { 48782 return 'This field is required.'; 48783 } else { 48784 return 'Ce champ est requis.'; 48785 } 48786}; 48787var $author$project$Ui$Input$HiddenLabel = function (a) { 48788 return {$: 0, a: a}; 48789}; 48790var $author$project$Ui$Input$labelHidden = $author$project$Ui$Input$HiddenLabel; 48791var $author$project$Translations$memberAddNameLabel = function (_v0) { 48792 var lang = _v0; 48793 if (!lang) { 48794 return 'Member name'; 48795 } else { 48796 return 'Nom du membre'; 48797 } 48798}; 48799var $author$project$Translations$memberAddNamePlaceholder = function (_v0) { 48800 var lang = _v0; 48801 if (!lang) { 48802 return 'e.g. Bob'; 48803 } else { 48804 return 'ex. Bob'; 48805 } 48806}; 48807var $author$project$Translations$memberAddNameTaken = function (_v0) { 48808 var lang = _v0; 48809 if (!lang) { 48810 return 'This name is already used by another member.'; 48811 } else { 48812 return 'Ce nom est déjà utilisé par un autre membre.'; 48813 } 48814}; 48815var $author$project$Translations$memberAddSubmit = function (_v0) { 48816 var lang = _v0; 48817 if (!lang) { 48818 return 'Add Member'; 48819 } else { 48820 return 'Ajouter'; 48821 } 48822}; 48823var $author$project$Ui$Input$TextInputNode = function (a) { 48824 return {$: 0, a: a}; 48825}; 48826var $author$project$Internal$Model2$NodeAsInput = {$: 13}; 48827var $author$project$Internal$Model2$NodeAsTextArea = {$: 14}; 48828var $author$project$Ui$Input$darkGrey2 = A3($author$project$Ui$rgb, 186, 189, 182); 48829var $author$project$Ui$Input$white = A3($author$project$Ui$rgb, 255, 255, 255); 48830var $author$project$Ui$Input$defaultTextBoxStyle2 = _List_fromArray( 48831 [ 48832 $author$project$Ui$padding(12), 48833 $author$project$Ui$rounded(3), 48834 $author$project$Ui$borderColor($author$project$Ui$Input$darkGrey2), 48835 $author$project$Ui$border(1), 48836 $author$project$Ui$background($author$project$Ui$Input$white), 48837 $author$project$Ui$spacing(5), 48838 $author$project$Ui$width($author$project$Ui$fill) 48839 ]); 48840var $author$project$Internal$Model2$keepOnly = F2( 48841 function (isPassing, _v0) { 48842 var attrList = _v0; 48843 var newAttrs = A2( 48844 $elm$core$List$filter, 48845 function (attr) { 48846 return isPassing(attr.h); 48847 }, 48848 attrList); 48849 if (!newAttrs.b) { 48850 return $elm$core$Maybe$Nothing; 48851 } else { 48852 return $elm$core$Maybe$Just(newAttrs); 48853 } 48854 }); 48855var $author$project$Internal$Model2$attributeWith = F2( 48856 function (flag, a) { 48857 return _List_fromArray( 48858 [ 48859 { 48860 g: { 48861 q: $author$project$Internal$BitField$none, 48862 ei: _List_fromArray( 48863 [a]), 48864 f: $elm$core$Maybe$Nothing, 48865 j: _List_Nil, 48866 o: $author$project$Internal$Model2$NodeAsDiv, 48867 p: $author$project$Internal$Model2$noStyles 48868 }, 48869 h: flag 48870 } 48871 ]); 48872 }); 48873var $author$project$Ui$id = function (strId) { 48874 return A2( 48875 $author$project$Internal$Model2$attributeWith, 48876 $author$project$Internal$Flag$id, 48877 $elm$html$Html$Attributes$id(strId)); 48878}; 48879var $author$project$Ui$Input$labelAttribute = function (lbl) { 48880 if (!lbl.$) { 48881 var textLabel = lbl.a; 48882 return $author$project$Ui$Accessibility$description(textLabel); 48883 } else { 48884 var id = lbl.a; 48885 return $author$project$Ui$id(id); 48886 } 48887}; 48888var $elm$html$Html$Events$alwaysStop = function (x) { 48889 return _Utils_Tuple2(x, true); 48890}; 48891var $elm$virtual_dom$VirtualDom$MayStopPropagation = function (a) { 48892 return {$: 1, a: a}; 48893}; 48894var $elm$html$Html$Events$stopPropagationOn = F2( 48895 function (event, decoder) { 48896 return A2( 48897 $elm$virtual_dom$VirtualDom$on, 48898 event, 48899 $elm$virtual_dom$VirtualDom$MayStopPropagation(decoder)); 48900 }); 48901var $elm$html$Html$Events$targetValue = A2( 48902 $elm$json$Json$Decode$at, 48903 _List_fromArray( 48904 ['target', 'value']), 48905 $elm$json$Json$Decode$string); 48906var $elm$html$Html$Events$onInput = function (tagger) { 48907 return A2( 48908 $elm$html$Html$Events$stopPropagationOn, 48909 'input', 48910 A2( 48911 $elm$json$Json$Decode$map, 48912 $elm$html$Html$Events$alwaysStop, 48913 A2($elm$json$Json$Decode$map, tagger, $elm$html$Html$Events$targetValue))); 48914}; 48915var $elm$html$Html$Attributes$placeholder = $elm$html$Html$Attributes$stringProperty('placeholder'); 48916var $author$project$Internal$Model2$removeIfFlag = F2( 48917 function (shouldRemove, _v0) { 48918 var attrList = _v0; 48919 return A2( 48920 $elm$core$List$filter, 48921 function (attr) { 48922 return !shouldRemove(attr.h); 48923 }, 48924 attrList); 48925 }); 48926var $elm$html$Html$Attributes$boolProperty = F2( 48927 function (key, bool) { 48928 return A2( 48929 _VirtualDom_property, 48930 key, 48931 $elm$json$Json$Encode$bool(bool)); 48932 }); 48933var $elm$html$Html$Attributes$spellcheck = $elm$html$Html$Attributes$boolProperty('spellcheck'); 48934var $elm$html$Html$Attributes$type_ = $elm$html$Html$Attributes$stringProperty('type'); 48935var $elm$html$Html$Attributes$value = $elm$html$Html$Attributes$stringProperty('value'); 48936var $author$project$Ui$Input$textHelper = F3( 48937 function (textInput, attrs, textOptions) { 48938 var withDefaults = _Utils_ap( 48939 $author$project$Ui$Input$defaultTextBoxStyle2, 48940 A2( 48941 $elm$core$List$map, 48942 $author$project$Internal$Model2$removeIfFlag( 48943 $author$project$Internal$BitField$fieldEqual($author$project$Internal$Flag$id)), 48944 attrs)); 48945 var hasId = function (attr) { 48946 return A2( 48947 $author$project$Internal$Model2$keepOnly, 48948 function (flag) { 48949 return A2($author$project$Internal$BitField$fieldEqual, $author$project$Internal$Flag$id, flag); 48950 }, 48951 attr); 48952 }; 48953 var _v0 = textInput.a3; 48954 if (_v0.$ === 1) { 48955 var padding = A2( 48956 $elm$core$List$filterMap, 48957 $author$project$Internal$Model2$keepOnly( 48958 function (flag) { 48959 return A2($author$project$Internal$BitField$fieldEqual, $author$project$Internal$Flag$padding, flag); 48960 }), 48961 withDefaults); 48962 var id = A2($elm$core$List$filterMap, hasId, attrs); 48963 var inputElement = A4( 48964 $author$project$Internal$Model2$element, 48965 $author$project$Internal$Model2$NodeAsTextArea, 48966 2, 48967 _Utils_ap( 48968 _List_fromArray( 48969 [ 48970 $author$project$Internal$Model2$class($author$project$Internal$Style$Generated$classes.nh), 48971 A2($author$project$Internal$Model2$style, 'line-height', 'inherit'), 48972 A2($author$project$Internal$Model2$style, 'grid-column', '1 / 2'), 48973 A2($author$project$Internal$Model2$style, 'grid-row', '1 / 2'), 48974 A2($author$project$Internal$Model2$style, 'resize', 'none'), 48975 A2($author$project$Internal$Model2$style, 'overflow', 'hidden'), 48976 $author$project$Internal$Model2$attribute( 48977 $elm$html$Html$Attributes$value(textOptions.qI)), 48978 $author$project$Internal$Model2$attribute( 48979 $elm$html$Html$Events$onInput(textOptions.oq)), 48980 $author$project$Ui$Input$labelAttribute(textOptions.i6), 48981 $author$project$Internal$Model2$attribute( 48982 $elm$html$Html$Attributes$spellcheck(textInput.aL)), 48983 function () { 48984 var _v1 = textInput.aF; 48985 if (_v1.$ === 1) { 48986 return $author$project$Internal$Model2$noAttr; 48987 } else { 48988 var fill = _v1.a; 48989 return $author$project$Internal$Model2$attribute( 48990 A2($elm$html$Html$Attributes$attribute, 'autocomplete', fill)); 48991 } 48992 }(), 48993 function () { 48994 var _v2 = textOptions.pt; 48995 if (_v2.$ === 1) { 48996 return $author$project$Internal$Model2$noAttr; 48997 } else { 48998 var placeholder = _v2.a; 48999 return $author$project$Internal$Model2$attribut
48999e( 49000 $elm$html$Html$Attributes$placeholder(placeholder)); 49001 } 49002 }() 49003 ]), 49004 _Utils_ap(id, padding)), 49005 _List_Nil); 49006 return A4( 49007 $author$project$Internal$Model2$element, 49008 $author$project$Internal$Model2$NodeAsDiv, 49009 2, 49010 _Utils_ap( 49011 _List_fromArray( 49012 [ 49013 $author$project$Ui$width($author$project$Ui$fill), 49014 $author$project$Internal$Model2$class($author$project$Internal$Style$Generated$classes.mG), 49015 $author$project$Internal$Model2$class($author$project$Internal$Style$Generated$classes.nk), 49016 A2($author$project$Internal$Model2$style, 'white-space', 'pre-wrap'), 49017 A2($author$project$Internal$Model2$style, 'display', 'grid') 49018 ]), 49019 _Utils_ap( 49020 withDefaults, 49021 _List_fromArray( 49022 [ 49023 $author$project$Ui$padding(0) 49024 ]))), 49025 _List_fromArray( 49026 [ 49027 A2( 49028 $author$project$Ui$el, 49029 A2( 49030 $elm$core$List$cons, 49031 A2($author$project$Internal$Model2$style, 'grid-column', '1 / 2'), 49032 A2( 49033 $elm$core$List$cons, 49034 A2($author$project$Internal$Model2$style, 'grid-row', '1 / 2'), 49035 A2( 49036 $elm$core$List$cons, 49037 A2($author$project$Internal$Model2$style, 'visibility', 'hidden'), 49038 padding))), 49039 (textOptions.qI === '') ? $author$project$Ui$text( 49040 A2($elm$core$Maybe$withDefault, '', textOptions.pt) + '\u00A0') : $author$project$Ui$text(textOptions.qI + '\u00A0')), 49041 inputElement 49042 ])); 49043 } else { 49044 var inputType = _v0.a; 49045 return A4( 49046 $author$project$Internal$Model2$element, 49047 $author$project$Internal$Model2$NodeAsInput, 49048 2, 49049 _Utils_ap( 49050 _List_fromArray( 49051 [ 49052 $author$project$Internal$Model2$attribute( 49053 $elm$html$Html$Attributes$type_(inputType)), 49054 $author$project$Internal$Model2$class($author$project$Internal$Style$Generated$classes.nm), 49055 $author$project$Internal$Model2$attribute( 49056 $elm$html$Html$Attributes$value(textOptions.qI)), 49057 $author$project$Internal$Model2$attribute( 49058 $elm$html$Html$Events$onInput(textOptions.oq)), 49059 $author$project$Ui$Input$labelAttribute(textOptions.i6), 49060 $author$project$Internal$Model2$attribute( 49061 $elm$html$Html$Attributes$spellcheck(textInput.aL)), 49062 function () { 49063 var _v3 = textInput.aF; 49064 if (_v3.$ === 1) { 49065 return $author$project$Internal$Model2$noAttr; 49066 } else { 49067 var fill = _v3.a; 49068 return $author$project$Internal$Model2$attribute( 49069 A2($elm$html$Html$Attributes$attribute, 'autocomplete', fill)); 49070 } 49071 }(), 49072 function () { 49073 var _v4 = textOptions.pt; 49074 if (_v4.$ === 1) { 49075 return $author$project$Internal$Model2$noAttr; 49076 } else { 49077 var placeholder = _v4.a; 49078 return $author$project$Internal$Model2$attribute( 49079 $elm$html$Html$Attributes$placeholder(placeholder)); 49080 } 49081 }() 49082 ]), 49083 withDefaults), 49084 _List_Nil); 49085 } 49086 }); 49087var $author$project$Ui$Input$text = $author$project$Ui$Input$textHelper( 49088 { 49089 aF: $elm$core$Maybe$Nothing, 49090 aL: false, 49091 a3: $author$project$Ui$Input$TextInputNode('text') 49092 }); 49093var $author$project$Page$Group$AddMember$view = F4( 49094 function (i18n, existingNames, toMsg, _v0) { 49095 var data = _v0; 49096 var trimmed = $elm$core$String$trim(data.bW); 49097 return A2( 49098 $author$project$Ui$map, 49099 toMsg, 49100 A2( 49101 $author$project$Ui$column, 49102 _List_fromArray( 49103 [ 49104 $author$project$Ui$spacing($author$project$UI$Theme$spacing.i8), 49105 $author$project$Ui$width($author$project$Ui$fill) 49106 ]), 49107 _List_fromArray( 49108 [ 49109 A2( 49110 $author$project$Ui$column, 49111 _List_fromArray( 49112 [ 49113 $author$project$Ui$spacing($author$project$UI$Theme$spacing.bb), 49114 $author$project$Ui$width($author$project$Ui$fill) 49115 ]), 49116 _List_fromArray( 49117 [ 49118 A2( 49119 $author$project$Ui$el, 49120 _List_fromArray( 49121 [ 49122 $author$project$Ui$Font$size($author$project$UI$Theme$font.qk), 49123 $author$project$Ui$Font$weight($author$project$UI$Theme$fontWeight.dL) 49124 ]), 49125 $author$project$Ui$text( 49126 $author$project$Translations$memberAddNameLabel(i18n))), 49127 A2( 49128 $author$project$Ui$Input$text, 49129 _List_fromArray( 49130 [ 49131 $author$project$Ui$width($author$project$Ui$fill), 49132 $author$project$Ui$padding($author$project$UI$Theme$spacing.qk), 49133 $author$project$Ui$rounded($author$project$UI$Theme$radiu
49133s.qk), 49134 $author$project$Ui$border($author$project$UI$Theme$border), 49135 $author$project$Ui$borderColor($author$project$UI$Theme$base.k3) 49136 ]), 49137 { 49138 i6: $author$project$Ui$Input$labelHidden( 49139 $author$project$Translations$memberAddNameLabel(i18n)), 49140 oq: $author$project$Page$Group$AddMember$InputName, 49141 pt: $elm$core$Maybe$Just( 49142 $author$project$Translations$memberAddNamePlaceholder(i18n)), 49143 qI: data.bW 49144 }), 49145 (data.d_ && $elm$core$String$isEmpty(trimmed)) ? A2( 49146 $author$project$Ui$el, 49147 _List_fromArray( 49148 [ 49149 $author$project$Ui$Font$size($author$project$UI$Theme$font.qk), 49150 $author$project$Ui$Font$color($author$project$UI$Theme$danger.qI) 49151 ]), 49152 $author$project$Ui$text( 49153 $author$project$Translations$fieldRequired(i18n))) : ((data.d_ && A2( 49154 $elm$core$List$any, 49155 function (n) { 49156 return _Utils_eq( 49157 $elm$core$String$toLower(n), 49158 $elm$core$String$toLower(trimmed)); 49159 }, 49160 existingNames)) ? A2( 49161 $author$project$Ui$el, 49162 _List_fromArray( 49163 [ 49164 $author$project$Ui$Font$size($author$project$UI$Theme$font.qk), 49165 $author$project$Ui$Font$color($author$project$UI$Theme$danger.qI) 49166 ]), 49167 $author$project$Ui$text( 49168 $author$project$Translations$memberAddNameTaken(i18n))) : $author$project$Ui$none) 49169 ])), 49170 A2( 49171 $author$project$UI$Components$btnPrimary, 49172 _List_Nil, 49173 { 49174 i6: $author$project$Translations$memberAddSubmit(i18n), 49175 e7: $author$project$Page$Group$AddMember$Submit 49176 }) 49177 ]))); 49178 }); 49179var $author$project$Translations$diagEventCount = function (_v0) { 49180 var lang = _v0; 49181 if (!lang) { 49182 return 'Total events'; 49183 } else { 49184 return 'Nombre total d\'événements'; 49185 } 49186}; 49187var $author$project$Translations$diagEventsTitle = function (_v0) { 49188 var lang = _v0; 49189 if (!lang) { 49190 return 'Events'; 49191 } else { 49192 return 'Ãvénements'; 49193 } 49194}; 49195var $author$project$Page$Group$Diagnostics$payloadName = function (payload) { 49196 switch (payload.$) { 49197 case 0: 49198 return 'Unknown'; 49199 case 1: 49200 return 'MemberCreated'; 49201 case 2: 49202 return 'MemberRenamed'; 49203 case 3: 49204 return 'MemberRetired'; 49205 case 4: 49206 return 'MemberUnretired'; 49207 case 5: 49208 return 'MemberLinked'; 49209 case 6: 49210 return 'MemberMetadataUpdated'; 49211 case 7: 49212 return 'EntryAdded'; 49213 case 8: 49214 return 'EntryModified'; 49215 case 9: 49216 return 'EntryDeleted'; 49217 case 10: 49218 return 'EntryUndeleted'; 49219 case 11: 49220 return 'GroupCreated'; 49221 case 12: 49222 return 'GroupMetadataUpdated'; 49223 case 13: 49224 return 'SettlementPreferencesUpdated'; 49225 case 14: 49226 return 'CompactionProposed'; 49227 default: 49228 return 'CompactionApproved'; 49229 } 49230}; 49231var $author$project$Page$Group$Diagnostics$histogram = function (envelopes) { 49232 return A2( 49233 $elm$core$List$sortBy, 49234 function (_v0) { 49235 var name = _v0.a; 49236 var count = _v0.b; 49237 return _Utils_Tuple2(-count, name); 49238 }, 49239 $elm$core$Dict$toList( 49240 A3( 49241 $elm$core$List$foldl, 49242 F2( 49243 function (envelope, counts) { 49244 return A3( 49245 $elm$core$Dict$update, 49246 $author$project$Page$Group$Diagnostics$payloadName(envelope.jC), 49247 A2( 49248 $elm$core$Basics$composeR, 49249 $elm$core$Maybe$withDefault(0), 49250 A2( 49251 $elm$core$Basics$composeR, 49252 $elm$core$Basics$add(1), 49253 $elm$core$Maybe$Just)), 49254 counts); 49255 }), 49256 $elm$core$Dict$empty, 49257 envelopes))); 49258}; 49259var $author$project$Page$Group$Diagnostics$metricRow = F2( 49260 function (label, value) { 49261 return A2( 49262 $author$project$Ui$row, 49263 _List_fromArray( 49264 [ 49265 $author$project$Ui$width($author$project$Ui$fill), 49266 $author$project$Ui$spacing($author$project$UI$Theme$spacing.qk) 49267 ]), 49268 _List_fromArray( 49269 [ 49270 A2( 49271 $author$project$Ui$el, 49272 _List_fromArray( 49273 [ 49274 $author$project$Ui$Font$size($author$project$UI$Theme$font.qk), 49275 $author$project$Ui$Font$color($author$project$UI$Theme$base.qI) 49276 ]), 49277 $author$project$Ui$text(label)), 49278 A2( 49279 $author$project$Ui$el, 49280 _List_fromArray( 49281 [ 49282 $author$project$Ui$Font$size($author$project$UI$Theme$font.qk), 49283 $author$project$Ui$Font$weight($author$project$UI$Theme$fontWeight.dL), 49284 $author$project$Ui$alignRight 49285 ]), 49286 $author$project$Ui$text(value)) 49287 ])); 49288 }); 49289var $author$project$Page$Group$Diagnostics$section = F2( 49290 function (title, rows) { 49291 return A2( 49292 $author$project$Ui$column, 49293 _List_fromArray( 49294 [ 49295 $author$project$Ui$spacing($author$project$UI$Theme$spacing.bb), 49296 $author$project$Ui$width($author$project$Ui$fill) 49297 ]), 49298 _List_fromArray( 49299 [ 49300 $author$project$UI$Components$sectionLabel(title), 49301 A2( 49302 $author$project$UI$Components$card, 49303 _List_fromArray( 49304 [ 49305 $author$project$Ui$padding($author$project$UI$Theme$spacing.i8) 49306 ]), 49307 _List_fromArray( 49308 [ 49309 A2( 49310 $author$project$Ui$column, 49311 _List_fromArray( 49312 [ 49313 $author$project$Ui$spacing($author$project$UI$Theme$spacing.qk), 49314 $author$project$Ui$width($author$project$Ui$fill) 49315 ]), 49316 rows) 49317 ])) 49318 ])); 49319 }); 49320var $author$project$Page$Group$Diagnostics$eventsSection = F2( 49321 function (i18n, loaded) { 49322 return A2( 49323 $author$project$Page$Group$Diagnostics$section, 49324 $author$project$Translations$diagEventsTitle(i18n), 49325 A2( 49326 $elm$core$List$cons, 49327 A2( 49328 $author$project$Page$Group$Diagnostics$metricRow, 49329 $author$project$Translations$diagEventCount(i18n), 49330 $elm$core$String$fromInt( 49331 $elm$core$List$length(loaded.iC))), 49332 A2( 49333 $elm$core$List$map, 49334 function (_v0) { 49335 var name = _v0.a; 49336 var count = _v0.b; 49337 return A2( 49338 $author$project$Page$Group$Diagnostics$metricRow, 49339 name, 49340 $elm$core$String$fromInt(count)); 49341 }, 49342 $author$project$Page$Group$Diagnostics$histogram(loaded.iC)))); 49343 }); 49344var $author$project$Translations$diagMeasuring = function (_v0) { 49345 var lang = _v0; 49346 if (!lang) { 49347 return 'Measuring...'; 49348 } else { 49349 return 'Mesure en cours...'; 49350 } 49351}; 49352var $author$project$Page$Group$Diagnostics$subtleText = function (value) { 49353 return A2( 49354 $author$project$Ui$el, 49355 _List_fromArray( 49356 [ 49357 $author$project$Ui$Font$size($author$project$UI$Theme$font.qk), 49358 $author$project$Ui$Font$color($author$project$UI$Theme$base.aM) 49359 ]), 49360 $author$project$Ui$text(value)); 49361}; 49362var $author$project$Page$Group$Diagnostics$asyncSection = F4( 49363 function (i18n, title, model, rows) { 49364 return A2( 49365 $author$project$Page$Group$Diagnostics$section, 49366 title, 49367 function () { 49368 if (!model.$) { 49369 var stats = model.a; 49370 return rows(stats); 49371 } else { 49372 return _List_fromArray( 49373 [ 49374 $author$project$Page$Group$Diagnostics$subtleText( 49375 $author$project$Translations$diagMeasuring(i18n)) 49376 ]); 49377 } 49378 }()); 49379 }); 49380var $author$project$Translations$diagLoadTime = function (_v0) { 49381 var lang = _v0; 49382 if (!lang) { 49383 return 'IndexedDB load + decode'; 49384 } else { 49385 return 'Chargement IndexedDB + décodage'; 49386 } 49387}; 49388var $author$project$Translations$diagPerfTitle = function (_v0) { 49389 var lang = _v0; 49390 if (!lang) { 49391 return 'Performance'; 49392 } else { 49393 return 'Performance'; 49394 } 49395}; 49396var $author$project$Translations$diagReplayEntries = function (_v0) { 49397 var lang = _v0; 49398 if (!lang) { 49399 return 'Entries after replay'; 49400 } else { 49401 return 'Entrées après rejeu'; 49402 } 49403};
49404var $author$project$Translations$diagReplayTime = function (_v0) { 49405 var lang = _v0; 49406 if (!lang) { 49407 return 'Sort + replay all events'; 49408 } else { 49409 return 'Tri + rejeu de tous les événements'; 49410 } 49411}; 49412var $author$project$Translations$diagVerifiedCount = function (_v0) { 49413 var lang = _v0; 49414 if (!lang) { 49415 return 'Events passing verification'; 49416 } else { 49417 return 'Ãvénements vérifiés'; 49418 } 49419}; 49420var $author$project$Translations$diagVerifyTime = function (_v0) { 49421 var lang = _v0; 49422 if (!lang) { 49423 return 'Signature verification'; 49424 } else { 49425 return 'Vérification des signatures'; 49426 } 49427}; 49428var $author$project$Page$Group$Diagnostics$perfSection = F2( 49429 function (i18n, model) { 49430 return A4( 49431 $author$project$Page$Group$Diagnostics$asyncSection, 49432 i18n, 49433 $author$project$Translations$diagPerfTitle(i18n), 49434 model, 49435 function (stats) { 49436 return _List_fromArray( 49437 [ 49438 A2( 49439 $author$project$Page$Group$Diagnostics$metricRow, 49440 $author$project$Translations$diagLoadTime(i18n), 49441 $elm$core$String$fromInt(stats.cA) + ' ms'), 49442 A2( 49443 $author$project$Page$Group$Diagnostics$metricRow, 49444 $author$project$Translations$diagVerifyTime(i18n), 49445 $elm$core$String$fromInt(stats.c2) + ' ms'), 49446 A2( 49447 $author$project$Page$Group$Diagnostics$metricRow, 49448 $author$project$Translations$diagVerifiedCount(i18n), 49449 $elm$core$String$fromInt(stats.c1)), 49450 A2( 49451 $author$project$Page$Group$Diagnostics$metricRow, 49452 $author$project$Translations$diagReplayTime(i18n), 49453 $elm$core$String$fromInt(stats.hc) + ' ms'), 49454 A2( 49455 $author$project$Page$Group$Diagnostics$metricRow, 49456 $author$project$Translations$diagReplayEntries(i18n), 49457 $elm$core$String$fromInt(stats.hb)) 49458 ]); 49459 }); 49460 }); 49461var $author$project$Translations$diagAvgSize = function (_v0) { 49462 var lang = _v0; 49463 if (!lang) { 49464 return 'Average'; 49465 } else { 49466 return 'Moyenne'; 49467 } 49468}; 49469var $author$project$Translations$diagGzipPerEvent = function (_v0) { 49470 var lang = _v0; 49471 if (!lang) { 49472 return 'Compressed one by one'; 49473 } else { 49474 return 'Compressés un par un'; 49475 } 49476}; 49477var $author$project$Translations$diagGzipSavings = function (_v0) { 49478 var lang = _v0; 49479 if (!lang) { 49480 return 'Consolidation could save'; 49481 } else { 49482 return 'Gain potentiel de la consolidation'; 49483 } 49484}; 49485var $author$project$Translations$diagGzipUnavailable = function (_v0) { 49486 var lang = _v0; 49487 if (!lang) { 49488 return 'Compression measurement is not supported by this browser.'; 49489 } else { 49490 return 'La mesure de compression n\'est pas prise en charge par ce navigateur.'; 49491 } 49492}; 49493var $author$project$Translations$diagGzipWholeLog = function (_v0) { 49494 var lang = _v0; 49495 if (!lang) { 49496 return 'Compressed as a single log'; 49497 } else { 49498 return 'Compressés en un seul journal'; 49499 } 49500}; 49501var $author$project$Translations$diagMedianSize = function (_v0) { 49502 var lang = _v0; 49503 if (!lang) { 49504 return 'Median'; 49505 } else { 49506 return 'Médiane'; 49507 } 49508}; 49509var $author$project$Translations$diagSizesTitle = function (_v0) { 49510 var lang = _v0; 49511 if (!lang) { 49512 return 'Event sizes (before encryption)'; 49513 } else { 49514 return 'Taille des événements (avant chiffrement)'; 49515 } 49516}; 49517var $author$project$Translations$diagTotalSize = function (_v0) { 49518 var lang = _v0; 49519 if (!lang) { 49520 return 'Total'; 49521 } else { 49522 return 'Total'; 49523 } 49524}; 49525var $author$project$Page$Group$Diagnostics$formatBytes = function (bytes) { 49526 var scaled = function (unit) { 49527 var tenths = $elm$core$Basics$round((bytes / unit) * 10); 49528 return _Utils_ap( 49529 $elm$core$String$fromInt((tenths / 10) | 0), 49530 (!(tenths % 10)) ? '' : ('.' + $elm$core$String$fromInt(tenths % 10))); 49531 }; 49532 return (bytes < 1000) ? ($elm$core$String$fromInt(bytes) + ' B') : ((bytes < 1000000) ? (scaled(1000) + ' kB') : (scaled(1000000) + ' MB')); 49533}; 49534var $author$project$Page$Group$Diagnostics$sizesSection = F2( 49535 function (i18n, model) { 49536 return A4( 49537 $author$project$Page$Group$Diagnostics$asyncSection, 49538 i18n, 49539 $author$project$Translations$diagSizesTitle(i18n), 49540 model, 49541 function (stats) { 49542 return _Utils_ap( 49543 _List_fromArray( 49544 [ 49545 A2( 49546 $author$project$Page$Group$Diagnostics$metricRow, 49547 $author$project$Translations$diagTotalSize(i18n), 49548 $author$project$Page$Group$Diagnostics$formatBytes(stats.hw)), 49549 A2( 49550 $author$project$Page$Group$Diagnostics$metricRow, 49551 $author$project$Translations$diagAvgSize(i18n), 49552 $author$project$Page$Group$Diagnostics$formatBytes(stats.fT)), 49553 A2( 49554 $author$project$Page$Group$Diagnostics$metricRow,
49555 $author$project$Translations$diagMedianSize(i18n), 49556 $author$project$Page$Group$Diagnostics$formatBytes(stats.gK)) 49557 ]), 49558 function () { 49559 var _v0 = stats.di; 49560 if (!_v0.$) { 49561 var gzip = _v0.a; 49562 return _List_fromArray( 49563 [ 49564 A2( 49565 $author$project$Page$Group$Diagnostics$metricRow, 49566 $author$project$Translations$diagGzipPerEvent(i18n), 49567 $author$project$Page$Group$Diagnostics$formatBytes(gzip.g3)), 49568 A2( 49569 $author$project$Page$Group$Diagnostics$metricRow, 49570 $author$project$Translations$diagGzipWholeLog(i18n), 49571 $author$project$Page$Group$Diagnostics$formatBytes(gzip.hC)), 49572 A2( 49573 $author$project$Page$Group$Diagnostics$metricRow, 49574 $author$project$Translations$diagGzipSavings(i18n), 49575 $author$project$Page$Group$Diagnostics$formatBytes( 49576 A2($elm$core$Basics$max, 0, gzip.g3 - gzip.hC))) 49577 ]); 49578 } else { 49579 return _List_fromArray( 49580 [ 49581 $author$project$Page$Group$Diagnostics$subtleText( 49582 $author$project$Translations$diagGzipUnavailable(i18n)) 49583 ]); 49584 } 49585 }()); 49586 }); 49587 }); 49588var $author$project$Translations$diagStorageTitle = function (_v0) { 49589 var lang = _v0; 49590 if (!lang) { 49591 return 'Device storage'; 49592 } else { 49593 return 'Stockage de l\'appareil'; 49594 } 49595}; 49596var $author$project$Translations$diagStorageUsage = function (_v0) { 49597 var lang = _v0; 49598 if (!lang) { 49599 return 'Used'; 49600 } else { 49601 return 'Utilisé'; 49602 } 49603}; 49604var $author$project$Page$Group$Diagnostics$storageSection = F2( 49605 function (i18n, model) { 49606 return A4( 49607 $author$project$Page$Group$Diagnostics$asyncSection, 49608 i18n, 49609 $author$project$Translations$diagStorageTitle(i18n), 49610 model, 49611 function (stats) { 49612 return _List_fromArray( 49613 [ 49614 A2( 49615 $author$project$Page$Group$Diagnostics$metricRow, 49616 $author$project$Translations$diagStorageUsage(i18n), 49617 $author$project$Page$Group$Diagnostics$formatBytes(stats.fu.q4) + (' / ' + $author$project$Page$Group$Diagnostics$formatBytes(stats.fu.pJ))), 49618 $author$project$Page$Group$Diagnostics$subtleText( 49619 function () { 49620 var _v0 = stats.jE; 49621 switch (_v0) { 49622 case 0: 49623 return $author$project$Translations$aboutPersistGranted(i18n); 49624 case 1: 49625 return $author$project$Translations$aboutPersistDenied(i18n); 49626 default: 49627 return $author$project$Translations$aboutPersistUnsupported(i18n); 49628 } 49629 }()) 49630 ]); 49631 }); 49632 }); 49633var $author$project$Translations$diagNeverSynced = function (_v0) { 49634 var lang = _v0; 49635 if (!lang) { 49636 return 'never synced'; 49637 } else { 49638 return 'jamais synchronisé'; 49639 } 49640}; 49641var $author$project$Translations$diagSyncCursor = function (_v0) { 49642 var lang = _v0; 49643 if (!lang) { 49644 return 'Sync cursor'; 49645 } else { 49646 return 'Curseur de synchronisation'; 49647 } 49648}; 49649var $author$project$Translations$diagSyncTitle = function (_v0) { 49650 var lang = _v0; 49651 if (!lang) { 49652 return 'Sync'; 49653 } else { 49654 return 'Synchronisation'; 49655 } 49656}; 49657var $author$project$Translations$diagUnpushedCount = function (_v0) { 49658 var lang = _v0; 49659 if (!lang) { 49660 return 'Unpushed events'; 49661 } else { 49662 return 'Ãvénements non envoyés'; 49663 } 49664}; 49665var $author$project$Page$Group$Diagnostics$syncSection = F2( 49666 function (i18n, loaded) { 49667 return A2( 49668 $author$project$Page$Group$Diagnostics$section, 49669 $author$project$Translations$diagSyncTitle(i18n), 49670 _List_fromArray( 49671 [ 49672 A2( 49673 $author$project$Page$Group$Diagnostics$metricRow, 49674 $author$project$Translations$diagSyncCursor(i18n), 49675 function () { 49676 var _v0 = loaded.cZ; 49677 if (!_v0.$) { 49678 var cursor = _v0.a; 49679 return $elm$core$String$fromInt(cursor.kg); 49680 } else { 49681 return $author$project$Translations$diagNeverSynced(i18n); 49682 } 49683 }()), 49684 A2( 49685 $author$project$Page$Group$Diagnostics$metricRow, 49686 $author$project$Translations$diagUnpushedCount(i18n), 49687 $elm$core$String$fromInt( 49688 $elm$core$Set$size(loaded.bC))) 49689 ])); 49690 }); 49691var $author$project$Translations$diagTamperClean = function (_v0) { 49692 var lang = _v0; 49693 if (!lang) { 49694 return 'No signals detected.'; 49695 } else { 49696 return 'Aucun signal détecté.'; 49697 } 49698}; 49699var $author$project$Translations$diagTamperForged = function (_v0) { 49700 var lang = _v0; 49701 if (!lang) { 49702 return 'Forged signatures'; 49703 } else { 49704 return 'Signatures falsifiées'; 49705 } 49706}; 49707var $author$project$Translations$diagTamperManifest = function (_v0) { 49708 var lang = _v0; 49709 if (!lang) { 49710 return 'Compaction mismatches'; 49711 } else { 49712 return 'Incohérences de compaction'; 49713 } 49714}; 49715var $author$project$Translations$diagTamperRateLimit = function (_v0) { 49716 var lang = _v0; 49717 if (!lang) { 49718 return 'Rate-limit anomalies'; 49719 } else { 49720 return 'Anomalies de débit'; 49721 } 49722}; 49723var $author$project$Translations$diagTamperReset = function (_v0) { 49724 var lang = _v0; 49725 if (!lang) { 49726 return 'History resets with loss'; 49727 } else { 49728 return 'Réinitialisations avec perte'; 49729 } 49730}; 49731var $author$project$Translations$diagTamperTitle = function (_v0) { 49732 var lang = _v0; 49733 if (!lang) { 49734 return 'Tamper signals'; 49735 } else { 49736 return 'Signaux d\'altération'; 49737 } 49738}; 49739var $author$project$Translations$diagTamperForgedClaimed = function (_v0) { 49740 var lang = _v0; 49741 if (!lang) { 49742 return 'Claimed authors (not proof of responsibility):'; 49743 } else { 49744 return 'Auteurs revendiqués (pas une preuve de responsabilité) :'; 49745 } 49746}; 49747var $author$project$Page$Group$Diagnostics$forgedByAuthor = F3( 49748 function (i18n, loaded, signals) { 49749 return $elm$core$Dict$isEmpty(signals.bm) ? _List_Nil : A2( 49750 $elm$core$List$cons, 49751 $author$project$Page$Group$Diagnostics$subtleText( 49752 $author$project$Translations$diagTamperForgedClaimed(i18n)), 49753 A2( 49754 $elm$core$List$map, 49755 function (_v0) { 49756 var authorId = _v0.a; 49757 var count = _v0.b; 49758 return A2( 49759 $author$project$Page$Group$Diagnostics$metricRow, 49760 A2($author$project$Domain$GroupState$resolveMemberName, loaded.a6, authorId), 49761 $elm$core$String$fromInt(count)); 49762 }, 49763 $elm$core$Dict$toList(signals.bm))); 49764 }); 49765var $author$project$Domain$TamperSignals$forgedCount = function (s) { 49766 return A3( 49767 $elm$core$Dict$foldl, 49768 F3( 49769 function (_v0, n, acc) { 49770 return acc + n; 49771 }), 49772 0, 49773 s.bm); 49774}; 49775var $author$project$Page$Group$Diagnostics$tamperSection = F2( 49776 function (i18n, loaded) { 49777 var signals = loaded.c_; 49778 return A2( 49779 $author$project$Page$Group$Diagnostics$section, 49780 $author$project$Translations$diagTamperTitle(i18n), 49781 $author$project$Domain$TamperSignals$isClean(signals) ? _List_fromArray( 49782 [ 49783 $author$project$Page$Group$Diagnostics$subtleText( 49784 $author$project$Translations$diagTamperClean(i18n)) 49785 ]) : A2( 49786 $elm$core$List$cons, 49787 A2( 49788 $author$project$Page$Group$Diagnostics$metricRow, 49789 $author$project$Translations$diagTamperForged(i18n), 49790 $elm$core$String$fromInt(
49791 $author$project$Domain$TamperSignals$forgedCount(signals))), 49792 _Utils_ap( 49793 A3($author$project$Page$Group$Diagnostics$forgedByAuthor, i18n, loaded, signals), 49794 _List_fromArray( 49795 [ 49796 A2( 49797 $author$project$Page$Group$Diagnostics$metricRow, 49798 $author$project$Translations$diagTamperRateLimit(i18n), 49799 $elm$core$String$fromInt(signals.bZ)), 49800 A2( 49801 $author$project$Page$Group$Diagnostics$metricRow, 49802 $author$project$Translations$diagTamperReset(i18n), 49803 $elm$core$String$fromInt(signals.cP)), 49804 A2( 49805 $author$project$Page$Group$Diagnostics$metricRow, 49806 $author$project$Translations$diagTamperManifest(i18n), 49807 $elm$core$String$fromInt(signals.cC)) 49808 ])))); 49809 }); 49810var $author$project$Page$Group$Diagnostics$view = F3( 49811 function (i18n, loaded, model) { 49812 return A2( 49813 $author$project$Ui$column, 49814 _List_fromArray( 49815 [ 49816 $author$project$Ui$spacing($author$project$UI$Theme$spacing.hE), 49817 $author$project$Ui$width($author$project$Ui$fill), 49818 A2($author$project$Ui$paddingXY, 0, $author$project$UI$Theme$spacing.aW) 49819 ]), 49820 _List_fromArray( 49821 [ 49822 A2($author$project$Page$Group$Diagnostics$eventsSection, i18n, loaded), 49823 A2($author$project$Page$Group$Diagnostics$syncSection, i18n, loaded), 49824 A2($author$project$Page$Group$Diagnostics$tamperSection, i18n, loaded), 49825 A2($author$project$Page$Group$Diagnostics$sizesSection, i18n, model), 49826 A2($author$project$Page$Group$Diagnostics$storageSection, i18n, model), 49827 A2($author$project$Page$Group$Diagnostics$perfSection, i18n, model) 49828 ])); 49829 }); 49830var $author$project$Page$Group$EditGroupMetadata$InputDescription = function (a) { 49831 return {$: 2, a: a}; 49832}; 49833var $author$project$Page$Group$EditGroupMetadata$InputName = function (a) { 49834 return {$: 0, a: a}; 49835}; 49836var $author$project$Page$Group$EditGroupMetadata$InputSubtitle = function (a) { 49837 return {$: 1, a: a}; 49838}; 49839var $author$project$Page$Group$EditGroupMetadata$Submit = {$: 7}; 49840var $author$project$Page$Group$EditGroupMetadata$ToggleArchive = {$: 8}; 49841var $feathericons$elm_feather$FeatherIcons$archive = A2( 49842 $feathericons$elm_feather$FeatherIcons$makeBuilder, 49843 'archive', 49844 _List_fromArray( 49845 [ 49846 A2( 49847 $elm$svg$Svg$polyline, 49848 _List_fromArray( 49849 [ 49850 $elm$svg$Svg$Attributes$points('21 8 21 21 3 21 3 8') 49851 ]), 49852 _List_Nil), 49853 A2( 49854 $elm$svg$Svg$rect, 49855 _List_fromArray( 49856 [ 49857 $elm$svg$Svg$Attributes$x('1'), 49858 $elm$svg$Svg$Attributes$y('3'), 49859 $elm$svg$Svg$Attributes$width('22'), 49860 $elm$svg$Svg$Attributes$height('5') 49861 ]), 49862 _List_Nil), 49863 A2( 49864 $elm$svg$Svg$line, 49865 _List_fromArray( 49866 [ 49867 $elm$svg$Svg$Attributes$x1('10'), 49868 $elm$svg$Svg$Attributes$y1('12'), 49869 $elm$svg$Svg$Attributes$x2('14'), 49870 $elm$svg$Svg$Attributes$y2('12') 49871 ]), 49872 _List_Nil) 49873 ])); 49874var $author$project$Translations$groupArchiveButton = function (_v0) { 49875 var lang = _v0; 49876 if (!lang) { 49877 return 'Archive group'; 49878 } else { 49879 return 'Archiver le groupe'; 49880 } 49881}; 49882var $author$project$Translations$groupUnarchiveButton = function (_v0) { 49883 var lang = _v0; 49884 if (!lang) { 49885 return 'Unarchive group'; 49886 } else { 49887 return 'Désarchiver le groupe'; 49888 } 49889}; 49890var $author$project$Page$Group$EditGroupMetadata$archiveSection = F2( 49891 function (i18n, isArchived) { 49892 return A2( 49893 $author$project$Ui$column, 49894 _List_fromArray( 49895 [ 49896 $author$project$Ui$spacing($author$project$UI$Theme$spacing.qk), 49897 $author$project$Ui$width($author$project$Ui$fill) 49898 ]), 49899 _List_fromArray( 49900 [ 49901 $author$project$UI$Components$horizontalSeparator, 49902 A2( 49903 $author$project$UI$Components$btnOutline, 49904 _List_Nil, 49905 { 49906 gv: $elm$core$Maybe$Just( 49907 A2($author$project$UI$Components$featherIcon, 16, $feathericons$elm_feather$FeatherIcons$archive)), 49908 i6: isArchived ? $author$project$Translations$groupUnarchiveButton(i18n) : $author$project$Translations$groupArchiveButton(i18n), 49909 e7: $author$project$Page$Group$EditGroupMetadata$ToggleArchive 49910 }) 49911 ])); 49912 }); 49913var $author$project$Page$Group$EditGroupMetadata$ConfirmDelete = {$: 10}; 49914var $author$project$Page$Group$EditGroupMetadata$ToggleDeleteConfirm = {$: 9}; 49915var $author$project$Translations$groupRemoveButton = function (_v0) { 49916 var lang = _v0; 49917 if (!lang) { 49918 return 'Remove Group'; 49919 } else { 49920 return 'Supprimer le groupe'; 49921 } 49922}; 49923var $author$project$Translations$groupRemoveConfirm = function (_v0) { 49924 var lang = _v0; 49925 if (!lang) { 49926 return 'Remove'; 49927 } else { 49928 return 'Supprimer'; 49929 } 49930}; 49931var $author$project$Translations$groupRemoveWarning = function (_v0) { 49932 var lang = _v0; 49933 if (!lang) { 49934 return 'This will permanently remove this group from your device. This cannot be undone.'; 49935 } else { 49936 return 'Cela supprimera définitivement ce groupe de ton appareil. Cette action est irréversible.'; 49937 } 49938}; 49939var $author$project$Page$Group$EditGroupMetadata$deleteSection = F2( 49940 function (i18n, confirmingDelete) { 49941 return A2( 49942 $author$project$Ui$column, 49943 _List_fromArray( 49944 [ 49945 $author$project$Ui$spacing($author$project$UI$Theme$spacing.qk), 49946 $author$project$Ui$width($author$project$Ui$fill) 49947 ]), 49948 _List_fromArray( 49949 [ 49950 $author$project$UI$Components$horizontalSeparator, 49951 confirmingDelete ? A2( 49952 $author$project$Ui$column, 49953 _List_fromArray( 49954 [ 49955 $author$project$Ui$spacing($author$project$UI$Theme$spacing.qk), 49956 $author$project$Ui$width($author$project$Ui$fill) 49957 ]), 49958 _List_fromArray( 49959 [ 49960 A2( 49961 $author$project$Ui$el, 49962 _List_fromArray( 49963 [ 49964 $author$project$Ui$width($author$project$Ui$fill), 49965 $author$project$Ui$padding($author$project$UI$Theme$spacing.aW), 49966 $author$project$Ui$rounded($author$project$UI$Theme$radiu
49966s.aW), 49967 $author$project$Ui$background($author$project$UI$Theme$danger.qR), 49968 $author$project$Ui$Font$size($author$project$UI$Theme$font.qk), 49969 $author$project$Ui$Font$color($author$project$UI$Theme$danger.qI) 49970 ]), 49971 $author$project$Ui$text( 49972 $author$project$Translations$groupRemoveWarning(i18n))), 49973 A2( 49974 $author$project$UI$Components$btnDanger, 49975 _List_Nil, 49976 { 49977 gv: $feathericons$elm_feather$FeatherIcons$trash2, 49978 i6: $author$project$Translations$groupRemoveConfirm(i18n), 49979 e7: $author$project$Page$Group$EditGroupMetadata$ConfirmDelete 49980 }) 49981 ])) : A2( 49982 $author$project$UI$Components$btnOutline, 49983 _List_Nil, 49984 { 49985 gv: $elm$core$Maybe$Nothing, 49986 i6: $author$project$Translations$groupRemoveButton(i18n), 49987 e7: $author$project$Page$Group$EditGroupMetadata$ToggleDeleteConfirm 49988 }) 49989 ])); 49990 }); 49991var $author$project$UI$Components$formLabel = F2( 49992 function (label, required) { 49993 return A2( 49994 $author$project$Ui$row, 49995 _List_fromArray( 49996 [ 49997 $author$project$Ui$spacing($author$project$UI$Theme$spacing.bb), 49998 $author$project$Ui$width($author$project$Ui$shrink) 49999 ]), 50000 _List_fromArray( 50001 [ 50002 A2( 50003 $author$project$Ui$el, 50004 _List_fromArray( 50005 [ 50006 $author$project$Ui$Font$size($author$project$UI$Theme$font.qk), 50007 $author$project$Ui$Font$weight($author$project$UI$Theme$fontWeight.dL) 50008 ]), 50009 $author$project$Ui$text(label)), 50010 required ? A2( 50011 $author$project$Ui$el, 50012 _List_fromArray( 50013 [ 50014 $author$project$Ui$Font$size($author$project$UI$Theme$font.qk), 50015 $author$project$Ui$Font$color($author$project$UI$Theme$primary.kl) 50016 ]), 50017 $author$project$Ui$text('*')) : $author$project$Ui$none 50018 ])); 50019 }); 50020var $author$project$UI$Components$formTextField = function (config) { 50021 return A2( 50022 $author$project$Ui$column, 50023 _List_fromArray( 50024 [ 50025 $author$project$Ui$spacing($author$project$UI$Theme$spacing.bb), 50026 $author$project$Ui$width($author$project$Ui$fill) 50027 ]), 50028 _List_fromArray( 50029 [ 50030 function () { 50031 var _v0 = config.gv; 50032 if (!_v0.$) { 50033 var icon = _v0.a; 50034 return A2( 50035 $author$project$Ui$row, 50036 _List_fromArray( 50037 [ 50038 $author$project$Ui$spacing($author$project$UI$Theme$spacing.qk), 50039 $author$project$Ui$contentCenterY, 50040 $author$project$Ui$width($author$project$Ui$shrink) 50041 ]), 50042 _List_fromArray( 50043 [ 50044 A2( 50045 $author$project$Ui$el, 50046 _List_fromArray( 50047 [ 50048 $author$project$Ui$Font$color($author$project$UI$Theme$base.aM) 50049 ]), 50050 A2($author$project$UI$Components$featherIcon, 16, icon)), 50051 A2($author$project$UI$Components$formLabel, config.i6, config.hd) 50052 ])); 50053 } else { 50054 return A2($author$project$UI$Components$formLabel, config.i6, config.hd); 50055 } 50056 }(), 50057 A2( 50058 $author$project$Ui$Input$text, 50059 _List_fromArray( 50060 [ 50061 $author$project$Ui$width($author$project$Ui$fill), 50062 $author$project$Ui$padding($author$project$UI$Theme$spacing.qk), 50063 $author$project$Ui$rounded($author$project$UI$Theme$radius.qk), 50064 $author$project$Ui$border($author$project$UI$Theme$border), 50065 $author$project$Ui$borderColor($author$project$UI$Theme$base.k3) 50066 ]), 50067 { 50068 i6: $author$project$Ui$Input$labelHidden(config.i6), 50069 oq: config.oq, 50070 pt: config.pt, 50071 qI: config.q8 50072 }), 50073 function () { 50074 var _v1 = config.gi; 50075 if (!_v1.$) { 50076 var errorMsg = _v1.a; 50077 return A2( 50078 $author$project$Ui$el, 50079 _List_fromArray( 50080 [ 50081 $author$project$Ui$Font$size($author$project$UI$Theme$font.qk), 50082 $author$project$Ui$Font$color($author$project$UI$Theme$danger.qI) 50083 ]), 50084 $author$project$Ui$text(errorMsg)); 50085 } else { 50086 return $author$project$Ui$none; 50087 } 50088 }() 50089 ])); 50090}; 50091var $author$project$Translations$groupSettingsDescription = function (_v0) { 50092 var lang = _v0; 50093 if (!lang) { 50094 return 'Description'; 50095 } else { 50096 return 'Description'; 50097 } 50098}; 50099var $author$project$Translations$groupSettingsDescriptionPlaceholder = function (_v0) { 50100 var lang = _v0; 50101 if (!lang) { 50102 return 'What is this group for?'; 50103 } else { 50104 return 'à quoi sert ce groupe ?'; 50105 } 50106}; 50107var $author$project$Translations$groupSettingsName = function (_v0) { 50108 var lang = _v0; 50109 if (!lang) { 50110 return 'Group name'; 50111 } else { 50112 return 'Nom du groupe'; 50113 } 50114}; 50115var $author$project$Translations$groupSettingsSave = function (_v0) { 50116 var lang = _v0; 50117 if (!lang) { 50118 return 'Save'; 50119 } else { 50120 return 'Enregistrer'; 50121 } 50122}; 50123var $author$project$Translations$groupSettingsSubtitle = function (_v0) { 50124 var lang = _v0; 50125 if (!lang) { 50126 return 'Subtitle'; 50127 } else { 50128 return 'Sous-titre'; 50129 } 50130}; 50131var $author$project$Translations$groupSettingsSubtitlePlaceholder = function (_v0) { 50132 var lang = _v0; 50133 if (!lang) { 50134 return 'e.g. Summer 2024'; 50135 } else { 50136 return 'ex. Ãté 2024'; 50137 } 50138}; 50139var $dwayne$elm_validation$Validation$isValid = function (v) { 50140 if (!v.$) { 50141 return true; 50142 } else { 50143 return false;
50144 } 50145}; 50146var $dwayne$elm_field$Field$Advanced$isValid = function (_v0) { 50147 var processed = _v0.b.ae; 50148 return $dwayne$elm_validation$Validation$isValid(processed); 50149}; 50150var $dwayne$elm_field$Field$Advanced$isInvalid = A2($elm$core$Basics$composeL, $elm$core$Basics$not, $dwayne$elm_field$Field$Advanced$isValid); 50151var $dwayne$elm_field$Field$isInvalid = $dwayne$elm_field$Field$Advanced$isInvalid; 50152var $author$project$Page$Group$EditGroupMetadata$AddLink = {$: 5}; 50153var $author$project$Translations$groupSettingsAddLink = function (_v0) { 50154 var lang = _v0; 50155 if (!lang) { 50156 return 'Add link'; 50157 } else { 50158 return 'Ajouter un lien'; 50159 } 50160}; 50161var $author$project$Translations$groupSettingsLinks = function (_v0) { 50162 var lang = _v0; 50163 if (!lang) { 50164 return 'Links'; 50165 } else { 50166 return 'Liens'; 50167 } 50168}; 50169var $author$project$Page$Group$EditGroupMetadata$InputLinkLabel = F2( 50170 function (a, b) { 50171 return {$: 3, a: a, b: b}; 50172 }); 50173var $author$project$Page$Group$EditGroupMetadata$InputLinkUrl = F2( 50174 function (a, b) { 50175 return {$: 4, a: a, b: b}; 50176 }); 50177var $author$project$Page$Group$EditGroupMetadata$RemoveLink = function (a) { 50178 return {$: 6, a: a}; 50179}; 50180var $author$project$Translations$fieldInvalidUrl = function (_v0) { 50181 var lang = _v0; 50182 if (!lang) { 50183 return 'Must start with http:// or https://'; 50184 } else { 50185 return 'Doit commencer par http:// ou https://'; 50186 } 50187}; 50188var $author$project$Translations$groupSettingsLinkLabelPlaceholder = function (_v0) { 50189 var lang = _v0; 50190 if (!lang) { 50191 return 'Label'; 50192 } else { 50193 return 'Intitulé'; 50194 } 50195}; 50196var $author$project$Translations$groupSettingsLinkUrlPlaceholder = function (_v0) { 50197 var lang = _v0; 50198 if (!lang) { 50199 return 'https://...'; 50200 } else { 50201 return 'https://...'; 50202 } 50203}; 50204var $author$project$Translations$groupSettingsRemoveLink = function (_v0) { 50205 var lang = _v0; 50206 if (!lang) { 50207 return 'Remove'; 50208 } else { 50209 return 'Supprimer'; 50210 } 50211}; 50212var $author$project$Page$Group$EditGroupMetadata$linkRow = F4( 50213 function (i18n, submitted, id, formData) { 50214 var urlField = A2( 50215 $dwayne$elm_form$Form$get, 50216 function (a) { 50217 return a.jc(id); 50218 }, 50219 formData); 50220 var showError = function (field) { 50221 return $dwayne$elm_field$Field$isInvalid(field) && (submitted || $dwayne$elm_field$Field$isDirty(field)); 50222 }; 50223 var labelField = A2( 50224 $dwayne$elm_form$Form$get, 50225 function (a) { 50226 return a.jb(id); 50227 }, 50228 formData); 50229 return A2( 50230 $author$project$Ui$column, 50231 _List_fromArray( 50232 [ 50233 $author$project$Ui$spacing($author$project$UI$Theme$spacing.bb), 50234 $author$project$Ui$width($author$project$Ui$fill) 50235 ]), 50236 _List_fromArray( 50237 [ 50238 A2( 50239 $author$project$Ui$row, 50240 _List_fromArray( 50241 [ 50242 $author$project$Ui$spacing($author$project$UI$Theme$spacing.qk), 50243 $author$project$Ui$width($author$project$Ui$fill), 50244 $author$project$Ui$contentCenterY 50245 ]), 50246 _List_fromArray( 50247 [ 50248 A2( 50249 $author$project$Ui$Input$text, 50250 _List_fromArray( 50251 [ 50252 $author$project$Ui$width($author$project$Ui$fill), 50253 $author$project$Ui$padding($author$project$UI$Theme$spacing.qk), 50254 $author$project$Ui$rounded($author$project$UI$Theme$radius.qk), 50255 $author$project$Ui$border($author$project$UI$Theme$border), 50256 $author$project$Ui$borderColor($author$project$UI$Theme$base.k3) 50257 ]), 50258 { 50259 i6: $author$project$Ui$Input$labelHidden( 50260 $author$project$Translations$groupSettingsLinkLabelPlaceholder(i18n)), 50261 oq: $author$project$Page$Group$EditGroupMetadata$InputLinkLabel(id), 50262 pt: $elm$core$Maybe$Just( 50263 $author$project$Translations$groupSettingsLinkLabelPlaceholder(i18n)), 50264 qI: $dwayne$elm_field$Field$toRawString(labelField) 50265 }), 50266 A2( 50267 $author$project$UI$Components$btnOutline, 50268 _List_fromArray( 50269 [ 50270 $author$project$Ui$width($author$project$Ui$shrink), 50271 A2($author$project$Ui$paddingXY, $author$project$UI$Theme$spacing.aW, $author$project$UI$Theme$spacing.qk) 50272 ]), 50273 { 50274 gv: $elm$core$Maybe$Just( 50275 A2($author$project$UI$Components$featherIcon, 14, $feathericons$elm_feather$FeatherIcons$trash2)), 50276 i6: $author$project$Translations$groupSettingsRemoveLink(i18n), 50277 e7: $author$project$Page$Group$EditGroupMetadata$RemoveLink(id) 50278 }) 50279 ])), 50280 A2( 50281 $author$project$Ui$Input$text, 50282 _List_fromArray( 50283 [ 50284 $author$project$Ui$width($author$project$Ui$fill), 50285 $author$project$Ui$padding($author$project$UI$Theme$spacing.qk), 50286 $author$project$Ui$rounded($author$project$UI$Theme$radiu
50286s.qk), 50287 $author$project$Ui$border($author$project$UI$Theme$border), 50288 $author$project$Ui$borderColor($author$project$UI$Theme$base.k3) 50289 ]), 50290 { 50291 i6: $author$project$Ui$Input$labelHidden( 50292 $author$project$Translations$groupSettingsLinkUrlPlaceholder(i18n)), 50293 oq: $author$project$Page$Group$EditGroupMetadata$InputLinkUrl(id), 50294 pt: $elm$core$Maybe$Just( 50295 $author$project$Translations$groupSettingsLinkUrlPlaceholder(i18n)), 50296 qI: $dwayne$elm_field$Field$toRawString(urlField) 50297 }), 50298 showError(labelField) ? A2( 50299 $author$project$Ui$el, 50300 _List_fromArray( 50301 [ 50302 $author$project$Ui$Font$size($author$project$UI$Theme$font.qk), 50303 $author$project$Ui$Font$color($author$project$UI$Theme$danger.qI) 50304 ]), 50305 $author$project$Ui$text( 50306 $author$project$Translations$fieldRequired(i18n))) : (showError(urlField) ? A2( 50307 $author$project$Ui$el, 50308 _List_fromArray( 50309 [ 50310 $author$project$Ui$Font$size($author$project$UI$Theme$font.qk), 50311 $author$project$Ui$Font$color($author$project$UI$Theme$danger.qI) 50312 ]), 50313 $author$project$Ui$text( 50314 $author$project$Translations$fieldInvalidUrl(i18n))) : $author$project$Ui$none) 50315 ])); 50316 }); 50317var $feathericons$elm_feather$FeatherIcons$plus = A2( 50318 $feathericons$elm_feather$FeatherIcons$makeBuilder, 50319 'plus', 50320 _List_fromArray( 50321 [ 50322 A2( 50323 $elm$svg$Svg$line, 50324 _List_fromArray( 50325 [ 50326 $elm$svg$Svg$Attributes$x1('12'), 50327 $elm$svg$Svg$Attributes$y1('5'), 50328 $elm$svg$Svg$Attributes$x2('12'), 50329 $elm$svg$Svg$Attributes$y2('19') 50330 ]), 50331 _List_Nil), 50332 A2( 50333 $elm$svg$Svg$line, 50334 _List_fromArray( 50335 [ 50336 $elm$svg$Svg$Attributes$x1('5'), 50337 $elm$svg$Svg$Attributes$y1('12'), 50338 $elm$svg$Svg$Attributes$x2('19'), 50339 $elm$svg$Svg$Attributes$y2('12') 50340 ]), 50341 _List_Nil) 50342 ])); 50343var $author$project$Page$Group$EditGroupMetadata$linksSection = F3( 50344 function (i18n, submitted, formData) { 50345 var linkEntries = $dwayne$elm_form$Form$List$toList( 50346 A2( 50347 $dwayne$elm_form$Form$get, 50348 function ($) { 50349 return $.cz; 50350 }, 50351 formData)); 50352 return A2( 50353 $author$project$Ui$column, 50354 _List_fromArray( 50355 [ 50356 $author$project$Ui$spacing($author$project$UI$Theme$spacing.qk), 50357 $author$project$Ui$width($author$project$Ui$fill) 50358 ]), 50359 _List_fromArray( 50360 [ 50361 A2( 50362 $author$project$UI$Components$formLabel, 50363 $author$project$Translations$groupSettingsLinks(i18n), 50364 false), 50365 A2( 50366 $author$project$Ui$column, 50367 _List_fromArray( 50368 [ 50369 $author$project$Ui$spacing($author$project$UI$Theme$spacing.qk), 50370 $author$project$Ui$width($author$project$Ui$fill) 50371 ]), 50372 A2( 50373 $elm$core$List$map, 50374 function (_v0) { 50375 var id = _v0.a; 50376 return A4($author$project$Page$Group$EditGroupMetadata$linkRow, i18n, submitted, id, formData); 50377 }, 50378 linkEntries)), 50379 A2( 50380 $author$project$UI$Components$btnOutline, 50381 _List_fromArray( 50382 [ 50383 $author$project$Ui$width($author$project$Ui$shrink), 50384 A2($author$project$Ui$paddingXY, $author$project$UI$Theme$spacing.aW, $author$project$UI$Theme$spacing.qk) 50385 ]), 50386 { 50387 gv: $elm$core$Maybe$Just( 50388 A2($author$project$UI$Components$featherIcon, 16, $feathericons$elm_feather$FeatherIcons$plus)), 50389 i6: $author$project$Translations$groupSettingsAddLink(i18n), 50390 e7: $author$project$Page$Group$EditGroupMetadata$AddLink 50391 }) 50392 ])); 50393 }); 50394var $author$project$Page$Group$EditGroupMetadata$view = F4( 50395 function (i18n, _v0, toMsg, _v1) { 50396 var isMember = _v0.nq; 50397 var isArchived = _v0.gA; 50398 var data = _v1; 50399 return A2( 50400 $author$project$Ui$map, 50401 toMsg, 50402 A2( 50403 $author$project$Ui$column, 50404 _List_fromArray( 50405 [ 50406 $author$project$Ui$spacing($author$project$UI$Theme$spacing.i8), 50407 $author$project$Ui$width($author$project$Ui$fill) 50408 ]), 50409 _Utils_ap( 50410 function () { 50411 if (isMember) { 50412 var nameError = function () { 50413 var field = A2( 50414 $dwayne$elm_form$Form$get, 50415 function ($) { 50416 return $.bW; 50417 }, 50418 data.w); 50419 return ($dwayne$elm_field$Field$isInvalid(field) && (data.d_ || $dwayne$elm_field$Field$isDirty(field))) ? $elm$core$Maybe$Just( 50420 $author$project$Translations$fieldRequired(i18n)) : $elm$core$Maybe$Nothing; 50421 }(); 50422 return _List_fromArray( 50423 [ 50424 $author$project$UI$Components$formTextField( 50425 { 50426 gi: nameError, 50427 gv: $elm$core$Maybe$Nothing, 50428 i6: $author$project$Translations$groupSettingsName(i18n), 50429 oq: $author$project$Page$Group$EditGroupMetadata$InputName, 50430 pt: $elm$core$Maybe$Nothing, 50431 hd: true, 50432 q8: $dwayne$elm_field$Field$toRawString( 50433 A2( 50434 $dwayne$elm_form$Form$get, 50435 function ($) { 50436 return $.bW; 50437 }, 50438 data.w)) 50439 }), 50440 $author$project$UI$Components$formTextField( 50441 { 50442 gi: $elm$core$Maybe$Nothing, 50443 gv: $elm$core$Maybe$Nothing, 50444 i6: $author$project$Translations$groupSettingsSubtitle(i18n), 50445 oq: $author$project$Page$Group$EditGroupMetadata$InputSubtitle, 50446 pt: $elm$core$Maybe$Just( 50447 $author$project$Translations$groupSettingsSubtitlePlaceholder(i18n)), 50448 hd: false, 50449 q8: $dwayne$elm_field$Field$toRawString( 50450 A2( 50451 $dwayne$elm_form$Form$get, 50452 function ($) { 50453 return $.cY; 50454 }, 50455 data.w)) 50456 }), 50457 $author$project$UI$Components$formTextField( 50458 { 50459 gi: $elm$core$Maybe$Nothing, 50460 gv: $elm$core$Maybe$Nothing, 50461 i6: $author$project$Translations$groupSettingsDescription(i18n), 50462 oq: $author$project$Page$Group$EditGroupMetadata$InputDescription, 50463 pt: $elm$core$Maybe$Just( 50464 $author$project$Translations$groupSettingsDescriptionPlaceholder(i18n)), 50465 hd: false, 50466 q8: $dwayne$elm_field$Field$toRawString( 50467 A2( 50468 $dwayne$elm_form$Form$get, 50469 function ($) { 50470 return $.eE; 50471 }, 50472 data.w)) 50473 }), 50474 A3($author$project$Page$Group$EditGroupMetadata$linksSection, i18n, data.d_, data.w), 50475 A2( 50476 $author$project$UI$Components$btnPrimary, 50477 _List_Nil, 50478 { 50479 i6: $author$project$Translations$groupSettingsSave(i18n), 50480 e7: $author$project$Page$Group$EditGroupMetadata$Submit 50481 }) 50482 ]); 50483 } else { 50484 return _List_Nil; 50485 } 50486 }(), 50487 _List_fromArray( 50488 [ 50489 A2($author$project$Page$Group$EditGroupMetadata$archiveSection, i18n, isArchived), 50490 A2($author$project$Page$Group$EditGroupMetadata$deleteSection, i18n, data.dc) 50491 ])))); 50492 }); 50493var $author$project$Page$Group$EditMemberMetadata$InputEmail = function (a) { 50494 return {$: 2, a: a}; 50495}; 50496var $author$project$Page$Group$EditMemberMetadata$InputName = function (a) { 50497 return {$: 0, a: a}; 50498}; 50499var $author$project$Page$Group$EditMemberMetadata$InputNotes = function (a) { 50500 return {$: 3, a: a}; 50501}; 50502var $author$project$Page$Group$EditMemberMetadata$InputPayment = F2( 50503 function (a, b) { 50504 return {$: 4, a: a, b: b}; 50505 }); 50506var $author$project$Page$Group$EditMemberMetadata$InputPhone = function (a) { 50507 return {$: 1, a: a}; 50508}; 50509var $author$project$Page$Group$EditMemberMetadata$Submit = {$: 5}; 50510var $feathericons$elm_feather$FeatherIcons$atSign = A2( 50511 $feathericons$elm_feather$FeatherIcons$makeBuilder, 50512 'at-sign', 50513 _List_fromArray( 50514 [ 50515 A2( 50516 $elm$svg$Svg$circle, 50517 _List_fromArray( 50518 [ 50519 $elm$svg$Svg$Attributes$cx('12'), 50520 $elm$svg$Svg$Attributes$cy('12'), 50521 $elm$svg$Svg$Attributes$r('4') 50522 ]), 50523 _List_Nil), 50524 A2( 50525 $elm$svg$Svg$path, 50526 _List_fromArray( 50527 [ 50528 $elm$svg$Svg$Attributes$d('M16 8v5a3 3 0 0 0 6 0v-1a10 10 0 1 0-3.92 7.94') 50529 ]), 50530 _List_Nil) 50531 ])); 50532var $author$project$Translations$fieldInvalidEmail = function (_v0) { 50533 var lang = _v0; 50534 if (!lang) { 50535 return 'Invalid email address.'; 50536 } else { 50537 return 'Adresse email invalide.'; 50538 } 50539}; 50540var $feathericons$elm_feather$FeatherIcons$fileText = A2( 50541 $feathericons$elm_feather$FeatherIcons$makeBuilder, 50542 'file-text', 50543 _List_fromArray( 50544 [ 50545 A2( 50546 $elm$svg$Svg$path, 50547 _List_fromArray( 50548 [ 50549 $elm$svg$Svg$Attributes$d('M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z') 50550 ]), 50551 _List_Nil), 50552 A2( 50553 $elm$svg$Svg$polyline, 50554 _List_fromArray( 50555 [ 50556 $elm$svg$Svg$Attributes$points('14 2 14 8 20 8') 50557 ]), 50558 _List_Nil), 50559 A2( 50560 $elm$svg$Svg$line, 50561 _List_fromArray( 50562 [ 50563 $elm$svg$Svg$Attributes$x1('16'), 50564 $elm$svg$Svg$Attributes$y1('13'), 50565 $elm$svg$Svg$Attributes$x2('8'), 50566 $elm$svg$Svg$Attributes$y2('13') 50567 ]), 50568 _List_Nil), 50569 A2( 50570 $elm$svg$Svg$line, 50571 _List_fromArray( 50572 [ 50573 $elm$svg$Svg$Attributes$x1('16'), 50574 $elm$svg$Svg$Attributes$y1('17'), 50575 $elm$svg$Svg$Attributes$x2('8'), 50576 $elm$svg$Svg$Attributes$y2('17') 50577 ]), 50578 _List_Nil), 50579 A2( 50580 $elm$svg$Svg$polyline, 50581 _List_fromArray( 50582 [ 50583 $elm$svg$Svg$Attributes$points('10 9 9 9 8 9') 50584 ]), 50585 _List_Nil) 50586 ])); 50587var $author$project$Translations$memberMetadataEmail = function (_v0) { 50588 var lang = _v0; 50589 if (!lang) { 50590 return 'Email'; 50591 } else { 50592 return 'Email'; 50593 } 50594}; 50595var $author$project$Translations$memberMetadataNotes = function (_v0) { 50596 var lang = _v0; 50597 if (!lang) { 50598 return 'Notes'; 50599 } else { 50600 return 'Notes'; 50601 } 50602}; 50603var $author$project$Translations$memberMetadataNotesPlaceholder = function (_v0) { 50604 var lang = _v0; 50605 if (!lang) { 50606 return 'Dietary preferences, allergies, etc.'; 50607 } else { 50608 return 'Préférences alimentaires, allergies, etc.'; 50609 } 50610}; 50611var $author$project$Translations$memberMetadataPayment = function (_v0) { 50612 var lang = _v0; 50613 if (!lang) { 50614 return 'Payment Methods'; 50615 } else { 50616 return 'Moyens de paiement'; 50617 } 50618}; 50619var $author$project$Translations$memberMetadataPhone = function (_v0) { 50620 var lang = _v0; 50621 if (!lang) { 50622 return 'Phone'; 50623 } else { 50624 return 'Téléphone'; 50625 } 50626}; 50627var $author$project$Translations$memberMetadataSave = function (_v0) { 50628 var lang = _v0; 50629 if (!lang) { 50630 return 'Save'; 50631 } else { 50632 return 'Enregistrer'; 50633 } 50634}; 50635var $author$project$Translations$memberRenameLabel = function (_v0) { 50636 var lang = _v0; 50637 if (!lang) { 50638 return 'Name'; 50639 } else { 50640 return 'Nom'; 50641 } 50642}; 50643var $feathericons$elm_feather$FeatherIcons$phone = A2( 50644 $feathericons$elm_feather$FeatherIcons$makeBuilder, 50645 'phone', 50646 _List_fromArray( 50647 [ 50648 A2( 50649 $elm$svg$Svg$path, 50650 _List_fromArray( 50651 [ 50652 $elm$svg$Svg$Attributes$d('M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7A2 2 0 0 1 22 16.92z') 50653 ]), 50654 _List_Nil) 50655 ])); 50656var $feathericons$elm_feather$FeatherIcons$creditCard = A2( 50657 $feathericons$elm_feather$FeatherIcons$makeBuilder, 50658 'credit-card', 50659 _List_fromArray( 50660 [ 50661 A2( 50662 $elm$svg$Svg$rect, 50663 _List_fromArray( 50664 [ 50665 $elm$svg$Svg$Attributes$x('1'), 50666 $elm$svg$Svg$Attributes$y('4'), 50667 $elm$svg$Svg$Attributes$width('22'), 50668 $elm$svg$Svg$Attributes$height('16'), 50669 $elm$svg$Svg$Attributes$rx('2'), 50670 $elm$svg$Svg$Attributes$ry('2') 50671 ]), 50672 _List_Nil), 50673 A2( 50674 $elm$svg$Svg$line, 50675 _List_fromArray( 50676 [ 50677 $elm$svg$Svg$Attributes$x1('1'), 50678 $elm$svg$Svg$Attributes$y1('10'), 50679 $elm$svg$Svg$Attributes$x2('23'), 50680 $elm$svg$Svg$Attributes$y2('10') 50681 ]), 50682 _List_Nil) 50683 ])); 50684var $feathericons$elm_feather$FeatherIcons$dollarSign = A2( 50685 $feathericons$elm_feather$FeatherIcons$makeBuilder, 50686 'dollar-sign', 50687 _List_fromArray( 50688 [ 50689 A2( 50690 $elm$svg$Svg$line, 50691 _List_fromArray( 50692 [ 50693 $elm$svg$Svg$Attributes$x1('12'), 50694 $elm$svg$Svg$Attributes$y1('1'), 50695 $elm$svg$Svg$Attributes$x2('12'), 50696 $elm$svg$Svg$Attributes$y2('23') 50697 ]), 50698 _List_Nil), 50699 A2( 50700 $elm$svg$Svg$path, 50701 _List_fromArray( 50702 [ 50703 $elm$svg$Svg$Attributes$d('M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6') 50704 ]), 50705 _List_Nil) 50706 ])); 50707var $author$project$Translations$memberMetadataAda = function (_v0) { 50708 var lang = _v0; 50709 if (!lang) { 50710 return 'Cardano address'; 50711 } else { 50712 return 'Adresse Cardano'; 50713 } 50714}; 50715var $author$project$Translations$memberMetadataBtc = function (_v0) { 50716 var lang = _v0; 50717 if (!lang) { 50718 return 'Bitcoin address'; 50719 } else { 50720 return 'Adresse Bitcoin'; 50721 } 50722}; 50723var $author$project$Translations$memberMetadataCashapp = function (_v0) { 50724 var lang = _v0; 50725 if (!lang) { 50726 return 'Cash App'; 50727 } else { 50728 return 'Cash App'; 50729 } 50730}; 50731var $author$project$Translations$memberMetadataIban = function (_v0) { 50732 var lang = _v0; 50733 if (!lang) { 50734 return 'IBAN'; 50735 } else { 50736 return 'IBAN'; 50737 } 50738}; 50739var $author$project$Translations$memberMetadataLydia = function (_v0) { 50740 var lang = _v0; 50741 if (!lang) { 50742 return 'Lydia'; 50743 } else { 50744 return 'Lydia'; 50745 } 50746}; 50747var $author$project$Translations$memberMetadataPaypal = function (_v0) { 50748 var lang = _v0; 50749 if (!lang) { 50750 return 'PayPal'; 50751 } else { 50752 return 'PayPal'; 50753 } 50754}; 50755var $author$project$Translations$memberMetadataRevolut = function (_v0) { 50756 var lang = _v0; 50757 if (!lang) { 50758 return 'Revolut'; 50759 } else { 50760 return 'Revolut'; 50761 } 50762}; 50763var $author$project$Translations$memberMetadataVenmo = function (_v0) { 50764 var lang = _v0; 50765 if (!lang) { 50766 return 'Venmo'; 50767 } else { 50768 return 'Venmo'; 50769 } 50770};
50771var $author$project$Translations$memberMetadataWero = function (_v0) { 50772 var lang = _v0; 50773 if (!lang) { 50774 return 'Wero'; 50775 } else { 50776 return 'Wero'; 50777 } 50778}; 50779var $author$project$Translations$memberMetadataWise = function (_v0) { 50780 var lang = _v0; 50781 if (!lang) { 50782 return 'Wise'; 50783 } else { 50784 return 'Wise'; 50785 } 50786}; 50787var $author$project$UI$PaymentMethods$normalizeHandle = F2( 50788 function (prefix, value) { 50789 var trimmed = $elm$core$String$trim(value); 50790 return A2($elm$core$String$startsWith, prefix, trimmed) ? trimmed : ((A2($elm$core$String$startsWith, '@', trimmed) || A2($elm$core$String$startsWith, '$', trimmed)) ? _Utils_ap( 50791 prefix, 50792 A2($elm$core$String$dropLeft, 1, trimmed)) : _Utils_ap(prefix, trimmed)); 50793 }); 50794var $feathericons$elm_feather$FeatherIcons$smartphone = A2( 50795 $feathericons$elm_feather$FeatherIcons$makeBuilder, 50796 'smartphone', 50797 _List_fromArray( 50798 [ 50799 A2( 50800 $elm$svg$Svg$rect, 50801 _List_fromArray( 50802 [ 50803 $elm$svg$Svg$Attributes$x('5'), 50804 $elm$svg$Svg$Attributes$y('2'), 50805 $elm$svg$Svg$Attributes$width('14'), 50806 $elm$svg$Svg$Attributes$height('20'), 50807 $elm$svg$Svg$Attributes$rx('2'), 50808 $elm$svg$Svg$Attributes$ry('2') 50809 ]), 50810 _List_Nil), 50811 A2( 50812 $elm$svg$Svg$line, 50813 _List_fromArray( 50814 [ 50815 $elm$svg$Svg$Attributes$x1('12'), 50816 $elm$svg$Svg$Attributes$y1('18'), 50817 $elm$svg$Svg$Attributes$x2('12.01'), 50818 $elm$svg$Svg$Attributes$y2('18') 50819 ]), 50820 _List_Nil) 50821 ])); 50822var $author$project$UI$PaymentMethods$presentation = function (method) { 50823 switch (method) { 50824 case 0: 50825 return {mm: 'iban', gv: $feathericons$elm_feather$FeatherIcons$creditCard, i6: $author$project$Translations$memberMetadataIban, pt: 'FR76 1234 5678 9012 3456 7890 123', kS: $elm$core$Maybe$Nothing}; 50826 case 1: 50827 return {mm: 'wero', gv: $feathericons$elm_feather$FeatherIcons$smartphone, i6: $author$project$Translations$memberMetadataWero, pt: '+33 6 12 34 56 78', kS: $elm$core$Maybe$Nothing}; 50828 case 2: 50829 return { 50830 mm: 'lydia', 50831 gv: $feathericons$elm_feather$FeatherIcons$dollarSign, 50832 i6: $author$project$Translations$memberMetadataLydia, 50833 pt: 'antoniop6hcr', 50834 kS: $elm$core$Maybe$Just( 50835 $author$project$UI$PaymentMethods$normalizeHandle('https://pay.lydia.me/l?t=')) 50836 }; 50837 case 3: 50838 return { 50839 mm: 'revolut', 50840 gv: $feathericons$elm_feather$FeatherIcons$dollarSign, 50841 i6: $author$project$Translations$memberMetadataRevolut, 50842 pt: '@username', 50843 kS: $elm$core$Maybe$Just( 50844 $author$project$UI$PaymentMethods$normalizeHandle('https://revolut.me/')) 50845 }; 50846 case 4: 50847 return { 50848 mm: 'wise', 50849 gv: $feathericons$elm_feather$FeatherIcons$dollarSign, 50850 i6: $author$project$Translations$memberMetadataWise, 50851 pt: '@username', 50852 kS: $elm$core$Maybe$Just( 50853 $author$project$UI$PaymentMethods$normalizeHandle('https://wise.com/pay/me/')) 50854 }; 50855 case 5: 50856 return { 50857 mm: 'paypal', 50858 gv: $feathericons$elm_feather$FeatherIcons$dollarSign, 50859 i6: $author$project$Translations$memberMetadataPaypal, 50860 pt: 'rogerfed', 50861 kS: $elm$core$Maybe$Just( 50862 $author$project$UI$PaymentMethods$normalizeHandle('https://paypal.me/')) 50863 }; 50864 case 6: 50865 return { 50866 mm: 'venmo', 50867 gv: $feathericons$elm_feather$FeatherIcons$dollarSign, 50868 i6: $author$project$Translations$memberMetadataVenmo, 50869 pt: '@username', 50870 kS: $elm$core$Maybe$Just( 50871 $author$project$UI$PaymentMethods$normalizeHandle('https://venmo.com/')) 50872 }; 50873 case 7: 50874 return { 50875 mm: 'cashapp', 50876 gv: $feathericons$elm_feather$FeatherIcons$dollarSign, 50877 i6: $author$project$Translations$memberMetadataCashapp, 50878 pt: '$cashtag', 50879 kS: $elm$core$Maybe$Just( 50880 $author$project$UI$PaymentMethods$normalizeHandle('https://cash.app/$')) 50881 }; 50882 case 8: 50883 return { 50884 mm: 'btc', 50885 gv: $feathericons$elm_feather$FeatherIcons$key, 50886 i6: $author$project$Translations$memberMetadataBtc, 50887 pt: 'bc1q...', 50888 kS: $elm$core$Maybe$Just( 50889 function (value) {
50890 return 'bitcoin:' + value; 50891 }) 50892 }; 50893 default: 50894 return {mm: 'ada', gv: $feathericons$elm_feather$FeatherIcons$key, i6: $author$project$Translations$memberMetadataAda, pt: 'addr1...', kS: $elm$core$Maybe$Nothing}; 50895 } 50896}; 50897var $feathericons$elm_feather$FeatherIcons$user = A2( 50898 $feathericons$elm_feather$FeatherIcons$makeBuilder, 50899 'user', 50900 _List_fromArray( 50901 [ 50902 A2( 50903 $elm$svg$Svg$path, 50904 _List_fromArray( 50905 [ 50906 $elm$svg$Svg$Attributes$d('M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2') 50907 ]), 50908 _List_Nil), 50909 A2( 50910 $elm$svg$Svg$circle, 50911 _List_fromArray( 50912 [ 50913 $elm$svg$Svg$Attributes$cx('12'), 50914 $elm$svg$Svg$Attributes$cy('7'), 50915 $elm$svg$Svg$Attributes$r('4') 50916 ]), 50917 _List_Nil) 50918 ])); 50919var $author$project$Page$Group$EditMemberMetadata$ApplyFill = {$: 10}; 50920var $author$project$Translations$editMetadataProfileFillApply = function (_v0) { 50921 var lang = _v0; 50922 if (!lang) { 50923 return 'Fill selected'; 50924 } else { 50925 return 'Pré-remplir la sélection'; 50926 } 50927}; 50928var $author$project$Translations$editMetadataProfileFillDescription = function (_v0) { 50929 var lang = _v0; 50930 if (!lang) { 50931 return 'Pick which fields to copy into the form. Nothing leaves this device until you submit.'; 50932 } else { 50933 return 'Choisis les champs à copier dans le formulaire. Rien ne quitte cet appareil tant que tu n\'as pas validé.'; 50934 } 50935}; 50936var $author$project$Translations$editMetadataProfileFillEmpty = function (_v0) { 50937 var lang = _v0; 50938 if (!lang) { 50939 return 'Your local profile is empty.'; 50940 } else { 50941 return 'Ton profil local est vide.'; 50942 } 50943}; 50944var $author$project$Translations$editMetadataProfileFillTitle = function (_v0) { 50945 var lang = _v0; 50946 if (!lang) { 50947 return 'Fill from local profile'; 50948 } else { 50949 return 'Pré-remplir depuis le profil local'; 50950 } 50951}; 50952var $author$project$Page$Group$EditMemberMetadata$ToggleField = function (a) { 50953 return {$: 9, a: a}; 50954}; 50955var $author$project$Ui$Input$blue = A3($author$project$Ui$rgb, 59, 153, 252); 50956var $author$project$Ui$borderWith = function (options) { 50957 return A2( 50958 $author$project$Internal$Model2$style, 50959 'border-width', 50960 ($elm$core$String$fromInt(options.qW) + 'px ') + (($elm$core$String$fromInt(options.pW) + 'px ') + (($elm$core$String$fromInt(options.lI) + 'px ') + ($elm$core$String$fromInt(options.nz) + 'px')))); 50961}; 50962var $author$project$Ui$move = function (pos) { 50963 return A2( 50964 $author$project$Internal$Model2$style, 50965 'translate', 50966 ($elm$core$String$fromInt(pos.rm) + 'px ') + (($elm$core$String$fromInt(pos.k0) + 'px ') + ($elm$core$String$fromInt(pos.k1) + 'px'))); 50967}; 50968var $author$project$Ui$rotate = function (_v0) { 50969 var rads = _v0; 50970 return A2( 50971 $author$project$Internal$Model2$style, 50972 'rotate', 50973 $elm$core$String$fromFloat(rads) + 'rad'); 50974}; 50975var $author$project$Ui$up = function (y) { 50976 return {rm: 0, k0: -y, k1: 0}; 50977}; 50978var $author$project$Ui$Input$defaultCheckbox = function (checked) { 50979 return A2( 50980 $author$project$Ui$el, 50981 _List_fromArray( 50982 [ 50983 $author$project$Ui$width( 50984 $author$project$Ui$px(14)), 50985 $author$project$Ui$height( 50986 $author$project$Ui$px(14)), 50987 $author$project$Ui$Font$color($author$project$Ui$Input$white), 50988 $author$project$Ui$Font$size(9), 50989 $author$project$Ui$Font$center, 50990 $author$project$Ui$centerY, 50991 $author$project$Ui$rounded(3), 50992 $author$project$Ui$borderColor( 50993 checked ? A3($author$project$Ui$rgb, 59, 153, 252) : A3($author$project$Ui$rgb, 211, 211, 211)), 50994 $author$project$Ui$border( 50995 checked ? 0 : 1), 50996 checked ? $author$project$Ui$noAttr : $author$project$Ui$Shadow$shadows( 50997 _List_fromArray( 50998 [ 50999 { 51000 h1: 1, 51001 ic: A3($author$project$Ui$rgb, 238, 238, 238), 51002 dW: 1, 51003 rm: 0, 51004 k0: 0 51005 } 51006 ])), 51007 $author$project$Ui$background( 51008 checked ? $author$project$Ui$Input$blue : $author$project$Ui$Input$white) 51009 ]), 51010 checked ? A2( 51011 $author$project$Ui$el, 51012 _List_fromArray( 51013 [ 51014 $author$project$Ui$borderWith( 51015 {lI: 2, nz: 2, pW: 0, qW: 0}), 51016 $author$project$Ui$borderColor($author$project$Ui$Input$white), 51017 $author$project$Ui$height( 51018 $author$project$Ui$px(6)), 51019 $author$project$Ui$width( 51020 $author$project$Ui$px(9)), 51021 $author$project$Ui$rotate( 51022 $author$project$Ui$turns(1 - 0.125)), 51023 $author$project$Ui$centerX, 51024 $author$project$Ui$centerY, 51025 $author$project$Ui$move( 51026 $author$project$Ui$up(1)) 51027 ]), 51028 $author$project$Ui$none) : $author$project$Ui$none); 51029}; 51030var $author$project$Ui$Input$enter = 'Enter'; 51031var $author$project$Ui$Input$onKeyLookup2 = function (lookup) { 51032 var decode = function (code) { 51033 var _v0 = lookup(code); 51034 if (_v0.$ === 1) { 51035 return $elm$json$Json$Decode$fail('No key matched'); 51036 } else { 51037 var msg = _v0.a; 51038 return $elm$json$Json$Decode$succeed(msg); 51039 } 51040 }; 51041 var isKey = A2( 51042 $elm$json$Json$Decode$andThen, 51043 decode, 51044 A2($elm$json$Json$Decode$field, 'key', $elm$json$Json$Decode$string)); 51045 return $author$project$Internal$Model2$attribute( 51046 A2($elm$html$Html$Events$on, 'keyup', isKey)); 51047}; 51048var $author$project$Ui$Input$space = ' '; 51049var $elm$html$Html$Attributes$tabindex = function (n) { 51050 return A2( 51051 _VirtualDom_attribute, 51052 'tabIndex', 51053 $elm$core$String$fromInt(n)); 51054}; 51055var $author$project$Ui$Input$checkbox = F2( 51056 function (attrs, options) { 51057 var input = A4( 51058 $author$project$Internal$Model2$element, 51059 $author$project$Internal$Model2$NodeAsInput, 51060 2, 51061 _Utils_ap( 51062 _List_fromArray( 51063 [ 51064 $author$project$Internal$Model2$attribute( 51065 $elm$html$Html$Attributes$type_('checkbox')), 51066 $author$project$Internal$Model2$attribute( 51067 A2( 51068 $elm$html$Html$Attributes$attribute, 51069 'aria-checked', 51070 options.lQ ? 'true' : 'false')), 51071 $author$project$Internal$Model2$attribute( 51072 $elm$html$Html$Attributes$class($author$project$Internal$Style$Generated$classes.nl)), 51073 $author$project$Ui$Input$labelAttribute(options.i6), 51074 $author$project$Internal$Model2$attribute( 51075 $elm$html$Html$Events$onClick( 51076 options.oq(!options.lQ))), 51077 $author$project$Ui$Input$onKeyLookup2( 51078 function (code) { 51079 return _Utils_eq(code, $author$project$Ui$Input$enter) ? $elm$core$Maybe$Just( 51080 options.oq(!options.lQ)) : (_Utils_eq(code, $author$project$Ui$Input$space) ? $elm$core$Maybe$Just( 51081 options.oq(!options.lQ)) : $elm$core$Maybe$Nothing); 51082 }), 51083 $author$project$Internal$Model2$attribute( 51084 $elm$html$Html$Attributes$tabindex(0)), 51085 $author$project$Ui$pointer, 51086 $author$project$Ui$width($author$project$Ui$fill), 51087 $author$project$Ui$height($author$project$Ui$fill) 51088 ]), 51089 attrs), 51090 _List_Nil); 51091 var icon = function () { 51092 var viewIcon = A2($elm$core$Maybe$withDefault, $author$project$Ui$Input$defaultCheckbox, options.gv); 51093 return viewIcon(options.lQ); 51094 }(); 51095 return A2( 51096 $author$project$Ui$el, 51097 _List_fromArray( 51098 [ 51099 $author$project$Ui$inFront(input), 51100 $author$project$Ui$width($author$project$Ui$shrink), 51101 $author$project$Ui$height($author$project$Ui$shrink) 51102 ]), 51103 icon); 51104 }); 51105var $author$project$Page$Group$EditMemberMetadata$checkboxBox = function (selected) { 51106 var _v0 = selected ? _Utils_Tuple2( 51107 $author$project$UI$Theme$primary.kl, 51108 A2( 51109 $author$project$Ui$el, 51110 _List_fromArray( 51111 [ 51112 $author$project$Ui$centerX, 51113 $author$project$Ui$centerY, 51114 $author$project$Ui$Font$color($author$project$UI$Theme$base.km), 51115 $author$project$Ui$Font$size($author$project$UI$Theme$font.qk) 51116 ]), 51117 $author$project$Ui$text('â'))) : _Utils_Tuple2($author$project$UI$Theme$base.kl, $author$project$Ui$none); 51118 var bg = _v0.a; 51119 var content = _v0.b; 51120 return A2( 51121 $author$project$Ui$el, 51122 _List_fromArray( 51123 [ 51124 $author$project$Ui$width( 51125 $author$project$Ui$px(22)), 51126 $author$project$Ui$height( 51127 $author$project$Ui$px(22)),
51128 $author$project$Ui$rounded($author$project$UI$Theme$radius.qk), 51129 $author$project$Ui$background(bg), 51130 $author$project$Ui$border(1), 51131 $author$project$Ui$borderColor($author$project$UI$Theme$base.k4) 51132 ]), 51133 content); 51134}; 51135var $author$project$Page$Group$EditMemberMetadata$fieldDomId = function (field) { 51136 switch (field.$) { 51137 case 0: 51138 return 'phone'; 51139 case 1: 51140 return 'email'; 51141 case 2: 51142 return 'notes'; 51143 default: 51144 var method = field.a; 51145 return $author$project$UI$PaymentMethods$presentation(method).mm; 51146 } 51147}; 51148var $author$project$Page$Group$EditMemberMetadata$fieldLabel = F2( 51149 function (i18n, field) { 51150 switch (field.$) { 51151 case 0: 51152 return $author$project$Translations$memberMetadataPhone(i18n); 51153 case 1: 51154 return $author$project$Translations$memberMetadataEmail(i18n); 51155 case 2: 51156 return $author$project$Translations$memberMetadataNotes(i18n); 51157 default: 51158 var method = field.a; 51159 return $author$project$UI$PaymentMethods$presentation(method).i6(i18n); 51160 } 51161 }); 51162var $author$project$Ui$Input$LabelFromId = function (a) { 51163 return {$: 1, a: a}; 51164}; 51165var $author$project$Internal$Model2$NodeAsLabel = {$: 12}; 51166var $elm$html$Html$Attributes$for = $elm$html$Html$Attributes$stringProperty('htmlFor'); 51167var $author$project$Ui$Input$label = F3( 51168 function (id, attrs, labelElement) { 51169 return { 51170 mr: A4( 51171 $author$project$Internal$Model2$element, 51172 $author$project$Internal$Model2$NodeAsLabel, 51173 1, 51174 A2( 51175 $elm$core$List$cons, 51176 $author$project$Ui$htmlAttribute( 51177 $elm$html$Html$Attributes$for(id)), 51178 A2( 51179 $elm$core$List$cons, 51180 $author$project$Ui$width($author$project$Ui$fill), 51181 attrs)), 51182 _List_fromArray( 51183 [labelElement])), 51184 m9: $author$project$Ui$Input$LabelFromId(id) 51185 }; 51186 }); 51187var $author$project$Page$Group$EditMemberMetadata$fieldRow = F4( 51188 function (i18n, field, value, selected) { 51189 var label = A3( 51190 $author$project$Ui$Input$label, 51191 'edit-meta-profile-' + $author$project$Page$Group$EditMemberMetadata$fieldDomId(field), 51192 _List_fromArray( 51193 [ 51194 $author$project$Ui$width($author$project$Ui$fill) 51195 ]), 51196 A2( 51197 $author$project$Ui$column, 51198 _List_fromArray( 51199 [ 51200 $author$project$Ui$spacing($author$project$UI$Theme$spacing.bb), 51201 $author$project$Ui$width($author$project$Ui$fill) 51202 ]), 51203 _List_fromArray( 51204 [ 51205 A2( 51206 $author$project$Ui$el, 51207 _List_fromArray( 51208 [ 51209 $author$project$Ui$Font$size($author$project$UI$Theme$font.qk), 51210 $author$project$Ui$Font$weight($author$project$UI$Theme$fontWeight.lD) 51211 ]), 51212 $author$project$Ui$text( 51213 A2($author$project$Page$Group$EditMemberMetadata$fieldLabel, i18n, field))), 51214 A2( 51215 $author$project$Ui$el, 51216 _List_fromArray( 51217 [ 51218 $author$project$Ui$Font$size($author$project$UI$Theme$font.qk), 51219 $author$project$Ui$Font$color($author$project$UI$Theme$base.aM) 51220 ]), 51221 $author$project$Ui$text(value)) 51222 ]))); 51223 return A2( 51224 $author$project$Ui$row, 51225 _List_fromArray( 51226 [ 51227 $author$project$Ui$spacing($author$project$UI$Theme$spacing.qk), 51228 $author$project$Ui$width($author$project$Ui$fill) 51229 ]), 51230 _List_fromArray( 51231 [ 51232 A2( 51233 $author$project$Ui$Input$checkbox, 51234 _List_Nil, 51235 { 51236 lQ: selected, 51237 gv: $elm$core$Maybe$Just($author$project$Page$Group$EditMemberMetadata$checkboxBox), 51238 i6: label.m9, 51239 oq: function (_v0) { 51240 return $author$project$Page$Group$EditMemberMetadata$ToggleField(field); 51241 } 51242 }), 51243 label.mr 51244 ])); 51245 }); 51246var $author$project$Page$Group$EditMemberMetadata$ClosePanel = {$: 8}; 51247var $author$project$Translations$editMetadataProfileCancel = function (_v0) { 51248 var lang = _v0; 51249 if (!lang) { 51250 return 'Cancel'; 51251 } else { 51252 return 'Annuler'; 51253 } 51254}; 51255var $author$project$Page$Group$EditMemberMetadata$panelShell = F2( 51256 function (i18n, cfg) { 51257 return A2( 51258 $author$project$Ui$column, 51259 _List_fromArray( 51260 [ 51261 $author$project$Ui$spacing($author$project$UI$Theme$spacing.aW), 51262 $author$project$Ui$width($author$project$Ui$fill), 51263 $author$project$Ui$padding($author$project$UI$Theme$spacing.i8), 51264 $author$project$Ui$background($author$project$UI$Theme$base.k3),
51265 $author$project$Ui$rounded($author$project$UI$Theme$radius.aW) 51266 ]), 51267 _List_fromArray( 51268 [ 51269 A2( 51270 $author$project$Ui$el, 51271 _List_fromArray( 51272 [ 51273 $author$project$Ui$Font$size($author$project$UI$Theme$font.aW), 51274 $author$project$Ui$Font$weight($author$project$UI$Theme$fontWeight.lD) 51275 ]), 51276 $author$project$Ui$text(cfg.ba)), 51277 A2( 51278 $author$project$Ui$el, 51279 _List_fromArray( 51280 [ 51281 $author$project$Ui$Font$size($author$project$UI$Theme$font.qk), 51282 $author$project$Ui$Font$color($author$project$UI$Theme$base.aM) 51283 ]), 51284 $author$project$Ui$text(cfg.eE)), 51285 cfg.fY, 51286 A2( 51287 $author$project$Ui$row, 51288 _List_fromArray( 51289 [ 51290 $author$project$Ui$spacing($author$project$UI$Theme$spacing.qk), 51291 $author$project$Ui$width($author$project$Ui$fill) 51292 ]), 51293 _List_fromArray( 51294 [ 51295 A2( 51296 $author$project$UI$Components$btnOutline, 51297 _List_Nil, 51298 { 51299 gv: $elm$core$Maybe$Nothing, 51300 i6: $author$project$Translations$editMetadataProfileCancel(i18n), 51301 e7: $author$project$Page$Group$EditMemberMetadata$ClosePanel 51302 }), 51303 cfg.fR ? A2( 51304 $author$project$UI$Components$btnPrimary, 51305 _List_Nil, 51306 {i6: cfg.fS, e7: cfg.gX}) : $author$project$Ui$none 51307 ])) 51308 ])); 51309 }); 51310var $author$project$Page$Group$EditMemberMetadata$viewFillPanel = F3( 51311 function (i18n, profile, sel) { 51312 var rows = A2( 51313 $elm$core$List$filterMap, 51314 function (field) { 51315 var _v0 = A2($author$project$Page$Group$EditMemberMetadata$profileValue, field, profile); 51316 if (!_v0.$) { 51317 var value = _v0.a; 51318 return $elm$core$Maybe$Just( 51319 A4( 51320 $author$project$Page$Group$EditMemberMetadata$fieldRow, 51321 i18n, 51322 field, 51323 value, 51324 A2($elm$core$List$member, field, sel))); 51325 } else { 51326 return $elm$core$Maybe$Nothing; 51327 } 51328 }, 51329 $author$project$Page$Group$EditMemberMetadata$allFields); 51330 var body = $elm$core$List$isEmpty(rows) ? A2( 51331 $author$project$Ui$el, 51332 _List_fromArray( 51333 [ 51334 $author$project$Ui$Font$color($author$project$UI$Theme$base.aM), 51335 $author$project$Ui$Font$size($author$project$UI$Theme$font.qk) 51336 ]), 51337 $author$project$Ui$text( 51338 $author$project$Translations$editMetadataProfileFillEmpty(i18n))) : A2( 51339 $author$project$Ui$column, 51340 _List_fromArray( 51341 [ 51342 $author$project$Ui$spacing($author$project$UI$Theme$spacing.qk), 51343 $author$project$Ui$width($author$project$Ui$fill) 51344 ]), 51345 rows); 51346 return A2( 51347 $author$project$Page$Group$EditMemberMetadata$panelShell, 51348 i18n, 51349 { 51350 fR: (!$elm$core$List$isEmpty(rows)) && (!$elm$core$List$isEmpty(sel)), 51351 fS: $author$project$Translations$editMetadataProfileFillApply(i18n), 51352 fY: body, 51353 eE: $author$project$Translations$editMetadataProfileFillDescription(i18n), 51354 gX: $author$project$Page$Group$EditMemberMetadata$ApplyFill, 51355 ba: $author$project$Translations$editMetadataProfileFillTitle(i18n) 51356 }); 51357 }); 51358var $author$project$Page$Group$EditMemberMetadata$OpenFillPanel = {$: 6}; 51359var $author$project$Page$Group$EditMemberMetadata$OpenSavePanel = {$: 7}; 51360var $feathericons$elm_feather$FeatherIcons$download = A2( 51361 $feathericons$elm_feather$FeatherIcons$makeBuilder, 51362 'download', 51363 _List_fromArray( 51364 [ 51365 A2( 51366 $elm$svg$Svg$path, 51367 _List_fromArray( 51368 [ 51369 $elm$svg$Svg$Attributes$d('M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4') 51370 ]), 51371 _List_Nil), 51372 A2( 51373 $elm$svg$Svg$polyline, 51374 _List_fromArray( 51375 [ 51376 $elm$svg$Svg$Attributes$points('7 10 12 15 17 10') 51377 ]), 51378 _List_Nil), 51379 A2( 51380 $elm$svg$Svg$line, 51381 _List_fromArray( 51382 [ 51383 $elm$svg$Svg$Attributes$x1('12'), 51384 $elm$svg$Svg$Attributes$y1('15'), 51385 $elm$svg$Svg$Attributes$x2('12'), 51386 $elm$svg$Svg$Attributes$y2('3') 51387 ]), 51388 _List_Nil) 51389 ])); 51390var $author$project$Translations$editMetadataProfileFillBtn = function (_v0) { 51391 var lang = _v0; 51392 if (!lang) { 51393 return 'Fill from local profile'; 51394 } else { 51395 return 'Pré-remplir depuis le profil local'; 51396 } 51397}; 51398var $author$project$Translations$editMetadataProfileSaveBtn = function (_v0) { 51399 var lang = _v0; 51400 if (!lang) { 51401 return 'Save to local profile'; 51402 } else { 51403 return 'Enregistrer dans le profil local'; 51404 } 51405}; 51406var $feathericons$elm_feather$FeatherIcons$upload = A2( 51407 $feathericons$elm_feather$FeatherIcons$makeBuilder, 51408 'upload', 51409 _List_fromArray( 51410 [ 51411 A2( 51412 $elm$svg$Svg$path, 51413 _List_fromArray( 51414 [ 51415 $elm$svg$Svg$Attributes$d('M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4') 51416 ]), 51417 _List_Nil), 51418 A2( 51419 $elm$svg$Svg$polyline, 51420 _List_fromArray( 51421 [ 51422 $elm$svg$Svg$Attributes$points('17 8 12 3 7 8') 51423 ]), 51424 _List_Nil), 51425 A2( 51426 $elm$svg$Svg$line, 51427 _List_fromArray( 51428 [ 51429 $elm$svg$Svg$Attributes$x1('12'), 51430 $elm$svg$Svg$Attributes$y1('3'), 51431 $elm$svg$Svg$Attributes$x2('12'), 51432 $elm$svg$Svg$Attributes$y2('15') 51433 ]), 51434 _List_Nil) 51435 ])); 51436var $author$project$Page$Group$EditMemberMetadata$viewProfileButtons = F2( 51437 function (i18n, profile) { 51438 var profileEmpty = _Utils_eq(profile, $author$project$Domain$Member$emptyMetadata); 51439 var fillBtn = profileEmpty ? $author$project$Ui$none : A2( 51440 $author$project$UI$Components$btnOutline, 51441 _List_Nil, 51442 { 51443 gv: $elm$core$Maybe$Just( 51444 $author$project$Ui$html( 51445 A2( 51446 $feathericons$elm_feather$FeatherIcons$toHtml, 51447 _List_Nil, 51448 A2($feathericons$elm_feather$FeatherIcons$withSize, 16, $feathericons$elm_feather$FeatherIcons$upload)))), 51449 i6: $author$project$Translations$editMetadataProfileFillBtn(i18n), 51450 e7: $author$project$Page$Group$EditMemberMetadata$OpenFillPanel 51451 }); 51452 return A2( 51453 $author$project$Ui$column, 51454 _List_fromArray( 51455 [ 51456 $author$project$Ui$spacing($author$project$UI$Theme$spacing.qk), 51457 $author$project$Ui$width($author$project$Ui$fill) 51458 ]), 51459 _List_fromArray( 51460 [ 51461 fillBtn, 51462 A2( 51463 $author$project$UI$Components$btnOutline, 51464 _List_Nil, 51465 { 51466 gv: $elm$core$Maybe$Just( 51467 $author$project$Ui$html( 51468 A2( 51469 $feathericons$elm_feather$FeatherIcons$toHtml, 51470 _List_Nil, 51471 A2($feathericons$elm_feather$FeatherIcons$withSize, 16, $feathericons$elm_feather$FeatherIcons$download)))), 51472 i6: $author$project$Translations$editMetadataProfileSaveBtn(i18n), 51473 e7: $author$project$Page$Group$EditMemberMetadata$OpenSavePanel 51474 }) 51475 ])); 51476 }); 51477var $author$project$Page$Group$EditMemberMetadata$ApplySave = {$: 11}; 51478var $author$project$Translations$editMetadataProfileSaveApply = function (_v0) { 51479 var lang = _v0; 51480 if (!lang) { 51481 return 'Save selected'; 51482 } else { 51483 return 'Enregistrer la sélection'; 51484 } 51485}; 51486var $author$project$Translations$editMetadataProfileSaveDescription = function (_v0) { 51487 var lang = _v0; 51488 if (!lang) { 51489 return 'Pick which fields to remember on this device. Unselected fields keep their previously saved value.'; 51490 } else { 51491 return 'Choisis les champs à mémoriser sur cet appareil. Les champs non cochés gardent leur valeur précédente.'; 51492 } 51493}; 51494var $author$project$Translations$editMetadataProfileSaveEmpty = function (_v0) { 51495 var lang = _v0; 51496 if (!lang) { 51497 return 'Nothing to save: fill in some fields first.'; 51498 } else { 51499 return 'Rien à enregistrer : remplis d\'abord quelques champs.'; 51500 } 51501}; 51502var $author$project$Translations$editMetadataProfileSaveTitle = function (_v0) { 51503 var lang = _v0; 51504 if (!lang) { 51505 return 'Save to local profile'; 51506 } else { 51507 return 'Enregistrer dans le profil local'; 51508 } 51509}; 51510var $author$project$Page$Group$EditMemberMetadata$viewSavePanel = F3( 51511 function (i18n, form, sel) { 51512 var rows = A2( 51513 $elm$core$List$filterMap, 51514 function (field) { 51515 var value = $elm$core$String$trim( 51516 A2($author$project$Page$Group$EditMemberMetadata$formValue, field, form)); 51517 return $elm$core$String$isEmpty(value) ? $elm$core$Maybe$Nothing : $elm$core$Maybe$Just( 51518 A4( 51519 $author$project$Page$Group$EditMemberMetadata$fieldRow, 51520 i18n, 51521 field, 51522 value, 51523 A2($elm$core$List$member, field, sel))); 51524 }, 51525 $author$project$Page$Group$EditMemberMetadata$allFields); 51526 var body = $elm$core$List$isEmpty(rows) ? A2( 51527 $author$project$Ui$el, 51528 _List_fromArray( 51529 [ 51530 $author$project$Ui$Font$color($author$project$UI$Theme$base.aM), 51531 $author$project$Ui$Font$size($author$project$UI$Theme$font.qk) 51532 ]), 51533 $author$project$Ui$text( 51534 $author$project$Translations$editMetadataProfileSaveEmpty(i18n))) : A2( 51535 $author$project$Ui$column, 51536 _List_fromArray( 51537 [ 51538 $author$project$Ui$spacing($author$project$UI$Theme$spacing.qk), 51539 $author$project$Ui$width($author$project$Ui$fill) 51540 ]), 51541 rows); 51542 return A2( 51543 $author$project$Page$Group$EditMemberMetadata$panelShell, 51544 i18n, 51545 { 51546 fR: (!$elm$core$List$isEmpty(rows)) && (!$elm$core$List$isEmpty(sel)), 51547 fS: $author$project$Translations$editMetadataProfileSaveApply(i18n), 51548 fY: body, 51549 eE: $author$project$Translations$editMetadataProfileSaveDescription(i18n), 51550 gX: $author$project$Page$Group$EditMemberMetadata$ApplySave, 51551 ba: $author$project$Translations$editMetadataProfileSaveTitle(i18n) 51552 }); 51553 }); 51554var $author$project$Page$Group$EditMemberMetadata$viewProfileSection = F3( 51555 function (i18n, profile, data) { 51556 var _v0 = data.au; 51557 switch (_v0.$) { 51558 case 0: 51559 return A2($author$project$Page$Group$EditMemberMetadata$viewProfileButtons, i18n, profile); 51560 case 1: 51561 var sel = _v0.a; 51562 return A3($author$project$Page$Group$EditMemberMetadata$viewFillPanel, i18n, profile, sel); 51563 default: 51564 var sel = _v0.a; 51565 return A3($author$project$Page$Group$EditMemberMetadata$viewSavePanel, i18n, data.w, sel); 51566 } 51567 }); 51568var $author$project$Page$Group$EditMemberMetadata$view = F2( 51569 function (config, _v0) { 51570 var data = _v0; 51571 var optionalField = F5( 51572 function (icon, label, placeholder, onChange, accessor) { 51573 return $author$project$UI$Components$formTextField( 51574 { 51575 gi: $elm$core$Maybe$Nothing, 51576 gv: $elm$core$Maybe$Just(icon), 51577 i6: label, 51578 oq: onChange, 51579 pt: placeholder, 51580 hd: false, 51581 q8: $dwayne$elm_field$Field$toRawString( 51582 A2($dwayne$elm_form$Form$get, accessor, data.w)) 51583 }); 51584 }); 51585 var i18n = config.aJ; 51586 var nameError = function () { 51587 var field = A2( 51588 $dwayne$elm_form$Form$get, 51589 function ($) { 51590 return $.bW; 51591 }, 51592 data.w); 51593 return ($dwayne$elm_field$Field$isInvalid(field) && (data.d_ || $dwayne$elm_field$Field$isDirty(field))) ? $elm$core$Maybe$Just( 51594 $author$project$Translations$fieldRequired(i18n)) : (function () { 51595 var currentName = $dwayne$elm_field$Field$toRawString(field); 51596 return (data.d_ || $dwayne$elm_field$Field$isDirty(field)) && ((!_Utils_eq( 51597 $elm$core$String$toLower(currentName), 51598 $elm$core$String$toLower(data.dB))) && A2( 51599 $elm$core$List$any, 51600 function (n) { 51601 return _Utils_eq( 51602 $elm$core$String$toLower(n), 51603 $elm$core$String$toLower(currentName)); 51604 }, 51605 config.iD)); 51606 }() ? $elm$core$Maybe$Just( 51607 $author$project$Translations$memberAddNameTaken(i18n)) : $elm$core$Maybe$Nothing); 51608 }(); 51609 var profileSection = config.dl ? A3($author$project$Page$Group$EditMemberMetadata$viewProfileSection, i18n, config.kc, data) : $author$project$Ui$none; 51610 var emailError = function () { 51611 var field = A2( 51612 $dwayne$elm_form$Form$get, 51613 function ($) { 51614 return $.is; 51615 }, 51616 data.w); 51617 return ($dwayne$elm_field$Field$isInvalid(field) && (data.d_ || $dwayne$elm_field$Field$isDirty(field))) ? $elm$core$Maybe$Just( 51618 $author$project$Translations$fieldInvalidEmail(i18n)) : $elm$core$Maybe$Nothing; 51619 }(); 51620 return A2( 51621 $author$project$Ui$map, 51622 config.d3, 51623 A2( 51624 $author$project$Ui$column, 51625 _List_fromArray( 51626 [ 51627 $author$project$Ui$spacing($author$project$UI$Theme$spacing.hE) 51628 ]), 51629 _List_fromArray( 51630 [ 51631 profileSection, 51632 A2( 51633 $author$project$Ui$column, 51634 _List_fromArray( 51635 [ 51636 $author$project$Ui$spacing($author$project$UI$Theme$spacing.i8) 51637 ]), 51638 _List_fromArray( 51639 [ 51640 $author$project$UI$Components$formTextField( 51641 { 51642 gi: nameError, 51643 gv: $elm$core$Maybe$Just($feathericons$elm_feather$FeatherIcons$user), 51644 i6: $author$project$Translations$memberRenameLabel(i18n), 51645 oq: $author$project$Page$Group$EditMemberMetadata$InputName, 51646 pt: $elm$core$Maybe$Nothing, 51647 hd: true, 51648 q8: $dwayne$elm_field$Field$toRawString( 51649 A2( 51650 $dwayne$elm_form$Form$get, 51651 function ($) { 51652 return $.bW; 51653 }, 51654 data.w)) 51655 }), 51656 A5( 51657 optionalField, 51658 $feathericons$elm_feather$FeatherIcons$phone, 51659 $author$project$Translations$memberMetadataPhone(i18n), 51660 $elm$core$Maybe$Just('+33 6 12 34 56 78'), 51661 $author$project$Page$Group$EditMemberMetadata$InputPhone, 51662 function ($) { 51663 return $.jF; 51664 }), 51665 $author$project$UI$Components$formTextField( 51666 { 51667 gi: emailError, 51668 gv: $elm$core$Maybe$Just($feathericons$elm_feather$FeatherIcons$atSign), 51669 i6: $author$project$Translations$memberMetadataEmail(i18n), 51670 oq: $author$project$Page$Group$EditMemberMetadata$InputEmail, 51671 pt: $elm$core$Maybe$Nothing, 51672 hd: false, 51673 q8: $dwayne$elm_field$Field$toRawString( 51674 A2( 51675 $dwayne$elm_form$Form$get, 51676 function ($) { 51677 return $.is; 51678 }, 51679 data.w)) 51680 }), 51681 A5( 51682 optionalField, 51683 $feathericons$elm_feather$FeatherIcons$fileText, 51684 $author$project$Translations$memberMetadataNotes(i18n), 51685 $elm$core$Maybe$Just( 51686 $author$project$Translations$memberMetadataNotesPlaceholder(i18n)), 51687 $author$project$Page$Group$EditMemberMetadata$InputNotes, 51688 function ($) { 51689 return $.bu; 51690 }) 51691 ])), 51692 A2( 51693 $author$project$Ui$column, 51694 _List_Nil, 51695 _List_fromArray( 51696 [ 51697 $author$project$UI$Components$sectionLabel( 51698 $author$project$Translations$memberMetadataPayment(i18n)), 51699 A2( 51700 $author$project$Ui$column, 51701 _List_fromArray( 51702 [ 51703 $author$project$Ui$spacing($author$project$UI$Theme$spacing.i8) 51704 ]), 51705 A2( 51706 $elm$core$List$map, 51707 function (method) { 51708 var shown = $author$project$UI$PaymentMethods$presentation(method); 51709 return A5( 51710 optionalField, 51711 shown.gv, 51712 shown.i6(i18n), 51713 $elm$core$Maybe$Just(shown.pt), 51714 $author$project$Page$Group$EditMemberMetadata$InputPayment(method), 51715 $author$project$Form$EditMemberMetadata$payment(method)); 51716 }, 51717 $author$project$Domain$PaymentMethod$all)) 51718 ])), 51719 A2( 51720 $author$project$UI$Components$btnPrimary, 51721 _List_Nil, 51722 { 51723 i6: $author$project$Translations$memberMetadataSave(i18n), 51724 e7: $author$project$Page$Group$EditMemberMetadata$Submit 51725 }) 51726 ]))); 51727 }); 51728var $author$project$Page$Group$MergeMember$ToneRetiring = 0; 51729var $author$project$UI$Components$AvatarAccent = 0; 51730var $author$project$Page$Group$MergeMember$PickTarget = function (a) { 51731 return {$: 0, a: a}; 51732}; 51733var $author$project$UI$Components$avatar = F2( 51734 function (color, initials) { 51735 var _v0 = function () { 51736 switch (color) { 51737 case 0: 51738 return _Utils_Tuple2($author$project$UI$Theme$primary.qR, $author$project$UI$Theme$primary.k3); 51739 case 1: 51740 return _Utils_Tuple2($author$project$UI$Theme$base.qR, $author$project$UI$Theme$base.aM); 51741 case 2: 51742 return _Utils_Tuple2($author$project$UI$Theme$base.en, $author$project$UI$Theme$base.aM); 51743 default: 51744 return _Utils_Tuple2($author$project$UI$Theme$danger.qR, $author$project$UI$Theme$danger.k3); 51745 } 51746 }(); 51747 var bgColor = _v0.a; 51748 var textColor = _v0.b; 51749 return A2( 51750 $author$project$Ui$el, 51751 _List_fromArray( 51752 [ 51753 $author$project$Ui$width( 51754 $author$project$Ui$px($author$project$UI$Theme$sizing.i8)), 51755 $author$project$Ui$height( 51756 $author$project$Ui$px($author$project$UI$Theme$sizing.i8)),
51757 $author$project$Ui$rounded($author$project$UI$Theme$radius.hF), 51758 $author$project$Ui$background(bgColor), 51759 $author$project$Ui$Font$color(textColor), 51760 $author$project$Ui$Font$weight($author$project$UI$Theme$fontWeight.dL), 51761 $author$project$Ui$Font$size($author$project$UI$Theme$font.aW), 51762 $author$project$Ui$contentCenterX, 51763 $author$project$Ui$contentCenterY 51764 ]), 51765 $author$project$Ui$text(initials)); 51766 }); 51767var $feathericons$elm_feather$FeatherIcons$chevronRight = A2( 51768 $feathericons$elm_feather$FeatherIcons$makeBuilder, 51769 'chevron-right', 51770 _List_fromArray( 51771 [ 51772 A2( 51773 $elm$svg$Svg$polyline, 51774 _List_fromArray( 51775 [ 51776 $elm$svg$Svg$Attributes$points('9 18 15 12 9 6') 51777 ]), 51778 _List_Nil) 51779 ])); 51780var $author$project$Page$Group$MergeMember$initialsOf = function (member) { 51781 return A2( 51782 $elm$core$String$left, 51783 2, 51784 $elm$core$String$toUpper(member.bW)); 51785}; 51786var $author$project$Translations$memberVirtualLabel = function (_v0) { 51787 var lang = _v0; 51788 if (!lang) { 51789 return 'virtual'; 51790 } else { 51791 return 'virtuel'; 51792 } 51793}; 51794var $author$project$Page$Group$MergeMember$smallTag = F3( 51795 function (label, bg, fontColor) { 51796 return A2( 51797 $author$project$Ui$el, 51798 _List_fromArray( 51799 [ 51800 $author$project$Ui$Font$size($author$project$UI$Theme$font.bb), 51801 $author$project$Ui$Font$weight($author$project$UI$Theme$fontWeight.dL), 51802 A2($author$project$Ui$paddingXY, $author$project$UI$Theme$spacing.qk, $author$project$UI$Theme$spacing.bb), 51803 $author$project$Ui$rounded($author$project$UI$Theme$radius.qk), 51804 $author$project$Ui$background(bg), 51805 $author$project$Ui$Font$color(fontColor), 51806 $author$project$Ui$width($author$project$Ui$shrink) 51807 ]), 51808 $author$project$Ui$text(label)); 51809 }); 51810var $author$project$Page$Group$MergeMember$candidateRow = F2( 51811 function (i18n, member) { 51812 var isVirtual = member.nL === 1; 51813 return A2( 51814 $author$project$UI$Components$card, 51815 _List_fromArray( 51816 [ 51817 $author$project$Ui$Input$button( 51818 $author$project$Page$Group$MergeMember$PickTarget(member.aj)), 51819 A2($author$project$Ui$paddingXY, $author$project$UI$Theme$spacing.i8, $author$project$UI$Theme$spacing.aW), 51820 $author$project$Ui$pointer 51821 ]), 51822 _List_fromArray( 51823 [ 51824 A2( 51825 $author$project$Ui$row, 51826 _List_fromArray( 51827 [ 51828 $author$project$Ui$spacing($author$project$UI$Theme$spacing.aW), 51829 $author$project$Ui$contentCenterY, 51830 $author$project$Ui$width($author$project$Ui$fill) 51831 ]), 51832 _List_fromArray( 51833 [ 51834 A2( 51835 $author$project$UI$Components$avatar, 51836 0, 51837 $author$project$Page$Group$MergeMember$initialsOf(member)), 51838 A2( 51839 $author$project$Ui$column, 51840 _List_fromArray( 51841 [ 51842 $author$project$Ui$spacing($author$project$UI$Theme$spacing.bb), 51843 $author$project$Ui$width($author$project$Ui$fill) 51844 ]), 51845 _List_fromArray( 51846 [ 51847 A2( 51848 $author$project$Ui$row, 51849 _List_fromArray( 51850 [ 51851 $author$project$Ui$spacing($author$project$UI$Theme$spacing.bb), 51852 $author$project$Ui$contentCenterY 51853 ]), 51854 _List_fromArray( 51855 [ 51856 A2( 51857 $author$project$Ui$el, 51858 _List_fromArray( 51859 [ 51860 $author$project$Ui$Font$weight($author$project$UI$Theme$fontWeight.dL), 51861 $author$project$Ui$Font$size($author$project$UI$Theme$font.aW) 51862 ]), 51863 $author$project$Ui$text(member.bW)), 51864 isVirtual ? A3( 51865 $author$project$Page$Group$MergeMember$smallTag, 51866 $author$project$Translations$memberVirtualLabel(i18n), 51867 $author$project$UI$Theme$base.qR, 51868 $author$project$UI$Theme$base.aM) : $author$project$Ui$none 51869 ])) 51870 ])), 51871 A2($author$project$UI$Components$featherIcon, 18, $feathericons$elm_feather$FeatherIcons$chevronRight) 51872 ])) 51873 ])); 51874 }); 51875var $author$project$Page$Group$MergeMember$headingSection = F2( 51876 function (title, subtitle) { 51877 return A2( 51878 $author$project$Ui$column, 51879 _List_fromArray( 51880 [ 51881 $author$project$Ui$spacing($author$project$UI$Theme$spacing.qk), 51882 $author$project$Ui$width($author$project$Ui$fill) 51883 ]), 51884 _List_fromArray( 51885 [ 51886 A2( 51887 $author$project$Ui$el, 51888 _List_fromArray( 51889 [ 51890 $author$project$Ui$Font$size($author$project$UI$Theme$font.i8), 51891 $author$project$Ui$Font$weight($author$project$UI$Theme$fontWeight.dL) 51892 ]), 51893 $author$project$Ui$text(title)), 51894 A2( 51895 $author$project$Ui$el, 51896 _List_fromArray( 51897 [ 51898 $author$project$Ui$Font$size($author$project$UI$Theme$font.qk), 51899 $author$project$Ui$Font$color($author$project$UI$Theme$base.aM) 51900 ]), 51901 $author$project$Ui$text(subtitle)) 51902 ])); 51903 }); 51904var $author$project$Translations$mergeMemberNotFound = function (_v0) { 51905 var lang = _v0; 51906 if (!lang) { 51907 return 'Member not found.'; 51908 } else { 51909 return 'Membre introuvable.'; 51910 } 51911}; 51912var $author$project$Page$Group$MergeMember$memberNotFoundView = function (i18n) { 51913 return A2( 51914 $author$project$Ui$el, 51915 _List_fromArray( 51916 [ 51917 $author$project$Ui$padding($author$project$UI$Theme$spacing.i8), 51918 $author$project$Ui$Font$color($author$project$UI$Theme$danger.qI) 51919 ]), 51920 $author$project$Ui$text( 51921 $author$project$Translations$mergeMemberNotFound(i18n))); 51922};
51923var $author$project$UI$Components$AvatarRed = 3; 51924var $author$project$Page$Group$MergeMember$memberSlot = function (config) { 51925 var _v0 = function () { 51926 var _v1 = config.fE; 51927 if (!_v1) { 51928 return _Utils_Tuple3($author$project$UI$Theme$danger.qI, $author$project$UI$Theme$danger.k3, 3); 51929 } else { 51930 return _Utils_Tuple3($author$project$UI$Theme$success.qI, $author$project$UI$Theme$success.k3, 0); 51931 } 51932 }(); 51933 var labelColor = _v0.a; 51934 var borderColor = _v0.b; 51935 var avatarColor = _v0.c; 51936 return A2( 51937 $author$project$Ui$column, 51938 _List_fromArray( 51939 [ 51940 $author$project$Ui$spacing($author$project$UI$Theme$spacing.bb), 51941 $author$project$Ui$padding($author$project$UI$Theme$spacing.aW), 51942 $author$project$Ui$background($author$project$UI$Theme$base.h$), 51943 $author$project$Ui$border($author$project$UI$Theme$border), 51944 $author$project$Ui$borderColor(borderColor), 51945 $author$project$Ui$rounded($author$project$UI$Theme$radius.aW), 51946 $author$project$Ui$width($author$project$Ui$fill) 51947 ]), 51948 _List_fromArray( 51949 [ 51950 A2( 51951 $author$project$Ui$el, 51952 _List_fromArray( 51953 [ 51954 $author$project$Ui$Font$size($author$project$UI$Theme$font.bb), 51955 $author$project$Ui$Font$weight($author$project$UI$Theme$fontWeight.dL), 51956 $author$project$Ui$Font$letterSpacing($author$project$UI$Theme$letterSpacing.kY), 51957 $author$project$Ui$Font$color(labelColor) 51958 ]), 51959 $author$project$Ui$text( 51960 $elm$core$String$toUpper(config.i6))), 51961 A2( 51962 $author$project$Ui$row, 51963 _List_fromArray( 51964 [ 51965 $author$project$Ui$spacing($author$project$UI$Theme$spacing.qk), 51966 $author$project$Ui$contentCenterY, 51967 $author$project$Ui$width($author$project$Ui$fill) 51968 ]), 51969 _List_fromArray( 51970 [ 51971 A2( 51972 $author$project$UI$Components$avatar, 51973 avatarColor, 51974 $author$project$Page$Group$MergeMember$initialsOf(config.dt)), 51975 A2( 51976 $author$project$Ui$el, 51977 _List_fromArray( 51978 [ 51979 $author$project$Ui$Font$weight($author$project$UI$Theme$fontWeight.dL), 51980 $author$project$Ui$Font$size($author$project$UI$Theme$font.aW), 51981 $author$project$Ui$width($author$project$Ui$fill) 51982 ]), 51983 $author$project$Ui$text(config.dt.bW)) 51984 ])) 51985 ])); 51986}; 51987var $author$project$Translations$mergeNoOtherMember = function (_v0) { 51988 var lang = _v0; 51989 if (!lang) { 51990 return 'There is no other member to merge into.'; 51991 } else { 51992 return 'Il n\'y a aucun autre membre vers lequel fusionner.'; 51993 } 51994}; 51995var $author$project$Translations$mergeRetiringLabel = function (_v0) { 51996 var lang = _v0; 51997 if (!lang) { 51998 return 'Retiring'; 51999 } else { 52000 return 'Retiré'; 52001 } 52002}; 52003var $author$project$Translations$mergeStep1PickerLabel = function (_v0) { 52004 var lang = _v0; 52005 if (!lang) { 52006 return 'Members'; 52007 } else { 52008 return 'Membres'; 52009 } 52010}; 52011var $author$project$Translations$mergeStep1Subtitle = function (_v0) { 52012 var lang = _v0; 52013 if (!lang) { 52014 return 'All entries and settlement preferences from the retiring member will move to the kept member.'; 52015 } else { 52016 return 'Toutes les entrées et préférences de remboursement du membre retiré seront déplacées vers le membre conservé.'; 52017 } 52018}; 52019var $author$project$Translations$mergeStep1Title = function (_v0) { 52020 var lang = _v0; 52021 if (!lang) { 52022 return 'Pick the member to keep'; 52023 } else { 52024 return 'Choisir le membre à conserver'; 52025 } 52026}; 52027var $author$project$Page$Group$MergeMember$viewStep1 = F3( 52028 function (i18n, state, data) { 52029 var _v0 = A2($elm$core$Dict$get, data.dZ, state.r); 52030 if (_v0.$ === 1) { 52031 return $author$project$Page$Group$MergeMember$memberNotFoundView(i18n); 52032 } else { 52033 var sourceMember = _v0.a; 52034 var activeCandidates = A2( 52035 $elm$core$List$sortBy, 52036 function (m) { 52037 return $elm$core$String$toLower(m.bW); 52038 }, 52039 A2( 52040 $elm$core$List$filter, 52041 function (m) { 52042 return (!_Utils_eq(m.aj, data.dZ)) && (!m.nt); 52043 }, 52044 $elm$core$Dict$values(state.r))); 52045 return A2( 52046 $author$project$Ui$column, 52047 _List_fromArray( 52048 [ 52049 $author$project$Ui$spacing($author$project$UI$Theme$spacing.hE), 52050 $author$project$Ui$width($author$project$Ui$fill) 52051 ]), 52052 _List_fromArray( 52053 [ 52054 A2( 52055 $author$project$Page$Group$MergeMember$headingSection, 52056 $author$project$Translations$mergeStep1Title(i18n), 52057 $author$project$Translations$mergeStep1Subtitle(i18n)), 52058 $author$project$Page$Group$MergeMember$memberSlot( 52059 { 52060 i6: $author$project$Translations$mergeRetiringLabel(i18n),
52061 dt: sourceMember, 52062 fE: 0 52063 }), 52064 A2( 52065 $author$project$Ui$column, 52066 _List_fromArray( 52067 [ 52068 $author$project$Ui$spacing($author$project$UI$Theme$spacing.qk), 52069 $author$project$Ui$width($author$project$Ui$fill) 52070 ]), 52071 _List_fromArray( 52072 [ 52073 $author$project$UI$Components$sectionLabel( 52074 $author$project$Translations$mergeStep1PickerLabel(i18n)), 52075 $elm$core$List$isEmpty(activeCandidates) ? A2( 52076 $author$project$Ui$el, 52077 _List_fromArray( 52078 [ 52079 $author$project$Ui$Font$color($author$project$UI$Theme$base.aM), 52080 $author$project$Ui$Font$size($author$project$UI$Theme$font.qk) 52081 ]), 52082 $author$project$Ui$text( 52083 $author$project$Translations$mergeNoOtherMember(i18n))) : A2( 52084 $author$project$Ui$column, 52085 _List_fromArray( 52086 [ 52087 $author$project$Ui$spacing($author$project$UI$Theme$spacing.bb), 52088 $author$project$Ui$width($author$project$Ui$fill) 52089 ]), 52090 A2( 52091 $elm$core$List$map, 52092 $author$project$Page$Group$MergeMember$candidateRow(i18n), 52093 activeCandidates)) 52094 ])) 52095 ])); 52096 } 52097 }); 52098var $author$project$Page$Group$MergeMember$InputConfirm = function (a) { 52099 return {$: 3, a: a}; 52100}; 52101var $author$project$Page$Group$MergeMember$Submit = {$: 7}; 52102var $author$project$Translations$mergeConfirmHint = F2( 52103 function (name, _v0) { 52104 var lang = _v0; 52105 if (!lang) { 52106 return 'Type ' + (name + ' to confirm.'); 52107 } else { 52108 return 'Rentre ' + (name + ' pour confirmer.'); 52109 } 52110 }); 52111var $author$project$Translations$mergeConfirmPlaceholder = function (_v0) { 52112 var lang = _v0; 52113 if (!lang) { 52114 return 'Type the name to enable the merge button'; 52115 } else { 52116 return 'Rentre le nom pour activer le bouton de fusion'; 52117 } 52118}; 52119var $author$project$Translations$mergeSubmitButton = F2( 52120 function (name, _v0) { 52121 var lang = _v0; 52122 if (!lang) { 52123 return 'Merge and retire ' + name; 52124 } else { 52125 return 'Fusionner et retirer ' + name; 52126 } 52127 }); 52128var $author$project$Page$Group$MergeMember$confirmSection = F3( 52129 function (i18n, data, sourceMember) { 52130 var canSubmit = _Utils_eq( 52131 $elm$core$String$trim(data.cg), 52132 sourceMember.bW) && (sourceMember.bW !== ''); 52133 return A2( 52134 $author$project$Ui$column, 52135 _List_fromArray( 52136 [ 52137 $author$project$Ui$spacing($author$project$UI$Theme$spacing.qk), 52138 $author$project$Ui$width($author$project$Ui$fill) 52139 ]), 52140 _List_fromArray( 52141 [ 52142 A2( 52143 $author$project$Ui$el, 52144 _List_fromArray( 52145 [ 52146 $author$project$Ui$Font$size($author$project$UI$Theme$font.qk), 52147 $author$project$Ui$Font$color($author$project$UI$Theme$base.qI) 52148 ]), 52149 $author$project$Ui$text( 52150 A2($author$project$Translations$mergeConfirmHint, sourceMember.bW, i18n))), 52151 A2( 52152 $author$project$Ui$Input$text, 52153 _List_fromArray( 52154 [ 52155 $author$project$Ui$width($author$project$Ui$fill), 52156 $author$project$Ui$padding($author$project$UI$Theme$spacing.qk), 52157 $author$project$Ui$rounded($author$project$UI$Theme$radius.qk), 52158 $author$project$Ui$border($author$project$UI$Theme$border), 52159 $author$project$Ui$borderColor($author$project$UI$Theme$base.k3) 52160 ]), 52161 { 52162 i6: $author$project$Ui$Input$labelHidden( 52163 A2($author$project$Translations$mergeConfirmHint, sourceMember.bW, i18n)), 52164 oq: $author$project$Page$Group$MergeMember$InputConfirm, 52165 pt: $elm$core$Maybe$Just( 52166 $author$project$Translations$mergeConfirmPlaceholder(i18n)), 52167 qI: data.cg 52168 }), 52169 canSubmit ? A2( 52170 $author$project$UI$Components$btnDanger, 52171 _List_Nil, 52172 { 52173 gv: $feathericons$elm_feather$FeatherIcons$alertTriangle, 52174 i6: A2($author$project$Translations$mergeSubmitButton, sourceMember.bW, i18n), 52175 e7: $author$project$Page$Group$MergeMember$Submit 52176 }) : A2( 52177 $author$project$Ui$row, 52178 _List_fromArray( 52179 [ 52180 $author$project$Ui$width($author$project$Ui$fill), 52181 $author$project$Ui$spacing($author$project$UI$Theme$spacing.qk), 52182 $author$project$Ui$contentCenterX, 52183 $author$project$Ui$contentCenterY, 52184 $author$project$Ui$padding($author$project$UI$Theme$spacing.aW), 52185 $author$project$Ui$rounded($author$project$UI$Theme$radiu
52185s.aW), 52186 $author$project$Ui$background($author$project$UI$Theme$base.en), 52187 $author$project$Ui$Font$color($author$project$UI$Theme$base.aM), 52188 $author$project$Ui$Font$weight($author$project$UI$Theme$fontWeight.dL), 52189 $author$project$Ui$Font$size($author$project$UI$Theme$font.aW) 52190 ]), 52191 _List_fromArray( 52192 [ 52193 A2($author$project$UI$Components$featherIcon, 16, $feathericons$elm_feather$FeatherIcons$alertTriangle), 52194 $author$project$Ui$text( 52195 A2($author$project$Translations$mergeSubmitButton, sourceMember.bW, i18n)) 52196 ])) 52197 ])); 52198 }); 52199var $author$project$Page$Group$MergeMember$ToggleEntriesDetails = {$: 4}; 52200var $author$project$Page$Group$MergeMember$TogglePrefsDetails = {$: 6}; 52201var $author$project$Page$Group$MergeMember$ToggleSelfTransfersDetails = {$: 5}; 52202var $feathericons$elm_feather$FeatherIcons$chevronDown = A2( 52203 $feathericons$elm_feather$FeatherIcons$makeBuilder, 52204 'chevron-down', 52205 _List_fromArray( 52206 [ 52207 A2( 52208 $elm$svg$Svg$polyline, 52209 _List_fromArray( 52210 [ 52211 $elm$svg$Svg$Attributes$points('6 9 12 15 18 9') 52212 ]), 52213 _List_Nil) 52214 ])); 52215var $author$project$InternalAnim$Css$Props$ids = {pd: 13, j8: 3, he: 4, p1: 5, p2: 6, p3: 7, rm: 0, k0: 1, k1: 2}; 52216var $author$project$InternalAnim$Css$Props$Turns = function (a) { 52217 return {$: 3, a: a}; 52218}; 52219var $author$project$InternalAnim$Css$Props$turns = function (vec) { 52220 return $author$project$InternalAnim$Css$Props$Turns(vec); 52221}; 52222var $author$project$Animator$zAxis = {rm: 0, k0: 0, k1: 1}; 52223var $author$project$Animator$rotation = function (n) { 52224 return A4( 52225 $author$project$InternalAnim$Css$Prop, 52226 $author$project$InternalAnim$Css$Props$ids.j8, 52227 'rotate', 52228 $author$project$InternalAnim$Move$to(1000 * n), 52229 $author$project$InternalAnim$Css$Props$turns($author$project$Animator$zAxis)); 52230}; 52231var $author$project$Ui$Anim$rotation = $author$project$Animator$rotation; 52232var $author$project$UI$Components$animatedChevron = function (isOpen) { 52233 return A2( 52234 $author$project$Ui$el, 52235 _List_fromArray( 52236 [ 52237 $author$project$Ui$width($author$project$Ui$shrink), 52238 A2( 52239 $author$project$Ui$Anim$transition, 52240 $author$project$Ui$Anim$ms(300), 52241 _List_fromArray( 52242 [ 52243 A2( 52244 $author$project$Ui$Anim$withTransition, 52245 A4($author$project$Ui$Anim$bezier, 0.16, 1, 0.3, 1), 52246 $author$project$Ui$Anim$rotation( 52247 isOpen ? 0.5 : 0)) 52248 ])) 52249 ]), 52250 A2($author$project$UI$Components$featherIcon, 18, $feathericons$elm_feather$FeatherIcons$chevronDown)); 52251}; 52252var $author$project$UI$Components$expandTrigger = function (config) { 52253 return A2( 52254 $author$project$Ui$row, 52255 A2( 52256 $elm$core$List$cons, 52257 $author$project$Ui$Input$button(config.e7), 52258 A2( 52259 $elm$core$List$cons, 52260 $author$project$Ui$pointer, 52261 A2( 52262 $elm$core$List$cons, 52263 $author$project$Ui$width($author$project$Ui$shrink), 52264 A2( 52265 $elm$core$List$cons, 52266 $author$project$Ui$spacing($author$project$UI$Theme$spacing.aW), 52267 $author$project$UI$Components$sectionLabelAttrs)))), 52268 _List_fromArray( 52269 [ 52270 A2( 52271 $author$project$Ui$el, 52272 _List_fromArray( 52273 [ 52274 $author$project$Ui$width($author$project$Ui$shrink) 52275 ]), 52276 $author$project$Ui$text( 52277 $elm$core$String$toUpper(config.i6))), 52278 $author$project$UI$Components$animatedChevron(config.ns) 52279 ])); 52280}; 52281var $author$project$Page$Group$MergeMember$collapsible = function (config) { 52282 return A2( 52283 $author$project$Ui$column, 52284 _List_fromArray( 52285 [ 52286 $author$project$Ui$spacing($author$project$UI$Theme$spacing.qk), 52287 $author$project$Ui$width($author$project$Ui$fill) 52288 ]), 52289 _List_fromArray( 52290 [ 52291 $author$project$UI$Components$expandTrigger( 52292 {ns: config.ns, i6: config.i6, e7: config.fD}), 52293 config.ns ? config.ew : $author$project$Ui$none 52294 ])); 52295}; 52296var $feathericons$elm_feather$FeatherIcons$arrowRight = A2( 52297 $feathericons$elm_feather$FeatherIcons$makeBuilder, 52298 'arrow-right', 52299 _List_fromArray( 52300 [ 52301 A2( 52302 $elm$svg$Svg$line, 52303 _List_fromArray( 52304 [ 52305 $elm$svg$Svg$Attributes$x1('5'), 52306 $elm$svg$Svg$Attributes$y1('12'), 52307 $elm$svg$Svg$Attributes$x2('19'), 52308 $elm$svg$Svg$Attributes$y2('12') 52309 ]), 52310 _List_Nil), 52311 A2( 52312 $elm$svg$Svg$polyline, 52313 _List_fromArray( 52314 [ 52315 $elm$svg$Svg$Attributes$points('12 5 19 12 12 19') 52316 ]), 52317 _List_Nil) 52318 ])); 52319var $author$project$Translations$entryIncome = function (_v0) { 52320 var lang = _v0; 52321 if (!lang) { 52322 return 'Income'; 52323 } else { 52324 return 'Revenu'; 52325 } 52326}; 52327var $author$project$Translations$entryTransfer = function (_v0) { 52328 var lang = _v0; 52329 if (!lang) { 52330 return 'Transfer'; 52331 } else { 52332 return 'Transfert'; 52333 } 52334}; 52335var $author$project$Translations$mergeSelfTransferTag = function (_v0) { 52336 var lang = _v0; 52337 if (!lang) { 52338 return 'will be deleted'; 52339 } else { 52340 return 'sera supprimé'; 52341 } 52342}; 52343var $feathericons$elm_feather$FeatherIcons$shoppingBag = A2( 52344 $feathericons$elm_feather$FeatherIcons$makeBuilder, 52345 'shopping-bag', 52346 _List_fromArray( 52347 [ 52348 A2( 52349 $elm$svg$Svg$path, 52350 _List_fromArray( 52351 [ 52352 $elm$svg$Svg$Attributes$d('M6 2L3 6v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V6l-3-4z') 52353 ]), 52354 _List_Nil), 52355 A2( 52356 $elm$svg$Svg$line, 52357 _List_fromArray( 52358 [ 52359 $elm$svg$Svg$Attributes$x1('3'), 52360 $elm$svg$Svg$Attributes$y1('6'), 52361 $elm$svg$Svg$Attributes$x2('21'), 52362 $elm$svg$Svg$Attributes$y2('6') 52363 ]), 52364 _List_Nil), 52365 A2( 52366 $elm$svg$Svg$path, 52367 _List_fromArray( 52368 [ 52369 $elm$svg$Svg$Attributes$d('M16 10a4 4 0 0 1-8 0') 52370 ]), 52371 _List_Nil) 52372 ])); 52373var $author$project$Page$Group$MergeMember$entryRow = F3( 52374 function (i18n, entry, isSelfTransferDelete) { 52375 var suffix = isSelfTransferDelete ? A2( 52376 $author$project$Ui$el, 52377 _List_fromArray( 52378 [ 52379 $author$project$Ui$Font$size($author$project$UI$Theme$font.bb), 52380 $author$project$Ui$Font$color($author$project$UI$Theme$danger.qI), 52381 $author$project$Ui$width($author$project$Ui$shrink) 52382 ]), 52383 $author$project$Ui$text( 52384 $author$project$Translations$mergeSelfTransferTag(i18n))) : $author$project$Ui$none; 52385 var _v0 = function () { 52386 var _v1 = entry.gE; 52387 switch (_v1.$) { 52388 case 0: 52389 var data = _v1.a; 52390 return _Utils_Tuple2($feathericons$elm_feather$FeatherIcons$shoppingBag, data.eE); 52391 case 1: 52392 var data = _v1.a; 52393 return _Utils_Tuple2( 52394 $feathericons$elm_feather$FeatherIcons$arrowRight, 52395 A2( 52396 $elm$core$Maybe$withDefault, 52397 $author$project$Translations$entryTransfer(i18n), 52398 data.eE)); 52399 default: 52400 return _Utils_Tuple2( 52401 $feathericons$elm_feather$FeatherIcons$gift, 52402 $author$project$Translations$entryIncome(i18n)); 52403 } 52404 }(); 52405 var icon = _v0.a; 52406 var label = _v0.b; 52407 return A2( 52408 $author$project$Ui$row, 52409 _List_fromArray( 52410 [ 52411 $author$project$Ui$spacing($author$project$UI$Theme$spacing.qk), 52412 A2($author$project$Ui$paddingXY, $author$project$UI$Theme$spacing.aW, $author$project$UI$Theme$spacing.qk), 52413 $author$project$Ui$background($author$project$UI$Theme$base.h$), 52414 $author$project$Ui$border($author$project$UI$Theme$border), 52415 $author$project$Ui$borderColor($author$project$UI$Theme$base.k3),
52416 $author$project$Ui$rounded($author$project$UI$Theme$radius.qk), 52417 $author$project$Ui$width($author$project$Ui$fill), 52418 $author$project$Ui$contentCenterY 52419 ]), 52420 _List_fromArray( 52421 [ 52422 A2( 52423 $author$project$Ui$el, 52424 _List_fromArray( 52425 [ 52426 $author$project$Ui$Font$color($author$project$UI$Theme$base.aM), 52427 $author$project$Ui$width($author$project$Ui$shrink) 52428 ]), 52429 A2($author$project$UI$Components$featherIcon, 14, icon)), 52430 A2( 52431 $author$project$Ui$el, 52432 _List_fromArray( 52433 [ 52434 $author$project$Ui$Font$size($author$project$UI$Theme$font.qk), 52435 $author$project$Ui$width($author$project$Ui$fill) 52436 ]), 52437 $author$project$Ui$text(label)), 52438 suffix 52439 ])); 52440 }); 52441var $author$project$Page$Group$MergeMember$entryActionRow = F2( 52442 function (i18n, action) { 52443 switch (action.$) { 52444 case 0: 52445 var original = action.a.jA; 52446 return A3($author$project$Page$Group$MergeMember$entryRow, i18n, original, false); 52447 case 1: 52448 var original = action.a.jA; 52449 return A3($author$project$Page$Group$MergeMember$entryRow, i18n, original, true); 52450 default: 52451 return $author$project$Ui$none; 52452 } 52453 }); 52454var $author$project$Translations$mergeEffectsTitle = function (_v0) { 52455 var lang = _v0; 52456 if (!lang) { 52457 return 'Effects of this merge'; 52458 } else { 52459 return 'Effets de la fusion'; 52460 } 52461}; 52462var $author$project$Translations$mergeEntriesRewrittenCount = F2( 52463 function (count, _v0) { 52464 var lang = _v0; 52465 if (!lang) { 52466 if (count === '1') { 52467 return count + ' entry will be rewritten'; 52468 } else { 52469 return count + ' entries will be rewritten'; 52470 } 52471 } else { 52472 switch (count) { 52473 case '0': 52474 return count + ' entrée sera mise à jour'; 52475 case '1': 52476 return count + ' entrée sera mise à jour'; 52477 default: 52478 return count + ' entrées seront mises à jour'; 52479 } 52480 } 52481 }); 52482var $author$project$Translations$mergeNothingToRewrite = F2( 52483 function (source, _v0) { 52484 var lang = _v0; 52485 if (!lang) { 52486 return 'Nothing to rewrite. ' + (source + ' will simply be retired.'); 52487 } else { 52488 return 'Rien à réécrire. ' + (source + ' sera simplement retiré.'); 52489 } 52490 }); 52491var $author$project$Translations$mergePrefsUpdatedCount = F2( 52492 function (count, _v0) { 52493 var lang = _v0; 52494 if (!lang) { 52495 return count + ' settlement preferences will be updated'; 52496 } else { 52497 return count + ' préférences de remboursement seront mises à jour'; 52498 } 52499 }); 52500var $author$project$Translations$mergeSelfTransfersDeletedCount = F2( 52501 function (count, _v0) { 52502 var lang = _v0; 52503 if (!lang) { 52504 return count + ' transfers will become self-to-self and be deleted'; 52505 } else { 52506 return count + ' transferts deviendront vers soi-même et seront supprimés'; 52507 } 52508 }); 52509var $author$project$Translations$mergePrefUpdated = F2( 52510 function (owner, _v0) { 52511 var lang = _v0; 52512 if (!lang) { 52513 return owner + '\'s settlement preferences'; 52514 } else { 52515 return 'Préférences de remboursement de ' + owner; 52516 } 52517 }); 52518var $author$project$Page$Group$MergeMember$prefActionRow = F3( 52519 function (i18n, state, action) { 52520 var nameOf = function (id) { 52521 return A2( 52522 $elm$core$Maybe$withDefault, 52523 id, 52524 A2( 52525 $elm$core$Maybe$map, 52526 function ($) { 52527 return $.bW; 52528 }, 52529 A2($elm$core$Dict$get, id, state.r))); 52530 }; 52531 var text = function () { 52532 if (action.$ === 2) { 52533 var pref = action.a; 52534 return A2( 52535 $author$project$Translations$mergePrefUpdated, 52536 nameOf(pref.e$), 52537 i18n); 52538 } else { 52539 return ''; 52540 } 52541 }(); 52542 return A2( 52543 $author$project$Ui$el, 52544 _List_fromArray( 52545 [ 52546 A2($author$project$Ui$paddingXY, $author$project$UI$Theme$spacing.aW, $author$project$UI$Theme$spacing.qk), 52547 $author$project$Ui$background($author$project$UI$Theme$base.h$), 52548 $author$project$Ui$border($author$project$UI$Theme$border), 52549 $author$project$Ui$borderColor($author$project$UI$Theme$base.k3), 52550 $author$project$Ui$rounded($author$project$UI$Theme$radius.qk), 52551 $author$project$Ui$width($author$project$Ui$fill), 52552 $author$project$Ui$Font$size($author$project$UI$Theme$font.qk) 52553 ]), 52554 $author$project$Ui$text(text)); 52555 }); 52556var $author$project$Translations$mergeRetireLine = F2( 52557 function (data, _v0) { 52558 var lang = _v0; 52559 if (!lang) { 52560 return data.dY + (' will be retired (merged into ' + (data.kz + ').')); 52561 } else { 52562 return data.dY + (' sera retiré (fusionné dans ' + (data.kz + ').')); 52563 } 52564 }); 52565var $feathericons$elm_feather$FeatherIcons$userMinus = A2( 52566 $feathericons$elm_feather$FeatherIcons$makeBuilder, 52567 'user-minus', 52568 _List_fromArray( 52569 [ 52570 A2( 52571 $elm$svg$Svg$path, 52572 _List_fromArray( 52573 [ 52574 $elm$svg$Svg$Attributes$d('M16 21v-2a4 4 0 0 0-4-4H5a4 4 0 0 0-4 4v2') 52575 ]), 52576 _List_Nil), 52577 A2( 52578 $elm$svg$Svg$circle, 52579 _List_fromArray( 52580 [ 52581 $elm$svg$Svg$Attributes$cx('8.5'), 52582 $elm$svg$Svg$Attributes$cy('7'),
52583 $elm$svg$Svg$Attributes$r('4') 52584 ]), 52585 _List_Nil), 52586 A2( 52587 $elm$svg$Svg$line, 52588 _List_fromArray( 52589 [ 52590 $elm$svg$Svg$Attributes$x1('23'), 52591 $elm$svg$Svg$Attributes$y1('11'), 52592 $elm$svg$Svg$Attributes$x2('17'), 52593 $elm$svg$Svg$Attributes$y2('11') 52594 ]), 52595 _List_Nil) 52596 ])); 52597var $author$project$Page$Group$MergeMember$retireLine = F3( 52598 function (i18n, source, target) { 52599 return A2( 52600 $author$project$Ui$row, 52601 _List_fromArray( 52602 [ 52603 $author$project$Ui$spacing($author$project$UI$Theme$spacing.qk), 52604 $author$project$Ui$padding($author$project$UI$Theme$spacing.aW), 52605 $author$project$Ui$background($author$project$UI$Theme$base.en), 52606 $author$project$Ui$rounded($author$project$UI$Theme$radius.qk), 52607 $author$project$Ui$width($author$project$Ui$fill), 52608 $author$project$Ui$contentCenterY 52609 ]), 52610 _List_fromArray( 52611 [ 52612 A2( 52613 $author$project$Ui$el, 52614 _List_fromArray( 52615 [ 52616 $author$project$Ui$Font$color($author$project$UI$Theme$base.aM), 52617 $author$project$Ui$width($author$project$Ui$shrink) 52618 ]), 52619 A2($author$project$UI$Components$featherIcon, 16, $feathericons$elm_feather$FeatherIcons$userMinus)), 52620 A2( 52621 $author$project$Ui$el, 52622 _List_fromArray( 52623 [ 52624 $author$project$Ui$Font$size($author$project$UI$Theme$font.qk), 52625 $author$project$Ui$width($author$project$Ui$fill) 52626 ]), 52627 $author$project$Ui$text( 52628 A2( 52629 $author$project$Translations$mergeRetireLine, 52630 {dY: source.bW, kz: target.bW}, 52631 i18n))) 52632 ])); 52633 }); 52634var $author$project$Page$Group$MergeMember$effectsSection = F8( 52635 function (i18n, data, state, sourceMember, targetMember, modifyActions, deleteActions, prefActions) { 52636 var totalActions = ($elm$core$List$length(modifyActions) + $elm$core$List$length(deleteActions)) + $elm$core$List$length(prefActions); 52637 return A2( 52638 $author$project$Ui$column, 52639 _List_fromArray( 52640 [ 52641 $author$project$Ui$spacing($author$project$UI$Theme$spacing.aW), 52642 $author$project$Ui$width($author$project$Ui$fill) 52643 ]), 52644 _List_fromArray( 52645 [ 52646 $author$project$UI$Components$sectionLabel( 52647 $author$project$Translations$mergeEffectsTitle(i18n)), 52648 (!totalActions) ? A2( 52649 $author$project$Ui$el, 52650 _List_fromArray( 52651 [ 52652 $author$project$Ui$padding($author$project$UI$Theme$spacing.aW), 52653 $author$project$Ui$Font$size($author$project$UI$Theme$font.qk), 52654 $author$project$Ui$Font$color($author$project$UI$Theme$base.aM), 52655 $author$project$Ui$background($author$project$UI$Theme$base.en), 52656 $author$project$Ui$rounded($author$project$UI$Theme$radius.qk), 52657 $author$project$Ui$width($author$project$Ui$fill) 52658 ]), 52659 $author$project$Ui$text( 52660 A2($author$project$Translations$mergeNothingToRewrite, sourceMember.bW, i18n))) : $author$project$Ui$none, 52661 $elm$core$List$isEmpty(modifyActions) ? $author$project$Ui$none : $author$project$Page$Group$MergeMember$collapsible( 52662 { 52663 ew: A2( 52664 $author$project$Ui$column, 52665 _List_fromArray( 52666 [ 52667 $author$project$Ui$spacing($author$project$UI$Theme$spacing.bb), 52668 $author$project$Ui$width($author$project$Ui$fill) 52669 ]), 52670 A2( 52671 $elm$core$List$map, 52672 $author$project$Page$Group$MergeMember$entryActionRow(i18n), 52673 modifyActions)), 52674 ns: data.dP, 52675 i6: A2( 52676 $author$project$Translations$mergeEntriesRewrittenCount, 52677 $elm$core$String$fromInt( 52678 $elm$core$List$length(modifyActions)), 52679 i18n), 52680 fD: $author$project$Page$Group$MergeMember$ToggleEntriesDetails 52681 }), 52682 $elm$core$List$isEmpty(deleteActions) ? $author$project$Ui$none : $author$project$Page$Group$MergeMember$collapsible( 52683 { 52684 ew: A2( 52685 $author$project$Ui$column, 52686 _List_fromArray( 52687 [ 52688 $author$project$Ui$spacing($author$project$UI$Theme$spacing.bb), 52689 $author$project$Ui$width($author$project$Ui$fill) 52690 ]), 52691 A2( 52692 $elm$core$List$map, 52693 $author$project$Page$Group$MergeMember$entryActionRow(i18n), 52694 deleteActions)), 52695 ns: data.dT, 52696 i6: A2( 52697 $author$project$Translations$mergeSelfTransfersDeletedCount, 52698 $elm$core$String$fromInt( 52699 $elm$core$List$length(deleteActions)), 52700 i18n), 52701 fD: $author$project$Page$Group$MergeMember$ToggleSelfTransfersDetails 52702 }), 52703 $elm$core$List$isEmpty(prefActions) ? $author$project$Ui$none : $author$project$Page$Group$MergeMember$collapsible( 52704 { 52705 ew: A2( 52706 $author$project$Ui$column, 52707 _List_fromArray( 52708 [ 52709 $author$project$Ui$spacing($author$project$UI$Theme$spacing.bb), 52710 $author$project$Ui$width($author$project$Ui$fill) 52711 ]), 52712 A2( 52713 $elm$core$List$map, 52714 A2($author$project$Page$Group$MergeMember$prefActionRow, i18n, state), 52715 prefActions)), 52716 ns: data.dR, 52717 i6: A2( 52718 $author$project$Translations$mergePrefsUpdatedCount, 52719 $elm$core$String$fromInt( 52720 $elm$core$List$length(prefActions)), 52721 i18n), 52722 fD: $author$project$Page$Group$MergeMember$TogglePrefsDetails 52723 }), 52724 A3($author$project$Page$Group$MergeMember$retireLine, i18n, sourceMember, targetMember) 52725 ])); 52726 }); 52727var $author$project$Page$Group$MergeMember$isDelete = function (action) { 52728 if (action.$ === 1) { 52729 return true; 52730 } else { 52731 return false;
52732 } 52733}; 52734var $author$project$Page$Group$MergeMember$isModify = function (action) { 52735 if (!action.$) { 52736 return true; 52737 } else { 52738 return false; 52739 } 52740}; 52741var $author$project$Page$Group$MergeMember$isPref = function (action) { 52742 if (action.$ === 2) { 52743 return true; 52744 } else { 52745 return false; 52746 } 52747}; 52748var $author$project$Translations$mergeAuthorshipNote = function (_v0) { 52749 var lang = _v0; 52750 if (!lang) { 52751 return 'Original authorship of each entry is preserved. Only who paid and who benefited is rewritten.'; 52752 } else { 52753 return 'L\'auteur d\'origine de chaque entrée est conservé. Seuls les payeurs et bénéficiaires sont modifiés.'; 52754 } 52755}; 52756var $author$project$Translations$mergeIrreversibleWarning = F2( 52757 function (count, _v0) { 52758 var lang = _v0; 52759 if (!lang) { 52760 return 'This will create ' + (count + ' events and cannot be undone except by editing each entry back by hand.'); 52761 } else { 52762 return 'Cela créera ' + (count + ' événements. Revenir en arrière ne sera possible quâen éditant manuellement les changements nécessaires.'); 52763 } 52764 }); 52765var $author$project$Translations$mergeStep2Subtitle = function (_v0) { 52766 var lang = _v0; 52767 if (!lang) { 52768 return 'Review every effect, then type the name to confirm.'; 52769 } else { 52770 return 'Vérifie chaque effet, puis entre le nom pour confirmer.'; 52771 } 52772}; 52773var $author$project$Translations$mergeStep2Title = function (_v0) { 52774 var lang = _v0; 52775 if (!lang) { 52776 return 'Confirm merge'; 52777 } else { 52778 return 'Confirmer la fusion'; 52779 } 52780}; 52781var $author$project$Page$Group$MergeMember$BackToPick = {$: 2}; 52782var $author$project$Page$Group$MergeMember$ToneKeeping = 1; 52783var $feathericons$elm_feather$FeatherIcons$arrowLeft = A2( 52784 $feathericons$elm_feather$FeatherIcons$makeBuilder, 52785 'arrow-left', 52786 _List_fromArray( 52787 [ 52788 A2( 52789 $elm$svg$Svg$line, 52790 _List_fromArray( 52791 [ 52792 $elm$svg$Svg$Attributes$x1('19'), 52793 $elm$svg$Svg$Attributes$y1('12'), 52794 $elm$svg$Svg$Attributes$x2('5'), 52795 $elm$svg$Svg$Attributes$y2('12') 52796 ]), 52797 _List_Nil), 52798 A2( 52799 $elm$svg$Svg$polyline, 52800 _List_fromArray( 52801 [ 52802 $elm$svg$Svg$Attributes$points('12 19 5 12 12 5') 52803 ]), 52804 _List_Nil) 52805 ])); 52806var $author$project$Translations$mergeBackButton = function (_v0) { 52807 var lang = _v0; 52808 if (!lang) { 52809 return 'Change selection'; 52810 } else { 52811 return 'Changer la sélection'; 52812 } 52813}; 52814var $author$project$Translations$mergeKeepingLabel = function (_v0) { 52815 var lang = _v0; 52816 if (!lang) { 52817 return 'Keeping'; 52818 } else { 52819 return 'Conservé'; 52820 } 52821}; 52822var $author$project$Page$Group$MergeMember$Swap = {$: 1}; 52823var $author$project$UI$Components$iconButton = F2( 52824 function (attrs, config) { 52825 return A2( 52826 $author$project$Ui$el, 52827 A2( 52828 $elm$core$List$cons, 52829 $author$project$Ui$Input$button(config.e7), 52830 A2( 52831 $elm$core$List$cons, 52832 $author$project$Ui$Accessibility$description(config.i6), 52833 A2( 52834 $elm$core$List$cons, 52835 $author$project$Ui$width( 52836 $author$project$Ui$px($author$project$UI$Theme$sizing.i8)), 52837 A2( 52838 $elm$core$List$cons, 52839 $author$project$Ui$height( 52840 $author$project$Ui$px($author$project$UI$Theme$sizing.i8)), 52841 A2( 52842 $elm$core$List$cons, 52843 $author$project$Ui$rounded($author$project$UI$Theme$radius.aW), 52844 A2( 52845 $elm$core$List$cons, 52846 $author$project$Ui$contentCenterX, 52847 A2( 52848 $elm$core$List$cons, 52849 $author$project$Ui$contentCenterY, 52850 A2($elm$core$List$cons, $author$project$Ui$pointer, attrs)))))))), 52851 A2($author$project$UI$Components$featherIcon, config.dW, config.gv)); 52852 }); 52853var $author$project$Translations$mergeSwapButton = function (_v0) { 52854 var lang = _v0; 52855 if (!lang) { 52856 return 'Swap'; 52857 } else { 52858 return 'Inverser'; 52859 } 52860}; 52861var $feathericons$elm_feather$FeatherIcons$repeat = A2( 52862 $feathericons$elm_feather$FeatherIcons$makeBuilder, 52863 'repeat', 52864 _List_fromArray( 52865 [ 52866 A2( 52867 $elm$svg$Svg$polyline, 52868 _List_fromArray( 52869 [ 52870 $elm$svg$Svg$Attributes$points('17 1 21 5 17 9') 52871 ]), 52872 _List_Nil), 52873 A2( 52874 $elm$svg$Svg$path, 52875 _List_fromArray( 52876 [ 52877 $elm$svg$Svg$Attributes$d('M3 11V9a4 4 0 0 1 4-4h14') 52878 ]), 52879 _List_Nil), 52880 A2( 52881 $elm$svg$Svg$polyline, 52882 _List_fromArray( 52883 [ 52884 $elm$svg$Svg$Attributes$points('7 23 3 19 7 15') 52885 ]), 52886 _List_Nil), 52887 A2( 52888 $elm$svg$Svg$path, 52889 _List_fromArray( 52890 [ 52891 $elm$svg$Svg$Attributes$d('M21 13v2a4 4 0 0 1-4 4H3') 52892 ]), 52893 _List_Nil) 52894 ])); 52895var $author$project$Page$Group$MergeMember$swapButton = function (i18n) { 52896 return A2( 52897 $author$project$UI$Components$iconButton, 52898 _List_fromArray( 52899 [ 52900 $author$project$Ui$background($author$project$UI$Theme$base.en), 52901 $author$project$Ui$border($author$project$UI$Theme$border), 52902 $author$project$Ui$borderColor($author$project$UI$Theme$base.k3), 52903 $author$project$Ui$width($author$project$Ui$shrink), 52904 $author$project$Ui$width( 52905 $author$project$Ui$px($author$project$UI$Theme$sizing.i8)) 52906 ]), 52907 { 52908 gv: $feathericons$elm_feather$FeatherIcons$repeat, 52909 i6: $author$project$Translations$mergeSwapButton(i18n), 52910 e7: $author$project$Page$Group$MergeMember$Swap, 52911 dW: 18 52912 }); 52913}; 52914var $author$project$Page$Group$MergeMember$pairView = F3( 52915 function (i18n, source, target) { 52916 return A2( 52917 $author$project$Ui$column, 52918 _List_fromArray( 52919 [ 52920 $author$project$Ui$spacing($author$project$UI$Theme$spacing.aW), 52921 $author$project$Ui$width($author$project$Ui$fill) 52922 ]), 52923 _List_fromArray( 52924 [ 52925 A2( 52926 $author$project$Ui$row, 52927 _List_fromArray( 52928 [ 52929 $author$project$Ui$spacing($author$project$UI$Theme$spacing.aW), 52930 $author$project$Ui$width($author$project$Ui$fill), 52931 $author$project$Ui$contentCenterY 52932 ]), 52933 _List_fromArray( 52934 [ 52935 $author$project$Page$Group$MergeMember$memberSlot( 52936 { 52937 i6: $author$project$Translations$mergeRetiringLabel(i18n),
52938 dt: source, 52939 fE: 0 52940 }), 52941 $author$project$Page$Group$MergeMember$swapButton(i18n), 52942 $author$project$Page$Group$MergeMember$memberSlot( 52943 { 52944 i6: $author$project$Translations$mergeKeepingLabel(i18n), 52945 dt: target, 52946 fE: 1 52947 }) 52948 ])), 52949 A2( 52950 $author$project$UI$Components$btnOutline, 52951 _List_Nil, 52952 { 52953 gv: $elm$core$Maybe$Just( 52954 A2($author$project$UI$Components$featherIcon, 16, $feathericons$elm_feather$FeatherIcons$arrowLeft)), 52955 i6: $author$project$Translations$mergeBackButton(i18n), 52956 e7: $author$project$Page$Group$MergeMember$BackToPick 52957 }) 52958 ])); 52959 }); 52960var $author$project$Page$Group$MergeMember$banner = F4( 52961 function (colors, icon, message, maybeAction) { 52962 return A2( 52963 $author$project$Ui$row, 52964 _List_fromArray( 52965 [ 52966 $author$project$Ui$spacing($author$project$UI$Theme$spacing.aW), 52967 $author$project$Ui$padding($author$project$UI$Theme$spacing.aW), 52968 $author$project$Ui$rounded($author$project$UI$Theme$radius.aW), 52969 $author$project$Ui$background(colors.en), 52970 $author$project$Ui$border($author$project$UI$Theme$border), 52971 $author$project$Ui$borderColor(colors.k3), 52972 $author$project$Ui$width($author$project$Ui$fill), 52973 $author$project$Ui$contentCenterY 52974 ]), 52975 _List_fromArray( 52976 [ 52977 A2( 52978 $author$project$Ui$el, 52979 _List_fromArray( 52980 [ 52981 $author$project$Ui$Font$color(colors.k3), 52982 $author$project$Ui$width($author$project$Ui$shrink) 52983 ]), 52984 icon), 52985 A2( 52986 $author$project$Ui$el, 52987 _List_fromArray( 52988 [ 52989 $author$project$Ui$Font$size($author$project$UI$Theme$font.qk), 52990 $author$project$Ui$Font$color(colors.qI), 52991 $author$project$Ui$width($author$project$Ui$fill) 52992 ]), 52993 $author$project$Ui$text(message)), 52994 function () { 52995 if (!maybeAction.$) { 52996 var action = maybeAction.a; 52997 return A2( 52998 $author$project$Ui$el, 52999 _List_fromArray( 53000 [ 53001 $author$project$Ui$Input$button(action.e7), 53002 A2($author$project$Ui$paddingXY, $author$project$UI$Theme$spacing.aW, $author$project$UI$Theme$spacing.qk), 53003 $author$project$Ui$rounded($author$project$UI$Theme$radius.qk), 53004 $author$project$Ui$background(colors.k3), 53005 $author$project$Ui$Font$color($author$project$UI$Theme$base.h$), 53006 $author$project$Ui$Font$size($author$project$UI$Theme$font.qk), 53007 $author$project$Ui$Font$weight($author$project$UI$Theme$fontWeight.dL), 53008 $author$project$Ui$pointer, 53009 $author$project$Ui$width($author$project$Ui$shrink) 53010 ]), 53011 $author$project$Ui$text(action.i6)); 53012 } else { 53013 return $author$project$Ui$none; 53014 } 53015 }() 53016 ])); 53017 }); 53018var $feathericons$elm_feather$FeatherIcons$checkCircle = A2( 53019 $feathericons$elm_feather$FeatherIcons$makeBuilder, 53020 'check-circle', 53021 _List_fromArray( 53022 [ 53023 A2( 53024 $elm$svg$Svg$path, 53025 _List_fromArray( 53026 [ 53027 $elm$svg$Svg$Attributes$d('M22 11.08V12a10 10 0 1 1-5.93-9.14') 53028 ]), 53029 _List_Nil), 53030 A2( 53031 $elm$svg$Svg$polyline, 53032 _List_fromArray( 53033 [ 53034 $elm$svg$Svg$Attributes$points('22 4 12 14.01 9 11.01') 53035 ]), 53036 _List_Nil) 53037 ])); 53038var $author$project$Translations$mergeBannerBothReal = F2( 53039 function (source, _v0) { 53040 var lang = _v0; 53041 if (!lang) { 53042 return source + ' is a real member who has joined with a device. Make sure you mean to retire that one rather than the other.'; 53043 } else { 53044 return source + ' est un membre réel qui a rejoint avec un appareil. Vérifie que c\'est bien celui-là que tu veux retirer plutôt que l\'autre.'; 53045 } 53046 }); 53047var $author$project$Translations$mergeBannerRecommended = function (_v0) { 53048 var lang = _v0; 53049 if (!lang) { 53050 return 'Recommended direction: a virtual placeholder is being merged into a real member.'; 53051 } else { 53052 return 'Direction recommandée : un membre virtuel est fusionné dans un membre réel.'; 53053 } 53054}; 53055var $author$project$Translations$mergeBannerSwapHint = F2( 53056 function (data, _v0) { 53057 var lang = _v0; 53058 if (!lang) { 53059 return data.dY + (' is a real member but ' + (data.kz + ' is virtual. Consider swapping.')); 53060 } else { 53061 return data.dY + (' est un membre réel mais ' + (data.kz + ' est virtuel. Pense à inverser.')); 53062 } 53063 }); 53064var $author$project$Page$Group$MergeMember$suggestionBanner = F3( 53065 function (i18n, source, target) { 53066 var targetIsReal = !target.nL; 53067 var sourceIsReal = !source.nL; 53068 var _v0 = _Utils_Tuple2(sourceIsReal, targetIsReal); 53069 if (_v0.a) { 53070 if (!_v0.b) { 53071 return A4( 53072 $author$project$Page$Group$MergeMember$banner, 53073 $author$project$UI$Theme$warning, 53074 A2($author$project$UI$Components$featherIcon, 18, $feathericons$elm_feather$FeatherIcons$alertTriangle), 53075 A2( 53076 $author$project$Translations$mergeBannerSwapHint, 53077 {dY: source.bW, kz: target.bW}, 53078 i18n), 53079 $elm$core$Maybe$Just( 53080 { 53081 i6: $author$project$Translations$mergeSwapButton(i18n), 53082 e7: $author$project$Page$Group$MergeMember$Swap 53083 })); 53084 } else { 53085 return A4( 53086 $author$project$Page$Group$MergeMember$banner, 53087 $author$project$UI$Theme$warning, 53088 A2($author$project$UI$Components$featherIcon, 18, $feathericons$elm_feather$FeatherIcons$alertTriangle), 53089 A2($author$project$Translations$mergeBannerBothReal, source.bW, i18n), 53090 $elm$core$Maybe$Nothing); 53091 } 53092 } else { 53093 if (_v0.b) { 53094 return A4( 53095 $author$project$Page$Group$MergeMember$banner, 53096 $author$project$UI$Theme$success, 53097 A2($author$project$UI$Components$featherIcon, 18, $feathericons$elm_feather$FeatherIcons$checkCircle), 53098 $author$project$Translations$mergeBannerRecommended(i18n), 53099 $elm$core$Maybe$Nothing); 53100 } else { 53101 return $author$project$Ui$none; 53102 } 53103 } 53104 }); 53105var $author$project$Page$Group$MergeMember$warningCallout = function (message) { 53106 return A2( 53107 $author$project$Ui$row, 53108 _List_fromArray( 53109 [ 53110 $author$project$Ui$spacing($author$project$UI$Theme$spacing.qk), 53111 $author$project$Ui$padding($author$project$UI$Theme$spacing.aW),
53112 $author$project$Ui$rounded($author$project$UI$Theme$radius.aW), 53113 $author$project$Ui$background($author$project$UI$Theme$warning.en), 53114 $author$project$Ui$border($author$project$UI$Theme$border), 53115 $author$project$Ui$borderColor($author$project$UI$Theme$warning.k3), 53116 $author$project$Ui$width($author$project$Ui$fill), 53117 $author$project$Ui$contentCenterY 53118 ]), 53119 _List_fromArray( 53120 [ 53121 A2( 53122 $author$project$Ui$el, 53123 _List_fromArray( 53124 [ 53125 $author$project$Ui$Font$color($author$project$UI$Theme$warning.k3), 53126 $author$project$Ui$width($author$project$Ui$shrink) 53127 ]), 53128 A2($author$project$UI$Components$featherIcon, 18, $feathericons$elm_feather$FeatherIcons$alertTriangle)), 53129 A2( 53130 $author$project$Ui$el, 53131 _List_fromArray( 53132 [ 53133 $author$project$Ui$Font$size($author$project$UI$Theme$font.qk), 53134 $author$project$Ui$Font$color($author$project$UI$Theme$warning.qI), 53135 $author$project$Ui$width($author$project$Ui$fill) 53136 ]), 53137 $author$project$Ui$text(message)) 53138 ])); 53139}; 53140var $author$project$Page$Group$MergeMember$viewStep2 = F4( 53141 function (i18n, state, data, targetId) { 53142 var _v0 = _Utils_Tuple2( 53143 A2($elm$core$Dict$get, data.dZ, state.r), 53144 A2($elm$core$Dict$get, targetId, state.r)); 53145 if ((!_v0.a.$) && (!_v0.b.$)) { 53146 var sourceMember = _v0.a.a; 53147 var targetMember = _v0.b.a; 53148 var planActions = A3($author$project$Domain$MemberMerge$plan, data.dZ, targetId, state); 53149 var prefActions = A2($elm$core$List$filter, $author$project$Page$Group$MergeMember$isPref, planActions); 53150 var totalEvents = $elm$core$List$length(planActions); 53151 var modifyActions = A2($elm$core$List$filter, $author$project$Page$Group$MergeMember$isModify, planActions); 53152 var deleteActions = A2($elm$core$List$filter, $author$project$Page$Group$MergeMember$isDelete, planActions); 53153 return A2( 53154 $author$project$Ui$column, 53155 _List_fromArray( 53156 [ 53157 $author$project$Ui$spacing($author$project$UI$Theme$spacing.hE), 53158 $author$project$Ui$width($author$project$Ui$fill) 53159 ]), 53160 _List_fromArray( 53161 [ 53162 A2( 53163 $author$project$Page$Group$MergeMember$headingSection, 53164 $author$project$Translations$mergeStep2Title(i18n), 53165 $author$project$Translations$mergeStep2Subtitle(i18n)), 53166 A3($author$project$Page$Group$MergeMember$pairView, i18n, sourceMember, targetMember), 53167 A3($author$project$Page$Group$MergeMember$suggestionBanner, i18n, sourceMember, targetMember), 53168 A8($author$project$Page$Group$MergeMember$effectsSection, i18n, data, state, sourceMember, targetMember, modifyActions, deleteActions, prefActions), 53169 A2( 53170 $author$project$Ui$el, 53171 _List_fromArray( 53172 [ 53173 $author$project$Ui$Font$size($author$project$UI$Theme$font.qk), 53174 $author$project$Ui$Font$color($author$project$UI$Theme$base.aM) 53175 ]), 53176 $author$project$Ui$text( 53177 $author$project$Translations$mergeAuthorshipNote(i18n))), 53178 $author$project$Page$Group$MergeMember$warningCallout( 53179 A2( 53180 $author$project$Translations$mergeIrreversibleWarning, 53181 $elm$core$String$fromInt(totalEvents), 53182 i18n)), 53183 A3($author$project$Page$Group$MergeMember$confirmSection, i18n, data, sourceMember) 53184 ])); 53185 } else { 53186 return $author$project$Page$Group$MergeMember$memberNotFoundView(i18n); 53187 } 53188 }); 53189var $author$project$Page$Group$MergeMember$view = F4( 53190 function (i18n, toMsg, state, _v0) { 53191 var data = _v0; 53192 var _v1 = data.fA; 53193 if (_v1.$ === 1) { 53194 return A2( 53195 $author$project$Ui$map, 53196 toMsg, 53197 A3($author$project$Page$Group$MergeMember$viewStep1, i18n, state, data)); 53198 } else { 53199 var targetId = _v1.a; 53200 return A2( 53201 $author$project$Ui$map, 53202 toMsg, 53203 A4($author$project$Page$Group$MergeMember$viewStep2, i18n, state, data, targetId)); 53204 } 53205 }); 53206var $author$project$Page$Group$NewEntry$Shared$Submit = {$: 24}; 53207var $author$project$Translations$editEntrySubmit = function (_v0) { 53208 var lang = _v0; 53209 if (!lang) { 53210 return 'Save Changes'; 53211 } else { 53212 return 'Enregistrer'; 53213 } 53214}; 53215var $author$project$Page$Group$NewEntry$Shared$InputAmount = function (a) { 53216 return {$: 2, a: a}; 53217}; 53218var $author$project$Page$Group$NewEntry$Shared$InputCurrency = function (a) { 53219 return {$: 18, a: a}; 53220}; 53221var $elm$html$Html$option = _VirtualDom_node('option'); 53222var $elm$html$Html$select = _VirtualDom_node('select'); 53223var $elm$html$Html$Attributes$selected = $elm$html$Html$Attributes$boolProperty('selected'); 53224var $author$project$Page$Group$NewEntry$Shared$currencySelect = function (selected) { 53225 return $author$project$Ui$html( 53226 A2( 53227 $elm$html$Html$select, 53228 _List_fromArray( 53229 [ 53230 $elm$html$Html$Events$onInput( 53231 function (code) { 53232 var _v0 = $author$project$Domain$Currency$currencyFromCode(code); 53233 if (!_v0.$) { 53234 var c = _v0.a; 53235 return $author$project$Page$Group$NewEntry$Shared$InputCurrency(c); 53236 } else { 53237 return $author$project$Page$Group$NewEntry$Shared$InputCurrency(selected); 53238 } 53239 }), 53240 A2($elm$html$Html$Attributes$style, 'border', 'none'), 53241 A2($elm$html$Html$Attributes$style, 'background', 'transparent'), 53242 A2($elm$html$Html$Attributes$style, 'font', 'inherit'), 53243 A2($elm$html$Html$Attributes$style, 'color', 'inherit') 53244 ]), 53245 A2( 53246 $elm$core$List$map, 53247 function (c) { 53248 return A2( 53249 $elm$html$Html$option, 53250 _List_fromArray( 53251 [ 53252 $elm$html$Html$Attributes$value( 53253 $author$project$Domain$Currency$currencyCode(c)), 53254 $elm$html$Html$Attributes$selected( 53255 _Utils_eq(c, selected)) 53256 ]), 53257 _List_fromArray( 53258 [ 53259 $elm$html$Html$text( 53260 $author$project$Domain$Currency$currencyCode(c)) 53261 ])); 53262 }, 53263 $author$project$Domain$Currency$allCurrencies))); 53264}; 53265var $author$project$Page$Group$NewEntry$Shared$decimalInputAttr = $author$project$Ui$htmlAttribute( 53266 A2($elm$html$Html$Attributes$attribute, 'inputmode', 'decimal')); 53267var $dwayne$elm_field$Field$Advanced$errorToString = F2( 53268 function (_v0, error) { 53269 var onBlank = _v0.oo; 53270 var onSyntaxError = _v0.o3; 53271 var onValidationError = _v0.pc; 53272 var onCustomError = _v0.os; 53273 switch (error.$) { 53274 case 0: 53275 return onBlank; 53276 case 1: 53277 var s = error.a; 53278 return onSyntaxError(s); 53279 case 2: 53280 var s = error.a; 53281 return onValidationError(s); 53282 default: 53283 var e = error.a; 53284 return onCustomError(e); 53285 } 53286 }); 53287var $dwayne$elm_field$Field$errorToString = function (_v0) { 53288 var onBlank = _v0.oo; 53289 var onSyntaxError = _v0.o3; 53290 var onValidationError = _v0.pc; 53291 return $dwayne$elm_field$Field$Advanced$errorToString( 53292 {oo: onBlank, os: $elm$core$Basics$identity, o3: onSyntaxError, pc: onValidationError}); 53293}; 53294var $author$project$Translations$fieldInvalidFormat = function (_v0) { 53295 var lang = _v0; 53296 if (!lang) { 53297 return 'Invalid format.'; 53298 } else { 53299 return 'Format invalide.'; 53300 } 53301}; 53302var $dwayne$elm_validation$Validation$firstError = function (v) { 53303 if (v.$ === 1) { 53304 var _v1 = v.a; 53305 var e = _v1.a; 53306 return $elm$core$Maybe$Just(e); 53307 } else { 53308 return $elm$core$Maybe$Nothing; 53309 } 53310}; 53311var $dwayne$elm_field$Field$Advanced$firstError = function (_v0) { 53312 var processed = _v0.b.ae; 53313 return $dwayne$elm_validation$Validation$firstError(processed); 53314}; 53315var $dwayne$elm_field$Field$firstError = $dwayne$elm_field$Field$Advanced$firstError; 53316var $author$project$Page$Group$NewEntry$Shared$fieldError = F3( 53317 function (i18n, submitted, field) { 53318 if ($dwayne$elm_field$Field$isInvalid(field) && (submitted || $dwayne$elm_field$Field$isDirty(field))) { 53319 var message = function () { 53320 var _v0 = $dwayne$elm_field$Field$firstError(field); 53321 if (!_v0.$) { 53322 var err = _v0.a; 53323 return A2( 53324 $dwayne$elm_field$Field$errorToString, 53325 { 53326 oo: $author$project$Translations$fieldRequired(i18n), 53327 o3: function (_v1) { 53328 return $author$project$Translations$fieldInvalidFormat(i18
53328n); 53329 }, 53330 pc: function (_v2) { 53331 return $author$project$Translations$fieldInvalidFormat(i18n); 53332 } 53333 }, 53334 err); 53335 } else { 53336 return $author$project$Translations$fieldRequired(i18n); 53337 } 53338 }(); 53339 return A2( 53340 $author$project$Ui$el, 53341 _List_fromArray( 53342 [ 53343 $author$project$Ui$Font$size($author$project$UI$Theme$font.qk), 53344 $author$project$Ui$Font$color($author$project$UI$Theme$danger.qI) 53345 ]), 53346 $author$project$Ui$text(message)); 53347 } else { 53348 return $author$project$Ui$none; 53349 } 53350 }); 53351var $author$project$Page$Group$NewEntry$Shared$fieldTitle = F2( 53352 function (label, required) { 53353 return A2( 53354 $author$project$Ui$row, 53355 _List_fromArray( 53356 [ 53357 $author$project$Ui$spacing($author$project$UI$Theme$spacing.bb), 53358 $author$project$Ui$width($author$project$Ui$shrink) 53359 ]), 53360 _List_fromArray( 53361 [ 53362 A2( 53363 $author$project$Ui$el, 53364 _List_fromArray( 53365 [ 53366 $author$project$Ui$Font$size($author$project$UI$Theme$font.qk), 53367 $author$project$Ui$Font$weight($author$project$UI$Theme$fontWeight.dL), 53368 $author$project$Ui$Font$color($author$project$UI$Theme$base.aM) 53369 ]), 53370 $author$project$Ui$text(label)), 53371 required ? A2( 53372 $author$project$Ui$el, 53373 _List_fromArray( 53374 [ 53375 $author$project$Ui$Font$color($author$project$UI$Theme$primary.kl), 53376 $author$project$Ui$Font$size($author$project$UI$Theme$font.qk) 53377 ]), 53378 $author$project$Ui$text('*')) : $author$project$Ui$none 53379 ])); 53380 }); 53381var $author$project$Page$Group$NewEntry$Shared$formField = F2( 53382 function (config, children) { 53383 return A2( 53384 $author$project$Ui$column, 53385 _List_fromArray( 53386 [ 53387 $author$project$Ui$width($author$project$Ui$fill), 53388 $author$project$Ui$spacing($author$project$UI$Theme$spacing.bb) 53389 ]), 53390 A2( 53391 $elm$core$List$cons, 53392 A2($author$project$Page$Group$NewEntry$Shared$fieldTitle, config.i6, config.hd), 53393 children)); 53394 }); 53395var $author$project$Page$Group$NewEntry$Shared$formHint = function (text) { 53396 return A2( 53397 $author$project$Ui$el, 53398 _List_fromArray( 53399 [ 53400 $author$project$Ui$Font$size($author$project$UI$Theme$font.qk), 53401 $author$project$Ui$Font$color($author$project$UI$Theme$base.aM) 53402 ]), 53403 $author$project$Ui$text(text)); 53404}; 53405var $author$project$Translations$newEntryAmountHint = function (_v0) { 53406 var lang = _v0; 53407 if (!lang) { 53408 return 'Total amount paid.'; 53409 } else { 53410 return 'Montant total payé.'; 53411 } 53412}; 53413var $author$project$Translations$newEntryAmountLabel = function (_v0) { 53414 var lang = _v0; 53415 if (!lang) { 53416 return 'Amount'; 53417 } else { 53418 return 'Montant'; 53419 } 53420}; 53421var $author$project$Translations$newEntryAmountPlaceholder = function (_v0) { 53422 var lang = _v0; 53423 if (!lang) { 53424 return 'e.g. 42.50'; 53425 } else { 53426 return 'ex. 42,50'; 53427 } 53428}; 53429var $author$project$Page$Group$NewEntry$Shared$amountCurrencyField = F2( 53430 function (i18n, data) { 53431 var field = A2( 53432 $dwayne$elm_form$Form$get, 53433 function ($) { 53434 return $.ef; 53435 }, 53436 data.w); 53437 return A2( 53438 $author$project$Page$Group$NewEntry$Shared$formField, 53439 { 53440 i6: $author$project$Translations$newEntryAmountLabel(i18n), 53441 hd: true 53442 }, 53443 _List_fromArray( 53444 [ 53445 A2( 53446 $author$project$Ui$row, 53447 _List_fromArray( 53448 [ 53449 $author$project$Ui$spacing($author$project$UI$Theme$spacing.qk), 53450 $author$project$Ui$width($author$project$Ui$fill), 53451 $author$project$Ui$contentCenterY 53452 ]), 53453 _List_fromArray( 53454 [ 53455 A2( 53456 $author$project$Ui$Input$text, 53457 _List_fromArray( 53458 [ 53459 $author$project$Ui$width($author$project$Ui$fill), 53460 $author$project$Page$Group$NewEntry$Shared$decimalInputAttr 53461 ]), 53462 { 53463 i6: $author$project$Ui$Input$labelHidden( 53464 $author$project$Translations$newEntryAmountLabel(i18n)), 53465 oq: $author$project$Page$Group$NewEntry$Shared$InputAmount, 53466 pt: $elm$core$Maybe$Just( 53467 $author$project$Translations$newEntryAmountPlaceholder(i18n)), 53468 qI: $dwayne$elm_field$Field$toRawString(field) 53469 }), 53470 $author$project$Page$Group$NewEntry$Shared$currencySelect(data.bg) 53471 ])), 53472 $author$project$Page$Group$NewEntry$Shared$formHint( 53473 $author$project$Translations$newEntryAmountHint(i18n)), 53474 A3($author$project$Page$Group$NewEntry$Shared$fieldError, i18n, data.d_, field) 53475 ])); 53476 }); 53477var $author$project$Page$Group$NewEntry$Shared$AddAttachment = {$: 4}; 53478var $author$project$Page$Group$NewEntry$Shared$InputAttachmentLabel = F2( 53479 function (a, b) { 53480 return {$: 6, a: a, b: b}; 53481 }); 53482var $author$project$Page$Group$NewEntry$Shared$InputAttachmentUrl = F2( 53483 function (a, b) { 53484 return {$: 7, a: a, b: b}; 53485 }); 53486var $author$project$Page$Group$NewEntry$Shared$RemoveAttachment = function (a) { 53487 return {$: 5, a: a}; 53488}; 53489var $author$project$Page$Group$NewEntry$Shared$errorWhen = F2( 53490 function (condition, message) { 53491 return condition ? A2( 53492 $author$project$Ui$el, 53493 _List_fromArray( 53494 [ 53495 $author$project$Ui$Font$size($author$project$UI$Theme$font.qk), 53496 $author$project$Ui$Font$color($author$project$UI$Theme$danger.qI) 53497 ]), 53498 $author$project$Ui$text(message)) : $author$project$Ui$none; 53499 }); 53500var $author$project$Translations$newEntryAttachmentLabelPlaceholder = function (_v0) { 53501 var lang = _v0; 53502 if (!lang) { 53503 return 'Label (optional)'; 53504 } else { 53505 return 'Intitulé (facultatif)'; 53506 } 53507}; 53508var $author$project$Page$Group$NewEntry$Shared$attachmentRow = F4( 53509 function (i18n, submitted, index, attachment) { 53510 var invalidUrl = (!$author$project$Page$Group$NewEntry$Shared$isValidAttachmentUrl( 53511 $elm$core$String$trim(attachment.kS))) && (($elm$core$String$trim(attachment.i6) !== '') || ($elm$core$String$trim(attachment.kS) !== '')); 53512 return A2( 53513 $author$project$Ui$column, 53514 _List_fromArray( 53515 [ 53516 $author$project$Ui$spacing($author$project$UI$Theme$spacing.bb), 53517 $author$project$Ui$width($author$project$Ui$fill) 53518 ]), 53519 _List_fromArray( 53520 [ 53521 A2( 53522 $author$project$Ui$row, 53523 _List_fromArray( 53524 [ 53525 $author$project$Ui$spacing($author$project$UI$Theme$spacing.qk), 53526 $author$project$Ui$width($author$project$Ui$fill), 53527 $author$project$Ui$contentCenterY 53528 ]), 53529 _List_fromArray( 53530 [ 53531 A2( 53532 $author$project$Ui$Input$text, 53533 _List_fromArray( 53534 [ 53535 $author$project$Ui$width($author$project$Ui$fill) 53536 ]), 53537 { 53538 i6: $author$project$Ui$Input$labelHidden( 53539 $author$project$Translations$newEntryAttachmentLabelPlaceholder(i18n)), 53540 oq: $author$project$Page$Group$NewEntry$Shared$InputAttachmentLabel(index), 53541 pt: $elm$core$Maybe$Just( 53542 $author$project$Translations$newEntryAttachmentLabelPlaceholder(i18n)), 53543 qI: attachment.i6 53544 }), 53545 A2( 53546 $author$project$UI$Components$btnOutline, 53547 _List_fromArray( 53548 [ 53549 $author$project$Ui$width($author$project$Ui$shrink), 53550 A2($author$project$Ui$paddingXY, $author$project$UI$Theme$spacing.aW, $author$project$UI$Theme$spacing.qk) 53551 ]), 53552 { 53553 gv: $elm$core$Maybe$Just( 53554 A2($author$project$UI$Components$featherIcon, 14, $feathericons$elm_feather$FeatherIcons$trash2)), 53555 i6: $author$project$Translations$groupSettingsRemoveLink(i18n), 53556 e7: $author$project$Page$Group$NewEntry$Shared$RemoveAttachment(index) 53557 }) 53558 ])), 53559 A2( 53560 $author$project$Ui$Input$text, 53561 _List_fromArray( 53562 [ 53563 $author$project$Ui$width($author$project$Ui$fill) 53564 ]), 53565 { 53566 i6: $author$project$Ui$Input$labelHidden( 53567 $author$project$Translations$groupSettingsLinkUrlPlaceholder(i18n)), 53568 oq: $author$project$Page$Group$NewEntry$Shared$InputAttachmentUrl(index), 53569 pt: $elm$core$Maybe$Just( 53570 $author$project$Translations$groupSettingsLinkUrlPlaceholder(i18n)), 53571 qI: attachment.kS 53572 }), 53573 A2( 53574 $author$project$Page$Group$NewEntry$Shared$errorWhen, 53575 submitted && invalidUrl, 53576 $author$project$Translations$fieldInvalidUrl(i18n)) 53577 ])); 53578 }); 53579var $author$project$Translations$newEntryAttachmentsHint = function (_v0) { 53580 var lang = _v0; 53581 if (!lang) { 53582 return 'Take a photo, share it to your cloud storage, then copy the link and paste it here.'; 53583 } else { 53584 return 'Prends une photo, partage-la sur ton stockage en ligne, puis copie le lien et colle-le ici.'; 53585 } 53586}; 53587var $author$project$Translations$newEntryAttachmentsLabel = function (_v0) { 53588 var lang = _v0; 53589 if (!lang) { 53590 return 'Attachments'; 53591 } else { 53592 return 'Pièces jointes'; 53593 } 53594}; 53595var $author$project$Page$Group$NewEntry$Shared$attachmentsField = F2( 53596 function (i18n, data) { 53597 return A2( 53598 $author$project$Page$Group$NewEntry$Shared$formField, 53599 { 53600 i6: $author$project$Translations$newEntryAttachmentsLabel(i18n), 53601 hd: false 53602 }, 53603 _Utils_ap( 53604 A2( 53605 $elm$core$List$indexedMap, 53606 A2($author$project$Page$Group$NewEntry$Shared$attachmentRow, i18n, data.d_), 53607 data.ce), 53608 _List_fromArray( 53609 [ 53610 A2( 53611 $author$project$UI$Components$btnOutline, 53612 _List_fromArray( 53613 [ 53614 $author$project$Ui$width($author$project$Ui$shrink), 53615 A2($author$project$Ui$paddingXY, $author$project$UI$Theme$spacing.aW, $author$project$UI$Theme$spacing.qk) 53616 ]), 53617 { 53618 gv: $elm$core$Maybe$Just( 53619 A2($author$project$UI$Components$featherIcon, 16, $feathericons$elm_feather$FeatherIcons$plus)), 53620 i6: $author$project$Translations$groupSettingsAddLink(i18n), 53621 e7: $author$project$Page$Group$NewEntry$Shared$AddAttachment 53622 }), 53623 $author$project$Page$Group$NewEntry$Shared$formHint( 53624 $author$project$Translations$newEntryAttachmentsHint(i18n)) 53625 ]))); 53626 }); 53627var $author$project$Page$Group$NewEntry$Shared$InputSplitMode = function (a) { 53628 return {$: 13, a: a}; 53629}; 53630var $author$project$Page$Group$NewEntry$Shared$InputExactAmount = F2( 53631 function (a, b) { 53632 return {$: 14, a: a, b: b}; 53633 }); 53634var $author$project$Page$Group$NewEntry$Shared$ToggleBeneficiary = function (a) { 53635 return {$: 10, a: a}; 53636}; 53637var $author$project$Page$Group$NewEntry$Shared$DecrementShares = function (a) { 53638 return {$: 12, a: a}; 53639}; 53640var $author$project$Page$Group$NewEntry$Shared$IncrementShares = function (a) { 53641 return {$: 11, a: a}; 53642}; 53643var $feathericons$elm_feather$FeatherIcons$minus = A2( 53644 $feathericons$elm_feather$FeatherIcons$makeBuilder, 53645 'minus', 53646 _List_fromArray( 53647 [ 53648 A2( 53649 $elm$svg$Svg$line, 53650 _List_fromArray( 53651 [ 53652 $elm$svg$Svg$Attributes$x1('5'), 53653 $elm$svg$Svg$Attributes$y1('12'), 53654 $elm$svg$Svg$Attributes$x2('19'), 53655 $elm$svg$Svg$Attributes$y2('12') 53656 ]), 53657 _List_Nil) 53658 ])); 53659var $author$project$Page$Group$NewEntry$Shared$stepperBtn = F3( 53660 function (onPress, icon, enabled) { 53661 return A2( 53662 $author$project$Ui$el, 53663 A2( 53664 $elm$core$List$cons, 53665 $author$project$Ui$width( 53666 $author$project$Ui$px($author$project$UI$Theme$sizing.aW)), 53667 A2( 53668 $elm$core$List$cons, 53669 $author$project$Ui$height( 53670 $author$project$Ui$px($author$project$UI$Theme$sizing.aW)), 53671 A2( 53672 $elm$core$List$cons, 53673 $author$project$Ui$contentCenterX, 53674 A2( 53675 $elm$core$List$cons, 53676 $author$project$Ui$contentCenterY, 53677 enabled ? _List_fromArray( 53678 [ 53679 $author$project$Ui$Input$button(onPress), 53680 $author$project$Ui$pointer, 53681 $author$project$Ui$Font$color($author$project$UI$Theme$base.qI) 53682 ]) : _List_fromArray( 53683 [ 53684 $author$project$Ui$Font$color($author$project$UI$Theme$base.k3) 53685 ]))))), 53686 A2($author$project$UI$Components$featherIcon, $author$project$UI$Theme$sizing.bb, icon)); 53687 }); 53688var $author$project$Ui$widthMin = function (x) { 53689 return A2( 53690 $author$project$Internal$Model2$styleAndClass, 53691 $author$project$Internal$Flag$skip, 53692 { 53693 f: $author$project$Internal$Style2$classes.rh, 53694 qz: 'min-width', 53695 qA: $author$project$Internal$Style2$px(x) 53696 }); 53697}; 53698var $author$project$Page$Group$NewEntry$Shared$shareStepper = F2( 53699 function (memberId, shares) { 53700 return A2( 53701 $author$project$Ui$row, 53702 _List_fromArray( 53703 [ 53704 $author$project$Ui$spacing($author$project$UI$Theme$spacing.bb), 53705 $author$project$Ui$contentCenterY,
53706 $author$project$Ui$rounded($author$project$UI$Theme$radius.aW), 53707 $author$project$Ui$border($author$project$UI$Theme$border), 53708 $author$project$Ui$borderColor($author$project$UI$Theme$base.k3), 53709 A2($author$project$Ui$paddingXY, $author$project$UI$Theme$spacing.bb, 0) 53710 ]), 53711 _List_fromArray( 53712 [ 53713 A3( 53714 $author$project$Page$Group$NewEntry$Shared$stepperBtn, 53715 $author$project$Page$Group$NewEntry$Shared$DecrementShares(memberId), 53716 $feathericons$elm_feather$FeatherIcons$minus, 53717 shares > 0), 53718 A2( 53719 $author$project$Ui$el, 53720 _List_fromArray( 53721 [ 53722 $author$project$Ui$Font$center, 53723 $author$project$Ui$Font$weight($author$project$UI$Theme$fontWeight.dL), 53724 $author$project$Ui$widthMin($author$project$UI$Theme$sizing.bb) 53725 ]), 53726 $author$project$Ui$text( 53727 $elm$core$String$fromInt(shares))), 53728 A3( 53729 $author$project$Page$Group$NewEntry$Shared$stepperBtn, 53730 $author$project$Page$Group$NewEntry$Shared$IncrementShares(memberId), 53731 $feathericons$elm_feather$FeatherIcons$plus, 53732 true) 53733 ])); 53734 }); 53735var $author$project$UI$Components$AvatarNeutral = 1; 53736var $author$project$UI$Components$avatarIcon = F2( 53737 function (color, icon) { 53738 var _v0 = function () { 53739 switch (color) { 53740 case 0: 53741 return _Utils_Tuple2($author$project$UI$Theme$primary.qR, $author$project$UI$Theme$primary.k3); 53742 case 1: 53743 return _Utils_Tuple2($author$project$UI$Theme$base.qR, $author$project$UI$Theme$base.aM); 53744 case 2: 53745 return _Utils_Tuple2($author$project$UI$Theme$base.en, $author$project$UI$Theme$base.aM); 53746 default: 53747 return _Utils_Tuple2($author$project$UI$Theme$danger.qR, $author$project$UI$Theme$danger.k3); 53748 } 53749 }(); 53750 var bgColor = _v0.a; 53751 var strokeColor = _v0.b; 53752 return A2( 53753 $author$project$Ui$el, 53754 _List_fromArray( 53755 [ 53756 $author$project$Ui$width( 53757 $author$project$Ui$px($author$project$UI$Theme$sizing.i8)), 53758 $author$project$Ui$height( 53759 $author$project$Ui$px($author$project$UI$Theme$sizing.i8)), 53760 $author$project$Ui$rounded($author$project$UI$Theme$radius.hF), 53761 $author$project$Ui$background(bgColor), 53762 $author$project$Ui$Font$color(strokeColor), 53763 $author$project$Ui$contentCenterX, 53764 $author$project$Ui$contentCenterY 53765 ]), 53766 A2($author$project$UI$Components$featherIcon, 20, icon)); 53767 }); 53768var $author$project$Ui$Anim$borderColor = function (clr) { 53769 return A2($author$project$Animator$color, 'border-color', clr); 53770}; 53771var $feathericons$elm_feather$FeatherIcons$check = A2( 53772 $feathericons$elm_feather$FeatherIcons$makeBuilder, 53773 'check', 53774 _List_fromArray( 53775 [ 53776 A2( 53777 $elm$svg$Svg$polyline, 53778 _List_fromArray( 53779 [ 53780 $elm$svg$Svg$Attributes$points('20 6 9 17 4 12') 53781 ]), 53782 _List_Nil) 53783 ])); 53784var $author$project$UI$Components$togglePill = function (config) { 53785 var _v0 = config.hj ? _Utils_Tuple3($author$project$UI$Theme$primary.kl, $author$project$UI$Theme$primary.h$, 0) : _Utils_Tuple3($author$project$UI$Theme$base.kl, $author$project$UI$Theme$base.h$, 1); 53786 var borderClr = _v0.a; 53787 var backgroundColor = _v0.b; 53788 var avatarColor = _v0.c; 53789 var avatarContent = function () { 53790 if (config.hj) { 53791 return A2($author$project$UI$Components$avatarIcon, avatarColor, $feathericons$elm_feather$FeatherIcons$check); 53792 } else { 53793 var _v1 = config.gv; 53794 if (!_v1.$) { 53795 var icon = _v1.a; 53796 return A2($author$project$UI$Components$avatarIcon, avatarColor, icon); 53797 } else { 53798 return A2( 53799 $author$project$UI$Components$avatar, 53800 avatarColor, 53801 A2( 53802 $elm$core$String$left, 53803 2, 53804 $elm$core$String$toUpper(config.i6))); 53805 } 53806 } 53807 }(); 53808 return A2( 53809 $author$project$Ui$row, 53810 _List_fromArray( 53811 [ 53812 $author$project$Ui$Input$button(config.e7), 53813 $author$project$Ui$width($author$project$Ui$shrink), 53814 $author$project$Ui$paddingWith( 53815 {lI: 0, nz: 0, pW: $author$project$UI$Theme$spacing.qk, qW: 0}), 53816 $author$project$Ui$rounded($author$project$UI$Theme$radius.hF), 53817 $author$project$Ui$border($author$project$UI$Theme$border), 53818 $author$project$Ui$spacing($author$project$UI$Theme$spacing.qk), 53819 $author$project$Ui$contentCenterY, 53820 $author$project$Ui$pointer, 53821 A2( 53822 $author$project$Ui$Anim$transition, 53823 $author$project$Ui$Anim$ms(200), 53824 _List_fromArray( 53825 [ 53826 $author$project$Ui$Anim$borderColor(borderClr), 53827 $author$project$Ui$Anim$backgroundColor(backgroundColor) 53828 ])) 53829 ]), 53830 _List_fromArray( 53831 [ 53832 avatarContent, 53833 A2( 53834 $author$project$Ui$el, 53835 _List_fromArray( 53836 [ 53837 $author$project$Ui$Font$weight($author$project$UI$Theme$fontWeight.nI) 53838 ]), 53839 $author$project$Ui$text(config.i6)) 53840 ])); 53841}; 53842var $author$project$Page$Group$NewEntry$Shared$zeroAmountPlaceholder = F2( 53843 function (i18n, currency) { 53844 return A3( 53845 $author$project$Format$formatCentsForInput, 53846 $author$project$Translations$currentLanguage(i18n), 53847 0, 53848 currency); 53849 }); 53850var $author$project$Page$Group$NewEntry$Shared$beneficiaryRow = F3( 53851 function (i18n, data, member) { 53852 var totalShares = $elm$core$List$sum( 53853 $elm$core$Dict$values(data.em)); 53854 var isSelected = A2($elm$core$Dict$member, member.aj, data.em); 53855 var rightControl = function () { 53856 var _v2 = data.b2; 53857 if (!_v2) { 53858 return A2( 53859 $author$project$Page$Group$NewEntry$Shared$shareStepper, 53860 member.aj, 53861 A2( 53862 $elm$core$Maybe$withDefault, 53863 0, 53864 A2($elm$core$Dict$get, member.aj, data.em))); 53865 } else { 53866 return isSelected ? A2( 53867 $author$project$Ui$row, 53868 _List_fromArray( 53869 [ 53870 $author$project$Ui$spacing($author$project$UI$Theme$spacing.bb), 53871 $author$project$Ui$contentCenterY 53872 ]), 53873 _List_fromArray( 53874 [ 53875 A2( 53876 $author$project$Ui$Input$text, 53877 _List_fromArray( 53878 [ 53879 $author$project$Ui$width( 53880 $author$project$Ui$px(100)), 53881 $author$project$Page$Group$NewEntry$Shared$decimalInputAttr 53882 ]), 53883 { 53884 i6: $author$project$Ui$Input$labelHidden(member.bW), 53885 oq: $author$project$Page$Group$NewEntry$Shared$InputExactAmount(member.aj), 53886 pt: $elm$core$Maybe$Just( 53887 A2($author$project$Page$Group$NewEntry$Shared$zeroAmountPlaceholder, i18n, data.bg)), 53888 qI: A2( 53889 $elm$core$Maybe$withDefault, 53890 '', 53891 A2($elm$core$Dict$get, member.aj, data.bj)) 53892 }), 53893 A2( 53894 $author$project$Ui$el, 53895 _List_fromArray( 53896 [ 53897 $author$project$Ui$Font$size($author$project$UI$Theme$font.qk), 53898 $author$project$Ui$Font$color($author$project$UI$Theme$base.aM) 53899 ]), 53900 $author$project$Ui$text( 53901 $author$project$Domain$Currency$currencySymbol(data.bg))) 53902 ])) : $author$project$Ui$none; 53903 } 53904 }(); 53905 var splitAmount = function () { 53906 if ((!isSelected) || (!totalShares)) { 53907 return $author$project$Ui$none; 53908 } else { 53909 var _v0 = data.b2; 53910 if (!_v0) { 53911 var totalAmountCents = A2( 53912 $elm$core$Maybe$withDefault, 53913 0, 53914 $dwayne$elm_field$Field$toMaybe( 53915 A2( 53916 $dwayne$elm_form$Form$get, 53917 function ($) { 53918 return $.ef; 53919 }, 53920 data.w))); 53921 var allocatedAmounts = $elm$core$Dict$fromList( 53922 A2( 53923 $author$project$Domain$Balance$computeBeneficiarySplit, 53924 totalAmountCents, 53925 A2( 53926 $elm$core$List$map, 53927 function (_v1) { 53928 var memberId = _v1.a; 53929 var memberShares = _v1.b; 53930 return $author$project$Domain$Entry$ShareBeneficiary( 53931 {e_: memberId, qc: memberShares}); 53932 }, 53933 $elm$core$Dict$toList(data.em)))); 53934 var cents = A2( 53935 $elm$core$Maybe$withDefault, 53936 0, 53937 A2($elm$core$Dict$get, member.aj, allocatedAmounts)); 53938 return A2( 53939 $author$project$Ui$el, 53940 _List_fromArray( 53941 [ 53942 $author$project$Ui$Font$size($author$project$UI$Theme$font.qk), 53943 $author$project$Ui$Font$color($author$project$UI$Theme$base.aM) 53944 ]), 53945 $author$project$Ui$text( 53946 A3( 53947 $author$project$Format$formatCentsWithCurrency, 53948 $author$project$Translations$currentLanguage(i18n), 53949 cents, 53950 data.bg))); 53951 } else { 53952 return $author$project$Ui$none; 53953 } 53954 } 53955 }(); 53956 return A2( 53957 $author$project$Ui$row, 53958 _List_fromArray( 53959 [ 53960 $author$project$Ui$width($author$project$Ui$fill), 53961 $author$project$Ui$spacing($author$project$UI$Theme$spacing.qk), 53962 $author$project$Ui$contentCenterY 53963 ]), 53964 _List_fromArray( 53965 [ 53966 $author$project$UI$Components$togglePill( 53967 { 53968 gv: $elm$core$Maybe$Nothing, 53969 i6: member.bW, 53970 e7: $author$project$Page$Group$NewEntry$Shared$ToggleBeneficiary(member.aj), 53971 hj: isSelected 53972 }), 53973 splitAmount, 53974 A2( 53975 $author$project$Ui$el, 53976 _List_fromArray( 53977 [$author$project$Ui$alignRight]), 53978 rightControl) 53979 ])); 53980 }); 53981var $author$project$Translations$newEntryBeneficiariesLabel = function (_v0) { 53982 var lang = _v0; 53983 if (!lang) { 53984 return 'Split among'; 53985 } else { 53986 return 'Partagé entre'; 53987 } 53988}; 53989var $author$project$Translations$newEntryExactMismatch = function (_v0) { 53990 var lang = _v0; 53991 if (!lang) { 53992 return 'Exact amounts must add up to the total.'; 53993 } else {
53994 return 'Les montants exacts doivent correspondre au total.'; 53995 } 53996}; 53997var $author$project$Translations$newEntryNoBeneficiaries = function (_v0) { 53998 var lang = _v0; 53999 if (!lang) { 54000 return 'Select at least one member.'; 54001 } else { 54002 return 'Sélectionne au moins un membre.'; 54003 } 54004}; 54005var $author$project$Translations$newEntryPartsLabel = function (_v0) { 54006 var lang = _v0; 54007 if (!lang) { 54008 return 'Shares'; 54009 } else { 54010 return 'Parts'; 54011 } 54012}; 54013var $author$project$Translations$newEntrySplitExact = function (_v0) { 54014 var lang = _v0; 54015 if (!lang) { 54016 return 'Exact amounts'; 54017 } else { 54018 return 'Montants exacts'; 54019 } 54020}; 54021var $author$project$Page$Group$NewEntry$Shared$toggleSplitMode = function (mode) { 54022 if (!mode) { 54023 return 1; 54024 } else { 54025 return 0; 54026 } 54027}; 54028var $author$project$Page$Group$NewEntry$Shared$beneficiariesField = F4( 54029 function (i18n, hint, activeMembers, data) { 54030 var partsColumnHeader = function () { 54031 var _v1 = data.b2; 54032 if (!_v1) { 54033 return A2( 54034 $author$project$Ui$el, 54035 _List_fromArray( 54036 [ 54037 $author$project$Ui$alignRight, 54038 $author$project$Ui$Font$size($author$project$UI$Theme$font.qk), 54039 $author$project$Ui$Font$color($author$project$UI$Theme$base.aM) 54040 ]), 54041 $author$project$Ui$text( 54042 $author$project$Translations$newEntryPartsLabel(i18n))); 54043 } else { 54044 return $author$project$Ui$none; 54045 } 54046 }(); 54047 var headerRow = A2( 54048 $author$project$Ui$row, 54049 _List_fromArray( 54050 [ 54051 $author$project$Ui$width($author$project$Ui$fill), 54052 $author$project$Ui$contentCenterY 54053 ]), 54054 _List_fromArray( 54055 [ 54056 A2( 54057 $author$project$Page$Group$NewEntry$Shared$fieldTitle, 54058 $author$project$Translations$newEntryBeneficiariesLabel(i18n), 54059 true), 54060 A2( 54061 $author$project$Ui$row, 54062 _List_fromArray( 54063 [ 54064 $author$project$Ui$alignRight, 54065 $author$project$Ui$spacing($author$project$UI$Theme$spacing.qk), 54066 $author$project$Ui$contentCenterY 54067 ]), 54068 _List_fromArray( 54069 [ 54070 A2( 54071 $author$project$Ui$el, 54072 _List_fromArray( 54073 [ 54074 $author$project$Ui$Font$size($author$project$UI$Theme$font.qk), 54075 $author$project$Ui$Font$color($author$project$UI$Theme$base.aM) 54076 ]), 54077 $author$project$Ui$text( 54078 $author$project$Translations$newEntrySplitExact(i18n))), 54079 $author$project$UI$Components$toggle( 54080 { 54081 nr: data.b2 === 1, 54082 e7: $author$project$Page$Group$NewEntry$Shared$InputSplitMode( 54083 $author$project$Page$Group$NewEntry$Shared$toggleSplitMode(data.b2)) 54084 }) 54085 ])) 54086 ])); 54087 var exactMismatchError = function () { 54088 var _v0 = data.b2; 54089 if (_v0 === 1) { 54090 var totalExact = $elm$core$List$sum( 54091 A2( 54092 $elm$core$List$filterMap, 54093 function (mid) { 54094 return A2( 54095 $elm$core$Maybe$andThen, 54096 $author$project$Page$Group$NewEntry$Shared$parseAmountCents(data.bg), 54097 A2($elm$core$Dict$get, mid, data.bj)); 54098 }, 54099 $elm$core$Dict$keys(data.em))); 54100 var totalAmount = A2( 54101 $elm$core$Maybe$withDefault, 54102 0, 54103 $dwayne$elm_field$Field$toMaybe( 54104 A2( 54105 $dwayne$elm_form$Form$get, 54106 function ($) { 54107 return $.ef; 54108 }, 54109 data.w))); 54110 return A2( 54111 $author$project$Page$Group$NewEntry$Shared$errorWhen, 54112 data.d_ && (!_Utils_eq(totalExact, totalAmount)), 54113 $author$project$Translations$newEntryExactMismatch(i18n)); 54114 } else { 54115 return $author$project$Ui$none; 54116 } 54117 }(); 54118 return A2( 54119 $author$project$Ui$column, 54120 _List_fromArray( 54121 [ 54122 $author$project$Ui$spacing($author$project$UI$Theme$spacing.qk), 54123 $author$project$Ui$width($author$project$Ui$fill) 54124 ]), 54125 _List_fromArray( 54126 [ 54127 headerRow, 54128 $author$project$Page$Group$NewEntry$Shared$formHint(hint), 54129 partsColumnHeader, 54130 A2( 54131 $author$project$Ui$column, 54132 _List_fromArray( 54133 [ 54134 $author$project$Ui$spacing($author$project$UI$Theme$spacing.qk), 54135 $author$project$Ui$width($author$project$Ui$fill) 54136 ]), 54137 A2( 54138 $elm$core$List$map, 54139 A2($author$project$Page$Group$NewEntry$Shared$beneficiaryRow, i18n, data), 54140 activeMembers)), 54141 A2( 54142 $author$project$Page$Group$NewEntry$Shared$errorWhen, 54143 data.d_ && $elm$core$Dict$isEmpty(data.em), 54144 $author$project$Translations$newEntryNoBeneficiaries(i18n)), 54145 exactMismatchError 54146 ])); 54147 }); 54148var $author$project$Page$Group$NewEntry$Shared$InputCategory = function (a) { 54149 return {$: 17, a: a}; 54150}; 54151var $author$project$Domain$Entry$allCategories = _List_fromArray( 54152 [0, 1, 2, 3, 4, 5, 6, 7, 8]); 54153var $author$project$Ui$Anim$fontColor = function (clr) { 54154 return A2($author$project$Animator$color, 'color', clr); 54155}; 54156var $author$project$UI$Components$chip = function (config) { 54157 var _v0 = config.hj ? _Utils_Tuple3($author$project$UI$Theme$primary.kl, $author$project$UI$Theme$primary.kl, $author$project$UI$Theme$primary.km) : _Utils_Tuple3( 54158 A4($author$project$Ui$rgba, 0, 0, 0, 0), 54159 $author$project$UI$Theme$base.k3, 54160 $author$project$UI$Theme$base.aM); 54161 var bg = _v0.a; 54162 var borderColor = _v0.b; 54163 var textColor = _v0.c; 54164 return A2( 54165 $author$project$Ui$el, 54166 _List_fromArray( 54167 [ 54168 $author$project$Ui$Input$button(config.e7), 54169 A2($author$project$Ui$paddingXY, $author$project$UI$Theme$spacing.aW, $author$project$UI$Theme$spacing.qk), 54170 $author$project$Ui$border($author$project$UI$Theme$border),
54171 $author$project$Ui$rounded($author$project$UI$Theme$radius.rn), 54172 $author$project$Ui$Font$size($author$project$UI$Theme$font.qk), 54173 $author$project$Ui$Font$weight($author$project$UI$Theme$fontWeight.nI), 54174 $author$project$Ui$pointer, 54175 $author$project$Ui$width($author$project$Ui$shrink), 54176 A2( 54177 $author$project$Ui$Anim$transition, 54178 $author$project$Ui$Anim$ms(200), 54179 _List_fromArray( 54180 [ 54181 $author$project$Ui$Anim$backgroundColor(bg), 54182 $author$project$Ui$Anim$borderColor(borderColor), 54183 $author$project$Ui$Anim$fontColor(textColor) 54184 ])) 54185 ]), 54186 $author$project$Ui$text(config.i6)); 54187}; 54188var $author$project$Translations$categoryAccommodation = function (_v0) { 54189 var lang = _v0; 54190 if (!lang) { 54191 return 'Accommodation'; 54192 } else { 54193 return 'Hébergement'; 54194 } 54195}; 54196var $author$project$Translations$categoryEntertainment = function (_v0) { 54197 var lang = _v0; 54198 if (!lang) { 54199 return 'Entertainment'; 54200 } else { 54201 return 'Divertissement'; 54202 } 54203}; 54204var $author$project$Translations$categoryFood = function (_v0) { 54205 var lang = _v0; 54206 if (!lang) { 54207 return 'Food'; 54208 } else { 54209 return 'Alimentation'; 54210 } 54211}; 54212var $author$project$Translations$categoryGroceries = function (_v0) { 54213 var lang = _v0; 54214 if (!lang) { 54215 return 'Groceries'; 54216 } else { 54217 return 'Courses'; 54218 } 54219}; 54220var $author$project$Translations$categoryHealthcare = function (_v0) { 54221 var lang = _v0; 54222 if (!lang) { 54223 return 'Healthcare'; 54224 } else { 54225 return 'Santé'; 54226 } 54227}; 54228var $author$project$Translations$categoryOther = function (_v0) { 54229 var lang = _v0; 54230 if (!lang) { 54231 return 'Other'; 54232 } else { 54233 return 'Autre'; 54234 } 54235}; 54236var $author$project$Translations$categoryShopping = function (_v0) { 54237 var lang = _v0; 54238 if (!lang) { 54239 return 'Shopping'; 54240 } else { 54241 return 'Shopping'; 54242 } 54243}; 54244var $author$project$Translations$categoryTransport = function (_v0) { 54245 var lang = _v0; 54246 if (!lang) { 54247 return 'Transport'; 54248 } else { 54249 return 'Transport'; 54250 } 54251}; 54252var $author$project$Translations$categoryUtilities = function (_v0) { 54253 var lang = _v0; 54254 if (!lang) { 54255 return 'Utilities'; 54256 } else { 54257 return 'Services'; 54258 } 54259}; 54260var $author$project$UI$Categories$presentation = function (category) { 54261 switch (category) { 54262 case 0: 54263 return {aH: 'ð½ï¸', i6: $author$project$Translations$categoryFo
54263od}; 54264 case 1: 54265 return {aH: 'ð', i6: $author$project$Translations$categoryTransport}; 54266 case 2: 54267 return {aH: 'ð ', i6: $author$project$Translations$categoryAccommodation}; 54268 case 3: 54269 return {aH: 'ð', i6: $author$project$Translations$categoryEntertainment}; 54270 case 4: 54271 return {aH: 'ðï¸', i6: $author$project$Translations$categoryShopping}; 54272 case 5: 54273 return {aH: 'ð', i6: $author$project$Translations$categoryGroceries}; 54274 case 6: 54275 return {aH: 'â¡', i6: $author$project$Translations$categoryUtilities}; 54276 case 7: 54277 return {aH: 'ð', i6: $author$project$Translations$categoryHealthcare}; 54278 default: 54279 return {aH: 'ð¦', i6: $author$project$Translations$categoryOther}; 54280 } 54281}; 54282var $author$project$UI$Categories$labelWithEmoji = F2( 54283 function (i18n, category) { 54284 var shown = $author$project$UI$Categories$presentation(category); 54285 return shown.aH + (' ' + shown.i6(i18n)); 54286 }); 54287var $author$project$Translations$newEntryCategoryLabel = function (_v0) { 54288 var lang = _v0; 54289 if (!lang) { 54290 return 'Category'; 54291 } else { 54292 return 'Catégorie'; 54293 } 54294}; 54295var $author$project$Translations$newEntryCategoryNone = function (_v0) { 54296 var lang = _v0; 54297 if (!lang) { 54298 return 'No category'; 54299 } else { 54300 return 'Aucune catégorie'; 54301 } 54302}; 54303var $author$project$Page$Group$NewEntry$ExpenseView$categoryField = F2( 54304 function (i18n, data) { 54305 return A2( 54306 $author$project$Page$Group$NewEntry$Shared$formField, 54307 { 54308 i6: $author$project$Translations$newEntryCategoryLabel(i18n), 54309 hd: false 54310 }, 54311 _List_fromArray( 54312 [ 54313 A2( 54314 $author$project$Ui$row, 54315 _List_fromArray( 54316 [ 54317 $author$project$Ui$spacing($author$project$UI$Theme$spacing.bb), 54318 $author$project$Ui$wrap 54319 ]), 54320 A2( 54321 $elm$core$List$map, 54322 function (_v0) { 54323 var cat = _v0.a; 54324 var label = _v0.b; 54325 return $author$project$UI$Components$chip( 54326 { 54327 i6: label, 54328 e7: $author$project$Page$Group$NewEntry$Shared$InputCategory(cat), 54329 hj: _Utils_eq(data.h9, cat) 54330 }); 54331 }, 54332 A2( 54333 $elm$core$List$cons, 54334 _Utils_Tuple2( 54335 $elm$core$Maybe$Nothing, 54336 $author$project$Translations$newEntryCategoryNone(i18n)), 54337 A2( 54338 $elm$core$List$map, 54339 function (category) { 54340 return _Utils_Tuple2( 54341 $elm$core$Maybe$Just(category), 54342 A2($author$project$UI$Categories$labelWithEmoji, i18n, category)); 54343 }, 54344 $author$project$Domain$Entry$allCategories)))) 54345 ])); 54346 }); 54347var $author$project$Page$Group$NewEntry$Shared$InputDate = function (a) { 54348 return {$: 23, a: a}; 54349}; 54350var $author$project$Page$Group$NewEntry$Shared$dateInputAttr = $author$project$Ui$htmlAttribute( 54351 $elm$html$Html$Attributes$type_('date')); 54352var $author$project$Translations$newEntryDateLabel = function (_v0) { 54353 var lang = _v0; 54354 if (!lang) { 54355 return 'Date'; 54356 } else { 54357 return 'Date'; 54358 } 54359}; 54360var $author$project$Page$Group$NewEntry$Shared$dateField = F2( 54361 function (i18n, data) { 54362 var field = A2( 54363 $dwayne$elm_form$Form$get, 54364 function ($) { 54365 return $.cj; 54366 }, 54367 data.w); 54368 return A2( 54369 $author$project$Page$Group$NewEntry$Shared$formField, 54370 { 54371 i6: $author$project$Translations$newEntryDateLabel(i18n), 54372 hd: true 54373 }, 54374 _List_fromArray( 54375 [ 54376 A2( 54377 $author$project$Ui$Input$text, 54378 _List_fromArray( 54379 [ 54380 $author$project$Ui$width($author$project$Ui$fill), 54381 $author$project$Page$Group$NewEntry$Shared$dateInputAttr 54382 ]), 54383 { 54384 i6: $author$project$Ui$Input$labelHidden( 54385 $author$project$Translations$newEntryDateLabel(i18n)), 54386 oq: $author$project$Page$Group$NewEntry$Shared$InputDate, 54387 pt: $elm$core$Maybe$Nothing, 54388 qI: $dwayne$elm_field$Field$toRawString(field) 54389 }), 54390 A3($author$project$Page$Group$NewEntry$Shared$fieldError, i18n, data.d_, field) 54391 ])); 54392 }); 54393var $author$project$Page$Group$NewEntry$Shared$InputDefaultCurrencyAmount = function (a) { 54394 return {$: 19, a: a}; 54395}; 54396var $author$project$Page$Group$NewEntry$Shared$FetchRate = function (a) { 54397 return {$: 20, a: a}; 54398}; 54399var $author$project$Translations$newEntryFetchRate = function (_v0) { 54400 var lang = _v0; 54401 if (!lang) { 54402 return 'auto'; 54403 } else { 54404 return 'auto'; 54405 } 54406}; 54407var $author$project$Translations$newEntryFetchingRate = function (_v0) { 54408 var lang = _v0; 54409 if (!lang) { 54410 return 'Fetchingâ¦'; 54411 } else { 54412 return 'Récupérationâ¦'; 54413 } 54414}; 54415var $author$project$Page$Group$NewEntry$Shared$fetchRateControl = F3( 54416 function (i18n, amountCents, data) { 54417 var canAutoFetch = $author$project$Infra$ExchangeRate$supports(data.bg) && ($author$project$Infra$ExchangeRate$supports(data.mS) && (amountCents > 0)); 54418 if (!canAutoFetch) { 54419 return $author$project$Ui$none; 54420 } else { 54421 var _v0 = data.bx; 54422 if (_v0 === 1) { 54423 return $author$project$Page$Group$NewEntry$Shared$formHint( 54424 $author$project$Translations$newEntryFetchingRate(i18n)); 54425 } else { 54426 return A2( 54427 $author$project$UI$Components$btnOutline, 54428 _List_fromArray( 54429 [ 54430 $author$project$Ui$width($author$project$Ui$shrink) 54431 ]), 54432 { 54433 gv: $elm$core$Maybe$Just( 54434 A2($author$project$UI$Components$featherIcon, 14, $feathericons$elm_feather$FeatherIcons$refreshCw)), 54435 i6: $author$project$Translations$newEntryFetchRate(i18n), 54436 e7: $author$project$Page$Group$NewEntry$Shared$FetchRate( 54437 {hX: data.bg, jY: data.mS}) 54438 }); 54439 } 54440 } 54441 }); 54442var $author$project$Translations$newEntryDefaultCurrencyAmountHint = F2( 54443 function (currency, _v0) { 54444 var lang = _v0; 54445 if (!lang) { 54446 return 'Equivalent amount in the group\'s default currency (' + (currency + ').'); 54447 } else { 54448 return 'Montant équivalent dans la devise par défaut du groupe (' + (currency + ').'); 54449 } 54450 }); 54451var $author$project$Translations$newEntryDefaultCurrencyAmountLabel = F2( 54452 function (currency, _v0) { 54453 var lang = _v0; 54454 if (!lang) { 54455 return 'Amount in ' + currency; 54456 } else { 54457 return 'Montant en ' + currency; 54458 } 54459 }); 54460var $author$project$Translations$newEntryRateError = function (_v0) { 54461 var lang = _v0; 54462 if (!lang) { 54463 return 'Couldn\'t fetch the rate. Enter it manually or check xe.com.'; 54464 } else { 54465 return 'Impossible de récupérer le taux. Saisis-le manuellement ou via xe.com.'; 54466 } 54467}; 54468var $feathericons$elm_feather$FeatherIcons$externalLink = A2( 54469 $feathericons$elm_feather$FeatherIcons$makeBuilder, 54470 'external-link', 54471 _List_fromArray( 54472 [ 54473 A2( 54474 $elm$svg$Svg$path, 54475 _List_fromArray( 54476 [ 54477 $elm$svg$Svg$Attributes$d('M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6') 54478 ]), 54479 _List_Nil), 54480 A2( 54481 $elm$svg$Svg$polyline, 54482 _List_fromArray( 54483 [ 54484 $elm$svg$Svg$Attributes$points('15 3 21 3 21 9') 54485 ]), 54486 _List_Nil), 54487 A2( 54488 $elm$svg$Svg$line, 54489 _List_fromArray( 54490 [ 54491 $elm$svg$Svg$Attributes$x1('10'), 54492 $elm$svg$Svg$Attributes$y1('14'), 54493 $elm$svg$Svg$Attributes$x2('21'), 54494 $elm$svg$Svg$Attributes$y2('3') 54495 ]), 54496 _List_Nil) 54497 ])); 54498var $author$project$Translations$newEntryRateCheckXe = function (_v0) { 54499 var lang = _v0; 54500 if (!lang) { 54501 return 'Check on xe.com'; 54502 } else { 54503 return 'Vérifier sur xe.com'; 54504 } 54505}; 54506var $author$project$Ui$Font$underline = $author$project$Internal$Model2$class($author$project$Internal$Style2$classes.q1); 54507var $author$project$Infra$ExchangeRate$xeComUrl = function (_v0) { 54508 var base = _v0.hX; 54509 var quote = _v0.jY; 54510 var amountCents = _v0.lo; 54511 var amount = (amountCents <= 0) ? 1 : (amountCents / A2( 54512 $elm$core$Basics$pow, 54513 10, 54514 $author$project$Domain$Currency$precision(base))); 54515 return 'https://www.xe.com/currencyconverter/convert/?Amount=' + ($elm$core$String$fromFloat(amount) + ('&From=' + ($author$project$Domain$Currency$currencyCode(base) + ('&To=' + $author$project$Domain$Currency$currencyCode(quote))))); 54516}; 54517var $author$project$Page$Group$NewEntry$Shared$xeComLink = F2( 54518 function (i18n, params) { 54519 return A2( 54520 $author$project$Ui$row, 54521 _List_fromArray( 54522 [ 54523 $author$project$Ui$linkNewTab( 54524 $author$project$Infra$ExchangeRate$xeComUrl(params)), 54525 $author$project$Ui$spacing($author$project$UI$Theme$spacing.bb), 54526 $author$project$Ui$contentCenterY, 54527 $author$project$Ui$pointer, 54528 $author$project$Ui$width($author$project$Ui$shrink), 54529 $author$project$Ui$Font$size($author$project$UI$Theme$font.qk), 54530 $author$project$Ui$Font$color($author$project$UI$Theme$primary.qI) 54531 ]), 54532 _List_fromArray( 54533 [ 54534 A2($author$project$UI$Components$featherIcon, 14, $feathericons$elm_feather$FeatherIcons$externalLink), 54535 A2( 54536 $author$project$Ui$el, 54537 _List_fromArray( 54538 [$author$project$Ui$Font$underline]), 54539 $author$project$Ui$text( 54540 $author$project$Translations$newEntryRateCheckXe(i18n))) 54541 ])); 54542 }); 54543var $author$project$Page$Group$NewEntry$Shared$defaultCurrencyAmountField = F2( 54544 function (i18n, data) { 54545 if (_Utils_eq(data.bg, data.mS)) { 54546 return $author$project$Ui$none; 54547 } else { 54548 var isEmpty = $elm$core$String$isEmpty( 54549 $elm$core$String$trim(data.ck)); 54550 var isInvalid = (!isEmpty) && _Utils_eq( 54551 A2( 54552 $author$project$Page$Group$NewEntry$Shared$parseAmountCents, 54553 data.mS, 54554 $elm$core$String$trim(data.ck)), 54555 $elm$core$Maybe$Nothing); 54556 var amountCents = A2( 54557 $elm$core$Maybe$withDefault, 54558 0, 54559 $dwayne$elm_field$Field$toMaybe( 54560 A2( 54561 $dwayne$elm_form$Form$get, 54562 function ($) { 54563 return $.ef; 54564 }, 54565 data.w))); 54566 return A2( 54567 $author$project$Page$Group$NewEntry$Shared$formField, 54568 { 54569 i6: A2( 54570 $author$project$Translations$newEntryDefaultCurrencyAmountLabel, 54571 $author$project$Domain$Currency$currencyCode(data.mS), 54572 i18n), 54573 hd: true 54574 }, 54575 _List_fromArray( 54576 [ 54577 A2( 54578 $author$project$Ui$row, 54579 _List_fromArray( 54580 [ 54581 $author$project$Ui$width($author$project$Ui$fill), 54582 $author$project$Ui$spacing($author$project$UI$Theme$spacing.qk), 54583 $author$project$Ui$contentCenterY 54584 ]), 54585 _List_fromArray( 54586 [ 54587 A2( 54588 $author$project$Ui$Input$text, 54589 _List_fromArray( 54590 [ 54591 $author$project$Ui$width($author$project$Ui$fill), 54592 $author$project$Page$Group$NewEntry$Shared$decimalInputAttr 54593 ]), 54594 { 54595 i6: $author$project$Ui$Input$labelHidden( 54596 A2( 54597 $author$project$Translations$newEntryDefaultCurrencyAmountLabel, 54598 $author$project$Domain$Currency$currencyCode(data.mS), 54599 i18n)), 54600 oq: $author$project$Page$Group$NewEntry$Shared$InputDefaultCurrencyAmount, 54601 pt: $elm$core$Maybe$Just( 54602 $author$project$Translations$newEntryAmountPlaceholder(i18n)), 54603 qI: data.ck 54604 }), 54605 A3($author$project$Page$Group$NewEntry$Shared$fetchRateControl, i18n, amountCents, data) 54606 ])), 54607 $author$project$Page$Group$NewEntry$Shared$formHint( 54608 A2( 54609 $author$project$Translations$newEntryDefaultCurrencyAmountHint, 54610 $author$project$Domain$Currency$currencyCode(data.mS), 54611 i18n)), 54612 A2( 54613 $author$project$Page$Group$NewEntry$Shared$xeComLink, 54614 i18n, 54615 {lo: amountCents, hX: data.bg, jY: data.mS}), 54616 A2( 54617 $author$project$Page$Group$NewEntry$Shared$errorWhen, 54618 data.bx === 2, 54619 $author$project$Translations$newEntryRateError(i18n)), 54620 A2( 54621 $author$project$Page$Group$NewEntry$Shared$errorWhen, 54622 data.d_ && isEmpty, 54623 $author$project$Translations$fieldRequired(i18n)), 54624 A2( 54625 $author$project$Page$Group$NewEntry$Shared$errorWhen, 54626 data.d_ && isInvalid,
54627 $author$project$Translations$fieldInvalidFormat(i18n)) 54628 ])); 54629 } 54630 }); 54631var $author$project$Page$Group$NewEntry$Shared$InputDescription = function (a) { 54632 return {$: 1, a: a}; 54633}; 54634var $author$project$Translations$newEntryDescriptionHint = function (_v0) { 54635 var lang = _v0; 54636 if (!lang) { 54637 return 'A short description of the expense.'; 54638 } else { 54639 return 'Une courte description de la dépense.'; 54640 } 54641}; 54642var $author$project$Translations$newEntryDescriptionLabel = function (_v0) { 54643 var lang = _v0; 54644 if (!lang) { 54645 return 'Description'; 54646 } else { 54647 return 'Description'; 54648 } 54649}; 54650var $author$project$Translations$newEntryDescriptionPlaceholder = function (_v0) { 54651 var lang = _v0; 54652 if (!lang) { 54653 return 'e.g. Dinner at the restaurant'; 54654 } else { 54655 return 'ex. Dîner au restaurant'; 54656 } 54657}; 54658var $author$project$Page$Group$NewEntry$ExpenseView$descriptionField = F2( 54659 function (i18n, data) { 54660 var field = A2( 54661 $dwayne$elm_form$Form$get, 54662 function ($) { 54663 return $.eE; 54664 }, 54665 data.w); 54666 return A2( 54667 $author$project$Page$Group$NewEntry$Shared$formField, 54668 { 54669 i6: $author$project$Translations$newEntryDescriptionLabel(i18n), 54670 hd: true 54671 }, 54672 _List_fromArray( 54673 [ 54674 A2( 54675 $author$project$Ui$Input$text, 54676 _List_fromArray( 54677 [ 54678 $author$project$Ui$width($author$project$Ui$fill) 54679 ]), 54680 { 54681 i6: $author$project$Ui$Input$labelHidden( 54682 $author$project$Translations$newEntryDescriptionLabel(i18n)), 54683 oq: $author$project$Page$Group$NewEntry$Shared$InputDescription, 54684 pt: $elm$core$Maybe$Just( 54685 $author$project$Translations$newEntryDescriptionPlaceholder(i18n)), 54686 qI: $dwayne$elm_field$Field$toRawString(field) 54687 }), 54688 $author$project$Page$Group$NewEntry$Shared$formHint( 54689 $author$project$Translations$newEntryDescriptionHint(i18n)), 54690 A3($author$project$Page$Group$NewEntry$Shared$fieldError, i18n, data.d_, field) 54691 ])); 54692 }); 54693var $author$project$Translations$newEntryBeneficiariesHint = function (_v0) { 54694 var lang = _v0; 54695 if (!lang) { 54696 return 'Select the members who benefit from this expense.'; 54697 } else { 54698 return 'Sélectionne les membres concernés par cette dépense.'; 54699 } 54700}; 54701var $author$project$Page$Group$NewEntry$Shared$InputNotes = function (a) { 54702 return {$: 3, a: a}; 54703}; 54704var $author$project$Translations$newEntryNotesLabel = function (_v0) { 54705 var lang = _v0; 54706 if (!lang) { 54707 return 'Notes'; 54708 } else { 54709 return 'Notes'; 54710 } 54711}; 54712var $author$project$Translations$newEntryNotesPlaceholder = function (_v0) { 54713 var lang = _v0; 54714 if (!lang) { 54715 return 'Optional notes...'; 54716 } else { 54717 return 'Notes optionnelles...'; 54718 } 54719}; 54720var $author$project$Page$Group$NewEntry$Shared$notesField = F2( 54721 function (i18n, data) { 54722 return A2( 54723 $author$project$Page$Group$NewEntry$Shared$formField, 54724 { 54725 i6: $author$project$Translations$newEntryNotesLabel(i18n), 54726 hd: false 54727 }, 54728 _List_fromArray( 54729 [ 54730 A2( 54731 $author$project$Ui$Input$text, 54732 _List_fromArray( 54733 [ 54734 $author$project$Ui$width($author$project$Ui$fill) 54735 ]), 54736 { 54737 i6: $author$project$Ui$Input$labelHidden( 54738 $author$project$Translations$newEntryNotesLabel(i18n)), 54739 oq: $author$project$Page$Group$NewEntry$Shared$InputNotes, 54740 pt: $elm$core$Maybe$Just( 54741 $author$project$Translations$newEntryNotesPlaceholder(i18n)), 54742 qI: data.bu 54743 }) 54744 ])); 54745 }); 54746var $author$project$Page$Group$NewEntry$Shared$InputPayerAmount = F2( 54747 function (a, b) { 54748 return {$: 9, a: a, b: b}; 54749 }); 54750var $author$project$Page$Group$NewEntry$Shared$TogglePayer = function (a) { 54751 return {$: 8, a: a}; 54752}; 54753var $author$project$Translations$newEntryNoPayerError = function (_v0) { 54754 var lang = _v0; 54755 if (!lang) { 54756 return 'Please select at least one payer.'; 54757 } else { 54758 return 'Sélectionne au moins un payeur.'; 54759 } 54760}; 54761var $author$project$Translations$newEntryPayerLabel = function (_v0) { 54762 var lang = _v0; 54763 if (!lang) { 54764 return 'Paid by'; 54765 } else { 54766 return 'Payé par'; 54767 } 54768}; 54769var $author$project$Translations$newEntryPayerMismatch = function (_v0) { 54770 var lang = _v0; 54771 if (!lang) { 54772 return 'Payer amounts must add up to the total.'; 54773 } else {
54774 return 'Les montants des payeurs doivent correspondre au total.'; 54775 } 54776}; 54777var $author$project$Page$Group$NewEntry$ExpenseView$payerField = F3( 54778 function (i18n, activeMembers, data) { 54779 var isMultiPayer = $elm$core$Dict$size(data.aB) > 1; 54780 var payerAmountRows = function () { 54781 if (isMultiPayer) { 54782 var payerMismatchError = function () { 54783 var totalPayer = $elm$core$List$sum( 54784 A2( 54785 $elm$core$List$filterMap, 54786 $author$project$Page$Group$NewEntry$Shared$parseAmountCents(data.bg), 54787 $elm$core$Dict$values(data.aB))); 54788 var totalAmount = A2( 54789 $elm$core$Maybe$withDefault, 54790 0, 54791 $dwayne$elm_field$Field$toMaybe( 54792 A2( 54793 $dwayne$elm_form$Form$get, 54794 function ($) { 54795 return $.ef; 54796 }, 54797 data.w))); 54798 return A2( 54799 $author$project$Page$Group$NewEntry$Shared$errorWhen, 54800 data.d_ && (!_Utils_eq(totalPayer, totalAmount)), 54801 $author$project$Translations$newEntryPayerMismatch(i18n)); 54802 }(); 54803 var amountRow = function (member) { 54804 return A2( 54805 $author$project$Ui$row, 54806 _List_fromArray( 54807 [ 54808 $author$project$Ui$spacing($author$project$UI$Theme$spacing.qk), 54809 $author$project$Ui$contentCenterY 54810 ]), 54811 _List_fromArray( 54812 [ 54813 A2( 54814 $author$project$Ui$el, 54815 _List_fromArray( 54816 [$author$project$Ui$alignRight]), 54817 $author$project$Ui$text(member.bW)), 54818 A2( 54819 $author$project$Ui$Input$text, 54820 _List_fromArray( 54821 [ 54822 $author$project$Ui$width( 54823 $author$project$Ui$px(100)), 54824 $author$project$Page$Group$NewEntry$Shared$decimalInputAttr 54825 ]), 54826 { 54827 i6: $author$project$Ui$Input$labelHidden(member.bW), 54828 oq: $author$project$Page$Group$NewEntry$Shared$InputPayerAmount(member.aj), 54829 pt: $elm$core$Maybe$Just( 54830 A2($author$project$Page$Group$NewEntry$Shared$zeroAmountPlaceholder, i18n, data.bg)), 54831 qI: A2( 54832 $elm$core$Maybe$withDefault, 54833 '', 54834 A2($elm$core$Dict$get, member.aj, data.aB)) 54835 }), 54836 $author$project$Ui$text( 54837 '(' + ($author$project$Domain$Currency$currencySymbol(data.bg) + ')')) 54838 ])); 54839 }; 54840 return _Utils_ap( 54841 A2( 54842 $elm$core$List$filterMap, 54843 function (member) { 54844 return A2($elm$core$Dict$member, member.aj, data.aB) ? $elm$core$Maybe$Just( 54845 amountRow(member)) : $elm$core$Maybe$Nothing; 54846 }, 54847 activeMembers), 54848 _List_fromArray( 54849 [payerMismatchError])); 54850 } else { 54851 return _List_Nil; 54852 } 54853 }(); 54854 return A2( 54855 $author$project$Page$Group$NewEntry$Shared$formField, 54856 { 54857 i6: $author$project$Translations$newEntryPayerLabel(i18n), 54858 hd: true 54859 }, 54860 _Utils_ap( 54861 _List_fromArray( 54862 [ 54863 A2( 54864 $author$project$Ui$row, 54865 _List_fromArray( 54866 [ 54867 $author$project$Ui$spacing($author$project$UI$Theme$spacing.qk), 54868 $author$project$Ui$wrap 54869 ]), 54870 A2( 54871 $elm$core$List$map, 54872 function (member) { 54873 return $author$project$UI$Components$togglePill( 54874 { 54875 gv: $elm$core$Maybe$Nothing, 54876 i6: member.bW, 54877 e7: $author$project$Page$Group$NewEntry$Shared$TogglePayer(member.aj), 54878 hj: A2($elm$core$Dict$member, member.aj, data.aB) 54879 }); 54880 }, 54881 activeMembers)), 54882 A2( 54883 $author$project$Page$Group$NewEntry$Shared$errorWhen, 54884 data.d_ && $elm$core$Dict$isEmpty(data.aB), 54885 $author$project$Translations$newEntryNoPayerError(i18n)) 54886 ]), 54887 payerAmountRows)); 54888 }); 54889var $author$project$Page$Group$NewEntry$ExpenseView$expenseFields = F3( 54890 function (i18n, activeMembers, data) { 54891 return _List_fromArray( 54892 [ 54893 A2($author$project$Page$Group$NewEntry$ExpenseView$descriptionField, i18n, data), 54894 A2($author$project$Page$Group$NewEntry$Shared$amountCurrencyField, i18n, data), 54895 A2($author$project$Page$Group$NewEntry$Shared$defaultCurrencyAmountField, i18n, data), 54896 A2($author$project$Page$Group$NewEntry$Shared$dateField, i18n, data), 54897 A3($author$project$Page$Group$NewEntry$ExpenseView$payerField, i18n, activeMembers, data), 54898 A4( 54899 $author$project$Page$Group$NewEntry$Shared$beneficiariesField, 54900 i18n, 54901 $author$project$Translations$newEntryBeneficiariesHint(i18n), 54902 activeMembers, 54903 data), 54904 A2($author$project$Page$Group$NewEntry$ExpenseView$categoryField, i18n, data), 54905 A2($author$project$Page$Group$NewEntry$Shared$notesField, i18n, data), 54906 A2($author$project$Page$Group$NewEntry$Shared$attachmentsField, i18n, data) 54907 ]); 54908 }); 54909var $author$project$Translations$newEntryIncomeDescriptionHint = function (_v0) { 54910 var lang = _v0; 54911 if (!lang) { 54912 return 'A short description of the income.'; 54913 } else { 54914 return 'Une courte description du revenu.'; 54915 } 54916}; 54917var $author$project$Page$Group$NewEntry$IncomeView$descriptionField = F2( 54918 function (i18n, data) { 54919 var field = A2( 54920 $dwayne$elm_form$Form$get, 54921 function ($) { 54922 return $.eE; 54923 }, 54924 data.w); 54925 return A2( 54926 $author$project$Page$Group$NewEntry$Shared$formField, 54927 { 54928 i6: $author$project$Translations$newEntryDescriptionLabel(i18n), 54929 hd: true 54930 }, 54931 _List_fromArray( 54932 [ 54933 A2( 54934 $author$project$Ui$Input$text, 54935 _List_fromArray( 54936 [ 54937 $author$project$Ui$width($author$project$Ui$fill) 54938 ]), 54939 { 54940 i6: $author$project$Ui$Input$labelHidden( 54941 $author$project$Translations$newEntryDescriptionLabel(i18n)), 54942 oq: $author$project$Page$Group$NewEntry$Shared$InputDescription, 54943 pt: $elm$core$Maybe$Just( 54944 $author$project$Translations$newEntryDescriptionPlaceholder(i18n)), 54945 qI: $dwayne$elm_field$Field$toRawString(field) 54946 }), 54947 $author$project$Page$Group$NewEntry$Shared$formHint( 54948 $author$project$Translations$newEntryIncomeDescriptionHint(i18n)), 54949 A3($author$project$Page$Group$NewEntry$Shared$fieldError, i18n, data.d_, field) 54950 ])); 54951 }); 54952var $author$project$Translations$newEntryIncomeBeneficiariesHint = function (_v0) { 54953 var lang = _v0; 54954 if (!lang) { 54955 return 'Select the members who should receive a share of this income.'; 54956 } else { 54957 return 'Sélectionne les membres qui doivent recevoir une part de ce revenu.'; 54958 } 54959}; 54960var $author$project$Page$Group$NewEntry$Shared$SelectReceiver = function (a) { 54961 return {$: 16, a: a}; 54962}; 54963var $author$project$Translations$newEntryNoReceiverError = function (_v0) { 54964 var lang = _v0; 54965 if (!lang) { 54966 return 'Please select a receiver.'; 54967 } else { 54968 return 'Sélectionne un destinataire.'; 54969 } 54970}; 54971var $author$project$Translations$newEntryReceivedByLabel = function (_v0) { 54972 var lang = _v0; 54973 if (!lang) { 54974 return 'Received by'; 54975 } else { 54976 return 'Reçu par'; 54977 } 54978}; 54979var $author$project$Page$Group$NewEntry$IncomeView$receiverField = F3( 54980 function (i18n, activeMembers, data) { 54981 return A2( 54982 $author$project$Page$Group$NewEntry$Shared$formField, 54983 { 54984 i6: $author$project$Translations$newEntryReceivedByLabel(i18n), 54985 hd: true 54986 }, 54987 _List_fromArray( 54988 [ 54989 A2( 54990 $author$project$Ui$row, 54991 _List_fromArray( 54992 [ 54993 $author$project$Ui$spacing($author$project$UI$Theme$spacing.qk), 54994 $author$project$Ui$wrap 54995 ]), 54996 A2( 54997 $elm$core$List$map, 54998 function (member) { 54999 return $author$project$UI$Components$togglePill( 55000 { 55001 gv: $elm$core$Maybe$Nothing, 55002 i6: member.bW, 55003 e7: $author$project$Page$Group$NewEntry$Shared$SelectReceiver(member.aj), 55004 hj: _Utils_eq( 55005 data.cO, 55006 $elm$core$Maybe$Just(member.aj)) 55007 }); 55008 }, 55009 activeMembers)), 55010 A2( 55011 $author$project$Page$Group$NewEntry$Shared$errorWhen, 55012 data.d_ && _Utils_eq(data.cO, $elm$core$Maybe$Nothing), 55013 $author$project$Translations$newEntryNoReceiverError(i18n)) 55014 ])); 55015 }); 55016var $author$project$Page$Group$NewEntry$IncomeView$incomeFields = F3( 55017 function (i18n, activeMembers, data) { 55018 return _List_fromArray( 55019 [ 55020 A2($author$project$Page$Group$NewEntry$IncomeView$descriptionField, i18n, data), 55021 A2($author$project$Page$Group$NewEntry$Shared$amountCurrencyField, i18n, data), 55022 A2($author$project$Page$Group$NewEntry$Shared$defaultCurrencyAmountField, i18n, data), 55023 A2($author$project$Page$Group$NewEntry$Shared$dateField, i18n, data), 55024 A3($author$project$Page$Group$NewEntry$IncomeView$receiverField, i18n, activeMembers, data), 55025 A4( 55026 $author$project$Page$Group$NewEntry$Shared$beneficiariesField, 55027 i18n, 55028 $author$project$Translations$newEntryIncomeBeneficiariesHint(i18n), 55029 activeMembers, 55030 data), 55031 A2($author$project$Page$Group$NewEntry$Shared$notesField, i18n, data), 55032 A2($author$project$Page$Group$NewEntry$Shared$attachmentsField, i18n, data) 55033 ]); 55034 }); 55035var $author$project$Page$Group$NewEntry$Shared$SelectEntryKind = function (a) { 55036 return {$: 0, a: a}; 55037}; 55038var $author$project$Page$Group$NewEntry$modeBtn = function (config) { 55039 return A2( 55040 $author$project$Ui$row, 55041 _List_fromArray( 55042 [ 55043 $author$project$Ui$Input$button(config.e7), 55044 $author$project$Ui$width($author$project$Ui$fill), 55045 $author$project$Ui$spacing($author$project$UI$Theme$spacing.qk), 55046 A2($author$project$Ui$paddingXY, 0, $author$project$UI$Theme$spacing.qk),
55047 $author$project$Ui$rounded($author$project$UI$Theme$radius.qk), 55048 $author$project$Ui$Font$size($author$project$UI$Theme$font.aW), 55049 $author$project$Ui$Font$weight($author$project$UI$Theme$fontWeight.dL), 55050 $author$project$Ui$contentCenterX, 55051 $author$project$Ui$contentCenterY, 55052 $author$project$Ui$pointer, 55053 A2( 55054 $author$project$Ui$Anim$transition, 55055 $author$project$Ui$Anim$ms(200), 55056 _List_fromArray( 55057 [ 55058 $author$project$Ui$Anim$backgroundColor( 55059 config.k6 ? $author$project$UI$Theme$primary.kl : $author$project$UI$Theme$base.en), 55060 $author$project$Ui$Anim$fontColor( 55061 config.k6 ? $author$project$UI$Theme$primary.km : $author$project$UI$Theme$base.aM) 55062 ])) 55063 ]), 55064 _List_fromArray( 55065 [ 55066 A2($author$project$UI$Components$featherIcon, 16, config.gv), 55067 $author$project$Ui$text(config.i6) 55068 ])); 55069}; 55070var $author$project$Translations$newEntryKindExpense = function (_v0) { 55071 var lang = _v0; 55072 if (!lang) { 55073 return 'Expense'; 55074 } else { 55075 return 'Dépense'; 55076 } 55077}; 55078var $author$project$Translations$newEntryKindIncome = function (_v0) { 55079 var lang = _v0; 55080 if (!lang) { 55081 return 'Income'; 55082 } else { 55083 return 'Revenu'; 55084 } 55085}; 55086var $author$project$Translations$newEntryKindTransfer = function (_v0) { 55087 var lang = _v0; 55088 if (!lang) { 55089 return 'Transfer'; 55090 } else { 55091 return 'Transfert'; 55092 } 55093}; 55094var $elm$svg$Svg$polygon = $elm$svg$Svg$trustedNode('polygon'); 55095var $feathericons$elm_feather$FeatherIcons$send = A2( 55096 $feathericons$elm_feather$FeatherIcons$makeBuilder, 55097 'send', 55098 _List_fromArray( 55099 [ 55100 A2( 55101 $elm$svg$Svg$line, 55102 _List_fromArray( 55103 [ 55104 $elm$svg$Svg$Attributes$x1('22'), 55105 $elm$svg$Svg$Attributes$y1('2'), 55106 $elm$svg$Svg$Attributes$x2('11'), 55107 $elm$svg$Svg$Attributes$y2('13') 55108 ]), 55109 _List_Nil), 55110 A2( 55111 $elm$svg$Svg$polygon, 55112 _List_fromArray( 55113 [ 55114 $elm$svg$Svg$Attributes$points('22 2 15 22 11 13 2 9 22 2') 55115 ]), 55116 _List_Nil) 55117 ])); 55118var $feathericons$elm_feather$FeatherIcons$shoppingCart = A2( 55119 $feathericons$elm_feather$FeatherIcons$makeBuilder, 55120 'shopping-cart', 55121 _List_fromArray( 55122 [ 55123 A2( 55124 $elm$svg$Svg$circle, 55125 _List_fromArray( 55126 [ 55127 $elm$svg$Svg$Attributes$cx('9'), 55128 $elm$svg$Svg$Attributes$cy('21'), 55129 $elm$svg$Svg$Attributes$r('1') 55130 ]), 55131 _List_Nil), 55132 A2( 55133 $elm$svg$Svg$circle, 55134 _List_fromArray( 55135 [ 55136 $elm$svg$Svg$Attributes$cx('20'), 55137 $elm$svg$Svg$Attributes$cy('21'), 55138 $elm$svg$Svg$Attributes$r('1') 55139 ]), 55140 _List_Nil), 55141 A2( 55142 $elm$svg$Svg$path, 55143 _List_fromArray( 55144 [ 55145 $elm$svg$Svg$Attributes$d('M1 1h4l2.68 13.39a2 2 0 0 0 2 1.61h9.72a2 2 0 0 0 2-1.61L23 6H6') 55146 ]), 55147 _List_Nil) 55148 ])); 55149var $author$project$Page$Group$NewEntry$modeToggle = F2( 55150 function (i18n, current) { 55151 return A2( 55152 $author$project$Ui$row, 55153 _List_fromArray( 55154 [ 55155 $author$project$Ui$width($author$project$Ui$fill), 55156 $author$project$Ui$background($author$project$UI$Theme$base.en), 55157 $author$project$Ui$rounded($author$project$UI$Theme$radius.aW), 55158 $author$project$Ui$border($author$project$UI$Theme$border), 55159 $author$project$Ui$borderColor($author$project$UI$Theme$base.k3), 55160 $author$project$Ui$padding($author$project$UI$Theme$spacing.bb) 55161 ]), 55162 _List_fromArray( 55163 [ 55164 $author$project$Page$Group$NewEntry$modeBtn( 55165 { 55166 k6: !current, 55167 gv: $feathericons$elm_feather$FeatherIcons$shoppingCart, 55168 i6: $author$project$Translations$newEntryKindExpense(i18n), 55169 e7: $author$project$Page$Group$NewEntry$Shared$SelectEntryKind(0) 55170 }), 55171 $author$project$Page$Group$NewEntry$modeBtn( 55172 { 55173 k6: current === 1, 55174 gv: $feathericons$elm_feather$FeatherIcons$send, 55175 i6: $author$project$Translations$newEntryKindTransfer(i18n), 55176 e7: $author$project$Page$Group$NewEntry$Shared$SelectEntryKind(1) 55177 }), 55178 $author$project$Page$Group$NewEntry$modeBtn( 55179 { 55180 k6: current === 2, 55181 gv: $feathericons$elm_feather$FeatherIcons$download, 55182 i6: $author$project$Translations$newEntryKindIncome(i18n), 55183 e7: $author$project$Page$Group$NewEntry$Shared$SelectEntryKind(2) 55184 }) 55185 ])); 55186 }); 55187var $author$project$Translations$newEntrySubmit = function (_v0) { 55188 var lang = _v0; 55189 if (!lang) { 55190 return 'Add'; 55191 } else { 55192 return 'Ajouter'; 55193 } 55194}; 55195var $author$project$Translations$newEntryTransferDescriptionPlaceholder = function (_v0) { 55196 var lang = _v0; 55197 if (!lang) { 55198 return 'e.g. Reimbursement for the trip'; 55199 } else { 55200 return 'ex. Remboursement du séjour'; 55201 } 55202}; 55203var $author$project$Page$Group$NewEntry$TransferView$descriptionField = F2( 55204 function (i18n, data) { 55205 return A2( 55206 $author$project$Page$Group$NewEntry$Shared$formField, 55207 { 55208 i6: $author$project$Translations$newEntryDescriptionLabel(i18n), 55209 hd: false 55210 }, 55211 _List_fromArray( 55212 [ 55213 A2( 55214 $author$project$Ui$Input$text, 55215 _List_fromArray( 55216 [ 55217 $author$project$Ui$width($author$project$Ui$fill) 55218 ]), 55219 { 55220 i6: $author$project$Ui$Input$labelHidden( 55221 $author$project$Translations$newEntryDescriptionLabel(i18n)), 55222 oq: $author$project$Page$Group$NewEntry$Shared$InputDescription, 55223 pt: $elm$core$Maybe$Just( 55224 $author$project$Translations$newEntryTransferDescriptionPlaceholder(i18n)), 55225 qI: $dwayne$elm_field$Field$toRawString( 55226 A2( 55227 $dwayne$elm_form$Form$get, 55228 function ($) { 55229 return $.eE; 55230 }, 55231 data.w)) 55232 }) 55233 ])); 55234 }); 55235var $author$project$Page$Group$NewEntry$Shared$CycleTransferRole = function (a) { 55236 return {$: 15, a: a}; 55237}; 55238var $author$project$Page$Group$NewEntry$TransferView$FromRole = 0; 55239var $author$project$Page$Group$NewEntry$TransferView$ToRole = 1; 55240var $author$project$Translations$newEntrySameFromTo = function (_v0) { 55241 var lang = _v0; 55242 if (!lang) { 55243 return 'Sender and receiver must be different.'; 55244 } else { 55245 return 'L\'expéditeur et le destinataire doivent être différents.'; 55246 } 55247}; 55248var $author$project$Translations$newEntrySelectBoth = function (_v0) { 55249 var lang = _v0; 55250 if (!lang) {
55251 return 'Please select both a sender and a receiver.'; 55252 } else { 55253 return 'Sélectionne un émetteur et un destinataire.'; 55254 } 55255}; 55256var $author$project$Translations$newEntryTransferLabel = function (_v0) { 55257 var lang = _v0; 55258 if (!lang) { 55259 return 'Transfer between'; 55260 } else { 55261 return 'Transfert entre'; 55262 } 55263}; 55264var $author$project$Translations$entryDetailFrom = function (_v0) { 55265 var lang = _v0; 55266 if (!lang) { 55267 return 'From'; 55268 } else { 55269 return 'De'; 55270 } 55271}; 55272var $author$project$Translations$entryDetailTo = function (_v0) { 55273 var lang = _v0; 55274 if (!lang) { 55275 return 'To'; 55276 } else { 55277 return 'Ã'; 55278 } 55279}; 55280var $author$project$Page$Group$NewEntry$TransferView$transferMemberBtn = F2( 55281 function (i18n, config) { 55282 var _v0 = function () { 55283 var _v2 = config.j6; 55284 if (!_v2.$) { 55285 if (!_v2.a) { 55286 var _v3 = _v2.a; 55287 return _Utils_Tuple2( 55288 _Utils_Tuple3($author$project$UI$Theme$success.kl, $author$project$UI$Theme$success.h$, 0), 55289 $elm$core$Maybe$Just( 55290 $author$project$Translations$entryDetailFrom(i18n))); 55291 } else { 55292 var _v4 = _v2.a; 55293 return _Utils_Tuple2( 55294 _Utils_Tuple3($author$project$UI$Theme$warning.kl, $author$project$UI$Theme$warning.h$, 3), 55295 $elm$core$Maybe$Just( 55296 $author$project$Translations$entryDetailTo(i18n))); 55297 } 55298 } else { 55299 return _Utils_Tuple2( 55300 _Utils_Tuple3($author$project$UI$Theme$base.kl, $author$project$UI$Theme$base.h$, 1), 55301 $elm$core$Maybe$Nothing); 55302 } 55303 }(); 55304 var _v1 = _v0.a; 55305 var borderClr = _v1.a; 55306 var backgroundColor = _v1.b; 55307 var avatarColor = _v1.c; 55308 var roleText = _v0.b; 55309 return A2( 55310 $author$project$Ui$row, 55311 _List_fromArray( 55312 [ 55313 $author$project$Ui$Input$button(config.e7), 55314 $author$project$Ui$width($author$project$Ui$shrink), 55315 $author$project$Ui$paddingWith( 55316 {lI: 0, nz: 0, pW: $author$project$UI$Theme$spacing.qk, qW: 0}), 55317 $author$project$Ui$rounded($author$project$UI$Theme$radius.hF), 55318 $author$project$Ui$border($author$project$UI$Theme$border), 55319 $author$project$Ui$spacing($author$project$UI$Theme$spacing.qk), 55320 $author$project$Ui$contentCenterY, 55321 $author$project$Ui$pointer, 55322 A2( 55323 $author$project$Ui$Anim$transition, 55324 $author$project$Ui$Anim$ms(200), 55325 _List_fromArray( 55326 [ 55327 $author$project$Ui$Anim$borderColor(borderClr), 55328 $author$project$Ui$Anim$backgroundColor(backgroundColor) 55329 ])) 55330 ]), 55331 _List_fromArray( 55332 [ 55333 A2($author$project$UI$Components$avatar, avatarColor, config.i0), 55334 function () { 55335 if (!roleText.$) { 55336 var text = roleText.a; 55337 return A2( 55338 $author$project$Ui$el, 55339 _List_fromArray( 55340 [ 55341 $author$project$Ui$Font$size($author$project$UI$Theme$font.aW), 55342 $author$project$Ui$Font$weight($author$project$UI$Theme$fontWeight.dL), 55343 $author$project$Ui$Font$color(borderClr) 55344 ]), 55345 $author$project$Ui$text( 55346 $elm$core$String$toUpper(text) + ':')); 55347 } else { 55348 return $author$project$Ui$none; 55349 } 55350 }(), 55351 A2( 55352 $author$project$Ui$el, 55353 _List_fromArray( 55354 [ 55355 $author$project$Ui$Font$weight($author$project$UI$Theme$fontWeight.nI) 55356 ]), 55357 $author$project$Ui$text(config.bW)) 55358 ])); 55359 }); 55360var $author$project$Page$Group$NewEntry$TransferView$transferMembersField = F3( 55361 function (i18n, activeMembers, data) { 55362 var sameFromTo = data.d_ && ((!_Utils_eq(data.mL, $elm$core$Maybe$Nothing)) && _Utils_eq(data.mL, data.kF)); 55363 var missingSelection = data.d_ && (_Utils_eq(data.mL, $elm$core$Maybe$Nothing) || _Utils_eq(data.kF, $elm$core$Maybe$Nothing)); 55364 var memberRole = function (memberId) { 55365 return _Utils_eq( 55366 data.mL, 55367 $elm$core$Maybe$Just(memberId)) ? $elm$core$Maybe$Just(0) : (_Utils_eq( 55368 data.kF, 55369 $elm$core$Maybe$Just(memberId)) ? $elm$core$Maybe$Just(1) : $elm$core$Maybe$Nothing); 55370 }; 55371 return A2( 55372 $author$project$Page$Group$NewEntry$Shared$formField, 55373 { 55374 i6: $author$project$Translations$newEntryTransferLabel(i18n), 55375 hd: true 55376 }, 55377 _List_fromArray( 55378 [ 55379 A2( 55380 $author$project$Ui$row, 55381 _List_fromArray( 55382 [ 55383 $author$project$Ui$spacing($author$project$UI$Theme$spacing.qk), 55384 $author$project$Ui$wrap 55385 ]), 55386 A2( 55387 $elm$core$List$map, 55388 function (member) { 55389 return A2( 55390 $author$project$Page$Group$NewEntry$TransferView$transferMemberBtn, 55391 i18n, 55392 { 55393 i0: A2( 55394 $elm$core$String$left, 55395 2, 55396 $elm$core$String$toUpper(member.bW)), 55397 bW: member.bW, 55398 e7: $author$project$Page$Group$NewEntry$Shared$CycleTransferRole(member.aj), 55399 j6: memberRole(member.aj) 55400 }); 55401 }, 55402 activeMembers)), 55403 A2( 55404 $author$project$Page$Group$NewEntry$Shared$errorWhen, 55405 missingSelection, 55406 $author$project$Translations$newEntrySelectBoth(i18n)), 55407 A2( 55408 $author$project$Page$Group$NewEntry$Shared$errorWhen, 55409 sameFromTo, 55410 $author$project$Translations$newEntrySameFromTo(i18n)) 55411 ])); 55412 }); 55413var $author$project$Ui$alignLeft = A2($author$project$Internal$Model2$classWith, $author$project$Internal$Flag$xAlign, $author$project$Internal$Style2$classes.lh); 55414var $author$project$Ui$contentBottom = A2($author$project$Internal$Model2$classWith, $author$project$Internal$Flag$yContentAlign, $author$project$Internal$Style2$classes.l$); 55415var $author$project$Page$Group$NewEntry$TransferView$transferSummary = F3( 55416 function (i18n, activeMembers, data) { 55417 var _v0 = _Utils_Tuple2(data.mL, data.kF); 55418 if ((!_v0.a.$) && (!_v0.b.$)) { 55419 var fromId = _v0.a.a; 55420 var toId = _v0.b.a; 55421 var memberSummary = F2( 55422 function (alignAttr, name) { 55423 return A2( 55424 $author$project$Ui$el, 55425 _List_fromArray( 55426 [ 55427 $author$project$Ui$Font$size($author$project$UI$Theme$font.i8), 55428 $author$project$Ui$Font$weight($author$project$UI$Theme$fontWeight.dL), 55429 $author$project$Ui$width($author$project$Ui$shrink), 55430 alignAttr 55431 ]), 55432 $author$project$Ui$text(name)); 55433 }); 55434 var findName = function (mid) { 55435 return A2( 55436 $elm$core$Maybe$withDefault, 55437 '?', 55438 A2( 55439 $elm$core$Maybe$map, 55440 function ($) { 55441 return $.bW; 55442 }, 55443 A2( 55444 $elmcraft$core_extra$List$Extra$find, 55445 function (m) { 55446 return _Utils_eq(m.aj, mid); 55447 }, 55448 activeMembers))); 55449 }; 55450 var amountCents = A2( 55451 $elm$core$Maybe$withDefault, 55452 0, 55453 $dwayne$elm_field$Field$toMaybe( 55454 A2( 55455 $dwayne$elm_form$Form$get, 55456 function ($) { 55457 return $.ef; 55458 }, 55459 data.w))); 55460 var amountText = A3( 55461 $author$project$Format$formatCentsWithCurrency, 55462 $author$project$Translations$currentLanguage(i18n), 55463 amountCents, 55464 data.bg); 55465 return A2( 55466 $author$project$Ui$row, 55467 _List_fromArray( 55468 [ 55469 $author$project$Ui$contentCenterX, 55470 $author$project$Ui$contentBottom, 55471 $author$project$Ui$spacing($author$project$UI$Theme$spacing.aW), 55472 $author$project$Ui$width($author$project$Ui$shrink), 55473 $author$project$Ui$centerX, 55474 $author$project$Ui$Font$color($author$project$UI$Theme$base.aM) 55475 ]), 55476 _List_fromArray( 55477 [ 55478 A2( 55479 memberSummary, 55480 $author$project$Ui$alignRight, 55481 findName(fromId)), 55482 A2( 55483 $author$project$Ui$column, 55484 _List_fromArray( 55485 [ 55486 $author$project$Ui$spacing($author$project$UI$Theme$spacing.bb), 55487 $author$project$Ui$contentCenterX 55488 ]), 55489 _List_fromArray( 55490 [ 55491 A2( 55492 $author$project$Ui$el, 55493 _List_fromArray( 55494 [ 55495 $author$project$Ui$Font$size($author$project$UI$Theme$font.qk), 55496 $author$project$Ui$Font$weight($author$project$UI$Theme$fontWeight.nI) 55497 ]), 55498 $author$project$Ui$text(amountText)), 55499 A2( 55500 $author$project$Ui$el, 55501 _List_fromArray( 55502 [$author$project$Ui$centerX]), 55503 A2($author$project$UI$Components$featherIcon, 20, $feathericons$elm_feather$FeatherIcons$arrowRight)) 55504 ])), 55505 A2( 55506 memberSummary, 55507 $author$project$Ui$alignLeft, 55508 findName(toId)) 55509 ])); 55510 } else { 55511 return $author$project$Ui$none; 55512 } 55513 }); 55514var $author$project$Page$Group$NewEntry$TransferView$transferFields = F3( 55515 function (i18n, activeMembers, data) { 55516 return _List_fromArray( 55517 [ 55518 A2($author$project$Page$Group$NewEntry$TransferView$descriptionField, i18n, data), 55519 A2($author$project$Page$Group$NewEntry$Shared$amountCurrencyField, i18n, data), 55520 A2($author$project$Page$Group$NewEntry$Shared$defaultCurrencyAmountField, i18n, data), 55521 A2($author$project$Page$Group$NewEntry$Shared$dateField, i18n, data), 55522 A3($author$project$Page$Group$NewEntry$TransferView$transferMembersField, i18n, activeMembers, data), 55523 A2($author$project$Page$Group$NewEntry$Shared$notesField, i18n, data), 55524 A2($author$project$Page$Group$NewEntry$Shared$attachmentsField, i18n, data), 55525 A3($author$project$Page$Group$NewEntry$TransferView$transferSummary, i18n, activeMembers, data) 55526 ]); 55527 }); 55528var $author$project$Page$Group$NewEntry$view = F4( 55529 function (i18n, activeMembers, toMsg, _v0) { 55530 var data = _v0; 55531 var sortedMembers = A2( 55532 $elm$core$List$sortBy, 55533 function (m) { 55534 return $elm$core$String$toLower(m.bW); 55535 }, 55536 activeMembers); 55537 var content = function () { 55538 var _v2 = data.gE; 55539 switch (_v2) { 55540 case 0: 55541 return A2( 55542 $author$project$Ui$column, 55543 _List_fromArray( 55544 [ 55545 $author$project$Ui$spacing($author$project$UI$Theme$spacing.i8) 55546 ]), 55547 A3($author$project$Page$Group$NewEntry$ExpenseView$expenseFields, i18n, sortedMembers, data)); 55548 case 1: 55549 return A2( 55550 $author$project$Ui$column, 55551 _List_fromArray( 55552 [ 55553 $author$project$Ui$spacing($author$project$UI$Theme$spacing.i8) 55554 ]), 55555 A3($author$project$Page$Group$NewEntry$TransferView$transferFields, i18n, sortedMembers, data)); 55556 default: 55557 return A2( 55558 $author$project$Ui$column, 55559 _List_fromArray( 55560 [ 55561 $author$project$Ui$spacing($author$project$UI$Theme$spacing.i8) 55562 ]), 55563 A3($author$project$Page$Group$NewEntry$IncomeView$incomeFields, i18n, sortedMembers, data)); 55564 } 55565 }(); 55566 var _v1 = data.cw ? _Utils_Tuple2( 55567 $author$project$Ui$none, 55568 A2( 55569 $author$project$UI$Components$btnPrimary, 55570 _List_Nil, 55571 { 55572 i6: $author$project$Translations$editEntrySubmit(i18n), 55573 e7: $author$project$Page$Group$NewEntry$Shared$Submit 55574 })) : _Utils_Tuple2( 55575 A2($author$project$Page$Group$NewEntry$modeToggle, i18n, data.gE), 55576 A2( 55577 $author$project$UI$Components$btnPrimary, 55578 _List_Nil, 55579 { 55580 i6: $author$project$Translations$newEntrySubmit(i18n), 55581 e7: $author$project$Page$Group$NewEntry$Shared$Submit 55582 })); 55583 var entryKindTabs = _v1.a; 55584 var confirmButton = _v1.b; 55585 return A2( 55586 $author$project$Ui$map, 55587 toMsg, 55588 A2( 55589 $author$project$Ui$column, 55590 _List_fromArray( 55591 [ 55592 $author$project$Ui$spacing($author$project$UI$Theme$spacing.i8), 55593 $author$project$Ui$width($author$project$Ui$fill) 55594 ]), 55595 _List_fromArray( 55596 [ 55597 entryKindTabs, 55598 content, 55599 confirmButton, 55600 A2($author$project$Ui$el, _List_Nil, $author$project$Ui$none) 55601 ]))); 55602 }); 55603var $author$project$Page$JoinGroup$viewGroupName = function (preview) { 55604 return A2( 55605 $author$project$Ui$el, 55606 _List_fromArray( 55607 [ 55608 $author$project$Ui$centerX, 55609 $author$project$Ui$Font$size($author$project$UI$Theme$font.hE), 55610 $author$project$Ui$Font$weight($author$project$UI$Theme$fontWeight.lD), 55611 $author$project$Ui$Font$letterSpacing($author$project$UI$Theme$letterSpacing.qP) 55612 ]), 55613 $author$project$Ui$text(preview.iP)); 55614}; 55615var $author$project$Page$JoinGroup$ConfirmJoin = {$: 3}; 55616var $author$project$Page$JoinGroup$InputNewMemberName = function (a) { 55617 return {$: 2, a: a}; 55618}; 55619var $author$project$Page$JoinGroup$SelectJoinAsNew = {$: 1}; 55620var $author$project$Translations$joinGroupClaimMember = function (_v0) { 55621 var lang = _v0; 55622 if (!lang) { 55623 return 'I am...'; 55624 } else { 55625 return 'Je suis...'; 55626 } 55627}; 55628var $author$project$Translations$joinGroupConfirm = function (_v0) { 55629 var lang = _v0; 55630 if (!lang) { 55631 return 'Join'; 55632 } else { 55633 return 'Rejoindre'; 55634 } 55635}; 55636var $author$project$Translations$joinGroupConfirmClaim = F2( 55637 function (name, _v0) { 55638 var lang = _v0; 55639 if (!lang) { 55640 return 'I am ' + name; 55641 } else {
55642 return 'Je suis ' + name; 55643 } 55644 }); 55645var $author$project$Translations$joinGroupConfirmNew = F2( 55646 function (name, _v0) { 55647 var lang = _v0; 55648 if (!lang) { 55649 return 'Join as ' + name; 55650 } else { 55651 return 'Rejoindre en tant que ' + name; 55652 } 55653 }); 55654var $author$project$Translations$joinGroupConfirmRelink = F2( 55655 function (name, _v0) { 55656 var lang = _v0; 55657 if (!lang) { 55658 return 'Re-link ' + name; 55659 } else { 55660 return 'Re-lier ' + name; 55661 } 55662 }); 55663var $author$project$Translations$joinGroupHistoryWarning = function (_v0) { 55664 var lang = _v0; 55665 if (!lang) { 55666 return 'This group\'s consolidated history could not be fully verified. Ask the person who invited you before relying on the amounts shown.'; 55667 } else { 55668 return 'L\'historique consolidé de ce groupe n\'a pas pu être entièrement vérifié. Vérifie auprès de la personne qui t\'a invité·e avant de te fier aux montants affichés.'; 55669 } 55670}; 55671var $author$project$Translations$joinGroupJoinAsNew = function (_v0) { 55672 var lang = _v0; 55673 if (!lang) { 55674 return 'Join as new member'; 55675 } else { 55676 return 'Rejoindre en tant que nouveau membre'; 55677 } 55678}; 55679var $author$project$Translations$joinGroupNameLabel = function (_v0) { 55680 var lang = _v0; 55681 if (!lang) { 55682 return 'Your name'; 55683 } else { 55684 return 'Ton nom'; 55685 } 55686}; 55687var $author$project$Translations$joinGroupNamePlaceholder = function (_v0) { 55688 var lang = _v0; 55689 if (!lang) { 55690 return 'Enter your name'; 55691 } else { 55692 return 'Entre ici ton nom'; 55693 } 55694}; 55695var $author$project$Translations$joinGroupNameTaken = function (_v0) { 55696 var lang = _v0; 55697 if (!lang) { 55698 return 'This name is already used by another member.'; 55699 } else { 55700 return 'Ce nom est déjà utilisé par un autre membre.'; 55701 } 55702}; 55703var $author$project$Translations$joinGroupRelinkMember = function (_v0) { 55704 var lang = _v0; 55705 if (!lang) { 55706 return 'Re-link my account...'; 55707 } else { 55708 return 'Re-lier mon compte...'; 55709 } 55710}; 55711var $author$project$Ui$paddingTop = function (x) { 55712 return A3( 55713 $author$project$Internal$Model2$styleWith, 55714 $author$project$Internal$Flag$padding, 55715 'padding-top', 55716 $elm$core$String$fromInt(x) + 'px'); 55717}; 55718var $author$project$Page$JoinGroup$SelectMember = function (a) { 55719 return {$: 0, a: a}; 55720}; 55721var $author$project$Page$JoinGroup$viewMemberToggle = F2( 55722 function (selectedAction, member) { 55723 var isSelected = function () { 55724 if (!selectedAction.$) { 55725 var id = selectedAction.a; 55726 return _Utils_eq(id, member.aj); 55727 } else { 55728 return false; 55729 } 55730 }(); 55731 return $author$project$UI$Components$togglePill( 55732 { 55733 gv: $elm$core$Maybe$Nothing, 55734 i6: member.bW, 55735 e7: $author$project$Page$JoinGroup$SelectMember(member.aj), 55736 hj: isSelected 55737 }); 55738 }); 55739var $author$project$Page$JoinGroup$viewPreview = F2( 55740 function (i18n, preview) { 55741 var virtualMembers = A2( 55742 $elm$core$List$sortBy, 55743 function (m) { 55744 return $elm$core$String$toLower(m.bW); 55745 }, 55746 A2( 55747 $elm$core$List$filter, 55748 function (m) { 55749 return (m.nL === 1) && (!m.nt); 55750 }, 55751 $elm$core$Dict$values(preview.a6.r))); 55752 var trimmedName = $elm$core$String$trim(preview.n0); 55753 var realMembers = A2( 55754 $elm$core$List$sortBy, 55755 function (m) { 55756 return $elm$core$String$toLower(m.bW); 55757 }, 55758 A2( 55759 $elm$core$List$filter, 55760 function (m) { 55761 return (!m.nL) && (!m.nt); 55762 }, 55763 $elm$core$Dict$values(preview.a6.r))); 55764 var isJoinAsNew = function () { 55765 var _v6 = preview.hk; 55766 if (_v6.$ === 1) { 55767 return true; 55768 } else { 55769 return false; 55770 } 55771 }(); 55772 var existingNames = A2( 55773 $elm$core$List$map, 55774 function (m) { 55775 return $elm$core$String$toLower(m.bW); 55776 }, 55777 A2( 55778 $elm$core$List$filter, 55779 A2( 55780 $elm$core$Basics$composeL, 55781 $elm$core$Basics$not, 55782 function ($) { 55783 return $.nt; 55784 }), 55785 $elm$core$Dict$values(preview.a6.r))); 55786 var isDuplicateName = A2( 55787 $elm$core$List$member, 55788 $elm$core$String$toLower(trimmedName), 55789 existingNames); 55790 var canConfirm = function () { 55791 var _v5 = preview.hk; 55792 if (!_v5.$) { 55793 return true; 55794 } else { 55795 return (!$elm$core$String$isEmpty(trimmedName)) && (!isDuplicateName); 55796 } 55797 }(); 55798 return _List_fromArray( 55799 [ 55800 preview.iU ? A2( 55801 $author$project$UI$Components$card, 55802 _List_fromArray( 55803 [ 55804 $author$project$Ui$padding($author$project$UI$Theme$spacing.aW) 55805 ]), 55806 _List_fromArray( 55807 [ 55808 A2( 55809 $author$project$Ui$el, 55810 _List_fromArray( 55811 [ 55812 $author$project$Ui$Font$size($author$project$UI$Theme$font.qk), 55813 $author$project$Ui$Font$color($author$project$UI$Theme$danger.qI) 55814 ]), 55815 $author$project$Ui$text( 55816 $author$project$Translations$joinGroupHistoryWarning(i18n))) 55817 ])) : $author$project$Ui$none, 55818 (!$elm$core$List$isEmpty(virtualMembers)) ? A2( 55819 $author$project$Ui$column, 55820 _List_Nil, 55821 _List_fromArray( 55822 [ 55823 $author$project$UI$Components$sectionLabel( 55824 $author$project$Translations$joinGroupClaimMember(i18n)), 55825 A2( 55826 $author$project$Ui$row, 55827 _List_fromArray( 55828 [ 55829 $author$project$Ui$wrap, 55830 $author$project$Ui$spacing($author$project$UI$Theme$spacing.qk) 55831 ]), 55832 A2( 55833 $elm$core$List$map, 55834 $author$project$Page$JoinGroup$viewMemberToggle(preview.hk), 55835 virtualMembers)) 55836 ])) : $author$project$Ui$none, 55837 A2( 55838 $author$project$Ui$column, 55839 _List_Nil, 55840 _List_fromArray( 55841 [ 55842 $author$project$UI$Components$togglePill( 55843 { 55844 gv: $elm$core$Maybe$Just($feathericons$elm_feather$FeatherIcons$plus), 55845 i6: $author$project$Translations$joinGroupJoinAsNew(i18n), 55846 e7: $author$project$Page$JoinGroup$SelectJoinAsNew, 55847 hj: isJoinAsNew 55848 }), 55849 isJoinAsNew ? A2( 55850 $author$project$Ui$column, 55851 _List_fromArray( 55852 [ 55853 $author$project$Ui$paddingTop($author$project$UI$Theme$spacing.aW), 55854 $author$project$Ui$spacing($author$project$UI$Theme$spacing.bb), 55855 $author$project$Ui$width($author$project$Ui$fill) 55856 ]), 55857 _List_fromArray( 55858 [ 55859 A2( 55860 $author$project$UI$Components$formLabel, 55861 $author$project$Translations$joinGroupNameLabel(i18n), 55862 true), 55863 A2( 55864 $author$project$Ui$Input$text, 55865 _List_fromArray( 55866 [ 55867 $author$project$Ui$width($author$project$Ui$fill), 55868 $author$project$Ui$padding($author$project$UI$Theme$spacing.qk), 55869 $author$project$Ui$rounded($author$project$UI$Theme$radiu
55869s.qk), 55870 $author$project$Ui$border($author$project$UI$Theme$border), 55871 $author$project$Ui$borderColor($author$project$UI$Theme$base.k3) 55872 ]), 55873 { 55874 i6: $author$project$Ui$Input$labelHidden( 55875 $author$project$Translations$joinGroupNameLabel(i18n)), 55876 oq: $author$project$Page$JoinGroup$InputNewMemberName, 55877 pt: $elm$core$Maybe$Just( 55878 $author$project$Translations$joinGroupNamePlaceholder(i18n)), 55879 qI: preview.n0 55880 }), 55881 (isDuplicateName && (!$elm$core$String$isEmpty(trimmedName))) ? A2( 55882 $author$project$Ui$el, 55883 _List_fromArray( 55884 [ 55885 $author$project$Ui$Font$size($author$project$UI$Theme$font.qk), 55886 $author$project$Ui$Font$color($author$project$UI$Theme$danger.qI) 55887 ]), 55888 $author$project$Ui$text( 55889 $author$project$Translations$joinGroupNameTaken(i18n))) : $author$project$Ui$none 55890 ])) : $author$project$Ui$none 55891 ])), 55892 (!$elm$core$List$isEmpty(realMembers)) ? A2( 55893 $author$project$Ui$column, 55894 _List_Nil, 55895 _List_fromArray( 55896 [ 55897 $author$project$UI$Components$sectionLabel( 55898 $author$project$Translations$joinGroupRelinkMember(i18n)), 55899 A2( 55900 $author$project$Ui$row, 55901 _List_fromArray( 55902 [ 55903 $author$project$Ui$wrap, 55904 $author$project$Ui$spacing($author$project$UI$Theme$spacing.qk) 55905 ]), 55906 A2( 55907 $elm$core$List$map, 55908 $author$project$Page$JoinGroup$viewMemberToggle(preview.hk), 55909 realMembers)) 55910 ])) : $author$project$Ui$none, 55911 function () { 55912 if (canConfirm) { 55913 var confirmLabel = function () { 55914 var _v0 = preview.hk; 55915 if (!_v0.$) { 55916 var memberId = _v0.a; 55917 var member = A2($elm$core$Dict$get, memberId, preview.a6.r); 55918 var _v1 = A2( 55919 $elm$core$Maybe$map, 55920 function (m) { 55921 return _Utils_Tuple2(m.bW, m.nL); 55922 }, 55923 member); 55924 if (!_v1.$) { 55925 if (_v1.a.b === 1) { 55926 var _v2 = _v1.a; 55927 var name = _v2.a; 55928 var _v3 = _v2.b; 55929 return A2($author$project$Translations$joinGroupConfirmClaim, name, i18n); 55930 } else { 55931 var _v4 = _v1.a; 55932 var name = _v4.a; 55933 return A2($author$project$Translations$joinGroupConfirmRelink, name, i18n); 55934 } 55935 } else { 55936 return $author$project$Translations$joinGroupConfirm(i18n); 55937 } 55938 } else { 55939 return A2($author$project$Translations$joinGroupConfirmNew, trimmedName, i18n); 55940 } 55941 }(); 55942 return A2( 55943 $author$project$UI$Components$btnPrimary, 55944 _List_Nil, 55945 {i6: confirmLabel, e7: $author$project$Page$JoinGroup$ConfirmJoin}); 55946 } else { 55947 return $author$project$Ui$none; 55948 } 55949 }() 55950 ]); 55951 }); 55952var $author$project$Page$Group$DismissTamperSignals = {$: 31}; 55953var $author$project$Page$Group$RelinkDevice = function (a) { 55954 return {$: 4, a: a}; 55955}; 55956var $author$project$Page$Group$UnarchiveGroup = {$: 17}; 55957var $author$project$Translations$groupArchivedBanner = function (_v0) { 55958 var lang = _v0; 55959 if (!lang) { 55960 return 'This group is archived: read-only, and it doesn\'t sync.'; 55961 } else { 55962 return 'Ce groupe est archivé : lecture seule, sans synchronisation.'; 55963 } 55964}; 55965var $author$project$Translations$groupArchivedUnarchive = function (_v0) { 55966 var lang = _v0; 55967 if (!lang) { 55968 return 'Unarchive'; 55969 } else { 55970 return 'Désarchiver'; 55971 } 55972}; 55973var $author$project$UI$Components$archivedBanner = F2( 55974 function (i18n, _v0) { 55975 var onUnarchive = _v0.o8; 55976 return A2( 55977 $author$project$UI$Components$pwaBanner, 55978 $author$project$Translations$groupArchivedBanner(i18n), 55979 { 55980 k5: $elm$core$Maybe$Just( 55981 _Utils_Tuple2( 55982 $author$project$Translations$groupArchivedUnarchive(i18n), 55983 _List_fromArray( 55984 [ 55985 $author$project$Ui$Input$button(onUnarchive) 55986 ]))), 55987 fW: $author$project$UI$Theme$base.qS, 55988 Y: $elm$core$Maybe$Nothing, 55989 hv: $author$project$UI$Theme$base.qI 55990 }); 55991 }); 55992var $author$project$Domain$TamperSignals$bannerWorthy = function (s) { 55993 return (!$elm$core$Dict$isEmpty(s.bm)) || (s.bZ > 0); 55994}; 55995var $author$project$UI$Theme$shadowAccent = $author$project$Ui$Shadow$shadows( 55996 _List_fromArray( 55997 [ 55998 {
55999 h1: 20, 56000 ic: A4($author$project$Ui$rgba, 232, 114, 92, 0.35), 56001 dW: 0, 56002 rm: 0, 56003 k0: 4 56004 }, 56005 { 56006 h1: 8, 56007 ic: A4($author$project$Ui$rgba, 232, 114, 92, 0.2), 56008 dW: 0, 56009 rm: 0, 56010 k0: 2 56011 } 56012 ])); 56013var $author$project$Ui$link = function (uri) { 56014 return $author$project$Internal$Model2$link( 56015 {iq: $elm$core$Maybe$Nothing, n4: false, kS: uri}); 56016}; 56017var $elm$virtual_dom$VirtualDom$MayPreventDefault = function (a) { 56018 return {$: 2, a: a}; 56019}; 56020var $elm$html$Html$Events$preventDefaultOn = F2( 56021 function (event, decoder) { 56022 return A2( 56023 $elm$virtual_dom$VirtualDom$on, 56024 event, 56025 $elm$virtual_dom$VirtualDom$MayPreventDefault(decoder)); 56026 }); 56027var $author$project$Ui$Events$preventDefaultOn = F2( 56028 function (name, decoder) { 56029 return $author$project$Internal$Model2$attribute( 56030 A2($elm$html$Html$Events$preventDefaultOn, name, decoder)); 56031 }); 56032var $author$project$UI$Components$spaLinkAttrs = F2( 56033 function (href, onPress) { 56034 return _List_fromArray( 56035 [ 56036 $author$project$Ui$link(href), 56037 A2( 56038 $author$project$Ui$Events$preventDefaultOn, 56039 'click', 56040 $elm$json$Json$Decode$succeed( 56041 _Utils_Tuple2(onPress, true))) 56042 ]); 56043 }); 56044var $author$project$UI$Components$fab = function (config) { 56045 return A2( 56046 $author$project$Ui$el, 56047 _Utils_ap( 56048 A2($author$project$UI$Components$spaLinkAttrs, config.m7, config.e7), 56049 _List_fromArray( 56050 [ 56051 $author$project$Ui$Accessibility$description(config.i6), 56052 $author$project$Ui$width( 56053 $author$project$Ui$px($author$project$UI$Theme$sizing.hE)), 56054 $author$project$Ui$height( 56055 $author$project$Ui$px($author$project$UI$Theme$sizing.hE)), 56056 $author$project$Ui$rounded($author$project$UI$Theme$radius.i8), 56057 $author$project$Ui$background($author$project$UI$Theme$primary.kl), 56058 $author$project$Ui$Font$color($author$project$UI$Theme$primary.km), 56059 $author$project$UI$Theme$shadowAccent, 56060 $author$project$Ui$alignRight, 56061 $author$project$Ui$pointer, 56062 $author$project$Ui$contentCenterX, 56063 $author$project$Ui$contentCenterY 56064 ])), 56065 A3($author$project$UI$Components$featherIconColored, 'white', $author$project$UI$Theme$sizing.qk, $feathericons$elm_feather$FeatherIcons$plus)); 56066}; 56067var $author$project$Translations$groupAddEntryLabel = function (_v0) { 56068 var lang = _v0; 56069 if (!lang) { 56070 return 'Add expense'; 56071 } else { 56072 return 'Ajouter une dépense'; 56073 } 56074}; 56075var $author$project$Translations$readOnlyBanner = function (_v0) { 56076 var lang = _v0; 56077 if (!lang) { 56078 return 'Read-only mode. You are not a member of this group'; 56079 } else { 56080 return 'Mode lecture seule. Tu n\'es pas membre de ce groupe'; 56081 } 56082}; 56083var $author$project$Translations$readOnlyRejoin = function (_v0) { 56084 var lang = _v0; 56085 if (!lang) { 56086 return 'Re-join'; 56087 } else { 56088 return 'Rejoindre'; 56089 } 56090}; 56091var $author$project$UI$Components$readOnlyBanner = F2( 56092 function (i18n, _v0) { 56093 var onRejoin = _v0.oV; 56094 return A2( 56095 $author$project$UI$Components$pwaBanner, 56096 $author$project$Translations$readOnlyBanner(i18n), 56097 { 56098 k5: $elm$core$Maybe$Just( 56099 _Utils_Tuple2( 56100 $author$project$Translations$readOnlyRejoin(i18n), 56101 _List_fromArray( 56102 [ 56103 $author$project$Ui$Input$button(onRejoin) 56104 ]))), 56105 fW: $author$project$UI$Theme$warning.qR, 56106 Y: $elm$core$Maybe$Nothing, 56107 hv: $author$project$UI$Theme$warning.qI 56108 }); 56109 }); 56110var $author$project$Translations$groupRecoveryBanner = function (_v0) { 56111 var lang = _v0; 56112 if (!lang) { 56113 return 'This device isn\'t linked to this group under its current key. Re-link it to post again.'; 56114 } else { 56115 return 'Cet appareil nâest pas rattaché à ce groupe avec sa clé actuelle. Rattache-le pour publier à nouveau.'; 56116 } 56117}; 56118var $author$project$Translations$groupRecoveryRelink = function (_v0) { 56119 var lang = _v0; 56120 if (!lang) { 56121 return 'Re-link this device'; 56122 } else { 56123 return 'Rattacher cet appareil'; 56124 } 56125}; 56126var $author$project$UI$Components$recoveryBanner = F2( 56127 function (i18n, _v0) { 56128 var onRelink = _v0.oW; 56129 return A2( 56130 $author$project$UI$Components$pwaBanner, 56131 $author$project$Translations$groupRecoveryBanner(i18n), 56132 { 56133 k5: $elm$core$Maybe$Just( 56134 _Utils_Tuple2( 56135 $author$project$Translations$groupRecoveryRelink(i18n), 56136 _List_fromArray( 56137 [ 56138 $author$project$Ui$Input$button(onRelink) 56139 ]))), 56140 fW: $author$project$UI$Theme$primary.qR, 56141 Y: $elm$core$Maybe$Nothing, 56142 hv: $author$project$UI$Theme$primary.qI 56143 }); 56144 }); 56145var $author$project$Translations$groupSuspicionReview = function (_v0) { 56146 var lang = _v0; 56147 if (!lang) { 56148 return 'Review'; 56149 } else { 56150 return 'Examiner'; 56151 } 56152}; 56153var $author$project$Translations$groupSuspicionWarning = function (_v0) { 56154 var lang = _v0; 56155 if (!lang) { 56156 return 'Some activity in this group looks suspicious. Review it before it spreads.'; 56157 } else { 56158 return 'Certaines activités de ce groupe semblent suspectes. Examine-les avant qu\'elles ne se prop
56158agent.'; 56159 } 56160}; 56161var $author$project$UI$Components$suspicionBanner = F2( 56162 function (i18n, _v0) { 56163 var onReview = _v0.o$; 56164 return A2( 56165 $author$project$UI$Components$pwaBanner, 56166 $author$project$Translations$groupSuspicionWarning(i18n), 56167 { 56168 k5: $elm$core$Maybe$Just( 56169 _Utils_Tuple2( 56170 $author$project$Translations$groupSuspicionReview(i18n), 56171 _List_fromArray( 56172 [ 56173 $author$project$Ui$Input$button(onReview) 56174 ]))), 56175 fW: $author$project$UI$Theme$danger.qR, 56176 Y: $elm$core$Maybe$Nothing, 56177 hv: $author$project$UI$Theme$danger.qI 56178 }); 56179 }); 56180var $author$project$Translations$tabActivity = function (_v0) { 56181 var lang = _v0; 56182 if (!lang) { 56183 return 'Activity'; 56184 } else { 56185 return 'Activité'; 56186 } 56187}; 56188var $author$project$Translations$tabBalance = function (_v0) { 56189 var lang = _v0; 56190 if (!lang) { 56191 return 'Balance'; 56192 } else { 56193 return 'Soldes'; 56194 } 56195}; 56196var $feathericons$elm_feather$FeatherIcons$activity = A2( 56197 $feathericons$elm_feather$FeatherIcons$makeBuilder, 56198 'activity', 56199 _List_fromArray( 56200 [ 56201 A2( 56202 $elm$svg$Svg$polyline, 56203 _List_fromArray( 56204 [ 56205 $elm$svg$Svg$Attributes$points('22 12 18 12 15 21 9 3 6 12 2 12') 56206 ]), 56207 _List_Nil) 56208 ])); 56209var $feathericons$elm_feather$FeatherIcons$list = A2( 56210 $feathericons$elm_feather$FeatherIcons$makeBuilder, 56211 'list', 56212 _List_fromArray( 56213 [ 56214 A2( 56215 $elm$svg$Svg$line, 56216 _List_fromArray( 56217 [ 56218 $elm$svg$Svg$Attributes$x1('8'), 56219 $elm$svg$Svg$Attributes$y1('6'), 56220 $elm$svg$Svg$Attributes$x2('21'), 56221 $elm$svg$Svg$Attributes$y2('6') 56222 ]), 56223 _List_Nil), 56224 A2( 56225 $elm$svg$Svg$line, 56226 _List_fromArray( 56227 [ 56228 $elm$svg$Svg$Attributes$x1('8'), 56229 $elm$svg$Svg$Attributes$y1('12'), 56230 $elm$svg$Svg$Attributes$x2('21'), 56231 $elm$svg$Svg$Attributes$y2('12') 56232 ]), 56233 _List_Nil), 56234 A2( 56235 $elm$svg$Svg$line, 56236 _List_fromArray( 56237 [ 56238 $elm$svg$Svg$Attributes$x1('8'), 56239 $elm$svg$Svg$Attributes$y1('18'), 56240 $elm$svg$Svg$Attributes$x2('21'), 56241 $elm$svg$Svg$Attributes$y2('18') 56242 ]), 56243 _List_Nil), 56244 A2( 56245 $elm$svg$Svg$line, 56246 _List_fromArray( 56247 [ 56248 $elm$svg$Svg$Attributes$x1('3'), 56249 $elm$svg$Svg$Attributes$y1('6'), 56250 $elm$svg$Svg$Attributes$x2('3.01'), 56251 $elm$svg$Svg$Attributes$y2('6') 56252 ]), 56253 _List_Nil), 56254 A2( 56255 $elm$svg$Svg$line, 56256 _List_fromArray( 56257 [ 56258 $elm$svg$Svg$Attributes$x1('3'), 56259 $elm$svg$Svg$Attributes$y1('12'), 56260 $elm$svg$Svg$Attributes$x2('3.01'), 56261 $elm$svg$Svg$Attributes$y2('12') 56262 ]), 56263 _List_Nil), 56264 A2( 56265 $elm$svg$Svg$line, 56266 _List_fromArray( 56267 [ 56268 $elm$svg$Svg$Attributes$x1('3'), 56269 $elm$svg$Svg$Attributes$y1('18'), 56270 $elm$svg$Svg$Attributes$x2('3.01'), 56271 $elm$svg$Svg$Attributes$y2('18') 56272 ]), 56273 _List_Nil) 56274 ])); 56275var $author$project$UI$Shell$tab = F6( 56276 function (activeTab, tabHref, onTabClick, thisTab, icon, label) { 56277 var _v0 = _Utils_eq(thisTab, activeTab) ? _Utils_Tuple2( 56278 $author$project$Ui$Font$color($author$project$UI$Theme$primary.kl), 56279 $author$project$Ui$Font$weight($author$project$UI$Theme$fontWeight.dL)) : _Utils_Tuple2( 56280 $author$project$Ui$Font$color($author$project$UI$Theme$base.aM), 56281 $author$project$Ui$noAttr); 56282 var fontColor = _v0.a; 56283 var fontWeight = _v0.b; 56284 return A2( 56285 $author$project$Ui$column, 56286 A2( 56287 $elm$core$List$cons, 56288 $author$project$Ui$width($author$project$Ui$fill), 56289 A2( 56290 $elm$core$List$cons, 56291 A2($author$project$Ui$paddingXY, $author$project$UI$Theme$spacing.qk, $author$project$UI$Theme$spacing.qk), 56292 A2( 56293 $elm$core$List$cons, 56294 $author$project$Ui$spacing($author$project$UI$Theme$spacing.bb), 56295 A2( 56296 $elm$core$List$cons, 56297 $author$project$Ui$pointer, 56298 A2( 56299 $elm$core$List$cons, 56300 $author$project$Ui$contentCenterX, 56301 A2( 56302 $elm$core$List$cons, 56303 $author$project$Ui$Font$center, 56304 A2( 56305 $elm$core$List$cons, 56306 $author$project$Ui$Font$size($author$project$UI$Theme$font.bb), 56307 A2( 56308 $elm$core$List$cons, 56309 fontColor, 56310 A2( 56311 $elm$core$List$cons, 56312 fontWeight, 56313 A2( 56314 $author$project$UI$Components$spaLinkAttrs, 56315 tabHref(thisTab), 56316 onTabClick(thisTab))))))))))), 56317 _List_fromArray( 56318 [ 56319 A2( 56320 $author$project$Ui$el, 56321 _List_fromArray( 56322 [$author$project$Ui$centerX]), 56323 A2($author$project$UI$Components$featherIcon, 18, icon)), 56324 $author$project$Ui$text(label) 56325 ])); 56326 }); 56327var $feathericons$elm_feather$FeatherIcons$users = A2( 56328 $feathericons$elm_feather$FeatherIcons$makeBuilder, 56329 'users', 56330 _List_fromArray( 56331 [ 56332 A2( 56333 $elm$svg$Svg$path, 56334 _List_fromArray( 56335 [ 56336 $elm$svg$Svg$Attributes$d('M17 21v-2a4 4 0 0 0-4-4H5a4 4 0 0 0-4 4v2') 56337 ]), 56338 _List_Nil), 56339 A2( 56340 $elm$svg$Svg$circle, 56341 _List_fromArray( 56342 [ 56343 $elm$svg$Svg$Attributes$cx('9'), 56344 $elm$svg$Svg$Attributes$cy('7'),
56345 $elm$svg$Svg$Attributes$r('4') 56346 ]), 56347 _List_Nil), 56348 A2( 56349 $elm$svg$Svg$path, 56350 _List_fromArray( 56351 [ 56352 $elm$svg$Svg$Attributes$d('M23 21v-2a4 4 0 0 0-3-3.87') 56353 ]), 56354 _List_Nil), 56355 A2( 56356 $elm$svg$Svg$path, 56357 _List_fromArray( 56358 [ 56359 $elm$svg$Svg$Attributes$d('M16 3.13a4 4 0 0 1 0 7.75') 56360 ]), 56361 _List_Nil) 56362 ])); 56363var $author$project$UI$Shell$tabBar = F4( 56364 function (labels, tabHref, activeTab, onTabClick) { 56365 return A2( 56366 $author$project$Ui$row, 56367 _List_fromArray( 56368 [ 56369 $author$project$Ui$width($author$project$Ui$fill), 56370 $author$project$Ui$alignBottom, 56371 $author$project$Ui$background($author$project$UI$Theme$base.h$), 56372 $author$project$Ui$borderWith( 56373 {lI: 0, nz: 0, pW: 0, qW: $author$project$UI$Theme$border}), 56374 $author$project$Ui$borderColor($author$project$UI$Theme$base.k3) 56375 ]), 56376 _List_fromArray( 56377 [ 56378 A6($author$project$UI$Shell$tab, activeTab, tabHref, onTabClick, 0, $feathericons$elm_feather$FeatherIcons$dollarSign, labels.lx), 56379 A6($author$project$UI$Shell$tab, activeTab, tabHref, onTabClick, 1, $feathericons$elm_feather$FeatherIcons$list, labels.E), 56380 A6($author$project$UI$Shell$tab, activeTab, tabHref, onTabClick, 2, $feathericons$elm_feather$FeatherIcons$users, labels.r), 56381 A6($author$project$UI$Shell$tab, activeTab, tabHref, onTabClick, 3, $feathericons$elm_feather$FeatherIcons$activity, labels.k7) 56382 ])); 56383 }); 56384var $author$project$Page$Group$ActivityTabMsg = function (a) { 56385 return {$: 7, a: a}; 56386}; 56387var $author$project$Page$Group$BalanceTabMsg = function (a) { 56388 return {$: 6, a: a}; 56389}; 56390var $author$project$Page$Group$EntriesTabMsg = function (a) { 56391 return {$: 5, a: a}; 56392}; 56393var $author$project$Page$Group$MembersTabMsg = function (a) { 56394 return {$: 8, a: a}; 56395}; 56396var $author$project$Page$Group$RequestTransfer = function (a) { 56397 return {$: 3, a: a}; 56398}; 56399var $author$project$Page$Group$SaveSettlementPreferences = function (a) { 56400 return {$: 15, a: a}; 56401}; 56402var $author$project$Page$Group$ToggleNotification = {$: 16}; 56403var $author$project$Domain$Compaction$attestationTail = function (events) { 56404 return A2( 56405 $elm$core$Maybe$map, 56406 function (newest) { 56407 return $elm$core$String$fromInt( 56408 $elm$core$List$length(events)) + ('-' + newest.m9); 56409 }, 56410 $elm$core$List$head( 56411 $elm$core$List$reverse( 56412 $author$project$Domain$Event$sortEvents(events)))); 56413}; 56414var $author$project$Page$Group$EntriesTab$FreshlyAdded = 0; 56415var $author$project$Page$Group$EntriesTab$FreshlyEdited = 1; 56416var $author$project$Page$Group$entryFreshness = function (loaded) { 56417 var freshnessDict = A3( 56418 $elm$core$List$foldl, 56419 F2( 56420 function (envelope, acc) { 56421 if (A2($elm$core$Set$member, envelope.m9, loaded.kP)) { 56422 var _v0 = envelope.jC; 56423 switch (_v0.$) { 56424 case 7: 56425 var entry = _v0.a; 56426 return A3($elm$core$Dict$insert, entry.gM.aj, 0, acc); 56427 case 8: 56428 var entry = _v0.a; 56429 return A3( 56430 $elm$core$Dict$update, 56431 entry.gM.aj, 56432 function (existing) { 56433 if ((!existing.$) && (!existing.a)) { 56434 var _v2 = existing.a; 56435 return existing; 56436 } else { 56437 return $elm$core$Maybe$Just(1); 56438 } 56439 }, 56440 acc); 56441 default: 56442 return acc; 56443 } 56444 } else { 56445 return acc; 56446 } 56447 }), 56448 $elm$core$Dict$empty, 56449 loaded.iC); 56450 return function (entryId) { 56451 return A2($elm$core$Dict$get, entryId, freshnessDict); 56452 }; 56453}; 56454var $author$project$Page$Group$pendingEntryIds = function (loaded) { 56455 return $elm$core$Set$fromList( 56456 A2( 56457 $elm$core$List$filterMap, 56458 function (envelope) { 56459 if (A2($elm$core$Set$member, envelope.m9, loaded.bC)) { 56460 var _v0 = envelope.jC; 56461 switch (_v0.$) { 56462 case 7: 56463 var entry = _v0.a; 56464 return $elm$core$Maybe$Just(entry.gM.aj); 56465 case 8: 56466 var entry = _v0.a; 56467 return $elm$core$Maybe$Just(entry.gM.aj); 56468 case 9: 56469 var rootId = _v0.a.aj; 56470 return $elm$core$Maybe$Just(rootId); 56471 case 10: 56472 var rootId = _v0.a.aj; 56473 return $elm$core$Maybe$Just(rootId); 56474 default: 56475 return $elm$core$Maybe$Nothing; 56476 } 56477 } else { 56478 return $elm$core$Maybe$Nothing; 56479 } 56480 }, 56481 loaded.iC)); 56482}; 56483var $author$project$Domain$Filter$EntryActivity = 0; 56484var $author$project$Domain$Filter$GroupActivity = 2; 56485var $author$project$Domain$Filter$MemberActivity = 1; 56486var $author$project$Domain$Filter$activityTypeToString = function (at) { 56487 switch (at) { 56488 case 0: 56489 return 'entry'; 56490 case 1: 56491 return 'member'; 56492 default: 56493 return 'group'; 56494 } 56495}; 56496var $author$project$Translations$filterActivityEntry = function (_v0) { 56497 var lang = _v0; 56498 if (!lang) { 56499 return 'Entry events'; 56500 } else { 56501 return 'Entrées'; 56502 } 56503}; 56504var $author$project$Translations$filterActivityGroup = function (_v0) { 56505 var lang = _v0; 56506 if (!lang) { 56507 return 'Group events'; 56508 } else { 56509 return 'Activité de groupe'; 56510 } 56511}; 56512var $author$project$Translations$filterActivityMember = function (_v0) { 56513 var lang = _v0; 56514 if (!lang) { 56515 return 'Member events'; 56516 } else { 56517 return 'Activité de membre'; 56518 } 56519}; 56520var $author$project$Translations$filterActivityTypeLabel = function (_v0) { 56521 var lang = _v0; 56522 if (!lang) { 56523 return 'Type'; 56524 } else { 56525 return 'Type'; 56526 } 56527}; 56528var $author$project$Translations$filterActorLabel = function (_v0) { 56529 var lang = _v0; 56530 if (!lang) { 56531 return 'Actor'; 56532 } else { 56533 return 'Acteur'; 56534 } 56535}; 56536var $author$project$Translations$filterInvolvedLabel = function (_v0) { 56537 var lang = _v0; 56538 if (!lang) { 56539 return 'Involved'; 56540 } else { 56541 return 'Impliqué'; 56542 } 56543}; 56544var $author$project$Translations$filterSectionTitle = function (_v0) { 56545 var lang = _v0; 56546 if (!lang) { 56547 return 'Filters'; 56548 } else { 56549 return 'Filtres'; 56550 } 56551}; 56552var $author$project$UI$Components$filterSummaryChip = F2( 56553 function (category, label) { 56554 return A2( 56555 $author$project$Ui$row, 56556 _List_fromArray( 56557 [ 56558 $author$project$Ui$Font$size($author$project$UI$Theme$font.bb), 56559 A2($author$project$Ui$paddingXY, $author$project$UI$Theme$spacing.qk, $author$project$UI$Theme$spacing.bb),
56560 $author$project$Ui$rounded($author$project$UI$Theme$radius.aW), 56561 $author$project$Ui$background($author$project$UI$Theme$primary.qR), 56562 $author$project$Ui$width($author$project$Ui$shrink), 56563 $author$project$Ui$spacing($author$project$UI$Theme$spacing.bb) 56564 ]), 56565 _List_fromArray( 56566 [ 56567 A2( 56568 $author$project$Ui$el, 56569 _List_fromArray( 56570 [ 56571 $author$project$Ui$Font$color($author$project$UI$Theme$base.aM) 56572 ]), 56573 $author$project$Ui$text(category + ':')), 56574 A2( 56575 $author$project$Ui$el, 56576 _List_fromArray( 56577 [ 56578 $author$project$Ui$Font$color($author$project$UI$Theme$primary.qI), 56579 $author$project$Ui$Font$weight($author$project$UI$Theme$fontWeight.nI) 56580 ]), 56581 $author$project$Ui$text(label)) 56582 ])); 56583 }); 56584var $author$project$Page$Group$ActivityTab$activeFilterSummary = F3( 56585 function (i18n, config, filters) { 56586 var typeCategory = $author$project$Translations$filterActivityTypeLabel(i18n); 56587 var involvedChips = A2( 56588 $elm$core$List$map, 56589 function (id) { 56590 return A2( 56591 $author$project$UI$Components$filterSummaryChip, 56592 $author$project$Translations$filterInvolvedLabel(i18n), 56593 config.bz(id)); 56594 }, 56595 $elm$core$Set$toList(filters.i2)); 56596 var actorChips = A2( 56597 $elm$core$List$map, 56598 function (id) { 56599 return A2( 56600 $author$project$UI$Components$filterSummaryChip, 56601 $author$project$Translations$filterActorLabel(i18n), 56602 config.bz(id)); 56603 }, 56604 $elm$core$Set$toList(filters.ed)); 56605 var activityTypeLabels = _List_fromArray( 56606 [ 56607 _Utils_Tuple2( 56608 $author$project$Domain$Filter$activityTypeToString(0), 56609 $author$project$Translations$filterActivityEntry(i18n)), 56610 _Utils_Tuple2( 56611 $author$project$Domain$Filter$activityTypeToString(1), 56612 $author$project$Translations$filterActivityMember(i18n)), 56613 _Utils_Tuple2( 56614 $author$project$Domain$Filter$activityTypeToString(2), 56615 $author$project$Translations$filterActivityGroup(i18n)) 56616 ]); 56617 var typeChips = A2( 56618 $elm$core$List$filterMap, 56619 function (_v0) { 56620 var key = _v0.a; 56621 var label = _v0.b; 56622 return A2($elm$core$Set$member, key, filters.ec) ? $elm$core$Maybe$Just( 56623 A2($author$project$UI$Components$filterSummaryChip, typeCategory, label)) : $elm$core$Maybe$Nothing; 56624 }, 56625 activityTypeLabels); 56626 return A2( 56627 $author$project$Ui$column, 56628 _List_fromArray( 56629 [ 56630 $author$project$Ui$spacing($author$project$UI$Theme$spacing.bb), 56631 $author$project$Ui$width($author$project$Ui$fill) 56632 ]), 56633 _List_fromArray( 56634 [ 56635 $author$project$UI$Components$sectionLabel( 56636 $author$project$Translations$filterSectionTitle(i18n)), 56637 A2( 56638 $author$project$Ui$row, 56639 _List_fromArray( 56640 [ 56641 $author$project$Ui$wrap, 56642 $author$project$Ui$spacing($author$project$UI$Theme$spacing.bb) 56643 ]), 56644 $elm$core$List$concat( 56645 _List_fromArray( 56646 [typeChips, actorChips, involvedChips]))) 56647 ])); 56648 }); 56649var $author$project$Translations$activityComingSoon = function (_v0) { 56650 var lang = _v0; 56651 if (!lang) { 56652 return 'Activity feed coming soon.'; 56653 } else { 56654 return 'Le fil d\'activité arrive bientôt.'; 56655 } 56656}; 56657var $author$project$Page$Group$ActivityTab$ClearAllFilters = {$: 4}; 56658var $author$project$Page$Group$ActivityTab$ToggleActivityType = function (a) { 56659 return {$: 1, a: a}; 56660}; 56661var $author$project$UI$Components$filterSection = F2( 56662 function (label, chips) { 56663 return A2( 56664 $author$project$Ui$column, 56665 _List_fromArray( 56666 [ 56667 $author$project$Ui$width($author$project$Ui$fill), 56668 $author$project$Ui$spacing($author$project$UI$Theme$spacing.qk), 56669 $author$project$Ui$paddingBottom($author$project$UI$Theme$spacing.aW) 56670 ]), 56671 _List_fromArray( 56672 [ 56673 A2( 56674 $author$project$Ui$el, 56675 _List_fromArray( 56676 [ 56677 $author$project$Ui$Font$size($author$project$UI$Theme$font.bb), 56678 $author$project$Ui$Font$weight($author$project$UI$Theme$fontWeight.dL), 56679 $author$project$Ui$Font$letterSpacing($author$project$UI$Theme$letterSpacing.kY), 56680 $author$project$Ui$Font$color($author$project$UI$Theme$base.aM) 56681 ]), 56682 $author$project$Ui$text( 56683 $elm$core$String$toUpper(label))), 56684 A2( 56685 $author$project$Ui$row, 56686 _List_fromArray( 56687 [ 56688 $author$project$Ui$wrap, 56689 $author$project$Ui$spacing($author$project$UI$Theme$spacing.bb) 56690 ]), 56691 chips) 56692 ])); 56693 }); 56694var $author$project$Page$Group$ActivityTab$activityTypeFilterSection = F3( 56695 function (i18n, toMsg, selected) { 56696 var types = _List_fromArray( 56697 [ 56698 _Utils_Tuple2( 56699 $author$project$Domain$Filter$activityTypeToString(0), 56700 $author$project$Translations$filterActivityEntry(i18n)), 56701 _Utils_Tuple2( 56702 $author$project$Domain$Filter$activityTypeToString(1), 56703 $author$project$Translations$filterActivityMember(i18n)), 56704 _Utils_Tuple2( 56705 $author$project$Domain$Filter$activityTypeToString(2), 56706 $author$project$Translations$filterActivityGroup(i18n)) 56707 ]); 56708 return A2( 56709 $author$project$UI$Components$filterSection, 56710 $author$project$Translations$filterActivityTypeLabel(i18n), 56711 A2( 56712 $elm$core$List$map, 56713 function (_v0) { 56714 var key = _v0.a; 56715 var label = _v0.b; 56716 return $author$project$UI$Components$chip( 56717 { 56718 i6: label, 56719 e7: toMsg( 56720 $author$project$Page$Group$ActivityTab$ToggleActivityType(key)), 56721 hj: A2($elm$core$Set$member, key, selected) 56722 }); 56723 }, 56724 types)); 56725 }); 56726var $author$project$Page$Group$ActivityTab$ToggleActor = function (a) { 56727 return {$: 2, a: a}; 56728}; 56729var $author$project$Page$Group$ActivityTab$actorFilterSection = F3( 56730 function (i18n, config, selected) { 56731 return A2( 56732 $author$project$UI$Components$filterSection, 56733 $author$project$Translations$filterActorLabel(i18n), 56734 A2( 56735 $elm$core$List$map, 56736 function (_v0) { 56737 var id = _v0.a; 56738 var name = _v0.b; 56739 return $author$project$UI$Components$chip( 56740 { 56741 i6: name, 56742 e7: config.d3( 56743 $author$project$Page$Group$ActivityTab$ToggleActor(id)), 56744 hj: A2($elm$core$Set$member, id, selected) 56745 }); 56746 }, 56747 config.ll)); 56748 }); 56749var $author$project$Translations$filterClearAll = function (_v0) { 56750 var lang = _v0; 56751 if (!lang) { 56752 return 'Clear filters'; 56753 } else { 56754 return 'Effacer les filtres'; 56755 } 56756}; 56757var $author$project$UI$Components$clearAllFiltersButton = F2( 56758 function (i18n, onPress) { 56759 return A2( 56760 $author$project$Ui$el, 56761 _List_fromArray( 56762 [ 56763 $author$project$Ui$Input$button(onPress), 56764 $author$project$Ui$width($author$project$Ui$fill), 56765 $author$project$Ui$paddingTop($author$project$UI$Theme$spacing.aW), 56766 $author$project$Ui$pointer 56767 ]), 56768 A2( 56769 $author$project$Ui$el, 56770 _List_fromArray( 56771 [ 56772 $author$project$Ui$padding($author$project$UI$Theme$spacing.qk), 56773 $author$project$Ui$Font$size($author$project$UI$Theme$font.qk), 56774 $author$project$Ui$Font$weight($author$project$UI$Theme$fontWeight.nI), 56775 $author$project$Ui$Font$color($author$project$UI$Theme$danger.qI), 56776 $author$project$Ui$Font$center, 56777 $author$project$Ui$width($author$project$Ui$fill),
56778 $author$project$Ui$rounded($author$project$UI$Theme$radius.qk) 56779 ]), 56780 $author$project$Ui$text( 56781 $author$project$Translations$filterClearAll(i18n)))); 56782 }); 56783var $author$project$Page$Group$ActivityTab$ToggleInvolvedMember = function (a) { 56784 return {$: 3, a: a}; 56785}; 56786var $author$project$Page$Group$ActivityTab$involvedFilterSection = F3( 56787 function (i18n, config, selected) { 56788 return A2( 56789 $author$project$UI$Components$filterSection, 56790 $author$project$Translations$filterInvolvedLabel(i18n), 56791 A2( 56792 $elm$core$List$map, 56793 function (_v0) { 56794 var id = _v0.a; 56795 var name = _v0.b; 56796 return $author$project$UI$Components$chip( 56797 { 56798 i6: name, 56799 e7: config.d3( 56800 $author$project$Page$Group$ActivityTab$ToggleInvolvedMember(id)), 56801 hj: A2($elm$core$Set$member, id, selected) 56802 }); 56803 }, 56804 config.ll)); 56805 }); 56806var $author$project$Domain$Filter$isActivityFilterActive = function (f) { 56807 return (!$elm$core$Set$isEmpty(f.ec)) || ((!$elm$core$Set$isEmpty(f.ed)) || (!$elm$core$Set$isEmpty(f.i2))); 56808}; 56809var $author$project$Page$Group$ActivityTab$filterPanel = F3( 56810 function (i18n, config, filters) { 56811 return A2( 56812 $author$project$UI$Components$card, 56813 _List_fromArray( 56814 [ 56815 $author$project$Ui$padding($author$project$UI$Theme$spacing.i8) 56816 ]), 56817 _List_fromArray( 56818 [ 56819 A2( 56820 $author$project$Ui$column, 56821 _List_fromArray( 56822 [ 56823 $author$project$Ui$spacing($author$project$UI$Theme$spacing.aW), 56824 $author$project$Ui$width($author$project$Ui$fill) 56825 ]), 56826 _List_fromArray( 56827 [ 56828 A3($author$project$Page$Group$ActivityTab$activityTypeFilterSection, i18n, config.d3, filters.ec), 56829 A3($author$project$Page$Group$ActivityTab$actorFilterSection, i18n, config, filters.ed), 56830 A3($author$project$Page$Group$ActivityTab$involvedFilterSection, i18n, config, filters.i2), 56831 $author$project$Domain$Filter$isActivityFilterActive(filters) ? A2( 56832 $author$project$UI$Components$clearAllFiltersButton, 56833 i18n, 56834 config.d3($author$project$Page$Group$ActivityTab$ClearAllFilters)) : $author$project$Ui$none 56835 ])) 56836 ])); 56837 }); 56838var $author$project$Page$Group$ActivityTab$ToggleFilters = {$: 0}; 56839var $feathericons$elm_feather$FeatherIcons$filter = A2( 56840 $feathericons$elm_feather$FeatherIcons$makeBuilder, 56841 'filter', 56842 _List_fromArray( 56843 [ 56844 A2( 56845 $elm$svg$Svg$polygon, 56846 _List_fromArray( 56847 [ 56848 $elm$svg$Svg$Attributes$points('22 3 2 3 10 12.46 10 19 14 21 14 12.46 22 3') 56849 ]), 56850 _List_Nil) 56851 ])); 56852var $author$project$UI$Components$filterToggleButton = function (config) { 56853 var _v0 = (config.cS || config.mV) ? _Utils_Tuple3($author$project$UI$Theme$primary.kl, $author$project$UI$Theme$primary.kl, $author$project$UI$Theme$primary.km) : _Utils_Tuple3($author$project$UI$Theme$base.en, $author$project$UI$Theme$base.k3, $author$project$UI$Theme$base.aM); 56854 var bg = _v0.a; 56855 var border = _v0.b; 56856 var fontColor = _v0.c; 56857 return A2( 56858 $author$project$UI$Components$iconButton, 56859 _List_fromArray( 56860 [ 56861 $author$project$Ui$alignRight, 56862 $author$project$Ui$border($author$project$UI$Theme$border), 56863 $author$project$Ui$htmlAttribute( 56864 A2( 56865 $elm$html$Html$Attributes$attribute, 56866 'aria-expanded', 56867 config.cS ? 'true' : 'false')), 56868 A2( 56869 $author$project$Ui$Anim$transition, 56870 $author$project$Ui$Anim$ms(200), 56871 _List_fromArray( 56872 [ 56873 $author$project$Ui$Anim$backgroundColor(bg), 56874 $author$project$Ui$Anim$borderColor(border), 56875 $author$project$Ui$Anim$fontColor(fontColor) 56876 ])) 56877 ]), 56878 {gv: $feathericons$elm_feather$FeatherIcons$filter, i6: config.i6, e7: config.e7, dW: 18}); 56879}; 56880var $author$project$Translations$filterToggleLabel = function (_v0) { 56881 var lang = _v0; 56882 if (!lang) { 56883 return 'Show filters'; 56884 } else { 56885 return 'Afficher les filtres'; 56886 } 56887}; 56888var $author$project$Page$Group$ActivityTab$filterToggleRow = F4( 56889 function (i18n, toMsg, showFilters, filters) { 56890 return A2( 56891 $author$project$Ui$row, 56892 _List_fromArray( 56893 [ 56894 $author$project$Ui$spacing($author$project$UI$Theme$spacing.qk), 56895 $author$project$Ui$contentCenterY, 56896 $author$project$Ui$width($author$project$Ui$fill) 56897 ]), 56898 _List_fromArray( 56899 [ 56900 $author$project$UI$Components$filterToggleButton( 56901 { 56902 mV: $author$project$Domain$Filter$isActivityFilterActive(filters), 56903 i6: $author$project$Translations$filterToggleLabel(i18n), 56904 e7: toMsg($author$project$Page$Group$ActivityTab$ToggleFilters), 56905 cS: showFilters 56906 }) 56907 ])); 56908 }); 56909var $author$project$Page$Group$ActivityTab$ToggleExpanded = function (a) { 56910 return {$: 5, a: a}; 56911}; 56912var $author$project$Translations$activityDetailNoValue = function (_v0) { 56913 var lang = _v0; 56914 if (!lang) { 56915 return 'none'; 56916 } else { 56917 return 'aucun'; 56918 } 56919}; 56920var $author$project$Translations$activityMemberTypeLabel = function (_v0) { 56921 var lang = _v0; 56922 if (!lang) { 56923 return 'Member type'; 56924 } else { 56925 return 'Type de membre'; 56926 } 56927}; 56928var $author$project$Translations$changeFieldName = function (_v0) { 56929 var lang = _v0; 56930 if (!lang) { 56931 return 'name'; 56932 } else { 56933 return 'nom'; 56934 } 56935}; 56936var $author$project$Page$Group$ActivityTab$detailRow = F2( 56937 function (label, value) { 56938 return A2( 56939 $author$project$Ui$column, 56940 _List_fromArray( 56941 [ 56942 $author$project$Ui$spacing($author$project$UI$Theme$spacing.bb), 56943 $author$project$Ui$width($author$project$Ui$fill) 56944 ]), 56945 _List_fromArray( 56946 [ 56947 A2( 56948 $author$project$Ui$el, 56949 _List_fromArray( 56950 [ 56951 $author$project$Ui$Font$size($author$project$UI$Theme$font.qk), 56952 $author$project$Ui$Font$color($author$project$UI$Theme$base.aM) 56953 ]), 56954 $author$project$Ui$text(label)), 56955 A2( 56956 $author$project$Ui$el, 56957 _List_fromArray( 56958 [ 56959 $author$project$Ui$Font$size($author$project$UI$Theme$font.qk) 56960 ]), 56961 $author$project$Ui$text(value)) 56962 ])); 56963 }); 56964var $author$project$Ui$Font$strike = $author$project$Internal$Model2$class($author$project$Internal$Style2$classes.qy); 56965var $author$project$Page$Group$ActivityTab$diffRow = F3( 56966 function (label, oldValue, newValue) { 56967 return A2( 56968 $author$project$Ui$column, 56969 _List_fromArray( 56970 [ 56971 $author$project$Ui$spacing($author$project$UI$Theme$spacing.bb), 56972 $author$project$Ui$width($author$project$Ui$fill) 56973 ]), 56974 _List_fromArray( 56975 [ 56976 A2( 56977 $author$project$Ui$el, 56978 _List_fromArray( 56979 [ 56980 $author$project$Ui$Font$size($author$project$UI$Theme$font.qk), 56981 $author$project$Ui$Font$color($author$project$UI$Theme$base.aM) 56982 ]), 56983 $author$project$Ui$text(label)), 56984 A2( 56985 $author$project$Ui$row, 56986 _List_fromArray( 56987 [ 56988 $author$project$Ui$spacing($author$project$UI$Theme$spacing.qk) 56989 ]), 56990 _List_fromArray( 56991 [ 56992 A2( 56993 $author$project$Ui$el, 56994 _List_fromArray( 56995 [ 56996 $author$project$Ui$Font$size($author$project$UI$Theme$font.qk), 56997 $author$project$Ui$Font$color($author$project$UI$Theme$danger.qI), 56998 $author$project$Ui$Font$strike 56999 ]), 57000 $author$project$Ui$text(oldValue)), 57001 A2( 57002 $author$project$Ui$el, 57003 _List_fromArray( 57004 [ 57005 $author$project$Ui$Font$size($author$project$UI$Theme$font.qk) 57006 ]), 57007 $author$project$Ui$text('â')), 57008 A2( 57009 $author$project$Ui$el, 57010 _List_fromArray( 57011 [ 57012 $author$project$Ui$Font$size($author$project$UI$Theme$font.qk), 57013 $author$project$Ui$Font$color($author$project$UI$Theme$success.qI) 57014 ]), 57015 $author$project$Ui$text(newValue)) 57016 ])) 57017 ])); 57018 }); 57019var $author$project$Ui$clipWithEllipsis = A2($author$project$Internal$Model2$classWith, $author$project$Internal$Flag$fontEllipsis, $author$project$Internal$Style2$classes.ms); 57020var $author$project$UI$Components$shortenUrl = function (url) { 57021 return function (s) { 57022 return A2($elm$core$String$endsWith, '/', s) ? A2($elm$core$String$dropRight, 1, s) : s; 57023 }( 57024 A3( 57025 $elm$core$String$replace, 57026 'http://', 57027 '', 57028 A3($elm$core$String$replace, 'https://', '', url))); 57029}; 57030var $author$project$UI$Components$linkItem = F2( 57031 function (icon, link) { 57032 var displayUrl = $author$project$UI$Components$shortenUrl(link.kS); 57033 var displayLabel = $elm$core$String$isEmpty(link.i6) ? $author$project$UI$Components$shortenUrl(link.kS) : (($elm$core$String$length(link.i6) > 40) ? (A2($elm$core$String$left, 37, link.i6) + '...') : link.i6); 57034 return A2( 57035 $author$project$Ui$row, 57036 _List_fromArray( 57037 [ 57038 $author$project$Ui$linkNewTab(link.kS), 57039 $author$project$Ui$spacing($author$project$UI$Theme$spacing.qk), 57040 $author$project$Ui$contentCenterY, 57041 $author$project$Ui$pointer, 57042 $author$project$Ui$clipWithEllipsis, 57043 $author$project$Ui$Font$size($author$project$UI$Theme$font.qk) 57044 ]), 57045 _List_fromArray( 57046 [ 57047 A2( 57048 $author$project$Ui$el, 57049 _List_fromArray( 57050 [ 57051 $author$project$Ui$Font$color($author$project$UI$Theme$primary.qI), 57052 $author$project$Ui$width($author$project$Ui$shrink) 57053 ]), 57054 A2($author$project$UI$Components$featherIcon, 14, icon)), 57055 A2( 57056 $author$project$Ui$el, 57057 _List_fromArray( 57058 [ 57059 $author$project$Ui$Font$color($author$project$UI$Theme$primary.qI), 57060 $author$project$Ui$Font$underline, 57061 $author$project$Ui$Font$noWrap, 57062 $author$project$Ui$width($author$project$Ui$shrink) 57063 ]), 57064 $author$project$Ui$text(displayLabel)), 57065 A2( 57066 $author$project$Ui$el, 57067 _List_fromArray( 57068 [ 57069 $author$project$Ui$Font$color($author$project$UI$Theme$base.aM), 57070 $author$project$Ui$Font$noWrap 57071 ]), 57072 $author$project$Ui$text(displayUrl)) 57073 ])); 57074 }); 57075var $feathericons$elm_feather$FeatherIcons$paperclip = A2( 57076 $feathericons$elm_feather$FeatherIcons$makeBuilder, 57077 'paperclip', 57078 _List_fromArray( 57079 [ 57080 A2( 57081 $elm$svg$Svg$path, 57082 _List_fromArray( 57083 [ 57084 $elm$svg$Svg$Attributes$d('M21.44 11.05l-9.19 9.19a6 6 0 0 1-8.49-8.49l9.19-9.19a4 4 0 0 1 5.66 5.66l-9.2 9.19a2 2 0 0 1-2.83-2.83l8.49-8.48') 57085 ]), 57086 _List_Nil) 57087 ])); 57088var $author$project$Page$Group$ActivityTab$attachmentRows = F2( 57089 function (i18n, attachments) { 57090 return $elm$core$List$isEmpty(attachments) ? _List_Nil : _List_fromArray( 57091 [ 57092 A2( 57093 $author$project$Ui$column, 57094 _List_fromArray( 57095 [ 57096 $author$project$Ui$spacing($author$project$UI$Theme$spacing.bb), 57097 $author$project$Ui$width($author$project$Ui$fill) 57098 ]), 57099 A2( 57100 $elm$core$List$cons, 57101 A2( 57102 $author$project$Ui$el, 57103 _List_fromArray( 57104 [ 57105 $author$project$Ui$Font$size($author$project$UI$Theme$font.qk), 57106 $author$project$Ui$Font$color($author$project$UI$Theme$base.aM) 57107 ]), 57108 $author$project$Ui$text( 57109 $author$project$Translations$newEntryAttachmentsLabel(i18n))), 57110 A2( 57111 $elm$core$List$map, 57112 $author$project$UI$Components$linkItem($feathericons$elm_feather$FeatherIcons$paperclip), 57113 attachments))) 57114 ]); 57115 }); 57116var $author$project$Page$Group$ActivityTab$beneficiaryDescriptions = F4( 57117 function (i18n, currency, resolveName, beneficiaries) { 57118 return A2( 57119 $elm$core$String$join, 57120 ', ', 57121 A2( 57122 $elm$core$List$map, 57123 function (beneficiary) { 57124 if (!beneficiary.$) { 57125 var data = beneficiary.a; 57126 return resolveName(data.e_) + (' Ã' + $elm$core$String$fromInt(data.qc)); 57127 } else { 57128 var data = beneficiary.a; 57129 return resolveName(data.e_) + (' (' + (A3( 57130 $author$project$Format$formatCentsWithCurrency, 57131 $author$project$Translations$currentLanguage(i18n), 57132 data.ef, 57133 currency) + ')')); 57134 } 57135 }, 57136 beneficiaries)); 57137 }); 57138var $author$project$Translations$entryDetailCategory = function (_v0) { 57139 var lang = _v0; 57140 if (!lang) { 57141 return 'Category'; 57142 } else { 57143 return 'Catégorie'; 57144 } 57145}; 57146var $author$project$UI$Categories$label = F2( 57147 function (i18n, category) { 57148 return $author$project$UI$Categories$presentation(category).i6(i18n); 57149 }); 57150var $author$project$Page$Group$ActivityTab$categoryRow = F2( 57151 function (i18n, maybeCategory) { 57152 if (!maybeCategory.$) { 57153 var category = maybeCategory.a; 57154 return _List_fromArray( 57155 [ 57156 A2( 57157 $author$project$Page$Group$ActivityTab$detailRow, 57158 $author$project$Translations$entryDetailCategory(i18n), 57159 A2($author$project$UI$Categories$label, i18n, category)) 57160 ]); 57161 } else { 57162 return _List_Nil; 57163 } 57164 }); 57165var $author$project$Page$Group$ActivityTab$defaultCurrencyAmountRow = F3(
57166 function (i18n, groupCurrency, maybeAmount) { 57167 if (!maybeAmount.$) { 57168 var amount = maybeAmount.a; 57169 return _List_fromArray( 57170 [ 57171 A2( 57172 $author$project$Ui$el, 57173 _List_fromArray( 57174 [ 57175 $author$project$Ui$Font$size($author$project$UI$Theme$font.qk), 57176 $author$project$Ui$Font$color($author$project$UI$Theme$base.aM) 57177 ]), 57178 $author$project$Ui$text( 57179 'â ' + A3( 57180 $author$project$Format$formatCentsWithCurrency, 57181 $author$project$Translations$currentLanguage(i18n), 57182 amount, 57183 groupCurrency))) 57184 ]); 57185 } else { 57186 return _List_Nil; 57187 } 57188 }); 57189var $author$project$Translations$entryDetailDate = function (_v0) { 57190 var lang = _v0; 57191 if (!lang) { 57192 return 'Date'; 57193 } else { 57194 return 'Date'; 57195 } 57196}; 57197var $author$project$Translations$entryDetailLocation = function (_v0) { 57198 var lang = _v0; 57199 if (!lang) { 57200 return 'Location'; 57201 } else { 57202 return 'Lieu'; 57203 } 57204}; 57205var $author$project$Translations$entryDetailNotes = function (_v0) { 57206 var lang = _v0; 57207 if (!lang) { 57208 return 'Notes'; 57209 } else { 57210 return 'Notes'; 57211 } 57212}; 57213var $author$project$Translations$entryDetailPaidBy = function (_v0) { 57214 var lang = _v0; 57215 if (!lang) { 57216 return 'Paid by'; 57217 } else { 57218 return 'Payé par'; 57219 } 57220}; 57221var $author$project$Translations$entryDetailReceivedBy = function (_v0) { 57222 var lang = _v0; 57223 if (!lang) { 57224 return 'Received by'; 57225 } else { 57226 return 'Reçu par'; 57227 } 57228}; 57229var $author$project$Translations$entryDetailSplitAmong = function (_v0) { 57230 var lang = _v0; 57231 if (!lang) { 57232 return 'Split among'; 57233 } else { 57234 return 'Partagé entre'; 57235 } 57236}; 57237var $author$project$Page$Group$ActivityTab$optionalRow = F2( 57238 function (label, maybeValue) { 57239 if (!maybeValue.$) { 57240 var value = maybeValue.a; 57241 return _List_fromArray( 57242 [ 57243 A2($author$project$Page$Group$ActivityTab$detailRow, label, value) 57244 ]); 57245 } else { 57246 return _List_Nil; 57247 } 57248 }); 57249var $author$project$Page$Group$ActivityTab$payerDescriptions = F4( 57250 function (i18n, currency, resolveName, payers) { 57251 return A2( 57252 $elm$core$String$join, 57253 ', ', 57254 A2( 57255 $elm$core$List$map, 57256 function (payer) { 57257 return resolveName(payer.e_) + (' (' + (A3( 57258 $author$project$Format$formatCentsWithCurrency, 57259 $author$project$Translations$currentLanguage(i18n), 57260 payer.ef, 57261 currency) + ')')); 57262 }, 57263 payers)); 57264 }); 57265var $author$project$Page$Group$ActivityTab$entryDetailRows = F4( 57266 function (i18n, groupCurrency, resolveName, entry) { 57267 var _v0 = entry.gE; 57268 switch (_v0.$) { 57269 case 0: 57270 var data = _v0.a; 57271 return $elm$core$List$concat( 57272 _List_fromArray( 57273 [ 57274 _List_fromArray( 57275 [ 57276 A2( 57277 $author$project$Page$Group$ActivityTab$detailRow, 57278 $author$project$Translations$newEntryDescriptionLabel(i18n), 57279 data.eE), 57280 A2( 57281 $author$project$Page$Group$ActivityTab$detailRow, 57282 $author$project$Translations$entryDetailDate(i18n), 57283 $author$project$Domain$Date$toString(data.cj)), 57284 A2( 57285 $author$project$Page$Group$ActivityTab$detailRow, 57286 $author$project$Translations$newEntryAmountLabel(i18n), 57287 A3( 57288 $author$project$Format$formatCentsWithCurrency, 57289 $author$project$Translations$currentLanguage(i18n), 57290 data.ef, 57291 data.bg)) 57292 ]), 57293 A3($author$project$Page$Group$ActivityTab$defaultCurrencyAmountRow, i18n, groupCurrency, data.ck), 57294 _List_fromArray( 57295 [ 57296 A2( 57297 $author$project$Page$Group$ActivityTab$detailRow, 57298 $author$project$Translations$entryDetailPaidBy(i18n), 57299 A4($author$project$Page$Group$ActivityTab$payerDescriptions, i18n, data.bg, resolveName, data.jB)), 57300 A2( 57301 $author$project$Page$Group$ActivityTab$detailRow, 57302 $author$project$Translations$entryDetailSplitAmong(i18n), 57303 A4($author$project$Page$Group$ActivityTab$beneficiaryDescriptions, i18n, data.bg, resolveName, data.em)) 57304 ]), 57305 A2($author$project$Page$Group$ActivityTab$categoryRow, i18n, data.h9), 57306 A2( 57307 $author$project$Page$Group$ActivityTab$optionalRow, 57308 $author$project$Translations$entryDetailLocation(i18n), 57309 data.je), 57310 A2( 57311 $author$project$Page$Group$ActivityTab$optionalRow, 57312 $author$project$Translations$entryDetailNotes(i18n), 57313 data.bu), 57314 A2($author$project$Page$Group$ActivityTab$attachmentRows, i18n, data.ce) 57315 ])); 57316 case 1: 57317 var data = _v0.a; 57318 return $elm$core$List$concat( 57319 _List_fromArray( 57320 [ 57321 A2( 57322 $author$project$Page$Group$ActivityTab$optionalRow, 57323 $author$project$Translations$newEntryDescriptionLabel(i18n), 57324 data.eE), 57325 _List_fromArray( 57326 [ 57327 A2( 57328 $author$project$Page$Group$ActivityTab$detailRow, 57329 $author$project$Translations$entryDetailDate(i18n), 57330 $author$project$Domain$Date$toString(data.cj)), 57331 A2( 57332 $author$project$Page$Group$ActivityTab$detailRow, 57333 $author$project$Translations$newEntryAmountLabel(i18n), 57334 A3( 57335 $author$project$Format$formatCentsWithCurrency, 57336 $author$project$Translations$currentLanguage(i18n), 57337 data.ef, 57338 data.bg)) 57339 ]), 57340 A3($author$project$Page$Group$ActivityTab$defaultCurrencyAmountRow, i18n, groupCurrency, data.ck), 57341 _List_fromArray( 57342 [ 57343 A2( 57344 $author$project$Page$Group$ActivityTab$detailRow, 57345 $author$project$Translations$entryDetailFrom(i18n),
57346 resolveName(data.iH)), 57347 A2( 57348 $author$project$Page$Group$ActivityTab$detailRow, 57349 $author$project$Translations$entryDetailTo(i18n), 57350 resolveName(data.kE)) 57351 ]), 57352 A2( 57353 $author$project$Page$Group$ActivityTab$optionalRow, 57354 $author$project$Translations$entryDetailNotes(i18n), 57355 data.bu), 57356 A2($author$project$Page$Group$ActivityTab$attachmentRows, i18n, data.ce) 57357 ])); 57358 default: 57359 var data = _v0.a; 57360 return $elm$core$List$concat( 57361 _List_fromArray( 57362 [ 57363 _List_fromArray( 57364 [ 57365 A2( 57366 $author$project$Page$Group$ActivityTab$detailRow, 57367 $author$project$Translations$newEntryDescriptionLabel(i18n), 57368 data.eE), 57369 A2( 57370 $author$project$Page$Group$ActivityTab$detailRow, 57371 $author$project$Translations$entryDetailDate(i18n), 57372 $author$project$Domain$Date$toString(data.cj)), 57373 A2( 57374 $author$project$Page$Group$ActivityTab$detailRow, 57375 $author$project$Translations$newEntryAmountLabel(i18n), 57376 A3( 57377 $author$project$Format$formatCentsWithCurrency, 57378 $author$project$Translations$currentLanguage(i18n), 57379 data.ef, 57380 data.bg)) 57381 ]), 57382 A3($author$project$Page$Group$ActivityTab$defaultCurrencyAmountRow, i18n, groupCurrency, data.ck), 57383 _List_fromArray( 57384 [ 57385 A2( 57386 $author$project$Page$Group$ActivityTab$detailRow, 57387 $author$project$Translations$entryDetailReceivedBy(i18n), 57388 resolveName(data.j$)), 57389 A2( 57390 $author$project$Page$Group$ActivityTab$detailRow, 57391 $author$project$Translations$entryDetailSplitAmong(i18n), 57392 A4($author$project$Page$Group$ActivityTab$beneficiaryDescriptions, i18n, data.bg, resolveName, data.em)) 57393 ]), 57394 A2( 57395 $author$project$Page$Group$ActivityTab$optionalRow, 57396 $author$project$Translations$entryDetailNotes(i18n), 57397 data.bu), 57398 A2($author$project$Page$Group$ActivityTab$attachmentRows, i18n, data.ce) 57399 ])); 57400 } 57401 }); 57402var $author$project$Translations$activityViewEntry = function (_v0) { 57403 var lang = _v0; 57404 if (!lang) { 57405 return 'View current entry'; 57406 } else { 57407 return 'Voir l\'entrée actuelle'; 57408 } 57409}; 57410var $author$project$Page$Group$ActivityTab$entryLinkRow = F3( 57411 function (i18n, href, onPress) { 57412 return A2( 57413 $author$project$Ui$row, 57414 A2( 57415 $elm$core$List$cons, 57416 $author$project$Ui$spacing($author$project$UI$Theme$spacing.qk), 57417 A2( 57418 $elm$core$List$cons, 57419 $author$project$Ui$contentCenterY, 57420 A2( 57421 $elm$core$List$cons, 57422 $author$project$Ui$paddingTop($author$project$UI$Theme$spacing.bb), 57423 A2( 57424 $elm$core$List$cons, 57425 $author$project$Ui$pointer, 57426 A2($author$project$UI$Components$spaLinkAttrs, href, onPress))))), 57427 _List_fromArray( 57428 [ 57429 A2( 57430 $author$project$Ui$el, 57431 _List_fromArray( 57432 [ 57433 $author$project$Ui$Font$color($author$project$UI$Theme$primary.kl), 57434 $author$project$Ui$width($author$project$Ui$shrink) 57435 ]), 57436 A2($author$project$UI$Components$featherIcon, 14, $feathericons$elm_feather$FeatherIcons$externalLink)), 57437 A2( 57438 $author$project$Ui$el, 57439 _List_fromArray( 57440 [ 57441 $author$project$Ui$Font$size($author$project$UI$Theme$font.qk), 57442 $author$project$Ui$Font$color($author$project$UI$Theme$primary.kl) 57443 ]), 57444 $author$project$Ui$text( 57445 $author$project$Translations$activityViewEntry(i18n))) 57446 ])); 57447 }); 57448var $author$project$Translations$activityDetailRemoved = function (_v0) { 57449 var lang = _v0; 57450 if (!lang) { 57451 return 'removed'; 57452 } else { 57453 return 'supprimé'; 57454 } 57455}; 57456var $author$project$Translations$newEntryCurrencyLabel = function (_v0) { 57457 var lang = _v0; 57458 if (!lang) { 57459 return 'Currency'; 57460 } else { 57461 return 'Devise'; 57462 } 57463}; 57464var $author$project$Page$Group$ActivityTab$amountCurrencyDiffRows = F4( 57465 function (i18n, groupCurrency, old, _new) { 57466 var formatDefaultAmount = function (amt) { 57467 return A3( 57468 $author$project$Format$formatCentsWithCurrency, 57469 $author$project$Translations$currentLanguage(i18n), 57470 amt, 57471 groupCurrency); 57472 }; 57473 var currencyChanged = !_Utils_eq(old.cI, _new.cF); 57474 var currencyRow = currencyChanged ? _List_fromArray( 57475 [ 57476 A3( 57477 $author$project$Page$Group$ActivityTab$diffRow, 57478 $author$project$Translations$newEntryCurrencyLabel(i18n),
57479 $author$project$Domain$Currency$currencyCode(old.cI), 57480 $author$project$Domain$Currency$currencyCode(_new.cF)) 57481 ]) : _List_Nil; 57482 var defaultAmountRow = function () { 57483 var label = 'â ' + $author$project$Translations$newEntryAmountLabel(i18n); 57484 var _v0 = _Utils_Tuple2(old.e5, _new.e3); 57485 if (_v0.a.$ === 1) { 57486 if (_v0.b.$ === 1) { 57487 var _v1 = _v0.a; 57488 var _v2 = _v0.b; 57489 return _List_Nil; 57490 } else { 57491 var _v3 = _v0.a; 57492 var newAmt = _v0.b.a; 57493 return _List_fromArray( 57494 [ 57495 A2( 57496 $author$project$Page$Group$ActivityTab$detailRow, 57497 label, 57498 formatDefaultAmount(newAmt)) 57499 ]); 57500 } 57501 } else { 57502 if (_v0.b.$ === 1) { 57503 var oldAmt = _v0.a.a; 57504 var _v4 = _v0.b; 57505 return _List_fromArray( 57506 [ 57507 A3( 57508 $author$project$Page$Group$ActivityTab$diffRow, 57509 label, 57510 formatDefaultAmount(oldAmt), 57511 $author$project$Translations$activityDetailRemoved(i18n)) 57512 ]); 57513 } else { 57514 var oldAmt = _v0.a.a; 57515 var newAmt = _v0.b.a; 57516 return (_Utils_eq(oldAmt, newAmt) && (!currencyChanged)) ? _List_fromArray( 57517 [ 57518 A2( 57519 $author$project$Page$Group$ActivityTab$detailRow, 57520 label, 57521 formatDefaultAmount(newAmt)) 57522 ]) : _List_fromArray( 57523 [ 57524 A3( 57525 $author$project$Page$Group$ActivityTab$diffRow, 57526 label, 57527 formatDefaultAmount(oldAmt), 57528 formatDefaultAmount(newAmt)) 57529 ]); 57530 } 57531 } 57532 }(); 57533 var amountRow = function () { 57534 var newFormatted = A3( 57535 $author$project$Format$formatCentsWithCurrency, 57536 $author$project$Translations$currentLanguage(i18n), 57537 _new.dw, 57538 _new.cF); 57539 var label = $author$project$Translations$newEntryAmountLabel(i18n); 57540 var amountChanged = !_Utils_eq(old.dz, _new.dw); 57541 if (amountChanged || currencyChanged) { 57542 var oldFormatted = A3( 57543 $author$project$Format$formatCentsWithCurrency, 57544 $author$project$Translations$currentLanguage(i18n), 57545 old.dz, 57546 old.cI); 57547 return _List_fromArray( 57548 [ 57549 A3($author$project$Page$Group$ActivityTab$diffRow, label, oldFormatted, newFormatted) 57550 ]); 57551 } else { 57552 return _List_fromArray( 57553 [ 57554 A2($author$project$Page$Group$ActivityTab$detailRow, label, newFormatted) 57555 ]); 57556 } 57557 }(); 57558 return _Utils_ap( 57559 currencyRow, 57560 _Utils_ap(amountRow, defaultAmountRow)); 57561 }); 57562var $author$project$Page$Group$ActivityTab$linksToString = function (links) { 57563 if (!links.b) { 57564 return 'â'; 57565 } else { 57566 return A2( 57567 $elm$core$String$join, 57568 ', ', 57569 A2( 57570 $elm$core$List$map, 57571 function (l) { 57572 return l.i6 + (' (' + (l.kS + ')')); 57573 }, 57574 links)); 57575 } 57576}; 57577var $author$project$Page$Group$ActivityTab$attachmentsDiffRow = F3( 57578 function (i18n, old, _new) { 57579 return _Utils_eq(old, _new) ? A2($author$project$Page$Group$ActivityTab$attachmentRows, i18n, _new) : _List_fromArray( 57580 [ 57581 A3( 57582 $author$project$Page$Group$ActivityTab$diffRow, 57583 $author$project$Translations$newEntryAttachmentsLabel(i18n), 57584 $author$project$Page$Group$ActivityTab$linksToString(old), 57585 $author$project$Page$Group$ActivityTab$linksToString(_new)) 57586 ]); 57587 }); 57588var $author$project$Page$Group$ActivityTab$beneficiaryDiffOrDetailRow = F6( 57589 function (i18n, resolveName, oldCurrency, oldBeneficiaries, newCurrency, newBeneficiaries) { 57590 var oldText = A4($author$project$Page$Group$ActivityTab$beneficiaryDescriptions, i18n, oldCurrency, resolveName, oldBeneficiaries); 57591 var newText = A4($author$project$Page$Group$ActivityTab$beneficiaryDescriptions, i18n, newCurrency, resolveName, newBeneficiaries); 57592 var label = $author$project$Translations$entryDetailSplitAmong(i18n); 57593 return _Utils_eq(oldText, newText) ? A2($author$project$Page$Group$ActivityTab$detailRow, label, newText) : A3($author$project$Page$Group$ActivityTab$diffRow, label, oldText, newText); 57594 }); 57595var $author$project$Page$Group$ActivityTab$categoryDiffRow = F3( 57596 function (i18n, oldCat, newCat) { 57597 if (_Utils_eq(oldCat, newCat)) { 57598 return A2($author$project$Page$Group$ActivityTab$categoryRow, i18n, newCat); 57599 } else { 57600 var oldLabel = A2( 57601 $elm$core$Maybe$withDefault, 57602 $author$project$Translations$newEntryCategoryNone(i18n), 57603 A2( 57604 $elm$core$Maybe$map,
57605 $author$project$UI$Categories$label(i18n), 57606 oldCat)); 57607 var newLabel = A2( 57608 $elm$core$Maybe$withDefault, 57609 $author$project$Translations$newEntryCategoryNone(i18n), 57610 A2( 57611 $elm$core$Maybe$map, 57612 $author$project$UI$Categories$label(i18n), 57613 newCat)); 57614 return _List_fromArray( 57615 [ 57616 A3( 57617 $author$project$Page$Group$ActivityTab$diffRow, 57618 $author$project$Translations$entryDetailCategory(i18n), 57619 oldLabel, 57620 newLabel) 57621 ]); 57622 } 57623 }); 57624var $author$project$Page$Group$ActivityTab$maybeDiffOrDetailRow = F3( 57625 function (label, oldVal, newVal) { 57626 return _Utils_eq(oldVal, newVal) ? A2($author$project$Page$Group$ActivityTab$detailRow, label, newVal) : A3($author$project$Page$Group$ActivityTab$diffRow, label, oldVal, newVal); 57627 }); 57628var $author$project$Page$Group$ActivityTab$optionalDiffRow = F4( 57629 function (i18n, label, oldValue, newValue) { 57630 if (_Utils_eq(oldValue, newValue)) { 57631 return A2($author$project$Page$Group$ActivityTab$optionalRow, label, newValue); 57632 } else { 57633 var oldText = A2( 57634 $elm$core$Maybe$withDefault, 57635 $author$project$Translations$activityDetailNoValue(i18n), 57636 oldValue); 57637 var newText = A2( 57638 $elm$core$Maybe$withDefault, 57639 $author$project$Translations$activityDetailRemoved(i18n), 57640 newValue); 57641 return _List_fromArray( 57642 [ 57643 A3($author$project$Page$Group$ActivityTab$diffRow, label, oldText, newText) 57644 ]); 57645 } 57646 }); 57647var $author$project$Page$Group$ActivityTab$payerDiffOrDetailRow = F6( 57648 function (i18n, resolveName, oldCurrency, oldPayers, newCurrency, newPayers) { 57649 var oldText = A4($author$project$Page$Group$ActivityTab$payerDescriptions, i18n, oldCurrency, resolveName, oldPayers); 57650 var newText = A4($author$project$Page$Group$ActivityTab$payerDescriptions, i18n, newCurrency, resolveName, newPayers); 57651 var label = $author$project$Translations$entryDetailPaidBy(i18n); 57652 return _Utils_eq(oldText, newText) ? A2($author$project$Page$Group$ActivityTab$detailRow, label, newText) : A3($author$project$Page$Group$ActivityTab$diffRow, label, oldText, newText); 57653 }); 57654var $author$project$Page$Group$ActivityTab$expenseDiffRows = F5( 57655 function (i18n, groupCurrency, resolveName, old, _new) { 57656 return $elm$core$List$concat( 57657 _List_fromArray( 57658 [ 57659 _List_fromArray( 57660 [ 57661 A3( 57662 $author$project$Page$Group$ActivityTab$maybeDiffOrDetailRow, 57663 $author$project$Translations$newEntryDescriptionLabel(i18n), 57664 old.eE, 57665 _new.eE) 57666 ]), 57667 _List_fromArray( 57668 [ 57669 A3( 57670 $author$project$Page$Group$ActivityTab$maybeDiffOrDetailRow, 57671 $author$project$Translations$entryDetailDate(i18n), 57672 $author$project$Domain$Date$toString(old.cj), 57673 $author$project$Domain$Date$toString(_new.cj)) 57674 ]), 57675 A4( 57676 $author$project$Page$Group$ActivityTab$amountCurrencyDiffRows, 57677 i18n, 57678 groupCurrency, 57679 {dz: old.ef, cI: old.bg, e5: old.ck}, 57680 {dw: _new.ef, cF: _new.bg, e3: _new.ck}), 57681 _List_fromArray( 57682 [ 57683 A6($author$project$Page$Group$ActivityTab$payerDiffOrDetailRow, i18n, resolveName, old.bg, old.jB, _new.bg, _new.jB) 57684 ]), 57685 _List_fromArray( 57686 [ 57687 A6($author$project$Page$Group$ActivityTab$beneficiaryDiffOrDetailRow, i18n, resolveName, old.bg, old.em, _new.bg, _new.em) 57688 ]), 57689 A3($author$project$Page$Group$ActivityTab$categoryDiffRow, i18n, old.h9, _new.h9), 57690 A4( 57691 $author$project$Page$Group$ActivityTab$optionalDiffRow, 57692 i18n, 57693 $author$project$Translations$entryDetailLocation(i18n), 57694 old.je, 57695 _new.je), 57696 A4( 57697 $author$project$Page$Group$ActivityTab$optionalDiffRow, 57698 i18n, 57699 $author$project$Translations$entryDetailNotes(i18n), 57700 old.bu, 57701 _new.bu), 57702 A3($author$project$Page$Group$ActivityTab$attachmentsDiffRow, i18n, old.ce, _new.ce) 57703 ])); 57704 }); 57705var $author$project$Page$Group$ActivityTab$incomeDiffRows = F5( 57706 function (i18n, groupCurrency, resolveName, old, _new) { 57707 return $elm$core$List$concat( 57708 _List_fromArray( 57709 [ 57710 _List_fromArray( 57711 [ 57712 A3( 57713 $author$project$Page$Group$ActivityTab$maybeDiffOrDetailRow, 57714 $author$project$Translations$newEntryDescriptionLabel(i18n), 57715 old.eE, 57716 _new.eE) 57717 ]), 57718 _List_fromArray( 57719 [ 57720 A3( 57721 $author$project$Page$Group$ActivityTab$maybeDiffOrDetailRow, 57722 $author$project$Translations$entryDetailDate(i18n), 57723 $author$project$Domain$Date$toString(old.cj), 57724 $author$project$Domain$Date$toString(_new.cj)) 57725 ]), 57726 A4( 57727 $author$project$Page$Group$ActivityTab$amountCurrencyDiffRows, 57728 i18n, 57729 groupCurrency, 57730 {dz: old.ef, cI: old.bg, e5: old.ck}, 57731 {dw: _new.ef, cF: _new.bg, e3: _new.ck}), 57732 _List_fromArray( 57733 [ 57734 A3( 57735 $author$project$Page$Group$ActivityTab$maybeDiffOrDetailRow, 57736 $author$project$Translations$entryDetailReceivedBy(i18n), 57737 resolveName(old.j$), 57738 resolveName(_new.j$)) 57739 ]), 57740 _List_fromArray( 57741 [ 57742 A6($author$project$Page$Group$ActivityTab$beneficiaryDiffOrDetailRow, i18n, resolveName, old.bg, old.em, _new.bg, _new.em) 57743 ]), 57744 A4( 57745 $author$project$Page$Group$ActivityTab$optionalDiffRow, 57746 i18n, 57747 $author$project$Translations$entryDetailNotes(i18n), 57748 old.bu, 57749 _new.bu), 57750 A3($author$project$Page$Group$ActivityTab$attachmentsDiffRow, i18n, old.ce, _new.ce) 57751 ])); 57752 }); 57753var $author$project$Page$Group$ActivityTab$transferDiffRows = F5( 57754 function (i18n, groupCurrency, resolveName, old, _new) { 57755 return $elm$core$List$concat( 57756 _List_fromArray( 57757 [ 57758 A4( 57759 $author$project$Page$Group$ActivityTab$optionalDiffRow, 57760 i18n, 57761 $author$project$Translations$newEntryDescriptionLabel(i18n), 57762 old.eE, 57763 _new.eE), 57764 _List_fromArray( 57765 [ 57766 A3( 57767 $author$project$Page$Group$ActivityTab$maybeDiffOrDetailRow, 57768 $author$project$Translations$entryDetailDate(i18n), 57769 $author$project$Domain$Date$toString(old.cj), 57770 $author$project$Domain$Date$toString(_new.cj)) 57771 ]), 57772 A4( 57773 $author$project$Page$Group$ActivityTab$amountCurrencyDiffRows, 57774 i18n, 57775 groupCurrency, 57776 {dz: old.ef, cI: old.bg, e5: old.ck}, 57777 {dw: _new.ef, cF: _new.bg, e3: _new.ck}), 57778 _List_fromArray( 57779 [ 57780 A3( 57781 $author$project$Page$Group$ActivityTab$maybeDiffOrDetailRow, 57782 $author$project$Translations$entryDetailFrom(i18n), 57783 resolveName(old.iH), 57784 resolveName(_new.iH)) 57785 ]), 57786 _List_fromArray( 57787 [ 57788 A3( 57789 $author$project$Page$Group$ActivityTab$maybeDiffOrDetailRow, 57790 $author$project$Translations$entryDetailTo(i18n), 57791 resolveName(old.kE), 57792 resolveName(_new.kE)) 57793 ]), 57794 A4( 57795 $author$project$Page$Group$ActivityTab$optionalDiffRow, 57796 i18n, 57797 $author$project$Translations$entryDetailNotes(i18n), 57798 old.bu, 57799 _new.bu), 57800 A3($author$project$Page$Group$ActivityTab$attachmentsDiffRow, i18n, old.ce, _new.ce) 57801 ])); 57802 }); 57803var $author$project$Page$Group$ActivityTab$entryModifiedDiffRows = F5( 57804 function (i18n, groupCurrency, resolveName, newEntry, maybePreviousEntry) { 57805 if (maybePreviousEntry.$ === 1) { 57806 return A4($author$project$Page$Group$ActivityTab$entryDetailRows, i18n, groupCurrency, resolveName, newEntry); 57807 } else { 57808 var oldEntry = maybePreviousEntry.a; 57809 var _v1 = _Utils_Tuple2(newEntry.gE, oldEntry.gE); 57810 _v1$3: 57811 while (true) { 57812 switch (_v1.a.$) { 57813 case 0: 57814 if (!_v1.b.$) { 57815 var _new = _v1.a.a; 57816 var old = _v1.b.a; 57817 return A5($author$project$Page$Group$ActivityTab$expenseDiffRows, i18n, groupCurrency, resolveName, old, _new); 57818 } else { 57819 break _v1$3; 57820 } 57821 case 1: 57822 if (_v1.b.$ === 1) { 57823 var _new = _v1.a.a; 57824 var old = _v1.b.a; 57825 return A5($author$project$Page$Group$ActivityTab$transferDiffRows, i18n, groupCurrency, resolveName, old, _new); 57826 } else { 57827 break _v1$3; 57828 } 57829 default: 57830 if (_v1.b.$ === 2) { 57831 var _new = _v1.a.a; 57832 var old = _v1.b.a; 57833 return A5($author$project$Page$Group$ActivityTab$incomeDiffRows, i18n, groupCurrency, resolveName, old, _new); 57834 } else { 57835 break _v1$3; 57836 } 57837 } 57838 } 57839 return A4($author$project$Page$Group$ActivityTab$entryDetailRows, i18n, groupCurrency, resolveName, newEntry); 57840 } 57841 }); 57842var $author$project$Translations$changeFieldLinks = function (_v0) { 57843 var lang = _v0; 57844 if (!lang) { 57845 return 'links'; 57846 } else { 57847 return 'liens'; 57848 } 57849}; 57850var $author$project$Translations$changeFieldSubtitle = function (_v0) { 57851 var lang = _v0; 57852 if (!lang) { 57853 return 'subtitle'; 57854 } else { 57855 return 'sous-titre'; 57856 } 57857}; 57858var $author$project$Page$Group$ActivityTab$maybeDiffRow = F3( 57859 function (label, oldVal, newVal) { 57860 return _Utils_eq(oldVal, newVal) ? $elm$core$Maybe$Nothing : $elm$core$Maybe$Just( 57861 A3( 57862 $author$project$Page$Group$ActivityTab$diffRow, 57863 label, 57864 A2($elm$core$Maybe$withDefault, 'â', oldVal), 57865 A2($elm$core$Maybe$withDefault, 'â', newVal))); 57866 }); 57867var $author$project$Page$Group$ActivityTab$groupMetadataDiffRows = F3( 57868 function (i18n, old, _new) { 57869 return A2( 57870 $elm$core$List$filterMap, 57871 $elm$core$Basics$identity, 57872 _List_fromArray( 57873 [ 57874 (!_Utils_eq(old.bW, _new.bW)) ? $elm$core$Maybe$Just( 57875 A3( 57876 $author$project$Page$Group$ActivityTab$diffRow, 57877 $author$project$Translations$changeFieldName(i18n), 57878 old.bW, 57879 _new.bW)) : $elm$core$Maybe$Nothing, 57880 A3( 57881 $author$project$Page$Group$ActivityTab$maybeDiffRow, 57882 $author$project$Translations$changeFieldSubtitle(i18n), 57883 old.cY, 57884 _new.cY), 57885 A3( 57886 $author$project$Page$Group$ActivityTab$maybeDiffRow, 57887 $author$project$Translations$groupSettingsDescription(i18n), 57888 old.eE, 57889 _new.eE), 57890 (!_Utils_eq(old.cz, _new.cz)) ? $elm$core$Maybe$Just( 57891 A3( 57892 $author$project$Page$Group$ActivityTab$diffRow, 57893 $author$project$Translations$changeFieldLinks(i18n), 57894 $author$project$Page$Group$ActivityTab$linksToString(old.cz), 57895 $author$project$Page$Group$ActivityTab$linksToString(_new.cz))) : $elm$core$Maybe$Nothing 57896 ])); 57897 }); 57898var $author$project$Translations$memberDetailTypeReal = function (_v0) { 57899 var lang = _v0; 57900 if (!lang) { 57901 return 'Real member'; 57902 } else { 57903 return 'Membre réel'; 57904 } 57905}; 57906var $author$project$Translations$memberDetailTypeVirtual = function (_v0) { 57907 var lang = _v0; 57908 if (!lang) { 57909 return 'Virtual member'; 57910 } else { 57911 return 'Membre virtuel'; 57912 } 57913}; 57914var $author$project$Translations$changeFieldEmail = function (_v0) { 57915 var lang = _v0; 57916 if (!lang) { 57917 return 'email'; 57918 } else { 57919 return 'email'; 57920 } 57921}; 57922var $author$project$Translations$changeFieldNotes = function (_v0) { 57923 var lang = _v0; 57924 if (!lang) { 57925 return 'notes'; 57926 } else { 57927 return 'notes'; 57928 } 57929}; 57930var $author$project$Translations$changeFieldPhone = function (_v0) { 57931 var lang = _v0; 57932 if (!lang) { 57933 return 'phone'; 57934 } else { 57935 return 'téléphone'; 57936 } 57937}; 57938var $author$project$Page$Group$ActivityTab$paymentDiffRows = F3( 57939 function (i18n, old, _new) { 57940 if (_Utils_eq(old, _new)) { 57941 return $elm$core$Maybe$Nothing; 57942 } else { 57943 var rows = A2( 57944 $elm$core$List$filterMap, 57945 function (method) { 57946 return A3( 57947 $author$project$Page$Group$ActivityTab$maybeDiffRow, 57948 $author$project$UI$PaymentMethods$presentation(method).i6(i18n), 57949 A2($author$project$Domain$PaymentMethod$get, method, old), 57950 A2($author$project$Domain$PaymentMethod$get, method, _new)); 57951 }, 57952 $author$project$Domain$PaymentMethod$all); 57953 if (!rows.b) { 57954 return $elm$core$Maybe$Nothing; 57955 } else { 57956 return $elm$core$Maybe$Just( 57957 A2( 57958 $author$project$Ui$column, 57959 _List_fromArray( 57960 [ 57961 $author$project$Ui$spacing($author$project$UI$Theme$spacing.bb), 57962 $author$project$Ui$width($author$project$Ui$fill) 57963 ]), 57964 rows)); 57965 } 57966 } 57967 }); 57968var $author$project$Page$Group$ActivityTab$memberMetadataDiffRows = F3( 57969 function (i18n, old, _new) { 57970 return A2( 57971 $elm$core$List$filterMap, 57972 $elm$core$Basics$identity, 57973 _List_fromArray( 57974 [ 57975 A3( 57976 $author$project$Page$Group$ActivityTab$maybeDiffRow, 57977 $author$project$Translations$changeFieldPhone(i18n), 57978 old.jF, 57979 _new.jF), 57980 A3( 57981 $author$project$Page$Group$ActivityTab$maybeDiffRow, 57982 $author$project$Translations$changeFieldEmail(i18n), 57983 old.is, 57984 _new.is), 57985 A3( 57986 $author$project$Page$Group$ActivityTab$maybeDiffRow, 57987 $author$project$Translations$changeFieldNotes(i18n), 57988 old.bu, 57989 _new.bu), 57990 A3($author$project$Page$Group$ActivityTab$paymentDiffRows, i18n, old.jD, _new.jD) 57991 ])); 57992 }); 57993var $author$project$Translations$settlementPreferPayFirst = function (_v0) { 57994 var lang = _v0; 57995 if (!lang) { 57996 return 'Prefer to pay first'; 57997 } else { 57998 return 'Payer en priorité'; 57999 } 58000}; 58001var $author$project$Page$Group$ActivityTab$detailContent = F3( 58002 function (i18n, config, detail) { 58003 var withEntryLink = F2( 58004 function (entryId, rows) { 58005 return _Utils_ap( 58006 rows, 58007 _List_fromArray( 58008 [ 58009 A3( 58010 $author$project$Page$Group$ActivityTab$entryLinkRow, 58011 i18n, 58012 config.iw(entryId), 58013 config.oQ(entryId)) 58014 ])); 58015 }); 58016 var resolveName = config.bz; 58017 switch (detail.$) { 58018 case 0: 58019 return _List_Nil; 58020 case 1: 58021 var data = detail.a; 58022 return A2( 58023 withEntryLink, 58024 data.aR.gM.aj, 58025 A4($author$project$Page$Group$ActivityTab$entryDetailRows, i18n, config.mS, resolveName, data.aR)); 58026 case 2: 58027 var data = detail.a; 58028 return A2( 58029 withEntryLink, 58030 data.aR.gM.aj, 58031 A5($author$project$Page$Group$ActivityTab$entryModifiedDiffRows, i18n, config.mS, resolveName, data.aR, data.g4)); 58032 case 3: 58033 var data = detail.a; 58034 return A2( 58035 withEntryLink, 58036 data.aR.gM.aj, 58037 A4($author$project$Page$Group$ActivityTab$entryDetailRows, i18n, config.mS, resolveName, data.aR)); 58038 case 4: 58039 var data = detail.a; 58040 return A2( 58041 withEntryLink, 58042 data.aR.gM.aj, 58043 A5($author$project$Page$Group$ActivityTab$entryModifiedDiffRows, i18n, config.mS, resolveName, data.aR, data.g4)); 58044 case 5: 58045 var data = detail.a; 58046 var _v1 = data.aR; 58047 if (!_v1.$) { 58048 var entry = _v1.a; 58049 return A2( 58050 withEntryLink, 58051 entry.gM.aj, 58052 A4($author$project$Page$Group$ActivityTab$entryDetailRows, i18n, config.mS, resolveName, entry)); 58053 } else { 58054 return _List_fromArray( 58055 [ 58056 A2( 58057 $author$project$Page$Group$ActivityTab$detailRow, 58058 $author$project$Translations$newEntryDescriptionLabel(i18n), 58059 data.iv) 58060 ]); 58061 } 58062 case 6: 58063 var data = detail.a; 58064 var _v2 = data.aR; 58065 if (!_v2.$) { 58066 var entry = _v2.a; 58067 return A2( 58068 withEntryLink, 58069 entry.gM.aj, 58070 A4($author$project$Page$Group$ActivityTab$entryDetailRows, i18n, config.mS, resolveName, entry)); 58071 } else { 58072 return _List_fromArray( 58073 [ 58074 A2( 58075 $author$project$Page$Group$ActivityTab$detailRow, 58076 $author$project$Translations$newEntryDescriptionLabel(i18n), 58077 data.iv) 58078 ]); 58079 } 58080 case 7: 58081 var data = detail.a; 58082 return _List_fromArray( 58083 [ 58084 A2( 58085 $author$project$Page$Group$ActivityTab$detailRow, 58086 $author$project$Translations$changeFieldName(i18n), 58087 data.bW), 58088 A2( 58089 $author$project$Page$Group$ActivityTab$detailRow, 58090 $author$project$Translations$activityMemberTypeLabel(i18n), 58091 function () { 58092 var _v3 = data.nL; 58093 if (!_v3) { 58094 return $author$project$Translations$memberDetailTypeReal(i18n); 58095 } else { 58096 return $author$project$Translations$memberDetailTypeVirtual(i18n); 58097 } 58098 }()) 58099 ]); 58100 case 8: 58101 var data = detail.a; 58102 return _List_fromArray( 58103 [ 58104 A2( 58105 $author$project$Page$Group$ActivityTab$detailRow, 58106 $author$project$Translations$changeFieldName(i18n), 58107 data.bW) 58108 ]); 58109 case 9: 58110 var data = detail.a; 58111 return _List_fromArray( 58112 [ 58113 A3( 58114 $author$project$Page$Group$ActivityTab$diffRow, 58115 $author$project$Translations$changeFieldName(i18n), 58116 data.e6, 58117 data.e4) 58118 ]); 58119 case 10: 58120 var data = detail.a; 58121 return _List_fromArray( 58122 [ 58123 A2( 58124 $author$project$Page$Group$ActivityTab$detailRow, 58125 $author$project$Translations$changeFieldName(i18n), 58126 data.bW) 58127 ]); 58128 case 11: 58129 var data = detail.a; 58130 return _List_fromArray( 58131 [ 58132 A2( 58133 $author$project$Page$Group$ActivityTab$detailRow, 58134 $author$project$Translations$changeFieldNa
58134me(i18n), 58135 data.bW) 58136 ]); 58137 case 12: 58138 var data = detail.a; 58139 return A3($author$project$Page$Group$ActivityTab$memberMetadataDiffRows, i18n, data.oj, data.n2); 58140 case 13: 58141 var data = detail.a; 58142 return _List_fromArray( 58143 [ 58144 A2( 58145 $author$project$Page$Group$ActivityTab$detailRow, 58146 $author$project$Translations$changeFieldName(i18n), 58147 data.bW), 58148 A2( 58149 $author$project$Page$Group$ActivityTab$detailRow, 58150 $author$project$Translations$newEntryCurrencyLabel(i18n), 58151 $author$project$Domain$Currency$currencyCode(data.il)) 58152 ]); 58153 case 14: 58154 var data = detail.a; 58155 return A3($author$project$Page$Group$ActivityTab$groupMetadataDiffRows, i18n, data.oi, data.n1); 58156 default: 58157 var data = detail.a; 58158 var formatRecipients = function (recipients) { 58159 if (!recipients.b) { 58160 return $author$project$Translations$activityDetailNoValue(i18n); 58161 } else { 58162 return A2($elm$core$String$join, ', ', recipients); 58163 } 58164 }; 58165 return _List_fromArray( 58166 [ 58167 A2( 58168 $author$project$Page$Group$ActivityTab$detailRow, 58169 $author$project$Translations$changeFieldName(i18n), 58170 data.bW), 58171 A3( 58172 $author$project$Page$Group$ActivityTab$diffRow, 58173 $author$project$Translations$settlementPreferPayFirst(i18n), 58174 formatRecipients(data.ok), 58175 formatRecipients(data.n3)) 58176 ]); 58177 } 58178 }); 58179var $author$project$Page$Group$ActivityTab$detailPanel = F3( 58180 function (i18n, config, detail) { 58181 return A2( 58182 $author$project$Ui$column, 58183 _List_fromArray( 58184 [ 58185 $author$project$Ui$spacing($author$project$UI$Theme$spacing.qk), 58186 $author$project$Ui$width($author$project$Ui$fill), 58187 $author$project$Ui$paddingWith( 58188 {lI: 0, nz: $author$project$UI$Theme$spacing.aW, pW: 0, qW: $author$project$UI$Theme$spacing.qk}), 58189 $author$project$Ui$borderWith( 58190 {lI: 0, nz: 2, pW: 0, qW: 0}), 58191 $author$project$Ui$borderColor($author$project$UI$Theme$primary.k3) 58192 ]), 58193 A3($author$project$Page$Group$ActivityTab$detailContent, i18n, config, detail)); 58194 }); 58195var $feathericons$elm_feather$FeatherIcons$edit = A2( 58196 $feathericons$elm_feather$FeatherIcons$makeBuilder, 58197 'edit', 58198 _List_fromArray( 58199 [ 58200 A2( 58201 $elm$svg$Svg$path, 58202 _List_fromArray( 58203 [ 58204 $elm$svg$Svg$Attributes$d('M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7') 58205 ]), 58206 _List_Nil), 58207 A2( 58208 $elm$svg$Svg$path, 58209 _List_fromArray( 58210 [ 58211 $elm$svg$Svg$Attributes$d('M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z') 58212 ]), 58213 _List_Nil) 58214 ])); 58215var $feathericons$elm_feather$FeatherIcons$folder = A2( 58216 $feathericons$elm_feather$FeatherIcons$makeBuilder, 58217 'folder', 58218 _List_fromArray( 58219 [ 58220 A2( 58221 $elm$svg$Svg$path, 58222 _List_fromArray( 58223 [ 58224 $elm$svg$Svg$Attributes$d('M22 19a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5l2 3h9a2 2 0 0 1 2 2z') 58225 ]), 58226 _List_Nil) 58227 ])); 58228var $feathericons$elm_feather$FeatherIcons$helpCircle = A2( 58229 $feathericons$elm_feather$FeatherIcons$makeBuilder, 58230 'help-circle', 58231 _List_fromArray( 58232 [ 58233 A2( 58234 $elm$svg$Svg$circle, 58235 _List_fromArray( 58236 [ 58237 $elm$svg$Svg$Attributes$cx('12'), 58238 $elm$svg$Svg$Attributes$cy('12'), 58239 $elm$svg$Svg$Attributes$r('10') 58240 ]), 58241 _List_Nil), 58242 A2( 58243 $elm$svg$Svg$path, 58244 _List_fromArray( 58245 [ 58246 $elm$svg$Svg$Attributes$d('M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3') 58247 ]), 58248 _List_Nil), 58249 A2( 58250 $elm$svg$Svg$line, 58251 _List_fromArray( 58252 [ 58253 $elm$svg$Svg$Attributes$x1('12'), 58254 $elm$svg$Svg$Attributes$y1('17'), 58255 $elm$svg$Svg$Attributes$x2('12.01'), 58256 $elm$svg$Svg$Attributes$y2('17') 58257 ]), 58258 _List_Nil) 58259 ])); 58260var $feathericons$elm_feather$FeatherIcons$plusCircle = A2( 58261 $feathericons$elm_feather$FeatherIcons$makeBuilder, 58262 'plus-circle', 58263 _List_fromArray( 58264 [ 58265 A2( 58266 $elm$svg$Svg$circle, 58267 _List_fromArray( 58268 [ 58269 $elm$svg$Svg$Attributes$cx('12'), 58270 $elm$svg$Svg$Attributes$cy('12'), 58271 $elm$svg$Svg$Attributes$r('10') 58272 ]), 58273 _List_Nil), 58274 A2( 58275 $elm$svg$Svg$line, 58276 _List_fromArray( 58277 [ 58278 $elm$svg$Svg$Attributes$x1('12'), 58279 $elm$svg$Svg$Attributes$y1('8'), 58280 $elm$svg$Svg$Attributes$x2('12'), 58281 $elm$svg$Svg$Attributes$y2('16') 58282 ]), 58283 _List_Nil), 58284 A2( 58285 $elm$svg$Svg$line, 58286 _List_fromArray( 58287 [ 58288 $elm$svg$Svg$Attributes$x1('8'), 58289 $elm$svg$Svg$Attributes$y1('12'), 58290 $elm$svg$Svg$Attributes$x2('16'), 58291 $elm$svg$Svg$Attributes$y2('12') 58292 ]), 58293 _List_Nil) 58294 ])); 58295var $feathericons$elm_feather$FeatherIcons$rotateCcw = A2( 58296 $feathericons$elm_feather$FeatherIcons$makeBuilder, 58297 'rotate-ccw', 58298 _List_fromArray( 58299 [ 58300 A2( 58301 $elm$svg$Svg$polyline, 58302 _List_fromArray( 58303 [ 58304 $elm$svg$Svg$Attributes$points('1 4 1 10 7 10') 58305 ]), 58306 _List_Nil), 58307 A2( 58308 $elm$svg$Svg$path, 58309 _List_fromArray( 58310 [ 58311 $elm$svg$Svg$Attributes$d('M3.51 15a9 9 0 1 0 2.13-9.36L1 10') 58312 ]), 58313 _List_Nil) 58314 ])); 58315var $feathericons$elm_feather$FeatherIcons$settings = A2( 58316 $feathericons$elm_feather$FeatherIcons$makeBuilder, 58317 'settings', 58318 _List_fromArray( 58319 [ 58320 A2( 58321 $elm$svg$Svg$circle, 58322 _List_fromArray( 58323 [ 58324 $elm$svg$Svg$Attributes$cx('12'), 58325 $elm$svg$Svg$Attributes$cy('12'), 58326 $elm$svg$Svg$Attributes$r('3') 58327 ]), 58328 _List_Nil), 58329 A2( 58330 $elm$svg$Svg$path, 58331 _List_fromArray( 58332 [ 58333 $elm$svg$Svg$Attributes$d('M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1 0 2.83 2 2 0 0 1-2.83 0l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-2 2 2 2 0 0 1-2-2v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83 0 2 2
583330 0 1 0-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1-2-2 2 2 0 0 1 2-2h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 0-2.83 2 2 0 0 1 2.83 0l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 2-2 2 2 0 0 1 2 2v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 0 2 2 0 0 1 0 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 2 2 2 2 0 0 1-2 2h-.09a1.65 1.65 0 0 0-1.51 1z') 58334 ]), 58335 _List_Nil) 58336 ])); 58337var $feathericons$elm_feather$FeatherIcons$sliders = A2( 58338 $feathericons$elm_feather$FeatherIcons$makeBuilder, 58339 'sliders', 58340 _List_fromArray( 58341 [ 58342 A2( 58343 $elm$svg$Svg$line, 58344 _List_fromArray( 58345 [ 58346 $elm$svg$Svg$Attributes$x1('4'), 58347 $elm$svg$Svg$Attributes$y1('21'), 58348 $elm$svg$Svg$Attributes$x2('4'), 58349 $elm$svg$Svg$Attributes$y2('14') 58350 ]), 58351 _List_Nil), 58352 A2( 58353 $elm$svg$Svg$line, 58354 _List_fromArray( 58355 [ 58356 $elm$svg$Svg$Attributes$x1('4'), 58357 $elm$svg$Svg$Attributes$y1('10'), 58358 $elm$svg$Svg$Attributes$x2('4'), 58359 $elm$svg$Svg$Attributes$y2('3') 58360 ]), 58361 _List_Nil), 58362 A2( 58363 $elm$svg$Svg$line, 58364 _List_fromArray( 58365 [ 58366 $elm$svg$Svg$Attributes$x1('12'), 58367 $elm$svg$Svg$Attributes$y1('21'), 58368 $elm$svg$Svg$Attributes$x2('12'), 58369 $elm$svg$Svg$Attributes$y2('12') 58370 ]), 58371 _List_Nil), 58372 A2( 58373 $elm$svg$Svg$line, 58374 _List_fromArray( 58375 [ 58376 $elm$svg$Svg$Attributes$x1('12'), 58377 $elm$svg$Svg$Attributes$y1('8'), 58378 $elm$svg$Svg$Attributes$x2('12'), 58379 $elm$svg$Svg$Attributes$y2('3') 58380 ]), 58381 _List_Nil), 58382 A2( 58383 $elm$svg$Svg$line, 58384 _List_fromArray( 58385 [ 58386 $elm$svg$Svg$Attributes$x1('20'), 58387 $elm$svg$Svg$Attributes$y1('21'), 58388 $elm$svg$Svg$Attributes$x2('20'), 58389 $elm$svg$Svg$Attributes$y2('16') 58390 ]), 58391 _List_Nil), 58392 A2( 58393 $elm$svg$Svg$line, 58394 _List_fromArray( 58395 [ 58396 $elm$svg$Svg$Attributes$x1('20'), 58397 $elm$svg$Svg$Attributes$y1('12'), 58398 $elm$svg$Svg$Attributes$x2('20'), 58399 $elm$svg$Svg$Attributes$y2('3') 58400 ]), 58401 _List_Nil), 58402 A2( 58403 $elm$svg$Svg$line, 58404 _List_fromArray( 58405 [ 58406 $elm$svg$Svg$Attributes$x1('1'), 58407 $elm$svg$Svg$Attributes$y1('14'), 58408 $elm$svg$Svg$Attributes$x2('7'), 58409 $elm$svg$Svg$Attributes$y2('14') 58410 ]), 58411 _List_Nil), 58412 A2( 58413 $elm$svg$Svg$line, 58414 _List_fromArray( 58415 [ 58416 $elm$svg$Svg$Attributes$x1('9'), 58417 $elm$svg$Svg$Attributes$y1('8'), 58418 $elm$svg$Svg$Attributes$x2('15'), 58419 $elm$svg$Svg$Attributes$y2('8') 58420 ]), 58421 _List_Nil), 58422 A2( 58423 $elm$svg$Svg$line, 58424 _List_fromArray( 58425 [ 58426 $elm$svg$Svg$Attributes$x1('17'), 58427 $elm$svg$Svg$Attributes$y1('16'), 58428 $elm$svg$Svg$Attributes$x2('23'), 58429 $elm$svg$Svg$Attributes$y2('16') 58430 ]), 58431 _List_Nil) 58432 ])); 58433var $feathericons$elm_feather$FeatherIcons$userCheck = A2( 58434 $feathericons$elm_feather$FeatherIcons$makeBuilder, 58435 'user-check', 58436 _List_fromArray( 58437 [ 58438 A2( 58439 $elm$svg$Svg$path, 58440 _List_fromArray( 58441 [ 58442 $elm$svg$Svg$Attributes$d('M16 21v-2a4 4 0 0 0-4-4H5a4 4 0 0 0-4 4v2') 58443 ]), 58444 _List_Nil), 58445 A2( 58446 $elm$svg$Svg$circle, 58447 _List_fromArray( 58448 [ 58449 $elm$svg$Svg$Attributes$cx('8.5'), 58450 $elm$svg$Svg$Attributes$cy('7'), 58451 $elm$svg$Svg$Attributes$r('4') 58452 ]), 58453 _List_Nil), 58454 A2( 58455 $elm$svg$Svg$polyline, 58456 _List_fromArray( 58457 [ 58458 $elm$svg$Svg$Attributes$points('17 11 19 13 23 9') 58459 ]), 58460 _List_Nil) 58461 ])); 58462var $feathericons$elm_feather$FeatherIcons$userPlus = A2( 58463 $feathericons$elm_feather$FeatherIcons$makeBuilder, 58464 'user-plus', 58465 _List_fromArray( 58466 [ 58467 A2( 58468 $elm$svg$Svg$path, 58469 _List_fromArray( 58470 [ 58471 $elm$svg$Svg$Attributes$d('M16 21v-2a4 4 0 0 0-4-4H5a4 4 0 0 0-4 4v2') 58472 ]), 58473 _List_Nil), 58474 A2( 58475 $elm$svg$Svg$circle, 58476 _List_fromArray( 58477 [ 58478 $elm$svg$Svg$Attributes$cx('8.5'), 58479 $elm$svg$Svg$Attributes$cy('7'), 58480 $elm$svg$Svg$Attributes$r('4') 58481 ]), 58482 _List_Nil), 58483 A2( 58484 $elm$svg$Svg$line, 58485 _List_fromArray( 58486 [ 58487 $elm$svg$Svg$Attributes$x1('20'), 58488 $elm$svg$Svg$Attributes$y1('8'), 58489 $elm$svg$Svg$Attributes$x2('20'), 58490 $elm$svg$Svg$Attributes$y2('14') 58491 ]), 58492 _List_Nil), 58493 A2( 58494 $elm$svg$Svg$line, 58495 _List_fromArray( 58496 [ 58497 $elm$svg$Svg$Attributes$x1('23'), 58498 $elm$svg$Svg$Attributes$y1('11'),
58499 $elm$svg$Svg$Attributes$x2('17'), 58500 $elm$svg$Svg$Attributes$y2('11') 58501 ]), 58502 _List_Nil) 58503 ])); 58504var $author$project$Page$Group$ActivityTab$detailIcon = function (detail) { 58505 switch (detail.$) { 58506 case 0: 58507 return $feathericons$elm_feather$FeatherIcons$helpCircle; 58508 case 1: 58509 return $feathericons$elm_feather$FeatherIcons$plusCircle; 58510 case 2: 58511 return $feathericons$elm_feather$FeatherIcons$edit; 58512 case 3: 58513 return $feathericons$elm_feather$FeatherIcons$arrowRight; 58514 case 4: 58515 return $feathericons$elm_feather$FeatherIcons$edit; 58516 case 5: 58517 return $feathericons$elm_feather$FeatherIcons$trash2; 58518 case 6: 58519 return $feathericons$elm_feather$FeatherIcons$rotateCcw; 58520 case 7: 58521 return $feathericons$elm_feather$FeatherIcons$userPlus; 58522 case 8: 58523 return $feathericons$elm_feather$FeatherIcons$userCheck; 58524 case 9: 58525 return $feathericons$elm_feather$FeatherIcons$user; 58526 case 10: 58527 return $feathericons$elm_feather$FeatherIcons$userMinus; 58528 case 11: 58529 return $feathericons$elm_feather$FeatherIcons$userCheck; 58530 case 12: 58531 return $feathericons$elm_feather$FeatherIcons$user; 58532 case 13: 58533 return $feathericons$elm_feather$FeatherIcons$folder; 58534 case 14: 58535 return $feathericons$elm_feather$FeatherIcons$settings; 58536 default: 58537 return $feathericons$elm_feather$FeatherIcons$sliders; 58538 } 58539}; 58540var $author$project$Translations$changeFieldAmount = function (_v0) { 58541 var lang = _v0; 58542 if (!lang) { 58543 return 'amount'; 58544 } else { 58545 return 'montant'; 58546 } 58547}; 58548var $author$project$Translations$changeFieldAttachments = function (_v0) { 58549 var lang = _v0; 58550 if (!lang) { 58551 return 'attachments'; 58552 } else { 58553 return 'pièces jointes'; 58554 } 58555}; 58556var $author$project$Translations$changeFieldBeneficiaries = function (_v0) { 58557 var lang = _v0; 58558 if (!lang) { 58559 return 'beneficiaries'; 58560 } else { 58561 return 'bénéficiaires'; 58562 } 58563}; 58564var $author$project$Translations$changeFieldCategory = function (_v0) { 58565 var lang = _v0; 58566 if (!lang) { 58567 return 'category'; 58568 } else { 58569 return 'catégorie'; 58570 } 58571}; 58572var $author$project$Translations$changeFieldDate = function (_v0) { 58573 var lang = _v0; 58574 if (!lang) { 58575 return 'date'; 58576 } else { 58577 return 'date'; 58578 } 58579}; 58580var $author$project$Translations$changeFieldDescription = function (_v0) { 58581 var lang = _v0; 58582 if (!lang) { 58583 return 'description'; 58584 } else { 58585 return 'description'; 58586 } 58587}; 58588var $author$project$Translations$changeFieldFrom = function (_v0) { 58589 var lang = _v0; 58590 if (!lang) { 58591 return 'sender'; 58592 } else { 58593 return 'expéditeur'; 58594 } 58595}; 58596var $author$project$Translations$changeFieldLocation = function (_v0) { 58597 var lang = _v0; 58598 if (!lang) { 58599 return 'location'; 58600 } else { 58601 return 'lieu'; 58602 } 58603}; 58604var $author$project$Translations$changeFieldPayers = function (_v0) { 58605 var lang = _v0; 58606 if (!lang) { 58607 return 'payers'; 58608 } else { 58609 return 'payeurs'; 58610 } 58611}; 58612var $author$project$Translations$changeFieldPayment = function (_v0) { 58613 var lang = _v0; 58614 if (!lang) { 58615 return 'payment methods'; 58616 } else { 58617 return 'moyens de paiement'; 58618 } 58619}; 58620var $author$project$Translations$changeFieldReceivedBy = function (_v0) { 58621 var lang = _v0; 58622 if (!lang) { 58623 return 'receiver'; 58624 } else { 58625 return 'destinataire'; 58626 } 58627}; 58628var $author$project$Translations$changeFieldTo = function (_v0) { 58629 var lang = _v0; 58630 if (!lang) { 58631 return 'receiver'; 58632 } else { 58633 return 'destinataire'; 58634 } 58635}; 58636var $author$project$Page$Group$ActivityTab$translateField = F2( 58637 function (i18n, field) { 58638 switch (field) { 58639 case 0: 58640 return $author$project$Translations$changeFieldDescription(i18n); 58641 case 1: 58642 return $author$project$Translations$changeFieldAmount(i18n); 58643 case 2: 58644 return $author$project$Translations$changeFieldDate(i18n); 58645 case 3: 58646 return $author$project$Translations$changeFieldPayers(i18n); 58647 case 4: 58648 return $author$project$Translations$changeFieldBeneficiaries(i18n); 58649 case 5: 58650 return $author$project$Translations$changeFieldCategory(i18n); 58651 case 6: 58652 return $author$project$Translations$changeFieldLocation(i18n); 58653 case 7: 58654 return $author$project$Translations$changeFieldNotes(i18n); 58655 case 8: 58656 return $author$project$Translations$changeFieldAttachments(i18n); 58657 case 9: 58658 return $author$project$Translations$changeFieldFrom(i18n); 58659 case 10: 58660 return $author$project$Translations$changeFieldTo(i18n); 58661 case 11: 58662 return $author$project$Translations$changeFieldReceivedBy(i18n); 58663 case 12: 58664 return $author$project$Translations$changeFieldPhone(i18n); 58665 case 13: 58666 return $author$project$Translations$changeFieldEmail(i18n); 58667 case 14: 58668 return $author$project$Translations$changeFieldPayment(i18n); 58669 case 15: 58670 return $author$project$Translations$changeFieldName(i18n); 58671 case 16: 58672 return $author$project$Translations$changeFieldSubtitle(i18n); 58673 default: 58674 return $author$project$Translations$changeFieldLinks(i18n); 58675 } 58676 }); 58677var $author$project$Page$Group$ActivityTab$changesText = F2( 58678 function (i18n, fields) { 58679 if (!fields.b) { 58680 return ''; 58681 } else { 58682 return ' â ' + A2( 58683 $elm$core$String$join, 58684 ', ', 58685 A2( 58686 $elm$core$List$map, 58687 $author$project$Page$Group$ActivityTab$translateField(i18n), 58688 fields)); 58689 } 58690 }); 58691var $author$project$Page$Group$ActivityTab$detailChanges = function (detail) { 58692 switch (detail.$) { 58693 case 2: 58694 var data = detail.a; 58695 return data.f_; 58696 case 4: 58697 var data = detail.a; 58698 return data.f_; 58699 case 12: 58700 var data = detail.a; 58701 return data.q3; 58702 case 14: 58703 var data = detail.a; 58704 return data.lP; 58705 default: 58706 return _List_Nil; 58707 } 58708}; 58709var $author$project$ActivityPhrase$renderLine = F2( 58710 function (i18n, _v0) { 58711 var p = _v0.a;
58712 var maybeAmount = _v0.b; 58713 var text = A2($author$project$ActivityPhrase$render, i18n, p); 58714 if (maybeAmount.$ === 1) { 58715 return text; 58716 } else { 58717 var amount = maybeAmount.a; 58718 return A2( 58719 $author$project$Translations$activityAmountSuffix, 58720 { 58721 ef: A3( 58722 $author$project$Format$formatCentsWithCurrency, 58723 $author$project$Translations$currentLanguage(i18n), 58724 amount.da, 58725 amount.bg), 58726 qI: text 58727 }, 58728 i18n); 58729 } 58730 }); 58731var $author$project$Page$Group$ActivityTab$detailSummaryText = F2( 58732 function (i18n, detail) { 58733 return _Utils_ap( 58734 A2( 58735 $author$project$ActivityPhrase$renderLine, 58736 i18n, 58737 $author$project$ActivityPhrase$phrase(detail)), 58738 A2( 58739 $author$project$Page$Group$ActivityTab$changesText, 58740 i18n, 58741 $author$project$Page$Group$ActivityTab$detailChanges(detail))); 58742 }); 58743var $author$project$Page$Group$ActivityTab$monthToInt = function (month) { 58744 switch (month) { 58745 case 0: 58746 return 1; 58747 case 1: 58748 return 2; 58749 case 2: 58750 return 3; 58751 case 3: 58752 return 4; 58753 case 4: 58754 return 5; 58755 case 5: 58756 return 6; 58757 case 6: 58758 return 7; 58759 case 7: 58760 return 8; 58761 case 8: 58762 return 9; 58763 case 9: 58764 return 10; 58765 case 10: 58766 return 11; 58767 default: 58768 return 12; 58769 } 58770}; 58771var $author$project$Page$Group$ActivityTab$formatTimestamp = F2( 58772 function (zone, posix) { 58773 var year = $elm$core$String$fromInt( 58774 A2($elm$time$Time$toYear, zone, posix)); 58775 var month = A3( 58776 $elm$core$String$padLeft, 58777 2, 58778 '0', 58779 $elm$core$String$fromInt( 58780 $author$project$Page$Group$ActivityTab$monthToInt( 58781 A2($elm$time$Time$toMonth, zone, posix)))); 58782 var minute = A3( 58783 $elm$core$String$padLeft, 58784 2, 58785 '0', 58786 $elm$core$String$fromInt( 58787 A2($elm$time$Time$toMinute, zone, posix))); 58788 var hour = A3( 58789 $elm$core$String$padLeft, 58790 2, 58791 '0', 58792 $elm$core$String$fromInt( 58793 A2($elm$time$Time$toHour, zone, posix))); 58794 var day = A3( 58795 $elm$core$String$padLeft, 58796 2, 58797 '0', 58798 $elm$core$String$fromInt( 58799 A2($elm$time$Time$toDay, zone, posix))); 58800 return year + ('-' + (month + ('-' + (day + (' ' + (hour + (':' + minute))))))); 58801 }); 58802var $feathericons$elm_feather$FeatherIcons$cloudOff = A2( 58803 $feathericons$elm_feather$FeatherIcons$makeBuilder, 58804 'cloud-off', 58805 _List_fromArray( 58806 [ 58807 A2( 58808 $elm$svg$Svg$path, 58809 _List_fromArray( 58810 [ 58811 $elm$svg$Svg$Attributes$d('M22.61 16.95A5 5 0 0 0 18 10h-1.26a8 8 0 0 0-7.05-6M5 5a8 8 0 0 0 4 15h9a5 5 0 0 0 1.7-.3') 58812 ]), 58813 _List_Nil), 58814 A2( 58815 $elm$svg$Svg$line, 58816 _List_fromArray( 58817 [ 58818 $elm$svg$Svg$Attributes$x1('1'), 58819 $elm$svg$Svg$Attributes$y1('1'), 58820 $elm$svg$Svg$Attributes$x2('23'), 58821 $elm$svg$Svg$Attributes$y2('23') 58822 ]), 58823 _List_Nil) 58824 ])); 58825var $author$project$Translations$syncPendingLabel = function (_v0) { 58826 var lang = _v0; 58827 if (!lang) { 58828 return 'Not synced'; 58829 } else { 58830 return 'Non synchronisé'; 58831 } 58832}; 58833var $author$project$UI$Components$pendingSyncBadge = function (i18n) { 58834 return A2( 58835 $author$project$Ui$row, 58836 _List_fromArray( 58837 [ 58838 $author$project$Ui$width($author$project$Ui$shrink), 58839 $author$project$Ui$spacing($author$project$UI$Theme$spacing.bb), 58840 $author$project$Ui$contentCenterY, 58841 A2($author$project$Ui$paddingXY, $author$project$UI$Theme$spacing.qk, $author$project$UI$Theme$spacing.bb), 58842 $author$project$Ui$rounded($author$project$UI$Theme$radius.aW), 58843 $author$project$Ui$background($author$project$UI$Theme$warning.qR), 58844 $author$project$Ui$Font$color($author$project$UI$Theme$warning.qI), 58845 $author$project$Ui$Font$size($author$project$UI$Theme$font.bb), 58846 $author$project$Ui$Font$weight($author$project$UI$Theme$fontWeight.dL) 58847 ]), 58848 _List_fromArray( 58849 [ 58850 A2($author$project$UI$Components$featherIcon, 12, $feathericons$elm_feather$FeatherIcons$cloudOff), 58851 $author$project$Ui$text( 58852 $author$project$Translations$syncPendingLabel(i18n)) 58853 ])); 58854}; 58855var $author$project$Page$Group$ActivityTab$summaryRow = F5( 58856 function (i18n, zone, resolveName, isPending, activity) { 58857 return A2( 58858 $author$project$Ui$row, 58859 _List_fromArray( 58860 [ 58861 $author$project$Ui$spacing($author$project$UI$Theme$spacing.aW), 58862 $author$project$Ui$contentCenterY 58863 ]), 58864 _List_fromArray( 58865 [ 58866 A2( 58867 $author$project$Ui$el, 58868 _List_fromArray( 58869 [ 58870 $author$project$Ui$width($author$project$Ui$shrink), 58871 $author$project$Ui$Font$color($author$project$UI$Theme$base.aM) 58872 ]), 58873 A2( 58874 $author$project$UI$Components$featherIcon, 58875 16, 58876 $author$project$Page$Group$ActivityTab$detailIcon(activity.io))), 58877 A2( 58878 $author$project$Ui$column, 58879 _List_fromArray( 58880 [ 58881 $author$project$Ui$spacing($author$project$UI$Theme$spacing.bb), 58882 $author$project$Ui$width($author$project$Ui$shrink) 58883 ]), 58884 A2( 58885 $elm$core$List$cons, 58886 A2( 58887 $author$project$Ui$el, 58888 _List_fromArray( 58889 [ 58890 $author$project$Ui$Font$weight($author$project$UI$Theme$fontWeight.dL), 58891 $author$project$Ui$Font$size($author$project$UI$Theme$font.qk), 58892 $author$project$Ui$clipWithEllipsis 58893 ]), 58894 $author$project$Ui$text( 58895 resolveName(activity.hJ))), 58896 A2( 58897 $elm$core$List$cons, 58898 A2( 58899 $author$project$Ui$el, 58900 _List_fromArray( 58901 [ 58902 $author$project$Ui$Font$size($author$project$UI$Theme$font.bb), 58903 $author$project$Ui$Font$color($author$project$UI$Theme$base.aM), 58904 $author$project$Ui$clipWithEllipsis 58905 ]), 58906 $author$project$Ui$text( 58907 A2($author$project$Page$Group$ActivityTab$formatTimestamp, zone, activity.kD))), 58908 isPending ? _List_fromArray( 58909 [ 58910 $author$project$UI$Components$pendingSyncBadge(i18n) 58911 ]) : _List_Nil))), 58912 A2( 58913 $author$project$Ui$el, 58914 _List_fromArray( 58915 [ 58916 $author$project$Ui$Font$size($author$project$UI$Theme$font.qk) 58917 ]), 58918 $author$project$Ui$text( 58919 A2($author$project$Page$Group$ActivityTab$detailSummaryText, i18n, activity.io))) 58920 ])); 58921 }); 58922var $author$project$Page$Group$ActivityTab$activityItem = F4(
58923 function (i18n, config, expandedActivities, activity) { 58924 var isExpanded = A2($elm$core$Set$member, activity.iA, expandedActivities); 58925 var _v0 = A2($elm$core$Set$member, activity.iA, config.kP) ? _Utils_Tuple2( 58926 $author$project$Ui$borderWith( 58927 {lI: $author$project$UI$Theme$border, nz: 4, pW: $author$project$UI$Theme$border, qW: $author$project$UI$Theme$border}), 58928 $author$project$Ui$borderColor($author$project$UI$Theme$primary.kl)) : (A2( 58929 $elm$core$Maybe$withDefault, 58930 false, 58931 A2( 58932 $elm$core$Maybe$map, 58933 function (uid) { 58934 return A2($elm$core$List$member, uid, activity.i2); 58935 }, 58936 config.f7)) ? _Utils_Tuple2( 58937 $author$project$Ui$borderWith( 58938 {lI: $author$project$UI$Theme$border, nz: 4, pW: $author$project$UI$Theme$border, qW: $author$project$UI$Theme$border}), 58939 $author$project$Ui$borderColor($author$project$UI$Theme$base.qI)) : _Utils_Tuple2($author$project$Ui$noAttr, $author$project$Ui$noAttr)); 58940 var borderWidth = _v0.a; 58941 var borderColor = _v0.b; 58942 return A2( 58943 $author$project$UI$Components$card, 58944 _List_fromArray( 58945 [ 58946 $author$project$Ui$Input$button( 58947 config.d3( 58948 $author$project$Page$Group$ActivityTab$ToggleExpanded(activity.iA))), 58949 A2($author$project$Ui$paddingXY, $author$project$UI$Theme$spacing.i8, $author$project$UI$Theme$spacing.aW), 58950 $author$project$Ui$pointer, 58951 borderWidth, 58952 borderColor 58953 ]), 58954 _List_fromArray( 58955 [ 58956 A2( 58957 $author$project$Ui$column, 58958 _List_fromArray( 58959 [ 58960 $author$project$Ui$spacing($author$project$UI$Theme$spacing.qk), 58961 $author$project$Ui$width($author$project$Ui$fill) 58962 ]), 58963 _List_fromArray( 58964 [ 58965 A5( 58966 $author$project$Page$Group$ActivityTab$summaryRow, 58967 i18n, 58968 config.al, 58969 config.bz, 58970 A2($elm$core$Set$member, activity.iA, config.pr), 58971 activity), 58972 isExpanded ? A3($author$project$Page$Group$ActivityTab$detailPanel, i18n, config, activity.io) : $author$project$Ui$none 58973 ])) 58974 ])); 58975 }); 58976var $author$project$Translations$monthApril = function (_v0) { 58977 var lang = _v0; 58978 if (!lang) { 58979 return 'April'; 58980 } else { 58981 return 'Avril'; 58982 } 58983}; 58984var $author$project$Translations$monthAugust = function (_v0) { 58985 var lang = _v0; 58986 if (!lang) { 58987 return 'August'; 58988 } else { 58989 return 'Août'; 58990 } 58991}; 58992var $author$project$Translations$monthDecember = function (_v0) { 58993 var lang = _v0; 58994 if (!lang) { 58995 return 'December'; 58996 } else { 58997 return 'Décembre'; 58998 } 58999}; 59000var $author$project$Translations$monthFebruary = function (_v0) { 59001 var lang = _v0; 59002 if (!lang) { 59003 return 'February'; 59004 } else { 59005 return 'Février'; 59006 } 59007}; 59008var $author$project$Translations$monthJanuary = function (_v0) { 59009 var lang = _v0; 59010 if (!lang) { 59011 return 'January'; 59012 } else { 59013 return 'Janvier'; 59014 } 59015}; 59016var $author$project$Translations$monthJuly = function (_v0) { 59017 var lang = _v0; 59018 if (!lang) { 59019 return 'July'; 59020 } else { 59021 return 'Juillet'; 59022 } 59023}; 59024var $author$project$Translations$monthJune = function (_v0) { 59025 var lang = _v0; 59026 if (!lang) { 59027 return 'June'; 59028 } else { 59029 return 'Juin'; 59030 } 59031}; 59032var $author$project$Translations$monthMarch = function (_v0) { 59033 var lang = _v0; 59034 if (!lang) { 59035 return 'March'; 59036 } else { 59037 return 'Mars'; 59038 } 59039}; 59040var $author$project$Translations$monthMay = function (_v0) { 59041 var lang = _v0; 59042 if (!lang) { 59043 return 'May'; 59044 } else { 59045 return 'Mai'; 59046 } 59047}; 59048var $author$project$Translations$monthNovember = function (_v0) { 59049 var lang = _v0; 59050 if (!lang) { 59051 return 'November'; 59052 } else { 59053 return 'Novembre'; 59054 } 59055}; 59056var $author$project$Translations$monthOctober = function (_v0) { 59057 var lang = _v0; 59058 if (!lang) { 59059 return 'October'; 59060 } else { 59061 return 'Octobre'; 59062 } 59063}; 59064var $author$project$Translations$monthSeptember = function (_v0) { 59065 var lang = _v0; 59066 if (!lang) { 59067 return 'September'; 59068 } else { 59069 return 'Septembre'; 59070 } 59071}; 59072var $author$project$Page$Group$ActivityTab$monthName = F2( 59073 function (i18n, m) { 59074 switch (m) { 59075 case 1: 59076 return $author$project$Translations$monthJanuary(i18n); 59077 case 2: 59078 return $author$project$Translations$monthFebruary(i18n); 59079 case 3: 59080 return $author$project$Translations$monthMarch(i18n); 59081 case 4: 59082 return $author$project$Translations$monthApril(i18n); 59083 case 5: 59084 return $author$project$Translations$monthMay(i18n); 59085 case 6: 59086 return $author$project$Translations$monthJune(i18n); 59087 case 7: 59088 return $author$project$Translations$monthJuly(i18n); 59089 case 8: 59090 return $author$project$Translations$monthAugust(i18n); 59091 case 9: 59092 return $author$project$Translations$monthSeptember(i18n); 59093 case 10: 59094 return $author$project$Translations$monthOctober(i18n); 59095 case 11: 59096 return $author$project$Translations$monthNovember(i18n); 59097 case 12: 59098 return $author$project$Translations$monthDecember(i18n); 59099 default: 59100 return ''; 59101 } 59102 }); 59103var $author$project$Page$Group$ActivityTab$dateSeparator = F3( 59104 function (i18n, zone, posix) { 59105 var year = A2($elm$time$Time$toYear, zone, posix);
59106 var month = $author$project$Page$Group$ActivityTab$monthToInt( 59107 A2($elm$time$Time$toMonth, zone, posix)); 59108 var day = A2($elm$time$Time$toDay, zone, posix); 59109 return A2( 59110 $author$project$Ui$el, 59111 _List_fromArray( 59112 [ 59113 $author$project$Ui$paddingTop($author$project$UI$Theme$spacing.aW), 59114 $author$project$Ui$Font$size($author$project$UI$Theme$font.bb), 59115 $author$project$Ui$Font$weight($author$project$UI$Theme$fontWeight.dL), 59116 $author$project$Ui$Font$letterSpacing($author$project$UI$Theme$letterSpacing.kY), 59117 $author$project$Ui$Font$color($author$project$UI$Theme$base.aM) 59118 ]), 59119 $author$project$Ui$text( 59120 $elm$core$String$toUpper( 59121 A2($author$project$Page$Group$ActivityTab$monthName, i18n, month) + (' ' + ($elm$core$String$fromInt(day) + (', ' + $elm$core$String$fromInt(year))))))); 59122 }); 59123var $elmcraft$core_extra$List$Extra$groupWhile = F2( 59124 function (isSameGroup, items) { 59125 return A3( 59126 $elm$core$List$foldr, 59127 F2( 59128 function (x, acc) { 59129 if (!acc.b) { 59130 return _List_fromArray( 59131 [ 59132 _Utils_Tuple2(x, _List_Nil) 59133 ]); 59134 } else { 59135 var _v1 = acc.a; 59136 var y = _v1.a; 59137 var restOfGroup = _v1.b; 59138 var groups = acc.b; 59139 return A2(isSameGroup, x, y) ? A2( 59140 $elm$core$List$cons, 59141 _Utils_Tuple2( 59142 x, 59143 A2($elm$core$List$cons, y, restOfGroup)), 59144 groups) : A2( 59145 $elm$core$List$cons, 59146 _Utils_Tuple2(x, _List_Nil), 59147 acc); 59148 } 59149 }), 59150 _List_Nil, 59151 items); 59152 }); 59153var $author$project$Page$Group$ActivityTab$newActivityDelimiter = function (i18n) { 59154 var line = A2( 59155 $author$project$Ui$el, 59156 _List_fromArray( 59157 [ 59158 $author$project$Ui$width($author$project$Ui$fill), 59159 $author$project$Ui$height( 59160 $author$project$Ui$px(1)), 59161 $author$project$Ui$background($author$project$UI$Theme$primary.kl) 59162 ]), 59163 $author$project$Ui$none); 59164 return A2( 59165 $author$project$Ui$row, 59166 _List_fromArray( 59167 [ 59168 $author$project$Ui$spacing($author$project$UI$Theme$spacing.qk), 59169 $author$project$Ui$width($author$project$Ui$fill), 59170 $author$project$Ui$contentCenterY, 59171 A2($author$project$Ui$paddingXY, 0, $author$project$UI$Theme$spacing.bb) 59172 ]), 59173 _List_fromArray( 59174 [ 59175 line, 59176 A2( 59177 $author$project$Ui$el, 59178 _List_fromArray( 59179 [ 59180 $author$project$Ui$width($author$project$Ui$shrink), 59181 $author$project$Ui$Font$size($author$project$UI$Theme$font.bb), 59182 $author$project$Ui$Font$weight($author$project$UI$Theme$fontWeight.dL), 59183 $author$project$Ui$Font$letterSpacing($author$project$UI$Theme$letterSpacing.kY), 59184 $author$project$Ui$Font$color($author$project$UI$Theme$primary.k4) 59185 ]), 59186 $author$project$Ui$text( 59187 $elm$core$String$toUpper( 59188 $author$project$Translations$notificationGeneric(i18n)))), 59189 line 59190 ])); 59191}; 59192var $author$project$Page$Group$ActivityTab$groupedByDate = F5( 59193 function (i18n, config, expandedActivities, lastUnseenId, activities) { 59194 var dateKey = function (activity) { 59195 return _Utils_Tuple3( 59196 A2($elm$time$Time$toYear, config.al, activity.kD), 59197 $author$project$Page$Group$ActivityTab$monthToInt( 59198 A2($elm$time$Time$toMonth, config.al, activity.kD)), 59199 A2($elm$time$Time$toDay, config.al, activity.kD)); 59200 }; 59201 return A2( 59202 $elm$core$List$concatMap, 59203 function (_v0) { 59204 var first = _v0.a; 59205 var rest = _v0.b; 59206 return A2( 59207 $elm$core$List$cons, 59208 A3($author$project$Page$Group$ActivityTab$dateSeparator, i18n, config.al, first.kD), 59209 A2( 59210 $elm$core$List$concatMap, 59211 function (activity) { 59212 return A2( 59213 $elm$core$List$cons, 59214 A4($author$project$Page$Group$ActivityTab$activityItem, i18n, config, expandedActivities, activity), 59215 _Utils_eq( 59216 $elm$core$Maybe$Just(activity.iA), 59217 lastUnseenId) ? _List_fromArray( 59218 [ 59219 $author$project$Page$Group$ActivityTab$newActivityDelimiter(i18n) 59220 ]) : _List_Nil); 59221 }, 59222 A2($elm$core$List$cons, first, rest))); 59223 }, 59224 A2( 59225 $elmcraft$core_extra$List$Extra$groupWhile, 59226 F2( 59227 function (a1, a2) { 59228 return _Utils_eq( 59229 dateKey(a1), 59230 dateKey(a2)); 59231 }), 59232 activities)); 59233 }); 59234var $author$project$Domain$Filter$classifyActivity = function (activity) { 59235 var _v0 = activity.io; 59236 switch (_v0.$) { 59237 case 0: 59238 return 2; 59239 case 1: 59240 return 0; 59241 case 2: 59242 return 0; 59243 case 3: 59244 return 0; 59245 case 4: 59246 return 0; 59247 case 5: 59248 return 0; 59249 case 6: 59250 return 0; 59251 case 7: 59252 return 1; 59253 case 8: 59254 return 1; 59255 case 9: 59256 return 1; 59257 case 10: 59258 return 1; 59259 case 11: 59260 return 1; 59261 case 12: 59262 return 1; 59263 case 13: 59264 return 2; 59265 case 14: 59266 return 2; 59267 default: 59268 return 2; 59269 } 59270}; 59271var $author$project$Domain$Filter$matchesActivityTypeFilter = F2( 59272 function (types, activity) { 59273 return $elm$core$Set$isEmpty(types) ? true : A2( 59274 $elm$core$Set$member, 59275 $author$project$Domain$Filter$activityTypeToString( 59276 $author$project$Domain$Filter$classifyActivity(activity)), 59277 types); 59278 }); 59279var $author$project$Domain$Filter$matchesActorFilter = F2( 59280 function (actors, activity) { 59281 return $elm$core$Set$isEmpty(actors) ? true : A2($elm$core$Set$member, activity.hJ, actors); 59282 }); 59283var $author$project$Domain$Filter$matchesInvolvedFilter = F2( 59284 function (members, activity) { 59285 return $elm$core$Set$isEmpty(members) ? true : A3( 59286 $elm$core$Set$foldl, 59287 F2( 59288 function (m, acc) { 59289 return acc && A2($elm$core$List$member, m, activity.i2); 59290 }), 59291 true, 59292 members); 59293 }); 59294var $author$project$Domain$Filter$matchesActivityFilters = F2( 59295 function (filters, activity) { 59296 return A2($author$project$Domain$Filter$matchesActivityTypeFilter, filters.ec, activity) && (A2($author$project$Domain$Filter$matchesActorFilter, filters.ed, activity) && A2($author$project$Domain$Filter$matchesInvolvedFilter, filters.i2, activity)); 59297 }); 59298var $author$project$Page$Group$ActivityTab$view = F4( 59299 function (i18n, config, _v0, activities) { 59300 var data = _v0; 59301 var filteredActivities = A2( 59302 $elm$core$List$filter, 59303 $author$project$Domain$Filter$matchesActivityFilters(data.a5), 59304 activities); 59305 return A2( 59306 $author$project$Ui$column, 59307 _List_fromArray( 59308 [ 59309 $author$project$Ui$spacing($author$project$UI$Theme$spacing.aW), 59310 $author$project$Ui$width($author$project$Ui$fill) 59311 ]), 59312 _List_fromArray( 59313 [ 59314 A4($author$project$Page$Group$ActivityTab$filterToggleRow, i18n, config.d3, data.cS, data.a5), 59315 data.cS ? A3($author$project$Page$Group$ActivityTab$filterPanel, i18n, config, data.a5) : ($author$project$Domain$Filter$isActivityFilterActive(data.a5) ? A3($author$project$Page$Group$ActivityTab$activeFilterSummary, i18n, config, data.a5) : $author$project$Ui$none), 59316 function () { 59317 if ($elm$core$List$isEmpty(filteredActivities)) { 59318 return A2( 59319 $author$project$Ui$el, 59320 _List_fromArray( 59321 [ 59322 $author$project$Ui$Font$size($author$project$UI$Theme$font.qk), 59323 $author$project$Ui$Font$color($author$project$UI$Theme$base.aM), 59324 A2($author$project$Ui$paddingXY, 0, $author$project$UI$Theme$spacing.i8) 59325 ]), 59326 $author$project$Ui$text( 59327 $author$project$Translations$activityComingSoon(i18n))); 59328 } else { 59329 var lastUnseenId = A2( 59330 $elm$core$Maybe$map, 59331 function ($) { 59332 return $.iA; 59333 }, 59334 $elmcraft$core_extra$List$Extra$last( 59335 A2( 59336 $elm$core$List$filter, 59337 function (a) { 59338 return A2($elm$core$Set$member, a.iA, config.kP); 59339 }, 59340 filteredActivities))); 59341 return A2( 59342 $author$project$Ui$column, 59343 _List_fromArray( 59344 [ 59345 $author$project$Ui$spacing($author$project$UI$Theme$spacing.bb), 59346 $author$project$Ui$width($author$project$Ui$fill) 59347 ]), 59348 A5($author$project$Page$Group$ActivityTab$groupedByDate, i18n, config, data.cq, lastUnseenId, filteredActivities)); 59349 } 59350 }() 59351 ])); 59352 }); 59353var $author$project$Translations$balanceNoEntries = function (_v0) { 59354 var lang = _v0; 59355 if (!lang) { 59356 return 'No expenses yet. Add your first expense to see balances here.'; 59357 } else { 59358 return 'Aucune dépense pour le moment. Ajoute-en une, ensuite tu verras ton solde ici.'; 59359 } 59360}; 59361var $author$project$Translations$balanceTabTitle = function (_v0) { 59362 var lang = _v0; 59363 if (!lang) { 59364 return 'Balances'; 59365 } else { 59366 return 'Soldes'; 59367 } 59368}; 59369var $author$project$Page$Group$BalanceTab$ToggleMember = function (a) { 59370 return {$: 0, a: a}; 59371}; 59372var $author$project$Translations$balanceIsOwed = function (_v0) { 59373 var lang = _v0; 59374 if (!lang) { 59375 return 'is owed'; 59376 } else { 59377 return 'on lui doit'; 59378 } 59379}; 59380var $author$project$Translations$balanceOwes = function (_v0) { 59381 var lang = _v0; 59382 if (!lang) { 59383 return 'owes'; 59384 } else { 59385 return 'doit'; 59386 } 59387}; 59388var $author$project$Translations$balanceSettled = function (_v0) { 59389 var lang = _v0; 59390 if (!lang) { 59391 return 'settled'; 59392 } else { 59393 return 'soldé'; 59394 } 59395}; 59396var $author$project$Domain$Balance$Creditor = 0; 59397var $author$project$Domain$Balance$Debtor = 1; 59398var $author$project$Domain$Balance$Settled = 2; 59399var $author$project$Domain$Balance$status = function (balance) { 59400 return (balance.e2 > 0) ? 0 : ((balance.e2 < 0) ? 1 : 2); 59401}; 59402var $author$project$Translations$balanceNewTransfer = function (_v0) { 59403 var lang = _v0; 59404 if (!lang) { 59405 return '+ Record new transfer'; 59406 } else { 59407 return '+ Enregistrer un transfert'; 59408 } 59409}; 59410var $author$project$Page$Group$BalanceTab$transferActionBtn = F3( 59411 function (i18n, href, onPress) { 59412 return A2( 59413 $author$project$Ui$row, 59414 A2( 59415 $elm$core$List$cons, 59416 $author$project$Ui$width($author$project$Ui$fill), 59417 A2( 59418 $elm$core$List$cons, 59419 $author$project$Ui$spacing($author$project$UI$Theme$spacing.bb), 59420 A2( 59421 $elm$core$List$cons, 59422 $author$project$Ui$contentCenterX, 59423 A2( 59424 $elm$core$List$cons, 59425 $author$project$Ui$contentCenterY, 59426 A2( 59427 $elm$core$List$cons, 59428 A2($author$project$Ui$paddingXY, $author$project$UI$Theme$spacing.aW, $author$project$UI$Theme$spacing.qk), 59429 A2( 59430 $elm$core$List$cons, 59431 $author$project$Ui$border($author$project$UI$Theme$border), 59432 A2( 59433 $elm$core$List$cons, 59434 $author$project$Ui$borderColor($author$project$UI$Theme$base.k3), 59435 A2( 59436 $elm$core$List$cons, 59437 $author$project$Ui$rounded($author$project$UI$Theme$radiu
59437s.qk), 59438 A2( 59439 $elm$core$List$cons, 59440 $author$project$Ui$background($author$project$UI$Theme$base.en), 59441 A2( 59442 $elm$core$List$cons, 59443 $author$project$Ui$Font$size($author$project$UI$Theme$font.qk), 59444 A2( 59445 $elm$core$List$cons, 59446 $author$project$Ui$Font$weight($author$project$UI$Theme$fontWeight.nI), 59447 A2( 59448 $elm$core$List$cons, 59449 $author$project$Ui$Font$color($author$project$UI$Theme$primary.qI), 59450 A2( 59451 $elm$core$List$cons, 59452 $author$project$Ui$pointer, 59453 A2($author$project$UI$Components$spaLinkAttrs, href, onPress)))))))))))))), 59454 _List_fromArray( 59455 [ 59456 $author$project$Ui$text( 59457 $author$project$Translations$balanceNewTransfer(i18n)) 59458 ])); 59459 }); 59460var $author$project$Page$Group$BalanceTab$memberBalanceCard = F7( 59461 function (i18n, config, isMember, currency, resolveName, expandedMember, b) { 59462 var name = resolveName(b.e$); 59463 var isExpanded = _Utils_eq( 59464 expandedMember, 59465 $elm$core$Maybe$Just(b.e$)); 59466 var initials = A2( 59467 $elm$core$String$left, 59468 2, 59469 $elm$core$String$toUpper(name)); 59470 var balanceStatus = $author$project$Domain$Balance$status(b); 59471 var statusText = function () { 59472 switch (balanceStatus) { 59473 case 0: 59474 return $author$project$Translations$balanceIsOwed(i18n); 59475 case 1: 59476 return $author$project$Translations$balanceOwes(i18n); 59477 default: 59478 return $author$project$Translations$balanceSettled(i18n); 59479 } 59480 }(); 59481 var avatarColor = function () { 59482 switch (balanceStatus) { 59483 case 0: 59484 return 3; 59485 case 1: 59486 return 0; 59487 default: 59488 return 1; 59489 } 59490 }(); 59491 var amountColor = function () { 59492 switch (balanceStatus) { 59493 case 0: 59494 return $author$project$UI$Theme$success.qI; 59495 case 1: 59496 return $author$project$UI$Theme$danger.qI; 59497 default: 59498 return $author$project$UI$Theme$base.aM; 59499 } 59500 }(); 59501 return A2( 59502 $author$project$UI$Components$card, 59503 _List_fromArray( 59504 [ 59505 $author$project$Ui$Input$button( 59506 config.d3( 59507 $author$project$Page$Group$BalanceTab$ToggleMember(b.e$))), 59508 A2($author$project$Ui$paddingXY, $author$project$UI$Theme$spacing.i8, $author$project$UI$Theme$spacing.aW), 59509 $author$project$Ui$pointer, 59510 $author$project$Ui$spacing($author$project$UI$Theme$spacing.aW) 59511 ]), 59512 _List_fromArray( 59513 [ 59514 A2( 59515 $author$project$Ui$row, 59516 _List_fromArray( 59517 [ 59518 $author$project$Ui$width($author$project$Ui$fill), 59519 $author$project$Ui$contentCenterY 59520 ]), 59521 _List_fromArray( 59522 [ 59523 A2( 59524 $author$project$Ui$row, 59525 _List_fromArray( 59526 [ 59527 $author$project$Ui$spacing($author$project$UI$Theme$spacing.aW), 59528 $author$project$Ui$contentCenterY 59529 ]), 59530 _List_fromArray( 59531 [ 59532 A2($author$project$UI$Components$avatar, avatarColor, initials), 59533 A2( 59534 $author$project$Ui$column, 59535 _List_fromArray( 59536 [ 59537 $author$project$Ui$spacing($author$project$UI$Theme$spacing.bb) 59538 ]), 59539 _List_fromArray( 59540 [ 59541 A2( 59542 $author$project$Ui$el, 59543 _List_fromArray( 59544 [ 59545 $author$project$Ui$Font$weight($author$project$UI$Theme$fontWeight.dL), 59546 $author$project$Ui$Font$size($author$project$UI$Theme$font.aW) 59547 ]), 59548 $author$project$Ui$text(name)), 59549 A2( 59550 $author$project$Ui$el, 59551 _List_fromArray( 59552 [ 59553 $author$project$Ui$Font$size($author$project$UI$Theme$font.qk), 59554 $author$project$Ui$Font$color($author$project$UI$Theme$base.aM) 59555 ]), 59556 $author$project$Ui$text(statusText)) 59557 ])) 59558 ])), 59559 A2( 59560 $author$project$Ui$el, 59561 _List_fromArray( 59562 [ 59563 $author$project$Ui$alignRight, 59564 $author$project$Ui$Font$size($author$project$UI$Theme$font.aW), 59565 $author$project$Ui$Font$weight($author$project$UI$Theme$fontWeight.dL), 59566 $author$project$Ui$Font$color(amountColor) 59567 ]), 59568 $author$project$Ui$text( 59569 A3( 59570 $author$project$Format$formatCentsSigned, 59571 $author$project$Translations$currentLanguage(i18n), 59572 b.e2, 59573 currency))) 59574 ])), 59575 (isExpanded && isMember) ? A3( 59576 $author$project$Page$Group$BalanceTab$transferActionBtn, 59577 i18n, 59578 config.n5, 59579 config.oS( 59580 { 59581 lo: $elm$core$Basics$abs(b.e2), 59582 kF: b.e$ 59583 })) : $author$project$Ui$none 59584 ])); 59585 }); 59586var $author$project$Translations$membersTabTitle = function (_v0) { 59587 var lang = _v0; 59588 if (!lang) { 59589 return 'Members'; 59590 } else { 59591 return 'Membres'; 59592 } 59593}; 59594var $author$project$Page$Group$BalanceTab$otherMembersSection = F5(
59595 function (i18n, config, expandedMember, maybeUserRootId, state) { 59596 var resolveName = $author$project$Domain$GroupState$resolveMemberName(state); 59597 var balances = A2( 59598 $elm$core$List$sortBy, 59599 function (b) { 59600 return resolveName(b.e$); 59601 }, 59602 $elm$core$Dict$values( 59603 function () { 59604 if (!maybeUserRootId.$) { 59605 var uid = maybeUserRootId.a; 59606 return A2($elm$core$Dict$remove, uid, state.ly); 59607 } else { 59608 return state.ly; 59609 } 59610 }())); 59611 return $elm$core$List$isEmpty(balances) ? $author$project$Ui$none : A2( 59612 $author$project$Ui$column, 59613 _List_Nil, 59614 _List_fromArray( 59615 [ 59616 $author$project$UI$Components$sectionLabel( 59617 $author$project$Translations$membersTabTitle(i18n)), 59618 A2( 59619 $author$project$Ui$column, 59620 _List_fromArray( 59621 [ 59622 $author$project$Ui$spacing($author$project$UI$Theme$spacing.bb) 59623 ]), 59624 A2( 59625 $elm$core$List$map, 59626 A6( 59627 $author$project$Page$Group$BalanceTab$memberBalanceCard, 59628 i18n, 59629 config, 59630 !_Utils_eq(maybeUserRootId, $elm$core$Maybe$Nothing), 59631 state.iO.il, 59632 resolveName, 59633 expandedMember), 59634 balances)) 59635 ])); 59636 }); 59637var $author$project$Page$Group$BalanceTab$preferencesContent = F3( 59638 function (currentUserRootId, onSavePreferences, state) { 59639 var preferredRecipients = A2( 59640 $elm$core$Maybe$withDefault, 59641 _List_Nil, 59642 A2( 59643 $elm$core$Maybe$map, 59644 function (pref) { 59645 return pref.pB; 59646 }, 59647 A2( 59648 $elmcraft$core_extra$List$Extra$find, 59649 function (pref) { 59650 return _Utils_eq(pref.e$, currentUserRootId); 59651 }, 59652 state.qb))); 59653 var selectCreditor = function (creditorId) { 59654 return _Utils_eq( 59655 preferredRecipients, 59656 _List_fromArray( 59657 [creditorId])) ? onSavePreferences( 59658 {e$: currentUserRootId, pB: _List_Nil}) : onSavePreferences( 59659 { 59660 e$: currentUserRootId, 59661 pB: _List_fromArray( 59662 [creditorId]) 59663 }); 59664 }; 59665 var otherMembers = A2( 59666 $elm$core$List$map, 59667 function (m) { 59668 return _Utils_Tuple2(m.aj, m.bW); 59669 }, 59670 A2( 59671 $elm$core$List$sortBy, 59672 function ($) { 59673 return $.bW; 59674 }, 59675 $elm$core$Dict$values( 59676 A2($elm$core$Dict$remove, currentUserRootId, state.r)))); 59677 return A2( 59678 $author$project$Ui$column, 59679 _List_fromArray( 59680 [ 59681 $author$project$Ui$paddingTop($author$project$UI$Theme$spacing.aW), 59682 $author$project$Ui$spacing($author$project$UI$Theme$spacing.bb) 59683 ]), 59684 _List_fromArray( 59685 [ 59686 A2( 59687 $author$project$Ui$row, 59688 _List_fromArray( 59689 [ 59690 $author$project$Ui$wrap, 59691 $author$project$Ui$spacing($author$project$UI$Theme$spacing.bb) 59692 ]), 59693 A2( 59694 $elm$core$List$map, 59695 function (_v0) { 59696 var creditorId = _v0.a; 59697 var creditorName = _v0.b; 59698 return $author$project$UI$Components$togglePill( 59699 { 59700 gv: $elm$core$Maybe$Nothing, 59701 i6: creditorName, 59702 e7: selectCreditor(creditorId), 59703 hj: A2($elm$core$List$member, creditorId, preferredRecipients) 59704 }); 59705 }, 59706 otherMembers)) 59707 ])); 59708 }); 59709var $author$project$Translations$settlementPreferencesHint = function (_v0) { 59710 var lang = _v0; 59711 if (!lang) { 59712 return 'Choose who you prefer to pay first. It is recommended to leave this untouched for a better settlement plan for the whole group.'; 59713 } else { 59714 return 'Choisis à qui tu préfères payer en priorité. Il est recommandé de ne pas y toucher pour un meilleur plan de remboursement pour l\'ensemble du groupe.'; 59715 } 59716}; 59717var $author$project$Translations$settlementPreferencesShow = function (_v0) { 59718 var lang = _v0; 59719 if (!lang) { 59720 return 'Settlement preferences'; 59721 } else { 59722 return 'Préférences de remboursement'; 59723 } 59724}; 59725var $author$project$Page$Group$BalanceTab$preferencesSection = F4( 59726 function (i18n, config, currentUserRootId, state) { 59727 return A2( 59728 $author$project$Ui$column, 59729 _List_Nil, 59730 _List_fromArray( 59731 [ 59732 $author$project$UI$Components$sectionLabel( 59733 $author$project$Translations$settlementPreferencesShow(i18n)), 59734 A2( 59735 $author$project$Ui$el, 59736 _List_fromArray( 59737 [ 59738 $author$project$Ui$Font$size($author$project$UI$Theme$font.qk), 59739 $author$project$Ui$Font$color($author$project$UI$Theme$base.aM) 59740 ]), 59741 $author$project$Ui$text( 59742 $author$project$Translations$settlementPreferencesHint(i18n))), 59743 A3($author$project$Page$Group$BalanceTab$preferencesContent, currentUserRootId, config.o1, state) 59744 ])); 59745 }); 59746var $author$project$Translations$balanceSettlementPlan = function (_v0) { 59747 var lang = _v0; 59748 if (!lang) { 59749 return 'Settlement Plan'; 59750 } else { 59751 return 'Plan de remboursement'; 59752 } 59753}; 59754var $author$project$Page$Group$BalanceTab$selectedSettlement = F3( 59755 function (maybeUserRootId, transactions, _v0) { 59756 var data = _v0; 59757 var _v1 = data.dM; 59758 switch (_v1.$) { 59759 case 0: 59760 return A2( 59761 $elm$core$Maybe$andThen, 59762 function (userRootId) { 59763 return A2( 59764 $elmcraft$core_extra$List$Extra$find, 59765 function (transaction) { 59766 return _Utils_eq(transaction.iH, userRootId); 59767 }, 59768 transactions); 59769 }, 59770 maybeUserRootId); 59771 case 1: 59772 var transaction = _v1.a; 59773 return A2($elm$core$List$member, transaction, transactions) ? $elm$core$Maybe$Just(transaction) : $elm$core$Maybe$Nothing; 59774 default: 59775 return $elm$core$Maybe$Nothing; 59776 } 59777 }); 59778var $author$project$Page$Group$BalanceTab$CollapseSettlements = {$: 2}; 59779var $author$project$Page$Group$BalanceTab$SelectSettlement = function (a) { 59780 return {$: 1, a: a}; 59781}; 59782var $author$project$Page$Group$BalanceTab$RecordTransfer = function (a) { 59783 return {$: 3, a: a}; 59784}; 59785var $author$project$UI$PaymentMethods$toHandle = F3( 59786 function (i18n, method, value) { 59787 var shown = $author$project$UI$PaymentMethods$presentation(method); 59788 return { 59789 gv: shown.gv,
59790 i6: shown.i6(i18n), 59791 kS: A2( 59792 $elm$core$Maybe$map, 59793 function (toUrl) { 59794 return toUrl(value); 59795 }, 59796 shown.kS), 59797 q8: value 59798 }; 59799 }); 59800var $author$project$UI$PaymentMethods$handles = F2( 59801 function (i18n, info) { 59802 return A2( 59803 $elm$core$List$filterMap, 59804 function (method) { 59805 return A2( 59806 $elm$core$Maybe$map, 59807 A2($author$project$UI$PaymentMethods$toHandle, i18n, method), 59808 A2($author$project$Domain$PaymentMethod$get, method, info)); 59809 }, 59810 $author$project$Domain$PaymentMethod$all); 59811 }); 59812var $author$project$Page$Group$BalanceTab$copyButton = function (value) { 59813 return A2( 59814 $author$project$Ui$el, 59815 _List_fromArray( 59816 [ 59817 $author$project$Ui$width($author$project$Ui$shrink), 59818 $author$project$Ui$alignRight, 59819 $author$project$Ui$inFront( 59820 A2( 59821 $author$project$Ui$el, 59822 _List_fromArray( 59823 [ 59824 $author$project$Ui$width($author$project$Ui$fill), 59825 $author$project$Ui$height($author$project$Ui$fill) 59826 ]), 59827 $author$project$Ui$html( 59828 A3( 59829 $elm$html$Html$node, 59830 'copy-button', 59831 _List_fromArray( 59832 [ 59833 A2($elm$html$Html$Attributes$attribute, 'data-copy', value), 59834 A2($elm$html$Html$Attributes$style, 'display', 'block'), 59835 A2($elm$html$Html$Attributes$style, 'width', '100%'), 59836 A2($elm$html$Html$Attributes$style, 'height', '100%'), 59837 A2($elm$html$Html$Attributes$style, 'cursor', 'pointer') 59838 ]), 59839 _List_Nil)))), 59840 $author$project$Ui$Font$color($author$project$UI$Theme$base.aM), 59841 $author$project$Ui$pointer 59842 ]), 59843 A2($author$project$UI$Components$featherIcon, 16, $feathericons$elm_feather$FeatherIcons$copy)); 59844}; 59845var $author$project$Page$Group$BalanceTab$paymentRow = F4( 59846 function (icon, label, value, maybeUrl) { 59847 return A2( 59848 $author$project$Ui$row, 59849 _List_fromArray( 59850 [ 59851 $author$project$Ui$spacing($author$project$UI$Theme$spacing.qk), 59852 $author$project$Ui$contentCenterY 59853 ]), 59854 _List_fromArray( 59855 [ 59856 A2( 59857 $author$project$Ui$el, 59858 _List_fromArray( 59859 [ 59860 $author$project$Ui$Font$color($author$project$UI$Theme$base.aM), 59861 $author$project$Ui$width($author$project$Ui$shrink) 59862 ]), 59863 A2($author$project$UI$Components$featherIcon, 16, icon)), 59864 A2( 59865 $author$project$Ui$el, 59866 _List_fromArray( 59867 [ 59868 $author$project$Ui$Font$size($author$project$UI$Theme$font.qk), 59869 $author$project$Ui$Font$color($author$project$UI$Theme$base.aM), 59870 $author$project$Ui$width($author$project$Ui$shrink) 59871 ]), 59872 $author$project$Ui$text(label)), 59873 function () { 59874 if (!maybeUrl.$) { 59875 var url = maybeUrl.a; 59876 return A2( 59877 $author$project$Ui$el, 59878 _List_fromArray( 59879 [ 59880 $author$project$Ui$linkNewTab(url), 59881 $author$project$Ui$Font$size($author$project$UI$Theme$font.aW), 59882 $author$project$Ui$Font$color($author$project$UI$Theme$primary.qI), 59883 $author$project$Ui$Font$underline, 59884 $author$project$Ui$pointer, 59885 $author$project$Ui$width($author$project$Ui$shrink), 59886 $author$project$Ui$clipWithEllipsis 59887 ]), 59888 $author$project$Ui$text(value)); 59889 } else { 59890 return A2( 59891 $author$project$Ui$el, 59892 _List_fromArray( 59893 [ 59894 $author$project$Ui$Font$size($author$project$UI$Theme$font.aW), 59895 $author$project$Ui$clipWithEllipsis 59896 ]), 59897 $author$project$Ui$text(value)); 59898 } 59899 }(), 59900 $author$project$Page$Group$BalanceTab$copyButton(value) 59901 ])); 59902 }); 59903var $author$project$Translations$settlementNoPaymentMethods = F2( 59904 function (name, _v0) { 59905 var lang = _v0; 59906 if (!lang) { 59907 return name + ' hasn\'t set up a payment method yet. You can add one from the Group tab.'; 59908 } else { 59909 return name + ' n\'a pas encore de méthode de paiement. Tu peux en ajouter depuis l\'onglet Groupe.'; 59910 } 59911 }); 59912var $author$project$Translations$settlementRecordTransfer = function (_v0) { 59913 var lang = _v0; 59914 if (!lang) { 59915 return 'Mark as paid'; 59916 } else { 59917 return 'Marquer comme payé'; 59918 } 59919}; 59920var $author$project$Page$Group$BalanceTab$settlementDetail = F6( 59921 function (i18n, config, isMember, resolveName, t, state) { 59922 var paymentMethodRows = A2( 59923 $elm$core$List$map, 59924 function (h) { 59925 return A4($author$project$Page$Group$BalanceTab$paymentRow, h.gv, h.i6, h.q8, h.kS); 59926 }, 59927 A2( 59928 $author$project$UI$PaymentMethods$handles, 59929 i18n, 59930 A2( 59931 $elm$core$Maybe$withDefault, 59932 $author$project$Domain$PaymentMethod$empty, 59933 A2( 59934 $elm$core$Maybe$map, 59935 A2( 59936 $elm$core$Basics$composeR, 59937 function ($) { 59938 return $.ji; 59939 }, 59940 function ($) { 59941 return $.jD; 59942 }), 59943 A2($elm$core$Dict$get, t.kE, state.r))))); 59944 return A2( 59945 $author$project$Ui$column, 59946 _List_fromArray( 59947 [ 59948 A2($author$project$Ui$paddingXY, $author$project$UI$Theme$spacing.i8, $author$project$UI$Theme$spacing.aW), 59949 $author$project$Ui$spacing($author$project$UI$Theme$spacing.aW), 59950 $author$project$Ui$width($author$project$Ui$fill), 59951 $author$project$Ui$borderWith( 59952 {lI: 0, nz: 0, pW: 0, qW: $author$project$UI$Theme$border}), 59953 $author$project$Ui$borderColor($author$project$UI$Theme$base.k3), 59954 $author$project$Ui$background($author$project$UI$Theme$base.en) 59955 ]), 59956 _List_fromArray( 59957 [ 59958 $elm$core$List$isEmpty(paymentMethodRows) ? A2( 59959 $author$project$Ui$el, 59960 _List_fromArray( 59961 [ 59962 $author$project$Ui$Font$size($author$project$UI$Theme$font.qk), 59963 $author$project$Ui$Font$color($author$project$UI$Theme$base.aM) 59964 ]), 59965 $author$project$Ui$text( 59966 A2( 59967 $author$project$Translations$settlementNoPaymentMethods, 59968 resolveName(t.kE), 59969 i18n))) : A2( 59970 $author$project$Ui$column, 59971 _List_fromArray( 59972 [ 59973 $author$project$Ui$spacing($author$project$UI$Theme$spacing.aW), 59974 $author$project$Ui$width($author$project$Ui$fill) 59975 ]), 59976 paymentMethodRows), 59977 isMember ? A2( 59978 $author$project$UI$Components$btnPrimary, 59979 _List_Nil, 59980 { 59981 i6: $author$project$Translations$settlementRecordTransfer(i18n), 59982 e7: config.d3( 59983 $author$project$Page$Group$BalanceTab$RecordTransfer(t)) 59984 }) : $author$project$Ui$none 59985 ])); 59986 }); 59987var $author$project$Page$Group$BalanceTab$settlementItem = F8( 59988 function (i18n, config, resolveName, maybeUserRootId, showTopBorder, isSelected, t, state) { 59989 var isCurrentUser = function () { 59990 if (!maybeUserRootId.$) { 59991 var uid = maybeUserRootId.a; 59992 return _Utils_eq(t.iH, uid) || _Utils_eq(t.kE, uid); 59993 } else { 59994 return false;
59995 } 59996 }(); 59997 var _v0 = showTopBorder ? _Utils_Tuple2( 59998 $author$project$Ui$borderWith( 59999 {lI: 0, nz: 0, pW: 0, qW: $author$project$UI$Theme$border}), 60000 $author$project$Ui$borderColor($author$project$UI$Theme$base.k3)) : _Utils_Tuple2($author$project$Ui$noAttr, $author$project$Ui$noAttr); 60001 var topBorder = _v0.a; 60002 var borderColor = _v0.b; 60003 var _v1 = isCurrentUser ? _Utils_Tuple3( 60004 $author$project$Ui$background($author$project$UI$Theme$base.qI), 60005 $author$project$Ui$Font$color($author$project$UI$Theme$base.km), 60006 $author$project$Ui$Font$color($author$project$UI$Theme$base.km)) : _Utils_Tuple3($author$project$Ui$noAttr, $author$project$Ui$noAttr, $author$project$Ui$noAttr); 60007 var bgColor = _v1.a; 60008 var textColor = _v1.b; 60009 var amountColor = _v1.c; 60010 var headerRow = A2( 60011 $author$project$Ui$row, 60012 _List_fromArray( 60013 [ 60014 $author$project$Ui$Input$button( 60015 config.d3( 60016 isSelected ? $author$project$Page$Group$BalanceTab$CollapseSettlements : $author$project$Page$Group$BalanceTab$SelectSettlement(t))), 60017 A2($author$project$Ui$paddingXY, $author$project$UI$Theme$spacing.i8, $author$project$UI$Theme$spacing.aW), 60018 $author$project$Ui$pointer, 60019 $author$project$Ui$contentCenterY, 60020 topBorder, 60021 borderColor, 60022 bgColor, 60023 textColor 60024 ]), 60025 _List_fromArray( 60026 [ 60027 A2( 60028 $author$project$Ui$row, 60029 _List_fromArray( 60030 [ 60031 $author$project$Ui$spacing($author$project$UI$Theme$spacing.qk), 60032 $author$project$Ui$Font$size($author$project$UI$Theme$font.aW), 60033 $author$project$Ui$contentCenterY, 60034 $author$project$Ui$width($author$project$Ui$shrink) 60035 ]), 60036 _List_fromArray( 60037 [ 60038 A2( 60039 $author$project$Ui$el, 60040 _List_fromArray( 60041 [ 60042 $author$project$Ui$Font$weight($author$project$UI$Theme$fontWeight.dL) 60043 ]), 60044 $author$project$Ui$text( 60045 resolveName(t.iH))), 60046 A2( 60047 $author$project$Ui$el, 60048 _List_fromArray( 60049 [ 60050 $author$project$Ui$Font$color($author$project$UI$Theme$base.aM) 60051 ]), 60052 $author$project$Ui$text('â')), 60053 A2( 60054 $author$project$Ui$el, 60055 _List_fromArray( 60056 [ 60057 $author$project$Ui$Font$weight($author$project$UI$Theme$fontWeight.dL) 60058 ]), 60059 $author$project$Ui$text( 60060 resolveName(t.kE))) 60061 ])), 60062 A2( 60063 $author$project$Ui$row, 60064 _List_fromArray( 60065 [ 60066 $author$project$Ui$alignRight, 60067 $author$project$Ui$spacing($author$project$UI$Theme$spacing.qk), 60068 $author$project$Ui$contentCenterY, 60069 $author$project$Ui$width($author$project$Ui$shrink) 60070 ]), 60071 _List_fromArray( 60072 [ 60073 A2( 60074 $author$project$Ui$el, 60075 _List_fromArray( 60076 [ 60077 $author$project$Ui$Font$weight($author$project$UI$Theme$fontWeight.dL), 60078 amountColor 60079 ]), 60080 $author$project$Ui$text( 60081 A3( 60082 $author$project$Format$formatCentsWithCurrency, 60083 $author$project$Translations$currentLanguage(i18n), 60084 t.ef, 60085 state.iO.il))), 60086 $author$project$UI$Components$animatedChevron(isSelected) 60087 ])) 60088 ])); 60089 return isSelected ? _List_fromArray( 60090 [ 60091 headerRow, 60092 A6( 60093 $author$project$Page$Group$BalanceTab$settlementDetail, 60094 i18n, 60095 config, 60096 !_Utils_eq(maybeUserRootId, $elm$core$Maybe$Nothing), 60097 resolveName, 60098 t, 60099 state) 60100 ]) : _List_fromArray( 60101 [headerRow]); 60102 }); 60103var $author$project$Page$Group$BalanceTab$settlementSection = F5( 60104 function (i18n, config, maybeUserRootId, model, state) { 60105 var transactions = A3($author$project$Domain$StableSettlement$stablePlan, state.lp, state.qb, state.ly); 60106 if ($elm$core$List$isEmpty(transactions)) { 60107 return $author$project$Ui$none; 60108 } else { 60109 var selectedTransaction = A3($author$project$Page$Group$BalanceTab$selectedSettlement, maybeUserRootId, transactions, model); 60110 var resolveName = $author$project$Domain$GroupState$resolveMemberName(state); 60111 var settlementRow = F2( 60112 function (idx, transaction) { 60113 return A8( 60114 $author$project$Page$Group$BalanceTab$settlementItem, 60115 i18n, 60116 config, 60117 resolveName, 60118 maybeUserRootId, 60119 idx > 0, 60120 _Utils_eq( 60121 selectedTransaction, 60122 $elm$core$Maybe$Just(transaction)), 60123 transaction, 60124 state); 60125 }); 60126 return A2( 60127 $author$project$Ui$column, 60128 _List_Nil, 60129 _List_fromArray( 60130 [ 60131 $author$project$UI$Components$sectionLabel( 60132 $author$project$Translations$balanceSettlementPlan(i18n)), 60133 A2( 60134 $author$project$UI$Components$card, 60135 _List_fromArray( 60136 [$author$project$Ui$clip]), 60137 $elm$core$List$concat( 60138 A2($elm$core$List$indexedMap, settlementRow, transactions))) 60139 ])); 60140 } 60141 }); 60142var $author$project$Translations$balanceIsOwedYou = function (_v0) { 60143 var lang = _v0; 60144 if (!lang) { 60145 return 'You are owed this amount'; 60146 } else { 60147 return 'On te doit ce montant'; 60148 } 60149}; 60150var $author$project$Translations$balanceOwesYou = function (_v0) { 60151 var lang = _v0; 60152 if (!lang) { 60153 return 'You owe this amount'; 60154 } else { 60155 return 'Tu dois ce montant'; 60156 } 60157}; 60158var $author$project$Translations$balanceYourBalance = function (_v0) { 60159 var lang = _v0; 60160 if (!lang) { 60161 return 'YOUR BALANCE'; 60162 } else { 60163 return 'TON SOLDE'; 60164 } 60165}; 60166var $author$project$UI$Theme$shadowXl = $author$project$Ui$Shadow$shadows( 60167 _List_fromArray( 60168 [ 60169 {
60170 h1: 32, 60171 ic: A4($author$project$Ui$rgba, 45, 45, 45, 0.18), 60172 dW: 0, 60173 rm: 0, 60174 k0: 8 60175 }, 60176 { 60177 h1: 8, 60178 ic: A4($author$project$Ui$rgba, 45, 45, 45, 0.18), 60179 dW: 0, 60180 rm: 0, 60181 k0: 2 60182 } 60183 ])); 60184var $author$project$Page$Group$BalanceTab$yourBalanceCard = F3( 60185 function (i18n, currentUserRootId, state) { 60186 var myBalance = A2($elm$core$Dict$get, currentUserRootId, state.ly); 60187 var amountColor = function () { 60188 var _v3 = A2($elm$core$Maybe$map, $author$project$Domain$Balance$status, myBalance); 60189 _v3$2: 60190 while (true) { 60191 if (!_v3.$) { 60192 switch (_v3.a) { 60193 case 0: 60194 var _v4 = _v3.a; 60195 return $author$project$UI$Theme$success.hG; 60196 case 1: 60197 var _v5 = _v3.a; 60198 return $author$project$UI$Theme$danger.hG; 60199 default: 60200 break _v3$2; 60201 } 60202 } else { 60203 break _v3$2; 60204 } 60205 } 60206 return $author$project$UI$Theme$base.en; 60207 }(); 60208 var _v0 = function () { 60209 if (!myBalance.$) { 60210 var b = myBalance.a; 60211 return _Utils_Tuple2( 60212 A3( 60213 $author$project$Format$formatCentsSigned, 60214 $author$project$Translations$currentLanguage(i18n), 60215 b.e2, 60216 state.iO.il), 60217 function () { 60218 var _v2 = $author$project$Domain$Balance$status(b); 60219 switch (_v2) { 60220 case 0: 60221 return $author$project$Translations$balanceIsOwedYou(i18n); 60222 case 1: 60223 return $author$project$Translations$balanceOwesYou(i18n); 60224 default: 60225 return $author$project$Translations$balanceSettled(i18n); 60226 } 60227 }()); 60228 } else { 60229 return _Utils_Tuple2( 60230 A3( 60231 $author$project$Format$formatCentsSigned, 60232 $author$project$Translations$currentLanguage(i18n), 60233 0, 60234 state.iO.il), 60235 $author$project$Translations$balanceSettled(i18n)); 60236 } 60237 }(); 60238 var amountText = _v0.a; 60239 var detailText = _v0.b; 60240 return A2( 60241 $author$project$Ui$column, 60242 _List_fromArray( 60243 [ 60244 $author$project$Ui$background($author$project$UI$Theme$base.qI), 60245 $author$project$Ui$rounded($author$project$UI$Theme$radius.i8), 60246 $author$project$Ui$padding($author$project$UI$Theme$spacing.hE), 60247 $author$project$Ui$spacing($author$project$UI$Theme$spacing.qk), 60248 $author$project$UI$Theme$shadowXl 60249 ]), 60250 _List_fromArray( 60251 [ 60252 A2( 60253 $author$project$Ui$el, 60254 _List_fromArray( 60255 [ 60256 $author$project$Ui$Font$size($author$project$UI$Theme$font.qk), 60257 $author$project$Ui$Font$weight($author$project$UI$Theme$fontWeight.dL), 60258 $author$project$Ui$Font$letterSpacing($author$project$UI$Theme$letterSpacing.kY), 60259 $author$project$Ui$Font$color($author$project$UI$Theme$base.ql) 60260 ]), 60261 $author$project$Ui$text( 60262 $author$project$Translations$balanceYourBalance(i18n))), 60263 A2( 60264 $author$project$Ui$el, 60265 _List_fromArray( 60266 [ 60267 $author$project$Ui$Font$size($author$project$UI$Theme$font.rn), 60268 $author$project$Ui$Font$weight($author$project$UI$Theme$fontWeight.lD), 60269 $author$project$Ui$Font$letterSpacing($author$project$UI$Theme$letterSpacing.qP), 60270 $author$project$Ui$Font$color(amountColor) 60271 ]), 60272 $author$project$Ui$text(amountText)), 60273 A2( 60274 $author$project$Ui$el, 60275 _List_fromArray( 60276 [ 60277 $author$project$Ui$Font$size($author$project$UI$Theme$font.qk), 60278 $author$project$Ui$Font$color($author$project$UI$Theme$base.en) 60279 ]), 60280 $author$project$Ui$text(detailText)) 60281 ])); 60282 }); 60283var $author$project$Page$Group$BalanceTab$view = F5( 60284 function (i18n, config, maybeUserRootId, _v0, state) { 60285 var data = _v0; 60286 return $elm$core$Dict$isEmpty(state.E) ? A2( 60287 $author$project$Ui$column, 60288 _List_fromArray( 60289 [ 60290 $author$project$Ui$spacing($author$project$UI$Theme$spacing.i8), 60291 $author$project$Ui$width($author$project$Ui$fill) 60292 ]), 60293 _List_fromArray( 60294 [ 60295 A2( 60296 $author$project$Ui$el, 60297 _List_fromArray( 60298 [ 60299 $author$project$Ui$Font$size($author$project$UI$Theme$font.i8), 60300 $author$project$Ui$Font$weight($author$project$UI$Theme$fontWeight.lD) 60301 ]), 60302 $author$project$Ui$text( 60303 $author$project$Translations$balanceTabTitle(i18n))), 60304 A2( 60305 $author$project$Ui$el, 60306 _List_fromArray( 60307 [ 60308 $author$project$Ui$Font$size($author$project$UI$Theme$font.qk), 60309 $author$project$Ui$Font$color($author$project$UI$Theme$base.aM) 60310 ]), 60311 $author$project$Ui$text( 60312 $author$project$Translations$balanceNoEntries(i18n))) 60313 ])) : A2( 60314 $author$project$Ui$column, 60315 _List_fromArray( 60316 [ 60317 $author$project$Ui$spacing($author$project$UI$Theme$spacing.i8) 60318 ]), 60319 A2( 60320 $elm$core$List$filterMap, 60321 $elm$core$Basics$identity, 60322 _List_fromArray( 60323 [ 60324 A2( 60325 $elm$core$Maybe$map, 60326 function (uid) { 60327 return A3($author$project$Page$Group$BalanceTab$yourBalanceCard, i18n, uid, state); 60328 }, 60329 maybeUserRootId), 60330 $elm$core$Maybe$Just( 60331 A5($author$project$Page$Group$BalanceTab$otherMembersSection, i18n, config, data.eJ, maybeUserRootId, state)), 60332 $elm$core$Maybe$Just( 60333 A5($author$project$Page$Group$BalanceTab$settlementSection, i18n, config, maybeUserRootId, data, state)), 60334 A2( 60335 $elm$core$Maybe$map, 60336 function (uid) { 60337 return A4($author$project$Page$Group$BalanceTab$preferencesSection, i18n, config, uid, state); 60338 }, 60339 maybeUserRootId) 60340 ]))); 60341 }); 60342var $author$project$Translations$filterDateLast30 = function (_v0) { 60343 var lang = _v0; 60344 if (!lang) { 60345 return 'Last 30 days'; 60346 } else { 60347 return '30 derniers jours'; 60348 } 60349}; 60350var $author$project$Translations$filterDateLast7 = function (_v0) { 60351 var lang = _v0; 60352 if (!lang) { 60353 return 'Last 7 days'; 60354 } else { 60355 return '7 derniers jours'; 60356 } 60357}; 60358var $author$project$Translations$filterDateLastMonth = function (_v0) { 60359 var lang = _v0; 60360 if (!lang) { 60361 return 'Last month'; 60362 } else { 60363 return 'Le mois dernier'; 60364 } 60365}; 60366var $author$project$Translations$filterDateThisMonth = function (_v0) { 60367 var lang = _v0; 60368 if (!lang) { 60369 return 'This month'; 60370 } else { 60371 return 'Ce mois-ci'; 60372 } 60373}; 60374var $author$project$Translations$filterDateToday = function (_v0) { 60375 var lang = _v0; 60376 if (!lang) { 60377 return 'Today'; 60378 } else { 60379 return 'Aujourd\'hui'; 60380 } 60381}; 60382var $author$project$Translations$filterDateYesterday = function (_v0) { 60383 var lang = _v0; 60384 if (!lang) { 60385 return 'Yesterday'; 60386 } else { 60387 return 'Hier'; 60388 } 60389}; 60390var $author$project$Page$Group$EntriesTab$dateRangeLabel = F2( 60391 function (i18n, range) { 60392 switch (range) { 60393 case 0: 60394 return $author$project$Translations$filterDateToday(i18n); 60395 case 1: 60396 return $author$project$Translations$filterDateYesterday(i18n); 60397 case 2: 60398 return $author$project$Translations$filterDateLast7(i18n); 60399 case 3: 60400 return $author$project$Translations$filterDateLast30(i18n); 60401 case 4: 60402 return $author$project$Translations$filterDateThisMonth(i18n); 60403 default: 60404 return $author$project$Translations$filterDateLastMonth(i18n); 60405 } 60406 }); 60407var $author$project$Translations$entriesShowDeleted = F2( 60408 function (count, _v0) { 60409 var lang = _v0; 60410 if (!lang) { 60411 return 'Show deleted (' + (count + ')'); 60412 } else { 60413 return 'Afficher supprimées (' + (count + ')'); 60414 } 60415 }); 60416var $author$project$Translations$filterCategoryLabel = function (_v0) { 60417 var lang = _v0; 60418 if (!lang) { 60419 return 'Category'; 60420 } else { 60421 return 'Catégorie'; 60422 } 60423}; 60424var $author$project$Translations$filterCurrencyLabel = function (_v0) { 60425 var lang = _v0; 60426 if (!lang) { 60427 return 'Currency'; 60428 } else { 60429 return 'Devise'; 60430 } 60431}; 60432var $author$project$Translations$filterDateLabel = function (_v0) { 60433 var lang = _v0; 60434 if (!lang) { 60435 return 'Date'; 60436 } else { 60437 return 'Date'; 60438 } 60439}; 60440var $author$project$Translations$filterPersonLabel = function (_v0) { 60441 var lang = _v0; 60442 if (!lang) { 60443 return 'Person'; 60444 } else { 60445 return 'Personne'; 60446 } 60447}; 60448var $author$project$Page$Group$EntriesTab$activeFilterSummary = F4( 60449 function (i18n, filters, showDeleted, state) { 60450 var resolveName = $author$project$Domain$GroupState$resolveMemberName(state); 60451 var personChips = A2( 60452 $elm$core$List$map, 60453 function (id) { 60454 return A2( 60455 $author$project$UI$Components$filterSummaryChip, 60456 $author$project$Translations$filterPersonLabel(i18n), 60457 resolveName(id)); 60458 }, 60459 $elm$core$Set$toList(filters.fc)); 60460 var deletedChip = showDeleted ? _List_fromArray( 60461 [ 60462 A2( 60463 $author$project$UI$Components$filterSummaryChip, 60464 $author$project$Translations$filterSectionTitle(i18n), 60465 A2($author$project$Translations$entriesShowDeleted, '', i18n)) 60466 ]) : _List_Nil; 60467 var dateChips = A2( 60468 $elm$core$List$map, 60469 function (r) { 60470 return A2( 60471 $author$project$UI$Components$filterSummaryChip, 60472 $author$project$Translations$filterDateLabel(i18n), 60473 A2($author$project$Page$Group$EntriesTab$dateRangeLabel, i18n, r)); 60474 }, 60475 filters.eB); 60476 var currencyChips = A2( 60477 $elm$core$List$map, 60478 $author$project$UI$Components$filterSummaryChip( 60479 $author$project$Translations$filterCurrencyLabel(i18n)), 60480 $elm$core$Set$toList(filters.ez)); 60481 var categoryChips = A2( 60482 $elm$core$List$map, 60483 $author$project$UI$Components$filterSummaryChip( 60484 $author$project$Translations$filterCategoryLabel(i18n)), 60485 $elm$core$Set$toList(filters.eu)); 60486 return A2( 60487 $author$project$Ui$column, 60488 _List_fromArray( 60489 [ 60490 $author$project$Ui$spacing($author$project$UI$Theme$spacing.bb), 60491 $author$project$Ui$width($author$project$Ui$fill) 60492 ]), 60493 _List_fromArray( 60494 [ 60495 $author$project$UI$Components$sectionLabel( 60496 $author$project$Translations$filterSectionTitle(i18n)), 60497 A2( 60498 $author$project$Ui$row, 60499 _List_fromArray( 60500 [ 60501 $author$project$Ui$wrap, 60502 $author$project$Ui$spacing($author$project$UI$Theme$spacing.bb) 60503 ]), 60504 $elm$core$List$concat( 60505 _List_fromArray( 60506 [personChips, categoryChips, currencyChips, dateChips, deletedChip]))) 60507 ])); 60508 }); 60509var $author$project$Translations$entriesNone = function (_v0) { 60510 var lang = _v0; 60511 if (!lang) { 60512 return 'No expenses yet.'; 60513 } else { 60514 return 'Aucune dépense pour le moment.'; 60515 } 60516}; 60517var $author$project$Page$Group$EntriesTab$entrySortKey = function (entry) { 60518 var d = function () { 60519 var _v0 = entry.gE; 60520 switch (_v0.$) { 60521 case 0: 60522 var data = _v0.a; 60523 return data.cj; 60524 case 1: 60525 var data = _v0.a; 60526 return data.cj; 60527 default: 60528 var data = _v0.a; 60529 return data.cj; 60530 } 60531 }(); 60532 return _Utils_Tuple3( 60533 -(((d.C * 10000) + (d.F * 100)) + d.y), 60534 -$elm$time$Time$posixToMillis(entry.gM.f2), 60535 entry.gM.m9); 60536}; 60537var $author$project$Page$Group$EntriesTab$ClearAllFilters = {$: 6}; 60538var $author$project$Page$Group$EntriesTab$ToggleShowDeleted = {$: 0}; 60539var $author$project$Domain$Filter$ExpenseCategory = function (a) { 60540 return {$: 0, a: a}; 60541}; 60542var $author$project$Domain$Filter$IncomeCategory = {$: 2}; 60543var $author$project$Page$Group$EntriesTab$ToggleCategory = function (a) { 60544 return {$: 3, a: a}; 60545}; 60546var $author$project$Domain$Filter$TransferCategory = {$: 1}; 60547var $author$project$Domain$Filter$categoryFilterToString = function (cf) { 60548 switch (cf.$) { 60549 case 0: 60550 var cat = cf.a; 60551 return 'expense:' + $author$project$Domain$Entry$categoryToString(cat); 60552 case 1: 60553 return 'transfer'; 60554 default: 60555 return 'income'; 60556 } 60557}; 60558var $author$project$Translations$filterCategoryIncome = function (_v0) { 60559 var lang = _v0; 60560 if (!lang) { 60561 return 'Income'; 60562 } else { 60563 return 'Revenu'; 60564 } 60565}; 60566var $author$project$Translations$filterCategoryTransfer = function (_v0) { 60567 var lang = _v0; 60568 if (!lang) { 60569 return 'Transfer'; 60570 } else { 60571 return 'Transfert'; 60572 } 60573}; 60574var $author$project$Page$Group$EntriesTab$categoryFilterSection = F2( 60575 function (i18n, selected) { 60576 var allCategories = _Utils_ap( 60577 _List_fromArray( 60578 [ 60579 _Utils_Tuple2( 60580 $author$project$Domain$Filter$categoryFilterToString($author$project$Domain$Filter$TransferCategory), 60581 'ð¸ ' + $author$project$Translations$filterCategoryTransfer(i18n)), 60582 _Utils_Tuple2( 60583 $author$project$Domain$Filter$categoryFilterToString($author$project$Domain$Filter$IncomeCategory), 60584 'ð¥ ' + $author$project$Translations$filterCategoryIncome(i18n)) 60585 ]), 60586 A2( 60587 $elm$core$List$map, 60588 function (category) { 60589 return _Utils_Tuple2( 60590 $author$project$Domain$Filter$categoryFilterToString( 60591 $author$project$Domain$Filter$ExpenseCategory(category)), 60592 A2($author$project$UI$Categories$labelWithEmoji, i18n, category)); 60593 }, 60594 $author$project$Domain$Entry$allCategories)); 60595 return A2( 60596 $author$project$UI$Components$filterSection, 60597 $author$project$Translations$filterCategoryLabel(i18n), 60598 A2( 60599 $elm$core$List$map, 60600 function (_v0) { 60601 var key = _v0.a; 60602 var label = _v0.b; 60603 return $author$project$UI$Components$chip( 60604 { 60605 i6: label, 60606 e7: $author$project$Page$Group$EntriesTab$ToggleCategory(key), 60607 hj: A2($elm$core$Set$member, key, selected) 60608 }); 60609 }, 60610 allCategories)); 60611 }); 60612var $author$project$Page$Group$EntriesTab$ToggleCurrency = function (a) { 60613 return {$: 4, a: a}; 60614}; 60615var $author$project$Page$Group$EntriesTab$currencyFilterSection = F3( 60616 function (i18n, selected, state) { 60617 var usedCurrencies = $elm$core$Set$toList( 60618 $elm$core$Set$fromList( 60619 A2( 60620 $elm$core$List$map, 60621 function (es) { 60622 var _v0 = es.bi.gE; 60623 switch (_v0.$) { 60624 case 0: 60625 var data = _v0.a; 60626 return $author$project$Domain$Currency$currencyCode(data.bg); 60627 case 1: 60628 var data = _v0.a; 60629 return $author$project$Domain$Currency$currencyCode(data.bg); 60630 default: 60631 var data = _v0.a; 60632 return $author$project$Domain$Currency$currencyCode(data.bg); 60633 } 60634 }, 60635 $elm$core$Dict$values(state.E)))); 60636 return A2( 60637 $author$project$UI$Components$filterSection, 60638 $author$project$Translations$filterCurrencyLabel(i18n), 60639 A2( 60640 $elm$core$List$map, 60641 function (code) { 60642 return $author$project$UI$Components$chip( 60643 { 60644 i6: code, 60645 e7: $author$project$Page$Group$EntriesTab$ToggleCurrency(code), 60646 hj: A2($elm$core$Set$member, code, selected) 60647 }); 60648 }, 60649 usedCurrencies)); 60650 }); 60651var $author$project$Domain$Filter$Last30Days = 3; 60652var $author$project$Domain$Filter$Last7Days = 2; 60653var $author$project$Domain$Filter$LastMonth = 5; 60654var $author$project$Domain$Filter$ThisMonth = 4; 60655var $author$project$Domain$Filter$Today = 0; 60656var $author$project$Page$Group$EntriesTab$ToggleDateRange = function (a) { 60657 return {$: 5, a: a}; 60658}; 60659var $author$project$Domain$Filter$Yesterday = 1; 60660var $author$project$Page$Group$EntriesTab$dateFilterSection = F2( 60661 function (i18n, activeRanges) { 60662 var presets = _List_fromArray( 60663 [ 60664 _Utils_Tuple2( 60665 0, 60666 $author$project$Translations$filterDateToday(i18n)), 60667 _Utils_Tuple2( 60668 1, 60669 $author$project$Translations$filterDateYesterday(i18n)), 60670 _Utils_Tuple2( 60671 2, 60672 $author$project$Translations$filterDateLast7(i18n)), 60673 _Utils_Tuple2( 60674 3, 60675 $author$project$Translations$filterDateLast30(i18n)), 60676 _Utils_Tuple2( 60677 4, 60678 $author$project$Translations$filterDateThisMonth(i18n)), 60679 _Utils_Tuple2( 60680 5, 60681 $author$project$Translations$filterDateLastMonth(i18n)) 60682 ]); 60683 return A2( 60684 $author$project$UI$Components$filterSection, 60685 $author$project$Translations$filterDateLabel(i18n), 60686 A2( 60687 $elm$core$List$map, 60688 function (_v0) { 60689 var range = _v0.a; 60690 var label = _v0.b; 60691 return $author$project$UI$Components$chip( 60692 { 60693 i6: label, 60694 e7: $author$project$Page$Group$EntriesTab$ToggleDateRange(range), 60695 hj: A2($elm$core$List$member, range, activeRanges) 60696 }); 60697 }, 60698 presets)); 60699 }); 60700var $author$project$Domain$Filter$isEntryFilterActive = function (f) { 60701 return (!$elm$core$Set$isEmpty(f.fc)) || ((!$elm$core$Set$isEmpty(f.eu)) || ((!$elm$core$Set$isEmpty(f.ez)) || (!$elm$core$List$isEmpty(f.eB)))); 60702}; 60703var $author$project$Page$Group$EntriesTab$TogglePerson = function (a) { 60704 return {$: 2, a: a}; 60705}; 60706var $author$project$Page$Group$EntriesTab$personFilterSection = F3( 60707 function (i18n, selected, state) { 60708 var members = A2( 60709 $elm$core$List$sortBy, 60710 $elm$core$Tuple$second, 60711 A2( 60712 $elm$core$List$map, 60713 function (m) { 60714 return _Utils_Tuple2(m.aj, m.bW); 60715 }, 60716 $author$project$Domain$GroupState$activeMembers(state))); 60717 return A2( 60718 $author$project$UI$Components$filterSection, 60719 $author$project$Translations$filterPersonLabel(i18n), 60720 A2( 60721 $elm$core$List$map, 60722 function (_v0) { 60723 var id = _v0.a; 60724 var name = _v0
60724.b; 60725 return $author$project$UI$Components$chip( 60726 { 60727 i6: name, 60728 e7: $author$project$Page$Group$EntriesTab$TogglePerson(id), 60729 hj: A2($elm$core$Set$member, id, selected) 60730 }); 60731 }, 60732 members)); 60733 }); 60734var $author$project$Page$Group$EntriesTab$filterPanel = F4( 60735 function (i18n, filters, showDeleted, state) { 60736 var deletedCount = $elm$core$Dict$size( 60737 A2( 60738 $elm$core$Dict$filter, 60739 F2( 60740 function (_v0, entry) { 60741 return entry.gB; 60742 }), 60743 state.E)); 60744 return A2( 60745 $author$project$UI$Components$card, 60746 _List_fromArray( 60747 [ 60748 $author$project$Ui$padding($author$project$UI$Theme$spacing.i8) 60749 ]), 60750 _List_fromArray( 60751 [ 60752 A3($author$project$Page$Group$EntriesTab$personFilterSection, i18n, filters.fc, state), 60753 A2($author$project$Page$Group$EntriesTab$categoryFilterSection, i18n, filters.eu), 60754 A3($author$project$Page$Group$EntriesTab$currencyFilterSection, i18n, filters.ez, state), 60755 A2($author$project$Page$Group$EntriesTab$dateFilterSection, i18n, filters.eB), 60756 A2( 60757 $author$project$Ui$row, 60758 _List_fromArray( 60759 [ 60760 $author$project$Ui$width($author$project$Ui$fill), 60761 $author$project$Ui$contentCenterY, 60762 $author$project$Ui$paddingTop($author$project$UI$Theme$spacing.qk) 60763 ]), 60764 _List_fromArray( 60765 [ 60766 A2( 60767 $author$project$Ui$el, 60768 _List_fromArray( 60769 [ 60770 $author$project$Ui$Font$size($author$project$UI$Theme$font.qk), 60771 $author$project$Ui$Font$color($author$project$UI$Theme$base.aM) 60772 ]), 60773 $author$project$Ui$text( 60774 A2( 60775 $author$project$Translations$entriesShowDeleted, 60776 $elm$core$String$fromInt(deletedCount), 60777 i18n))), 60778 $author$project$UI$Components$toggle( 60779 {nr: showDeleted, e7: $author$project$Page$Group$EntriesTab$ToggleShowDeleted}) 60780 ])), 60781 $author$project$Domain$Filter$isEntryFilterActive(filters) ? A2($author$project$UI$Components$clearAllFiltersButton, i18n, $author$project$Page$Group$EntriesTab$ClearAllFilters) : $author$project$Ui$none 60782 ])); 60783 }); 60784var $author$project$Page$Group$EntriesTab$monthName = F2( 60785 function (i18n, m) { 60786 switch (m) { 60787 case 1: 60788 return $author$project$Translations$monthJanuary(i18n); 60789 case 2: 60790 return $author$project$Translations$monthFebruary(i18n); 60791 case 3: 60792 return $author$project$Translations$monthMarch(i18n); 60793 case 4: 60794 return $author$project$Translations$monthApril(i18n); 60795 case 5: 60796 return $author$project$Translations$monthMay(i18n); 60797 case 6: 60798 return $author$project$Translations$monthJune(i18n); 60799 case 7: 60800 return $author$project$Translations$monthJuly(i18n); 60801 case 8: 60802 return $author$project$Translations$monthAugust(i18n); 60803 case 9: 60804 return $author$project$Translations$monthSeptember(i18n); 60805 case 10: 60806 return $author$project$Translations$monthOctober(i18n); 60807 case 11: 60808 return $author$project$Translations$monthNovember(i18n); 60809 case 12: 60810 return $author$project$Translations$monthDecember(i18n); 60811 default: 60812 return ''; 60813 } 60814 }); 60815var $author$project$Page$Group$EntriesTab$formatDate = F2( 60816 function (i18n, date) { 60817 return A2($author$project$Page$Group$EntriesTab$monthName, i18n, date.F) + (' ' + ($elm$core$String$fromInt(date.y) + (', ' + $elm$core$String$fromInt(date.C)))); 60818 }); 60819var $author$project$Page$Group$EntriesTab$dateSeparator = F2( 60820 function (i18n, date) { 60821 return A2( 60822 $author$project$Ui$el, 60823 _List_fromArray( 60824 [ 60825 $author$project$Ui$paddingTop($author$project$UI$Theme$spacing.aW), 60826 $author$project$Ui$Font$size($author$project$UI$Theme$font.bb), 60827 $author$project$Ui$Font$weight($author$project$UI$Theme$fontWeight.dL), 60828 $author$project$Ui$Font$letterSpacing($author$project$UI$Theme$letterSpacing.kY), 60829 $author$project$Ui$Font$color($author$project$UI$Theme$base.aM) 60830 ]), 60831 $author$project$Ui$text( 60832 $elm$core$String$toUpper( 60833 A2($author$project$Page$Group$EntriesTab$formatDate, i18n, date)))); 60834 }); 60835var $author$project$Page$Group$EntriesTab$ToggleEntry = function (a) { 60836 return {$: 8, a: a}; 60837}; 60838var $author$project$Page$Group$EntriesTab$CancelConfirm = {$: 14}; 60839var $author$project$Page$Group$EntriesTab$Confirm = {$: 13}; 60840var $author$project$Translations$memberRenameCancel = function (_v0) { 60841 var lang = _v0; 60842 if (!lang) { 60843 return 'Cancel'; 60844 } else { 60845 return 'Annuler'; 60846 } 60847}; 60848var $author$project$Page$Group$EntriesTab$confirmSection = F2( 60849 function (i18n, config) { 60850 return A2( 60851 $author$project$Ui$column, 60852 _List_fromArray( 60853 [ 60854 $author$project$Ui$spacing($author$project$UI$Theme$spacing.qk), 60855 $author$project$Ui$width($author$project$Ui$fill) 60856 ]), 60857 _List_fromArray( 60858 [ 60859 A2( 60860 $author$project$Ui$el, 60861 _List_fromArray( 60862 [ 60863 $author$project$Ui$width($author$project$Ui$fill), 60864 $author$project$Ui$padding($author$project$UI$Theme$spacing.aW), 60865 $author$project$Ui$rounded($author$project$UI$Theme$radiu
60865s.aW), 60866 $author$project$Ui$background($author$project$UI$Theme$danger.qR), 60867 $author$project$Ui$Font$color($author$project$UI$Theme$danger.qI), 60868 $author$project$Ui$Font$size($author$project$UI$Theme$font.qk) 60869 ]), 60870 $author$project$Ui$text(config.hB)), 60871 A2( 60872 $author$project$Ui$row, 60873 _List_fromArray( 60874 [ 60875 $author$project$Ui$spacing($author$project$UI$Theme$spacing.qk) 60876 ]), 60877 _List_fromArray( 60878 [ 60879 A2( 60880 $author$project$Ui$row, 60881 _List_fromArray( 60882 [ 60883 $author$project$Ui$Input$button($author$project$Page$Group$EntriesTab$Confirm), 60884 $author$project$Ui$width($author$project$Ui$fill), 60885 $author$project$Ui$spacing($author$project$UI$Theme$spacing.qk), 60886 $author$project$Ui$contentCenterX, 60887 $author$project$Ui$contentCenterY, 60888 $author$project$Ui$padding($author$project$UI$Theme$spacing.aW), 60889 $author$project$Ui$rounded($author$project$UI$Theme$radius.aW), 60890 $author$project$Ui$background(config.fW), 60891 $author$project$Ui$Font$color(config.hv), 60892 $author$project$Ui$Font$weight($author$project$UI$Theme$fontWeight.dL), 60893 $author$project$Ui$pointer 60894 ]), 60895 _List_fromArray( 60896 [ 60897 A2($author$project$UI$Components$featherIcon, 16, config.f0), 60898 $author$project$Ui$text(config.f1) 60899 ])), 60900 A2( 60901 $author$project$UI$Components$btnOutline, 60902 _List_Nil, 60903 { 60904 gv: $elm$core$Maybe$Nothing, 60905 i6: $author$project$Translations$memberRenameCancel(i18n), 60906 e7: $author$project$Page$Group$EntriesTab$CancelConfirm 60907 }) 60908 ])) 60909 ])); 60910 }); 60911var $author$project$Page$Group$EntriesTab$ClickDelete = function (a) { 60912 return {$: 11, a: a}; 60913}; 60914var $author$project$Page$Group$EntriesTab$ClickEdit = function (a) { 60915 return {$: 9, a: a}; 60916}; 60917var $author$project$Page$Group$EntriesTab$ClickRestore = function (a) { 60918 return {$: 12, a: a}; 60919}; 60920var $author$project$UI$Components$btnSuccess = F2( 60921 function (attrs, config) { 60922 return A2( 60923 $author$project$Ui$row, 60924 A2( 60925 $elm$core$List$cons, 60926 $author$project$Ui$Input$button(config.e7), 60927 A2( 60928 $elm$core$List$cons, 60929 $author$project$Ui$width($author$project$Ui$fill), 60930 A2( 60931 $elm$core$List$cons, 60932 $author$project$Ui$spacing($author$project$UI$Theme$spacing.qk), 60933 A2( 60934 $elm$core$List$cons, 60935 $author$project$Ui$contentCenterX, 60936 A2( 60937 $elm$core$List$cons, 60938 $author$project$Ui$contentCenterY, 60939 A2( 60940 $elm$core$List$cons, 60941 $author$project$Ui$padding($author$project$UI$Theme$spacing.aW), 60942 A2( 60943 $elm$core$List$cons, 60944 $author$project$Ui$rounded($author$project$UI$Theme$radius.aW), 60945 A2( 60946 $elm$core$List$cons, 60947 $author$project$Ui$background($author$project$UI$Theme$success.kl), 60948 A2( 60949 $elm$core$List$cons, 60950 $author$project$Ui$Font$color($author$project$UI$Theme$success.km), 60951 A2( 60952 $elm$core$List$cons, 60953 $author$project$Ui$Font$weight($author$project$UI$Theme$fontWeight.dL), 60954 A2($elm$core$List$cons, $author$project$Ui$pointer, attrs))))))))))), 60955 _List_fromArray( 60956 [ 60957 A2($author$project$UI$Components$featherIcon, 16, config.gv), 60958 $author$project$Ui$text(config.i6) 60959 ])); 60960 }); 60961var $author$project$Translations$entryDetailDeleteButton = function (_v0) { 60962 var lang = _v0; 60963 if (!lang) { 60964 return 'Delete'; 60965 } else { 60966 return 'Supprimer'; 60967 } 60968}; 60969var $author$project$Translations$entryDetailEditButton = function (_v0) { 60970 var lang = _v0; 60971 if (!lang) { 60972 return 'Edit'; 60973 } else { 60974 return 'Modifier'; 60975 } 60976}; 60977var $author$project$Translations$entryDetailRestoreButton = function (_v0) { 60978 var lang = _v0; 60979 if (!lang) { 60980 return 'Restore'; 60981 } else { 60982 return 'Restaurer'; 60983 } 60984}; 60985var $author$project$Page$Group$EntriesTab$defaultButtons = F3( 60986 function (i18n, entryId, isDeleted) { 60987 return A2( 60988 $author$project$Ui$row, 60989 _List_fromArray( 60990 [ 60991 $author$project$Ui$spacing($author$project$UI$Theme$spacing.qk) 60992 ]), 60993 _List_fromArray( 60994 [ 60995 A2( 60996 $author$project$UI$Components$btnOutline, 60997 _List_Nil, 60998 { 60999 gv: $elm$core$Maybe$Just( 61000 A2($author$project$UI$Components$featherIcon, 16, $feathericons$elm_feather$FeatherIcons$edit)), 61001 i6: $author$project$Translations$entryDetailEditButton(i18n), 61002 e7: $author$project$Page$Group$EntriesTab$ClickEdit(entryId) 61003 }), 61004 isDeleted ? A2( 61005 $author$project$UI$Components$btnSuccess, 61006 _List_Nil, 61007 { 61008 gv: $feathericons$elm_feather$FeatherIcons$rotateCcw, 61009 i6: $author$project$Translations$entryDetailRestoreButton(i18n), 61010 e7: $author$project$Page$Group$EntriesTab$ClickRestore(entryId) 61011 }) : A2( 61012 $author$project$UI$Components$btnDanger, 61013 _List_Nil, 61014 { 61015 gv: $feathericons$elm_feather$FeatherIcons$trash2, 61016 i6: $author$project$Translations$entryDetailDeleteButton(i18n), 61017 e7: $author$project$Page$Group$EntriesTab$ClickDelete(entryId) 61018 }) 61019 ])); 61020 }); 61021var $author$project$Translations$entryDeleteConfirm = function (_v0) { 61022 var lang = _v0; 61023 if (!lang) { 61024 return 'Confirm Delete'; 61025 } else { 61026 return 'Confirmer la suppression'; 61027 } 61028}; 61029var $author$project$Translations$entryDeleteWarning = function (_v0) { 61030 var lang = _v0; 61031 if (!lang) { 61032 return 'This will mark the entry as deleted.'; 61033 } else { 61034 return 'Cette écriture sera marquée comme supprimée.'; 61035 } 61036}; 61037var $author$project$Translations$entryRestoreConfirm = function (_v0) { 61038 var lang = _v0; 61039 if (!lang) { 61040 return 'Confirm Restore'; 61041 } else { 61042 return 'Confirmer la restauration'; 61043 } 61044}; 61045var $author$project$Translations$entryRestoreWarning = function (_v0) { 61046 var lang = _v0; 61047 if (!lang) { 61048 return 'This will restore the deleted entry.'; 61049 } else { 61050 return 'Cette écriture sera restaurée.'; 61051 } 61052}; 61053var $author$project$Page$Group$EntriesTab$actionButtons = F4( 61054 function (i18n, entryId, isDeleted, confirmAction) { 61055 if (!confirmAction.$) { 61056 if (!confirmAction.a) { 61057 var _v1 = confirmAction.a; 61058 return A2( 61059 $author$project$Page$Group$EntriesTab$confirmSection, 61060 i18n, 61061 { 61062 fW: $author$project$UI$Theme$danger.kl, 61063 f0: $feathericons$elm_feather$FeatherIcons$trash2, 61064 f1: $author$project$Translations$entryDeleteConfirm(i18n), 61065 hv: $author$project$UI$Theme$danger.km, 61066 hB: $author$project$Translations$entryDeleteWarning(i18n) 61067 }); 61068 } else { 61069 var _v2 = confirmAction.a; 61070 return A2( 61071 $author$project$Page$Group$EntriesTab$confirmSection, 61072 i18n, 61073 { 61074 fW: $author$project$UI$Theme$success.kl, 61075 f0: $feathericons$elm_feather$FeatherIcons$rotateCcw, 61076 f1: $author$project$Translations$entryRestoreConfirm(i18n), 61077 hv: $author$project$UI$Theme$success.km, 61078 hB: $author$project$Translations$entryRestoreWarning(i18n) 61079 }); 61080 } 61081 } else { 61082 return A3($author$project$Page$Group$EntriesTab$defaultButtons, i18n, entryId, isDeleted); 61083 } 61084 }); 61085var $author$project$Page$Group$EntriesTab$attachmentRows = F2( 61086 function (i18n, attachments) { 61087 return $elm$core$List$isEmpty(attachments) ? _List_Nil : _List_fromArray( 61088 [ 61089 A2( 61090 $author$project$Ui$column, 61091 _List_fromArray( 61092 [ 61093 $author$project$Ui$spacing($author$project$UI$Theme$spacing.bb), 61094 $author$project$Ui$width($author$project$Ui$fill) 61095 ]), 61096 A2( 61097 $elm$core$List$cons, 61098 A2( 61099 $author$project$Ui$el, 61100 _List_fromArray( 61101 [ 61102 $author$project$Ui$Font$size($author$project$UI$Theme$font.qk), 61103 $author$project$Ui$Font$color($author$project$UI$Theme$base.aM) 61104 ]), 61105 $author$project$Ui$text( 61106 $author$project$Translations$newEntryAttachmentsLabel(i18n))), 61107 A2( 61108 $elm$core$List$map, 61109 $author$project$UI$Components$linkItem($feathericons$elm_feather$FeatherIcons$paperclip), 61110 attachments))) 61111 ]); 61112 }); 61113var $author$project$Page$Group$EntriesTab$allocationAmounts = F5( 61114 function (i18n, groupCurrency, entryCurrency, amount, maybeEquivalent) { 61115 return A2( 61116 $author$project$Ui$row, 61117 _List_fromArray( 61118 [ 61119 $author$project$Ui$spacing($author$project$UI$Theme$spacing.qk), 61120 $author$project$Ui$width($author$project$Ui$shrink), 61121 $author$project$Ui$alignRight, 61122 $author$project$Ui$contentCenterY 61123 ]), 61124 _List_fromArray( 61125 [ 61126 A2( 61127 $author$project$Ui$el, 61128 _List_fromArray( 61129 [ 61130 $author$project$Ui$Font$size($author$project$UI$Theme$font.aW) 61131 ]), 61132 $author$project$Ui$text( 61133 A3( 61134 $author$project$Format$formatCentsWithCurrency, 61135 $author$project$Translations$currentLanguage(i18n), 61136 amount, 61137 entryCurrency))), 61138 function () { 61139 if (!_Utils_eq(entryCurrency, groupCurrency)) { 61140 if (!maybeEquivalent.$) { 61141 var equivalent = maybeEquivalent.a; 61142 return A2( 61143 $author$project$Ui$el, 61144 _List_fromArray( 61145 [ 61146 $author$project$Ui$Font$size($author$project$UI$Theme$font.qk), 61147 $author$project$Ui$Font$color($author$project$UI$Theme$base.aM) 61148 ]), 61149 $author$project$Ui$text( 61150 'â ' + A3( 61151 $author$project$Format$formatCentsWithCurrency, 61152 $author$project$Translations$currentLanguage(i18n), 61153 equivalent, 61154 groupCurrency))); 61155 } else { 61156 return $author$project$Ui$none; 61157 } 61158 } else { 61159 return $author$project$Ui$none; 61160 } 61161 }() 61162 ])); 61163 }); 61164var $author$project$Translations$entryDetailCurrentUser = function (_v0) { 61165 var lang = _v0; 61166 if (!lang) { 61167 return '(you)'; 61168 } else { 61169 return '(toi)'; 61170 } 61171}; 61172var $author$project$Page$Group$EntriesTab$allocationRow = F2( 61173 function (env, data) { 61174 var isCurrentMember = _Utils_eq( 61175 env.ds, 61176 $elm$core$Maybe$Just(data.e_)); 61177 var memberName = _Utils_ap( 61178 env.bz(data.e_), 61179 isCurrentMember ? (' ' + $author$project$Translations$entryDetailCurrentUser(env.aJ)) : ''); 61180 return A2( 61181 $author$project$Ui$row, 61182 _List_fromArray( 61183 [ 61184 $author$project$Ui$width($author$project$Ui$fill), 61185 $author$project$Ui$spacing($author$project$UI$Theme$spacing.qk), 61186 $author$project$Ui$contentCenterY, 61187 isCurrentMember ? $author$project$Ui$Font$weight($author$project$UI$Theme$fontWeight.lD) : $author$project$Ui$Font$weight($author$project$UI$Theme$fontWeight.nI) 61188 ]), 61189 _List_fromArray( 61190 [ 61191 A2( 61192 $author$project$Ui$row, 61193 _List_fromArray( 61194 [ 61195 $author$project$Ui$width($author$project$Ui$fill), 61196 $author$project$Ui$spacing($author$project$UI$Theme$spacing.qk), 61197 $author$project$Ui$contentCenterY 61198 ]), 61199 _List_fromArray( 61200 [ 61201 A2( 61202 $author$project$Ui$el, 61203 _List_fromArray( 61204 [ 61205 $author$project$Ui$width($author$project$Ui$fill), 61206 $author$project$Ui$Font$size($author$project$UI$Theme$font.aW) 61207 ]), 61208 $author$project$Ui$text(memberName)), 61209 function () { 61210 var _v0 = data.io; 61211 if (!_v0.$) { 61212 var rowDetail = _v0.a; 61213 return A2( 61214 $author$project$Ui$el, 61215 _List_fromArray( 61216 [ 61217 $author$project$Ui$width($author$project$Ui$shrink), 61218 $author$project$Ui$Font$size($author$project$UI$Theme$font.qk), 61219 $author$project$Ui$Font$color($author$project$UI$Theme$base.aM) 61220 ]), 61221 $author$project$Ui$text(rowDetail)); 61222 } else { 61223 return $author$project$Ui$none; 61224 } 61225 }() 61226 ])), 61227 function () { 61228 var _v1 = data.ef; 61229 if (!_v1.$) { 61230 var amount = _v1.a; 61231 return A5($author$project$Page$Group$EntriesTab$allocationAmounts, env.aJ, env.mS, data.bg, amount, data.eI); 61232 } else { 61233 return $author$project$Ui$none; 61234 } 61235 }() 61236 ])); 61237 }); 61238var $author$project$Page$Group$EntriesTab$allocationSection = F3( 61239 function (label, maybeDetail, rows) { 61240 return A2( 61241 $author$project$Ui$column, 61242 _List_fromArray( 61243 [ 61244 $author$project$Ui$spacing($author$project$UI$Theme$spacing.qk), 61245 $author$project$Ui$width($author$project$Ui$fill) 61246 ]), 61247 _List_fromArray( 61248 [ 61249 A2( 61250 $author$project$Ui$column, 61251 _List_fromArray( 61252 [ 61253 $author$project$Ui$spacing($author$project$UI$Theme$spacing.bb), 61254 $author$project$Ui$width($author$project$Ui$fill) 61255 ]), 61256 _List_fromArray( 61257 [ 61258 A2( 61259 $author$project$Ui$el, 61260 _List_fromArray( 61261 [ 61262 $author$project$Ui$Font$size($author$project$UI$Theme$font.qk), 61263 $author$project$Ui$Font$color($author$project$UI$Theme$base.aM) 61264 ]), 61265 $author$project$Ui$text(label)), 61266 function () { 61267 if (!maybeDetail.$) { 61268 var sectionDetail = maybeDetail.a; 61269 return A2( 61270 $author$project$Ui$el, 61271 _List_fromArray( 61272 [ 61273 $author$project$Ui$Font$size($author$project$UI$Theme$font.bb), 61274 $author$project$Ui$Font$color($author$project$UI$Theme$base.aM) 61275 ]), 61276 $author$project$Ui$text(sectionDetail)); 61277 } else { 61278 return $author$project$Ui$none; 61279 } 61280 }() 61281 ])), 61282 A2( 61283 $author$project$Ui$column, 61284 _List_fromArray( 61285 [ 61286 $author$project$Ui$spacing($author$project$UI$Theme$spacing.qk), 61287 $author$project$Ui$width($author$project$Ui$fill) 61288 ]), 61289 rows) 61290 ])); 61291 }); 61292var $author$project$Translations$entryDetailSplitEqual = F2( 61293 function (count, _v0) { 61294 var lang = _v0; 61295 if (!lang) { 61296 return 'Equal split · ' + function () { 61297 if (count === '1') { 61298 return count + ' share'; 61299 } else { 61300 return count + ' shares'; 61301 } 61302 }(); 61303 } else { 61304 return 'Partage égal · ' + function () { 61305 switch (count) { 61306 case '0': 61307 return count + ' part'; 61308 case '1': 61309 return count + ' part'; 61310 default: 61311 return count + ' parts'; 61312 } 61313 }(); 61314 } 61315 }); 61316var $author$project$Translations$entryDetailSplitShares = F2( 61317 function (count, _v0) { 61318 var lang = _v0; 61319 if (!lang) { 61320 return 'By shares · ' + function () { 61321 if (count === '1') { 61322 return count + ' share'; 61323 } else { 61324 return count + ' shares'; 61325 } 61326 }(); 61327 } else { 61328 return 'Par parts · ' + function () { 61329 switch (count) { 61330 case '0': 61331 return count + ' part'; 61332 case '1': 61333 return count + ' part'; 61334 default: 61335 return count + ' parts'; 61336 } 61337 }(); 61338 } 61339 }); 61340var $author$project$Page$Group$EntriesTab$beneficiarySplitLabel = F2( 61341 function (i18n, beneficiaries) { 61342 if (beneficiaries.b) { 61343 if (!beneficiaries.a.$) { 61344 var first = beneficiaries.a.a; 61345 var rest = beneficiaries.b; 61346 var shares = A2( 61347 $elm$core$List$cons, 61348 first.qc, 61349 A2( 61350 $elm$core$List$filterMap, 61351 function (beneficiary) { 61352 if (!beneficiary.$) { 61353 var data = beneficiary.a; 61354 return $elm$core$Maybe$Just(data.qc); 61355 } else { 61356 return $elm$core$Maybe$Nothing; 61357 } 61358 }, 61359 rest)); 61360 var count = $elm$core$String$fromInt(
61361 $elm$core$List$sum(shares)); 61362 return A2( 61363 $elm$core$List$all, 61364 $elm$core$Basics$eq(first.qc), 61365 shares) ? A2($author$project$Translations$entryDetailSplitEqual, count, i18n) : A2($author$project$Translations$entryDetailSplitShares, count, i18n); 61366 } else { 61367 return $author$project$Translations$newEntrySplitExact(i18n); 61368 } 61369 } else { 61370 return ''; 61371 } 61372 }); 61373var $author$project$Page$Group$EntriesTab$beneficiariesSection = F2( 61374 function (env, data) { 61375 var equivalentAmounts = _Utils_eq(data.bg, env.mS) ? $elm$core$Dict$empty : A2( 61376 $elm$core$Maybe$withDefault, 61377 $elm$core$Dict$empty, 61378 A2( 61379 $elm$core$Maybe$map, 61380 function (amount) { 61381 return $elm$core$Dict$fromList( 61382 A2($author$project$Domain$Balance$computeBeneficiarySplit, amount, data.em)); 61383 }, 61384 data.ck)); 61385 var amounts = $elm$core$Dict$fromList( 61386 A2($author$project$Domain$Balance$computeBeneficiarySplit, data.ef, data.em)); 61387 var beneficiaryRow = function (beneficiary) { 61388 if (!beneficiary.$) { 61389 var beneficiaryData = beneficiary.a; 61390 return A2( 61391 $author$project$Page$Group$EntriesTab$allocationRow, 61392 env, 61393 { 61394 ef: $elm$core$Maybe$Just( 61395 A2( 61396 $elm$core$Maybe$withDefault, 61397 0, 61398 A2($elm$core$Dict$get, beneficiaryData.e_, amounts))), 61399 bg: data.bg, 61400 io: $elm$core$Maybe$Just( 61401 'Ã' + $elm$core$String$fromInt(beneficiaryData.qc)), 61402 eI: A2($elm$core$Dict$get, beneficiaryData.e_, equivalentAmounts), 61403 e_: beneficiaryData.e_ 61404 }); 61405 } else { 61406 var beneficiaryData = beneficiary.a; 61407 return A2( 61408 $author$project$Page$Group$EntriesTab$allocationRow, 61409 env, 61410 { 61411 ef: $elm$core$Maybe$Just( 61412 A2( 61413 $elm$core$Maybe$withDefault, 61414 0, 61415 A2($elm$core$Dict$get, beneficiaryData.e_, amounts))), 61416 bg: data.bg, 61417 io: $elm$core$Maybe$Nothing, 61418 eI: A2($elm$core$Dict$get, beneficiaryData.e_, equivalentAmounts), 61419 e_: beneficiaryData.e_ 61420 }); 61421 } 61422 }; 61423 return A3( 61424 $author$project$Page$Group$EntriesTab$allocationSection, 61425 $author$project$Translations$entryDetailSplitAmong(env.aJ), 61426 $elm$core$Maybe$Just( 61427 A2($author$project$Page$Group$EntriesTab$beneficiarySplitLabel, env.aJ, data.em)), 61428 A2($elm$core$List$map, beneficiaryRow, data.em)); 61429 }); 61430var $author$project$Page$Group$EntriesTab$inlineDetailRow = F2( 61431 function (label, value) { 61432 return A2( 61433 $author$project$Ui$row, 61434 _List_fromArray( 61435 [ 61436 $author$project$Ui$width($author$project$Ui$fill), 61437 $author$project$Ui$spacing($author$project$UI$Theme$spacing.qk), 61438 $author$project$Ui$contentCenterY 61439 ]), 61440 _List_fromArray( 61441 [ 61442 A2( 61443 $author$project$Ui$el, 61444 _List_fromArray( 61445 [ 61446 $author$project$Ui$width($author$project$Ui$fill), 61447 $author$project$Ui$Font$size($author$project$UI$Theme$font.qk), 61448 $author$project$Ui$Font$color($author$project$UI$Theme$base.aM) 61449 ]), 61450 $author$project$Ui$text(label)), 61451 A2( 61452 $author$project$Ui$el, 61453 _List_fromArray( 61454 [ 61455 $author$project$Ui$width($author$project$Ui$shrink), 61456 $author$project$Ui$Font$size($author$project$UI$Theme$font.aW), 61457 $author$project$Ui$Font$weight($author$project$UI$Theme$fontWeight.nI) 61458 ]), 61459 $author$project$Ui$text(value)) 61460 ])); 61461 }); 61462var $author$project$Page$Group$EntriesTab$defaultCurrencyAmountRow = F4( 61463 function (i18n, groupDefaultCurrency, entryCurrency, maybeAmount) { 61464 if (_Utils_eq(entryCurrency, groupDefaultCurrency)) { 61465 return _List_Nil; 61466 } else { 61467 if (!maybeAmount.$) { 61468 var amount = maybeAmount.a; 61469 return _List_fromArray( 61470 [ 61471 A2( 61472 $author$project$Page$Group$EntriesTab$inlineDetailRow, 61473 A2( 61474 $author$project$Translations$newEntryDefaultCurrencyAmountLabel, 61475 $author$project$Domain$Currency$currencyCode(groupDefaultCurrency), 61476 i18n), 61477 'â ' + A3( 61478 $author$project$Format$formatCentsWithCurrency, 61479 $author$project$Translations$currentLanguage(i18n), 61480 amount, 61481 groupDefaultCurrency)) 61482 ]); 61483 } else { 61484 return _List_Nil; 61485 } 61486 } 61487 }); 61488var $elm$core$List$intersperse = F2( 61489 function (sep, xs) { 61490 if (!xs.b) { 61491 return _List_Nil; 61492 } else { 61493 var hd = xs.a; 61494 var tl = xs.b; 61495 var step = F2( 61496 function (x, rest) { 61497 return A2( 61498 $elm$core$List$cons, 61499 sep, 61500 A2($elm$core$List$cons, x, rest)); 61501 }); 61502 var spersed = A3($elm$core$List$foldr, step, _List_Nil, tl); 61503 return A2($elm$core$List$cons, hd, spersed); 61504 } 61505 }); 61506var $author$project$Page$Group$EntriesTab$detailRow = F2( 61507 function (label, value) { 61508 return A2( 61509 $author$project$Ui$column, 61510 _List_fromArray( 61511 [ 61512 $author$project$Ui$spacing($author$project$UI$Theme$spacing.bb), 61513 $author$project$Ui$width($author$project$Ui$fill) 61514 ]), 61515 _List_fromArray( 61516 [ 61517 A2( 61518 $author$project$Ui$el, 61519 _List_fromArray( 61520 [ 61521 $author$project$Ui$Font$size($author$project$UI$Theme$font.qk), 61522 $author$project$Ui$Font$color($author$project$UI$Theme$base.aM) 61523 ]), 61524 $author$project$Ui$text(label)), 61525 A2( 61526 $author$project$Ui$el, 61527 _List_fromArray( 61528 [ 61529 $author$project$Ui$Font$size($author$project$UI$Theme$font.aW), 61530 $author$project$Ui$Font$weight($author$project$UI$Theme$fontWeight.nI) 61531 ]), 61532 $author$project$Ui$text(value)) 61533 ])); 61534 }); 61535var $author$project$Page$Group$EntriesTab$optionalRow = F2( 61536 function (label, maybeValue) { 61537 if (!maybeValue.$) { 61538 var value = maybeValue.a; 61539 return _List_fromArray( 61540 [ 61541 A2($author$project$Page$Group$EntriesTab$detailRow, label, value) 61542 ]); 61543 } else { 61544 return _List_Nil; 61545 } 61546 }); 61547var $author$project$Page$Group$EntriesTab$payersSection = F2( 61548 function (env, data) { 61549 var showAmounts = $elm$core$List$length(data.jB) > 1; 61550 var equivalentAmounts = ((!showAmounts) || _Utils_eq(data.bg, env.mS)) ? $elm$core$Dict$empty : A2( 61551 $elm$core$Maybe$withDefault, 61552 $elm$core$Dict$empty, 61553 A2( 61554 $elm$core$Maybe$map, 61555 function (amount) { 61556 return $elm$core$Dict$fromList( 61557 A2($author$project$Domain$Balance$computePayerSplit, amount, data.jB)); 61558 }, 61559 data.ck)); 61560 var payerRow = function (payer) { 61561 return A2( 61562 $author$project$Page$Group$EntriesTab$allocationRow, 61563 env, 61564 { 61565 ef: showAmounts ? $elm$core$Maybe$Just(payer.ef) : $elm$core$Maybe$Nothing, 61566 bg: data.bg, 61567 io: $elm$core$Maybe$Nothing, 61568 eI: A2($elm$core$Dict$get, payer.e_, equivalentAmounts), 61569 e_: payer.e_ 61570 }); 61571 }; 61572 return A3( 61573 $author$project$Page$Group$EntriesTab$allocationSection, 61574 $author$project$Translations$entryDetailPaidBy(env.aJ), 61575 $elm$core$Maybe$Nothing, 61576 A2($elm$core$List$map, payerRow, data.jB)); 61577 }); 61578var $author$project$Page$Group$EntriesTab$expenseContent = F2( 61579 function (env, data) { 61580 var metadataRows = $elm$core$List$concat( 61581 _List_fromArray( 61582 [ 61583 A2( 61584 $author$project$Page$Group$EntriesTab$optionalRow, 61585 $author$project$Translations$entryDetailLocation(env.aJ), 61586 data.je), 61587 A2( 61588 $author$project$Page$Group$EntriesTab$optionalRow, 61589 $author$project$Translations$entryDetailNotes(env.aJ), 61590 data.bu), 61591 A2($author$project$Page$Group$EntriesTab$attachmentRows, env.aJ, data.ce) 61592 ])); 61593 var metadataSection = $elm$core$List$isEmpty(metadataRows) ? _List_Nil : _List_fromArray( 61594 [ 61595 A2( 61596 $author$project$Ui$column, 61597 _List_fromArray( 61598 [ 61599 $author$project$Ui$spacing($author$project$UI$Theme$spacing.aW), 61600 $author$project$Ui$width($author$project$Ui$fill) 61601 ]), 61602 metadataRows) 61603 ]); 61604 var sections = $elm$core$List$concat( 61605 _List_fromArray( 61606 [ 61607 A4($author$project$Page$Group$EntriesTab$defaultCurrencyAmountRow, env.aJ, env.mS, data.bg, data.ck), 61608 _List_fromArray( 61609 [ 61610 A2($author$project$Page$Group$EntriesTab$payersSection, env, data), 61611 A2($author$project$Page$Group$EntriesTab$beneficiariesSection, env, data) 61612 ]), 61613 metadataSection 61614 ])); 61615 return A2( 61616 $author$project$Ui$column, 61617 _List_fromArray( 61618 [ 61619 $author$project$Ui$spacing($author$project$UI$Theme$spacing.aW), 61620 $author$project$Ui$width($author$project$Ui$fill) 61621 ]), 61622 A2($elm$core$List$intersperse, $author$project$UI$Components$horizontalSeparator, sections)); 61623 }); 61624var $author$project$Page$Group$EntriesTab$incomeContent = F2( 61625 function (env, data) { 61626 return A2( 61627 $author$project$Ui$column, 61628 _List_fromArray( 61629 [ 61630 $author$project$Ui$spacing($author$project$UI$Theme$spacing.aW), 61631 $author$project$Ui$width($author$project$Ui$fill) 61632 ]), 61633 $elm$core$List$concat( 61634 _List_fromArray( 61635 [ 61636 _List_fromArray( 61637 [ 61638 A2( 61639 $author$project$Page$Group$EntriesTab$detailRow, 61640 $author$project$Translations$newEntryDescriptionLabel(env.aJ), 61641 data.eE), 61642 A2( 61643 $author$project$Page$Group$EntriesTab$detailRow, 61644 $author$project$Translations$entryDetailDate(env.aJ), 61645 $author$project$Domain$Date$toString(data.cj)), 61646 A2( 61647 $author$project$Page$Group$EntriesTab$detailRow, 61648 $author$project$Translations$newEntryAmountLabel(env.aJ), 61649 A3( 61650 $author$project$Format$formatCentsWithCurrency, 61651 $author$project$Translations$currentLanguage(env.aJ), 61652 data.ef, 61653 data.bg)) 61654 ]), 61655 A4($author$project$Page$Group$EntriesTab$defaultCurrencyAmountRow, env.aJ, env.mS, data.bg, data.ck), 61656 _List_fromArray( 61657 [ 61658 A2( 61659 $author$project$Page$Group$EntriesTab$detailRow, 61660 $author$project$Translations$entryDetailReceivedBy(env.aJ), 61661 env.bz(data.j$)), 61662 A2($author$project$Page$Group$EntriesTab$beneficiariesSection, env, data) 61663 ]), 61664 A2( 61665 $author$project$Page$Group$EntriesTab$optionalRow, 61666 $author$project$Translations$entryDetailNotes(env.aJ), 61667 data.bu), 61668 A2($author$project$Page$Group$EntriesTab$attachmentRows, env.aJ, data.ce) 61669 ]))); 61670 }); 61671var $author$project$Page$Group$EntriesTab$transferContent = F4( 61672 function (i18n, groupDefaultCurrency, resolveName, data) { 61673 return A2( 61674 $author$project$Ui$column, 61675 _List_fromArray( 61676 [ 61677 $author$project$Ui$spacing($author$project$UI$Theme$spacing.aW), 61678 $author$project$Ui$width($author$project$Ui$fill) 61679 ]), 61680 $elm$core$List$concat( 61681 _List_fromArray( 61682 [ 61683 A2( 61684 $author$project$Page$Group$EntriesTab$optionalRow, 61685 $author$project$Translations$newEntryDescriptionLabel(i18n), 61686 data.eE), 61687 _List_fromArray( 61688 [ 61689 A2( 61690 $author$project$Page$Group$EntriesTab$detailRow, 61691 $author$project$Translations$entryDetailDate(i18n), 61692 $author$project$Domain$Date$toString(data.cj)), 61693 A2( 61694 $author$project$Page$Group$EntriesTab$detailRow, 61695 $author$project$Translations$newEntryAmountLabel(i18n), 61696 A3( 61697 $author$project$Format$formatCentsWithCurrency, 61698 $author$project$Translations$currentLanguage(i18n), 61699 data.ef, 61700 data.bg)) 61701 ]), 61702 A4($author$project$Page$Group$EntriesTab$defaultCurrencyAmountRow, i18n, groupDefaultCurrency, data.bg, data.ck), 61703 _List_fromArray( 61704 [ 61705 A2( 61706 $author$project$Page$Group$EntriesTab$detailRow, 61707 $author$project$Translations$entryDetailFrom(i18n),
61708 resolveName(data.iH)), 61709 A2( 61710 $author$project$Page$Group$EntriesTab$detailRow, 61711 $author$project$Translations$entryDetailTo(i18n), 61712 resolveName(data.kE)) 61713 ]), 61714 A2( 61715 $author$project$Page$Group$EntriesTab$optionalRow, 61716 $author$project$Translations$entryDetailNotes(i18n), 61717 data.bu), 61718 A2($author$project$Page$Group$EntriesTab$attachmentRows, i18n, data.ce) 61719 ]))); 61720 }); 61721var $author$project$Page$Group$EntriesTab$entryContent = F2( 61722 function (env, entry) { 61723 var _v0 = entry.gE; 61724 switch (_v0.$) { 61725 case 0: 61726 var data = _v0.a; 61727 return A2($author$project$Page$Group$EntriesTab$expenseContent, env, data); 61728 case 1: 61729 var data = _v0.a; 61730 return A4($author$project$Page$Group$EntriesTab$transferContent, env.aJ, env.mS, env.bz, data); 61731 default: 61732 var data = _v0.a; 61733 return A2($author$project$Page$Group$EntriesTab$incomeContent, env, data); 61734 } 61735 }); 61736var $author$project$Page$Group$EntriesTab$ClickDuplicate = function (a) { 61737 return {$: 10, a: a}; 61738}; 61739var $feathericons$elm_feather$FeatherIcons$link = A2( 61740 $feathericons$elm_feather$FeatherIcons$makeBuilder, 61741 'link', 61742 _List_fromArray( 61743 [ 61744 A2( 61745 $elm$svg$Svg$path, 61746 _List_fromArray( 61747 [ 61748 $elm$svg$Svg$Attributes$d('M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71') 61749 ]), 61750 _List_Nil), 61751 A2( 61752 $elm$svg$Svg$path, 61753 _List_fromArray( 61754 [ 61755 $elm$svg$Svg$Attributes$d('M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71') 61756 ]), 61757 _List_Nil) 61758 ])); 61759var $author$project$Page$Group$EntriesTab$secondaryActionAttrs = _List_fromArray( 61760 [ 61761 $author$project$Ui$width($author$project$Ui$fill), 61762 $author$project$Ui$spacing($author$project$UI$Theme$spacing.qk), 61763 $author$project$Ui$contentCenterX, 61764 $author$project$Ui$contentCenterY, 61765 $author$project$Ui$padding($author$project$UI$Theme$spacing.qk), 61766 $author$project$Ui$Font$size($author$project$UI$Theme$font.qk), 61767 $author$project$Ui$Font$weight($author$project$UI$Theme$fontWeight.nI), 61768 $author$project$Ui$Font$color($author$project$UI$Theme$base.aM), 61769 $author$project$Ui$pointer 61770 ]); 61771var $author$project$Page$Group$EntriesTab$copyLinkBtn = F2( 61772 function (copyText, label) { 61773 return A2( 61774 $author$project$Ui$row, 61775 A2( 61776 $elm$core$List$cons, 61777 $author$project$Ui$inFront( 61778 $author$project$Ui$html( 61779 A3( 61780 $elm$html$Html$node, 61781 'copy-button', 61782 _List_fromArray( 61783 [ 61784 A2($elm$html$Html$Attributes$attribute, 'data-copy', copyText), 61785 A2($elm$html$Html$Attributes$style, 'display', 'block'), 61786 A2($elm$html$Html$Attributes$style, 'width', '100%'), 61787 A2($elm$html$Html$Attributes$style, 'height', '100%'), 61788 A2($elm$html$Html$Attributes$style, 'cursor', 'pointer') 61789 ]), 61790 _List_Nil))), 61791 $author$project$Page$Group$EntriesTab$secondaryActionAttrs), 61792 _List_fromArray( 61793 [ 61794 A2($author$project$UI$Components$featherIcon, 16, $feathericons$elm_feather$FeatherIcons$link), 61795 $author$project$Ui$text(label) 61796 ])); 61797 }); 61798var $author$project$Translations$entryDetailCopyLink = function (_v0) { 61799 var lang = _v0; 61800 if (!lang) { 61801 return 'Copy link'; 61802 } else { 61803 return 'Copier le lien'; 61804 } 61805}; 61806var $author$project$Translations$entryDetailDuplicateButton = function (_v0) { 61807 var lang = _v0; 61808 if (!lang) { 61809 return 'Duplicate'; 61810 } else { 61811 return 'Dupliquer'; 61812 } 61813}; 61814var $author$project$Page$Group$EntriesTab$secondaryActionButtons = F3( 61815 function (i18n, linkHref, entryId) { 61816 return A2( 61817 $author$project$Ui$row, 61818 _List_fromArray( 61819 [ 61820 $author$project$Ui$width($author$project$Ui$fill), 61821 $author$project$Ui$spacing($author$project$UI$Theme$spacing.qk) 61822 ]), 61823 _List_fromArray( 61824 [ 61825 A2( 61826 $author$project$Page$Group$EntriesTab$copyLinkBtn, 61827 linkHref, 61828 $author$project$Translations$entryDetailCopyLink(i18n)), 61829 A2( 61830 $author$project$Ui$row, 61831 A2( 61832 $elm$core$List$cons, 61833 $author$project$Ui$Input$button( 61834 $author$project$Page$Group$EntriesTab$ClickDuplicate(entryId)), 61835 $author$project$Page$Group$EntriesTab$secondaryActionAttrs), 61836 _List_fromArray( 61837 [ 61838 A2($author$project$UI$Components$featherIcon, 16, $feathericons$elm_feather$FeatherIcons$copy), 61839 $author$project$Ui$text( 61840 $author$project$Translations$entryDetailDuplicateButton(i18n)) 61841 ])) 61842 ])); 61843 }); 61844var $author$project$Page$Group$EntriesTab$entryDetail = F5( 61845 function (env, linkHref, entryId, entry, isDeleted) { 61846 var memberActions = function () { 61847 var _v0 = env.ds; 61848 if (!_v0.$) { 61849 return _List_fromArray( 61850 [ 61851 $author$project$UI$Components$horizontalSeparator, 61852 A3($author$project$Page$Group$EntriesTab$secondaryActionButtons, env.aJ, linkHref, entryId), 61853 $author$project$UI$Components$horizontalSeparator, 61854 A4( 61855 $author$project$Page$Group$EntriesTab$actionButtons, 61856 env.aJ, 61857 entryId, 61858 isDeleted, 61859 function () { 61860 var _v1 = env.X; 61861 if (!_v1.$) { 61862 var _v2 = _v1.a; 61863 var id = _v2.a; 61864 var action = _v2.b; 61865 return _Utils_eq(id, entryId) ? $elm$core$Maybe$Just(action) : $elm$core$Maybe$Nothing; 61866 } else { 61867 return $elm$core$Maybe$Nothing; 61868 } 61869 }()) 61870 ]); 61871 } else { 61872 return _List_Nil; 61873 } 61874 }(); 61875 return A2( 61876 $author$project$Ui$column, 61877 _List_fromArray( 61878 [ 61879 $author$project$Ui$paddingTop($author$project$UI$Theme$spacing.aW), 61880 $author$project$Ui$spacing($author$project$UI$Theme$spacing.aW) 61881 ]), 61882 A2( 61883 $elm$core$List$cons, 61884 A2($author$project$Page$Group$EntriesTab$entryContent, env, entry), 61885 memberActions)); 61886 }); 61887var $author$project$Page$Group$EntriesTab$entryDomId = function (entryId) { 61888 return 'entry-' + entryId; 61889}; 61890var $author$project$Page$Group$EntriesTab$entryTag = function (label) { 61891 return A2( 61892 $author$project$Ui$el, 61893 _List_fromArray( 61894 [ 61895 $author$project$Ui$Font$size($author$project$UI$Theme$font.bb), 61896 $author$project$Ui$Font$weight($author$project$UI$Theme$fontWeight.dL), 61897 A2($author$project$Ui$paddingXY, $author$project$UI$Theme$spacing.qk, $author$project$UI$Theme$spacing.bb),
61898 $author$project$Ui$rounded($author$project$UI$Theme$radius.aW), 61899 $author$project$Ui$background($author$project$UI$Theme$base.qR), 61900 $author$project$Ui$Font$color($author$project$UI$Theme$base.aM), 61901 $author$project$Ui$width($author$project$Ui$shrink) 61902 ]), 61903 $author$project$Ui$text(label)); 61904}; 61905var $author$project$Translations$monthShortApr = function (_v0) { 61906 var lang = _v0; 61907 if (!lang) { 61908 return 'Apr'; 61909 } else { 61910 return 'avr.'; 61911 } 61912}; 61913var $author$project$Translations$monthShortAug = function (_v0) { 61914 var lang = _v0; 61915 if (!lang) { 61916 return 'Aug'; 61917 } else { 61918 return 'août'; 61919 } 61920}; 61921var $author$project$Translations$monthShortDec = function (_v0) { 61922 var lang = _v0; 61923 if (!lang) { 61924 return 'Dec'; 61925 } else { 61926 return 'déc.'; 61927 } 61928}; 61929var $author$project$Translations$monthShortFeb = function (_v0) { 61930 var lang = _v0; 61931 if (!lang) { 61932 return 'Feb'; 61933 } else { 61934 return 'févr.'; 61935 } 61936}; 61937var $author$project$Translations$monthShortJan = function (_v0) { 61938 var lang = _v0; 61939 if (!lang) { 61940 return 'Jan'; 61941 } else { 61942 return 'janv.'; 61943 } 61944}; 61945var $author$project$Translations$monthShortJul = function (_v0) { 61946 var lang = _v0; 61947 if (!lang) { 61948 return 'Jul'; 61949 } else { 61950 return 'juil.'; 61951 } 61952}; 61953var $author$project$Translations$monthShortJun = function (_v0) { 61954 var lang = _v0; 61955 if (!lang) { 61956 return 'Jun'; 61957 } else { 61958 return 'juin'; 61959 } 61960}; 61961var $author$project$Translations$monthShortMar = function (_v0) { 61962 var lang = _v0; 61963 if (!lang) { 61964 return 'Mar'; 61965 } else { 61966 return 'mars'; 61967 } 61968}; 61969var $author$project$Translations$monthShortMay = function (_v0) { 61970 var lang = _v0; 61971 if (!lang) { 61972 return 'May'; 61973 } else { 61974 return 'mai'; 61975 } 61976}; 61977var $author$project$Translations$monthShortNov = function (_v0) { 61978 var lang = _v0; 61979 if (!lang) { 61980 return 'Nov'; 61981 } else { 61982 return 'nov.'; 61983 } 61984}; 61985var $author$project$Translations$monthShortOct = function (_v0) { 61986 var lang = _v0; 61987 if (!lang) { 61988 return 'Oct'; 61989 } else { 61990 return 'oct.'; 61991 } 61992}; 61993var $author$project$Translations$monthShortSep = function (_v0) { 61994 var lang = _v0; 61995 if (!lang) { 61996 return 'Sep'; 61997 } else { 61998 return 'sept.'; 61999 } 62000}; 62001var $author$project$Page$Group$EntriesTab$shortMonthName = F2( 62002 function (i18n, m) { 62003 switch (m) { 62004 case 1: 62005 return $author$project$Translations$monthShortJan(i18n); 62006 case 2: 62007 return $author$project$Translations$monthShortFeb(i18n); 62008 case 3: 62009 return $author$project$Translations$monthShortMar(i18n); 62010 case 4: 62011 return $author$project$Translations$monthShortApr(i18n); 62012 case 5: 62013 return $author$project$Translations$monthShortMay(i18n); 62014 case 6: 62015 return $author$project$Translations$monthShortJun(i18n); 62016 case 7: 62017 return $author$project$Translations$monthShortJul(i18n); 62018 case 8: 62019 return $author$project$Translations$monthShortAug(i18n); 62020 case 9: 62021 return $author$project$Translations$monthShortSep(i18n); 62022 case 10: 62023 return $author$project$Translations$monthShortOct(i18n); 62024 case 11: 62025 return $author$project$Translations$monthShortNov(i18n); 62026 case 12: 62027 return $author$project$Translations$monthShortDec(i18n); 62028 default: 62029 return ''; 62030 } 62031 }); 62032var $author$project$Page$Group$EntriesTab$formatShortDate = F2( 62033 function (i18n, date) { 62034 return A2($author$project$Page$Group$EntriesTab$shortMonthName, i18n, date.F) + (' ' + $elm$core$String$fromInt(date.y)); 62035 }); 62036var $author$project$Page$Group$EntriesTab$payerText = F2( 62037 function (resolveName, payers) { 62038 if (!payers.b) { 62039 return ''; 62040 } else { 62041 if (!payers.b.b) { 62042 var single = payers.a; 62043 return resolveName(single.e_); 62044 } else { 62045 var multiple = payers; 62046 return A2( 62047 $elm$core$String$join, 62048 ', ', 62049 A2( 62050 $elm$core$List$map, 62051 A2( 62052 $elm$core$Basics$composeR, 62053 function ($) { 62054 return $.e_; 62055 }, 62056 resolveName), 62057 multiple)); 62058 } 62059 } 62060 }); 62061var $author$project$Page$Group$EntriesTab$recipientText = F2( 62062 function (resolveName, beneficiaries) { 62063 if (!beneficiaries.b) { 62064 return ''; 62065 } else { 62066 if (!beneficiaries.b.b) { 62067 var single = beneficiaries.a; 62068 if (!single.$) { 62069 var memberId = single.a.e_; 62070 return resolveName(memberId); 62071 } else { 62072 var memberId = single.a.e_; 62073 return resolveName(memberId); 62074 } 62075 } else { 62076 var names = A2( 62077 $elm$core$List$map, 62078 function (b) { 62079 if (!b.$) { 62080 var memberId = b.a.e_; 62081 return resolveName(memberId); 62082 } else { 62083 var memberId = b.a.e_; 62084 return resolveName(memberId); 62085 } 62086 }, 62087 beneficiaries); 62088 if (names.b) { 62089 var first = names.a; 62090 var rest = names.b; 62091 return first + (' +' + $elm$core$String$fromInt( 62092 $elm$core$List$length(rest))); 62093 } else { 62094 return ''; 62095 } 62096 } 62097 } 62098 }); 62099var $author$project$Page$Group$EntriesTab$expenseCardHeader = F3( 62100 function (i18n, resolveName, data) { 62101 return A2( 62102 $author$project$Ui$column, 62103 _List_fromArray( 62104 [ 62105 $author$project$Ui$width($author$project$Ui$fill) 62106 ]), 62107 _List_fromArray( 62108 [ 62109 A2( 62110 $author$project$Ui$row, 62111 _List_fromArray( 62112 [ 62113 $author$project$Ui$width($author$project$Ui$fill) 62114 ]), 62115 _List_fromArray( 62116 [ 62117 A2( 62118 $author$project$Ui$el, 62119 _List_fromArray( 62120 [ 62121 $author$project$Ui$Font$weight($author$project$UI$Theme$fontWeight.dL), 62122 $author$project$Ui$Font$size($author$project$UI$Theme$font.aW) 62123 ]), 62124 $author$project$Ui$text(data.eE)), 62125 A2( 62126 $author$project$Ui$el, 62127 _List_fromArray( 62128 [ 62129 $author$project$Ui$alignRight, 62130 $author$project$Ui$Font$weight($author$project$UI$Theme$fontWeight.lD), 62131 $author$project$Ui$Font$size($author$project$UI$Theme$font.aW), 62132 $author$project$Ui$Font$letterSpacing($author$project$UI$Theme$letterSpacing.qP) 62133 ]), 62134 $author$project$Ui$text( 62135 A3( 62136 $author$project$Format$formatCentsWithCurrency, 62137 $author$project$Translations$currentLanguage(i18n), 62138 data.ef, 62139 data.bg))) 62140 ])), 62141 A2( 62142 $author$project$Ui$row, 62143 _List_fromArray( 62144 [ 62145 $author$project$Ui$spacing($author$project$UI$Theme$spacing.bb), 62146 $author$project$Ui$paddingTop($author$project$UI$Theme$spacing.bb), 62147 $author$project$Ui$contentCenterY, 62148 $author$project$Ui$Font$size($author$project$UI$Theme$font.qk), 62149 $author$project$Ui$Font$color($author$project$UI$Theme$base.aM) 62150 ]), 62151 _List_fromArray( 62152 [ 62153 A2( 62154 $author$project$Ui$el, 62155 _List_fromArray( 62156 [ 62157 $author$project$Ui$width($author$project$Ui$shrink) 62158 ]), 62159 $author$project$Ui$text( 62160 A2($author$project$Page$Group$EntriesTab$formatShortDate, i18n, data.cj))), 62161 function () { 62162 var _v0 = data.h9; 62163 if (!_v0.$) { 62164 var cat = _v0.a; 62165 return $author$project$Page$Group$EntriesTab$entryTag( 62166 A2($author$project$UI$Categories$labelWithEmoji, i18n, cat)); 62167 } else { 62168 return $author$project$Ui$none; 62169 } 62170 }(), 62171 A2( 62172 $author$project$Ui$row, 62173 _List_fromArray( 62174 [ 62175 $author$project$Ui$spacing($author$project$UI$Theme$spacing.bb), 62176 $author$project$Ui$width($author$project$Ui$shrink), 62177 $author$project$Ui$contentCenterY, 62178 $author$project$Ui$alignRight 62179 ]), 62180 _List_fromArray( 62181 [ 62182 $author$project$Ui$text( 62183 A2($author$project$Page$Group$EntriesTab$payerText, resolveName, data.jB)), 62184 A2( 62185 $author$project$Ui$el, 62186 _List_fromArray( 62187 [ 62188 $author$project$Ui$Font$color($author$project$UI$Theme$base.aM) 62189 ]), 62190 $author$project$Ui$text('â')), 62191 $author$project$Ui$text( 62192 A2($author$project$Page$Group$EntriesTab$recipientText, resolveName, data.em)) 62193 ])) 62194 ])) 62195 ])); 62196 }); 62197var $author$project$Page$Group$EntriesTab$incomeCardHeader = F3( 62198 function (i18n, resolveName, data) { 62199 return A2( 62200 $author$project$Ui$column, 62201 _List_fromArray( 62202 [ 62203 $author$project$Ui$width($author$project$Ui$fill) 62204 ]), 62205 _List_fromArray( 62206 [ 62207 A2( 62208 $author$project$Ui$row, 62209 _List_fromArray( 62210 [ 62211 $author$project$Ui$width($author$project$Ui$fill) 62212 ]), 62213 _List_fromArray( 62214 [ 62215 A2( 62216 $author$project$Ui$el, 62217 _List_fromArray( 62218 [ 62219 $author$project$Ui$Font$weight($author$project$UI$Theme$fontWeight.dL), 62220 $author$project$Ui$Font$size($author$project$UI$Theme$font.aW) 62221 ]), 62222 $author$project$Ui$text(data.eE)), 62223 A2( 62224 $author$project$Ui$el, 62225 _List_fromArray( 62226 [ 62227 $author$project$Ui$alignRight, 62228 $author$project$Ui$Font$weight($author$project$UI$Theme$fontWeight.lD), 62229 $author$project$Ui$Font$size($author$project$UI$Theme$font.aW), 62230 $author$project$Ui$Font$letterSpacing($author$project$UI$Theme$letterSpacing.qP), 62231 $author$project$Ui$Font$color($author$project$UI$Theme$success.qI) 62232 ]), 62233 $author$project$Ui$text( 62234 A3( 62235 $author$project$Format$formatCentsSigned, 62236 $author$project$Translations$currentLanguage(i18n), 62237 data.ef, 62238 data.bg))) 62239 ])), 62240 A2( 62241 $author$project$Ui$row, 62242 _List_fromArray( 62243 [ 62244 $author$project$Ui$spacing($author$project$UI$Theme$spacing.bb), 62245 $author$project$Ui$paddingTop($author$project$UI$Theme$spacing.bb), 62246 $author$project$Ui$contentCenterY, 62247 $author$project$Ui$Font$size($author$project$UI$Theme$font.qk), 62248 $author$project$Ui$Font$color($author$project$UI$Theme$base.aM) 62249 ]), 62250 _List_fromArray( 62251 [ 62252 A2( 62253 $author$project$Ui$el, 62254 _List_fromArray( 62255 [ 62256 $author$project$Ui$width($author$project$Ui$shrink) 62257 ]), 62258 $author$project$Ui$text( 62259 A2($author$project$Page$Group$EntriesTab$formatShortDate, i18n, data.cj))), 62260 $author$project$Page$Group$EntriesTab$entryTag( 62261 'ð¥ ' + $author$project$Translations$entryIncome(i18n)), 62262 A2( 62263 $author$project$Ui$row, 62264 _List_fromArray( 62265 [ 62266 $author$project$Ui$spacing($author$project$UI$Theme$spacing.bb), 62267 $author$project$Ui$width($author$project$Ui$shrink), 62268 $author$project$Ui$contentCenterY, 62269 $author$project$Ui$alignRight 62270 ]), 62271 _List_fromArray( 62272 [ 62273 $author$project$Ui$text( 62274 A2($author$project$Page$Group$EntriesTab$recipientText, resolveName, data.em)), 62275 A2( 62276 $author$project$Ui$el, 62277 _List_fromArray( 62278 [ 62279 $author$project$Ui$Font$color($author$project$UI$Theme$base.aM) 62280 ]), 62281 $author$project$Ui$text('â')), 62282 $author$project$Ui$text( 62283 resolveName(data.j$)) 62284 ])) 62285 ])) 62286 ])); 62287 }); 62288var $author$project$Page$Group$EntriesTab$transferCardHeader = F3( 62289 function (i18n, resolveName, data) { 62290 return A2( 62291 $author$project$Ui$column, 62292 _List_fromArray( 62293 [ 62294 $author$project$Ui$width($author$project$Ui$fill) 62295 ]), 62296 _List_fromArray( 62297 [ 62298 A2( 62299 $author$project$Ui$row, 62300 _List_fromArray( 62301 [ 62302 $author$project$Ui$width($author$project$Ui$fill) 62303 ]), 62304 _List_fromArray( 62305 [ 62306 A2( 62307 $author$project$Ui$el, 62308 _List_fromArray( 62309 [ 62310 $author$project$Ui$Font$weight($author$project$UI$Theme$fontWeight.dL), 62311 $author$project$Ui$Font$size($author$project$UI$Theme$font.aW) 62312 ]), 62313 $author$project$Ui$text( 62314 A2( 62315 $elm$core$Maybe$withDefault, 62316 $author$project$Translations$entryTransfer(i18n), 62317 data.eE))), 62318 A2( 62319 $author$project$Ui$el, 62320 _List_fromArray( 62321 [ 62322 $author$project$Ui$alignRight, 62323 $author$project$Ui$Font$weight($author$project$UI$Theme$fontWeight.lD), 62324 $author$project$Ui$Font$size($author$project$UI$Theme$font.aW), 62325 $author$project$Ui$Font$letterSpacing($author$project$UI$Theme$letterSpacing.qP) 62326 ]), 62327 $author$project$Ui$text( 62328 A3( 62329 $author$project$Format$formatCentsWithCurrency, 62330 $author$project$Translations$currentLanguage(i18n), 62331 data.ef, 62332 data.bg))) 62333 ])), 62334 A2( 62335 $author$project$Ui$row, 62336 _List_fromArray( 62337 [ 62338 $author$project$Ui$spacing($author$project$UI$Theme$spacing.bb), 62339 $author$project$Ui$paddingTop($author$project$UI$Theme$spacing.bb), 62340 $author$project$Ui$Font$color($author$project$UI$Theme$base.aM), 62341 $author$project$Ui$Font$size($author$project$UI$Theme$font.qk), 62342 $author$project$Ui$contentCenterY 62343 ]), 62344 _List_fromArray( 62345 [ 62346 A2( 62347 $author$project$Ui$el, 62348 _List_fromArray( 62349 [ 62350 $author$project$Ui$width($author$project$Ui$shrink) 62351 ]), 62352 $author$project$Ui$text( 62353 A2($author$project$Page$Group$EntriesTab$formatShortDate, i18n, data.cj))), 62354 $author$project$Page$Group$EntriesTab$entryTag( 62355 'ð¸ ' + $author$project$Translations$filterCategoryTransfer(i18n)), 62356 A2( 62357 $author$project$Ui$row, 62358 _List_fromArray( 62359 [ 62360 $author$project$Ui$spacing($author$project$UI$Theme$spacing.bb), 62361 $author$project$Ui$width($author$project$Ui$shrink), 62362 $author$project$Ui$contentCenterY, 62363 $author$project$Ui$alignRight 62364 ]), 62365 _List_fromArray( 62366 [ 62367 $author$project$Ui$text(
62368 resolveName(data.iH)), 62369 A2( 62370 $author$project$Ui$el, 62371 _List_fromArray( 62372 [ 62373 $author$project$Ui$Font$color($author$project$UI$Theme$base.aM) 62374 ]), 62375 $author$project$Ui$text('â')), 62376 $author$project$Ui$text( 62377 resolveName(data.kE)) 62378 ])) 62379 ])) 62380 ])); 62381 }); 62382var $author$project$Page$Group$EntriesTab$entryCardView = F2( 62383 function (env, _v0) { 62384 var entry = _v0.aR; 62385 var isDeleted = _v0.gB; 62386 var headerEl = function () { 62387 var _v4 = entry.gE; 62388 switch (_v4.$) { 62389 case 0: 62390 var data = _v4.a; 62391 return A3($author$project$Page$Group$EntriesTab$expenseCardHeader, env.aJ, env.bz, data); 62392 case 1: 62393 var data = _v4.a; 62394 return A3($author$project$Page$Group$EntriesTab$transferCardHeader, env.aJ, env.bz, data); 62395 default: 62396 var data = _v4.a; 62397 return A3($author$project$Page$Group$EntriesTab$incomeCardHeader, env.aJ, env.bz, data); 62398 } 62399 }(); 62400 var entryId = entry.gM.aj; 62401 var freshnessAttrs = function () { 62402 var _v1 = env.mK(entryId); 62403 if (!_v1.$) { 62404 if (!_v1.a) { 62405 var _v2 = _v1.a; 62406 return _List_fromArray( 62407 [ 62408 $author$project$Ui$borderWith( 62409 {lI: $author$project$UI$Theme$border, nz: 4, pW: $author$project$UI$Theme$border, qW: $author$project$UI$Theme$border}), 62410 $author$project$Ui$borderColor($author$project$UI$Theme$primary.kl) 62411 ]); 62412 } else { 62413 var _v3 = _v1.a; 62414 return _List_fromArray( 62415 [ 62416 $author$project$Ui$borderWith( 62417 {lI: $author$project$UI$Theme$border, nz: 4, pW: $author$project$UI$Theme$border, qW: $author$project$UI$Theme$border}), 62418 $author$project$Ui$borderColor($author$project$UI$Theme$warning.kl) 62419 ]); 62420 } 62421 } else { 62422 return A2( 62423 $elm$core$Maybe$withDefault, 62424 false, 62425 A2( 62426 $elm$core$Maybe$map, 62427 function (memberId) { 62428 return A2( 62429 $elm$core$List$member, 62430 memberId, 62431 $author$project$Domain$Entry$involvedMembers(entry)); 62432 }, 62433 env.ds)) ? _List_fromArray( 62434 [ 62435 $author$project$Ui$borderWith( 62436 {lI: $author$project$UI$Theme$border, nz: 4, pW: $author$project$UI$Theme$border, qW: $author$project$UI$Theme$border}), 62437 $author$project$Ui$borderColor($author$project$UI$Theme$base.qI) 62438 ]) : _List_Nil; 62439 } 62440 }(); 62441 var isExpanded = A2($elm$core$Set$member, entryId, env.aS); 62442 var cardEl = A2( 62443 $author$project$UI$Components$card, 62444 A2( 62445 $elm$core$List$cons, 62446 A2($author$project$Ui$paddingXY, $author$project$UI$Theme$spacing.i8, $author$project$UI$Theme$spacing.aW), 62447 A2( 62448 $elm$core$List$cons, 62449 $author$project$Ui$id( 62450 $author$project$Page$Group$EntriesTab$entryDomId(entryId)), 62451 freshnessAttrs)), 62452 _List_fromArray( 62453 [ 62454 A2( 62455 $author$project$Ui$el, 62456 _List_fromArray( 62457 [ 62458 $author$project$Ui$Input$button( 62459 $author$project$Page$Group$EntriesTab$ToggleEntry(entryId)), 62460 $author$project$Ui$pointer 62461 ]), 62462 headerEl), 62463 A2($elm$core$Set$member, entryId, env.pq) ? A2( 62464 $author$project$Ui$el, 62465 _List_fromArray( 62466 [ 62467 $author$project$Ui$paddingTop($author$project$UI$Theme$spacing.bb) 62468 ]), 62469 $author$project$UI$Components$pendingSyncBadge(env.aJ)) : $author$project$Ui$none, 62470 isExpanded ? A5( 62471 $author$project$Page$Group$EntriesTab$entryDetail, 62472 env, 62473 env.iw(entryId), 62474 entryId, 62475 entry, 62476 isDeleted) : $author$project$Ui$none 62477 ])); 62478 return isDeleted ? A2( 62479 $author$project$Ui$el, 62480 _List_fromArray( 62481 [ 62482 $author$project$Ui$opacity(0.5) 62483 ]), 62484 cardEl) : cardEl; 62485 }); 62486var $author$project$Page$Group$EntriesTab$groupedByDate = F2( 62487 function (env, entries) { 62488 var getDate = function (entry) { 62489 var _v2 = entry.gE; 62490 switch (_v2.$) { 62491 case 0: 62492 var data = _v2.a; 62493 return data.cj; 62494 case 1: 62495 var data = _v2.a; 62496 return data.cj; 62497 default: 62498 var data = _v2.a; 62499 return data.cj; 62500 } 62501 }; 62502 var groupEntries = function (items) { 62503 return A2( 62504 $elm$core$List$map, 62505 function (_v1) { 62506 var e1 = _v1.a; 62507 var es = _v1.b; 62508 return _Utils_Tuple2( 62509 getDate(e1.aR), 62510 A2($elm$core$List$cons, e1, es)); 62511 }, 62512 A2( 62513 $elmcraft$core_extra$List$Extra$groupWhile, 62514 F2( 62515 function (e1, e2) { 62516 return _Utils_eq( 62517 getDate(e1.aR), 62518 getDate(e2.aR)); 62519 }), 62520 items)); 62521 }; 62522 return A2( 62523 $elm$core$List$concatMap, 62524 function (_v0) { 62525 var date = _v0.a; 62526 var group = _v0.b; 62527 return A2( 62528 $elm$core$List$cons, 62529 A2($author$project$Page$Group$EntriesTab$dateSeparator, env.aJ, date), 62530 A2( 62531 $elm$core$List$map, 62532 $author$project$Page$Group$EntriesTab$entryCardView(env), 62533 group)); 62534 }, 62535 groupEntries(entries)); 62536 }); 62537var $author$project$Domain$Filter$matchesCategoryFilter = F2( 62538 function (categories, entry) { 62539 if ($elm$core$Set$isEmpty(categories)) { 62540 return true; 62541 } else { 62542 var _v0 = entry.gE; 62543 switch (_v0.$) { 62544 case 0: 62545 var data = _v0.a; 62546 var _v1 = data.h9; 62547 if (!_v1.$) { 62548 var cat = _v1.a; 62549 return A2( 62550 $elm$core$Set$member, 62551 $author$project$Domain$Filter$categoryFilterToString( 62552 $author$project$Domain$Filter$ExpenseCategory(cat)), 62553 categories); 62554 } else { 62555 return false;
62556 } 62557 case 1: 62558 return A2( 62559 $elm$core$Set$member, 62560 $author$project$Domain$Filter$categoryFilterToString($author$project$Domain$Filter$TransferCategory), 62561 categories); 62562 default: 62563 return A2( 62564 $elm$core$Set$member, 62565 $author$project$Domain$Filter$categoryFilterToString($author$project$Domain$Filter$IncomeCategory), 62566 categories); 62567 } 62568 } 62569 }); 62570var $author$project$Domain$Filter$matchesCurrencyFilter = F2( 62571 function (currencies, entry) { 62572 if ($elm$core$Set$isEmpty(currencies)) { 62573 return true; 62574 } else { 62575 var code = function () { 62576 var _v0 = entry.gE; 62577 switch (_v0.$) { 62578 case 0: 62579 var data = _v0.a; 62580 return $author$project$Domain$Currency$currencyCode(data.bg); 62581 case 1: 62582 var data = _v0.a; 62583 return $author$project$Domain$Currency$currencyCode(data.bg); 62584 default: 62585 var data = _v0.a; 62586 return $author$project$Domain$Currency$currencyCode(data.bg); 62587 } 62588 }(); 62589 return A2($elm$core$Set$member, code, currencies); 62590 } 62591 }); 62592var $author$project$Domain$Date$endOfMonth = function (date) { 62593 return _Utils_update( 62594 date, 62595 { 62596 y: A2($author$project$Domain$Date$daysInMonth, date.C, date.F) 62597 }); 62598}; 62599var $author$project$Domain$Date$previousMonth = function (date) { 62600 var prev = (date.F === 1) ? {y: 1, F: 12, C: date.C - 1} : {y: 1, F: date.F - 1, C: date.C}; 62601 return { 62602 iH: prev, 62603 kE: $author$project$Domain$Date$endOfMonth(prev) 62604 }; 62605}; 62606var $author$project$Domain$Date$startOfMonth = function (date) { 62607 return _Utils_update( 62608 date, 62609 {y: 1}); 62610}; 62611var $author$project$Domain$Filter$resolveDateRange = F2( 62612 function (today, range) { 62613 switch (range) { 62614 case 0: 62615 return {iH: today, kE: today}; 62616 case 1: 62617 var y = A2($author$project$Domain$Date$addDays, -1, today); 62618 return {iH: y, kE: y}; 62619 case 2: 62620 return { 62621 iH: A2($author$project$Domain$Date$addDays, -6, today), 62622 kE: today 62623 }; 62624 case 3: 62625 return { 62626 iH: A2($author$project$Domain$Date$addDays, -29, today), 62627 kE: today 62628 }; 62629 case 4: 62630 return { 62631 iH: $author$project$Domain$Date$startOfMonth(today), 62632 kE: $author$project$Domain$Date$endOfMonth(today) 62633 }; 62634 default: 62635 return $author$project$Domain$Date$previousMonth(today); 62636 } 62637 }); 62638var $author$project$Domain$Filter$dateInRange = F3( 62639 function (today, range, date) { 62640 var resolved = A2($author$project$Domain$Filter$resolveDateRange, today, range); 62641 return (_Utils_cmp( 62642 $author$project$Domain$Date$toComparable(date), 62643 $author$project$Domain$Date$toComparable(resolved.iH)) > -1) && (_Utils_cmp( 62644 $author$project$Domain$Date$toComparable(date), 62645 $author$project$Domain$Date$toComparable(resolved.kE)) < 1); 62646 }); 62647var $author$project$Domain$Filter$matchesDateFilter = F3( 62648 function (today, ranges, entry) { 62649 if ($elm$core$List$isEmpty(ranges)) { 62650 return true; 62651 } else { 62652 var entryDate = function () { 62653 var _v0 = entry.gE; 62654 switch (_v0.$) { 62655 case 0: 62656 var data = _v0.a; 62657 return data.cj; 62658 case 1: 62659 var data = _v0.a; 62660 return data.cj; 62661 default: 62662 var data = _v0.a; 62663 return data.cj; 62664 } 62665 }(); 62666 return A2( 62667 $elm$core$List$any, 62668 function (range) { 62669 return A3($author$project$Domain$Filter$dateInRange, today, range, entryDate); 62670 }, 62671 ranges); 62672 } 62673 }); 62674var $author$project$Domain$Filter$matchesPersonFilter = F2( 62675 function (persons, entry) { 62676 if ($elm$core$Set$isEmpty(persons)) { 62677 return true; 62678 } else { 62679 var involved = $elm$core$Set$fromList( 62680 $author$project$Domain$Entry$involvedMembers(entry)); 62681 return A3( 62682 $elm$core$Set$foldl, 62683 F2( 62684 function (p, acc) { 62685 return acc && A2($elm$core$Set$member, p, involved); 62686 }), 62687 true, 62688 persons); 62689 } 62690 }); 62691var $author$project$Domain$Filter$matchesEntryFilters = F3( 62692 function (today, filters, entry) { 62693 return A2($author$project$Domain$Filter$matchesPersonFilter, filters.fc, entry) && (A2($author$project$Domain$Filter$matchesCategoryFilter, filters.eu, entry) && (A2($author$project$Domain$Filter$matchesCurrencyFilter, filters.ez, entry) && A3($author$project$Domain$Filter$matchesDateFilter, today, filters.eB, entry))); 62694 }); 62695var $author$project$Page$Group$EntriesTab$beneficiaryMatchesSearch = F2( 62696 function (matchesMemberName, beneficiary) { 62697 if (!beneficiary.$) { 62698 var r = beneficiary.a; 62699 return matchesMemberName(r.e_); 62700 } else { 62701 var r = beneficiary.a; 62702 return matchesMemberName(r.e_); 62703 } 62704 }); 62705var $author$project$Page$Group$EntriesTab$matchesSearch = F4( 62706 function (i18n, resolveName, query, entry) { 62707 if ($elm$core$String$isEmpty(query)) { 62708 return true; 62709 } else { 62710 var q = $elm$core$String$toLower(query); 62711 var contains = function (text) { 62712 return A2( 62713 $elm$core$String$contains, 62714 q, 62715 $elm$core$String$toLower(text)); 62716 }; 62717 var matchesCategory = function (maybeCat) { 62718 if (!maybeCat.$) { 62719 var cat = maybeCat.a; 62720 return contains( 62721 A2($author$project$UI$Categories$label, i18n, cat)); 62722 } else { 62723 return false;
62724 } 62725 }; 62726 var matchesMemberName = function (memberId) { 62727 return contains( 62728 resolveName(memberId)); 62729 }; 62730 var _v0 = entry.gE; 62731 switch (_v0.$) { 62732 case 0: 62733 var data = _v0.a; 62734 return contains(data.eE) || (A2( 62735 $elm$core$Maybe$withDefault, 62736 false, 62737 A2($elm$core$Maybe$map, contains, data.bu)) || (matchesCategory(data.h9) || (A2( 62738 $elm$core$List$any, 62739 function (p) { 62740 return matchesMemberName(p.e_); 62741 }, 62742 data.jB) || A2( 62743 $elm$core$List$any, 62744 $author$project$Page$Group$EntriesTab$beneficiaryMatchesSearch(matchesMemberName), 62745 data.em)))); 62746 case 1: 62747 var data = _v0.a; 62748 return contains( 62749 $author$project$Translations$entryTransfer(i18n)) || (A2( 62750 $elm$core$Maybe$withDefault, 62751 false, 62752 A2($elm$core$Maybe$map, contains, data.eE)) || (A2( 62753 $elm$core$Maybe$withDefault, 62754 false, 62755 A2($elm$core$Maybe$map, contains, data.bu)) || (matchesMemberName(data.iH) || matchesMemberName(data.kE)))); 62756 default: 62757 var data = _v0.a; 62758 return contains(data.eE) || (contains( 62759 $author$project$Translations$entryIncome(i18n)) || (A2( 62760 $elm$core$Maybe$withDefault, 62761 false, 62762 A2($elm$core$Maybe$map, contains, data.bu)) || (matchesMemberName(data.j$) || A2( 62763 $elm$core$List$any, 62764 $author$project$Page$Group$EntriesTab$beneficiaryMatchesSearch(matchesMemberName), 62765 data.em)))); 62766 } 62767 } 62768 }); 62769var $author$project$Page$Group$EntriesTab$InputSearch = function (a) { 62770 return {$: 7, a: a}; 62771}; 62772var $author$project$Page$Group$EntriesTab$ToggleFilters = {$: 1}; 62773var $author$project$Translations$entriesSearchLabel = function (_v0) { 62774 var lang = _v0; 62775 if (!lang) { 62776 return 'Search'; 62777 } else { 62778 return 'Rechercher'; 62779 } 62780}; 62781var $feathericons$elm_feather$FeatherIcons$search = A2( 62782 $feathericons$elm_feather$FeatherIcons$makeBuilder, 62783 'search', 62784 _List_fromArray( 62785 [ 62786 A2( 62787 $elm$svg$Svg$circle, 62788 _List_fromArray( 62789 [ 62790 $elm$svg$Svg$Attributes$cx('11'), 62791 $elm$svg$Svg$Attributes$cy('11'), 62792 $elm$svg$Svg$Attributes$r('8') 62793 ]), 62794 _List_Nil), 62795 A2( 62796 $elm$svg$Svg$line, 62797 _List_fromArray( 62798 [ 62799 $elm$svg$Svg$Attributes$x1('21'), 62800 $elm$svg$Svg$Attributes$y1('21'), 62801 $elm$svg$Svg$Attributes$x2('16.65'), 62802 $elm$svg$Svg$Attributes$y2('16.65') 62803 ]), 62804 _List_Nil) 62805 ])); 62806var $author$project$Page$Group$EntriesTab$searchFilterRow = F4( 62807 function (i18n, showFilters, hasActiveFilters, query) { 62808 return A2( 62809 $author$project$Ui$row, 62810 _List_fromArray( 62811 [ 62812 $author$project$Ui$width($author$project$Ui$fill), 62813 $author$project$Ui$spacing($author$project$UI$Theme$spacing.qk), 62814 $author$project$Ui$contentCenterY 62815 ]), 62816 _List_fromArray( 62817 [ 62818 A2( 62819 $author$project$Ui$row, 62820 _List_fromArray( 62821 [ 62822 $author$project$Ui$width($author$project$Ui$fill), 62823 A2($author$project$Ui$paddingXY, $author$project$UI$Theme$spacing.aW, $author$project$UI$Theme$spacing.qk), 62824 $author$project$Ui$spacing($author$project$UI$Theme$spacing.qk), 62825 $author$project$Ui$border($author$project$UI$Theme$border), 62826 $author$project$Ui$borderColor($author$project$UI$Theme$base.k3), 62827 $author$project$Ui$rounded($author$project$UI$Theme$radius.aW), 62828 $author$project$Ui$background( 62829 A3($author$project$Ui$rgb, 255, 255, 255)), 62830 $author$project$Ui$contentCenterY 62831 ]), 62832 _List_fromArray( 62833 [ 62834 A2( 62835 $author$project$Ui$el, 62836 _List_fromArray( 62837 [ 62838 $author$project$Ui$Font$color($author$project$UI$Theme$base.aM), 62839 $author$project$Ui$width($author$project$Ui$shrink) 62840 ]), 62841 A2($author$project$UI$Components$featherIcon, 18, $feathericons$elm_feather$FeatherIcons$search)), 62842 A2( 62843 $author$project$Ui$Input$text, 62844 _List_fromArray( 62845 [ 62846 $author$project$Ui$width($author$project$Ui$fill), 62847 $author$project$Ui$padding(0), 62848 $author$project$Ui$border(0), 62849 $author$project$Ui$Font$size($author$project$UI$Theme$font.aW) 62850 ]), 62851 { 62852 i6: $author$project$Ui$Input$labelHidden( 62853 $author$project$Translations$entriesSearchLabel(i18n)), 62854 oq: $author$project$Page$Group$EntriesTab$InputSearch, 62855 pt: $elm$core$Maybe$Just( 62856 $author$project$Translations$entriesSearchLabel(i18n) + '...'), 62857 qI: query 62858 }) 62859 ])), 62860 $author$project$UI$Components$filterToggleButton( 62861 { 62862 mV: hasActiveFilters, 62863 i6: $author$project$Translations$filterToggleLabel(i18n), 62864 e7: $author$project$Page$Group$EntriesTab$ToggleFilters, 62865 cS: showFilters 62866 }) 62867 ])); 62868 }); 62869var $author$project$Translations$entriesGroupTotal = function (_v0) { 62870 var lang = _v0; 62871 if (!lang) { 62872 return 'Group total'; 62873 } else { 62874 return 'Total du groupe'; 62875 } 62876}; 62877var $author$project$Translations$entriesYourSpending = function (_v0) { 62878 var lang = _v0; 62879 if (!lang) { 62880 return 'Your spending'; 62881 } else { 62882 return 'Tes dépenses'; 62883 } 62884}; 62885var $author$project$Page$Group$EntriesTab$summaryCard = F4( 62886 function (i18n, maybeUserRootId, currency, expenseShares) { 62887 var lang = $author$project$Translations$currentLanguage(i18n); 62888 var stat = F3( 62889 function (label, amount, isPrimary) { 62890 return A2( 62891 $author$project$Ui$column, 62892 _List_fromArray( 62893 [ 62894 $author$project$Ui$spacing($author$project$UI$Theme$spacing.bb), 62895 $author$project$Ui$width($author$project$Ui$fill) 62896 ]), 62897 _List_fromArray( 62898 [ 62899 A2( 62900 $author$project$Ui$el, 62901 _List_fromArray( 62902 [ 62903 $author$project$Ui$Font$size($author$project$UI$Theme$font.bb), 62904 $author$project$Ui$Font$weight($author$project$UI$Theme$fontWeight.dL), 62905 $author$project$Ui$Font$letterSpacing($author$project$UI$Theme$letterSpacing.kY), 62906 $author$project$Ui$Font$color($author$project$UI$Theme$base.aM) 62907 ]), 62908 $author$project$Ui$text( 62909 $elm$core$String$toUpper(label))), 62910 A2( 62911 $author$project$Ui$el, 62912 _List_fromArray( 62913 [ 62914 $author$project$Ui$Font$size($author$project$UI$Theme$font.hE), 62915 $author$project$Ui$Font$weight($author$project$UI$Theme$fontWeight.lD), 62916 $author$project$Ui$Font$letterSpacing($author$project$UI$Theme$letterSpacing.qP), 62917 isPrimary ? $author$project$Ui$Font$color($author$project$UI$Theme$primary.qI) : $author$project$Ui$noAttr 62918 ]), 62919 $author$project$Ui$text( 62920 A3($author$project$Format$formatCentsWithCurrency, lang, amount, currency))) 62921 ])); 62922 }); 62923 var yourStat = function () { 62924 if (!maybeUserRootId.$) { 62925 var uid = maybeUserRootId.a; 62926 return _List_fromArray( 62927 [ 62928 A3( 62929 stat, 62930 $author$project$Translations$entriesYourSpending(i18n), 62931 A2( 62932 $elm$core$Maybe$withDefault, 62933 0, 62934 A2($elm$core$Dict$get, uid, expenseShares)), 62935 true) 62936 ]); 62937 } else { 62938 return _List_Nil; 62939 } 62940 }(); 62941 var groupTotal = $elm$core$List$sum( 62942 $elm$core$Dict$values(expenseShares)); 62943 return A2( 62944 $author$project$UI$Components$card, 62945 _List_fromArray( 62946 [ 62947 $author$project$Ui$padding($author$project$UI$Theme$spacing.i8) 62948 ]), 62949 _List_fromArray( 62950 [ 62951 A2( 62952 $author$project$Ui$row, 62953 _List_fromArray( 62954 [ 62955 $author$project$Ui$width($author$project$Ui$fill), 62956 $author$project$Ui$spacing($author$project$UI$Theme$spacing.aW) 62957 ]), 62958 A2( 62959 $elm$core$List$cons, 62960 A3( 62961 stat, 62962 $author$project$Translations$entriesGroupTotal(i18n), 62963 groupTotal, 62964 false), 62965 yourStat)) 62966 ])); 62967 }); 62968var $author$project$Translations$entriesSummary = F2( 62969 function (data, _v0) { 62970 var lang = _v0; 62971 if (!lang) { 62972 var _v2 = data.bH; 62973 if (_v2 === '1') { 62974 return data.bH + (' entry · ' + (data.ef + ' spent total')); 62975 } else { 62976 return data.bH + (' entries · ' + (data.ef + ' spent total')); 62977 } 62978 } else { 62979 var _v3 = data.bH; 62980 switch (_v3) { 62981 case '0': 62982 return data.bH + (' entrée · ' + (data.ef + ' dépensé au total')); 62983 case '1': 62984 return data.bH + (' entrée · ' + (data.ef + ' dépensé au total')); 62985 default: 62986 return data.bH + (' entrées · ' + (data.ef + ' dépensé au total')); 62987 } 62988 } 62989 }); 62990var $author$project$Page$Group$EntriesTab$summaryRow = F4( 62991 function (i18n, entryCount, totalAmount, currency) { 62992 return A2( 62993 $author$project$Ui$el, 62994 _List_fromArray( 62995 [ 62996 $author$project$Ui$Font$size($author$project$UI$Theme$font.qk), 62997 $author$project$Ui$Font$color($author$project$UI$Theme$base.aM) 62998 ]), 62999 $author$project$Ui$text( 63000 A2( 63001 $author$project$Translations$entriesSummary, 63002 { 63003 ef: A3( 63004 $author$project$Format$formatCentsWithCurrency, 63005 $author$project$Translations$currentLanguage(i18n), 63006 totalAmount, 63007 currency), 63008 bH: $elm$core$String$fromInt(entryCount) 63009 }, 63010 i18n))); 63011 }); 63012var $author$project$Page$Group$EntriesTab$view = F6( 63013 function (i18n, config, maybeUserRootId, today, _v0, state) { 63014 var data = _v0; 63015 var toMsg = config.d3; 63016 var resolveName = $author$project$Domain$GroupState$resolveMemberName(state); 63017 var groupDefaultCurrency = state.iO.il; 63018 var allEntries = data.a0 ? A2( 63019 $elm$core$List$map, 63020 function (es) { 63021 return {aR: es.bi, gB: es.gB}; 63022 }, 63023 $elm$core$Dict$values(state.E)) : A2( 63024 $elm$core$List$map, 63025 function (e) {
63026 return {aR: e, gB: false}; 63027 }, 63028 $author$project$Domain$GroupState$activeEntries(state)); 63029 var visibleEntries = A2( 63030 $elm$core$List$sortBy, 63031 function (_v5) { 63032 var entry = _v5.aR; 63033 return $author$project$Page$Group$EntriesTab$entrySortKey(entry); 63034 }, 63035 A2( 63036 $elm$core$List$filter, 63037 function (_v4) { 63038 var entry = _v4.aR; 63039 return A4($author$project$Page$Group$EntriesTab$matchesSearch, i18n, resolveName, data.dK, entry); 63040 }, 63041 A2( 63042 $elm$core$List$filter, 63043 function (_v3) { 63044 var entry = _v3.aR; 63045 return A3($author$project$Domain$Filter$matchesEntryFilters, today, data.a5, entry); 63046 }, 63047 allEntries))); 63048 var totalAmount = $elm$core$List$sum( 63049 A2( 63050 $elm$core$List$filterMap, 63051 function (_v1) { 63052 var entry = _v1.aR; 63053 var _v2 = entry.gE; 63054 switch (_v2.$) { 63055 case 0: 63056 var d = _v2.a; 63057 return _Utils_eq(d.bg, groupDefaultCurrency) ? $elm$core$Maybe$Just(d.ef) : d.ck; 63058 case 2: 63059 return $elm$core$Maybe$Nothing; 63060 default: 63061 return $elm$core$Maybe$Nothing; 63062 } 63063 }, 63064 visibleEntries)); 63065 return A2( 63066 $author$project$Ui$column, 63067 _List_fromArray( 63068 [ 63069 $author$project$Ui$spacing($author$project$UI$Theme$spacing.aW), 63070 $author$project$Ui$width($author$project$Ui$fill) 63071 ]), 63072 _List_fromArray( 63073 [ 63074 A4($author$project$Page$Group$EntriesTab$summaryCard, i18n, maybeUserRootId, groupDefaultCurrency, state.gk), 63075 (!_Utils_eq(maybeUserRootId, $elm$core$Maybe$Nothing)) ? A2( 63076 $author$project$Ui$el, 63077 _List_fromArray( 63078 [ 63079 A2($author$project$Ui$paddingXY, 0, $author$project$UI$Theme$spacing.i8) 63080 ]), 63081 A2( 63082 $author$project$UI$Components$btnPrimary, 63083 A2($author$project$UI$Components$spaLinkAttrs, config.n$, config.oR), 63084 { 63085 i6: A2($author$project$Translations$newEntryTitle, 'expense', i18n), 63086 e7: config.oR 63087 })) : $author$project$Ui$none, 63088 A2( 63089 $author$project$Ui$map, 63090 toMsg, 63091 A4( 63092 $author$project$Page$Group$EntriesTab$searchFilterRow, 63093 i18n, 63094 data.cS, 63095 $author$project$Domain$Filter$isEntryFilterActive(data.a5) || data.a0, 63096 data.dK)), 63097 data.cS ? A2( 63098 $author$project$Ui$map, 63099 toMsg, 63100 A4($author$project$Page$Group$EntriesTab$filterPanel, i18n, data.a5, data.a0, state)) : (($author$project$Domain$Filter$isEntryFilterActive(data.a5) || data.a0) ? A4($author$project$Page$Group$EntriesTab$activeFilterSummary, i18n, data.a5, data.a0, state) : $author$project$Ui$none), 63101 A4( 63102 $author$project$Page$Group$EntriesTab$summaryRow, 63103 i18n, 63104 $elm$core$List$length(visibleEntries), 63105 totalAmount, 63106 groupDefaultCurrency), 63107 $elm$core$List$isEmpty(visibleEntries) ? A2( 63108 $author$project$Ui$el, 63109 _List_fromArray( 63110 [ 63111 $author$project$Ui$Font$size($author$project$UI$Theme$font.qk), 63112 $author$project$Ui$Font$color($author$project$UI$Theme$base.aM) 63113 ]), 63114 $author$project$Ui$text( 63115 $author$project$Translations$entriesNone(i18n))) : A2( 63116 $author$project$Ui$map, 63117 toMsg, 63118 A2( 63119 $author$project$Ui$column, 63120 _List_fromArray( 63121 [ 63122 $author$project$Ui$width($author$project$Ui$fill), 63123 $author$project$Ui$spacing($author$project$UI$Theme$spacing.qk) 63124 ]), 63125 A2( 63126 $author$project$Page$Group$EntriesTab$groupedByDate, 63127 {X: data.X, iw: config.iw, aS: data.aS, mK: config.mK, mS: groupDefaultCurrency, aJ: i18n, ds: maybeUserRootId, pq: config.pq, bz: resolveName}, 63128 visibleEntries))) 63129 ])); 63130 }); 63131var $author$project$Page$Group$MembersTab$ToggleRetired = {$: 2}; 63132var $author$project$Page$Group$MembersTab$boolToInt = function (b) { 63133 return b ? 1 : 0; 63134}; 63135var $author$project$Translations$groupConfigButton = function (_v0) { 63136 var lang = _v0; 63137 if (!lang) { 63138 return 'Group Config'; 63139 } else { 63140 return 'Configuration du groupe'; 63141 } 63142}; 63143var $author$project$Page$Group$MembersTab$groupInfoSection = F4( 63144 function (i18n, editHref, onEditGroupMetadata, state) { 63145 var viewSubtitle = function (sub) { 63146 return A2( 63147 $author$project$Ui$el, 63148 _List_fromArray( 63149 [ 63150 $author$project$Ui$Font$size($author$project$UI$Theme$font.i8) 63151 ]), 63152 $author$project$Ui$text(sub)); 63153 }; 63154 var viewDescription = function (desc) { 63155 return A2( 63156 $author$project$Ui$el, 63157 _List_fromArray( 63158 [ 63159 $author$project$Ui$Font$color($author$project$UI$Theme$base.aM) 63160 ]), 63161 $author$project$Ui$text(desc)); 63162 }; 63163 var meta = state.iO;
63164 var viewLinks = $elm$core$List$isEmpty(meta.cz) ? $author$project$Ui$none : A2( 63165 $author$project$Ui$column, 63166 _List_fromArray( 63167 [ 63168 $author$project$Ui$spacing($author$project$UI$Theme$spacing.qk) 63169 ]), 63170 A2( 63171 $elm$core$List$map, 63172 $author$project$UI$Components$linkItem($feathericons$elm_feather$FeatherIcons$externalLink), 63173 meta.cz)); 63174 return A2( 63175 $author$project$Ui$column, 63176 _List_fromArray( 63177 [ 63178 $author$project$Ui$spacing($author$project$UI$Theme$spacing.aW), 63179 $author$project$Ui$width($author$project$Ui$fill) 63180 ]), 63181 _List_fromArray( 63182 [ 63183 A2( 63184 $elm$core$Maybe$withDefault, 63185 $author$project$Ui$none, 63186 A2($elm$core$Maybe$map, viewSubtitle, meta.cY)), 63187 A2( 63188 $elm$core$Maybe$withDefault, 63189 $author$project$Ui$none, 63190 A2($elm$core$Maybe$map, viewDescription, meta.eE)), 63191 viewLinks, 63192 A2( 63193 $author$project$UI$Components$btnOutline, 63194 A2( 63195 $elm$core$List$cons, 63196 A2($author$project$Ui$paddingXY, $author$project$UI$Theme$spacing.aW, $author$project$UI$Theme$spacing.qk), 63197 A2($author$project$UI$Components$spaLinkAttrs, editHref, onEditGroupMetadata)), 63198 { 63199 gv: $elm$core$Maybe$Just( 63200 A2($author$project$UI$Components$featherIcon, 14, $feathericons$elm_feather$FeatherIcons$settings)), 63201 i6: $author$project$Translations$groupConfigButton(i18n), 63202 e7: onEditGroupMetadata 63203 }) 63204 ])); 63205 }); 63206var $author$project$Page$Group$MembersTab$ToggleQrCode = {$: 0}; 63207var $author$project$Page$Group$MembersTab$copyBtn = F2( 63208 function (copyText, label) { 63209 return A2( 63210 $author$project$Ui$row, 63211 A2( 63212 $elm$core$List$cons, 63213 $author$project$Ui$width($author$project$Ui$shrink), 63214 A2( 63215 $elm$core$List$cons, 63216 $author$project$Ui$Font$noWrap, 63217 A2( 63218 $elm$core$List$cons, 63219 $author$project$Ui$inFront( 63220 A2( 63221 $author$project$Ui$el, 63222 _List_fromArray( 63223 [ 63224 $author$project$Ui$width($author$project$Ui$fill), 63225 $author$project$Ui$height($author$project$Ui$fill) 63226 ]), 63227 $author$project$Ui$html( 63228 A3( 63229 $elm$html$Html$node, 63230 'copy-button', 63231 _List_fromArray( 63232 [ 63233 A2($elm$html$Html$Attributes$attribute, 'data-copy', copyText), 63234 A2($elm$html$Html$Attributes$style, 'display', 'block'), 63235 A2($elm$html$Html$Attributes$style, 'width', '100%'), 63236 A2($elm$html$Html$Attributes$style, 'height', '100%'), 63237 A2($elm$html$Html$Attributes$style, 'cursor', 'pointer') 63238 ]), 63239 _List_Nil)))), 63240 $author$project$UI$Components$btnOutlineAttrs))), 63241 _List_fromArray( 63242 [ 63243 A2( 63244 $author$project$Ui$el, 63245 _List_fromArray( 63246 [ 63247 $author$project$Ui$width($author$project$Ui$shrink) 63248 ]), 63249 A2($author$project$UI$Components$featherIcon, 16, $feathericons$elm_feather$FeatherIcons$copy)), 63250 $author$project$Ui$text(label) 63251 ])); 63252 }); 63253var $feathericons$elm_feather$FeatherIcons$grid = A2( 63254 $feathericons$elm_feather$FeatherIcons$makeBuilder, 63255 'grid', 63256 _List_fromArray( 63257 [ 63258 A2( 63259 $elm$svg$Svg$rect, 63260 _List_fromArray( 63261 [ 63262 $elm$svg$Svg$Attributes$x('3'), 63263 $elm$svg$Svg$Attributes$y('3'), 63264 $elm$svg$Svg$Attributes$width('7'), 63265 $elm$svg$Svg$Attributes$height('7') 63266 ]), 63267 _List_Nil), 63268 A2( 63269 $elm$svg$Svg$rect, 63270 _List_fromArray( 63271 [ 63272 $elm$svg$Svg$Attributes$x('14'), 63273 $elm$svg$Svg$Attributes$y('3'), 63274 $elm$svg$Svg$Attributes$width('7'), 63275 $elm$svg$Svg$Attributes$height('7') 63276 ]), 63277 _List_Nil), 63278 A2( 63279 $elm$svg$Svg$rect, 63280 _List_fromArray( 63281 [ 63282 $elm$svg$Svg$Attributes$x('14'), 63283 $elm$svg$Svg$Attributes$y('14'), 63284 $elm$svg$Svg$Attributes$width('7'), 63285 $elm$svg$Svg$Attributes$height('7') 63286 ]), 63287 _List_Nil), 63288 A2( 63289 $elm$svg$Svg$rect, 63290 _List_fromArray( 63291 [ 63292 $elm$svg$Svg$Attributes$x('3'), 63293 $elm$svg$Svg$Attributes$y('14'), 63294 $elm$svg$Svg$Attributes$width('7'), 63295 $elm$svg$Svg$Attributes$height('7') 63296 ]), 63297 _List_Nil) 63298 ])); 63299var $author$project$Translations$inviteLinkCopy = function (_v0) { 63300 var lang = _v0; 63301 if (!lang) { 63302 return 'Invite'; 63303 } else { 63304 return 'Copier lien'; 63305 } 63306}; 63307var $author$project$Translations$inviteLinkHint = function (_v0) { 63308 var lang = _v0; 63309 if (!lang) { 63310 return 'Share this invite link in trusted channels only. It contains the group encryption key to participate and read the group history.'; 63311 } else { 63312 return 'Partage ce lien uniquement par des canaux de confiance. Il contient la clé de chiffrement du groupe.'; 63313 } 63314}; 63315var $author$project$Translations$inviteLinkShare = function (_v0) { 63316 var lang = _v0; 63317 if (!lang) { 63318 return 'Share'; 63319 } else { 63320 return 'Partager'; 63321 } 63322}; 63323var $author$project$Translations$inviteLinkTitle = function (_v0) { 63324 var lang = _v0; 63325 if (!lang) { 63326 return 'Invite Link'; 63327 } else { 63328 return 'Lien d\'invitation'; 63329 } 63330}; 63331var $pablohirafuji$elm_qrcode$QRCode$Quartile = 2; 63332var $pablohirafuji$elm_qrcode$QRCode$QRCode = $elm$core$Basics$identity; 63333var $elm$core$Result$andThen = F2( 63334 function (callback, result) { 63335 if (!result.$) { 63336 var value = result.a; 63337 return callback(value); 63338 } else { 63339 var msg = result.a; 63340 return $elm$core$Result$Err(msg); 63341 } 63342 }); 63343var $elm$core$Array$getHelp = F3( 63344 function (shift, index, tree) { 63345 getHelp: 63346 while (true) { 63347 var pos = $elm$core$Array$bitMask & (index >>> shift); 63348 var _v0 = A2($elm$core$Elm$JsArray$unsafeGet, pos, tree); 63349 if (!_v0.$) { 63350 var subTree = _v0.a; 63351 var $temp$shift = shift - $elm$core$Array$shiftStep, 63352 $temp$index = index, 63353 $temp$tree = subTree; 63354 shift = $temp$shift; 63355 index = $temp$index; 63356 tree = $temp$tree; 63357 continue getHelp; 63358 } else { 63359 var values = _v0.a; 63360 return A2($elm$core$Elm$JsArray$unsafeGet, $elm$core$Array$bitMask & index, values); 63361 } 63362 } 63363 }); 63364var $elm$core$Array$tailIndex = function (len) { 63365 return (len >>> 5) << 5; 63366}; 63367var $elm$core$Array$get = F2( 63368 function (index, _v0) { 63369 var len = _v0.a; 63370 var startShift = _v0.b; 63371 var tree = _v0.c; 63372 var tail = _v0.d; 63373 return ((index < 0) || (_Utils_cmp(index, len) > -1)) ? $elm$core$Maybe$Nothing : ((_Utils_cmp( 63374 index, 63375 $elm$core$Array$tailIndex(len)) > -1) ? $elm$core$Maybe$Just( 63376 A2($elm$core$Elm$JsArray$unsafeGet, $elm$core$Array$bitMask & index, tail)) : $elm$core$Maybe$Just( 63377 A3($elm$core$Array$getHelp, startShift, index, tree))); 63378 });
63379var $pablohirafuji$elm_qrcode$QRCode$Matrix$getIndex = F3( 63380 function (size, row, col) { 63381 return (size * row) + col; 63382 }); 63383var $pablohirafuji$elm_qrcode$QRCode$Matrix$isOccupy = F4( 63384 function (row, col, size, matrix) { 63385 var _v0 = A2( 63386 $elm$core$Array$get, 63387 A3($pablohirafuji$elm_qrcode$QRCode$Matrix$getIndex, size, row, col), 63388 matrix); 63389 if ((!_v0.$) && (!_v0.a.$)) { 63390 return true; 63391 } else { 63392 return false; 63393 } 63394 }); 63395var $pablohirafuji$elm_qrcode$QRCode$Matrix$nextModule = function (placement) { 63396 var row = placement.p_; 63397 var col = placement.aG; 63398 var isRight = placement.a7; 63399 var isUp = placement.dm; 63400 return isRight ? _Utils_update( 63401 placement, 63402 {aG: col - 1, a7: false}) : (isUp ? _Utils_update( 63403 placement, 63404 {aG: col + 1, a7: true, p_: row - 1}) : _Utils_update( 63405 placement, 63406 {aG: col + 1, a7: true, p_: row + 1})); 63407}; 63408var $pablohirafuji$elm_qrcode$QRCode$Matrix$bitToColor = F2( 63409 function (_byte, offset) { 63410 return (1 & (_byte >> (7 - offset))) === 1; 63411 }); 63412var $elm$core$Array$setHelp = F4( 63413 function (shift, index, value, tree) { 63414 var pos = $elm$core$Array$bitMask & (index >>> shift); 63415 var _v0 = A2($elm$core$Elm$JsArray$unsafeGet, pos, tree); 63416 if (!_v0.$) { 63417 var subTree = _v0.a; 63418 var newSub = A4($elm$core$Array$setHelp, shift - $elm$core$Array$shiftStep, index, value, subTree); 63419 return A3( 63420 $elm$core$Elm$JsArray$unsafeSet, 63421 pos, 63422 $elm$core$Array$SubTree(newSub), 63423 tree); 63424 } else { 63425 var values = _v0.a; 63426 var newLeaf = A3($elm$core$Elm$JsArray$unsafeSet, $elm$core$Array$bitMask & index, value, values); 63427 return A3( 63428 $elm$core$Elm$JsArray$unsafeSet, 63429 pos, 63430 $elm$core$Array$Leaf(newLeaf), 63431 tree); 63432 } 63433 }); 63434var $elm$core$Array$set = F3( 63435 function (index, value, array) { 63436 var len = array.a; 63437 var startShift = array.b; 63438 var tree = array.c; 63439 var tail = array.d; 63440 return ((index < 0) || (_Utils_cmp(index, len) > -1)) ? array : ((_Utils_cmp( 63441 index, 63442 $elm$core$Array$tailIndex(len)) > -1) ? A4( 63443 $elm$core$Array$Array_elm_builtin, 63444 len, 63445 startShift, 63446 tree, 63447 A3($elm$core$Elm$JsArray$unsafeSet, $elm$core$Array$bitMask & index, value, tail)) : A4( 63448 $elm$core$Array$Array_elm_builtin, 63449 len, 63450 startShift, 63451 A4($elm$core$Array$setHelp, startShift, index, value, tree), 63452 tail)); 63453 }); 63454var $pablohirafuji$elm_qrcode$QRCode$Matrix$setDataModule = F3( 63455 function (_v0, _byte, offset) { 63456 var size = _v0.dW; 63457 var row = _v0.p_; 63458 var col = _v0.aG; 63459 return A2( 63460 $elm$core$Array$set, 63461 A3($pablohirafuji$elm_qrcode$QRCode$Matrix$getIndex, size, row, col), 63462 $elm$core$Maybe$Just( 63463 _Utils_Tuple2( 63464 false, 63465 A2($pablohirafuji$elm_qrcode$QRCode$Matrix$bitToColor, _byte, offset)))); 63466 }); 63467var $pablohirafuji$elm_qrcode$QRCode$Matrix$addDataModule = F4( 63468 function (placement, bytes, offset, matrix) { 63469 addDataModule: 63470 while (true) { 63471 var size = placement.dW; 63472 var row = placement.p_; 63473 var col = placement.aG; 63474 if (!bytes.b) { 63475 return matrix; 63476 } else { 63477 var head = bytes.a; 63478 var tail = bytes.b; 63479 if (offset >= 8) { 63480 var $temp$placement = placement, 63481 $temp$bytes = tail, 63482 $temp$offset = 0, 63483 $temp$matrix = matrix; 63484 placement = $temp$placement; 63485 bytes = $temp$bytes; 63486 offset = $temp$offset; 63487 matrix = $temp$matrix; 63488 continue addDataModule; 63489 } else { 63490 if (col === 6) { 63491 var $temp$placement = _Utils_update( 63492 placement, 63493 {aG: col - 1, a7: true}), 63494 $temp$bytes = bytes, 63495 $temp$offset = offset, 63496 $temp$matrix = matrix; 63497 placement = $temp$placement; 63498 bytes = $temp$bytes; 63499 offset = $temp$offset; 63500 matrix = $temp$matrix; 63501 continue addDataModule; 63502 } else { 63503 if (row < 0) { 63504 var $temp$placement = _Utils_update( 63505 placement, 63506 {aG: col - 2, a7: true, dm: false, p_: 0}), 63507 $temp$bytes = bytes, 63508 $temp$offset = offset, 63509 $temp$matrix = matrix; 63510 placement = $temp$placement; 63511 bytes = $temp$bytes; 63512 offset = $temp$offset; 63513 matrix = $temp$matrix; 63514 continue addDataModule; 63515 } else { 63516 if (_Utils_cmp(row, size) > -1) { 63517 var $temp$placement = _Utils_update( 63518 placement, 63519 {aG: col - 2, a7: true, dm: true, p_: size - 1}), 63520 $temp$bytes = bytes, 63521 $temp$offset = offset, 63522 $temp$matrix = matrix; 63523 placement = $temp$placement; 63524 bytes = $temp$bytes; 63525 offset = $temp$offset; 63526 matrix = $temp$matrix; 63527 continue addDataModule; 63528 } else {
63529 if (A4($pablohirafuji$elm_qrcode$QRCode$Matrix$isOccupy, row, col, size, matrix)) { 63530 var $temp$placement = $pablohirafuji$elm_qrcode$QRCode$Matrix$nextModule(placement), 63531 $temp$bytes = bytes, 63532 $temp$offset = offset, 63533 $temp$matrix = matrix; 63534 placement = $temp$placement; 63535 bytes = $temp$bytes; 63536 offset = $temp$offset; 63537 matrix = $temp$matrix; 63538 continue addDataModule; 63539 } else { 63540 var $temp$placement = $pablohirafuji$elm_qrcode$QRCode$Matrix$nextModule(placement), 63541 $temp$bytes = bytes, 63542 $temp$offset = offset + 1, 63543 $temp$matrix = A4($pablohirafuji$elm_qrcode$QRCode$Matrix$setDataModule, placement, head, offset, matrix); 63544 placement = $temp$placement; 63545 bytes = $temp$bytes; 63546 offset = $temp$offset; 63547 matrix = $temp$matrix; 63548 continue addDataModule; 63549 } 63550 } 63551 } 63552 } 63553 } 63554 } 63555 } 63556 }); 63557var $pablohirafuji$elm_qrcode$QRCode$Matrix$initPlacement = function (size) { 63558 return {aG: size + 1, a7: true, dm: true, p_: size + 1, dW: size}; 63559}; 63560var $pablohirafuji$elm_qrcode$QRCode$Matrix$addData = F3( 63561 function (size, bytes, matrix) { 63562 return A4( 63563 $pablohirafuji$elm_qrcode$QRCode$Matrix$addDataModule, 63564 $pablohirafuji$elm_qrcode$QRCode$Matrix$initPlacement(size), 63565 bytes, 63566 0, 63567 matrix); 63568 }); 63569var $pablohirafuji$elm_qrcode$QRCode$Error$AlignmentPatternNotFound = {$: 0}; 63570var $pablohirafuji$elm_qrcode$QRCode$Matrix$alignmentPatternData = $elm$core$Array$fromList( 63571 _List_fromArray( 63572 [ 63573 _List_Nil, 63574 _List_fromArray( 63575 [6, 18]), 63576 _List_fromArray( 63577 [6, 22]), 63578 _List_fromArray( 63579 [6, 26]), 63580 _List_fromArray( 63581 [6, 30]), 63582 _List_fromArray( 63583 [6, 34]), 63584 _List_fromArray( 63585 [6, 22, 38]), 63586 _List_fromArray( 63587 [6, 24, 42]), 63588 _List_fromArray( 63589 [6, 26, 46]), 63590 _List_fromArray( 63591 [6, 28, 50]), 63592 _List_fromArray( 63593 [6, 30, 54]), 63594 _List_fromArray( 63595 [6, 32, 58]), 63596 _List_fromArray( 63597 [6, 34, 62]), 63598 _List_fromArray( 63599 [6, 26, 46, 66]), 63600 _List_fromArray( 63601 [6, 26, 48, 70]), 63602 _List_fromArray( 63603 [6, 26, 50, 74]), 63604 _List_fromArray( 63605 [6, 30, 54, 78]), 63606 _List_fromArray( 63607 [6, 30, 56, 82]), 63608 _List_fromArray( 63609 [6, 30, 58, 86]), 63610 _List_fromArray( 63611 [6, 34, 62, 90]), 63612 _List_fromArray( 63613 [6, 28, 50, 72, 94]), 63614 _List_fromArray( 63615 [6, 26, 50, 74, 98]), 63616 _List_fromArray( 63617 [6, 30, 54, 78, 102]), 63618 _List_fromArray( 63619 [6, 28, 54, 80, 106]), 63620 _List_fromArray( 63621 [6, 32, 58, 84, 110]), 63622 _List_fromArray( 63623 [6, 30, 58, 86, 114]), 63624 _List_fromArray( 63625 [6, 34, 62, 90, 118]), 63626 _List_fromArray( 63627 [6, 26, 50, 74, 98, 122]), 63628 _List_fromArray( 63629 [6, 30, 54, 78, 102, 126]), 63630 _List_fromArray( 63631 [6, 26, 52, 78, 104, 130]), 63632 _List_fromArray( 63633 [6, 30, 56, 82, 108, 134]), 63634 _List_fromArray( 63635 [6, 34, 60, 86, 112, 138]), 63636 _List_fromArray( 63637 [6, 30, 58, 86, 114, 142]), 63638 _List_fromArray( 63639 [6, 34, 62, 90, 118, 146]), 63640 _List_fromArray( 63641 [6, 30, 54, 78, 102, 126, 150]), 63642 _List_fromArray( 63643 [6, 24, 50, 76, 102, 128, 154]), 63644 _List_fromArray( 63645 [6, 28, 54, 80, 106, 132, 158]), 63646 _List_fromArray( 63647 [6, 32, 58, 84, 110, 136, 162]), 63648 _List_fromArray( 63649 [6, 26, 54, 82, 110, 138, 166]), 63650 _List_fromArray( 63651 [6, 30, 58, 86, 114, 142, 170]) 63652 ])); 63653var $elm$core$Result$fromMaybe = F2( 63654 function (err, maybe) { 63655 if (!maybe.$) { 63656 var v = maybe.a; 63657 return $elm$core$Result$Ok(v); 63658 } else { 63659 return $elm$core$Result$Err(err); 63660 } 63661 }); 63662var $pablohirafuji$elm_qrcode$QRCode$Matrix$getAreaCoord = F2( 63663 function (rows, cols) { 63664 return A3( 63665 $elm$core$List$foldl, 63666 F2( 63667 function (row, list) { 63668 return A3( 63669 $elm$core$List$foldl, 63670 F2( 63671 function (col, list_) { 63672 return A2( 63673 $elm$core$List$cons, 63674 _Utils_Tuple2(row, col), 63675 list_); 63676 }), 63677 list, 63678 cols); 63679 }), 63680 _List_Nil, 63681 rows); 63682 }); 63683var $pablohirafuji$elm_qrcode$QRCode$Matrix$isValidAlign = F2( 63684 function (size, _v0) { 63685 var row = _v0.a; 63686 var col = _v0.b; 63687 return ((row > 10) || ((10 < col) && (_Utils_cmp(col, size - 10) < 0))) && ((_Utils_cmp(row, size - 10) < 0) || (col > 10)); 63688 });
63689var $pablohirafuji$elm_qrcode$QRCode$Matrix$alignmentRange = A2($elm$core$List$range, -2, 2); 63690var $pablohirafuji$elm_qrcode$QRCode$Matrix$alignmentColor = F2( 63691 function (row, col) { 63692 return (_Utils_eq(row, -2) || ((row === 2) || (_Utils_eq(col, -2) || ((col === 2) || ((!row) && (!col)))))) ? $elm$core$Maybe$Just( 63693 _Utils_Tuple2(true, true)) : $elm$core$Maybe$Just( 63694 _Utils_Tuple2(true, false)); 63695 }); 63696var $pablohirafuji$elm_qrcode$QRCode$Matrix$setAlignModule = F4( 63697 function (size, rowPos, colPos, _v0) { 63698 var row = _v0.a; 63699 var col = _v0.b; 63700 return A2( 63701 $elm$core$Array$set, 63702 A3($pablohirafuji$elm_qrcode$QRCode$Matrix$getIndex, size, row + rowPos, col + colPos), 63703 A2($pablohirafuji$elm_qrcode$QRCode$Matrix$alignmentColor, row, col)); 63704 }); 63705var $pablohirafuji$elm_qrcode$QRCode$Matrix$setAlignment = F3( 63706 function (size, _v0, matrix) { 63707 var row = _v0.a; 63708 var col = _v0.b; 63709 return A3( 63710 $elm$core$List$foldl, 63711 A3($pablohirafuji$elm_qrcode$QRCode$Matrix$setAlignModule, size, row, col), 63712 matrix, 63713 A2($pablohirafuji$elm_qrcode$QRCode$Matrix$getAreaCoord, $pablohirafuji$elm_qrcode$QRCode$Matrix$alignmentRange, $pablohirafuji$elm_qrcode$QRCode$Matrix$alignmentRange)); 63714 }); 63715var $pablohirafuji$elm_qrcode$QRCode$Matrix$setAlignments = F3( 63716 function (size, locations, matrix) { 63717 return A3( 63718 $elm$core$List$foldl, 63719 $pablohirafuji$elm_qrcode$QRCode$Matrix$setAlignment(size), 63720 matrix, 63721 A2( 63722 $elm$core$List$filter, 63723 $pablohirafuji$elm_qrcode$QRCode$Matrix$isValidAlign(size), 63724 A2($pablohirafuji$elm_qrcode$QRCode$Matrix$getAreaCoord, locations, locations))); 63725 }); 63726var $pablohirafuji$elm_qrcode$QRCode$Matrix$alignmentPattern = F3( 63727 function (version, size, matrix) { 63728 return A2( 63729 $elm$core$Result$map, 63730 function (a) { 63731 return A3($pablohirafuji$elm_qrcode$QRCode$Matrix$setAlignments, size, a, matrix); 63732 }, 63733 A2( 63734 $elm$core$Result$fromMaybe, 63735 $pablohirafuji$elm_qrcode$QRCode$Error$AlignmentPatternNotFound, 63736 A2($elm$core$Array$get, version - 1, $pablohirafuji$elm_qrcode$QRCode$Matrix$alignmentPatternData))); 63737 }); 63738var $pablohirafuji$elm_qrcode$QRCode$Matrix$darkModule = F2( 63739 function (version, size) { 63740 return A2( 63741 $elm$core$Array$set, 63742 A3($pablohirafuji$elm_qrcode$QRCode$Matrix$getIndex, size, (4 * version) + 9, 8), 63743 $elm$core$Maybe$Just( 63744 _Utils_Tuple2(true, true))); 63745 }); 63746var $pablohirafuji$elm_qrcode$QRCode$Matrix$finderRange = A2($elm$core$List$range, 0, 8); 63747var $pablohirafuji$elm_qrcode$QRCode$Matrix$finderColor = F2( 63748 function (row, col) { 63749 return ((1 <= row) && ((row <= 7) && ((col === 1) || (col === 7)))) || (((1 <= col) && ((col <= 7) && ((row === 1) || (row === 7)))) || ((3 <= row) && ((row <= 5) && ((3 <= col) && (col <= 5))))); 63750 }); 63751var $pablohirafuji$elm_qrcode$QRCode$Matrix$setFinder = F5( 63752 function (size, rowOffset, colOffset, _v0, matrix) { 63753 var row = _v0.a; 63754 var col = _v0.b; 63755 var finalRow = row + rowOffset; 63756 var finalCol = col + colOffset; 63757 return ((finalRow < 0) || ((finalCol < 0) || ((_Utils_cmp(finalRow, size) > -1) || (_Utils_cmp(finalCol, size) > -1)))) ? matrix : A3( 63758 $elm$core$Array$set, 63759 A3($pablohirafuji$elm_qrcode$QRCode$Matrix$getIndex, size, finalRow, finalCol), 63760 $elm$core$Maybe$Just( 63761 _Utils_Tuple2( 63762 true, 63763 A2($pablohirafuji$elm_qrcode$QRCode$Matrix$finderColor, row, col))), 63764 matrix); 63765 }); 63766var $pablohirafuji$elm_qrcode$QRCode$Matrix$finderPattern = F4( 63767 function (size, rowOffset, colOffset, matrix) { 63768 return A3( 63769 $elm$core$List$foldl, 63770 A3($pablohirafuji$elm_qrcode$QRCode$Matrix$setFinder, size, rowOffset, colOffset), 63771 matrix, 63772 A2($pablohirafuji$elm_qrcode$QRCode$Matrix$getAreaCoord, $pablohirafuji$elm_qrcode$QRCode$Matrix$finderRange, $pablohirafuji$elm_qrcode$QRCode$Matrix$finderRange)); 63773 }); 63774var $pablohirafuji$elm_qrcode$QRCode$Matrix$applyMaskColor = F2( 63775 function (maybeModule, isChange) { 63776 if (isChange) { 63777 if ((!maybeModule.$) && (!maybeModule.a.a)) { 63778 var _v1 = maybeModule.a; 63779 var isDark = _v1.b; 63780 return $elm$core$Maybe$Just( 63781 _Utils_Tuple2(false, !isDark)); 63782 } else { 63783 return maybeModule; 63784 } 63785 } else { 63786 return maybeModule; 63787 } 63788 });
63789var $pablohirafuji$elm_qrcode$QRCode$Matrix$getCoord = F2( 63790 function (size, index) { 63791 return _Utils_Tuple2( 63792 (index / size) | 0, 63793 A2($elm$core$Basics$modBy, size, index)); 63794 }); 63795var $pablohirafuji$elm_qrcode$QRCode$Matrix$applyMaskFunction = F4( 63796 function (_function, size, index, maybeModule) { 63797 return A2( 63798 $pablohirafuji$elm_qrcode$QRCode$Matrix$applyMaskColor, 63799 maybeModule, 63800 _function( 63801 A2($pablohirafuji$elm_qrcode$QRCode$Matrix$getCoord, size, index))); 63802 }); 63803var $elm$core$Elm$JsArray$indexedMap = _JsArray_indexedMap; 63804var $elm$core$Array$indexedMap = F2( 63805 function (func, _v0) { 63806 var len = _v0.a; 63807 var tree = _v0.c; 63808 var tail = _v0.d; 63809 var initialBuilder = { 63810 Q: _List_Nil, 63811 I: 0, 63812 ky: A3( 63813 $elm$core$Elm$JsArray$indexedMap, 63814 func, 63815 $elm$core$Array$tailIndex(len), 63816 tail) 63817 }; 63818 var helper = F2( 63819 function (node, builder) { 63820 if (!node.$) { 63821 var subTree = node.a; 63822 return A3($elm$core$Elm$JsArray$foldl, helper, builder, subTree); 63823 } else { 63824 var leaf = node.a; 63825 var offset = builder.I * $elm$core$Array$branchFactor; 63826 var mappedLeaf = $elm$core$Array$Leaf( 63827 A3($elm$core$Elm$JsArray$indexedMap, func, offset, leaf)); 63828 return { 63829 Q: A2($elm$core$List$cons, mappedLeaf, builder.Q), 63830 I: builder.I + 1, 63831 ky: builder.ky 63832 }; 63833 } 63834 }); 63835 return A2( 63836 $elm$core$Array$builderToArray, 63837 true, 63838 A3($elm$core$Elm$JsArray$foldl, helper, initialBuilder, tree)); 63839 }); 63840var $pablohirafuji$elm_qrcode$QRCode$Matrix$maskFunction = function (mask) { 63841 switch (mask) { 63842 case 0: 63843 return function (_v1) { 63844 var row = _v1.a; 63845 var col = _v1.b; 63846 return !A2($elm$core$Basics$modBy, 2, row + col); 63847 }; 63848 case 1: 63849 return function (_v2) { 63850 var row = _v2.a; 63851 return !A2($elm$core$Basics$modBy, 2, row); 63852 }; 63853 case 2: 63854 return function (_v3) { 63855 var col = _v3.b; 63856 return !A2($elm$core$Basics$modBy, 3, col); 63857 }; 63858 case 3: 63859 return function (_v4) { 63860 var row = _v4.a; 63861 var col = _v4.b; 63862 return !A2($elm$core$Basics$modBy, 3, row + col); 63863 }; 63864 case 4: 63865 return function (_v5) { 63866 var row = _v5.a; 63867 var col = _v5.b; 63868 return !A2( 63869 $elm$core$Basics$modBy, 63870 2, 63871 $elm$core$Basics$floor(row / 2) + $elm$core$Basics$floor(col / 3)); 63872 }; 63873 case 5: 63874 return function (_v6) { 63875 var row = _v6.a; 63876 var col = _v6.b; 63877 return !(A2($elm$core$Basics$modBy, 2, row * col) + A2($elm$core$Basics$modBy, 3, row * col)); 63878 }; 63879 case 6: 63880 return function (_v7) { 63881 var row = _v7.a; 63882 var col = _v7.b; 63883 return !A2( 63884 $elm$core$Basics$modBy, 63885 2, 63886 A2($elm$core$Basics$modBy, 2, row * col) + A2($elm$core$Basics$modBy, 3, row * col)); 63887 }; 63888 default: 63889 return function (_v8) { 63890 var row = _v8.a; 63891 var col = _v8.b; 63892 return !A2( 63893 $elm$core$Basics$modBy, 63894 2, 63895 A2($elm$core$Basics$modBy, 3, row * col) + A2($elm$core$Basics$modBy, 2, row + col)); 63896 }; 63897 } 63898}; 63899var $pablohirafuji$elm_qrcode$QRCode$Matrix$applyMask = F3( 63900 function (size, mask, matrix) { 63901 return A2( 63902 $elm$core$Array$indexedMap, 63903 A2( 63904 $pablohirafuji$elm_qrcode$QRCode$Matrix$applyMaskFunction, 63905 $pablohirafuji$elm_qrcode$QRCode$Matrix$maskFunction(mask), 63906 size), 63907 matrix); 63908 }); 63909var $pablohirafuji$elm_qrcode$QRCode$Matrix$breakList = F3( 63910 function (width, list, acc) { 63911 breakList: 63912 while (true) { 63913 if (!list.b) { 63914 return $elm$core$List$reverse(acc); 63915 } else { 63916 var $temp$width = width, 63917 $temp$list = A2($elm$core$List$drop, width, list), 63918 $temp$acc = A2( 63919 $elm$core$List$cons, 63920 A2($elm$core$List$take, width, list), 63921 acc); 63922 width = $temp$width; 63923 list = $temp$list; 63924 acc = $temp$acc; 63925 continue breakList; 63926 } 63927 } 63928 }); 63929var $pablohirafuji$elm_qrcode$QRCode$Matrix$isDarkModule = A2( 63930 $elm$core$Basics$composeR, 63931 $elm$core$Maybe$map($elm$core$Tuple$second), 63932 $elm$core$Maybe$withDefault(false)); 63933var $pablohirafuji$elm_qrcode$QRCode$Matrix$rule1Score_ = F2( 63934 function (simplifiedList, _v0) { 63935 rule1Score_: 63936 while (true) { 63937 var last = _v0.a; 63938 var partialScore = _v0.b; 63939 var score = _v0.c; 63940 if (!simplifiedList.b) { 63941 return (partialScore >= 5) ? ((score + partialScore) - 2) : score; 63942 } else { 63943 var head = simplifiedList.a; 63944 var tail = simplifiedList.b; 63945 if (_Utils_eq(last, head)) { 63946 var $temp$simplifiedList = tail, 63947 $temp$_v0 = _Utils_Tuple3(last, partialScore + 1, score); 63948 simplifiedList = $temp$simplifiedList; 63949 _v0 = $temp$_v0; 63950 continue rule1Score_; 63951 } else { 63952 if (partialScore >= 5) { 63953 var $temp$simplifiedList = tail, 63954 $temp$_v0 = _Utils_Tuple3(head, 0, (score + partialScore) - 2); 63955 simplifiedList = $temp$simplifiedList; 63956 _v0 = $temp$_v0; 63957 continue rule1Score_; 63958 } else { 63959 var $temp$simplifiedList = tail, 63960 $temp$_v0 = _Utils_Tuple3(head, 0, score); 63961 simplifiedList = $temp$simplifiedList; 63962 _v0 = $temp$_v0; 63963 continue rule1Score_; 63964 } 63965 } 63966 } 63967 } 63968 });
63969var $pablohirafuji$elm_qrcode$QRCode$Matrix$rule1Score = A2( 63970 $elm$core$Basics$composeR, 63971 $elm$core$List$map( 63972 function (a) { 63973 return A2( 63974 $pablohirafuji$elm_qrcode$QRCode$Matrix$rule1Score_, 63975 a, 63976 _Utils_Tuple3(false, 0, 0)); 63977 }), 63978 $elm$core$List$sum); 63979var $pablohirafuji$elm_qrcode$QRCode$Matrix$rule2Score_ = F4( 63980 function (row1, row2, maybeLast, score) { 63981 rule2Score_: 63982 while (true) { 63983 if (!row1.b) { 63984 return score; 63985 } else { 63986 var head = row1.a; 63987 var tail = row1.b; 63988 if (!row2.b) { 63989 return score; 63990 } else { 63991 var head2 = row2.a; 63992 var tail2 = row2.b; 63993 if (_Utils_eq(head, head2)) { 63994 if (_Utils_eq( 63995 $elm$core$Maybe$Just(head), 63996 maybeLast)) { 63997 var $temp$row1 = tail, 63998 $temp$row2 = tail2, 63999 $temp$maybeLast = $elm$core$Maybe$Just(head), 64000 $temp$score = score + 3; 64001 row1 = $temp$row1; 64002 row2 = $temp$row2; 64003 maybeLast = $temp$maybeLast; 64004 score = $temp$score; 64005 continue rule2Score_; 64006 } else { 64007 var $temp$row1 = tail, 64008 $temp$row2 = tail2, 64009 $temp$maybeLast = $elm$core$Maybe$Just(head), 64010 $temp$score = score; 64011 row1 = $temp$row1; 64012 row2 = $temp$row2; 64013 maybeLast = $temp$maybeLast; 64014 score = $temp$score; 64015 continue rule2Score_; 64016 } 64017 } else { 64018 var $temp$row1 = tail, 64019 $temp$row2 = tail2, 64020 $temp$maybeLast = $elm$core$Maybe$Nothing, 64021 $temp$score = score; 64022 row1 = $temp$row1; 64023 row2 = $temp$row2; 64024 maybeLast = $temp$maybeLast; 64025 score = $temp$score; 64026 continue rule2Score_; 64027 } 64028 } 64029 } 64030 } 64031 }); 64032var $pablohirafuji$elm_qrcode$QRCode$Matrix$rule2Score = F2( 64033 function (list, score) { 64034 rule2Score: 64035 while (true) { 64036 if (list.b && list.b.b) { 64037 var head1 = list.a; 64038 var _v1 = list.b; 64039 var head2 = _v1.a; 64040 var tail = _v1.b; 64041 var $temp$list = tail, 64042 $temp$score = score + A4($pablohirafuji$elm_qrcode$QRCode$Matrix$rule2Score_, head1, head2, $elm$core$Maybe$Nothing, 0); 64043 list = $temp$list; 64044 score = $temp$score; 64045 continue rule2Score; 64046 } else { 64047 return score; 64048 } 64049 } 64050 }); 64051var $pablohirafuji$elm_qrcode$QRCode$Matrix$rule3Score_ = F2( 64052 function (simplifiedList, score) { 64053 rule3Score_: 64054 while (true) { 64055 _v0$3: 64056 while (true) { 64057 if (!simplifiedList.b) { 64058 return score; 64059 } else { 64060 if (!simplifiedList.a) { 64061 if (((((((((((((((((((simplifiedList.b.b && (!simplifiedList.b.a)) && simplifiedList.b.b.b) && (!simplifiedList.b.b.a)) && simplifiedList.b.b.b.b) && (!simplifiedList.b.b.b.a)) && simplifiedList.b.b.b.b.b) && simplifiedList.b.b.b.b.a) && simplifiedList.b.b.b.b.b.b) && (!simplifiedList.b.b.b.b.b.a)) && simplifiedList.b.b.b.b.b.b.b) && simplifiedList.b.b.b.b.b.b.a) && simplifiedList.b.b.b.b.b.b.b.b) && simplifiedList.b.b.b.b.b.b.b.a) && simplifiedList.b.b.b.b.b.b.b.b.b) && simplifiedList.b.b.b.b.b.b.b.b.a) && simplifiedList.b.b.b.b.b.b.b.b.b.b) && (!simplifiedList.b.b.b.b.b.b.b.b.b.a)) && simplifiedList.b.b.b.b.b.b.b.b.b.b.b) && simplifiedList.b.b.b.b.b.b.b.b.b.b.a) { 64062 var _v1 = simplifiedList.b; 64063 var _v2 = _v1.b; 64064 var _v3 = _v2.b; 64065 var _v4 = _v3.b; 64066 var _v5 = _v4.b; 64067 var _v6 = _v5.b; 64068 var _v7 = _v6.b; 64069 var _v8 = _v7.b; 64070 var _v9 = _v8.b; 64071 var _v10 = _v9.b; 64072 var tail = _v10.b; 64073 var $temp$simplifiedList = tail, 64074 $temp$score = score + 40; 64075 simplifiedList = $temp$simplifiedList; 64076 score = $temp$score; 64077 continue rule3Score_; 64078 } else { 64079 break _v0$3; 64080 } 64081 } else { 64082 if (((((((((((((((((((simplifiedList.b.b && (!simplifiedList.b.a)) && simplifiedList.b.b.b) && simplifiedList.b.b.a) && simplifiedList.b.b.b.b) && simplifiedList.b.b.b.a) && simplifiedList.b.b.b.b.b) && simplifiedList.b.b.b.b.a) && simplifiedList.b.b.b.b.b.b) && (!simplifiedList.b.b.b.b.b.a)) && simplifiedList.b.b.b.b.b.b.b) && simplifiedList.b.b.b.b.b.b.a) && simplifiedList.b.b.b.b.b.b.b.b) && (!simplifiedList.b.b.b.b.b.b.b.a)) && simplifiedList.b.b.b.b.b.b.b.b.b) && (!simplifiedList.b.b.b.b.b.b.b.b.a)) && simplifiedList.b.b.b.b.b.b.b.b.b.b) && (!simplifiedList.b.b.b.b.b.b.b.b.b.a)) && simplifiedList.b.b.b.b.b.b.b.b.b.b.b) && (!simplifiedList.b.b.b.b.b.b.b.b.b.b.a)) { 64083 var _v11 = simplifiedList.b; 64084 var _v12 = _v11.b; 64085 var _v13 = _v12.b; 64086 var _v14 = _v13.b; 64087 var _v15 = _v14.b;
64088 var _v16 = _v15.b; 64089 var _v17 = _v16.b; 64090 var _v18 = _v17.b; 64091 var _v19 = _v18.b; 64092 var _v20 = _v19.b; 64093 var tail = _v20.b; 64094 var $temp$simplifiedList = tail, 64095 $temp$score = score + 40; 64096 simplifiedList = $temp$simplifiedList; 64097 score = $temp$score; 64098 continue rule3Score_; 64099 } else { 64100 break _v0$3; 64101 } 64102 } 64103 } 64104 } 64105 var head = simplifiedList.a; 64106 var tail = simplifiedList.b; 64107 var $temp$simplifiedList = tail, 64108 $temp$score = score; 64109 simplifiedList = $temp$simplifiedList; 64110 score = $temp$score; 64111 continue rule3Score_; 64112 } 64113 }); 64114var $pablohirafuji$elm_qrcode$QRCode$Matrix$rule3Score = A2($elm$core$List$foldl, $pablohirafuji$elm_qrcode$QRCode$Matrix$rule3Score_, 0); 64115var $pablohirafuji$elm_qrcode$QRCode$Matrix$rule4Score = F2( 64116 function (size, simplifiedList) { 64117 var moduleCount = size * size; 64118 var darkCount = $elm$core$List$length( 64119 A2($elm$core$List$filter, $elm$core$Basics$identity, simplifiedList)); 64120 var darkPerc = $elm$core$Basics$round((100 * darkCount) / moduleCount); 64121 var remOf5 = darkPerc % 5; 64122 var nextMult5 = $elm$core$Basics$round( 64123 $elm$core$Basics$abs((darkPerc + (5 - remOf5)) - 50) / 5); 64124 var prevMult5 = $elm$core$Basics$round( 64125 $elm$core$Basics$abs((darkPerc - remOf5) - 50) / 5); 64126 return A2($elm$core$Basics$min, prevMult5, nextMult5) * 10; 64127 }); 64128var $elm$core$List$tail = function (list) { 64129 if (list.b) { 64130 var x = list.a; 64131 var xs = list.b; 64132 return $elm$core$Maybe$Just(xs); 64133 } else { 64134 return $elm$core$Maybe$Nothing; 64135 } 64136}; 64137var $pablohirafuji$elm_qrcode$QRCode$Helpers$transpose = function (ll) { 64138 transpose: 64139 while (true) { 64140 if (!ll.b) { 64141 return _List_Nil; 64142 } else { 64143 if (!ll.a.b) { 64144 var xss = ll.b; 64145 var $temp$ll = xss; 64146 ll = $temp$ll; 64147 continue transpose; 64148 } else { 64149 var _v1 = ll.a; 64150 var x = _v1.a; 64151 var xs = _v1.b; 64152 var xss = ll.b; 64153 var tails = A2($elm$core$List$filterMap, $elm$core$List$tail, xss); 64154 var heads = A2($elm$core$List$filterMap, $elm$core$List$head, xss); 64155 return A2( 64156 $elm$core$List$cons, 64157 A2($elm$core$List$cons, x, heads), 64158 $pablohirafuji$elm_qrcode$QRCode$Helpers$transpose( 64159 A2($elm$core$List$cons, xs, tails))); 64160 } 64161 } 64162 } 64163}; 64164var $pablohirafuji$elm_qrcode$QRCode$Matrix$getMaskScore = F2( 64165 function (size, matrix) { 64166 var list = A2( 64167 $elm$core$List$map, 64168 $pablohirafuji$elm_qrcode$QRCode$Matrix$isDarkModule, 64169 $elm$core$Array$toList(matrix)); 64170 var rowList = A3($pablohirafuji$elm_qrcode$QRCode$Matrix$breakList, size, list, _List_Nil); 64171 var transposedRowList = $pablohirafuji$elm_qrcode$QRCode$Helpers$transpose(rowList); 64172 return function (b) { 64173 return _Utils_Tuple2(rowList, b); 64174 }( 64175 A2($pablohirafuji$elm_qrcode$QRCode$Matrix$rule4Score, size, list) + ($pablohirafuji$elm_qrcode$QRCode$Matrix$rule3Score(transposedRowList) + ($pablohirafuji$elm_qrcode$QRCode$Matrix$rule3Score(rowList) + (A2($pablohirafuji$elm_qrcode$QRCode$Matrix$rule2Score, rowList, 0) + ($pablohirafuji$elm_qrcode$QRCode$Matrix$rule1Score(transposedRowList) + $pablohirafuji$elm_qrcode$QRCode$Matrix$rule1Score(rowList)))))); 64176 }); 64177var $pablohirafuji$elm_qrcode$QRCode$Matrix$ecLevelToInt = function (ecLevel) { 64178 switch (ecLevel) { 64179 case 0: 64180 return 1; 64181 case 1: 64182 return 0; 64183 case 2: 64184 return 3; 64185 default: 64186 return 2; 64187 } 64188}; 64189var $pablohirafuji$elm_qrcode$QRCode$Matrix$getBCHDigit = function (_int) { 64190 var helper = F2( 64191 function (digit, int_) { 64192 helper: 64193 while (true) { 64194 if (!(!int_)) { 64195 var $temp$digit = digit + 1, 64196 $temp$int_ = int_ >>> 1; 64197 digit = $temp$digit; 64198 int_ = $temp$int_; 64199 continue helper; 64200 } else { 64201 return digit; 64202 } 64203 } 64204 }); 64205 return A2(helper, 0, _int); 64206}; 64207var $pablohirafuji$elm_qrcode$QRCode$Matrix$maskToInt = function (mask) { 64208 switch (mask) { 64209 case 0: 64210 return 0; 64211 case 1: 64212 return 1; 64213 case 2: 64214 return 2; 64215 case 3: 64216 return 3; 64217 case 4: 64218 return 4; 64219 case 5: 64220 return 5; 64221 case 6: 64222 return 6; 64223 default: 64224 return 7; 64225 } 64226}; 64227var $pablohirafuji$elm_qrcode$QRCode$Matrix$encodeFormatInfo = F2( 64228 function (ecLevel, mask) { 64229 var g15Mask = 21522; 64230 var g15Int = 1335;
64231 var g15Digit = $pablohirafuji$elm_qrcode$QRCode$Matrix$getBCHDigit(g15Int); 64232 var formatInfoInt = $pablohirafuji$elm_qrcode$QRCode$Matrix$maskToInt(mask) | ($pablohirafuji$elm_qrcode$QRCode$Matrix$ecLevelToInt(ecLevel) << 3); 64233 var helper = function (d_) { 64234 helper: 64235 while (true) { 64236 if (($pablohirafuji$elm_qrcode$QRCode$Matrix$getBCHDigit(d_) - g15Digit) >= 0) { 64237 var $temp$d_ = d_ ^ (g15Int << ($pablohirafuji$elm_qrcode$QRCode$Matrix$getBCHDigit(d_) - g15Digit)); 64238 d_ = $temp$d_; 64239 continue helper; 64240 } else { 64241 return g15Mask ^ (d_ | (formatInfoInt << 10)); 64242 } 64243 } 64244 }; 64245 var d = formatInfoInt << 10; 64246 return helper(d); 64247 }); 64248var $pablohirafuji$elm_qrcode$QRCode$Matrix$formatInfoHorizontal = F2( 64249 function (size, count) { 64250 return (count < 8) ? _Utils_Tuple2(8, (size - count) - 1) : ((count < 9) ? _Utils_Tuple2(8, 15 - count) : _Utils_Tuple2(8, (15 - count) - 1)); 64251 }); 64252var $pablohirafuji$elm_qrcode$QRCode$Matrix$formatInfoVertical = F2( 64253 function (size, count) { 64254 return (count < 6) ? _Utils_Tuple2(count, 8) : ((count < 8) ? _Utils_Tuple2(count + 1, 8) : _Utils_Tuple2((size - 15) + count, 8)); 64255 }); 64256var $pablohirafuji$elm_qrcode$QRCode$Matrix$setFormatModule = F4( 64257 function (size, isBlack, row, col) { 64258 return A2( 64259 $elm$core$Array$set, 64260 A3($pablohirafuji$elm_qrcode$QRCode$Matrix$getIndex, size, row, col), 64261 $elm$core$Maybe$Just( 64262 _Utils_Tuple2(true, isBlack))); 64263 }); 64264var $pablohirafuji$elm_qrcode$QRCode$Matrix$setFormatInfo_ = F4( 64265 function (size, isBlackFn, count, matrix) { 64266 setFormatInfo_: 64267 while (true) { 64268 if (count < 15) { 64269 var isBlack = isBlackFn(count); 64270 var _v0 = A2($pablohirafuji$elm_qrcode$QRCode$Matrix$formatInfoVertical, size, count); 64271 var x2 = _v0.a; 64272 var y2 = _v0.b; 64273 var _v1 = A2($pablohirafuji$elm_qrcode$QRCode$Matrix$formatInfoHorizontal, size, count); 64274 var x1 = _v1.a; 64275 var y1 = _v1.b; 64276 var $temp$size = size, 64277 $temp$isBlackFn = isBlackFn, 64278 $temp$count = count + 1, 64279 $temp$matrix = A5( 64280 $pablohirafuji$elm_qrcode$QRCode$Matrix$setFormatModule, 64281 size, 64282 isBlack, 64283 x2, 64284 y2, 64285 A5($pablohirafuji$elm_qrcode$QRCode$Matrix$setFormatModule, size, isBlack, x1, y1, matrix)); 64286 size = $temp$size; 64287 isBlackFn = $temp$isBlackFn; 64288 count = $temp$count; 64289 matrix = $temp$matrix; 64290 continue setFormatInfo_; 64291 } else { 64292 return matrix; 64293 } 64294 } 64295 }); 64296var $pablohirafuji$elm_qrcode$QRCode$Matrix$setFormatInfo = F4( 64297 function (ecLevel, size, mask, matrix) { 64298 var isBlack = F2( 64299 function (bits_, count) { 64300 return (1 & (bits_ >> count)) === 1; 64301 }); 64302 var bits = A2($pablohirafuji$elm_qrcode$QRCode$Matrix$encodeFormatInfo, ecLevel, mask); 64303 return A4( 64304 $pablohirafuji$elm_qrcode$QRCode$Matrix$setFormatInfo_, 64305 size, 64306 isBlack(bits), 64307 0, 64308 matrix); 64309 }); 64310var $pablohirafuji$elm_qrcode$QRCode$Matrix$getBestMask_ = F5( 64311 function (ecLevel, size, matrix, mask, _v0) { 64312 var minSMatrix = _v0.a; 64313 var minScore = _v0.b; 64314 var maskedMatrix = A4( 64315 $pablohirafuji$elm_qrcode$QRCode$Matrix$setFormatInfo, 64316 ecLevel, 64317 size, 64318 mask, 64319 A3($pablohirafuji$elm_qrcode$QRCode$Matrix$applyMask, size, mask, matrix)); 64320 var _v1 = A2($pablohirafuji$elm_qrcode$QRCode$Matrix$getMaskScore, size, maskedMatrix); 64321 var maskSMatrix = _v1.a; 64322 var maskScore = _v1.b; 64323 return ((_Utils_cmp(minScore, maskScore) < 0) && (!_Utils_eq(minScore, -1))) ? _Utils_Tuple2(minSMatrix, minScore) : _Utils_Tuple2(maskSMatrix, maskScore); 64324 }); 64325var $pablohirafuji$elm_qrcode$QRCode$Matrix$Pattern0 = 0; 64326var $pablohirafuji$elm_qrcode$QRCode$Matrix$Pattern1 = 1; 64327var $pablohirafuji$elm_qrcode$QRCode$Matrix$Pattern2 = 2; 64328var $pablohirafuji$elm_qrcode$QRCode$Matrix$Pattern3 = 3; 64329var $pablohirafuji$elm_qrcode$QRCode$Matrix$Pattern4 = 4; 64330var $pablohirafuji$elm_qrcode$QRCode$Matrix$Pattern5 = 5; 64331var $pablohirafuji$elm_qrcode$QRCode$Matrix$Pattern6 = 6; 64332var $pablohirafuji$elm_qrcode$QRCode$Matrix$Pattern7 = 7; 64333var $pablohirafuji$elm_qrcode$QRCode$Matrix$patternList = _List_fromArray( 64334 [0, 1, 2, 3, 4, 5, 6, 7]); 64335var $pablohirafuji$elm_qrcode$QRCode$Matrix$getBestMask = F3(
64336 function (ecLevel, size, matrix) { 64337 return A3( 64338 $elm$core$List$foldl, 64339 A3($pablohirafuji$elm_qrcode$QRCode$Matrix$getBestMask_, ecLevel, size, matrix), 64340 _Utils_Tuple2(_List_Nil, -1), 64341 $pablohirafuji$elm_qrcode$QRCode$Matrix$patternList).a; 64342 }); 64343var $pablohirafuji$elm_qrcode$QRCode$Matrix$reserveFormatInfo = F2( 64344 function (size, matrix) { 64345 return A4( 64346 $pablohirafuji$elm_qrcode$QRCode$Matrix$setFormatInfo_, 64347 size, 64348 $elm$core$Basics$always(true), 64349 0, 64350 matrix); 64351 }); 64352var $pablohirafuji$elm_qrcode$QRCode$Matrix$encodeVersionInfo = function (version) { 64353 var g18Int = 7973; 64354 var g18Digit = $pablohirafuji$elm_qrcode$QRCode$Matrix$getBCHDigit(g18Int); 64355 var helper = function (d_) { 64356 helper: 64357 while (true) { 64358 if (($pablohirafuji$elm_qrcode$QRCode$Matrix$getBCHDigit(d_) - g18Digit) >= 0) { 64359 var $temp$d_ = d_ ^ (g18Int << ($pablohirafuji$elm_qrcode$QRCode$Matrix$getBCHDigit(d_) - g18Digit)); 64360 d_ = $temp$d_; 64361 continue helper; 64362 } else { 64363 return d_ | (version << 12); 64364 } 64365 } 64366 }; 64367 var d = version << 12; 64368 return helper(d); 64369}; 64370var $pablohirafuji$elm_qrcode$QRCode$Matrix$setVersionModule = F3( 64371 function (size, isBlack, _v0) { 64372 var row = _v0.a; 64373 var col = _v0.b; 64374 return A2( 64375 $elm$core$Array$set, 64376 A3($pablohirafuji$elm_qrcode$QRCode$Matrix$getIndex, size, row, col), 64377 $elm$core$Maybe$Just( 64378 _Utils_Tuple2(true, isBlack))); 64379 }); 64380var $pablohirafuji$elm_qrcode$QRCode$Matrix$setVersionInfo_ = F4( 64381 function (size, isBlackFn, count, matrix) { 64382 setVersionInfo_: 64383 while (true) { 64384 if (count < 18) { 64385 var topRight = _Utils_Tuple2( 64386 $elm$core$Basics$floor(count / 3), 64387 ((A2($elm$core$Basics$modBy, 3, count) + size) - 8) - 3); 64388 var isBlack = isBlackFn(count); 64389 var bottomLeft = _Utils_Tuple2( 64390 ((A2($elm$core$Basics$modBy, 3, count) + size) - 8) - 3, 64391 $elm$core$Basics$floor(count / 3)); 64392 var $temp$size = size, 64393 $temp$isBlackFn = isBlackFn, 64394 $temp$count = count + 1, 64395 $temp$matrix = A4( 64396 $pablohirafuji$elm_qrcode$QRCode$Matrix$setVersionModule, 64397 size, 64398 isBlack, 64399 bottomLeft, 64400 A4($pablohirafuji$elm_qrcode$QRCode$Matrix$setVersionModule, size, isBlack, topRight, matrix)); 64401 size = $temp$size; 64402 isBlackFn = $temp$isBlackFn; 64403 count = $temp$count; 64404 matrix = $temp$matrix; 64405 continue setVersionInfo_; 64406 } else { 64407 return matrix; 64408 } 64409 } 64410 }); 64411var $pablohirafuji$elm_qrcode$QRCode$Matrix$setVersionInfo = F3( 64412 function (version, size, matrix) { 64413 if (version >= 7) { 64414 var isBlack = F2( 64415 function (bits_, count) { 64416 return (1 & (bits_ >> count)) === 1; 64417 }); 64418 var bits = $pablohirafuji$elm_qrcode$QRCode$Matrix$encodeVersionInfo(version); 64419 return A4( 64420 $pablohirafuji$elm_qrcode$QRCode$Matrix$setVersionInfo_, 64421 size, 64422 isBlack(bits), 64423 0, 64424 matrix); 64425 } else { 64426 return matrix; 64427 } 64428 }); 64429var $pablohirafuji$elm_qrcode$QRCode$Matrix$timingColor = F2( 64430 function (row, col) { 64431 return (!A2($elm$core$Basics$modBy, 2, row + col)) ? $elm$core$Maybe$Just( 64432 _Utils_Tuple2(true, true)) : $elm$core$Maybe$Just( 64433 _Utils_Tuple2(true, false)); 64434 }); 64435var $pablohirafuji$elm_qrcode$QRCode$Matrix$setTiming = F3( 64436 function (size, row, col) { 64437 return A2( 64438 $elm$core$Array$set, 64439 A3($pablohirafuji$elm_qrcode$QRCode$Matrix$getIndex, size, row, col), 64440 A2($pablohirafuji$elm_qrcode$QRCode$Matrix$timingColor, row, col)); 64441 }); 64442var $pablohirafuji$elm_qrcode$QRCode$Matrix$timingPattern = F2( 64443 function (size, matrix) { 64444 var range = A2($elm$core$List$range, 8, size - 9); 64445 return A3( 64446 $elm$core$List$foldl, 64447 function (b) { 64448 return A3($pablohirafuji$elm_qrcode$QRCode$Matrix$setTiming, size, b, 6); 64449 }, 64450 A3( 64451 $elm$core$List$foldl, 64452 A2($pablohirafuji$elm_qrcode$QRCode$Matrix$setTiming, size, 6), 64453 matrix, 64454 range), 64455 range); 64456 }); 64457var $pablohirafuji$elm_qrcode$QRCode$Matrix$apply = function (_v0) { 64458 var ecLevel = _v0.a.ir; 64459 var groupInfo = _v0.a.mT; 64460 var bytes = _v0.b; 64461 var version = groupInfo.fK; 64462 var size = ((version - 1) * 4) + 21; 64463 return A2( 64464 $elm$core$Result$map, 64465 A2($pablohirafuji$elm_qrcode$QRCode$Matrix$getBestMask, ecLevel, size), 64466 A2( 64467 $elm$core$Result$map,
64468 A2($pablohirafuji$elm_qrcode$QRCode$Matrix$addData, size, bytes), 64469 A3( 64470 $pablohirafuji$elm_qrcode$QRCode$Matrix$alignmentPattern, 64471 version, 64472 size, 64473 A2( 64474 $pablohirafuji$elm_qrcode$QRCode$Matrix$timingPattern, 64475 size, 64476 A3( 64477 $pablohirafuji$elm_qrcode$QRCode$Matrix$darkModule, 64478 version, 64479 size, 64480 A3( 64481 $pablohirafuji$elm_qrcode$QRCode$Matrix$setVersionInfo, 64482 version, 64483 size, 64484 A2( 64485 $pablohirafuji$elm_qrcode$QRCode$Matrix$reserveFormatInfo, 64486 size, 64487 A4( 64488 $pablohirafuji$elm_qrcode$QRCode$Matrix$finderPattern, 64489 size, 64490 -1, 64491 size - 8, 64492 A4( 64493 $pablohirafuji$elm_qrcode$QRCode$Matrix$finderPattern, 64494 size, 64495 size - 8, 64496 -1, 64497 A4( 64498 $pablohirafuji$elm_qrcode$QRCode$Matrix$finderPattern, 64499 size, 64500 -1, 64501 -1, 64502 A2( 64503 $elm$core$Array$initialize, 64504 size * size, 64505 $elm$core$Basics$always($elm$core$Maybe$Nothing)))))))))))); 64506}; 64507var $pablohirafuji$elm_qrcode$QRCode$ECLevel$H = 3; 64508var $pablohirafuji$elm_qrcode$QRCode$ECLevel$L = 0; 64509var $pablohirafuji$elm_qrcode$QRCode$ECLevel$M = 1; 64510var $pablohirafuji$elm_qrcode$QRCode$ECLevel$Q = 2; 64511var $pablohirafuji$elm_qrcode$QRCode$convertEC = function (ec) { 64512 switch (ec) { 64513 case 0: 64514 return 0; 64515 case 1: 64516 return 1; 64517 case 2: 64518 return 2; 64519 default: 64520 return 3; 64521 } 64522}; 64523var $pablohirafuji$elm_qrcode$QRCode$AlignmentPatternNotFound = {$: 0}; 64524var $pablohirafuji$elm_qrcode$QRCode$InputLengthOverflow = {$: 7}; 64525var $pablohirafuji$elm_qrcode$QRCode$InvalidAlphanumericChar = {$: 2}; 64526var $pablohirafuji$elm_qrcode$QRCode$InvalidNumericChar = {$: 1}; 64527var $pablohirafuji$elm_qrcode$QRCode$InvalidUTF8Char = {$: 3}; 64528var $pablohirafuji$elm_qrcode$QRCode$LogTableException = function (a) { 64529 return {$: 4, a: a}; 64530}; 64531var $pablohirafuji$elm_qrcode$QRCode$PolynomialModException = {$: 6}; 64532var $pablohirafuji$elm_qrcode$QRCode$PolynomialMultiplyException = {$: 5}; 64533var $pablohirafuji$elm_qrcode$QRCode$convertError = function (e) { 64534 switch (e.$) { 64535 case 0: 64536 return $pablohirafuji$elm_qrcode$QRCode$AlignmentPatternNotFound; 64537 case 1: 64538 return $pablohirafuji$elm_qrcode$QRCode$InvalidNumericChar; 64539 case 2: 64540 return $pablohirafuji$elm_qrcode$QRCode$InvalidAlphanumericChar; 64541 case 3: 64542 return $pablohirafuji$elm_qrcode$QRCode$InvalidUTF8Char; 64543 case 4: 64544 var n = e.a; 64545 return $pablohirafuji$elm_qrcode$QRCode$LogTableException(n); 64546 case 5: 64547 return $pablohirafuji$elm_qrcode$QRCode$PolynomialMultiplyException; 64548 case 6: 64549 return $pablohirafuji$elm_qrcode$QRCode$PolynomialModException; 64550 default: 64551 return $pablohirafuji$elm_qrcode$QRCode$InputLengthOverflow; 64552 } 64553}; 64554var $pablohirafuji$elm_qrcode$QRCode$Encode$firstFillerByte = 236; 64555var $elm$core$List$repeatHelp = F3( 64556 function (result, n, value) { 64557 repeatHelp: 64558 while (true) { 64559 if (n <= 0) { 64560 return result; 64561 } else { 64562 var $temp$result = A2($elm$core$List$cons, value, result), 64563 $temp$n = n - 1, 64564 $temp$value = value; 64565 result = $temp$result; 64566 n = $temp$n; 64567 value = $temp$value; 64568 continue repeatHelp; 64569 } 64570 } 64571 }); 64572var $elm$core$List$repeat = F2( 64573 function (n, value) { 64574 return A3($elm$core$List$repeatHelp, _List_Nil, n, value); 64575 }); 64576var $pablohirafuji$elm_qrcode$QRCode$Encode$secondFillerByte = 17; 64577var $pablohirafuji$elm_qrcode$QRCode$Encode$addFiller = F2( 64578 function (capacity, bytes) { 64579 var fillerLength = ((capacity / 8) | 0) - $elm$core$List$length(bytes); 64580 var ns = $elm$core$List$concat( 64581 A2( 64582 $elm$core$List$repeat, 64583 (fillerLength / 2) | 0, 64584 _List_fromArray( 64585 [$pablohirafuji$elm_qrcode$QRCode$Encode$firstFillerByte, $pablohirafuji$elm_qrcode$QRCode$Encode$secondFillerByte]))); 64586 return (!A2($elm$core$Basics$modBy, 2, fillerLength)) ? _Utils_ap(bytes, ns) : _Utils_ap( 64587 bytes, 64588 _Utils_ap( 64589 ns, 64590 _List_fromArray( 64591 [$pablohirafuji$elm_qrcode$QRCode$Encode$firstFillerByte]))); 64592 }); 64593var $pablohirafuji$elm_qrcode$QRCode$Encode$addTerminator = F3( 64594 function (capacity, bitsCount, bits) { 64595 return _Utils_ap( 64596 bits, 64597 _List_fromArray( 64598 [ 64599 _Utils_Tuple2( 64600 0, 64601 A2($elm$core$Basics$min, 4, capacity - bitsCount)) 64602 ])); 64603 }); 64604var $pablohirafuji$elm_qrcode$QRCode$Encode$bitsToBytes3 = function (_v0) { 64605 bitsToBytes3: 64606 while (true) { 64607 var _v1 = _v0.a; 64608 var bits = _v1.a; 64609 var length = _v1.b; 64610 var bytes = _v0.b; 64611 if (length >= 8) { 64612 var remLength = length - 8; 64613 var remBits = bits & ((1 << remLength) - 1); 64614 var _byte = bits >> remLength; 64615 var $temp$_v0 = _Utils_Tuple2( 64616 _Utils_Tuple2(remBits, remLength), 64617 A2($elm$core$List$cons, _byte, bytes)); 64618 _v0 = $temp$_v0; 64619 continue bitsToBytes3; 64620 } else { 64621 return _Utils_Tuple2( 64622 _Utils_Tuple2(bits, length), 64623 bytes); 64624 } 64625 } 64626}; 64627var $pablohirafuji$elm_qrcode$QRCode$Encode$bitsToBytes2 = F2( 64628 function (_v0, _v1) { 64629 var curBits = _v0.a; 64630 var curLength = _v0.b; 64631 var _v2 = _v1.a; 64632 var remBits = _v2.a; 64633 var remLength = _v2.b; 64634 var bytes = _v1.b; 64635 var lengthSum = curLength + remLength; 64636 var bitsSum = curBits | (remBits << curLength); 64637 return $pablohirafuji$elm_qrcode$QRCode$Encode$bitsToBytes3( 64638 _Utils_Tuple2( 64639 _Utils_Tuple2(bitsSum, lengthSum), 64640 bytes)); 64641 }); 64642var $pablohirafuji$elm_qrcode$QRCode$Encode$bitsToBytes1 = F2( 64643 function (bits, _v0) { 64644 bitsToBytes1: 64645 while (true) { 64646 var _v1 = _v0.a; 64647 var remBits = _v1.a; 64648 var remLength = _v1.b; 64649 var bytes = _v0.b; 64650 if (bits.b) { 64651 var head = bits.a; 64652 var tail = bits.b; 64653 var $temp$bits = tail, 64654 $temp$_v0 = A2( 64655 $pablohirafuji$elm_qrcode$QRCode$Encode$bitsToBytes2, 64656 head, 64657 _Utils_Tuple2( 64658 _Utils_Tuple2(remBits, remLength), 64659 bytes)); 64660 bits = $temp$bits; 64661 _v0 = $temp$_v0; 64662 continue bitsToBytes1; 64663 } else { 64664 return (!remLength) ? $elm$core$List$reverse(bytes) : $elm$core$List$reverse( 64665 A2($elm$core$List$cons, remBits << (8 - remLength), bytes)); 64666 } 64667 } 64668 }); 64669var $pablohirafuji$elm_qrcode$QRCode$Encode$bitsToBytes = function (bits) { 64670 return A2( 64671 $pablohirafuji$elm_qrcode$QRCode$Encode$bitsToBytes1, 64672 bits, 64673 _Utils_Tuple2( 64674 _Utils_Tuple2(0, 0), 64675 _List_Nil)); 64676}; 64677var $pablohirafuji$elm_qrcode$QRCode$Encode$UTF8 = 3; 64678var $pablohirafuji$elm_qrcode$QRCode$Encode$charCountIndicatorLength = F2( 64679 function (mode, version) { 64680 if (version <= 9) { 64681 switch (mode) { 64682 case 0: 64683 return 10; 64684 case 1: 64685 return 9; 64686 case 2: 64687 return 8; 64688 default: 64689 return 8; 64690 } 64691 } else { 64692 if (version <= 26) { 64693 switch (mode) { 64694 case 0: 64695 return 12; 64696 case 1: 64697 return 11; 64698 case 2: 64699 return 16; 64700 default: 64701 return 16; 64702 } 64703 } else { 64704 switch (mode) { 64705 case 0: 64706 return 14; 64707 case 1: 64708 return 13; 64709 case 2: 64710 return 16; 64711 default: 64712 return 16; 64713 } 64714 } 64715 } 64716 }); 64717var $pablohirafuji$elm_qrcode$QRCode$Encode$charCountIndicator = F2( 64718 function (_v0, bits) { 64719 var groupInfo = _v0.mT; 64720 var inputStr = _v0.gz; 64721 var mode = _v0.e0; 64722 var length = A2($pablohirafuji$elm_qrcode$QRCode$Encode$charCountIndicatorLength, mode, groupInfo.fK); 64723 var charCount = (mode === 3) ? $elm$core$List$length(bits) : $elm$core$String$length(inputStr); 64724 return _Utils_Tuple2(charCount, length); 64725 }); 64726var $pablohirafuji$elm_qrcode$QRCode$Encode$modeIndicator = function (mode) { 64727 switch (mode) { 64728 case 0: 64729 return 1; 64730 case 1: 64731 return 2; 64732 case 2: 64733 return 4; 64734 default: 64735 return 4; 64736 } 64737};
64738var $pablohirafuji$elm_qrcode$QRCode$Encode$addInfoAndFinalBits = function (_v0) { 64739 var bits = _v0.a; 64740 var model = _v0.b; 64741 return _Utils_Tuple2( 64742 model, 64743 A2( 64744 $pablohirafuji$elm_qrcode$QRCode$Encode$addFiller, 64745 model.mT.es, 64746 $pablohirafuji$elm_qrcode$QRCode$Encode$bitsToBytes( 64747 A3( 64748 $pablohirafuji$elm_qrcode$QRCode$Encode$addTerminator, 64749 model.mT.es, 64750 model.fX, 64751 A2( 64752 $elm$core$List$cons, 64753 _Utils_Tuple2( 64754 $pablohirafuji$elm_qrcode$QRCode$Encode$modeIndicator(model.e0), 64755 4), 64756 A2( 64757 $elm$core$List$cons, 64758 A2($pablohirafuji$elm_qrcode$QRCode$Encode$charCountIndicator, model, bits), 64759 bits)))))); 64760}; 64761var $pablohirafuji$elm_qrcode$QRCode$Encode$concatTranspose = function (_v0) { 64762 var model = _v0.a; 64763 var dataBlocks = _v0.b; 64764 var ecBlocks = _v0.c; 64765 return _Utils_Tuple2( 64766 model, 64767 $elm$core$List$concat( 64768 _Utils_ap( 64769 $pablohirafuji$elm_qrcode$QRCode$Helpers$transpose(dataBlocks), 64770 $pablohirafuji$elm_qrcode$QRCode$Helpers$transpose(ecBlocks)))); 64771}; 64772var $elm_community$list_extra$List$Extra$greedyGroupsOfWithStep = F3( 64773 function (size, step, list) { 64774 if ((size <= 0) || (step <= 0)) { 64775 return _List_Nil; 64776 } else { 64777 var go = F2( 64778 function (xs, acc) { 64779 go: 64780 while (true) { 64781 if ($elm$core$List$isEmpty(xs)) { 64782 return $elm$core$List$reverse(acc); 64783 } else { 64784 var $temp$xs = A2($elm$core$List$drop, step, xs), 64785 $temp$acc = A2( 64786 $elm$core$List$cons, 64787 A2($elm$core$List$take, size, xs), 64788 acc); 64789 xs = $temp$xs; 64790 acc = $temp$acc; 64791 continue go; 64792 } 64793 } 64794 }); 64795 return A2(go, list, _List_Nil); 64796 } 64797 }); 64798var $elm_community$list_extra$List$Extra$greedyGroupsOf = F2( 64799 function (size, xs) { 64800 return A3($elm_community$list_extra$List$Extra$greedyGroupsOfWithStep, size, size, xs); 64801 }); 64802var $pablohirafuji$elm_qrcode$QRCode$Error$InvalidAlphanumericChar = {$: 2}; 64803var $pablohirafuji$elm_qrcode$QRCode$Encode$Alphanumeric$alphanumericCodes = $elm$core$Dict$fromList( 64804 _List_fromArray( 64805 [ 64806 _Utils_Tuple2('0', 0), 64807 _Utils_Tuple2('1', 1), 64808 _Utils_Tuple2('2', 2), 64809 _Utils_Tuple2('3', 3), 64810 _Utils_Tuple2('4', 4), 64811 _Utils_Tuple2('5', 5), 64812 _Utils_Tuple2('6', 6), 64813 _Utils_Tuple2('7', 7), 64814 _Utils_Tuple2('8', 8), 64815 _Utils_Tuple2('9', 9), 64816 _Utils_Tuple2('A', 10), 64817 _Utils_Tuple2('B', 11), 64818 _Utils_Tuple2('C', 12), 64819 _Utils_Tuple2('D', 13), 64820 _Utils_Tuple2('E', 14), 64821 _Utils_Tuple2('F', 15), 64822 _Utils_Tuple2('G', 16), 64823 _Utils_Tuple2('H', 17), 64824 _Utils_Tuple2('I', 18), 64825 _Utils_Tuple2('J', 19), 64826 _Utils_Tuple2('K', 20), 64827 _Utils_Tuple2('L', 21), 64828 _Utils_Tuple2('M', 22), 64829 _Utils_Tuple2('N', 23), 64830 _Utils_Tuple2('O', 24), 64831 _Utils_Tuple2('P', 25), 64832 _Utils_Tuple2('Q', 26), 64833 _Utils_Tuple2('R', 27), 64834 _Utils_Tuple2('S', 28), 64835 _Utils_Tuple2('T', 29), 64836 _Utils_Tuple2('U', 30), 64837 _Utils_Tuple2('V', 31), 64838 _Utils_Tuple2('W', 32), 64839 _Utils_Tuple2('X', 33), 64840 _Utils_Tuple2('Y', 34), 64841 _Utils_Tuple2('Z', 35), 64842 _Utils_Tuple2(' ', 36), 64843 _Utils_Tuple2('$', 37), 64844 _Utils_Tuple2('%', 38), 64845 _Utils_Tuple2('*', 39), 64846 _Utils_Tuple2('+', 40), 64847 _Utils_Tuple2('-', 41), 64848 _Utils_Tuple2('.', 42), 64849 _Utils_Tuple2('/', 43), 64850 _Utils_Tuple2(':', 44) 64851 ])); 64852var $pablohirafuji$elm_qrcode$QRCode$Encode$Alphanumeric$toAlphanumericCode = function (_char) { 64853 return A2( 64854 $elm$core$Result$fromMaybe, 64855 $pablohirafuji$elm_qrcode$QRCode$Error$InvalidAlphanumericChar, 64856 A2($elm$core$Dict$get, _char, $pablohirafuji$elm_qrcode$QRCode$Encode$Alphanumeric$alphanumericCodes)); 64857}; 64858var $pablohirafuji$elm_qrcode$QRCode$Encode$Alphanumeric$toBinary = function (chars) { 64859 _v0$2: 64860 while (true) { 64861 if (chars.b) { 64862 if (chars.b.b) { 64863 if (!chars.b.b.b) { 64864 var firstChar = chars.a; 64865 var _v1 = chars.b; 64866 var secondChar = _v1.a; 64867 return A3( 64868 $elm$core$Result$map2, 64869 F2( 64870 function (firstCode, secondCode) { 64871 return _Utils_Tuple2((firstCode * 45) + secondCode, 11); 64872 }), 64873 $pablohirafuji$elm_qrcode$QRCode$Encode$Alphanumeric$toAlphanumericCode(firstChar), 64874 $pablohirafuji$elm_qrcode$QRCode$Encode$Alphanumeric$toAlphanumericCode(secondChar)); 64875 } else { 64876 break _v0$2; 64877 } 64878 } else { 64879 var _char = chars.a; 64880 return A2( 64881 $elm$core$Result$map, 64882 function (a) { 64883 return _Utils_Tuple2(a, 6); 64884 }, 64885 $pablohirafuji$elm_qrcode$QRCode$Encode$Alphanumeric$toAlphanumericCode(_char)); 64886 } 64887 } else { 64888 break _v0$2; 64889 } 64890 } 64891 return $elm$core$Result$Err($pablohirafuji$elm_qrcode$QRCode$Error$InvalidAlphanumericChar); 64892}; 64893var $pablohirafuji$elm_qrcode$QRCode$Encode$Alphanumeric$encode = function (str) { 64894 return A3( 64895 $elm$core$List$foldr, 64896 $elm$core$Result$map2($elm$core$List$cons), 64897 $elm$core$Result$Ok(_List_Nil), 64898 A2( 64899 $elm$core$List$map, 64900 $pablohirafuji$elm_qrcode$QRCode$Encode$Alphanumeric$toBinary, 64901 A2( 64902 $elm_community$list_extra$List$Extra$greedyGroupsOf, 64903 2, 64904 $elm$core$String$toList(str)))); 64905}; 64906var $pablohirafuji$elm_qrcode$QRCode$Encode$Byte$encode = function (str) { 64907 return $elm$core$Result$Ok( 64908 A2( 64909 $elm$core$List$map, 64910 function (a) { 64911 return _Utils_Tuple2( 64912 $elm$core$Char$toCode(a), 64913 8); 64914 }, 64915 $elm$core$String$toList(str))); 64916}; 64917var $pablohirafuji$elm_qrcode$QRCode$Error$InvalidNumericChar = {$: 1}; 64918var $pablohirafuji$elm_qrcode$QRCode$Encode$Numeric$numericLength = function (str) { 64919 var _v0 = $elm$core$String$length(str); 64920 switch (_v0) { 64921 case 1: 64922 return 4; 64923 case 2: 64924 return 7; 64925 default: 64926 return 10; 64927 } 64928}; 64929var $pablohirafuji$elm_qrcode$QRCode$Encode$Numeric$encodeHelp = function (chars) { 64930 var str = $elm$core$String$fromList(chars); 64931 return A2( 64932 $elm$core$Result$fromMaybe, 64933 $pablohirafuji$elm_qrcode$QRCode$Error$InvalidNumericChar, 64934 A2( 64935 $elm$core$Maybe$map, 64936 function (a) { 64937 return _Utils_Tuple2( 64938 a, 64939 $pablohirafuji$elm_qrcode$QRCode$Encode$Numeric$numericLength(str)); 64940 }, 64941 $elm$core$String$toInt(str))); 64942}; 64943var $pablohirafuji$elm_qrcode$QRCode$Encode$Numeric$encode = function (str) { 64944 return A3( 64945 $elm$core$List$foldr, 64946 $elm$core$Result$map2($elm$core$List$cons), 64947 $elm$core$Result$Ok(_List_Nil), 64948 A2( 64949 $elm$core$List$map, 64950 $pablohirafuji$elm_qrcode$QRCode$Encode$Numeric$encodeHelp, 64951 A2( 64952 $elm_community$list_extra$List$Extra$greedyGroupsOf, 64953 3, 64954 $elm$core$String$toList(str)))); 64955}; 64956var $pablohirafuji$elm_qrcode$QRCode$Error$InvalidUTF8Char = {$: 3}; 64957var $elm$bytes$Bytes$Encode$getStringWidth = _Bytes_getStringWidth;
64958var $pablohirafuji$elm_qrcode$QRCode$Encode$UTF8$step = function (_v0) { 64959 var n = _v0.a; 64960 var xs = _v0.b; 64961 return (n <= 0) ? $elm$bytes$Bytes$Decode$succeed( 64962 $elm$bytes$Bytes$Decode$Done( 64963 $elm$core$List$reverse(xs))) : A2( 64964 $elm$bytes$Bytes$Decode$map, 64965 function (x) { 64966 return $elm$bytes$Bytes$Decode$Loop( 64967 _Utils_Tuple2( 64968 n - 1, 64969 A2( 64970 $elm$core$List$cons, 64971 _Utils_Tuple2(x, 8), 64972 xs))); 64973 }, 64974 $elm$bytes$Bytes$Decode$unsignedInt8); 64975}; 64976var $pablohirafuji$elm_qrcode$QRCode$Encode$UTF8$encode = function (str) { 64977 var utf8BytesWidth = $elm$bytes$Bytes$Encode$getStringWidth(str); 64978 var decoder = A2( 64979 $elm$bytes$Bytes$Decode$loop, 64980 _Utils_Tuple2(utf8BytesWidth, _List_Nil), 64981 $pablohirafuji$elm_qrcode$QRCode$Encode$UTF8$step); 64982 return A2( 64983 $elm$core$Result$fromMaybe, 64984 $pablohirafuji$elm_qrcode$QRCode$Error$InvalidUTF8Char, 64985 A2( 64986 $elm$bytes$Bytes$Decode$decode, 64987 decoder, 64988 $elm$bytes$Bytes$Encode$encode( 64989 $elm$bytes$Bytes$Encode$string(str)))); 64990}; 64991var $pablohirafuji$elm_qrcode$QRCode$Encode$encoder = function (mode) { 64992 switch (mode) { 64993 case 0: 64994 return $pablohirafuji$elm_qrcode$QRCode$Encode$Numeric$encode; 64995 case 1: 64996 return $pablohirafuji$elm_qrcode$QRCode$Encode$Alphanumeric$encode; 64997 case 2: 64998 return $pablohirafuji$elm_qrcode$QRCode$Encode$Byte$encode; 64999 default: 65000 return $pablohirafuji$elm_qrcode$QRCode$Encode$UTF8$encode; 65001 } 65002}; 65003var $pablohirafuji$elm_qrcode$QRCode$ErrorCorrection$expTable = $elm$core$Array$fromList( 65004 _List_fromArray( 65005 [1, 2, 4, 8, 16, 32, 64, 128, 29, 58, 116, 232, 205, 135, 19, 38, 76, 152, 45, 90, 180, 117, 234, 201, 143, 3, 6, 12, 24, 48, 96, 192, 157, 39, 78, 156, 37, 74, 148, 53, 106, 212, 181, 119, 238, 193, 159, 35, 70, 140, 5, 10, 20, 40, 80, 160, 93, 186, 105, 210, 185, 111, 222, 161, 95, 190, 97, 194, 153, 47, 94, 188, 101, 202, 137, 15, 30, 60, 120, 240, 253, 231, 211, 187, 107, 214, 177, 127, 254, 225, 223, 163, 91, 182, 113, 226, 217, 175, 67, 134, 17, 34, 68, 136, 13, 26, 52, 104, 208, 189, 103, 206, 129, 31, 62, 124, 248, 237, 199, 147, 59, 118, 236, 197, 151, 51, 102, 204, 133, 23, 46, 92, 184, 109, 218, 169, 79, 158, 33, 66, 132, 21, 42, 84, 168, 77, 154, 41, 82, 164, 85, 170, 73, 146, 57, 114, 228, 213, 183, 115, 230, 209, 191, 99, 198, 145, 63, 126, 252, 229, 215, 179, 123, 246, 241, 255, 227, 219, 171, 75, 150, 49, 98, 196, 149, 55, 110, 220, 165, 87, 174, 65, 130, 25, 50, 100, 200, 141, 7, 14, 28, 56, 112, 224, 221, 167, 83, 166, 81, 162, 89, 178, 121, 242, 249, 239, 195, 155, 43, 86, 172, 69, 138, 9, 18, 36, 72, 144, 61, 122, 244, 245, 247, 243, 251, 235, 203, 139, 11, 22, 44, 88, 176, 125, 250, 233, 207, 131, 27, 54, 108, 216, 173, 71, 142, 1])); 65006var $pablohirafuji$elm_qrcode$QRCode$ErrorCorrection$getExp = function (index) { 65007 return A2( 65008 $elm$core$Maybe$withDefault, 65009 0, 65010 A2( 65011 $elm$core$Array$get, 65012 A2($elm$core$Basics$modBy, 255, index), 65013 $pablohirafuji$elm_qrcode$QRCode$ErrorCorrection$expTable)); 65014}; 65015var $pablohirafuji$elm_qrcode$QRCode$Error$PolynomialMultiplyException = {$: 5}; 65016var $pablohirafuji$elm_qrcode$QRCode$Error$LogTableException = function (a) { 65017 return {$: 4, a: a}; 65018}; 65019var $pablohirafuji$elm_qrcode$QRCode$ErrorCorrection$logTable = $elm$core$Array$fromList( 65020 _List_fromArray( 65021 [0, 1, 25, 2, 50, 26, 198, 3, 223, 51, 238, 27, 104, 199, 75, 4, 100, 224, 14, 52, 141, 239, 129, 28, 193, 105, 248, 200, 8, 76, 113, 5, 138, 101, 47, 225, 36, 15, 33, 53, 147, 142, 218, 240, 18, 130, 69, 29, 181, 194, 125, 106, 39, 249, 185, 201, 154, 9, 120, 77, 228, 114, 166, 6, 191, 139, 98, 102, 221, 48, 253, 226, 152, 37, 179, 16, 145, 34, 136, 54, 208, 148, 206, 143, 150, 219, 189, 241, 210, 19, 92, 131, 56, 70, 64, 30, 66, 182, 163, 195, 72, 126, 110, 107, 58, 40, 84, 250, 133, 186, 61, 202, 94, 155, 159, 10, 21, 121, 43, 78, 212, 229, 172, 115, 243, 167, 87, 7, 112, 192, 247, 140, 128, 99, 13, 103, 74, 222, 237, 49, 197, 254, 24, 227, 165, 153, 119, 38, 184, 180, 124, 17, 68, 146, 217, 35, 32, 137, 46, 55, 63, 209, 91, 149, 188, 207, 205, 144, 135, 151, 178, 220, 252, 190, 97, 242, 86, 211, 171, 20, 42, 93, 158, 132, 60, 57, 83, 71, 109, 65, 162, 31, 45, 67, 216, 183, 123, 164, 118, 196, 23, 73, 236, 127, 12, 111, 246, 108, 161, 59, 82, 41, 157, 85, 170, 251, 96, 134, 177, 187, 204, 62, 90, 203, 89, 95, 176, 156, 169, 160, 81, 11, 245, 22, 235, 122, 117, 44, 215, 79, 174, 213, 233, 230, 231, 173, 232, 116, 214, 244, 234, 168, 80, 88, 175])); 65022var $pablohirafuji$elm_qrcode$QRCode$ErrorCorrection$getLog = function (index) { 65023 return (index < 1) ? $elm$core$Result$Err( 65024 $pablohirafuji$elm_qrcode$QRCode$Error$LogTableException(index)) : A2( 65025 $elm$core$Result$fromMaybe, 65026 $pablohirafuji$elm_qrcode$QRCode$Error$LogTableException(index), 65027 A2($elm$core$Array$get, index - 1, $pablohirafuji$elm_qrcode$QRCode$ErrorCorrection$logTable)); 65028}; 65029var $elm$core$Array$length = function (_v0) { 65030 var len = _v0.a; 65031 return len; 65032}; 65033var $pablohirafuji$elm_qrcode$QRCode$ErrorCorrection$getOffset = function (_v0) { 65034 getOffset: 65035 while (true) { 65036 var num = _v0.a; 65037 var offset = _v0.b; 65038 if (num.b) { 65039 var head = num.a; 65040 var tail = num.b; 65041 if (!head) { 65042 var $temp$_v0 = _Utils_Tuple2(tail, offset + 1); 65043 _v0 = $temp$_v0; 65044 continue getOffset; 65045 } else { 65046 return offset; 65047 } 65048 } else { 65049 return offset; 65050 } 65051 } 65052}; 65053var $pablohirafuji$elm_qrcode$QRCode$ErrorCorrection$newPolynomial = F2( 65054 function (num, shift) { 65055 var offset = $pablohirafuji$elm_qrcode$QRCode$ErrorCorrection$getOffset( 65056 _Utils_Tuple2(num, 0)); 65057 var numArray = $elm$core$Array$fromList(num); 65058 return A2( 65059 $elm$core$Array$initialize, 65060 ($elm$core$List$length(num) - offset) + shift, 65061 function (index) { 65062 return A2( 65063 $elm$core$Maybe$withDefault, 65064 0, 65065 A2($elm$core$Array$get, index + offset, numArray)); 65066 }); 65067 }); 65068var $pablohirafuji$elm_qrcode$QRCode$ErrorCorrection$multiply = F2( 65069 function (poly1, poly2) { 65070 var valuesArray = A2( 65071 $elm$core$List$indexedMap, 65072 F2( 65073 function (index1, value1) { 65074 return A2( 65075 $elm$core$List$indexedMap, 65076 F2( 65077 function (index2, value2) { 65078 return _Utils_Tuple3(index1 + index2, value1, value2); 65079 }), 65080 $elm$core$Array$toList(poly2)); 65081 }), 65082 $elm$core$Array$toList(poly1)); 65083 var process__ = F3( 65084 function (indexSum, num_, exp) { 65085 return A2( 65086 $elm$core$Result$fromMaybe, 65087 $pablohirafuji$elm_qrcode$QRCode$Error$PolynomialMultiplyException, 65088 A2( 65089 $elm$core$Maybe$map, 65090 $elm$core$Bitwise$xor(exp), 65091 A2($elm$core$Array$get, indexSum, num_))); 65092 }); 65093 var process_ = F2( 65094 function (_v0, num_) { 65095 var indexSum = _v0.a; 65096 var value1 = _v0.b; 65097 var value2 = _v0.c; 65098 return A2( 65099 $elm$core$Result$map, 65100 function (r) { 65101 return A3($elm$core$Array$set, indexSum, r, num_); 65102 }, 65103 A2( 65104 $elm$core$Result$andThen, 65105 A2(process__, indexSum, num_), 65106 A2( 65107 $elm$core$Result$map, 65108 $pablohirafuji$elm_qrcode$QRCode$ErrorCorrection$getExp, 65109 A3( 65110 $elm$core$Result$map2, 65111 $elm$core$Basics$add, 65112 $pablohirafuji$elm_qrcode$QRCode$ErrorCorrection$getLog(value1), 65113 $pablohirafuji$elm_qrcode$QRCode$ErrorCorrection$getLog(value2))))); 65114 }); 65115 var process = F2( 65116 function (args, numResult) { 65117 return A2( 65118 $elm$core$Result$andThen, 65119 process_(args), 65120 numResult); 65121 }); 65122 var num = A2( 65123 $elm$core$Array$initialize, 65124 ($elm$core$Array$length(poly1) + $elm$core$Array$length(poly2)) - 1, 65125 $elm$core$Basics$always(0)); 65126 return A2( 65127 $elm$core$Result$map, 65128 function (a) { 65129 return A2($pablohirafuji$elm_qrcode$QRCode$ErrorCorrection$newPolynomial, a, 0); 65130 }, 65131 A2( 65132 $elm$core$Result$map, 65133 $elm$core$Array$toList, 65134 A3( 65135 $elm$core$List$foldl, 65136 process, 65137 $elm$core$Result$Ok(num), 65138 $elm$core$List$concat(valuesArray)))); 65139 }); 65140var $pablohirafuji$elm_qrcode$QRCode$ErrorCorrection$getECPolynomial = function (ecLength) { 65141 var generate = F2( 65142 function (count, polyResult) { 65143 generate: 65144 while (true) { 65145 if (_Utils_cmp(count, ecLength) < 0) { 65146 var $temp$count = count + 1, 65147 $temp$polyResult = A2( 65148 $elm$core$Result$andThen, 65149 function (a) { 65150 return A2( 65151 $pablohirafuji$elm_qrcode$QRCode$ErrorCorrection$multiply, 65152 a, 65153 A2( 65154 $pablohirafuji$elm_qrcode$QRCode$ErrorCorrection$newPolynomial, 65155 _List_fromArray( 65156 [ 65157 1, 65158 $pablohirafuji$elm_qrcode$QRCode$ErrorCorrection$getExp(count) 65159 ]), 65160 0)); 65161 }, 65162 polyResult); 65163 count = $temp$count; 65164 polyResult = $temp$polyResult; 65165 continue generate; 65166 } else { 65167 return polyResult; 65168 } 65169 } 65170 }); 65171 return A2( 65172 generate, 65173 0, 65174 $elm$core$Result$Ok( 65175 A2( 65176 $pablohirafuji$elm_qrcode$QRCode$ErrorCorrection$newPolynomial, 65177 _List_fromArray( 65178 [1]), 65179 0))); 65180}; 65181var $pablohirafuji$elm_qrcode$QRCode$ErrorCorrection$get___ = F2( 65182 function (ecLength, modPoly) { 65183 return $elm$core$Array$toList( 65184 A2( 65185 $elm$core$Array$initialize, 65186 ecLength,
65187 function (index) { 65188 var modIndex = (index + $elm$core$Array$length(modPoly)) - ecLength; 65189 return (modIndex >= 0) ? A2( 65190 $elm$core$Maybe$withDefault, 65191 0, 65192 A2($elm$core$Array$get, modIndex, modPoly)) : 0; 65193 })); 65194 }); 65195var $pablohirafuji$elm_qrcode$QRCode$Error$PolynomialModException = {$: 6}; 65196var $pablohirafuji$elm_qrcode$QRCode$ErrorCorrection$mod = F2( 65197 function (poly1, poly2) { 65198 if (($elm$core$Array$length(poly1) - $elm$core$Array$length(poly2)) < 0) { 65199 return $elm$core$Result$Ok(poly1); 65200 } else { 65201 var helper_ = F3( 65202 function (index2, poly1_, exp) { 65203 return A2( 65204 $elm$core$Result$fromMaybe, 65205 $pablohirafuji$elm_qrcode$QRCode$Error$PolynomialModException, 65206 A2( 65207 $elm$core$Maybe$map, 65208 $elm$core$Bitwise$xor(exp), 65209 A2($elm$core$Array$get, index2, poly1_))); 65210 }); 65211 var getHead = function (poly) { 65212 return A2( 65213 $elm$core$Result$andThen, 65214 $pablohirafuji$elm_qrcode$QRCode$ErrorCorrection$getLog, 65215 A2( 65216 $elm$core$Result$fromMaybe, 65217 $pablohirafuji$elm_qrcode$QRCode$Error$PolynomialModException, 65218 A2($elm$core$Array$get, 0, poly))); 65219 }; 65220 var ratio = A3( 65221 $elm$core$Result$map2, 65222 $elm$core$Basics$sub, 65223 getHead(poly1), 65224 getHead(poly2)); 65225 var helper = F2( 65226 function (_v0, poly1_) { 65227 var index2 = _v0.a; 65228 var value2 = _v0.b; 65229 return A2( 65230 $elm$core$Result$map, 65231 function (r) { 65232 return A3($elm$core$Array$set, index2, r, poly1_); 65233 }, 65234 A2( 65235 $elm$core$Result$andThen, 65236 A2(helper_, index2, poly1_), 65237 A2( 65238 $elm$core$Result$map, 65239 $pablohirafuji$elm_qrcode$QRCode$ErrorCorrection$getExp, 65240 A3( 65241 $elm$core$Result$map2, 65242 $elm$core$Basics$add, 65243 ratio, 65244 $pablohirafuji$elm_qrcode$QRCode$ErrorCorrection$getLog(value2))))); 65245 }); 65246 var numFold = F2( 65247 function (args, poly1Result) { 65248 return A2( 65249 $elm$core$Result$andThen, 65250 helper(args), 65251 poly1Result); 65252 }); 65253 var numResult = A3( 65254 $elm$core$Array$foldl, 65255 numFold, 65256 $elm$core$Result$Ok(poly1), 65257 A2( 65258 $elm$core$Array$indexedMap, 65259 F2( 65260 function (a, b) { 65261 return _Utils_Tuple2(a, b); 65262 }), 65263 poly2)); 65264 return A2( 65265 $elm$core$Result$andThen, 65266 function (a) { 65267 return A2($pablohirafuji$elm_qrcode$QRCode$ErrorCorrection$mod, a, poly2); 65268 }, 65269 A2( 65270 $elm$core$Result$map, 65271 function (a) { 65272 return A2($pablohirafuji$elm_qrcode$QRCode$ErrorCorrection$newPolynomial, a, 0); 65273 }, 65274 A2($elm$core$Result$map, $elm$core$Array$toList, numResult))); 65275 } 65276 }); 65277var $pablohirafuji$elm_qrcode$QRCode$ErrorCorrection$get__ = F2( 65278 function (rsPoly, dataCodewords) { 65279 return A2( 65280 $elm$core$Result$map, 65281 $pablohirafuji$elm_qrcode$QRCode$ErrorCorrection$get___( 65282 $elm$core$Array$length(rsPoly) - 1), 65283 A2( 65284 $pablohirafuji$elm_qrcode$QRCode$ErrorCorrection$mod, 65285 A2( 65286 $pablohirafuji$elm_qrcode$QRCode$ErrorCorrection$newPolynomial, 65287 dataCodewords, 65288 $elm$core$Array$length(rsPoly) - 1), 65289 rsPoly)); 65290 }); 65291var $pablohirafuji$elm_qrcode$QRCode$Helpers$listResult = F3( 65292 function (fun, listb, lista) { 65293 if (lista.b) { 65294 var head = lista.a; 65295 var tail = lista.b; 65296 return A2( 65297 $elm$core$Result$andThen, 65298 function (a) { 65299 return A3($pablohirafuji$elm_qrcode$QRCode$Helpers$listResult, fun, a, tail); 65300 }, 65301 A2( 65302 $elm$core$Result$map, 65303 function (r) { 65304 return A2($elm$core$List$cons, r, listb); 65305 }, 65306 fun(head))); 65307 } else { 65308 return $elm$core$Result$Ok( 65309 $elm$core$List$reverse(listb)); 65310 } 65311 }); 65312var $pablohirafuji$elm_qrcode$QRCode$ErrorCorrection$get_ = F2( 65313 function (byteBlocks, rsPoly) { 65314 return A3( 65315 $pablohirafuji$elm_qrcode$QRCode$Helpers$listResult, 65316 $pablohirafuji$elm_qrcode$QRCode$ErrorCorrection$get__(rsPoly), 65317 _List_Nil, 65318 byteBlocks); 65319 }); 65320var $pablohirafuji$elm_qrcode$QRCode$ErrorCorrection$get = F2( 65321 function (ecPerBlock, byteBlocks) { 65322 return A2( 65323 $elm$core$Result$andThen, 65324 $pablohirafuji$elm_qrcode$QRCode$ErrorCorrection$get_(byteBlocks), 65325 $pablohirafuji$elm_qrcode$QRCode$ErrorCorrection$getECPolynomial(ecPerBlock)); 65326 }); 65327var $pablohirafuji$elm_qrcode$QRCode$Encode$getErrorCorrection = function (_v0) { 65328 var model = _v0.a; 65329 var dataBlocks = _v0.b; 65330 return A2( 65331 $elm$core$Result$map, 65332 function (c) { 65333 return _Utils_Tuple3(model, dataBlocks, c); 65334 }, 65335 A2($pablohirafuji$elm_qrcode$QRCode$ErrorCorrection$get, model.mT.mp, dataBlocks)); 65336}; 65337var $pablohirafuji$elm_qrcode$QRCode$Encode$Alphanumeric = 1; 65338var $pablohirafuji$elm_qrcode$QRCode$Encode$Byte = 2; 65339var $pablohirafuji$elm_qrcode$QRCode$Encode$Numeric = 0; 65340var $elm$regex$Regex$Match = F4( 65341 function (match, index, number, submatches) { 65342 return {ne: index, nG: match, oh: number, qB: submatches}; 65343 }); 65344var $elm$regex$Regex$contains = _Regex_contains; 65345var $elm$regex$Regex$fromStringWith = _Regex_fromStringWith; 65346var $pablohirafuji$elm_qrcode$QRCode$Encode$Alphanumeric$onlyAlphanumeric = A2( 65347 $elm$regex$Regex$fromStringWith, 65348 {lN: false, nY: false}, 65349 '^[0-9A-Z $%*+\\-.\\/:]+$'); 65350var $pablohirafuji$elm_qrcode$QRCode$Encode$Alphanumeric$isValid = function (input) { 65351 return A2( 65352 $elm$core$Maybe$withDefault, 65353 false, 65354 A2( 65355 $elm$core$Maybe$map, 65356 function (r) { 65357 return A2($elm$regex$Regex$contains, r, input); 65358 }, 65359 $pablohirafuji$elm_qrcode$QRCode$Encode$Alphanumeric$onlyAlphanumeric)); 65360}; 65361var $pablohirafuji$elm_qrcode$QRCode$Encode$Byte$only8Bit = A2( 65362 $elm$regex$Regex$fromStringWith, 65363 {lN: false, nY: false},
65364 '^[\\u0000-\\u00ff]+$'); 65365var $pablohirafuji$elm_qrcode$QRCode$Encode$Byte$isValid = function (input) { 65366 return A2( 65367 $elm$core$Maybe$withDefault, 65368 false, 65369 A2( 65370 $elm$core$Maybe$map, 65371 function (r) { 65372 return A2($elm$regex$Regex$contains, r, input); 65373 }, 65374 $pablohirafuji$elm_qrcode$QRCode$Encode$Byte$only8Bit)); 65375}; 65376var $pablohirafuji$elm_qrcode$QRCode$Encode$Numeric$onlyNumber = A2( 65377 $elm$regex$Regex$fromStringWith, 65378 {lN: false, nY: false}, 65379 '^[0-9]+$'); 65380var $pablohirafuji$elm_qrcode$QRCode$Encode$Numeric$isValid = function (input) { 65381 return A2( 65382 $elm$core$Maybe$withDefault, 65383 false, 65384 A2( 65385 $elm$core$Maybe$map, 65386 function (r) { 65387 return A2($elm$regex$Regex$contains, r, input); 65388 }, 65389 $pablohirafuji$elm_qrcode$QRCode$Encode$Numeric$onlyNumber)); 65390}; 65391var $pablohirafuji$elm_qrcode$QRCode$Encode$selectMode = function (input) { 65392 return $pablohirafuji$elm_qrcode$QRCode$Encode$Numeric$isValid(input) ? 0 : ($pablohirafuji$elm_qrcode$QRCode$Encode$Alphanumeric$isValid(input) ? 1 : ($pablohirafuji$elm_qrcode$QRCode$Encode$Byte$isValid(input) ? 2 : 3)); 65393}; 65394var $pablohirafuji$elm_qrcode$QRCode$Error$InputLengthOverflow = {$: 7}; 65395var $pablohirafuji$elm_qrcode$QRCode$Encode$filterCapacity = F3( 65396 function (mode, dataLength, _v0) { 65397 var version = _v0.fK; 65398 var capacity = _v0.es; 65399 return _Utils_cmp( 65400 A2($pablohirafuji$elm_qrcode$QRCode$Encode$charCountIndicatorLength, mode, version) + dataLength, 65401 capacity) < 1; 65402 }); 65403var $pablohirafuji$elm_qrcode$QRCode$GroupInfo$blockByteCapacity = function (_v0) { 65404 var blockCount = _v0.a; 65405 var bytePerBlock = _v0.b; 65406 return blockCount * bytePerBlock; 65407}; 65408var $pablohirafuji$elm_qrcode$QRCode$GroupInfo$byteCapacity = F2( 65409 function (group1, maybeGroup2) { 65410 if (!maybeGroup2.$) { 65411 var block2 = maybeGroup2.a; 65412 return $pablohirafuji$elm_qrcode$QRCode$GroupInfo$blockByteCapacity(group1) + $pablohirafuji$elm_qrcode$QRCode$GroupInfo$blockByteCapacity(block2); 65413 } else { 65414 return $pablohirafuji$elm_qrcode$QRCode$GroupInfo$blockByteCapacity(group1); 65415 } 65416 }); 65417var $pablohirafuji$elm_qrcode$QRCode$GroupInfo$newGroupInfo = F4( 65418 function (version, ecPerBlock, group1, maybeGroup2) { 65419 return { 65420 es: A2($pablohirafuji$elm_qrcode$QRCode$GroupInfo$byteCapacity, group1, maybeGroup2) * 8, 65421 mp: ecPerBlock, 65422 iN: group1, 65423 nH: maybeGroup2, 65424 fK: version 65425 }; 65426 }); 65427var $pablohirafuji$elm_qrcode$QRCode$GroupInfo$dataH = _List_fromArray( 65428 [ 65429 A4( 65430 $pablohirafuji$elm_qrcode$QRCode$GroupInfo$newGroupInfo, 65431 1, 65432 17, 65433 _Utils_Tuple2(1, 9), 65434 $elm$core$Maybe$Nothing), 65435 A4( 65436 $pablohirafuji$elm_qrcode$QRCode$GroupInfo$newGroupInfo, 65437 2, 65438 28, 65439 _Utils_Tuple2(1, 16), 65440 $elm$core$Maybe$Nothing), 65441 A4( 65442 $pablohirafuji$elm_qrcode$QRCode$GroupInfo$newGroupInfo, 65443 3, 65444 22, 65445 _Utils_Tuple2(2, 13), 65446 $elm$core$Maybe$Nothing), 65447 A4( 65448 $pablohirafuji$elm_qrcode$QRCode$GroupInfo$newGroupInfo, 65449 4, 65450 16, 65451 _Utils_Tuple2(4, 9), 65452 $elm$core$Maybe$Nothing), 65453 A4( 65454 $pablohirafuji$elm_qrcode$QRCode$GroupInfo$newGroupInfo, 65455 5, 65456 22, 65457 _Utils_Tuple2(2, 11), 65458 $elm$core$Maybe$Just( 65459 _Utils_Tuple2(2, 12))), 65460 A4( 65461 $pablohirafuji$elm_qrcode$QRCode$GroupInfo$newGroupInfo, 65462 6, 65463 28, 65464 _Utils_Tuple2(4, 15), 65465 $elm$core$Maybe$Nothing), 65466 A4( 65467 $pablohirafuji$elm_qrcode$QRCode$GroupInfo$newGroupInfo, 65468 7, 65469 26, 65470 _Utils_Tuple2(4, 13), 65471 $elm$core$Maybe$Just( 65472 _Utils_Tuple2(1, 14))), 65473 A4( 65474 $pablohirafuji$elm_qrcode$QRCode$GroupInfo$newGroupInfo, 65475 8, 65476 26, 65477 _Utils_Tuple2(4, 14), 65478 $elm$core$Maybe$Just( 65479 _Utils_Tuple2(2, 15))), 65480 A4( 65481 $pablohirafuji$elm_qrcode$QRCode$GroupInfo$newGroupInfo, 65482 9, 65483 24, 65484 _Utils_Tuple2(4, 12), 65485 $elm$core$Maybe$Just( 65486 _Utils_Tuple2(4, 13))), 65487 A4( 65488 $pablohirafuji$elm_qrcode$QRCode$GroupInfo$newGroupInfo, 65489 10, 65490 28, 65491 _Utils_Tuple2(6, 15), 65492 $elm$core$Maybe$Just( 65493 _Utils_Tuple2(2, 16))), 65494 A4( 65495 $pablohirafuji$elm_qrcode$QRCode$GroupInfo$newGroupInfo, 65496 11, 65497 24, 65498 _Utils_Tuple2(3, 12), 65499 $elm$core$Maybe$Just( 65500 _Utils_Tuple2(8, 13))), 65501 A4( 65502 $pablohirafuji$elm_qrcode$QRCode$GroupInfo$newGroupInfo, 65503 12, 65504 28, 65505 _Utils_Tuple2(7, 14), 65506 $elm$core$Maybe$Just( 65507 _Utils_Tuple2(4, 15))), 65508 A4( 65509 $pablohirafuji$elm_qrcode$QRCode$GroupInfo$newGroupInfo, 65510 13, 65511 22, 65512 _Utils_Tuple2(12, 11), 65513 $elm$core$Maybe$Just( 65514 _Utils_Tuple2(4, 12))), 65515 A4( 65516 $pablohirafuji$elm_qrcode$QRCode$GroupInfo$newGroupInfo, 65517 14, 65518 24, 65519 _Utils_Tuple2(11, 12), 65520 $elm$core$Maybe$Just( 65521 _Utils_Tuple2(5, 13))), 65522 A4( 65523 $pablohirafuji$elm_qrcode$QRCode$GroupInfo$newGroupInfo, 65524 15, 65525 24, 65526 _Utils_Tuple2(11, 12), 65527 $elm$core$Maybe$Just( 65528 _Utils_Tuple2(7, 13))), 65529 A4( 65530 $pablohirafuji$elm_qrcode$QRCode$GroupInfo$newGroupInfo, 65531 16, 65532 30, 65533 _Utils_Tuple2(3, 15), 65534 $elm$core$Maybe$Just( 65535 _Utils_Tuple2(13, 16))), 65536 A4( 65537 $pablohirafuji$elm_qrcode$QRCode$GroupInfo$newGroupInfo, 65538 17, 65539 28, 65540 _Utils_Tuple2(2, 14), 65541 $elm$core$Maybe$Just( 65542 _Utils_Tuple2(17, 15))), 65543 A4( 65544 $pablohirafuji$elm_qrcode$QRCode$GroupInfo$newGroupInfo, 65545 18, 65546 28, 65547 _Utils_Tuple2(2, 14), 65548 $elm$core$Maybe$Just( 65549 _Utils_Tuple2(19, 15))), 65550 A4( 65551 $pablohirafuji$elm_qrcode$QRCode$GroupInfo$newGroupInfo, 65552 19, 65553 26, 65554 _Utils_Tuple2(9, 13), 65555 $elm$core$Maybe$Just( 65556 _Utils_Tuple2(16, 14))), 65557 A4( 65558 $pablohirafuji$elm_qrcode$QRCode$GroupInfo$newGroupInfo, 65559 20, 65560 28, 65561 _Utils_Tuple2(15, 15), 65562 $elm$core$Maybe$Just( 65563 _Utils_Tuple2(10, 16))), 65564 A4( 65565 $pablohirafuji$elm_qrcode$QRCode$GroupInfo$newGroupInfo, 65566 21, 65567 30, 65568 _Utils_Tuple2(19, 16), 65569 $elm$core$Maybe$Just( 65570 _Utils_Tuple2(6, 17))), 65571 A4( 65572 $pablohirafuji$elm_qrcode$QRCode$GroupInfo$newGroupInfo, 65573 22, 65574 24, 65575 _Utils_Tuple2(34, 13), 65576 $elm$core$Maybe$Nothing), 65577 A4( 65578 $pablohirafuji$elm_qrcode$QRCode$GroupInfo$newGroupInfo, 65579 23, 65580 30, 65581 _Utils_Tuple2(16, 15), 65582 $elm$core$Maybe$Just( 65583 _Utils_Tuple2(14, 16))), 65584 A4( 65585 $pablohirafuji$elm_qrcode$QRCode$GroupInfo$newGroupInfo, 65586 24, 65587 30, 65588 _Utils_Tuple2(30, 16), 65589 $elm$core$Maybe$Just( 65590 _Utils_Tuple2(2, 17))), 65591 A4( 65592 $pablohirafuji$elm_qrcode$QRCode$GroupInfo$newGroupInfo, 65593 25, 65594 30, 65595 _Utils_Tuple2(22, 15), 65596 $elm$core$Maybe$Just( 65597 _Utils_Tuple2(13, 16))), 65598 A4( 65599 $pablohirafuji$elm_qrcode$QRCode$GroupInfo$newGroupInfo, 65600 26, 65601 30, 65602 _Utils_Tuple2(33, 16), 65603 $elm$core$Maybe$Just( 65604 _Utils_Tuple2(4, 17))), 65605 A4( 65606 $pablohirafuji$elm_qrcode$QRCode$GroupInfo$newGroupInfo, 65607 27, 65608 30, 65609 _Utils_Tuple2(12, 15), 65610 $elm$core$Maybe$Just( 65611 _Utils_Tuple2(28, 16))), 65612 A4( 65613 $pablohirafuji$elm_qrcode$QRCode$GroupInfo$newGroupInfo, 65614 28, 65615 30, 65616 _Utils_Tuple2(11, 15), 65617 $elm$core$Maybe$Just( 65618 _Utils_Tuple2(31, 16))), 65619 A4( 65620 $pablohirafuji$elm_qrcode$QRCode$GroupInfo$newGroupInfo, 65621 29, 65622 30, 65623 _Utils_Tuple2(19, 15), 65624 $elm$core$Maybe$Just( 65625 _Utils_Tuple2(26, 16))), 65626 A4( 65627 $pablohirafuji$elm_qrcode$QRCode$GroupInfo$newGroupInfo, 65628 30, 65629 30, 65630 _Utils_Tuple2(23, 15), 65631 $elm$core$Maybe$Just( 65632 _Utils_Tuple2(25, 16))), 65633 A4( 65634 $pablohirafuji$elm_qrcode$QRCode$GroupInfo$newGroupInfo, 65635 31, 65636 30, 65637 _Utils_Tuple2(23, 15), 65638 $elm$core$Maybe$Just( 65639 _Utils_Tuple2(28, 16))), 65640 A4( 65641 $pablohirafuji$elm_qrcode$QRCode$GroupInfo$newGroupInfo, 65642 32, 65643 30, 65644 _Utils_Tuple2(19, 15), 65645 $elm$core$Maybe$Just( 65646 _Utils_Tuple2(35, 16))), 65647 A4( 65648 $pablohirafuji$elm_qrcode$QRCode$GroupInfo$newGroupInfo, 65649 33, 65650 30, 65651 _Utils_Tuple2(11, 15), 65652 $elm$core$Maybe$Just( 65653 _Utils_Tuple2(46, 16))), 65654 A4( 65655 $pablohirafuji$elm_qrcode$QRCode$GroupInfo$newGroupInfo, 65656 34, 65657 30, 65658 _Utils_Tuple2(59, 16), 65659 $elm$core$Maybe$Just( 65660 _Utils_Tuple2(1, 17))), 65661 A4( 65662 $pablohirafuji$elm_qrcode$QRCode$GroupInfo$newGroupInfo, 65663 35, 65664 30, 65665 _Utils_Tuple2(22, 15), 65666 $elm$core$Maybe$Just( 65667 _Utils_Tuple2(41, 16))), 65668 A4( 65669 $pablohirafuji$elm_qrcode$QRCode$GroupInfo$newGroupInfo, 65670 36, 65671 30, 65672 _Utils_Tuple2(2, 15), 65673 $elm$core$Maybe$Just( 65674 _Utils_Tuple2(64, 16))), 65675 A4( 65676 $pablohirafuji$elm_qrcode$QRCode$GroupInfo$newGroupInfo, 65677 37, 65678 30, 65679 _Utils_Tuple2(24, 15), 65680 $elm$core$Maybe$Just( 65681 _Utils_Tuple2(46, 16))), 65682 A4( 65683 $pablohirafuji$elm_qrcode$QRCode$GroupInfo$newGroupInfo, 65684 38, 65685 30, 65686 _Utils_Tuple2(42, 15), 65687 $elm$core$Maybe$Just( 65688 _Utils_Tuple2(32, 16))), 65689 A4( 65690 $pablohirafuji$elm_qrcode$QRCode$GroupInfo$newGroupInfo, 65691 39, 65692 30, 65693 _Utils_Tuple2(10, 15), 65694 $elm$core$Maybe$Just( 65695 _Utils_Tuple2(67, 16))), 65696 A4( 65697 $pablohirafuji$elm_qrcode$QRCode$GroupInfo$newGroupInfo, 65698 40, 65699 30, 65700 _Utils_Tuple2(20, 15), 65701 $elm$core$Maybe$Just( 65702 _Utils_Tuple2(61, 16))) 65703 ]); 65704var $pablohirafuji$elm_qrcode$QRCode$GroupInfo$dataL = _List_fromArray( 65705 [ 65706 A4( 65707 $pablohirafuji$elm_qrcode$QRCode$GroupInfo$newGroupInfo, 65708 1, 65709 7, 65710 _Utils_Tuple2(1, 19), 65711 $elm$core$Maybe$Nothing), 65712 A4( 65713 $pablohirafuji$elm_qrcode$QRCode$GroupInfo$newGroupInfo, 65714 2,
65715 10, 65716 _Utils_Tuple2(1, 34), 65717 $elm$core$Maybe$Nothing), 65718 A4( 65719 $pablohirafuji$elm_qrcode$QRCode$GroupInfo$newGroupInfo, 65720 3, 65721 15, 65722 _Utils_Tuple2(1, 55), 65723 $elm$core$Maybe$Nothing), 65724 A4( 65725 $pablohirafuji$elm_qrcode$QRCode$GroupInfo$newGroupInfo, 65726 4, 65727 20, 65728 _Utils_Tuple2(1, 80), 65729 $elm$core$Maybe$Nothing), 65730 A4( 65731 $pablohirafuji$elm_qrcode$QRCode$GroupInfo$newGroupInfo, 65732 5, 65733 26, 65734 _Utils_Tuple2(1, 108), 65735 $elm$core$Maybe$Nothing), 65736 A4( 65737 $pablohirafuji$elm_qrcode$QRCode$GroupInfo$newGroupInfo, 65738 6, 65739 18, 65740 _Utils_Tuple2(2, 68), 65741 $elm$core$Maybe$Nothing), 65742 A4( 65743 $pablohirafuji$elm_qrcode$QRCode$GroupInfo$newGroupInfo, 65744 7, 65745 20, 65746 _Utils_Tuple2(2, 78), 65747 $elm$core$Maybe$Nothing), 65748 A4( 65749 $pablohirafuji$elm_qrcode$QRCode$GroupInfo$newGroupInfo, 65750 8, 65751 24, 65752 _Utils_Tuple2(2, 97), 65753 $elm$core$Maybe$Nothing), 65754 A4( 65755 $pablohirafuji$elm_qrcode$QRCode$GroupInfo$newGroupInfo, 65756 9, 65757 30, 65758 _Utils_Tuple2(2, 116), 65759 $elm$core$Maybe$Nothing), 65760 A4( 65761 $pablohirafuji$elm_qrcode$QRCode$GroupInfo$newGroupInfo, 65762 10, 65763 18, 65764 _Utils_Tuple2(2, 68), 65765 $elm$core$Maybe$Just( 65766 _Utils_Tuple2(2, 69))), 65767 A4( 65768 $pablohirafuji$elm_qrcode$QRCode$GroupInfo$newGroupInfo, 65769 11, 65770 20, 65771 _Utils_Tuple2(4, 81), 65772 $elm$core$Maybe$Nothing), 65773 A4( 65774 $pablohirafuji$elm_qrcode$QRCode$GroupInfo$newGroupInfo, 65775 12, 65776 24, 65777 _Utils_Tuple2(2, 92), 65778 $elm$core$Maybe$Just( 65779 _Utils_Tuple2(2, 93))), 65780 A4( 65781 $pablohirafuji$elm_qrcode$QRCode$GroupInfo$newGroupInfo, 65782 13, 65783 26, 65784 _Utils_Tuple2(4, 107), 65785 $elm$core$Maybe$Nothing), 65786 A4( 65787 $pablohirafuji$elm_qrcode$QRCode$GroupInfo$newGroupInfo, 65788 14, 65789 30, 65790 _Utils_Tuple2(3, 115), 65791 $elm$core$Maybe$Just( 65792 _Utils_Tuple2(1, 116))), 65793 A4( 65794 $pablohirafuji$elm_qrcode$QRCode$GroupInfo$newGroupInfo, 65795 15, 65796 22, 65797 _Utils_Tuple2(5, 87), 65798 $elm$core$Maybe$Just( 65799 _Utils_Tuple2(1, 88))), 65800 A4( 65801 $pablohirafuji$elm_qrcode$QRCode$GroupInfo$newGroupInfo, 65802 16, 65803 24, 65804 _Utils_Tuple2(5, 98), 65805 $elm$core$Maybe$Just( 65806 _Utils_Tuple2(1, 99))), 65807 A4( 65808 $pablohirafuji$elm_qrcode$QRCode$GroupInfo$newGroupInfo, 65809 17, 65810 28, 65811 _Utils_Tuple2(1, 107), 65812 $elm$core$Maybe$Just( 65813 _Utils_Tuple2(5, 108))), 65814 A4( 65815 $pablohirafuji$elm_qrcode$QRCode$GroupInfo$newGroupInfo, 65816 18, 65817 30, 65818 _Utils_Tuple2(5, 120), 65819 $elm$core$Maybe$Just( 65820 _Utils_Tuple2(1, 121))), 65821 A4( 65822 $pablohirafuji$elm_qrcode$QRCode$GroupInfo$newGroupInfo, 65823 19, 65824 28, 65825 _Utils_Tuple2(3, 113), 65826 $elm$core$Maybe$Just( 65827 _Utils_Tuple2(4, 114))), 65828 A4( 65829 $pablohirafuji$elm_qrcode$QRCode$GroupInfo$newGroupInfo, 65830 20, 65831 28, 65832 _Utils_Tuple2(3, 107), 65833 $elm$core$Maybe$Just( 65834 _Utils_Tuple2(5, 108))), 65835 A4( 65836 $pablohirafuji$elm_qrcode$QRCode$GroupInfo$newGroupInfo, 65837 21, 65838 28, 65839 _Utils_Tuple2(4, 116), 65840 $elm$core$Maybe$Just( 65841 _Utils_Tuple2(4, 117))), 65842 A4( 65843 $pablohirafuji$elm_qrcode$QRCode$GroupInfo$newGroupInfo, 65844 22, 65845 28, 65846 _Utils_Tuple2(2, 111), 65847 $elm$core$Maybe$Just( 65848 _Utils_Tuple2(7, 112))), 65849 A4( 65850 $pablohirafuji$elm_qrcode$QRCode$GroupInfo$newGroupInfo, 65851 23, 65852 30, 65853 _Utils_Tuple2(4, 121), 65854 $elm$core$Maybe$Just( 65855 _Utils_Tuple2(5, 122))), 65856 A4( 65857 $pablohirafuji$elm_qrcode$QRCode$GroupInfo$newGroupInfo, 65858 24, 65859 30, 65860 _Utils_Tuple2(6, 117), 65861 $elm$core$Maybe$Just( 65862 _Utils_Tuple2(4, 118))), 65863 A4( 65864 $pablohirafuji$elm_qrcode$QRCode$GroupInfo$newGroupInfo, 65865 25, 65866 26, 65867 _Utils_Tuple2(8, 106), 65868 $elm$core$Maybe$Just( 65869 _Utils_Tuple2(4, 107))), 65870 A4( 65871 $pablohirafuji$elm_qrcode$QRCode$GroupInfo$newGroupInfo, 65872 26, 65873 28, 65874 _Utils_Tuple2(10, 114), 65875 $elm$core$Maybe$Just( 65876 _Utils_Tuple2(2, 115))), 65877 A4( 65878 $pablohirafuji$elm_qrcode$QRCode$GroupInfo$newGroupInfo, 65879 27, 65880 30, 65881 _Utils_Tuple2(8, 122), 65882 $elm$core$Maybe$Just( 65883 _Utils_Tuple2(4, 123))), 65884 A4( 65885 $pablohirafuji$elm_qrcode$QRCode$GroupInfo$newGroupInfo, 65886 28, 65887 30, 65888 _Utils_Tuple2(3, 117), 65889 $elm$core$Maybe$Just( 65890 _Utils_Tuple2(10, 118))), 65891 A4( 65892 $pablohirafuji$elm_qrcode$QRCode$GroupInfo$newGroupInfo, 65893 29, 65894 30, 65895 _Utils_Tuple2(7, 116), 65896 $elm$core$Maybe$Just( 65897 _Utils_Tuple2(7, 117))), 65898 A4( 65899 $pablohirafuji$elm_qrcode$QRCode$GroupInfo$newGroupInfo, 65900 30, 65901 30, 65902 _Utils_Tuple2(5, 115), 65903 $elm$core$Maybe$Just( 65904 _Utils_Tuple2(10, 116))), 65905 A4( 65906 $pablohirafuji$elm_qrcode$QRCode$GroupInfo$newGroupInfo, 65907 31, 65908 30,
65909 _Utils_Tuple2(13, 115), 65910 $elm$core$Maybe$Just( 65911 _Utils_Tuple2(3, 116))), 65912 A4( 65913 $pablohirafuji$elm_qrcode$QRCode$GroupInfo$newGroupInfo, 65914 32, 65915 30, 65916 _Utils_Tuple2(17, 115), 65917 $elm$core$Maybe$Nothing), 65918 A4( 65919 $pablohirafuji$elm_qrcode$QRCode$GroupInfo$newGroupInfo, 65920 33, 65921 30, 65922 _Utils_Tuple2(17, 115), 65923 $elm$core$Maybe$Just( 65924 _Utils_Tuple2(1, 116))), 65925 A4( 65926 $pablohirafuji$elm_qrcode$QRCode$GroupInfo$newGroupInfo, 65927 34, 65928 30, 65929 _Utils_Tuple2(13, 115), 65930 $elm$core$Maybe$Just( 65931 _Utils_Tuple2(6, 116))), 65932 A4( 65933 $pablohirafuji$elm_qrcode$QRCode$GroupInfo$newGroupInfo, 65934 35, 65935 30, 65936 _Utils_Tuple2(12, 121), 65937 $elm$core$Maybe$Just( 65938 _Utils_Tuple2(7, 122))), 65939 A4( 65940 $pablohirafuji$elm_qrcode$QRCode$GroupInfo$newGroupInfo, 65941 36, 65942 30, 65943 _Utils_Tuple2(6, 121), 65944 $elm$core$Maybe$Just( 65945 _Utils_Tuple2(14, 122))), 65946 A4( 65947 $pablohirafuji$elm_qrcode$QRCode$GroupInfo$newGroupInfo, 65948 37, 65949 30, 65950 _Utils_Tuple2(17, 122), 65951 $elm$core$Maybe$Just( 65952 _Utils_Tuple2(4, 123))), 65953 A4( 65954 $pablohirafuji$elm_qrcode$QRCode$GroupInfo$newGroupInfo, 65955 38, 65956 30, 65957 _Utils_Tuple2(4, 122), 65958 $elm$core$Maybe$Just( 65959 _Utils_Tuple2(18, 123))), 65960 A4( 65961 $pablohirafuji$elm_qrcode$QRCode$GroupInfo$newGroupInfo, 65962 39, 65963 30, 65964 _Utils_Tuple2(20, 117), 65965 $elm$core$Maybe$Just( 65966 _Utils_Tuple2(4, 118))), 65967 A4( 65968 $pablohirafuji$elm_qrcode$QRCode$GroupInfo$newGroupInfo, 65969 40, 65970 30, 65971 _Utils_Tuple2(19, 118), 65972 $elm$core$Maybe$Just( 65973 _Utils_Tuple2(6, 119))) 65974 ]); 65975var $pablohirafuji$elm_qrcode$QRCode$GroupInfo$dataM = _List_fromArray( 65976 [ 65977 A4( 65978 $pablohirafuji$elm_qrcode$QRCode$GroupInfo$newGroupInfo, 65979 1, 65980 10, 65981 _Utils_Tuple2(1, 16), 65982 $elm$core$Maybe$Nothing), 65983 A4( 65984 $pablohirafuji$elm_qrcode$QRCode$GroupInfo$newGroupInfo, 65985 2, 65986 16, 65987 _Utils_Tuple2(1, 28), 65988 $elm$core$Maybe$Nothing), 65989 A4( 65990 $pablohirafuji$elm_qrcode$QRCode$GroupInfo$newGroupInfo, 65991 3, 65992 26, 65993 _Utils_Tuple2(1, 44), 65994 $elm$core$Maybe$Nothing), 65995 A4( 65996 $pablohirafuji$elm_qrcode$QRCode$GroupInfo$newGroupInfo, 65997 4, 65998 18, 65999 _Utils_Tuple2(2, 32), 66000 $elm$core$Maybe$Nothing), 66001 A4( 66002 $pablohirafuji$elm_qrcode$QRCode$GroupInfo$newGroupInfo, 66003 5, 66004 24, 66005 _Utils_Tuple2(2, 43), 66006 $elm$core$Maybe$Nothing), 66007 A4( 66008 $pablohirafuji$elm_qrcode$QRCode$GroupInfo$newGroupInfo, 66009 6, 66010 16, 66011 _Utils_Tuple2(4, 27), 66012 $elm$core$Maybe$Nothing), 66013 A4( 66014 $pablohirafuji$elm_qrcode$QRCode$GroupInfo$newGroupInfo, 66015 7, 66016 18, 66017 _Utils_Tuple2(4, 31), 66018 $elm$core$Maybe$Nothing), 66019 A4( 66020 $pablohirafuji$elm_qrcode$QRCode$GroupInfo$newGroupInfo, 66021 8, 66022 22, 66023 _Utils_Tuple2(2, 38), 66024 $elm$core$Maybe$Just( 66025 _Utils_Tuple2(2, 39))), 66026 A4( 66027 $pablohirafuji$elm_qrcode$QRCode$GroupInfo$newGroupInfo, 66028 9, 66029 22, 66030 _Utils_Tuple2(3, 36), 66031 $elm$core$Maybe$Just( 66032 _Utils_Tuple2(2, 37))), 66033 A4( 66034 $pablohirafuji$elm_qrcode$QRCode$GroupInfo$newGroupInfo, 66035 10, 66036 26, 66037 _Utils_Tuple2(4, 43), 66038 $elm$core$Maybe$Just( 66039 _Utils_Tuple2(1, 44))), 66040 A4( 66041 $pablohirafuji$elm_qrcode$QRCode$GroupInfo$newGroupInfo, 66042 11, 66043 30, 66044 _Utils_Tuple2(1, 50), 66045 $elm$core$Maybe$Just( 66046 _Utils_Tuple2(4, 51))), 66047 A4( 66048 $pablohirafuji$elm_qrcode$QRCode$GroupInfo$newGroupInfo, 66049 12, 66050 22, 66051 _Utils_Tuple2(6, 36), 66052 $elm$core$Maybe$Just( 66053 _Utils_Tuple2(2, 37))), 66054 A4( 66055 $pablohirafuji$elm_qrcode$QRCode$GroupInfo$newGroupInfo, 66056 13, 66057 22, 66058 _Utils_Tuple2(8, 37), 66059 $elm$core$Maybe$Just( 66060 _Utils_Tuple2(1, 38))), 66061 A4( 66062 $pablohirafuji$elm_qrcode$QRCode$GroupInfo$newGroupInfo, 66063 14, 66064 24, 66065 _Utils_Tuple2(4, 40), 66066 $elm$core$Maybe$Just( 66067 _Utils_Tuple2(5, 41))), 66068 A4( 66069 $pablohirafuji$elm_qrcode$QRCode$GroupInfo$newGroupInfo, 66070 15, 66071 24, 66072 _Utils_Tuple2(5, 41), 66073 $elm$core$Maybe$Just( 66074 _Utils_Tuple2(5, 42))), 66075 A4( 66076 $pablohirafuji$elm_qrcode$QRCode$GroupInfo$newGroupInfo, 66077 16, 66078 28, 66079 _Utils_Tuple2(7, 45), 66080 $elm$core$Maybe$Just( 66081 _Utils_Tuple2(3, 46))), 66082 A4( 66083 $pablohirafuji$elm_qrcode$QRCode$GroupInfo$newGroupInfo, 66084 17, 66085 28, 66086 _Utils_Tuple2(10, 46), 66087 $elm$core$Maybe$Just( 66088 _Utils_Tuple2(1, 47))), 66089 A4( 66090 $pablohirafuji$elm_qrcode$QRCode$GroupInfo$newGroupInfo, 66091 18, 66092 26, 66093 _Utils_Tuple2(9, 43), 66094 $elm$core$Maybe$Just( 66095 _Utils_Tuple2(4, 44))), 66096 A4( 66097 $pablohirafuji$elm_qrcode$QRCode$GroupInfo$newGroupInfo, 66098 19, 66099 26, 66100 _Utils_Tuple2(3, 44), 66101 $elm$core$Maybe$Just( 66102 _Utils_Tuple2(11, 45))), 66103 A4( 66104 $pablohirafuji$elm_qrcode$QRCode$GroupInfo$newGroupInfo, 66105 20, 66106 26, 66107 _Utils_Tuple2(3, 41), 66108 $elm$core$Maybe$Just( 66109 _Utils_Tuple2(13, 42))), 66110 A4( 66111 $pablohirafuji$elm_qrcode$QRCode$GroupInfo$newGroupInfo, 66112 21, 66113 26, 66114 _Utils_Tuple2(17, 42), 66115 $elm$core$Maybe$Nothing), 66116 A4( 66117 $pablohirafuji$elm_qrcode$QRCode$GroupInfo$newGroupInfo, 66118 22, 66119 28, 66120 _Utils_Tuple2(17, 46), 66121 $elm$core$Maybe$Nothing), 66122 A4( 66123 $pablohirafuji$elm_qrcode$QRCode$GroupInfo$newGroupInfo, 66124 23, 66125 28, 66126 _Utils_Tuple2(4, 47), 66127 $elm$core$Maybe$Just( 66128 _Utils_Tuple2(14, 48))), 66129 A4( 66130 $pablohirafuji$elm_qrcode$QRCode$GroupInfo$newGroupInfo, 66131 24, 66132 28, 66133 _Utils_Tuple2(6, 45), 66134 $elm$core$Maybe$Just( 66135 _Utils_Tuple2(14, 46))), 66136 A4( 66137 $pablohirafuji$elm_qrcode$QRCode$GroupInfo$newGroupInfo, 66138 25, 66139 28, 66140 _Utils_Tuple2(8, 47), 66141 $elm$core$Maybe$Just( 66142 _Utils_Tuple2(13, 48))), 66143 A4( 66144 $pablohirafuji$elm_qrcode$QRCode$GroupInfo$newGroupInfo, 66145 26, 66146 28, 66147 _Utils_Tuple2(19, 46), 66148 $elm$core$Maybe$Just( 66149 _Utils_Tuple2(4, 47))), 66150 A4( 66151 $pablohirafuji$elm_qrcode$QRCode$GroupInfo$newGroupInfo, 66152 27, 66153 28, 66154 _Utils_Tuple2(22, 45), 66155 $elm$core$Maybe$Just( 66156 _Utils_Tuple2(3, 46))), 66157 A4( 66158 $pablohirafuji$elm_qrcode$QRCode$GroupInfo$newGroupInfo, 66159 28, 66160 28, 66161 _Utils_Tuple2(3, 45), 66162 $elm$core$Maybe$Just( 66163 _Utils_Tuple2(23, 46))), 66164 A4( 66165 $pablohirafuji$elm_qrcode$QRCode$GroupInfo$newGroupInfo, 66166 29, 66167 28, 66168 _Utils_Tuple2(21, 45), 66169 $elm$core$Maybe$Just( 66170 _Utils_Tuple2(7, 46))), 66171 A4( 66172 $pablohirafuji$elm_qrcode$QRCode$GroupInfo$newGroupInfo, 66173 30, 66174 28, 66175 _Utils_Tuple2(19, 47), 66176 $elm$core$Maybe$Just( 66177 _Utils_Tuple2(10, 48))), 66178 A4( 66179 $pablohirafuji$elm_qrcode$QRCode$GroupInfo$newGroupInfo, 66180 31, 66181 28, 66182 _Utils_Tuple2(2, 46), 66183 $elm$core$Maybe$Just( 66184 _Utils_Tuple2(29, 47))), 66185 A4( 66186 $pablohirafuji$elm_qrcode$QRCode$GroupInfo$newGroupInfo, 66187 32, 66188 28, 66189 _Utils_Tuple2(10, 46), 66190 $elm$core$Maybe$Just( 66191 _Utils_Tuple2(23, 47))), 66192 A4( 66193 $pablohirafuji$elm_qrcode$QRCode$GroupInfo$newGroupInfo, 66194 33, 66195 28, 66196 _Utils_Tuple2(14, 46), 66197 $elm$core$Maybe$Just( 66198 _Utils_Tuple2(21, 47))), 66199 A4( 66200 $pablohirafuji$elm_qrcode$QRCode$GroupInfo$newGroupInfo, 66201 34, 66202 28, 66203 _Utils_Tuple2(14, 46), 66204 $elm$core$Maybe$Just( 66205 _Utils_Tuple2(23, 47))), 66206 A4( 66207 $pablohirafuji$elm_qrcode$QRCode$GroupInfo$newGroupInfo, 66208 35, 66209 28, 66210 _Utils_Tuple2(12, 47), 66211 $elm$core$Maybe$Just( 66212 _Utils_Tuple2(26, 48))), 66213 A4( 66214 $pablohirafuji$elm_qrcode$QRCode$GroupInfo$newGroupInfo, 66215 36, 66216 28, 66217 _Utils_Tuple2(6, 47), 66218 $elm$core$Maybe$Just( 66219 _Utils_Tuple2(34, 48))), 66220 A4( 66221 $pablohirafuji$elm_qrcode$QRCode$GroupInfo$newGroupInfo, 66222 37, 66223 28, 66224 _Utils_Tuple2(29, 46), 66225 $elm$core$Maybe$Just( 66226 _Utils_Tuple2(14, 47))), 66227 A4( 66228 $pablohirafuji$elm_qrcode$QRCode$GroupInfo$newGroupInfo, 66229 38, 66230 28, 66231 _Utils_Tuple2(13, 46), 66232 $elm$core$Maybe$Just( 66233 _Utils_Tuple2(32, 47))), 66234 A4( 66235 $pablohirafuji$elm_qrcode$QRCode$GroupInfo$newGroupInfo, 66236 39, 66237 28, 66238 _Utils_Tuple2(40, 47), 66239 $elm$core$Maybe$Just( 66240 _Utils_Tuple2(7, 48))), 66241 A4( 66242 $pablohirafuji$elm_qrcode$QRCode$GroupInfo$newGroupInfo, 66243 40, 66244 28, 66245 _Utils_Tuple2(18, 47), 66246 $elm$core$Maybe$Just( 66247 _Utils_Tuple2(31, 48))) 66248 ]);
66249var $pablohirafuji$elm_qrcode$QRCode$GroupInfo$dataQ = _List_fromArray( 66250 [ 66251 A4( 66252 $pablohirafuji$elm_qrcode$QRCode$GroupInfo$newGroupInfo, 66253 1, 66254 13, 66255 _Utils_Tuple2(1, 13), 66256 $elm$core$Maybe$Nothing), 66257 A4( 66258 $pablohirafuji$elm_qrcode$QRCode$GroupInfo$newGroupInfo, 66259 2, 66260 22, 66261 _Utils_Tuple2(1, 22), 66262 $elm$core$Maybe$Nothing), 66263 A4( 66264 $pablohirafuji$elm_qrcode$QRCode$GroupInfo$newGroupInfo, 66265 3, 66266 18, 66267 _Utils_Tuple2(2, 17), 66268 $elm$core$Maybe$Nothing), 66269 A4( 66270 $pablohirafuji$elm_qrcode$QRCode$GroupInfo$newGroupInfo, 66271 4, 66272 26, 66273 _Utils_Tuple2(2, 24), 66274 $elm$core$Maybe$Nothing), 66275 A4( 66276 $pablohirafuji$elm_qrcode$QRCode$GroupInfo$newGroupInfo, 66277 5, 66278 18, 66279 _Utils_Tuple2(2, 15), 66280 $elm$core$Maybe$Just( 66281 _Utils_Tuple2(2, 16))), 66282 A4( 66283 $pablohirafuji$elm_qrcode$QRCode$GroupInfo$newGroupInfo, 66284 6, 66285 24, 66286 _Utils_Tuple2(4, 19), 66287 $elm$core$Maybe$Nothing), 66288 A4( 66289 $pablohirafuji$elm_qrcode$QRCode$GroupInfo$newGroupInfo, 66290 7, 66291 18, 66292 _Utils_Tuple2(2, 14), 66293 $elm$core$Maybe$Just( 66294 _Utils_Tuple2(4, 15))), 66295 A4( 66296 $pablohirafuji$elm_qrcode$QRCode$GroupInfo$newGroupInfo, 66297 8, 66298 22, 66299 _Utils_Tuple2(4, 18), 66300 $elm$core$Maybe$Just( 66301 _Utils_Tuple2(2, 19))), 66302 A4( 66303 $pablohirafuji$elm_qrcode$QRCode$GroupInfo$newGroupInfo, 66304 9, 66305 20, 66306 _Utils_Tuple2(4, 16), 66307 $elm$core$Maybe$Just( 66308 _Utils_Tuple2(4, 17))), 66309 A4( 66310 $pablohirafuji$elm_qrcode$QRCode$GroupInfo$newGroupInfo, 66311 10, 66312 24, 66313 _Utils_Tuple2(6, 19), 66314 $elm$core$Maybe$Just( 66315 _Utils_Tuple2(2, 20))), 66316 A4( 66317 $pablohirafuji$elm_qrcode$QRCode$GroupInfo$newGroupInfo, 66318 11, 66319 28, 66320 _Utils_Tuple2(4, 22), 66321 $elm$core$Maybe$Just( 66322 _Utils_Tuple2(4, 23))), 66323 A4( 66324 $pablohirafuji$elm_qrcode$QRCode$GroupInfo$newGroupInfo, 66325 12, 66326 26, 66327 _Utils_Tuple2(4, 20), 66328 $elm$core$Maybe$Just( 66329 _Utils_Tuple2(6, 21))), 66330 A4( 66331 $pablohirafuji$elm_qrcode$QRCode$GroupInfo$newGroupInfo, 66332 13, 66333 24, 66334 _Utils_Tuple2(8, 20), 66335 $elm$core$Maybe$Just( 66336 _Utils_Tuple2(4, 21))), 66337 A4( 66338 $pablohirafuji$elm_qrcode$QRCode$GroupInfo$newGroupInfo, 66339 14, 66340 20, 66341 _Utils_Tuple2(11, 16), 66342 $elm$core$Maybe$Just( 66343 _Utils_Tuple2(5, 17))), 66344 A4( 66345 $pablohirafuji$elm_qrcode$QRCode$GroupInfo$newGroupInfo, 66346 15, 66347 30, 66348 _Utils_Tuple2(5, 24), 66349 $elm$core$Maybe$Just( 66350 _Utils_Tuple2(7, 25))), 66351 A4( 66352 $pablohirafuji$elm_qrcode$QRCode$GroupInfo$newGroupInfo, 66353 16, 66354 24, 66355 _Utils_Tuple2(15, 19), 66356 $elm$core$Maybe$Just( 66357 _Utils_Tuple2(2, 20))), 66358 A4( 66359 $pablohirafuji$elm_qrcode$QRCode$GroupInfo$newGroupInfo, 66360 17, 66361 28, 66362 _Utils_Tuple2(1, 22), 66363 $elm$core$Maybe$Just( 66364 _Utils_Tuple2(15, 23))), 66365 A4( 66366 $pablohirafuji$elm_qrcode$QRCode$GroupInfo$newGroupInfo, 66367 18, 66368 28, 66369 _Utils_Tuple2(17, 22), 66370 $elm$core$Maybe$Just( 66371 _Utils_Tuple2(1, 23))), 66372 A4( 66373 $pablohirafuji$elm_qrcode$QRCode$GroupInfo$newGroupInfo, 66374 19, 66375 26, 66376 _Utils_Tuple2(17, 21), 66377 $elm$core$Maybe$Just( 66378 _Utils_Tuple2(4, 22))), 66379 A4( 66380 $pablohirafuji$elm_qrcode$QRCode$GroupInfo$newGroupInfo, 66381 20, 66382 30, 66383 _Utils_Tuple2(15, 24), 66384 $elm$core$Maybe$Just( 66385 _Utils_Tuple2(5, 25))), 66386 A4( 66387 $pablohirafuji$elm_qrcode$QRCode$GroupInfo$newGroupInfo, 66388 21, 66389 28, 66390 _Utils_Tuple2(17, 22), 66391 $elm$core$Maybe$Just( 66392 _Utils_Tuple2(6, 23))), 66393 A4( 66394 $pablohirafuji$elm_qrcode$QRCode$GroupInfo$newGroupInfo, 66395 22, 66396 30, 66397 _Utils_Tuple2(7, 24), 66398 $elm$core$Maybe$Just( 66399 _Utils_Tuple2(16, 25))), 66400 A4( 66401 $pablohirafuji$elm_qrcode$QRCode$GroupInfo$newGroupInfo, 66402 23, 66403 30, 66404 _Utils_Tuple2(11, 24), 66405 $elm$core$Maybe$Just( 66406 _Utils_Tuple2(14, 25))), 66407 A4( 66408 $pablohirafuji$elm_qrcode$QRCode$GroupInfo$newGroupInfo, 66409 24, 66410 30, 66411 _Utils_Tuple2(11, 24), 66412 $elm$core$Maybe$Just( 66413 _Utils_Tuple2(16, 25))), 66414 A4( 66415 $pablohirafuji$elm_qrcode$QRCode$GroupInfo$newGroupInfo, 66416 25, 66417 30, 66418 _Utils_Tuple2(7, 24), 66419 $elm$core$Maybe$Just( 66420 _Utils_Tuple2(22, 25))), 66421 A4( 66422 $pablohirafuji$elm_qrcode$QRCode$GroupInfo$newGroupInfo, 66423 26, 66424 28, 66425 _Utils_Tuple2(28, 22), 66426 $elm$core$Maybe$Just( 66427 _Utils_Tuple2(6, 23))), 66428 A4( 66429 $pablohirafuji$elm_qrcode$QRCode$GroupInfo$newGroupInfo, 66430 27, 66431 30, 66432 _Utils_Tuple2(8, 23), 66433 $elm$core$Maybe$Just( 66434 _Utils_Tuple2(26, 24))), 66435 A4( 66436 $pablohirafuji$elm_qrcode$QRCode$GroupInfo$newGroupInfo, 66437 28, 66438 30, 66439 _Utils_Tuple2(4, 24), 66440 $elm$core$Maybe$Just( 66441 _Utils_Tuple2(31, 25))), 66442 A4( 66443 $pablohirafuji$elm_qrcode$QRCode$GroupInfo$newGroupInfo, 66444 29, 66445 30, 66446 _Utils_Tuple2(1, 23), 66447 $elm$core$Maybe$Just( 66448 _Utils_Tuple2(37, 24))), 66449 A4( 66450 $pablohirafuji$elm_qrcode$QRCode$GroupInfo$newGroupInfo, 66451 30, 66452 30, 66453 _Utils_Tuple2(15, 24), 66454 $elm$core$Maybe$Just( 66455 _Utils_Tuple2(25, 25))), 66456 A4( 66457 $pablohirafuji$elm_qrcode$QRCode$GroupInfo$newGroupInfo, 66458 31, 66459 30, 66460 _Utils_Tuple2(42, 24), 66461 $elm$core$Maybe$Just( 66462 _Utils_Tuple2(1, 25))), 66463 A4( 66464 $pablohirafuji$elm_qrcode$QRCode$GroupInfo$newGroupInfo, 66465 32, 66466 30, 66467 _Utils_Tuple2(10, 24), 66468 $elm$core$Maybe$Just( 66469 _Utils_Tuple2(35, 25))), 66470 A4( 66471 $pablohirafuji$elm_qrcode$QRCode$GroupInfo$newGroupInfo, 66472 33, 66473 30, 66474 _Utils_Tuple2(29, 24), 66475 $elm$core$Maybe$Just( 66476 _Utils_Tuple2(19, 25))), 66477 A4( 66478 $pablohirafuji$elm_qrcode$QRCode$GroupInfo$newGroupInfo, 66479 34, 66480 30, 66481 _Utils_Tuple2(44, 24), 66482 $elm$core$Maybe$Just( 66483 _Utils_Tuple2(7, 25))), 66484 A4( 66485 $pablohirafuji$elm_qrcode$QRCode$GroupInfo$newGroupInfo, 66486 35, 66487 30, 66488 _Utils_Tuple2(39, 24), 66489 $elm$core$Maybe$Just( 66490 _Utils_Tuple2(14, 25))), 66491 A4( 66492 $pablohirafuji$elm_qrcode$QRCode$GroupInfo$newGroupInfo, 66493 36, 66494 30, 66495 _Utils_Tuple2(46, 24), 66496 $elm$core$Maybe$Just( 66497 _Utils_Tuple2(10, 25))), 66498 A4( 66499 $pablohirafuji$elm_qrcode$QRCode$GroupInfo$newGroupInfo, 66500 37, 66501 30, 66502 _Utils_Tuple2(49, 24), 66503 $elm$core$Maybe$Just( 66504 _Utils_Tuple2(10, 25))), 66505 A4( 66506 $pablohirafuji$elm_qrcode$QRCode$GroupInfo$newGroupInfo, 66507 38, 66508 30, 66509 _Utils_Tuple2(48, 24), 66510 $elm$core$Maybe$Just( 66511 _Utils_Tuple2(14, 25))), 66512 A4( 66513 $pablohirafuji$elm_qrcode$QRCode$GroupInfo$newGroupInfo, 66514 39, 66515 30, 66516 _Utils_Tuple2(43, 24), 66517 $elm$core$Maybe$Just( 66518 _Utils_Tuple2(22, 25))), 66519 A4( 66520 $pablohirafuji$elm_qrcode$QRCode$GroupInfo$newGroupInfo, 66521 40, 66522 30, 66523 _Utils_Tuple2(34, 24), 66524 $elm$core$Maybe$Just( 66525 _Utils_Tuple2(34, 25))) 66526 ]); 66527var $pablohirafuji$elm_qrcode$QRCode$GroupInfo$getGroupData = function (ecLevel) { 66528 switch (ecLevel) { 66529 case 0: 66530 return $pablohirafuji$elm_qrcode$QRCode$GroupInfo$dataL;
66531 case 1: 66532 return $pablohirafuji$elm_qrcode$QRCode$GroupInfo$dataM; 66533 case 2: 66534 return $pablohirafuji$elm_qrcode$QRCode$GroupInfo$dataQ; 66535 default: 66536 return $pablohirafuji$elm_qrcode$QRCode$GroupInfo$dataH; 66537 } 66538}; 66539var $pablohirafuji$elm_qrcode$QRCode$Encode$getVersion = F3( 66540 function (ecLevel, mode, dataLength) { 66541 return A2( 66542 $elm$core$Result$fromMaybe, 66543 $pablohirafuji$elm_qrcode$QRCode$Error$InputLengthOverflow, 66544 $elm$core$List$head( 66545 A2( 66546 $elm$core$List$sortBy, 66547 function ($) { 66548 return $.es; 66549 }, 66550 A2( 66551 $elm$core$List$filter, 66552 A2($pablohirafuji$elm_qrcode$QRCode$Encode$filterCapacity, mode, dataLength), 66553 $pablohirafuji$elm_qrcode$QRCode$GroupInfo$getGroupData(ecLevel))))); 66554 }); 66555var $pablohirafuji$elm_qrcode$QRCode$Encode$versionToModel = F5( 66556 function (inputStr, ecLevel, mode, partialBitsCount, groupInfo) { 66557 return { 66558 fX: partialBitsCount + A2($pablohirafuji$elm_qrcode$QRCode$Encode$charCountIndicatorLength, mode, groupInfo.fK), 66559 ir: ecLevel, 66560 mT: groupInfo, 66561 gz: inputStr, 66562 e0: mode 66563 }; 66564 }); 66565var $pablohirafuji$elm_qrcode$QRCode$Encode$selectVersion = F4( 66566 function (inputStr, ecLevel, mode, encodedStr) { 66567 var partialBitsCount = 4 + A3( 66568 $elm$core$List$foldl, 66569 F2( 66570 function (a, b) { 66571 return a.b + b; 66572 }), 66573 0, 66574 encodedStr); 66575 return A2( 66576 $elm$core$Result$map, 66577 function (b) { 66578 return _Utils_Tuple2(encodedStr, b); 66579 }, 66580 A2( 66581 $elm$core$Result$map, 66582 A4($pablohirafuji$elm_qrcode$QRCode$Encode$versionToModel, inputStr, ecLevel, mode, partialBitsCount), 66583 A3($pablohirafuji$elm_qrcode$QRCode$Encode$getVersion, ecLevel, mode, partialBitsCount))); 66584 }); 66585var $pablohirafuji$elm_qrcode$QRCode$Encode$breakList = F3( 66586 function (checkFinish, _v0, _v1) { 66587 breakList: 66588 while (true) { 66589 var times = _v0.a; 66590 var itemCount = _v0.b; 66591 var byteList = _v1.a; 66592 var progress = _v1.b; 66593 if (times > 0) { 66594 var remainList = A2($elm$core$List$drop, itemCount, byteList); 66595 var block = A2($elm$core$List$take, itemCount, byteList); 66596 var $temp$checkFinish = checkFinish, 66597 $temp$_v0 = _Utils_Tuple2(times - 1, itemCount), 66598 $temp$_v1 = _Utils_Tuple2( 66599 remainList, 66600 A2($elm$core$List$cons, block, progress)); 66601 checkFinish = $temp$checkFinish; 66602 _v0 = $temp$_v0; 66603 _v1 = $temp$_v1; 66604 continue breakList; 66605 } else { 66606 if (checkFinish && ($elm$core$List$length(byteList) > 0)) { 66607 return $elm$core$Result$Err($pablohirafuji$elm_qrcode$QRCode$Error$InputLengthOverflow); 66608 } else { 66609 return $elm$core$Result$Ok( 66610 _Utils_Tuple2(byteList, progress)); 66611 } 66612 } 66613 } 66614 }); 66615var $pablohirafuji$elm_qrcode$QRCode$Encode$toBlocks = function (_v0) { 66616 var model = _v0.a; 66617 var groupInfo = model.mT; 66618 var byteList = _v0.b; 66619 var _v1 = groupInfo.nH; 66620 if (!_v1.$) { 66621 var group2 = _v1.a; 66622 return A2( 66623 $elm$core$Result$map, 66624 function (b) { 66625 return _Utils_Tuple2(model, b); 66626 }, 66627 A2( 66628 $elm$core$Result$map, 66629 A2($elm$core$Basics$composeR, $elm$core$Tuple$second, $elm$core$List$reverse), 66630 A2( 66631 $elm$core$Result$andThen, 66632 A2($pablohirafuji$elm_qrcode$QRCode$Encode$breakList, true, group2), 66633 A3( 66634 $pablohirafuji$elm_qrcode$QRCode$Encode$breakList, 66635 false, 66636 groupInfo.iN, 66637 _Utils_Tuple2(byteList, _List_Nil))))); 66638 } else { 66639 return A2( 66640 $elm$core$Result$map, 66641 function (b) { 66642 return _Utils_Tuple2(model, b); 66643 }, 66644 A2( 66645 $elm$core$Result$map, 66646 A2($elm$core$Basics$composeR, $elm$core$Tuple$second, $elm$core$List$reverse), 66647 A3( 66648 $pablohirafuji$elm_qrcode$QRCode$Encode$breakList, 66649 true, 66650 groupInfo.iN, 66651 _Utils_Tuple2(byteList, _List_Nil)))); 66652 } 66653}; 66654var $pablohirafuji$elm_qrcode$QRCode$Encode$encode = F2( 66655 function (inputStr, ecLevel) { 66656 var mode = $pablohirafuji$elm_qrcode$QRCode$Encode$selectMode(inputStr); 66657 return A2( 66658 $elm$core$Result$map, 66659 $pablohirafuji$elm_qrcode$QRCode$Encode$concatTranspose, 66660 A2( 66661 $elm$core$Result$andThen, 66662 $pablohirafuji$elm_qrcode$QRCode$Encode$getErrorCorrection, 66663 A2( 66664 $elm$core$Result$andThen, 66665 $pablohirafuji$elm_qrcode$QRCode$Encode$toBlocks, 66666 A2( 66667 $elm$core$Result$map,
66668 $pablohirafuji$elm_qrcode$QRCode$Encode$addInfoAndFinalBits, 66669 A2( 66670 $elm$core$Result$andThen, 66671 A3($pablohirafuji$elm_qrcode$QRCode$Encode$selectVersion, inputStr, ecLevel, mode), 66672 A2($pablohirafuji$elm_qrcode$QRCode$Encode$encoder, mode, inputStr)))))); 66673 }); 66674var $pablohirafuji$elm_qrcode$QRCode$fromStringWith = F2( 66675 function (ecLevel, input) { 66676 return A2( 66677 $elm$core$Result$mapError, 66678 $pablohirafuji$elm_qrcode$QRCode$convertError, 66679 A2( 66680 $elm$core$Result$andThen, 66681 function (_v0) { 66682 var encodeModel = _v0.a; 66683 var encodedData = _v0.b; 66684 return A2( 66685 $elm$core$Result$map, 66686 function (matrix) { 66687 return {dr: matrix, fK: encodeModel.mT.fK}; 66688 }, 66689 $pablohirafuji$elm_qrcode$QRCode$Matrix$apply( 66690 _Utils_Tuple2(encodeModel, encodedData))); 66691 }, 66692 A2( 66693 $pablohirafuji$elm_qrcode$QRCode$Encode$encode, 66694 input, 66695 $pablohirafuji$elm_qrcode$QRCode$convertEC(ecLevel)))); 66696 }); 66697var $pablohirafuji$elm_qrcode$QRCode$fromString = $pablohirafuji$elm_qrcode$QRCode$fromStringWith(2); 66698var $pablohirafuji$elm_qrcode$QRCode$Render$Svg$moduleSize = 5; 66699var $pablohirafuji$elm_qrcode$QRCode$Render$Svg$appendLastRect = function (_v0) { 66700 var lastRect = _v0.a; 66701 var rowLines = _v0.b; 66702 return A2( 66703 $elm$core$List$cons, 66704 'h' + $elm$core$String$fromInt(lastRect.kZ * $pablohirafuji$elm_qrcode$QRCode$Render$Svg$moduleSize), 66705 rowLines); 66706}; 66707var $elm$svg$Svg$Attributes$shapeRendering = _VirtualDom_attribute('shape-rendering'); 66708var $pablohirafuji$elm_qrcode$QRCode$Render$Svg$toRowLines = F2( 66709 function (isDark, _v0) { 66710 var lastRect = _v0.a; 66711 var rowLines = _v0.b; 66712 return isDark ? ((!lastRect.b1) ? _Utils_Tuple2( 66713 _Utils_update( 66714 lastRect, 66715 {kZ: lastRect.kZ + 1}), 66716 rowLines) : _Utils_Tuple2( 66717 {b1: 0, kZ: 1}, 66718 A2( 66719 $elm$core$List$cons, 66720 $elm$core$String$concat( 66721 _List_fromArray( 66722 [ 66723 (lastRect.kZ > 0) ? ('h' + $elm$core$String$fromInt(lastRect.kZ * $pablohirafuji$elm_qrcode$QRCode$Render$Svg$moduleSize)) : '', 66724 'm', 66725 $elm$core$String$fromInt(lastRect.b1 * $pablohirafuji$elm_qrcode$QRCode$Render$Svg$moduleSize), 66726 ' 0' 66727 ])), 66728 rowLines))) : _Utils_Tuple2( 66729 _Utils_update( 66730 lastRect, 66731 {b1: lastRect.b1 + 1}), 66732 rowLines); 66733 }); 66734var $elm$svg$Svg$Attributes$transform = _VirtualDom_attribute('transform'); 66735var $pablohirafuji$elm_qrcode$QRCode$Render$Svg$viewRow = F3( 66736 function (quietZoneSize, rowIndex, rowLines) { 66737 return A2( 66738 $elm$core$List$cons, 66739 'M0 ', 66740 A2( 66741 $elm$core$List$cons, 66742 $elm$core$String$fromInt(rowIndex * $pablohirafuji$elm_qrcode$QRCode$Render$Svg$moduleSize), 66743 rowLines)); 66744 }); 66745var $pablohirafuji$elm_qrcode$QRCode$Render$Svg$viewBase = F3( 66746 function (quietZoneSize, extraAttrs, matrix) { 66747 var quietZonePx = quietZoneSize * $pablohirafuji$elm_qrcode$QRCode$Render$Svg$moduleSize; 66748 var sizePx = $elm$core$String$fromInt( 66749 ($elm$core$List$length(matrix) * $pablohirafuji$elm_qrcode$QRCode$Render$Svg$moduleSize) + (2 * quietZonePx)); 66750 return A2( 66751 $elm$svg$Svg$svg, 66752 _Utils_ap( 66753 _List_fromArray( 66754 [ 66755 $elm$svg$Svg$Attributes$viewBox('0 0 ' + (sizePx + (' ' + sizePx))), 66756 $elm$svg$Svg$Attributes$shapeRendering('crispEdges'), 66757 $elm$svg$Svg$Attributes$stroke('#000'), 66758 $elm$svg$Svg$Attributes$strokeWidth( 66759 $elm$core$String$fromInt($pablohirafuji$elm_qrcode$QRCode$Render$Svg$moduleSize) + 'px') 66760 ]), 66761 extraAttrs), 66762 function (d) { 66763 return _List_fromArray( 66764 [ 66765 A2( 66766 $elm$svg$Svg$path, 66767 _List_fromArray( 66768 [ 66769 d, 66770 $elm$svg$Svg$Attributes$transform( 66771 'translate(' + ($elm$core$String$fromInt(quietZonePx) + (', ' + ($elm$core$String$fromFloat(quietZonePx + ($pablohirafuji$elm_qrcode$QRCode$Render$Svg$moduleSize / 2)) + ')')))), 66772 $elm$svg$Svg$Attributes$strokeWidth('5px') 66773 ]), 66774 _List_Nil) 66775 ]); 66776 }( 66777 $elm$svg$Svg$Attributes$d( 66778 $elm$core$String$concat( 66779 $elm$core$List$concat( 66780 A2( 66781 $elm$core$List$indexedMap, 66782 $pablohirafuji$elm_qrcode$QRCode$Render$Svg$viewRow(quietZoneSize), 66783 A2( 66784 $elm$core$List$map, 66785 A2( 66786 $elm$core$Basics$composeR, 66787 A2( 66788 $elm$core$List$foldl, 66789 $pablohirafuji$elm_qrcode$QRCode$Render$Svg$toRowLines, 66790 _Utils_Tuple2( 66791 {b1: 0, kZ: 0}, 66792 _List_Nil)), 66793 A2($elm$core$Basics$composeR, $pablohirafuji$elm_qrcode$QRCode$Render$Svg$appendLastRect, $elm$core$List$reverse)), 66794 matrix))))))); 66795 }); 66796var $pablohirafuji$elm_qrcode$QRCode$Render$Svg$view = $pablohirafuji$elm_qrcode$QRCode$Render$Svg$viewBase(4); 66797var $pablohirafuji$elm_qrcode$QRCode$toSvg = F2( 66798 function (extraAttrs, _v0) { 66799 var matrix = _v0.dr; 66800 return A2($pablohirafuji$elm_qrcode$QRCode$Render$Svg$view, extraAttrs, matrix); 66801 }); 66802var $author$project$Page$Group$MembersTab$qrCodeView = function (link) { 66803 var _v0 = $pablohirafuji$elm_qrcode$QRCode$fromString(link); 66804 if (!_v0.$) { 66805 var qrCode = _v0.a; 66806 return A2( 66807 $author$project$UI$Components$card, 66808 _List_fromArray( 66809 [ 66810 $author$project$Ui$padding($author$project$UI$Theme$spacing.hE) 66811 ]), 66812 _List_fromArray( 66813 [ 66814 $author$project$Ui$html( 66815 A2( 66816 $pablohirafuji$elm_qrcode$QRCode$toSvg, 66817 _List_fromArray( 66818 [ 66819 A2($elm$html$Html$Attributes$attribute, 'width', '100%'), 66820 A2($elm$html$Html$Attributes$style, 'max-width', '200px'), 66821 A2($elm$html$Html$Attributes$style, 'margin', '0 auto'),
66822 A2($elm$html$Html$Attributes$style, 'display', 'block') 66823 ]), 66824 qrCode)) 66825 ])); 66826 } else { 66827 return $author$project$Ui$none; 66828 } 66829}; 66830var $author$project$Page$Group$MembersTab$shareBtn = F3( 66831 function (shareUrl, shareTitle, label) { 66832 return $author$project$Ui$html( 66833 A3( 66834 $elm$html$Html$node, 66835 'share-button', 66836 _List_fromArray( 66837 [ 66838 A2($elm$html$Html$Attributes$attribute, 'data-share-url', shareUrl), 66839 A2($elm$html$Html$Attributes$attribute, 'data-share-title', shareTitle) 66840 ]), 66841 _List_fromArray( 66842 [ 66843 A3( 66844 $author$project$Ui$layout, 66845 $author$project$Ui$withNoStylesheet($author$project$Ui$default), 66846 _List_Nil, 66847 A2( 66848 $author$project$Ui$row, 66849 A2( 66850 $elm$core$List$cons, 66851 $author$project$Ui$width($author$project$Ui$shrink), 66852 A2($elm$core$List$cons, $author$project$Ui$Font$noWrap, $author$project$UI$Components$btnOutlineAttrs)), 66853 _List_fromArray( 66854 [ 66855 A2( 66856 $author$project$Ui$el, 66857 _List_fromArray( 66858 [ 66859 $author$project$Ui$width($author$project$Ui$shrink) 66860 ]), 66861 A2($author$project$UI$Components$featherIcon, 16, $feathericons$elm_feather$FeatherIcons$share2)), 66862 $author$project$Ui$text(label) 66863 ]))) 66864 ]))); 66865 }); 66866var $author$project$Page$Group$MembersTab$inviteSection = F5( 66867 function (i18n, toMsg, model, config, groupName) { 66868 var link = config.np; 66869 return A2( 66870 $author$project$Ui$column, 66871 _List_Nil, 66872 _List_fromArray( 66873 [ 66874 $author$project$UI$Components$sectionLabel( 66875 $author$project$Translations$inviteLinkTitle(i18n)), 66876 A2( 66877 $author$project$Ui$column, 66878 _List_fromArray( 66879 [ 66880 $author$project$Ui$spacing($author$project$UI$Theme$spacing.qk), 66881 $author$project$Ui$width($author$project$Ui$fill) 66882 ]), 66883 _List_fromArray( 66884 [ 66885 A2( 66886 $author$project$Ui$el, 66887 _List_fromArray( 66888 [ 66889 $author$project$Ui$Font$size($author$project$UI$Theme$font.qk), 66890 $author$project$Ui$Font$color($author$project$UI$Theme$base.aM) 66891 ]), 66892 $author$project$Ui$text( 66893 $author$project$Translations$inviteLinkHint(i18n))), 66894 A2( 66895 $author$project$Ui$row, 66896 _List_fromArray( 66897 [ 66898 $author$project$Ui$wrap, 66899 $author$project$Ui$spacing($author$project$UI$Theme$spacing.qk), 66900 $author$project$Ui$width($author$project$Ui$fill) 66901 ]), 66902 _List_fromArray( 66903 [ 66904 A2( 66905 $author$project$Page$Group$MembersTab$copyBtn, 66906 link, 66907 $author$project$Translations$inviteLinkCopy(i18n)), 66908 A3( 66909 $author$project$Page$Group$MembersTab$shareBtn, 66910 link, 66911 groupName, 66912 $author$project$Translations$inviteLinkShare(i18n)), 66913 A2( 66914 $author$project$UI$Components$btnOutline, 66915 _List_fromArray( 66916 [ 66917 $author$project$Ui$width($author$project$Ui$shrink), 66918 $author$project$Ui$Font$noWrap 66919 ]), 66920 { 66921 gv: $elm$core$Maybe$Just( 66922 A2( 66923 $author$project$Ui$el, 66924 _List_fromArray( 66925 [ 66926 $author$project$Ui$width($author$project$Ui$shrink) 66927 ]), 66928 A2($author$project$UI$Components$featherIcon, 16, $feathericons$elm_feather$FeatherIcons$grid))), 66929 i6: 'QR', 66930 e7: toMsg($author$project$Page$Group$MembersTab$ToggleQrCode) 66931 }) 66932 ])), 66933 model.dS ? $author$project$Page$Group$MembersTab$qrCodeView(link) : $author$project$Ui$none 66934 ])) 66935 ])); 66936 }); 66937var $author$project$Translations$memberAddButton = function (_v0) { 66938 var lang = _v0; 66939 if (!lang) { 66940 return '+ Add Member'; 66941 } else { 66942 return '+ Ajouter un membre'; 66943 } 66944}; 66945var $author$project$UI$Components$AvatarNeutralInversed = 2; 66946var $author$project$Page$Group$MembersTab$ToggleMember = function (a) { 66947 return {$: 1, a: a}; 66948}; 66949var $author$project$Translations$memberJoinedDate = F2( 66950 function (date, _v0) { 66951 var lang = _v0; 66952 if (!lang) { 66953 return 'Joined ' + date; 66954 } else { 66955 return 'Membre depuis ' + date; 66956 } 66957 }); 66958var $author$project$Page$Group$MembersTab$monthYear = F3( 66959 function (i18n, zone, posix) { 66960 var year = $elm$core$String$fromInt( 66961 A2($elm$time$Time$toYear, zone, posix));
66962 var month = function () { 66963 var _v0 = A2($elm$time$Time$toMonth, zone, posix); 66964 switch (_v0) { 66965 case 0: 66966 return $author$project$Translations$monthShortJan(i18n); 66967 case 1: 66968 return $author$project$Translations$monthShortFeb(i18n); 66969 case 2: 66970 return $author$project$Translations$monthShortMar(i18n); 66971 case 3: 66972 return $author$project$Translations$monthShortApr(i18n); 66973 case 4: 66974 return $author$project$Translations$monthShortMay(i18n); 66975 case 5: 66976 return $author$project$Translations$monthShortJun(i18n); 66977 case 6: 66978 return $author$project$Translations$monthShortJul(i18n); 66979 case 7: 66980 return $author$project$Translations$monthShortAug(i18n); 66981 case 8: 66982 return $author$project$Translations$monthShortSep(i18n); 66983 case 9: 66984 return $author$project$Translations$monthShortOct(i18n); 66985 case 10: 66986 return $author$project$Translations$monthShortNov(i18n); 66987 default: 66988 return $author$project$Translations$monthShortDec(i18n); 66989 } 66990 }(); 66991 return month + (' ' + year); 66992 }); 66993var $author$project$Page$Group$MembersTab$formatJoinDate = F3( 66994 function (i18n, zone, posix) { 66995 return A2( 66996 $author$project$Translations$memberJoinedDate, 66997 A3($author$project$Page$Group$MembersTab$monthYear, i18n, zone, posix), 66998 i18n); 66999 }); 67000var $author$project$Page$Group$MembersTab$EditMetadata = function (a) { 67001 return {$: 5, a: a}; 67002}; 67003var $author$project$Page$Group$MembersTab$LinkSelf = function (a) { 67004 return {$: 7, a: a}; 67005}; 67006var $author$project$Page$Group$MembersTab$Merge = function (a) { 67007 return {$: 6, a: a}; 67008}; 67009var $author$project$Page$Group$MembersTab$Retire = function (a) { 67010 return {$: 3, a: a}; 67011}; 67012var $author$project$Page$Group$MembersTab$Unretire = function (a) { 67013 return {$: 4, a: a}; 67014}; 67015var $author$project$Page$Group$MembersTab$copyButton = function (value) { 67016 return A2( 67017 $author$project$Ui$el, 67018 _List_fromArray( 67019 [ 67020 $author$project$Ui$width($author$project$Ui$shrink), 67021 $author$project$Ui$alignRight, 67022 $author$project$Ui$inFront( 67023 A2( 67024 $author$project$Ui$el, 67025 _List_fromArray( 67026 [ 67027 $author$project$Ui$width($author$project$Ui$fill), 67028 $author$project$Ui$height($author$project$Ui$fill) 67029 ]), 67030 $author$project$Ui$html( 67031 A3( 67032 $elm$html$Html$node, 67033 'copy-button', 67034 _List_fromArray( 67035 [ 67036 A2($elm$html$Html$Attributes$attribute, 'data-copy', value), 67037 A2($elm$html$Html$Attributes$style, 'display', 'block'), 67038 A2($elm$html$Html$Attributes$style, 'width', '100%'), 67039 A2($elm$html$Html$Attributes$style, 'height', '100%'), 67040 A2($elm$html$Html$Attributes$style, 'cursor', 'pointer') 67041 ]), 67042 _List_Nil)))), 67043 $author$project$Ui$Font$color($author$project$UI$Theme$base.aM), 67044 $author$project$Ui$pointer 67045 ]), 67046 A2($author$project$UI$Components$featherIcon, 16, $feathericons$elm_feather$FeatherIcons$copy)); 67047}; 67048var $author$project$Translations$memberDeviceThis = function (_v0) { 67049 var lang = _v0; 67050 if (!lang) { 67051 return 'this device'; 67052 } else { 67053 return 'cet appareil'; 67054 } 67055}; 67056var $author$project$Page$Group$MembersTab$thisDeviceTag = function (i18n) { 67057 return A2( 67058 $author$project$Ui$el, 67059 _List_fromArray( 67060 [ 67061 $author$project$Ui$Font$size($author$project$UI$Theme$font.bb), 67062 $author$project$Ui$Font$weight($author$project$UI$Theme$fontWeight.dL), 67063 A2($author$project$Ui$paddingXY, $author$project$UI$Theme$spacing.qk, $author$project$UI$Theme$spacing.bb), 67064 $author$project$Ui$rounded($author$project$UI$Theme$radius.qk), 67065 $author$project$Ui$background($author$project$UI$Theme$base.qR), 67066 $author$project$Ui$Font$color($author$project$UI$Theme$base.aM), 67067 $author$project$Ui$width($author$project$Ui$shrink) 67068 ]), 67069 $author$project$Ui$text( 67070 $author$project$Translations$memberDeviceThis(i18n))); 67071}; 67072var $author$project$Page$Group$MembersTab$deviceRow = F7( 67073 function (subtle, strong, i18n, zone, deviceId, linkedAt, isThis) { 67074 return A2( 67075 $author$project$Ui$row, 67076 _List_fromArray( 67077 [ 67078 $author$project$Ui$spacing($author$project$UI$Theme$spacing.qk), 67079 $author$project$Ui$contentCenterY, 67080 $author$project$Ui$width($author$project$Ui$fill) 67081 ]), 67082 _List_fromArray( 67083 [ 67084 A2( 67085 $author$project$Ui$el, 67086 _List_fromArray( 67087 [ 67088 $author$project$Ui$Font$color(subtle), 67089 $author$project$Ui$width($author$project$Ui$shrink) 67090 ]), 67091 A2($author$project$UI$Components$featherIcon, 16, $feathericons$elm_feather$FeatherIcons$smartphone)), 67092 A2( 67093 $author$project$Ui$column, 67094 _List_fromArray( 67095 [ 67096 $author$project$Ui$spacing($author$project$UI$Theme$spacing.bb), 67097 $author$project$Ui$width($author$project$Ui$fill) 67098 ]), 67099 _List_fromArray( 67100 [ 67101 A2( 67102 $author$project$Ui$row, 67103 _List_fromArray( 67104 [ 67105 $author$project$Ui$spacing($author$project$UI$Theme$spacing.qk), 67106 $author$project$Ui$contentCenterY, 67107 $author$project$Ui$width($author$project$Ui$shrink) 67108 ]), 67109 A2( 67110 $elm$core$List$cons, 67111 A2( 67112 $author$project$Ui$el, 67113 _List_fromArray( 67114 [ 67115 $author$project$Ui$Font$size($author$project$UI$Theme$font.aW), 67116 $author$project$Ui$Font$color(strong) 67117 ]), 67118 $author$project$Ui$text( 67119 $author$project$Domain$Member$shortId(deviceId))), 67120 isThis ? _List_fromArray( 67121 [ 67122 $author$project$Page$Group$MembersTab$thisDeviceTag(i18n) 67123 ]) : _List_Nil)), 67124 A2( 67125 $author$project$Ui$el, 67126 _List_fromArray( 67127 [ 67128 $author$project$Ui$Font$size($author$project$UI$Theme$font.bb), 67129 $author$project$Ui$Font$color(subtle) 67130 ]), 67131 $author$project$Ui$text( 67132 A2( 67133 $author$project$Translations$memberDeviceLinkedDate, 67134 $author$project$Domain$Date$toString( 67135 A2($author$project$Domain$Date$posixToDate, zone, linkedAt)), 67136 i18n))) 67137 ])), 67138 $author$project$Page$Group$MembersTab$copyButton(deviceId) 67139 ])); 67140 }); 67141var $feathericons$elm_feather$FeatherIcons$gitMerge = A2( 67142 $feathericons$elm_feather$FeatherIcons$makeBuilder, 67143 'git-merge', 67144 _List_fromArray( 67145 [ 67146 A2( 67147 $elm$svg$Svg$circle, 67148 _List_fromArray( 67149 [ 67150 $elm$svg$Svg$Attributes$cx('18'), 67151 $elm$svg$Svg$Attributes$cy('18'), 67152 $elm$svg$Svg$Attributes$r('3') 67153 ]), 67154 _List_Nil), 67155 A2( 67156 $elm$svg$Svg$circle, 67157 _List_fromArray( 67158 [ 67159 $elm$svg$Svg$Attributes$cx('6'), 67160 $elm$svg$Svg$Attributes$cy('6'), 67161 $elm$svg$Svg$Attributes$r('3') 67162 ]), 67163 _List_Nil), 67164 A2( 67165 $elm$svg$Svg$path, 67166 _List_fromArray( 67167 [ 67168 $elm$svg$Svg$Attributes$d('M6 21V9a9 9 0 0 0 9 9') 67169 ]), 67170 _List_Nil) 67171 ])); 67172var $author$project$Page$Group$MembersTab$infoRow = F5( 67173 function (subtle, icon, label, value, maybeUrl) { 67174 return A2( 67175 $author$project$Ui$row, 67176 _List_fromArray( 67177 [ 67178 $author$project$Ui$spacing($author$project$UI$Theme$spacing.qk), 67179 $author$project$Ui$contentCenterY 67180 ]), 67181 _List_fromArray( 67182 [ 67183 A2( 67184 $author$project$Ui$el, 67185 _List_fromArray( 67186 [ 67187 $author$project$Ui$Font$color(subtle), 67188 $author$project$Ui$width($author$project$Ui$shrink) 67189 ]), 67190 A2($author$project$UI$Components$featherIcon, 16, icon)), 67191 A2( 67192 $author$project$Ui$el, 67193 _List_fromArray( 67194 [ 67195 $author$project$Ui$Font$size($author$project$UI$Theme$font.qk), 67196 $author$project$Ui$Font$color(subtle), 67197 $author$project$Ui$width($author$project$Ui$shrink) 67198 ]), 67199 $author$project$Ui$text(label)), 67200 function () { 67201 if (!maybeUrl.$) { 67202 var url = maybeUrl.a; 67203 return A2( 67204 $author$project$Ui$el, 67205 _List_fromArray( 67206 [ 67207 $author$project$Ui$linkNewTab(url), 67208 $author$project$Ui$Font$size($author$project$UI$Theme$font.aW), 67209 $author$project$Ui$Font$color($author$project$UI$Theme$primary.qI), 67210 $author$project$Ui$Font$underline, 67211 $author$project$Ui$pointer, 67212 $author$project$Ui$width($author$project$Ui$shrink), 67213 $author$project$Ui$clipWithEllipsis 67214 ]), 67215 $author$project$Ui$text(value)); 67216 } else { 67217 return A2( 67218 $author$project$Ui$el, 67219 _List_fromArray( 67220 [ 67221 $author$project$Ui$Font$size($author$project$UI$Theme$font.aW), 67222 $author$project$Ui$clipWithEllipsis 67223 ]), 67224 $author$project$Ui$text(value)); 67225 } 67226 }(), 67227 $author$project$Page$Group$MembersTab$copyButton(value) 67228 ])); 67229 }); 67230var $author$project$Translations$memberDetailContactInfo = function (_v0) { 67231 var lang = _v0; 67232 if (!lang) { 67233 return 'Contact Info'; 67234 } else { 67235 return 'Coordonnées'; 67236 } 67237}; 67238var $author$project$Translations$memberDevicesLabel = function (_v0) { 67239 var lang = _v0; 67240 if (!lang) { 67241 return 'Devices'; 67242 } else { 67243 return 'Appareils'; 67244 } 67245}; 67246var $author$project$Translations$memberLinkSelfButton = function (_v0) { 67247 var lang = _v0; 67248 if (!lang) { 67249 return 'This is me â link my device'; 67250 } else { 67251 return 'C\'est moi â lier mon appareil'; 67252 } 67253}; 67254var $author$project$Translations$memberMergeButton = function (_v0) { 67255 var lang = _v0; 67256 if (!lang) { 67257 return 'Merge with another member'; 67258 } else { 67259 return 'Fusionner avec un autre membre'; 67260 } 67261}; 67262var $author$project$Translations$memberRetireButton = function (_v0) { 67263 var lang = _v0; 67264 if (!lang) { 67265 return 'Retire'; 67266 } else { 67267 return 'Retirer'; 67268 } 67269}; 67270var $author$project$Translations$memberUnretireButton = function (_v0) { 67271 var lang = _v0; 67272 if (!lang) { 67273 return 'Reactivate'; 67274 } else { 67275 return 'Réactiver'; 67276 } 67277}; 67278var $elm$core$String$filter = _String_filter;
67279var $author$project$Page$Group$MembersTab$stripSpaces = $elm$core$String$filter( 67280 function (c) { 67281 return c !== ' '; 67282 }); 67283var $author$project$Page$Group$MembersTab$memberDetail = F8( 67284 function (i18n, zone, identityHash, deviceLinks, toMsg, isCurrentUser, maybeUserRootId, member) { 67285 var textColor = isCurrentUser ? $author$project$UI$Theme$base.h$ : $author$project$UI$Theme$base.qI; 67286 var subtleColor = isCurrentUser ? $author$project$UI$Theme$base.en : $author$project$UI$Theme$base.aM; 67287 var sectionLbl = function (label) { 67288 return A2( 67289 $author$project$Ui$el, 67290 _List_fromArray( 67291 [ 67292 $author$project$Ui$Font$size($author$project$UI$Theme$font.bb), 67293 $author$project$Ui$Font$weight($author$project$UI$Theme$fontWeight.dL), 67294 $author$project$Ui$Font$letterSpacing($author$project$UI$Theme$letterSpacing.kY), 67295 $author$project$Ui$Font$color(subtleColor), 67296 $author$project$Ui$paddingBottom($author$project$UI$Theme$spacing.aW) 67297 ]), 67298 $author$project$Ui$text( 67299 $elm$core$String$toUpper(label))); 67300 }; 67301 var notesSection = function (notes) { 67302 return A2( 67303 $author$project$Ui$column, 67304 _List_Nil, 67305 _List_fromArray( 67306 [ 67307 sectionLbl( 67308 $author$project$Translations$memberMetadataNotes(i18n)), 67309 A2( 67310 $author$project$Ui$el, 67311 _List_fromArray( 67312 [ 67313 $author$project$Ui$Font$color(subtleColor) 67314 ]), 67315 $author$project$Ui$text(notes)) 67316 ])); 67317 }; 67318 var metadataSections = function () { 67319 var meta = member.ji; 67320 var paymentMethods = A2( 67321 $elm$core$List$map, 67322 function (h) { 67323 return A5($author$project$Page$Group$MembersTab$infoRow, subtleColor, h.gv, h.i6, h.q8, h.kS); 67324 }, 67325 A2($author$project$UI$PaymentMethods$handles, i18n, meta.jD)); 67326 var paymentMethodsSection = $elm$core$List$isEmpty(paymentMethods) ? $elm$core$Maybe$Nothing : $elm$core$Maybe$Just( 67327 A2( 67328 $author$project$Ui$column, 67329 _List_Nil, 67330 _List_fromArray( 67331 [ 67332 sectionLbl( 67333 $author$project$Translations$memberMetadataPayment(i18n)), 67334 A2( 67335 $author$project$Ui$column, 67336 _List_fromArray( 67337 [ 67338 $author$project$Ui$spacing($author$project$UI$Theme$spacing.aW) 67339 ]), 67340 paymentMethods) 67341 ]))); 67342 var infoRows = A2( 67343 $elm$core$List$filterMap, 67344 $elm$core$Basics$identity, 67345 _List_fromArray( 67346 [ 67347 A2( 67348 $elm$core$Maybe$map, 67349 function (v) { 67350 return A5( 67351 $author$project$Page$Group$MembersTab$infoRow, 67352 subtleColor, 67353 $feathericons$elm_feather$FeatherIcons$phone, 67354 $author$project$Translations$memberMetadataPhone(i18n), 67355 v, 67356 $elm$core$Maybe$Just( 67357 'tel:' + $author$project$Page$Group$MembersTab$stripSpaces(v))); 67358 }, 67359 meta.jF), 67360 A2( 67361 $elm$core$Maybe$map, 67362 function (v) { 67363 return A5( 67364 $author$project$Page$Group$MembersTab$infoRow, 67365 subtleColor, 67366 $feathericons$elm_feather$FeatherIcons$atSign, 67367 $author$project$Translations$memberMetadataEmail(i18n), 67368 v, 67369 $elm$core$Maybe$Just('mailto:' + v)); 67370 }, 67371 meta.is) 67372 ])); 67373 var contactSection = $elm$core$List$isEmpty(infoRows) ? $elm$core$Maybe$Nothing : $elm$core$Maybe$Just( 67374 A2( 67375 $author$project$Ui$column, 67376 _List_Nil, 67377 _List_fromArray( 67378 [ 67379 sectionLbl( 67380 $author$project$Translations$memberDetailContactInfo(i18n)), 67381 A2( 67382 $author$project$Ui$column, 67383 _List_fromArray( 67384 [ 67385 $author$project$Ui$spacing($author$project$UI$Theme$spacing.aW) 67386 ]), 67387 infoRows) 67388 ]))); 67389 var sections = A2( 67390 $elm$core$List$filterMap, 67391 $elm$core$Basics$identity, 67392 _List_fromArray( 67393 [ 67394 contactSection, 67395 A2($elm$core$Maybe$map, notesSection, meta.bu), 67396 paymentMethodsSection 67397 ])); 67398 return $elm$core$List$isEmpty(sections) ? $author$project$Ui$none : A2( 67399 $author$project$Ui$column, 67400 _List_fromArray( 67401 [ 67402 $author$project$Ui$spacing($author$project$UI$Theme$spacing.hE), 67403 $author$project$Ui$width($author$project$Ui$fill) 67404 ]), 67405 sections); 67406 }(); 67407 var isMember = !_Utils_eq(maybeUserRootId, $elm$core$Maybe$Nothing); 67408 var linkSelfButton = (isMember && ((!isCurrentUser) && (!member.nt))) ? A2( 67409 $author$project$UI$Components$btnOutline, 67410 _List_Nil, 67411 { 67412 gv: $elm$core$Maybe$Just( 67413 A2($author$project$UI$Components$featherIcon, 16, $feathericons$elm_feather$FeatherIcons$userCheck)), 67414 i6: $author$project$Translations$memberLinkSelfButton(i18n), 67415 e7: toMsg( 67416 $author$project$Page$Group$MembersTab$LinkSelf(member.aj)) 67417 }) : $author$project$Ui$none; 67418 var mergeButton = isMember ? A2( 67419 $author$project$UI$Components$btnOutline, 67420 _List_Nil, 67421 { 67422 gv: $elm$core$Maybe$Just( 67423 A2($author$project$UI$Components$featherIcon, 16, $feathericons$elm_feather$FeatherIcons$gitMerge)), 67424 i6: $author$project$Translations$memberMergeButton(i18n), 67425 e7: toMsg( 67426 $author$project$Page$Group$MembersTab$Merge(member.aj)) 67427 }) : $author$project$Ui$none; 67428 var retireButton = (!isMember) ? $author$project$Ui$none : (member.nt ? A2( 67429 $author$project$UI$Components$btnSuccess, 67430 _List_Nil, 67431 { 67432 gv: $feathericons$elm_feather$FeatherIcons$userPlus, 67433 i6: $author$project$Translations$memberUnretireButton(i18n), 67434 e7: toMsg( 67435 $author$project$Page$Group$MembersTab$Unretire(member.aj)) 67436 }) : ((!_Utils_eq( 67437 $elm$core$Maybe$Just(member.aj), 67438 maybeUserRootId)) ? A2( 67439 $author$project$UI$Components$btnDanger, 67440 _List_Nil, 67441 { 67442 gv: $feathericons$elm_feather$FeatherIcons$trash2, 67443 i6: $author$project$Translations$memberRetireButton(i18n), 67444 e7: toMsg( 67445 $author$project$Page$Group$MembersTab$Retire(member.aj)) 67446 }) : $author$project$Ui$none)); 67447 var devicesSection = function () { 67448 var rows = A2( 67449 $elm$core$List$map, 67450 function (_v2) { 67451 var deviceId = _v2.a; 67452 var link = _v2.b; 67453 return A7( 67454 $author$project$Page$Group$MembersTab$deviceRow, 67455 subtleColor, 67456 textColor, 67457 i18n, 67458 zone, 67459 deviceId, 67460 link.kD, 67461 _Utils_eq(deviceId, identityHash)); 67462 }, 67463 A2( 67464 $elm$core$List$sortBy, 67465 function (_v1) { 67466 var link = _v1.b; 67467 return $elm$time$Time$posixToMillis(link.kD); 67468 }, 67469 A2( 67470 $elm$core$List$filter, 67471 function (_v0) { 67472 var link = _v0.b; 67473 return _Utils_eq(link.aj, member.aj); 67474 }, 67475 $elm$core$Dict$toList(deviceLinks)))); 67476 return $elm$core$List$isEmpty(rows) ? $author$project$Ui$none : A2( 67477 $author$project$Ui$column, 67478 _List_Nil, 67479 _List_fromArray( 67480 [ 67481 sectionLbl( 67482 $author$project$Translations$memberDevicesLabel(i18n)), 67483 A2( 67484 $author$project$Ui$column, 67485 _List_fromArray( 67486 [ 67487 $author$project$Ui$spacing($author$project$UI$Theme$spacing.aW), 67488 $author$project$Ui$width($author$project$Ui$fill) 67489 ]), 67490 rows) 67491 ])); 67492 }(); 67493 return A2( 67494 $author$project$Ui$column, 67495 _List_fromArray( 67496 [ 67497 $author$project$Ui$spacing($author$project$UI$Theme$spacing.aW), 67498 $author$project$Ui$width($author$project$Ui$fill), 67499 $author$project$Ui$Font$color(textColor) 67500 ]), 67501 _List_fromArray( 67502 [ 67503 metadataSections, 67504 devicesSection, 67505 isMember ? A2( 67506 $author$project$UI$Components$btnOutline, 67507 _List_Nil, 67508 { 67509 gv: $elm$core$Maybe$Just( 67510 A2($author$project$UI$Components$featherIcon, 16, $feathericons$elm_feather$FeatherIcons$edit)), 67511 i6: $author$project$Translations$memberEditMetadataButton(i18n), 67512 e7: toMsg( 67513 $author$project$Page$Group$MembersTab$EditMetadata(member.aj)) 67514 }) : $author$project$Ui$none, 67515 linkSelfButton, 67516 mergeButton, 67517 retireButton 67518 ])); 67519 }); 67520var $author$project$Page$Group$MembersTab$metadataIcons = F2( 67521 function (isCurrentUser, meta) { 67522 var hasPaymentMethod = A2( 67523 $elm$core$List$any, 67524 function (method) { 67525 return !_Utils_eq( 67526 A2($author$project$Domain$PaymentMethod$get, method, meta.jD), 67527 $elm$core$Maybe$Nothing); 67528 }, 67529 A2( 67530 $elm$core$List$filter, 67531 $elm$core$Basics$neq(0), 67532 $author$project$Domain$PaymentMethod$all)); 67533 var icons = A2( 67534 $elm$core$List$filterMap, 67535 $elm$core$Basics$identity, 67536 _List_fromArray( 67537 [ 67538 A2( 67539 $elm$core$Maybe$map, 67540 function (_v0) { 67541 return A2($author$project$UI$Components$featherIcon, 14, $feathericons$elm_feather$FeatherIcons$phone); 67542 }, 67543 meta.jF), 67544 A2( 67545 $elm$core$Maybe$map, 67546 function (_v1) { 67547 return A2($author$project$UI$Components$featherIcon, 14, $feathericons$elm_feather$FeatherIcons$atSign); 67548 }, 67549 meta.is), 67550 A2( 67551 $elm$core$Maybe$map, 67552 function (_v2) { 67553 return A2($author$project$UI$Components$featherIcon, 14, $feathericons$elm_feather$FeatherIcons$creditCard); 67554 }, 67555 A2($author$project$Domain$PaymentMethod$get, 0, meta.jD)), 67556 hasPaymentMethod ? $elm$core$Maybe$Just( 67557 A2($author$project$UI$Components$featherIcon, 14, $feathericons$elm_feather$FeatherIcons$dollarSign)) : $elm$core$Maybe$Nothing 67558 ])); 67559 if ($elm$core$List$isEmpty(icons)) { 67560 return $author$project$Ui$none; 67561 } else { 67562 var iconColor = isCurrentUser ? $author$project$UI$Theme$base.en : $author$project$UI$Theme$base.aM; 67563 return A2( 67564 $author$project$Ui$row, 67565 _List_fromArray( 67566 [ 67567 $author$project$Ui$spacing($author$project$UI$Theme$spacing.bb), 67568 $author$project$Ui$alignRight, 67569 $author$project$Ui$Font$color(iconColor), 67570 $author$project$Ui$width($author$project$Ui$shrink) 67571 ]), 67572 icons); 67573 } 67574 }); 67575var $author$project$Translations$nameYouSuffix = F2( 67576 function (name, _v0) { 67577 var lang = _v0; 67578 if (!lang) { 67579 return name + ' (you)'; 67580 } else { 67581 return name + ' (toi)'; 67582 } 67583 }); 67584var $author$project$Page$Group$MembersTab$virtualTag = function (i18n) { 67585 return A2( 67586 $author$project$Ui$el, 67587 _List_fromArray( 67588 [ 67589 $author$project$Ui$Font$size($author$project$UI$Theme$font.bb), 67590 $author$project$Ui$Font$weight($author$project$UI$Theme$fontWeight.dL), 67591 A2($author$project$Ui$paddingXY, $author$project$UI$Theme$spacing.qk, $author$project$UI$Theme$spacing.bb),
67592 $author$project$Ui$rounded($author$project$UI$Theme$radius.qk), 67593 $author$project$Ui$background($author$project$UI$Theme$base.qR), 67594 $author$project$Ui$Font$color($author$project$UI$Theme$base.aM), 67595 $author$project$Ui$width($author$project$Ui$shrink) 67596 ]), 67597 $author$project$Ui$text( 67598 $author$project$Translations$memberVirtualLabel(i18n))); 67599}; 67600var $author$project$Page$Group$MembersTab$memberCard = F8( 67601 function (i18n, zone, identityHash, deviceLinks, toMsg, expandedMembers, maybeUserRootId, member) { 67602 var isVirtual = member.nL === 1; 67603 var isExpanded = A2($elm$core$Set$member, member.aj, expandedMembers); 67604 var isCurrentUser = _Utils_eq( 67605 $elm$core$Maybe$Just(member.aj), 67606 maybeUserRootId); 67607 var nameAttrs = isCurrentUser ? _List_fromArray( 67608 [ 67609 $author$project$Ui$Font$color($author$project$UI$Theme$base.h$) 67610 ]) : _List_Nil; 67611 var nameLabel = isCurrentUser ? A2($author$project$Translations$nameYouSuffix, member.bW, i18n) : member.bW; 67612 var initials = A2( 67613 $elm$core$String$left, 67614 2, 67615 $elm$core$String$toUpper(member.bW)); 67616 var cardAttrs = isCurrentUser ? _List_fromArray( 67617 [ 67618 $author$project$Ui$background($author$project$UI$Theme$base.qI), 67619 $author$project$Ui$borderColor($author$project$UI$Theme$base.qI) 67620 ]) : _List_Nil; 67621 var avatarEl = A2( 67622 $author$project$UI$Components$avatar, 67623 isCurrentUser ? 2 : 0, 67624 initials); 67625 return A2( 67626 $author$project$UI$Components$card, 67627 _Utils_ap( 67628 _List_fromArray( 67629 [ 67630 A2($author$project$Ui$paddingXY, $author$project$UI$Theme$spacing.i8, $author$project$UI$Theme$spacing.aW), 67631 $author$project$Ui$spacing($author$project$UI$Theme$spacing.aW) 67632 ]), 67633 cardAttrs), 67634 _List_fromArray( 67635 [ 67636 A2( 67637 $author$project$Ui$row, 67638 _List_fromArray( 67639 [ 67640 $author$project$Ui$Input$button( 67641 toMsg( 67642 $author$project$Page$Group$MembersTab$ToggleMember(member.aj))), 67643 $author$project$Ui$spacing($author$project$UI$Theme$spacing.aW), 67644 $author$project$Ui$contentCenterY, 67645 $author$project$Ui$width($author$project$Ui$fill), 67646 $author$project$Ui$pointer 67647 ]), 67648 _List_fromArray( 67649 [ 67650 avatarEl, 67651 A2( 67652 $author$project$Ui$column, 67653 _List_fromArray( 67654 [ 67655 $author$project$Ui$spacing($author$project$UI$Theme$spacing.bb) 67656 ]), 67657 _List_fromArray( 67658 [ 67659 A2( 67660 $author$project$Ui$row, 67661 _List_fromArray( 67662 [ 67663 $author$project$Ui$spacing($author$project$UI$Theme$spacing.bb), 67664 $author$project$Ui$contentCenterY, 67665 $author$project$Ui$width($author$project$Ui$shrink) 67666 ]), 67667 _List_fromArray( 67668 [ 67669 A2( 67670 $author$project$Ui$el, 67671 _Utils_ap( 67672 _List_fromArray( 67673 [ 67674 $author$project$Ui$Font$weight($author$project$UI$Theme$fontWeight.dL), 67675 $author$project$Ui$Font$size($author$project$UI$Theme$font.aW) 67676 ]), 67677 nameAttrs), 67678 $author$project$Ui$text(nameLabel)), 67679 isVirtual ? $author$project$Page$Group$MembersTab$virtualTag(i18n) : $author$project$Ui$none 67680 ])), 67681 A2( 67682 $author$project$Ui$el, 67683 _List_fromArray( 67684 [ 67685 $author$project$Ui$Font$size($author$project$UI$Theme$font.bb), 67686 $author$project$Ui$Font$color( 67687 isCurrentUser ? $author$project$UI$Theme$base.en : $author$project$UI$Theme$base.aM) 67688 ]), 67689 $author$project$Ui$text( 67690 A3($author$project$Page$Group$MembersTab$formatJoinDate, i18n, zone, member.nx))) 67691 ])), 67692 A2($author$project$Page$Group$MembersTab$metadataIcons, isCurrentUser, member.ji) 67693 ])), 67694 isExpanded ? A8($author$project$Page$Group$MembersTab$memberDetail, i18n, zone, identityHash, deviceLinks, toMsg, isCurrentUser, maybeUserRootId, member) : $author$project$Ui$none 67695 ])); 67696 }); 67697var $author$project$Translations$membersDeparted = function (_v0) { 67698 var lang = _v0; 67699 if (!lang) { 67700 return 'Departed'; 67701 } else { 67702 return 'Anciens membres'; 67703 } 67704}; 67705var $feathericons$elm_feather$FeatherIcons$bell = A2( 67706 $feathericons$elm_feather$FeatherIcons$makeBuilder, 67707 'bell', 67708 _List_fromArray( 67709 [ 67710 A2( 67711 $elm$svg$Svg$path, 67712 _List_fromArray( 67713 [ 67714 $elm$svg$Svg$Attributes$d('M18 8A6 6 0 0 0 6 8c0 7-3 9-3 9h18s-3-2-3-9') 67715 ]), 67716 _List_Nil), 67717 A2( 67718 $elm$svg$Svg$path, 67719 _List_fromArray( 67720 [ 67721 $elm$svg$Svg$Attributes$d('M13.73 21a2 2 0 0 1-3.46 0') 67722 ]), 67723 _List_Nil) 67724 ])); 67725var $author$project$Page$Group$MembersTab$notifIcon = A2( 67726 $author$project$Ui$el, 67727 _List_fromArray( 67728 [ 67729 $author$project$Ui$width( 67730 $author$project$Ui$px($author$project$UI$Theme$sizing.i8)), 67731 $author$project$Ui$height( 67732 $author$project$Ui$px($author$project$UI$Theme$sizing.i8)),
67733 $author$project$Ui$rounded($author$project$UI$Theme$radius.aW), 67734 $author$project$Ui$background($author$project$UI$Theme$primary.qR), 67735 $author$project$Ui$contentCenterX, 67736 $author$project$Ui$contentCenterY, 67737 $author$project$Ui$Font$size($author$project$UI$Theme$font.i8) 67738 ]), 67739 A2($author$project$UI$Components$featherIcon, 18, $feathericons$elm_feather$FeatherIcons$bell)); 67740var $author$project$Translations$notificationsDisabled = function (_v0) { 67741 var lang = _v0; 67742 if (!lang) { 67743 return 'Disabled'; 67744 } else { 67745 return 'Désactivées'; 67746 } 67747}; 67748var $author$project$Translations$notificationsEnabled = function (_v0) { 67749 var lang = _v0; 67750 if (!lang) { 67751 return 'Enabled'; 67752 } else { 67753 return 'Activées'; 67754 } 67755}; 67756var $author$project$Translations$notificationsLabel = function (_v0) { 67757 var lang = _v0; 67758 if (!lang) { 67759 return 'Notifications'; 67760 } else { 67761 return 'Notifications'; 67762 } 67763}; 67764var $author$project$Translations$notificationsNotAvailable = function (_v0) { 67765 var lang = _v0; 67766 if (!lang) { 67767 return 'Not available'; 67768 } else { 67769 return 'Non disponible'; 67770 } 67771}; 67772var $author$project$Page$Group$MembersTab$notificationRow = F2( 67773 function (i18n, config) { 67774 var _v0 = (!config.g6) ? _Utils_Tuple2( 67775 $author$project$Translations$notificationsNotAvailable(i18n), 67776 $author$project$Ui$none) : _Utils_Tuple2( 67777 config.gC ? $author$project$Translations$notificationsEnabled(i18n) : $author$project$Translations$notificationsDisabled(i18n), 67778 $author$project$UI$Components$toggle( 67779 {nr: config.gC, e7: config.o7})); 67780 var statusText = _v0.a; 67781 var toggleEl = _v0.b; 67782 return A2( 67783 $author$project$Ui$row, 67784 _List_fromArray( 67785 [ 67786 $author$project$Ui$width($author$project$Ui$fill), 67787 $author$project$Ui$contentCenterY 67788 ]), 67789 _List_fromArray( 67790 [ 67791 A2( 67792 $author$project$Ui$row, 67793 _List_fromArray( 67794 [ 67795 $author$project$Ui$spacing($author$project$UI$Theme$spacing.aW), 67796 $author$project$Ui$contentCenterY, 67797 $author$project$Ui$width($author$project$Ui$shrink) 67798 ]), 67799 _List_fromArray( 67800 [ 67801 $author$project$Page$Group$MembersTab$notifIcon, 67802 A2( 67803 $author$project$Ui$column, 67804 _List_fromArray( 67805 [ 67806 $author$project$Ui$spacing($author$project$UI$Theme$spacing.bb) 67807 ]), 67808 _List_fromArray( 67809 [ 67810 A2( 67811 $author$project$Ui$el, 67812 _List_fromArray( 67813 [ 67814 $author$project$Ui$Font$size($author$project$UI$Theme$font.aW), 67815 $author$project$Ui$Font$weight($author$project$UI$Theme$fontWeight.nI) 67816 ]), 67817 $author$project$Ui$text( 67818 $author$project$Translations$notificationsLabel(i18n))), 67819 A2( 67820 $author$project$Ui$el, 67821 _List_fromArray( 67822 [ 67823 $author$project$Ui$Font$size($author$project$UI$Theme$font.bb), 67824 $author$project$Ui$Font$color($author$project$UI$Theme$base.aM) 67825 ]), 67826 $author$project$Ui$text(statusText)) 67827 ])) 67828 ])), 67829 toggleEl 67830 ])); 67831 }); 67832var $author$project$Page$Group$MembersTab$view = F6( 67833 function (i18n, config, toMsg, model, maybeUserRootId, state) { 67834 var isMember = !_Utils_eq(maybeUserRootId, $elm$core$Maybe$Nothing); 67835 var allMembers = $elm$core$Dict$values(state.r); 67836 var retired = A2( 67837 $elm$core$List$sortBy, 67838 function (m) { 67839 return $elm$core$String$toLower(m.bW); 67840 }, 67841 A2( 67842 $elm$core$List$filter, 67843 function ($) { 67844 return $.nt; 67845 }, 67846 allMembers)); 67847 var active = A2( 67848 $elm$core$List$sortBy, 67849 function (m) { 67850 return _Utils_Tuple2( 67851 $author$project$Page$Group$MembersTab$boolToInt( 67852 !_Utils_eq( 67853 $elm$core$Maybe$Just(m.aj), 67854 maybeUserRootId)), 67855 $elm$core$String$toLower(m.bW)); 67856 }, 67857 A2( 67858 $elm$core$List$filter, 67859 A2( 67860 $elm$core$Basics$composeL, 67861 $elm$core$Basics$not, 67862 function ($) { 67863 return $.nt; 67864 }), 67865 allMembers)); 67866 return A2( 67867 $author$project$Ui$column, 67868 _List_fromArray( 67869 [ 67870 $author$project$Ui$spacing($author$project$UI$Theme$spacing.hE), 67871 $author$project$Ui$width($author$project$Ui$fill) 67872 ]), 67873 _List_fromArray( 67874 [ 67875 (config.jQ && (config.nu && (!config.gA))) ? A2($author$project$Page$Group$MembersTab$notificationRow, i18n, config) : $author$project$Ui$none, 67876 A4($author$project$Page$Group$MembersTab$groupInfoSection, i18n, config.mq, config.oy, state), 67877 config.nu ? A5($author$project$Page$Group$MembersTab$inviteSection, i18n, toMsg, model, config, state.iO.bW) : $author$project$Ui$none, 67878 A2( 67879 $author$project$Ui$column, 67880 _List_Nil, 67881 _List_fromArray( 67882 [ 67883 $author$project$UI$Components$sectionLabel( 67884 $author$project$Translations$membersTabTitle(i18n) + (' (' + ($elm$core$String$fromInt( 67885 $elm$core$List$length(active)) + ')'))), 67886 A2( 67887 $author$project$Ui$column, 67888 _List_fromArray( 67889 [ 67890 $author$project$Ui$spacing($author$project$UI$Theme$spacing.bb), 67891 $author$project$Ui$width($author$project$Ui$fill) 67892 ]), 67893 A2( 67894 $elm$core$List$map, 67895 A7($author$project$Page$Group$MembersTab$memberCard, i18n, config.al, config.iY, state.aP, toMsg, model.bk, maybeUserRootId), 67896 active)) 67897 ])), 67898 (!$elm$core$List$isEmpty(retired)) ? A2( 67899 $author$project$Ui$column, 67900 _List_fromArray( 67901 [ 67902 $author$project$Ui$spacing($author$project$UI$Theme$spacing.bb), 67903 $author$project$Ui$width($author$project$Ui$fill) 67904 ]), 67905 _List_fromArray( 67906 [
67907 $author$project$UI$Components$expandTrigger( 67908 { 67909 ns: model.cU, 67910 i6: $author$project$Translations$membersDeparted(i18n) + (' (' + ($elm$core$String$fromInt( 67911 $elm$core$List$length(retired)) + ')')), 67912 e7: toMsg($author$project$Page$Group$MembersTab$ToggleRetired) 67913 }), 67914 model.cU ? A2( 67915 $author$project$Ui$column, 67916 _List_fromArray( 67917 [ 67918 $author$project$Ui$spacing($author$project$UI$Theme$spacing.bb), 67919 $author$project$Ui$width($author$project$Ui$fill), 67920 $author$project$Ui$opacity(0.6) 67921 ]), 67922 A2( 67923 $elm$core$List$map, 67924 A7($author$project$Page$Group$MembersTab$memberCard, i18n, config.al, config.iY, state.aP, toMsg, model.bk, maybeUserRootId), 67925 retired)) : $author$project$Ui$none 67926 ])) : $author$project$Ui$none, 67927 isMember ? A2( 67928 $author$project$UI$Components$btnPrimary, 67929 A2($author$project$UI$Components$spaLinkAttrs, config.lc, config.om), 67930 { 67931 i6: $author$project$Translations$memberAddButton(i18n), 67932 e7: config.om 67933 }) : $author$project$Ui$none 67934 ])); 67935 }); 67936var $author$project$Page$Group$tabContent = F4( 67937 function (config, maybeUserRootId, loaded, model) { 67938 var _v0 = model.an; 67939 switch (_v0) { 67940 case 0: 67941 return A5( 67942 $author$project$Page$Group$BalanceTab$view, 67943 config.aJ, 67944 { 67945 n5: $author$project$Route$toPath( 67946 A2($author$project$Route$GroupRoute, loaded.bA.m9, $author$project$Route$NewEntry)), 67947 oS: function (payData) { 67948 return config.d3( 67949 $author$project$Page$Group$RequestTransfer(payData)); 67950 }, 67951 o1: function (prefData) { 67952 return config.d3( 67953 $author$project$Page$Group$SaveSettlementPreferences(prefData)); 67954 }, 67955 d3: A2($elm$core$Basics$composeL, config.d3, $author$project$Page$Group$BalanceTabMsg) 67956 }, 67957 maybeUserRootId, 67958 model.c8, 67959 loaded.a6); 67960 case 1: 67961 return A6( 67962 $author$project$Page$Group$EntriesTab$view, 67963 config.aJ, 67964 { 67965 iw: function (entryId) { 67966 return _Utils_ap( 67967 config.aZ, 67968 $author$project$Route$toPath( 67969 A2( 67970 $author$project$Route$GroupRoute, 67971 loaded.bA.m9, 67972 $author$project$Route$HighlightEntry(entryId)))); 67973 }, 67974 mK: $author$project$Page$Group$entryFreshness(loaded), 67975 n$: $author$project$Route$toPath( 67976 A2($author$project$Route$GroupRoute, loaded.bA.m9, $author$project$Route$NewEntry)), 67977 oR: config.d3( 67978 $author$project$Page$Group$RequestNavigation($author$project$Route$NewEntry)), 67979 pq: $author$project$Page$Group$pendingEntryIds(loaded), 67980 d3: A2($elm$core$Basics$composeL, config.d3, $author$project$Page$Group$EntriesTabMsg) 67981 }, 67982 maybeUserRootId, 67983 config.qV, 67984 model.cp, 67985 loaded.a6); 67986 case 2: 67987 return A6( 67988 $author$project$Page$Group$MembersTab$view, 67989 config.aJ, 67990 { 67991 lc: $author$project$Route$toPath( 67992 A2($author$project$Route$GroupRoute, loaded.bA.m9, $author$project$Route$AddVirtualMember)), 67993 mq: $author$project$Route$toPath( 67994 A2($author$project$Route$GroupRoute, loaded.bA.m9, $author$project$Route$EditGroupMetadata)), 67995 iY: model.iY, 67996 np: _Utils_ap( 67997 config.aZ, 67998 $author$project$Route$toPath( 67999 A2( 68000 $author$project$Route$GroupRoute, 68001 loaded.bA.m9, 68002 $author$project$Route$Join( 68003 { 68004 i4: $author$project$WebCrypto$Symmetric$exportKey(loaded.gs), 68005 ky: $author$project$Domain$Compaction$attestationTail( 68006 A2( 68007 $elm$core$List$filter, 68008 function (e) { 68009 return !A2($elm$core$Set$member, e.m9, loaded.bC); 68010 }, 68011 loaded.iC)) 68012 })))), 68013 gA: loaded.bA.gA, 68014 gC: loaded.bA.gC, 68015 nu: !_Utils_eq(loaded.cZ, $elm$core$Maybe$Nothing), 68016 om: config.d3( 68017 $author$project$Page$Group$RequestNavigation($author$project$Route$AddVirtualMember)), 68018 oy: config.d3( 68019 $author$project$Page$Group$RequestNavigation($author$project$Route$EditGroupMetadata)), 68020 o7: config.d3($author$project$Page$Group$ToggleNotification), 68021 g6: config.g6, 68022 jQ: config.jQ, 68023 al: config.al 68024 }, 68025 A2($elm$core$Basics$composeL, config.d3, $author$project$Page$Group$MembersTabMsg), 68026 model.du, 68027 maybeUserRootId, 68028 loaded.a6); 68029 default: 68030 var allMembers = A2( 68031 $elm$core$List$sortBy, 68032 $elm$core$Tuple$second, 68033 A2( 68034 $elm$core$List$map, 68035 function (m) { 68036 return _Utils_Tuple2(m.aj, m.bW); 68037 }, 68038 $author$project$Domain$GroupState$activeMembers(loaded.a6))); 68039 return A4( 68040 $author$project$Page$Group$ActivityTab$view, 68041 config.aJ, 68042 { 68043 ll: allMembers, 68044 f7: maybeUserRootId, 68045 iw: function (entryId) { 68046 return $author$project$Route$toPath( 68047 A2( 68048 $author$project$Route$GroupRoute, 68049 loaded.bA.m9, 68050 $author$project$Route$HighlightEntry(entryId))); 68051 }, 68052 mS: loaded.bA.il, 68053 oQ: function (entryId) { 68054 return config.d3( 68055 $author$project$Page$Group$RequestNavigation( 68056 $author$project$Route$HighlightEntry(entryId))); 68057 }, 68058 pr: loaded.bC, 68059 bz: $author$project$Domain$GroupState$resolveMemberName(loaded.a6), 68060 al: config.al, 68061 d3: A2($elm$core$Basics$composeL, config.d3, $author$project$Page$Group$ActivityTabMsg), 68062 kP: loaded.kP 68063 }, 68064 model.c4, 68065 loaded.a6.eb); 68066 } 68067 }); 68068var $author$project$Translations$tabEntries = function (_v0) { 68069 var lang = _v0; 68070 if (!lang) { 68071 return 'Expenses'; 68072 } else { 68073 return 'Dépenses'; 68074 } 68075}; 68076var $author$project$Translations$tabMembers = function (_v0) { 68077 var lang = _v0; 68078 if (!lang) { 68079 return 'Group'; 68080 } else { 68081 return 'Groupe'; 68082 } 68083}; 68084var $author$project$UI$Shell$tabbedShell = function (config) { 68085 return A2( 68086 $author$project$Ui$column, 68087 _List_fromArray( 68088 [ 68089 $author$project$Ui$height($author$project$Ui$fill), 68090 $author$project$Ui$paddingBottom($author$project$UI$Theme$sizing.hF) 68091 ]), 68092 _List_fromArray( 68093 [ 68094 $author$project$UI$Shell$pageHeader( 68095 {a9: config.a9, cY: config.cY, ba: config.ba}), 68096 A2( 68097 $author$project$Ui$el, 68098 _List_fromArray( 68099 [ 68100 $author$project$Ui$width($author$project$Ui$fill), 68101 $author$project$Ui$height($author$project$Ui$fill), 68102 $author$project$Ui$paddingBottom($author$project$UI$Theme$sizing.rn) 68103 ]), 68104 config.ew) 68105 ])); 68106}; 68107var $author$project$Translations$groupTamperMigrate = function (_v0) { 68108 var lang = _v0; 68109 if (!lang) { 68110 return 'Migrate'; 68111 } else { 68112 return 'Migrer'; 68113 } 68114}; 68115var $author$project$Translations$groupTamperWarning = function (_v0) { 68116 var lang = _v0; 68117 if (!lang) { 68118 return 'This group\'s data on the server shows signs of tampering. Your local history is safe. If you didn\'t expect this, consider migrating to a new group.'; 68119 } else { 68120 return 'Les données de ce groupe sur le serveur présentent des signes d\'altération. Ton historique local est intact. Si tu ne t\'y attendais pas, envisage de migrer vers un nouveau groupe.'; 68121 } 68122}; 68123var $author$project$UI$Components$tamperBanner = F2( 68124 function (i18n, _v0) { 68125 var onMigrate = _v0.oN; 68126 var onDismiss = _v0.ot; 68127 return A2( 68128 $author$project$UI$Components$pwaBanner, 68129 $author$project$Translations$groupTamperWarning(i18n), 68130 { 68131 k5: $elm$core$Maybe$Just( 68132 _Utils_Tuple2( 68133 $author$project$Translations$groupTamperMigrate(i18n), 68134 _List_fromArray( 68135 [ 68136 $author$project$Ui$Input$button(onMigrate) 68137 ]))), 68138 fW: $author$project$UI$Theme$danger.qR, 68139 Y: $elm$core$Maybe$Just(onDismiss), 68140 hv: $author$project$UI$Theme$danger.qI 68141 }); 68142 }); 68143var $author$project$Translations$groupUnknownEventsBanner = function (_v0) { 68144 var lang = _v0; 68145 if (!lang) { 68146 return 'Some changes can\'t be read by this app version, so balances may be incomplete. Update the app to see them.'; 68147 } else { 68148 return 'Certaines modifications ne peuvent pas être lues par cette version de l\'application, les soldes peuvent donc être incomplets. Mets à jour l\'application pour les voir.'; 68149 } 68150}; 68151var $author$project$UI$Components$unknownEventsBanner = function (i18n) { 68152 return A2( 68153 $author$project$UI$Components$pwaBanner, 68154 $author$project$Translations$groupUnknownEventsBanner(i18n), 68155 {k5: $elm$core$Maybe$Nothing, fW: $author$project$UI$Theme$warning.qR, Y: $elm$core$Maybe$Nothing, hv: $author$project$UI$Theme$warning.qI}); 68156}; 68157var $author$project$Page$Group$viewTabs = F4( 68158 function (config, maybeUserRootId, loaded, model) { 68159 var tabHref = function (tab) { 68160 return $author$project$Route$toPath( 68161 A2( 68162 $author$project$Route$GroupRoute, 68163 loaded.bA.m9, 68164 $author$project$Route$Tab(tab))); 68165 }; 68166 var fab = function () { 68167 if (!maybeUserRootId.$) { 68168 return $author$project$UI$Components$fab( 68169 { 68170 m7: $author$project$Route$toPath( 68171 A2($author$project$Route$GroupRoute, loaded.bA.m9, $author$project$Route$NewEntry)), 68172 i6: $author$project$Translations$groupAddEntryLabel(config.aJ), 68173 e7: config.d3( 68174 $author$project$Page$Group$RequestNavigation($author$project$Route$NewEntry)) 68175 }); 68176 } else { 68177 return $author$project$Ui$none; 68178 } 68179 }(); 68180 return { 68181 ew: $author$project$UI$Shell$tabbedShell( 68182 { 68183 ew: function () { 68184 var banners = $elm$core$List$concat( 68185 _List_fromArray( 68186 [ 68187 ($author$project$Domain$TamperSignals$bannerWorthy(loaded.c_) && (!loaded.bA.gA)) ? _List_fromArray( 68188 [ 68189 A2( 68190 $author$project$UI$Components$tamperBanner, 68191 config.aJ, 68192 { 68193 ot: config.d3($author$project$Page$Group$DismissTamperSignals), 68194 oN: config.d3( 68195 $author$project$Page$Group$RequestNavigation($author$project$Route$Migrate)) 68196 }) 68197 ]) : _List_Nil, 68198 ((!$elm$core$List$isEmpty( 68199 A2($author$project$Page$Group$activeFindings, model.iY, loaded))) && (!loaded.bA.gA)) ? _List_fromArray( 68200 [ 68201 A2( 68202 $author$project$UI$Components$suspicionBanner, 68203 config.aJ, 68204 { 68205 o$: config.d3( 68206 $author$project$Page$Group$RequestNavigation($author$project$Route$Migrate)) 68207 }) 68208 ]) : _List_Nil, 68209 function () { 68210 if (loaded.bA.gA) { 68211 return _List_fromArray( 68212 [ 68213 A2( 68214 $author$project$UI$Components$archivedBanner, 68215 config.aJ, 68216 { 68217 o8: config.d3($author$project$Page$Group$UnarchiveGroup) 68218 }) 68219 ]); 68220 } else { 68221 if (_Utils_eq(maybeUserRootId, $elm$core$Maybe$Nothing)) { 68222 var _v0 = A2($author$project$Page$Group$recoveryRootId, model, loaded); 68223 if (!_v0.$) { 68224 var root = _v0.a; 68225 return _List_fromArray( 68226 [ 68227 A2( 68228 $author$project$UI$Components$recoveryBanner, 68229 config.aJ, 68230 { 68231 oW: config.d3( 68232 $author$project$Page$Group$RelinkDevice(root)) 68233 }) 68234 ]); 68235 } else { 68236 return _List_fromArray( 68237 [ 68238 A2( 68239 $author$project$UI$Components$readOnlyBanner, 68240 config.aJ, 68241 { 68242 oV: config.d3( 68243 $author$project$Page$Group$RequestNavigation($author$project$Route$Rejoin)) 68244 }) 68245 ]); 68246 } 68247 } else { 68248 return _List_Nil; 68249 } 68250 } 68251 }(), 68252 A2( 68253 $elm$core$List$any, 68254 function (e) { 68255 return _Utils_eq(e.jC, $author$project$Domain$Event$Unknown); 68256 }, 68257 loaded.iC) ? _List_fromArray( 68258 [ 68259 $author$project$UI$Components$unknownEventsBanner(config.aJ) 68260 ]) : _List_Nil 68261 ])); 68262 return $elm$core$List$isEmpty(banners) ? A4($author$project$Page$Group$tabContent, config, maybeUserRootId, loaded, model) : A2( 68263 $author$project$Ui$column, 68264 _List_fromArray( 68265 [ 68266 $author$project$Ui$spacing($author$project$UI$Theme$spacing.aW), 68267 $author$project$Ui$width($author$project$Ui$fill) 68268 ]), 68269 _Utils_ap( 68270 banners, 68271 _List_fromArray( 68272 [ 68273 A4($author$project$Page$Group$tabContent, config, maybeUserRootId, loaded, model) 68274 ]))); 68275 }(), 68276 a9: config.oP, 68277 cY: '', 68278 ba: loaded.a6.iO.bW 68279 }), 68280 g$: $elm$core$Maybe$Just( 68281 A2( 68282 $author$project$Ui$column, 68283 _List_fromArray( 68284 [ 68285 $author$project$Ui$spacing($author$project$UI$Theme$spacing.i8) 68286 ]), 68287 _List_fromArray( 68288 [ 68289 fab, 68290 A4( 68291 $author$project$UI$Shell$tabBar, 68292 { 68293 k7: $author$project$Translations$tabActivity(config.aJ), 68294 lx: $author$project$Translations$tabBalance(config.aJ), 68295 E: $author$project$Translations$tabEntries(config.aJ), 68296 r: $author$project$Translations$tabMembers(config.aJ) 68297 }, 68298 tabHref, 68299 model.an, 68300 function (tab) { 68301 return config.d3( 68302 $author$project$Page$Group$RequestNavigation( 68303 $author$project$Route$Tab(tab))); 68304 }) 68305 ]))) 68306 }; 68307 }); 68308var $author$project$Page$Group$viewGroupPage = F4( 68309 function (config, groupView, loaded, model) { 68310 var noOverlay = function (content) { 68311 return {ew: content, g$: $elm$core$Maybe$Nothing}; 68312 }; 68313 var maybeUserRootId = loaded.bA.gA ? $elm$core$Maybe$Nothing : A2($author$project$Page$Group$currentUserRootId, model, loaded); 68314 var _v0 = _Utils_Tuple2(groupView, maybeUserRootId); 68315 _v0$12: 68316 while (true) { 68317 switch (_v0.a.$) { 68318 case 1: 68319 var tab = _v0.a.a; 68320 return A4( 68321 $author$project$Page$Group$viewTabs, 68322 config, 68323 maybeUserRootId, 68324 loaded, 68325 _Utils_update( 68326 model, 68327 {an: tab})); 68328 case 2: 68329 return A4( 68330 $author$project$Page$Group$viewTabs, 68331 config, 68332 maybeUserRootId, 68333 loaded, 68334 _Utils_update( 68335 model, 68336 {an: 1})); 68337 case 0: 68338 return noOverlay($author$project$Ui$none); 68339 case 3: 68340 if (!_v0.b.$) { 68341 var _v1 = _v0.a; 68342 return noOverlay( 68343 A3( 68344 $author$project$Page$Group$pageShell, 68345 config, 68346 A2($author$project$Page$Group$NewEntry$pageTitle, config.aJ, model.ac), 68347 A4( 68348 $author$project$Page$Group$NewEntry$view, 68349 config.aJ, 68350 $author$project$Domain$GroupState$activeMembers(loaded.a6), 68351 A2($elm$core$Basics$composeL, config.d3, $author$project$Page$Group$NewEntryMsg), 68352 model.ac))); 68353 } else { 68354 break _v0$12; 68355 } 68356 case 4: 68357 if (!_v0.b.$) { 68358 var entryId = _v0.a.a; 68359 return A2($elm$core$Dict$member, entryId, loaded.a6.E) ? noOverlay( 68360 A3( 68361 $author$project$Page$Group$pageShell, 68362 config, 68363 A2($author$project$Page$Group$NewEntry$pageTitle, config.aJ, model.ac), 68364 A4( 68365 $author$project$Page$Group$NewEntry$view, 68366 config.aJ, 68367 $author$project$Domain$GroupState$activeMembers(loaded.a6), 68368 A2($elm$core$Basics$composeL, config.d3, $author$project$Page$Group$NewEntryMsg), 68369 model.ac))) : noOverlay( 68370 A2( 68371 $author$project$Page$Group$notFoundShell, 68372 config, 68373 $author$project$Translations$entryNotFound(config.aJ))); 68374 } else { 68375 break _v0$12; 68376 } 68377 case 5: 68378 if (!_v0.b.$) { 68379 var _v2 = _v0.a; 68380 return noOverlay( 68381 A3( 68382 $author$project$Page$Group$pageShell, 68383 config, 68384 $author$project$Translations$memberAddTitle(config.aJ), 68385 A4( 68386 $author$project$Page$Group$AddMember$view, 68387 config.aJ, 68388 A2( 68389 $elm$core$List$map, 68390 function ($) { 68391 return $.bW; 68392 }, 68393 $author$project$Domain$GroupState$activeMembers(loaded.a6)), 68394 A2($elm$core$Basics$composeL, config.d3, $author$project$Page$Group$AddMemberMsg), 68395 model.cb))); 68396 } else { 68397 break _v0$12; 68398 } 68399 case 6: 68400 if (!_v0.b.$) { 68401 var memberId = _v0.a.a; 68402 return A2($elm$core$Dict$member, memberId, loaded.a6.r) ? noOverlay( 68403 A3( 68404 $author$project$Page$Group$pageShell, 68405 config, 68406 $author$project$Translations$memberEditMetadataButton(config.aJ), 68407 A2( 68408 $author$project$Page$Group$EditMemberMetadata$view, 68409 { 68410 iD: A2( 68411 $elm$core$Lis
68411t$map, 68412 function ($) { 68413 return $.bW; 68414 }, 68415 $author$project$Domain$GroupState$activeMembers(loaded.a6)), 68416 aJ: config.aJ, 68417 dl: _Utils_eq( 68418 A2($author$project$Page$Group$currentUserRootId, model, loaded), 68419 $elm$core$Maybe$Just(memberId)), 68420 kc: config.fr, 68421 d3: A2($elm$core$Basics$composeL, config.d3, $author$project$Page$Group$EditMemberMetadataMsg) 68422 }, 68423 model.cn))) : noOverlay( 68424 A2( 68425 $author$project$Page$Group$notFoundShell, 68426 config, 68427 $author$project$Translations$memberNotFound(config.aJ))); 68428 } else { 68429 break _v0$12; 68430 } 68431 case 7: 68432 if (!_v0.b.$) { 68433 var _v3 = _v0.a; 68434 return noOverlay( 68435 A3( 68436 $author$project$Page$Group$pageShell, 68437 config, 68438 $author$project$Translations$mergePageTitle(config.aJ), 68439 A4( 68440 $author$project$Page$Group$MergeMember$view, 68441 config.aJ, 68442 A2($elm$core$Basics$composeL, config.d3, $author$project$Page$Group$MergeMemberMsg), 68443 loaded.a6, 68444 model.cD))); 68445 } else { 68446 break _v0$12; 68447 } 68448 case 8: 68449 var _v4 = _v0.a; 68450 var settingsForm = A4( 68451 $author$project$Page$Group$EditGroupMetadata$view, 68452 config.aJ, 68453 { 68454 gA: loaded.bA.gA, 68455 nq: !_Utils_eq(maybeUserRootId, $elm$core$Maybe$Nothing) 68456 }, 68457 A2($elm$core$Basics$composeL, config.d3, $author$project$Page$Group$EditGroupMetadataMsg), 68458 model.cm); 68459 var migrateButton = ((!_Utils_eq( 68460 A2($author$project$Page$Group$recoveryRootId, model, loaded), 68461 $elm$core$Maybe$Nothing)) && (!loaded.bA.gA)) ? _List_fromArray( 68462 [ 68463 A2( 68464 $author$project$UI$Components$btnOutline, 68465 _List_Nil, 68466 { 68467 gv: $elm$core$Maybe$Nothing, 68468 i6: $author$project$Translations$migrateTitle(config.aJ), 68469 e7: config.d3( 68470 $author$project$Page$Group$RequestNavigation($author$project$Route$Migrate)) 68471 }) 68472 ]) : _List_Nil; 68473 return noOverlay( 68474 A3( 68475 $author$project$Page$Group$pageShell, 68476 config, 68477 $author$project$Translations$groupSettingsTitle(config.aJ), 68478 A2( 68479 $author$project$Ui$column, 68480 _List_fromArray( 68481 [ 68482 $author$project$Ui$spacing($author$project$UI$Theme$spacing.hE), 68483 $author$project$Ui$width($author$project$Ui$fill) 68484 ]), 68485 A2( 68486 $elm$core$List$cons, 68487 settingsForm, 68488 _Utils_ap( 68489 migrateButton, 68490 config.mi ? _List_fromArray( 68491 [ 68492 A2( 68493 $author$project$UI$Components$btnOutline, 68494 _List_Nil, 68495 { 68496 gv: $elm$core$Maybe$Nothing, 68497 i6: $author$project$Translations$diagTitle(config.aJ), 68498 e7: config.d3( 68499 $author$project$Page$Group$RequestNavigation($author$project$Route$Diagnostics)) 68500 }) 68501 ]) : _List_Nil))))); 68502 case 9: 68503 var _v5 = _v0.a; 68504 var _v6 = _Utils_Tuple2( 68505 maybeUserRootId, 68506 $author$project$Page$JoinGroup$getPreview(model.by)); 68507 if ((_v6.a.$ === 1) && (!_v6.b.$)) { 68508 var _v7 = _v6.a; 68509 var preview = _v6.b.a; 68510 return (!loaded.bA.gA) ? noOverlay( 68511 A3( 68512 $author$project$Page$Group$pageShell, 68513 config, 68514 $author$project$Translations$rejoinTitle(config.aJ), 68515 A2( 68516 $author$project$Ui$column, 68517 _List_fromArray( 68518 [ 68519 $author$project$Ui$spacing($author$project$UI$Theme$spacing.hE), 68520 $author$project$Ui$width($author$project$Ui$fill) 68521 ]), 68522 A2( 68523 $elm$core$List$cons, 68524 $author$project$Page$JoinGroup$viewGroupName(preview), 68525 A2( 68526 $elm$core$List$map, 68527 $author$project$Ui$map( 68528 A2($elm$core$Basics$composeL, config.d3, $author$project$Page$Group$RejoinMsg)), 68529 A2($author$project$Page$JoinGroup$viewPreview, config.aJ, preview)))))) : A4( 68530 $author$project$Page$Group$viewTabs, 68531 config, 68532 maybeUserRootId, 68533 loaded, 68534 _Utils_update( 68535 model, 68536 {an: 0})); 68537 } else { 68538 return A4( 68539 $author$project$Page$Group$viewTabs, 68540 config, 68541 maybeUserRootId, 68542 loaded, 68543 _Utils_update( 68544 model, 68545 {an: 0})); 68546 } 68547 case 10: 68548 var _v8 = _v0.a; 68549 var _v9 = A2($author$project$Page$Group$recoveryRootId, model, loaded); 68550 if (!_v9.$) { 68551 var selfRoot = _v9.a; 68552 return (!loaded.bA.gA) ? A4($author$project$Page$Group$migrateView, config, loaded, model, selfRoot) : A4( 68553 $author$project$Page$Group$viewTabs, 68554 config, 68555 maybeUserRootId, 68556 loaded, 68557 _Utils_update( 68558 model, 68559 {an: 0})); 68560 } else { 68561 return A4( 68562 $author$project$Page$Group$viewTabs, 68563 config, 68564 maybeUserRootId, 68565 loaded, 68566 _Utils_update( 68567 model, 68568 {an: 0})); 68569 } 68570 default: 68571 var _v10 = _v0.a; 68572 return config.mi ? noOverlay( 68573 A3( 68574 $author$project$Page$Group$pageShell, 68575 config, 68576 $author$project$Translations$diagTitle(config.aJ), 68577 A3($author$project$Page$Group$Diagnostics$view, config.aJ, loaded, model.cl))) : A4( 68578 $author$project$Page$Group$viewTabs, 68579 config, 68580 maybeUserRootId, 68581 loaded, 68582 _Utils_update( 68583 model, 68584 {an: 0})); 68585 } 68586 } 68587 var _v11 = _v0.b; 68588 return A4( 68589 $author$project$Page$Group$viewTabs, 68590 config, 68591 $elm$core$Maybe$Nothing, 68592 loaded, 68593 _Utils_update( 68594 model, 68595 {an: 0})); 68596 }); 68597var $author$project$Page$Group$RetryGroupLoad = {$: 2}; 68598var $author$project$Translations$groupLoadRetry = function (_v0) { 68599 var lang = _v0; 68600 if (!lang) { 68601 return 'Try again'; 68602 } else { 68603 return 'Réessayer'; 68604 } 68605}; 68606var $author$project$Page$Group$viewLoadFailedShell = function (config) { 68607 return A2( 68608 $author$project$UI$Shell$pageShell, 68609 { 68610 a9: config.oP, 68611 ba: $author$project$Translations$shellPartage(config.aJ) 68612 }, 68613 A2( 68614 $author$project$Ui$column, 68615 _List_fromArray( 68616 [ 68617 $author$project$Ui$spacing($author$project$UI$Theme$spacing.hE), 68618 $author$project$Ui$width($author$project$Ui$fill) 68619 ]), 68620 _List_fromArray( 68621 [ 68622 A2( 68623 $author$project$Ui$el, 68624 _List_fromArray( 68625 [ 68626 $author$project$Ui$Font$size($author$project$UI$Theme$font.qk), 68627 $author$project$Ui$Font$color($author$project$UI$Theme$base.aM) 68628 ]), 68629 $author$project$Ui$text( 68630 $author$project$Translations$toastGroupLoadError(config.aJ))), 68631 A2( 68632 $author$project$UI$Components$btnPrimary, 68633 _List_fromArray( 68634 [ 68635 $author$project$Ui$centerX, 68636 $author$project$Ui$width($author$project$Ui$shrink) 68637 ]), 68638 { 68639 i6: $author$project$Translations$groupLoadRetry(config.aJ), 68640 e7: config.d3($author$project$Page$Group$RetryGroupLoad) 68641 }) 68642 ]))); 68643}; 68644var $author$project$Translations$loadingGroup = function (_v0) { 68645 var lang = _v0; 68646 if (!lang) { 68647 return 'Loading group...'; 68648 } else { 68649 return 'Chargement du groupe...'; 68650 } 68651}; 68652var $author$project$Page$Group$viewLoadingShell = function (config) { 68653 return A2( 68654 $author$project$UI$Shell$pageShell, 68655 { 68656 a9: config.oP, 68657 ba: $author$project$Translations$shellPartage(config.aJ) 68658 }, 68659 A2( 68660 $author$project$Ui$el, 68661 _List_fromArray( 68662 [ 68663 $author$project$Ui$Font$size($author$project$UI$Theme$font.qk), 68664 $author$project$Ui$Font$color($author$project$UI$Theme$base.aM) 68665 ]), 68666 $author$project$Ui$text( 68667 $author$project$Translations$loadingGroup(config.aJ)))); 68668}; 68669var $author$project$Translations$missingGroupMessage = function (_v0) { 68670 var lang = _v0; 68671 if (!lang) { 68672 return 'You don\'t have this group locally. Open an invitation link (with its key after the #) to
68672join it.'; 68673 } else { 68674 return 'Tu n\'as pas ce groupe en local. Ouvre un lien d\'invitation (avec sa clé après le #) pour le rejoindre.'; 68675 } 68676}; 68677var $author$project$Translations$missingGroupTitle = function (_v0) { 68678 var lang = _v0; 68679 if (!lang) { 68680 return 'Group not on this device'; 68681 } else { 68682 return 'Ce groupe n\'est pas sur cet appareil'; 68683 } 68684}; 68685var $author$project$Page$Group$viewMissingGroupShell = function (config) { 68686 return A2( 68687 $author$project$UI$Shell$pageShell, 68688 { 68689 a9: config.oP, 68690 ba: $author$project$Translations$shellPartage(config.aJ) 68691 }, 68692 A2( 68693 $author$project$Ui$column, 68694 _List_fromArray( 68695 [ 68696 $author$project$Ui$spacing($author$project$UI$Theme$spacing.hE), 68697 $author$project$Ui$width($author$project$Ui$fill), 68698 A2($author$project$Ui$paddingXY, 0, $author$project$UI$Theme$spacing.rn) 68699 ]), 68700 _List_fromArray( 68701 [ 68702 A2( 68703 $author$project$Ui$column, 68704 _List_fromArray( 68705 [ 68706 $author$project$Ui$spacing($author$project$UI$Theme$spacing.aW), 68707 $author$project$Ui$width($author$project$Ui$fill) 68708 ]), 68709 _List_fromArray( 68710 [ 68711 A2( 68712 $author$project$Ui$el, 68713 _List_fromArray( 68714 [ 68715 $author$project$Ui$Font$size($author$project$UI$Theme$font.i8), 68716 $author$project$Ui$Font$weight($author$project$UI$Theme$fontWeight.lD), 68717 $author$project$Ui$Font$color($author$project$UI$Theme$base.qI) 68718 ]), 68719 $author$project$Ui$text( 68720 $author$project$Translations$missingGroupTitle(config.aJ))), 68721 A2( 68722 $author$project$Ui$el, 68723 _List_fromArray( 68724 [ 68725 $author$project$Ui$Font$size($author$project$UI$Theme$font.aW), 68726 $author$project$Ui$Font$color($author$project$UI$Theme$base.aM) 68727 ]), 68728 $author$project$Ui$text( 68729 $author$project$Translations$missingGroupMessage(config.aJ))) 68730 ])), 68731 A2( 68732 $author$project$Ui$el, 68733 _List_fromArray( 68734 [$author$project$Ui$centerX]), 68735 A2( 68736 $author$project$UI$Components$languageSelector, 68737 config.gY, 68738 $author$project$Translations$currentLanguage(config.aJ))) 68739 ]))); 68740}; 68741var $author$project$Page$Group$view = F3( 68742 function (config, groupView, model) { 68743 var _v0 = model.a; 68744 switch (_v0.$) { 68745 case 0: 68746 return { 68747 ew: $author$project$Page$Group$viewLoadingShell(config), 68748 g$: $elm$core$Maybe$Nothing 68749 }; 68750 case 1: 68751 return { 68752 ew: $author$project$Page$Group$viewMissingGroupShell(config), 68753 g$: $elm$core$Maybe$Nothing 68754 }; 68755 case 2: 68756 return { 68757 ew: $author$project$Page$Group$viewLoadingShell(config), 68758 g$: $elm$core$Maybe$Nothing 68759 }; 68760 case 3: 68761 return { 68762 ew: $author$project$Page$Group$viewLoadFailedShell(config), 68763 g$: $elm$core$Maybe$Nothing 68764 }; 68765 default: 68766 var loaded = _v0.a; 68767 return A4($author$project$Page$Group$viewGroupPage, config, groupView, loaded, model); 68768 } 68769 }); 68770var $author$project$Page$Home$ShowJoinInput = {$: 7}; 68771var $author$project$Page$Home$ToggleImportInfo = {$: 0}; 68772var $author$project$Page$Home$ToggleShowArchived = {$: 10}; 68773var $author$project$Page$Home$errorBanner = function (error) { 68774 return A2( 68775 $author$project$Ui$el, 68776 _List_fromArray( 68777 [ 68778 $author$project$Ui$width($author$project$Ui$fill), 68779 $author$project$Ui$paddingTop($author$project$UI$Theme$spacing.qk) 68780 ]), 68781 A2( 68782 $author$project$Ui$el, 68783 _List_fromArray( 68784 [ 68785 $author$project$Ui$Font$size($author$project$UI$Theme$font.qk), 68786 $author$project$Ui$Font$color($author$project$UI$Theme$danger.qI), 68787 $author$project$Ui$background($author$project$UI$Theme$danger.qR), 68788 A2($author$project$Ui$paddingXY, $author$project$UI$Theme$spacing.i8, $author$project$UI$Theme$spacing.aW), 68789 $author$project$Ui$rounded($author$project$UI$Theme$radius.aW), 68790 $author$project$Ui$border($author$project$UI$Theme$border), 68791 $author$project$Ui$borderColor($author$project$UI$Theme$danger.k3), 68792 $author$project$Ui$width($author$project$Ui$fill) 68793 ]), 68794 $author$project$Ui$text(error))); 68795}; 68796var $author$project$UI$Components$appLogo = function (size) { 68797 var s = $elm$core$String$fromFloat(size); 68798 return $author$project$Ui$html( 68799 A2( 68800 $elm$svg$Svg$svg, 68801 _List_fromArray( 68802 [ 68803 $elm$svg$Svg$Attributes$viewBox('0 0 32 32'), 68804 $elm$svg$Svg$Attributes$width(s), 68805 $elm$svg$Svg$Attributes$height(s) 68806 ]), 68807 _List_fromArray( 68808 [ 68809 A2( 68810 $elm$svg$Svg$circle, 68811 _List_fromArray( 68812 [ 68813 $elm$svg$Svg$Attributes$cx('16'), 68814 $elm$svg$Svg$Attributes$cy('16'), 68815 $elm$svg$Svg$Attributes$r('15'),
68816 $elm$svg$Svg$Attributes$fill('#E8725C') 68817 ]), 68818 _List_Nil), 68819 A2( 68820 $elm$svg$Svg$line, 68821 _List_fromArray( 68822 [ 68823 $elm$svg$Svg$Attributes$x1('16'), 68824 $elm$svg$Svg$Attributes$y1('6'), 68825 $elm$svg$Svg$Attributes$x2('16'), 68826 $elm$svg$Svg$Attributes$y2('26'), 68827 $elm$svg$Svg$Attributes$stroke('white'), 68828 $elm$svg$Svg$Attributes$strokeWidth('2'), 68829 $elm$svg$Svg$Attributes$strokeLinecap('round') 68830 ]), 68831 _List_Nil), 68832 A2( 68833 $elm$svg$Svg$circle, 68834 _List_fromArray( 68835 [ 68836 $elm$svg$Svg$Attributes$cx('10'), 68837 $elm$svg$Svg$Attributes$cy('16'), 68838 $elm$svg$Svg$Attributes$r('3'), 68839 $elm$svg$Svg$Attributes$fill('white') 68840 ]), 68841 _List_Nil), 68842 A2( 68843 $elm$svg$Svg$circle, 68844 _List_fromArray( 68845 [ 68846 $elm$svg$Svg$Attributes$cx('22'), 68847 $elm$svg$Svg$Attributes$cy('16'), 68848 $elm$svg$Svg$Attributes$r('3'), 68849 $elm$svg$Svg$Attributes$fill('white') 68850 ]), 68851 _List_Nil) 68852 ]))); 68853}; 68854var $author$project$Page$Home$footer = F2( 68855 function (i18n, onNavigate) { 68856 return A2( 68857 $author$project$Ui$column, 68858 _List_fromArray( 68859 [ 68860 $author$project$Ui$width($author$project$Ui$fill), 68861 $author$project$Ui$paddingTop($author$project$UI$Theme$spacing.hF), 68862 $author$project$Ui$alignBottom 68863 ]), 68864 _List_fromArray( 68865 [ 68866 $author$project$UI$Components$horizontalSeparator, 68867 A2( 68868 $author$project$Ui$row, 68869 A2( 68870 $elm$core$List$cons, 68871 A2($author$project$Ui$paddingXY, 0, $author$project$UI$Theme$spacing.i8), 68872 A2( 68873 $elm$core$List$cons, 68874 $author$project$Ui$centerX, 68875 A2( 68876 $elm$core$List$cons, 68877 $author$project$Ui$Font$size($author$project$UI$Theme$font.qk), 68878 A2( 68879 $elm$core$List$cons, 68880 $author$project$Ui$Font$weight($author$project$UI$Theme$fontWeight.nI), 68881 A2( 68882 $elm$core$List$cons, 68883 $author$project$Ui$Font$color($author$project$UI$Theme$base.aM), 68884 A2( 68885 $elm$core$List$cons, 68886 $author$project$Ui$pointer, 68887 A2( 68888 $elm$core$List$cons, 68889 $author$project$Ui$spacing($author$project$UI$Theme$spacing.bb), 68890 A2( 68891 $elm$core$List$cons, 68892 $author$project$Ui$contentCenterY, 68893 A2( 68894 $author$project$UI$Components$spaLinkAttrs, 68895 $author$project$Route$toPath($author$project$Route$About), 68896 onNavigate($author$project$Route$About)))))))))), 68897 _List_fromArray( 68898 [ 68899 $author$project$UI$Components$appLogo(16), 68900 $author$project$Ui$text( 68901 $author$project$Translations$aboutTitle(i18n)) 68902 ])) 68903 ])); 68904 }); 68905var $elm$virtual_dom$VirtualDom$Custom = function (a) { 68906 return {$: 3, a: a}; 68907}; 68908var $elm$html$Html$Events$custom = F2( 68909 function (event, decoder) { 68910 return A2( 68911 $elm$virtual_dom$VirtualDom$on, 68912 event, 68913 $elm$virtual_dom$VirtualDom$Custom(decoder)); 68914 }); 68915var $author$project$Ui$Events$custom = F2( 68916 function (name, decoder) { 68917 return $author$project$Internal$Model2$attribute( 68918 A2($elm$html$Html$Events$custom, name, decoder)); 68919 }); 68920var $author$project$Page$Home$exportLink = F2( 68921 function (onClickMsg, label) { 68922 return A2( 68923 $author$project$Ui$el, 68924 _List_fromArray( 68925 [ 68926 $author$project$Ui$pointer, 68927 A2( 68928 $author$project$Ui$Events$custom, 68929 'click', 68930 $elm$json$Json$Decode$succeed( 68931 {dv: onClickMsg, pD: true, qx: true})) 68932 ]), 68933 $author$project$Ui$text(label)); 68934 }); 68935var $author$project$Page$Home$formatYear = function (posix) { 68936 var year = (($elm$time$Time$posixToMillis(posix) / 31557600000) | 0) + 1970; 68937 return $elm$core$String$fromInt(year); 68938}; 68939var $author$project$Translations$homeCreated = function (_v0) { 68940 var lang = _v0; 68941 if (!lang) { 68942 return 'Created'; 68943 } else { 68944 return 'Créé en'; 68945 } 68946}; 68947var $author$project$Translations$homeDormantHint = function (_v0) { 68948 var lang = _v0; 68949 if (!lang) { 68950 return 'Inactive for a while. The server deletes its copy after 12 months; yours stays on this device â export a backup.'; 68951 } else { 68952 return 'Inactif depuis un moment. Le serveur supprime sa copie après 12 mois ; la tienne reste sur cet appareil â exporte une sauvegarde.'; 68953 } 68954}; 68955var $author$project$Translations$homeExportGroup = function (_v0) { 68956 var lang = _v0; 68957 if (!lang) { 68958 return 'Export'; 68959 } else { 68960 return 'Exporter'; 68961 } 68962}; 68963var $author$project$Translations$homeExportGroupCsv = function (_v0) { 68964 var lang = _v0; 68965 if (!lang) { 68966 return 'CSV'; 68967 } else { 68968 return 'CSV'; 68969 } 68970}; 68971var $author$project$Translations$homeMembers = F2( 68972 function (count, _v0) { 68973 var lang = _v0; 68974 if (!lang) { 68975 if (count === '1') { 68976 return count + ' member'; 68977 } else { 68978 return count + ' members'; 68979 } 68980 } else { 68981 switch (count) { 68982 case '0': 68983 return count + ' membre'; 68984 case '1': 68985 return count + ' membre'; 68986 default: 68987 return count + ' membres'; 68988 } 68989 } 68990 }); 68991var $author$project$Translations$homeSettled = function (_v0) { 68992 var lang = _v0; 68993 if (!lang) { 68994 return 'Settled'; 68995 } else { 68996 return 'Soldé'; 68997 } 68998}; 68999var $author$project$Translations$homeYourBalance = function (_v0) { 69000 var lang = _v0; 69001 if (!lang) { 69002 return 'Your balance:'; 69003 } else { 69004 return 'Ton solde :'; 69005 } 69006}; 69007var $author$project$Page$Home$dormantThresholdMillis = (((334 * 24) * 60) * 60) * 1000; 69008var $author$project$Page$Home$isDormant = F2( 69009 function (now, summary) { 69010 return _Utils_cmp( 69011 $elm$time$Time$posixToMillis(now) - $elm$time$Time$posixToMillis(summary.gF), 69012 $author$project$Page$Home$dormantThresholdMillis) > 0; 69013 }); 69014var $author$project$Page$Home$groupCard = F3( 69015 function (i18n, ctx, summary) { 69016 var metaLine = A2( 69017 $elm$core$String$join, 69018 ' · ', 69019 _List_fromArray( 69020 [ 69021 A2( 69022 $author$project$Translations$homeMembers, 69023 $elm$core$String$fromInt(summary.gL), 69024 i18n), 69025 $author$project$Translations$homeCreated(i18n) + (' ' + $author$project$Page$Home$formatYear(summary.f2)), 69026 $author$project$Domain$Currency$currencySymbol(summary.il) 69027 ])); 69028 var hasActivity = A2($elm$core$Set$member, summary.m9, ctx.k8); 69029 var groupRoute = hasActivity ? A2( 69030 $author$project$Route$GroupRoute, 69031 summary.m9, 69032 $author$project$Route$Tab(3)) : A2( 69033 $author$project$Route$GroupRoute, 69034 summary.m9, 69035 $author$project$Route$Tab(0)); 69036 var balanceView = function () { 69037 var cents = summary.gS; 69038 var balancePrefix = A2( 69039 $author$project$Ui$el, 69040 _List_fromArray( 69041 [ 69042 $author$project$Ui$Font$size($author$project$UI$Theme$font.qk), 69043 $author$project$Ui$Font$color($author$project$UI$Theme$base.aM) 69044 ]), 69045 $author$project$Ui$text( 69046 $author$project$Translations$homeYourBalance(i18n) + ' ')); 69047 return (cents > 0) ? A2( 69048 $author$project$Ui$row, 69049 _List_fromArray( 69050 [ 69051 $author$project$Ui$spacing($author$project$UI$Theme$spacing.qk), 69052 $author$project$Ui$width($author$project$Ui$shrink) 69053 ]), 69054 _List_fromArray( 69055 [ 69056 balancePrefix, 69057 A2( 69058 $author$project$Ui$el, 69059 _List_fromArray( 69060 [ 69061 $author$project$Ui$Font$size($author$project$UI$Theme$font.qk), 69062 $author$project$Ui$Font$weight($author$project$UI$Theme$fontWeight.nI), 69063 $author$project$Ui$Font$color($author$project$UI$Theme$success.qI) 69064 ]), 69065 $author$project$Ui$text( 69066 A3( 69067 $author$project$Format$formatCentsSigned, 69068 $author$project$Translations$currentLanguage(i18n), 69069 cents, 69070 summary.il))) 69071 ])) : ((cents < 0) ? A2( 69072 $author$project$Ui$row, 69073 _List_fromArray( 69074 [ 69075 $author$project$Ui$spacing($author$project$UI$Theme$spacing.qk), 69076 $author$project$Ui$width($author$project$Ui$shrink) 69077 ]), 69078 _List_fromArray( 69079 [ 69080 balancePrefix, 69081 A2( 69082 $author$project$Ui$el, 69083 _List_fromArray( 69084 [ 69085 $author$project$Ui$Font$size($author$project$UI$Theme$font.qk), 69086 $author$project$Ui$Font$weight($author$project$UI$Theme$fontWeight.nI), 69087 $author$project$Ui$Font$color($author$project$UI$Theme$danger.qI) 69088 ]), 69089 $author$project$Ui$text( 69090 A3( 69091 $author$project$Format$formatCentsSigned, 69092 $author$project$Translations$currentLanguage(i18n), 69093 cents, 69094 summary.il))) 69095 ])) : A2( 69096 $author$project$Ui$row, 69097 _List_fromArray( 69098 [ 69099 $author$project$Ui$spacing($author$project$UI$Theme$spacing.qk), 69100 $author$project$Ui$width($author$project$Ui$shrink) 69101 ]), 69102 _List_fromArray( 69103 [ 69104 balancePrefix, 69105 A2( 69106 $author$project$Ui$el, 69107 _List_fromArray( 69108 [ 69109 $author$project$Ui$Font$size($author$project$UI$Theme$font.qk), 69110 $author$project$Ui$Font$color($author$project$UI$Theme$base.aM) 69111 ]), 69112 $author$project$Ui$text( 69113 $author$project$Translations$homeSettled(i18n))) 69114 ]))); 69115 }(); 69116 return A2( 69117 $author$project$UI$Components$card, 69118 A2( 69119 $elm$core$List$cons, 69120 $author$project$Ui$padding($author$project$UI$Theme$spacing.i8), 69121 A2( 69122 $elm$core$List$cons, 69123 $author$project$Ui$pointer, 69124 A2( 69125 $author$project$UI$Components$spaLinkAttrs, 69126 $author$project$Route$toPath(groupRoute), 69127 ctx.oO(groupRoute)))), 69128 _List_fromArray( 69129 [ 69130 A2( 69131 $author$project$Ui$row, 69132 _List_fromArray( 69133 [ 69134 $author$project$Ui$spacing($author$project$UI$Theme$spacing.qk), 69135 $author$project$Ui$contentCenterY 69136 ]), 69137 _List_fromArray( 69138 [ 69139 A2( 69140 $author$project$Ui$el, 69141 _List_fromArray( 69142 [ 69143 $author$project$Ui$width($author$project$Ui$shrink), 69144 $author$project$Ui$Font$size($author$project$UI$Theme$font.i8), 69145 $author$project$Ui$Font$weight($author$project$UI$Theme$fontWeight.dL), 69146 $author$project$Ui$Font$letterSpacing($author$project$UI$Theme$letterSpacing.qP) 69147 ]), 69148 $author$project$Ui$text(summary.bW)), 69149 hasActivity ? A2( 69150 $author$project$Ui$el, 69151 _List_fromArray( 69152 [ 69153 $author$project$Ui$width( 69154 $author$project$Ui$px(10)), 69155 $author$project$Ui$height( 69156 $author$project$Ui$px(10)), 69157 $author$project$Ui$rounded(5), 69158 $author$project$Ui$background($author$project$UI$Theme$primary.kl) 69159 ]), 69160 $author$project$Ui$none) : $author$project$Ui$none 69161 ])), 69162 A2( 69163 $author$project$Ui$row, 69164 _List_fromArray( 69165 [ 69166 $author$project$Ui$spacing($author$project$UI$Theme$spacing.i8), 69167 $author$project$Ui$paddingTop($author$project$UI$Theme$spacing.bb), 69168 $author$project$Ui$Font$size($author$project$UI$Theme$font.qk), 69169 $author$project$Ui$Font$color($author$project$UI$Theme$base.aM) 69170 ]), 69171 _List_fromArray( 69172 [ 69173 $author$project$Ui$text(metaLine) 69174 ])), 69175 A2( 69176 $author$project$Ui$el, 69177 _List_fromArray( 69178 [ 69179 A2($author$project$Ui$paddingXY, 0, $author$project$UI$Theme$spacing.qk), 69180 $author$project$Ui$width($author$project$Ui$fill) 69181 ]), 69182 $author$project$UI$Components$horizontalSeparator), 69183 A2( 69184 $author$project$Ui$row, 69185 _List_fromArray( 69186 [ 69187 $author$project$Ui$width($author$project$Ui$fill), 69188 $author$project$Ui$spacing($author$project$UI$Theme$spacing.aW) 69189 ]), 69190 _List_fromArray( 69191 [ 69192 balanceView, 69193 A2( 69194 $author$project$Ui$row, 69195 _List_fromArray( 69196 [ 69197 $author$project$Ui$spacing($author$project$UI$Theme$spacing.aW), 69198 $author$project$Ui$alignRight, 69199 $author$project$Ui$Font$size($author$project$UI$Theme$font.qk), 69200 $author$project$Ui$Font$color($author$project$UI$Theme$primary.qI) 69201 ]), 69202 _List_fromArray( 69203 [ 69204 A2( 69205 $author$project$Page$Home$exportLink, 69206 ctx.oB(summary.m9), 69207 $author$project$Translations$homeExportGroup(i18n)), 69208 A2( 69209 $author$project$Page$Home$exportLink, 69210 ctx.oC(summary.m9), 69211 $author$project$Translations$homeExportGroupCsv(i18n)) 69212 ])) 69213 ])), 69214 ((!summary.gA) && A2($author$project$Page$Home$isDormant, ctx.ap, summary)) ? A2( 69215 $author$project$Ui$el, 69216 _List_fromArray( 69217 [ 69218 $author$project$Ui$paddingTop($author$project$UI$Theme$spacing.qk), 69219 $author$project$Ui$Font$size($author$project$UI$Theme$font.qk), 69220 $author$project$Ui$Font$color($author$project$UI$Theme$warning.qI) 69221 ]), 69222 $author$project$Ui$text( 69223 $author$project$Translations$homeDormantHint(i18n))) : $author$project$Ui$none 69224 ])); 69225 }); 69226var $author$project$Translations$homeArchivedGroups = function (_v0) { 69227 var lang = _v0; 69228 if (!lang) { 69229 return 'Archived'; 69230 } else { 69231 return 'Archivés'; 69232 } 69233}; 69234var $author$project$UI$Components$staticPageLinkAttrs = function (href) { 69235 return A2( 69236 $elm$core$List$cons, 69237 $author$project$Ui$link(href), 69238 $author$project$UI$Components$keepOriginReferrer); 69239}; 69240var $author$project$Page$Home$homeHeader = function (i18n) { 69241 return A2( 69242 $author$project$Ui$row, 69243 A2( 69244 $elm$core$List$cons, 69245 $author$project$Ui$paddingWith( 69246 {lI: $author$project$UI$Theme$spacing.aW, nz: 0, pW: 0, qW: $author$project$UI$Theme$spacing.hE}), 69247 A2( 69248 $elm$core$List$cons, 69249 $author$project$Ui$Font$size($author$project$UI$Theme$font.hF), 69250 A2( 69251 $elm$core$List$cons, 69252 $author$project$Ui$Font$weight($author$project$UI$Theme$fontWeight.lD), 69253 A2( 69254 $elm$core$List$cons, 69255 $author$project$Ui$Font$letterSpacing($author$project$UI$Theme$letterSpacing.qP), 69256 A2( 69257 $elm$core$List$cons, 69258 $author$project$Ui$spacing($author$project$UI$Theme$spacing.qk), 69259 A2( 69260 $elm$core$List$cons, 69261 $author$project$Ui$contentCenterY, 69262 A2( 69263 $elm$core$List$cons, 69264 $author$project$Ui$pointer, 69265 $author$project$UI$Components$staticPageLinkAttrs('/')))))))), 69266 _List_fromArray( 69267 [ 69268 $author$project$UI$Components$appLogo(32), 69269 $author$project$Ui$text(
69270 $author$project$Translations$shellPartage(i18n)) 69271 ])); 69272}; 69273var $author$project$Translations$homeImportGroup = function (_v0) { 69274 var lang = _v0; 69275 if (!lang) { 69276 return 'Import'; 69277 } else { 69278 return 'Importer'; 69279 } 69280}; 69281var $author$project$Translations$homeMigrationBanner = F2( 69282 function (target, _v0) { 69283 var lang = _v0; 69284 if (!lang) { 69285 return 'Partage is migrating to ' + (target + '. Bring your groups along â it only takes a minute.'); 69286 } else { 69287 return 'Partage migre vers ' + (target + '. Emmène tes groupes â ça ne prend qu\'une minute.'); 69288 } 69289 }); 69290var $author$project$Translations$homeMigrationBannerCta = function (_v0) { 69291 var lang = _v0; 69292 if (!lang) { 69293 return 'Migrate my groups'; 69294 } else { 69295 return 'Migrer mes groupes'; 69296 } 69297}; 69298var $author$project$Translations$homeMovingInBanner = F2( 69299 function (source, _v0) { 69300 var lang = _v0; 69301 if (!lang) { 69302 return 'Migrating from ' + (source + '? Bring your profile and your groups over â it only takes a minute.'); 69303 } else { 69304 return 'Tu migres depuis ' + (source + ' ? Récupère ton profil et tes groupes â ça ne prend qu\'une minute.'); 69305 } 69306 }); 69307var $author$project$Translations$homeMovingInBannerCta = function (_v0) { 69308 var lang = _v0; 69309 if (!lang) { 69310 return 'Finish migrating'; 69311 } else { 69312 return 'Terminer la migration'; 69313 } 69314}; 69315var $author$project$Translations$homeNewGroup = function (_v0) { 69316 var lang = _v0; 69317 if (!lang) { 69318 return '+ New Group'; 69319 } else { 69320 return '+ Créer un nouveau groupe'; 69321 } 69322}; 69323var $author$project$Translations$homeNoGroups = function (_v0) { 69324 var lang = _v0; 69325 if (!lang) { 69326 return 'No groups yet. Create your first one!'; 69327 } else { 69328 return 'Pas encore de groupe. On se lance ?'; 69329 } 69330}; 69331var $author$project$Translations$homeYourGroups = function (_v0) { 69332 var lang = _v0; 69333 if (!lang) { 69334 return 'Your Groups'; 69335 } else { 69336 return 'Tes groupes'; 69337 } 69338}; 69339var $author$project$Page$Home$StartImport = {$: 1}; 69340var $author$project$Page$Home$StartSplitwiseImport = {$: 4}; 69341var $author$project$UI$Components$btnDark = F2( 69342 function (attrs, config) { 69343 return A2( 69344 $author$project$Ui$el, 69345 A2( 69346 $elm$core$List$cons, 69347 $author$project$Ui$Input$button(config.e7), 69348 A2( 69349 $elm$core$List$cons, 69350 $author$project$Ui$background($author$project$UI$Theme$base.qI), 69351 A2( 69352 $elm$core$List$cons, 69353 $author$project$Ui$rounded($author$project$UI$Theme$radius.aW), 69354 A2( 69355 $elm$core$List$cons, 69356 A2($author$project$Ui$paddingXY, $author$project$UI$Theme$spacing.i8, $author$project$UI$Theme$spacing.aW), 69357 A2( 69358 $elm$core$List$cons, 69359 $author$project$Ui$Font$color($author$project$UI$Theme$base.h$), 69360 A2( 69361 $elm$core$List$cons, 69362 $author$project$Ui$Font$size($author$project$UI$Theme$font.aW), 69363 A2( 69364 $elm$core$List$cons, 69365 $author$project$Ui$Font$weight($author$project$UI$Theme$fontWeight.dL), 69366 A2( 69367 $elm$core$List$cons, 69368 $author$project$Ui$Font$center, 69369 A2( 69370 $elm$core$List$cons, 69371 $author$project$Ui$contentCenterX, 69372 A2($elm$core$List$cons, $author$project$Ui$pointer, attrs)))))))))), 69373 $author$project$Ui$text(config.i6)); 69374 }); 69375var $author$project$Translations$homeImportCancel = function (_v0) { 69376 var lang = _v0; 69377 if (!lang) { 69378 return 'Cancel'; 69379 } else { 69380 return 'Annuler'; 69381 } 69382}; 69383var $author$project$Translations$homeImportConfirm = function (_v0) { 69384 var lang = _v0; 69385 if (!lang) { 69386 return 'Choose file'; 69387 } else { 69388 return 'Choisir un fichier'; 69389 } 69390}; 69391var $author$project$Translations$homeImportHint = function (_v0) { 69392 var lang = _v0; 69393 if (!lang) { 69394 return 'Imports a group previously exported from Partage.'; 69395 } else { 69396 return 'Importe un groupe précédemment exporté depuis Partage.'; 69397 } 69398}; 69399var $author$project$Translations$splitwiseImportButton = function (_v0) { 69400 var lang = _v0; 69401 if (!lang) { 69402 return 'Import Splitwise CSV'; 69403 } else { 69404 return 'Importer un CSV Splitwise'; 69405 } 69406}; 69407var $author$project$Translations$splitwiseImportEnglishOnly = function (_v0) { 69408 var lang = _v0; 69409 if (!lang) { 69410 return 'The Splitwise export must be in English.'; 69411 } else { 69412 return 'L\'export Splitwise doit être en anglais.'; 69413 } 69414}; 69415var $author$project$Translations$splitwiseImportInfo = function (_v0) { 69416 var lang = _v0; 69417 if (!lang) { 69418 return 'Import a group from a Splitwise group CSV: only history and balances, exact split details are lost in the Splitwise CSV export.'; 69419 } else { 69420 return 'Importe un groupe depuis un export CSV de groupe Splitwise : uniquement l\'historique et les soldes, les détails exacts de répartition sont perdus dans l\'export CSV de Splitwise.'; 69421 } 69422}; 69423var $author$project$Page$Home$importInfo = F3( 69424 function (i18n, toMsg, data) { 69425 return (!data.cT) ? $author$project$Ui$none : A2( 69426 $author$project$Ui$column, 69427 _List_fromArray( 69428 [ 69429 $author$project$Ui$spacing($author$project$UI$Theme$spacing.aW), 69430 $author$project$Ui$width($author$project$Ui$fill) 69431 ]), 69432 _List_fromArray( 69433 [ 69434 A2( 69435 $author$project$Ui$el, 69436 _List_fromArray( 69437 [ 69438 $author$project$Ui$Font$size($author$project$UI$Theme$font.qk), 69439 $author$project$Ui$Font$color($author$project$UI$Theme$base.aM), 69440 $author$project$Ui$width($author$project$Ui$fill) 69441 ]), 69442 $author$project$Ui$text( 69443 $author$project$Translations$homeImportHint(i18n))), 69444 A2( 69445 $author$project$Ui$row, 69446 _List_fromArray( 69447 [ 69448 $author$project$Ui$spacing($author$project$UI$Theme$spacing.qk) 69449 ]), 69450 _List_fromArray( 69451 [ 69452 A2( 69453 $author$project$UI$Components$btnOutline, 69454 _List_Nil, 69455 { 69456 gv: $elm$core$Maybe$Nothing, 69457 i6: $author$project$Translations$homeImportCancel(i18n), 69458 e7: toMsg($author$project$Page$Home$ToggleImportInfo) 69459 }), 69460 A2( 69461 $author$project$UI$Components$btnDark, 69462 _List_Nil, 69463 { 69464 i6: $author$project$Translations$homeImportConfirm(i18n), 69465 e7: toMsg($author$project$Page$Home$StartImport) 69466 }) 69467 ])), 69468 A2( 69469 $author$project$Ui$el, 69470 _List_fromArray( 69471 [ 69472 A2($author$project$Ui$paddingXY, 0, $author$project$UI$Theme$spacing.bb), 69473 $author$project$Ui$width($author$project$Ui$fill) 69474 ]), 69475 $author$project$UI$Components$horizontalSeparator), 69476 A2( 69477 $author$project$Ui$el, 69478 _List_fromArray( 69479 [ 69480 $author$project$Ui$Font$size($author$project$UI$Theme$font.qk), 69481 $author$project$Ui$Font$color($author$project$UI$Theme$base.aM), 69482 $author$project$Ui$width($author$project$Ui$fill) 69483 ]), 69484 $author$project$Ui$text( 69485 $author$project$Translations$splitwiseImportInfo(i18n))), 69486 A2( 69487 $author$project$Ui$el, 69488 _List_fromArray( 69489 [ 69490 $author$project$Ui$Font$size($author$project$UI$Theme$font.qk), 69491 $author$project$Ui$Font$color($author$project$UI$Theme$warning.qI), 69492 $author$project$Ui$width($author$project$Ui$fill) 69493 ]), 69494 $author$project$Ui$text( 69495 $author$project$Translations$splitwiseImportEnglishOnly(i18n))), 69496 A2( 69497 $author$project$UI$Components$btnOutline, 69498 _List_fromArray( 69499 [ 69500 $author$project$Ui$width($author$project$Ui$shrink) 69501 ]), 69502 { 69503 gv: $elm$core$Maybe$Nothing, 69504 i6: $author$project$Translations$splitwiseImportButton(i18n), 69505 e7: toMsg($author$project$Page$Home$StartSplitwiseImport) 69506 }) 69507 ])); 69508 }); 69509var $author$project$Page$Home$JoinLinkChanged = function (a) { 69510 return {$: 8, a: a}; 69511}; 69512var $author$project$Page$Home$SubmitJoinLink = {$: 9}; 69513var $author$project$Translations$homeGoButton = function (_v0) { 69514 var lang = _v0; 69515 if (!lang) { 69516 return 'Go'; 69517 } else { 69518 return 'Go'; 69519 } 69520}; 69521var $author$project$Translations$homeJoinLinkPlaceholder = function (_v0) { 69522 var lang = _v0; 69523 if (!lang) { 69524 return 'Paste join link here'; 69525 } else { 69526 return 'Coller le lien d\'invitation ici'; 69527 } 69528}; 69529var $author$project$Page$Home$joinInput = F3( 69530 function (i18n, toMsg, data) { 69531 return (!data.dQ) ? $author$project$Ui$none : A2( 69532 $author$project$Ui$row, 69533 _List_fromArray( 69534 [ 69535 $author$project$Ui$spacing($author$project$UI$Theme$spacing.qk) 69536 ]), 69537 _List_fromArray( 69538 [ 69539 A2( 69540 $author$project$Ui$Input$text, 69541 _List_fromArray( 69542 [ 69543 $author$project$Ui$width($author$project$Ui$fill) 69544 ]), 69545 { 69546 i6: $author$project$Ui$Input$labelHidden( 69547 $author$project$Translations$shellJoinGroup(i18n)), 69548 oq: A2($elm$core$Basics$composeL, toMsg, $author$project$Page$Home$JoinLinkChanged), 69549 pt: $elm$core$Maybe$Just( 69550 $author$project$Translations$homeJoinLinkPlaceholder(i18n)), 69551 qI: data.bR 69552 }), 69553 A2( 69554 $author$project$UI$Components$btnDark, 69555 _List_fromArray( 69556 [ 69557 $author$project$Ui$width($author$project$Ui$shrink) 69558 ]), 69559 { 69560 i6: $author$project$Translations$homeGoButton(i18n), 69561 e7: toMsg($author$project$Page$Home$SubmitJoinLink) 69562 }) 69563 ])); 69564 }); 69565var $author$project$Page$Home$migrationBanner = function (banner) { 69566 return A2( 69567 $author$project$Ui$column, 69568 _List_fromArray( 69569 [ 69570 $author$project$Ui$spacing($author$project$UI$Theme$spacing.aW), 69571 $author$project$Ui$background($author$project$UI$Theme$primary.qR), 69572 A2($author$project$Ui$paddingXY, $author$project$UI$Theme$spacing.i8, $author$project$UI$Theme$spacing.aW),
69573 $author$project$Ui$rounded($author$project$UI$Theme$radius.aW), 69574 $author$project$Ui$border($author$project$UI$Theme$border), 69575 $author$project$Ui$borderColor($author$project$UI$Theme$primary.k3), 69576 $author$project$Ui$width($author$project$Ui$fill) 69577 ]), 69578 _List_fromArray( 69579 [ 69580 A2( 69581 $author$project$Ui$el, 69582 _List_fromArray( 69583 [ 69584 $author$project$Ui$Font$size($author$project$UI$Theme$font.aW), 69585 $author$project$Ui$Font$color($author$project$UI$Theme$base.qI) 69586 ]), 69587 $author$project$Ui$text(banner.dv)), 69588 A2( 69589 $author$project$UI$Components$btnPrimary, 69590 _List_fromArray( 69591 [ 69592 $author$project$Ui$width($author$project$Ui$shrink) 69593 ]), 69594 {i6: banner.f4, e7: banner.e7}) 69595 ])); 69596}; 69597var $author$project$Translations$homeNotificationsTitle = function (_v0) { 69598 var lang = _v0; 69599 if (!lang) { 69600 return 'NOTIFICATIONS'; 69601 } else { 69602 return 'NOTIFICATIONS'; 69603 } 69604}; 69605var $author$project$Translations$homeNotificationsUnavailable = function (_v0) { 69606 var lang = _v0; 69607 if (!lang) { 69608 return 'Notifications aren\'t available right now. Please try again later.'; 69609 } else { 69610 return 'Les notifications ne sont pas disponibles pour le moment. Réessaie plus tard.'; 69611 } 69612}; 69613var $author$project$Translations$homeEnableNotificationsLabel = function (_v0) { 69614 var lang = _v0; 69615 if (!lang) { 69616 return 'Enable notifications'; 69617 } else { 69618 return 'Activer les notifications'; 69619 } 69620}; 69621var $author$project$Translations$homeNotificationsHint = function (_v0) { 69622 var lang = _v0; 69623 if (!lang) { 69624 return 'This is a global setting to activate notifications in the app. Per-group Push notifications are configured inside each group.'; 69625 } else { 69626 return 'Clique sur la cloche pour autoriser les notifications. Ensuite tu pourras souscrire aux notifications push indépendamment dans chaque groupe.'; 69627 } 69628}; 69629var $author$project$Page$Home$notifEnableSection = F2( 69630 function (i18n, ctx) { 69631 var _v0 = ctx.jr; 69632 _v0$3: 69633 while (true) { 69634 if (!_v0.$) { 69635 switch (_v0.a) { 69636 case 0: 69637 var _v1 = _v0.a; 69638 return $author$project$Ui$none; 69639 case 1: 69640 var _v2 = _v0.a; 69641 return $author$project$Ui$none; 69642 case 3: 69643 var _v3 = _v0.a; 69644 return $author$project$Ui$none; 69645 default: 69646 break _v0$3; 69647 } 69648 } else { 69649 break _v0$3; 69650 } 69651 } 69652 return A2( 69653 $author$project$Ui$column, 69654 _List_Nil, 69655 _List_fromArray( 69656 [ 69657 $author$project$UI$Components$sectionLabel( 69658 $author$project$Translations$homeNotificationsTitle(i18n)), 69659 A2( 69660 $author$project$Ui$row, 69661 _List_fromArray( 69662 [ 69663 $author$project$Ui$spacing($author$project$UI$Theme$spacing.aW) 69664 ]), 69665 _List_fromArray( 69666 [ 69667 A2( 69668 $author$project$Ui$el, 69669 _List_fromArray( 69670 [ 69671 $author$project$Ui$Font$size($author$project$UI$Theme$font.qk), 69672 $author$project$Ui$Font$color($author$project$UI$Theme$base.aM), 69673 $author$project$Ui$width($author$project$Ui$fill) 69674 ]), 69675 $author$project$Ui$text( 69676 $author$project$Translations$homeNotificationsHint(i18n))), 69677 A2( 69678 $author$project$UI$Components$iconButton, 69679 _List_fromArray( 69680 [ 69681 $author$project$Ui$background($author$project$UI$Theme$primary.qR) 69682 ]), 69683 { 69684 gv: $feathericons$elm_feather$FeatherIcons$bell, 69685 i6: $author$project$Translations$homeEnableNotificationsLabel(i18n), 69686 e7: ctx.oz, 69687 dW: $author$project$UI$Theme$sizing.qk 69688 }) 69689 ])) 69690 ])); 69691 }); 69692var $author$project$Page$Home$notifSection = F2( 69693 function (i18n, ctx) { 69694 return (!ctx.jQ) ? $author$project$Ui$none : (ctx.of ? A2( 69695 $author$project$Ui$column, 69696 _List_Nil, 69697 _List_fromArray( 69698 [ 69699 $author$project$UI$Components$sectionLabel( 69700 $author$project$Translations$homeNotificationsTitle(i18n)), 69701 A2( 69702 $author$project$Ui$el, 69703 _List_fromArray( 69704 [ 69705 $author$project$Ui$Font$size($author$project$UI$Theme$font.qk), 69706 $author$project$Ui$Font$color($author$project$UI$Theme$base.aM) 69707 ]), 69708 $author$project$Ui$text( 69709 $author$project$Translations$homeNotificationsUnavailable(i18
69709n))) 69710 ])) : A2($author$project$Page$Home$notifEnableSection, i18n, ctx)); 69711 }); 69712var $author$project$Page$Home$view = F5( 69713 function (i18n, ctx, toMsg, _v0, groups) { 69714 var data = _v0; 69715 var groupActions = function (attrs) { 69716 return A2( 69717 $author$project$Ui$column, 69718 A2( 69719 $elm$core$List$cons, 69720 $author$project$Ui$spacing($author$project$UI$Theme$spacing.i8), 69721 attrs), 69722 _List_fromArray( 69723 [ 69724 A2( 69725 $author$project$Ui$row, 69726 _List_fromArray( 69727 [ 69728 $author$project$Ui$spacing($author$project$UI$Theme$spacing.aW) 69729 ]), 69730 _List_fromArray( 69731 [ 69732 A2( 69733 $author$project$UI$Components$btnOutline, 69734 _List_Nil, 69735 { 69736 gv: $elm$core$Maybe$Just( 69737 A2($author$project$UI$Components$featherIcon, 16, $feathericons$elm_feather$FeatherIcons$download)), 69738 i6: $author$project$Translations$homeImportGroup(i18n), 69739 e7: toMsg($author$project$Page$Home$ToggleImportInfo) 69740 }), 69741 A2( 69742 $author$project$UI$Components$btnOutline, 69743 _List_Nil, 69744 { 69745 gv: $elm$core$Maybe$Just( 69746 A2($author$project$UI$Components$featherIcon, 16, $feathericons$elm_feather$FeatherIcons$userPlus)), 69747 i6: $author$project$Translations$shellJoinGroup(i18n), 69748 e7: toMsg($author$project$Page$Home$ShowJoinInput) 69749 }) 69750 ])), 69751 A3($author$project$Page$Home$importInfo, i18n, toMsg, data), 69752 A3($author$project$Page$Home$joinInput, i18n, toMsg, data), 69753 A2( 69754 $author$project$UI$Components$btnPrimary, 69755 A2( 69756 $author$project$UI$Components$spaLinkAttrs, 69757 $author$project$Route$toPath($author$project$Route$NewGroup), 69758 ctx.oO($author$project$Route$NewGroup)), 69759 { 69760 i6: $author$project$Translations$homeNewGroup(i18n), 69761 e7: ctx.oO($author$project$Route$NewGroup) 69762 }) 69763 ])); 69764 }; 69765 return A2( 69766 $author$project$Ui$column, 69767 _List_fromArray( 69768 [ 69769 $author$project$Ui$spacing($author$project$UI$Theme$spacing.i8), 69770 $author$project$Ui$width($author$project$Ui$fill), 69771 $author$project$Ui$height($author$project$Ui$fill) 69772 ]), 69773 _List_fromArray( 69774 [ 69775 $author$project$Page$Home$homeHeader(i18n), 69776 function () { 69777 var _v1 = ctx.nW; 69778 if (!_v1.$) { 69779 var targetName = _v1.a.kA; 69780 var onOpen = _v1.a.jw; 69781 return $author$project$Page$Home$migrationBanner( 69782 { 69783 f4: $author$project$Translations$homeMigrationBannerCta(i18n), 69784 dv: A2($author$project$Translations$homeMigrationBanner, targetName, i18n), 69785 e7: onOpen 69786 }); 69787 } else { 69788 return $author$project$Ui$none; 69789 } 69790 }(), 69791 function () { 69792 var _v2 = ctx.nV; 69793 if (!_v2.$) { 69794 var sourceName = _v2.a.ko; 69795 var onOpen = _v2.a.jw; 69796 return $author$project$Page$Home$migrationBanner( 69797 { 69798 f4: $author$project$Translations$homeMovingInBannerCta(i18n), 69799 dv: A2($author$project$Translations$homeMovingInBanner, sourceName, i18n), 69800 e7: onOpen 69801 }); 69802 } else { 69803 return $author$project$Ui$none; 69804 } 69805 }(), 69806 A2($author$project$Page$Home$notifSection, i18n, ctx), 69807 function () { 69808 var _v3 = data.bo; 69809 if (!_v3.$) { 69810 var error = _v3.a; 69811 return $author$project$Page$Home$errorBanner(error); 69812 } else { 69813 return $author$project$Ui$none; 69814 } 69815 }(), 69816 function () { 69817 var _v4 = data.cy; 69818 if (!_v4.$) { 69819 var error = _v4.a; 69820 return $author$project$Page$Home$errorBanner(error); 69821 } else { 69822 return $author$project$Ui$none; 69823 } 69824 }(), 69825 function () { 69826 if ($elm$core$List$isEmpty(groups)) { 69827 return A2( 69828 $author$project$Ui$column, 69829 _List_fromArray( 69830 [ 69831 $author$project$Ui$spacing($author$project$UI$Theme$spacing.i8) 69832 ]), 69833 _List_fromArray( 69834 [ 69835 A2( 69836 $author$project$Ui$el, 69837 _List_fromArray( 69838 [ 69839 $author$project$Ui$Font$size($author$project$UI$Theme$font.aW), 69840 $author$project$Ui$Font$color($author$project$UI$Theme$base.qI), 69841 $author$project$Ui$centerX 69842 ]), 69843 $author$project$Ui$text( 69844 $author$project$Translations$homeNoGroups(i18n))), 69845 groupActions(_List_Nil) 69846 ])); 69847 } else { 69848 var _v5 = A2( 69849 $elm$core$List$partition, 69850 function (g) { 69851 return !g.gA; 69852 }, 69853 groups); 69854 var activeGroups = _v5.a; 69855 var archivedGroups = _v5.b; 69856 var archivedSection = $elm$core$List$isEmpty(archivedGroups) ? $author$project$Ui$none : A2( 69857 $author$project$Ui$column, 69858 _List_fromArray( 69859 [ 69860 $author$project$Ui$paddingTop($author$project$UI$Theme$spacing.i8), 69861 $author$project$Ui$spacing($author$project$UI$Theme$spacing.bb) 69862 ]), 69863 _List_fromArray( 69864 [
69865 $author$project$UI$Components$expandTrigger( 69866 { 69867 ns: data.dO, 69868 i6: $author$project$Translations$homeArchivedGroups(i18n) + (' (' + ($elm$core$String$fromInt( 69869 $elm$core$List$length(archivedGroups)) + ')')), 69870 e7: toMsg($author$project$Page$Home$ToggleShowArchived) 69871 }), 69872 data.dO ? A2( 69873 $author$project$Ui$column, 69874 _List_fromArray( 69875 [ 69876 $author$project$Ui$spacing($author$project$UI$Theme$spacing.qk), 69877 $author$project$Ui$width($author$project$Ui$fill), 69878 $author$project$Ui$opacity(0.7) 69879 ]), 69880 A2( 69881 $elm$core$List$map, 69882 A2($author$project$Page$Home$groupCard, i18n, ctx), 69883 archivedGroups)) : $author$project$Ui$none 69884 ])); 69885 return A2( 69886 $author$project$Ui$column, 69887 _List_Nil, 69888 _List_fromArray( 69889 [ 69890 $author$project$UI$Components$sectionLabel( 69891 $author$project$Translations$homeYourGroups(i18n) + (' (' + ($elm$core$String$fromInt( 69892 $elm$core$List$length(activeGroups)) + ')'))), 69893 A2( 69894 $author$project$Ui$column, 69895 _List_fromArray( 69896 [ 69897 $author$project$Ui$spacing($author$project$UI$Theme$spacing.qk), 69898 $author$project$Ui$width($author$project$Ui$fill) 69899 ]), 69900 A2( 69901 $elm$core$List$map, 69902 A2($author$project$Page$Home$groupCard, i18n, ctx), 69903 activeGroups)), 69904 archivedSection, 69905 groupActions( 69906 _List_fromArray( 69907 [ 69908 $author$project$Ui$paddingTop($author$project$UI$Theme$spacing.i8) 69909 ])) 69910 ])); 69911 } 69912 }(), 69913 A2($author$project$Page$Home$footer, i18n, ctx.oO) 69914 ])); 69915 }); 69916var $author$project$Page$ImportSplitwise$InputGroupName = function (a) { 69917 return {$: 0, a: a}; 69918}; 69919var $author$project$Page$ImportSplitwise$Submit = {$: 7}; 69920var $author$project$Page$ImportSplitwise$SelectCurrency = function (a) { 69921 return {$: 4, a: a}; 69922}; 69923var $author$project$Translations$splitwiseImportDefaultCurrencyLabel = function (_v0) { 69924 var lang = _v0; 69925 if (!lang) { 69926 return 'Default currency'; 69927 } else { 69928 return 'Devise par défaut'; 69929 } 69930}; 69931var $author$project$Page$ImportSplitwise$currencyField = F2( 69932 function (i18n, data) { 69933 return A2( 69934 $author$project$Ui$column, 69935 _List_fromArray( 69936 [ 69937 $author$project$Ui$spacing($author$project$UI$Theme$spacing.qk), 69938 $author$project$Ui$width($author$project$Ui$fill) 69939 ]), 69940 _List_fromArray( 69941 [ 69942 A2( 69943 $author$project$UI$Components$formLabel, 69944 $author$project$Translations$splitwiseImportDefaultCurrencyLabel(i18n), 69945 true), 69946 A2( 69947 $author$project$Ui$row, 69948 _List_fromArray( 69949 [ 69950 $author$project$Ui$wrap, 69951 $author$project$Ui$spacing($author$project$UI$Theme$spacing.bb) 69952 ]), 69953 A2( 69954 $elm$core$List$map, 69955 function (c) { 69956 return $author$project$UI$Components$chip( 69957 { 69958 i6: $author$project$Domain$Currency$currencyCode(c), 69959 e7: $author$project$Page$ImportSplitwise$SelectCurrency(c), 69960 hj: _Utils_eq(data.il, c) 69961 }); 69962 }, 69963 $author$project$SplitwiseImport$usedCurrencies(data.g2))) 69964 ])); 69965 }); 69966var $author$project$Page$ImportSplitwise$InputNewMemberName = function (a) { 69967 return {$: 3, a: a}; 69968}; 69969var $author$project$Page$ImportSplitwise$SelectNewMember = {$: 2}; 69970var $author$project$Page$ImportSplitwise$SelectClaim = function (a) { 69971 return {$: 1, a: a}; 69972}; 69973var $author$project$Page$ImportSplitwise$memberToggle = F3( 69974 function (identity, index, name) { 69975 return $author$project$UI$Components$togglePill( 69976 { 69977 gv: $elm$core$Maybe$Nothing, 69978 i6: name, 69979 e7: $author$project$Page$ImportSplitwise$SelectClaim(index), 69980 hj: _Utils_eq( 69981 identity, 69982 $author$project$Page$ImportSplitwise$ClaimMember(index)) 69983 }); 69984 }); 69985var $author$project$Page$ImportSplitwise$identitySection = F2( 69986 function (i18n, data) { 69987 var isNew = _Utils_eq(data.O, $author$project$Page$ImportSplitwise$NewMember); 69988 return A2( 69989 $author$project$Ui$column, 69990 _List_fromArray( 69991 [ 69992 $author$project$Ui$spacing($author$project$UI$Theme$spacing.i8), 69993 $author$project$Ui$width($author$project$Ui$fill) 69994 ]), 69995 _List_fromArray( 69996 [ 69997 A2( 69998 $author$project$Ui$column, 69999 _List_fromArray( 70000 [ 70001 $author$project$Ui$spacing($author$project$UI$Theme$spacing.qk), 70002 $author$project$Ui$width($author$project$Ui$fill) 70003 ]), 70004 _List_fromArray( 70005 [ 70006 $author$project$UI$Components$sectionLabel( 70007 $author$project$Translations$joinGroupClaimMember(i18n)), 70008 A2( 70009 $author$project$Ui$row, 70010 _List_fromArray( 70011 [ 70012 $author$project$Ui$wrap, 70013 $author$project$Ui$spacing($author$project$UI$Theme$spacing.qk) 70014 ]), 70015 A2( 70016 $elm$core$List$indexedMap, 70017 $author$project$Page$ImportSplitwise$memberToggle(data.O), 70018 data.g2.nK)) 70019 ])), 70020 A2( 70021 $author$project$Ui$column, 70022 _List_fromArray( 70023 [ 70024 $author$project$Ui$spacing($author$project$UI$Theme$spacing.qk), 70025 $author$project$Ui$width($author$project$Ui$fill) 70026 ]), 70027 _List_fromArray( 70028 [ 70029 $author$project$UI$Components$togglePill( 70030 { 70031 gv: $elm$core$Maybe$Just($feathericons$elm_feather$FeatherIcons$plus), 70032 i6: $author$project$Translations$joinGroupJoinAsNew(i18n), 70033 e7: $author$project$Page$ImportSplitwise$SelectNewMember, 70034 hj: isNew 70035 }), 70036 function () { 70037 if (isNew) { 70038 var trimmed = $elm$core$String$trim(data.n0); 70039 var clashes = A2( 70040 $elm$core$List$any, 70041 function (m) { 70042 return _Utils_eq( 70043 $elm$core$String$toLower(m), 70044 $elm$core$String$toLower(trimmed)); 70045 }, 70046 data.g2.nK); 70047 return A2( 70048 $author$project$Ui$column, 70049 _List_fromArray( 70050 [ 70051 $author$project$Ui$paddingTop($author$project$UI$Theme$spacing.bb), 70052 $author$project$Ui$spacing($author$project$UI$Theme$spacing.bb), 70053 $author$project$Ui$width($author$project$Ui$fill) 70054 ]), 70055 _List_fromArray( 70056 [ 70057 A2( 70058 $author$project$UI$Components$formLabel, 70059 $author$project$Translations$joinGroupNameLabel(i18n), 70060 true), 70061 A2( 70062 $author$project$Ui$Input$text, 70063 _List_fromArray( 70064 [ 70065 $author$project$Ui$width($author$project$Ui$fill), 70066 $author$project$Ui$padding($author$project$UI$Theme$spacing.qk), 70067 $author$project$Ui$rounded($author$project$UI$Theme$radiu
70067s.qk), 70068 $author$project$Ui$border($author$project$UI$Theme$border), 70069 $author$project$Ui$borderColor($author$project$UI$Theme$base.k3) 70070 ]), 70071 { 70072 i6: $author$project$Ui$Input$labelHidden( 70073 $author$project$Translations$joinGroupNameLabel(i18n)), 70074 oq: $author$project$Page$ImportSplitwise$InputNewMemberName, 70075 pt: $elm$core$Maybe$Just( 70076 $author$project$Translations$joinGroupNamePlaceholder(i18n)), 70077 qI: data.n0 70078 }), 70079 (clashes && (!$elm$core$String$isEmpty(trimmed))) ? A2( 70080 $author$project$Ui$el, 70081 _List_fromArray( 70082 [ 70083 $author$project$Ui$Font$size($author$project$UI$Theme$font.qk), 70084 $author$project$Ui$Font$color($author$project$UI$Theme$danger.qI) 70085 ]), 70086 $author$project$Ui$text( 70087 $author$project$Translations$joinGroupNameTaken(i18n))) : ((data.d_ && $elm$core$String$isEmpty(trimmed)) ? A2( 70088 $author$project$Ui$el, 70089 _List_fromArray( 70090 [ 70091 $author$project$Ui$Font$size($author$project$UI$Theme$font.qk), 70092 $author$project$Ui$Font$color($author$project$UI$Theme$danger.qI) 70093 ]), 70094 $author$project$Ui$text( 70095 $author$project$Translations$fieldRequired(i18n))) : $author$project$Ui$none) 70096 ])); 70097 } else { 70098 return $author$project$Ui$none; 70099 } 70100 }() 70101 ])) 70102 ])); 70103 }); 70104var $author$project$Translations$splitwiseImportPreview = F2( 70105 function (data, _v0) { 70106 var lang = _v0; 70107 if (!lang) { 70108 return data.q_ + (' transactions · ' + (data.r + ' members')); 70109 } else { 70110 return data.q_ + (' transactions · ' + (data.r + ' membres')); 70111 } 70112 }); 70113var $author$project$Translations$splitwiseImportSkipped = F2( 70114 function (count, _v0) { 70115 var lang = _v0; 70116 if (!lang) { 70117 return count + ' rows couldn\'t be read and were skipped.'; 70118 } else { 70119 return count + ' lignes illisibles ont été ignorées.'; 70120 } 70121 }); 70122var $author$project$Page$ImportSplitwise$previewCard = F2( 70123 function (i18n, data) { 70124 return A2( 70125 $author$project$UI$Components$card, 70126 _List_fromArray( 70127 [ 70128 $author$project$Ui$padding($author$project$UI$Theme$spacing.i8) 70129 ]), 70130 A2( 70131 $elm$core$List$cons, 70132 A2( 70133 $author$project$Ui$el, 70134 _List_fromArray( 70135 [ 70136 $author$project$Ui$Font$size($author$project$UI$Theme$font.qk), 70137 $author$project$Ui$Font$color($author$project$UI$Theme$base.aM) 70138 ]), 70139 $author$project$Ui$text( 70140 A2( 70141 $author$project$Translations$splitwiseImportPreview, 70142 { 70143 r: $elm$core$String$fromInt( 70144 $elm$core$List$length(data.g2.nK)), 70145 q_: $elm$core$String$fromInt( 70146 $elm$core$List$length(data.g2.p$)) 70147 }, 70148 i18n))), 70149 (data.g2.qg > 0) ? _List_fromArray( 70150 [ 70151 A2( 70152 $author$project$Ui$el, 70153 _List_fromArray( 70154 [ 70155 $author$project$Ui$Font$size($author$project$UI$Theme$font.qk), 70156 $author$project$Ui$Font$color($author$project$UI$Theme$warning.qI), 70157 $author$project$Ui$paddingTop($author$project$UI$Theme$spacing.bb) 70158 ]), 70159 $author$project$Ui$text( 70160 A2( 70161 $author$project$Translations$splitwiseImportSkipped, 70162 $elm$core$String$fromInt(data.g2.qg), 70163 i18n))) 70164 ]) : _List_Nil)); 70165 }); 70166var $author$project$Page$ImportSplitwise$FetchRate = function (a) { 70167 return {$: 6, a: a}; 70168}; 70169var $author$project$Page$ImportSplitwise$InputRate = F2( 70170 function (a, b) { 70171 return {$: 5, a: a, b: b}; 70172 }); 70173var $author$project$Page$ImportSplitwise$rateRow = F3( 70174 function (i18n, data, currency) { 70175 var code = $author$project$Domain$Currency$currencyCode(currency); 70176 var status = A2( 70177 $elm$core$Maybe$withDefault, 70178 0, 70179 A2($elm$core$Dict$get, code, data.bx)); 70180 return A2( 70181 $author$project$Ui$column, 70182 _List_fromArray( 70183 [ 70184 $author$project$Ui$spacing($author$project$UI$Theme$spacing.bb), 70185 $author$project$Ui$width($author$project$Ui$fill) 70186 ]), 70187 _List_fromArray( 70188 [ 70189 A2( 70190 $author$project$Ui$row, 70191 _List_fromArray( 70192 [ 70193 $author$project$Ui$spacing($author$project$UI$Theme$spacing.qk), 70194 $author$project$Ui$width($author$project$Ui$fill), 70195 $author$project$Ui$contentCenterY 70196 ]), 70197 _List_fromArray( 70198 [ 70199 A2( 70200 $author$project$Ui$el, 70201 _List_fromArray( 70202 [ 70203 $author$project$Ui$Font$size($author$project$UI$Theme$font.qk), 70204 $author$project$Ui$width($author$project$Ui$shrink) 70205 ]), 70206 $author$project$Ui$text('1 ' + (code + ' ='))), 70207 A2( 70208 $author$project$Ui$Input$text, 70209 _List_fromArray( 70210 [ 70211 $author$project$Ui$width($author$project$Ui$fill), 70212 $author$project$Ui$padding($author$project$UI$Theme$spacing.qk), 70213 $author$project$Ui$rounded($author$project$UI$Theme$radiu
70213s.qk), 70214 $author$project$Ui$border($author$project$UI$Theme$border), 70215 $author$project$Ui$borderColor($author$project$UI$Theme$base.k3) 70216 ]), 70217 { 70218 i6: $author$project$Ui$Input$labelHidden(code), 70219 oq: $author$project$Page$ImportSplitwise$InputRate(currency), 70220 pt: $elm$core$Maybe$Just('1.00'), 70221 qI: A2( 70222 $elm$core$Maybe$withDefault, 70223 '', 70224 A2($elm$core$Dict$get, code, data.a$)) 70225 }), 70226 A2( 70227 $author$project$Ui$el, 70228 _List_fromArray( 70229 [ 70230 $author$project$Ui$Font$size($author$project$UI$Theme$font.qk), 70231 $author$project$Ui$width($author$project$Ui$shrink) 70232 ]), 70233 $author$project$Ui$text( 70234 $author$project$Domain$Currency$currencyCode(data.il))), 70235 A2( 70236 $author$project$UI$Components$btnOutline, 70237 _List_fromArray( 70238 [ 70239 $author$project$Ui$width($author$project$Ui$shrink), 70240 A2($author$project$Ui$paddingXY, $author$project$UI$Theme$spacing.aW, $author$project$UI$Theme$spacing.qk) 70241 ]), 70242 { 70243 gv: $elm$core$Maybe$Nothing, 70244 i6: (status === 1) ? $author$project$Translations$newEntryFetchingRate(i18n) : $author$project$Translations$newEntryFetchRate(i18n), 70245 e7: $author$project$Page$ImportSplitwise$FetchRate(currency) 70246 }) 70247 ])), 70248 function () { 70249 if (status === 2) { 70250 return A2( 70251 $author$project$Ui$el, 70252 _List_fromArray( 70253 [ 70254 $author$project$Ui$Font$size($author$project$UI$Theme$font.qk), 70255 $author$project$Ui$Font$color($author$project$UI$Theme$danger.qI) 70256 ]), 70257 $author$project$Ui$text( 70258 $author$project$Translations$newEntryRateError(i18n))); 70259 } else { 70260 var invalid = data.d_ && _Utils_eq( 70261 $elm$core$Maybe$Nothing, 70262 A2( 70263 $elm$core$Maybe$andThen, 70264 $author$project$Page$ImportSplitwise$parseRate, 70265 A2($elm$core$Dict$get, code, data.a$))); 70266 return invalid ? A2( 70267 $author$project$Ui$el, 70268 _List_fromArray( 70269 [ 70270 $author$project$Ui$Font$size($author$project$UI$Theme$font.qk), 70271 $author$project$Ui$Font$color($author$project$UI$Theme$danger.qI) 70272 ]), 70273 $author$project$Ui$text( 70274 $author$project$Translations$fieldRequired(i18n))) : $author$project$Ui$none; 70275 } 70276 }() 70277 ])); 70278 }); 70279var $author$project$Translations$splitwiseImportRatesHint = function (_v0) { 70280 var lang = _v0; 70281 if (!lang) { 70282 return 'Splitwise tracks each currency separately. Pick one rate per other currency to convert balances into the default currency.'; 70283 } else { 70284 return 'Splitwise suit chaque devise séparément. Choisis un taux par autre devise pour convertir les s
70284oldes dans la devise par défaut.'; 70285 } 70286}; 70287var $author$project$Translations$splitwiseImportRatesLabel = function (_v0) { 70288 var lang = _v0; 70289 if (!lang) { 70290 return 'Conversion rates'; 70291 } else { 70292 return 'Taux de conversion'; 70293 } 70294}; 70295var $author$project$Page$ImportSplitwise$ratesSection = F2( 70296 function (i18n, data) { 70297 var _v0 = $author$project$Page$ImportSplitwise$otherCurrencies(data); 70298 if (!_v0.b) { 70299 return $author$project$Ui$none; 70300 } else { 70301 var others = _v0; 70302 return A2( 70303 $author$project$Ui$column, 70304 _List_fromArray( 70305 [ 70306 $author$project$Ui$spacing($author$project$UI$Theme$spacing.qk), 70307 $author$project$Ui$width($author$project$Ui$fill) 70308 ]), 70309 A2( 70310 $elm$core$List$cons, 70311 A2( 70312 $author$project$UI$Components$formLabel, 70313 $author$project$Translations$splitwiseImportRatesLabel(i18n), 70314 true), 70315 A2( 70316 $elm$core$List$cons, 70317 A2( 70318 $author$project$Ui$el, 70319 _List_fromArray( 70320 [ 70321 $author$project$Ui$Font$size($author$project$UI$Theme$font.qk), 70322 $author$project$Ui$Font$color($author$project$UI$Theme$base.aM) 70323 ]), 70324 $author$project$Ui$text( 70325 $author$project$Translations$splitwiseImportRatesHint(i18n))), 70326 A2( 70327 $elm$core$List$map, 70328 A2($author$project$Page$ImportSplitwise$rateRow, i18n, data), 70329 others)))); 70330 } 70331 }); 70332var $author$project$Translations$splitwiseImportHint = function (_v0) { 70333 var lang = _v0; 70334 if (!lang) { 70335 return 'Review the details below, then create the group.'; 70336 } else { 70337 return 'Vérifie les détails ci-dessous, puis crée le groupe.'; 70338 } 70339}; 70340var $author$project$Translations$splitwiseImportNameLabel = function (_v0) { 70341 var lang = _v0; 70342 if (!lang) { 70343 return 'Group name'; 70344 } else { 70345 return 'Nom du groupe'; 70346 } 70347}; 70348var $author$project$Translations$splitwiseImportNamePlaceholder = function (_v0) { 70349 var lang = _v0; 70350 if (!lang) { 70351 return 'e.g. Trip to London'; 70352 } else { 70353 return 'ex. Voyage à Londres'; 70354 } 70355}; 70356var $author$project$Translations$splitwiseImportSubmit = function (_v0) { 70357 var lang = _v0; 70358 if (!lang) { 70359 return 'Create group'; 70360 } else { 70361 return 'Créer le groupe'; 70362 } 70363}; 70364var $author$project$Page$ImportSplitwise$textField = F6( 70365 function (i18n, label, placeholder, value, onChange, showError) { 70366 return A2( 70367 $author$project$Ui$column, 70368 _List_fromArray( 70369 [ 70370 $author$project$Ui$spacing($author$project$UI$Theme$spacing.bb), 70371 $author$project$Ui$width($author$project$Ui$fill) 70372 ]), 70373 _List_fromArray( 70374 [ 70375 A2($author$project$UI$Components$formLabel, label, true), 70376 A2( 70377 $author$project$Ui$Input$text, 70378 _List_fromArray( 70379 [ 70380 $author$project$Ui$width($author$project$Ui$fill), 70381 $author$project$Ui$padding($author$project$UI$Theme$spacing.qk), 70382 $author$project$Ui$rounded($author$project$UI$Theme$radius.qk), 70383 $author$project$Ui$border($author$project$UI$Theme$border), 70384 $author$project$Ui$borderColor($author$project$UI$Theme$base.k3) 70385 ]), 70386 { 70387 i6: $author$project$Ui$Input$labelHidden(label), 70388 oq: onChange, 70389 pt: $elm$core$Maybe$Just(placeholder), 70390 qI: value 70391 }), 70392 showError ? A2( 70393 $author$project$Ui$el, 70394 _List_fromArray( 70395 [ 70396 $author$project$Ui$Font$size($author$project$UI$Theme$font.qk), 70397 $author$project$Ui$Font$color($author$project$UI$Theme$danger.qI) 70398 ]), 70399 $author$project$Ui$text( 70400 $author$project$Translations$fieldRequired(i18n))) : $author$project$Ui$none 70401 ])); 70402 }); 70403var $author$project$Page$ImportSplitwise$view = F3( 70404 function (i18n, toMsg, _v0) { 70405 var data = _v0; 70406 return A2( 70407 $author$project$Ui$map, 70408 toMsg, 70409 A2( 70410 $author$project$Ui$column, 70411 _List_fromArray( 70412 [ 70413 $author$project$Ui$spacing($author$project$UI$Theme$spacing.i8), 70414 $author$project$Ui$width($author$project$Ui$fill) 70415 ]), 70416 _List_fromArray( 70417 [ 70418 A2( 70419 $author$project$Ui$el, 70420 _List_fromArray( 70421 [ 70422 $author$project$Ui$Font$size($author$project$UI$Theme$font.qk), 70423 $author$project$Ui$Font$color($author$project$UI$Theme$base.aM), 70424 $author$project$Ui$width($author$project$Ui$fill) 70425 ]), 70426 $author$project$Ui$text( 70427 $author$project$Translations$splitwiseImportHint(i18n))), 70428 A2($author$project$Page$ImportSplitwise$previewCard, i18n, data), 70429 A6( 70430 $author$project$Page$ImportSplitwise$textField, 70431 i18n, 70432 $author$project$Translations$splitwiseImportNameLabel(i18n), 70433 $author$project$Translations$splitwiseImportNamePlaceholder(i18n), 70434 data.iP, 70435 $author$project$Page$ImportSplitwise$InputGroupName, 70436 data.d_ && $elm$core$String$isEmpty( 70437 $elm$core$String$trim(data.iP))), 70438 A2($author$project$Page$ImportSplitwise$identitySection, i18n, data), 70439 A2($author$project$Page$ImportSplitwise$currencyField, i18n, data), 70440 A2($author$project$Page$ImportSplitwise$ratesSection, i18n, data), 70441 A2( 70442 $author$project$UI$Components$btnPrimary, 70443 _List_Nil, 70444 { 70445 i6: $author$project$Translations$splitwiseImportSubmit(i18n), 70446 e7: $author$project$Page$ImportSplitwise$Submit 70447 }) 70448 ]))); 70449 }); 70450var $author$project$Translations$joinGroupError = function (_v0) { 70451 var lang = _v0; 70452 if (!lang) { 70453 return 'Failed to load group'; 70454 } else { 70455 return 'Ãchec du chargement du groupe'; 70456 } 70457}; 70458var $author$project$Translations$joinGroupFetching = function (_v0) { 70459 var lang = _v0; 70460 if (!lang) { 70461 return 'Loading group...'; 70462 } else { 70463 return 'Chargement du groupe...'; 70464 } 70465}; 70466var $author$project$Translations$joinGroupGoHome = function (_v0) { 70467 var lang = _v0; 70468 if (!lang) { 70469 return 'Go home'; 70470 } else { 70471 return 'Accueil'; 70472 } 70473}; 70474var $author$project$Page$JoinGroup$view = F3( 70475 function (i18n, config, model) { 70476 var languageSelector = A2( 70477 $author$project$Ui$el, 70478 _List_fromArray( 70479 [$author$project$Ui$centerX]), 70480 A2( 70481 $author$project$UI$Components$languageSelector, 70482 config.gY, 70483 $author$project$Translations$currentLanguage(i18n))); 70484 var errorActions = function () { 70485 if (model.$ === 3) { 70486 return _List_fromArray( 70487 [ 70488 A2( 70489 $author$project$Ui$row, 70490 _List_fromArray( 70491 [ 70492 $author$project$Ui$centerX, 70493 $author$project$Ui$spacing($author$project$UI$Theme$spacing.qk) 70494 ]), 70495 _List_fromArray( 70496 [ 70497 A2( 70498 $author$project$UI$Components$btnPrimary, 70499 _List_fromArray( 70500 [ 70501 $author$project$Ui$width($author$project$Ui$shrink) 70502 ]), 70503 { 70504 i6: $author$project$Translations$joinGroupRetry(i18n), 70505 e7: config.o_ 70506 }), 70507 A2( 70508 $author$project$UI$Components$btnOutline, 70509 _List_fromArray( 70510 [ 70511 $author$project$Ui$width($author$project$Ui$shrink) 70512 ]), 70513 { 70514 gv: $elm$core$Maybe$Nothing, 70515 i6: $author$project$Translations$joinGroupGoHome(i18n), 70516 e7: config.jv 70517 }) 70518 ])) 70519 ]); 70520 } else { 70521 return _List_Nil; 70522 } 70523 }(); 70524 var content = function () { 70525 switch (model.$) { 70526 case 0: 70527 return _List_fromArray( 70528 [ 70529 A2( 70530 $author$project$Ui$el, 70531 _List_fromArray( 70532 [ 70533 $author$project$Ui$centerX, 70534 $author$project$Ui$Font$size($author$project$UI$Theme$font.aW), 70535 $author$project$Ui$Font$color($author$project$UI$Theme$base.aM) 70536 ]), 70537 $author$project$Ui$text( 70538 $author$project$Translations$joinGroupFetching(i18n))) 70539 ]); 70540 case 3: 70541 var errorMsg = model.a; 70542 return _List_fromArray( 70543 [ 70544 A2( 70545 $author$project$UI$Components$card, 70546 _List_fromArray( 70547 [ 70548 $author$project$Ui$padding($author$project$UI$Theme$spacing.i8) 70549 ]), 70550 _List_fromArray( 70551 [ 70552 A2( 70553 $author$project$Ui$column, 70554 _List_fromArray( 70555 [ 70556 $author$project$Ui$spacing($author$project$UI$Theme$spacing.qk) 70557 ]), 70558 _List_fromArray( 70559 [ 70560 A2( 70561 $author$project$Ui$el, 70562 _List_fromArray( 70563 [ 70564 $author$project$Ui$centerX, 70565 $author$project$Ui$Font$size($author$project$UI$Theme$font.aW), 70566 $author$project$Ui$Font$color($author$project$UI$Theme$danger.qI), 70567 $author$project$Ui$Font$weight($author$project$UI$Theme$fontWeight.dL) 70568 ]), 70569 $author$project$Ui$text( 70570 $author$project$Translations$joinGroupError(i18n))), 70571 A2( 70572 $author$project$Ui$el, 70573 _List_fromArray( 70574 [ 70575 $author$project$Ui$centerX, 70576 $author$project$Ui$Font$size($author$project$UI$Theme$font.qk), 70577 $author$project$Ui$Font$color($author$project$UI$Theme$base.aM) 70578 ]), 70579 $author$project$Ui$text(errorMsg)) 70580 ])) 70581 ])) 70582 ]); 70583 case 1: 70584 var preview = model.a; 70585 return A2($author$project$Page$JoinGroup$viewPreview, i18n, preview); 70586 default: 70587 var preview = model.a; 70588 return A2($author$project$Page$JoinGroup$viewPreview, i18n, preview); 70589 } 70590 }(); 70591 var _v0 = function () { 70592 var _v1 = $author$project$Page$JoinGroup$getPreview(model); 70593 if (!_v1.$) { 70594 var preview = _v1.a; 70595 return _Utils_Tuple2( 70596 _List_fromArray( 70597 [ 70598 $author$project$Page$JoinGroup$viewGroupName(preview), 70599 languageSelector 70600 ]), 70601 _List_Nil); 70602 } else { 70603 return _Utils_Tuple2( 70604 _List_Nil, 70605 _List_fromArray( 70606 [languageSelector])); 70607 } 70608 }(); 70609 var header = _v0.a; 70610 var footer = _v0.b; 70611 return A2( 70612 $author$project$Ui$column, 70613 _List_fromArray( 70614 [ 70615 $author$project$Ui$spacing($author$project$UI$Theme$spacing.hE) 70616 ]), 70617 _Utils_ap( 70618 header, 70619 _Utils_ap( 70620 A2( 70621 $elm$core$List$map, 70622 $author$project$Ui$map(config.d3), 70623 content), 70624 _Utils_ap(errorActions, footer)))); 70625 }); 70626var $author$project$Page$Move$Start = {$: 1}; 70627var $author$project$Page$Move$ToggleGroup = function (a) { 70628 return {$: 0, a: a}; 70629}; 70630var $author$project$Page$Move$hint = function (text) { 70631 return A2( 70632 $author$project$Ui$el, 70633 _List_fromArray( 70634 [ 70635 $author$project$Ui$Font$size($author$project$UI$Theme$font.qk), 70636 $author$project$Ui$Font$color($author$project$UI$Theme$base.aM), 70637 $author$project$Ui$width($author$project$Ui$fill) 70638 ]), 70639 $author$project$Ui$text(text)); 70640}; 70641var $author$project$Translations$moveArchivedHint = function (_v0) { 70642 var lang = _v0; 70643 if (!lang) { 70644 return 'Archived groups can come too:'; 70645 } else { 70646 return 'Les groupes archivés peuvent venir aussi :'; 70647 } 70648}; 70649var $author$project$Translations$moveNothingSelected = function (_v0) { 70650 var lang = _v0; 70651 if (!lang) { 70652 return 'Select at least one group to move.'; 70653 } else { 70654 return 'Sélectionne au moins un groupe à migrer.'; 70655 } 70656}; 70657var $author$project$Translations$movePickGroups = function (_v0) { 70658 var lang = _v0; 70659 if (!lang) { 70660 return 'Choose the groups to bring along. Each one is copied to the new home fully encrypted â its history, members, and balances travel with it. This app keeps working afterwards, but only on this device â it no longer syncs with the server, so make your changes in the new home.'; 70661 } else { 70662 return 'Choisis les groupes à emmener. Chacun est copié vers la nouvelle adresse, entièrement chiffré â son historique, ses membres et ses soldes voyagent avec lui. Cette app continue de fonctionner ensuite, mais seulement sur cet appareil â elle ne se synchronise plus avec le serveur, alors fais tes modifications à la nouvelle adresse.'; 70663 } 70664}; 70665var $author$project$Translations$moveStart = function (_v0) { 70666 var lang = _v0; 70667 if (!lang) { 70668 return 'Copy these groups over'; 70669 } else { 70670 return 'Copier ces groupes'; 70671 } 70672}; 70673var $author$project$Page$Move$viewChoosing = F3( 70674 function (i18n, groups, data) { 70675 var groupToggle = function (group) { 70676 return $author$project$UI$Components$togglePill( 70677 { 70678 gv: $elm$core$Maybe$Just($feathericons$elm_feather$FeatherIcons$check), 70679 i6: group.bW, 70680 e7: $author$project$Page$Move$ToggleGroup(group.m9), 70681 hj: A2($elm$core$List$member, group.m9, data.hj) 70682 }); 70683 }; 70684 var _v0 = A2( 70685 $elm$core$List$partition, 70686 function (g) { 70687 return !g.gA; 70688 }, 70689 groups); 70690 var activeGroups = _v0.a; 70691 var archivedGroups = _v0.b; 70692 return _List_fromArray( 70693 [ 70694 $author$project$Page$Move$hint( 70695 $author$project$Translations$movePickGroups(i18n)), 70696 A2( 70697 $author$project$Ui$column, 70698 _List_fromArray( 70699 [ 70700 $author$project$Ui$spacing($author$project$UI$Theme$spacing.qk), 70701 $author$project$Ui$width($author$project$Ui$fill) 70702 ]), 70703 A2($elm$core$List$map, groupToggle, activeGroups)), 70704 $elm$core$List$isEmpty(archivedGroups) ? $author$project$Ui$none : A2( 70705 $author$project$Ui$column, 70706 _List_fromArray( 70707 [ 70708 $author$project$Ui$spacing($author$project$UI$Theme$spacing.qk), 70709 $author$project$Ui$width($author$project$Ui$fill) 70710 ]), 70711 A2( 70712 $elm$core$List$cons, 70713 $author$project$Page$Move$hint( 70714 $author$project$Translations$moveArchivedHint(i18n)), 70715 A2($elm$core$List$map, groupToggle, archivedGroups))), 70716 $elm$core$List$isEmpty(data.hj) ? $author$project$Page$Move$hint( 70717 $author$project$Translations$moveNothingSelected(i18n)) : A2( 70718 $author$project$UI$Components$btnPrimary, 70719 _List_Nil, 70720 { 70721 i6: $author$project$Translations$moveStart(i18n), 70722 e7: $author$project$Page$Move$Start 70723 }) 70724 ]); 70725 }); 70726var $author$project$Page$Move$OpenTarget = {$: 3}; 70727var $author$project$Internal$Font$Monospace = {$: 2}; 70728var $author$project$Ui$Font$monospace = $author$project$Internal$Font$Monospace; 70729var $author$project$Internal$Model2$AsParagraph = 4; 70730var $author$project$Internal$Model2$NodeAsParagraph = {$: 3}; 70731var $author$project$Ui$Prose$paragraph = F2( 70732 function (attrs, children) { 70733 return A4( 70734 $author$project$Internal$Model2$element, 70735 $author$project$Internal$Model2$NodeAsParagraph, 70736 4, 70737 A2( 70738 $elm$core$List$cons, 70739 $author$project$Ui$width($author$project$Ui$fill), 70740 attrs), 70741 children); 70742 }); 70743var $author$project$Page$Move$codeBlock = function (payload) { 70744 return A2( 70745 $author$project$Ui$Prose$paragraph, 70746 _List_fromArray( 70747 [ 70748 $author$project$Ui$Font$size($author$project$UI$Theme$font.bb), 70749 $author$project$Ui$Font$family( 70750 _List_fromArray( 70751 [$author$project$Ui$Font$monospace])), 70752 $author$project$Ui$Font$color($author$project$UI$Theme$base.aM), 70753 $author$project$Ui$background($author$project$UI$Theme$base.qR), 70754 $author$project$Ui$padding($author$project$UI$Theme$spacing.aW),
70755 $author$project$Ui$rounded($author$project$UI$Theme$radius.qk), 70756 $author$project$Ui$border($author$project$UI$Theme$border), 70757 $author$project$Ui$borderColor($author$project$UI$Theme$base.k3), 70758 $author$project$Ui$height( 70759 $author$project$Ui$px(120)), 70760 $author$project$Ui$clip 70761 ]), 70762 _List_fromArray( 70763 [ 70764 $author$project$Ui$text(payload) 70765 ])); 70766}; 70767var $author$project$Page$Move$copyBtn = F2( 70768 function (copyText, label) { 70769 return A2( 70770 $author$project$Ui$row, 70771 A2( 70772 $elm$core$List$cons, 70773 $author$project$Ui$width($author$project$Ui$shrink), 70774 A2( 70775 $elm$core$List$cons, 70776 $author$project$Ui$inFront( 70777 A2( 70778 $author$project$Ui$el, 70779 _List_fromArray( 70780 [ 70781 $author$project$Ui$width($author$project$Ui$fill), 70782 $author$project$Ui$height($author$project$Ui$fill) 70783 ]), 70784 $author$project$Ui$html( 70785 A3( 70786 $elm$html$Html$node, 70787 'copy-button', 70788 _List_fromArray( 70789 [ 70790 A2($elm$html$Html$Attributes$attribute, 'data-copy', copyText), 70791 A2($elm$html$Html$Attributes$style, 'display', 'block'), 70792 A2($elm$html$Html$Attributes$style, 'width', '100%'), 70793 A2($elm$html$Html$Attributes$style, 'height', '100%'), 70794 A2($elm$html$Html$Attributes$style, 'cursor', 'pointer') 70795 ]), 70796 _List_Nil)))), 70797 $author$project$UI$Components$btnOutlineAttrs)), 70798 _List_fromArray( 70799 [ 70800 A2($author$project$UI$Components$featherIcon, 16, $feathericons$elm_feather$FeatherIcons$copy), 70801 $author$project$Ui$text(label) 70802 ])); 70803 }); 70804var $author$project$Translations$moveHandoffCodeHint = function (_v0) { 70805 var lang = _v0; 70806 if (!lang) { 70807 return 'If the button doesn\'t work, copy this migration code and paste it into the new app instead:'; 70808 } else { 70809 return 'Si le bouton ne fonctionne pas, copie ce code de migration et colle-le dans la nouvelle app :'; 70810 } 70811}; 70812var $author$project$Translations$moveHandoffCodeIos = F2( 70813 function (target, _v0) { 70814 var lang = _v0; 70815 if (!lang) { 70816 return 'Copy this migration code. Then open ' + (target + ', install Partage (Share â Add to Home Screen), and paste the code into the installed app:'); 70817 } else { 70818 return 'Copie ce code de migration. Ouvre ensuite ' + (target + ', installe Partage (Partager â Sur l\'écran d\'accueil), puis colle le code dans l\'app installée :'); 70819 } 70820 }); 70821var $author$project$Translations$moveHandoffCopy = function (_v0) { 70822 var lang = _v0; 70823 if (!lang) { 70824 return 'Copy the migration code'; 70825 } else { 70826 return 'Copier le code de migration'; 70827 } 70828}; 70829var $author$project$Translations$moveHandoffDelivered = function (_v0) { 70830 var lang = _v0; 70831 if (!lang) { 70832 return 'Profile sent â finish up in the tab that just opened.'; 70833 } else { 70834 return 'Profil envoyé â termine dans l\'onglet qui vient de s\'ouvrir.'; 70835 } 70836}; 70837var $author$project$Translations$moveHandoffInstall = F2( 70838 function (target, _v0) { 70839 var lang = _v0; 70840 if (!lang) { 70841 return 'Open ' + (target + ' to install'); 70842 } else { 70843 return 'Ouvrir ' + (target + ' pour l\'installer'); 70844 } 70845 }); 70846var $author$project$Translations$moveHandoffIntro = F2( 70847 function (target, _v0) { 70848 var lang = _v0; 70849 if (!lang) { 70850 return 'Last step: bring your profile â your identity and your groups\' keys â over to ' + (target + '.'); 70851 } else { 70852 return 'Dernière étape : emmène ton profil â ton identité et les clés de tes groupes â vers ' + (target + '.'); 70853 } 70854 }); 70855var $author$project$Translations$moveHandoffOpen = F2( 70856 function (target, _v0) { 70857 var lang = _v0; 70858 if (!lang) { 70859 return 'Continue on ' + target; 70860 } else { 70861 return 'Continuer sur ' + target; 70862 } 70863 }); 70864var $author$project$Page$Move$targetLink = F2( 70865 function (targetUrl, label) { 70866 return A2( 70867 $author$project$Ui$row, 70868 A2( 70869 $elm$core$List$cons, 70870 $author$project$Ui$linkNewTab(targetUrl), 70871 A2( 70872 $elm$core$List$cons, 70873 $author$project$Ui$width($author$project$Ui$shrink), 70874 $author$project$UI$Components$btnOutlineAttrs)), 70875 _List_fromArray( 70876 [ 70877 A2($author$project$UI$Components$featherIcon, 16, $feathericons$elm_feather$FeatherIcons$externalLink), 70878 $author$project$Ui$text(label) 70879 ])); 70880 }); 70881var $author$project$Page$Move$handoffSection = F6( 70882 function (i18n, targetName, targetUrl, codeOnly, delivered, payload) { 70883 return A2( 70884 $author$project$Ui$column, 70885 _List_fromArray( 70886 [ 70887 $author$project$Ui$spacing($author$project$UI$Theme$spacing.aW), 70888 $author$project$Ui$width($author$project$Ui$fill) 70889 ]), 70890 _List_fromArray( 70891 [ 70892 $author$project$Page$Move$hint( 70893 A2($author$project$Translations$moveHandoffIntro, targetName, i18n)), 70894 codeOnly ? $author$project$Ui$none : A2( 70895 $author$project$UI$Components$btnPrimary, 70896 _List_fromArray( 70897 [ 70898 $author$project$Ui$width($author$project$Ui$shrink) 70899 ]), 70900 { 70901 i6: A2($author$project$Translations$moveHandoffOpen, targetName, i18n), 70902 e7: $author$project$Page$Move$OpenTarget 70903 }), 70904 delivered ? A2( 70905 $author$project$Ui$el, 70906 _List_fromArray( 70907 [ 70908 $author$project$Ui$Font$size($author$project$UI$Theme$font.qk), 70909 $author$project$Ui$Font$color($author$project$UI$Theme$success.qI) 70910 ]), 70911 $author$project$Ui$text( 70912 $author$project$Translations$moveHandoffDelivered(i18n))) : $author$project$Ui$none, 70913 $author$project$Page$Move$hint( 70914 codeOnly ? A2($author$project$Translations$moveHandoffCodeIos, targetName, i18n) : $author$project$Translations$moveHandoffCodeHint(i18n)), 70915 $author$project$Page$Move$codeBlock(payload), 70916 A2( 70917 $author$project$Page$Move$copyBtn, 70918 payload, 70919 $author$project$Translations$moveHandoffCopy(i18n)), 70920 codeOnly ? A2( 70921 $author$project$Page$Move$targetLink, 70922 targetUrl, 70923 A2($author$project$Translations$moveHandoffInstall, targetName, i18n)) : $author$project$Ui$none 70924 ])); 70925 }); 70926var $author$project$Translations$moveAllSeeded = F2( 70927 function (target, _v0) { 70928 var lang = _v0; 70929 if (!lang) { 70930 return 'All done â these groups now live on ' + (target + '. Invite the other members to migrate too: this address is now read-only.'); 70931 } else { 70932 return 'C\'est fait â ces groupes vivent maintenant sur ' + (target + '. Invite les autres membres à migrer aussi : cette adresse est désormais en lecture seule.'); 70933 } 70934 }); 70935var $author$project$Translations$moveBuildingHandoff = function (_v0) { 70936 var lang = _v0; 70937 if (!lang) { 70938 return 'Preparing your profileâ¦'; 70939 } else { 70940 return 'Préparation de ton profilâ¦'; 70941 } 70942}; 70943var $feathericons$elm_feather$FeatherIcons$alertCircle = A2( 70944 $feathericons$elm_feather$FeatherIcons$makeBuilder, 70945 'alert-circle', 70946 _List_fromArray( 70947 [ 70948 A2( 70949 $elm$svg$Svg$circle, 70950 _List_fromArray( 70951 [ 70952 $elm$svg$Svg$Attributes$cx('12'), 70953 $elm$svg$Svg$Attributes$cy('12'), 70954 $elm$svg$Svg$Attributes$r('10') 70955 ]), 70956 _List_Nil), 70957 A2( 70958 $elm$svg$Svg$line, 70959 _List_fromArray( 70960 [ 70961 $elm$svg$Svg$Attributes$x1('12'), 70962 $elm$svg$Svg$Attributes$y1('8'), 70963 $elm$svg$Svg$Attributes$x2('12'), 70964 $elm$svg$Svg$Attributes$y2('12') 70965 ]), 70966 _List_Nil), 70967 A2( 70968 $elm$svg$Svg$line, 70969 _List_fromArray( 70970 [ 70971 $elm$svg$Svg$Attributes$x1('12'), 70972 $elm$svg$Svg$Attributes$y1('16'), 70973 $elm$svg$Svg$Attributes$x2('12.01'), 70974 $elm$svg$Svg$Attributes$y2('16') 70975 ]), 70976 _List_Nil) 70977 ])); 70978var $feathericons$elm_feather$FeatherIcons$clock = A2( 70979 $feathericons$elm_feather$FeatherIcons$makeBuilder, 70980 'clock', 70981 _List_fromArray( 70982 [ 70983 A2( 70984 $elm$svg$Svg$circle, 70985 _List_fromArray( 70986 [ 70987 $elm$svg$Svg$Attributes$cx('12'), 70988 $elm$svg$Svg$Attributes$cy('12'), 70989 $elm$svg$Svg$Attributes$r('10') 70990 ]), 70991 _List_Nil), 70992 A2( 70993 $elm$svg$Svg$polyline, 70994 _List_fromArray( 70995 [ 70996 $elm$svg$Svg$Attributes$points('12 6 12 12 16 14') 70997 ]), 70998 _List_Nil) 70999 ])); 71000var $author$project$Translations$moveStatusDone = function (_v0) { 71001 var lang = _v0; 71002 if (!lang) { 71003 return 'Copied'; 71004 } else { 71005 return 'Copié'; 71006 } 71007}; 71008var $author$project$Translations$moveStatusQueued = function (_v0) { 71009 var lang = _v0; 71010 if (!lang) { 71011 return 'Waiting'; 71012 } else { 71013 return 'En attente'; 71014 } 71015}; 71016var $author$project$Translations$moveStatusUploading = function (_v0) { 71017 var lang = _v0; 71018 if (!lang) { 71019 return 'Copyingâ¦'; 71020 } else { 71021 return 'Copieâ¦'; 71022 } 71023}; 71024var $feathericons$elm_feather$FeatherIcons$uploadCloud = A2( 71025 $feathericons$elm_feather$FeatherIcons$makeBuilder, 71026 'upload-cloud', 71027 _List_fromArray( 71028 [ 71029 A2( 71030 $elm$svg$Svg$polyline, 71031 _List_fromArray( 71032 [ 71033 $elm$svg$Svg$Attributes$points('16 16 12 12 8 16') 71034 ]), 71035 _List_Nil), 71036 A2( 71037 $elm$svg$Svg$line, 71038 _List_fromArray( 71039 [ 71040 $elm$svg$Svg$Attributes$x1('12'), 71041 $elm$svg$Svg$Attributes$y1('12'), 71042 $elm$svg$Svg$Attributes$x2('12'), 71043 $elm$svg$Svg$Attributes$y2('21') 71044 ]), 71045 _List_Nil), 71046 A2( 71047 $elm$svg$Svg$path, 71048 _List_fromArray( 71049 [ 71050 $elm$svg$Svg$Attributes$d('M20.39 18.39A5 5 0 0 0 18 9h-1.26A8 8 0 1 0 3 16.3') 71051 ]), 71052 _List_Nil), 71053 A2( 71054 $elm$svg$Svg$polyline, 71055 _List_fromArray( 71056 [ 71057 $elm$svg$Svg$Attributes$points('16 16 12 12 8 16') 71058 ]), 71059 _List_Nil) 71060 ])); 71061var $author$project$Page$Move$statusRow = F3( 71062 function (i18n, group, status) { 71063 var _v0 = function () { 71064 _v1$3: 71065 while (true) { 71066 if (!status.$) { 71067 switch (status.a.$) { 71068 case 1: 71069 var _v2 = status.a; 71070 return _Utils_Tuple3( 71071 $feathericons$elm_feather$FeatherIcons$uploadCloud, 71072 $author$project$Translations$moveStatusUploading(i18n), 71073 $author$project$UI$Theme$base.aM); 71074 case 2: 71075 var _v3 = status.a; 71076 return _Utils_Tuple3( 71077 $feathericons$elm_feather$FeatherIcons$checkCircle, 71078 $author$project$Translations$moveStatusDone(i18n), 71079 $author$project$UI$Theme$success.qI); 71080 case 3: 71081 var reason = status.a.a; 71082 return _Utils_Tuple3($feathericons$elm_feather$FeatherIcons$alertCircle, reason, $author$project$UI$Theme$danger.qI); 71083 default: 71084 break _v1$3; 71085 } 71086 } else { 71087 break _v1$3; 71088 } 71089 } 71090 return _Utils_Tuple3( 71091 $feathericons$elm_feather$FeatherIcons$clock, 71092 $author$project$Translations$moveStatusQueued(i18n), 71093 $author$project$UI$Theme$base.aM); 71094 }(); 71095 var icon = _v0.a; 71096 var text = _v0.b; 71097 var color = _v0.c; 71098 return A2( 71099 $author$project$UI$Components$card, 71100 _List_fromArray( 71101 [ 71102 $author$project$Ui$padding($author$project$UI$Theme$spacing.aW) 71103 ]), 71104 _List_fromArray( 71105 [ 71106 A2( 71107 $author$project$Ui$row, 71108 _List_fromArray( 71109 [ 71110 $author$project$Ui$spacing($author$project$UI$Theme$spacing.qk), 71111 $author$project$Ui$contentCenterY 71112 ]), 71113 _List_fromArray( 71114 [ 71115 A2( 71116 $author$project$Ui$el, 71117 _List_fromArray( 71118 [ 71119 $author$project$Ui$width($author$project$Ui$shrink) 71120 ]), 71121 A2($author$project$UI$Components$featherIcon, 16, icon)), 71122 A2( 71123 $author$project$Ui$el, 71124 _List_fromArray( 71125 [ 71126 $author$project$Ui$Font$size($author$project$UI$Theme$font.aW) 71127 ]), 71128 $author$project$Ui$text(group.bW)), 71129 A2( 71130 $author$project$Ui$el, 71131 _List_fromArray( 71132 [ 71133 $author$project$Ui$Font$size($author$project$UI$Theme$font.qk), 71134 $author$project$Ui$Font$color(color), 71135 $author$project$Ui$alignRight 71136 ]), 71137 $author$project$Ui$text(text)) 71138 ])) 71139 ])); 71140 }); 71141var $author$project$Page$Move$statusList = F3( 71142 function (i18n, data, selectedGroups) { 71143 return A2( 71144 $author$project$Ui$column, 71145 _List_fromArray( 71146 [ 71147 $author$project$Ui$spacing($author$project$UI$Theme$spacing.qk), 71148 $author$project$Ui$width($author$project$Ui$fill) 71149 ]), 71150 A2( 71151 $elm$core$List$map, 71152 function (group) { 71153 return A3( 71154 $author$project$Page$Move$statusRow, 71155 i18n, 71156 group, 71157 A2($elm$core$Dict$get, group.m9, data.ag)); 71158 }, 71159 selectedGroups)); 71160 }); 71161var $author$project$Page$Move$viewDone = F6( 71162 function (i18n, targetName, targetUrl, codeOnly, data, selectedGroups) { 71163 return _List_fromArray( 71164 [ 71165 A3($author$project$Page$Move$statusList, i18n, data, selectedGroups), 71166 A2( 71167 $author$project$UI$Components$card, 71168 _List_fromArray( 71169 [ 71170 $author$project$Ui$padding($author$project$UI$Theme$spacing.i8) 71171 ]), 71172 _List_fromArray( 71173 [ 71174 A2( 71175 $author$project$Ui$el, 71176 _List_fromArray( 71177 [ 71178 $author$project$Ui$Font$size($author$project$UI$Theme$font.aW) 71179 ]), 71180 $author$project$Ui$text( 71181 A2($author$project$Translations$moveAllSeeded, targetName, i18n))) 71182 ])), 71183 function () { 71184 var _v0 = data.jC; 71185 if (_v0.$ === 1) { 71186 return $author$project$Page$Move$hint( 71187 $author$project$Translations$moveBuildingHandoff(i18n)); 71188 } else { 71189 var payload = _v0.a; 71190 return A6($author$project$Page$Move$handoffSection, i18n, targetName, targetUrl, codeOnly, data.eD, payload); 71191 } 71192 }() 71193 ]); 71194 }); 71195var $author$project$Page$Move$RetryFailed = {$: 2}; 71196var $author$project$Page$Move$isFailed = function (status) { 71197 if ((!status.$) && (status.a.$ === 3)) { 71198 return true; 71199 } else { 71200 return false;
71201 } 71202}; 71203var $author$project$Translations$moveRetry = function (_v0) { 71204 var lang = _v0; 71205 if (!lang) { 71206 return 'Retry the failed groups'; 71207 } else { 71208 return 'Réessayer les groupes en échec'; 71209 } 71210}; 71211var $author$project$Translations$moveSeeding = F2( 71212 function (target, _v0) { 71213 var lang = _v0; 71214 if (!lang) { 71215 return 'Copying your groups to ' + (target + 'â¦'); 71216 } else { 71217 return 'Copie de tes groupes vers ' + (target + 'â¦'); 71218 } 71219 }); 71220var $author$project$Page$Move$viewProgress = F4( 71221 function (i18n, targetName, data, selectedGroups) { 71222 var stillRunning = A2( 71223 $elm$core$List$any, 71224 function (g) { 71225 return _Utils_eq( 71226 A2($elm$core$Dict$get, g.m9, data.ag), 71227 $elm$core$Maybe$Just($author$project$Page$Move$InFlight)); 71228 }, 71229 selectedGroups); 71230 var anyFailed = A2( 71231 $elm$core$List$any, 71232 function (g) { 71233 return $author$project$Page$Move$isFailed( 71234 A2($elm$core$Dict$get, g.m9, data.ag)); 71235 }, 71236 selectedGroups); 71237 return _List_fromArray( 71238 [ 71239 $author$project$Page$Move$hint( 71240 A2($author$project$Translations$moveSeeding, targetName, i18n)), 71241 A3($author$project$Page$Move$statusList, i18n, data, selectedGroups), 71242 (anyFailed && (!stillRunning)) ? A2( 71243 $author$project$UI$Components$btnPrimary, 71244 _List_Nil, 71245 { 71246 i6: $author$project$Translations$moveRetry(i18n), 71247 e7: $author$project$Page$Move$RetryFailed 71248 }) : $author$project$Ui$none 71249 ]); 71250 }); 71251var $author$project$Page$Move$view = F4( 71252 function (i18n, _v0, toMsg, _v1) { 71253 var targetName = _v0.kA; 71254 var targetUrl = _v0.qH; 71255 var groups = _v0.eN; 71256 var codeOnly = _v0.lX; 71257 var data = _v1; 71258 var selectedGroups = A2( 71259 $elm$core$List$filterMap, 71260 function (id) { 71261 return $elm$core$List$head( 71262 A2( 71263 $elm$core$List$filter, 71264 function (g) { 71265 return _Utils_eq(g.m9, id); 71266 }, 71267 groups)); 71268 }, 71269 data.hj); 71270 return A2( 71271 $author$project$Ui$map, 71272 toMsg, 71273 A2( 71274 $author$project$Ui$column, 71275 _List_fromArray( 71276 [ 71277 $author$project$Ui$spacing($author$project$UI$Theme$spacing.i8), 71278 $author$project$Ui$width($author$project$Ui$fill) 71279 ]), 71280 function () { 71281 var _v2 = $author$project$Page$Move$phase(data); 71282 switch (_v2) { 71283 case 0: 71284 return A3($author$project$Page$Move$viewChoosing, i18n, groups, data); 71285 case 1: 71286 return A4($author$project$Page$Move$viewProgress, i18n, targetName, data, selectedGroups); 71287 default: 71288 return A6($author$project$Page$Move$viewDone, i18n, targetName, targetUrl, codeOnly, data, selectedGroups); 71289 } 71290 }())); 71291 }); 71292var $author$project$Page$NewGroup$Submit = {$: 6}; 71293var $author$project$Page$NewGroup$InputCreatorName = function (a) { 71294 return {$: 1, a: a}; 71295}; 71296var $author$project$Page$NewGroup$fieldError = F3( 71297 function (i18n, submitted, field) { 71298 if ($dwayne$elm_field$Field$isInvalid(field) && (submitted || $dwayne$elm_field$Field$isDirty(field))) { 71299 var message = function () { 71300 var _v0 = $dwayne$elm_field$Field$firstError(field); 71301 if (!_v0.$) { 71302 var err = _v0.a; 71303 return A2( 71304 $dwayne$elm_field$Field$errorToString, 71305 { 71306 oo: $author$project$Translations$fieldRequired(i18n), 71307 o3: function (_v1) { 71308 return $author$project$Translations$fieldInvalidFormat(i18n); 71309 }, 71310 pc: function (_v2) { 71311 return $author$project$Translations$fieldInvalidFormat(i18n); 71312 } 71313 }, 71314 err); 71315 } else { 71316 return $author$project$Translations$fieldRequired(i18n); 71317 } 71318 }(); 71319 return A2( 71320 $author$project$Ui$el, 71321 _List_fromArray( 71322 [ 71323 $author$project$Ui$Font$size($author$project$UI$Theme$font.qk), 71324 $author$project$Ui$Font$color($author$project$UI$Theme$danger.qI) 71325 ]), 71326 $author$project$Ui$text(message)); 71327 } else { 71328 return $author$project$Ui$none; 71329 } 71330 }); 71331var $author$project$Translations$newGroupCreatorNameLabel = function (_v0) { 71332 var lang = _v0; 71333 if (!lang) { 71334 return 'Your name'; 71335 } else { 71336 return 'Ton nom'; 71337 } 71338}; 71339var $author$project$Translations$newGroupCreatorNamePlaceholder = function (_v0) { 71340 var lang = _v0; 71341 if (!lang) { 71342 return 'e.g. Alice'; 71343 } else { 71344 return 'ex. Alice'; 71345 } 71346}; 71347var $author$project$Page$NewGroup$creatorNameField = F3( 71348 function (i18n, submitted, form) { 71349 var field = A2( 71350 $dwayne$elm_form$Form$get, 71351 function ($) { 71352 return $.a4; 71353 }, 71354 form); 71355 return A2( 71356 $author$project$Ui$column, 71357 _List_fromArray( 71358 [ 71359 $author$project$Ui$spacing($author$project$UI$Theme$spacing.bb), 71360 $author$project$Ui$width($author$project$Ui$fill) 71361 ]), 71362 _List_fromArray( 71363 [ 71364 A2( 71365 $author$project$UI$Components$formLabel, 71366 $author$project$Translations$newGroupCreatorNameLabel(i18n), 71367 true), 71368 A2( 71369 $author$project$Ui$Input$text, 71370 _List_fromArray( 71371 [ 71372 $author$project$Ui$width($author$project$Ui$fill), 71373 $author$project$Ui$padding($author$project$UI$Theme$spacing.qk), 71374 $author$project$Ui$rounded($author$project$UI$Theme$radiu
71374s.qk), 71375 $author$project$Ui$border($author$project$UI$Theme$border), 71376 $author$project$Ui$borderColor($author$project$UI$Theme$base.k3) 71377 ]), 71378 { 71379 i6: $author$project$Ui$Input$labelHidden( 71380 $author$project$Translations$newGroupCreatorNameLabel(i18n)), 71381 oq: $author$project$Page$NewGroup$InputCreatorName, 71382 pt: $elm$core$Maybe$Just( 71383 $author$project$Translations$newGroupCreatorNamePlaceholder(i18n)), 71384 qI: $dwayne$elm_field$Field$toRawString(field) 71385 }), 71386 A3($author$project$Page$NewGroup$fieldError, i18n, submitted, field) 71387 ])); 71388 }); 71389var $author$project$Page$NewGroup$InputCurrency = function (a) { 71390 return {$: 2, a: a}; 71391}; 71392var $author$project$Page$NewGroup$currencyToString = function (c) { 71393 return $elm$core$String$toLower( 71394 $author$project$Domain$Currency$currencyCode(c)); 71395}; 71396var $author$project$Page$NewGroup$formHint = function (hint) { 71397 return A2( 71398 $author$project$Ui$el, 71399 _List_fromArray( 71400 [ 71401 $author$project$Ui$Font$size($author$project$UI$Theme$font.qk), 71402 $author$project$Ui$Font$color($author$project$UI$Theme$base.aM) 71403 ]), 71404 $author$project$Ui$text(hint)); 71405}; 71406var $author$project$Translations$newGroupCurrencyHint = function (_v0) { 71407 var lang = _v0; 71408 if (!lang) { 71409 return 'Used as the default currency for expenses in this group.'; 71410 } else { 71411 return 'Devise par défaut pour les dépenses du groupe.'; 71412 } 71413}; 71414var $author$project$Translations$newGroupCurrencyLabel = function (_v0) { 71415 var lang = _v0; 71416 if (!lang) { 71417 return 'Default currency'; 71418 } else { 71419 return 'Devise par défaut'; 71420 } 71421}; 71422var $author$project$Page$NewGroup$currencyField = F2( 71423 function (i18n, form) { 71424 var selected = $dwayne$elm_field$Field$toMaybe( 71425 A2( 71426 $dwayne$elm_form$Form$get, 71427 function ($) { 71428 return $.bg; 71429 }, 71430 form)); 71431 return A2( 71432 $author$project$Ui$column, 71433 _List_fromArray( 71434 [ 71435 $author$project$Ui$spacing($author$project$UI$Theme$spacing.qk), 71436 $author$project$Ui$width($author$project$Ui$fill) 71437 ]), 71438 _List_fromArray( 71439 [ 71440 A2( 71441 $author$project$UI$Components$formLabel, 71442 $author$project$Translations$newGroupCurrencyLabel(i18n), 71443 true), 71444 $author$project$Page$NewGroup$formHint( 71445 $author$project$Translations$newGroupCurrencyHint(i18n)), 71446 A2( 71447 $author$project$Ui$row, 71448 _List_fromArray( 71449 [ 71450 $author$project$Ui$wrap, 71451 $author$project$Ui$spacing($author$project$UI$Theme$spacing.bb) 71452 ]), 71453 A2( 71454 $elm$core$List$map, 71455 function (c) { 71456 return $author$project$UI$Components$chip( 71457 { 71458 i6: $author$project$Domain$Currency$currencyCode(c), 71459 e7: $author$project$Page$NewGroup$InputCurrency( 71460 $author$project$Page$NewGroup$currencyToString(c)), 71461 hj: _Utils_eq( 71462 selected, 71463 $elm$core$Maybe$Just(c)) 71464 }); 71465 }, 71466 $author$project$Domain$Currency$allCurrencies)) 71467 ])); 71468 }); 71469var $author$project$Page$NewGroup$InputName = function (a) { 71470 return {$: 0, a: a}; 71471}; 71472var $author$project$Translations$newGroupNameLabel = function (_v0) { 71473 var lang = _v0; 71474 if (!lang) { 71475 return 'Group name'; 71476 } else { 71477 return 'Nom du groupe'; 71478 } 71479}; 71480var $author$project$Translations$newGroupNamePlaceholder = function (_v0) { 71481 var lang = _v0; 71482 if (!lang) { 71483 return 'e.g. Trip to Paris'; 71484 } else { 71485 return 'ex. Voyage à Paris'; 71486 } 71487}; 71488var $author$project$Page$NewGroup$nameField = F3( 71489 function (i18n, submitted, form) { 71490 var field = A2( 71491 $dwayne$elm_form$Form$get, 71492 function ($) { 71493 return $.bW; 71494 }, 71495 form); 71496 return A2( 71497 $author$project$Ui$column, 71498 _List_fromArray( 71499 [ 71500 $author$project$Ui$spacing($author$project$UI$Theme$spacing.bb), 71501 $author$project$Ui$width($author$project$Ui$fill) 71502 ]), 71503 _List_fromArray( 71504 [ 71505 A2( 71506 $author$project$UI$Components$formLabel, 71507 $author$project$Translations$newGroupNameLabel(i18n), 71508 true), 71509 A2( 71510 $author$project$Ui$Input$text, 71511 _List_fromArray( 71512 [ 71513 $author$project$Ui$width($author$project$Ui$fill), 71514 $author$project$Ui$padding($author$project$UI$Theme$spacing.qk), 71515 $author$project$Ui$rounded($author$project$UI$Theme$radiu
71515s.qk), 71516 $author$project$Ui$border($author$project$UI$Theme$border), 71517 $author$project$Ui$borderColor($author$project$UI$Theme$base.k3) 71518 ]), 71519 { 71520 i6: $author$project$Ui$Input$labelHidden( 71521 $author$project$Translations$newGroupNameLabel(i18n)), 71522 oq: $author$project$Page$NewGroup$InputName, 71523 pt: $elm$core$Maybe$Just( 71524 $author$project$Translations$newGroupNamePlaceholder(i18n)), 71525 qI: $dwayne$elm_field$Field$toRawString(field) 71526 }), 71527 A3($author$project$Page$NewGroup$fieldError, i18n, submitted, field) 71528 ])); 71529 }); 71530var $author$project$Translations$newGroupSubmit = function (_v0) { 71531 var lang = _v0; 71532 if (!lang) { 71533 return 'Create Group'; 71534 } else { 71535 return 'Créer le groupe'; 71536 } 71537}; 71538var $author$project$Page$NewGroup$AddVirtualMember = {$: 4}; 71539var $author$project$Translations$newGroupAddVirtualMember = function (_v0) { 71540 var lang = _v0; 71541 if (!lang) { 71542 return 'Add member'; 71543 } else { 71544 return 'Ajouter un membre'; 71545 } 71546}; 71547var $author$project$Translations$newGroupVirtualMembersHint = function (_v0) { 71548 var lang = _v0; 71549 if (!lang) { 71550 return 'Add the names of other members of this group.'; 71551 } else { 71552 return 'Ajoute les noms des autres membres de ce groupe.'; 71553 } 71554}; 71555var $author$project$Translations$newGroupVirtualMembersLabel = function (_v0) { 71556 var lang = _v0; 71557 if (!lang) { 71558 return 'Other members'; 71559 } else { 71560 return 'Autres membres'; 71561 } 71562}; 71563var $author$project$Page$NewGroup$InputVirtualMemberName = F2( 71564 function (a, b) { 71565 return {$: 3, a: a, b: b}; 71566 }); 71567var $author$project$Page$NewGroup$RemoveVirtualMember = function (a) { 71568 return {$: 5, a: a}; 71569}; 71570var $author$project$Ui$Events$Enter = {$: 0}; 71571var $author$project$Ui$Events$enter = $author$project$Ui$Events$Enter; 71572var $author$project$Translations$newGroupRemoveMember = function (_v0) { 71573 var lang = _v0; 71574 if (!lang) { 71575 return 'Remove'; 71576 } else { 71577 return 'Supprimer'; 71578 } 71579}; 71580var $author$project$Translations$newGroupVirtualMemberPlaceholder = function (_v0) { 71581 var lang = _v0; 71582 if (!lang) { 71583 return 'e.g. Bob'; 71584 } else { 71585 return 'ex. Bob'; 71586 } 71587}; 71588var $author$project$Internal$Model2$onKey = function (details) { 71589 var decode = function (code) { 71590 return _Utils_eq(code, details.i4) ? $elm$json$Json$Decode$succeed(details.nX) : $elm$json$Json$Decode$fail('Not the enter key'); 71591 }; 71592 var isKey = A2( 71593 $elm$json$Json$Decode$andThen, 71594 decode, 71595 A2($elm$json$Json$Decode$field, 'key', $elm$json$Json$Decode$string)); 71596 return _List_fromArray( 71597 [ 71598 { 71599 g: { 71600 q: $author$project$Internal$BitField$none, 71601 ei: _List_fromArray( 71602 [ 71603 A2( 71604 $elm$html$Html$Events$preventDefaultOn, 71605 'keyup', 71606 A2( 71607 $elm$json$Json$Decode$map, 71608 function (fired) { 71609 return _Utils_Tuple2(fired, true); 71610 }, 71611 isKey)), 71612 $elm$html$Html$Attributes$tabindex(0) 71613 ]), 71614 f: $elm$core$Maybe$Nothing, 71615 j: _List_Nil, 71616 o: $author$project$Internal$Model2$NodeAsDiv, 71617 p: $author$project$Internal$Model2$noStyles 71618 }, 71619 h: $author$project$Internal$Flag$skip 71620 } 71621 ]); 71622}; 71623var $author$project$Ui$Events$toCodeString = function (myKey) { 71624 switch (myKey.$) { 71625 case 0: 71626 return 'Enter'; 71627 case 1: 71628 return 'Space'; 71629 case 2: 71630 return 'ArrowUp'; 71631 case 3: 71632 return 'ArrowDown'; 71633 case 4: 71634 return 'ArrowLeft'; 71635 case 5: 71636 return 'ArrowRight'; 71637 case 6: 71638 return 'Backspace'; 71639 default: 71640 var str = myKey.a; 71641 return str; 71642 } 71643}; 71644var $author$project$Ui$Events$onKey = F2( 71645 function (desiredKey, msg) { 71646 return $author$project$Internal$Model2$onKey( 71647 { 71648 i4: $author$project$Ui$Events$toCodeString(desiredKey), 71649 nX: msg 71650 }); 71651 }); 71652var $author$project$Page$NewGroup$virtualMemberRow = F3( 71653 function (i18n, id, form) { 71654 var field = A2( 71655 $dwayne$elm_form$Form$get, 71656 function (a) { 71657 return a.kV(id); 71658 }, 71659 form); 71660 return A2( 71661 $author$project$Ui$row, 71662 _List_fromArray( 71663 [ 71664 $author$project$Ui$spacing($author$project$UI$Theme$spacing.qk), 71665 $author$project$Ui$width($author$project$Ui$fill), 71666 $author$project$Ui$contentCenterY 71667 ]), 71668 _List_fromArray( 71669 [ 71670 A2( 71671 $author$project$Ui$Input$text, 71672 _List_fromArray( 71673 [ 71674 $author$project$Ui$width($author$project$Ui$fill), 71675 $author$project$Ui$padding($author$project$UI$Theme$spacing.qk), 71676 $author$project$Ui$rounded($author$project$UI$Theme$radiu
71676s.qk), 71677 $author$project$Ui$border($author$project$UI$Theme$border), 71678 $author$project$Ui$borderColor($author$project$UI$Theme$base.k3), 71679 A2($author$project$Ui$Events$onKey, $author$project$Ui$Events$enter, $author$project$Page$NewGroup$AddVirtualMember), 71680 $author$project$Ui$htmlAttribute( 71681 $elm$html$Html$Attributes$id( 71682 $author$project$Page$NewGroup$virtualMemberInputId(id))) 71683 ]), 71684 { 71685 i6: $author$project$Ui$Input$labelHidden( 71686 $author$project$Translations$newGroupVirtualMembersLabel(i18n)), 71687 oq: $author$project$Page$NewGroup$InputVirtualMemberName(id), 71688 pt: $elm$core$Maybe$Just( 71689 $author$project$Translations$newGroupVirtualMemberPlaceholder(i18n)), 71690 qI: $dwayne$elm_field$Field$toRawString(field) 71691 }), 71692 A2( 71693 $author$project$UI$Components$btnOutline, 71694 _List_fromArray( 71695 [ 71696 $author$project$Ui$width($author$project$Ui$shrink), 71697 A2($author$project$Ui$paddingXY, $author$project$UI$Theme$spacing.aW, $author$project$UI$Theme$spacing.qk) 71698 ]), 71699 { 71700 gv: $elm$core$Maybe$Just( 71701 A2($author$project$UI$Components$featherIcon, 14, $feathericons$elm_feather$FeatherIcons$trash2)), 71702 i6: $author$project$Translations$newGroupRemoveMember(i18n), 71703 e7: $author$project$Page$NewGroup$RemoveVirtualMember(id) 71704 }) 71705 ])); 71706 }); 71707var $author$project$Page$NewGroup$virtualMembersSection = F2( 71708 function (i18n, form) { 71709 var members = $dwayne$elm_form$Form$List$toList( 71710 $dwayne$elm_form$Form$toState(form).rc); 71711 return A2( 71712 $author$project$Ui$column, 71713 _List_fromArray( 71714 [ 71715 $author$project$Ui$spacing($author$project$UI$Theme$spacing.qk), 71716 $author$project$Ui$width($author$project$Ui$fill) 71717 ]), 71718 _List_fromArray( 71719 [ 71720 A2( 71721 $author$project$UI$Components$formLabel, 71722 $author$project$Translations$newGroupVirtualMembersLabel(i18n), 71723 false), 71724 A2( 71725 $author$project$Ui$row, 71726 _List_fromArray( 71727 [ 71728 $author$project$Ui$width($author$project$Ui$fill), 71729 $author$project$Ui$spacing($author$project$UI$Theme$spacing.aW), 71730 $author$project$Ui$contentCenterY 71731 ]), 71732 _List_fromArray( 71733 [ 71734 A2( 71735 $author$project$Ui$el, 71736 _List_fromArray( 71737 [ 71738 $author$project$Ui$Font$size($author$project$UI$Theme$font.qk), 71739 $author$project$Ui$Font$color($author$project$UI$Theme$base.aM), 71740 $author$project$Ui$width($author$project$Ui$fill) 71741 ]), 71742 $author$project$Ui$text( 71743 $author$project$Translations$newGroupVirtualMembersHint(i18n))) 71744 ])), 71745 A2( 71746 $author$project$Ui$column, 71747 _List_fromArray( 71748 [ 71749 $author$project$Ui$spacing($author$project$UI$Theme$spacing.qk), 71750 $author$project$Ui$width($author$project$Ui$fill) 71751 ]), 71752 A2( 71753 $elm$core$List$map, 71754 function (_v0) { 71755 var id = _v0.a; 71756 return A3($author$project$Page$NewGroup$virtualMemberRow, i18n, id, form); 71757 }, 71758 members)), 71759 A2( 71760 $author$project$UI$Components$btnOutline, 71761 _List_fromArray( 71762 [ 71763 $author$project$Ui$width($author$project$Ui$shrink), 71764 A2($author$project$Ui$paddingXY, $author$project$UI$Theme$spacing.aW, $author$project$UI$Theme$spacing.qk) 71765 ]), 71766 { 71767 gv: $elm$core$Maybe$Just( 71768 A2($author$project$UI$Components$featherIcon, 16, $feathericons$elm_feather$FeatherIcons$plus)), 71769 i6: $author$project$Translations$newGroupAddVirtualMember(i18n), 71770 e7: $author$project$Page$NewGroup$AddVirtualMember 71771 }) 71772 ])); 71773 }); 71774var $author$project$Page$NewGroup$view = F3( 71775 function (i18n, toMsg, _v0) { 71776 var form = _v0.a; 71777 var submitted = _v0.b; 71778 return A2( 71779 $author$project$Ui$map, 71780 toMsg, 71781 A2( 71782 $author$project$Ui$column, 71783 _List_fromArray( 71784 [ 71785 $author$project$Ui$spacing($author$project$UI$Theme$spacing.i8), 71786 $author$project$Ui$width($author$project$Ui$fill) 71787 ]), 71788 _List_fromArray( 71789 [ 71790 A3($author$project$Page$NewGroup$nameField, i18n, submitted, form), 71791 A3($author$project$Page$NewGroup$creatorNameField, i18n, submitted, form), 71792 A2($author$project$Page$NewGroup$virtualMembersSection, i18n, form), 71793 A2($author$project$Page$NewGroup$currencyField, i18n, form), 71794 A2( 71795 $author$project$UI$Components$btnPrimary, 71796 _List_Nil, 71797 { 71798 i6: $author$project$Translations$newGroupSubmit(i18n), 71799 e7: $author$project$Page$NewGroup$Submit 71800 }) 71801 ]))); 71802 }); 71803var $author$project$Translations$notFoundCode = function (_v0) { 71804 var lang = _v0; 71805 if (!lang) { 71806 return '404'; 71807 } else { 71808 return '404'; 71809 } 71810}; 71811var $author$project$Translations$notFoundMessage = function (_v0) { 71812 var lang = _v0; 71813 if (!lang) { 71814 return 'The page you are looking for does not exist.'; 71815 } else { 71816 return 'La page que tu cherches n\'existe pas.'; 71817 } 71818}; 71819var $author$project$Page$NotFound$view = function (i18n) { 71820 return A2( 71821 $author$project$Ui$column, 71822 _List_fromArray( 71823 [ 71824 $author$project$Ui$spacing($author$project$UI$Theme$spacing.aW), 71825 $author$project$Ui$width($author$project$Ui$fill), 71826 A2($author$project$Ui$paddingXY, 0, $author$project$UI$Theme$spacing.rn) 71827 ]), 71828 _List_fromArray( 71829 [ 71830 A2( 71831 $author$project$Ui$el, 71832 _List_fromArray( 71833 [ 71834 $author$project$Ui$Font$size($author$project$UI$Theme$font.hF), 71835 $author$project$Ui$Font$weight($author$project$UI$Theme$fontWeight.lD), 71836 $author$project$Ui$Font$letterSpacing($author$project$UI$Theme$letterSpacing.qP), 71837 $author$project$Ui$Font$color($author$project$UI$Theme$base.aM), 71838 $author$project$Ui$centerX 71839 ]), 71840 $author$project$Ui$text( 71841 $author$project$Translations$notFoundCode(i18n))), 71842 A2( 71843 $author$project$Ui$el, 71844 _List_fromArray( 71845 [ 71846 $author$project$Ui$Font$size($author$project$UI$Theme$font.aW), 71847 $author$project$Ui$Font$color($author$project$UI$Theme$base.aM), 71848 $author$project$Ui$centerX 71849 ]), 71850 $author$project$Ui$text( 71851 $author$project$Translations$notFoundMessage(i18n))) 71852 ])); 71853}; 71854var $author$project$Page$Receive$hint = function (text) { 71855 return A2( 71856 $author$project$Ui$el, 71857 _List_fromArray( 71858 [ 71859 $author$project$Ui$Font$size($author$project$UI$Theme$font.qk), 71860 $author$project$Ui$Font$color($author$project$UI$Theme$base.aM), 71861 $author$project$Ui$width($author$project$Ui$fill) 71862 ]), 71863 $author$project$Ui$text(text)); 71864}; 71865var $author$project$Translations$receiveNotExpecting = function (_v0) { 71866 var lang = _v0; 71867 if (!lang) { 71868 return 'This deployment is not expecting anyone to move in; there is nothing to do here.'; 71869 } else { 71870 return 'Cette instance n\'attend aucune migration ; il n\'y a rien à faire ici.'; 71871 } 71872}; 71873var $author$project$Translations$receiveDone = F2( 71874 function (count, _v0) { 71875 var lang = _v0; 71876 if (!lang) { 71877 return 'Welcome home â ' + (count + ' group(s) are ready.'); 71878 } else {
71879 return 'Bienvenue chez toi â ' + (count + ' groupe(s) prêts.'); 71880 } 71881 }); 71882var $author$project$Translations$receiveInstallHere = F2( 71883 function (destination, _v0) { 71884 var lang = _v0; 71885 if (!lang) { 71886 return 'The old app opened this page in a window of its own, which has no way to install anything. To put Partage back on your home screen, open ' + (destination + ' in your browser and install it from there.'); 71887 } else { 71888 return 'Lâancienne app a ouvert cette page dans une fenêtre à elle, qui ne peut rien installer. Pour remettre Partage sur ton écran dâaccueil, ouvre ' + (destination + ' dans ton navigateur et installe-la depuis là .'); 71889 } 71890 }); 71891var $author$project$Translations$receiveKeptIdentity = function (_v0) { 71892 var lang = _v0; 71893 if (!lang) { 71894 return 'This device already had a profile of its own, so the arriving groups are read-only for now â open one and use \"I amâ¦\" to re-link yourself.'; 71895 } else { 71896 return 'Cet appareil avait déjà son propre profil, donc les groupes arrivés sont en lecture seule pour l\'instant â ouvre-en un et utilise « Je suis⦠» pour te relier.'; 71897 } 71898}; 71899var $author$project$Translations$receiveNextSteps = function (_v0) { 71900 var lang = _v0; 71901 if (!lang) { 71902 return 'One thing doesn\'t survive a move: notifications. Enable them again from the home screen â the old permission belonged to the old address.'; 71903 } else { 71904 return 'Une chose ne survit pas à la migration de tes données : les notifications. Réactive-les depuis l\'écran d\'accueil â l\'ancienne permission appartenait à l\'ancienne adresse.'; 71905 } 71906}; 71907var $author$project$Translations$receiveOpenGroups = function (_v0) { 71908 var lang = _v0; 71909 if (!lang) { 71910 return 'Open my groups'; 71911 } else { 71912 return 'Ouvrir mes groupes'; 71913 } 71914}; 71915var $author$project$Translations$receiveSkipped = F2( 71916 function (count, _v0) { 71917 var lang = _v0; 71918 if (!lang) { 71919 return count + ' group(s) were already here and were left untouched.'; 71920 } else { 71921 return count + ' groupe(s) étaient déjà là et n\'ont pas été touchés.'; 71922 } 71923 }); 71924var $author$project$Page$Receive$viewApplied = F3( 71925 function (i18n, ctx, result) { 71926 return A2( 71927 $author$project$Ui$column, 71928 _List_fromArray( 71929 [ 71930 $author$project$Ui$spacing($author$project$UI$Theme$spacing.i8), 71931 $author$project$Ui$width($author$project$Ui$fill) 71932 ]), 71933 _List_fromArray( 71934 [ 71935 A2( 71936 $author$project$UI$Components$card, 71937 _List_fromArray( 71938 [ 71939 $author$project$Ui$padding($author$project$UI$Theme$spacing.i8) 71940 ]), 71941 _List_fromArray( 71942 [ 71943 A2( 71944 $author$project$Ui$el, 71945 _List_fromArray( 71946 [ 71947 $author$project$Ui$Font$size($author$project$UI$Theme$font.aW) 71948 ]), 71949 $author$project$Ui$text( 71950 A2( 71951 $author$project$Translations$receiveDone, 71952 $elm$core$String$fromInt(result.bc), 71953 i18n))), 71954 (result.qg > 0) ? A2( 71955 $author$project$Ui$el, 71956 _List_fromArray( 71957 [ 71958 $author$project$Ui$Font$size($author$project$UI$Theme$font.qk), 71959 $author$project$Ui$Font$color($author$project$UI$Theme$base.aM), 71960 $author$project$Ui$paddingTop($author$project$UI$Theme$spacing.bb) 71961 ]), 71962 $author$project$Ui$text( 71963 A2( 71964 $author$project$Translations$receiveSkipped, 71965 $elm$core$String$fromInt(result.qg), 71966 i18n))) : $author$project$Ui$none, 71967 result.ld ? $author$project$Ui$none : A2( 71968 $author$project$Ui$el, 71969 _List_fromArray( 71970 [ 71971 $author$project$Ui$Font$size($author$project$UI$Theme$font.qk), 71972 $author$project$Ui$Font$color($author$project$UI$Theme$base.aM), 71973 $author$project$Ui$paddingTop($author$project$UI$Theme$spacing.bb) 71974 ]), 71975 $author$project$Ui$text( 71976 $author$project$Translations$receiveKeptIdentity(i18n))) 71977 ])), 71978 ctx.bP ? $author$project$Page$Receive$hint( 71979 A2($author$project$Translations$receiveInstallHere, ctx.mh, i18n)) : $author$project$Ui$none, 71980 $author$project$Page$Receive$hint( 71981 $author$project$Translations$receiveNextSteps(i18n)), 71982 A2( 71983 $author$project$UI$Components$btnPrimary, 71984 _List_fromArray( 71985 [ 71986 $author$project$Ui$width($author$project$Ui$shrink) 71987 ]), 71988 { 71989 i6: $author$project$Translations$receiveOpenGroups(i18n), 71990 e7: ctx.jv 71991 }) 71992 ])); 71993 }); 71994var $author$project$Page$Receive$InputCode = function (a) { 71995 return {$: 0, a: a}; 71996}; 71997var $author$project$Page$Receive$SubmitCode = {$: 1}; 71998var $author$project$Page$Receive$errorText = function (text) { 71999 return A2( 72000 $author$project$Ui$el, 72001 _List_fromArray( 72002 [ 72003 $author$project$Ui$Font$size($author$project$UI$Theme$font.qk), 72004 $author$project$Ui$Font$color($author$project$UI$Theme$danger.qI) 72005 ]), 72006 $author$project$Ui$text(text)); 72007}; 72008var $author$project$Translations$receiveApplying = function (_v0) { 72009 var lang = _v0; 72010 if (!lang) { 72011 return 'Moving inâ¦'; 72012 } else { 72013 return 'Migrationâ¦'; 72014 } 72015}; 72016var $author$project$Translations$receiveCodeInvalid = function (_v0) { 72017 var lang = _v0; 72018 if (!lang) { 72019 return 'That doesn\'t look like a Partage migration code.'; 72020 } else { 72021 return 'Ãa ne ressemble pas à un code de migration Partage.'; 72022 } 72023}; 72024var $author$project$Translations$receiveCodePlaceholder = function (_v0) { 72025 var lang = _v0; 72026 if (!lang) { 72027 return 'Paste the migration code from the old app here'; 72028 } else { 72029 return 'Colle ici le code de migration de l\'ancienne app'; 72030 } 72031}; 72032var $author$project$Translations$receiveIntro = F2( 72033 function (source, _v0) { 72034 var lang = _v0; 72035 if (!lang) { 72036 return 'Finish moving from ' + (source + '. Your groups already live on this server; bringing your profile over unlocks them here. If the old app opened this page, it happens by itself â otherwise paste the migration code shown there.'); 72037 } else { 72038 return 'Termine la migration de tes données depuis ' + (source + '. Tes groupes vivent déjà sur ce serveur ; apporter ton profil les déverrouille ici. Si l\'ancienne app a ouvert cette page, tout se fait tout seul â sinon colle le code de migration affiché là -bas.'); 72039 } 72040 }); 72041var $author$project$Translations$receiveIosInstallFirst = function (_v0) { 72042 var lang = _v0; 72043 if (!lang) { 72044 return 'On iPhone or iPad, install Partage first (Share â Add to Home Screen), then open the installed app and paste the code there â a code pasted in Safari never reaches the installed app.'; 72045 } else { 72046 return 'Sur iPhone ou iPad, installe d\'abord Partage (Partager â Sur l\'écran d\'accueil), puis ouvre l\'app installée et colle le code dedans â un code collé dans Safari n\'atteint jamais l\'app installée.'; 72047 } 72048}; 72049var $author$project$Translations$receiveSubmit = function (_v0) { 72050 var lang = _v0; 72051 if (!lang) { 72052 return 'Move in'; 72053 } else { 72054 return 'Migrer'; 72055 } 72056}; 72057var $author$project$Page$Receive$viewReceiving = F4( 72058 function (i18n, sourceName, requiresInstall, data) { 72059 return A2( 72060 $author$project$Ui$column, 72061 _List_fromArray( 72062 [ 72063 $author$project$Ui$spacing($author$project$UI$Theme$spacing.i8), 72064 $author$project$Ui$width($author$project$Ui$fill) 72065 ]), 72066 A2( 72067 $elm$core$List$cons, 72068 $author$project$Page$Receive$hint( 72069 A2($author$project$Translations$receiveIntro, sourceName, i18n)), 72070 requiresInstall ? _List_fromArray( 72071 [ 72072 A2( 72073 $author$project$UI$Components$card, 72074 _List_fromArray( 72075 [ 72076 $author$project$Ui$padding($author$project$UI$Theme$spacing.i8) 72077 ]), 72078 _List_fromArray( 72079 [ 72080 A2( 72081 $author$project$Ui$el, 72082 _List_fromArray( 72083 [ 72084 $author$project$Ui$Font$size($author$project$UI$Theme$font.qk) 72085 ]), 72086 $author$project$Ui$text( 72087 $author$project$Translations$receiveIosInstallFirst(i18n))) 72088 ])) 72089 ]) : _List_fromArray( 72090 [ 72091 A2( 72092 $author$project$Ui$Input$text, 72093 _List_fromArray( 72094 [ 72095 $author$project$Ui$width($author$project$Ui$fill), 72096 $author$project$Ui$padding($author$project$UI$Theme$spacing.qk), 72097 $author$project$Ui$rounded($author$project$UI$Theme$radiu
72097s.qk), 72098 $author$project$Ui$border($author$project$UI$Theme$border), 72099 $author$project$Ui$borderColor($author$project$UI$Theme$base.k3), 72100 $author$project$Ui$Font$size($author$project$UI$Theme$font.aW), 72101 $author$project$Ui$Font$family( 72102 _List_fromArray( 72103 [$author$project$Ui$Font$monospace])) 72104 ]), 72105 { 72106 i6: $author$project$Ui$Input$labelHidden( 72107 $author$project$Translations$receiveCodePlaceholder(i18n)), 72108 oq: $author$project$Page$Receive$InputCode, 72109 pt: $elm$core$Maybe$Just( 72110 $author$project$Translations$receiveCodePlaceholder(i18n)), 72111 qI: data.cJ 72112 }), 72113 function () { 72114 var _v0 = data.gi; 72115 if (!_v0.$) { 72116 if (!_v0.a.$) { 72117 var _v1 = _v0.a; 72118 return $author$project$Page$Receive$errorText( 72119 $author$project$Translations$receiveCodeInvalid(i18n)); 72120 } else { 72121 var reason = _v0.a.a; 72122 return $author$project$Page$Receive$errorText(reason); 72123 } 72124 } else { 72125 return $author$project$Ui$none; 72126 } 72127 }(), 72128 A2( 72129 $author$project$UI$Components$btnPrimary, 72130 _List_fromArray( 72131 [ 72132 $author$project$Ui$width($author$project$Ui$shrink) 72133 ]), 72134 { 72135 i6: data.be ? $author$project$Translations$receiveApplying(i18n) : $author$project$Translations$receiveSubmit(i18n), 72136 e7: $author$project$Page$Receive$SubmitCode 72137 }) 72138 ]))); 72139 }); 72140var $author$project$Page$Receive$view = F4( 72141 function (i18n, ctx, toMsg, _v0) { 72142 var data = _v0; 72143 var _v1 = ctx.ko; 72144 if (_v1.$ === 1) { 72145 return $author$project$Page$Receive$hint( 72146 $author$project$Translations$receiveNotExpecting(i18n)); 72147 } else { 72148 var sourceName = _v1.a; 72149 var _v2 = data.dI; 72150 if (!_v2.$) { 72151 var result = _v2.a; 72152 return A3($author$project$Page$Receive$viewApplied, i18n, ctx, result); 72153 } else { 72154 return A2( 72155 $author$project$Ui$map, 72156 toMsg, 72157 A4($author$project$Page$Receive$viewReceiving, i18n, sourceName, ctx.pR, data)); 72158 } 72159 } 72160 }); 72161var $author$project$Main$viewReady = F2( 72162 function (model, readyData) { 72163 var noOverlay = function (content) { 72164 return {ew: content, g$: $elm$core$Maybe$Nothing}; 72165 }; 72166 var i18n = model.aJ; 72167 var _v0 = model.d; 72168 switch (_v0.$) { 72169 case 1: 72170 return noOverlay( 72171 $author$project$Page$Loading$view(model.aJ)); 72172 case 0: 72173 return noOverlay( 72174 function () { 72175 var _v1 = readyData.O; 72176 if (_v1.$ === 1) { 72177 return A2($author$project$Main$identityBootstrapView, i18n, model.aT); 72178 } else { 72179 return A5( 72180 $author$project$Page$Home$view, 72181 i18n, 72182 { 72183 k8: readyData.k8, 72184 ap: model.ap, 72185 nV: $elm$core$Dict$isEmpty(readyData.eN) ? A2( 72186 $elm$core$Maybe$map, 72187 function (source) { 72188 return { 72189 jw: $author$project$Main$NavigateTo($author$project$Route$Receive), 72190 ko: $author$project$Main$displayDomain(source) 72191 }; 72192 }, 72193 model.nO) : $elm$core$Maybe$Nothing, 72194 nW: A2( 72195 $elm$core$Maybe$map, 72196 function (target) { 72197 return { 72198 jw: $author$project$Main$NavigateTo($author$project$Route$Move), 72199 kA: $author$project$Main$displayDomain(target) 72200 }; 72201 }, 72202 model.nP), 72203 jr: model.G.jr, 72204 of: $author$project$PwaState$notificationUnavailable(model.G), 72205 oz: $author$project$Main$PwaStateMsg($author$project$PwaState$enableNotificationsMsg), 72206 oB: A2($elm$core$Basics$composeL, $author$project$Main$ImportExportMsg, $author$project$ImportExport$exportMsg), 72207 oC: A2($elm$core$Basics$composeL, $author$project$Main$ImportExportMsg, $author$project$ImportExport$exportCsvMsg), 72208 oO: $author$project$Main$NavigateTo, 72209 g6: $author$project$PwaState$pushIsActive(model.G), 72210 jQ: !_Utils_eq( 72211 $author$project$PwaState$pushServerUrl(model.G), 72212 $elm$core$Maybe$Nothing) 72213 }, 72214 $author$project$Main$HomeMsg, 72215 model.ah, 72216 $elm$core$Dict$values(readyData.eN)); 72217 } 72218 }()); 72219 case 2: 72220 return noOverlay( 72221 A2( 72222 $author$project$UI$Shell$pageShell, 72223 { 72224 a9: $author$project$Main$GoBack, 72225 ba: $author$project$Translations$shellNewGroup(i18n) 72226 }, 72227 A3($author$project$Page$NewGroup$view, i18n, $author$project$Main$NewGroupMsg, model.dx))); 72228 case 3: 72229 return noOverlay( 72230 A2( 72231 $author$project$UI$Shell$pageShell, 72232 { 72233 a9: $author$project$Main$NavigateTo($author$project$Route$Home), 72234 ba: $author$project$Translations$splitwiseImportTitle(i18n) 72235 }, 72236 function () { 72237 var _v2 = model.aU; 72238 if (!_v2.$) { 72239 var pageModel = _v2.a; 72240 return A3($author$project$Page$ImportSplitwise$view, i18n, $author$project$Main$ImportSplitwiseMsg, pageModel); 72241 } else { 72242 return $author$project$Ui$none; 72243 } 72244 }())); 72245 case 4: 72246 return noOverlay( 72247 A2( 72248 $author$project$UI$Shell$pageShell, 72249 { 72250 a9: $author$project$Main$NavigateTo($author$project$Route$Home), 72251 ba: $author$project$Translations$moveTitle(i18n) 72252 }, 72253 function () { 72254 var _v3 = model.nP; 72255 if (!_v3.$) { 72256 var target = _v3.a; 72257 return A4( 72258 $author$project$Page$Move$view, 72259 i18n, 72260 { 72261 lX: model.bQ,
72262 eN: $elm$core$Dict$values(readyData.eN), 72263 kA: $author$project$Main$displayDomain(target), 72264 qH: target 72265 }, 72266 $author$project$Main$MoveMsg, 72267 model.P); 72268 } else { 72269 return A2( 72270 $author$project$Ui$el, 72271 _List_fromArray( 72272 [ 72273 $author$project$Ui$Font$size($author$project$UI$Theme$font.aW) 72274 ]), 72275 $author$project$Ui$text( 72276 $author$project$Translations$moveNoTarget(i18n))); 72277 } 72278 }())); 72279 case 5: 72280 return noOverlay( 72281 A2( 72282 $author$project$UI$Shell$pageShell, 72283 { 72284 a9: $author$project$Main$NavigateTo($author$project$Route$Home), 72285 ba: $author$project$Translations$receiveTitle(i18n) 72286 }, 72287 A4( 72288 $author$project$Page$Receive$view, 72289 i18n, 72290 { 72291 mh: $author$project$Main$displayDomain(model.aZ), 72292 bP: model.bP, 72293 jv: $author$project$Main$NavigateTo($author$project$Route$Home), 72294 pR: !$author$project$Main$canReceiveHandoff(model), 72295 ko: A2($elm$core$Maybe$map, $author$project$Main$displayDomain, model.nO) 72296 }, 72297 $author$project$Main$ReceiveMsg, 72298 model.av))); 72299 case 6: 72300 if (!_v0.b.$) { 72301 return noOverlay( 72302 A2( 72303 $author$project$UI$Shell$pageShell, 72304 { 72305 a9: $author$project$Main$GoBack, 72306 ba: $author$project$Translations$shellJoinGroup(i18n) 72307 }, 72308 A3( 72309 $author$project$Page$JoinGroup$view, 72310 i18n, 72311 { 72312 jv: $author$project$Main$NavigateTo($author$project$Route$Home), 72313 o_: $author$project$Main$RetryJoinFetch, 72314 gY: $author$project$Main$SwitchLanguage, 72315 d3: $author$project$Main$JoinGroupMsg 72316 }, 72317 model.z))); 72318 } else { 72319 var groupView = _v0.b; 72320 return A3( 72321 $author$project$Page$Group$view, 72322 { 72323 mi: readyData.mi, 72324 aJ: i18n, 72325 oG: $author$project$Main$GoBack, 72326 oP: $author$project$Main$NavigateTo($author$project$Route$Home), 72327 gY: $author$project$Main$SwitchLanguage, 72328 aZ: model.aZ, 72329 g6: $author$project$PwaState$pushIsActive(model.G), 72330 jQ: !_Utils_eq( 72331 $author$project$PwaState$pushServerUrl(model.G), 72332 $elm$core$Maybe$Nothing), 72333 fr: readyData.fr, 72334 al: model.al, 72335 d3: $author$project$Main$GroupMsg, 72336 qV: A2($author$project$Domain$Date$posixToDate, model.al, model.ap) 72337 }, 72338 groupView, 72339 model.u); 72340 } 72341 case 7: 72342 return noOverlay( 72343 A2( 72344 $author$project$UI$Shell$pageShell, 72345 { 72346 a9: $author$project$Main$NavigateTo($author$project$Route$Home), 72347 ba: $author$project$Translations$aboutTitle(i18n) 72348 }, 72349 A3( 72350 $author$project$Page$About$view, 72351 i18n, 72352 { 72353 mi: readyData.mi, 72354 gd: A2( 72355 $elm$core$Maybe$map, 72356 function ($) { 72357 return $.aK; 72358 }, 72359 readyData.O), 72360 bN: model.bN, 72361 oM: $author$project$Main$MarkChangelogSeen, 72362 oZ: $author$project$Main$ResetFeedbackPrompts, 72363 gY: $author$project$Main$SwitchLanguage, 72364 o5: $author$project$Main$ToggleDevMode, 72365 g6: $author$project$PwaState$pushIsActive(model.G), 72366 g7: $author$project$PwaState$pushServerUrl(model.G), 72367 pG: $author$project$PwaState$notificationUnavailable(model.G), 72368 d3: $author$project$Main$AboutMsg 72369 }, 72370 model.W))); 72371 case 8: 72372 return noOverlay($author$project$Ui$none); 72373 default: 72374 return noOverlay( 72375 A2( 72376 $author$project$UI$Shell$pageShell, 72377 { 72378 a9: $author$project$Main$NavigateTo($author$project$Route$Home), 72379 ba: $author$project$Translations$shellPartage(i18n) 72380 }, 72381 $author$project$Page$NotFound$view(i18n))); 72382 } 72383 }); 72384var $author$project$Main$viewPage = function (model) { 72385 var noOverlay = function (content) { 72386 return {ew: content, g$: $elm$core$Maybe$Nothing}; 72387 }; 72388 var _v0 = model.d; 72389 if (_v0.$ === 8) { 72390 return noOverlay( 72391 A2( 72392 $author$project$UI$Shell$pageShell, 72393 { 72394 a9: $author$project$Main$GoBack, 72395 ba: $author$project$Translations$errorLogTitle(model.aJ) 72396 }, 72397 $author$project$Page$ErrorLog$view( 72398 { 72399 b: function () { 72400 var _v1 = model.b; 72401 switch (_v1.$) { 72402 case 0: 72403 return 'Loading'; 72404 case 2: 72405 return 'InitError'; 72406 default: 72407 return 'Ready'; 72408 } 72409 }(), 72410 ap: model.ap, 72411 bJ: model.bJ, 72412 eN: function () { 72413 var _v2 = model.b; 72414 if (_v2.$ === 1) { 72415 var readyData = _v2.a; 72416 return $elm$core$Dict$values(readyData.eN); 72417 } else { 72418 return _List_Nil; 72419 } 72420 }(), 72421 aJ: model.aJ, 72422 oY: $author$project$Main$feedbackEnabled(model) ? $elm$core$Maybe$Just($author$project$Main$ReportIssue) : $elm$core$Maybe$Nothing, 72423 al: model.al 72424 }
72424))); 72425 } else { 72426 var _v3 = model.b; 72427 switch (_v3.$) { 72428 case 0: 72429 return noOverlay( 72430 $author$project$Page$Loading$view(model.aJ)); 72431 case 2: 72432 var errorMsg = _v3.a; 72433 return noOverlay( 72434 A2( 72435 $author$project$UI$Shell$pageShell, 72436 { 72437 a9: $author$project$Main$NavigateTo($author$project$Route$Home), 72438 ba: $author$project$Translations$shellPartage(model.aJ) 72439 }, 72440 A2($author$project$Page$InitError$view, model.aJ, errorMsg))); 72441 default: 72442 var readyData = _v3.a; 72443 return A2($author$project$Main$viewReady, model, readyData); 72444 } 72445 } 72446}; 72447var $author$project$Main$DismissFeedbackPrompt = {$: 41}; 72448var $author$project$Translations$feedbackPromptAnswer = function (_v0) { 72449 var lang = _v0; 72450 if (!lang) { 72451 return 'Answer'; 72452 } else { 72453 return 'Répondre'; 72454 } 72455}; 72456var $author$project$UI$Components$feedbackPromptBanner = F2( 72457 function (i18n, _v0) { 72458 var question = _v0.pI; 72459 var onAnswer = _v0.on; 72460 var onDismiss = _v0.ot; 72461 return A2( 72462 $author$project$UI$Components$pwaBanner, 72463 question, 72464 { 72465 k5: $elm$core$Maybe$Just( 72466 _Utils_Tuple2( 72467 $author$project$Translations$feedbackPromptAnswer(i18n), 72468 _List_fromArray( 72469 [ 72470 $author$project$Ui$Input$button(onAnswer) 72471 ]))), 72472 fW: $author$project$UI$Theme$success.qR, 72473 Y: $elm$core$Maybe$Just(onDismiss), 72474 hv: $author$project$UI$Theme$success.qI 72475 }); 72476 }); 72477var $author$project$Translations$feedbackPromptConcluded = function (_v0) { 72478 var lang = _v0; 72479 if (!lang) { 72480 return 'This group is nearly settled. Do you like the app? Any feedback?'; 72481 } else { 72482 return 'Ce groupe est presque soldé. L\'app te plaît ? Un retour à nous faire ?'; 72483 } 72484}; 72485var $author$project$Translations$feedbackPromptProlific = F2( 72486 function (count, _v0) { 72487 var lang = _v0; 72488 if (!lang) { 72489 return 'Congrats, you\'ve reached ' + (count + ' shared expenses! Do you like the app? Any feedback?'); 72490 } else { 72491 return 'Bravo, tu as atteint ' + (count + ' dépenses partagées ! L\'app te plaît ? Un retour à nous faire ?'); 72492 } 72493 }); 72494var $author$project$Translations$feedbackPromptRefusal = function (_v0) { 72495 var lang = _v0; 72496 if (!lang) { 72497 return 'Some members of this group never joined. Do you know why?'; 72498 } else { 72499 return 'Certains membres de ce groupe n\'ont jamais rejoint l\'app. Sais-tu pourquoi ?'; 72500 } 72501}; 72502var $author$project$Main$feedbackQuestion = F2( 72503 function (i18n, trigger) { 72504 switch (trigger) { 72505 case 0: 72506 return $author$project$Translations$feedbackPromptConcluded(i18n); 72507 case 1: 72508 return A2( 72509 $author$project$Translations$feedbackPromptProlific, 72510 $elm$core$String$fromInt($author$project$Domain$FeedbackMoment$prolificEntries), 72511 i18n); 72512 default: 72513 return $author$project$Translations$feedbackPromptRefusal(i18n); 72514 } 72515 }); 72516var $author$project$Changelog$hasUnseen = function (marker) { 72517 if (marker.$ === 1) { 72518 return false; 72519 } else { 72520 var seen = marker.a; 72521 return _Utils_cmp(seen, $author$project$Changelog$Latest$date) < 0; 72522 } 72523}; 72524var $author$project$Main$pendingPrompt = function (model) { 72525 var _v0 = _Utils_Tuple2(model.bL, model.d); 72526 if ((!_v0.a.$) && (_v0.b.$ === 6)) { 72527 var prompt = _v0.a.a; 72528 var _v1 = _v0.b; 72529 var groupId = _v1.a; 72530 return _Utils_eq(prompt.ct, groupId) ? $elm$core$Maybe$Just(prompt.a2) : $elm$core$Maybe$Nothing; 72531 } else { 72532 return $elm$core$Maybe$Nothing; 72533 } 72534}; 72535var $author$project$Translations$changelogBanner = function (_v0) { 72536 var lang = _v0; 72537 if (!lang) { 72538 return 'Partage has been updated.'; 72539 } else { 72540 return 'Partage a été mis à jour.'; 72541 } 72542}; 72543var $author$project$UI$Components$whatsNewBanner = F2( 72544 function (i18n, onSeen) { 72545 return A2( 72546 $author$project$UI$Components$pwaBanner, 72547 $author$project$Translations$changelogBanner(i18n), 72548 { 72549 k5: $elm$core$Maybe$Just( 72550 _Utils_Tuple2( 72551 $author$project$Translations$changelogTitle(i18n), 72552 A2( 72553 $elm$core$List$cons, 72554 $author$project$Ui$Events$onClick(onSeen), 72555 $author$project$UI$Components$staticPageNewTabLinkAttrs( 72556 $author$project$UI$Components$changelogPath(i18n))))), 72557 fW: $author$project$UI$Theme$primary.qR, 72558 Y: $elm$core$Maybe$Just(onSeen), 72559 hv: $author$project$UI$Theme$primary.qI 72560 }); 72561 }); 72562var $author$project$Main$viewPromptBanner = function (model) { 72563 var _v0 = _Utils_Tuple2( 72564 $author$project$Main$pendingPrompt(model), 72565 model.b); 72566 if (!_v0.a.$) { 72567 var trigger = _v0.a.a; 72568 return A2( 72569 $author$project$UI$Components$feedbackPromptBanner, 72570 model.aJ, 72571 { 72572 on: $author$project$Main$OpenFeedback, 72573 ot: $author$project$Main$DismissFeedbackPrompt, 72574 pI: A2($author$project$Main$feedbackQuestion, model.aJ, trigger) 72575 }); 72576 } else { 72577 if (_v0.b.$ === 1) { 72578 var _v1 = _v0.a; 72579 var readyData = _v0.b.a; 72580 return $author$project$Changelog$hasUnseen(readyData.eY) ? A2($author$project$UI$Components$whatsNewBanner, model.aJ, $author$project$Main$MarkChangelogSeen) : $author$project$Ui$none; 72581 } else { 72582 var _v2 = _v0.a; 72583 return $author$project$Ui$none; 72584 } 72585 } 72586}; 72587var $author$project$Ui$widthMax = function (x) { 72588 return A2( 72589 $author$project$Internal$Model2$styleAndClass, 72590 $author$project$Internal$Flag$skip, 72591 { 72592 f: $author$project$Internal$Style2$classes.rh, 72593 qz: 'max-width', 72594 qA: $author$project$Internal$Style2$px(x) 72595 }); 72596}; 72597var $author$project$Ui$withBreakpoints = F2( 72598 function (_v0, _v1) { 72599 var breaks = _v0; 72600 var opts = _v1; 72601 return _Utils_update( 72602 opts, 72603 { 72604 c9: $elm$core$Maybe$Just(breaks.c9) 72605 }); 72606 }); 72607var $author$project$Main$view = function (model) { 72608 var pageResult = $author$project$Main$viewPage(model); 72609 var innerAppArea = _List_fromArray( 72610 [ 72611 $author$project$Ui$centerX, 72612 $author$project$Ui$widthMax($author$project$UI$Theme$contentMaxWidth), 72613 $author$project$Ui$width($author$project$Ui$fill), 72614 A2( 72615 $author$project$Ui$Responsive$paddingXY, 72616 $author$project$UI$Theme$breakpoints, 72617 function (bp) { 72618 if (!bp) { 72619 return { 72620 rm: $author$project$Ui$Responsive$value($author$project$UI$Theme$spacing.aW), 72621 k0: $author$project$Ui$Responsive$value(0) 72622 }; 72623 } else { 72624 return { 72625 rm: $author$project$Ui$Responsive$value($author$project$UI$Theme$spacing.hE), 72626 k0: $author$project$Ui$Responsive$value(0) 72627 }; 72628 } 72629 }) 72630 ]); 72631 var overlayAttr = function () { 72632 var _v1 = pageResult.g$; 72633 if (!_v1.$) {
72634 var overlay = _v1.a; 72635 return $author$project$Ui$inFront( 72636 A2( 72637 $author$project$Ui$el, 72638 A2($elm$core$List$cons, $author$project$Ui$alignBottom, innerAppArea), 72639 overlay)); 72640 } else { 72641 return $author$project$Ui$noAttr; 72642 } 72643 }(); 72644 var toasts = $author$project$Ui$inFront( 72645 A2( 72646 $author$project$Ui$el, 72647 A2( 72648 $elm$core$List$cons, 72649 $author$project$Ui$alignBottom, 72650 A2( 72651 $elm$core$List$cons, 72652 $author$project$Ui$htmlAttribute( 72653 A2($elm$html$Html$Attributes$style, 'pointer-events', 'none')), 72654 innerAppArea)), 72655 $author$project$UI$Toast$view(model.b7))); 72656 var edgeTabs = $author$project$Ui$inFront( 72657 A2( 72658 $author$project$Ui$column, 72659 _List_fromArray( 72660 [ 72661 $author$project$Ui$alignRight, 72662 $author$project$Ui$centerY, 72663 $author$project$Ui$width($author$project$Ui$shrink), 72664 $author$project$Ui$spacing($author$project$UI$Theme$spacing.qk) 72665 ]), 72666 _List_fromArray( 72667 [ 72668 ((model.bJ.dW > 0) && (!_Utils_eq(model.d, $author$project$Route$ErrorLog))) ? $author$project$Main$edgeTab( 72669 { 72670 fU: $author$project$Ui$background($author$project$UI$Theme$danger.kl), 72671 gv: $feathericons$elm_feather$FeatherIcons$alertTriangle, 72672 i6: $author$project$Translations$errorLogOpenLabel(model.aJ), 72673 e7: $author$project$Main$NavigateTo($author$project$Route$ErrorLog) 72674 }) : $author$project$Ui$none, 72675 $author$project$Main$feedbackEnabled(model) ? $author$project$Main$edgeTab( 72676 { 72677 fU: $author$project$Ui$backgroundGradient( 72678 _List_fromArray( 72679 [ 72680 A2( 72681 $author$project$Ui$Gradient$linear, 72682 $author$project$Ui$turns(0.25), 72683 _List_fromArray( 72684 [ 72685 A2( 72686 $author$project$Ui$Gradient$percent, 72687 0, 72688 A4($author$project$Ui$rgba, 122, 117, 112, 0.8)), 72689 A2($author$project$Ui$Gradient$percent, 100, $author$project$UI$Theme$base.kl) 72690 ])) 72691 ])), 72692 gv: $feathericons$elm_feather$FeatherIcons$messageSquare, 72693 i6: $author$project$Translations$feedbackOpenLabel(model.aJ), 72694 e7: $author$project$Main$OpenFeedback 72695 }) : $author$project$Ui$none 72696 ]))); 72697 return A3( 72698 $author$project$Ui$layout, 72699 A2($author$project$Ui$withBreakpoints, $author$project$UI$Theme$breakpoints, $author$project$Ui$default), 72700 _List_fromArray( 72701 [ 72702 $author$project$Ui$background($author$project$UI$Theme$base.h$), 72703 $author$project$UI$Theme$fontFamily, 72704 $author$project$Ui$Font$color($author$project$UI$Theme$base.qI), 72705 $author$project$Ui$Font$size($author$project$UI$Theme$font.aW), 72706 overlayAttr, 72707 toasts, 72708 edgeTabs 72709 ]), 72710 A2( 72711 $author$project$Ui$el, 72712 _List_fromArray( 72713 [ 72714 $author$project$Ui$background($author$project$UI$Theme$base.h$) 72715 ]), 72716 A2( 72717 $author$project$Ui$column, 72718 _List_fromArray( 72719 [ 72720 $author$project$Ui$widthMax($author$project$UI$Theme$contentMaxWidth), 72721 $author$project$Ui$centerX, 72722 $author$project$Ui$htmlAttribute( 72723 A2($elm$html$Html$Attributes$style, 'min-height', '100dvh')), 72724 A2( 72725 $author$project$Ui$Responsive$paddingEach, 72726 $author$project$UI$Theme$breakpoints, 72727 function (bp) { 72728 if (!bp) { 72729 return { 72730 lI: $author$project$Ui$Responsive$value(0), 72731 nz: $author$project$Ui$Responsive$value($author$project$UI$Theme$spacing.aW), 72732 pW: $author$project$Ui$Responsive$value($author$project$UI$Theme$spacing.aW), 72733 qW: $author$project$Ui$Responsive$value($author$project$UI$Theme$spacing.aW) 72734 }; 72735 } else { 72736 return { 72737 lI: $author$project$Ui$Responsive$value(0), 72738 nz: $author$project$Ui$Responsive$value($author$project$UI$Theme$spacing.hE), 72739 pW: $author$project$Ui$Responsive$value($author$project$UI$Theme$spacing.hE), 72740 qW: $author$project$Ui$Responsive$value($author$project$UI$Theme$spacing.aW) 72741 }; 72742 } 72743 }) 72744 ]), 72745 _List_fromArray( 72746 [ 72747 A2( 72748 $author$project$Ui$map, 72749 $author$project$Main$PwaStateMsg, 72750 A2($author$project$PwaState$viewBanners, model.aJ, model.G)), 72751 $author$project$Main$viewPromptBanner(model), 72752 pageResult.ew 72753 ])))); 72754}; 72755var $author$project$Main$main = $elm$browser$Browser$element( 72756 {iZ: $author$project$Main$init, qC: $author$project$Main$subscriptions, q2: $author$project$Main$update, rb: $author$project$Main$view}); 72757_Platform_export({'Main':{'init':$author$project$Main$main( 72758 A2( 72759 $elm$json$Json$Decode$andThen, 72760 function (serverUrl) { 72761 return A2( 72762 $elm$json$Json$Decode$andThen, 72763 function (origin) { 72764 return A2( 72765 $elm$json$Json$Decode$andThen, 72766 function (language) { 72767 return A2( 72768 $elm$json$Json$Decode$andThen, 72769 function (isStandalone) { 72770 return A2( 72771 $elm$json$Json$Decode$andThen, 72772 function (isOnline) { 72773 return A2( 72774 $elm$json$Json$Decode$andThen, 72775 function (isIos) { 72776 return A2( 72777 $elm$json$Json$Decode$andThen, 72778 function (installHint) { 72779 return A2( 72780 $elm$json$Json$Decode$andThen, 72781 function (initialUrl) { 72782 return A2( 72783 $elm$json$Json$Decode$andThen, 72784 function (inHostAppWindow) { 72785 return A2( 72786 $elm$json$Json$Decode$andThen, 72787 function (idEntropy) { 72788 return A2( 72789 $elm$json$Json$Decode$andThen,
72790 function (gitSha) { 72791 return A2( 72792 $elm$json$Json$Decode$andThen, 72793 function (currentTime) { 72794 return $elm$json$Json$Decode$succeed( 72795 {ap: currentTime, bN: gitSha, gw: idEntropy, bP: inHostAppWindow, gy: initialUrl, eT: installHint, bQ: isIos, dk: isOnline, cx: isStandalone, eX: language, aZ: origin, hl: serverUrl}); 72796 }, 72797 A2($elm$json$Json$Decode$field, 'currentTime', $elm$json$Json$Decode$int)); 72798 }, 72799 A2($elm$json$Json$Decode$field, 'gitSha', $elm$json$Json$Decode$string)); 72800 }, 72801 A2( 72802 $elm$json$Json$Decode$field, 72803 'idEntropy', 72804 A2( 72805 $elm$json$Json$Decode$andThen, 72806 function (seed4) { 72807 return A2( 72808 $elm$json$Json$Decode$andThen, 72809 function (seed3) { 72810 return A2( 72811 $elm$json$Json$Decode$andThen, 72812 function (seed2) { 72813 return A2( 72814 $elm$json$Json$Decode$andThen, 72815 function (seed1) { 72816 return $elm$json$Json$Decode$succeed( 72817 {hf: seed1, hg: seed2, hh: seed3, hi: seed4}); 72818 }, 72819 A2($elm$json$Json$Decode$field, 'seed1', $elm$json$Json$Decode$int)); 72820 }, 72821 A2($elm$json$Json$Decode$field, 'seed2', $elm$json$Json$Decode$int)); 72822 }, 72823 A2($elm$json$Json$Decode$field, 'seed3', $elm$json$Json$Decode$int)); 72824 }, 72825 A2($elm$json$Json$Decode$field, 'seed4', $elm$json$Json$Decode$int)))); 72826 }, 72827 A2($elm$json$Json$Decode$field, 'inHostAppWindow', $elm$json$Json$Decode$bool)); 72828 }, 72829 A2($elm$json$Json$Decode$field, 'initialUrl', $elm$json$Json$Decode$string)); 72830 }, 72831 A2($elm$json$Json$Decode$field, 'installHint', $elm$json$Json$Decode$string)); 72832 }, 72833 A2($elm$json$Json$Decode$field, 'isIos', $elm$json$Json$Decode$bool)); 72834 }, 72835 A2($elm$json$Json$Decode$field, 'isOnline', $elm$json$Json$Decode$bool)); 72836 }, 72837 A2($elm$json$Json$Decode$field, 'isStandalone', $elm$json$Json$Decode$bool)); 72838 }, 72839 A2($elm$json$Json$Decode$field, 'language', $elm$json$Json$Decode$string)); 72840 }, 72841 A2($elm$json$Json$Decode$field, 'origin', $elm$json$Json$Decode$string)); 72842 }, 72843 A2($elm$json$Json$Decode$field, 'serverUrl', $elm$json$Json$Decode$string)))(0)}});}(this));
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.