Current section
Files
Jump to
Current section
Files
priv/static/live_json.min.js
var LiveJson=(()=>{var ht=Object.create;var ge=Object.defineProperty;var vt=Object.getOwnPropertyDescriptor;var pt=Object.getOwnPropertyNames;var dt=Object.getPrototypeOf,ct=Object.prototype.hasOwnProperty;var _r=u=>ge(u,"__esModule",{value:!0});var wr=(u,p)=>()=>(p||u((p={exports:{}}).exports,p),p.exports),ke=(u,p)=>{_r(u);for(var g in p)ge(u,g,{get:p[g],enumerable:!0})},gt=(u,p,g)=>{if(p&&typeof p=="object"||typeof p=="function")for(let m of pt(p))!ct.call(u,m)&&m!=="default"&&ge(u,m,{get:()=>p[m],enumerable:!(g=vt(p,m))||g.enumerable});return u},mt=u=>gt(_r(ge(u!=null?ht(dt(u)):{},"default",u&&u.__esModule&&"default"in u?{get:()=>u.default,enumerable:!0}:{value:u,enumerable:!0})),u);var Or=wr(()=>{});var Rr=wr((Oe,Er)=>{(function(u,p){typeof Oe=="object"&&typeof Er!="undefined"?p(Oe,Or()):typeof define=="function"&&define.amd?define(["exports","./empty"],p):p(u.jsondiffpatch={},u.chalk)})(Oe,function(u,p){"use strict";p=p&&p.hasOwnProperty("default")?p.default:p;var g=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(v){return typeof v}:function(v){return v&&typeof Symbol=="function"&&v.constructor===Symbol&&v!==Symbol.prototype?"symbol":typeof v},m=function(v,e){if(!(v instanceof e))throw new TypeError("Cannot call a class as a function")},w=function(){function v(e,n){for(var t=0;t<n.length;t++){var a=n[t];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}return function(e,n,t){return n&&v(e.prototype,n),t&&v(e,t),e}}(),E=function v(e,n,t){e===null&&(e=Function.prototype);var a=Object.getOwnPropertyDescriptor(e,n);if(a===void 0){var r=Object.getPrototypeOf(e);return r===null?void 0:v(r,n,t)}else{if("value"in a)return a.value;var i=a.get;return i===void 0?void 0:i.call(t)}},A=function(v,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);v.prototype=Object.create(e&&e.prototype,{constructor:{value:v,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(v,e):v.__proto__=e)},T=function(v,e){if(!v)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:v},J=function(){function v(e,n){var t=[],a=!0,r=!1,i=void 0;try{for(var f=e[Symbol.iterator](),s;!(a=(s=f.next()).done)&&(t.push(s.value),!(n&&t.length===n));a=!0);}catch(l){r=!0,i=l}finally{try{!a&&f.return&&f.return()}finally{if(r)throw i}}return t}return function(e,n){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return v(e,n);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),I=function(v){if(Array.isArray(v)){for(var e=0,n=Array(v.length);e<v.length;e++)n[e]=v[e];return n}else return Array.from(v)},N=function(){function v(e){m(this,v),this.selfOptions=e||{},this.pipes={}}return w(v,[{key:"options",value:function(n){return n&&(this.selfOptions=n),this.selfOptions}},{key:"pipe",value:function(n,t){var a=t;if(typeof n=="string"){if(typeof a=="undefined")return this.pipes[n];this.pipes[n]=a}if(n&&n.name){if(a=n,a.processor===this)return a;this.pipes[a.name]=a}return a.processor=this,a}},{key:"process",value:function(n,t){var a=n;a.options=this.options();for(var r=t||n.pipe||"default",i=void 0,f=void 0;r;)typeof a.nextAfterChildren!="undefined"&&(a.next=a.nextAfterChildren,a.nextAfterChildren=null),typeof r=="string"&&(r=this.pipe(r)),r.process(a),f=a,i=r,r=null,a&&a.next&&(a=a.next,r=f.nextPipe||a.pipe||i);return a.hasResult?a.result:void 0}}]),v}(),H=function(){function v(e){m(this,v),this.name=e,this.filters=[]}return w(v,[{key:"process",value:function(n){if(!this.processor)throw new Error("add this pipe to a processor before using it");for(var t=this.debug,a=this.filters.length,r=n,i=0;i<a;i++){var f=this.filters[i];if(t&&this.log("filter: "+f.filterName),f(r),(typeof r=="undefined"?"undefined":g(r))==="object"&&r.exiting){r.exiting=!1;break}}!r.next&&this.resultCheck&&this.resultCheck(r)}},{key:"log",value:function(n){console.log("[jsondiffpatch] "+this.name+" pipe, "+n)}},{key:"append",value:function(){var n;return(n=this.filters).push.apply(n,arguments),this}},{key:"prepend",value:function(){var n;return(n=this.filters).unshift.apply(n,arguments),this}},{key:"indexOf",value:function(n){if(!n)throw new Error("a filter name is required");for(var t=0;t<this.filters.length;t++){var a=this.filters[t];if(a.filterName===n)return t}throw new Error("filter not found: "+n)}},{key:"list",value:function(){return this.filters.map(function(n){return n.filterName})}},{key:"after",value:function(n){var t=this.indexOf(n),a=Array.prototype.slice.call(arguments,1);if(!a.length)throw new Error("a filter is required");return a.unshift(t+1,0),Array.prototype.splice.apply(this.filters,a),this}},{key:"before",value:function(n){var t=this.indexOf(n),a=Array.prototype.slice.call(arguments,1);if(!a.length)throw new Error("a filter is required");return a.unshift(t,0),Array.prototype.splice.apply(this.filters,a),this}},{key:"replace",value:function(n){var t=this.indexOf(n),a=Array.prototype.slice.call(arguments,1);if(!a.length)throw new Error("a filter is required");return a.unshift(t,1),Array.prototype.splice.apply(this.filters,a),this}},{key:"remove",value:function(n){var t=this.indexOf(n);return this.filters.splice(t,1),this}},{key:"clear",value:function(){return this.filters.length=0,this}},{key:"shouldHaveResult",value:function(n){if(n===!1){this.resultCheck=null;return}if(!this.resultCheck){var t=this;return this.resultCheck=function(a){if(!a.hasResult){console.log(a);var r=new Error(t.name+" failed");throw r.noResult=!0,r}},this}}}]),v}(),V=function(){function v(){m(this,v)}return w(v,[{key:"setResult",value:function(n){return this.result=n,this.hasResult=!0,this}},{key:"exit",value:function(){return this.exiting=!0,this}},{key:"switchTo",value:function(n,t){return typeof n=="string"||n instanceof H?this.nextPipe=n:(this.next=n,t&&(this.nextPipe=t)),this}},{key:"push",value:function(n,t){return n.parent=this,typeof t!="undefined"&&(n.childName=t),n.root=this.root||this,n.options=n.options||this.options,this.children?(this.children[this.children.length-1].next=n,this.children.push(n)):(this.children=[n],this.nextAfterChildren=this.next||null,this.next=n),n.next=this,this}}]),v}(),B=typeof Array.isArray=="function"?Array.isArray:function(v){return v instanceof Array};function ie(v){var e=/^\/(.*)\/([gimyu]*)$/.exec(v.toString());return new RegExp(e[1],e[2])}function ue(v){if((typeof v=="undefined"?"undefined":g(v))!=="object")return v;if(v===null)return null;if(B(v))return v.map(ue);if(v instanceof Date)return new Date(v.getTime());if(v instanceof RegExp)return ie(v);var e={};for(var n in v)Object.prototype.hasOwnProperty.call(v,n)&&(e[n]=ue(v[n]));return e}var X=function(v){A(e,v);function e(n,t){m(this,e);var a=T(this,(e.__proto__||Object.getPrototypeOf(e)).call(this));return a.left=n,a.right=t,a.pipe="diff",a}return w(e,[{key:"setResult",value:function(t){if(this.options.cloneDiffValues&&(typeof t=="undefined"?"undefined":g(t))==="object"){var a=typeof this.options.cloneDiffValues=="function"?this.options.cloneDiffValues:ue;g(t[0])==="object"&&(t[0]=a(t[0])),g(t[1])==="object"&&(t[1]=a(t[1]))}return V.prototype.setResult.apply(this,arguments)}}]),e}(V),Ee=function(v){A(e,v);function e(n,t){m(this,e);var a=T(this,(e.__proto__||Object.getPrototypeOf(e)).call(this));return a.left=n,a.delta=t,a.pipe="patch",a}return e}(V),Re=function(v){A(e,v);function e(n){m(this,e);var t=T(this,(e.__proto__||Object.getPrototypeOf(e)).call(this));return t.delta=n,t.pipe="reverse",t}return e}(V),he=typeof Array.isArray=="function"?Array.isArray:function(v){return v instanceof Array},Ue=function(e){if(e.left===e.right){e.setResult(void 0).exit();return}if(typeof e.left=="undefined"){if(typeof e.right=="function")throw new Error("functions are not supported");e.setResult([e.right]).exit();return}if(typeof e.right=="undefined"){e.setResult([e.left,0,0]).exit();return}if(typeof e.left=="function"||typeof e.right=="function")throw new Error("functions are not supported");if(e.leftType=e.left===null?"null":g(e.left),e.rightType=e.right===null?"null":g(e.right),e.leftType!==e.rightType){e.setResult([e.left,e.right]).exit();return}if(e.leftType==="boolean"||e.leftType==="number"){e.setResult([e.left,e.right]).exit();return}if(e.leftType==="object"&&(e.leftIsArray=he(e.left)),e.rightType==="object"&&(e.rightIsArray=he(e.right)),e.leftIsArray!==e.rightIsArray){e.setResult([e.left,e.right]).exit();return}e.left instanceof RegExp&&(e.right instanceof RegExp?e.setResult([e.left.toString(),e.right.toString()]).exit():e.setResult([e.left,e.right]).exit())};Ue.filterName="trivial";var $e=function(e){if(typeof e.delta=="undefined"){e.setResult(e.left).exit();return}if(e.nested=!he(e.delta),!e.nested){if(e.delta.length===1){e.setResult(e.delta[0]).exit();return}if(e.delta.length===2){if(e.left instanceof RegExp){var n=/^\/(.*)\/([gimyu]+)$/.exec(e.delta[1]);if(n){e.setResult(new RegExp(n[1],n[2])).exit();return}}e.setResult(e.delta[1]).exit();return}e.delta.length===3&&e.delta[2]===0&&e.setResult(void 0).exit()}};$e.filterName="trivial";var He=function(e){if(typeof e.delta=="undefined"){e.setResult(e.delta).exit();return}if(e.nested=!he(e.delta),!e.nested){if(e.delta.length===1){e.setResult([e.delta[0],0,0]).exit();return}if(e.delta.length===2){e.setResult([e.delta[1],e.delta[0]]).exit();return}e.delta.length===3&&e.delta[2]===0&&e.setResult([e.delta[0]]).exit()}};He.filterName="trivial";function Je(v){if(!(!v||!v.children)){for(var e=v.children.length,n=void 0,t=v.result,a=0;a<e;a++)n=v.children[a],typeof n.result!="undefined"&&(t=t||{},t[n.childName]=n.result);t&&v.leftIsArray&&(t._t="a"),v.setResult(t).exit()}}Je.filterName="collectChildren";function Ve(v){if(!(v.leftIsArray||v.leftType!=="object")){var e=void 0,n=void 0,t=v.options.propertyFilter;for(e in v.left)!Object.prototype.hasOwnProperty.call(v.left,e)||t&&!t(e,v)||(n=new X(v.left[e],v.right[e]),v.push(n,e));for(e in v.right)!Object.prototype.hasOwnProperty.call(v.right,e)||t&&!t(e,v)||typeof v.left[e]=="undefined"&&(n=new X(void 0,v.right[e]),v.push(n,e));if(!v.children||v.children.length===0){v.setResult(void 0).exit();return}v.exit()}}Ve.filterName="objects";var ze=function(e){if(!!e.nested&&!e.delta._t){var n=void 0,t=void 0;for(n in e.delta)t=new Ee(e.left[n],e.delta[n]),e.push(t,n);e.exit()}};ze.filterName="objects";var Qe=function(e){if(!(!e||!e.children)&&!e.delta._t){for(var n=e.children.length,t=void 0,a=0;a<n;a++)t=e.children[a],Object.prototype.hasOwnProperty.call(e.left,t.childName)&&t.result===void 0?delete e.left[t.childName]:e.left[t.childName]!==t.result&&(e.left[t.childName]=t.result);e.setResult(e.left).exit()}};Qe.filterName="collectChildren";var Ye=function(e){if(!!e.nested&&!e.delta._t){var n=void 0,t=void 0;for(n in e.delta)t=new Re(e.delta[n]),e.push(t,n);e.exit()}};Ye.filterName="objects";function qe(v){if(!(!v||!v.children)&&!v.delta._t){for(var e=v.children.length,n=void 0,t={},a=0;a<e;a++)n=v.children[a],t[n.childName]!==n.result&&(t[n.childName]=n.result);v.setResult(t).exit()}}qe.filterName="collectChildren";var Dr=function(e,n,t,a){return e[t]===n[a]},Cr=function(e,n,t,a){var r=e.length,i=n.length,f=void 0,s=void 0,l=[r+1];for(f=0;f<r+1;f++)for(l[f]=[i+1],s=0;s<i+1;s++)l[f][s]=0;for(l.match=t,f=1;f<r+1;f++)for(s=1;s<i+1;s++)t(e,n,f-1,s-1,a)?l[f][s]=l[f-1][s-1]+1:l[f][s]=Math.max(l[f-1][s],l[f][s-1]);return l},jr=function(e,n,t,a){for(var r=n.length,i=t.length,f={sequence:[],indices1:[],indices2:[]};r!==0&&i!==0;){var s=e.match(n,t,r-1,i-1,a);if(s)f.sequence.unshift(n[r-1]),f.indices1.unshift(r-1),f.indices2.unshift(i-1),--r,--i;else{var l=e[r][i-1],o=e[r-1][i];l>o?--i:--r}}return f},Nr=function(e,n,t,a){var r=a||{},i=Cr(e,n,t||Dr,r),f=jr(i,e,n,r);return typeof e=="string"&&typeof n=="string"&&(f.sequence=f.sequence.join("")),f},Mr={get:Nr},re=3,Ge=typeof Array.isArray=="function"?Array.isArray:function(v){return v instanceof Array},Xe=typeof Array.prototype.indexOf=="function"?function(v,e){return v.indexOf(e)}:function(v,e){for(var n=v.length,t=0;t<n;t++)if(v[t]===e)return t;return-1};function kr(v,e,n,t){for(var a=0;a<n;a++)for(var r=v[a],i=0;i<t;i++){var f=e[i];if(a!==i&&r===f)return!0}}function ve(v,e,n,t,a){var r=v[n],i=e[t];if(r===i)return!0;if((typeof r=="undefined"?"undefined":g(r))!=="object"||(typeof i=="undefined"?"undefined":g(i))!=="object")return!1;var f=a.objectHash;if(!f)return a.matchByPosition&&n===t;var s=void 0,l=void 0;return typeof n=="number"?(a.hashCache1=a.hashCache1||[],s=a.hashCache1[n],typeof s=="undefined"&&(a.hashCache1[n]=s=f(r,n))):s=f(r),typeof s=="undefined"||(typeof t=="number"?(a.hashCache2=a.hashCache2||[],l=a.hashCache2[t],typeof l=="undefined"&&(a.hashCache2[t]=l=f(i,t))):l=f(i),typeof l=="undefined")?!1:s===l}var We=function(e){if(!!e.leftIsArray){var n={objectHash:e.options&&e.options.objectHash,matchByPosition:e.options&&e.options.matchByPosition},t=0,a=0,r=void 0,i=void 0,f=void 0,s=e.left,l=e.right,o=s.length,h=l.length,d=void 0;for(o>0&&h>0&&!n.objectHash&&typeof n.matchByPosition!="boolean"&&(n.matchByPosition=!kr(s,l,o,h));t<o&&t<h&&ve(s,l,t,t,n);)r=t,d=new X(e.left[r],e.right[r]),e.push(d,r),t++;for(;a+t<o&&a+t<h&&ve(s,l,o-1-a,h-1-a,n);)i=o-1-a,f=h-1-a,d=new X(e.left[i],e.right[f]),e.push(d,f),a++;var c=void 0;if(t+a===o){if(o===h){e.setResult(void 0).exit();return}for(c=c||{_t:"a"},r=t;r<h-a;r++)c[r]=[l[r]];e.setResult(c).exit();return}if(t+a===h){for(c=c||{_t:"a"},r=t;r<o-a;r++)c["_"+r]=[s[r],0,0];e.setResult(c).exit();return}delete n.hashCache1,delete n.hashCache2;var y=s.slice(t,o-a),_=l.slice(t,h-a),b=Mr.get(y,_,ve,n),O=[];for(c=c||{_t:"a"},r=t;r<o-a;r++)Xe(b.indices1,r-t)<0&&(c["_"+r]=[s[r],0,0],O.push(r));var R=!0;e.options&&e.options.arrays&&e.options.arrays.detectMove===!1&&(R=!1);var P=!1;e.options&&e.options.arrays&&e.options.arrays.includeValueOnMove&&(P=!0);var C=O.length;for(r=t;r<h-a;r++){var M=Xe(b.indices2,r-t);if(M<0){var D=!1;if(R&&C>0){for(var j=0;j<C;j++)if(i=O[j],ve(y,_,i-t,r-t,n)){c["_"+i].splice(1,2,r,re),P||(c["_"+i][0]=""),f=r,d=new X(e.left[i],e.right[f]),e.push(d,f),O.splice(j,1),D=!0;break}}D||(c[r]=[l[r]])}else i=b.indices1[M]+t,f=b.indices2[M]+t,d=new X(e.left[i],e.right[f]),e.push(d,f)}e.setResult(c).exit()}};We.filterName="arrays";var Ze={numerically:function(e,n){return e-n},numericallyBy:function(e){return function(n,t){return n[e]-t[e]}}},Ke=function(e){if(!!e.nested&&e.delta._t==="a"){var n=void 0,t=void 0,a=e.delta,r=e.left,i=[],f=[],s=[];for(n in a)if(n!=="_t")if(n[0]==="_")if(a[n][2]===0||a[n][2]===re)i.push(parseInt(n.slice(1),10));else throw new Error("only removal or move can be applied at original array indices,"+(" invalid diff type: "+a[n][2]));else a[n].length===1?f.push({index:parseInt(n,10),value:a[n][0]}):s.push({index:parseInt(n,10),delta:a[n]});for(i=i.sort(Ze.numerically),n=i.length-1;n>=0;n--){t=i[n];var l=a["_"+t],o=r.splice(t,1)[0];l[2]===re&&f.push({index:l[1],value:o})}f=f.sort(Ze.numericallyBy("index"));var h=f.length;for(n=0;n<h;n++){var d=f[n];r.splice(d.index,0,d.value)}var c=s.length,y=void 0;if(c>0)for(n=0;n<c;n++){var _=s[n];y=new Ee(e.left[_.index],_.delta),e.push(y,_.index)}if(!e.children){e.setResult(e.left).exit();return}e.exit()}};Ke.filterName="arrays";var xe=function(e){if(!(!e||!e.children)&&e.delta._t==="a"){for(var n=e.children.length,t=void 0,a=0;a<n;a++)t=e.children[a],e.left[t.childName]=t.result;e.setResult(e.left).exit()}};xe.filterName="arraysCollectChildren";var er=function(e){if(!e.nested){e.delta[2]===re&&(e.newName="_"+e.delta[1],e.setResult([e.delta[0],parseInt(e.childName.substr(1),10),re]).exit());return}if(e.delta._t==="a"){var n=void 0,t=void 0;for(n in e.delta)n!=="_t"&&(t=new Re(e.delta[n]),e.push(t,n));e.exit()}};er.filterName="arrays";var Fr=function(e,n,t){if(typeof n=="string"&&n[0]==="_")return parseInt(n.substr(1),10);if(Ge(t)&&t[2]===0)return"_"+n;var a=+n;for(var r in e){var i=e[r];if(Ge(i))if(i[2]===re){var f=parseInt(r.substr(1),10),s=i[1];if(s===+n)return f;f<=a&&s>a?a++:f>=a&&s<a&&a--}else if(i[2]===0){var l=parseInt(r.substr(1),10);l<=a&&a++}else i.length===1&&r<=a&&a--}return a};function rr(v){if(!(!v||!v.children)&&v.delta._t==="a"){for(var e=v.children.length,n=void 0,t={_t:"a"},a=0;a<e;a++){n=v.children[a];var r=n.newName;typeof r=="undefined"&&(r=Fr(v.delta,n.childName,n.result)),t[r]!==n.result&&(t[r]=n.result)}v.setResult(t).exit()}}rr.filterName="arraysCollectChildren";var tr=function(e){e.left instanceof Date?(e.right instanceof Date?e.left.getTime()!==e.right.getTime()?e.setResult([e.left,e.right]):e.setResult(void 0):e.setResult([e.left,e.right]),e.exit()):e.right instanceof Date&&e.setResult([e.left,e.right]).exit()};tr.filterName="dates";function Ir(v,e){return e={exports:{}},v(e,e.exports),e.exports}var Pe=Ir(function(v){function e(){this.Diff_Timeout=1,this.Diff_EditCost=4,this.Match_Threshold=.5,this.Match_Distance=1e3,this.Patch_DeleteThreshold=.5,this.Patch_Margin=4,this.Match_MaxBits=32}var n=-1,t=1,a=0;e.prototype.diff_main=function(r,i,f,s){typeof s=="undefined"&&(this.Diff_Timeout<=0?s=Number.MAX_VALUE:s=new Date().getTime()+this.Diff_Timeout*1e3);var l=s;if(r==null||i==null)throw new Error("Null input. (diff_main)");if(r==i)return r?[[a,r]]:[];typeof f=="undefined"&&(f=!0);var o=f,h=this.diff_commonPrefix(r,i),d=r.substring(0,h);r=r.substring(h),i=i.substring(h),h=this.diff_commonSuffix(r,i);var c=r.substring(r.length-h);r=r.substring(0,r.length-h),i=i.substring(0,i.length-h);var y=this.diff_compute_(r,i,o,l);return d&&y.unshift([a,d]),c&&y.push([a,c]),this.diff_cleanupMerge(y),y},e.prototype.diff_compute_=function(r,i,f,s){var l;if(!r)return[[t,i]];if(!i)return[[n,r]];var o=r.length>i.length?r:i,h=r.length>i.length?i:r,d=o.indexOf(h);if(d!=-1)return l=[[t,o.substring(0,d)],[a,h],[t,o.substring(d+h.length)]],r.length>i.length&&(l[0][0]=l[2][0]=n),l;if(h.length==1)return[[n,r],[t,i]];var c=this.diff_halfMatch_(r,i);if(c){var y=c[0],_=c[1],b=c[2],O=c[3],R=c[4],P=this.diff_main(y,b,f,s),C=this.diff_main(_,O,f,s);return P.concat([[a,R]],C)}return f&&r.length>100&&i.length>100?this.diff_lineMode_(r,i,s):this.diff_bisect_(r,i,s)},e.prototype.diff_lineMode_=function(r,i,f){var s=this.diff_linesToChars_(r,i);r=s.chars1,i=s.chars2;var l=s.lineArray,o=this.diff_main(r,i,!1,f);this.diff_charsToLines_(o,l),this.diff_cleanupSemantic(o),o.push([a,""]);for(var h=0,d=0,c=0,y="",_="";h<o.length;){switch(o[h][0]){case t:c++,_+=o[h][1];break;case n:d++,y+=o[h][1];break;case a:if(d>=1&&c>=1){o.splice(h-d-c,d+c),h=h-d-c;for(var s=this.diff_main(y,_,!1,f),b=s.length-1;b>=0;b--)o.splice(h,0,s[b]);h=h+s.length}c=0,d=0,y="",_="";break}h++}return o.pop(),o},e.prototype.diff_bisect_=function(r,i,f){for(var s=r.length,l=i.length,o=Math.ceil((s+l)/2),h=o,d=2*o,c=new Array(d),y=new Array(d),_=0;_<d;_++)c[_]=-1,y[_]=-1;c[h+1]=0,y[h+1]=0;for(var b=s-l,O=b%2!=0,R=0,P=0,C=0,M=0,D=0;D<o&&!(new Date().getTime()>f);D++){for(var j=-D+R;j<=D-P;j+=2){var k=h+j,F;j==-D||j!=D&&c[k-1]<c[k+1]?F=c[k+1]:F=c[k-1]+1;for(var Q=F-j;F<s&&Q<l&&r.charAt(F)==i.charAt(Q);)F++,Q++;if(c[k]=F,F>s)P+=2;else if(Q>l)R+=2;else if(O){var $=h+b-j;if($>=0&&$<d&&y[$]!=-1){var L=s-y[$];if(F>=L)return this.diff_bisectSplit_(r,i,F,Q,f)}}}for(var Y=-D+C;Y<=D-M;Y+=2){var $=h+Y,L;Y==-D||Y!=D&&y[$-1]<y[$+1]?L=y[$+1]:L=y[$-1]+1;for(var G=L-Y;L<s&&G<l&&r.charAt(s-L-1)==i.charAt(l-G-1);)L++,G++;if(y[$]=L,L>s)M+=2;else if(G>l)C+=2;else if(!O){var k=h+b-Y;if(k>=0&&k<d&&c[k]!=-1){var F=c[k],Q=h+F-k;if(L=s-L,F>=L)return this.diff_bisectSplit_(r,i,F,Q,f)}}}}return[[n,r],[t,i]]},e.prototype.diff_bisectSplit_=function(r,i,f,s,l){var o=r.substring(0,f),h=i.substring(0,s),d=r.substring(f),c=i.substring(s),y=this.diff_main(o,h,!1,l),_=this.diff_main(d,c,!1,l);return y.concat(_)},e.prototype.diff_linesToChars_=function(r,i){var f=[],s={};f[0]="";function l(d){for(var c="",y=0,_=-1,b=f.length;_<d.length-1;){_=d.indexOf(`
`,y),_==-1&&(_=d.length-1);var O=d.substring(y,_+1);y=_+1,(s.hasOwnProperty?s.hasOwnProperty(O):s[O]!==void 0)?c+=String.fromCharCode(s[O]):(c+=String.fromCharCode(b),s[O]=b,f[b++]=O)}return c}var o=l(r),h=l(i);return{chars1:o,chars2:h,lineArray:f}},e.prototype.diff_charsToLines_=function(r,i){for(var f=0;f<r.length;f++){for(var s=r[f][1],l=[],o=0;o<s.length;o++)l[o]=i[s.charCodeAt(o)];r[f][1]=l.join("")}},e.prototype.diff_commonPrefix=function(r,i){if(!r||!i||r.charAt(0)!=i.charAt(0))return 0;for(var f=0,s=Math.min(r.length,i.length),l=s,o=0;f<l;)r.substring(o,l)==i.substring(o,l)?(f=l,o=f):s=l,l=Math.floor((s-f)/2+f);return l},e.prototype.diff_commonSuffix=function(r,i){if(!r||!i||r.charAt(r.length-1)!=i.charAt(i.length-1))return 0;for(var f=0,s=Math.min(r.length,i.length),l=s,o=0;f<l;)r.substring(r.length-l,r.length-o)==i.substring(i.length-l,i.length-o)?(f=l,o=f):s=l,l=Math.floor((s-f)/2+f);return l},e.prototype.diff_commonOverlap_=function(r,i){var f=r.length,s=i.length;if(f==0||s==0)return 0;f>s?r=r.substring(f-s):f<s&&(i=i.substring(0,f));var l=Math.min(f,s);if(r==i)return l;for(var o=0,h=1;;){var d=r.substring(l-h),c=i.indexOf(d);if(c==-1)return o;h+=c,(c==0||r.substring(l-h)==i.substring(0,h))&&(o=h,h++)}},e.prototype.diff_halfMatch_=function(r,i){if(this.Diff_Timeout<=0)return null;var f=r.length>i.length?r:i,s=r.length>i.length?i:r;if(f.length<4||s.length*2<f.length)return null;var l=this;function o(P,C,M){for(var D=P.substring(M,M+Math.floor(P.length/4)),j=-1,k="",F,Q,$,L;(j=C.indexOf(D,j+1))!=-1;){var Y=l.diff_commonPrefix(P.substring(M),C.substring(j)),G=l.diff_commonSuffix(P.substring(0,M),C.substring(0,j));k.length<G+Y&&(k=C.substring(j-G,j)+C.substring(j,j+Y),F=P.substring(0,M-G),Q=P.substring(M+Y),$=C.substring(0,j-G),L=C.substring(j+Y))}return k.length*2>=P.length?[F,Q,$,L,k]:null}var h=o(f,s,Math.ceil(f.length/4)),d=o(f,s,Math.ceil(f.length/2)),c;if(!h&&!d)return null;d?h?c=h[4].length>d[4].length?h:d:c=d:c=h;var y,_,b,O;r.length>i.length?(y=c[0],_=c[1],b=c[2],O=c[3]):(b=c[0],O=c[1],y=c[2],_=c[3]);var R=c[4];return[y,_,b,O,R]},e.prototype.diff_cleanupSemantic=function(r){for(var i=!1,f=[],s=0,l=null,o=0,h=0,d=0,c=0,y=0;o<r.length;)r[o][0]==a?(f[s++]=o,h=c,d=y,c=0,y=0,l=r[o][1]):(r[o][0]==t?c+=r[o][1].length:y+=r[o][1].length,l&&l.length<=Math.max(h,d)&&l.length<=Math.max(c,y)&&(r.splice(f[s-1],0,[n,l]),r[f[s-1]+1][0]=t,s--,s--,o=s>0?f[s-1]:-1,h=0,d=0,c=0,y=0,l=null,i=!0)),o++;for(i&&this.diff_cleanupMerge(r),this.diff_cleanupSemanticLossless(r),o=1;o<r.length;){if(r[o-1][0]==n&&r[o][0]==t){var _=r[o-1][1],b=r[o][1],O=this.diff_commonOverlap_(_,b),R=this.diff_commonOverlap_(b,_);O>=R?(O>=_.length/2||O>=b.length/2)&&(r.splice(o,0,[a,b.substring(0,O)]),r[o-1][1]=_.substring(0,_.length-O),r[o+1][1]=b.substring(O),o++):(R>=_.length/2||R>=b.length/2)&&(r.splice(o,0,[a,_.substring(0,R)]),r[o-1][0]=t,r[o-1][1]=b.substring(0,b.length-R),r[o+1][0]=n,r[o+1][1]=_.substring(R),o++),o++}o++}},e.prototype.diff_cleanupSemanticLossless=function(r){function i(R,P){if(!R||!P)return 6;var C=R.charAt(R.length-1),M=P.charAt(0),D=C.match(e.nonAlphaNumericRegex_),j=M.match(e.nonAlphaNumericRegex_),k=D&&C.match(e.whitespaceRegex_),F=j&&M.match(e.whitespaceRegex_),Q=k&&C.match(e.linebreakRegex_),$=F&&M.match(e.linebreakRegex_),L=Q&&R.match(e.blanklineEndRegex_),Y=$&&P.match(e.blanklineStartRegex_);return L||Y?5:Q||$?4:D&&!k&&F?3:k||F?2:D||j?1:0}for(var f=1;f<r.length-1;){if(r[f-1][0]==a&&r[f+1][0]==a){var s=r[f-1][1],l=r[f][1],o=r[f+1][1],h=this.diff_commonSuffix(s,l);if(h){var d=l.substring(l.length-h);s=s.substring(0,s.length-h),l=d+l.substring(0,l.length-h),o=d+o}for(var c=s,y=l,_=o,b=i(s,l)+i(l,o);l.charAt(0)===o.charAt(0);){s+=l.charAt(0),l=l.substring(1)+o.charAt(0),o=o.substring(1);var O=i(s,l)+i(l,o);O>=b&&(b=O,c=s,y=l,_=o)}r[f-1][1]!=c&&(c?r[f-1][1]=c:(r.splice(f-1,1),f--),r[f][1]=y,_?r[f+1][1]=_:(r.splice(f+1,1),f--))}f++}},e.nonAlphaNumericRegex_=/[^a-zA-Z0-9]/,e.whitespaceRegex_=/\s/,e.linebreakRegex_=/[\r\n]/,e.blanklineEndRegex_=/\n\r?\n$/,e.blanklineStartRegex_=/^\r?\n\r?\n/,e.prototype.diff_cleanupEfficiency=function(r){for(var i=!1,f=[],s=0,l=null,o=0,h=!1,d=!1,c=!1,y=!1;o<r.length;)r[o][0]==a?(r[o][1].length<this.Diff_EditCost&&(c||y)?(f[s++]=o,h=c,d=y,l=r[o][1]):(s=0,l=null),c=y=!1):(r[o][0]==n?y=!0:c=!0,l&&(h&&d&&c&&y||l.length<this.Diff_EditCost/2&&h+d+c+y==3)&&(r.splice(f[s-1],0,[n,l]),r[f[s-1]+1][0]=t,s--,l=null,h&&d?(c=y=!0,s=0):(s--,o=s>0?f[s-1]:-1,c=y=!1),i=!0)),o++;i&&this.diff_cleanupMerge(r)},e.prototype.diff_cleanupMerge=function(r){r.push([a,""]);for(var i=0,f=0,s=0,l="",o="",h;i<r.length;)switch(r[i][0]){case t:s++,o+=r[i][1],i++;break;case n:f++,l+=r[i][1],i++;break;case a:f+s>1?(f!==0&&s!==0&&(h=this.diff_commonPrefix(o,l),h!==0&&(i-f-s>0&&r[i-f-s-1][0]==a?r[i-f-s-1][1]+=o.substring(0,h):(r.splice(0,0,[a,o.substring(0,h)]),i++),o=o.substring(h),l=l.substring(h)),h=this.diff_commonSuffix(o,l),h!==0&&(r[i][1]=o.substring(o.length-h)+r[i][1],o=o.substring(0,o.length-h),l=l.substring(0,l.length-h))),f===0?r.splice(i-s,f+s,[t,o]):s===0?r.splice(i-f,f+s,[n,l]):r.splice(i-f-s,f+s,[n,l],[t,o]),i=i-f-s+(f?1:0)+(s?1:0)+1):i!==0&&r[i-1][0]==a?(r[i-1][1]+=r[i][1],r.splice(i,1)):i++,s=0,f=0,l="",o="";break}r[r.length-1][1]===""&&r.pop();var d=!1;for(i=1;i<r.length-1;)r[i-1][0]==a&&r[i+1][0]==a&&(r[i][1].substring(r[i][1].length-r[i-1][1].length)==r[i-1][1]?(r[i][1]=r[i-1][1]+r[i][1].substring(0,r[i][1].length-r[i-1][1].length),r[i+1][1]=r[i-1][1]+r[i+1][1],r.splice(i-1,1),d=!0):r[i][1].substring(0,r[i+1][1].length)==r[i+1][1]&&(r[i-1][1]+=r[i+1][1],r[i][1]=r[i][1].substring(r[i+1][1].length)+r[i+1][1],r.splice(i+1,1),d=!0)),i++;d&&this.diff_cleanupMerge(r)},e.prototype.diff_xIndex=function(r,i){var f=0,s=0,l=0,o=0,h;for(h=0;h<r.length&&(r[h][0]!==t&&(f+=r[h][1].length),r[h][0]!==n&&(s+=r[h][1].length),!(f>i));h++)l=f,o=s;return r.length!=h&&r[h][0]===n?o:o+(i-l)},e.prototype.diff_prettyHtml=function(r){for(var i=[],f=/&/g,s=/</g,l=/>/g,o=/\n/g,h=0;h<r.length;h++){var d=r[h][0],c=r[h][1],y=c.replace(f,"&").replace(s,"<").replace(l,">").replace(o,"¶<br>");switch(d){case t:i[h]='<ins style="background:#e6ffe6;">'+y+"</ins>";break;case n:i[h]='<del style="background:#ffe6e6;">'+y+"</del>";break;case a:i[h]="<span>"+y+"</span>";break}}return i.join("")},e.prototype.diff_text1=function(r){for(var i=[],f=0;f<r.length;f++)r[f][0]!==t&&(i[f]=r[f][1]);return i.join("")},e.prototype.diff_text2=function(r){for(var i=[],f=0;f<r.length;f++)r[f][0]!==n&&(i[f]=r[f][1]);return i.join("")},e.prototype.diff_levenshtein=function(r){for(var i=0,f=0,s=0,l=0;l<r.length;l++){var o=r[l][0],h=r[l][1];switch(o){case t:f+=h.length;break;case n:s+=h.length;break;case a:i+=Math.max(f,s),f=0,s=0;break}}return i+=Math.max(f,s),i},e.prototype.diff_toDelta=function(r){for(var i=[],f=0;f<r.length;f++)switch(r[f][0]){case t:i[f]="+"+encodeURI(r[f][1]);break;case n:i[f]="-"+r[f][1].length;break;case a:i[f]="="+r[f][1].length;break}return i.join(" ").replace(/%20/g," ")},e.prototype.diff_fromDelta=function(r,i){for(var f=[],s=0,l=0,o=i.split(/\t/g),h=0;h<o.length;h++){var d=o[h].substring(1);switch(o[h].charAt(0)){case"+":try{f[s++]=[t,decodeURI(d)]}catch(_){throw new Error("Illegal escape in diff_fromDelta: "+d)}break;case"-":case"=":var c=parseInt(d,10);if(isNaN(c)||c<0)throw new Error("Invalid number in diff_fromDelta: "+d);var y=r.substring(l,l+=c);o[h].charAt(0)=="="?f[s++]=[a,y]:f[s++]=[n,y];break;default:if(o[h])throw new Error("Invalid diff operation in diff_fromDelta: "+o[h])}}if(l!=r.length)throw new Error("Delta length ("+l+") does not equal source text length ("+r.length+").");return f},e.prototype.match_main=function(r,i,f){if(r==null||i==null||f==null)throw new Error("Null input. (match_main)");return f=Math.max(0,Math.min(f,r.length)),r==i?0:r.length?r.substring(f,f+i.length)==i?f:this.match_bitap_(r,i,f):-1},e.prototype.match_bitap_=function(r,i,f){if(i.length>this.Match_MaxBits)throw new Error("Pattern too long for this browser.");var s=this.match_alphabet_(i),l=this;function o(F,Q){var $=F/i.length,L=Math.abs(f-Q);return l.Match_Distance?$+L/l.Match_Distance:L?1:$}var h=this.Match_Threshold,d=r.indexOf(i,f);d!=-1&&(h=Math.min(o(0,d),h),d=r.lastIndexOf(i,f+i.length),d!=-1&&(h=Math.min(o(0,d),h)));var c=1<<i.length-1;d=-1;for(var y,_,b=i.length+r.length,O,R=0;R<i.length;R++){for(y=0,_=b;y<_;)o(R,f+_)<=h?y=_:b=_,_=Math.floor((b-y)/2+y);b=_;var P=Math.max(1,f-_+1),C=Math.min(f+_,r.length)+i.length,M=Array(C+2);M[C+1]=(1<<R)-1;for(var D=C;D>=P;D--){var j=s[r.charAt(D-1)];if(R===0?M[D]=(M[D+1]<<1|1)&j:M[D]=(M[D+1]<<1|1)&j|((O[D+1]|O[D])<<1|1)|O[D+1],M[D]&c){var k=o(R,D-1);if(k<=h)if(h=k,d=D-1,d>f)P=Math.max(1,2*f-d);else break}}if(o(R+1,f)>h)break;O=M}return d},e.prototype.match_alphabet_=function(r){for(var i={},f=0;f<r.length;f++)i[r.charAt(f)]=0;for(var f=0;f<r.length;f++)i[r.charAt(f)]|=1<<r.length-f-1;return i},e.prototype.patch_addContext_=function(r,i){if(i.length!=0){for(var f=i.substring(r.start2,r.start2+r.length1),s=0;i.indexOf(f)!=i.lastIndexOf(f)&&f.length<this.Match_MaxBits-this.Patch_Margin-this.Patch_Margin;)s+=this.Patch_Margin,f=i.substring(r.start2-s,r.start2+r.length1+s);s+=this.Patch_Margin;var l=i.substring(r.start2-s,r.start2);l&&r.diffs.unshift([a,l]);var o=i.substring(r.start2+r.length1,r.start2+r.length1+s);o&&r.diffs.push([a,o]),r.start1-=l.length,r.start2-=l.length,r.length1+=l.length+o.length,r.length2+=l.length+o.length}},e.prototype.patch_make=function(r,i,f){var s,l;if(typeof r=="string"&&typeof i=="string"&&typeof f=="undefined")s=r,l=this.diff_main(s,i,!0),l.length>2&&(this.diff_cleanupSemantic(l),this.diff_cleanupEfficiency(l));else if(r&&typeof r=="object"&&typeof i=="undefined"&&typeof f=="undefined")l=r,s=this.diff_text1(l);else if(typeof r=="string"&&i&&typeof i=="object"&&typeof f=="undefined")s=r,l=i;else if(typeof r=="string"&&typeof i=="string"&&f&&typeof f=="object")s=r,l=f;else throw new Error("Unknown call format to patch_make.");if(l.length===0)return[];for(var o=[],h=new e.patch_obj,d=0,c=0,y=0,_=s,b=s,O=0;O<l.length;O++){var R=l[O][0],P=l[O][1];switch(!d&&R!==a&&(h.start1=c,h.start2=y),R){case t:h.diffs[d++]=l[O],h.length2+=P.length,b=b.substring(0,y)+P+b.substring(y);break;case n:h.length1+=P.length,h.diffs[d++]=l[O],b=b.substring(0,y)+b.substring(y+P.length);break;case a:P.length<=2*this.Patch_Margin&&d&&l.length!=O+1?(h.diffs[d++]=l[O],h.length1+=P.length,h.length2+=P.length):P.length>=2*this.Patch_Margin&&d&&(this.patch_addContext_(h,_),o.push(h),h=new e.patch_obj,d=0,_=b,c=y);break}R!==t&&(c+=P.length),R!==n&&(y+=P.length)}return d&&(this.patch_addContext_(h,_),o.push(h)),o},e.prototype.patch_deepCopy=function(r){for(var i=[],f=0;f<r.length;f++){var s=r[f],l=new e.patch_obj;l.diffs=[];for(var o=0;o<s.diffs.length;o++)l.diffs[o]=s.diffs[o].slice();l.start1=s.start1,l.start2=s.start2,l.length1=s.length1,l.length2=s.length2,i[f]=l}return i},e.prototype.patch_apply=function(r,i){if(r.length==0)return[i,[]];r=this.patch_deepCopy(r);var f=this.patch_addPadding(r);i=f+i+f,this.patch_splitMax(r);for(var s=0,l=[],o=0;o<r.length;o++){var h=r[o].start2+s,d=this.diff_text1(r[o].diffs),c,y=-1;if(d.length>this.Match_MaxBits?(c=this.match_main(i,d.substring(0,this.Match_MaxBits),h),c!=-1&&(y=this.match_main(i,d.substring(d.length-this.Match_MaxBits),h+d.length-this.Match_MaxBits),(y==-1||c>=y)&&(c=-1))):c=this.match_main(i,d,h),c==-1)l[o]=!1,s-=r[o].length2-r[o].length1;else{l[o]=!0,s=c-h;var _;if(y==-1?_=i.substring(c,c+d.length):_=i.substring(c,y+this.Match_MaxBits),d==_)i=i.substring(0,c)+this.diff_text2(r[o].diffs)+i.substring(c+d.length);else{var b=this.diff_main(d,_,!1);if(d.length>this.Match_MaxBits&&this.diff_levenshtein(b)/d.length>this.Patch_DeleteThreshold)l[o]=!1;else{this.diff_cleanupSemanticLossless(b);for(var O=0,R,P=0;P<r[o].diffs.length;P++){var C=r[o].diffs[P];C[0]!==a&&(R=this.diff_xIndex(b,O)),C[0]===t?i=i.substring(0,c+R)+C[1]+i.substring(c+R):C[0]===n&&(i=i.substring(0,c+R)+i.substring(c+this.diff_xIndex(b,O+C[1].length))),C[0]!==n&&(O+=C[1].length)}}}}}return i=i.substring(f.length,i.length-f.length),[i,l]},e.prototype.patch_addPadding=function(r){for(var i=this.Patch_Margin,f="",s=1;s<=i;s++)f+=String.fromCharCode(s);for(var s=0;s<r.length;s++)r[s].start1+=i,r[s].start2+=i;var l=r[0],o=l.diffs;if(o.length==0||o[0][0]!=a)o.unshift([a,f]),l.start1-=i,l.start2-=i,l.length1+=i,l.length2+=i;else if(i>o[0][1].length){var h=i-o[0][1].length;o[0][1]=f.substring(o[0][1].length)+o[0][1],l.start1-=h,l.start2-=h,l.length1+=h,l.length2+=h}if(l=r[r.length-1],o=l.diffs,o.length==0||o[o.length-1][0]!=a)o.push([a,f]),l.length1+=i,l.length2+=i;else if(i>o[o.length-1][1].length){var h=i-o[o.length-1][1].length;o[o.length-1][1]+=f.substring(0,h),l.length1+=h,l.length2+=h}return f},e.prototype.patch_splitMax=function(r){for(var i=this.Match_MaxBits,f=0;f<r.length;f++)if(!(r[f].length1<=i)){var s=r[f];r.splice(f--,1);for(var l=s.start1,o=s.start2,h="";s.diffs.length!==0;){var d=new e.patch_obj,c=!0;for(d.start1=l-h.length,d.start2=o-h.length,h!==""&&(d.length1=d.length2=h.length,d.diffs.push([a,h]));s.diffs.length!==0&&d.length1<i-this.Patch_Margin;){var y=s.diffs[0][0],_=s.diffs[0][1];y===t?(d.length2+=_.length,o+=_.length,d.diffs.push(s.diffs.shift()),c=!1):y===n&&d.diffs.length==1&&d.diffs[0][0]==a&&_.length>2*i?(d.length1+=_.length,l+=_.length,c=!1,d.diffs.push([y,_]),s.diffs.shift()):(_=_.substring(0,i-d.length1-this.Patch_Margin),d.length1+=_.length,l+=_.length,y===a?(d.length2+=_.length,o+=_.length):c=!1,d.diffs.push([y,_]),_==s.diffs[0][1]?s.diffs.shift():s.diffs[0][1]=s.diffs[0][1].substring(_.length))}h=this.diff_text2(d.diffs),h=h.substring(h.length-this.Patch_Margin);var b=this.diff_text1(s.diffs).substring(0,this.Patch_Margin);b!==""&&(d.length1+=b.length,d.length2+=b.length,d.diffs.length!==0&&d.diffs[d.diffs.length-1][0]===a?d.diffs[d.diffs.length-1][1]+=b:d.diffs.push([a,b])),c||r.splice(++f,0,d)}}},e.prototype.patch_toText=function(r){for(var i=[],f=0;f<r.length;f++)i[f]=r[f];return i.join("")},e.prototype.patch_fromText=function(r){var i=[];if(!r)return i;for(var f=r.split(`
`),s=0,l=/^@@ -(\d+),?(\d*) \+(\d+),?(\d*) @@$/;s<f.length;){var o=f[s].match(l);if(!o)throw new Error("Invalid patch string: "+f[s]);var h=new e.patch_obj;for(i.push(h),h.start1=parseInt(o[1],10),o[2]===""?(h.start1--,h.length1=1):o[2]=="0"?h.length1=0:(h.start1--,h.length1=parseInt(o[2],10)),h.start2=parseInt(o[3],10),o[4]===""?(h.start2--,h.length2=1):o[4]=="0"?h.length2=0:(h.start2--,h.length2=parseInt(o[4],10)),s++;s<f.length;){var d=f[s].charAt(0);try{var c=decodeURI(f[s].substring(1))}catch(y){throw new Error("Illegal escape in patch_fromText: "+c)}if(d=="-")h.diffs.push([n,c]);else if(d=="+")h.diffs.push([t,c]);else if(d==" ")h.diffs.push([a,c]);else{if(d=="@")break;if(d!=="")throw new Error('Invalid patch mode "'+d+'" in: '+c)}s++}}return i},e.patch_obj=function(){this.diffs=[],this.start1=null,this.start2=null,this.length1=0,this.length2=0},e.patch_obj.prototype.toString=function(){var r,i;this.length1===0?r=this.start1+",0":this.length1==1?r=this.start1+1:r=this.start1+1+","+this.length1,this.length2===0?i=this.start2+",0":this.length2==1?i=this.start2+1:i=this.start2+1+","+this.length2;for(var f=["@@ -"+r+" +"+i+` @@
`],s,l=0;l<this.diffs.length;l++){switch(this.diffs[l][0]){case t:s="+";break;case n:s="-";break;case a:s=" ";break}f[l+1]=s+encodeURI(this.diffs[l][1])+`
`}return f.join("").replace(/%20/g," ")},v.exports=e,v.exports.diff_match_patch=e,v.exports.DIFF_DELETE=n,v.exports.DIFF_INSERT=t,v.exports.DIFF_EQUAL=a}),pe=2,Sr=60,Te=null,nr=function(e){if(!Te){var n=void 0;if(typeof diff_match_patch!="undefined")n=typeof diff_match_patch=="function"?new diff_match_patch:new diff_match_patch.diff_match_patch;else if(Pe)try{n=Pe&&new Pe}catch(a){n=null}if(!n){if(!e)return null;var t=new Error("text diff_match_patch library not found");throw t.diff_match_patch_not_found=!0,t}Te={diff:function(r,i){return n.patch_toText(n.patch_make(r,i))},patch:function(r,i){for(var f=n.patch_apply(n.patch_fromText(i),r),s=0;s<f[1].length;s++)if(!f[1][s]){var l=new Error("text patch failed");l.textPatchFailed=!0}return f[0]}}}return Te},ir=function(e){if(e.leftType==="string"){var n=e.options&&e.options.textDiff&&e.options.textDiff.minLength||Sr;if(e.left.length<n||e.right.length<n){e.setResult([e.left,e.right]).exit();return}var t=nr();if(!t){e.setResult([e.left,e.right]).exit();return}var a=t.diff;e.setResult([a(e.left,e.right),0,pe]).exit()}};ir.filterName="texts";var ar=function(e){if(!e.nested&&e.delta[2]===pe){var n=nr(!0).patch;e.setResult(n(e.left,e.delta[0])).exit()}};ar.filterName="texts";var Lr=function(e){var n=void 0,t=void 0,a=void 0,r=void 0,i=void 0,f=null,s=/^@@ +-(\d+),(\d+) +\+(\d+),(\d+) +@@$/,l=void 0;for(a=e.split(`
`),n=0,t=a.length;n<t;n++){r=a[n];var o=r.slice(0,1);o==="@"?(f=s.exec(r),l=n,a[l]="@@ -"+f[3]+","+f[4]+" +"+f[1]+","+f[2]+" @@"):o==="+"?(a[n]="-"+a[n].slice(1),a[n-1].slice(0,1)==="+"&&(i=a[n],a[n]=a[n-1],a[n-1]=i)):o==="-"&&(a[n]="+"+a[n].slice(1))}return a.join(`
`)},fr=function(e){e.nested||e.delta[2]===pe&&e.setResult([Lr(e.delta[0]),0,pe]).exit()};fr.filterName="texts";var W=function(){function v(e){m(this,v),this.processor=new N(e),this.processor.pipe(new H("diff").append(Je,Ue,tr,ir,Ve,We).shouldHaveResult()),this.processor.pipe(new H("patch").append(Qe,xe,$e,ar,ze,Ke).shouldHaveResult()),this.processor.pipe(new H("reverse").append(qe,rr,He,fr,Ye,er).shouldHaveResult())}return w(v,[{key:"options",value:function(){var n;return(n=this.processor).options.apply(n,arguments)}},{key:"diff",value:function(n,t){return this.processor.process(new X(n,t))}},{key:"patch",value:function(n,t){return this.processor.process(new Ee(n,t))}},{key:"reverse",value:function(n){return this.processor.process(new Re(n))}},{key:"unpatch",value:function(n,t){return this.patch(n,this.reverse(t))}},{key:"clone",value:function(n){return ue(n)}}]),v}(),De=typeof Array.isArray=="function"?Array.isArray:function(v){return v instanceof Array},Br=typeof Object.keys=="function"?function(v){return Object.keys(v)}:function(v){var e=[];for(var n in v)Object.prototype.hasOwnProperty.call(v,n)&&e.push(n);return e},Ur=function(e){return e.substr(0,1)==="_"?e.slice(1):e},sr=function(e){return e==="_t"?-1:e.substr(0,1)==="_"?parseInt(e.slice(1),10):parseInt(e,10)+.1},$r=function(e,n){return sr(e)-sr(n)},ae=function(){function v(){m(this,v)}return w(v,[{key:"format",value:function(n,t){var a={};return this.prepareContext(a),this.recurse(a,n,t),this.finalize(a)}},{key:"prepareContext",value:function(n){n.buffer=[],n.out=function(){var t;(t=this.buffer).push.apply(t,arguments)}}},{key:"typeFormattterNotFound",value:function(n,t){throw new Error("cannot format delta type: "+t)}},{key:"typeFormattterErrorFormatter",value:function(n,t){return t.toString()}},{key:"finalize",value:function(n){var t=n.buffer;if(De(t))return t.join("")}},{key:"recurse",value:function(n,t,a,r,i,f,s){var l=t&&f,o=l?f.value:a;if(!(typeof t=="undefined"&&typeof r=="undefined")){var h=this.getDeltaType(t,f),d=h==="node"?t._t==="a"?"array":"object":"";typeof r!="undefined"?this.nodeBegin(n,r,i,h,d,s):this.rootBegin(n,h,d);var c=void 0;try{c=this["format_"+h]||this.typeFormattterNotFound(n,h),c.call(this,n,t,o,r,i,f)}catch(y){this.typeFormattterErrorFormatter(n,y,t,o,r,i,f),typeof console!="undefined"&&console.error&&console.error(y.stack)}typeof r!="undefined"?this.nodeEnd(n,r,i,h,d,s):this.rootEnd(n,h,d)}}},{key:"formatDeltaChildren",value:function(n,t,a){var r=this;this.forEachDeltaKey(t,a,function(i,f,s,l){r.recurse(n,t[i],a?a[f]:void 0,i,f,s,l)})}},{key:"forEachDeltaKey",value:function(n,t,a){var r=Br(n),i=n._t==="a",f={},s=void 0;if(typeof t!="undefined")for(s in t)Object.prototype.hasOwnProperty.call(t,s)&&typeof n[s]=="undefined"&&(!i||typeof n["_"+s]=="undefined")&&r.push(s);for(s in n)if(Object.prototype.hasOwnProperty.call(n,s)){var l=n[s];De(l)&&l[2]===3&&(f[l[1].toString()]={key:s,value:t&&t[parseInt(s.substr(1))]},this.includeMoveDestinations!==!1&&typeof t=="undefined"&&typeof n[l[1]]=="undefined"&&r.push(l[1].toString()))}i?r.sort($r):r.sort();for(var o=0,h=r.length;o<h;o++){var d=r[o];if(!(i&&d==="_t")){var c=i?typeof d=="number"?d:parseInt(Ur(d),10):d,y=o===h-1;a(d,c,f[c],y)}}}},{key:"getDeltaType",value:function(n,t){if(typeof n=="undefined")return typeof t!="undefined"?"movedestination":"unchanged";if(De(n)){if(n.length===1)return"added";if(n.length===2)return"modified";if(n.length===3&&n[2]===0)return"deleted";if(n.length===3&&n[2]===2)return"textdiff";if(n.length===3&&n[2]===3)return"moved"}else if((typeof n=="undefined"?"undefined":g(n))==="object")return"node";return"unknown"}},{key:"parseTextDiff",value:function(n){for(var t=[],a=n.split(`
@@ `),r=0,i=a.length;r<i;r++){var f=a[r],s={pieces:[]},l=/^(?:@@ )?[-+]?(\d+),(\d+)/.exec(f).slice(1);s.location={line:l[0],chr:l[1]};for(var o=f.split(`
`).slice(1),h=0,d=o.length;h<d;h++){var c=o[h];if(!!c.length){var y={type:"context"};c.substr(0,1)==="+"?y.type="added":c.substr(0,1)==="-"&&(y.type="deleted"),y.text=c.slice(1),s.pieces.push(y)}}t.push(s)}return t}}]),v}(),Hr=Object.freeze({default:ae}),or=function(v){A(e,v);function e(){return m(this,e),T(this,(e.__proto__||Object.getPrototypeOf(e)).apply(this,arguments))}return w(e,[{key:"typeFormattterErrorFormatter",value:function(t,a){t.out('<pre class="jsondiffpatch-error">'+a+"</pre>")}},{key:"formatValue",value:function(t,a){t.out("<pre>"+lr(JSON.stringify(a,null,2))+"</pre>")}},{key:"formatTextDiffString",value:function(t,a){var r=this.parseTextDiff(a);t.out('<ul class="jsondiffpatch-textdiff">');for(var i=0,f=r.length;i<f;i++){var s=r[i];t.out('<li><div class="jsondiffpatch-textdiff-location">'+('<span class="jsondiffpatch-textdiff-line-number">'+s.location.line+'</span><span class="jsondiffpatch-textdiff-char">'+s.location.chr+'</span></div><div class="jsondiffpatch-textdiff-line">'));for(var l=s.pieces,o=0,h=l.length;o<h;o++){var d=l[o];t.out('<span class="jsondiffpatch-textdiff-'+d.type+'">'+lr(decodeURI(d.text))+"</span>")}t.out("</div></li>")}t.out("</ul>")}},{key:"rootBegin",value:function(t,a,r){var i="jsondiffpatch-"+a+(r?" jsondiffpatch-child-node-type-"+r:"");t.out('<div class="jsondiffpatch-delta '+i+'">')}},{key:"rootEnd",value:function(t){t.out("</div>"+(t.hasArrows?'<script type="text/javascript">setTimeout('+(ur.toString()+",10);<\/script>"):""))}},{key:"nodeBegin",value:function(t,a,r,i,f){var s="jsondiffpatch-"+i+(f?" jsondiffpatch-child-node-type-"+f:"");t.out('<li class="'+s+'" data-key="'+r+'">'+('<div class="jsondiffpatch-property-name">'+r+"</div>"))}},{key:"nodeEnd",value:function(t){t.out("</li>")}},{key:"format_unchanged",value:function(t,a,r){typeof r!="undefined"&&(t.out('<div class="jsondiffpatch-value">'),this.formatValue(t,r),t.out("</div>"))}},{key:"format_movedestination",value:function(t,a,r){typeof r!="undefined"&&(t.out('<div class="jsondiffpatch-value">'),this.formatValue(t,r),t.out("</div>"))}},{key:"format_node",value:function(t,a,r){var i=a._t==="a"?"array":"object";t.out('<ul class="jsondiffpatch-node jsondiffpatch-node-type-'+i+'">'),this.formatDeltaChildren(t,a,r),t.out("</ul>")}},{key:"format_added",value:function(t,a){t.out('<div class="jsondiffpatch-value">'),this.formatValue(t,a[0]),t.out("</div>")}},{key:"format_modified",value:function(t,a){t.out('<div class="jsondiffpatch-value jsondiffpatch-left-value">'),this.formatValue(t,a[0]),t.out('</div><div class="jsondiffpatch-value jsondiffpatch-right-value">'),this.formatValue(t,a[1]),t.out("</div>")}},{key:"format_deleted",value:function(t,a){t.out('<div class="jsondiffpatch-value">'),this.formatValue(t,a[0]),t.out("</div>")}},{key:"format_moved",value:function(t,a){t.out('<div class="jsondiffpatch-value">'),this.formatValue(t,a[0]),t.out('</div><div class="jsondiffpatch-moved-destination">'+a[1]+"</div>"),t.out(`<div class="jsondiffpatch-arrow" style="position: relative; left: -34px;">
<svg width="30" height="60" style="position: absolute; display: none;">
<defs>
<marker id="markerArrow" markerWidth="8" markerHeight="8"
refx="2" refy="4"
orient="auto" markerUnits="userSpaceOnUse">
<path d="M1,1 L1,7 L7,4 L1,1" style="fill: #339;" />
</marker>
</defs>
<path d="M30,0 Q-10,25 26,50"
style="stroke: #88f; stroke-width: 2px; fill: none; stroke-opacity: 0.5; marker-end: url(#markerArrow);"
></path>
</svg>
</div>`),t.hasArrows=!0}},{key:"format_textdiff",value:function(t,a){t.out('<div class="jsondiffpatch-value">'),this.formatTextDiffString(t,a[0]),t.out("</div>")}}]),e}(ae);function lr(v){for(var e=v,n=[[/&/g,"&"],[/</g,"<"],[/>/g,">"],[/'/g,"'"],[/"/g,"""]],t=0;t<n.length;t++)e=e.replace(n[t][0],n[t][1]);return e}var ur=function(e){var n=e||document,t=function(f){var s=f.textContent,l=f.innerText;return s||l},a=function(f,s,l){for(var o=f.querySelectorAll(s),h=0,d=o.length;h<d;h++)l(o[h])},r=function(f,s){for(var l=f.children,o=0,h=l.length;o<h;o++)s(l[o],o)};a(n,".jsondiffpatch-arrow",function(i){var f=i.parentNode,s=i.children,l=i.style,o=f,h=s[0],d=h.children[1];h.style.display="none";var c=t(o.querySelector(".jsondiffpatch-moved-destination")),y=o.parentNode,_=void 0;if(r(y,function(R){R.getAttribute("data-key")===c&&(_=R)}),!!_)try{var b=_.offsetTop-o.offsetTop;h.setAttribute("height",Math.abs(b)+6),l.top=-8+(b>0?0:b)+"px";var O=b>0?"M30,0 Q-10,"+Math.round(b/2)+" 26,"+(b-4):"M30,"+-b+" Q-10,"+Math.round(-b/2)+" 26,4";d.setAttribute("d",O),h.style.display=""}catch(R){}})},hr=function(e,n,t){var a=n||document.body,r="jsondiffpatch-unchanged-",i={showing:r+"showing",hiding:r+"hiding",visible:r+"visible",hidden:r+"hidden"},f=a.classList;if(!!f){if(!t){f.remove(i.showing),f.remove(i.hiding),f.remove(i.visible),f.remove(i.hidden),e===!1&&f.add(i.hidden);return}e===!1?(f.remove(i.showing),f.add(i.visible),setTimeout(function(){f.add(i.hiding)},10)):(f.remove(i.hiding),f.add(i.showing),f.remove(i.hidden));var s=setInterval(function(){ur(a)},100);setTimeout(function(){f.remove(i.showing),f.remove(i.hiding),e===!1?(f.add(i.hidden),f.remove(i.visible)):(f.add(i.visible),f.remove(i.hidden)),setTimeout(function(){f.remove(i.visible),clearInterval(s)},t+400)},t)}},Jr=function(e,n){return hr(!1,e,n)},Ce=void 0;function Vr(v,e){return Ce||(Ce=new or),Ce.format(v,e)}var zr=Object.freeze({showUnchanged:hr,hideUnchanged:Jr,default:or,format:Vr}),Z=function(v){A(e,v);function e(){m(this,e);var n=T(this,(e.__proto__||Object.getPrototypeOf(e)).call(this));return n.includeMoveDestinations=!1,n}return w(e,[{key:"prepareContext",value:function(t){E(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"prepareContext",this).call(this,t),t.indent=function(a){this.indentLevel=(this.indentLevel||0)+(typeof a=="undefined"?1:a),this.indentPad=new Array(this.indentLevel+1).join(" ")},t.row=function(a,r){t.out('<tr><td style="white-space: nowrap;"><pre class="jsondiffpatch-annotated-indent" style="display: inline-block">'),t.out(t.indentPad),t.out('</pre><pre style="display: inline-block">'),t.out(a),t.out('</pre></td><td class="jsondiffpatch-delta-note"><div>'),t.out(r),t.out("</div></td></tr>")}}},{key:"typeFormattterErrorFormatter",value:function(t,a){t.row("",'<pre class="jsondiffpatch-error">'+a+"</pre>")}},{key:"formatTextDiffString",value:function(t,a){var r=this.parseTextDiff(a);t.out('<ul class="jsondiffpatch-textdiff">');for(var i=0,f=r.length;i<f;i++){var s=r[i];t.out('<li><div class="jsondiffpatch-textdiff-location">'+('<span class="jsondiffpatch-textdiff-line-number">'+s.location.line+'</span><span class="jsondiffpatch-textdiff-char">'+s.location.chr+'</span></div><div class="jsondiffpatch-textdiff-line">'));for(var l=s.pieces,o=0,h=l.length;o<h;o++){var d=l[o];t.out('<span class="jsondiffpatch-textdiff-'+d.type+'">'+d.text+"</span>")}t.out("</div></li>")}t.out("</ul>")}},{key:"rootBegin",value:function(t,a,r){t.out('<table class="jsondiffpatch-annotated-delta">'),a==="node"&&(t.row("{"),t.indent()),r==="array"&&t.row('"_t": "a",',"Array delta (member names indicate array indices)")}},{key:"rootEnd",value:function(t,a){a==="node"&&(t.indent(-1),t.row("}")),t.out("</table>")}},{key:"nodeBegin",value:function(t,a,r,i,f){t.row("""+a+"": {"),i==="node"&&t.indent(),f==="array"&&t.row('"_t": "a",',"Array delta (member names indicate array indices)")}},{key:"nodeEnd",value:function(t,a,r,i,f,s){i==="node"&&t.indent(-1),t.row("}"+(s?"":","))}},{key:"format_unchanged",value:function(){}},{key:"format_movedestination",value:function(){}},{key:"format_node",value:function(t,a,r){this.formatDeltaChildren(t,a,r)}}]),e}(ae),de=function(e){return'<pre style="display:inline-block">"'+e+""</pre>"},Qr={added:function(e,n,t,a){var r=" <pre>([newValue])</pre>";return typeof a=="undefined"?"new value"+r:typeof a=="number"?"insert at index "+a+r:"add property "+de(a)+r},modified:function(e,n,t,a){var r=" <pre>([previousValue, newValue])</pre>";return typeof a=="undefined"?"modify value"+r:typeof a=="number"?"modify at index "+a+r:"modify property "+de(a)+r},deleted:function(e,n,t,a){var r=" <pre>([previousValue, 0, 0])</pre>";return typeof a=="undefined"?"delete value"+r:typeof a=="number"?"remove index "+a+r:"delete property "+de(a)+r},moved:function(e,n,t,a){return'move from <span title="(position to remove at original state)">'+("index "+a+'</span> to <span title="(position to insert at final')+(' state)">index '+e[1]+"</span>")},textdiff:function(e,n,t,a){var r=typeof a=="undefined"?"":typeof a=="number"?" at index "+a:" at property "+de(a);return"text diff"+r+', format is <a href="https://code.google.com/p/google-diff-match-patch/wiki/Unidiff">a variation of Unidiff</a>'}},fe=function(e,n){var t=this.getDeltaType(n),a=Qr[t],r=a&&a.apply(a,Array.prototype.slice.call(arguments,1)),i=JSON.stringify(n,null,2);t==="textdiff"&&(i=i.split("\\n").join(`\\n"+
"`)),e.indent(),e.row(i,r),e.indent(-1)};Z.prototype.format_added=fe,Z.prototype.format_modified=fe,Z.prototype.format_deleted=fe,Z.prototype.format_moved=fe,Z.prototype.format_textdiff=fe;var je=void 0;function Yr(v,e){return je||(je=new Z),je.format(v,e)}var qr=Object.freeze({default:Z,format:Yr}),ce={add:"add",remove:"remove",replace:"replace",move:"move"},vr=function(v){A(e,v);function e(){m(this,e);var n=T(this,(e.__proto__||Object.getPrototypeOf(e)).call(this));return n.includeMoveDestinations=!0,n}return w(e,[{key:"prepareContext",value:function(t){E(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"prepareContext",this).call(this,t),t.result=[],t.path=[],t.pushCurrentOp=function(a){var r=a.op,i=a.value,f={op:r,path:this.currentPath()};typeof i!="undefined"&&(f.value=i),this.result.push(f)},t.pushMoveOp=function(a){var r=this.currentPath();this.result.push({op:ce.move,from:r,path:this.toPath(a)})},t.currentPath=function(){return"/"+this.path.join("/")},t.toPath=function(a){var r=this.path.slice();return r[r.length-1]=a,"/"+r.join("/")}}},{key:"typeFormattterErrorFormatter",value:function(t,a){t.out("[ERROR] "+a)}},{key:"rootBegin",value:function(){}},{key:"rootEnd",value:function(){}},{key:"nodeBegin",value:function(t,a,r){var i=t.path;i.push(r)}},{key:"nodeEnd",value:function(t){var a=t.path;a.pop()}},{key:"format_unchanged",value:function(){}},{key:"format_movedestination",value:function(){}},{key:"format_node",value:function(t,a,r){this.formatDeltaChildren(t,a,r)}},{key:"format_added",value:function(t,a){t.pushCurrentOp({op:ce.add,value:a[0]})}},{key:"format_modified",value:function(t,a){t.pushCurrentOp({op:ce.replace,value:a[1]})}},{key:"format_deleted",value:function(t){t.pushCurrentOp({op:ce.remove})}},{key:"format_moved",value:function(t,a){var r=a[1];t.pushMoveOp(r)}},{key:"format_textdiff",value:function(){throw new Error("Not implemented")}},{key:"format",value:function(t,a){var r={};return this.prepareContext(r),this.recurse(r,t,a),r.result}}]),e}(ae),pr=function(e){return e[e.length-1]},Gr=function(e,n){return e.sort(n),e},Xr=function(e,n){var t=parseInt(e,10),a=parseInt(n,10);return isNaN(t)||isNaN(a)?0:a-t},Wr=function(e){return Gr(e,function(n,t){var a=n.path.split("/"),r=t.path.split("/");return a.length!==r.length?a.length-r.length:Xr(pr(a),pr(r))})},dr=function(e,n){var t=Array(n.length+1).fill().map(function(){return[]});return e.map(function(a){var r=n.map(function(i){return i(a)}).indexOf(!0);return r<0&&(r=n.length),{item:a,position:r}}).reduce(function(a,r){return a[r.position].push(r.item),a},t)},Zr=function(e){var n=e.op;return n==="move"},Kr=function(e){var n=e.op;return n==="remove"},xr=function(e){var n=dr(e,[Zr,Kr]),t=J(n,3),a=t[0],r=t[1],i=t[2],f=Wr(r);return[].concat(I(f),I(a),I(i))},Ne=void 0,cr=function(e,n){return Ne||(Ne=new vr),xr(Ne.format(e,n))},et=function(e,n){console.log(cr(e,n))},rt=Object.freeze({default:vr,partitionOps:dr,format:cr,log:et});function K(v){return p&&p[v]||function(){for(var e=arguments.length,n=Array(e),t=0;t<e;t++)n[t]=arguments[t];return n}}var x={added:K("green"),deleted:K("red"),movedestination:K("gray"),moved:K("yellow"),unchanged:K("gray"),error:K("white.bgRed"),textDiffLine:K("gray")},gr=function(v){A(e,v);function e(){m(this,e);var n=T(this,(e.__proto__||Object.getPrototypeOf(e)).call(this));return n.includeMoveDestinations=!1,n}return w(e,[{key:"prepareContext",value:function(t){E(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"prepareContext",this).call(this,t),t.indent=function(a){this.indentLevel=(this.indentLevel||0)+(typeof a=="undefined"?1:a),this.indentPad=new Array(this.indentLevel+1).join(" "),this.outLine()},t.outLine=function(){this.buffer.push(`
`+(this.indentPad||""))},t.out=function(){for(var a=arguments.length,r=Array(a),i=0;i<a;i++)r[i]=arguments[i];for(var f=0,s=r.length;f<s;f++){var l=r[f].split(`
`),o=l.join(`
`+(this.indentPad||""));this.color&&this.color[0]&&(o=this.color[0](o)),this.buffer.push(o)}},t.pushColor=function(a){this.color=this.color||[],this.color.unshift(a)},t.popColor=function(){this.color=this.color||[],this.color.shift()}}},{key:"typeFormattterErrorFormatter",value:function(t,a){t.pushColor(x.error),t.out("[ERROR]"+a),t.popColor()}},{key:"formatValue",value:function(t,a){t.out(JSON.stringify(a,null,2))}},{key:"formatTextDiffString",value:function(t,a){var r=this.parseTextDiff(a);t.indent();for(var i=0,f=r.length;i<f;i++){var s=r[i];t.pushColor(x.textDiffLine),t.out(s.location.line+","+s.location.chr+" "),t.popColor();for(var l=s.pieces,o=0,h=l.length;o<h;o++){var d=l[o];t.pushColor(x[d.type]),t.out(d.text),t.popColor()}i<f-1&&t.outLine()}t.indent(-1)}},{key:"rootBegin",value:function(t,a,r){t.pushColor(x[a]),a==="node"&&(t.out(r==="array"?"[":"{"),t.indent())}},{key:"rootEnd",value:function(t,a,r){a==="node"&&(t.indent(-1),t.out(r==="array"?"]":"}")),t.popColor()}},{key:"nodeBegin",value:function(t,a,r,i,f){t.pushColor(x[i]),t.out(r+": "),i==="node"&&(t.out(f==="array"?"[":"{"),t.indent())}},{key:"nodeEnd",value:function(t,a,r,i,f,s){i==="node"&&(t.indent(-1),t.out(f==="array"?"]":"}"+(s?"":","))),s||t.outLine(),t.popColor()}},{key:"format_unchanged",value:function(t,a,r){typeof r!="undefined"&&this.formatValue(t,r)}},{key:"format_movedestination",value:function(t,a,r){typeof r!="undefined"&&this.formatValue(t,r)}},{key:"format_node",value:function(t,a,r){this.formatDeltaChildren(t,a,r)}},{key:"format_added",value:function(t,a){this.formatValue(t,a[0])}},{key:"format_modified",value:function(t,a){t.pushColor(x.deleted),this.formatValue(t,a[0]),t.popColor(),t.out(" => "),t.pushColor(x.added),this.formatValue(t,a[1]),t.popColor()}},{key:"format_deleted",value:function(t,a){this.formatValue(t,a[0])}},{key:"format_moved",value:function(t,a){t.out("==> "+a[1])}},{key:"format_textdiff",value:function(t,a){this.formatTextDiffString(t,a[0])}}]),e}(ae),Me=void 0,mr=function(e,n){return Me||(Me=new gr),Me.format(e,n)};function tt(v,e){console.log(mr(v,e))}var yr=Object.freeze({default:gr,format:mr,log:tt}),nt=Object.freeze({base:Hr,html:zr,annotated:qr,jsonpatch:rt,console:yr});function it(v,e){var n=void 0;return typeof e=="string"&&(n=/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2})(?:\.(\d*))?(Z|([+-])(\d{2}):(\d{2}))$/.exec(e),n)?new Date(Date.UTC(+n[1],+n[2]-1,+n[3],+n[4],+n[5],+n[6],+(n[7]||0))):e}function at(v){return new W(v)}var U=void 0;function ft(){return U||(U=new W),U.diff.apply(U,arguments)}function st(){return U||(U=new W),U.patch.apply(U,arguments)}function ot(){return U||(U=new W),U.unpatch.apply(U,arguments)}function lt(){return U||(U=new W),U.reverse.apply(U,arguments)}function ut(){return U||(U=new W),U.clone.apply(U,arguments)}u.DiffPatcher=W,u.formatters=nt,u.console=yr,u.create=at,u.dateReviver=it,u.diff=ft,u.patch=st,u.unpatch=ot,u.reverse=lt,u.clone=ut,Object.defineProperty(u,"__esModule",{value:!0})})});var Mt={};ke(Mt,{createLiveJSONHooks:()=>Nt});var Fe={};ke(Fe,{JsonPatchError:()=>S,_areEquals:()=>le,applyOperation:()=>ee,applyPatch:()=>ne,applyReducer:()=>At,deepClone:()=>wt,getValueByPointer:()=>be,validate:()=>Ar,validator:()=>Ae});var yt=function(){var u=function(p,g){return u=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(m,w){m.__proto__=w}||function(m,w){for(var E in w)w.hasOwnProperty(E)&&(m[E]=w[E])},u(p,g)};return function(p,g){u(p,g);function m(){this.constructor=p}p.prototype=g===null?Object.create(g):(m.prototype=g.prototype,new m)}}(),_t=Object.prototype.hasOwnProperty;function me(u,p){return _t.call(u,p)}function ye(u){if(Array.isArray(u)){for(var p=new Array(u.length),g=0;g<p.length;g++)p[g]=""+g;return p}if(Object.keys)return Object.keys(u);var m=[];for(var w in u)me(u,w)&&m.push(w);return m}function z(u){switch(typeof u){case"object":return JSON.parse(JSON.stringify(u));case"undefined":return null;default:return u}}function _e(u){for(var p=0,g=u.length,m;p<g;){if(m=u.charCodeAt(p),m>=48&&m<=57){p++;continue}return!1}return!0}function q(u){return u.indexOf("/")===-1&&u.indexOf("~")===-1?u:u.replace(/~/g,"~0").replace(/\//g,"~1")}function se(u){return u.replace(/~1/g,"/").replace(/~0/g,"~")}function we(u){if(u===void 0)return!0;if(u){if(Array.isArray(u)){for(var p=0,g=u.length;p<g;p++)if(we(u[p]))return!0}else if(typeof u=="object"){for(var m=ye(u),w=m.length,E=0;E<w;E++)if(we(u[m[E]]))return!0}}return!1}function br(u,p){var g=[u];for(var m in p){var w=typeof p[m]=="object"?JSON.stringify(p[m],null,2):p[m];typeof w!="undefined"&&g.push(m+": "+w)}return g.join(`
`)}var oe=function(u){yt(p,u);function p(g,m,w,E,A){var T=this.constructor,J=u.call(this,br(g,{name:m,index:w,operation:E,tree:A}))||this;return J.name=m,J.index=w,J.operation=E,J.tree=A,Object.setPrototypeOf(J,T.prototype),J.message=br(g,{name:m,index:w,operation:E,tree:A}),J}return p}(Error);var S=oe,wt=z,te={add:function(u,p,g){return u[p]=this.value,{newDocument:g}},remove:function(u,p,g){var m=u[p];return delete u[p],{newDocument:g,removed:m}},replace:function(u,p,g){var m=u[p];return u[p]=this.value,{newDocument:g,removed:m}},move:function(u,p,g){var m=be(g,this.path);m&&(m=z(m));var w=ee(g,{op:"remove",path:this.from}).removed;return ee(g,{op:"add",path:this.path,value:w}),{newDocument:g,removed:m}},copy:function(u,p,g){var m=be(g,this.from);return ee(g,{op:"add",path:this.path,value:z(m)}),{newDocument:g}},test:function(u,p,g){return{newDocument:g,test:le(u[p],this.value)}},_get:function(u,p,g){return this.value=u[p],{newDocument:g}}},bt={add:function(u,p,g){return _e(p)?u.splice(p,0,this.value):u[p]=this.value,{newDocument:g,index:p}},remove:function(u,p,g){var m=u.splice(p,1);return{newDocument:g,removed:m[0]}},replace:function(u,p,g){var m=u[p];return u[p]=this.value,{newDocument:g,removed:m}},move:te.move,copy:te.copy,test:te.test,_get:te._get};function be(u,p){if(p=="")return u;var g={op:"_get",path:p};return ee(u,g),g.value}function ee(u,p,g,m,w,E){if(g===void 0&&(g=!1),m===void 0&&(m=!0),w===void 0&&(w=!0),E===void 0&&(E=0),g&&(typeof g=="function"?g(p,0,u,p.path):Ae(p,0)),p.path===""){var A={newDocument:u};if(p.op==="add")return A.newDocument=p.value,A;if(p.op==="replace")return A.newDocument=p.value,A.removed=u,A;if(p.op==="move"||p.op==="copy")return A.newDocument=be(u,p.from),p.op==="move"&&(A.removed=u),A;if(p.op==="test"){if(A.test=le(u,p.value),A.test===!1)throw new S("Test operation failed","TEST_OPERATION_FAILED",E,p,u);return A.newDocument=u,A}else{if(p.op==="remove")return A.removed=u,A.newDocument=null,A;if(p.op==="_get")return p.value=u,A;if(g)throw new S("Operation `op` property is not one of operations defined in RFC-6902","OPERATION_OP_INVALID",E,p,u);return A}}else{m||(u=z(u));var T=p.path||"",J=T.split("/"),I=u,N=1,H=J.length,V=void 0,B=void 0,ie=void 0;for(typeof g=="function"?ie=g:ie=Ae;;){if(B=J[N],B&&B.indexOf("~")!=-1&&(B=se(B)),w&&(B=="__proto__"||B=="prototype"&&N>0&&J[N-1]=="constructor"))throw new TypeError("JSON-Patch: modifying `__proto__` or `constructor/prototype` prop is banned for security reasons, if this was on purpose, please set `banPrototypeModifications` flag false and pass it to this function. More info in fast-json-patch README");if(g&&V===void 0&&(I[B]===void 0?V=J.slice(0,N).join("/"):N==H-1&&(V=p.path),V!==void 0&&ie(p,0,u,V)),N++,Array.isArray(I)){if(B==="-")B=I.length;else{if(g&&!_e(B))throw new S("Expected an unsigned base-10 integer value, making the new referenced value the array element with the zero-based index","OPERATION_PATH_ILLEGAL_ARRAY_INDEX",E,p,u);_e(B)&&(B=~~B)}if(N>=H){if(g&&p.op==="add"&&B>I.length)throw new S("The specified index MUST NOT be greater than the number of elements in the array","OPERATION_VALUE_OUT_OF_BOUNDS",E,p,u);var A=bt[p.op].call(p,I,B,u);if(A.test===!1)throw new S("Test operation failed","TEST_OPERATION_FAILED",E,p,u);return A}}else if(N>=H){var A=te[p.op].call(p,I,B,u);if(A.test===!1)throw new S("Test operation failed","TEST_OPERATION_FAILED",E,p,u);return A}if(I=I[B],g&&N<H&&(!I||typeof I!="object"))throw new S("Cannot perform operation at the desired path","OPERATION_PATH_UNRESOLVABLE",E,p,u)}}}function ne(u,p,g,m,w){if(m===void 0&&(m=!0),w===void 0&&(w=!0),g&&!Array.isArray(p))throw new S("Patch sequence must be an array","SEQUENCE_NOT_AN_ARRAY");m||(u=z(u));for(var E=new Array(p.length),A=0,T=p.length;A<T;A++)E[A]=ee(u,p[A],g,!0,w,A),u=E[A].newDocument;return E.newDocument=u,E}function At(u,p,g){var m=ee(u,p);if(m.test===!1)throw new S("Test operation failed","TEST_OPERATION_FAILED",g,p,u);return m.newDocument}function Ae(u,p,g,m){if(typeof u!="object"||u===null||Array.isArray(u))throw new S("Operation is not an object","OPERATION_NOT_AN_OBJECT",p,u,g);if(te[u.op]){if(typeof u.path!="string")throw new S("Operation `path` property is not a string","OPERATION_PATH_INVALID",p,u,g);if(u.path.indexOf("/")!==0&&u.path.length>0)throw new S('Operation `path` property must start with "/"',"OPERATION_PATH_INVALID",p,u,g);if((u.op==="move"||u.op==="copy")&&typeof u.from!="string")throw new S("Operation `from` property is not present (applicable in `move` and `copy` operations)","OPERATION_FROM_REQUIRED",p,u,g);if((u.op==="add"||u.op==="replace"||u.op==="test")&&u.value===void 0)throw new S("Operation `value` property is not present (applicable in `add`, `replace` and `test` operations)","OPERATION_VALUE_REQUIRED",p,u,g);if((u.op==="add"||u.op==="replace"||u.op==="test")&&we(u.value))throw new S("Operation `value` property is not present (applicable in `add`, `replace` and `test` operations)","OPERATION_VALUE_CANNOT_CONTAIN_UNDEFINED",p,u,g);if(g){if(u.op=="add"){var w=u.path.split("/").length,E=m.split("/").length;if(w!==E+1&&w!==E)throw new S("Cannot perform an `add` operation at the desired path","OPERATION_PATH_CANNOT_ADD",p,u,g)}else if(u.op==="replace"||u.op==="remove"||u.op==="_get"){if(u.path!==m)throw new S("Cannot perform the operation at a path that does not exist","OPERATION_PATH_UNRESOLVABLE",p,u,g)}else if(u.op==="move"||u.op==="copy"){var A={op:"_get",path:u.from,value:void 0},T=Ar([A],g);if(T&&T.name==="OPERATION_PATH_UNRESOLVABLE")throw new S("Cannot perform the operation from a path that does not exist","OPERATION_FROM_UNRESOLVABLE",p,u,g)}}}else throw new S("Operation `op` property is not one of operations defined in RFC-6902","OPERATION_OP_INVALID",p,u,g)}function Ar(u,p,g){try{if(!Array.isArray(u))throw new S("Patch sequence must be an array","SEQUENCE_NOT_AN_ARRAY");if(p)ne(z(p),z(u),g||!0);else{g=g||Ae;for(var m=0;m<u.length;m++)g(u[m],m,p,void 0)}}catch(w){if(w instanceof S)return w;throw w}}function le(u,p){if(u===p)return!0;if(u&&p&&typeof u=="object"&&typeof p=="object"){var g=Array.isArray(u),m=Array.isArray(p),w,E,A;if(g&&m){if(E=u.length,E!=p.length)return!1;for(w=E;w--!=0;)if(!le(u[w],p[w]))return!1;return!0}if(g!=m)return!1;var T=Object.keys(u);if(E=T.length,E!==Object.keys(p).length)return!1;for(w=E;w--!=0;)if(!p.hasOwnProperty(T[w]))return!1;for(w=E;w--!=0;)if(A=T[w],!le(u[A],p[A]))return!1;return!0}return u!==u&&p!==p}var Be={};ke(Be,{compare:()=>jt,generate:()=>Se,observe:()=>Ct,unobserve:()=>Dt});var Ie=new WeakMap,Ot=function(){function u(p){this.observers=new Map,this.obj=p}return u}(),Et=function(){function u(p,g){this.callback=p,this.observer=g}return u}();function Rt(u){return Ie.get(u)}function Pt(u,p){return u.observers.get(p)}function Tt(u,p){u.observers.delete(p.callback)}function Dt(u,p){p.unobserve()}function Ct(u,p){var g=[],m,w=Rt(u);if(!w)w=new Ot(u),Ie.set(u,w);else{var E=Pt(w,p);m=E&&E.observer}if(m)return m;if(m={},w.value=z(u),p){m.callback=p,m.next=null;var A=function(){Se(m)},T=function(){clearTimeout(m.next),m.next=setTimeout(A)};typeof window!="undefined"&&(window.addEventListener("mouseup",T),window.addEventListener("keyup",T),window.addEventListener("mousedown",T),window.addEventListener("keydown",T),window.addEventListener("change",T))}return m.patches=g,m.object=u,m.unobserve=function(){Se(m),clearTimeout(m.next),Tt(w,m),typeof window!="undefined"&&(window.removeEventListener("mouseup",T),window.removeEventListener("keyup",T),window.removeEventListener("mousedown",T),window.removeEventListener("keydown",T),window.removeEventListener("change",T))},w.observers.set(p,new Et(p,m)),m}function Se(u,p){p===void 0&&(p=!1);var g=Ie.get(u.object);Le(g.value,u.object,u.patches,"",p),u.patches.length&&ne(g.value,u.patches);var m=u.patches;return m.length>0&&(u.patches=[],u.callback&&u.callback(m)),m}function Le(u,p,g,m,w){if(p!==u){typeof p.toJSON=="function"&&(p=p.toJSON());for(var E=ye(p),A=ye(u),T=!1,J=!1,I=A.length-1;I>=0;I--){var N=A[I],H=u[N];if(me(p,N)&&!(p[N]===void 0&&H!==void 0&&Array.isArray(p)===!1)){var V=p[N];typeof H=="object"&&H!=null&&typeof V=="object"&&V!=null&&Array.isArray(H)===Array.isArray(V)?Le(H,V,g,m+"/"+q(N),w):H!==V&&(T=!0,w&&g.push({op:"test",path:m+"/"+q(N),value:z(H)}),g.push({op:"replace",path:m+"/"+q(N),value:z(V)}))}else Array.isArray(u)===Array.isArray(p)?(w&&g.push({op:"test",path:m+"/"+q(N),value:z(H)}),g.push({op:"remove",path:m+"/"+q(N)}),J=!0):(w&&g.push({op:"test",path:m,value:u}),g.push({op:"replace",path:m,value:p}),T=!0)}if(!(!J&&E.length==A.length))for(var I=0;I<E.length;I++){var N=E[I];!me(u,N)&&p[N]!==void 0&&g.push({op:"add",path:m+"/"+q(N),value:z(p[N])})}}}function jt(u,p,g){g===void 0&&(g=!1);var m=[];return Le(u,p,m,"",g),m}var Ut=Object.assign({},Fe,Be,{JsonPatchError:oe,deepClone:z,escapePathComponent:q,unescapePathComponent:se});var Pr=mt(Rr());function Tr(u){let p;typeof window.CustomEvent=="function"?p=new window.CustomEvent(u,{}):(p=document.createEvent("Event"),p.initEvent(u,!1,!0)),window.dispatchEvent(p)}function Nt(){return{LiveJSON:{mounted(){this.handleEvent("lj:patch",({doc_name:u,patch:p,method:g})=>{console.log("patching"),g=="rfc"?window[u]=ne(window[u],p).newDocument:window[u]=Pr.patch(window[u],p),Tr(u+"_patched")}),this.handleEvent("lj:init",({doc_name:u,data:p})=>{console.log("Init"),window[u]=p,Tr(u+"_initiated")})}}}}return Mt;})();
/*!
* https://github.com/Starcounter-Jack/JSON-Patch
* (c) 2017-2021 Joachim Wester
* MIT license
*/
/*!
* https://github.com/Starcounter-Jack/JSON-Patch
* (c) 2017-2022 Joachim Wester
* MIT licensed
*/