-
Notifications
You must be signed in to change notification settings - Fork 44
Expand file tree
/
Copy pathdifflib-browser.js
More file actions
6 lines (6 loc) · 40.9 KB
/
Copy pathdifflib-browser.js
File metadata and controls
6 lines (6 loc) · 40.9 KB
1
2
3
4
5
6
/**
* @fileoverview Text diff library ported from Python's difflib module.
* https://github.com/qiao/difflib.js
*/
var difflib=function(){var t=function(e,n){var r=t.resolve(e,n||"/"),o=t.modules[r];if(!o)throw new Error("Failed to resolve module "+e+", tried "+r);var i=o._cached?o._cached:o();return i};return t.paths=[],t.modules={},t.extensions=[".js",".coffee"],t._core={assert:!0,events:!0,fs:!0,path:!0,vm:!0},t.resolve=function(){return function(e,n){function r(e){if(t.modules[e])return e;for(var n=0;n<t.extensions.length;n++){var r=t.extensions[n];if(t.modules[e+r])return e+r}}function o(e){e=e.replace(/\/+$/,"");var n=e+"/package.json";if(t.modules[n]){var o=t.modules[n](),i=o.browserify;if("object"==typeof i&&i.main){var s=r(u.resolve(e,i.main));if(s)return s}else if("string"==typeof i){var s=r(u.resolve(e,i));if(s)return s}else if(o.main){var s=r(u.resolve(e,o.main));if(s)return s}}return r(e+"/index")}function i(t,e){for(var n=s(e),i=0;i<n.length;i++){var u=n[i],a=r(u+"/"+t);if(a)return a;var f=o(u+"/"+t);if(f)return f}var a=r(t);if(a)return a}function s(t){var e;e="/"===t?[""]:u.normalize(t).split("/");for(var n=[],r=e.length-1;r>=0;r--)if("node_modules"!==e[r]){var o=e.slice(0,r+1).join("/")+"/node_modules";n.push(o)}return n}if(n||(n="/"),t._core[e])return e;var u=t.modules.path();n=u.resolve("/",n);var a=n||"/";if(e.match(/^(?:\.\.?\/|\/)/)){var f=r(u.resolve(a,e))||o(u.resolve(a,e));if(f)return f}var l=i(e,a);if(l)return l;throw new Error("Cannot find module '"+e+"'")}}(),t.alias=function(e,n){var r=t.modules.path(),o=null;try{o=t.resolve(e+"/package.json","/")}catch(n){o=t.resolve(e,"/")}for(var i=r.dirname(o),s=(Object.keys||function(t){var e=[];for(var n in t)e.push(n);return e})(t.modules),u=0;u<s.length;u++){var a=s[u];if(a.slice(0,i.length+1)===i+"/"){var f=a.slice(i.length);t.modules[n+f]=t.modules[i+f]}else a===i&&(t.modules[n]=t.modules[i])}},t.define=function(e,n){var r=t._core[e]?"":t.modules.path().dirname(e),o=function(e){return t(e,r)};o.resolve=function(e){return t.resolve(e,r)},o.modules=t.modules,o.define=t.define;var i={exports:{}};t.modules[e]=function(){return t.modules[e]._cached=i.exports,n.call(i.exports,o,i,i.exports,r,e),t.modules[e]._cached=i.exports,i.exports}},"undefined"==typeof process&&(process={}),process.nextTick||(process.nextTick=function(){var t=[],e="undefined"!=typeof window&&window.postMessage&&window.addEventListener;return e&&window.addEventListener("message",function(e){if(e.source===window&&"browserify-tick"===e.data&&(e.stopPropagation(),t.length>0)){var n=t.shift();n()}},!0),function(n){e?(t.push(n),window.postMessage("browserify-tick","*")):setTimeout(n,0)}}()),process.title||(process.title="browser"),process.binding||(process.binding=function(e){if("evals"===e)return t("vm");throw new Error("No such module")}),process.cwd||(process.cwd=function(){return"."}),process.env||(process.env={}),process.argv||(process.argv=[]),t.define("path",function(t,e,n,r,o){function i(t,e){for(var n=[],r=0;r<t.length;r++)e(t[r],r,t)&&n.push(t[r]);return n}function s(t,e){for(var n=0,r=t.length;r>=0;r--){var o=t[r];"."==o?t.splice(r,1):".."===o?(t.splice(r,1),n++):n&&(t.splice(r,1),n--)}if(e)for(;n--;n)t.unshift("..");return t}var u=/^(.+\/(?!$)|\/)?((?:.+?)?(\.[^.]*)?)$/;n.resolve=function(){for(var t="",e=!1,n=arguments.length;n>=-1&&!e;n--){var r=n>=0?arguments[n]:process.cwd();"string"==typeof r&&r&&(t=r+"/"+t,e="/"===r.charAt(0))}return t=s(i(t.split("/"),function(t){return!!t}),!e).join("/"),(e?"/":"")+t||"."},n.normalize=function(t){var e="/"===t.charAt(0),n="/"===t.slice(-1);return t=s(i(t.split("/"),function(t){return!!t}),!e).join("/"),t||e||(t="."),t&&n&&(t+="/"),(e?"/":"")+t},n.join=function(){var t=Array.prototype.slice.call(arguments,0);return n.normalize(i(t,function(t,e){return t&&"string"==typeof t}).join("/"))},n.dirname=function(t){var e=u.exec(t)[1]||"",n=!1;return e?1===e.length||n&&e.length<=3&&":"===e.charAt(1)?e:e.substring(0,e.length-1):"."},n.basename=function(t,e){var n=u.exec(t)[2]||"";return e&&n.substr(-1*e.length)===e&&(n=n.substr(0,n.length-e.length)),n},n.extname=function(t){return u.exec(t)[3]||""}}),t.define("/node_modules/heap/package.json",function(t,e,n,r,o){e.exports={main:"./index.js"}}),t.define("/node_modules/heap/index.js",function(t,e,n,r,o){e.exports=t("./lib/heap")}),t.define("/node_modules/heap/lib/heap.js",function(t,e,n,r,o){(function(){var t,r,o,i,s,u,a,f,l,p,h,c,d,g,y;o=Math.floor,p=Math.min,r=function(t,e){return t<e?-1:t>e?1:0},l=function(t,e,n,i,s){var u;if(null==n&&(n=0),null==s&&(s=r),n<0)throw new Error("lo must be non-negative");for(null==i&&(i=t.length);n<i;)u=o((n+i)/2),s(e,t[u])<0?i=u:n=u+1;return[].splice.apply(t,[n,n-n].concat(e)),e},u=function(t,e,n){return null==n&&(n=r),t.push(e),g(t,0,t.length-1,n)},s=function(t,e){var n,o;return null==e&&(e=r),n=t.pop(),t.length?(o=t[0],t[0]=n,y(t,0,e)):o=n,o},f=function(t,e,n){var o;return null==n&&(n=r),o=t[0],t[0]=e,y(t,0,n),o},a=function(t,e,n){var o;return null==n&&(n=r),t.length&&n(t[0],e)<0&&(o=[t[0],e],e=o[0],t[0]=o[1],y(t,0,n)),e},i=function(t,e){var n,i,s,u,a,f;for(null==e&&(e=r),u=function(){f=[];for(var e=0,n=o(t.length/2);0<=n?e<n:e>n;0<=n?e++:e--)f.push(e);return f}.apply(this).reverse(),a=[],i=0,s=u.length;i<s;i++)n=u[i],a.push(y(t,n,e));return a},d=function(t,e,n){var o;if(null==n&&(n=r),o=t.indexOf(e),o!==-1)return g(t,0,o,n),y(t,o,n)},h=function(t,e,n){var o,s,u,f,l;if(null==n&&(n=r),s=t.slice(0,e),!s.length)return s;for(i(s,n),l=t.slice(e),u=0,f=l.length;u<f;u++)o=l[u],a(s,o,n);return s.sort(n).reverse()},c=function(t,e,n){var o,u,a,f,h,c,d,g,y,v;if(null==n&&(n=r),10*e<=t.length){if(f=t.slice(0,e).sort(n),!f.length)return f;for(a=f[f.length-1],g=t.slice(e),h=0,d=g.length;h<d;h++)o=g[h],n(o,a)<0&&(l(f,o,0,null,n),f.pop(),a=f[f.length-1]);return f}for(i(t,n),v=[],u=c=0,y=p(e,t.length);0<=y?c<y:c>y;u=0<=y?++c:--c)v.push(s(t,n));return v},g=function(t,e,n,o){var i,s,u;for(null==o&&(o=r),i=t[n];n>e&&(u=n-1>>1,s=t[u],o(i,s)<0);)t[n]=s,n=u;return t[n]=i},y=function(t,e,n){var o,i,s,u,a;for(null==n&&(n=r),i=t.length,a=e,s=t[e],o=2*e+1;o<i;)u=o+1,u<i&&!(n(t[o],t[u])<0)&&(o=u),t[e]=t[o],e=o,o=2*e+1;return t[e]=s,g(t,a,e,n)},t=function(){function t(t){this.cmp=null!=t?t:r,this.nodes=[]}return t.push=u,t.pop=s,t.replace=f,t.pushpop=a,t.heapify=i,t.updateItem=d,t.nlargest=h,t.nsmallest=c,t.prototype.push=function(t){return u(this.nodes,t,this.cmp)},t.prototype.pop=function(){return s(this.nodes,this.cmp)},t.prototype.peek=function(){return this.nodes[0]},t.prototype.contains=function(t){return this.nodes.indexOf(t)!==-1},t.prototype.replace=function(t){return f(this.nodes,t,this.cmp)},t.prototype.pushpop=function(t){return a(this.nodes,t,this.cmp)},t.prototype.heapify=function(){return i(this.nodes,this.cmp)},t.prototype.updateItem=function(t){return d(this.nodes,t,this.cmp)},t.prototype.clear=function(){return this.nodes=[]},t.prototype.empty=function(){return 0===this.nodes.length},t.prototype.size=function(){return this.nodes.length},t.prototype.clone=function(){var e;return e=new t,e.nodes=this.nodes.slice(0),e},t.prototype.toArray=function(){return this.nodes.slice(0)},t.prototype.insert=t.prototype.push,t.prototype.top=t.prototype.peek,t.prototype.front=t.prototype.peek,t.prototype.has=t.prototype.contains,t.prototype.copy=t.prototype.clone,t}(),function(t,r){return"function"==typeof define&&define.amd?define([],r):"object"==typeof n?e.exports=r():t.Heap=r()}(this,function(){return t})}).call(this)}),t.define("assert",function(t,e,n,r,o){function i(t,e){return void 0===e?""+e:"number"!=typeof e||!isNaN(e)&&isFinite(e)?"function"==typeof e||e instanceof RegExp?e.toString():e:e.toString()}function s(t,e){return"string"==typeof t?t.length<e?t:t.slice(0,e):t}function u(t,e,n,r,o){throw new b.AssertionError({message:n,actual:t,expected:e,operator:r,stackStartFunction:o})}function a(t,e){t||u(t,!0,e,"==",b.ok)}function f(t,e){if(t===e)return!0;if(y.isBuffer(t)&&y.isBuffer(e)){if(t.length!=e.length)return!1;for(var n=0;n<t.length;n++)if(t[n]!==e[n])return!1;return!0}return t instanceof Date&&e instanceof Date?t.getTime()===e.getTime():"object"!=typeof t&&"object"!=typeof e?t==e:h(t,e)}function l(t){return null===t||void 0===t}function p(t){return"[object Arguments]"==Object.prototype.toString.call(t)}function h(t,e){if(l(t)||l(e))return!1;if(t.prototype!==e.prototype)return!1;if(p(t))return!!p(e)&&(t=v.call(t),e=v.call(e),f(t,e));try{var n,r,o=Object.keys(t),i=Object.keys(e)}catch(t){return!1}if(o.length!=i.length)return!1;for(o.sort(),i.sort(),r=o.length-1;r>=0;r--)if(o[r]!=i[r])return!1;for(r=o.length-1;r>=0;r--)if(n=o[r],!f(t[n],e[n]))return!1;return!0}function c(t,e){return!(!t||!e)&&(e instanceof RegExp?e.test(t):t instanceof e||e.call({},t)===!0)}function d(t,e,n,r){var o;"string"==typeof n&&(r=n,n=null);try{e()}catch(t){o=t}if(r=(n&&n.name?" ("+n.name+").":".")+(r?" "+r:"."),t&&!o&&u("Missing expected exception"+r),!t&&c(o,n)&&u("Got unwanted exception"+r),t&&o&&n&&!c(o,n)||!t&&o)throw o}var g=t("util"),y=t("buffer").Buffer,v=Array.prototype.slice,b=e.exports=a;b.AssertionError=function(t){this.name="AssertionError",this.message=t.message,this.actual=t.actual,this.expected=t.expected,this.operator=t.operator;var e=t.stackStartFunction||u;Error.captureStackTrace&&Error.captureStackTrace(this,e)},g.inherits(b.AssertionError,Error),b.AssertionError.prototype.toString=function(){return this.message?[this.name+":",this.message].join(" "):[this.name+":",s(JSON.stringify(this.actual,i),128),this.operator,s(JSON.stringify(this.expected,i),128)].join(" ")},b.AssertionError.__proto__=Error.prototype,b.fail=u,b.ok=a,b.equal=function(t,e,n){t!=e&&u(t,e,n,"==",b.equal)},b.notEqual=function(t,e,n){t==e&&u(t,e,n,"!=",b.notEqual)},b.deepEqual=function(t,e,n){f(t,e)||u(t,e,n,"deepEqual",b.deepEqual)},b.notDeepEqual=function(t,e,n){f(t,e)&&u(t,e,n,"notDeepEqual",b.notDeepEqual)},b.strictEqual=function(t,e,n){t!==e&&u(t,e,n,"===",b.strictEqual)},b.notStrictEqual=function(t,e,n){t===e&&u(t,e,n,"!==",b.notStrictEqual)},b.throws=function(t,e,n){d.apply(this,[!0].concat(v.call(arguments)))},b.doesNotThrow=function(t,e,n){d.apply(this,[!1].concat(v.call(arguments)))},b.ifError=function(t){if(t)throw t}}),t.define("util",function(t,e,n,r,o){function i(t){return t instanceof Array||Array.isArray(t)||t&&t!==Object.prototype&&i(t.__proto__)}function s(t){return t instanceof RegExp||"object"==typeof t&&"[object RegExp]"===Object.prototype.toString.call(t)}function u(t){if(t instanceof Date)return!0;if("object"!=typeof t)return!1;var e=Date.prototype&&f(Date.prototype),n=t.__proto__&&f(t.__proto__);return JSON.stringify(n)===JSON.stringify(e)}t("events");n.print=function(){},n.puts=function(){},n.debug=function(){},n.inspect=function(t,e,r,o){function l(t,r){if(t&&"function"==typeof t.inspect&&t!==n&&(!t.constructor||t.constructor.prototype!==t))return t.inspect(r);switch(typeof t){case"undefined":return h("undefined","undefined");case"string":var o="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return h(o,"string");case"number":return h(""+t,"number");case"boolean":return h(""+t,"boolean")}if(null===t)return h("null","null");var c=a(t),d=e?f(t):c;if("function"==typeof t&&0===d.length){if(s(t))return h(""+t,"regexp");var g=t.name?": "+t.name:"";return h("[Function"+g+"]","special")}if(u(t)&&0===d.length)return h(t.toUTCString(),"date");var y,v,b;if(i(t)?(v="Array",b=["[","]"]):(v="Object",b=["{","}"]),"function"==typeof t){var w=t.name?": "+t.name:"";y=s(t)?" "+t:" [Function"+w+"]"}else y="";if(u(t)&&(y=" "+t.toUTCString()),0===d.length)return b[0]+y+b[1];if(r<0)return s(t)?h(""+t,"regexp"):h("[Object]","special");p.push(t);var m=d.map(function(e){var n,o;if(t.__lookupGetter__&&(t.__lookupGetter__(e)?o=t.__lookupSetter__(e)?h("[Getter/Setter]","special"):h("[Getter]","special"):t.__lookupSetter__(e)&&(o=h("[Setter]","special"))),c.indexOf(e)<0&&(n="["+e+"]"),o||(p.indexOf(t[e])<0?(o=null===r?l(t[e]):l(t[e],r-1),o.indexOf("\n")>-1&&(o=i(t)?o.split("\n").map(function(t){return" "+t}).join("\n").substr(2):"\n"+o.split("\n").map(function(t){return" "+t}).join("\n"))):o=h("[Circular]","special")),"undefined"==typeof n){if("Array"===v&&e.match(/^\d+$/))return o;n=JSON.stringify(""+e),n.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(n=n.substr(1,n.length-2),n=h(n,"name")):(n=n.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),n=h(n,"string"))}return n+": "+o});p.pop();var E=0,k=m.reduce(function(t,e){return E++,e.indexOf("\n")>=0&&E++,t+e.length+1},0);return m=k>50?b[0]+(""===y?"":y+"\n ")+" "+m.join(",\n ")+" "+b[1]:b[0]+y+" "+m.join(", ")+" "+b[1]}var p=[],h=function(t,e){var n={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},r={special:"cyan",number:"blue",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"}[e];return r?"["+n[r][0]+"m"+t+"["+n[r][1]+"m":t};return o||(h=function(t,e){return t}),l(t,"undefined"==typeof r?2:r)};n.log=function(t){},n.pump=null;var a=Object.keys||function(t){var e=[];for(var n in t)e.push(n);return e},f=Object.getOwnPropertyNames||function(t){var e=[];for(var n in t)Object.hasOwnProperty.call(t,n)&&e.push(n);return e},l=Object.create||function(t,e){var n;if(null===t)n={__proto__:null};else{if("object"!=typeof t)throw new TypeError("typeof prototype["+typeof t+"] != 'object'");var r=function(){};r.prototype=t,n=new r,n.__proto__=t}return"undefined"!=typeof e&&Object.defineProperties&&Object.defineProperties(n,e),n};n.inherits=function(t,e){t.super_=e,t.prototype=l(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}})}}),t.define("events",function(t,e,n,r,o){process.EventEmitter||(process.EventEmitter=function(){});var i=n.EventEmitter=process.EventEmitter,s="function"==typeof Array.isArray?Array.isArray:function(t){return"[object Array]"===Object.prototype.toString.call(t)},u=10;i.prototype.setMaxListeners=function(t){this._events||(this._events={}),this._events.maxListeners=t},i.prototype.emit=function(t){if("error"===t&&(!this._events||!this._events.error||s(this._events.error)&&!this._events.error.length))throw arguments[1]instanceof Error?arguments[1]:new Error("Uncaught, unspecified 'error' event.");if(!this._events)return!1;var e=this._events[t];if(!e)return!1;if("function"==typeof e){switch(arguments.length){case 1:e.call(this);break;case 2:e.call(this,arguments[1]);break;case 3:e.call(this,arguments[1],arguments[2]);break;default:var n=Array.prototype.slice.call(arguments,1);e.apply(this,n)}return!0}if(s(e)){for(var n=Array.prototype.slice.call(arguments,1),r=e.slice(),o=0,i=r.length;o<i;o++)r[o].apply(this,n);return!0}return!1},i.prototype.addListener=function(t,e){if("function"!=typeof e)throw new Error("addListener only takes instances of Function");if(this._events||(this._events={}),this.emit("newListener",t,e),this._events[t])if(s(this._events[t])){if(!this._events[t].warned){var n;n=void 0!==this._events.maxListeners?this._events.maxListeners:u,n&&n>0&&this._events[t].length>n&&(this._events[t].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[t].length),console.trace())}this._events[t].push(e)}else this._events[t]=[this._events[t],e];else this._events[t]=e;return this},i.prototype.on=i.prototype.addListener,i.prototype.once=function(t,e){var n=this;return n.on(t,function r(){n.removeListener(t,r),e.apply(this,arguments)}),this},i.prototype.removeListener=function(t,e){if("function"!=typeof e)throw new Error("removeListener only takes instances of Function");if(!this._events||!this._events[t])return this;var n=this._events[t];if(s(n)){var r=n.indexOf(e);if(r<0)return this;n.splice(r,1),0==n.length&&delete this._events[t]}else this._events[t]===e&&delete this._events[t];return this},i.prototype.removeAllListeners=function(t){return t&&this._events&&this._events[t]&&(this._events[t]=null),this},i.prototype.listeners=function(t){return this._events||(this._events={}),this._events[t]||(this._events[t]=[]),s(this._events[t])||(this._events[t]=[this._events[t]]),this._events[t]}}),t.define("buffer",function(t,e,n,r,o){function i(t){this.length=t}function s(t){return t<16?"0"+t.toString(16):t.toString(16)}function u(t){return t=~~Math.ceil(+t),t<0?0:t}function a(t,e,n){if(!(this instanceof a))return new a(t,e,n);var r;if("number"==typeof n)this.length=u(e),this.parent=t,this.offset=n;else{switch(r=typeof t){case"number":this.length=u(t);break;case"string":this.length=a.byteLength(t,e);break;case"object":this.length=u(t.length);break;default:throw new Error("First argument needs to be a number, array or string.")}if(this.length>a.poolSize?(this.parent=new i(this.length),this.offset=0):((!x||x.length-x.used<this.length)&&l(),this.parent=x,this.offset=x.used,x.used+=this.length),f(t))for(var o=0;o<this.length;o++)this.parent[o+this.offset]=t[o];else"string"==r&&(this.length=this.write(t,0,e))}}function f(t){return Array.isArray(t)||a.isBuffer(t)||t&&"object"==typeof t&&"number"==typeof t.length}function l(){x=new i(a.poolSize),x.used=0}function p(t,e,n,r){var o=0;return r||(j.ok("boolean"==typeof n,"missing or invalid endian"),j.ok(void 0!==e&&null!==e,"missing offset"),j.ok(e+1<t.length,"Trying to read beyond buffer length")),n?(o=t[e]<<8,o|=t[e+1]):(o=t[e],o|=t[e+1]<<8),o}function h(t,e,n,r){var o=0;return r||(j.ok("boolean"==typeof n,"missing or invalid endian"),j.ok(void 0!==e&&null!==e,"missing offset"),j.ok(e+3<t.length,"Trying to read beyond buffer length")),n?(o=t[e+1]<<16,o|=t[e+2]<<8,o|=t[e+3],o+=t[e]<<24>>>0):(o=t[e+2]<<16,o|=t[e+1]<<8,o|=t[e],o+=t[e+3]<<24>>>0),o}function c(t,e,n,r){var o,i;return r||(j.ok("boolean"==typeof n,"missing or invalid endian"),j.ok(void 0!==e&&null!==e,"missing offset"),j.ok(e+1<t.length,"Trying to read beyond buffer length")),i=p(t,e,n,r),o=32768&i,o?(65535-i+1)*-1:i}function d(t,e,n,r){var o,i;return r||(j.ok("boolean"==typeof n,"missing or invalid endian"),j.ok(void 0!==e&&null!==e,"missing offset"),j.ok(e+3<t.length,"Trying to read beyond buffer length")),i=h(t,e,n,r),o=2147483648&i,o?(4294967295-i+1)*-1:i}function g(e,n,r,o){return o||(j.ok("boolean"==typeof r,"missing or invalid endian"),j.ok(n+3<e.length,"Trying to read beyond buffer length")),t("buffer_ieee754").readIEEE754(e,n,r,23,4)}function y(e,n,r,o){return o||(j.ok("boolean"==typeof r,"missing or invalid endian"),j.ok(n+7<e.length,"Trying to read beyond buffer length")),t("buffer_ieee754").readIEEE754(e,n,r,52,8)}function v(t,e){j.ok("number"==typeof t,"cannot write a non-number as a number"),j.ok(t>=0,"specified a negative value for writing an unsigned value"),j.ok(t<=e,"value is larger than maximum value for type"),j.ok(Math.floor(t)===t,"value has a fractional component")}function b(t,e,n,r,o){o||(j.ok(void 0!==e&&null!==e,"missing value"),j.ok("boolean"==typeof r,"missing or invalid endian"),j.ok(void 0!==n&&null!==n,"missing offset"),j.ok(n+1<t.length,"trying to write beyond buffer length"),v(e,65535)),r?(t[n]=(65280&e)>>>8,t[n+1]=255&e):(t[n+1]=(65280&e)>>>8,t[n]=255&e)}function w(t,e,n,r,o){o||(j.ok(void 0!==e&&null!==e,"missing value"),j.ok("boolean"==typeof r,"missing or invalid endian"),j.ok(void 0!==n&&null!==n,"missing offset"),j.ok(n+3<t.length,"trying to write beyond buffer length"),v(e,4294967295)),r?(t[n]=e>>>24&255,t[n+1]=e>>>16&255,t[n+2]=e>>>8&255,t[n+3]=255&e):(t[n+3]=e>>>24&255,t[n+2]=e>>>16&255,t[n+1]=e>>>8&255,t[n]=255&e)}function m(t,e,n){j.ok("number"==typeof t,"cannot write a non-number as a number"),j.ok(t<=e,"value larger than maximum allowed value"),j.ok(t>=n,"value smaller than minimum allowed value"),j.ok(Math.floor(t)===t,"value has a fractional component")}function E(t,e,n){j.ok("number"==typeof t,"cannot write a non-number as a number"),j.ok(t<=e,"value larger than maximum allowed value"),j.ok(t>=n,"value smaller than minimum allowed value")}function k(t,e,n,r,o){o||(j.ok(void 0!==e&&null!==e,"missing value"),j.ok("boolean"==typeof r,"missing or invalid endian"),j.ok(void 0!==n&&null!==n,"missing offset"),j.ok(n+1<t.length,"Trying to write beyond buffer length"),m(e,32767,-32768)),e>=0?b(t,e,n,r,o):b(t,65535+e+1,n,r,o)}function _(t,e,n,r,o){o||(j.ok(void 0!==e&&null!==e,"missing value"),j.ok("boolean"==typeof r,"missing or invalid endian"),j.ok(void 0!==n&&null!==n,"missing offset"),j.ok(n+3<t.length,"Trying to write beyond buffer length"),m(e,2147483647,-2147483648)),e>=0?w(t,e,n,r,o):w(t,4294967295+e+1,n,r,o)}function I(e,n,r,o,i){i||(j.ok(void 0!==n&&null!==n,"missing value"),j.ok("boolean"==typeof o,"missing or invalid endian"),j.ok(void 0!==r&&null!==r,"missing offset"),j.ok(r+3<e.length,"Trying to write beyond buffer length"),E(n,3.4028234663852886e38,-3.4028234663852886e38)),t("buffer_ieee754").writeIEEE754(e,n,r,o,23,4)}function S(e,n,r,o,i){i||(j.ok(void 0!==n&&null!==n,"missing value"),j.ok("boolean"==typeof o,"missing or invalid endian"),j.ok(void 0!==r&&null!==r,"missing offset"),j.ok(r+7<e.length,"Trying to write beyond buffer length"),E(n,1.7976931348623157e308,-1.7976931348623157e308)),t("buffer_ieee754").writeIEEE754(e,n,r,o,52,8)}var j=t("assert");n.INSPECT_MAX_BYTES=50,i.prototype.inspect=function(){for(var t=[],e=this.length,r=0;r<e;r++)if(t[r]=s(this[r]),r==n.INSPECT_MAX_BYTES){t[r+1]="...";break}return"<SlowBuffer "+t.join(" ")+">"},i.prototype.hexSlice=function(t,e){var n=this.length;(!t||t<0)&&(t=0),(!e||e<0||e>n)&&(e=n);for(var r="",o=t;o<e;o++)r+=s(this[o]);return r},i.prototype.toString=function(t,e,n){if(t=String(t||"utf8").toLowerCase(),e=+e||0,"undefined"==typeof n&&(n=this.length),+n==e)return"";switch(t){case"hex":return this.hexSlice(e,n);case"utf8":case"utf-8":return this.utf8Slice(e,n);case"ascii":return this.asciiSlice(e,n);case"binary":return this.binarySlice(e,n);case"base64":return this.base64Slice(e,n);case"ucs2":case"ucs-2":return this.ucs2Slice(e,n);default:throw new Error("Unknown encoding")}},i.prototype.hexWrite=function(t,e,n){e=+e||0;var r=this.length-e;n?(n=+n,n>r&&(n=r)):n=r;var o=t.length;if(o%2)throw new Error("Invalid hex string");n>o/2&&(n=o/2);for(var s=0;s<n;s++){var u=parseInt(t.substr(2*s,2),16);if(isNaN(u))throw new Error("Invalid hex string");this[e+s]=u}return i._charsWritten=2*s,s},i.prototype.write=function(t,e,n,r){if(isFinite(e))isFinite(n)||(r=n,n=void 0);else{var o=r;r=e,e=n,n=o}e=+e||0;var i=this.length-e;switch(n?(n=+n,n>i&&(n=i)):n=i,r=String(r||"utf8").toLowerCase()){case"hex":return this.hexWrite(t,e,n);case"utf8":case"utf-8":return this.utf8Write(t,e,n);case"ascii":return this.asciiWrite(t,e,n);case"binary":return this.binaryWrite(t,e,n);case"base64":return this.base64Write(t,e,n);case"ucs2":case"ucs-2":return this.ucs2Write(t,e,n);default:throw new Error("Unknown encoding")}},i.prototype.slice=function(t,e){if(void 0===e&&(e=this.length),e>this.length)throw new Error("oob");if(t>e)throw new Error("oob");return new a(this,e-t,+t)},n.SlowBuffer=i,n.Buffer=a,a.poolSize=8192;var x;a.isBuffer=function(t){return t instanceof a||t instanceof i},a.prototype.inspect=function(){for(var t=[],e=this.length,r=0;r<e;r++)if(t[r]=s(this.parent[r+this.offset]),r==n.INSPECT_MAX_BYTES){t[r+1]="...";break}return"<Buffer "+t.join(" ")+">"},a.prototype.get=function(t){if(t<0||t>=this.length)throw new Error("oob");return this.parent[this.offset+t]},a.prototype.set=function(t,e){if(t<0||t>=this.length)throw new Error("oob");return this.parent[this.offset+t]=e},a.prototype.write=function(t,e,n,r){if(isFinite(e))isFinite(n)||(r=n,n=void 0);else{var o=r;r=e,e=n,n=o}e=+e||0;var s=this.length-e;n?(n=+n,n>s&&(n=s)):n=s,r=String(r||"utf8").toLowerCase();var u;switch(r){case"hex":u=this.parent.hexWrite(t,this.offset+e,n);break;case"utf8":case"utf-8":u=this.parent.utf8Write(t,this.offset+e,n);break;case"ascii":u=this.parent.asciiWrite(t,this.offset+e,n);break;case"binary":u=this.parent.binaryWrite(t,this.offset+e,n);break;case"base64":u=this.parent.base64Write(t,this.offset+e,n);break;case"ucs2":case"ucs-2":u=this.parent.ucs2Write(t,this.offset+e,n);break;default:throw new Error("Unknown encoding")}return a._charsWritten=i._charsWritten,u},a.prototype.toString=function(t,e,n){switch(t=String(t||"utf8").toLowerCase(),"undefined"==typeof e||e<0?e=0:e>this.length&&(e=this.length),"undefined"==typeof n||n>this.length?n=this.length:n<0&&(n=0),e+=this.offset,n+=this.offset,t){case"hex":return this.parent.hexSlice(e,n);case"utf8":case"utf-8":return this.parent.utf8Slice(e,n);case"ascii":return this.parent.asciiSlice(e,n);case"binary":return this.parent.binarySlice(e,n);case"base64":return this.parent.base64Slice(e,n);case"ucs2":case"ucs-2":return this.parent.ucs2Slice(e,n);default:throw new Error("Unknown encoding")}},a.byteLength=i.byteLength,a.prototype.fill=function(t,e,n){if(t||(t=0),e||(e=0),n||(n=this.length),"string"==typeof t&&(t=t.charCodeAt(0)),"number"!=typeof t||isNaN(t))throw new Error("value is not a number");if(n<e)throw new Error("end < start");if(n===e)return 0;if(0==this.length)return 0;if(e<0||e>=this.length)throw new Error("start out of bounds");if(n<0||n>this.length)throw new Error("end out of bounds");return this.parent.fill(t,e+this.offset,n+this.offset)},a.prototype.copy=function(t,e,n,r){var o=this;if(n||(n=0),r||(r=this.length),e||(e=0),r<n)throw new Error("sourceEnd < sourceStart");if(r===n)return 0;if(0==t.length||0==o.length)return 0;if(e<0||e>=t.length)throw new Error("targetStart out of bounds");if(n<0||n>=o.length)throw new Error("sourceStart out of bounds");if(r<0||r>o.length)throw new Error("sourceEnd out of bounds");return r>this.length&&(r=this.length),t.length-e<r-n&&(r=t.length-e+n),this.parent.copy(t.parent,e+t.offset,n+this.offset,r+this.offset)},a.prototype.slice=function(t,e){if(void 0===e&&(e=this.length),e>this.length)throw new Error("oob");if(t>e)throw new Error("oob");return new a(this.parent,e-t,+t+this.offset)},a.prototype.utf8Slice=function(t,e){return this.toString("utf8",t,e)},a.prototype.binarySlice=function(t,e){return this.toString("binary",t,e)},a.prototype.asciiSlice=function(t,e){return this.toString("ascii",t,e)},a.prototype.utf8Write=function(t,e){return this.write(t,e,"utf8")},a.prototype.binaryWrite=function(t,e){return this.write(t,e,"binary")},a.prototype.asciiWrite=function(t,e){return this.write(t,e,"ascii")},a.prototype.readUInt8=function(t,e){var n=this;return e||(j.ok(void 0!==t&&null!==t,"missing offset"),j.ok(t<n.length,"Trying to read beyond buffer length")),n[t]},a.prototype.readUInt16LE=function(t,e){return p(this,t,!1,e)},a.prototype.readUInt16BE=function(t,e){return p(this,t,!0,e)},a.prototype.readUInt32LE=function(t,e){return h(this,t,!1,e)},a.prototype.readUInt32BE=function(t,e){return h(this,t,!0,e)},a.prototype.readInt8=function(t,e){var n,r=this;return e||(j.ok(void 0!==t&&null!==t,"missing offset"),j.ok(t<r.length,"Trying to read beyond buffer length")),n=128&r[t],n?(255-r[t]+1)*-1:r[t]},a.prototype.readInt16LE=function(t,e){return c(this,t,!1,e)},a.prototype.readInt16BE=function(t,e){return c(this,t,!0,e)},a.prototype.readInt32LE=function(t,e){return d(this,t,!1,e)},a.prototype.readInt32BE=function(t,e){return d(this,t,!0,e)},a.prototype.readFloatLE=function(t,e){return g(this,t,!1,e)},a.prototype.readFloatBE=function(t,e){return g(this,t,!0,e)},a.prototype.readDoubleLE=function(t,e){return y(this,t,!1,e)},a.prototype.readDoubleBE=function(t,e){return y(this,t,!0,e)},a.prototype.writeUInt8=function(t,e,n){var r=this;n||(j.ok(void 0!==t&&null!==t,"missing value"),j.ok(void 0!==e&&null!==e,"missing offset"),j.ok(e<r.length,"trying to write beyond buffer length"),v(t,255)),r[e]=t},a.prototype.writeUInt16LE=function(t,e,n){b(this,t,e,!1,n)},a.prototype.writeUInt16BE=function(t,e,n){b(this,t,e,!0,n)},a.prototype.writeUInt32LE=function(t,e,n){w(this,t,e,!1,n)},a.prototype.writeUInt32BE=function(t,e,n){w(this,t,e,!0,n)},a.prototype.writeInt8=function(t,e,n){var r=this;n||(j.ok(void 0!==t&&null!==t,"missing value"),j.ok(void 0!==e&&null!==e,"missing offset"),j.ok(e<r.length,"Trying to write beyond buffer length"),m(t,127,-128)),t>=0?r.writeUInt8(t,e,n):r.writeUInt8(255+t+1,e,n)},a.prototype.writeInt16LE=function(t,e,n){k(this,t,e,!1,n)},a.prototype.writeInt16BE=function(t,e,n){k(this,t,e,!0,n)},a.prototype.writeInt32LE=function(t,e,n){_(this,t,e,!1,n)},a.prototype.writeInt32BE=function(t,e,n){_(this,t,e,!0,n)},a.prototype.writeFloatLE=function(t,e,n){I(this,t,e,!1,n)},a.prototype.writeFloatBE=function(t,e,n){I(this,t,e,!0,n)},a.prototype.writeDoubleLE=function(t,e,n){S(this,t,e,!1,n)},a.prototype.writeDoubleBE=function(t,e,n){S(this,t,e,!0,n)},i.prototype.readUInt8=a.prototype.readUInt8,i.prototype.readUInt16LE=a.prototype.readUInt16LE,i.prototype.readUInt16BE=a.prototype.readUInt16BE,i.prototype.readUInt32LE=a.prototype.readUInt32LE,i.prototype.readUInt32BE=a.prototype.readUInt32BE,i.prototype.readInt8=a.prototype.readInt8,i.prototype.readInt16LE=a.prototype.readInt16LE,i.prototype.readInt16BE=a.prototype.readInt16BE,i.prototype.readInt32LE=a.prototype.readInt32LE,i.prototype.readInt32BE=a.prototype.readInt32BE,i.prototype.readFloatLE=a.prototype.readFloatLE,i.prototype.readFloatBE=a.prototype.readFloatBE,i.prototype.readDoubleLE=a.prototype.readDoubleLE,i.prototype.readDoubleBE=a.prototype.readDoubleBE,i.prototype.writeUInt8=a.prototype.writeUInt8,i.prototype.writeUInt16LE=a.prototype.writeUInt16LE,i.prototype.writeUInt16BE=a.prototype.writeUInt16BE,i.prototype.writeUInt32LE=a.prototype.writeUInt32LE,i.prototype.writeUInt32BE=a.prototype.writeUInt32BE,i.prototype.writeInt8=a.prototype.writeInt8,i.prototype.writeInt16LE=a.prototype.writeInt16LE,i.prototype.writeInt16BE=a.prototype.writeInt16BE,i.prototype.writeInt32LE=a.prototype.writeInt32LE,i.prototype.writeInt32BE=a.prototype.writeInt32BE,i.prototype.writeFloatLE=a.prototype.writeFloatLE,i.prototype.writeFloatBE=a.prototype.writeFloatBE,i.prototype.writeDoubleLE=a.prototype.writeDoubleLE,i.prototype.writeDoubleBE=a.prototype.writeDoubleBE}),t.define("buffer_ieee754",function(t,e,n,r,o){n.readIEEE754=function(t,e,n,r,o){var i,s,u=8*o-r-1,a=(1<<u)-1,f=a>>1,l=-7,p=n?0:o-1,h=n?1:-1,c=t[e+p];for(p+=h,i=c&(1<<-l)-1,c>>=-l,l+=u;l>0;i=256*i+t[e+p],p+=h,l-=8);for(s=i&(1<<-l)-1,i>>=-l,l+=r;l>0;s=256*s+t[e+p],p+=h,l-=8);if(0===i)i=1-f;else{if(i===a)return s?NaN:(c?-1:1)*(1/0);s+=Math.pow(2,r),i-=f}return(c?-1:1)*s*Math.pow(2,i-r)},n.writeIEEE754=function(t,e,n,r,o,i){var s,u,a,f=8*i-o-1,l=(1<<f)-1,p=l>>1,h=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,c=r?i-1:0,d=r?-1:1,g=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(u=isNaN(e)?1:0,s=l):(s=Math.floor(Math.log(e)/Math.LN2),e*(a=Math.pow(2,-s))<1&&(s--,a*=2),e+=s+p>=1?h/a:h*Math.pow(2,1-p),e*a>=2&&(s++,a/=2),s+p>=l?(u=0,s=l):s+p>=1?(u=(e*a-1)*Math.pow(2,o),s+=p):(u=e*Math.pow(2,p-1)*Math.pow(2,o),s=0));o>=8;t[n+c]=255&u,c+=d,u/=256,o-=8);for(s=s<<o|u,f+=o;f>0;t[n+c]=255&s,c+=d,s/=256,f-=8);t[n+c-d]|=128*g}}),t.define("/difflib.js",function(t,e,n,r,o){(function(){var e,r,o,i,s,u,a,f,l,p,h,c,d,g,y,v,b,w,m,E,k,_=[].indexOf||function(t){for(var e=0,n=this.length;e<n;e++)if(e in this&&this[e]===t)return e;return-1};f=Math.floor,p=Math.max,h=Math.min,r=t("heap"),u=t("assert"),b=function(t,e){return e?2*t/e:1},v=function(t,e){var n,r,o,i,s,u;for(s=[t.length,e.length],r=s[0],o=s[1],n=i=0,u=h(r,o);0<=u?i<u:i>u;n=0<=u?++i:--i){if(t[n]<e[n])return-1;if(t[n]>e[n])return 1}return r-o},k=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},y=function(t){var e,n,r;for(n=0,r=t.length;n<r;n++)if(e=t[n])return!0;return!1},s=function(){function t(t,e,n,r){this.isjunk=t,null==e&&(e=""),null==n&&(n=""),this.autojunk=null==r||r,this.a=this.b=null,this.setSeqs(e,n)}return t.prototype.setSeqs=function(t,e){return this.setSeq1(t),this.setSeq2(e)},t.prototype.setSeq1=function(t){if(t!==this.a)return this.a=t,this.matchingBlocks=this.opcodes=null},t.prototype.setSeq2=function(t){if(t!==this.b)return this.b=t,this.matchingBlocks=this.opcodes=null,this.fullbcount=null,
this._chainB()},t.prototype._chainB=function(){var t,e,n,r,o,i,s,u,a,l,p,h,c,d,g,y;for(t=this.b,this.b2j=e={},r=h=0,d=t.length;h<d;r=++h)n=t[r],i=k(e,n)?e[n]:e[n]=[],i.push(r);if(u={},s=this.isjunk)for(y=Object.keys(e),c=0,g=y.length;c<g;c++)n=y[c],s(n)&&(u[n]=!0,delete e[n]);if(p={},a=t.length,this.autojunk&&a>=200){l=f(a/100)+1;for(n in e)o=e[n],o.length>l&&(p[n]=!0,delete e[n])}return this.isbjunk=function(t){return k(u,t)},this.isbpopular=function(t){return k(p,t)}},t.prototype.findLongestMatch=function(t,e,n,r){var o,i,s,u,a,f,l,p,h,c,d,g,y,v,b,w,m,E,_,I,S;for(w=[this.a,this.b,this.b2j,this.isbjunk],o=w[0],i=w[1],s=w[2],p=w[3],m=[t,n,0],u=m[0],a=m[1],f=m[2],c={},l=y=t;t<=e?y<e:y>e;l=t<=e?++y:--y){for(g={},E=k(s,o[l])?s[o[l]]:[],v=0,b=E.length;v<b;v++)if(h=E[v],!(h<n)){if(h>=r)break;d=g[h]=(c[h-1]||0)+1,d>f&&(_=[l-d+1,h-d+1,d],u=_[0],a=_[1],f=_[2])}c=g}for(;u>t&&a>n&&!p(i[a-1])&&o[u-1]===i[a-1];)I=[u-1,a-1,f+1],u=I[0],a=I[1],f=I[2];for(;u+f<e&&a+f<r&&!p(i[a+f])&&o[u+f]===i[a+f];)f++;for(;u>t&&a>n&&p(i[a-1])&&o[u-1]===i[a-1];)S=[u-1,a-1,f+1],u=S[0],a=S[1],f=S[2];for(;u+f<e&&a+f<r&&p(i[a+f])&&o[u+f]===i[a+f];)f++;return[u,a,f]},t.prototype.getMatchingBlocks=function(){var t,e,n,r,o,i,s,u,a,f,l,p,h,c,d,g,y,b,w,m,E,k,_,I,S,j;if(this.matchingBlocks)return this.matchingBlocks;for(k=[this.a.length,this.b.length],c=k[0],d=k[1],b=[[0,c,0,d]],g=[];b.length;)_=b.pop(),e=_[0],t=_[1],r=_[2],n=_[3],I=w=this.findLongestMatch(e,t,r,n),o=I[0],u=I[1],l=I[2],l&&(g.push(w),e<o&&r<u&&b.push([e,o,r,u]),o+l<t&&u+l<n&&b.push([o+l,t,u+l,n]));for(g.sort(v),i=a=p=0,y=[],m=0,E=g.length;m<E;m++)S=g[m],s=S[0],f=S[1],h=S[2],i+p===s&&a+p===f?p+=h:(p&&y.push([i,a,p]),j=[s,f,h],i=j[0],a=j[1],p=j[2]);return p&&y.push([i,a,p]),y.push([c,d,0]),this.matchingBlocks=y},t.prototype.getOpcodes=function(){var t,e,n,r,o,i,s,u,a,f,l,p;if(this.opcodes)return this.opcodes;for(r=o=0,this.opcodes=e=[],f=this.getMatchingBlocks(),u=0,a=f.length;u<a;u++)l=f[u],t=l[0],n=l[1],i=l[2],s="",r<t&&o<n?s="replace":r<t?s="delete":o<n&&(s="insert"),s&&e.push([s,r,t,o,n]),p=[t+i,n+i],r=p[0],o=p[1],i&&e.push(["equal",t,r,n,o]);return e},t.prototype.getGroupedOpcodes=function(t){var e,n,r,o,i,s,u,a,f,l,c,d,g,y,v;for(null==t&&(t=3),e=this.getOpcodes(),e.length||(e=[["equal",0,1,0,1]]),"equal"===e[0][0]&&(d=e[0],f=d[0],o=d[1],i=d[2],s=d[3],u=d[4],e[0]=[f,p(o,i-t),i,p(s,u-t),u]),"equal"===e[e.length-1][0]&&(g=e[e.length-1],f=g[0],o=g[1],i=g[2],s=g[3],u=g[4],e[e.length-1]=[f,o,h(i,o+t),s,h(u,s+t)]),a=t+t,r=[],n=[],l=0,c=e.length;l<c;l++)y=e[l],f=y[0],o=y[1],i=y[2],s=y[3],u=y[4],"equal"===f&&i-o>a&&(n.push([f,o,h(i,o+t),s,h(u,s+t)]),r.push(n),n=[],v=[p(o,i-t),p(s,u-t)],o=v[0],s=v[1]),n.push([f,o,i,s,u]);return!n.length||1===n.length&&"equal"===n[0][0]||r.push(n),r},t.prototype.ratio=function(){var t,e,n,r,o;for(e=0,o=this.getMatchingBlocks(),n=0,r=o.length;n<r;n++)t=o[n],e+=t[2];return b(e,this.a.length+this.b.length)},t.prototype.quickRatio=function(){var t,e,n,r,o,i,s,u,a,f,l;if(!this.fullbcount)for(this.fullbcount=n={},f=this.b,i=0,u=f.length;i<u;i++)e=f[i],n[e]=(n[e]||0)+1;for(n=this.fullbcount,t={},r=0,l=this.a,s=0,a=l.length;s<a;s++)e=l[s],o=k(t,e)?t[e]:n[e]||0,t[e]=o-1,o>0&&r++;return b(r,this.a.length+this.b.length)},t.prototype.realQuickRatio=function(){var t,e,n;return n=[this.a.length,this.b.length],t=n[0],e=n[1],b(h(t,e),t+e)},t}(),l=function(t,e,n,o,i){var u,a,f,l,p,h,c,d,g,y,b;if(null==n&&(n=3),null==o&&(o=.6),!(n>0))throw new Error("n must be > 0: ("+n+")");if(!(0<=o&&o<=1))throw new Error("cutoff must be in [0.0, 1.0]: ("+o+")");for(a=[],f=new s,f.setSeq2(t),h=0,d=e.length;h<d;h++)p=e[h],u=p,i&&(p=i(p)),f.setSeq1(p),f.realQuickRatio()>=o&&f.quickRatio()>=o&&f.ratio()>=o&&a.push([f.ratio(),u]);for(a=r.nlargest(a,n,v),b=[],c=0,g=a.length;c<g;c++)y=a[c],l=y[0],p=y[1],b.push(p);return b},w=function(t,e){var n,r,o;for(o=[0,t.length],n=o[0],r=o[1];n<r&&t[n]===e;)n++;return n},e=function(){function t(t,e){this.linejunk=t,this.charjunk=e}return t.prototype.compare=function(t,e){var n,r,o,i,u,a,f,l,p,h,c,d,g,y,v;for(u=new s(this.linejunk,t,e),l=[],y=u.getOpcodes(),h=0,d=y.length;h<d;h++){switch(v=y[h],p=v[0],r=v[1],n=v[2],i=v[3],o=v[4],p){case"replace":a=this._fancyReplace(t,r,n,e,i,o);break;case"delete":a=this._dump("-",t,r,n);break;case"insert":a=this._dump("+",e,i,o);break;case"equal":a=this._dump(" ",t,r,n);break;default:throw new Error("unknow tag ("+p+")")}for(c=0,g=a.length;c<g;c++)f=a[c],l.push(f)}return l},t.prototype._dump=function(t,e,n,r){var o,i,s;for(s=[],o=i=n;n<=r?i<r:i>r;o=n<=r?++i:--i)s.push(""+t+" "+e[o]);return s},t.prototype._plainReplace=function(t,e,n,r,o,i){var s,a,f,l,p,h,c,d,g,y;for(u(e<n&&o<i),i-o<n-e?(s=this._dump("+",r,o,i),p=this._dump("-",t,e,n)):(s=this._dump("-",t,e,n),p=this._dump("+",r,o,i)),l=[],y=[s,p],h=0,d=y.length;h<d;h++)for(a=y[h],c=0,g=a.length;c<g;c++)f=a[c],l.push(f);return l},t.prototype._fancyReplace=function(t,e,n,r,o,i){var u,a,f,l,p,h,c,d,g,y,v,b,w,m,E,k,_,I,S,j,x,L,B,A,U,q,O,M,T,N,F,D,R,W,C,$,z,P,G,J,H,Q,X,Y,K,Z,V,tt,et;for(z=[.74,.75],c=z[0],E=z[1],m=new s(this.charjunk),P=[null,null],k=P[0],_=P[1],B=[],S=U=o;o<=i?U<i:U>i;S=o<=i?++U:--U)for(y=r[S],m.setSeq2(y),I=q=e;e<=n?q<n:q>n;I=e<=n?++q:--q)a=t[I],a!==y?(m.setSeq1(a),m.realQuickRatio()>c&&m.quickRatio()>c&&m.ratio()>c&&(X=[m.ratio(),I,S],c=X[0],d=X[1],g=X[2])):null===k&&(Q=[I,S],k=Q[0],_=Q[1]);if(c<E){if(null===k){for(Y=this._plainReplace(t,e,n,r,o,i),O=0,T=Y.length;O<T;O++)L=Y[O],B.push(L);return B}K=[k,_,1],d=K[0],g=K[1],c=K[2]}else k=null;for(Z=this._fancyHelper(t,e,d,r,o,g),M=0,N=Z.length;M<N;M++)L=Z[M],B.push(L);if(V=[t[d],r[g]],u=V[0],h=V[1],null===k){for(p=w="",m.setSeqs(u,h),tt=m.getOpcodes(),W=0,F=tt.length;W<F;W++)switch(et=tt[W],A=et[0],f=et[1],l=et[2],v=et[3],b=et[4],G=[l-f,b-v],j=G[0],x=G[1],A){case"replace":p+=Array(j+1).join("^"),w+=Array(x+1).join("^");break;case"delete":p+=Array(j+1).join("-");break;case"insert":w+=Array(x+1).join("+");break;case"equal":p+=Array(j+1).join(" "),w+=Array(x+1).join(" ");break;default:throw new Error("unknow tag ("+A+")")}for(J=this._qformat(u,h,p,w),C=0,D=J.length;C<D;C++)L=J[C],B.push(L)}else B.push(" "+u);for(H=this._fancyHelper(t,d+1,n,r,g+1,i),$=0,R=H.length;$<R;$++)L=H[$],B.push(L);return B},t.prototype._fancyHelper=function(t,e,n,r,o,i){var s;return s=[],e<n?s=o<i?this._fancyReplace(t,e,n,r,o,i):this._dump("-",t,e,n):o<i&&(s=this._dump("+",r,o,i)),s},t.prototype._qformat=function(t,e,n,r){var o,i;return i=[],o=h(w(t,"\t"),w(e,"\t")),o=h(o,w(n.slice(0,o)," ")),o=h(o,w(r.slice(0,o)," ")),n=n.slice(o).replace(/\s+$/,""),r=r.slice(o).replace(/\s+$/,""),i.push("- "+t),n.length&&i.push("? "+Array(o+1).join("\t")+n+"\n"),i.push("+ "+e),r.length&&i.push("? "+Array(o+1).join("\t")+r+"\n"),i},t}(),i=function(t,e){return null==e&&(e=/^\s*#?\s*$/),e.test(t)},o=function(t,e){return null==e&&(e=" \t"),_.call(e,t)>=0},E=function(t,e){var n,r;return n=t+1,r=e-t,1===r?""+n:(r||n--,""+n+","+r)},g=function(t,e,n){var r,o,i,u,a,f,l,p,h,c,d,g,y,v,b,w,m,k,_,I,S,j,x,L,B,A,U,q,O,M,T,N,F,D,R,W,C,$;for(N=null!=n?n:{},a=N.fromfile,I=N.tofile,f=N.fromfiledate,S=N.tofiledate,w=N.n,b=N.lineterm,null==a&&(a=""),null==I&&(I=""),null==f&&(f=""),null==S&&(S=""),null==w&&(w=3),null==b&&(b="\n"),v=[],m=!1,F=new s(null,t,e).getGroupedOpcodes(),j=0,A=F.length;j<A;j++)for(l=F[j],m||(m=!0,u=f?"\t"+f:"",_=S?"\t"+S:"",v.push("--- "+a+u+b),v.push("+++ "+I+_+b)),D=[l[0],l[l.length-1]],i=D[0],g=D[1],r=E(i[1],g[2]),o=E(i[3],g[4]),v.push("@@ -"+r+" +"+o+" @@"+b),x=0,U=l.length;x<U;x++)if(R=l[x],k=R[0],p=R[1],h=R[2],c=R[3],d=R[4],"equal"!==k){if("replace"===k||"delete"===k)for(C=t.slice(p,h),B=0,O=C.length;B<O;B++)y=C[B],v.push("-"+y);if("replace"===k||"insert"===k)for($=e.slice(c,d),T=0,M=$.length;T<M;T++)y=$[T],v.push("+"+y)}else for(W=t.slice(p,h),L=0,q=W.length;L<q;L++)y=W[L],v.push(" "+y);return v},m=function(t,e){var n,r;return n=t+1,r=e-t,r||n--,r<=1?""+n:""+n+","+(n+r-1)},a=function(t,e,n){var r,o,i,u,a,f,l,p,h,c,d,g,v,b,w,E,k,_,I,S,j,x,L,B,A,U,q,O,M,T,N,F,D,R,W,C,$,z,P,G;for(R=null!=n?n:{},a=R.fromfile,j=R.tofile,f=R.fromfiledate,x=R.tofiledate,E=R.n,w=R.lineterm,null==a&&(a=""),null==j&&(j=""),null==f&&(f=""),null==x&&(x=""),null==E&&(E=3),null==w&&(w="\n"),k={insert:"+ ",delete:"- ",replace:"! ",equal:" "},_=!1,b=[],W=new s(null,t,e).getGroupedOpcodes(),B=0,O=W.length;B<O;B++)if(l=W[B],!_){if(_=!0,u=f?"\t"+f:"",S=x?"\t"+x:"",b.push("*** "+a+u+w),b.push("--- "+j+S+w),C=[l[0],l[l.length-1]],i=C[0],g=C[1],b.push("***************"+w),r=m(i[1],g[2]),b.push("*** "+r+" ****"+w),y(function(){var t,e,n,r;for(r=[],t=0,e=l.length;t<e;t++)n=l[t],I=n[0],L=n[1],L=n[2],L=n[3],L=n[4],r.push("replace"===I||"delete"===I);return r}()))for(A=0,M=l.length;A<M;A++)if($=l[A],I=$[0],p=$[1],h=$[2],L=$[3],L=$[4],"insert"!==I)for(z=t.slice(p,h),U=0,T=z.length;U<T;U++)v=z[U],b.push(k[I]+v);if(o=m(i[3],g[4]),b.push("--- "+o+" ----"+w),y(function(){var t,e,n,r;for(r=[],t=0,e=l.length;t<e;t++)n=l[t],I=n[0],L=n[1],L=n[2],L=n[3],L=n[4],r.push("replace"===I||"insert"===I);return r}()))for(q=0,N=l.length;q<N;q++)if(P=l[q],I=P[0],L=P[1],L=P[2],c=P[3],d=P[4],"delete"!==I)for(G=e.slice(c,d),D=0,F=G.length;D<F;D++)v=G[D],b.push(k[I]+v)}return b},c=function(t,n,r,i){return null==i&&(i=o),new e(r,i).compare(t,n)},d=function(t,e){var n,r,o,i,s,u,a;if(i={1:"- ",2:"+ "}[e],!i)throw new Error("unknow delta choice (must be 1 or 2): "+e);for(o=[" ",i],r=[],s=0,u=t.length;s<u;s++)n=t[s],a=n.slice(0,2),_.call(o,a)>=0&&r.push(n.slice(2));return r},n._arrayCmp=v,n.SequenceMatcher=s,n.getCloseMatches=l,n._countLeading=w,n.Differ=e,n.IS_LINE_JUNK=i,n.IS_CHARACTER_JUNK=o,n._formatRangeUnified=E,n.unifiedDiff=g,n._formatRangeContext=m,n.contextDiff=a,n.ndiff=c,n.restore=d}).call(this)}),t("/difflib.js"),t("/difflib")}();