decidim-accountability 0.8.0 → 0.8.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b9e4ccd5f0cb93b7caf07991bf0f69d1de1002dc
4
- data.tar.gz: fff3cc52314258d1d18d159be8ebf3b41854210b
3
+ metadata.gz: f133486255fc1eed73fca26c53d4ae41edf6a83b
4
+ data.tar.gz: d8fd6be9b21c09238f0a53b1f85ae6f6fba9ee77
5
5
  SHA512:
6
- metadata.gz: 9e615fb44d4e96e40555b689c2885652a7ba0ba6c7f7ad27663ad80019a86c96b6762c2f129a22c454e37c461b2f3eee990a539b0355ba6c705cfbd2ecdbc5b7
7
- data.tar.gz: 107326f7daeefd26291889a25798a8e21a301c7abe0b6df8a5390b1e6ad421f68bc6ad233eb31345fbd862685ee3d9b68fc2ed01ad44ef7bd0eadead9fda76d6
6
+ metadata.gz: 042c8fdba374be2512954a60167e56e73d4901e353c6da8b959a2d710b1c8c7008edfc2602c0064da0b44ab52e417b11642970fbdbb12787298034efced8942f
7
+ data.tar.gz: 7dcb28dac8fcf0b4b7739db1ef5a5673d23b6b9cc1e4f00251c6f94fdd13029b94d41a828877b3e555300730ac5cb949508252b680dbfa5f6f27065031192284
@@ -1,3 +1,4 @@
1
+ // = require diff
1
2
  // = require_tree .
2
3
  // = require_self
3
4
 
@@ -4,7 +4,7 @@ module Decidim
4
4
  # This holds decidim-accountability version.
5
5
  module Accountability
6
6
  def self.version
7
- "0.8.0"
7
+ "0.8.1"
8
8
  end
9
9
  end
10
10
  end
@@ -0,0 +1,1839 @@
1
+ /*!
2
+
3
+ diff v3.4.0
4
+
5
+ Software License Agreement (BSD License)
6
+
7
+ Copyright (c) 2009-2015, Kevin Decker <kpdecker@gmail.com>
8
+
9
+ All rights reserved.
10
+
11
+ Redistribution and use of this software in source and binary forms, with or without modification,
12
+ are permitted provided that the following conditions are met:
13
+
14
+ * Redistributions of source code must retain the above
15
+ copyright notice, this list of conditions and the
16
+ following disclaimer.
17
+
18
+ * Redistributions in binary form must reproduce the above
19
+ copyright notice, this list of conditions and the
20
+ following disclaimer in the documentation and/or other
21
+ materials provided with the distribution.
22
+
23
+ * Neither the name of Kevin Decker nor the names of its
24
+ contributors may be used to endorse or promote products
25
+ derived from this software without specific prior
26
+ written permission.
27
+
28
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
29
+ IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
30
+ FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
31
+ CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
32
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
33
+ DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
34
+ IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
35
+ OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
36
+ @license
37
+ */
38
+ (function webpackUniversalModuleDefinition(root, factory) {
39
+ if(typeof exports === 'object' && typeof module === 'object')
40
+ module.exports = factory();
41
+ else if(typeof define === 'function' && define.amd)
42
+ define([], factory);
43
+ else if(typeof exports === 'object')
44
+ exports["JsDiff"] = factory();
45
+ else
46
+ root["JsDiff"] = factory();
47
+ })(this, function() {
48
+ return /******/ (function(modules) { // webpackBootstrap
49
+ /******/ // The module cache
50
+ /******/ var installedModules = {};
51
+
52
+ /******/ // The require function
53
+ /******/ function __webpack_require__(moduleId) {
54
+
55
+ /******/ // Check if module is in cache
56
+ /******/ if(installedModules[moduleId])
57
+ /******/ return installedModules[moduleId].exports;
58
+
59
+ /******/ // Create a new module (and put it into the cache)
60
+ /******/ var module = installedModules[moduleId] = {
61
+ /******/ exports: {},
62
+ /******/ id: moduleId,
63
+ /******/ loaded: false
64
+ /******/ };
65
+
66
+ /******/ // Execute the module function
67
+ /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
68
+
69
+ /******/ // Flag the module as loaded
70
+ /******/ module.loaded = true;
71
+
72
+ /******/ // Return the exports of the module
73
+ /******/ return module.exports;
74
+ /******/ }
75
+
76
+
77
+ /******/ // expose the modules object (__webpack_modules__)
78
+ /******/ __webpack_require__.m = modules;
79
+
80
+ /******/ // expose the module cache
81
+ /******/ __webpack_require__.c = installedModules;
82
+
83
+ /******/ // __webpack_public_path__
84
+ /******/ __webpack_require__.p = "";
85
+
86
+ /******/ // Load entry module and return exports
87
+ /******/ return __webpack_require__(0);
88
+ /******/ })
89
+ /************************************************************************/
90
+ /******/ ([
91
+ /* 0 */
92
+ /***/ (function(module, exports, __webpack_require__) {
93
+
94
+ /*istanbul ignore start*/'use strict';
95
+
96
+ exports.__esModule = true;
97
+ exports.canonicalize = exports.convertChangesToXML = exports.convertChangesToDMP = exports.merge = exports.parsePatch = exports.applyPatches = exports.applyPatch = exports.createPatch = exports.createTwoFilesPatch = exports.structuredPatch = exports.diffArrays = exports.diffJson = exports.diffCss = exports.diffSentences = exports.diffTrimmedLines = exports.diffLines = exports.diffWordsWithSpace = exports.diffWords = exports.diffChars = exports.Diff = undefined;
98
+
99
+ /*istanbul ignore end*/var /*istanbul ignore start*/_base = __webpack_require__(1) /*istanbul ignore end*/;
100
+
101
+ /*istanbul ignore start*/var _base2 = _interopRequireDefault(_base);
102
+
103
+ /*istanbul ignore end*/var /*istanbul ignore start*/_character = __webpack_require__(2) /*istanbul ignore end*/;
104
+
105
+ var /*istanbul ignore start*/_word = __webpack_require__(3) /*istanbul ignore end*/;
106
+
107
+ var /*istanbul ignore start*/_line = __webpack_require__(5) /*istanbul ignore end*/;
108
+
109
+ var /*istanbul ignore start*/_sentence = __webpack_require__(6) /*istanbul ignore end*/;
110
+
111
+ var /*istanbul ignore start*/_css = __webpack_require__(7) /*istanbul ignore end*/;
112
+
113
+ var /*istanbul ignore start*/_json = __webpack_require__(8) /*istanbul ignore end*/;
114
+
115
+ var /*istanbul ignore start*/_array = __webpack_require__(9) /*istanbul ignore end*/;
116
+
117
+ var /*istanbul ignore start*/_apply = __webpack_require__(10) /*istanbul ignore end*/;
118
+
119
+ var /*istanbul ignore start*/_parse = __webpack_require__(11) /*istanbul ignore end*/;
120
+
121
+ var /*istanbul ignore start*/_merge = __webpack_require__(13) /*istanbul ignore end*/;
122
+
123
+ var /*istanbul ignore start*/_create = __webpack_require__(14) /*istanbul ignore end*/;
124
+
125
+ var /*istanbul ignore start*/_dmp = __webpack_require__(16) /*istanbul ignore end*/;
126
+
127
+ var /*istanbul ignore start*/_xml = __webpack_require__(17) /*istanbul ignore end*/;
128
+
129
+ /*istanbul ignore start*/function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
130
+
131
+ /* See LICENSE file for terms of use */
132
+
133
+ /*
134
+ * Text diff implementation.
135
+ *
136
+ * This library supports the following APIS:
137
+ * JsDiff.diffChars: Character by character diff
138
+ * JsDiff.diffWords: Word (as defined by \b regex) diff which ignores whitespace
139
+ * JsDiff.diffLines: Line based diff
140
+ *
141
+ * JsDiff.diffCss: Diff targeted at CSS content
142
+ *
143
+ * These methods are based on the implementation proposed in
144
+ * "An O(ND) Difference Algorithm and its Variations" (Myers, 1986).
145
+ * http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.4.6927
146
+ */
147
+ exports. /*istanbul ignore end*/Diff = _base2['default'];
148
+ /*istanbul ignore start*/exports. /*istanbul ignore end*/diffChars = _character.diffChars;
149
+ /*istanbul ignore start*/exports. /*istanbul ignore end*/diffWords = _word.diffWords;
150
+ /*istanbul ignore start*/exports. /*istanbul ignore end*/diffWordsWithSpace = _word.diffWordsWithSpace;
151
+ /*istanbul ignore start*/exports. /*istanbul ignore end*/diffLines = _line.diffLines;
152
+ /*istanbul ignore start*/exports. /*istanbul ignore end*/diffTrimmedLines = _line.diffTrimmedLines;
153
+ /*istanbul ignore start*/exports. /*istanbul ignore end*/diffSentences = _sentence.diffSentences;
154
+ /*istanbul ignore start*/exports. /*istanbul ignore end*/diffCss = _css.diffCss;
155
+ /*istanbul ignore start*/exports. /*istanbul ignore end*/diffJson = _json.diffJson;
156
+ /*istanbul ignore start*/exports. /*istanbul ignore end*/diffArrays = _array.diffArrays;
157
+ /*istanbul ignore start*/exports. /*istanbul ignore end*/structuredPatch = _create.structuredPatch;
158
+ /*istanbul ignore start*/exports. /*istanbul ignore end*/createTwoFilesPatch = _create.createTwoFilesPatch;
159
+ /*istanbul ignore start*/exports. /*istanbul ignore end*/createPatch = _create.createPatch;
160
+ /*istanbul ignore start*/exports. /*istanbul ignore end*/applyPatch = _apply.applyPatch;
161
+ /*istanbul ignore start*/exports. /*istanbul ignore end*/applyPatches = _apply.applyPatches;
162
+ /*istanbul ignore start*/exports. /*istanbul ignore end*/parsePatch = _parse.parsePatch;
163
+ /*istanbul ignore start*/exports. /*istanbul ignore end*/merge = _merge.merge;
164
+ /*istanbul ignore start*/exports. /*istanbul ignore end*/convertChangesToDMP = _dmp.convertChangesToDMP;
165
+ /*istanbul ignore start*/exports. /*istanbul ignore end*/convertChangesToXML = _xml.convertChangesToXML;
166
+ /*istanbul ignore start*/exports. /*istanbul ignore end*/canonicalize = _json.canonicalize;
167
+ //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uL3NyYy9pbmRleC5qcyJdLCJuYW1lcyI6WyJEaWZmIiwiZGlmZkNoYXJzIiwiZGlmZldvcmRzIiwiZGlmZldvcmRzV2l0aFNwYWNlIiwiZGlmZkxpbmVzIiwi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uL3BhdGNoL2FwcGx5JztcbmltcG9ydCB7cGFyc2VQYXRjaH0gZnJvbSAnLi9wYXRjaC9wYXJzZSc7XG5pbXBvcnQge21lcmdlfSBmcm9tICcuL3BhdGNoL21lcmdlJztcbmltcG9ydCB7c3RydWN0dXJlZFBhdGNoLCBjcmVhdGVUd29GaWxlc1BhdGNoLCBjcmVhdGVQYXRjaH0gZnJvbSAnLi9wYXRjaC9jcmVhdGUnO1xuXG5pbXBvcnQge2NvbnZlcnRDaGFuZ2VzVG9ETVB9IGZyb20gJy4vY29udmVydC9kbXAnO1xuaW1wb3J0IHtjb252ZXJ0Q2hhbmdlc1RvWE1MfSBmcm9tICcuL2NvbnZlcnQveG1sJztcblxuZXhwb3J0IHtcbiAgRGlmZixcblxuICBkaWZmQ2hhcnMsXG4gIGRpZmZXb3JkcyxcbiAgZGlmZldvcmRzV2l0aFNwYWNlLFxuICBkaWZmTGluZXMsXG4gIGRpZmZUcmltbWVkTGluZXMsXG4gIGRpZmZTZW50ZW5jZXMsXG5cbiAgZGlmZkNzcyxcbiAgZGlmZkpzb24sXG5cbiAgZGlmZkFycmF5cyxcblxuICBzdHJ1Y3R1cmVkUGF0Y2gsXG4gIGNyZWF0ZVR3b0ZpbGVzUGF0Y2gsXG4gIGNyZWF0ZVBhdGNoLFxuICBhcHBseVBhdGNoLFxuICBhcHBseVBhdGNoZXMsXG4gIHBhcnNlUGF0Y2gsXG4gIG1lcmdlLFxuICBjb252ZXJ0Q2hhbmdlc1RvRE1QLFxuICBjb252ZXJ0Q2hhbmdlc1RvWE1MLFxuICBjYW5vbmljYWxpemVcbn07XG4iXX0=
168
+
169
+
170
+ /***/ }),
171
+ /* 1 */
172
+ /***/ (function(module, exports) {
173
+
174
+ /*istanbul ignore start*/'use strict';
175
+
176
+ exports.__esModule = true;
177
+ exports['default'] = /*istanbul ignore end*/Diff;
178
+ function Diff() {}
179
+
180
+ Diff.prototype = {
181
+ /*istanbul ignore start*/ /*istanbul ignore end*/diff: function diff(oldString, newString) {
182
+ /*istanbul ignore start*/var /*istanbul ignore end*/options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
183
+
184
+ var callback = options.callback;
185
+ if (typeof options === 'function') {
186
+ callback = options;
187
+ options = {};
188
+ }
189
+ this.options = options;
190
+
191
+ var self = this;
192
+
193
+ function done(value) {
194
+ if (callback) {
195
+ setTimeout(function () {
196
+ callback(undefined, value);
197
+ }, 0);
198
+ return true;
199
+ } else {
200
+ return value;
201
+ }
202
+ }
203
+
204
+ // Allow subclasses to massage the input prior to running
205
+ oldString = this.castInput(oldString);
206
+ newString = this.castInput(newString);
207
+
208
+ oldString = this.removeEmpty(this.tokenize(oldString));
209
+ newString = this.removeEmpty(this.tokenize(newString));
210
+
211
+ var newLen = newString.length,
212
+ oldLen = oldString.length;
213
+ var editLength = 1;
214
+ var maxEditLength = newLen + oldLen;
215
+ var bestPath = [{ newPos: -1, components: [] }];
216
+
217
+ // Seed editLength = 0, i.e. the content starts with the same values
218
+ var oldPos = this.extractCommon(bestPath[0], newString, oldString, 0);
219
+ if (bestPath[0].newPos + 1 >= newLen && oldPos + 1 >= oldLen) {
220
+ // Identity per the equality and tokenizer
221
+ return done([{ value: this.join(newString), count: newString.length }]);
222
+ }
223
+
224
+ // Main worker method. checks all permutations of a given edit length for acceptance.
225
+ function execEditLength() {
226
+ for (var diagonalPath = -1 * editLength; diagonalPath <= editLength; diagonalPath += 2) {
227
+ var basePath = /*istanbul ignore start*/void 0 /*istanbul ignore end*/;
228
+ var addPath = bestPath[diagonalPath - 1],
229
+ removePath = bestPath[diagonalPath + 1],
230
+ _oldPos = (removePath ? removePath.newPos : 0) - diagonalPath;
231
+ if (addPath) {
232
+ // No one else is going to attempt to use this value, clear it
233
+ bestPath[diagonalPath - 1] = undefined;
234
+ }
235
+
236
+ var canAdd = addPath && addPath.newPos + 1 < newLen,
237
+ canRemove = removePath && 0 <= _oldPos && _oldPos < oldLen;
238
+ if (!canAdd && !canRemove) {
239
+ // If this path is a terminal then prune
240
+ bestPath[diagonalPath] = undefined;
241
+ continue;
242
+ }
243
+
244
+ // Select the diagonal that we want to branch from. We select the prior
245
+ // path whose position in the new string is the farthest from the origin
246
+ // and does not pass the bounds of the diff graph
247
+ if (!canAdd || canRemove && addPath.newPos < removePath.newPos) {
248
+ basePath = clonePath(removePath);
249
+ self.pushComponent(basePath.components, undefined, true);
250
+ } else {
251
+ basePath = addPath; // No need to clone, we've pulled it from the list
252
+ basePath.newPos++;
253
+ self.pushComponent(basePath.components, true, undefined);
254
+ }
255
+
256
+ _oldPos = self.extractCommon(basePath, newString, oldString, diagonalPath);
257
+
258
+ // If we have hit the end of both strings, then we are done
259
+ if (basePath.newPos + 1 >= newLen && _oldPos + 1 >= oldLen) {
260
+ return done(buildValues(self, basePath.components, newString, oldString, self.useLongestToken));
261
+ } else {
262
+ // Otherwise track this path as a potential candidate and continue.
263
+ bestPath[diagonalPath] = basePath;
264
+ }
265
+ }
266
+
267
+ editLength++;
268
+ }
269
+
270
+ // Performs the length of edit iteration. Is a bit fugly as this has to support the
271
+ // sync and async mode which is never fun. Loops over execEditLength until a value
272
+ // is produced.
273
+ if (callback) {
274
+ (function exec() {
275
+ setTimeout(function () {
276
+ // This should not happen, but we want to be safe.
277
+ /* istanbul ignore next */
278
+ if (editLength > maxEditLength) {
279
+ return callback();
280
+ }
281
+
282
+ if (!execEditLength()) {
283
+ exec();
284
+ }
285
+ }, 0);
286
+ })();
287
+ } else {
288
+ while (editLength <= maxEditLength) {
289
+ var ret = execEditLength();
290
+ if (ret) {
291
+ return ret;
292
+ }
293
+ }
294
+ }
295
+ },
296
+ /*istanbul ignore start*/ /*istanbul ignore end*/pushComponent: function pushComponent(components, added, removed) {
297
+ var last = components[components.length - 1];
298
+ if (last && last.added === added && last.removed === removed) {
299
+ // We need to clone here as the component clone operation is just
300
+ // as shallow array clone
301
+ components[components.length - 1] = { count: last.count + 1, added: added, removed: removed };
302
+ } else {
303
+ components.push({ count: 1, added: added, removed: removed });
304
+ }
305
+ },
306
+ /*istanbul ignore start*/ /*istanbul ignore end*/extractCommon: function extractCommon(basePath, newString, oldString, diagonalPath) {
307
+ var newLen = newString.length,
308
+ oldLen = oldString.length,
309
+ newPos = basePath.newPos,
310
+ oldPos = newPos - diagonalPath,
311
+ commonCount = 0;
312
+ while (newPos + 1 < newLen && oldPos + 1 < oldLen && this.equals(newString[newPos + 1], oldString[oldPos + 1])) {
313
+ newPos++;
314
+ oldPos++;
315
+ commonCount++;
316
+ }
317
+
318
+ if (commonCount) {
319
+ basePath.components.push({ count: commonCount });
320
+ }
321
+
322
+ basePath.newPos = newPos;
323
+ return oldPos;
324
+ },
325
+ /*istanbul ignore start*/ /*istanbul ignore end*/equals: function equals(left, right) {
326
+ if (this.options.comparator) {
327
+ return this.options.comparator(left, right);
328
+ } else {
329
+ return left === right || this.options.ignoreCase && left.toLowerCase() === right.toLowerCase();
330
+ }
331
+ },
332
+ /*istanbul ignore start*/ /*istanbul ignore end*/removeEmpty: function removeEmpty(array) {
333
+ var ret = [];
334
+ for (var i = 0; i < array.length; i++) {
335
+ if (array[i]) {
336
+ ret.push(array[i]);
337
+ }
338
+ }
339
+ return ret;
340
+ },
341
+ /*istanbul ignore start*/ /*istanbul ignore end*/castInput: function castInput(value) {
342
+ return value;
343
+ },
344
+ /*istanbul ignore start*/ /*istanbul ignore end*/tokenize: function tokenize(value) {
345
+ return value.split('');
346
+ },
347
+ /*istanbul ignore start*/ /*istanbul ignore end*/join: function join(chars) {
348
+ return chars.join('');
349
+ }
350
+ };
351
+
352
+ function buildValues(diff, components, newString, oldString, useLongestToken) {
353
+ var componentPos = 0,
354
+ componentLen = components.length,
355
+ newPos = 0,
356
+ oldPos = 0;
357
+
358
+ for (; componentPos < componentLen; componentPos++) {
359
+ var component = components[componentPos];
360
+ if (!component.removed) {
361
+ if (!component.added && useLongestToken) {
362
+ var value = newString.slice(newPos, newPos + component.count);
363
+ value = value.map(function (value, i) {
364
+ var oldValue = oldString[oldPos + i];
365
+ return oldValue.length > value.length ? oldValue : value;
366
+ });
367
+
368
+ component.value = diff.join(value);
369
+ } else {
370
+ component.value = diff.join(newString.slice(newPos, newPos + component.count));
371
+ }
372
+ newPos += component.count;
373
+
374
+ // Common case
375
+ if (!component.added) {
376
+ oldPos += component.count;
377
+ }
378
+ } else {
379
+ component.value = diff.join(oldString.slice(oldPos, oldPos + component.count));
380
+ oldPos += component.count;
381
+
382
+ // Reverse add and remove so removes are output first to match common convention
383
+ // The diffing algorithm is tied to add then remove output and this is the simplest
384
+ // route to get the desired output with minimal overhead.
385
+ if (componentPos && components[componentPos - 1].added) {
386
+ var tmp = components[componentPos - 1];
387
+ components[componentPos - 1] = components[componentPos];
388
+ components[componentPos] = tmp;
389
+ }
390
+ }
391
+ }
392
+
393
+ // Special case handle for when one terminal is ignored (i.e. whitespace).
394
+ // For this case we merge the terminal into the prior string and drop the change.
395
+ // This is only available for string mode.
396
+ var lastComponent = components[componentLen - 1];
397
+ if (componentLen > 1 && typeof lastComponent.value === 'string' && (lastComponent.added || lastComponent.removed) && diff.equals('', lastComponent.value)) {
398
+ components[componentLen - 2].value += lastComponent.value;
399
+ components.pop();
400
+ }
401
+
402
+ return components;
403
+ }
404
+
405
+ function clonePath(path) {
406
+ return { newPos: path.newPos, components: path.components.slice(0) };
407
+ }
408
+ //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9kaWZmL2Jhc2UuanMiXSwibmFtZXMiOlsiRGlmZiIsInByb3RvdHlwZSIsImRpZmYiLCJvbGRTdHJpbmciLCJuZXdTdHJpbmciLCJvcHRpb25zIiwiY2FsbGJhY2siLCJzZWxmIiwiZG9uZSIsInZhbHVlIiwic2V0VGltZW91dCIsInVuZGVmaW5lZCIsImNhc3RJbnB1dCIsInJlbW92ZUVtcHR5IiwidG9rZW5pemUiLCJuZXdMZW4iLCJsZW5ndGgiLCJvbGRMZW4iLCJlZGl0TGVuZ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gICAgJiYgZGlmZi5lcXVhbHMoJycsIGxhc3RDb21wb25lbnQudmFsdWUpKSB7XG4gICAgY29tcG9uZW50c1tjb21wb25lbnRMZW4gLSAyXS52YWx1ZSArPSBsYXN0Q29tcG9uZW50LnZhbHVlO1xuICAgIGNvbXBvbmVudHMucG9wKCk7XG4gIH1cblxuICByZXR1cm4gY29tcG9uZW50cztcbn1cblxuZnVuY3Rpb24gY2xvbmVQYXRoKHBhdGgpIHtcbiAgcmV0dXJuIHsgbmV3UG9zOiBwYXRoLm5ld1BvcywgY29tcG9uZW50czogcGF0aC5jb21wb25lbnRzLnNsaWNlKDApIH07XG59XG4iXX0=
409
+
410
+
411
+ /***/ }),
412
+ /* 2 */
413
+ /***/ (function(module, exports, __webpack_require__) {
414
+
415
+ /*istanbul ignore start*/'use strict';
416
+
417
+ exports.__esModule = true;
418
+ exports.characterDiff = undefined;
419
+ exports. /*istanbul ignore end*/diffChars = diffChars;
420
+
421
+ var /*istanbul ignore start*/_base = __webpack_require__(1) /*istanbul ignore end*/;
422
+
423
+ /*istanbul ignore start*/var _base2 = _interopRequireDefault(_base);
424
+
425
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
426
+
427
+ /*istanbul ignore end*/var characterDiff = /*istanbul ignore start*/exports. /*istanbul ignore end*/characterDiff = new /*istanbul ignore start*/_base2['default'] /*istanbul ignore end*/();
428
+ function diffChars(oldStr, newStr, options) {
429
+ return characterDiff.diff(oldStr, newStr, options);
430
+ }
431
+ //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9kaWZmL2NoYXJhY3Rlci5qcyJdLCJuYW1lcyI6WyJkaWZmQ2hhcnMiLCJjaGFyYWN0ZXJEaWZmIiwib2xkU3RyIiwibmV3U3RyIiwib3B0aW9ucyIsImRpZmYiXSwibWFwcGluZ3MiOiI7Ozs7Z0NBR2dCQSxTLEdBQUFBLFM7O0FBSGhCOzs7Ozs7dUJBRU8sSUFBTUMseUZBQWdCLHdFQUF0QjtBQUNBLFNBQVNELFNBQVQsQ0FBbUJFLE1BQW5CLEVBQTJCQyxNQUEzQixFQUFtQ0MsT0FBbkMsRUFBNEM7QUFBRSxTQUFPSCxjQUFjSSxJQUFkLENBQW1CSCxNQUFuQixFQUEyQkMsTUFBM0IsRUFBbUNDLE9BQW5DLENBQVA7QUFBcUQiLCJmaWxlIjoiY2hhcmFjdGVyLmpzIiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IERpZmYgZnJvbSAnLi9iYXNlJztcblxuZXhwb3J0IGNvbnN0IGNoYXJhY3RlckRpZmYgPSBuZXcgRGlmZigpO1xuZXhwb3J0IGZ1bmN0aW9uIGRpZmZDaGFycyhvbGRTdHIsIG5ld1N0ciwgb3B0aW9ucykgeyByZXR1cm4gY2hhcmFjdGVyRGlmZi5kaWZmKG9sZFN0ciwgbmV3U3RyLCBvcHRpb25zKTsgfVxuIl19
432
+
433
+
434
+ /***/ }),
435
+ /* 3 */
436
+ /***/ (function(module, exports, __webpack_require__) {
437
+
438
+ /*istanbul ignore start*/'use strict';
439
+
440
+ exports.__esModule = true;
441
+ exports.wordDiff = undefined;
442
+ exports. /*istanbul ignore end*/diffWords = diffWords;
443
+ /*istanbul ignore start*/exports. /*istanbul ignore end*/diffWordsWithSpace = diffWordsWithSpace;
444
+
445
+ var /*istanbul ignore start*/_base = __webpack_require__(1) /*istanbul ignore end*/;
446
+
447
+ /*istanbul ignore start*/var _base2 = _interopRequireDefault(_base);
448
+
449
+ /*istanbul ignore end*/var /*istanbul ignore start*/_params = __webpack_require__(4) /*istanbul ignore end*/;
450
+
451
+ /*istanbul ignore start*/function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
452
+
453
+ /*istanbul ignore end*/ // Based on https://en.wikipedia.org/wiki/Latin_script_in_Unicode
454
+ //
455
+ // Ranges and exceptions:
456
+ // Latin-1 Supplement, 0080–00FF
457
+ // - U+00D7 × Multiplication sign
458
+ // - U+00F7 ÷ Division sign
459
+ // Latin Extended-A, 0100–017F
460
+ // Latin Extended-B, 0180–024F
461
+ // IPA Extensions, 0250–02AF
462
+ // Spacing Modifier Letters, 02B0–02FF
463
+ // - U+02C7 ˇ &#711; Caron
464
+ // - U+02D8 ˘ &#728; Breve
465
+ // - U+02D9 ˙ &#729; Dot Above
466
+ // - U+02DA ˚ &#730; Ring Above
467
+ // - U+02DB ˛ &#731; Ogonek
468
+ // - U+02DC ˜ &#732; Small Tilde
469
+ // - U+02DD ˝ &#733; Double Acute Accent
470
+ // Latin Extended Additional, 1E00–1EFF
471
+ var extendedWordChars = /^[A-Za-z\xC0-\u02C6\u02C8-\u02D7\u02DE-\u02FF\u1E00-\u1EFF]+$/;
472
+
473
+ var reWhitespace = /\S/;
474
+
475
+ var wordDiff = /*istanbul ignore start*/exports. /*istanbul ignore end*/wordDiff = new /*istanbul ignore start*/_base2['default'] /*istanbul ignore end*/();
476
+ wordDiff.equals = function (left, right) {
477
+ if (this.options.ignoreCase) {
478
+ left = left.toLowerCase();
479
+ right = right.toLowerCase();
480
+ }
481
+ return left === right || this.options.ignoreWhitespace && !reWhitespace.test(left) && !reWhitespace.test(right);
482
+ };
483
+ wordDiff.tokenize = function (value) {
484
+ var tokens = value.split(/(\s+|\b)/);
485
+
486
+ // Join the boundary splits that we do not consider to be boundaries. This is primarily the extended Latin character set.
487
+ for (var i = 0; i < tokens.length - 1; i++) {
488
+ // If we have an empty string in the next field and we have only word chars before and after, merge
489
+ if (!tokens[i + 1] && tokens[i + 2] && extendedWordChars.test(tokens[i]) && extendedWordChars.test(tokens[i + 2])) {
490
+ tokens[i] += tokens[i + 2];
491
+ tokens.splice(i + 1, 2);
492
+ i--;
493
+ }
494
+ }
495
+
496
+ return tokens;
497
+ };
498
+
499
+ function diffWords(oldStr, newStr, options) {
500
+ options = /*istanbul ignore start*/(0, _params.generateOptions) /*istanbul ignore end*/(options, { ignoreWhitespace: true });
501
+ return wordDiff.diff(oldStr, newStr, options);
502
+ }
503
+
504
+ function diffWordsWithSpace(oldStr, newStr, options) {
505
+ return wordDiff.diff(oldStr, newStr, options);
506
+ }
507
+ //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9kaWZmL3dvcmQuanMiXSwibmFtZXMiOlsiZGlmZldvcmRzIiwiZGlmZldvcmRzV2l0aFNwYWNlIiwiZXh0ZW5kZWRXb3JkQ2hhcnMiLCJyZVdoaXRlc3BhY2UiLCJ3b3JkRGlmZiIsImVxdWFscyIsImxlZnQiLCJyaWdodCIsIm9wdGlvbnMiLCJpZ25vcmVDYXNlIiwidG9Mb3dlckNhc2UiLCJpZ25vcmVXaGl0ZXNwYWNlIiwidGVzdCIsInRva2VuaXplIiwidmFsdWUiLCJ0b2tlbnMiLCJzcGxpdCIsImkiLCJsZW5ndGgiLCJzcGxpY2UiLCJvbGRTdHIiLCJuZXdTdHIiLCJkaWZmIl0sIm1hcHBpbmdzIjoiOzs7O2dDQW1EZ0JBLFMsR0FBQUEsUzt5REFLQUMsa0IsR0FBQUEsa0I7O0FBeERoQjs7Ozt1QkFDQTs7Ozt3QkFFQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQSxJQUFNQyxvQkFBb0IsK0RBQTFCOztBQUVBLElBQU1DLGVBQWUsSUFBckI7O0FBRU8sSUFBTUMsK0VBQVcsd0VBQWpCO0FBQ1BBLFNBQVNDLE1BQVQsR0FBa0IsVUFBU0MsSUFBVCxFQUFlQyxLQUFmLEVBQXNCO0FBQ3RDLE1BQUksS0FBS0MsT0FBTCxDQUFhQyxVQUFqQixFQUE2QjtBQUMzQkgsV0FBT0EsS0FBS0ksV0FBTCxFQUFQO0FBQ0FIL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514
+ /*istanbul ignore start*/'use strict';
515
+
516
+ exports.__esModule = true;
517
+ exports. /*istanbul ignore end*/generateOptions = generateOptions;
518
+ function generateOptions(options, defaults) {
519
+ if (typeof options === 'function') {
520
+ defaults.callback = options;
521
+ } else if (options) {
522
+ for (var name in options) {
523
+ /* istanbul ignore else */
524
+ if (options.hasOwnProperty(name)) {
525
+ defaults[name] = options[name];
526
+ }
527
+ }
528
+ }
529
+ return defaults;
530
+ }
531
+ //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy91dGlsL3BhcmFtcy5qcyJdLCJuYW1lcyI6WyJnZW5lcmF0ZU9wdGlvbnMiLCJvcHRpb25zIiwiZGVmYXVsdHMiLCJjYWxsYmFjayIsIm5hbWUiLCJoYXNPd25Qcm9wZXJ0eSJdLCJtYXBwaW5ncyI6Ijs7O2dDQUFnQkEsZSxHQUFBQSxlO0FBQVQsU0FBU0EsZUFBVCxDQUF5QkMsT0FBekIsRUFBa0NDLFFBQWxDLEVBQTRDO0FBQ2pELE1BQUksT0FBT0QsT0FBUCxLQUFtQixVQUF2QixFQUFtQztBQUNqQ0MsYUFBU0MsUUFBVCxHQUFvQkYsT0FBcEI7QUFDRCxHQUZELE1BRU8sSUFBSUEsT0FBSixFQUFhO0FBQ2xCLFNBQUssSUFBSUcsSUFBVCxJQUFpQkgsT0FBakIsRUFBMEI7QUFDeEI7QUFDQSxVQUFJQSxRQUFRSSxjQUFSLENBQXVCRCxJQUF2QixDQUFKLEVBQWtDO0FBQ2hDRixpQkFBU0UsSUFBVCxJQUFpQkgsUUFBUUcsSUFBUixDQUFqQjtBQUNEO0FBQ0Y7QUFDRjtBQUNELFNBQU9GLFFBQVA7QUFDRCIsImZpbGUiOiJwYXJhbXMuanMiLCJzb3VyY2VzQ29udGVudCI6WyJleHBvcnQgZnVuY3Rpb24gZ2VuZXJhdGVPcHRpb25zKG9wdGlvbnMsIGRlZmF1bHRzKSB7XG4gIGlmICh0eXBlb2Ygb3B0aW9ucyA9PT0gJ2Z1bmN0aW9uJykge1xuICAgIGRlZmF1bHRzLmNhbGxiYWNrID0gb3B0aW9ucztcbiAgfSBlbHNlIGlmIChvcHRpb25zKSB7XG4gICAgZm9yIChsZXQgbmFtZSBpbiBvcHRpb25zKSB7XG4gICAgICAvKiBpc3RhbmJ1bCBpZ25vcmUgZWxzZSAqL1xuICAgICAgaWYgKG9wdGlvbnMuaGFzT3duUHJvcGVydHkobmFtZSkpIHtcbiAgICAgICAgZGVmYXVsdHNbbmFtZV0gPSBvcHRpb25zW25hbWVdO1xuICAgICAgfVxuICAgIH1cbiAgfVxuICByZXR1cm4gZGVmYXVsdHM7XG59XG4iXX0=
532
+
533
+
534
+ /***/ }),
535
+ /* 5 */
536
+ /***/ (function(module, exports, __webpack_require__) {
537
+
538
+ /*istanbul ignore start*/'use strict';
539
+
540
+ exports.__esModule = true;
541
+ exports.lineDiff = undefined;
542
+ exports. /*istanbul ignore end*/diffLines = diffLines;
543
+ /*istanbul ignore start*/exports. /*istanbul ignore end*/diffTrimmedLines = diffTrimmedLines;
544
+
545
+ var /*istanbul ignore start*/_base = __webpack_require__(1) /*istanbul ignore end*/;
546
+
547
+ /*istanbul ignore start*/var _base2 = _interopRequireDefault(_base);
548
+
549
+ /*istanbul ignore end*/var /*istanbul ignore start*/_params = __webpack_require__(4) /*istanbul ignore end*/;
550
+
551
+ /*istanbul ignore start*/function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
552
+
553
+ /*istanbul ignore end*/var lineDiff = /*istanbul ignore start*/exports. /*istanbul ignore end*/lineDiff = new /*istanbul ignore start*/_base2['default'] /*istanbul ignore end*/();
554
+ lineDiff.tokenize = function (value) {
555
+ var retLines = [],
556
+ linesAndNewlines = value.split(/(\n|\r\n)/);
557
+
558
+ // Ignore the final empty token that occurs if the string ends with a new line
559
+ if (!linesAndNewlines[linesAndNewlines.length - 1]) {
560
+ linesAndNewlines.pop();
561
+ }
562
+
563
+ // Merge the content and line separators into single tokens
564
+ for (var i = 0; i < linesAndNewlines.length; i++) {
565
+ var line = linesAndNewlines[i];
566
+
567
+ if (i % 2 && !this.options.newlineIsToken) {
568
+ retLines[retLines.length - 1] += line;
569
+ } else {
570
+ if (this.options.ignoreWhitespace) {
571
+ line = line.trim();
572
+ }
573
+ retLines.push(line);
574
+ }
575
+ }
576
+
577
+ return retLines;
578
+ };
579
+
580
+ function diffLines(oldStr, newStr, callback) {
581
+ return lineDiff.diff(oldStr, newStr, callback);
582
+ }
583
+ function diffTrimmedLines(oldStr, newStr, callback) {
584
+ var options = /*istanbul ignore start*/(0, _params.generateOptions) /*istanbul ignore end*/(callback, { ignoreWhitespace: true });
585
+ return lineDiff.diff(oldStr, newStr, options);
586
+ }
587
+ //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9kaWZmL2xpbmUuanMiXSwibmFtZXMiOlsiZGlmZkxpbmVzIiwiZGlmZlRyaW1tZWRMaW5lcyIsImxpbmVEaWZmIiwidG9rZW5pemUiLCJ2YWx1ZSIsInJldExpbmVzIiwibGluZXNBbmROZXdsaW5lcyIsInNwbGl0IiwibGVuZ3RoIiwicG9wIiwiaSIsImxpbmUiLCJvcHRpb25zIiwibmV3bGluZUlzVG9rZW4iLCJpZ25vcmVXaGl0ZXNwYWNlIiwidHJpbSIsInB1c2giLCJvbGRTdHIiLCJuZXdTdHIiLCJjYWxsYmFjayIsImRpZmYiXSwibWFwcGluZ3MiOiI7Ozs7Z0NBOEJnQkEsUyxHQUFBQSxTO3lEQUNBQyxnQixHQUFBQSxnQjs7QUEvQmhCOzs7O3VCQUNBOzs7O3VCQUVPLElBQU1DLCtFQUFXLHdFQUFqQjtBQUNQQSxTQUFTQyxRQUFULEdBQW9CLFVBQVNDLEtBQVQsRUFBZ0I7QUFDbEMsTUFBSUMsV0FBVyxFQUFmO0FBQU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tcbiAgICAgICAgbGluZSA9IGxpbmUudHJpbSgpO1xuICAgICAgfVxuICAgICAgcmV0TGluZXMucHVzaChsaW5lKTtcbiAgICB9XG4gIH1cblxuICByZXR1cm4gcmV0TGluZXM7XG59O1xuXG5leHBvcnQgZnVuY3Rpb24gZGlmZkxpbmVzKG9sZFN0ciwgbmV3U3RyLCBjYWxsYmFjaykgeyByZXR1cm4gbGluZURpZmYuZGlmZihvbGRTdHIsIG5ld1N0ciwgY2FsbGJhY2spOyB9XG5leHBvcnQgZnVuY3Rpb24gZGlmZlRyaW1tZWRMaW5lcyhvbGRTdHIsIG5ld1N0ciwgY2FsbGJhY2spIHtcbiAgbGV0IG9wdGlvbnMgPSBnZW5lcmF0ZU9wdGlvbnMoY2FsbGJhY2ssIHtpZ25vcmVXaGl0ZXNwYWNlOiB0cnVlfSk7XG4gIHJldHVybiBsaW5lRGlmZi5kaWZmKG9sZFN0ciwgbmV3U3RyLCBvcHRpb25zKTtcbn1cbiJdfQ==
588
+
589
+
590
+ /***/ }),
591
+ /* 6 */
592
+ /***/ (function(module, exports, __webpack_require__) {
593
+
594
+ /*istanbul ignore start*/'use strict';
595
+
596
+ exports.__esModule = true;
597
+ exports.sentenceDiff = undefined;
598
+ exports. /*istanbul ignore end*/diffSentences = diffSentences;
599
+
600
+ var /*istanbul ignore start*/_base = __webpack_require__(1) /*istanbul ignore end*/;
601
+
602
+ /*istanbul ignore start*/var _base2 = _interopRequireDefault(_base);
603
+
604
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
605
+
606
+ /*istanbul ignore end*/var sentenceDiff = /*istanbul ignore start*/exports. /*istanbul ignore end*/sentenceDiff = new /*istanbul ignore start*/_base2['default'] /*istanbul ignore end*/();
607
+ sentenceDiff.tokenize = function (value) {
608
+ return value.split(/(\S.+?[.!?])(?=\s+|$)/);
609
+ };
610
+
611
+ function diffSentences(oldStr, newStr, callback) {
612
+ return sentenceDiff.diff(oldStr, newStr, callback);
613
+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RyLCBjYWxsYmFjayk7IH1cbiJdfQ==
615
+
616
+
617
+ /***/ }),
618
+ /* 7 */
619
+ /***/ (function(module, exports, __webpack_require__) {
620
+
621
+ /*istanbul ignore start*/'use strict';
622
+
623
+ exports.__esModule = true;
624
+ exports.cssDiff = undefined;
625
+ exports. /*istanbul ignore end*/diffCss = diffCss;
626
+
627
+ var /*istanbul ignore start*/_base = __webpack_require__(1) /*istanbul ignore end*/;
628
+
629
+ /*istanbul ignore start*/var _base2 = _interopRequireDefault(_base);
630
+
631
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
632
+
633
+ /*istanbul ignore end*/var cssDiff = /*istanbul ignore start*/exports. /*istanbul ignore end*/cssDiff = new /*istanbul ignore start*/_base2['default'] /*istanbul ignore end*/();
634
+ cssDiff.tokenize = function (value) {
635
+ return value.split(/([{}:;,]|\s+)/);
636
+ };
637
+
638
+ function diffCss(oldStr, newStr, callback) {
639
+ return cssDiff.diff(oldStr, newStr, callback);
640
+ }
641
+ //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9kaWZmL2Nzcy5qcyJdLCJuYW1lcyI6WyJkaWZmQ3NzIiwiY3NzRGlmZiIsInRva2VuaXplIiwidmFsdWUiLCJzcGxpdCIsIm9sZFN0ciIsIm5ld1N0ciIsImNhbGxiYWNrIiwiZGlmZiJdLCJtYXBwaW5ncyI6Ijs7OztnQ0FPZ0JBLE8sR0FBQUEsTzs7QUFQaEI7Ozs7Ozt1QkFFTyxJQUFNQyw2RUFBVSx3RUFBaEI7QUFDUEEsUUFBUUMsUUFBUixHQUFtQixVQUFTQyxLQUFULEVBQWdCO0FBQ2pDLFNBQU9BLE1BQU1DLEtBQU4sQ0FBWSxlQUFaLENBQVA7QUFDRCxDQUZEOztBQUlPLFNBQVNKLE9BQVQsQ0FBaUJLLE1BQWpCLEVBQXlCQyxNQUF6QixFQUFpQ0MsUUFBakMsRUFBMkM7QUFBRSxTQUFPTixRQUFRTyxJQUFSLENBQWFILE1BQWIsRUFBcUJDLE1BQXJCLEVBQTZCQyxRQUE3QixDQUFQO0FBQWdEIiwiZmlsZSI6ImNzcy5qcyIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCBEaWZmIGZyb20gJy4vYmFzZSc7XG5cbmV4cG9ydCBjb25zdCBjc3NEaWZmID0gbmV3IERpZmYoKTtcbmNzc0RpZmYudG9rZW5pemUgPSBmdW5jdGlvbih2YWx1ZSkge1xuICByZXR1cm4gdmFsdWUuc3BsaXQoLyhbe306OyxdfFxccyspLyk7XG59O1xuXG5leHBvcnQgZnVuY3Rpb24gZGlmZkNzcyhvbGRTdHIsIG5ld1N0ciwgY2FsbGJhY2spIHsgcmV0dXJuIGNzc0RpZmYuZGlmZihvbGRTdHIsIG5ld1N0ciwgY2FsbGJhY2spOyB9XG4iXX0=
642
+
643
+
644
+ /***/ }),
645
+ /* 8 */
646
+ /***/ (function(module, exports, __webpack_require__) {
647
+
648
+ /*istanbul ignore start*/'use strict';
649
+
650
+ exports.__esModule = true;
651
+ exports.jsonDiff = undefined;
652
+
653
+ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
654
+
655
+ exports. /*istanbul ignore end*/diffJson = diffJson;
656
+ /*istanbul ignore start*/exports. /*istanbul ignore end*/canonicalize = canonicalize;
657
+
658
+ var /*istanbul ignore start*/_base = __webpack_require__(1) /*istanbul ignore end*/;
659
+
660
+ /*istanbul ignore start*/var _base2 = _interopRequireDefault(_base);
661
+
662
+ /*istanbul ignore end*/var /*istanbul ignore start*/_line = __webpack_require__(5) /*istanbul ignore end*/;
663
+
664
+ /*istanbul ignore start*/function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
665
+
666
+ /*istanbul ignore end*/var objectPrototypeToString = Object.prototype.toString;
667
+
668
+ var jsonDiff = /*istanbul ignore start*/exports. /*istanbul ignore end*/jsonDiff = new /*istanbul ignore start*/_base2['default'] /*istanbul ignore end*/();
669
+ // Discriminate between two lines of pretty-printed, serialized JSON where one of them has a
670
+ // dangling comma and the other doesn't. Turns out including the dangling comma yields the nicest output:
671
+ jsonDiff.useLongestToken = true;
672
+
673
+ jsonDiff.tokenize = /*istanbul ignore start*/_line.lineDiff /*istanbul ignore end*/.tokenize;
674
+ jsonDiff.castInput = function (value) {
675
+ /*istanbul ignore start*/var /*istanbul ignore end*/undefinedReplacement = this.options.undefinedReplacement;
676
+
677
+
678
+ return typeof value === 'string' ? value : JSON.stringify(canonicalize(value), function (k, v) {
679
+ if (typeof v === 'undefined') {
680
+ return undefinedReplacement;
681
+ }
682
+
683
+ return v;
684
+ }, ' ');
685
+ };
686
+ jsonDiff.equals = function (left, right) {
687
+ return (/*istanbul ignore start*/_base2['default'] /*istanbul ignore end*/.prototype.equals.call(jsonDiff, left.replace(/,([\r\n])/g, '$1'), right.replace(/,([\r\n])/g, '$1'))
688
+ );
689
+ };
690
+
691
+ function diffJson(oldObj, newObj, options) {
692
+ return jsonDiff.diff(oldObj, newObj, options);
693
+ }
694
+
695
+ // This function handles the presence of circular references by bailing out when encountering an
696
+ // object that is already on the "stack" of items being processed.
697
+ function canonicalize(obj, stack, replacementStack) {
698
+ stack = stack || [];
699
+ replacementStack = replacementStack || [];
700
+
701
+ var i = /*istanbul ignore start*/void 0 /*istanbul ignore end*/;
702
+
703
+ for (i = 0; i < stack.length; i += 1) {
704
+ if (stack[i] === obj) {
705
+ return replacementStack[i];
706
+ }
707
+ }
708
+
709
+ var canonicalizedObj = /*istanbul ignore start*/void 0 /*istanbul ignore end*/;
710
+
711
+ if ('[object Array]' === objectPrototypeToString.call(obj)) {
712
+ stack.push(obj);
713
+ canonicalizedObj = new Array(obj.length);
714
+ replacementStack.push(canonicalizedObj);
715
+ for (i = 0; i < obj.length; i += 1) {
716
+ canonicalizedObj[i] = canonicalize(obj[i], stack, replacementStack);
717
+ }
718
+ stack.pop();
719
+ replacementStack.pop();
720
+ return canonicalizedObj;
721
+ }
722
+
723
+ if (obj && obj.toJSON) {
724
+ obj = obj.toJSON();
725
+ }
726
+
727
+ if ( /*istanbul ignore start*/(typeof /*istanbul ignore end*/obj === 'undefined' ? 'undefined' : _typeof(obj)) === 'object' && obj !== null) {
728
+ stack.push(obj);
729
+ canonicalizedObj = {};
730
+ replacementStack.push(canonicalizedObj);
731
+ var sortedKeys = [],
732
+ key = /*istanbul ignore start*/void 0 /*istanbul ignore end*/;
733
+ for (key in obj) {
734
+ /* istanbul ignore else */
735
+ if (obj.hasOwnProperty(key)) {
736
+ sortedKeys.push(key);
737
+ }
738
+ }
739
+ sortedKeys.sort();
740
+ for (i = 0; i < sortedKeys.length; i += 1) {
741
+ key = sortedKeys[i];
742
+ canonicalizedObj[key] = canonicalize(obj[key], stack, replacementStack);
743
+ }
744
+ stack.pop();
745
+ replacementStack.pop();
746
+ } else {
747
+ canonicalizedObj = obj;
748
+ }
749
+ return canonicalizedObj;
750
+ }
751
+ //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9kaWZmL2pzb24uanMiXSwibmFtZXMiOlsiZGlmZkpzb24iLCJjYW5vbmljYWxpemUiLCJvYmplY3RQcm90b3R5cGVUb1N0cmluZyIsIk9iamVjdCIsInByb3RvdHlwZSIsInRvU3RyaW5nIiwianNvbkRpZmYiLCJ1c2VMb25nZXN0VG9rZW4iLCJ0b2tlbml6ZSIsImNhc3RJbnB1dCIsInZhbHVlIiwidW5kZWZpbmVkUmVwbGFjZW1lbnQiLCJvcHRpb25zIiwiSlNPTiIsInN0cmluZ2lmeSIsImsiLCJ2IiwiZXF1YWxzIiwibGVmdCIsInJpZ2h0IiwiY2FsbCIsInJlcGxhY2UiLCJvbGRPYmoiLCJuZXdPYmoiL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AgICAgIGtleSA9IHNvcnRlZEtleXNbaV07XG4gICAgICBjYW5vbmljYWxpemVkT2JqW2tleV0gPSBjYW5vbmljYWxpemUob2JqW2tleV0sIHN0YWNrLCByZXBsYWNlbWVudFN0YWNrKTtcbiAgICB9XG4gICAgc3RhY2sucG9wKCk7XG4gICAgcmVwbGFjZW1lbnRTdGFjay5wb3AoKTtcbiAgfSBlbHNlIHtcbiAgICBjYW5vbmljYWxpemVkT2JqID0gb2JqO1xuICB9XG4gIHJldHVybiBjYW5vbmljYWxpemVkT2JqO1xufVxuIl19
752
+
753
+
754
+ /***/ }),
755
+ /* 9 */
756
+ /***/ (function(module, exports, __webpack_require__) {
757
+
758
+ /*istanbul ignore start*/'use strict';
759
+
760
+ exports.__esModule = true;
761
+ exports.arrayDiff = undefined;
762
+ exports. /*istanbul ignore end*/diffArrays = diffArrays;
763
+
764
+ var /*istanbul ignore start*/_base = __webpack_require__(1) /*istanbul ignore end*/;
765
+
766
+ /*istanbul ignore start*/var _base2 = _interopRequireDefault(_base);
767
+
768
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
769
+
770
+ /*istanbul ignore end*/var arrayDiff = /*istanbul ignore start*/exports. /*istanbul ignore end*/arrayDiff = new /*istanbul ignore start*/_base2['default'] /*istanbul ignore end*/();
771
+ arrayDiff.tokenize = arrayDiff.join = function (value) {
772
+ return value.slice();
773
+ };
774
+ arrayDiff.removeEmpty = function (value) {
775
+ return value;
776
+ };
777
+
778
+ function diffArrays(oldArr, newArr, callback) {
779
+ return arrayDiff.diff(oldArr, newArr, callback);
780
+ }
781
+ //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9kaWZmL2FycmF5LmpzIl0sIm5hbWVzIjpbImRpZmZBcnJheXMiLCJhcnJheURpZmYiLCJ0b2tlbml6ZSIsImpvaW4iLCJ2YWx1ZSIsInNsaWNlIiwicmVtb3Zl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 /* 10 */
786
+ /***/ (function(module, exports, __webpack_require__) {
787
+
788
+ /*istanbul ignore start*/'use strict';
789
+
790
+ exports.__esModule = true;
791
+ exports. /*istanbul ignore end*/applyPatch = applyPatch;
792
+ /*istanbul ignore start*/exports. /*istanbul ignore end*/applyPatches = applyPatches;
793
+
794
+ var /*istanbul ignore start*/_parse = __webpack_require__(11) /*istanbul ignore end*/;
795
+
796
+ var /*istanbul ignore start*/_distanceIterator = __webpack_require__(12) /*istanbul ignore end*/;
797
+
798
+ /*istanbul ignore start*/var _distanceIterator2 = _interopRequireDefault(_distanceIterator);
799
+
800
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
801
+
802
+ /*istanbul ignore end*/function applyPatch(source, uniDiff) {
803
+ /*istanbul ignore start*/var /*istanbul ignore end*/options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
804
+
805
+ if (typeof uniDiff === 'string') {
806
+ uniDiff = /*istanbul ignore start*/(0, _parse.parsePatch) /*istanbul ignore end*/(uniDiff);
807
+ }
808
+
809
+ if (Array.isArray(uniDiff)) {
810
+ if (uniDiff.length > 1) {
811
+ throw new Error('applyPatch only works with a single input.');
812
+ }
813
+
814
+ uniDiff = uniDiff[0];
815
+ }
816
+
817
+ // Apply the diff to the input
818
+ var lines = source.split(/\r\n|[\n\v\f\r\x85]/),
819
+ delimiters = source.match(/\r\n|[\n\v\f\r\x85]/g) || [],
820
+ hunks = uniDiff.hunks,
821
+ compareLine = options.compareLine || function (lineNumber, line, operation, patchContent) /*istanbul ignore start*/{
822
+ return (/*istanbul ignore end*/line === patchContent
823
+ );
824
+ },
825
+ errorCount = 0,
826
+ fuzzFactor = options.fuzzFactor || 0,
827
+ minLine = 0,
828
+ offset = 0,
829
+ removeEOFNL = /*istanbul ignore start*/void 0 /*istanbul ignore end*/,
830
+ addEOFNL = /*istanbul ignore start*/void 0 /*istanbul ignore end*/;
831
+
832
+ /**
833
+ * Checks if the hunk exactly fits on the provided location
834
+ */
835
+ function hunkFits(hunk, toPos) {
836
+ for (var j = 0; j < hunk.lines.length; j++) {
837
+ var line = hunk.lines[j],
838
+ operation = line[0],
839
+ content = line.substr(1);
840
+
841
+ if (operation === ' ' || operation === '-') {
842
+ // Context sanity check
843
+ if (!compareLine(toPos + 1, lines[toPos], operation, content)) {
844
+ errorCount++;
845
+
846
+ if (errorCount > fuzzFactor) {
847
+ return false;
848
+ }
849
+ }
850
+ toPos++;
851
+ }
852
+ }
853
+
854
+ return true;
855
+ }
856
+
857
+ // Search best fit offsets for each hunk based on the previous ones
858
+ for (var i = 0; i < hunks.length; i++) {
859
+ var hunk = hunks[i],
860
+ maxLine = lines.length - hunk.oldLines,
861
+ localOffset = 0,
862
+ toPos = offset + hunk.oldStart - 1;
863
+
864
+ var iterator = /*istanbul ignore start*/(0, _distanceIterator2['default']) /*istanbul ignore end*/(toPos, minLine, maxLine);
865
+
866
+ for (; localOffset !== undefined; localOffset = iterator()) {
867
+ if (hunkFits(hunk, toPos + localOffset)) {
868
+ hunk.offset = offset += localOffset;
869
+ break;
870
+ }
871
+ }
872
+
873
+ if (localOffset === undefined) {
874
+ return false;
875
+ }
876
+
877
+ // Set lower text limit to end of the current hunk, so next ones don't try
878
+ // to fit over already patched text
879
+ minLine = hunk.offset + hunk.oldStart + hunk.oldLines;
880
+ }
881
+
882
+ // Apply patch hunks
883
+ var diffOffset = 0;
884
+ for (var _i = 0; _i < hunks.length; _i++) {
885
+ var _hunk = hunks[_i],
886
+ _toPos = _hunk.oldStart + _hunk.offset + diffOffset - 1;
887
+ diffOffset += _hunk.newLines - _hunk.oldLines;
888
+
889
+ if (_toPos < 0) {
890
+ // Creating a new file
891
+ _toPos = 0;
892
+ }
893
+
894
+ for (var j = 0; j < _hunk.lines.length; j++) {
895
+ var line = _hunk.lines[j],
896
+ operation = line[0],
897
+ content = line.substr(1),
898
+ delimiter = _hunk.linedelimiters[j];
899
+
900
+ if (operation === ' ') {
901
+ _toPos++;
902
+ } else if (operation === '-') {
903
+ lines.splice(_toPos, 1);
904
+ delimiters.splice(_toPos, 1);
905
+ /* istanbul ignore else */
906
+ } else if (operation === '+') {
907
+ lines.splice(_toPos, 0, content);
908
+ delimiters.splice(_toPos, 0, delimiter);
909
+ _toPos++;
910
+ } else if (operation === '\\') {
911
+ var previousOperation = _hunk.lines[j - 1] ? _hunk.lines[j - 1][0] : null;
912
+ if (previousOperation === '+') {
913
+ removeEOFNL = true;
914
+ } else if (previousOperation === '-') {
915
+ addEOFNL = true;
916
+ }
917
+ }
918
+ }
919
+ }
920
+
921
+ // Handle EOFNL insertion/removal
922
+ if (removeEOFNL) {
923
+ while (!lines[lines.length - 1]) {
924
+ lines.pop();
925
+ delimiters.pop();
926
+ }
927
+ } else if (addEOFNL) {
928
+ lines.push('');
929
+ delimiters.push('\n');
930
+ }
931
+ for (var _k = 0; _k < lines.length - 1; _k++) {
932
+ lines[_k] = lines[_k] + delimiters[_k];
933
+ }
934
+ return lines.join('');
935
+ }
936
+
937
+ // Wrapper that supports multiple file patches via callbacks.
938
+ function applyPatches(uniDiff, options) {
939
+ if (typeof uniDiff === 'string') {
940
+ uniDiff = /*istanbul ignore start*/(0, _parse.parsePatch) /*istanbul ignore end*/(uniDiff);
941
+ }
942
+
943
+ var currentIndex = 0;
944
+ function processIndex() {
945
+ var index = uniDiff[currentIndex++];
946
+ if (!index) {
947
+ return options.complete();
948
+ }
949
+
950
+ options.loadFile(index, function (err, data) {
951
+ if (err) {
952
+ return options.complete(err);
953
+ }
954
+
955
+ var updatedContent = applyPatch(data, index, options);
956
+ options.patched(index, updatedContent, function (err) {
957
+ if (err) {
958
+ return options.complete(err);
959
+ }
960
+
961
+ processIndex();
962
+ });
963
+ });
964
+ }
965
+ processIndex();
966
+ }
967
+ //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9wYXRjaC9hcHBseS5qcyJdLCJuYW1lcyI6WyJhcHBse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G9hZEZpbGUoaW5kZXgsIGZ1bmN0aW9uKGVyciwgZGF0YSkge1xuICAgICAgaWYgKGVycikge1xuICAgICAgICByZXR1cm4gb3B0aW9ucy5jb21wbGV0ZShlcnIpO1xuICAgICAgfVxuXG4gICAgICBsZXQgdXBkYXRlZENvbnRlbnQgPSBhcHBseVBhdGNoKGRhdGEsIGluZGV4LCBvcHRpb25zKTtcbiAgICAgIG9wdGlvbnMucGF0Y2hlZChpbmRleCwgdXBkYXRlZENvbnRlbnQsIGZ1bmN0aW9uKGVycikge1xuICAgICAgICBpZiAoZXJyKSB7XG4gICAgICAgICAgcmV0dXJuIG9wdGlvbnMuY29tcGxldGUoZXJyKTtcbiAgICAgICAgfVxuXG4gICAgICAgIHByb2Nlc3NJbmRleCgpO1xuICAgICAgfSk7XG4gICAgfSk7XG4gIH1cbiAgcHJvY2Vzc0luZGV4KCk7XG59XG4iXX0=
968
+
969
+
970
+ /***/ }),
971
+ /* 11 */
972
+ /***/ (function(module, exports) {
973
+
974
+ /*istanbul ignore start*/'use strict';
975
+
976
+ exports.__esModule = true;
977
+ exports. /*istanbul ignore end*/parsePatch = parsePatch;
978
+ function parsePatch(uniDiff) {
979
+ /*istanbul ignore start*/var /*istanbul ignore end*/options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
980
+
981
+ var diffstr = uniDiff.split(/\r\n|[\n\v\f\r\x85]/),
982
+ delimiters = uniDiff.match(/\r\n|[\n\v\f\r\x85]/g) || [],
983
+ list = [],
984
+ i = 0;
985
+
986
+ function parseIndex() {
987
+ var index = {};
988
+ list.push(index);
989
+
990
+ // Parse diff metadata
991
+ while (i < diffstr.length) {
992
+ var line = diffstr[i];
993
+
994
+ // File header found, end parsing diff metadata
995
+ if (/^(\-\-\-|\+\+\+|@@)\s/.test(line)) {
996
+ break;
997
+ }
998
+
999
+ // Diff index
1000
+ var header = /^(?:Index:|diff(?: -r \w+)+)\s+(.+?)\s*$/.exec(line);
1001
+ if (header) {
1002
+ index.index = header[1];
1003
+ }
1004
+
1005
+ i++;
1006
+ }
1007
+
1008
+ // Parse file headers if they are defined. Unified diff requires them, but
1009
+ // there's no technical issues to have an isolated hunk without file header
1010
+ parseFileHeader(index);
1011
+ parseFileHeader(index);
1012
+
1013
+ // Parse hunks
1014
+ index.hunks = [];
1015
+
1016
+ while (i < diffstr.length) {
1017
+ var _line = diffstr[i];
1018
+
1019
+ if (/^(Index:|diff|\-\-\-|\+\+\+)\s/.test(_line)) {
1020
+ break;
1021
+ } else if (/^@@/.test(_line)) {
1022
+ index.hunks.push(parseHunk());
1023
+ } else if (_line && options.strict) {
1024
+ // Ignore unexpected content unless in strict mode
1025
+ throw new Error('Unknown line ' + (i + 1) + ' ' + JSON.stringify(_line));
1026
+ } else {
1027
+ i++;
1028
+ }
1029
+ }
1030
+ }
1031
+
1032
+ // Parses the --- and +++ headers, if none are found, no lines
1033
+ // are consumed.
1034
+ function parseFileHeader(index) {
1035
+ var headerPattern = /^(---|\+\+\+)\s+([\S ]*)(?:\t(.*?)\s*)?$/;
1036
+ var fileHeader = headerPattern.exec(diffstr[i]);
1037
+ if (fileHeader) {
1038
+ var keyPrefix = fileHeader[1] === '---' ? 'old' : 'new';
1039
+ var fileName = fileHeader[2].replace(/\\\\/g, '\\');
1040
+ if (/^".*"$/.test(fileName)) {
1041
+ fileName = fileName.substr(1, fileName.length - 2);
1042
+ }
1043
+ index[keyPrefix + 'FileName'] = fileName;
1044
+ index[keyPrefix + 'Header'] = fileHeader[3];
1045
+
1046
+ i++;
1047
+ }
1048
+ }
1049
+
1050
+ // Parses a hunk
1051
+ // This assumes that we are at the start of a hunk.
1052
+ function parseHunk() {
1053
+ var chunkHeaderIndex = i,
1054
+ chunkHeaderLine = diffstr[i++],
1055
+ chunkHeader = chunkHeaderLine.split(/@@ -(\d+)(?:,(\d+))? \+(\d+)(?:,(\d+))? @@/);
1056
+
1057
+ var hunk = {
1058
+ oldStart: +chunkHeader[1],
1059
+ oldLines: +chunkHeader[2] || 1,
1060
+ newStart: +chunkHeader[3],
1061
+ newLines: +chunkHeader[4] || 1,
1062
+ lines: [],
1063
+ linedelimiters: []
1064
+ };
1065
+
1066
+ var addCount = 0,
1067
+ removeCount = 0;
1068
+ for (; i < diffstr.length; i++) {
1069
+ // Lines starting with '---' could be mistaken for the "remove line" operation
1070
+ // But they could be the header for the next file. Therefore prune such cases out.
1071
+ if (diffstr[i].indexOf('--- ') === 0 && i + 2 < diffstr.length && diffstr[i + 1].indexOf('+++ ') === 0 && diffstr[i + 2].indexOf('@@') === 0) {
1072
+ break;
1073
+ }
1074
+ var operation = diffstr[i][0];
1075
+
1076
+ if (operation === '+' || operation === '-' || operation === ' ' || operation === '\\') {
1077
+ hunk.lines.push(diffstr[i]);
1078
+ hunk.linedelimiters.push(delimiters[i] || '\n');
1079
+
1080
+ if (operation === '+') {
1081
+ addCount++;
1082
+ } else if (operation === '-') {
1083
+ removeCount++;
1084
+ } else if (operation === ' ') {
1085
+ addCount++;
1086
+ removeCount++;
1087
+ }
1088
+ } else {
1089
+ break;
1090
+ }
1091
+ }
1092
+
1093
+ // Handle the empty block count case
1094
+ if (!addCount && hunk.newLines === 1) {
1095
+ hunk.newLines = 0;
1096
+ }
1097
+ if (!removeCount && hunk.oldLines === 1) {
1098
+ hunk.oldLines = 0;
1099
+ }
1100
+
1101
+ // Perform optional sanity checking
1102
+ if (options.strict) {
1103
+ if (addCount !== hunk.newLines) {
1104
+ throw new Error('Added line count did not match for hunk at line ' + (chunkHeaderIndex + 1));
1105
+ }
1106
+ if (removeCount !== hunk.oldLines) {
1107
+ throw new Error('Removed line count did not match for hunk at line ' + (chunkHeaderIndex + 1));
1108
+ }
1109
+ }
1110
+
1111
+ return hunk;
1112
+ }
1113
+
1114
+ while (i < diffstr.length) {
1115
+ parseIndex();
1116
+ }
1117
+
1118
+ return list;
1119
+ }
1120
+ //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4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KztcbiAgICAgICAgICByZW1vdmVDb3VudCsrO1xuICAgICAgICB9XG4gICAgICB9IGVsc2Uge1xuICAgICAgICBicmVhaztcbiAgICAgIH1cbiAgICB9XG5cbiAgICAvLyBIYW5kbGUgdGhlIGVtcHR5IGJsb2NrIGNvdW50IGNhc2VcbiAgICBpZiAoIWFkZENvdW50ICYmIGh1bmsubmV3TGluZXMgPT09IDEpIHtcbiAgICAgIGh1bmsubmV3TGluZXMgPSAwO1xuICAgIH1cbiAgICBpZiAoIXJlbW92ZUNvdW50ICYmIGh1bmsub2xkTGluZXMgPT09IDEpIHtcbiAgICAgIGh1bmsub2xkTGluZXMgPSAwO1xuICAgIH1cblxuICAgIC8vIFBlcmZvcm0gb3B0aW9uYWwgc2FuaXR5IGNoZWNraW5nXG4gICAgaWYgKG9wdGlvbnMuc3RyaWN0KSB7XG4gICAgICBpZiAoYWRkQ291bnQgIT09IGh1bmsubmV3TGluZXMpIHtcbiAgICAgICAgdGhyb3cgbmV3IEVycm9yKCdBZGRlZCBsaW5lIGNvdW50IGRpZCBub3QgbWF0Y2ggZm9yIGh1bmsgYXQgbGluZSAnICsgKGNodW5rSGVhZGVySW5kZXggKyAxKSk7XG4gICAgICB9XG4gICAgICBpZiAocmVtb3ZlQ291bnQgIT09IGh1bmsub2xkTGluZXMpIHtcbiAgICAgICAgdGhyb3cgbmV3IEVycm9yKCdSZW1vdmVkIGxpbmUgY291bnQgZGlkIG5vdCBtYXRjaCBmb3IgaHVuayBhdCBsaW5lICcgKyAoY2h1bmtIZWFkZXJJbmRleCArIDEpKTtcbiAgICAgIH1cbiAgICB9XG5cbiAgICByZXR1cm4gaHVuaztcbiAgfVxuXG4gIHdoaWxlIChpIDwgZGlmZnN0ci5sZW5ndGgpIHtcbiAgICBwYXJzZUluZGV4KCk7XG4gIH1cblxuICByZXR1cm4gbGlzdDtcbn1cbiJdfQ==
1121
+
1122
+
1123
+ /***/ }),
1124
+ /* 12 */
1125
+ /***/ (function(module, exports) {
1126
+
1127
+ /*istanbul ignore start*/"use strict";
1128
+
1129
+ exports.__esModule = true;
1130
+
1131
+ exports["default"] = /*istanbul ignore end*/function (start, minLine, maxLine) {
1132
+ var wantForward = true,
1133
+ backwardExhausted = false,
1134
+ forwardExhausted = false,
1135
+ localOffset = 1;
1136
+
1137
+ return function iterator() {
1138
+ if (wantForward && !forwardExhausted) {
1139
+ if (backwardExhausted) {
1140
+ localOffset++;
1141
+ } else {
1142
+ wantForward = false;
1143
+ }
1144
+
1145
+ // Check if trying to fit beyond text length, and if not, check it fits
1146
+ // after offset location (or desired location on first iteration)
1147
+ if (start + localOffset <= maxLine) {
1148
+ return localOffset;
1149
+ }
1150
+
1151
+ forwardExhausted = true;
1152
+ }
1153
+
1154
+ if (!backwardExhausted) {
1155
+ if (!forwardExhausted) {
1156
+ wantForward = true;
1157
+ }
1158
+
1159
+ // Check if trying to fit before text beginning, and if not, check it fits
1160
+ // before offset location
1161
+ if (minLine <= start - localOffset) {
1162
+ return -localOffset++;
1163
+ }
1164
+
1165
+ backwardExhausted = true;
1166
+ return iterator();
1167
+ }
1168
+
1169
+ // We tried to fit hunk before text beginning and beyond text length, then
1170
+ // hunk can't fit on the text. Return undefined
1171
+ };
1172
+ };
1173
+ //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy91dGlsL2Rpc3RhbmNlLWl0ZXJhdG9yLmpzIl0sIm5hbWVzIjpbInN0YXJ0IiwibWluTGluZSIsIm1heExpbmUiLCJ3YW50Rm9yd2FyZCIsImJhY2t3YXJkRXhoYXVzdGVkIiwiZm9yd2FyZEV4aGF1c3RlZCIsImxvY2FsT2Zmc2V0IiwiaXRlcmF0b3IiXSwibWFwcGluZ3MiOiI7Ozs7NENBR2UsVUFBU0EsS0FBVCxFQUFnQkMsT0FBaEIsRUFBeUJDLE9BQXpCLEVBQWtDO0FBQy9DLE1BQUlDLGNBQWMsSUFBbEI7QUFBQSxN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XQgbG9jYXRpb25cbiAgICAgIGlmIChtaW5MaW5lIDw9IHN0YXJ0IC0gbG9jYWxPZmZzZXQpIHtcbiAgICAgICAgcmV0dXJuIC1sb2NhbE9mZnNldCsrO1xuICAgICAgfVxuXG4gICAgICBiYWNrd2FyZEV4aGF1c3RlZCA9IHRydWU7XG4gICAgICByZXR1cm4gaXRlcmF0b3IoKTtcbiAgICB9XG5cbiAgICAvLyBXZSB0cmllZCB0byBmaXQgaHVuayBiZWZvcmUgdGV4dCBiZWdpbm5pbmcgYW5kIGJleW9uZCB0ZXh0IGxlbmd0aCwgdGhlblxuICAgIC8vIGh1bmsgY2FuJ3QgZml0IG9uIHRoZSB0ZXh0LiBSZXR1cm4gdW5kZWZpbmVkXG4gIH07XG59XG4iXX0=
1174
+
1175
+
1176
+ /***/ }),
1177
+ /* 13 */
1178
+ /***/ (function(module, exports, __webpack_require__) {
1179
+
1180
+ /*istanbul ignore start*/'use strict';
1181
+
1182
+ exports.__esModule = true;
1183
+ exports. /*istanbul ignore end*/calcLineCount = calcLineCount;
1184
+ /*istanbul ignore start*/exports. /*istanbul ignore end*/merge = merge;
1185
+
1186
+ var /*istanbul ignore start*/_create = __webpack_require__(14) /*istanbul ignore end*/;
1187
+
1188
+ var /*istanbul ignore start*/_parse = __webpack_require__(11) /*istanbul ignore end*/;
1189
+
1190
+ var /*istanbul ignore start*/_array = __webpack_require__(15) /*istanbul ignore end*/;
1191
+
1192
+ /*istanbul ignore start*/function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }
1193
+
1194
+ /*istanbul ignore end*/function calcLineCount(hunk) {
1195
+ /*istanbul ignore start*/var _calcOldNewLineCount = /*istanbul ignore end*/calcOldNewLineCount(hunk.lines),
1196
+ oldLines = _calcOldNewLineCount.oldLines,
1197
+ newLines = _calcOldNewLineCount.newLines;
1198
+
1199
+ if (oldLines !== undefined) {
1200
+ hunk.oldLines = oldLines;
1201
+ } else {
1202
+ delete hunk.oldLines;
1203
+ }
1204
+
1205
+ if (newLines !== undefined) {
1206
+ hunk.newLines = newLines;
1207
+ } else {
1208
+ delete hunk.newLines;
1209
+ }
1210
+ }
1211
+
1212
+ function merge(mine, theirs, base) {
1213
+ mine = loadPatch(mine, base);
1214
+ theirs = loadPatch(theirs, base);
1215
+
1216
+ var ret = {};
1217
+
1218
+ // For index we just let it pass through as it doesn't have any necessary meaning.
1219
+ // Leaving sanity checks on this to the API consumer that may know more about the
1220
+ // meaning in their own context.
1221
+ if (mine.index || theirs.index) {
1222
+ ret.index = mine.index || theirs.index;
1223
+ }
1224
+
1225
+ if (mine.newFileName || theirs.newFileName) {
1226
+ if (!fileNameChanged(mine)) {
1227
+ // No header or no change in ours, use theirs (and ours if theirs does not exist)
1228
+ ret.oldFileName = theirs.oldFileName || mine.oldFileName;
1229
+ ret.newFileName = theirs.newFileName || mine.newFileName;
1230
+ ret.oldHeader = theirs.oldHeader || mine.oldHeader;
1231
+ ret.newHeader = theirs.newHeader || mine.newHeader;
1232
+ } else if (!fileNameChanged(theirs)) {
1233
+ // No header or no change in theirs, use ours
1234
+ ret.oldFileName = mine.oldFileName;
1235
+ ret.newFileName = mine.newFileName;
1236
+ ret.oldHeader = mine.oldHeader;
1237
+ ret.newHeader = mine.newHeader;
1238
+ } else {
1239
+ // Both changed... figure it out
1240
+ ret.oldFileName = selectField(ret, mine.oldFileName, theirs.oldFileName);
1241
+ ret.newFileName = selectField(ret, mine.newFileName, theirs.newFileName);
1242
+ ret.oldHeader = selectField(ret, mine.oldHeader, theirs.oldHeader);
1243
+ ret.newHeader = selectField(ret, mine.newHeader, theirs.newHeader);
1244
+ }
1245
+ }
1246
+
1247
+ ret.hunks = [];
1248
+
1249
+ var mineIndex = 0,
1250
+ theirsIndex = 0,
1251
+ mineOffset = 0,
1252
+ theirsOffset = 0;
1253
+
1254
+ while (mineIndex < mine.hunks.length || theirsIndex < theirs.hunks.length) {
1255
+ var mineCurrent = mine.hunks[mineIndex] || { oldStart: Infinity },
1256
+ theirsCurrent = theirs.hunks[theirsIndex] || { oldStart: Infinity };
1257
+
1258
+ if (hunkBefore(mineCurrent, theirsCurrent)) {
1259
+ // This patch does not overlap with any of the others, yay.
1260
+ ret.hunks.push(cloneHunk(mineCurrent, mineOffset));
1261
+ mineIndex++;
1262
+ theirsOffset += mineCurrent.newLines - mineCurrent.oldLines;
1263
+ } else if (hunkBefore(theirsCurrent, mineCurrent)) {
1264
+ // This patch does not overlap with any of the others, yay.
1265
+ ret.hunks.push(cloneHunk(theirsCurrent, theirsOffset));
1266
+ theirsIndex++;
1267
+ mineOffset += theirsCurrent.newLines - theirsCurrent.oldLines;
1268
+ } else {
1269
+ // Overlap, merge as best we can
1270
+ var mergedHunk = {
1271
+ oldStart: Math.min(mineCurrent.oldStart, theirsCurrent.oldStart),
1272
+ oldLines: 0,
1273
+ newStart: Math.min(mineCurrent.newStart + mineOffset, theirsCurrent.oldStart + theirsOffset),
1274
+ newLines: 0,
1275
+ lines: []
1276
+ };
1277
+ mergeLines(mergedHunk, mineCurrent.oldStart, mineCurrent.lines, theirsCurrent.oldStart, theirsCurrent.lines);
1278
+ theirsIndex++;
1279
+ mineIndex++;
1280
+
1281
+ ret.hunks.push(mergedHunk);
1282
+ }
1283
+ }
1284
+
1285
+ return ret;
1286
+ }
1287
+
1288
+ function loadPatch(param, base) {
1289
+ if (typeof param === 'string') {
1290
+ if (/^@@/m.test(param) || /^Index:/m.test(param)) {
1291
+ return (/*istanbul ignore start*/(0, _parse.parsePatch) /*istanbul ignore end*/(param)[0]
1292
+ );
1293
+ }
1294
+
1295
+ if (!base) {
1296
+ throw new Error('Must provide a base reference or pass in a patch');
1297
+ }
1298
+ return (/*istanbul ignore start*/(0, _create.structuredPatch) /*istanbul ignore end*/(undefined, undefined, base, param)
1299
+ );
1300
+ }
1301
+
1302
+ return param;
1303
+ }
1304
+
1305
+ function fileNameChanged(patch) {
1306
+ return patch.newFileName && patch.newFileName !== patch.oldFileName;
1307
+ }
1308
+
1309
+ function selectField(index, mine, theirs) {
1310
+ if (mine === theirs) {
1311
+ return mine;
1312
+ } else {
1313
+ index.conflict = true;
1314
+ return { mine: mine, theirs: theirs };
1315
+ }
1316
+ }
1317
+
1318
+ function hunkBefore(test, check) {
1319
+ return test.oldStart < check.oldStart && test.oldStart + test.oldLines < check.oldStart;
1320
+ }
1321
+
1322
+ function cloneHunk(hunk, offset) {
1323
+ return {
1324
+ oldStart: hunk.oldStart, oldLines: hunk.oldLines,
1325
+ newStart: hunk.newStart + offset, newLines: hunk.newLines,
1326
+ lines: hunk.lines
1327
+ };
1328
+ }
1329
+
1330
+ function mergeLines(hunk, mineOffset, mineLines, theirOffset, theirLines) {
1331
+ // This will generally result in a conflicted hunk, but there are cases where the context
1332
+ // is the only overlap where we can successfully merge the content here.
1333
+ var mine = { offset: mineOffset, lines: mineLines, index: 0 },
1334
+ their = { offset: theirOffset, lines: theirLines, index: 0 };
1335
+
1336
+ // Handle any leading content
1337
+ insertLeading(hunk, mine, their);
1338
+ insertLeading(hunk, their, mine);
1339
+
1340
+ // Now in the overlap content. Scan through and select the best changes from each.
1341
+ while (mine.index < mine.lines.length && their.index < their.lines.length) {
1342
+ var mineCurrent = mine.lines[mine.index],
1343
+ theirCurrent = their.lines[their.index];
1344
+
1345
+ if ((mineCurrent[0] === '-' || mineCurrent[0] === '+') && (theirCurrent[0] === '-' || theirCurrent[0] === '+')) {
1346
+ // Both modified ...
1347
+ mutualChange(hunk, mine, their);
1348
+ } else if (mineCurrent[0] === '+' && theirCurrent[0] === ' ') {
1349
+ /*istanbul ignore start*/var _hunk$lines;
1350
+
1351
+ /*istanbul ignore end*/ // Mine inserted
1352
+ /*istanbul ignore start*/(_hunk$lines = /*istanbul ignore end*/hunk.lines).push. /*istanbul ignore start*/apply /*istanbul ignore end*/( /*istanbul ignore start*/_hunk$lines /*istanbul ignore end*/, /*istanbul ignore start*/_toConsumableArray( /*istanbul ignore end*/collectChange(mine)));
1353
+ } else if (theirCurrent[0] === '+' && mineCurrent[0] === ' ') {
1354
+ /*istanbul ignore start*/var _hunk$lines2;
1355
+
1356
+ /*istanbul ignore end*/ // Theirs inserted
1357
+ /*istanbul ignore start*/(_hunk$lines2 = /*istanbul ignore end*/hunk.lines).push. /*istanbul ignore start*/apply /*istanbul ignore end*/( /*istanbul ignore start*/_hunk$lines2 /*istanbul ignore end*/, /*istanbul ignore start*/_toConsumableArray( /*istanbul ignore end*/collectChange(their)));
1358
+ } else if (mineCurrent[0] === '-' && theirCurrent[0] === ' ') {
1359
+ // Mine removed or edited
1360
+ removal(hunk, mine, their);
1361
+ } else if (theirCurrent[0] === '-' && mineCurrent[0] === ' ') {
1362
+ // Their removed or edited
1363
+ removal(hunk, their, mine, true);
1364
+ } else if (mineCurrent === theirCurrent) {
1365
+ // Context identity
1366
+ hunk.lines.push(mineCurrent);
1367
+ mine.index++;
1368
+ their.index++;
1369
+ } else {
1370
+ // Context mismatch
1371
+ conflict(hunk, collectChange(mine), collectChange(their));
1372
+ }
1373
+ }
1374
+
1375
+ // Now push anything that may be remaining
1376
+ insertTrailing(hunk, mine);
1377
+ insertTrailing(hunk, their);
1378
+
1379
+ calcLineCount(hunk);
1380
+ }
1381
+
1382
+ function mutualChange(hunk, mine, their) {
1383
+ var myChanges = collectChange(mine),
1384
+ theirChanges = collectChange(their);
1385
+
1386
+ if (allRemoves(myChanges) && allRemoves(theirChanges)) {
1387
+ // Special case for remove changes that are supersets of one another
1388
+ if ( /*istanbul ignore start*/(0, _array.arrayStartsWith) /*istanbul ignore end*/(myChanges, theirChanges) && skipRemoveSuperset(their, myChanges, myChanges.length - theirChanges.length)) {
1389
+ /*istanbul ignore start*/var _hunk$lines3;
1390
+
1391
+ /*istanbul ignore end*/ /*istanbul ignore start*/(_hunk$lines3 = /*istanbul ignore end*/hunk.lines).push. /*istanbul ignore start*/apply /*istanbul ignore end*/( /*istanbul ignore start*/_hunk$lines3 /*istanbul ignore end*/, /*istanbul ignore start*/_toConsumableArray( /*istanbul ignore end*/myChanges));
1392
+ return;
1393
+ } else if ( /*istanbul ignore start*/(0, _array.arrayStartsWith) /*istanbul ignore end*/(theirChanges, myChanges) && skipRemoveSuperset(mine, theirChanges, theirChanges.length - myChanges.length)) {
1394
+ /*istanbul ignore start*/var _hunk$lines4;
1395
+
1396
+ /*istanbul ignore end*/ /*istanbul ignore start*/(_hunk$lines4 = /*istanbul ignore end*/hunk.lines).push. /*istanbul ignore start*/apply /*istanbul ignore end*/( /*istanbul ignore start*/_hunk$lines4 /*istanbul ignore end*/, /*istanbul ignore start*/_toConsumableArray( /*istanbul ignore end*/theirChanges));
1397
+ return;
1398
+ }
1399
+ } else if ( /*istanbul ignore start*/(0, _array.arrayEqual) /*istanbul ignore end*/(myChanges, theirChanges)) {
1400
+ /*istanbul ignore start*/var _hunk$lines5;
1401
+
1402
+ /*istanbul ignore end*/ /*istanbul ignore start*/(_hunk$lines5 = /*istanbul ignore end*/hunk.lines).push. /*istanbul ignore start*/apply /*istanbul ignore end*/( /*istanbul ignore start*/_hunk$lines5 /*istanbul ignore end*/, /*istanbul ignore start*/_toConsumableArray( /*istanbul ignore end*/myChanges));
1403
+ return;
1404
+ }
1405
+
1406
+ conflict(hunk, myChanges, theirChanges);
1407
+ }
1408
+
1409
+ function removal(hunk, mine, their, swap) {
1410
+ var myChanges = collectChange(mine),
1411
+ theirChanges = collectContext(their, myChanges);
1412
+ if (theirChanges.merged) {
1413
+ /*istanbul ignore start*/var _hunk$lines6;
1414
+
1415
+ /*istanbul ignore end*/ /*istanbul ignore start*/(_hunk$lines6 = /*istanbul ignore end*/hunk.lines).push. /*istanbul ignore start*/apply /*istanbul ignore end*/( /*istanbul ignore start*/_hunk$lines6 /*istanbul ignore end*/, /*istanbul ignore start*/_toConsumableArray( /*istanbul ignore end*/theirChanges.merged));
1416
+ } else {
1417
+ conflict(hunk, swap ? theirChanges : myChanges, swap ? myChanges : theirChanges);
1418
+ }
1419
+ }
1420
+
1421
+ function conflict(hunk, mine, their) {
1422
+ hunk.conflict = true;
1423
+ hunk.lines.push({
1424
+ conflict: true,
1425
+ mine: mine,
1426
+ theirs: their
1427
+ });
1428
+ }
1429
+
1430
+ function insertLeading(hunk, insert, their) {
1431
+ while (insert.offset < their.offset && insert.index < insert.lines.length) {
1432
+ var line = insert.lines[insert.index++];
1433
+ hunk.lines.push(line);
1434
+ insert.offset++;
1435
+ }
1436
+ }
1437
+ function insertTrailing(hunk, insert) {
1438
+ while (insert.index < insert.lines.length) {
1439
+ var line = insert.lines[insert.index++];
1440
+ hunk.lines.push(line);
1441
+ }
1442
+ }
1443
+
1444
+ function collectChange(state) {
1445
+ var ret = [],
1446
+ operation = state.lines[state.index][0];
1447
+ while (state.index < state.lines.length) {
1448
+ var line = state.lines[state.index];
1449
+
1450
+ // Group additions that are immediately after subtractions and treat them as one "atomic" modify change.
1451
+ if (operation === '-' && line[0] === '+') {
1452
+ operation = '+';
1453
+ }
1454
+
1455
+ if (operation === line[0]) {
1456
+ ret.push(line);
1457
+ state.index++;
1458
+ } else {
1459
+ break;
1460
+ }
1461
+ }
1462
+
1463
+ return ret;
1464
+ }
1465
+ function collectContext(state, matchChanges) {
1466
+ var changes = [],
1467
+ merged = [],
1468
+ matchIndex = 0,
1469
+ contextChanges = false,
1470
+ conflicted = false;
1471
+ while (matchIndex < matchChanges.length && state.index < state.lines.length) {
1472
+ var change = state.lines[state.index],
1473
+ match = matchChanges[matchIndex];
1474
+
1475
+ // Once we've hit our add, then we are done
1476
+ if (match[0] === '+') {
1477
+ break;
1478
+ }
1479
+
1480
+ contextChanges = contextChanges || change[0] !== ' ';
1481
+
1482
+ merged.push(match);
1483
+ matchIndex++;
1484
+
1485
+ // Consume any additions in the other block as a conflict to attempt
1486
+ // to pull in the remaining context after this
1487
+ if (change[0] === '+') {
1488
+ conflicted = true;
1489
+
1490
+ while (change[0] === '+') {
1491
+ changes.push(change);
1492
+ change = state.lines[++state.index];
1493
+ }
1494
+ }
1495
+
1496
+ if (match.substr(1) === change.substr(1)) {
1497
+ changes.push(change);
1498
+ state.index++;
1499
+ } else {
1500
+ conflicted = true;
1501
+ }
1502
+ }
1503
+
1504
+ if ((matchChanges[matchIndex] || '')[0] === '+' && contextChanges) {
1505
+ conflicted = true;
1506
+ }
1507
+
1508
+ if (conflicted) {
1509
+ return changes;
1510
+ }
1511
+
1512
+ while (matchIndex < matchChanges.length) {
1513
+ merged.push(matchChanges[matchIndex++]);
1514
+ }
1515
+
1516
+ return {
1517
+ merged: merged,
1518
+ changes: changes
1519
+ };
1520
+ }
1521
+
1522
+ function allRemoves(changes) {
1523
+ return changes.reduce(function (prev, change) {
1524
+ return prev && change[0] === '-';
1525
+ }, true);
1526
+ }
1527
+ function skipRemoveSuperset(state, removeChanges, delta) {
1528
+ for (var i = 0; i < delta; i++) {
1529
+ var changeContent = removeChanges[removeChanges.length - delta + i].substr(1);
1530
+ if (state.lines[state.index + i] !== ' ' + changeContent) {
1531
+ return false;
1532
+ }
1533
+ }
1534
+
1535
+ state.index += delta;
1536
+ return true;
1537
+ }
1538
+
1539
+ function calcOldNewLineCount(lines) {
1540
+ var oldLines = 0;
1541
+ var newLines = 0;
1542
+
1543
+ lines.forEach(function (line) {
1544
+ if (typeof line !== 'string') {
1545
+ var myCount = calcOldNewLineCount(line.mine);
1546
+ var theirCount = calcOldNewLineCount(line.theirs);
1547
+
1548
+ if (oldLines !== undefined) {
1549
+ if (myCount.oldLines === theirCount.oldLines) {
1550
+ oldLines += myCount.oldLines;
1551
+ } else {
1552
+ oldLines = undefined;
1553
+ }
1554
+ }
1555
+
1556
+ if (newLines !== undefined) {
1557
+ if (myCount.newLines === theirCount.newLines) {
1558
+ newLines += myCount.newLines;
1559
+ } else {
1560
+ newLines = undefined;
1561
+ }
1562
+ }
1563
+ } else {
1564
+ if (newLines !== undefined && (line[0] === '+' || line[0] === ' ')) {
1565
+ newLines++;
1566
+ }
1567
+ if (oldLines !== undefined && (line[0] === '-' || line[0] === ' ')) {
1568
+ oldLines++;
1569
+ }
1570
+ }
1571
+ });
1572
+
1573
+ return { oldLines: oldLines, newLines: newLines };
1574
+ }
1575
+ //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9wYXRjaC9tZXJnZS5qcyJdLCJuYW1lcyI6WyJjYWxjTGluZUNvdW50IiwibWVyZ2UiLCJodW5rIiwiY2FsY09sZE5ld0xpbmVDb3VudCIsImxpbmVzIiwib2xkTGluZXMiLCJuZXdMaW5lcyIsInVuZGVmaW5lZCIsIm1pbmUiLCJ0aGVpcnMiLCJiYXNlIiwibG9hZFBhdGNoIiwicmV0IiwiaW5kZXgiLCJuZXdGaWxlTmFtZSIsImZpbGVOYW1lQ2hhbmdlZCIsIm9sZEZpbGVOYW1lIiwib2xkSGVhZGVyIiwibmV3SGVhZGVyIiwic2VsZWN0RmllbGQiLCJodW5rcyIsIm1pbmVJbmRleCIsInRoZWlyc0luZGV4IiwibWluZU9mZnNldCIsInRoZWlyc09mZnNldCIsImxlbmd0aCIsIm1pbmVDdXJyZW50Iiwib2xkU3RhcnQiLCJJbmZpbml0eSIsInRoZWlyc0N1cnJlbnQiLCJodW5rQmVmb3JlIiwicHVzaCIsImNsb25lSHVuayIsIm1lcmdlZEh1bmsiLCJNYXRoIiwibWluIiwibmV3U3RhcnQiLCJtZXJnZUxpbmVzIiwicGFyYW0iLCJ0ZXN0IiwiRXJyb3IiLCJwYXRjaCIsImNvbmZsaWN0IiwiY2hlY2siLCJvZmZzZXQiLCJtaW5lTGluZXMiLCJ0aGVpck9mZnNldCIsInRoZWlyTGluZXMiLCJ0aGVpciIsImluc2VydExlYWRpbmciLCJ0aGVpckN1cnJlbnQiLCJtdXR1YWxDaGFuZ2UiLCJjb2xsZWN0Q2hhbmdlIiwicmVtb3ZhbCIsImluc2VydFRyYWlsaW5nIiwibXlDaGFuZ2VzIiwidGhlaXJDaGFuZ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iAoc3RhdGUubGluZXNbc3RhdGUuaW5kZXggKyBpXSAhPT0gJyAnICsgY2hhbmdlQ29udGVudCkge1xuICAgICAgcmV0dXJuIGZhbHNlO1xuICAgIH1cbiAgfVxuXG4gIHN0YXRlLmluZGV4ICs9IGRlbHRhO1xuICByZXR1cm4gdHJ1ZTtcbn1cblxuZnVuY3Rpb24gY2FsY09sZE5ld0xpbmVDb3VudChsaW5lcykge1xuICBsZXQgb2xkTGluZXMgPSAwO1xuICBsZXQgbmV3TGluZXMgPSAwO1xuXG4gIGxpbmVzLmZvckVhY2goZnVuY3Rpb24obGluZSkge1xuICAgIGlmICh0eXBlb2YgbGluZSAhPT0gJ3N0cmluZycpIHtcbiAgICAgIGxldCBteUNvdW50ID0gY2FsY09sZE5ld0xpbmVDb3VudChsaW5lLm1pbmUpO1xuICAgICAgbGV0IHRoZWlyQ291bnQgPSBjYWxjT2xkTmV3TGluZUNvdW50KGxpbmUudGhlaXJzKTtcblxuICAgICAgaWYgKG9sZExpbmVzICE9PSB1bmRlZmluZWQpIHtcbiAgICAgICAgaWYgKG15Q291bnQub2xkTGluZXMgPT09IHRoZWlyQ291bnQub2xkTGluZXMpIHtcbiAgICAgICAgICBvbGRMaW5lcyArPSBteUNvdW50Lm9sZExpbmVzO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgIG9sZExpbmVzID0gdW5kZWZpbmVkO1xuICAgICAgICB9XG4gICAgICB9XG5cbiAgICAgIGlmIChuZXdMaW5lcyAhPT0gdW5kZWZpbmVkKSB7XG4gICAgICAgIGlmIChteUNvdW50Lm5ld0xpbmVzID09PSB0aGVpckNvdW50Lm5ld0xpbmVzKSB7XG4gICAgICAgICAgbmV3TGluZXMgKz0gbXlDb3VudC5uZXdMaW5lcztcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICBuZXdMaW5lcyA9IHVuZGVmaW5lZDtcbiAgICAgICAgfVxuICAgICAgfVxuICAgIH0gZWxzZSB7XG4gICAgICBpZiAobmV3TGluZXMgIT09IHVuZGVmaW5lZCAmJiAobGluZVswXSA9PT0gJysnIHx8IGxpbmVbMF0gPT09ICcgJykpIHtcbiAgICAgICAgbmV3TGluZXMrKztcbiAgICAgIH1cbiAgICAgIGlmIChvbGRMaW5lcyAhPT0gdW5kZWZpbmVkICYmIChsaW5lWzBdID09PSAnLScgfHwgbGluZVswXSA9PT0gJyAnKSkge1xuICAgICAgICBvbGRMaW5lcysrO1xuICAgICAgfVxuICAgIH1cbiAgfSk7XG5cbiAgcmV0dXJuIHtvbGRMaW5lcywgbmV3TGluZXN9O1xufVxuIl19
1576
+
1577
+
1578
+ /***/ }),
1579
+ /* 14 */
1580
+ /***/ (function(module, exports, __webpack_require__) {
1581
+
1582
+ /*istanbul ignore start*/'use strict';
1583
+
1584
+ exports.__esModule = true;
1585
+ exports. /*istanbul ignore end*/structuredPatch = structuredPatch;
1586
+ /*istanbul ignore start*/exports. /*istanbul ignore end*/createTwoFilesPatch = createTwoFilesPatch;
1587
+ /*istanbul ignore start*/exports. /*istanbul ignore end*/createPatch = createPatch;
1588
+
1589
+ var /*istanbul ignore start*/_line = __webpack_require__(5) /*istanbul ignore end*/;
1590
+
1591
+ /*istanbul ignore start*/function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }
1592
+
1593
+ /*istanbul ignore end*/function structuredPatch(oldFileName, newFileName, oldStr, newStr, oldHeader, newHeader, options) {
1594
+ if (!options) {
1595
+ options = {};
1596
+ }
1597
+ if (typeof options.context === 'undefined') {
1598
+ options.context = 4;
1599
+ }
1600
+
1601
+ var diff = /*istanbul ignore start*/(0, _line.diffLines) /*istanbul ignore end*/(oldStr, newStr, options);
1602
+ diff.push({ value: '', lines: [] }); // Append an empty value to make cleanup easier
1603
+
1604
+ function contextLines(lines) {
1605
+ return lines.map(function (entry) {
1606
+ return ' ' + entry;
1607
+ });
1608
+ }
1609
+
1610
+ var hunks = [];
1611
+ var oldRangeStart = 0,
1612
+ newRangeStart = 0,
1613
+ curRange = [],
1614
+ oldLine = 1,
1615
+ newLine = 1;
1616
+
1617
+ /*istanbul ignore start*/var _loop = function _loop( /*istanbul ignore end*/i) {
1618
+ var current = diff[i],
1619
+ lines = current.lines || current.value.replace(/\n$/, '').split('\n');
1620
+ current.lines = lines;
1621
+
1622
+ if (current.added || current.removed) {
1623
+ /*istanbul ignore start*/var _curRange;
1624
+
1625
+ /*istanbul ignore end*/ // If we have previous context, start with that
1626
+ if (!oldRangeStart) {
1627
+ var prev = diff[i - 1];
1628
+ oldRangeStart = oldLine;
1629
+ newRangeStart = newLine;
1630
+
1631
+ if (prev) {
1632
+ curRange = options.context > 0 ? contextLines(prev.lines.slice(-options.context)) : [];
1633
+ oldRangeStart -= curRange.length;
1634
+ newRangeStart -= curRange.length;
1635
+ }
1636
+ }
1637
+
1638
+ // Output our changes
1639
+ /*istanbul ignore start*/(_curRange = /*istanbul ignore end*/curRange).push. /*istanbul ignore start*/apply /*istanbul ignore end*/( /*istanbul ignore start*/_curRange /*istanbul ignore end*/, /*istanbul ignore start*/_toConsumableArray( /*istanbul ignore end*/lines.map(function (entry) {
1640
+ return (current.added ? '+' : '-') + entry;
1641
+ })));
1642
+
1643
+ // Track the updated file position
1644
+ if (current.added) {
1645
+ newLine += lines.length;
1646
+ } else {
1647
+ oldLine += lines.length;
1648
+ }
1649
+ } else {
1650
+ // Identical context lines. Track line changes
1651
+ if (oldRangeStart) {
1652
+ // Close out any changes that have been output (or join overlapping)
1653
+ if (lines.length <= options.context * 2 && i < diff.length - 2) {
1654
+ /*istanbul ignore start*/var _curRange2;
1655
+
1656
+ /*istanbul ignore end*/ // Overlapping
1657
+ /*istanbul ignore start*/(_curRange2 = /*istanbul ignore end*/curRange).push. /*istanbul ignore start*/apply /*istanbul ignore end*/( /*istanbul ignore start*/_curRange2 /*istanbul ignore end*/, /*istanbul ignore start*/_toConsumableArray( /*istanbul ignore end*/contextLines(lines)));
1658
+ } else {
1659
+ /*istanbul ignore start*/var _curRange3;
1660
+
1661
+ /*istanbul ignore end*/ // end the range and output
1662
+ var contextSize = Math.min(lines.length, options.context);
1663
+ /*istanbul ignore start*/(_curRange3 = /*istanbul ignore end*/curRange).push. /*istanbul ignore start*/apply /*istanbul ignore end*/( /*istanbul ignore start*/_curRange3 /*istanbul ignore end*/, /*istanbul ignore start*/_toConsumableArray( /*istanbul ignore end*/contextLines(lines.slice(0, contextSize))));
1664
+
1665
+ var hunk = {
1666
+ oldStart: oldRangeStart,
1667
+ oldLines: oldLine - oldRangeStart + contextSize,
1668
+ newStart: newRangeStart,
1669
+ newLines: newLine - newRangeStart + contextSize,
1670
+ lines: curRange
1671
+ };
1672
+ if (i >= diff.length - 2 && lines.length <= options.context) {
1673
+ // EOF is inside this hunk
1674
+ var oldEOFNewline = /\n$/.test(oldStr);
1675
+ var newEOFNewline = /\n$/.test(newStr);
1676
+ if (lines.length == 0 && !oldEOFNewline) {
1677
+ // special case: old has no eol and no trailing context; no-nl can end up before adds
1678
+ curRange.splice(hunk.oldLines, 0, '\');
1679
+ } else if (!oldEOFNewline || !newEOFNewline) {
1680
+ curRange.push('\');
1681
+ }
1682
+ }
1683
+ hunks.push(hunk);
1684
+
1685
+ oldRangeStart = 0;
1686
+ newRangeStart = 0;
1687
+ curRange = [];
1688
+ }
1689
+ }
1690
+ oldLine += lines.length;
1691
+ newLine += lines.length;
1692
+ }
1693
+ };
1694
+
1695
+ for (var i = 0; i < diff.length; i++) {
1696
+ /*istanbul ignore start*/_loop( /*istanbul ignore end*/i);
1697
+ }
1698
+
1699
+ return {
1700
+ oldFileName: oldFileName, newFileName: newFileName,
1701
+ oldHeader: oldHeader, newHeader: newHeader,
1702
+ hunks: hunks
1703
+ };
1704
+ }
1705
+
1706
+ function createTwoFilesPatch(oldFileName, newFileName, oldStr, newStr, oldHeader, newHeader, options) {
1707
+ var diff = structuredPatch(oldFileName, newFileName, oldStr, newStr, oldHeader, newHeader, options);
1708
+
1709
+ var ret = [];
1710
+ if (oldFileName == newFileName) {
1711
+ ret.push('Index: ' + oldFileName);
1712
+ }
1713
+ ret.push('===================================================================');
1714
+ ret.push('--- ' + diff.oldFileName + (typeof diff.oldHeader === 'undefined' ? '' : '\t' + diff.oldHeader));
1715
+ ret.push('+++ ' + diff.newFileName + (typeof diff.newHeader === 'undefined' ? '' : '\t' + diff.newHeader));
1716
+
1717
+ for (var i = 0; i < diff.hunks.length; i++) {
1718
+ var hunk = diff.hunks[i];
1719
+ ret.push('@@ -' + hunk.oldStart + ',' + hunk.oldLines + ' +' + hunk.newStart + ',' + hunk.newLines + ' @@');
1720
+ ret.push.apply(ret, hunk.lines);
1721
+ }
1722
+
1723
+ return ret.join('\n') + '\n';
1724
+ }
1725
+
1726
+ function createPatch(fileName, oldStr, newStr, oldHeader, newHeader, options) {
1727
+ return createTwoFilesPatch(fileName, fileName, oldStr, newStr, oldHeader, newHeader, options);
1728
+ }
1729
+ //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9wYXRjaC9jcmVhdGUuanMiXSwibmFtZXMiOlsic3RydWN0dXJlZFBhdGNoIiwiY3JlYXRlVHdvRmlsZXNQYXRjaCIsImNyZWF0ZVBhdGNoIiwib2xkRmlsZU5hbWUiLCJuZXdGaWxlTmFtZSIsIm9sZFN0ciIsIm5ld1N0ciIsIm9sZEhlYWRlciIsIm5ld0hlYWRlciIsIm9wdGlvbnMiLCJjb250ZXh0IiwiZGlmZiIsInB1c2giLCJ2YWx1ZSIsImxpbmVzIiwiY29udGV4dExpbmVzIiwibWFwIiwiZW50cnkiLCJodW5rcyIsIm9sZFJhbmdlU3RhcnQiLCJuZXdSYW5nZVN0YXJ0IiwiY3VyUmFuZ2UiLCJvbGRMaW5lIiwibmV3TGluZSIsImkiLCJjdXJyZW50IiwicmVwbGFjZSIsInNwbGl0IiwiYWRkZWQiLCJy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***/ }),
1733
+ /* 15 */
1734
+ /***/ (function(module, exports) {
1735
+
1736
+ /*istanbul ignore start*/"use strict";
1737
+
1738
+ exports.__esModule = true;
1739
+ exports. /*istanbul ignore end*/arrayEqual = arrayEqual;
1740
+ /*istanbul ignore start*/exports. /*istanbul ignore end*/arrayStartsWith = arrayStartsWith;
1741
+ function arrayEqual(a, b) {
1742
+ if (a.length !== b.length) {
1743
+ return false;
1744
+ }
1745
+
1746
+ return arrayStartsWith(a, b);
1747
+ }
1748
+
1749
+ function arrayStartsWith(array, start) {
1750
+ if (start.length > array.length) {
1751
+ return false;
1752
+ }
1753
+
1754
+ for (var i = 0; i < start.length; i++) {
1755
+ if (start[i] !== array[i]) {
1756
+ return false;
1757
+ }
1758
+ }
1759
+
1760
+ return true;
1761
+ }
1762
+ //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy91dGlsL2FycmF5LmpzIl0sIm5hbWVzIjpbImFycmF5RXF1YWwiLCJhcnJheVN0YXJ0c1dpdGgiLCJhIiwiYiIsImxlbmd0aCIsImFycmF5Iiwic3RhcnQiLCJpIl0sIm1hcHBpbmdzIjoiOzs7Z0NBQWdCQSxVLEdBQUFBLFU7eURBUUFDLGUsR0FBQUEsZTtBQVJULFNBQVNELFVBQVQsQ0FBb0JFLENBQXBCLEVBQXVCQyxDQUF2QixFQUEwQjtBQUMvQixNQUFJRCxFQUFFRSxNQUFGLEtBQWFELEVBQUVDLE1BQW5CLEVBQTJCO0FBQ3pCLFdBQU8sS0FBUDtBQUNEOztBQUVELFNBQU9ILGdCQUFnQkMsQ0FBaEIsRUFBbUJDLENBQW5CLENBQVA7QUFDRDs7QUFFTSxTQUFTRixlQUFULENBQXlCSSxLQUF6QixFQUFnQ0MsS0FBaEMsRUFBdUM7QUFDNUMsTUFBSUEsTUFBTUYsTUFBTixHQUFlQyxNQUFNRCxNQUF6QixFQUFpQztBQUMvQixXQUFPLEtBQVA7QUFDRDs7QUFFRCxPQUFLLElBQUlHLElBQUksQ0FBYixFQUFnQkEsSUFBSUQsTUFBTUYsTUFBMUIsRUFBa0NHLEdBQWxDLEVBQXVDO0FBQ3JDLFFBQUlELE1BQU1DLENBQU4sTUFBYUYsTUFBTUUsQ0FBTixDQUFqQixFQUEyQjtBQUN6QixhQUFPLEtBQVA7QUFDRDtBQUNGOztBQUVELFNBQU8sSUFBUDtBQUNEIiwiZmlsZSI6ImFycmF5LmpzIiwic291cmNlc0NvbnRlbnQiOlsiZXhwb3J0IGZ1bmN0aW9uIGFycmF5RXF1YWwoYSwgYikge1xuICBpZiAoYS5sZW5ndGggIT09IGIubGVuZ3RoKSB7XG4gICAgcmV0dXJuIGZhbHNlO1xuICB9XG5cbiAgcmV0dXJuIGFycmF5U3RhcnRzV2l0aChhLCBiKTtcbn1cblxuZXhwb3J0IGZ1bmN0aW9uIGFycmF5U3RhcnRzV2l0aChhcnJheSwgc3RhcnQpIHtcbiAgaWYgKHN0YXJ0Lmxlbmd0aCA+IGFycmF5Lmxlbmd0aCkge1xuICAgIHJldHVybiBmYWxzZTtcbiAgfVxuXG4gIGZvciAobGV0IGkgPSAwOyBpIDwgc3RhcnQubGVuZ3RoOyBpKyspIHtcbiAgICBpZiAoc3RhcnRbaV0gIT09IGFycmF5W2ldKSB7XG4gICAgICByZXR1cm4gZmFsc2U7XG4gICAgfVxuICB9XG5cbiAgcmV0dXJuIHRydWU7XG59XG4iXX0=
1763
+
1764
+
1765
+ /***/ }),
1766
+ /* 16 */
1767
+ /***/ (function(module, exports) {
1768
+
1769
+ /*istanbul ignore start*/"use strict";
1770
+
1771
+ exports.__esModule = true;
1772
+ exports. /*istanbul ignore end*/convertChangesToDMP = convertChangesToDMP;
1773
+ // See: http://code.google.com/p/google-diff-match-patch/wiki/API
1774
+ function convertChangesToDMP(changes) {
1775
+ var ret = [],
1776
+ change = /*istanbul ignore start*/void 0 /*istanbul ignore end*/,
1777
+ operation = /*istanbul ignore start*/void 0 /*istanbul ignore end*/;
1778
+ for (var i = 0; i < changes.length; i++) {
1779
+ change = changes[i];
1780
+ if (change.added) {
1781
+ operation = 1;
1782
+ } else if (change.removed) {
1783
+ operation = -1;
1784
+ } else {
1785
+ operation = 0;
1786
+ }
1787
+
1788
+ ret.push([operation, change.value]);
1789
+ }
1790
+ return ret;
1791
+ }
1792
+ //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9jb252ZXJ0L2RtcC5qcyJdLCJuYW1lcyI6WyJjb252ZXJ0Q2hhbmdlc1RvRE1QIiwiY2hhbmdlcyIsInJldCIsImNoYW5nZSIsIm9wZXJhdGlvbiIsImkiLCJsZW5ndGgiLCJhZGRlZCIsInJlbW92ZWQiLCJwdXNoIiwidmFsdWUiXSwibWFwcGluZ3MiOiI7OztnQ0FDZ0JBLG1CLEdBQUFBLG1CO0FBRGhCO0FBQ08sU0FBU0EsbUJBQVQsQ0FBNkJDLE9BQTdCLEVBQXNDO0FBQzNDLE1BQUlDLE1BQU0sRUFBVjtBQUFBLE1BQ0lDLHdDQURKO0FBQUEsTUFFSUMsMkNBRko7QUFHQSxPQUFLLElBQUlDLElBQUksQ0FBYixFQUFnQkEsSUFBSUosUUFBUUssTUFBNUIsRUFBb0NELEdBQXBDLEVBQXlDO0FBQ3ZDRixhQUFTRixRQUFRSSxDQUFSLENBQVQ7QUFDQSxRQUFJRixPQUFPSSxLQUFYLEVBQWtCO0FBQ2hCSCxrQkFBWSxDQUFaO0FBQ0QsS0FGRCxNQUVPLElBQUlELE9BQU9LLE9BQVgsRUFBb0I7QUFDekJKLGtCQUFZLENBQUMsQ0FBYjtBQUNELEtBRk0sTUFFQTtBQUNMQSxrQkFBWSxDQUFaO0FBQ0Q7O0FBRURGLFFBQUlPLElBQUosQ0FBUyxDQUFDTCxTQUFELEVBQVlELE9BQU9PLEtBQW5CLENBQVQ7QUFDRDtBQUNELFNBQU9SLEdBQVA7QUFDRCIsImZpbGUiOiJkbXAuanMiLCJzb3VyY2VzQ29udGVudCI6WyIvLyBTZWU6IGh0dHA6Ly9jb2RlLmdvb2dsZS5jb20vcC9nb29nbGUtZGlmZi1tYXRjaC1wYXRjaC93aWtpL0FQSVxuZXhwb3J0IGZ1bmN0aW9uIGNvbnZlcnRDaGFuZ2VzVG9ETVAoY2hhbmdlcykge1xuICBsZXQgcmV0ID0gW10sXG4gICAgICBjaGFuZ2UsXG4gICAgICBvcGVyYXRpb247XG4gIGZvciAobGV0IGkgPSAwOyBpIDwgY2hhbmdlcy5sZW5ndGg7IGkrKykge1xuICAgIGNoYW5nZSA9IGNoYW5nZXNbaV07XG4gICAgaWYgKGNoYW5nZS5hZGRlZCkge1xuICAgICAgb3BlcmF0aW9uID0gMTtcbiAgICB9IGVsc2UgaWYgKGNoYW5nZS5yZW1vdmVkKSB7XG4gICAgICBvcGVyYXRpb24gPSAtMTtcbiAgICB9IGVsc2Uge1xuICAgICAgb3BlcmF0aW9uID0gMDtcbiAgICB9XG5cbiAgICByZXQucHVzaChbb3BlcmF0aW9uLCBjaGFuZ2UudmFsdWVdKTtcbiAgfVxuICByZXR1cm4gcmV0O1xufVxuIl19
1793
+
1794
+
1795
+ /***/ }),
1796
+ /* 17 */
1797
+ /***/ (function(module, exports) {
1798
+
1799
+ /*istanbul ignore start*/'use strict';
1800
+
1801
+ exports.__esModule = true;
1802
+ exports. /*istanbul ignore end*/convertChangesToXML = convertChangesToXML;
1803
+ function convertChangesToXML(changes) {
1804
+ var ret = [];
1805
+ for (var i = 0; i < changes.length; i++) {
1806
+ var change = changes[i];
1807
+ if (change.added) {
1808
+ ret.push('<ins>');
1809
+ } else if (change.removed) {
1810
+ ret.push('<del>');
1811
+ }
1812
+
1813
+ ret.push(escapeHTML(change.value));
1814
+
1815
+ if (change.added) {
1816
+ ret.push('</ins>');
1817
+ } else if (change.removed) {
1818
+ ret.push('</del>');
1819
+ }
1820
+ }
1821
+ return ret.join('');
1822
+ }
1823
+
1824
+ function escapeHTML(s) {
1825
+ var n = s;
1826
+ n = n.replace(/&/g, '&amp;');
1827
+ n = n.replace(/</g, '&lt;');
1828
+ n = n.replace(/>/g, '&gt;');
1829
+ n = n.replace(/"/g, '&quot;');
1830
+
1831
+ return n;
1832
+ }
1833
+ //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9jb252ZXJ0L3htbC5qcyJdLCJuYW1lcyI6WyJjb252ZXJ0Q2hhbmdlc1RvWE1MIiwiY2hhbmdlcyIsInJldCIsImkiLCJsZW5ndGgiLCJjaGFuZ2UiLCJhZGRlZCIsInB1c2giLCJyZW1vdmVkIiwiZXNjYXBlSFRNTCIsInZhbHVlIiwiam9pbiIsInMiLCJuIiwicmVwbGFjZSJdLCJtYXBwaW5ncyI6Ijs7O2dDQUFnQkEsbUIsR0FBQUEsbUI7QUFBVCxTQUFTQSxtQkFBVCxDQUE2QkMsT0FBN0IsRUFBc0M7QUFDM0MsTUFBSUMsTUFBTSxFQUFWO0FBQ0EsT0FBSyxJQUFJQyxJQUFJLENBQWIsRUFBZ0JBLElBQUlGLFFBQVFHLE1BQTVCLEVBQW9DRCxHQUFwQyxFQUF5QztBQUN2QyxRQUFJRSxTQUFTSixRQUFRRSxDQUFSLENBQWI7QUFDQSxRQUFJRSxPQUFPQyxLQUFYLEVBQWtCO0FBQ2hCSixVQUFJSyxJQUFKLENBQVMsT0FBVDtBQUNELEtBRkQsTUFFTyxJQUFJRixPQUFPRyxPQUFYLEVBQW9CO0FBQ3pCTixVQUFJSyxJQUFKLENBQVMsT0FBVDtBQUNEOztBQUVETCxRQUFJSyxJQUFKLENBQVNFLFdBQVdKLE9BQU9LLEtBQWxCLENBQVQ7O0FBRUEsUUFBSUwsT0FBT0MsS0FBWCxFQUFrQjtBQUNoQkosVUFBSUssSUFBSixDQUFTLFFBQVQ7QUFDRCxLQUZELE1BRU8sSUF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