-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathserver.js
8029 lines (8029 loc) · 256 KB
/
server.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 Haxe 4.0.0-preview.4+1e3e5e016
(function ($global) { "use strict";
var $estr = function() { return js_Boot.__string_rec(this,''); },$hxEnums = {},$_;
function $extend(from, fields) {
function Inherit() {} Inherit.prototype = from; var proto = new Inherit();
for (var name in fields) proto[name] = fields[name];
if( fields.toString !== Object.prototype.toString ) proto.toString = fields.toString;
return proto;
}
var DateTools = function() { };
DateTools.__name__ = true;
DateTools.__format_get = function(d,e) {
switch(e) {
case "%":
return "%";
case "A":
return DateTools.DAY_NAMES[d.getDay()];
case "B":
return DateTools.MONTH_NAMES[d.getMonth()];
case "C":
return StringTools.lpad(Std.string(d.getFullYear() / 100 | 0),"0",2);
case "D":
return DateTools.__format(d,"%m/%d/%y");
case "F":
return DateTools.__format(d,"%Y-%m-%d");
case "I":case "l":
var hour = d.getHours() % 12;
return StringTools.lpad(Std.string(hour == 0 ? 12 : hour),e == "I" ? "0" : " ",2);
case "M":
return StringTools.lpad(Std.string(d.getMinutes()),"0",2);
case "R":
return DateTools.__format(d,"%H:%M");
case "S":
return StringTools.lpad(Std.string(d.getSeconds()),"0",2);
case "T":
return DateTools.__format(d,"%H:%M:%S");
case "Y":
return Std.string(d.getFullYear());
case "a":
return DateTools.DAY_SHORT_NAMES[d.getDay()];
case "b":case "h":
return DateTools.MONTH_SHORT_NAMES[d.getMonth()];
case "d":
return StringTools.lpad(Std.string(d.getDate()),"0",2);
case "e":
return Std.string(d.getDate());
case "H":case "k":
return StringTools.lpad(Std.string(d.getHours()),e == "H" ? "0" : " ",2);
case "m":
return StringTools.lpad(Std.string(d.getMonth() + 1),"0",2);
case "n":
return "\n";
case "p":
if(d.getHours() > 11) {
return "PM";
} else {
return "AM";
}
break;
case "r":
return DateTools.__format(d,"%I:%M:%S %p");
case "s":
return Std.string(d.getTime() / 1000 | 0);
case "t":
return "\t";
case "u":
var t = d.getDay();
if(t == 0) {
return "7";
} else if(t == null) {
return "null";
} else {
return "" + t;
}
break;
case "w":
return Std.string(d.getDay());
case "y":
return StringTools.lpad(Std.string(d.getFullYear() % 100),"0",2);
default:
throw new js__$Boot_HaxeError("Date.format %" + e + "- not implemented yet.");
}
};
DateTools.__format = function(d,f) {
var r_b = "";
var p = 0;
while(true) {
var np = f.indexOf("%",p);
if(np < 0) {
break;
}
var len = np - p;
r_b += len == null ? HxOverrides.substr(f,p,null) : HxOverrides.substr(f,p,len);
r_b += Std.string(DateTools.__format_get(d,HxOverrides.substr(f,np + 1,1)));
p = np + 2;
}
var len1 = f.length - p;
r_b += len1 == null ? HxOverrides.substr(f,p,null) : HxOverrides.substr(f,p,len1);
return r_b;
};
DateTools.format = function(d,f) {
return DateTools.__format(d,f);
};
var EReg = function(r,opt) {
this.r = new RegExp(r,opt.split("u").join(""));
};
EReg.__name__ = true;
EReg.prototype = {
match: function(s) {
if(this.r.global) {
this.r.lastIndex = 0;
}
this.r.m = this.r.exec(s);
this.r.s = s;
return this.r.m != null;
}
,matched: function(n) {
if(this.r.m != null && n >= 0 && n < this.r.m.length) {
return this.r.m[n];
} else {
throw new js__$Boot_HaxeError("EReg::matched");
}
}
,__class__: EReg
};
var HxOverrides = function() { };
HxOverrides.__name__ = true;
HxOverrides.strDate = function(s) {
var _g = s.length;
switch(_g) {
case 8:
var k = s.split(":");
var d = new Date();
d["setTime"](0);
d["setUTCHours"](k[0]);
d["setUTCMinutes"](k[1]);
d["setUTCSeconds"](k[2]);
return d;
case 10:
var k1 = s.split("-");
return new Date(k1[0],k1[1] - 1,k1[2],0,0,0);
case 19:
var k2 = s.split(" ");
var y = k2[0].split("-");
var t = k2[1].split(":");
return new Date(y[0],y[1] - 1,y[2],t[0],t[1],t[2]);
default:
throw new js__$Boot_HaxeError("Invalid date format : " + s);
}
};
HxOverrides.cca = function(s,index) {
var x = s.charCodeAt(index);
if(x != x) {
return undefined;
}
return x;
};
HxOverrides.substr = function(s,pos,len) {
if(len == null) {
len = s.length;
} else if(len < 0) {
if(pos == 0) {
len = s.length + len;
} else {
return "";
}
}
return s.substr(pos,len);
};
HxOverrides.remove = function(a,obj) {
var i = a.indexOf(obj);
if(i == -1) {
return false;
}
a.splice(i,1);
return true;
};
HxOverrides.iter = function(a) {
return { cur : 0, arr : a, hasNext : function() {
return this.cur < this.arr.length;
}, next : function() {
return this.arr[this.cur++];
}};
};
Math.__name__ = true;
var Reflect = function() { };
Reflect.__name__ = true;
Reflect.field = function(o,field) {
try {
return o[field];
} catch( e ) {
var e1 = (e instanceof js__$Boot_HaxeError) ? e.val : e;
return null;
}
};
Reflect.fields = function(o) {
var a = [];
if(o != null) {
var hasOwnProperty = Object.prototype.hasOwnProperty;
for( var f in o ) {
if(f != "__id__" && f != "hx__closures__" && hasOwnProperty.call(o,f)) {
a.push(f);
}
}
}
return a;
};
Reflect.copy = function(o) {
var o2 = { };
var _g = 0;
var _g1 = Reflect.fields(o);
while(_g < _g1.length) {
var f = _g1[_g];
++_g;
o2[f] = Reflect.field(o,f);
}
return o2;
};
var Server = function() { };
Server.__name__ = true;
Server.main = function() {
var container = new tink_http_containers_NodeContainer(8080);
var router = new tink_web_routing_Router0(new routing_Root());
container.run(new tink_http_SimpleHandler(function(req) {
var this1 = tink_web_routing_Context.ofRequest(req);
var this2 = router.route(this1);
var f = tink_core__$Promise_Recover_$Impl_$.ofSync(tink_http__$Response_OutgoingResponse_$Impl_$.reportError);
var ret = this2.flatMap(function(o) {
switch(o._hx_index) {
case 0:
var d = o.data;
return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(d));
case 1:
var e = o.failure;
return f(e);
}
});
return ret.gather();
}));
};
var Std = function() { };
Std.__name__ = true;
Std.string = function(s) {
return js_Boot.__string_rec(s,"");
};
Std.parseInt = function(x) {
var v = parseInt(x,10);
if(v == 0 && (HxOverrides.cca(x,1) == 120 || HxOverrides.cca(x,1) == 88)) {
v = parseInt(x);
}
if(isNaN(v)) {
return null;
}
return v;
};
Std.random = function(x) {
if(x <= 0) {
return 0;
} else {
return Math.floor(Math.random() * x);
}
};
var StringBuf = function() {
this.b = "";
};
StringBuf.__name__ = true;
StringBuf.prototype = {
__class__: StringBuf
};
var StringTools = function() { };
StringTools.__name__ = true;
StringTools.startsWith = function(s,start) {
if(s.length >= start.length) {
return HxOverrides.substr(s,0,start.length) == start;
} else {
return false;
}
};
StringTools.endsWith = function(s,end) {
var elen = end.length;
var slen = s.length;
if(slen >= elen) {
return HxOverrides.substr(s,slen - elen,elen) == end;
} else {
return false;
}
};
StringTools.isSpace = function(s,pos) {
var c = HxOverrides.cca(s,pos);
if(!(c > 8 && c < 14)) {
return c == 32;
} else {
return true;
}
};
StringTools.ltrim = function(s) {
var l = s.length;
var r = 0;
while(r < l && StringTools.isSpace(s,r)) ++r;
if(r > 0) {
return HxOverrides.substr(s,r,l - r);
} else {
return s;
}
};
StringTools.rtrim = function(s) {
var l = s.length;
var r = 0;
while(r < l && StringTools.isSpace(s,l - r - 1)) ++r;
if(r > 0) {
return HxOverrides.substr(s,0,l - r);
} else {
return s;
}
};
StringTools.trim = function(s) {
return StringTools.ltrim(StringTools.rtrim(s));
};
StringTools.lpad = function(s,c,l) {
if(c.length <= 0) {
return s;
}
while(s.length < l) s = c + s;
return s;
};
StringTools.replace = function(s,sub,by) {
return s.split(sub).join(by);
};
StringTools.hex = function(n,digits) {
var s = "";
var hexChars = "0123456789ABCDEF";
while(true) {
s = hexChars.charAt(n & 15) + s;
n >>>= 4;
if(!(n > 0)) {
break;
}
}
if(digits != null) {
while(s.length < digits) s = "0" + s;
}
return s;
};
var haxe_StackItem = $hxEnums["haxe.StackItem"] = { __ename__ : true, __constructs__ : ["CFunction","Module","FilePos","Method","LocalFunction"]
,CFunction: {_hx_index:0,__enum__:"haxe.StackItem",toString:$estr}
,Module: ($_=function(m) { return {_hx_index:1,m:m,__enum__:"haxe.StackItem",toString:$estr}; },$_.__params__ = ["m"],$_)
,FilePos: ($_=function(s,file,line,column) { return {_hx_index:2,s:s,file:file,line:line,column:column,__enum__:"haxe.StackItem",toString:$estr}; },$_.__params__ = ["s","file","line","column"],$_)
,Method: ($_=function(classname,method) { return {_hx_index:3,classname:classname,method:method,__enum__:"haxe.StackItem",toString:$estr}; },$_.__params__ = ["classname","method"],$_)
,LocalFunction: ($_=function(v) { return {_hx_index:4,v:v,__enum__:"haxe.StackItem",toString:$estr}; },$_.__params__ = ["v"],$_)
};
var haxe_IMap = function() { };
haxe_IMap.__name__ = true;
haxe_IMap.prototype = {
__class__: haxe_IMap
};
var haxe_io_Bytes = function(data) {
this.length = data.byteLength;
this.b = new Uint8Array(data);
this.b.bufferValue = data;
data.hxBytes = this;
data.bytes = this.b;
};
haxe_io_Bytes.__name__ = true;
haxe_io_Bytes.alloc = function(length) {
return new haxe_io_Bytes(new ArrayBuffer(length));
};
haxe_io_Bytes.ofString = function(s) {
var a = [];
var i = 0;
while(i < s.length) {
var c = s.charCodeAt(i++);
if(55296 <= c && c <= 56319) {
c = c - 55232 << 10 | s.charCodeAt(i++) & 1023;
}
if(c <= 127) {
a.push(c);
} else if(c <= 2047) {
a.push(192 | c >> 6);
a.push(128 | c & 63);
} else if(c <= 65535) {
a.push(224 | c >> 12);
a.push(128 | c >> 6 & 63);
a.push(128 | c & 63);
} else {
a.push(240 | c >> 18);
a.push(128 | c >> 12 & 63);
a.push(128 | c >> 6 & 63);
a.push(128 | c & 63);
}
}
return new haxe_io_Bytes(new Uint8Array(a).buffer);
};
haxe_io_Bytes.ofData = function(b) {
var hb = b.hxBytes;
if(hb != null) {
return hb;
}
return new haxe_io_Bytes(b);
};
haxe_io_Bytes.fastGet = function(b,pos) {
return b.bytes[pos];
};
haxe_io_Bytes.prototype = {
blit: function(pos,src,srcpos,len) {
if(pos < 0 || srcpos < 0 || len < 0 || pos + len > this.length || srcpos + len > src.length) {
throw new js__$Boot_HaxeError(haxe_io_Error.OutsideBounds);
}
if(srcpos == 0 && len == src.b.byteLength) {
this.b.set(src.b,pos);
} else {
this.b.set(src.b.subarray(srcpos,srcpos + len),pos);
}
}
,sub: function(pos,len) {
if(pos < 0 || len < 0 || pos + len > this.length) {
throw new js__$Boot_HaxeError(haxe_io_Error.OutsideBounds);
}
return new haxe_io_Bytes(this.b.buffer.slice(pos + this.b.byteOffset,pos + this.b.byteOffset + len));
}
,getString: function(pos,len) {
if(pos < 0 || len < 0 || pos + len > this.length) {
throw new js__$Boot_HaxeError(haxe_io_Error.OutsideBounds);
}
var s = "";
var b = this.b;
var fcc = String.fromCharCode;
var i = pos;
var max = pos + len;
while(i < max) {
var c = b[i++];
if(c < 128) {
if(c == 0) {
break;
}
s += fcc(c);
} else if(c < 224) {
s += fcc((c & 63) << 6 | b[i++] & 127);
} else if(c < 240) {
var c2 = b[i++];
s += fcc((c & 31) << 12 | (c2 & 127) << 6 | b[i++] & 127);
} else {
var c21 = b[i++];
var c3 = b[i++];
var u = (c & 15) << 18 | (c21 & 127) << 12 | (c3 & 127) << 6 | b[i++] & 127;
s += fcc((u >> 10) + 55232);
s += fcc(u & 1023 | 56320);
}
}
return s;
}
,toString: function() {
return this.getString(0,this.length);
}
,toHex: function() {
var s_b = "";
var chars = [];
var str = "0123456789abcdef";
var _g1 = 0;
var _g = str.length;
while(_g1 < _g) {
var i = _g1++;
chars.push(HxOverrides.cca(str,i));
}
var _g11 = 0;
var _g2 = this.length;
while(_g11 < _g2) {
var i1 = _g11++;
var c = this.b[i1];
s_b += String.fromCharCode(chars[c >> 4]);
s_b += String.fromCharCode(chars[c & 15]);
}
return s_b;
}
,__class__: haxe_io_Bytes
};
var haxe_crypto_Base64 = function() { };
haxe_crypto_Base64.__name__ = true;
haxe_crypto_Base64.decode = function(str,complement) {
if(complement == null) {
complement = true;
}
if(complement) {
while(HxOverrides.cca(str,str.length - 1) == 61) str = HxOverrides.substr(str,0,-1);
}
return new haxe_crypto_BaseCode(haxe_crypto_Base64.BYTES).decodeBytes(haxe_io_Bytes.ofString(str));
};
var haxe_crypto_BaseCode = function(base) {
var len = base.length;
var nbits = 1;
while(len > 1 << nbits) ++nbits;
if(nbits > 8 || len != 1 << nbits) {
throw new js__$Boot_HaxeError("BaseCode : base length must be a power of two.");
}
this.base = base;
this.nbits = nbits;
};
haxe_crypto_BaseCode.__name__ = true;
haxe_crypto_BaseCode.prototype = {
initTable: function() {
var tbl = [];
var _g = 0;
while(_g < 256) {
var i = _g++;
tbl[i] = -1;
}
var _g1 = 0;
var _g2 = this.base.length;
while(_g1 < _g2) {
var i1 = _g1++;
tbl[this.base.b[i1]] = i1;
}
this.tbl = tbl;
}
,decodeBytes: function(b) {
var nbits = this.nbits;
var base = this.base;
if(this.tbl == null) {
this.initTable();
}
var tbl = this.tbl;
var size = b.length * nbits >> 3;
var out = new haxe_io_Bytes(new ArrayBuffer(size));
var buf = 0;
var curbits = 0;
var pin = 0;
var pout = 0;
while(pout < size) {
while(curbits < 8) {
curbits += nbits;
buf <<= nbits;
var i = tbl[b.b[pin++]];
if(i == -1) {
throw new js__$Boot_HaxeError("BaseCode : invalid encoded char");
}
buf |= i;
}
curbits -= 8;
out.b[pout++] = buf >> curbits & 255 & 255;
}
return out;
}
,__class__: haxe_crypto_BaseCode
};
var haxe_ds_Either = $hxEnums["haxe.ds.Either"] = { __ename__ : true, __constructs__ : ["Left","Right"]
,Left: ($_=function(v) { return {_hx_index:0,v:v,__enum__:"haxe.ds.Either",toString:$estr}; },$_.__params__ = ["v"],$_)
,Right: ($_=function(v) { return {_hx_index:1,v:v,__enum__:"haxe.ds.Either",toString:$estr}; },$_.__params__ = ["v"],$_)
};
var haxe_ds_ObjectMap = function() {
this.h = { __keys__ : { }};
};
haxe_ds_ObjectMap.__name__ = true;
haxe_ds_ObjectMap.__interfaces__ = [haxe_IMap];
haxe_ds_ObjectMap.prototype = {
get: function(key) {
return this.h[key.__id__];
}
,exists: function(key) {
return this.h.__keys__[key.__id__] != null;
}
,keys: function() {
var a = [];
for( var key in this.h.__keys__ ) {
if(this.h.hasOwnProperty(key)) {
a.push(this.h.__keys__[key]);
}
}
return HxOverrides.iter(a);
}
,iterator: function() {
return { ref : this.h, it : this.keys(), hasNext : function() {
return this.it.hasNext();
}, next : function() {
var i = this.it.next();
return this.ref[i.__id__];
}};
}
,__class__: haxe_ds_ObjectMap
};
var haxe_ds_Option = $hxEnums["haxe.ds.Option"] = { __ename__ : true, __constructs__ : ["Some","None"]
,Some: ($_=function(v) { return {_hx_index:0,v:v,__enum__:"haxe.ds.Option",toString:$estr}; },$_.__params__ = ["v"],$_)
,None: {_hx_index:1,__enum__:"haxe.ds.Option",toString:$estr}
};
var haxe_ds__$StringMap_StringMapIterator = function(map,keys) {
this.map = map;
this.keys = keys;
this.index = 0;
this.count = keys.length;
};
haxe_ds__$StringMap_StringMapIterator.__name__ = true;
haxe_ds__$StringMap_StringMapIterator.prototype = {
hasNext: function() {
return this.index < this.count;
}
,next: function() {
var _this = this.map;
var key = this.keys[this.index++];
if(__map_reserved[key] != null) {
return _this.getReserved(key);
} else {
return _this.h[key];
}
}
,__class__: haxe_ds__$StringMap_StringMapIterator
};
var haxe_ds_StringMap = function() {
this.h = { };
};
haxe_ds_StringMap.__name__ = true;
haxe_ds_StringMap.__interfaces__ = [haxe_IMap];
haxe_ds_StringMap.prototype = {
get: function(key) {
if(__map_reserved[key] != null) {
return this.getReserved(key);
}
return this.h[key];
}
,exists: function(key) {
if(__map_reserved[key] != null) {
return this.existsReserved(key);
}
return this.h.hasOwnProperty(key);
}
,setReserved: function(key,value) {
if(this.rh == null) {
this.rh = { };
}
this.rh["$" + key] = value;
}
,getReserved: function(key) {
if(this.rh == null) {
return null;
} else {
return this.rh["$" + key];
}
}
,existsReserved: function(key) {
if(this.rh == null) {
return false;
}
return this.rh.hasOwnProperty("$" + key);
}
,keys: function() {
return HxOverrides.iter(this.arrayKeys());
}
,arrayKeys: function() {
var out = [];
for( var key in this.h ) {
if(this.h.hasOwnProperty(key)) {
out.push(key);
}
}
if(this.rh != null) {
for( var key in this.rh ) {
if(key.charCodeAt(0) == 36) {
out.push(key.substr(1));
}
}
}
return out;
}
,iterator: function() {
return new haxe_ds__$StringMap_StringMapIterator(this,this.arrayKeys());
}
,__class__: haxe_ds_StringMap
};
var haxe_io_Eof = function() {
};
haxe_io_Eof.__name__ = true;
haxe_io_Eof.prototype = {
toString: function() {
return "Eof";
}
,__class__: haxe_io_Eof
};
var haxe_io_Error = $hxEnums["haxe.io.Error"] = { __ename__ : true, __constructs__ : ["Blocked","Overflow","OutsideBounds","Custom"]
,Blocked: {_hx_index:0,__enum__:"haxe.io.Error",toString:$estr}
,Overflow: {_hx_index:1,__enum__:"haxe.io.Error",toString:$estr}
,OutsideBounds: {_hx_index:2,__enum__:"haxe.io.Error",toString:$estr}
,Custom: ($_=function(e) { return {_hx_index:3,e:e,__enum__:"haxe.io.Error",toString:$estr}; },$_.__params__ = ["e"],$_)
};
var haxe_io_Input = function() { };
haxe_io_Input.__name__ = true;
haxe_io_Input.prototype = {
readByte: function() {
throw new js__$Boot_HaxeError("Not implemented");
}
,readBytes: function(s,pos,len) {
var k = len;
var b = s.b;
if(pos < 0 || len < 0 || pos + len > s.length) {
throw new js__$Boot_HaxeError(haxe_io_Error.OutsideBounds);
}
try {
while(k > 0) {
b[pos] = this.readByte();
++pos;
--k;
}
} catch( eof ) {
var eof1 = (eof instanceof js__$Boot_HaxeError) ? eof.val : eof;
if((eof1 instanceof haxe_io_Eof)) {
var eof2 = eof1;
} else {
throw eof;
}
}
return len - k;
}
,close: function() {
}
,__class__: haxe_io_Input
};
var haxe_io_Output = function() { };
haxe_io_Output.__name__ = true;
haxe_io_Output.prototype = {
writeByte: function(c) {
throw new js__$Boot_HaxeError("Not implemented");
}
,writeBytes: function(s,pos,len) {
if(pos < 0 || len < 0 || pos + len > s.length) {
throw new js__$Boot_HaxeError(haxe_io_Error.OutsideBounds);
}
var b = s.b;
var k = len;
while(k > 0) {
this.writeByte(b[pos]);
++pos;
--k;
}
return len;
}
,close: function() {
}
,__class__: haxe_io_Output
};
var httpstatus__$HttpStatusCode_HttpStatusCode_$Impl_$ = {};
httpstatus__$HttpStatusCode_HttpStatusCode_$Impl_$.__name__ = true;
httpstatus__$HttpStatusCode_HttpStatusCode_$Impl_$.toMessage = function(this1) {
var this2 = httpstatus__$HttpStatusMessage_HttpStatusMessage_$Impl_$.fromCode(this1);
return this2;
};
httpstatus__$HttpStatusCode_HttpStatusCode_$Impl_$.toInt = function(this1) {
return this1;
};
httpstatus__$HttpStatusCode_HttpStatusCode_$Impl_$.fromErrorCode = function(code) {
return code;
};
httpstatus__$HttpStatusCode_HttpStatusCode_$Impl_$.toWebResponse = function(this1) {
return httpstatus__$HttpStatusCode_HttpStatusCode_$Impl_$.toOutgoingResponse(this1);
};
httpstatus__$HttpStatusCode_HttpStatusCode_$Impl_$.toOutgoingResponse = function(this1) {
var this2 = httpstatus__$HttpStatusMessage_HttpStatusMessage_$Impl_$.fromCode(this1);
var this3 = new tink_http_ResponseHeaderBase(this1,this2,[new tink_http_HeaderField("content-length","0")],"HTTP/1.1");
var this4 = new tink_http__$Response_OutgoingResponseData(this3,tink_io__$Source_Source_$Impl_$.EMPTY);
return this4;
};
httpstatus__$HttpStatusCode_HttpStatusCode_$Impl_$.fromIncomingResponse = function(res) {
return res.header.statusCode;
};
var httpstatus__$HttpStatusMessage_HttpStatusMessage_$Impl_$ = {};
httpstatus__$HttpStatusMessage_HttpStatusMessage_$Impl_$.__name__ = true;
httpstatus__$HttpStatusMessage_HttpStatusMessage_$Impl_$._new = function(statusCode) {
var this1 = httpstatus__$HttpStatusMessage_HttpStatusMessage_$Impl_$.fromCode(statusCode);
return this1;
};
httpstatus__$HttpStatusMessage_HttpStatusMessage_$Impl_$.fromCode = function(statusCode) {
switch(statusCode) {
case 100:
return "Continue";
case 101:
return "Switching Protocols";
case 102:
return "Processing";
case 200:
return "OK";
case 201:
return "Created";
case 202:
return "Accepted";
case 203:
return "Non-Authoritative Information";
case 204:
return "No Content";
case 205:
return "Reset Content";
case 206:
return "Partial Content";
case 207:
return "Multi-Status";
case 208:
return "Already Reported";
case 226:
return "IM Used";
case 300:
return "Multiple Choices";
case 301:
return "Moved Permanently";
case 302:
return "Found";
case 303:
return "See Other";
case 304:
return "Not Modified";
case 305:
return "Use Proxy";
case 306:
return "Switch Proxy";
case 307:
return "Temporary Redirect";
case 308:
return "Permanent Redirect";
case 400:
return "Bad Request";
case 401:
return "Unauthorized";
case 402:
return "Payment Required";
case 403:
return "Forbidden";
case 404:
return "Not Found";
case 405:
return "Method Not Allowed";
case 406:
return "Not Acceptable";
case 407:
return "Proxy Authentication Required";
case 408:
return "Request Timeout";
case 409:
return "Conflict";
case 410:
return "Gone";
case 411:
return "Length Required";
case 412:
return "Precondition Failed";
case 413:
return "Payload Too Large";
case 414:
return "URI Too Long";
case 415:
return "Unsupported Media Type";
case 416:
return "Range Not Satisfiable";
case 417:
return "Expectation Failed";
case 418:
return "I'm a teapot";
case 421:
return "Misdirected Request";
case 422:
return "Unprocessable Entity";
case 423:
return "Locked";
case 424:
return "Failed Dependency";
case 426:
return "Upgrade Required";
case 428:
return "Precondition Required";
case 429:
return "Too Many Requests";
case 431:
return "Request Header Fields Too Large";
case 451:
return "Unavailable For Legal Reasons";
case 500:
return "Internal Server Error";
case 501:
return "Not Implemented";
case 502:
return "Bad Gateway";
case 503:
return "Service Unavailable";
case 504:
return "Gateway Timeout";
case 505:
return "HTTP Version Not Supported";
case 506:
return "Variant Also Negotiates";
case 507:
return "Insufficient Storage";
case 508:
return "Loop Detected";
case 510:
return "Not Extended";
case 511:
return "Network Authentication Required";
default:
return "Unknown Status";
}
};
var js__$Boot_HaxeError = function(val) {
Error.call(this);
this.val = val;
if(Error.captureStackTrace) {
Error.captureStackTrace(this,js__$Boot_HaxeError);
}
};
js__$Boot_HaxeError.__name__ = true;
js__$Boot_HaxeError.wrap = function(val) {
if((val instanceof Error)) {
return val;
} else {
return new js__$Boot_HaxeError(val);
}
};
js__$Boot_HaxeError.__super__ = Error;
js__$Boot_HaxeError.prototype = $extend(Error.prototype,{
__class__: js__$Boot_HaxeError
});
var js_Boot = function() { };
js_Boot.__name__ = true;
js_Boot.getClass = function(o) {
if((o instanceof Array) && o.__enum__ == null) {
return Array;
} else {
var cl = o.__class__;
if(cl != null) {
return cl;
}
var name = js_Boot.__nativeClassName(o);
if(name != null) {
return js_Boot.__resolveNativeClass(name);
}
return null;
}
};
js_Boot.__string_rec = function(o,s) {
if(o == null) {
return "null";
}
if(s.length >= 5) {
return "<...>";
}
var t = typeof(o);
if(t == "function" && (o.__name__ || o.__ename__)) {
t = "object";
}
switch(t) {
case "function":
return "<function>";
case "object":
if(o.__enum__) {
var e = $hxEnums[o.__enum__];
var n = e.__constructs__[o._hx_index];
var con = e[n];
if(con.__params__) {
s += "\t";
var tmp = n + "(";
var _g = [];
var _g1 = 0;
var _g2 = con.__params__;
while(_g1 < _g2.length) {
var p = _g2[_g1];
++_g1;
_g.push(js_Boot.__string_rec(o[p],s));
}
return tmp + _g.join(",") + ")";
} else {
return n;
}
}
if((o instanceof Array)) {
var l = o.length;
var i;
var str = "[";
s += "\t";
var _g11 = 0;
var _g3 = l;
while(_g11 < _g3) {
var i1 = _g11++;
str += (i1 > 0 ? "," : "") + js_Boot.__string_rec(o[i1],s);
}
str += "]";
return str;
}
var tostr;
try {
tostr = o.toString;
} catch( e1 ) {
var e2 = (e1 instanceof js__$Boot_HaxeError) ? e1.val : e1;
return "???";
}
if(tostr != null && tostr != Object.toString && typeof(tostr) == "function") {
var s2 = o.toString();
if(s2 != "[object Object]") {
return s2;
}
}
var k = null;
var str1 = "{\n";
s += "\t";
var hasp = o.hasOwnProperty != null;
for( var k in o ) {
if(hasp && !o.hasOwnProperty(k)) {
continue;
}
if(k == "prototype" || k == "__class__" || k == "__super__" || k == "__interfaces__" || k == "__properties__") {