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