@magic-xpa/mscorelib 4.801.0-dev481.245 → 4.801.0-dev481.253

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (44) hide show
  1. package/{esm2015/index.js → esm2020/index.mjs} +0 -0
  2. package/{esm2015/magic-xpa-mscorelib.js → esm2020/magic-xpa-mscorelib.mjs} +0 -0
  3. package/{esm2015/src/ApplicationException.js → esm2020/src/ApplicationException.mjs} +0 -0
  4. package/{esm2015/src/ArrayEnumerator.js → esm2020/src/ArrayEnumerator.mjs} +0 -0
  5. package/{esm2015/src/BitArray.js → esm2020/src/BitArray.mjs} +0 -0
  6. package/{esm2015/src/Char.js → esm2020/src/Char.mjs} +0 -0
  7. package/{esm2015/src/CultureInfo.js → esm2020/src/CultureInfo.mjs} +0 -0
  8. package/{esm2015/src/DateTime.js → esm2020/src/DateTime.mjs} +0 -0
  9. package/{esm2015/src/Debug.js → esm2020/src/Debug.mjs} +0 -0
  10. package/{esm2015/src/Dictionary.js → esm2020/src/Dictionary.mjs} +0 -0
  11. package/{esm2015/src/Encoding.js → esm2020/src/Encoding.mjs} +0 -0
  12. package/{esm2015/src/Exception.js → esm2020/src/Exception.mjs} +0 -0
  13. package/{esm2015/src/HashTable.js → esm2020/src/HashTable.mjs} +0 -0
  14. package/{esm2015/src/IComparable.js → esm2020/src/IComparable.mjs} +1 -0
  15. package/{esm2015/src/ISO_8859_1_Encoding.js → esm2020/src/ISO_8859_1_Encoding.mjs} +0 -0
  16. package/{esm2015/src/Int32.js → esm2020/src/Int32.mjs} +0 -0
  17. package/{esm2015/src/Int64.js → esm2020/src/Int64.mjs} +0 -0
  18. package/{esm2015/src/List.js → esm2020/src/List.mjs} +0 -0
  19. package/{esm2015/src/NChar.js → esm2020/src/NChar.mjs} +0 -0
  20. package/{esm2015/src/NNumber.js → esm2020/src/NNumber.mjs} +0 -0
  21. package/{esm2015/src/NString.js → esm2020/src/NString.mjs} +0 -0
  22. package/{esm2015/src/NotImplementedException.js → esm2020/src/NotImplementedException.mjs} +0 -0
  23. package/{esm2015/src/NumberFormatInfo.js → esm2020/src/NumberFormatInfo.mjs} +0 -0
  24. package/{esm2015/src/RefParam.js → esm2020/src/RefParam.mjs} +0 -0
  25. package/{esm2015/src/Stack.js → esm2020/src/Stack.mjs} +0 -0
  26. package/{esm2015/src/StackFrame.js → esm2020/src/StackFrame.mjs} +0 -0
  27. package/{esm2015/src/StackTrace.js → esm2020/src/StackTrace.mjs} +0 -0
  28. package/{esm2015/src/StringBuilder.js → esm2020/src/StringBuilder.mjs} +0 -0
  29. package/{esm2015/src/StringUtils.js → esm2020/src/StringUtils.mjs} +0 -0
  30. package/esm2020/src/Thread.mjs +16 -0
  31. package/{esm2015/src/Utils.js → esm2020/src/Utils.mjs} +0 -0
  32. package/{esm2015/src/WebException.js → esm2020/src/WebException.mjs} +0 -0
  33. package/{esm2015/src/XmlConvert.js → esm2020/src/XmlConvert.mjs} +0 -0
  34. package/fesm2015/{magic-xpa-mscorelib.js → magic-xpa-mscorelib.mjs} +4 -4
  35. package/fesm2015/magic-xpa-mscorelib.mjs.map +1 -0
  36. package/fesm2020/magic-xpa-mscorelib.mjs +1107 -0
  37. package/fesm2020/magic-xpa-mscorelib.mjs.map +1 -0
  38. package/package.json +21 -8
  39. package/bundles/magic-xpa-mscorelib.umd.js +0 -1652
  40. package/bundles/magic-xpa-mscorelib.umd.js.map +0 -1
  41. package/bundles/magic-xpa-mscorelib.umd.min.js +0 -16
  42. package/bundles/magic-xpa-mscorelib.umd.min.js.map +0 -1
  43. package/esm2015/src/Thread.js +0 -19
  44. package/fesm2015/magic-xpa-mscorelib.js.map +0 -1
@@ -0,0 +1,1107 @@
1
+ import * as momentNs from 'moment';
2
+ import { TextEncoder, TextDecoder } from 'text-encoding';
3
+ import * as StackTrace$1 from 'stacktrace-js';
4
+ import { interval } from 'rxjs';
5
+
6
+ function isNullOrUndefined(object) {
7
+ return object == undefined || object == null;
8
+ }
9
+ function isUndefined(object) {
10
+ return object == undefined;
11
+ }
12
+
13
+ class Exception {
14
+ constructor(messageOrError) {
15
+ this.name = "Exception";
16
+ this.message = "";
17
+ this.stack = "";
18
+ this.errorLevel = 1;
19
+ if (!isNullOrUndefined(messageOrError)) {
20
+ if (messageOrError instanceof Error) {
21
+ this.stack = messageOrError.stack;
22
+ this.message = messageOrError.message;
23
+ }
24
+ else {
25
+ this.message = messageOrError;
26
+ this.stack = new Error().stack;
27
+ }
28
+ }
29
+ }
30
+ get Message() {
31
+ return this.message;
32
+ }
33
+ get StackTrace() {
34
+ let stackTrace = this.stack || '';
35
+ let stackLines = stackTrace.split("\n").map(function (line) { return line.trim(); });
36
+ stackTrace = stackLines.splice(stackLines[0] === 'Error' ? this.errorLevel + 1 : this.errorLevel).join("\n");
37
+ return "\n" + stackTrace;
38
+ }
39
+ GetType() {
40
+ return this.name;
41
+ }
42
+ }
43
+
44
+ class ApplicationException extends Exception {
45
+ constructor(message = "", innerException) {
46
+ super(message);
47
+ this.InnerException = null;
48
+ this.name = 'ApplicationException';
49
+ this.InnerException = (isUndefined(innerException) ? null : innerException);
50
+ this.errorLevel = 2;
51
+ }
52
+ }
53
+
54
+ class Array_Enumerator {
55
+ constructor(array) {
56
+ this.index = -1;
57
+ this.array = array;
58
+ }
59
+ MoveNext() {
60
+ this.index++;
61
+ return this.index < this.array.length;
62
+ }
63
+ get Current() {
64
+ return this.array[this.index];
65
+ }
66
+ Dispose() {
67
+ }
68
+ }
69
+
70
+ class BitArray {
71
+ constructor(length) {
72
+ this.array = null;
73
+ this.array = new Array(length).fill(false);
74
+ }
75
+ get Length() {
76
+ return this.array.length;
77
+ }
78
+ Get(index) {
79
+ return this.array[index];
80
+ }
81
+ Set(index, value) {
82
+ this.array[index] = value;
83
+ }
84
+ }
85
+
86
+ class Char {
87
+ }
88
+ Char.MinValue = '\0';
89
+ Char.MaxValue = String.fromCharCode(0xFFFF);
90
+
91
+ class CultureInfo {
92
+ }
93
+ CultureInfo.InvariantCulture = new CultureInfo();
94
+
95
+ const moment = momentNs;
96
+ var DateTimeKind;
97
+ (function (DateTimeKind) {
98
+ DateTimeKind[DateTimeKind["Local"] = 0] = "Local";
99
+ DateTimeKind[DateTimeKind["Utc"] = 1] = "Utc";
100
+ })(DateTimeKind || (DateTimeKind = {}));
101
+ class DateTime {
102
+ constructor(yearOrDate, month, day, hour, minute, second) {
103
+ this.dt = null;
104
+ this.kind = null;
105
+ this.epochTicks = 621355968000000000;
106
+ this.ticksPerMillisecond = 10000;
107
+ if (arguments.length === 1) {
108
+ this.dt = yearOrDate;
109
+ }
110
+ if (arguments.length === 3) {
111
+ this.dt = new Date(yearOrDate, month - 1, day);
112
+ }
113
+ if (arguments.length === 6) {
114
+ this.dt = new Date(yearOrDate, month - 1, day, hour, minute, second);
115
+ }
116
+ this.kind = DateTimeKind.Local;
117
+ }
118
+ get Ticks() {
119
+ return ((this.dt.getTime() * this.ticksPerMillisecond) + this.epochTicks) - (this.dt.getTimezoneOffset() * 600000000);
120
+ }
121
+ get Year() {
122
+ return this.kind === DateTimeKind.Utc ? this.dt.getUTCFullYear() : this.dt.getFullYear();
123
+ }
124
+ get Month() {
125
+ return this.kind === DateTimeKind.Utc ? this.dt.getUTCMonth() + 1 : this.dt.getMonth() + 1;
126
+ }
127
+ get Day() {
128
+ return this.kind === DateTimeKind.Utc ? this.dt.getUTCDate() : this.dt.getDate();
129
+ }
130
+ get Hour() {
131
+ return this.kind === DateTimeKind.Utc ? this.dt.getUTCHours() : this.dt.getHours();
132
+ }
133
+ get Minute() {
134
+ return this.kind === DateTimeKind.Utc ? this.dt.getUTCMinutes() : this.dt.getMinutes();
135
+ }
136
+ get Second() {
137
+ return this.kind === DateTimeKind.Utc ? this.dt.getUTCSeconds() : this.dt.getSeconds();
138
+ }
139
+ get Millisecond() {
140
+ return this.kind === DateTimeKind.Utc ? this.dt.getUTCMilliseconds() : this.dt.getMilliseconds();
141
+ }
142
+ Format(formatString) {
143
+ return moment(this.dt).format(formatString);
144
+ }
145
+ static get UtcNow() {
146
+ let d = new DateTime(new Date());
147
+ d.kind = DateTimeKind.Utc;
148
+ return d;
149
+ }
150
+ static get Now() {
151
+ let d = new DateTime(new Date());
152
+ d.kind = DateTimeKind.Local;
153
+ return d;
154
+ }
155
+ static GetTotalSecondsFromMidnight(utcTime, date) {
156
+ let hh = utcTime ? date.getUTCHours() : date.getHours();
157
+ let mm = utcTime ? date.getUTCMinutes() : date.getMinutes();
158
+ let ss = utcTime ? date.getUTCSeconds() : date.getSeconds();
159
+ return hh * 60 * 60 + mm * 60 + ss;
160
+ }
161
+ static GetTotalMilliSecondsFromMidnight(utcTime, date) {
162
+ let hh = utcTime ? date.getUTCHours() : date.getHours();
163
+ let mm = utcTime ? date.getUTCMinutes() : date.getMinutes();
164
+ let ss = utcTime ? date.getUTCSeconds() : date.getSeconds();
165
+ let ms = utcTime ? date.getUTCSeconds() : date.getMilliseconds();
166
+ return (hh * 60 * 60 + mm * 60 + ss) * 1000 + ms;
167
+ }
168
+ }
169
+
170
+ class Debug {
171
+ static WriteLine(text) {
172
+ console.log(text);
173
+ }
174
+ static Assert(assertCondtion, message) {
175
+ if (!assertCondtion)
176
+ alert(message);
177
+ }
178
+ }
179
+
180
+ class Dictionary {
181
+ constructor() {
182
+ this.values = new Array();
183
+ }
184
+ get_Item(key) {
185
+ if (this.values.hasOwnProperty(key))
186
+ return this.values[key];
187
+ else
188
+ return null;
189
+ }
190
+ set_Item(key, value) {
191
+ this.values[key] = value;
192
+ }
193
+ Add(key, value) {
194
+ if (this.values.hasOwnProperty(key))
195
+ throw new Exception("An item with the same key has already been added");
196
+ else
197
+ this.values[key] = value;
198
+ }
199
+ ContainsKey(key) {
200
+ return this.values.hasOwnProperty(key);
201
+ }
202
+ TryGetValue(key, pvalue) {
203
+ if (this.values.hasOwnProperty(key)) {
204
+ pvalue.value = this.values[key];
205
+ return true;
206
+ }
207
+ else {
208
+ pvalue.value = null;
209
+ return false;
210
+ }
211
+ }
212
+ Remove(key) {
213
+ delete this.values[key];
214
+ }
215
+ get Keys() {
216
+ return Object.keys(this.values);
217
+ }
218
+ }
219
+
220
+ class Encoding {
221
+ constructor(label) {
222
+ this.label = label;
223
+ this.textEncoder = null;
224
+ this.textDecoder = null;
225
+ this.textEncoder = new TextEncoder(label, { NONSTANDARD_allowLegacyEncoding: true });
226
+ this.textDecoder = new TextDecoder(label, { NONSTANDARD_allowLegacyEncoding: true });
227
+ }
228
+ GetBytes(str) {
229
+ if (str === null)
230
+ throw new Error("Argument is null");
231
+ let bytes = null;
232
+ try {
233
+ bytes = this.textEncoder.encode(str);
234
+ }
235
+ catch (ex) {
236
+ bytes = new Uint8Array(str.length * 3);
237
+ let bytesCount = 0;
238
+ let tmpBytes;
239
+ for (let i = 0; i < str.length; i++) {
240
+ try {
241
+ tmpBytes = this.textEncoder.encode(str[i]);
242
+ bytes.set(tmpBytes, bytesCount);
243
+ bytesCount += tmpBytes.length;
244
+ }
245
+ catch (ex) {
246
+ bytes[bytesCount++] = "?".charCodeAt(0);
247
+ }
248
+ }
249
+ bytes = bytes.subarray(0, 0 + bytesCount);
250
+ }
251
+ return bytes;
252
+ }
253
+ GetByteCount(str) {
254
+ return this.GetBytes(str).length;
255
+ }
256
+ GetString(bytes, index, count) {
257
+ let str = null;
258
+ if (bytes === null)
259
+ throw new Error("Argument is null");
260
+ if (index < 0 || count < 0 || (index + count) > bytes.length)
261
+ throw new Error("Argument out of range");
262
+ bytes = bytes.subarray(index, index + count);
263
+ try {
264
+ str = this.textDecoder.decode(bytes);
265
+ }
266
+ catch (ex) {
267
+ }
268
+ return str;
269
+ }
270
+ static GetEncoding(codepage) {
271
+ let label = Encoding.CodePageToEncodingMap[codepage];
272
+ if (label == null)
273
+ throw new Error("Invalid codepage.");
274
+ return new Encoding(label);
275
+ }
276
+ static PopulateCodePageToEncodingMap() {
277
+ let hashTable = new Object;
278
+ hashTable[20106] = "DIN_66003";
279
+ hashTable[20107] = "SEN_850200_B";
280
+ hashTable[50932] = "_autodetect";
281
+ hashTable[20108] = "NS_4551-1";
282
+ hashTable[50949] = "_autodetect_kr";
283
+ hashTable[950] = "big5";
284
+ hashTable[50221] = "csISO2022JP";
285
+ hashTable[51949] = "euc-kr";
286
+ hashTable[936] = "gb2312";
287
+ hashTable[52936] = "hz-gb-2312";
288
+ hashTable[852] = "ibm852";
289
+ hashTable[866] = "ibm866";
290
+ hashTable[20105] = "irv";
291
+ hashTable[50220] = "iso-2022-jp";
292
+ hashTable[50222] = "iso-2022-jp";
293
+ hashTable[50225] = "iso-2022-kr";
294
+ hashTable[28591] = "iso-8859-1";
295
+ hashTable[28592] = "iso-8859-2";
296
+ hashTable[28593] = "iso-8859-3";
297
+ hashTable[28594] = "iso-8859-4";
298
+ hashTable[28595] = "iso-8859-5";
299
+ hashTable[28596] = "iso-8859-6";
300
+ hashTable[28597] = "iso-8859-7";
301
+ hashTable[28598] = "iso-8859-8";
302
+ hashTable[20866] = "koi8-r";
303
+ hashTable[949] = "ks_c_5601";
304
+ hashTable[932] = "shift-jis";
305
+ hashTable[1200] = "unicode";
306
+ hashTable[1201] = "unicodeFEFF";
307
+ hashTable[65000] = "utf-7";
308
+ hashTable[65001] = "utf-8";
309
+ hashTable[1250] = "windows-1250";
310
+ hashTable[1251] = "windows-1251";
311
+ hashTable[1252] = "windows-1252";
312
+ hashTable[1253] = "windows-1253";
313
+ hashTable[1254] = "windows-1254";
314
+ hashTable[1255] = "windows-1255";
315
+ hashTable[1256] = "windows-1256";
316
+ hashTable[1257] = "windows-1257";
317
+ hashTable[1258] = "windows-1258";
318
+ hashTable[874] = "windows-874";
319
+ hashTable[20127] = "US-ASCII";
320
+ hashTable[51932] = "x-euc";
321
+ return hashTable;
322
+ }
323
+ toString() {
324
+ return this.label;
325
+ }
326
+ }
327
+ Encoding.ASCII = new Encoding("ascii");
328
+ Encoding.UTF8 = new Encoding("utf-8");
329
+ Encoding.Unicode = new Encoding("utf-16le");
330
+ Encoding.CodePageToEncodingMap = Encoding.PopulateCodePageToEncodingMap();
331
+
332
+ class HashUtils {
333
+ static GetHashCode(str) {
334
+ let bytes = null;
335
+ bytes = Encoding.UTF8.GetBytes(str);
336
+ return HashUtils.getHashCode(bytes);
337
+ }
338
+ static getHashCode(byteArray) {
339
+ let hashval;
340
+ let hash1 = 5381;
341
+ let hash2 = hash1;
342
+ let c;
343
+ for (let i = 0; i < byteArray.length; i += 2) {
344
+ c = byteArray[i];
345
+ hash1 = ((hash1 << 5) + hash1) ^ c;
346
+ if ((i + 1) === byteArray.length)
347
+ break;
348
+ c = byteArray[i + 1];
349
+ hash2 = ((hash2 << 5) + hash2) ^ c;
350
+ hash1 = hash1 & 0xffff;
351
+ hash2 = hash2 & 0xffff;
352
+ }
353
+ let hash3 = (hash2 * 13577);
354
+ hashval = (hash1 + hash3);
355
+ return (hashval);
356
+ }
357
+ }
358
+ const HashTableLoadFactor = 0.75;
359
+ class Hashtable {
360
+ constructor(bucketCount = 8, loadFactor = HashTableLoadFactor) {
361
+ this._buckets = [];
362
+ this._elementsCount = 0;
363
+ this._bucketCount = 0;
364
+ this._loadFactor = 0;
365
+ this._bucketCount = bucketCount;
366
+ this._loadFactor = loadFactor;
367
+ if (this._bucketCount % 2 !== 0) {
368
+ throw new Exception('Bucket count must be a positive number and be multiple of 2.');
369
+ }
370
+ }
371
+ HashFunction(key) {
372
+ if (typeof key.GetHashCode === 'function') {
373
+ return key.GetHashCode();
374
+ }
375
+ else if (key.constructor === String) {
376
+ return HashUtils.GetHashCode(key.toString());
377
+ }
378
+ else if (key.constructor === Number) {
379
+ return +key;
380
+ }
381
+ return 0;
382
+ }
383
+ get Count() {
384
+ return this._elementsCount;
385
+ }
386
+ get Values() {
387
+ let array = [];
388
+ this._buckets.forEach(b => b.forEach(item => {
389
+ array.push(item.value);
390
+ }));
391
+ return new Array_Enumerator(array);
392
+ }
393
+ get Keys() {
394
+ let array = [];
395
+ this._buckets.forEach(b => b.forEach(item => {
396
+ array.push(item.key);
397
+ }));
398
+ return new Array_Enumerator(array);
399
+ }
400
+ Add(key, value) {
401
+ this.Insert(key, value, true);
402
+ }
403
+ set_Item(key, value) {
404
+ this.Insert(key, value, false);
405
+ }
406
+ Insert(key, value, add) {
407
+ let bucketIndex = this.GetBucketIndex(key);
408
+ if (typeof this._buckets[bucketIndex] === "undefined") {
409
+ this._buckets[bucketIndex] = [];
410
+ }
411
+ if (this._buckets[bucketIndex].find(x => x.key === key)) {
412
+ if (add) {
413
+ throw new Exception('Item with provided key already exists!');
414
+ }
415
+ else {
416
+ this.Remove(key);
417
+ return;
418
+ }
419
+ }
420
+ this._buckets[bucketIndex].push({ key: key, value: value });
421
+ this._elementsCount++;
422
+ if (this._elementsCount > this._bucketCount * this._loadFactor) {
423
+ this.Resize(this._bucketCount * 2);
424
+ }
425
+ }
426
+ get_Item(key) {
427
+ let bucketIndex = this.GetBucketIndex(key);
428
+ let bucket = this._buckets[bucketIndex];
429
+ if (!bucket) {
430
+ return null;
431
+ }
432
+ let item = bucket.find(x => x.key === key);
433
+ if (item) {
434
+ return item.value;
435
+ }
436
+ return null;
437
+ }
438
+ ContainsKey(key) {
439
+ let bucketIndex = this.GetBucketIndex(key);
440
+ let bucket = this._buckets[bucketIndex];
441
+ if (!bucket) {
442
+ return false;
443
+ }
444
+ let itemIndex = bucket.findIndex(x => x.key === key);
445
+ return (itemIndex > -1);
446
+ }
447
+ Remove(key) {
448
+ let bucketIndex = this.GetBucketIndex(key);
449
+ let bucket = this._buckets[bucketIndex];
450
+ if (!bucket) {
451
+ return;
452
+ }
453
+ let itemIndex = bucket.findIndex(x => x.key === key);
454
+ if (itemIndex > -1) {
455
+ bucket.splice(itemIndex, 1);
456
+ this._elementsCount--;
457
+ if (this._elementsCount <= this._bucketCount * (1 - this._loadFactor)) {
458
+ this.Resize(this._bucketCount / 2);
459
+ }
460
+ }
461
+ }
462
+ Resize(newBucketCount) {
463
+ let _oldBuckets = this._buckets;
464
+ this._elementsCount = 0;
465
+ this._buckets = [];
466
+ this._bucketCount = newBucketCount;
467
+ _oldBuckets.forEach(b => b.forEach(item => this.Add(item.key, item.value)));
468
+ }
469
+ GetBucketIndex(key) {
470
+ let hash = this.HashFunction(key);
471
+ if (hash % 1 !== 0) {
472
+ throw new Exception('Key\'s hash must be an integer!');
473
+ }
474
+ let index = Math.abs(hash) % this._bucketCount;
475
+ if (index < 0 || index >= this._bucketCount) {
476
+ throw new Exception('Index exceeds bucket boundaries');
477
+ }
478
+ return index;
479
+ }
480
+ Clear() {
481
+ this._elementsCount = 0;
482
+ this._buckets = [];
483
+ }
484
+ }
485
+
486
+ class Int32 {
487
+ }
488
+ Int32.MinValue = -2147483648;
489
+ Int32.MaxValue = 2147483647;
490
+
491
+ class Int64 {
492
+ }
493
+ Int64.MinValue = -9223372036854775808;
494
+
495
+ class ISO_8859_1_Encoding extends Encoding {
496
+ constructor(label) {
497
+ super(label);
498
+ }
499
+ GetBytes(str) {
500
+ if (str === null)
501
+ throw new Error("Argument is null");
502
+ let bytes = null;
503
+ bytes = new Uint8Array(str.length * 3);
504
+ let bytesCount = 0;
505
+ let tmpBytes;
506
+ for (let i = 0; i < str.length; i++) {
507
+ bytes[bytesCount++] = str[i].charCodeAt(0);
508
+ }
509
+ bytes = bytes.subarray(0, 0 + bytesCount);
510
+ return bytes;
511
+ }
512
+ GetString(bytes, index, count) {
513
+ let str = null;
514
+ if (bytes === null)
515
+ throw new Error("Argument is null");
516
+ if (index < 0 || count < 0 || (index + count) > bytes.length)
517
+ throw new Error("Argument out of range");
518
+ bytes = bytes.subarray(index, index + count);
519
+ try {
520
+ str = '';
521
+ for (let i = 0; i < bytes.length; i++) {
522
+ str += String.fromCharCode(bytes[i]);
523
+ }
524
+ ;
525
+ }
526
+ catch (ex) {
527
+ }
528
+ return str;
529
+ }
530
+ }
531
+ ISO_8859_1_Encoding.ISO_8859_1 = new ISO_8859_1_Encoding("iso_8859-1");
532
+
533
+ class List extends Array {
534
+ constructor(arrayEnumerator) {
535
+ super();
536
+ Object.setPrototypeOf(this, List.prototype);
537
+ if (arguments.length === 1 && arrayEnumerator.constructor === Array_Enumerator) {
538
+ this.AddRange(arrayEnumerator);
539
+ }
540
+ }
541
+ AddRange(arrayEnumeratorOrArray) {
542
+ if (arrayEnumeratorOrArray.constructor === Array) {
543
+ arrayEnumeratorOrArray.forEach((item) => {
544
+ this.push(item);
545
+ });
546
+ }
547
+ else {
548
+ let e = arrayEnumeratorOrArray;
549
+ while (e.MoveNext()) {
550
+ this.push(e.Current);
551
+ }
552
+ }
553
+ }
554
+ get_Item(index) {
555
+ if (isUndefined(this[index]))
556
+ this[index] = null;
557
+ return this[index];
558
+ }
559
+ set_Item(index, value) {
560
+ if (index >= 0 && index < this.length)
561
+ this[index] = value;
562
+ else
563
+ throw new Error("index out of bounds");
564
+ }
565
+ GetEnumerator() {
566
+ return new Array_Enumerator(this);
567
+ }
568
+ Remove(object) {
569
+ let index = this.indexOf(object);
570
+ if (index > -1)
571
+ this.RemoveAt(index);
572
+ }
573
+ RemoveAt(index) {
574
+ this.RemoveRange(index, 1);
575
+ }
576
+ RemoveRange(index, count) {
577
+ this.splice(index, count);
578
+ }
579
+ Insert(index, item) {
580
+ if (index >= 0 && index < this.length)
581
+ this.splice(index, 0, item);
582
+ else if (index === this.length)
583
+ this.push(item);
584
+ else
585
+ throw new Error("index out of bounds");
586
+ }
587
+ InsertRange(items) {
588
+ let idx = 0;
589
+ while (idx < items.length) {
590
+ this.Insert(idx, items[idx]);
591
+ idx++;
592
+ }
593
+ }
594
+ Clear() {
595
+ this.splice(0, this.length);
596
+ }
597
+ ToArray() {
598
+ return this.slice(0);
599
+ }
600
+ Contains(object) {
601
+ return this.indexOf(object) > -1;
602
+ }
603
+ find(predicate) {
604
+ let foundItem = super.find(predicate);
605
+ if (isUndefined(foundItem))
606
+ foundItem = null;
607
+ return foundItem;
608
+ }
609
+ SetSize(size) {
610
+ if (this.length > size) {
611
+ this.RemoveRange(size, this.length - size);
612
+ }
613
+ else
614
+ this.length = size;
615
+ }
616
+ }
617
+
618
+ const $EOF = 0;
619
+ const $TAB = 9;
620
+ const $LF = 10;
621
+ const $VTAB = 11;
622
+ const $FF = 12;
623
+ const $CR = 13;
624
+ const $SPACE = 32;
625
+ const $BANG = 33;
626
+ const $DQ = 34;
627
+ const $HASH = 35;
628
+ const $$ = 36;
629
+ const $PERCENT = 37;
630
+ const $AMPERSAND = 38;
631
+ const $SQ = 39;
632
+ const $LPAREN = 40;
633
+ const $RPAREN = 41;
634
+ const $STAR = 42;
635
+ const $PLUS = 43;
636
+ const $COMMA = 44;
637
+ const $MINUS = 45;
638
+ const $PERIOD = 46;
639
+ const $SLASH = 47;
640
+ const $COLON = 58;
641
+ const $SEMICOLON = 59;
642
+ const $LT = 60;
643
+ const $EQ = 61;
644
+ const $GT = 62;
645
+ const $QUESTION = 63;
646
+ const $0 = 48;
647
+ const $9 = 57;
648
+ const $A = 65;
649
+ const $E = 69;
650
+ const $F = 70;
651
+ const $X = 88;
652
+ const $Z = 90;
653
+ const $LBRACKET = 91;
654
+ const $BACKSLASH = 92;
655
+ const $RBRACKET = 93;
656
+ const $CARET = 94;
657
+ const $_ = 95;
658
+ const $a = 97;
659
+ const $e = 101;
660
+ const $f = 102;
661
+ const $n = 110;
662
+ const $r = 114;
663
+ const $t = 116;
664
+ const $u = 117;
665
+ const $v = 118;
666
+ const $x = 120;
667
+ const $z = 122;
668
+ const $LBRACE = 123;
669
+ const $BAR = 124;
670
+ const $RBRACE = 125;
671
+ const $NBSP = 160;
672
+ const $PIPE = 124;
673
+ const $TILDA = 126;
674
+ const $AT = 64;
675
+ const $BT = 96;
676
+ function isWhitespace(code) {
677
+ return (code >= $TAB && code <= $SPACE) || code === $NBSP;
678
+ }
679
+ function isDigit(code) {
680
+ return $0 <= code && code <= $9;
681
+ }
682
+ function isAsciiLetter(code) {
683
+ return (code >= $a && code <= $z) || (code >= $A && code <= $Z);
684
+ }
685
+ function isAsciiHexDigit(code) {
686
+ return (code >= $a && code <= $f) || (code >= $A && code <= $F) || isDigit(code);
687
+ }
688
+ function isLowerCase(str) {
689
+ return str === str.toLowerCase();
690
+ }
691
+ function isUpperCase(str) {
692
+ return str === str.toUpperCase();
693
+ }
694
+
695
+ class NChar {
696
+ static IsWhiteSpace(str) {
697
+ let ch = str.charCodeAt(0);
698
+ return isWhitespace(ch);
699
+ }
700
+ static IsLetterOrDigit(str) {
701
+ let ch = str.charCodeAt(0);
702
+ return isDigit(ch) || isAsciiLetter(ch);
703
+ }
704
+ static IsDigit(str) {
705
+ let ch = str.charCodeAt(0);
706
+ return isDigit(ch);
707
+ }
708
+ static IsLetter(ltr) {
709
+ return isAsciiLetter(ltr.charCodeAt(0));
710
+ }
711
+ static IsLower(ch) {
712
+ return isLowerCase(ch);
713
+ }
714
+ static IsUpper(ch) {
715
+ return isUpperCase(ch);
716
+ }
717
+ }
718
+
719
+ class NotImplementedException extends Exception {
720
+ constructor(message = "Not implemented") {
721
+ super(message);
722
+ }
723
+ }
724
+
725
+ var NumberStyles;
726
+ (function (NumberStyles) {
727
+ NumberStyles[NumberStyles["HexNumber"] = 0] = "HexNumber";
728
+ })(NumberStyles || (NumberStyles = {}));
729
+ class NNumber {
730
+ static Parse(text, style) {
731
+ if (arguments.length === 2) {
732
+ if (style === NumberStyles.HexNumber)
733
+ return parseInt(text, 16);
734
+ else
735
+ throw new NotImplementedException();
736
+ }
737
+ return +text;
738
+ }
739
+ static TryParse(str, pvalue) {
740
+ pvalue.value = +str;
741
+ return !isNaN(pvalue.value);
742
+ }
743
+ static ToString(num, format) {
744
+ if (format === 'X2') {
745
+ let res = num.toString(16);
746
+ return res.length === 1 ? '0' + res : res;
747
+ }
748
+ throw new NotImplementedException();
749
+ }
750
+ }
751
+
752
+ class NString {
753
+ static IndexOf(str, searchStr, startIndex, count) {
754
+ let index = str.substr(startIndex, count).indexOf(searchStr);
755
+ return index > -1 ? startIndex + index : index;
756
+ }
757
+ static IndexOfAny(str, subs, startIndex, count) {
758
+ for (let i = 0; i < count; ++i) {
759
+ let c = str.charAt(startIndex + i);
760
+ for (let j = 0; j < subs.length; ++j) {
761
+ if (c === subs[j])
762
+ return (startIndex + i);
763
+ }
764
+ }
765
+ return -1;
766
+ }
767
+ static CopyTo(source, sourceIndex, destination, destinationIndex, count) {
768
+ for (let i = 0; i < count; i++) {
769
+ destination[destinationIndex + i] = source[sourceIndex + i];
770
+ }
771
+ }
772
+ static Compare(strA, strB, ignoreCase, indexA, indexB, length) {
773
+ if (arguments.length = 6) {
774
+ strA = strA.substr(indexA, length);
775
+ strB = strB.substr(indexB, length);
776
+ }
777
+ if (ignoreCase) {
778
+ strA = strA.toLowerCase();
779
+ strB = strB.toLowerCase();
780
+ }
781
+ return strA.localeCompare(strB);
782
+ }
783
+ static Equals(strA, strB, ignoreCase) {
784
+ if (!NString.IsNullOrEmpty(strA) && !NString.IsNullOrEmpty(strB)) {
785
+ if (ignoreCase) {
786
+ strA = strA.toLowerCase();
787
+ strB = strB.toLowerCase();
788
+ }
789
+ return strA === strB;
790
+ }
791
+ return false;
792
+ }
793
+ static GetHashCode(str) {
794
+ var hash = 0, i, l, ch;
795
+ if (str.length === 0)
796
+ return hash;
797
+ for (i = 0, l = str.length; i < l; i++) {
798
+ ch = str.charCodeAt(i);
799
+ hash = ((hash << 5) - hash) + ch;
800
+ hash |= 0;
801
+ }
802
+ return hash;
803
+ }
804
+ static Remove(str, startIndex, length) {
805
+ return str.substr(0, startIndex - 1) + str.substr(startIndex + length - 1);
806
+ }
807
+ static TrimStart(str) {
808
+ return str.replace(/^\s\s*/, '');
809
+ }
810
+ static TrimEnd(string, trimChars) {
811
+ if (arguments.length === 1)
812
+ return string.replace(/\s\s*$/, '');
813
+ for (let j = 0; j < trimChars.length; j++) {
814
+ let trimChar = trimChars[j];
815
+ let i = string.length - 1;
816
+ while (!isNullOrUndefined(string[i]) && string[i].endsWith(trimChar)) {
817
+ string = NString.Remove(string, string.length, 1);
818
+ i--;
819
+ }
820
+ }
821
+ return string;
822
+ }
823
+ static Format(format, arg0, arg1, arg2, arg3, arg4, arg5) {
824
+ if (!isNullOrUndefined(arg0) && arg0.constructor === Array) {
825
+ var s = format, i = arg0.length;
826
+ while (i--) {
827
+ s = s.replace(new RegExp('\\{' + i + '\\}', 'gm'), arg0[i]);
828
+ }
829
+ return s;
830
+ }
831
+ else {
832
+ var args = [arg0, arg1, arg2, arg3, arg4, arg5];
833
+ return NString.Format(format, args);
834
+ }
835
+ }
836
+ static IsNullOrEmpty(str1) {
837
+ return !str1;
838
+ }
839
+ static FromChars(chOrChars, startIndex, len) {
840
+ let str = chOrChars.join('');
841
+ if (arguments.length === 3)
842
+ return str.substr(startIndex, len);
843
+ return str;
844
+ }
845
+ static FromChar(ch, count) {
846
+ return (new Array(count).fill(ch)).join('');
847
+ }
848
+ static ToCharArray(str) {
849
+ return Array.from(str);
850
+ }
851
+ static CompareOrdinal(strA, strB) {
852
+ let lenA = strA.length;
853
+ let lenB = strB.length;
854
+ let len = Math.min(lenA, lenB);
855
+ for (let i = 0; i < len; i++) {
856
+ if (strA[i].charCodeAt(0) !== strB[i].charCodeAt(0)) {
857
+ return strA[i].charCodeAt(0) - strB[i].charCodeAt(0);
858
+ }
859
+ }
860
+ if (lenA !== lenB) {
861
+ return lenA - lenB;
862
+ }
863
+ return 0;
864
+ }
865
+ static PadRight(source, maxLength, fillString) {
866
+ if (source.length >= maxLength)
867
+ return source;
868
+ let fillLen = maxLength - source.length;
869
+ let timesToRepeat = Math.ceil(fillLen / fillString.length);
870
+ let truncatedStringFiller = fillString.repeat(timesToRepeat).slice(0, fillLen);
871
+ return source + truncatedStringFiller;
872
+ }
873
+ static Insert(str, index, ch) {
874
+ return str.substr(0, index) + ch + str.substr(index, str.length - index);
875
+ }
876
+ static Replace(str, orgSubStr, newSubStr) {
877
+ let resultStr = '';
878
+ orgSubStr = orgSubStr.replace(new RegExp("\\\\", 'g'), "\\\\");
879
+ orgSubStr = orgSubStr.replace(new RegExp("\\*", 'g'), "\\\*");
880
+ orgSubStr = orgSubStr.replace(new RegExp("\\$", 'g'), "\\\$");
881
+ orgSubStr = orgSubStr.replace(new RegExp("\\^", 'g'), "\\\^");
882
+ orgSubStr = orgSubStr.replace(new RegExp("\\.", 'g'), "\\\.");
883
+ orgSubStr = orgSubStr.replace(new RegExp("\\?", 'g'), "\\\?");
884
+ orgSubStr = orgSubStr.replace(new RegExp("\\+", 'g'), "\\\+");
885
+ orgSubStr = orgSubStr.replace(new RegExp("\\,", 'g'), "\\\,");
886
+ orgSubStr = orgSubStr.replace(new RegExp("\\[", 'g'), "\\\[");
887
+ orgSubStr = orgSubStr.replace(new RegExp("\\|", 'g'), "\\\|");
888
+ try {
889
+ resultStr = str.replace(new RegExp(orgSubStr, 'g'), newSubStr);
890
+ }
891
+ catch (e) {
892
+ throw new Exception(e.message);
893
+ }
894
+ return resultStr;
895
+ }
896
+ }
897
+ NString.Empty = "";
898
+
899
+ class NumberFormatInfo {
900
+ static GetLocaleDecimalSeperator() {
901
+ return (1.1).toLocaleString()[1];
902
+ }
903
+ }
904
+ NumberFormatInfo.NegativeSign = '-';
905
+ NumberFormatInfo.NumberDecimalSeparator = NumberFormatInfo.GetLocaleDecimalSeperator();
906
+
907
+ class RefParam {
908
+ constructor(value) {
909
+ this.value = value;
910
+ }
911
+ }
912
+
913
+ class Stack {
914
+ constructor() {
915
+ this._array = new Array();
916
+ }
917
+ count() {
918
+ return this._array.length;
919
+ }
920
+ isEmpty() {
921
+ return this._array.length === 0;
922
+ }
923
+ push(value) {
924
+ this._array.push(value);
925
+ }
926
+ pop() {
927
+ return this._array.pop();
928
+ }
929
+ peek() {
930
+ if (this._array.length > 0) {
931
+ return this._array[this._array.length - 1];
932
+ }
933
+ else {
934
+ return null;
935
+ }
936
+ }
937
+ Clear() {
938
+ this._array.splice(0, this._array.length);
939
+ }
940
+ Clone() {
941
+ let clone = new Stack();
942
+ clone._array = this._array.slice();
943
+ return clone;
944
+ }
945
+ }
946
+
947
+ class StackFrame {
948
+ constructor(skipFrames) {
949
+ this.stackFrame = null;
950
+ let stackFrames = StackTrace$1.getSync();
951
+ if (skipFrames < 0 || skipFrames >= stackFrames.length)
952
+ throw new Error("Argument out of range");
953
+ this.stackFrame = stackFrames[skipFrames];
954
+ }
955
+ GetFileName() {
956
+ return this.stackFrame.fileName;
957
+ }
958
+ }
959
+
960
+ class StackTrace {
961
+ GetFrames() {
962
+ return StackTrace$1.getSync();
963
+ }
964
+ }
965
+
966
+ class StringBuilder {
967
+ constructor(valueOrLength, length) {
968
+ this.part = "";
969
+ if (arguments.length > 0) {
970
+ if (valueOrLength != null && valueOrLength.constructor === Number) {
971
+ }
972
+ else if (valueOrLength != null && valueOrLength.constructor === String) {
973
+ this.part = valueOrLength.toString();
974
+ }
975
+ }
976
+ }
977
+ Append(textOrNum, startIndexOrNumberOfCharacters, charCount) {
978
+ if (textOrNum === null)
979
+ return this;
980
+ if (textOrNum.constructor === String) {
981
+ if (arguments.length === 1)
982
+ this.AppendString(textOrNum.toString());
983
+ else if (arguments.length === 2) {
984
+ Debug.Assert(textOrNum.length === 1, "character is expected not string");
985
+ this.AppendString(textOrNum.charAt(0).repeat(startIndexOrNumberOfCharacters));
986
+ }
987
+ else
988
+ this.AppendString(textOrNum.toString(), startIndexOrNumberOfCharacters, charCount);
989
+ }
990
+ else
991
+ this.AppendNumber(textOrNum, startIndexOrNumberOfCharacters);
992
+ return this;
993
+ }
994
+ AppendString(text, startIndex = 0, charCount = text.length) {
995
+ this.part = this.part + text.substr(startIndex, charCount);
996
+ }
997
+ AppendNumber(num, numberOfCharacters = 1) {
998
+ if (numberOfCharacters <= 0)
999
+ throw new Error("numberOfCharacters cannot be less than or equal to zero");
1000
+ this.part = this.part + num.toString().repeat(numberOfCharacters);
1001
+ }
1002
+ AppendLine(text = null) {
1003
+ if (text !== null)
1004
+ this.part = this.part + text;
1005
+ this.part = this.part + '\n';
1006
+ }
1007
+ AppendFormat(format, arg0, arg1, arg2) {
1008
+ this.part = this.part + NString.Format(format, arg0, arg1, arg2);
1009
+ return this;
1010
+ }
1011
+ ToString(startIndex, length) {
1012
+ if (arguments.length === 2) {
1013
+ if (startIndex < 0 || length < 0 || (startIndex + length) > this.part.length)
1014
+ throw new Error("Argument out of range");
1015
+ return this.part.substr(startIndex, length);
1016
+ }
1017
+ return this.part;
1018
+ }
1019
+ get Length() {
1020
+ return this.part.length;
1021
+ }
1022
+ get_Item(index) {
1023
+ if (index < 0 || index >= this.part.length)
1024
+ throw new Error("Index out of range");
1025
+ return this.part.charAt(index);
1026
+ }
1027
+ set_Item(index, value) {
1028
+ if (index < 0 || index >= this.part.length)
1029
+ throw new Error("Index out of range");
1030
+ Debug.Assert(value.length <= 1, "Length of string cannot be more than 1. Only character is expected");
1031
+ let leftPart = this.part.substring(0, index);
1032
+ let rightPart = this.part.substring(index + 1, this.part.length);
1033
+ this.part = leftPart + value.charAt(0) + rightPart;
1034
+ }
1035
+ Insert(index, value) {
1036
+ if (index < 0 || index > this.part.length)
1037
+ throw new Error("Argument out of range");
1038
+ let leftPart = this.part.substring(0, index);
1039
+ let rightPart = this.part.substring(index, this.part.length);
1040
+ this.part = leftPart + value + rightPart;
1041
+ return this;
1042
+ }
1043
+ Remove(startIndex, length) {
1044
+ if (startIndex < 0 || length < 0 || (startIndex + length) > this.part.length)
1045
+ throw new Error("Argument out of range");
1046
+ let leftPart = this.part.substring(0, startIndex);
1047
+ let rightPart = this.part.substring(startIndex + length, this.part.length);
1048
+ this.part = leftPart + rightPart;
1049
+ return this;
1050
+ }
1051
+ Replace(oldValue, newValue, startIndex, count) {
1052
+ if (oldValue === null)
1053
+ throw new Error("oldValue cannot be null");
1054
+ else if (oldValue.length === 0)
1055
+ throw new Error("Length of oldValue cannot be 0");
1056
+ if (arguments.length === 4) {
1057
+ if (startIndex < 0 || count < 0 || (startIndex + count) > this.part.length)
1058
+ throw new Error("Argument out of range");
1059
+ }
1060
+ if (arguments.length === 2)
1061
+ this.part = this.part.replace(new RegExp(oldValue, 'g'), newValue);
1062
+ else if (arguments.length === 4) {
1063
+ let substr = this.part.substring(startIndex, startIndex + count);
1064
+ substr = substr.replace(new RegExp(oldValue, 'g'), newValue);
1065
+ let leftPart = this.part.substring(0, startIndex);
1066
+ let rightPart = this.part.substring(startIndex + count, this.part.length);
1067
+ this.part = leftPart + substr + rightPart;
1068
+ }
1069
+ return this;
1070
+ }
1071
+ toString() {
1072
+ return this.ToString();
1073
+ }
1074
+ }
1075
+
1076
+ class Thread {
1077
+ constructor() {
1078
+ this.ManagedThreadId = 0;
1079
+ this.ManagedThreadId = Thread.nextId++;
1080
+ }
1081
+ static async Sleep(millisecondsTimeout) {
1082
+ await new Promise((resolve) => {
1083
+ let timer = interval(millisecondsTimeout);
1084
+ let subscription = timer.subscribe(() => { subscription.unsubscribe(); resolve(); });
1085
+ }).then();
1086
+ }
1087
+ }
1088
+ Thread.nextId = 1;
1089
+ Thread.CurrentThread = new Thread();
1090
+
1091
+ class WebException extends Exception {
1092
+ constructor(error) {
1093
+ super();
1094
+ this.name = "WebException";
1095
+ this.stack = error.stack;
1096
+ this.message = error.message;
1097
+ }
1098
+ }
1099
+
1100
+ class XmlConvert {
1101
+ static EncodeName(name) {
1102
+ throw new NotImplementedException();
1103
+ }
1104
+ }
1105
+
1106
+ export { $$, $0, $9, $A, $AMPERSAND, $AT, $BACKSLASH, $BANG, $BAR, $BT, $CARET, $COLON, $COMMA, $CR, $DQ, $E, $EOF, $EQ, $F, $FF, $GT, $HASH, $LBRACE, $LBRACKET, $LF, $LPAREN, $LT, $MINUS, $NBSP, $PERCENT, $PERIOD, $PIPE, $PLUS, $QUESTION, $RBRACE, $RBRACKET, $RPAREN, $SEMICOLON, $SLASH, $SPACE, $SQ, $STAR, $TAB, $TILDA, $VTAB, $X, $Z, $_, $a, $e, $f, $n, $r, $t, $u, $v, $x, $z, ApplicationException, Array_Enumerator, BitArray, Char, CultureInfo, DateTime, DateTimeKind, Debug, Dictionary, Encoding, Exception, HashUtils, Hashtable, ISO_8859_1_Encoding, Int32, Int64, List, NChar, NNumber, NString, NotImplementedException, NumberFormatInfo, NumberStyles, RefParam, Stack, StackFrame, StackTrace, StringBuilder, Thread, WebException, XmlConvert, isAsciiHexDigit, isAsciiLetter, isDigit, isLowerCase, isNullOrUndefined, isUndefined, isUpperCase, isWhitespace };
1107
+ //# sourceMappingURL=magic-xpa-mscorelib.mjs.map