算法评测平台前端。
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

1 lines
44 KiB

{"version":3,"sources":["/source-files/jsondiffpatch/node_modules/fiberglass/node_modules/browserify/node_modules/browser-pack/_prelude.js","/source-files/jsondiffpatch/src/main-formatters.js","/source-files/jsondiffpatch/src/formatters/index.js","/source-files/jsondiffpatch/src/environment.js","/source-files/jsondiffpatch/src/formatters/base.js","/source-files/jsondiffpatch/src/formatters/annotated.js","/source-files/jsondiffpatch/src/formatters/jsonpatch.js","/source-files/jsondiffpatch/src/formatters/html.js"],"names":["module","exports","require","environment","base","html","annotated","jsonpatch","isBrowser","consoleModuleName","console","window","isArray","Array","a","getObjectKeys","Object","keys","obj","names","property","prototype","hasOwnProperty","call","push","trimUnderscore","str","substr","slice","arrayKeyToSortNumber","key","parseInt","arrayKeyComparer","key1","key2","BaseFormatter","format","delta","left","context","this","prepareContext","recurse","finalize","buffer","out","apply","arguments","typeFormattterNotFound","deltaType","Error","typeFormattterErrorFormatter","err","toString","join","leftKey","movedFrom","isLast","useMoveOriginHere","leftValue","value","type","getDeltaType","nodeType","_t","nodeBegin","rootBegin","typeFormattter","error","stack","nodeEnd","rootEnd","formatDeltaChildren","self","forEachDeltaKey","undefined","fn","name","arrayKeys","moveDestinations","includeMoveDestinations","sort","index","length","parseTextDiff","output","lines","split","i","l","line","lineOutput","pieces","location","exec","chr","pieceIndex","piecesLength","piece","pieceOutput","text","AnnotatedFormatter","indent","levels","indentLevel","indentPad","row","json","htmlNote","formatTextDiffString","format_unchanged","format_movedestination","format_node","wrapPropertyName","deltaAnnotations","added","formatLegend","modified","deleted","moved","textdiff","formatAnyChange","annotator","JSON","stringify","format_added","format_modified","format_deleted","format_moved","format_textdiff","defaultInstance","JSONFormatter","last","arr","sortBy","pred","opsByDescendingOrder","removeOps","b","splitA","path","splitB","compareByIndexDesc","partition","right","forEach","el","coll","reorderOps","jsonFormattedDiff","removeOpsOtherOps","operation","op","otherOps","removeOpsReverse","concat","named","movedestination","unchanged","textDiffLine","result","pushCurrentOp","val","currentPath","pop","indexA","indexB","lastA","lastB","isNaN","log","htmlEscape","replacements","replace","HtmlFormatter","formatValue","unescape","adjustArrows","node","document","getElementText","textContent","innerText","eachByQuery","query","elems","querySelectorAll","eachChildren","children","arrow","arrowParent","parentNode","svg","style","display","destinationElem","destination","querySelector","container","child","getAttribute","distance","offsetTop","setAttribute","Math","abs","top","curve","round","nodeClass","hasArrows","showUnchanged","show","delay","body","prefix","classes","showing","hiding","visible","hidden","list","classList","remove","add","setTimeout","intervalId","setInterval","clearInterval","hideUnchanged"],"mappings":"AAAA;ACCAA,OAAOC,QAAUC,QAAQ;;AEAzBD,QAAQO,UAA8B,mBAAXG;;AED3B,GAAIP,MAAOF,QAAQ,UACfiC,cAAgB/B,KAAK+B,cAErBkE,mBAAqB,WACvB7D,KAAKwC,yBAA0B,EAGjCqB,oBAAmBhF,UAAY,GAAIc,eAEnCkE,mBAAmBhF,UAAUoB,eAAiB,SAASF,GACrDJ,cAAcd,UAAUoB,eAAelB,KAAKiB,KAAMD,GAClDA,EAAQ+D,OAAS,SAASC,GACxB/D,KAAKgE,aAAehE,KAAKgE,aAAe,IACnB,mBAAXD,GAAyB,EAAIA,GACvC/D,KAAKiE,UAAY,GAAI5F,OAAM2B,KAAKgE,YAAc,GAAGlD,KAAK,iBAExDf,EAAQmE,IAAM,SAASC,EAAMC,GAC3BrE,EAAQM,IAAI,mHAEZN,EAAQM,IAAIN,EAAQkE,WACpBlE,EAAQM,IAAI,6CACZN,EAAQM,IAAI8D,GACZpE,EAAQM,IAAI,yDACZN,EAAQM,IAAI+D,GACZrE,EAAQM,IAAI,sBAIhBwD,mBAAmBhF,UAAU8B,6BAA+B,SAASZ,EAASa,GAC5Eb,EAAQmE,IAAI,GAAI,oCAAsCtD,EAAM,WAG9DiD,mBAAmBhF,UAAUwF,qBAAuB,SAAStE,EAASqB,GACpE,GAAI0B,GAAQ9C,KAAK4C,cAA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M,KAG9C8F,EAAc9G,UAAU0G,eAAiB,SAAUxF,GACjDA,EAAQ0H,cAAcL,EAAMtC,UAG9Ba,EAAc9G,UAAU2G,aAAe,SAAUzF,EAASF,GACxDE,EAAQ0H,cAAcL,EAAMrC,MAAOlF,EAAM,KAG3C8F,EAAc9G,UAAU4G,gBAAkB,WACxC,KAAM,mBAGRE,EAAc9G,UAAUe,OAAS,SAAUC,EAAOC,GAChD,GAAIC,KAGJ,OAFAC,MAAKC,eAAeF,GACpBC,KAAKE,QAAQH,EAASF,EAAOC,GACtBC,EAAQyH,QAIjB/J,QAAQkI,cAAgBA,CAExB,IAAID,GAWAY,EAAqB,SAAUuB,EAAQC,GACzC,GAAIC,GAAQxI,SAASsI,EAAQ,IACzBG,EAAQzI,SAASuI,EAAQ,GAC7B,OAAMG,OAAMF,IAAUE,MAAMD,GAGnB,EAFAA,EAAQD,GAyCfnI,EAAS,SAAUC,EAAOC,GAI5B,MAHK4F,KACHA,EAAkB,GAAIC,IAEjBiB,EAAWlB,EAAgB9F,OAAOC,EAAOC,IAGlDrC,SAAQyK,IAAM,SAAUrI,EAAOC,GAC7B5B,QAAQgK,IAAItI,EAAOC,EAAOC,KAG5BrC,QAAQmC,OAASA","file":"bundle.js","sourcesContent":["(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require==\"function\"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error(\"Cannot find module '\"+o+\"'\");throw f.code=\"MODULE_NOT_FOUND\",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require==\"function\"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})","\nmodule.exports = require('./formatters');\n","var environment = require('../environment');\n\nexports.base = require('./base');\nexports.html = require('./html');\nexports.annotated = require('./annotated');\nexports.jsonpatch = require('./jsonpatch');\n\nif (!environment.isBrowser) {\n var consoleModuleName = './console';\n exports.console = require(consoleModuleName);\n}\n","\nexports.isBrowser = typeof window !== 'undefined';\n","var isArray = (typeof Array.isArray === 'function') ?\n // use native function\n Array.isArray :\n // use instanceof operator\n function(a) {\n return a instanceof Array;\n };\n\nvar getObjectKeys = typeof Object.keys === 'function' ?\n function(obj) {\n return Object.keys(obj);\n } : function(obj) {\n var names = [];\n for (var property in obj) {\n if (Object.prototype.hasOwnProperty.call(obj, property)) {\n names.push(property);\n }\n }\n return names;\n };\n\nvar trimUnderscore = function(str) {\n if (str.substr(0, 1) === '_') {\n return str.slice(1);\n }\n return str;\n};\n\nvar arrayKeyToSortNumber = function(key) {\n if (key === '_t') {\n return -1;\n } else {\n if (key.substr(0, 1) === '_') {\n return parseInt(key.slice(1), 10);\n } else {\n return parseInt(key, 10) + 0.1;\n }\n }\n};\n\nvar arrayKeyComparer = function(key1, key2) {\n return arrayKeyToSortNumber(key1) - arrayKeyToSortNumber(key2);\n};\n\nvar BaseFormatter = function BaseFormatter() {};\n\nBaseFormatter.prototype.format = function(delta, left) {\n var context = {};\n this.prepareContext(context);\n this.recurse(context, delta, left);\n return this.finalize(context);\n};\n\nBaseFormatter.prototype.prepareContext = function(context) {\n context.buffer = [];\n context.out = function() {\n this.buffer.push.apply(this.buffer, arguments);\n };\n};\n\nBaseFormatter.prototype.typeFormattterNotFound = function(context, deltaType) {\n throw new Error('cannot format delta type: ' + deltaType);\n};\n\nBaseFormatter.prototype.typeFormattterErrorFormatter = function(context, err) {\n return err.toString();\n};\n\nBaseFormatter.prototype.finalize = function(context) {\n if (isArray(context.buffer)) {\n return context.buffer.join('');\n }\n};\n\nBaseFormatter.prototype.recurse = function(context, delta, left, key, leftKey, movedFrom, isLast) {\n\n var useMoveOriginHere = delta && movedFrom;\n var leftValue = useMoveOriginHere ? movedFrom.value : left;\n\n if (typeof delta === 'undefined' && typeof key === 'undefined') {\n return undefined;\n }\n\n var type = this.getDeltaType(delta, movedFrom);\n var nodeType = type === 'node' ? (delta._t === 'a' ? 'array' : 'object') : '';\n\n if (typeof key !== 'undefined') {\n this.nodeBegin(context, key, leftKey, type, nodeType, isLast);\n } else {\n this.rootBegin(context, type, nodeType);\n }\n\n var typeFormattter;\n try {\n typeFormattter = this['format_' + type] || this.typeFormattterNotFound(context, type);\n typeFormattter.call(this, context, delta, leftValue, key, leftKey, movedFrom);\n } catch (err) {\n this.typeFormattterErrorFormatter(context, err, delta, leftValue, key, leftKey, movedFrom);\n if (typeof console !== 'undefined' && console.error) {\n console.error(err.stack);\n }\n }\n\n if (typeof key !== 'undefined') {\n this.nodeEnd(context, key, leftKey, type, nodeType, isLast);\n } else {\n this.rootEnd(context, type, nodeType);\n }\n};\n\nBaseFormatter.prototype.formatDeltaChildren = function(context, delta, left) {\n var self = this;\n this.forEachDeltaKey(delta, left, function(key, leftKey, movedFrom, isLast) {\n self.recurse(context, delta[key], left ? left[leftKey] : undefined,\n key, leftKey, movedFrom, isLast);\n });\n};\n\nBaseFormatter.prototype.forEachDeltaKey = function(delta, left, fn) {\n var keys = getObjectKeys(delta);\n var arrayKeys = delta._t === 'a';\n var moveDestinations = {};\n var name;\n if (typeof left !== 'undefined') {\n for (name in left) {\n if (Object.prototype.hasOwnProperty.call(left, name)) {\n if (typeof delta[name] === 'undefined' &&\n ((!arrayKeys) || typeof delta['_' + name] === 'undefined')) {\n keys.push(name);\n }\n }\n }\n }\n // look for move destinations\n for (name in delta) {\n if (Object.prototype.hasOwnProperty.call(delta, name)) {\n var value = delta[name];\n if (isArray(value) && value[2] === 3) {\n moveDestinations[value[1].toString()] = {\n key: name,\n value: left && left[parseInt(name.substr(1))]\n };\n if (this.includeMoveDestinations !== false) {\n if ((typeof left === 'undefined') &&\n (typeof delta[value[1]] === 'undefined')) {\n keys.push(value[1].toString());\n }\n }\n }\n }\n }\n if (arrayKeys) {\n keys.sort(arrayKeyComparer);\n } else {\n keys.sort();\n }\n for (var index = 0, length = keys.length; index < length; index++) {\n var key = keys[index];\n if (arrayKeys && key === '_t') {\n continue;\n }\n var leftKey = arrayKeys ?\n (typeof key === 'number' ? key : parseInt(trimUnderscore(key), 10)) :\n key;\n var isLast = (index === length - 1);\n fn(key, leftKey, moveDestinations[leftKey], isLast);\n }\n};\n\nBaseFormatter.prototype.getDeltaType = function(delta, movedFrom) {\n if (typeof delta === 'undefined') {\n if (typeof movedFrom !== 'undefined') {\n return 'movedestination';\n }\n return 'unchanged';\n }\n if (isArray(delta)) {\n if (delta.length === 1) {\n return 'added';\n }\n if (delta.length === 2) {\n return 'modified';\n }\n if (delta.length === 3 && delta[2] === 0) {\n return 'deleted';\n }\n if (delta.length === 3 && delta[2] === 2) {\n return 'textdiff';\n }\n if (delta.length === 3 && delta[2] === 3) {\n return 'moved';\n }\n } else if (typeof delta === 'object') {\n return 'node';\n }\n return 'unknown';\n};\n\nBaseFormatter.prototype.parseTextDiff = function(value) {\n var output = [];\n var lines = value.split('\\n@@ ');\n for (var i = 0, l = lines.length; i < l; i++) {\n var line = lines[i];\n var lineOutput = {\n pieces: []\n };\n var location = /^(?:@@ )?[-+]?(\\d+),(\\d+)/.exec(line).slice(1);\n lineOutput.location = {\n line: location[0],\n chr: location[1]\n };\n var pieces = line.split('\\n').slice(1);\n for (var pieceIndex = 0, piecesLength = pieces.length; pieceIndex < piecesLength; pieceIndex++) {\n var piece = pieces[pieceIndex];\n if (!piece.length) {\n continue;\n }\n var pieceOutput = {\n type: 'context'\n };\n if (piece.substr(0, 1) === '+') {\n pieceOutput.type = 'added';\n } else if (piece.substr(0, 1) === '-') {\n pieceOutput.type = 'deleted';\n }\n pieceOutput.text = piece.slice(1);\n lineOutput.pieces.push(pieceOutput);\n }\n output.push(lineOutput);\n }\n return output;\n};\n\nexports.BaseFormatter = BaseFormatter;\n","var base = require('./base');\nvar BaseFormatter = base.BaseFormatter;\n\nvar AnnotatedFormatter = function AnnotatedFormatter() {\n this.includeMoveDestinations = false;\n};\n\nAnnotatedFormatter.prototype = new BaseFormatter();\n\nAnnotatedFormatter.prototype.prepareContext = function(context) {\n BaseFormatter.prototype.prepareContext.call(this, context);\n context.indent = function(levels) {\n this.indentLevel = (this.indentLevel || 0) +\n (typeof levels === 'undefined' ? 1 : levels);\n this.indentPad = new Array(this.indentLevel + 1).join('&nbsp;&nbsp;');\n };\n context.row = function(json, htmlNote) {\n context.out('<tr><td style=\"white-space: nowrap;\">' +\n '<pre class=\"jsondiffpatch-annotated-indent\" style=\"display: inline-block\">');\n context.out(context.indentPad);\n context.out('</pre><pre style=\"display: inline-block\">');\n context.out(json);\n context.out('</pre></td><td class=\"jsondiffpatch-delta-note\"><div>');\n context.out(htmlNote);\n context.out('</div></td></tr>');\n };\n};\n\nAnnotatedFormatter.prototype.typeFormattterErrorFormatter = function(context, err) {\n context.row('', '<pre class=\"jsondiffpatch-error\">' + err + '</pre>');\n};\n\nAnnotatedFormatter.prototype.formatTextDiffString = function(context, value) {\n var lines = this.parseTextDiff(value);\n context.out('<ul class=\"jsondiffpatch-textdiff\">');\n for (var i = 0, l = lines.length; i < l; i++) {\n var line = lines[i];\n context.out('<li>' +\n '<div class=\"jsondiffpatch-textdiff-location\">' +\n '<span class=\"jsondiffpatch-textdiff-line-number\">' +\n line.location.line +\n '</span>' +\n '<span class=\"jsondiffpatch-textdiff-char\">' +\n line.location.chr +\n '</span>' +\n '</div>' +\n '<div class=\"jsondiffpatch-textdiff-line\">');\n var pieces = line.pieces;\n for (var pieceIndex = 0, piecesLength = pieces.length; pieceIndex < piecesLength; pieceIndex++) {\n var piece = pieces[pieceIndex];\n context.out('<span class=\"jsondiffpatch-textdiff-' + piece.type + '\">' +\n piece.text + '</span>');\n }\n context.out('</div></li>');\n }\n context.out('</ul>');\n};\n\nAnnotatedFormatter.prototype.rootBegin = function(context, type, nodeType) {\n context.out('<table class=\"jsondiffpatch-annotated-delta\">');\n if (type === 'node') {\n context.row('{');\n context.indent();\n }\n if (nodeType === 'array') {\n context.row('\"_t\": \"a\",', 'Array delta (member names indicate array indices)');\n }\n};\n\nAnnotatedFormatter.prototype.rootEnd = function(context, type) {\n if (type === 'node') {\n context.indent(-1);\n context.row('}');\n }\n context.out('</table>');\n};\n\nAnnotatedFormatter.prototype.nodeBegin = function(context, key, leftKey, type, nodeType) {\n context.row('&quot;' + key + '&quot;: {');\n if (type === 'node') {\n context.indent();\n }\n if (nodeType === 'array') {\n context.row('\"_t\": \"a\",', 'Array delta (member names indicate array indices)');\n }\n};\n\nAnnotatedFormatter.prototype.nodeEnd = function(context, key, leftKey, type, nodeType, isLast) {\n if (type === 'node') {\n context.indent(-1);\n }\n context.row('}' + (isLast ? '' : ','));\n};\n\n/* jshint camelcase: false */\n\nAnnotatedFormatter.prototype.format_unchanged = function() {\n return;\n};\n\nAnnotatedFormatter.prototype.format_movedestination = function() {\n return;\n};\n\n\nAnnotatedFormatter.prototype.format_node = function(context, delta, left) {\n // recurse\n this.formatDeltaChildren(context, delta, left);\n};\n\nvar wrapPropertyName = function(name) {\n return '<pre style=\"display:inline-block\">&quot;' + name + '&quot;</pre>';\n};\n\nvar deltaAnnotations = {\n added: function(delta, left, key, leftKey) {\n var formatLegend = ' <pre>([newValue])</pre>';\n if (typeof leftKey === 'undefined') {\n return 'new value' + formatLegend;\n }\n if (typeof leftKey === 'number') {\n return 'insert at index ' + leftKey + formatLegend;\n }\n return 'add property ' + wrapPropertyName(leftKey) + formatLegend;\n },\n modified: function(delta, left, key, leftKey) {\n var formatLegend = ' <pre>([previousValue, newValue])</pre>';\n if (typeof leftKey === 'undefined') {\n return 'modify value' + formatLegend;\n }\n if (typeof leftKey === 'number') {\n return 'modify at index ' + leftKey + formatLegend;\n }\n return 'modify property ' + wrapPropertyName(leftKey) + formatLegend;\n },\n deleted: function(delta, left, key, leftKey) {\n var formatLegend = ' <pre>([previousValue, 0, 0])</pre>';\n if (typeof leftKey === 'undefined') {\n return 'delete value' + formatLegend;\n }\n if (typeof leftKey === 'number') {\n return 'remove index ' + leftKey + formatLegend;\n }\n return 'delete property ' + wrapPropertyName(leftKey) + formatLegend;\n },\n moved: function(delta, left, key, leftKey) {\n return 'move from <span title=\"(position to remove at original state)\">index ' +\n leftKey + '</span> to ' +\n '<span title=\"(position to insert at final state)\">index ' +\n delta[1] + '</span>';\n },\n textdiff: function(delta, left, key, leftKey) {\n var location = (typeof leftKey === 'undefined') ?\n '' : (\n (typeof leftKey === 'number') ?\n ' at index ' + leftKey :\n ' at property ' + wrapPropertyName(leftKey)\n );\n return 'text diff' + location + ', format is ' +\n '<a href=\"https://code.google.com/p/google-diff-match-patch/wiki/Unidiff\">' +\n 'a variation of Unidiff</a>';\n }\n};\n\nvar formatAnyChange = function(context, delta) {\n var deltaType = this.getDeltaType(delta);\n var annotator = deltaAnnotations[deltaType];\n var htmlNote = annotator && annotator.apply(annotator,\n Array.prototype.slice.call(arguments, 1));\n var json = JSON.stringify(delta, null, 2);\n if (deltaType === 'textdiff') {\n // split text diffs lines\n json = json.split('\\\\n').join('\\\\n\"+\\n \"');\n }\n context.indent();\n context.row(json, htmlNote);\n context.indent(-1);\n};\n\nAnnotatedFormatter.prototype.format_added = formatAnyChange;\nAnnotatedFormatter.prototype.format_modified = formatAnyChange;\nAnnotatedFormatter.prototype.format_deleted = formatAnyChange;\nAnnotatedFormatter.prototype.format_moved = formatAnyChange;\nAnnotatedFormatter.prototype.format_textdiff = formatAnyChange;\n\n/* jshint camelcase: true */\n\nexports.AnnotatedFormatter = AnnotatedFormatter;\n\nvar defaultInstance;\n\nexports.format = function(delta, left) {\n if (!defaultInstance) {\n defaultInstance = new AnnotatedFormatter();\n }\n return defaultInstance.format(delta, left);\n};\n","(function () {\n var base = require('./base');\n var BaseFormatter = base.BaseFormatter;\n\n var named = {\n added: 'add',\n deleted: 'remove',\n modified: 'replace',\n moved: 'moved',\n movedestination: 'movedestination',\n unchanged: 'unchanged',\n error: 'error',\n textDiffLine: 'textDiffLine'\n };\n\n function JSONFormatter() {\n this.includeMoveDestinations = false;\n }\n\n JSONFormatter.prototype = new BaseFormatter();\n\n JSONFormatter.prototype.prepareContext = function (context) {\n BaseFormatter.prototype.prepareContext.call(this, context);\n context.result = [];\n context.path = [];\n context.pushCurrentOp = function (op, value) {\n var val = {\n op: op,\n path: this.currentPath()\n };\n if (typeof value !== 'undefined') {\n val.value = value;\n }\n this.result.push(val);\n };\n\n context.currentPath = function () {\n return '/' + this.path.join('/');\n };\n };\n\n JSONFormatter.prototype.typeFormattterErrorFormatter = function (context, err) {\n context.out('[ERROR]' + err);\n };\n\n JSONFormatter.prototype.rootBegin = function () {\n };\n\n JSONFormatter.prototype.rootEnd = function () {\n };\n\n JSONFormatter.prototype.nodeBegin = function (context, key, leftKey) {\n context.path.push(leftKey);\n };\n\n JSONFormatter.prototype.nodeEnd = function (context) {\n context.path.pop();\n };\n\n /* jshint camelcase: false */\n\n JSONFormatter.prototype.format_unchanged = function (context, delta, left) {\n if (typeof left === 'undefined') {\n return;\n }\n context.pushCurrentOp(named.unchanged, left);\n };\n\n JSONFormatter.prototype.format_movedestination = function (context, delta, left) {\n if (typeof left === 'undefined') {\n return;\n }\n context.pushCurrentOp(named.movedestination, left);\n };\n\n JSONFormatter.prototype.format_node = function (context, delta, left) {\n this.formatDeltaChildren(context, delta, left);\n };\n\n JSONFormatter.prototype.format_added = function (context, delta) {\n context.pushCurrentOp(named.added, delta[0]);\n };\n\n JSONFormatter.prototype.format_modified = function (context, delta) {\n context.pushCurrentOp(named.modified, delta[1]);\n };\n\n JSONFormatter.prototype.format_deleted = function (context) {\n context.pushCurrentOp(named.deleted);\n };\n\n JSONFormatter.prototype.format_moved = function (context, delta) {\n context.pushCurrentOp(named.moved, delta[1]);\n };\n\n JSONFormatter.prototype.format_textdiff = function () {\n throw 'not implimented';\n };\n\n JSONFormatter.prototype.format = function (delta, left) {\n var context = {};\n this.prepareContext(context);\n this.recurse(context, delta, left);\n return context.result;\n };\n /* jshint camelcase: true */\n\n exports.JSONFormatter = JSONFormatter;\n\n var defaultInstance;\n\n function last(arr) {\n return arr[arr.length - 1];\n }\n\n function sortBy(arr, pred) {\n arr.sort(pred);\n return arr;\n }\n\n var compareByIndexDesc = function (indexA, indexB) {\n var lastA = parseInt(indexA, 10);\n var lastB = parseInt(indexB, 10);\n if (!(isNaN(lastA) || isNaN(lastB))) {\n return lastB - lastA;\n } else {\n return 0;\n }\n };\n\n function opsByDescendingOrder(removeOps) {\n return sortBy(removeOps, function (a, b) {\n var splitA = a.path.split('/');\n var splitB = b.path.split('/');\n if (splitA.length !== splitB.length) {\n return splitA.length - splitB.length;\n } else {\n return compareByIndexDesc(last(splitA), last(splitB));\n }\n });\n }\n\n function partition(arr, pred) {\n var left = [];\n var right = [];\n\n arr.forEach(function (el) {\n var coll = pred(el) ? left : right;\n coll.push(el);\n });\n return [left, right];\n }\n\n function reorderOps(jsonFormattedDiff) {\n var removeOpsOtherOps = partition(jsonFormattedDiff, function (operation) {\n return operation.op === 'remove';\n });\n var removeOps = removeOpsOtherOps[0];\n var otherOps = removeOpsOtherOps[1];\n\n var removeOpsReverse = opsByDescendingOrder(removeOps);\n return removeOpsReverse.concat(otherOps);\n }\n\n\n var format = function (delta, left) {\n if (!defaultInstance) {\n defaultInstance = new JSONFormatter();\n }\n return reorderOps(defaultInstance.format(delta, left));\n };\n\n exports.log = function (delta, left) {\n console.log(format(delta, left));\n };\n\n exports.format = format;\n})();\n","var base = require('./base');\nvar BaseFormatter = base.BaseFormatter;\n\nvar HtmlFormatter = function HtmlFormatter() {};\n\nHtmlFormatter.prototype = new BaseFormatter();\n\nfunction htmlEscape(text) {\n var html = text;\n var replacements = [\n [/&/g, '&amp;'],\n [/</g, '&lt;'],\n [/>/g, '&gt;'],\n [/'/g, '&apos;'],\n [/\"/g, '&quot;']\n ];\n for (var i = 0; i < replacements.length; i++) {\n html = html.replace(replacements[i][0], replacements[i][1]);\n }\n return html;\n}\n\nHtmlFormatter.prototype.typeFormattterErrorFormatter = function(context, err) {\n context.out('<pre class=\"jsondiffpatch-error\">' + err + '</pre>');\n};\n\nHtmlFormatter.prototype.formatValue = function(context, value) {\n context.out('<pre>' + htmlEscape(JSON.stringify(value, null, 2)) + '</pre>');\n};\n\nHtmlFormatter.prototype.formatTextDiffString = function(context, value) {\n var lines = this.parseTextDiff(value);\n context.out('<ul class=\"jsondiffpatch-textdiff\">');\n for (var i = 0, l = lines.length; i < l; i++) {\n var line = lines[i];\n context.out('<li>' +\n '<div class=\"jsondiffpatch-textdiff-location\">' +\n '<span class=\"jsondiffpatch-textdiff-line-number\">' +\n line.location.line +\n '</span>' +\n '<span class=\"jsondiffpatch-textdiff-char\">' +\n line.location.chr +\n '</span>' +\n '</div>' +\n '<div class=\"jsondiffpatch-textdiff-line\">');\n var pieces = line.pieces;\n for (var pieceIndex = 0, piecesLength = pieces.length; pieceIndex < piecesLength; pieceIndex++) {\n /* global unescape */\n var piece = pieces[pieceIndex];\n context.out('<span class=\"jsondiffpatch-textdiff-' + piece.type + '\">' +\n htmlEscape(unescape(piece.text)) + '</span>');\n }\n context.out('</div></li>');\n }\n context.out('</ul>');\n};\n\nvar adjustArrows = function jsondiffpatchHtmlFormatterAdjustArrows(node) {\n node = node || document;\n var getElementText = function(el) {\n return el.textContent || el.innerText;\n };\n var eachByQuery = function(el, query, fn) {\n var elems = el.querySelectorAll(query);\n for (var i = 0, l = elems.length; i < l; i++) {\n fn(elems[i]);\n }\n };\n var eachChildren = function(el, fn) {\n for (var i = 0, l = el.children.length; i < l; i++) {\n fn(el.children[i], i);\n }\n };\n eachByQuery(node, '.jsondiffpatch-arrow', function(arrow) {\n var arrowParent = arrow.parentNode;\n var svg = arrow.children[0],\n path = svg.children[1];\n svg.style.display = 'none';\n var destination = getElementText(arrowParent.querySelector('.jsondiffpatch-moved-destination'));\n var container = arrowParent.parentNode;\n var destinationElem;\n eachChildren(container, function(child) {\n if (child.getAttribute('data-key') === destination) {\n destinationElem = child;\n }\n });\n if (!destinationElem) {\n return;\n }\n try {\n var distance = destinationElem.offsetTop - arrowParent.offsetTop;\n svg.setAttribute('height', Math.abs(distance) + 6);\n arrow.style.top = (-8 + (distance > 0 ? 0 : distance)) + 'px';\n var curve = distance > 0 ?\n 'M30,0 Q-10,' + Math.round(distance / 2) + ' 26,' + (distance - 4) :\n 'M30,' + (-distance) + ' Q-10,' + Math.round(-distance / 2) + ' 26,4';\n path.setAttribute('d', curve);\n svg.style.display = '';\n } catch (err) {\n return;\n }\n });\n};\n\nHtmlFormatter.prototype.rootBegin = function(context, type, nodeType) {\n var nodeClass = 'jsondiffpatch-' + type +\n (nodeType ? ' jsondiffpatch-child-node-type-' + nodeType : '');\n context.out('<div class=\"jsondiffpatch-delta ' + nodeClass + '\">');\n};\n\nHtmlFormatter.prototype.rootEnd = function(context) {\n context.out('</div>' + (context.hasArrows ?\n ('<script type=\"text/javascript\">setTimeout(' +\n adjustArrows.toString() +\n ',10);</script>') : ''));\n};\n\nHtmlFormatter.prototype.nodeBegin = function(context, key, leftKey, type, nodeType) {\n var nodeClass = 'jsondiffpatch-' + type +\n (nodeType ? ' jsondiffpatch-child-node-type-' + nodeType : '');\n context.out('<li class=\"' + nodeClass + '\" data-key=\"' + leftKey + '\">' +\n '<div class=\"jsondiffpatch-property-name\">' + leftKey + '</div>');\n};\n\n\nHtmlFormatter.prototype.nodeEnd = function(context) {\n context.out('</li>');\n};\n\n/* jshint camelcase: false */\n\nHtmlFormatter.prototype.format_unchanged = function(context, delta, left) {\n if (typeof left === 'undefined') {\n return;\n }\n context.out('<div class=\"jsondiffpatch-value\">');\n this.formatValue(context, left);\n context.out('</div>');\n};\n\nHtmlFormatter.prototype.format_movedestination = function(context, delta, left) {\n if (typeof left === 'undefined') {\n return;\n }\n context.out('<div class=\"jsondiffpatch-value\">');\n this.formatValue(context, left);\n context.out('</div>');\n};\n\nHtmlFormatter.prototype.format_node = function(context, delta, left) {\n // recurse\n var nodeType = (delta._t === 'a') ? 'array' : 'object';\n context.out('<ul class=\"jsondiffpatch-node jsondiffpatch-node-type-' + nodeType + '\">');\n this.formatDeltaChildren(context, delta, left);\n context.out('</ul>');\n};\n\nHtmlFormatter.prototype.format_added = function(context, delta) {\n context.out('<div class=\"jsondiffpatch-value\">');\n this.formatValue(context, delta[0]);\n context.out('</div>');\n};\n\nHtmlFormatter.prototype.format_modified = function(context, delta) {\n context.out('<div class=\"jsondiffpatch-value jsondiffpatch-left-value\">');\n this.formatValue(context, delta[0]);\n context.out('</div>' +\n '<div class=\"jsondiffpatch-value jsondiffpatch-right-value\">');\n this.formatValue(context, delta[1]);\n context.out('</div>');\n};\n\nHtmlFormatter.prototype.format_deleted = function(context, delta) {\n context.out('<div class=\"jsondiffpatch-value\">');\n this.formatValue(context, delta[0]);\n context.out('</div>');\n};\n\nHtmlFormatter.prototype.format_moved = function(context, delta) {\n context.out('<div class=\"jsondiffpatch-value\">');\n this.formatValue(context, delta[0]);\n context.out('</div><div class=\"jsondiffpatch-moved-destination\">' + delta[1] + '</div>');\n\n // draw an SVG arrow from here to move destination\n context.out(\n /*jshint multistr: true */\n '<div class=\"jsondiffpatch-arrow\" style=\"position: relative; left: -34px;\">\\\n <svg width=\"30\" height=\"60\" style=\"position: absolute; display: none;\">\\\n <defs>\\\n <marker id=\"markerArrow\" markerWidth=\"8\" markerHeight=\"8\" refx=\"2\" refy=\"4\"\\\n orient=\"auto\" markerUnits=\"userSpaceOnUse\">\\\n <path d=\"M1,1 L1,7 L7,4 L1,1\" style=\"fill: #339;\" />\\\n </marker>\\\n </defs>\\\n <path d=\"M30,0 Q-10,25 26,50\" style=\"stroke: #88f; stroke-width: 2px; fill: none;\\\n stroke-opacity: 0.5; marker-end: url(#markerArrow);\"></path>\\\n </svg>\\\n </div>');\n context.hasArrows = true;\n};\n\nHtmlFormatter.prototype.format_textdiff = function(context, delta) {\n context.out('<div class=\"jsondiffpatch-value\">');\n this.formatTextDiffString(context, delta[0]);\n context.out('</div>');\n};\n\n/* jshint camelcase: true */\n\nvar showUnchanged = function(show, node, delay) {\n var el = node || document.body;\n var prefix = 'jsondiffpatch-unchanged-';\n var classes = {\n showing: prefix + 'showing',\n hiding: prefix + 'hiding',\n visible: prefix + 'visible',\n hidden: prefix + 'hidden',\n };\n var list = el.classList;\n if (!list) {\n return;\n }\n if (!delay) {\n list.remove(classes.showing);\n list.remove(classes.hiding);\n list.remove(classes.visible);\n list.remove(classes.hidden);\n if (show === false) {\n list.add(classes.hidden);\n }\n return;\n }\n if (show === false) {\n list.remove(classes.showing);\n list.add(classes.visible);\n setTimeout(function() {\n list.add(classes.hiding);\n }, 10);\n } else {\n list.remove(classes.hiding);\n list.add(classes.showing);\n list.remove(classes.hidden);\n }\n var intervalId = setInterval(function() {\n adjustArrows(el);\n }, 100);\n setTimeout(function() {\n list.remove(classes.showing);\n list.remove(classes.hiding);\n if (show === false) {\n list.add(classes.hidden);\n list.remove(classes.visible);\n } else {\n list.add(classes.visible);\n list.remove(classes.hidden);\n }\n setTimeout(function() {\n list.remove(classes.visible);\n clearInterval(intervalId);\n }, delay + 400);\n }, delay);\n};\n\nvar hideUnchanged = function(node, delay) {\n return showUnchanged(false, node, delay);\n};\n\nexports.HtmlFormatter = HtmlFormatter;\n\nexports.showUnchanged = showUnchanged;\n\nexports.hideUnchanged = hideUnchanged;\n\nvar defaultInstance;\n\nexports.format = function(delta, left) {\n if (!defaultInstance) {\n defaultInstance = new HtmlFormatter();\n }\n return defaultInstance.format(delta, left);\n};\n"]}