-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpaint.js
2519 lines (2519 loc) · 100 KB
/
paint.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
// Generated by js_of_ocaml 3.9.1
(function(e){"use strict";var
dE="%Li",ee=" : flags Open_text and Open_binary are not compatible",d9="Invalid_argument",bB="Map.bal",ep=180,d8="@[",eu=640,cb=1255,dY=", characters ",z=255,ej=0x800,_=0xffff,ca="jsError",Z=0x8000,d7="%ni",dX=12520,dW="(Program not linked with -g, cannot print stack backtrace)\n",ei=256,dP="End_of_file",ed="Unix.Unix_error",dO="Failure",eo="infinity",L=0xff,a8=1000,g="",d6=360,ec="Stack_overflow",cd="^",K="0",aO=0x3f,eb=-97,ea="Not_found",ch=0xf,a_=128,dM=-48,dN=0xdc00,d5="Sys_blocked_io",et="fd ",dV="Match_failure",r=248,b$=", ",d$="px ",dD="static/",w="camlinternalFormat.ml",eh="Division_by_zero",bD=252,es=1027,dL="Sys_error",d4=0xFF,aC=".",aN="+",en=0xf0,d3=246,d2="%u",cg="%d",dU="%li",d_=1026,b_=480,eg="buffer.ml",dK="Unix",ce=127,a9=1024,em=-32,d1="@{",ah=" ",U=0x80,cj="e",dC="Undefined_recursive_module",dI=120,dJ=103,d0=" : flags Open_rdonly and Open_wronly are not compatible",er="([^/]*)",dH=512,aB="-",dT="Lwt.%s",cc="nan",bA="Graphics.Graphic_failure",dG=0x7ff0,el="Lwt.",dS=0xe0,dZ=" : file already exists",dR=0xdfff,aj=0xffffff,ai="/",cf="compare: functional value",ek="Assert_failure",dF="0x",dB="%i",eq="Out_of_memory",dQ=1073741823,bC=254,ci="index out of bounds",ef=100,a7=250,bE="_bigarr02";function
bM(c,b,a){var
d=String.fromCharCode;if(b==0&&a<=4096&&a==c.length)return d.apply(null,c);var
e=g;for(;0<a;b+=a9,a-=a9)e+=d.apply(null,c.slice(b,b+Math.min(a,a9)));return e}function
bF(b){if(e.Uint8Array)var
c=new(e.Uint8Array)(b.l);else
var
c=new
Array(b.l);var
f=b.c,d=f.length,a=0;for(;a<d;a++)c[a]=f.charCodeAt(a);for(d=b.l;a<d;a++)c[a]=0;b.c=c;b.t=4;return c}function
as(d,e,b,f,c){if(c==0)return 0;if(f==0&&(c>=b.l||b.t==2&&c>=b.c.length)){b.c=d.t==4?bM(d.c,e,c):e==0&&d.c.length==c?d.c:d.c.substr(e,c);b.t=b.c.length==b.l?0:2}else
if(b.t==2&&f==b.c.length){b.c+=d.t==4?bM(d.c,e,c):e==0&&d.c.length==c?d.c:d.c.substr(e,c);b.t=b.c.length==b.l?0:2}else{if(b.t!=4)bF(b);var
g=d.c,h=b.c;if(d.t==4)if(f<=e)for(var
a=0;a<c;a++)h[f+a]=g[e+a];else
for(var
a=c-1;a>=0;a--)h[f+a]=g[e+a];else{var
i=Math.min(c,g.length-e);for(var
a=0;a<i;a++)h[f+a]=g.charCodeAt(e+a);for(;a<c;a++)h[f+a]=0}}return 0}function
at(a){return a}function
aD(a,b,c,d,e){as(at(a),b,c,d,e);return 0}function
lY(b,a){throw[0,b,a]}function
aS(b,a){if(b==0)return g;if(a.repeat)return a.repeat(b);var
d=g,c=0;for(;;){if(b&1)d+=a;b>>=1;if(b==0)return d;a+=a;c++;if(c==9)a.slice(0,1)}}function
aF(a){if(a.t==2)a.c+=aS(a.l-a.c.length,"\0");else
a.c=bM(a.c,0,a.c.length);a.t=0}function
e3(a){if(a.length<24){for(var
b=0;b<a.length;b++)if(a.charCodeAt(b)>ce)return false;return true}else
return!/[^\x00-\x7f]/.test(a)}function
cA(e){for(var
k=g,c=g,h,f,i,a,b=0,j=e.length;b<j;b++){f=e.charCodeAt(b);if(f<U){for(var
d=b+1;d<j&&(f=e.charCodeAt(d))<U;d++);if(d-b>dH){c.substr(0,1);k+=c;c=g;k+=e.slice(b,d)}else
c+=e.slice(b,d);if(d==j)break;b=d}a=1;if(++b<j&&((i=e.charCodeAt(b))&-64)==a_){h=i+(f<<6);if(f<dS){a=h-0x3080;if(a<U)a=1}else{a=2;if(++b<j&&((i=e.charCodeAt(b))&-64)==a_){h=i+(h<<6);if(f<en){a=h-0xe2080;if(a<ej||a>=0xd7ff&&a<0xe000)a=2}else{a=3;if(++b<j&&((i=e.charCodeAt(b))&-64)==a_&&f<0xf5){a=i-0x3c82080+(h<<6);if(a<0x10000||a>0x10ffff)a=3}}}}}if(a<4){b-=a;c+="\ufffd"}else
if(a>_)c+=String.fromCharCode(0xd7c0+(a>>10),dN+(a&0x3FF));else
c+=String.fromCharCode(a);if(c.length>a9){c.substr(0,1);k+=c;c=g}}return k+c}function
ak(c,a,b){this.t=c;this.c=a;this.l=b}ak.prototype.toString=function(){switch(this.t){case
9:return this.c;default:aF(this);case
0:if(e3(this.c)){this.t=9;return this.c}this.t=8;case
8:return this.c}};ak.prototype.toUtf16=function(){var
a=this.toString();if(this.t==9)return a;return cA(a)};ak.prototype.slice=function(){var
a=this.t==4?this.c.slice():this.c;return new
ak(this.t,a,this.l)};function
eE(a){return new
ak(0,a,a.length)}function
a(a){return eE(a)}function
cy(c,b){lY(c,a(b))}var
q=[0];function
u(a){cy(q.Invalid_argument,a)}function
eC(){u(ci)}function
p(a,c,b){b&=L;if(a.t!=4){if(c==a.c.length){a.c+=String.fromCharCode(b);if(c+1==a.l)a.t=0;return 0}bF(a)}a.c[c]=b;return 0}function
aE(b,a,c){if(a>>>0>=b.l)eC();return p(b,a,c)}function
ba(a,b){switch(a.t&6){default:if(b>=a.c.length)return 0;case
0:return a.c.charCodeAt(b);case
4:return a.c[b]}}function
ab(c,a){if(c.fun)return ab(c.fun,a);if(typeof
c!=="function")return c;var
b=c.length|0;if(b===0)return c.apply(null,a);var
e=a.length|0,d=b-e|0;if(d==0)return c.apply(null,a);else
if(d<0)return ab(c.apply(null,a.slice(0,b)),a.slice(b));else
return function(){var
e=arguments.length==0?1:arguments.length,d=new
Array(a.length+e);for(var
b=0;b<a.length;b++)d[b]=a[b];for(var
b=0;b<arguments.length;b++)d[a.length+b]=arguments[b];return ab(c,d)}}function
a$(){u(ci)}function
au(a,b){if(b>>>0>=a.length-1)a$();return a}function
la(a){if(isFinite(a)){if(Math.abs(a)>=2.2250738585072014e-308)return 0;if(a!=0)return 1;return 2}return isNaN(a)?4:3}function
am(a){if((a.t&6)!=0)aF(a);return a.c}var
md=Math.log2&&Math.log2(1.1235582092889474E+307)==1020;function
mc(a){if(md)return Math.floor(Math.log2(a));var
b=0;if(a==0)return-Infinity;if(a>=1)while(a>=2){a/=2;b++}else
while(a<1){a*=2;b--}return b}function
cq(c){var
a=new(e.Float32Array)(1);a[0]=c;var
b=new(e.Int32Array)(a.buffer);return b[0]|0}var
eS=Math.pow(2,-24);function
eZ(a){throw a}function
cz(){eZ(q.Division_by_zero)}function
d(b,c,a){this.lo=b&aj;this.mi=c&aj;this.hi=a&_}d.prototype.caml_custom="_j";d.prototype.copy=function(){return new
d(this.lo,this.mi,this.hi)};d.prototype.ucompare=function(a){if(this.hi>a.hi)return 1;if(this.hi<a.hi)return-1;if(this.mi>a.mi)return 1;if(this.mi<a.mi)return-1;if(this.lo>a.lo)return 1;if(this.lo<a.lo)return-1;return 0};d.prototype.compare=function(a){var
b=this.hi<<16,c=a.hi<<16;if(b>c)return 1;if(b<c)return-1;if(this.mi>a.mi)return 1;if(this.mi<a.mi)return-1;if(this.lo>a.lo)return 1;if(this.lo<a.lo)return-1;return 0};d.prototype.neg=function(){var
a=-this.lo,b=-this.mi+(a>>24),c=-this.hi+(b>>24);return new
d(a,b,c)};d.prototype.add=function(a){var
b=this.lo+a.lo,c=this.mi+a.mi+(b>>24),e=this.hi+a.hi+(c>>24);return new
d(b,c,e)};d.prototype.sub=function(a){var
b=this.lo-a.lo,c=this.mi-a.mi+(b>>24),e=this.hi-a.hi+(c>>24);return new
d(b,c,e)};d.prototype.mul=function(a){var
b=this.lo*a.lo,c=(b*eS|0)+this.mi*a.lo+this.lo*a.mi,e=(c*eS|0)+this.hi*a.lo+this.mi*a.mi+this.lo*a.hi;return new
d(b,c,e)};d.prototype.isZero=function(){return(this.lo|this.mi|this.hi)==0};d.prototype.isNeg=function(){return this.hi<<16<0};d.prototype.and=function(a){return new
d(this.lo&a.lo,this.mi&a.mi,this.hi&a.hi)};d.prototype.or=function(a){return new
d(this.lo|a.lo,this.mi|a.mi,this.hi|a.hi)};d.prototype.xor=function(a){return new
d(this.lo^a.lo,this.mi^a.mi,this.hi^a.hi)};d.prototype.shift_left=function(a){a=a&63;if(a==0)return this;if(a<24)return new
d(this.lo<<a,this.mi<<a|this.lo>>24-a,this.hi<<a|this.mi>>24-a);if(a<48)return new
d(0,this.lo<<a-24,this.mi<<a-24|this.lo>>48-a);return new
d(0,0,this.lo<<a-48)};d.prototype.shift_right_unsigned=function(a){a=a&63;if(a==0)return this;if(a<24)return new
d(this.lo>>a|this.mi<<24-a,this.mi>>a|this.hi<<24-a,this.hi>>a);if(a<48)return new
d(this.mi>>a-24|this.hi<<48-a,this.hi>>a-24,0);return new
d(this.hi>>a-48,0,0)};d.prototype.shift_right=function(a){a=a&63;if(a==0)return this;var
c=this.hi<<16>>16;if(a<24)return new
d(this.lo>>a|this.mi<<24-a,this.mi>>a|c<<24-a,this.hi<<16>>a>>>16);var
b=this.hi<<16>>31;if(a<48)return new
d(this.mi>>a-24|this.hi<<48-a,this.hi<<16>>a-24>>16,b&_);return new
d(this.hi<<16>>a-32,b,b)};d.prototype.lsl1=function(){this.hi=this.hi<<1|this.mi>>23;this.mi=(this.mi<<1|this.lo>>23)&aj;this.lo=this.lo<<1&aj};d.prototype.lsr1=function(){this.lo=(this.lo>>>1|this.mi<<23)&aj;this.mi=(this.mi>>>1|this.hi<<23)&aj;this.hi=this.hi>>>1};d.prototype.udivmod=function(f){var
c=0,b=this.copy(),a=f.copy(),e=new
d(0,0,0);while(b.ucompare(a)>0){c++;a.lsl1()}while(c>=0){c--;e.lsl1();if(b.ucompare(a)>=0){e.lo++;b=b.sub(a)}a.lsr1()}return{quotient:e,modulus:b}};d.prototype.div=function(a){var
b=this;if(a.isZero())cz();var
d=b.hi^a.hi;if(b.hi&Z)b=b.neg();if(a.hi&Z)a=a.neg();var
c=b.udivmod(a).quotient;if(d&Z)c=c.neg();return c};d.prototype.mod=function(b){var
a=this;if(b.isZero())cz();var
d=a.hi;if(a.hi&Z)a=a.neg();if(b.hi&Z)b=b.neg();var
c=a.udivmod(b).modulus;if(d&Z)c=c.neg();return c};d.prototype.toInt=function(){return this.lo|this.mi<<24};d.prototype.toFloat=function(){return(this.hi<<16)*Math.pow(2,32)+this.mi*Math.pow(2,24)+this.lo};d.prototype.toArray=function(){return[this.hi>>8,this.hi&L,this.mi>>16,this.mi>>8&L,this.mi&L,this.lo>>16,this.lo>>8&L,this.lo&L]};d.prototype.lo32=function(){return this.lo|(this.mi&L)<<24};d.prototype.hi32=function(){return this.mi>>>8&_|this.hi<<16};function
bI(b,c,a){return new
d(b,c,a)}function
bH(a){if(!isFinite(a)){if(isNaN(a))return bI(1,0,dG);return a>0?bI(0,0,dG):bI(0,0,0xfff0)}var
f=a==0&&1/a==-Infinity?Z:a>=0?0:Z;if(f)a=-a;var
b=mc(a)+1023;if(b<=0){b=0;a/=Math.pow(2,-d_)}else{a/=Math.pow(2,b-es);if(a<16){a*=2;b-=1}if(b==0)a/=2}var
d=Math.pow(2,24),c=a|0;a=(a-c)*d;var
e=a|0;a=(a-e)*d;var
g=a|0;c=c&ch|f|b<<4;return bI(g,e,c)}function
bd(a){return a.toArray()}function
eB(c,b,g){c.write(32,b.dims.length);c.write(32,b.kind|b.layout<<8);if(b.caml_custom==bE)for(var
a=0;a<b.dims.length;a++)if(b.dims[a]<_)c.write(16,b.dims[a]);else{c.write(16,_);c.write(32,0);c.write(32,b.dims[a])}else
for(var
a=0;a<b.dims.length;a++)c.write(32,b.dims[a]);switch(b.kind){case
2:case
3:case
12:for(var
a=0;a<b.data.length;a++)c.write(8,b.data[a]);break;case
4:case
5:for(var
a=0;a<b.data.length;a++)c.write(16,b.data[a]);break;case
6:for(var
a=0;a<b.data.length;a++)c.write(32,b.data[a]);break;case
8:case
9:c.write(8,0);for(var
a=0;a<b.data.length;a++)c.write(32,b.data[a]);break;case
7:for(var
a=0;a<b.data.length/2;a++){var
e=bd(b.get(a));for(var
d=0;d<8;d++)c.write(8,e[d])}break;case
1:for(var
a=0;a<b.data.length;a++){var
e=bd(bH(b.get(a)));for(var
d=0;d<8;d++)c.write(8,e[d])}break;case
0:for(var
a=0;a<b.data.length;a++){var
e=cq(b.get(a));c.write(32,e)}break;case
10:for(var
a=0;a<b.data.length/2;a++){var
d=b.get(a);c.write(32,cq(d[1]));c.write(32,cq(d[2]))}break;case
11:for(var
a=0;a<b.data.length/2;a++){var
f=b.get(a),e=bd(bH(f[1]));for(var
d=0;d<8;d++)c.write(8,e[d]);var
e=bd(bH(f[2]));for(var
d=0;d<8;d++)c.write(8,e[d])}break}g[0]=(4+b.dims.length)*4;g[1]=(4+b.dims.length)*8}function
ez(a){switch(a){case
7:case
10:case
11:return 2;default:return 1}}function
k6(c,f){var
b=e,a;switch(c){case
0:a=b.Float32Array;break;case
1:a=b.Float64Array;break;case
2:a=b.Int8Array;break;case
3:a=b.Uint8Array;break;case
4:a=b.Int16Array;break;case
5:a=b.Uint16Array;break;case
6:a=b.Int32Array;break;case
7:a=b.Int32Array;break;case
8:a=b.Int32Array;break;case
9:a=b.Int32Array;break;case
10:a=b.Float32Array;break;case
11:a=b.Float64Array;break;case
12:a=b.Uint8Array;break}if(!a)u("Bigarray.create: unsupported kind");var
d=new
a(f*ez(c));return d}function
cr(c){var
a=new(e.Int32Array)(1);a[0]=c;var
b=new(e.Float32Array)(a.buffer);return b[0]}function
bc(a){return new
d(a[7]<<0|a[6]<<8|a[5]<<16,a[4]<<0|a[3]<<8|a[2]<<16,a[1]<<0|a[0]<<8)}function
cs(d){var
f=d.lo,g=d.mi,b=d.hi,c=(b&0x7fff)>>4;if(c==2047)return(f|g|b&ch)==0?b&Z?-Infinity:Infinity:NaN;var
e=Math.pow(2,-24),a=(f*e+g)*e+(b&ch);if(c>0){a+=16;a*=Math.pow(2,c-es)}else
a*=Math.pow(2,-d_);if(b&Z)a=-a;return a}function
ck(b){var
d=b.length,c=1;for(var
a=0;a<d;a++){if(b[a]<0)u("Bigarray.create: negative dimension");c=c*b[a]}return c}function
lz(b,a){return new
d(b&aj,b>>>24&L|(a&_)<<8,a>>>16&_)}function
ct(a){return a.hi32()}function
cu(a){return a.lo32()}var
k7=bE;function
ar(c,d,b,a){this.kind=c;this.layout=d;this.dims=b;this.data=a}ar.prototype.caml_custom=k7;ar.prototype.offset=function(b){var
c=0;if(typeof
b==="number")b=[b];if(!(b
instanceof
Array))u("bigarray.js: invalid offset");if(this.dims.length!=b.length)u("Bigarray.get/set: bad number of dimensions");if(this.layout==0)for(var
a=0;a<this.dims.length;a++){if(b[a]<0||b[a]>=this.dims[a])a$();c=c*this.dims[a]+b[a]}else
for(var
a=this.dims.length-1;a>=0;a--){if(b[a]<1||b[a]>this.dims[a])a$();c=c*this.dims[a]+(b[a]-1)}return c};ar.prototype.get=function(a){switch(this.kind){case
7:var
d=this.data[a*2+0],b=this.data[a*2+1];return lz(d,b);case
10:case
11:var
e=this.data[a*2+0],c=this.data[a*2+1];return[bC,e,c];default:return this.data[a]}};ar.prototype.set=function(a,b){switch(this.kind){case
7:this.data[a*2+0]=cu(b);this.data[a*2+1]=ct(b);break;case
10:case
11:this.data[a*2+0]=b[1];this.data[a*2+1]=b[2];break;default:this.data[a]=b;break}return 0};ar.prototype.fill=function(b){switch(this.kind){case
7:var
c=cu(b),e=ct(b);if(c==e)this.data.fill(c);else
for(var
a=0;a<this.data.length;a++)this.data[a]=a%2==0?c:e;break;case
10:case
11:var
d=b[1],f=b[2];if(d==f)this.data.fill(d);else
for(var
a=0;a<this.data.length;a++)this.data[a]=a%2==0?d:f;break;default:this.data.fill(b);break}};ar.prototype.compare=function(b,g){if(this.layout!=b.layout||this.kind!=b.kind){var
e=this.kind|this.layout<<8,f=b.kind|b.layout<<8;return f-e}if(this.dims.length!=b.dims.length)return b.dims.length-this.dims.length;for(var
a=0;a<this.dims.length;a++)if(this.dims[a]!=b.dims[a])return this.dims[a]<b.dims[a]?-1:1;switch(this.kind){case
0:case
1:case
10:case
11:var
c,d;for(var
a=0;a<this.data.length;a++){c=this.data[a];d=b.data[a];if(c<d)return-1;if(c>d)return 1;if(c!=d){if(!g)return NaN;if(c==c)return 1;if(d==d)return-1}}break;case
7:for(var
a=0;a<this.data.length;a+=2){if(this.data[a+1]<b.data[a+1])return-1;if(this.data[a+1]>b.data[a+1])return 1;if(this.data[a]>>>0<b.data[a]>>>0)return-1;if(this.data[a]>>>0>b.data[a]>>>0)return 1}break;case
2:case
3:case
4:case
5:case
6:case
8:case
9:case
12:for(var
a=0;a<this.data.length;a++){if(this.data[a]<b.data[a])return-1;if(this.data[a]>b.data[a])return 1}break}return 0};function
aP(c,d,b,a){this.kind=c;this.layout=d;this.dims=b;this.data=a}aP.prototype=new
ar();aP.prototype.offset=function(a){if(typeof
a!=="number")if(a
instanceof
Array&&a.length==1)a=a[0];else
u("Ml_Bigarray_c_1_1.offset");if(a<0||a>=this.dims[0])a$();return a};aP.prototype.get=function(a){return this.data[a]};aP.prototype.set=function(a,b){this.data[a]=b;return 0};aP.prototype.fill=function(a){this.data.fill(a);return 0};function
ex(c,d,a,b){var
e=ez(c);if(ck(a)*e!=b.length)u("length doesn't match dims");if(d==0&&a.length==1&&e==1)return new
aP(c,d,a,b);return new
ar(c,d,a,b)}function
aQ(a){cy(q.Failure,a)}function
ey(b,v,r){var
i=b.read32s();if(i<0||i>16)aQ("input_value: wrong number of bigarray dimensions");var
p=b.read32s(),j=p&L,o=p>>8&1,h=[];if(r==bE)for(var
a=0;a<i;a++){var
n=b.read16u();if(n==_){var
t=b.read32u(),u=b.read32u();if(t!=0)aQ("input_value: bigarray dimension overflow in 32bit");n=u}h.push(n)}else
for(var
a=0;a<i;a++)h.push(b.read32u());var
d=ck(h),f=k6(j,d),g=ex(j,o,h,f);switch(j){case
2:for(var
a=0;a<d;a++)f[a]=b.read8s();break;case
3:case
12:for(var
a=0;a<d;a++)f[a]=b.read8u();break;case
4:for(var
a=0;a<d;a++)f[a]=b.read16s();break;case
5:for(var
a=0;a<d;a++)f[a]=b.read16u();break;case
6:for(var
a=0;a<d;a++)f[a]=b.read32s();break;case
8:case
9:var
s=b.read8u();if(s)aQ("input_value: cannot read bigarray with 64-bit OCaml ints");for(var
a=0;a<d;a++)f[a]=b.read32s();break;case
7:var
e=new
Array(8);for(var
a=0;a<d;a++){for(var
c=0;c<8;c++)e[c]=b.read8u();var
q=bc(e);g.set(a,q)}break;case
1:var
e=new
Array(8);for(var
a=0;a<d;a++){for(var
c=0;c<8;c++)e[c]=b.read8u();var
k=cs(bc(e));g.set(a,k)}break;case
0:for(var
a=0;a<d;a++){var
k=cr(b.read32s());g.set(a,k)}break;case
10:for(var
a=0;a<d;a++){var
m=cr(b.read32s()),l=cr(b.read32s());g.set(a,[bC,m,l])}break;case
11:var
e=new
Array(8);for(var
a=0;a<d;a++){for(var
c=0;c<8;c++)e[c]=b.read8u();var
m=cs(bc(e));for(var
c=0;c<8;c++)e[c]=b.read8u();var
l=cs(bc(e));g.set(a,[bC,m,l])}break}v[0]=(4+i)*4;return ex(j,o,h,f)}function
ew(a,b,c){return a.compare(b,c)}function
eX(a,b){return Math.imul(a,b)}function
al(b,a){a=eX(a,0xcc9e2d51|0);a=a<<15|a>>>32-15;a=eX(a,0x1b873593);b^=a;b=b<<13|b>>>32-13;return(b+(b<<2)|0)+(0xe6546b64|0)|0}function
lv(a,b){a=al(a,cu(b));a=al(a,ct(b));return a}function
eR(a,b){return lv(a,bH(b))}function
eA(c){var
b=ck(c.dims),d=0;switch(c.kind){case
2:case
3:case
12:if(b>ei)b=ei;var
e=0,a=0;for(a=0;a+4<=c.data.length;a+=4){e=c.data[a+0]|c.data[a+1]<<8|c.data[a+2]<<16|c.data[a+3]<<24;d=al(d,e)}e=0;switch(b&3){case
3:e=c.data[a+2]<<16;case
2:e|=c.data[a+1]<<8;case
1:e|=c.data[a+0];d=al(d,e)}break;case
4:case
5:if(b>a_)b=a_;var
e=0,a=0;for(a=0;a+2<=c.data.length;a+=2){e=c.data[a+0]|c.data[a+1]<<16;d=al(d,e)}if((b&1)!=0)d=al(d,c.data[a]);break;case
6:if(b>64)b=64;for(var
a=0;a<b;a++)d=al(d,c.data[a]);break;case
8:case
9:if(b>64)b=64;for(var
a=0;a<b;a++)d=al(d,c.data[a]);break;case
7:if(b>32)b=32;b*=2;for(var
a=0;a<b;a++)d=al(d,c.data[a]);break;case
10:b*=2;case
0:if(b>64)b=64;for(var
a=0;a<b;a++)d=eR(d,c.data[a]);break;case
11:b*=2;case
1:if(b>32)b=32;for(var
a=0;a<b;a++)d=eR(d,c.data[a]);break}return d}function
lx(a,b){b[0]=4;return a.read32s()}function
lT(a,b){switch(a.read8u()){case
1:b[0]=4;return a.read32s();case
2:aQ("input_value: native integer value too large");default:aQ("input_value: ill-formed native integer")}}function
lI(c,d){var
b=new
Array(8);for(var
a=0;a<8;a++)b[a]=c.read8u();d[0]=8;return bc(b)}function
lE(e,d,b){var
c=bd(d);for(var
a=0;a<8;a++)e.write(8,c[a]);b[0]=8;b[1]=8}function
ly(a,b,c){return a.compare(b)}function
lB(a){return a.lo32()^a.hi32()}var
eJ={"_j":{deserialize:lI,serialize:lE,fixed_length:8,compare:ly,hash:lB},"_i":{deserialize:lx,fixed_length:4},"_n":{deserialize:lT,fixed_length:4},"_bigarray":{deserialize:function(a,b){return ey(a,b,"_bigarray")},serialize:eB,compare:ew,hash:eA},"_bigarr02":{deserialize:function(a,b){return ey(a,b,bE)},serialize:eB,compare:ew,hash:eA}};function
cm(a){return eJ[a.caml_custom]&&eJ[a.caml_custom].compare}function
eG(f,c,d,e){var
b=cm(c);if(b){var
a=d>0?b(c,f,e):b(f,c,e);if(e&&a!=a)return d;if(+a!=+a)return+a;if((a|0)!=0)return a|0}return d}function
bJ(a){return a
instanceof
ak}function
cv(a){return bJ(a)}function
eH(a){if(typeof
a==="number")return a8;else
if(bJ(a))return bD;else
if(cv(a))return 1252;else
if(a
instanceof
Array&&a[0]===a[0]>>>0&&a[0]<=z){var
b=a[0]|0;return b==bC?0:b}else
if(a
instanceof
String)return dX;else
if(typeof
a=="string")return dX;else
if(a
instanceof
Number)return a8;else
if(a&&a.caml_custom)return cb;else
if(a&&a.compare)return 1256;else
if(typeof
a=="function")return 1247;else
if(typeof
a=="symbol")return 1251;return 1001}function
lJ(a,b){if(a<b)return-1;if(a==b)return 0;return 1}function
eD(a,b){a.t&6&&aF(a);b.t&6&&aF(b);return a.c<b.c?-1:a.c>b.c?1:0}function
me(a,b){return eD(a,b)}function
cl(a,b,d){var
e=[];for(;;){if(!(d&&a===b)){var
f=eH(a);if(f==a7){a=a[1];continue}var
g=eH(b);if(g==a7){b=b[1];continue}if(f!==g){if(f==a8){if(g==cb)return eG(a,b,-1,d);return-1}if(g==a8){if(f==cb)return eG(b,a,1,d);return 1}return f<g?-1:1}switch(f){case
247:u(cf);break;case
248:var
c=lJ(a[2],b[2]);if(c!=0)return c|0;break;case
249:u(cf);break;case
250:u("equal: got Forward_tag, should not happen");break;case
251:u("equal: abstract value");break;case
252:if(a!==b){var
c=eD(a,b);if(c!=0)return c|0}break;case
253:u("equal: got Double_tag, should not happen");break;case
254:u("equal: got Double_array_tag, should not happen");break;case
255:u("equal: got Custom_tag, should not happen");break;case
1247:u(cf);break;case
1255:var
i=cm(a);if(i!=cm(b))return a.caml_custom<b.caml_custom?-1:1;if(!i)u("compare: abstract value");var
c=i(a,b,d);if(c!=c)return d?-1:c;if(c!==(c|0))return-1;if(c!=0)return c|0;break;case
1256:var
c=a.compare(b,d);if(c!=c)return d?-1:c;if(c!==(c|0))return-1;if(c!=0)return c|0;break;case
1000:a=+a;b=+b;if(a<b)return-1;if(a>b)return 1;if(a!=b){if(!d)return NaN;if(a==a)return 1;if(b==b)return-1}break;case
1001:if(a<b)return-1;if(a>b)return 1;if(a!=b){if(!d)return NaN;if(a==a)return 1;if(b==b)return-1}break;case
1251:if(a!==b){if(!d)return NaN;return 1}break;case
1252:var
a=am(a),b=am(b);if(a!==b){if(a<b)return-1;if(a>b)return 1}break;case
12520:var
a=a.toString(),b=b.toString();if(a!==b){if(a<b)return-1;if(a>b)return 1}break;case
246:case
254:default:if(a.length!=b.length)return a.length<b.length?-1:1;if(a.length>1)e.push(a,b,1);break}}if(e.length==0)return 0;var
h=e.pop();b=e.pop();a=e.pop();if(h+1<a.length)e.push(a,b,h+1);a=a[h];b=b[h]}}function
eF(a,b){return cl(a,b,true)}function
lb(){return[0]}function
x(a){if(a<0)u("Bytes.create");return new
ak(a?2:9,g,a)}function
lc(a,c,b,d){if(b>0)if(c==0&&(b>=a.l||a.t==2&&b>=a.c.length))if(d==0){a.c=g;a.t=2}else{a.c=aS(b,String.fromCharCode(d));a.t=b==a.l?0:2}else{if(a.t!=4)bF(a);for(b+=c;c<b;c++)a.c[c]=d}return 0}function
cx(d){d=am(d);var
e=d.length;if(e>31)u("format_int: format too long");var
a={justify:aN,signstyle:aB,filler:ah,alternate:false,base:0,signedconv:false,width:0,uppercase:false,sign:1,prec:-1,conv:"f"};for(var
c=0;c<e;c++){var
b=d.charAt(c);switch(b){case"-":a.justify=aB;break;case"+":case" ":a.signstyle=b;break;case"0":a.filler=K;break;case"#":a.alternate=true;break;case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":a.width=0;while(b=d.charCodeAt(c)-48,b>=0&&b<=9){a.width=a.width*10+b;c++}c--;break;case".":a.prec=0;c++;while(b=d.charCodeAt(c)-48,b>=0&&b<=9){a.prec=a.prec*10+b;c++}c--;case"d":case"i":a.signedconv=true;case"u":a.base=10;break;case"x":a.base=16;break;case"X":a.base=16;a.uppercase=true;break;case"o":a.base=8;break;case"e":case"f":case"g":a.signedconv=true;a.conv=b;break;case"E":case"F":case"G":a.signedconv=true;a.uppercase=true;a.conv=b.toLowerCase();break}}return a}function
cn(b,f){if(b.uppercase)f=f.toUpperCase();var
e=f.length;if(b.signedconv&&(b.sign<0||b.signstyle!=aB))e++;if(b.alternate){if(b.base==8)e+=1;if(b.base==16)e+=2}var
c=g;if(b.justify==aN&&b.filler==ah)for(var
d=e;d<b.width;d++)c+=ah;if(b.signedconv)if(b.sign<0)c+=aB;else
if(b.signstyle!=aB)c+=b.signstyle;if(b.alternate&&b.base==8)c+=K;if(b.alternate&&b.base==16)c+=dF;if(b.justify==aN&&b.filler==K)for(var
d=e;d<b.width;d++)c+=K;c+=f;if(b.justify==aB)for(var
d=e;d<b.width;d++)c+=ah;return a(c)}function
co(i,c){function
j(a,b){if(Math.abs(a)<1.0)return a.toFixed(b);else{var
c=parseInt(a.toString().split(aN)[1]);if(c>20){c-=20;a/=Math.pow(10,c);a+=new
Array(c+1).join(K);if(b>0)a=a+aC+new
Array(b+1).join(K);return a}else
return a.toFixed(b)}}var
a,e=cx(i),d=e.prec<0?6:e.prec;if(c<0||c==0&&1/c==-Infinity){e.sign=-1;c=-c}if(isNaN(c)){a=cc;e.filler=ah}else
if(!isFinite(c)){a="inf";e.filler=ah}else
switch(e.conv){case"e":var
a=c.toExponential(d),b=a.length;if(a.charAt(b-3)==cj)a=a.slice(0,b-1)+K+a.slice(b-1);break;case"f":a=j(c,d);break;case"g":d=d?d:1;a=c.toExponential(d-1);var
h=a.indexOf(cj),g=+a.slice(h+1);if(g<-4||c>=1e21||c.toFixed(0).length>d){var
b=h-1;while(a.charAt(b)==K)b--;if(a.charAt(b)==aC)b--;a=a.slice(0,b+1)+a.slice(h);b=a.length;if(a.charAt(b-3)==cj)a=a.slice(0,b-1)+K+a.slice(b-1);break}else{var
f=d;if(g<0){f-=g+1;a=c.toFixed(f)}else
while(a=c.toFixed(f),a.length>d+1)f--;if(f){var
b=a.length-1;while(a.charAt(b)==K)b--;if(a.charAt(b)==aC)b--;a=a.slice(0,b+1)}}break}return cn(e,a)}function
bG(e,c){if(am(e)==cg)return a(g+c);var
b=cx(e);if(c<0)if(b.signedconv){b.sign=-1;c=-c}else
c>>>=0;var
d=c.toString(b.base);if(b.prec>=0){b.filler=ah;var
f=b.prec-d.length;if(f>0)d=aS(f,K)+d}return cn(b,d)}var
lV=0;function
Q(){return lV++}function
av(a){return a.toUtf16()}if(e.process&&e.process.cwd)var
bb=e.process.cwd().replace(/\\/g,ai);else
var
bb="/static";if(bb.slice(-1)!==ai)bb+=ai;function
lM(a){a=av(a);if(a.charCodeAt(0)!=47)a=bb+a;var
d=a.split(ai),b=[];for(var
c=0;c<d.length;c++)switch(d[c]){case"..":if(b.length>1)b.pop();break;case".":break;case"":if(b.length==0)b.push(g);break;default:b.push(d[c]);break}b.orig=a;return b}function
k_(a){return new
ak(4,a,a.length)}function
l_(e){for(var
f=g,b=f,a,i,c=0,h=e.length;c<h;c++){a=e.charCodeAt(c);if(a<U){for(var
d=c+1;d<h&&(a=e.charCodeAt(d))<U;d++);if(d-c>dH){b.substr(0,1);f+=b;b=g;f+=e.slice(c,d)}else
b+=e.slice(c,d);if(d==h)break;c=d}if(a<ej){b+=String.fromCharCode(0xc0|a>>6);b+=String.fromCharCode(U|a&aO)}else
if(a<0xd800||a>=dR)b+=String.fromCharCode(dS|a>>12,U|a>>6&aO,U|a&aO);else
if(a>=0xdbff||c+1==h||(i=e.charCodeAt(c+1))<dN||i>dR)b+="\xef\xbf\xbd";else{c++;a=(a<<10)+i-0x35fdc00;b+=String.fromCharCode(en|a>>18,U|a>>12&aO,U|a>>6&aO,U|a&aO)}if(b.length>a9){b.substr(0,1);f+=b;b=g}}return f+b}function
k$(a){var
b=9;if(!e3(a))b=8,a=l_(a);return new
ak(b,a,a.length)}function
an(a){return k$(a)}function
n(a){cy(q.Sys_error,a)}function
lW(a){a=am(a);n(a+": No such file or directory")}function
k9(b,a){if(a>>>0>=b.l)eC();return ba(b,a)}function
S(a){return a.l}function
ev(){}function
A(a){this.data=a}A.prototype=new
ev();A.prototype.truncate=function(a){var
b=this.data;this.data=x(a|0);as(b,0,this.data,0,a)};A.prototype.length=function(){return S(this.data)};A.prototype.write=function(b,d,g,a){var
c=this.length();if(b+a>=c){var
e=x(b+a),f=this.data;this.data=e;as(f,0,this.data,0,c)}aD(d,g,this.data,b,a);return 0};A.prototype.read=function(c,a,d,b){var
e=this.length();as(this.data,c,a,d,b);return 0};A.prototype.read_one=function(a){return k9(this.data,a)};A.prototype.close=function(){};A.prototype.constructor=A;function
V(b,a){this.content={};this.root=b;this.lookupFun=a}V.prototype.nm=function(a){return this.root+a};V.prototype.lookup=function(b){if(!this.content[b]&&this.lookupFun){var
c=this.lookupFun(a(this.root),a(b));if(c!==0)this.content[b]=new
A(at(c[1]))}};V.prototype.exists=function(a){if(a==g)return 1;var
c=a+ai,d=new
RegExp(cd+c);for(var
b
in
this.content)if(b.match(d))return 1;this.lookup(a);return this.content[a]?1:0};V.prototype.readdir=function(c){var
f=c==g?g:c+ai,h=new
RegExp(cd+f+er),d={},b=[];for(var
e
in
this.content){var
a=e.match(h);if(a&&!d[a[1]]){d[a[1]]=true;b.push(a[1])}}return b};V.prototype.is_dir=function(a){var
d=a==g?g:a+ai,e=new
RegExp(cd+d+er),f=[];for(var
c
in
this.content){var
b=c.match(e);if(b)return 1}return 0};V.prototype.unlink=function(a){var
b=this.content[a]?true:false;delete
this.content[a];return b};V.prototype.open=function(a,b){if(b.rdonly&&b.wronly)n(this.nm(a)+d0);if(b.text&&b.binary)n(this.nm(a)+ee);this.lookup(a);if(this.content[a]){if(this.is_dir(a))n(this.nm(a)+" : is a directory");if(b.create&&b.excl)n(this.nm(a)+dZ);var
c=this.content[a];if(b.truncate)c.truncate();return c}else
if(b.create){this.content[a]=new
A(x(0));return this.content[a]}else
lW(this.nm(a))};V.prototype.register=function(b,a){if(this.content[b])n(this.nm(b)+dZ);if(bJ(a))this.content[b]=new
A(a);if(cv(a))this.content[b]=new
A(at(a));else
if(a
instanceof
Array)this.content[b]=new
A(k_(a));else
if(typeof
a==="string")this.content[b]=new
A(eE(a));else
if(a.toString){var
c=at(an(a.toString()));this.content[b]=new
A(c)}else
n(this.nm(b)+" : registering file with invalid content type")};V.prototype.constructor=V;function
s(a){return S(a)}function
aT(b,a){return ba(b,a)}function
k5(d){var
c=s(d),b=new
Array(c),a=0;for(;a<c;a++)b[a]=aT(d,a);return b}function
k4(a){if(a.t!=4)bF(a);return a.c}function
aa(a){this.fs=require("fs");this.fd=a}aa.prototype=new
ev();aa.prototype.truncate=function(a){try{this.fs.ftruncateSync(this.fd,a|0)}catch(a){n(a.toString())}};aa.prototype.length=function(){try{return this.fs.fstatSync(this.fd).size}catch(a){n(a.toString())}};aa.prototype.write=function(g,b,c,f){var
a=k5(b);if(!(a
instanceof
e.Uint8Array))a=new(e.Uint8Array)(a);var
d=e.Buffer.from(a);try{this.fs.writeSync(this.fd,d,c,f,g)}catch(a){n(a.toString())}return 0};aa.prototype.read=function(h,d,c,g){var
a=k4(d);if(!(a
instanceof
e.Uint8Array))a=new(e.Uint8Array)(a);var
f=e.Buffer.from(a);try{this.fs.readSync(this.fd,f,c,g,h)}catch(a){n(a.toString())}for(var
b=0;b<g;b++)aE(d,c+b,f[c+b]);return 0};aa.prototype.read_one=function(c){var
b=new(e.Uint8Array)(1),a=e.Buffer.from(b);try{this.fs.readSync(this.fd,a,0,1,c)}catch(a){n(a.toString())}return a[0]};aa.prototype.close=function(){try{this.fs.closeSync(this.fd)}catch(a){n(a.toString())}};aa.prototype.constructor=aa;function
$(a){this.fs=require("fs");this.root=a}$.prototype.nm=function(a){return this.root+a};$.prototype.exists=function(a){try{return this.fs.existsSync(this.nm(a))?1:0}catch(a){n(a.toString())}};$.prototype.readdir=function(a){try{return this.fs.readdirSync(this.nm(a))}catch(a){n(a.toString())}};$.prototype.is_dir=function(a){try{return this.fs.statSync(this.nm(a)).isDirectory()?1:0}catch(a){n(a.toString())}};$.prototype.unlink=function(a){try{var
b=this.fs.existsSync(this.nm(a))?1:0;this.fs.unlinkSync(this.nm(a))}catch(a){n(a.toString())}return b};$.prototype.open=function(f,c){var
a=require("constants"),b=0;for(var
e
in
c)switch(e){case"rdonly":b|=a.O_RDONLY;break;case"wronly":b|=a.O_WRONLY;break;case"append":b|=a.O_WRONLY|a.O_APPEND;break;case"create":b|=a.O_CREAT;break;case"truncate":b|=a.O_TRUNC;break;case"excl":b|=a.O_EXCL;break;case"binary":b|=a.O_BINARY;break;case"text":b|=a.O_TEXT;break;case"nonblock":b|=a.O_NONBLOCK;break}try{var
d=this.fs.openSync(this.nm(f),b);return new
aa(d)}catch(a){n(a.toString())}};$.prototype.rename=function(b,a){try{this.fs.renameSync(this.nm(b),this.nm(a))}catch(a){n(a.toString())}};$.prototype.constructor=$;var
aR=bb.match(/[^\/]*\//)[0];function
l$(){return typeof
e.process!=="undefined"&&typeof
e.process.versions!=="undefined"&&typeof
e.process.versions.node!=="undefined"&&e.process.platform!=="browser"}var
bh=[];if(l$())bh.push({path:aR,device:new
$(aR)});else
bh.push({path:aR,device:new
V(aR)});bh.push({path:aR+dD,device:new
V(aR+dD)});function
e4(b){var
f=lM(b),b=f.join(ai),e=b+ai,c;for(var
d=0;d<bh.length;d++){var
a=bh[d];if(e.search(a.path)==0&&(!c||c.path.length<a.path.length))c={path:a.path,device:a.device,rest:b.substring(a.path.length,b.length)}}return c}function
eI(c,b){var
c=typeof
c=="string"?a(c):c,b=typeof
b=="string"?a(b):b,d=e4(c);if(!d.device.register)aQ("cannot register file");d.device.register(d.rest,b);return 0}function
ld(){var
b=e.caml_fs_tmp;if(b)for(var
a=0;a<b.length;a++)eI(b[a].name,b[a].content);e.caml_create_file=eI;e.caml_fs_tmp=[];return 0}function
le(){return 0}function
lf(){return[0]}var
eY={};function
cw(a){return eY[a]}var
R;function
D(){if(R)return R;throw[0,cw(bA),a("Not initialized")]}function
eK(){var
a=D();a.canvas.width=a.width;a.canvas.height=a.height;return 0}function
lh(a){if(a.canvas.ownerDocument)return a.canvas.ownerDocument}function
lg(j,n,o,i,h,c,d){while(c>d)d+=d6;c/=ep;d/=ep;var
f=0,a,b,l,m,q=2,k=(d-c)*Math.PI*((h+i)/2)/q|0,p=(d-c)*Math.PI/k,e=c*Math.PI;for(var
g=0;g<=k;g++){a=n-h*Math.sin(e)*Math.sin(f*Math.PI)+i*Math.cos(e)*Math.cos(f*Math.PI);a=a.toFixed(2);b=o+i*Math.cos(e)*Math.sin(f*Math.PI)+h*Math.sin(e)*Math.cos(f*Math.PI);b=b.toFixed(2);if(g==0)j.moveTo(a,b);else
if(l!=a||m!=b)j.lineTo(a,b);l=a;m=b;e-=p}return 0}function
li(f,g,d,e,b,c){var
a=D();a.context.beginPath();lg(a.context,f,a.height-g,d,e,b,c);a.context.stroke();return 0}function
lj(d,e,c,b){var
a=D();a.context.strokeRect(d,a.height-e,c,-b);return 0}function
lk(b){var
a=D(),d=a.context.measureText(b),c=d.width;a.context.fillText(b,a.x,a.height-a.y);a.x+=c|0;return 0}function
ll(a){lk(av(a));return 0}function
lm(d,e,c,b){var
a=D();a.context.fillRect(d,a.height-e,c,-b);return 0}function
ln(b,c){var
a=D();a.context.beginPath();a.context.moveTo(a.x,a.height-a.y);a.context.lineTo(b,a.height-c);a.context.stroke();a.x=b;a.y=c;return 0}function
cp(b,c){var
a=D();a.x=b;a.y=c;return 0}function
lo(e,f){var
a=D(),d=a.context.createImageData(1,1),b=d.data,c=a.color;b[0]=c>>16&L;b[1]=c>>8&L,b[2]=c>>0&L;b[3]=d4;a.x=e;a.y=f;a.context.putImageData(d,e,a.height-f);return 0}function
eL(c,b){var
a=D();a.width=c;a.height=b;a.canvas.width=c;a.canvas.height=b;return 0}function
eM(a){var
c=D();function
b(b){var
a=g+b.toString(16);while(a.length<2)a=K+a;return a}var
h=a>>16&L,f=a>>8&L,e=a>>0&L;c.color=a;var
d="#"+b(h)+b(f)+b(e);c.context.fillStyle=d;c.context.strokeStyle=d;return 0}function
eN(b){var
a=D();a.font=b;a.context.font=a.text_size+d$+av(a.font);return 0}function
eO(b){var
a=D();a.line_width=b;a.context.lineWidth=b;return 0}function
eP(b){var
a=D();a.text_size=b;a.context.font=a.text_size+d$+av(a.font);return 0}function
lq(){var
a=D();return a.height}function
lr(b,e,d){var
c=b.getContext("2d");return{context:c,canvas:b,x:0,y:0,width:e,height:d,line_width:1,font:a("fixed"),text_size:26,color:0x000000,title:a(g)}}function
lp(b){var
a=D();a.title=b;var
c=av(b);if(a.set_title)a.set_title(c);return 0}function
ls(){cp(R.x,R.y);eL(R.width,R.height);eO(R.line_width);eP(R.text_size);eN(R.font);eM(R.color);lp(R.title);R.context.textBaseline="bottom"}function
lt(a){R=a;ls();return 0}function
eQ(b){var
a=D(),c=a.context.measureText(av(b)).width;return[0,c,a.text_size]}function
lu(a,b){return+(cl(a,b,false)>=0)}function
lw(a,c,l){if(!isFinite(a)){if(isNaN(a))return an(cc);return an(a>0?eo:"-infinity")}var
j=a==0&&1/a==-Infinity?1:a>=0?0:1;if(j)a=-a;var
d=0;if(a==0);else
if(a<1)while(a<1&&d>-1022){a*=2;d--}else
while(a>=2){a/=2;d++}var
k=d<0?g:aN,e=g;if(j)e=aB;else
switch(l){case
43:e=aN;break;case
32:e=ah;break;default:break}if(c>=0&&c<13){var
h=Math.pow(2,c*4);a=Math.round(a*h)/h}var
b=a.toString(16);if(c>=0){var
i=b.indexOf(aC);if(i<0)b+=aC+aS(c,K);else{var
f=i+1+c;if(b.length<f)b+=aS(f-b.length,K);else
b=b.substr(0,f)}}return an(e+dF+b+"p"+k+d.toString(10))}function
lD(a){return+a.isZero()}function
lG(a){return new
d(a&aj,a>>24&aj,a>>31&_)}function
lH(a){return a.toInt()}function
lC(a){return+a.isNeg()}function
lF(a){return a.neg()}function
lA(h,c){var
a=cx(h);if(a.signedconv&&lC(c)){a.sign=-1;c=lF(c)}var
b=g,i=lG(a.base),f="0123456789abcdef";do{var
e=c.udivmod(i);c=e.quotient;b=f.charAt(lH(e.modulus))+b}while(!lD(c));if(a.prec>=0){a.filler=ah;var
d=a.prec-b.length;if(d>0)b=aS(d,K)+b}return cn(a,b)}function
lK(){var
b=e.console?e.console:{},c=["log","debug","info","warn","error","assert","dir","dirxml","trace","group","groupCollapsed","groupEnd","time","timeEnd"];function
d(){}for(var
a=0;a<c.length;a++)if(!b[c[a]])b[c[a]]=d;return b}function
lL(d){return function(){var
b=arguments.length;if(b>0){var
c=new
Array(b);for(var
a=0;a<b;a++)c[a]=arguments[a];return ab(d,c)}else
return ab(d,[undefined])}}function
eT(a,d){if(a<0)a$();var
a=a+1|0,b=new
Array(a);b[0]=0;for(var
c=1;c<a;c++)b[c]=d;return b}function
l2(b){return a(bM(b,0,b.length))}var
lN=function(){function
l(a,b){return a+b|0}function
a(d,a,c,f,b,e){a=l(l(a,d),l(f,e));return l(a<<b|a>>>32-b,c)}function
g(c,b,d,e,h,f,g){return a(b&d|~b&e,c,b,h,f,g)}function
h(d,b,e,c,h,f,g){return a(b&c|e&~c,d,b,h,f,g)}function
i(c,b,d,e,h,f,g){return a(b^d^e,c,b,h,f,g)}function
j(c,b,d,e,h,f,g){return a(d^(b|~e),c,b,h,f,g)}function
k(f,n){var
e=n;f[e>>2]|=U<<8*(e&3);for(e=(e&~0x3)+8;(e&0x3F)<60;e+=4)f[(e>>2)-1]=0;f[(e>>2)-1]=n<<3;f[e>>2]=n>>29&0x1FFFFFFF;var
k=[0x67452301,0xEFCDAB89,0x98BADCFE,0x10325476];for(e=0;e<f.length;e+=16){var
a=k[0],b=k[1],c=k[2],d=k[3];a=g(a,b,c,d,f[e+0],7,0xD76AA478);d=g(d,a,b,c,f[e+1],12,0xE8C7B756);c=g(c,d,a,b,f[e+2],17,0x242070DB);b=g(b,c,d,a,f[e+3],22,0xC1BDCEEE);a=g(a,b,c,d,f[e+4],7,0xF57C0FAF);d=g(d,a,b,c,f[e+5],12,0x4787C62A);c=g(c,d,a,b,f[e+6],17,0xA8304613);b=g(b,c,d,a,f[e+7],22,0xFD469501);a=g(a,b,c,d,f[e+8],7,0x698098D8);d=g(d,a,b,c,f[e+9],12,0x8B44F7AF);c=g(c,d,a,b,f[e+10],17,0xFFFF5BB1);b=g(b,c,d,a,f[e+11],22,0x895CD7BE);a=g(a,b,c,d,f[e+12],7,0x6B901122);d=g(d,a,b,c,f[e+13],12,0xFD987193);c=g(c,d,a,b,f[e+14],17,0xA679438E);b=g(b,c,d,a,f[e+15],22,0x49B40821);a=h(a,b,c,d,f[e+1],5,0xF61E2562);d=h(d,a,b,c,f[e+6],9,0xC040B340);c=h(c,d,a,b,f[e+11],14,0x265E5A51);b=h(b,c,d,a,f[e+0],20,0xE9B6C7AA);a=h(a,b,c,d,f[e+5],5,0xD62F105D);d=h(d,a,b,c,f[e+10],9,0x02441453);c=h(c,d,a,b,f[e+15],14,0xD8A1E681);b=h(b,c,d,a,f[e+4],20,0xE7D3FBC8);a=h(a,b,c,d,f[e+9],5,0x21E1CDE6);d=h(d,a,b,c,f[e+14],9,0xC33707D6);c=h(c,d,a,b,f[e+3],14,0xF4D50D87);b=h(b,c,d,a,f[e+8],20,0x455A14ED);a=h(a,b,c,d,f[e+13],5,0xA9E3E905);d=h(d,a,b,c,f[e+2],9,0xFCEFA3F8);c=h(c,d,a,b,f[e+7],14,0x676F02D9);b=h(b,c,d,a,f[e+12],20,0x8D2A4C8A);a=i(a,b,c,d,f[e+5],4,0xFFFA3942);d=i(d,a,b,c,f[e+8],11,0x8771F681);c=i(c,d,a,b,f[e+11],16,0x6D9D6122);b=i(b,c,d,a,f[e+14],23,0xFDE5380C);a=i(a,b,c,d,f[e+1],4,0xA4BEEA44);d=i(d,a,b,c,f[e+4],11,0x4BDECFA9);c=i(c,d,a,b,f[e+7],16,0xF6BB4B60);b=i(b,c,d,a,f[e+10],23,0xBEBFBC70);a=i(a,b,c,d,f[e+13],4,0x289B7EC6);d=i(d,a,b,c,f[e+0],11,0xEAA127FA);c=i(c,d,a,b,f[e+3],16,0xD4EF3085);b=i(b,c,d,a,f[e+6],23,0x04881D05);a=i(a,b,c,d,f[e+9],4,0xD9D4D039);d=i(d,a,b,c,f[e+12],11,0xE6DB99E5);c=i(c,d,a,b,f[e+15],16,0x1FA27CF8);b=i(b,c,d,a,f[e+2],23,0xC4AC5665);a=j(a,b,c,d,f[e+0],6,0xF4292244);d=j(d,a,b,c,f[e+7],10,0x432AFF97);c=j(c,d,a,b,f[e+14],15,0xAB9423A7);b=j(b,c,d,a,f[e+5],21,0xFC93A039);a=j(a,b,c,d,f[e+12],6,0x655B59C3);d=j(d,a,b,c,f[e+3],10,0x8F0CCC92);c=j(c,d,a,b,f[e+10],15,0xFFEFF47D);b=j(b,c,d,a,f[e+1],21,0x85845DD1);a=j(a,b,c,d,f[e+8],6,0x6FA87E4F);d=j(d,a,b,c,f[e+15],10,0xFE2CE6E0);c=j(c,d,a,b,f[e+6],15,0xA3014314);b=j(b,c,d,a,f[e+13],21,0x4E0811A1);a=j(a,b,c,d,f[e+4],6,0xF7537E82);d=j(d,a,b,c,f[e+11],10,0xBD3AF235);c=j(c,d,a,b,f[e+2],15,0x2AD7D2BB);b=j(b,c,d,a,f[e+9],21,0xEB86D391);k[0]=l(a,k[0]);k[1]=l(b,k[1]);k[2]=l(c,k[2]);k[3]=l(d,k[3])}var
o=new
Array(16);for(var
e=0;e<4;e++)for(var
m=0;m<4;m++)o[e*4+m]=k[e]>>8*m&d4;return o}return function(h,g,f){var
e=[];switch(h.t&6){default:aF(h);case
0:var
d=h.c;for(var
a=0;a<f;a+=4){var
b=a+g;e[a>>2]=d.charCodeAt(b)|d.charCodeAt(b+1)<<8|d.charCodeAt(b+2)<<16|d.charCodeAt(b+3)<<24}for(;a<f;a++)e[a>>2]|=d.charCodeAt(a+g)<<8*(a&3);break;case
4:var
c=h.c;for(var
a=0;a<f;a+=4){var
b=a+g;e[a>>2]=c[b]|c[b+1]<<8|c[b+2]<<16|c[b+3]<<24}for(;a<f;a++)e[a>>2]|=c[a+g]<<8*(a&3)}return l2(k(e,f))}}();function
lO(c,b,a){return lN(at(c),b,a)}var
ac=new
Array();function
bK(c){var
a=ac[c];if(!a.opened)n("Cannot flush a closed channel");if(!a.buffer||a.buffer==g)return 0;if(a.fd&&q.fds[a.fd]&&q.fds[a.fd].output){var
b=q.fds[a.fd].output;switch(b.length){case
2:b(c,a.buffer);break;default:b(a.buffer)}}a.buffer=g;return 0}function
e1(e,f){var
b=ac[e],d=a(f),c=s(d);b.file.write(b.offset,d,0,c);b.offset+=c;return 0}function
ma(a){var
a=cA(a),b=e;if(b.process&&b.process.stdout&&b.process.stdout.write)b.process.stderr.write(a);else{if(a.charCodeAt(a.length-1)==10)a=a.substr(0,a.length-1);var
c=b.console;c&&c.error&&c.error(a)}}function
mb(a){var
a=cA(a),b=e;if(b.process&&b.process.stdout&&b.process.stdout.write)b.process.stdout.write(a);else{if(a.charCodeAt(a.length-1)==10)a=a.substr(0,a.length-1);var
c=b.console;c&&c.log&&c.log(a)}}function
bN(c,e,d,a){if(q.fds===undefined)q.fds=new
Array();a=a?a:{};var
b={};b.file=d;b.offset=a.append?d.length():0;b.flags=a;b.output=e;q.fds[c]=b;if(!q.fd_last_idx||c>q.fd_last_idx)q.fd_last_idx=c;return c}function
mf(c,b,g){var
a={};while(b){switch(b[1]){case
0:a.rdonly=1;break;case
1:a.wronly=1;break;case
2:a.append=1;break;case
3:a.create=1;break;case
4:a.truncate=1;break;case
5:a.excl=1;break;case
6:a.binary=1;break;case
7:a.text=1;break;case
8:a.nonblock=1;break}b=b[2]}if(a.rdonly&&a.wronly)n(am(c)+d0);if(a.text&&a.binary)n(am(c)+ee);var
d=e4(c),e=d.device.open(d.rest,a),f=q.fd_last_idx?q.fd_last_idx:0;return bN(f+1,e1,e,a)}bN(0,e1,new
A(x(0)));bN(1,mb,new
A(x(0)));bN(2,ma,new
A(x(0)));function
lP(c){var
b=q.fds[c];if(b.flags.wronly)n(et+c+" is writeonly");var
a={file:b.file,offset:b.offset,fd:c,opened:true,out:false,refill:null};ac[a.fd]=a;return a.fd}function
eU(c){var
b=q.fds[c];if(b.flags.rdonly)n(et+c+" is readonly");var
a={file:b.file,offset:b.offset,fd:c,opened:true,out:true,buffer:g};ac[a.fd]=a;return a.fd}function
lQ(){var
b=0;for(var
a=0;a<ac.length;a++)if(ac[a]&&ac[a].opened&&ac[a].out)b=[0,ac[a].fd,b];return b}function
M(a){return a}function
lR(g,d,h,f){var
b=ac[g];if(!b.opened)n("Cannot output to a closed channel");var
a;if(h==0&&S(d)==f)a=d;else{a=x(f);as(d,h,a,0,f)}var
i=M(a),c=am(i),e=c.lastIndexOf("\n");if(e<0)b.buffer+=c;else{b.buffer+=c.substr(0,e+1);bK(g);b.buffer+=c.substr(e+1)}return 0}function
eV(b,a,d,c){return lR(b,at(a),d,c)}function
eW(c,b){var
d=a(String.fromCharCode(b));eV(c,d,0,1);return 0}function
lS(b,a){if(a==0)cz();return b%a}function
be(a,b){return+(cl(a,b,false)!=0)}function
lU(a,b){a[0]=a7;a[1]=b;return 0}function
bf(a){if(a
instanceof
Array&&a[0]==a[0]>>>0)return a[0];else
if(bJ(a))return bD;else
if(cv(a))return bD;else
if(a
instanceof
Function||typeof
a=="function")return 247;else
if(a&&a.caml_custom)return z;else
return a8}function
W(b,c,a){if(a&&e.toplevelReloc)b=e.toplevelReloc(a);q[b+1]=c;if(a)q[a]=c}function
lZ(a,b){eY[am(a)]=b;return 0}function
l0(){u(ci)}function
E(b,a){if(a>>>0>=s(b))l0();return aT(b,a)}function
k8(a,b){if(a===b)return 1;a.t&6&&aF(a);b.t&6&&aF(b);return a.c==b.c?1:0}function
l1(a,b){return k8(a,b)}function
bL(a,b){return 1-l1(a,b)}function
l3(){return[0,a("js_of_ocaml")]}function
l4(){return 0x7FFFFFFF/4|0}function
l5(a){return 0}function
l6(b){var
a=e;if(a.quit)a.quit(b);if(a.process&&a.process.exit)a.process.exit(b);u("Function 'exit' not implemented")}function
l7(){return[0,a(dK),32,0]}function
lX(){eZ(q.Not_found)}function
e2(c){var
a=e,b=av(c);if(a.process&&a.process.env&&a.process.env[b]!=undefined)return an(a.process.env[b]);if(e.jsoo_static_env&&e.jsoo_static_env[b])return an(e.jsoo_static_env[b]);lX()}function
l8(){var
a=new
Date().getTime(),b=a^0xffffffff*Math.random();return[0,b]}function
bg(a){var
b=1;while(a&&a.joo_tramp){a=a.joo_tramp.apply(null,a.joo_args);b++}return a}function
k(b,a){return{joo_tramp:b,joo_args:a}}function
l9(c,a){if(typeof
a==="function"){c.fun=a;return 0}if(a.fun){c.fun=a.fun;return 0}var
b=a.length;while(b--)c[b]=a[b];return 0}function
e0(a){return a}function
ao(a){if(a
instanceof
Array)return a;if(e.RangeError&&a
instanceof
e.RangeError&&a.message&&a.message.match(/maximum call stack/i))return e0(q.Stack_overflow);if(e.InternalError&&a
instanceof
e.InternalError&&a.message&&a.message.match(/too much recursion/i))return e0(q.Stack_overflow);if(a
instanceof
e.Error&&cw(ca))return[0,cw(ca),a];return[0,q.Failure,an(String(a))]}function
bO(){return 0}function
b(a,b){return a.length==1?a(b):ab(a,[b])}function
f(a,b,c){return a.length==2?a(b,c):ab(a,[b,c])}function
aM(a,b,c,d){return a.length==3?a(b,c,d):ab(a,[b,c,d])}function
b9(a,b,c,d,e,f){return a.length==5?a(b,c,d,e,f):ab(a,[b,c,d,e,f])}function
k3(a,b,c,d,e,f,g,h){return a.length==7?a(b,c,d,e,f,g,h):ab(a,[b,c,d,e,f,g,h])}ld();var
cD=[r,a(eq),-1],cF=[r,a(dL),-2],bi=[r,a(dO),-3],aw=[r,a(d9),-4],X=[r,a(ea),-7],cC=[r,a(dV),-8],cE=[r,a(ec),-9],m=[r,a(ek),-11],cG=[r,a(dC),-12],cU=[0,dJ],k2=[4,0,0,0,[12,45,[4,0,0,0,0]]],bX=[0,[11,a('File "'),[2,0,[11,a('", line '),[4,0,0,0,[11,a(dY),[4,0,0,0,[12,45,[4,0,0,0,[11,a(": "),[2,0,0]]]]]]]]]],a('File "%s", line %d, characters %d-%d: %s')],da=a("wakeup"),c$=[0,0],aJ=[0,1],a2=[0,0,0,0],de=[0,z,z,z],dq=[0,a7,20],bz=[0,3,[0,0,[0,1,[0,2,0]]]],dx=a("Thick Lines");W(11,cG,dC);W(10,m,ek);W(9,[r,a(d5),-10],d5);W(8,cE,ec);W(7,cC,dV);W(6,X,ea);W(5,[r,a(eh),-6],eh);W(4,[r,a(dP),-5],dP);W(3,aw,d9);W(2,bi,dO);W(1,cF,dL);W(0,cD,eq);var
e_=a("%.12g"),e9=a(aC),e7=a("true"),e8=a("false"),e5=a("char_of_int"),fb=a("\\\\"),fc=a("\\'"),fd=a("\\b"),fe=a("\\t"),ff=a("\\n"),fg=a("\\r"),fj=a("String.blit / Bytes.blit_string"),fi=a("Bytes.blit"),fh=a("String.sub / Bytes.sub"),fm=a("String.contains_from / Bytes.contains_from"),fs=a("Map.remove_min_elt"),ft=[0,0,0,0],fu=[0,a("map.ml"),400,10],fv=[0,0,0],fo=a(bB),fp=a(bB),fq=a(bB),fr=a(bB),fx=a("Stdlib.Queue.Empty"),fA=a("CamlinternalLazy.Undefined"),fG=a("Buffer.add: cannot grow buffer"),fF=[0,a(eg),93,2],fE=[0,a(eg),94,2],fP=a("%c"),fQ=a("%s"),fR=a(dB),fS=a(dU),fT=a(d7),fU=a(dE),fV=a("%f"),fW=a("%B"),fX=a("%{"),fY=a("%}"),fZ=a("%("),f0=a("%)"),f1=a("%a"),f2=a("%t"),f3=a("%?"),f4=a("%r"),f5=a("%_r"),f6=[0,a(w),850,23],gf=[0,a(w),814,21],f9=[0,a(w),815,21],gg=[0,a(w),818,21],f_=[0,a(w),819,21],gh=[0,a(w),822,19],f$=[0,a(w),823,19],gi=[0,a(w),826,22],ga=[0,a(w),827,22],gj=[0,a(w),831,30],gb=[0,a(w),832,30],gd=[0,a(w),836,26],f7=[0,a(w),837,26],ge=[0,a(w),846,28],f8=[0,a(w),847,28],gc=[0,a(w),851,23],hl=a(d2),hj=[0,a(w),1558,4],hk=a("Printf: bad conversion %["),hm=[0,a(w),1626,39],hn=[0,a(w),1649,31],ho=[0,a(w),1650,31],hp=a("Printf: bad conversion %_"),hq=a(d1),hr=a(d8),hs=a(d1),ht=a(d8),hh=a(cc),hf=a("neg_infinity"),hg=a(eo),he=a(aC),g0=a("%+nd"),g1=a("% nd"),g3=a("%+ni"),g4=a("% ni"),g5=a("%nx"),g6=a("%#nx"),g7=a("%nX"),g8=a("%#nX"),g9=a("%no"),g_=a("%#no"),gZ=a("%nd"),g2=a(d7),g$=a("%nu"),gN=a("%+ld"),gO=a("% ld"),gQ=a("%+li"),gR=a("% li"),gS=a("%lx"),gT=a("%#lx"),gU=a("%lX"),gV=a("%#lX"),gW=a("%lo"),gX=a("%#lo"),gM=a("%ld"),gP=a(dU),gY=a("%lu"),gA=a("%+Ld"),gB=a("% Ld"),gD=a("%+Li"),gE=a("% Li"),gF=a("%Lx"),gG=a("%#Lx"),gH=a("%LX"),gI=a("%#LX"),gJ=a("%Lo"),gK=a("%#Lo"),gz=a("%Ld"),gC=a(dE),gL=a("%Lu"),gn=a("%+d"),go=a("% d"),gq=a("%+i"),gr=a("% i"),gs=a("%x"),gt=a("%#x"),gu=a("%X"),gv=a("%#X"),gw=a("%o"),gx=a("%#o"),gm=a(cg),gp=a(dB),gy=a(d2),fH=a("@]"),fI=a("@}"),fJ=a("@?"),fK=a("@\n"),fL=a("@."),fM=a("@@"),fN=a("@%"),fO=a("@"),gk=a("CamlinternalFormat.Type_mismatch"),hx=a(g),hy=[0,[11,a(b$),[2,0,[2,0,0]]],a(", %s%s")],hQ=[0,[2,0,[12,10,0]],a("%s\n")],hR=[0,[11,a(dW),0],a(dW)],hI=a("Raised at"),hJ=a("Re-raised at"),hK=a("Raised by primitive operation at"),hL=a("Called from"),hM=a(" (inlined)"),hO=a(g),hN=[0,[2,0,[12,32,[2,0,[11,a(' in file "'),[2,0,[12,34,[2,0,[11,a(", line "),[4,0,0,0,[11,a(dY),k2]]]]]]]]]],a('%s %s in file "%s"%s, line %d, characters %d-%d')],hP=[0,[2,0,[11,a(" unknown location"),0]],a("%s unknown location")],hD=a("Out of memory"),hE=a("Stack overflow"),hF=a("Pattern matching failed"),hG=a("Assertion failed"),hH=a("Undefined recursive module"),hz=[0,[12,40,[2,0,[2,0,[12,41,0]]]],a("(%s%s)")],hA=a(g),hB=a(g),hC=[0,[12,40,[2,0,[12,41,0]]],a("(%s)")],hw=[0,[4,0,0,0,0],a(cg)],hu=[0,[3,0,0],a("%S")],hv=a("_"),hU=a("Fun.Finally_raised: "),hS=a("Stdlib.Fun.Finally_raised"),hV=a("x"),k0=a("OCAMLRUNPARAM"),kY=a("CAMLRUNPARAM"),hW=a(g),h0=a("Js_of_ocaml__Js.Error"),h1=a(ca),h2=a("Js_of_ocaml__Dom_html.Canvas_not_available"),ie=a("fill_rect"),id=a("set_line_width"),ic=a("draw_arc/ellipse/circle"),ib=a("draw_rect"),h5=a(bA),h6=a(g),h7=a(bA),h8=a("Cygwin"),h9=a("MacOS"),h_=a(dK),h$=a("Win32"),ia=a("Graphics: unknown OS type: "),ik=[0,[11,a(el),[2,0,0]],a(dT)],il=[0,[11,a(el),[2,0,0]],a(dT)],ih=a("Fatal error: exception "),ij=a("Lwt.Resolution_loop.Canceled"),iq=a("Exception during Lwt.async: "),ir=a(g),is=a(bA),ix=a("E2BIG"),iz=a("EACCES"),iA=a("EAGAIN"),iB=a("EBADF"),iC=a("EBUSY"),iD=a("ECHILD"),iE=a("EDEADLK"),iF=a("EDOM"),iG=a("EEXIST"),iH=a("EFAULT"),iI=a("EFBIG"),iJ=a("EINTR"),iK=a("EINVAL"),iL=a("EIO"),iM=a("EISDIR"),iN=a("EMFILE"),iO=a("EMLINK"),iP=a("ENAMETOOLONG"),iQ=a("ENFILE"),iR=a("ENODEV"),iS=a("ENOENT"),iT=a("ENOEXEC"),iU=a("ENOLCK"),iV=a("ENOMEM"),iW=a("ENOSPC"),iX=a("ENOSYS"),iY=a("ENOTDIR"),iZ=a("ENOTEMPTY"),i0=a("ENOTTY"),i1=a("ENXIO"),i2=a("EPERM"),i3=a("EPIPE"),i4=a("ERANGE"),i5=a("EROFS"),i6=a("ESPIPE"),i7=a("ESRCH"),i8=a("EXDEV"),i9=a("EWOULDBLOCK"),i_=a("EINPROGRESS"),i$=a("EALREADY"),ja=a("ENOTSOCK"),jb=a("EDESTADDRREQ"),jc=a("EMSGSIZE"),jd=a("EPROTOTYPE"),je=a("ENOPROTOOPT"),jf=a("EPROTONOSUPPORT"),jg=a("ESOCKTNOSUPPORT"),jh=a("EOPNOTSUPP"),ji=a("EPFNOSUPPORT"),jj=a("EAFNOSUPPORT"),jk=a("EADDRINUSE"),jl=a("EADDRNOTAVAIL"),jm=a("ENETDOWN"),jn=a("ENETUNREACH"),jo=a("ENETRESET"),jp=a("ECONNABORTED"),jq=a("ECONNRESET"),jr=a("ENOBUFS"),js=a("EISCONN"),jt=a("ENOTCONN"),ju=a("ESHUTDOWN"),jv=a("ETOOMANYREFS"),jw=a("ETIMEDOUT"),jx=a("ECONNREFUSED"),jy=a("EHOSTDOWN"),jz=a("EHOSTUNREACH"),jA=a("ELOOP"),jB=a("EOVERFLOW"),jC=[0,[11,a("EUNKNOWNERR "),[4,0,0,0,0]],a("EUNKNOWNERR %d")],iy=[0,[11,a("Unix.Unix_error(Unix."),[2,0,[11,a(b$),[3,0,[11,a(b$),[3,0,[12,41,0]]]]]]],a("Unix.Unix_error(Unix.%s, %S, %S)")],it=a(ed),iu=a(g),iv=a(g),iw=a(ed),jD=a("0.0.0.0"),jE=a("127.0.0.1"),kX=a("::"),kW=a("::1"),jG=a("empty deque"),jO=a("Source Sans Pro, Roboto, sans-serif"),jH=[0,5],jI=[0,z,0,0],jJ=[0,0,z,0],jK=[0,0,0,z],jL=[0,z,z,0],jM=[0,0,z,z],jN=[0,z,0,z],j2=[0,0,0],j3=[0,0,0],j4=[0,260,0],j1=[0,z,20],j0=[0,z,20],jX=[0,25,0],jY=[0,0,0],jW=[0,0,0],jU=[0,0,0],jQ=[0,0,0],jR=[0,0,0],jS=[0,2,2],jP=[0,2,2],j6=[0,0],j7=[0,1],j8=[0,3],j9=[0,2],j5=[0,0,0,0,0,32],kJ=[0,0,0],j$=[0,601,351],ka=[0,0,0],kb=[0,600,350],kf=a("Undo"),kk=[0,10,10],kl=a("Line"),kq=a("Point"),kv=a("Ellipse"),kB=a("Adjust Brightness"),kL=a("Current Color");function
o(a){if(typeof
a==="number")return 0;else
switch(a[0]){case
0:return[0,o(a[1])];case
1:return[1,o(a[1])];case
2:return[2,o(a[1])];case
3:return[3,o(a[1])];case
4:return[4,o(a[1])];case
5:return[5,o(a[1])];case
6:return[6,o(a[1])];case
7:return[7,o(a[1])];case
8:var
c=a[1];return[8,c,o(a[2])];case
9:var
b=a[1];return[9,b,b,o(a[3])];case
10:return[10,o(a[1])];case
11:return[11,o(a[1])];case
12:return[12,o(a[1])];case
13:return[13,o(a[1])];default:return[14,o(a[1])]}}function
F(a,b){if(typeof
a==="number")return b;else
switch(a[0]){case
0:return[0,F(a[1],b)];case
1:return[1,F(a[1],b)];case
2:return[2,F(a[1],b)];case
3:return[3,F(a[1],b)];case
4:return[4,F(a[1],b)];case
5:return[5,F(a[1],b)];case
6:return[6,F(a[1],b)];case
7:return[7,F(a[1],b)];case
8:var
c=a[1];return[8,c,F(a[2],b)];case
9:var
d=a[2],e=a[1];return[9,e,d,F(a[3],b)];case
10:return[10,F(a[1],b)];case
11:return[11,F(a[1],b)];case
12:return[12,F(a[1],b)];case
13:return[13,F(a[1],b)];default:return[14,F(a[1],b)]}}function
l(a,b){if(typeof
a==="number")return b;else
switch(a[0]){case
0:return[0,l(a[1],b)];case
1:return[1,l(a[1],b)];case
2:var
c=a[1];return[2,c,l(a[2],b)];case
3:var
d=a[1];return[3,d,l(a[2],b)];case
4:var
e=a[3],f=a[2],g=a[1];return[4,g,f,e,l(a[4],b)];case
5:var
h=a[3],i=a[2],j=a[1];return[5,j,i,h,l(a[4],b)];case
6:var
k=a[3],m=a[2],n=a[1];return[6,n,m,k,l(a[4],b)];case
7:var
o=a[3],p=a[2],q=a[1];return[7,q,p,o,l(a[4],b)];case
8:var
r=a[3],s=a[2],t=a[1];return[8,t,s,r,l(a[4],b)];case
9:var
u=a[1];return[9,u,l(a[2],b)];case
10:return[10,l(a[1],b)];case
11:var
v=a[1];return[11,v,l(a[2],b)];case
12:var
w=a[1];return[12,w,l(a[2],b)];case
13:var
x=a[2],y=a[1];return[13,y,x,l(a[3],b)];case
14:var
z=a[2],A=a[1];return[14,A,z,l(a[3],b)];case
15:return[15,l(a[1],b)];case
16:return[16,l(a[1],b)];case
17:var
B=a[1];return[17,B,l(a[2],b)];case
18:var
C=a[1];return[18,C,l(a[2],b)];case
19:return[19,l(a[1],b)];case
20:var
D=a[2],E=a[1];return[20,E,D,l(a[3],b)];case
21:var
F=a[1];return[21,F,l(a[2],b)];case
22:return[22,l(a[1],b)];case
23:var
G=a[1];return[23,G,l(a[2],b)];default:var
H=a[2],I=a[1];return[24,I,H,l(a[3],b)]}}function
bP(a,c,b){return a[1]===c?(a[1]=b,1):0}function
cB(a){throw[0,bi,a]}function
G(a){throw[0,aw,a]}Q(0);function
bj(b,a){return lu(b,a)?b:a}function
aU(a){return 0<=a?a:-a|0}function
ax(d,c){var
a=s(d),e=s(c),b=x(a+e|0);aD(d,0,b,0,a);aD(c,0,b,a,e);return M(b)}function
cH(a){if(0<=a&&!(z<a))return a;return G(e5)}function
e6(a){return a?e7:e8}function
bk(a,b){if(a){var
c=a[1];return[0,c,bk(a[2],b)]}return b}lP(0);eU(1);var
aV=eU(2);function
e$(b){function
a(b){var
a=b;for(;;){if(a){var
c=a[2],d=a[1];try{bK(d)}catch(a){a=ao(a);if(a[1]!==cF)throw a;var
e=a}var
a=c;continue}return 0}}return a(lQ(0))}function
aW(b,a){return eV(b,a,0,s(a))}function
cI(a){return aW(aV,a)}var
bQ=[0,e$];function
fa(d){for(;;){var
a=bQ[1],e=[0,1],c=1-bP(bQ,a,function(a,c){return function(e){if(bP(a,1,0))b(d,0);return b(c,0)}}(e,a));if(c)continue;return c}}function
cJ(a){return b(bQ[1],0)}if(l5(0))fa(function(a){return le(a)});var
aX=l7(0)[1],cK=l4(0),aY=(4*cK|0)-1|0;Q(0);typeof
l3(0)==="number";function
cL(d,c){var
a=c;for(;;){if(a){var
e=a[2];b(d,a[1]);var
a=e;continue}return 0}}function
bR(c,a,b){if(a){var
d=a[1];return f(c,d,bR(c,a[2],b))}return b}function
bl(d,c){var
a=c;for(;;){if(a){var
e=a[2],b=0===eF(a[1],d)?1:0;if(b)return b;var
a=e;continue}return 0}}function
ay(a,c){var
b=x(a);lc(b,0,a,c);return b}function
cM(d,b,a){var
f=0;if(0<=b&&0<=a&&!((S(d)-a|0)<b)){var
c=x(a);as(d,b,c,0,a);var
e=c;f=1}if(!f)var
e=G(fh);return M(e)}function
cN(e,c,d,b,a){if(0<=a&&0<=c&&!((S(e)-a|0)<c)&&0<=b&&!((S(d)-a|0)<b))return as(e,c,d,b,a);return G(fi)}function
ad(e,c,d,b,a){if(0<=a&&0<=c&&!((s(e)-a|0)<c)&&0<=b&&!((S(d)-a|0)<b))return aD(e,c,d,b,a);return G(fj)}function
fk(e,d,c,b){var
a=c;for(;;){if(d<=a)throw X;if(aT(e,a)===b)return a;var
a=a+1|0;continue}}function
fl(b,a,d){var
c=s(b);if(0<=a&&!(c<a))try{fk(b,c,a,d);var
e=1;return e}catch(a){a=ao(a);if(a===X)return 0;throw a}return G(fm)}function
fn(b,a){return fl(b,0,a)}Q(0);function
fw(g){function
h(a){return a?a[5]:0}function
d(b,f,e,a){var
c=h(b),d=h(a),g=d<=c?c+1|0:d+1|0;return[0,b,f,e,a,g]}function
q(b,a){return[0,0,b,a,0,1]}function
a(b,g,f,a){var
i=b?b[5]:0,j=a?a[5]:0;if((j+2|0)<i){if(b){var
c=b[4],m=b[3],n=b[2],k=b[1],q=h(c);if(q<=h(k))return d(k,n,m,d(c,g,f,a));if(c){var
r=c[3],s=c[2],t=c[1],u=d(c[4],g,f,a);return d(d(k,n,m,t),s,r,u)}return G(fo)}return G(fp)}if((i+2|0)<j){if(a){var
l=a[4],o=a[3],p=a[2],e=a[1],v=h(e);if(v<=h(l))return d(d(b,g,f,e),p,o,l);if(e){var
w=e[3],x=e[2],y=e[1],z=d(e[4],p,o,l);return d(d(b,g,f,y),x,w,z)}return G(fq)}return G(fr)}var
A=j<=i?i+1|0:j+1|0;return[0,b,g,f,a,A]}var
B=0;function
P(a){return a?0:1}function
n(d,c,b){if(b){var
e=b[4],i=b[3],j=b[2],h=b[1],o=b[5],k=f(g[1],d,j);if(0===k)return i===c?b:[0,h,d,c,e,o];if(0<=k){var
l=n(d,c,e);return e===l?b:a(h,j,i,l)}var
m=n(d,c,h);return h===m?b:a(m,j,i,e)}return[0,0,d,c,0,1]}function
Q(d,c){var
a=c;for(;;){if(a){var
e=a[4],h=a[3],i=a[1],b=f(g[1],d,a[2]);if(0===b)return h;var
j=0<=b?e:i,a=j;continue}throw X}}function
R(g,l){var
c=l;for(;;){if(c){var
h=c[2],m=c[4],n=c[3],o=c[1];if(b(g,h)){var
e=h,d=n,a=o;for(;;){if(a){var
f=a[2],i=a[4],j=a[3],k=a[1];if(b(g,f)){var
e=f,d=j,a=k;continue}var
a=i;continue}return[0,e,d]}}var
c=m;continue}throw X}}function
S(g,l){var
c=l;for(;;){if(c){var
h=c[2],m=c[4],n=c[3],o=c[1];if(b(g,h)){var
e=h,d=n,a=o;for(;;){if(a){var
f=a[2],i=a[4],j=a[3],k=a[1];if(b(g,f)){var
e=f,d=j,a=k;continue}var
a=i;continue}return[0,[0,e,d]]}}var
c=m;continue}return 0}}function
T(g,l){var
c=l;for(;;){if(c){var
h=c[2],m=c[4],n=c[3],o=c[1];if(b(g,h)){var
e=h,d=n,a=m;for(;;){if(a){var
f=a[2],i=a[4],j=a[3],k=a[1];if(b(g,f)){var
e=f,d=j,a=i;continue}var
a=k;continue}return[0,e,d]}}var
c=o;continue}throw X}}function
U(g,l){var
c=l;for(;;){if(c){var
h=c[2],m=c[4],n=c[3],o=c[1];if(b(g,h)){var
e=h,d=n,a=m;for(;;){if(a){var
f=a[2],i=a[4],j=a[3],k=a[1];if(b(g,f)){var
e=f,d=j,a=i;continue}var
a=k;continue}return[0,[0,e,d]]}}var
c=o;continue}return 0}}function
V(d,c){var
a=c;for(;;){if(a){var
e=a[4],h=a[3],i=a[1],b=f(g[1],d,a[2]);if(0===b)return[0,h];var
j=0<=b?e:i,a=j;continue}return 0}}function
W(e,d){var
a=d;for(;;){if(a){var
h=a[4],i=a[1],b=f(g[1],e,a[2]),c=0===b?1:0;if(c)return c;var
j=0<=b?h:i,a=j;continue}return 0}}function
o(c){var
a=c;for(;;){if(a){var
b=a[1];if(b){var
a=b;continue}return[0,a[2],a[3]]}throw X}}function
C(c){var
a=c;for(;;){if(a){var
b=a[1];if(b){var
a=b;continue}return[0,[0,a[2],a[3]]]}return 0}}function
Y(b){var
a=b;for(;;){if(a){if(a[4]){var
a=a[4];continue}return[0,a[2],a[3]]}throw X}}function
Z(b){var
a=b;for(;;){if(a){if(a[4]){var
a=a[4];continue}return[0,[0,a[2],a[3]]]}return 0}}function
r(b){if(b){var