-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
2104 lines (2052 loc) · 61.9 KB
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
(() => {
// output/Data.Argonaut.Core/foreign.js
function id(x) {
return x;
}
var jsonNull = null;
function stringify(j) {
return JSON.stringify(j);
}
function isArray(a) {
return Object.prototype.toString.call(a) === "[object Array]";
}
function _caseJson(isNull2, isBool, isNum, isStr, isArr, isObj, j) {
if (j == null) return isNull2();
else if (typeof j === "boolean") return isBool(j);
else if (typeof j === "number") return isNum(j);
else if (typeof j === "string") return isStr(j);
else if (Object.prototype.toString.call(j) === "[object Array]")
return isArr(j);
else return isObj(j);
}
function _compare(EQ2, GT2, LT2, a, b) {
if (a == null) {
if (b == null) return EQ2;
else return LT2;
} else if (typeof a === "boolean") {
if (typeof b === "boolean") {
if (a === b) return EQ2;
else if (a === false) return LT2;
else return GT2;
} else if (b == null) return GT2;
else return LT2;
} else if (typeof a === "number") {
if (typeof b === "number") {
if (a === b) return EQ2;
else if (a < b) return LT2;
else return GT2;
} else if (b == null) return GT2;
else if (typeof b === "boolean") return GT2;
else return LT2;
} else if (typeof a === "string") {
if (typeof b === "string") {
if (a === b) return EQ2;
else if (a < b) return LT2;
else return GT2;
} else if (b == null) return GT2;
else if (typeof b === "boolean") return GT2;
else if (typeof b === "number") return GT2;
else return LT2;
} else if (isArray(a)) {
if (isArray(b)) {
for (var i = 0; i < Math.min(a.length, b.length); i++) {
var ca = _compare(EQ2, GT2, LT2, a[i], b[i]);
if (ca !== EQ2) return ca;
}
if (a.length === b.length) return EQ2;
else if (a.length < b.length) return LT2;
else return GT2;
} else if (b == null) return GT2;
else if (typeof b === "boolean") return GT2;
else if (typeof b === "number") return GT2;
else if (typeof b === "string") return GT2;
else return LT2;
} else {
if (b == null) return GT2;
else if (typeof b === "boolean") return GT2;
else if (typeof b === "number") return GT2;
else if (typeof b === "string") return GT2;
else if (isArray(b)) return GT2;
else {
var akeys = Object.keys(a);
var bkeys = Object.keys(b);
if (akeys.length < bkeys.length) return LT2;
else if (akeys.length > bkeys.length) return GT2;
var keys3 = akeys.concat(bkeys).sort();
for (var j = 0; j < keys3.length; j++) {
var k = keys3[j];
if (a[k] === void 0) return LT2;
else if (b[k] === void 0) return GT2;
var ck = _compare(EQ2, GT2, LT2, a[k], b[k]);
if (ck !== EQ2) return ck;
}
return EQ2;
}
}
}
// output/Data.Eq/foreign.js
var refEq = function(r1) {
return function(r2) {
return r1 === r2;
};
};
var eqBooleanImpl = refEq;
var eqArrayImpl = function(f) {
return function(xs) {
return function(ys) {
if (xs.length !== ys.length) return false;
for (var i = 0; i < xs.length; i++) {
if (!f(xs[i])(ys[i])) return false;
}
return true;
};
};
};
// output/Type.Proxy/index.js
var $$Proxy = /* @__PURE__ */ function() {
function $$Proxy2() {
}
;
$$Proxy2.value = new $$Proxy2();
return $$Proxy2;
}();
// output/Data.Symbol/index.js
var reflectSymbol = function(dict) {
return dict.reflectSymbol;
};
// output/Record.Unsafe/foreign.js
var unsafeGet = function(label4) {
return function(rec) {
return rec[label4];
};
};
var unsafeSet = function(label4) {
return function(value12) {
return function(rec) {
var copy = {};
for (var key in rec) {
if ({}.hasOwnProperty.call(rec, key)) {
copy[key] = rec[key];
}
}
copy[label4] = value12;
return copy;
};
};
};
// output/Data.Eq/index.js
var eqBoolean = {
eq: eqBooleanImpl
};
var eq = function(dict) {
return dict.eq;
};
var eq2 = /* @__PURE__ */ eq(eqBoolean);
var eqArray = function(dictEq) {
return {
eq: eqArrayImpl(eq(dictEq))
};
};
var notEq = function(dictEq) {
var eq32 = eq(dictEq);
return function(x) {
return function(y) {
return eq2(eq32(x)(y))(false);
};
};
};
// output/Control.Semigroupoid/index.js
var semigroupoidFn = {
compose: function(f) {
return function(g) {
return function(x) {
return f(g(x));
};
};
}
};
// output/Control.Category/index.js
var identity = function(dict) {
return dict.identity;
};
var categoryFn = {
identity: function(x) {
return x;
},
Semigroupoid0: function() {
return semigroupoidFn;
}
};
// output/Data.Function/index.js
var $$const = function(a) {
return function(v) {
return a;
};
};
// output/Data.Functor/foreign.js
var arrayMap = function(f) {
return function(arr) {
var l = arr.length;
var result = new Array(l);
for (var i = 0; i < l; i++) {
result[i] = f(arr[i]);
}
return result;
};
};
// output/Data.Unit/foreign.js
var unit = void 0;
// output/Data.Functor/index.js
var map = function(dict) {
return dict.map;
};
var functorArray = {
map: arrayMap
};
// output/Data.Semigroup/foreign.js
var concatArray = function(xs) {
return function(ys) {
if (xs.length === 0) return ys;
if (ys.length === 0) return xs;
return xs.concat(ys);
};
};
// output/Data.Semigroup/index.js
var semigroupArray = {
append: concatArray
};
var append = function(dict) {
return dict.append;
};
// output/Control.Applicative/index.js
var pure = function(dict) {
return dict.pure;
};
var when = function(dictApplicative) {
var pure1 = pure(dictApplicative);
return function(v) {
return function(v1) {
if (v) {
return v1;
}
;
if (!v) {
return pure1(unit);
}
;
throw new Error("Failed pattern match at Control.Applicative (line 63, column 1 - line 63, column 63): " + [v.constructor.name, v1.constructor.name]);
};
};
};
// output/Data.Bounded/foreign.js
var topChar = String.fromCharCode(65535);
var bottomChar = String.fromCharCode(0);
var topNumber = Number.POSITIVE_INFINITY;
var bottomNumber = Number.NEGATIVE_INFINITY;
// output/Data.Ordering/index.js
var LT = /* @__PURE__ */ function() {
function LT2() {
}
;
LT2.value = new LT2();
return LT2;
}();
var GT = /* @__PURE__ */ function() {
function GT2() {
}
;
GT2.value = new GT2();
return GT2;
}();
var EQ = /* @__PURE__ */ function() {
function EQ2() {
}
;
EQ2.value = new EQ2();
return EQ2;
}();
var eqOrdering = {
eq: function(v) {
return function(v1) {
if (v instanceof LT && v1 instanceof LT) {
return true;
}
;
if (v instanceof GT && v1 instanceof GT) {
return true;
}
;
if (v instanceof EQ && v1 instanceof EQ) {
return true;
}
;
return false;
};
}
};
// output/Data.Ord/index.js
var compare = function(dict) {
return dict.compare;
};
// output/Data.Show/foreign.js
var showIntImpl = function(n) {
return n.toString();
};
var showStringImpl = function(s) {
var l = s.length;
return '"' + s.replace(
/[\0-\x1F\x7F"\\]/g,
// eslint-disable-line no-control-regex
function(c, i) {
switch (c) {
case '"':
case "\\":
return "\\" + c;
case "\x07":
return "\\a";
case "\b":
return "\\b";
case "\f":
return "\\f";
case "\n":
return "\\n";
case "\r":
return "\\r";
case " ":
return "\\t";
case "\v":
return "\\v";
}
var k = i + 1;
var empty4 = k < l && s[k] >= "0" && s[k] <= "9" ? "\\&" : "";
return "\\" + c.charCodeAt(0).toString(10) + empty4;
}
) + '"';
};
// output/Data.Show/index.js
var showString = {
show: showStringImpl
};
var showRecordFields = function(dict) {
return dict.showRecordFields;
};
var showRecord = function() {
return function() {
return function(dictShowRecordFields) {
var showRecordFields1 = showRecordFields(dictShowRecordFields);
return {
show: function(record) {
return "{" + (showRecordFields1($$Proxy.value)(record) + "}");
}
};
};
};
};
var showInt = {
show: showIntImpl
};
var show = function(dict) {
return dict.show;
};
var showRecordFieldsConsNil = function(dictIsSymbol) {
var reflectSymbol2 = reflectSymbol(dictIsSymbol);
return function(dictShow) {
var show13 = show(dictShow);
return {
showRecordFields: function(v) {
return function(record) {
var key = reflectSymbol2($$Proxy.value);
var focus2 = unsafeGet(key)(record);
return " " + (key + (": " + (show13(focus2) + " ")));
};
}
};
};
};
// output/Data.Generic.Rep/index.js
var Inl = /* @__PURE__ */ function() {
function Inl2(value0) {
this.value0 = value0;
}
;
Inl2.create = function(value0) {
return new Inl2(value0);
};
return Inl2;
}();
var Inr = /* @__PURE__ */ function() {
function Inr2(value0) {
this.value0 = value0;
}
;
Inr2.create = function(value0) {
return new Inr2(value0);
};
return Inr2;
}();
var Argument = function(x) {
return x;
};
var to = function(dict) {
return dict.to;
};
var from = function(dict) {
return dict.from;
};
// output/Data.Maybe/index.js
var Nothing = /* @__PURE__ */ function() {
function Nothing2() {
}
;
Nothing2.value = new Nothing2();
return Nothing2;
}();
var Just = /* @__PURE__ */ function() {
function Just2(value0) {
this.value0 = value0;
}
;
Just2.create = function(value0) {
return new Just2(value0);
};
return Just2;
}();
var maybe = function(v) {
return function(v1) {
return function(v2) {
if (v2 instanceof Nothing) {
return v;
}
;
if (v2 instanceof Just) {
return v1(v2.value0);
}
;
throw new Error("Failed pattern match at Data.Maybe (line 237, column 1 - line 237, column 51): " + [v.constructor.name, v1.constructor.name, v2.constructor.name]);
};
};
};
var functorMaybe = {
map: function(v) {
return function(v1) {
if (v1 instanceof Just) {
return new Just(v(v1.value0));
}
;
return Nothing.value;
};
}
};
// output/Foreign.Object/foreign.js
function _copyST(m) {
return function() {
var r = {};
for (var k in m) {
if (hasOwnProperty.call(m, k)) {
r[k] = m[k];
}
}
return r;
};
}
var empty = {};
function runST(f) {
return f();
}
function _lookup(no, yes, k, m) {
return k in m ? yes(m[k]) : no;
}
function toArrayWithKey(f) {
return function(m) {
var r = [];
for (var k in m) {
if (hasOwnProperty.call(m, k)) {
r.push(f(k)(m[k]));
}
}
return r;
};
}
var keys = Object.keys || toArrayWithKey(function(k) {
return function() {
return k;
};
});
// output/Control.Bind/index.js
var discard = function(dict) {
return dict.discard;
};
var bind = function(dict) {
return dict.bind;
};
var discardUnit = {
discard: function(dictBind) {
return bind(dictBind);
}
};
// output/Data.Either/index.js
var Left = /* @__PURE__ */ function() {
function Left2(value0) {
this.value0 = value0;
}
;
Left2.create = function(value0) {
return new Left2(value0);
};
return Left2;
}();
var Right = /* @__PURE__ */ function() {
function Right2(value0) {
this.value0 = value0;
}
;
Right2.create = function(value0) {
return new Right2(value0);
};
return Right2;
}();
var showEither = function(dictShow) {
var show4 = show(dictShow);
return function(dictShow1) {
var show13 = show(dictShow1);
return {
show: function(v) {
if (v instanceof Left) {
return "(Left " + (show4(v.value0) + ")");
}
;
if (v instanceof Right) {
return "(Right " + (show13(v.value0) + ")");
}
;
throw new Error("Failed pattern match at Data.Either (line 173, column 1 - line 175, column 46): " + [v.constructor.name]);
}
};
};
};
var note = function(a) {
return maybe(new Left(a))(Right.create);
};
var functorEither = {
map: function(f) {
return function(m) {
if (m instanceof Left) {
return new Left(m.value0);
}
;
if (m instanceof Right) {
return new Right(f(m.value0));
}
;
throw new Error("Failed pattern match at Data.Either (line 0, column 0 - line 0, column 0): " + [m.constructor.name]);
};
}
};
var map2 = /* @__PURE__ */ map(functorEither);
var either = function(v) {
return function(v1) {
return function(v2) {
if (v2 instanceof Left) {
return v(v2.value0);
}
;
if (v2 instanceof Right) {
return v1(v2.value0);
}
;
throw new Error("Failed pattern match at Data.Either (line 208, column 1 - line 208, column 64): " + [v.constructor.name, v1.constructor.name, v2.constructor.name]);
};
};
};
var applyEither = {
apply: function(v) {
return function(v1) {
if (v instanceof Left) {
return new Left(v.value0);
}
;
if (v instanceof Right) {
return map2(v.value0)(v1);
}
;
throw new Error("Failed pattern match at Data.Either (line 70, column 1 - line 72, column 30): " + [v.constructor.name, v1.constructor.name]);
};
},
Functor0: function() {
return functorEither;
}
};
var bindEither = {
bind: /* @__PURE__ */ either(function(e) {
return function(v) {
return new Left(e);
};
})(function(a) {
return function(f) {
return f(a);
};
}),
Apply0: function() {
return applyEither;
}
};
var applicativeEither = /* @__PURE__ */ function() {
return {
pure: Right.create,
Apply0: function() {
return applyEither;
}
};
}();
// output/Data.Array/foreign.js
var replicateFill = function(count, value12) {
if (count < 1) {
return [];
}
var result = new Array(count);
return result.fill(value12);
};
var replicatePolyfill = function(count, value12) {
var result = [];
var n = 0;
for (var i = 0; i < count; i++) {
result[n++] = value12;
}
return result;
};
var replicateImpl = typeof Array.prototype.fill === "function" ? replicateFill : replicatePolyfill;
var unconsImpl = function(empty4, next, xs) {
return xs.length === 0 ? empty4({}) : next(xs[0])(xs.slice(1));
};
// output/Data.Bifunctor/index.js
var identity2 = /* @__PURE__ */ identity(categoryFn);
var bimap = function(dict) {
return dict.bimap;
};
var lmap = function(dictBifunctor) {
var bimap1 = bimap(dictBifunctor);
return function(f) {
return bimap1(f)(identity2);
};
};
var bifunctorEither = {
bimap: function(v) {
return function(v1) {
return function(v2) {
if (v2 instanceof Left) {
return new Left(v(v2.value0));
}
;
if (v2 instanceof Right) {
return new Right(v1(v2.value0));
}
;
throw new Error("Failed pattern match at Data.Bifunctor (line 32, column 1 - line 34, column 36): " + [v.constructor.name, v1.constructor.name, v2.constructor.name]);
};
};
}
};
// output/Data.Function.Uncurried/foreign.js
var runFn3 = function(fn) {
return function(a) {
return function(b) {
return function(c) {
return fn(a, b, c);
};
};
};
};
var runFn4 = function(fn) {
return function(a) {
return function(b) {
return function(c) {
return function(d) {
return fn(a, b, c, d);
};
};
};
};
};
// output/Data.Array/index.js
var uncons = /* @__PURE__ */ function() {
return runFn3(unconsImpl)($$const(Nothing.value))(function(x) {
return function(xs) {
return new Just({
head: x,
tail: xs
});
};
});
}();
// output/Foreign.Object.ST/foreign.js
function poke2(k) {
return function(v) {
return function(m) {
return function() {
m[k] = v;
return m;
};
};
};
}
// output/Foreign.Object/index.js
var thawST = _copyST;
var mutate = function(f) {
return function(m) {
return runST(function __do2() {
var s = thawST(m)();
f(s)();
return s;
});
};
};
var lookup = /* @__PURE__ */ function() {
return runFn4(_lookup)(Nothing.value)(Just.create);
}();
var insert = function(k) {
return function(v) {
return mutate(poke2(k)(v));
};
};
// output/Data.Argonaut.Core/index.js
var eq3 = /* @__PURE__ */ eq(eqOrdering);
var verbJsonType = function(def) {
return function(f) {
return function(g) {
return g(def)(f);
};
};
};
var toJsonType = /* @__PURE__ */ function() {
return verbJsonType(Nothing.value)(Just.create);
}();
var ordJson = {
compare: function(a) {
return function(b) {
return _compare(EQ.value, GT.value, LT.value, a, b);
};
},
Eq0: function() {
return eqJson;
}
};
var eqJson = {
eq: function(j1) {
return function(j2) {
return eq3(compare(ordJson)(j1)(j2))(EQ.value);
};
}
};
var caseJsonString = function(d) {
return function(f) {
return function(j) {
return _caseJson($$const(d), $$const(d), $$const(d), f, $$const(d), $$const(d), j);
};
};
};
var toString = /* @__PURE__ */ toJsonType(caseJsonString);
var caseJsonObject = function(d) {
return function(f) {
return function(j) {
return _caseJson($$const(d), $$const(d), $$const(d), $$const(d), $$const(d), f, j);
};
};
};
var toObject = /* @__PURE__ */ toJsonType(caseJsonObject);
var caseJsonArray = function(d) {
return function(f) {
return function(j) {
return _caseJson($$const(d), $$const(d), $$const(d), $$const(d), f, $$const(d), j);
};
};
};
var toArray = /* @__PURE__ */ toJsonType(caseJsonArray);
// output/Data.Argonaut.Decode.Error/index.js
var show2 = /* @__PURE__ */ show(showString);
var show1 = /* @__PURE__ */ show(showInt);
var TypeMismatch = /* @__PURE__ */ function() {
function TypeMismatch2(value0) {
this.value0 = value0;
}
;
TypeMismatch2.create = function(value0) {
return new TypeMismatch2(value0);
};
return TypeMismatch2;
}();
var UnexpectedValue = /* @__PURE__ */ function() {
function UnexpectedValue2(value0) {
this.value0 = value0;
}
;
UnexpectedValue2.create = function(value0) {
return new UnexpectedValue2(value0);
};
return UnexpectedValue2;
}();
var AtIndex = /* @__PURE__ */ function() {
function AtIndex2(value0, value1) {
this.value0 = value0;
this.value1 = value1;
}
;
AtIndex2.create = function(value0) {
return function(value1) {
return new AtIndex2(value0, value1);
};
};
return AtIndex2;
}();
var AtKey = /* @__PURE__ */ function() {
function AtKey2(value0, value1) {
this.value0 = value0;
this.value1 = value1;
}
;
AtKey2.create = function(value0) {
return function(value1) {
return new AtKey2(value0, value1);
};
};
return AtKey2;
}();
var Named = /* @__PURE__ */ function() {
function Named2(value0, value1) {
this.value0 = value0;
this.value1 = value1;
}
;
Named2.create = function(value0) {
return function(value1) {
return new Named2(value0, value1);
};
};
return Named2;
}();
var MissingValue = /* @__PURE__ */ function() {
function MissingValue2() {
}
;
MissingValue2.value = new MissingValue2();
return MissingValue2;
}();
var showJsonDecodeError = {
show: function(v) {
if (v instanceof TypeMismatch) {
return "(TypeMismatch " + (show2(v.value0) + ")");
}
;
if (v instanceof UnexpectedValue) {
return "(UnexpectedValue " + (stringify(v.value0) + ")");
}
;
if (v instanceof AtIndex) {
return "(AtIndex " + (show1(v.value0) + (" " + (show(showJsonDecodeError)(v.value1) + ")")));
}
;
if (v instanceof AtKey) {
return "(AtKey " + (show2(v.value0) + (" " + (show(showJsonDecodeError)(v.value1) + ")")));
}
;
if (v instanceof Named) {
return "(Named " + (show2(v.value0) + (" " + (show(showJsonDecodeError)(v.value1) + ")")));
}
;
if (v instanceof MissingValue) {
return "MissingValue";
}
;
throw new Error("Failed pattern match at Data.Argonaut.Decode.Error (line 24, column 10 - line 30, column 35): " + [v.constructor.name]);
}
};
var printJsonDecodeError = function(err) {
var go2 = function(v) {
if (v instanceof TypeMismatch) {
return " Expected value of type '" + (v.value0 + "'.");
}
;
if (v instanceof UnexpectedValue) {
return " Unexpected value " + (stringify(v.value0) + ".");
}
;
if (v instanceof AtIndex) {
return " At array index " + (show1(v.value0) + (":\n" + go2(v.value1)));
}
;
if (v instanceof AtKey) {
return " At object key '" + (v.value0 + ("':\n" + go2(v.value1)));
}
;
if (v instanceof Named) {
return " Under '" + (v.value0 + ("':\n" + go2(v.value1)));
}
;
if (v instanceof MissingValue) {
return " No value was found.";
}
;
throw new Error("Failed pattern match at Data.Argonaut.Decode.Error (line 37, column 8 - line 43, column 44): " + [v.constructor.name]);
};
return "An error occurred while decoding a JSON value:\n" + go2(err);
};
// output/Data.Int/foreign.js
var toNumber = function(n) {
return n;
};
// output/Data.String.CodePoints/foreign.js
var hasArrayFrom = typeof Array.from === "function";
var hasStringIterator = typeof Symbol !== "undefined" && Symbol != null && typeof Symbol.iterator !== "undefined" && typeof String.prototype[Symbol.iterator] === "function";
var hasFromCodePoint = typeof String.prototype.fromCodePoint === "function";
var hasCodePointAt = typeof String.prototype.codePointAt === "function";
// output/Data.Argonaut.Decode.Decoders/index.js
var decodeString = /* @__PURE__ */ function() {
return caseJsonString(new Left(new TypeMismatch("String")))(Right.create);
}();
// output/Record/index.js
var insert4 = function(dictIsSymbol) {
var reflectSymbol2 = reflectSymbol(dictIsSymbol);
return function() {
return function() {
return function(l) {
return function(a) {
return function(r) {
return unsafeSet(reflectSymbol2(l))(a)(r);
};
};
};
};
};
};
var get = function(dictIsSymbol) {
var reflectSymbol2 = reflectSymbol(dictIsSymbol);
return function() {
return function(l) {
return function(r) {
return unsafeGet(reflectSymbol2(l))(r);
};
};
};
};
// output/Data.Argonaut.Decode.Class/index.js
var bind2 = /* @__PURE__ */ bind(bindEither);
var lmap2 = /* @__PURE__ */ lmap(bifunctorEither);
var map3 = /* @__PURE__ */ map(functorMaybe);
var gDecodeJsonNil = {
gDecodeJson: function(v) {
return function(v1) {
return new Right({});
};
}
};
var gDecodeJson = function(dict) {
return dict.gDecodeJson;
};
var decodeRecord = function(dictGDecodeJson) {
var gDecodeJson1 = gDecodeJson(dictGDecodeJson);
return function() {
return {
decodeJson: function(json2) {
var v = toObject(json2);
if (v instanceof Just) {
return gDecodeJson1(v.value0)($$Proxy.value);
}
;
if (v instanceof Nothing) {
return new Left(new TypeMismatch("Object"));
}
;
throw new Error("Failed pattern match at Data.Argonaut.Decode.Class (line 103, column 5 - line 105, column 46): " + [v.constructor.name]);
}
};
};
};
var decodeJsonString = {