@karmaniverous/entity-manager 6.1.0-3 → 6.1.0-4

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.
@@ -1,515 +1,518 @@
1
- import { getDefaultExportFromCjs } from '../../../_virtual/_commonjsHelpers.js';
2
- import { __module as lzString$1 } from '../../../_virtual/lz-string.js';
3
-
4
- lzString$1.exports;
5
-
6
- (function (module) {
7
- // Copyright (c) 2013 Pieroxy <pieroxy@pieroxy.net>
8
- // This work is free. You can redistribute it and/or modify it
9
- // under the terms of the WTFPL, Version 2
10
- // For more information see LICENSE.txt or http://www.wtfpl.net/
11
- //
12
- // For more information, the home page:
13
- // http://pieroxy.net/blog/pages/lz-string/testing.html
14
- //
15
- // LZ-based compression algorithm, version 1.4.5
16
- var LZString = (function() {
17
-
18
- // private property
19
- var f = String.fromCharCode;
20
- var keyStrBase64 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
21
- var keyStrUriSafe = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+-$";
22
- var baseReverseDic = {};
23
-
24
- function getBaseValue(alphabet, character) {
25
- if (!baseReverseDic[alphabet]) {
26
- baseReverseDic[alphabet] = {};
27
- for (var i=0 ; i<alphabet.length ; i++) {
28
- baseReverseDic[alphabet][alphabet.charAt(i)] = i;
29
- }
30
- }
31
- return baseReverseDic[alphabet][character];
32
- }
33
-
34
- var LZString = {
35
- compressToBase64 : function (input) {
36
- if (input == null) return "";
37
- var res = LZString._compress(input, 6, function(a){return keyStrBase64.charAt(a);});
38
- switch (res.length % 4) { // To produce valid Base64
39
- default: // When could this happen ?
40
- case 0 : return res;
41
- case 1 : return res+"===";
42
- case 2 : return res+"==";
43
- case 3 : return res+"=";
44
- }
45
- },
46
-
47
- decompressFromBase64 : function (input) {
48
- if (input == null) return "";
49
- if (input == "") return null;
50
- return LZString._decompress(input.length, 32, function(index) { return getBaseValue(keyStrBase64, input.charAt(index)); });
51
- },
52
-
53
- compressToUTF16 : function (input) {
54
- if (input == null) return "";
55
- return LZString._compress(input, 15, function(a){return f(a+32);}) + " ";
56
- },
57
-
58
- decompressFromUTF16: function (compressed) {
59
- if (compressed == null) return "";
60
- if (compressed == "") return null;
61
- return LZString._decompress(compressed.length, 16384, function(index) { return compressed.charCodeAt(index) - 32; });
62
- },
63
-
64
- //compress into uint8array (UCS-2 big endian format)
65
- compressToUint8Array: function (uncompressed) {
66
- var compressed = LZString.compress(uncompressed);
67
- var buf=new Uint8Array(compressed.length*2); // 2 bytes per character
68
-
69
- for (var i=0, TotalLen=compressed.length; i<TotalLen; i++) {
70
- var current_value = compressed.charCodeAt(i);
71
- buf[i*2] = current_value >>> 8;
72
- buf[i*2+1] = current_value % 256;
73
- }
74
- return buf;
75
- },
76
-
77
- //decompress from uint8array (UCS-2 big endian format)
78
- decompressFromUint8Array:function (compressed) {
79
- if (compressed===null || compressed===undefined){
80
- return LZString.decompress(compressed);
81
- } else {
82
- var buf=new Array(compressed.length/2); // 2 bytes per character
83
- for (var i=0, TotalLen=buf.length; i<TotalLen; i++) {
84
- buf[i]=compressed[i*2]*256+compressed[i*2+1];
85
- }
86
-
87
- var result = [];
88
- buf.forEach(function (c) {
89
- result.push(f(c));
90
- });
91
- return LZString.decompress(result.join(''));
92
-
93
- }
94
-
95
- },
96
-
97
-
98
- //compress into a string that is already URI encoded
99
- compressToEncodedURIComponent: function (input) {
100
- if (input == null) return "";
101
- return LZString._compress(input, 6, function(a){return keyStrUriSafe.charAt(a);});
102
- },
103
-
104
- //decompress from an output of compressToEncodedURIComponent
105
- decompressFromEncodedURIComponent:function (input) {
106
- if (input == null) return "";
107
- if (input == "") return null;
108
- input = input.replace(/ /g, "+");
109
- return LZString._decompress(input.length, 32, function(index) { return getBaseValue(keyStrUriSafe, input.charAt(index)); });
110
- },
111
-
112
- compress: function (uncompressed) {
113
- return LZString._compress(uncompressed, 16, function(a){return f(a);});
114
- },
115
- _compress: function (uncompressed, bitsPerChar, getCharFromInt) {
116
- if (uncompressed == null) return "";
117
- var i, value,
118
- context_dictionary= {},
119
- context_dictionaryToCreate= {},
120
- context_c="",
121
- context_wc="",
122
- context_w="",
123
- context_enlargeIn= 2, // Compensate for the first entry which should not count
124
- context_dictSize= 3,
125
- context_numBits= 2,
126
- context_data=[],
127
- context_data_val=0,
128
- context_data_position=0,
129
- ii;
130
-
131
- for (ii = 0; ii < uncompressed.length; ii += 1) {
132
- context_c = uncompressed.charAt(ii);
133
- if (!Object.prototype.hasOwnProperty.call(context_dictionary,context_c)) {
134
- context_dictionary[context_c] = context_dictSize++;
135
- context_dictionaryToCreate[context_c] = true;
136
- }
137
-
138
- context_wc = context_w + context_c;
139
- if (Object.prototype.hasOwnProperty.call(context_dictionary,context_wc)) {
140
- context_w = context_wc;
141
- } else {
142
- if (Object.prototype.hasOwnProperty.call(context_dictionaryToCreate,context_w)) {
143
- if (context_w.charCodeAt(0)<256) {
144
- for (i=0 ; i<context_numBits ; i++) {
145
- context_data_val = (context_data_val << 1);
146
- if (context_data_position == bitsPerChar-1) {
147
- context_data_position = 0;
148
- context_data.push(getCharFromInt(context_data_val));
149
- context_data_val = 0;
150
- } else {
151
- context_data_position++;
152
- }
153
- }
154
- value = context_w.charCodeAt(0);
155
- for (i=0 ; i<8 ; i++) {
156
- context_data_val = (context_data_val << 1) | (value&1);
157
- if (context_data_position == bitsPerChar-1) {
158
- context_data_position = 0;
159
- context_data.push(getCharFromInt(context_data_val));
160
- context_data_val = 0;
161
- } else {
162
- context_data_position++;
163
- }
164
- value = value >> 1;
165
- }
166
- } else {
167
- value = 1;
168
- for (i=0 ; i<context_numBits ; i++) {
169
- context_data_val = (context_data_val << 1) | value;
170
- if (context_data_position ==bitsPerChar-1) {
171
- context_data_position = 0;
172
- context_data.push(getCharFromInt(context_data_val));
173
- context_data_val = 0;
174
- } else {
175
- context_data_position++;
176
- }
177
- value = 0;
178
- }
179
- value = context_w.charCodeAt(0);
180
- for (i=0 ; i<16 ; i++) {
181
- context_data_val = (context_data_val << 1) | (value&1);
182
- if (context_data_position == bitsPerChar-1) {
183
- context_data_position = 0;
184
- context_data.push(getCharFromInt(context_data_val));
185
- context_data_val = 0;
186
- } else {
187
- context_data_position++;
188
- }
189
- value = value >> 1;
190
- }
191
- }
192
- context_enlargeIn--;
193
- if (context_enlargeIn == 0) {
194
- context_enlargeIn = Math.pow(2, context_numBits);
195
- context_numBits++;
196
- }
197
- delete context_dictionaryToCreate[context_w];
198
- } else {
199
- value = context_dictionary[context_w];
200
- for (i=0 ; i<context_numBits ; i++) {
201
- context_data_val = (context_data_val << 1) | (value&1);
202
- if (context_data_position == bitsPerChar-1) {
203
- context_data_position = 0;
204
- context_data.push(getCharFromInt(context_data_val));
205
- context_data_val = 0;
206
- } else {
207
- context_data_position++;
208
- }
209
- value = value >> 1;
210
- }
211
-
212
-
213
- }
214
- context_enlargeIn--;
215
- if (context_enlargeIn == 0) {
216
- context_enlargeIn = Math.pow(2, context_numBits);
217
- context_numBits++;
218
- }
219
- // Add wc to the dictionary.
220
- context_dictionary[context_wc] = context_dictSize++;
221
- context_w = String(context_c);
222
- }
223
- }
224
-
225
- // Output the code for w.
226
- if (context_w !== "") {
227
- if (Object.prototype.hasOwnProperty.call(context_dictionaryToCreate,context_w)) {
228
- if (context_w.charCodeAt(0)<256) {
229
- for (i=0 ; i<context_numBits ; i++) {
230
- context_data_val = (context_data_val << 1);
231
- if (context_data_position == bitsPerChar-1) {
232
- context_data_position = 0;
233
- context_data.push(getCharFromInt(context_data_val));
234
- context_data_val = 0;
235
- } else {
236
- context_data_position++;
237
- }
238
- }
239
- value = context_w.charCodeAt(0);
240
- for (i=0 ; i<8 ; i++) {
241
- context_data_val = (context_data_val << 1) | (value&1);
242
- if (context_data_position == bitsPerChar-1) {
243
- context_data_position = 0;
244
- context_data.push(getCharFromInt(context_data_val));
245
- context_data_val = 0;
246
- } else {
247
- context_data_position++;
248
- }
249
- value = value >> 1;
250
- }
251
- } else {
252
- value = 1;
253
- for (i=0 ; i<context_numBits ; i++) {
254
- context_data_val = (context_data_val << 1) | value;
255
- if (context_data_position == bitsPerChar-1) {
256
- context_data_position = 0;
257
- context_data.push(getCharFromInt(context_data_val));
258
- context_data_val = 0;
259
- } else {
260
- context_data_position++;
261
- }
262
- value = 0;
263
- }
264
- value = context_w.charCodeAt(0);
265
- for (i=0 ; i<16 ; i++) {
266
- context_data_val = (context_data_val << 1) | (value&1);
267
- if (context_data_position == bitsPerChar-1) {
268
- context_data_position = 0;
269
- context_data.push(getCharFromInt(context_data_val));
270
- context_data_val = 0;
271
- } else {
272
- context_data_position++;
273
- }
274
- value = value >> 1;
275
- }
276
- }
277
- context_enlargeIn--;
278
- if (context_enlargeIn == 0) {
279
- context_enlargeIn = Math.pow(2, context_numBits);
280
- context_numBits++;
281
- }
282
- delete context_dictionaryToCreate[context_w];
283
- } else {
284
- value = context_dictionary[context_w];
285
- for (i=0 ; i<context_numBits ; i++) {
286
- context_data_val = (context_data_val << 1) | (value&1);
287
- if (context_data_position == bitsPerChar-1) {
288
- context_data_position = 0;
289
- context_data.push(getCharFromInt(context_data_val));
290
- context_data_val = 0;
291
- } else {
292
- context_data_position++;
293
- }
294
- value = value >> 1;
295
- }
296
-
297
-
298
- }
299
- context_enlargeIn--;
300
- if (context_enlargeIn == 0) {
301
- context_enlargeIn = Math.pow(2, context_numBits);
302
- context_numBits++;
303
- }
304
- }
305
-
306
- // Mark the end of the stream
307
- value = 2;
308
- for (i=0 ; i<context_numBits ; i++) {
309
- context_data_val = (context_data_val << 1) | (value&1);
310
- if (context_data_position == bitsPerChar-1) {
311
- context_data_position = 0;
312
- context_data.push(getCharFromInt(context_data_val));
313
- context_data_val = 0;
314
- } else {
315
- context_data_position++;
316
- }
317
- value = value >> 1;
318
- }
319
-
320
- // Flush the last char
321
- while (true) {
322
- context_data_val = (context_data_val << 1);
323
- if (context_data_position == bitsPerChar-1) {
324
- context_data.push(getCharFromInt(context_data_val));
325
- break;
326
- }
327
- else context_data_position++;
328
- }
329
- return context_data.join('');
330
- },
331
-
332
- decompress: function (compressed) {
333
- if (compressed == null) return "";
334
- if (compressed == "") return null;
335
- return LZString._decompress(compressed.length, 32768, function(index) { return compressed.charCodeAt(index); });
336
- },
337
-
338
- _decompress: function (length, resetValue, getNextValue) {
339
- var dictionary = [],
340
- enlargeIn = 4,
341
- dictSize = 4,
342
- numBits = 3,
343
- entry = "",
344
- result = [],
345
- i,
346
- w,
347
- bits, resb, maxpower, power,
348
- c,
349
- data = {val:getNextValue(0), position:resetValue, index:1};
350
-
351
- for (i = 0; i < 3; i += 1) {
352
- dictionary[i] = i;
353
- }
354
-
355
- bits = 0;
356
- maxpower = Math.pow(2,2);
357
- power=1;
358
- while (power!=maxpower) {
359
- resb = data.val & data.position;
360
- data.position >>= 1;
361
- if (data.position == 0) {
362
- data.position = resetValue;
363
- data.val = getNextValue(data.index++);
364
- }
365
- bits |= (resb>0 ? 1 : 0) * power;
366
- power <<= 1;
367
- }
368
-
369
- switch (bits) {
370
- case 0:
371
- bits = 0;
372
- maxpower = Math.pow(2,8);
373
- power=1;
374
- while (power!=maxpower) {
375
- resb = data.val & data.position;
376
- data.position >>= 1;
377
- if (data.position == 0) {
378
- data.position = resetValue;
379
- data.val = getNextValue(data.index++);
380
- }
381
- bits |= (resb>0 ? 1 : 0) * power;
382
- power <<= 1;
383
- }
384
- c = f(bits);
385
- break;
386
- case 1:
387
- bits = 0;
388
- maxpower = Math.pow(2,16);
389
- power=1;
390
- while (power!=maxpower) {
391
- resb = data.val & data.position;
392
- data.position >>= 1;
393
- if (data.position == 0) {
394
- data.position = resetValue;
395
- data.val = getNextValue(data.index++);
396
- }
397
- bits |= (resb>0 ? 1 : 0) * power;
398
- power <<= 1;
399
- }
400
- c = f(bits);
401
- break;
402
- case 2:
403
- return "";
404
- }
405
- dictionary[3] = c;
406
- w = c;
407
- result.push(c);
408
- while (true) {
409
- if (data.index > length) {
410
- return "";
411
- }
412
-
413
- bits = 0;
414
- maxpower = Math.pow(2,numBits);
415
- power=1;
416
- while (power!=maxpower) {
417
- resb = data.val & data.position;
418
- data.position >>= 1;
419
- if (data.position == 0) {
420
- data.position = resetValue;
421
- data.val = getNextValue(data.index++);
422
- }
423
- bits |= (resb>0 ? 1 : 0) * power;
424
- power <<= 1;
425
- }
426
-
427
- switch (c = bits) {
428
- case 0:
429
- bits = 0;
430
- maxpower = Math.pow(2,8);
431
- power=1;
432
- while (power!=maxpower) {
433
- resb = data.val & data.position;
434
- data.position >>= 1;
435
- if (data.position == 0) {
436
- data.position = resetValue;
437
- data.val = getNextValue(data.index++);
438
- }
439
- bits |= (resb>0 ? 1 : 0) * power;
440
- power <<= 1;
441
- }
442
-
443
- dictionary[dictSize++] = f(bits);
444
- c = dictSize-1;
445
- enlargeIn--;
446
- break;
447
- case 1:
448
- bits = 0;
449
- maxpower = Math.pow(2,16);
450
- power=1;
451
- while (power!=maxpower) {
452
- resb = data.val & data.position;
453
- data.position >>= 1;
454
- if (data.position == 0) {
455
- data.position = resetValue;
456
- data.val = getNextValue(data.index++);
457
- }
458
- bits |= (resb>0 ? 1 : 0) * power;
459
- power <<= 1;
460
- }
461
- dictionary[dictSize++] = f(bits);
462
- c = dictSize-1;
463
- enlargeIn--;
464
- break;
465
- case 2:
466
- return result.join('');
467
- }
468
-
469
- if (enlargeIn == 0) {
470
- enlargeIn = Math.pow(2, numBits);
471
- numBits++;
472
- }
473
-
474
- if (dictionary[c]) {
475
- entry = dictionary[c];
476
- } else {
477
- if (c === dictSize) {
478
- entry = w + w.charAt(0);
479
- } else {
480
- return null;
481
- }
482
- }
483
- result.push(entry);
484
-
485
- // Add w+entry[0] to the dictionary.
486
- dictionary[dictSize++] = w + entry.charAt(0);
487
- enlargeIn--;
488
-
489
- w = entry;
490
-
491
- if (enlargeIn == 0) {
492
- enlargeIn = Math.pow(2, numBits);
493
- numBits++;
494
- }
495
-
496
- }
497
- }
498
- };
499
- return LZString;
500
- })();
501
-
502
- if( module != null ) {
503
- module.exports = LZString;
504
- } else if( typeof angular !== 'undefined' && angular != null ) {
505
- angular.module('LZString', [])
506
- .factory('LZString', function () {
507
- return LZString;
508
- });
509
- }
510
- } (lzString$1));
511
-
512
- var lzStringExports = lzString$1.exports;
513
- var lzString = /*@__PURE__*/getDefaultExportFromCjs(lzStringExports);
514
-
515
- export { lzString as default };
1
+ import { __module as lzString } from '../../../_virtual/lz-string2.js';
2
+
3
+ lzString.exports;
4
+
5
+ var hasRequiredLzString;
6
+
7
+ function requireLzString () {
8
+ if (hasRequiredLzString) return lzString.exports;
9
+ hasRequiredLzString = 1;
10
+ (function (module) {
11
+ // Copyright (c) 2013 Pieroxy <pieroxy@pieroxy.net>
12
+ // This work is free. You can redistribute it and/or modify it
13
+ // under the terms of the WTFPL, Version 2
14
+ // For more information see LICENSE.txt or http://www.wtfpl.net/
15
+ //
16
+ // For more information, the home page:
17
+ // http://pieroxy.net/blog/pages/lz-string/testing.html
18
+ //
19
+ // LZ-based compression algorithm, version 1.4.5
20
+ var LZString = (function() {
21
+
22
+ // private property
23
+ var f = String.fromCharCode;
24
+ var keyStrBase64 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
25
+ var keyStrUriSafe = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+-$";
26
+ var baseReverseDic = {};
27
+
28
+ function getBaseValue(alphabet, character) {
29
+ if (!baseReverseDic[alphabet]) {
30
+ baseReverseDic[alphabet] = {};
31
+ for (var i=0 ; i<alphabet.length ; i++) {
32
+ baseReverseDic[alphabet][alphabet.charAt(i)] = i;
33
+ }
34
+ }
35
+ return baseReverseDic[alphabet][character];
36
+ }
37
+
38
+ var LZString = {
39
+ compressToBase64 : function (input) {
40
+ if (input == null) return "";
41
+ var res = LZString._compress(input, 6, function(a){return keyStrBase64.charAt(a);});
42
+ switch (res.length % 4) { // To produce valid Base64
43
+ default: // When could this happen ?
44
+ case 0 : return res;
45
+ case 1 : return res+"===";
46
+ case 2 : return res+"==";
47
+ case 3 : return res+"=";
48
+ }
49
+ },
50
+
51
+ decompressFromBase64 : function (input) {
52
+ if (input == null) return "";
53
+ if (input == "") return null;
54
+ return LZString._decompress(input.length, 32, function(index) { return getBaseValue(keyStrBase64, input.charAt(index)); });
55
+ },
56
+
57
+ compressToUTF16 : function (input) {
58
+ if (input == null) return "";
59
+ return LZString._compress(input, 15, function(a){return f(a+32);}) + " ";
60
+ },
61
+
62
+ decompressFromUTF16: function (compressed) {
63
+ if (compressed == null) return "";
64
+ if (compressed == "") return null;
65
+ return LZString._decompress(compressed.length, 16384, function(index) { return compressed.charCodeAt(index) - 32; });
66
+ },
67
+
68
+ //compress into uint8array (UCS-2 big endian format)
69
+ compressToUint8Array: function (uncompressed) {
70
+ var compressed = LZString.compress(uncompressed);
71
+ var buf=new Uint8Array(compressed.length*2); // 2 bytes per character
72
+
73
+ for (var i=0, TotalLen=compressed.length; i<TotalLen; i++) {
74
+ var current_value = compressed.charCodeAt(i);
75
+ buf[i*2] = current_value >>> 8;
76
+ buf[i*2+1] = current_value % 256;
77
+ }
78
+ return buf;
79
+ },
80
+
81
+ //decompress from uint8array (UCS-2 big endian format)
82
+ decompressFromUint8Array:function (compressed) {
83
+ if (compressed===null || compressed===undefined){
84
+ return LZString.decompress(compressed);
85
+ } else {
86
+ var buf=new Array(compressed.length/2); // 2 bytes per character
87
+ for (var i=0, TotalLen=buf.length; i<TotalLen; i++) {
88
+ buf[i]=compressed[i*2]*256+compressed[i*2+1];
89
+ }
90
+
91
+ var result = [];
92
+ buf.forEach(function (c) {
93
+ result.push(f(c));
94
+ });
95
+ return LZString.decompress(result.join(''));
96
+
97
+ }
98
+
99
+ },
100
+
101
+
102
+ //compress into a string that is already URI encoded
103
+ compressToEncodedURIComponent: function (input) {
104
+ if (input == null) return "";
105
+ return LZString._compress(input, 6, function(a){return keyStrUriSafe.charAt(a);});
106
+ },
107
+
108
+ //decompress from an output of compressToEncodedURIComponent
109
+ decompressFromEncodedURIComponent:function (input) {
110
+ if (input == null) return "";
111
+ if (input == "") return null;
112
+ input = input.replace(/ /g, "+");
113
+ return LZString._decompress(input.length, 32, function(index) { return getBaseValue(keyStrUriSafe, input.charAt(index)); });
114
+ },
115
+
116
+ compress: function (uncompressed) {
117
+ return LZString._compress(uncompressed, 16, function(a){return f(a);});
118
+ },
119
+ _compress: function (uncompressed, bitsPerChar, getCharFromInt) {
120
+ if (uncompressed == null) return "";
121
+ var i, value,
122
+ context_dictionary= {},
123
+ context_dictionaryToCreate= {},
124
+ context_c="",
125
+ context_wc="",
126
+ context_w="",
127
+ context_enlargeIn= 2, // Compensate for the first entry which should not count
128
+ context_dictSize= 3,
129
+ context_numBits= 2,
130
+ context_data=[],
131
+ context_data_val=0,
132
+ context_data_position=0,
133
+ ii;
134
+
135
+ for (ii = 0; ii < uncompressed.length; ii += 1) {
136
+ context_c = uncompressed.charAt(ii);
137
+ if (!Object.prototype.hasOwnProperty.call(context_dictionary,context_c)) {
138
+ context_dictionary[context_c] = context_dictSize++;
139
+ context_dictionaryToCreate[context_c] = true;
140
+ }
141
+
142
+ context_wc = context_w + context_c;
143
+ if (Object.prototype.hasOwnProperty.call(context_dictionary,context_wc)) {
144
+ context_w = context_wc;
145
+ } else {
146
+ if (Object.prototype.hasOwnProperty.call(context_dictionaryToCreate,context_w)) {
147
+ if (context_w.charCodeAt(0)<256) {
148
+ for (i=0 ; i<context_numBits ; i++) {
149
+ context_data_val = (context_data_val << 1);
150
+ if (context_data_position == bitsPerChar-1) {
151
+ context_data_position = 0;
152
+ context_data.push(getCharFromInt(context_data_val));
153
+ context_data_val = 0;
154
+ } else {
155
+ context_data_position++;
156
+ }
157
+ }
158
+ value = context_w.charCodeAt(0);
159
+ for (i=0 ; i<8 ; i++) {
160
+ context_data_val = (context_data_val << 1) | (value&1);
161
+ if (context_data_position == bitsPerChar-1) {
162
+ context_data_position = 0;
163
+ context_data.push(getCharFromInt(context_data_val));
164
+ context_data_val = 0;
165
+ } else {
166
+ context_data_position++;
167
+ }
168
+ value = value >> 1;
169
+ }
170
+ } else {
171
+ value = 1;
172
+ for (i=0 ; i<context_numBits ; i++) {
173
+ context_data_val = (context_data_val << 1) | value;
174
+ if (context_data_position ==bitsPerChar-1) {
175
+ context_data_position = 0;
176
+ context_data.push(getCharFromInt(context_data_val));
177
+ context_data_val = 0;
178
+ } else {
179
+ context_data_position++;
180
+ }
181
+ value = 0;
182
+ }
183
+ value = context_w.charCodeAt(0);
184
+ for (i=0 ; i<16 ; i++) {
185
+ context_data_val = (context_data_val << 1) | (value&1);
186
+ if (context_data_position == bitsPerChar-1) {
187
+ context_data_position = 0;
188
+ context_data.push(getCharFromInt(context_data_val));
189
+ context_data_val = 0;
190
+ } else {
191
+ context_data_position++;
192
+ }
193
+ value = value >> 1;
194
+ }
195
+ }
196
+ context_enlargeIn--;
197
+ if (context_enlargeIn == 0) {
198
+ context_enlargeIn = Math.pow(2, context_numBits);
199
+ context_numBits++;
200
+ }
201
+ delete context_dictionaryToCreate[context_w];
202
+ } else {
203
+ value = context_dictionary[context_w];
204
+ for (i=0 ; i<context_numBits ; i++) {
205
+ context_data_val = (context_data_val << 1) | (value&1);
206
+ if (context_data_position == bitsPerChar-1) {
207
+ context_data_position = 0;
208
+ context_data.push(getCharFromInt(context_data_val));
209
+ context_data_val = 0;
210
+ } else {
211
+ context_data_position++;
212
+ }
213
+ value = value >> 1;
214
+ }
215
+
216
+
217
+ }
218
+ context_enlargeIn--;
219
+ if (context_enlargeIn == 0) {
220
+ context_enlargeIn = Math.pow(2, context_numBits);
221
+ context_numBits++;
222
+ }
223
+ // Add wc to the dictionary.
224
+ context_dictionary[context_wc] = context_dictSize++;
225
+ context_w = String(context_c);
226
+ }
227
+ }
228
+
229
+ // Output the code for w.
230
+ if (context_w !== "") {
231
+ if (Object.prototype.hasOwnProperty.call(context_dictionaryToCreate,context_w)) {
232
+ if (context_w.charCodeAt(0)<256) {
233
+ for (i=0 ; i<context_numBits ; i++) {
234
+ context_data_val = (context_data_val << 1);
235
+ if (context_data_position == bitsPerChar-1) {
236
+ context_data_position = 0;
237
+ context_data.push(getCharFromInt(context_data_val));
238
+ context_data_val = 0;
239
+ } else {
240
+ context_data_position++;
241
+ }
242
+ }
243
+ value = context_w.charCodeAt(0);
244
+ for (i=0 ; i<8 ; i++) {
245
+ context_data_val = (context_data_val << 1) | (value&1);
246
+ if (context_data_position == bitsPerChar-1) {
247
+ context_data_position = 0;
248
+ context_data.push(getCharFromInt(context_data_val));
249
+ context_data_val = 0;
250
+ } else {
251
+ context_data_position++;
252
+ }
253
+ value = value >> 1;
254
+ }
255
+ } else {
256
+ value = 1;
257
+ for (i=0 ; i<context_numBits ; i++) {
258
+ context_data_val = (context_data_val << 1) | value;
259
+ if (context_data_position == bitsPerChar-1) {
260
+ context_data_position = 0;
261
+ context_data.push(getCharFromInt(context_data_val));
262
+ context_data_val = 0;
263
+ } else {
264
+ context_data_position++;
265
+ }
266
+ value = 0;
267
+ }
268
+ value = context_w.charCodeAt(0);
269
+ for (i=0 ; i<16 ; i++) {
270
+ context_data_val = (context_data_val << 1) | (value&1);
271
+ if (context_data_position == bitsPerChar-1) {
272
+ context_data_position = 0;
273
+ context_data.push(getCharFromInt(context_data_val));
274
+ context_data_val = 0;
275
+ } else {
276
+ context_data_position++;
277
+ }
278
+ value = value >> 1;
279
+ }
280
+ }
281
+ context_enlargeIn--;
282
+ if (context_enlargeIn == 0) {
283
+ context_enlargeIn = Math.pow(2, context_numBits);
284
+ context_numBits++;
285
+ }
286
+ delete context_dictionaryToCreate[context_w];
287
+ } else {
288
+ value = context_dictionary[context_w];
289
+ for (i=0 ; i<context_numBits ; i++) {
290
+ context_data_val = (context_data_val << 1) | (value&1);
291
+ if (context_data_position == bitsPerChar-1) {
292
+ context_data_position = 0;
293
+ context_data.push(getCharFromInt(context_data_val));
294
+ context_data_val = 0;
295
+ } else {
296
+ context_data_position++;
297
+ }
298
+ value = value >> 1;
299
+ }
300
+
301
+
302
+ }
303
+ context_enlargeIn--;
304
+ if (context_enlargeIn == 0) {
305
+ context_enlargeIn = Math.pow(2, context_numBits);
306
+ context_numBits++;
307
+ }
308
+ }
309
+
310
+ // Mark the end of the stream
311
+ value = 2;
312
+ for (i=0 ; i<context_numBits ; i++) {
313
+ context_data_val = (context_data_val << 1) | (value&1);
314
+ if (context_data_position == bitsPerChar-1) {
315
+ context_data_position = 0;
316
+ context_data.push(getCharFromInt(context_data_val));
317
+ context_data_val = 0;
318
+ } else {
319
+ context_data_position++;
320
+ }
321
+ value = value >> 1;
322
+ }
323
+
324
+ // Flush the last char
325
+ while (true) {
326
+ context_data_val = (context_data_val << 1);
327
+ if (context_data_position == bitsPerChar-1) {
328
+ context_data.push(getCharFromInt(context_data_val));
329
+ break;
330
+ }
331
+ else context_data_position++;
332
+ }
333
+ return context_data.join('');
334
+ },
335
+
336
+ decompress: function (compressed) {
337
+ if (compressed == null) return "";
338
+ if (compressed == "") return null;
339
+ return LZString._decompress(compressed.length, 32768, function(index) { return compressed.charCodeAt(index); });
340
+ },
341
+
342
+ _decompress: function (length, resetValue, getNextValue) {
343
+ var dictionary = [],
344
+ enlargeIn = 4,
345
+ dictSize = 4,
346
+ numBits = 3,
347
+ entry = "",
348
+ result = [],
349
+ i,
350
+ w,
351
+ bits, resb, maxpower, power,
352
+ c,
353
+ data = {val:getNextValue(0), position:resetValue, index:1};
354
+
355
+ for (i = 0; i < 3; i += 1) {
356
+ dictionary[i] = i;
357
+ }
358
+
359
+ bits = 0;
360
+ maxpower = Math.pow(2,2);
361
+ power=1;
362
+ while (power!=maxpower) {
363
+ resb = data.val & data.position;
364
+ data.position >>= 1;
365
+ if (data.position == 0) {
366
+ data.position = resetValue;
367
+ data.val = getNextValue(data.index++);
368
+ }
369
+ bits |= (resb>0 ? 1 : 0) * power;
370
+ power <<= 1;
371
+ }
372
+
373
+ switch (bits) {
374
+ case 0:
375
+ bits = 0;
376
+ maxpower = Math.pow(2,8);
377
+ power=1;
378
+ while (power!=maxpower) {
379
+ resb = data.val & data.position;
380
+ data.position >>= 1;
381
+ if (data.position == 0) {
382
+ data.position = resetValue;
383
+ data.val = getNextValue(data.index++);
384
+ }
385
+ bits |= (resb>0 ? 1 : 0) * power;
386
+ power <<= 1;
387
+ }
388
+ c = f(bits);
389
+ break;
390
+ case 1:
391
+ bits = 0;
392
+ maxpower = Math.pow(2,16);
393
+ power=1;
394
+ while (power!=maxpower) {
395
+ resb = data.val & data.position;
396
+ data.position >>= 1;
397
+ if (data.position == 0) {
398
+ data.position = resetValue;
399
+ data.val = getNextValue(data.index++);
400
+ }
401
+ bits |= (resb>0 ? 1 : 0) * power;
402
+ power <<= 1;
403
+ }
404
+ c = f(bits);
405
+ break;
406
+ case 2:
407
+ return "";
408
+ }
409
+ dictionary[3] = c;
410
+ w = c;
411
+ result.push(c);
412
+ while (true) {
413
+ if (data.index > length) {
414
+ return "";
415
+ }
416
+
417
+ bits = 0;
418
+ maxpower = Math.pow(2,numBits);
419
+ power=1;
420
+ while (power!=maxpower) {
421
+ resb = data.val & data.position;
422
+ data.position >>= 1;
423
+ if (data.position == 0) {
424
+ data.position = resetValue;
425
+ data.val = getNextValue(data.index++);
426
+ }
427
+ bits |= (resb>0 ? 1 : 0) * power;
428
+ power <<= 1;
429
+ }
430
+
431
+ switch (c = bits) {
432
+ case 0:
433
+ bits = 0;
434
+ maxpower = Math.pow(2,8);
435
+ power=1;
436
+ while (power!=maxpower) {
437
+ resb = data.val & data.position;
438
+ data.position >>= 1;
439
+ if (data.position == 0) {
440
+ data.position = resetValue;
441
+ data.val = getNextValue(data.index++);
442
+ }
443
+ bits |= (resb>0 ? 1 : 0) * power;
444
+ power <<= 1;
445
+ }
446
+
447
+ dictionary[dictSize++] = f(bits);
448
+ c = dictSize-1;
449
+ enlargeIn--;
450
+ break;
451
+ case 1:
452
+ bits = 0;
453
+ maxpower = Math.pow(2,16);
454
+ power=1;
455
+ while (power!=maxpower) {
456
+ resb = data.val & data.position;
457
+ data.position >>= 1;
458
+ if (data.position == 0) {
459
+ data.position = resetValue;
460
+ data.val = getNextValue(data.index++);
461
+ }
462
+ bits |= (resb>0 ? 1 : 0) * power;
463
+ power <<= 1;
464
+ }
465
+ dictionary[dictSize++] = f(bits);
466
+ c = dictSize-1;
467
+ enlargeIn--;
468
+ break;
469
+ case 2:
470
+ return result.join('');
471
+ }
472
+
473
+ if (enlargeIn == 0) {
474
+ enlargeIn = Math.pow(2, numBits);
475
+ numBits++;
476
+ }
477
+
478
+ if (dictionary[c]) {
479
+ entry = dictionary[c];
480
+ } else {
481
+ if (c === dictSize) {
482
+ entry = w + w.charAt(0);
483
+ } else {
484
+ return null;
485
+ }
486
+ }
487
+ result.push(entry);
488
+
489
+ // Add w+entry[0] to the dictionary.
490
+ dictionary[dictSize++] = w + entry.charAt(0);
491
+ enlargeIn--;
492
+
493
+ w = entry;
494
+
495
+ if (enlargeIn == 0) {
496
+ enlargeIn = Math.pow(2, numBits);
497
+ numBits++;
498
+ }
499
+
500
+ }
501
+ }
502
+ };
503
+ return LZString;
504
+ })();
505
+
506
+ if( module != null ) {
507
+ module.exports = LZString;
508
+ } else if( typeof angular !== 'undefined' && angular != null ) {
509
+ angular.module('LZString', [])
510
+ .factory('LZString', function () {
511
+ return LZString;
512
+ });
513
+ }
514
+ } (lzString));
515
+ return lzString.exports;
516
+ }
517
+
518
+ export { requireLzString as __require };