devops-diff
Version:
devops-diff
39 lines (30 loc) • 71.9 kB
JavaScript
!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var n=t();for(var i in n)("object"==typeof exports?exports:e)[i]=n[i]}}(this,(function(){return function(e){var t={};function n(i){if(t[i])return t[i].exports;var r=t[i]={i:i,l:!1,exports:{}};return e[i].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=e,n.c=t,n.d=function(e,t,i){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:i})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)n.d(i,r,function(t){return e[t]}.bind(null,r));return i},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=5)}([function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DiffStyleType=t.LineMatchingType=t.OutputFormatType=t.LineType=void 0,function(e){e.INSERT="insert",e.DELETE="delete",e.CONTEXT="context"}(t.LineType||(t.LineType={})),t.OutputFormatType={LINE_BY_LINE:"line-by-line",SIDE_BY_SIDE:"side-by-side"},t.LineMatchingType={LINES:"lines",WORDS:"words",NONE:"none"},t.DiffStyleType={WORD:"word",CHAR:"char"}},function(e,t,n){"use strict";var i=this&&this.__assign||function(){return(i=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}).apply(this,arguments)},r=this&&this.__createBinding||(Object.create?function(e,t,n,i){void 0===i&&(i=n),Object.defineProperty(e,i,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,i){void 0===i&&(i=n),e[i]=t[n]}),l=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return l(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.diffHighlight=t.getFileIcon=t.getHtmlId=t.filenameDiff=t.deconstructLine=t.escapeForHtml=t.toCSSClass=t.defaultRenderConfig=t.CSSLineClass=void 0;var a=o(n(10)),s=n(3),f=o(n(2)),u=n(0);t.CSSLineClass={INSERTS:"d2h-ins",DELETES:"d2h-del",CONTEXT:"d2h-cntx",INFO:"d2h-info",INSERT_CHANGES:"d2h-ins d2h-change",DELETE_CHANGES:"d2h-del d2h-change"},t.defaultRenderConfig={matching:u.LineMatchingType.NONE,matchWordsThreshold:.25,maxLineLengthHighlight:1e4,diffStyle:u.DiffStyleType.WORD};var d=f.newDistanceFn((function(e){return e.value})),c=f.newMatcherFn(d);function h(e){return-1!==e.indexOf("dev/null")}function p(e){return e.replace(/(<del[^>]*>((.|\n)*?)<\/del>)/g,"")}function g(e){return e.slice(0).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'").replace(/\//g,"/")}function v(e,t,n){void 0===n&&(n=!0);var i=function(e){return e?2:1}(t);return{prefix:e.substring(0,i),content:n?g(e.substring(i)):e.substring(i)}}function b(e){var t=s.unifyPath(e.oldName),n=s.unifyPath(e.newName);if(t===n||h(t)||h(n))return h(n)?t:n;for(var i=[],r=[],l=t.split("/"),o=n.split("/"),a=0,f=l.length-1,u=o.length-1;a<f&&a<u&&l[a]===o[a];)i.push(o[a]),a+=1;for(;f>a&&u>a&&l[f]===o[u];)r.unshift(o[u]),f-=1,u-=1;var d=i.join("/"),c=r.join("/"),p=l.slice(a,f+1).join("/"),g=o.slice(a,u+1).join("/");return d.length&&c.length?d+"/{"+p+" → "+g+"}/"+c:d.length?d+"/{"+p+" → "+g+"}":c.length?"{"+p+" → "+g+"}/"+c:t+" → "+n}t.toCSSClass=function(e){switch(e){case u.LineType.CONTEXT:return t.CSSLineClass.CONTEXT;case u.LineType.INSERT:return t.CSSLineClass.INSERTS;case u.LineType.DELETE:return t.CSSLineClass.DELETES}},t.escapeForHtml=g,t.deconstructLine=v,t.filenameDiff=b,t.getHtmlId=function(e){return"d2h-"+s.hashCode(b(e)).toString().slice(-6)},t.getFileIcon=function(e){var t="file-changed";return e.isRename||e.isCopy?t="file-renamed":e.isNew?t="file-added":e.isDeleted?t="file-deleted":e.newName!==e.oldName&&(t="file-renamed"),t},t.diffHighlight=function(e,n,r,l){void 0===l&&(l={});var o=i(i({},t.defaultRenderConfig),l),s=o.matching,f=o.maxLineLengthHighlight,u=o.matchWordsThreshold,h=o.diffStyle,b=v(e,r,!1),m=v(n,r,!1);if(b.content.length>f||m.content.length>f)return{oldLine:{prefix:b.prefix,content:g(b.content)},newLine:{prefix:m.prefix,content:g(m.content)}};var y="char"===h?a.diffChars(b.content,m.content):a.diffWordsWithSpace(b.content,m.content),w=[];if("word"===h&&"words"===s){var S=y.filter((function(e){return e.removed})),L=y.filter((function(e){return e.added}));c(L,S).forEach((function(e){1===e[0].length&&1===e[1].length&&(d(e[0][0],e[1][0])<u&&(w.push(e[0][0]),w.push(e[1][0])))}))}var x,C=y.reduce((function(e,t){var n=t.added?"ins":t.removed?"del":null,i=w.indexOf(t)>-1?' class="d2h-change"':"",r=g(t.value);return null!==n?e+"<"+n+i+">"+r+"</"+n+">":""+e+r}),"");return{oldLine:{prefix:b.prefix,content:(x=C,x.replace(/(<ins[^>]*>((.|\n)*?)<\/ins>)/g,""))},newLine:{prefix:m.prefix,content:p(C)}}}},function(e,t,n){"use strict";function i(e,t){if(0===e.length)return t.length;if(0===t.length)return e.length;var n,i,r=[];for(n=0;n<=t.length;n++)r[n]=[n];for(i=0;i<=e.length;i++)r[0][i]=i;for(n=1;n<=t.length;n++)for(i=1;i<=e.length;i++)t.charAt(n-1)===e.charAt(i-1)?r[n][i]=r[n-1][i-1]:r[n][i]=Math.min(r[n-1][i-1]+1,Math.min(r[n][i-1]+1,r[n-1][i]+1));return r[t.length][e.length]}Object.defineProperty(t,"__esModule",{value:!0}),t.newMatcherFn=t.newDistanceFn=t.levenshtein=void 0,t.levenshtein=i,t.newDistanceFn=function(e){return function(t,n){var r=e(t).trim(),l=e(n).trim();return i(r,l)/(r.length+l.length)}},t.newMatcherFn=function(e){return function t(n,i,r,l){void 0===r&&(r=0),void 0===l&&(l=new Map);var o=function(t,n,i){void 0===i&&(i=new Map);for(var r,l=1/0,o=0;o<t.length;++o)for(var a=0;a<n.length;++a){var s=JSON.stringify([t[o],n[a]]),f=void 0;i.has(s)&&(f=i.get(s))||(f=e(t[o],n[a]),i.set(s,f)),f<l&&(r={indexA:o,indexB:a,score:l=f})}return r}(n,i,l);if(!o||n.length+i.length<3)return[[n,i]];var a=n.slice(0,o.indexA),s=i.slice(0,o.indexB),f=[n[o.indexA]],u=[i[o.indexB]],d=o.indexA+1,c=o.indexB+1,h=n.slice(d),p=i.slice(c),g=t(a,s,r+1,l),v=t(f,u,r+1,l),b=t(h,p,r+1,l),m=v;return(o.indexA>0||o.indexB>0)&&(m=g.concat(m)),(n.length>d||i.length>c)&&(m=m.concat(b)),m}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.hashCode=t.unifyPath=t.escapeForRegExp=void 0;var i=RegExp("["+["-","[","]","/","{","}","(",")","*","+","?",".","\\","^","$","|"].join("\\")+"]","g");t.escapeForRegExp=function(e){return e.replace(i,"\\$&")},t.unifyPath=function(e){return e?e.replace(/\\/g,"/"):e},t.hashCode=function(e){var t,n,i=0;for(t=0,n=e.length;t<n;t++)i=(i<<5)-i+e.charCodeAt(t),i|=0;return i}},function(e,t,n){var i=n(14);i.Template=n(15).Template,i.template=i.Template,e.exports=i},function(e,t,n){"use strict";var i=this&&this.__assign||function(){return(i=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}).apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.Diff2HtmlUI=t.defaultDiff2HtmlUIConfig=void 0;var r=n(6),l=n(7);t.defaultDiff2HtmlUIConfig=i(i({},l.defaultDiff2HtmlConfig),{synchronisedScroll:!0,highlight:!0,fileListToggle:!0,fileListStartVisible:!1,smartSelection:!0});var o=function(){function e(e,n,r,o){void 0===r&&(r={}),this.hljs=null,this.currentSelectionColumnId=-1,this.config=i(i({},t.defaultDiff2HtmlUIConfig),r),this.diffHtml=void 0!==n?l.html(n,this.config):e.innerHTML,this.targetElement=e,void 0!==o&&(this.hljs=o)}return e.prototype.mergeLine=function(){function e(e){for(var t=e.querySelectorAll(".d2h-diff-tbody")[0].querySelectorAll("tr"),n=[],i=0,r=t.length;i<r;i++){var l=t[i].querySelectorAll(".d2h-cntx");n.push(0!=l.length?1:0)}return n}this.targetElement.querySelectorAll(".d2h-file-wrapper").forEach((function(t){for(var n=Array().slice.call(t.querySelectorAll(".d2h-file-side-diff")),i=n[0],r=n[1],l=e(i),o=e(r),a=[],s=0,f=l.length;s<f;s++)a.push(l[s]==o[s]?l[s]:0);var u=i.querySelector(".d2h-diff-tbody").querySelectorAll("tr"),d=r.querySelector(".d2h-diff-tbody").querySelectorAll("tr");if(null!=u&&null!=d){var c=[],h=[],p=0;for(s=0,f=a.length;s<f;s++)0==a[s]?(p=1,c.length>=20&&(c=c.slice(0!=p?5:0,c.length-5),h.push(c)),c=[]):c.push(s);c.length>=20&&(c=c.slice(0!=p?5:0,c.length),h.push(c)),0!=h.length&&h.forEach((function(e){var t,n;e.forEach((function(e){u[e].style.display="none",d[e].style.display="none"}));var i='<td class="d2h-code-side-linenumber d2h-ctnx">..</td><td class="d2h-ctnx"><div class="d2h-code-side-line d2h-cntx d2h-expand-cntx"><span class="d2h-code-line-ctn d2h-expand-cntx-btn">**************隐藏'+e.length+"行,单击展开***************</span></div></td>",r=document.createElement("tr");r.innerHTML=i,r.querySelector(".d2h-expand-cntx-btn").addEventListener("click",(function(){var t,n;null===(t=u[e[0]].parentNode)||void 0===t||t.removeChild(r),null===(n=d[e[0]].parentNode)||void 0===n||n.removeChild(l),e.forEach((function(e){u[e].style.display="table-row",d[e].style.display="table-row"}))}));var l=document.createElement("tr");l.innerHTML=i,l.querySelector(".d2h-expand-cntx-btn").addEventListener("click",(function(){var t,n;null===(t=u[e[0]].parentNode)||void 0===t||t.removeChild(r),null===(n=d[e[0]].parentNode)||void 0===n||n.removeChild(l),e.forEach((function(e){u[e].style.display="table-row",d[e].style.display="table-row"}))})),null===(t=u[e[0]].parentNode)||void 0===t||t.insertBefore(r,u[e[0]]),null===(n=d[e[0]].parentNode)||void 0===n||n.insertBefore(l,d[e[0]])}))}}))},e.prototype.showWrapper=function(){var e=this.targetElement,t=this.targetElement.querySelectorAll(".d2h-file-wrapper"),n=this.targetElement.querySelectorAll(".d2h-file-name"),i=this.targetElement.querySelector(".d2h-file-list-wrapper");if(null!=n){n.forEach((function(n){n.addEventListener("click",(function(){var r=n.getAttribute("href"),l=null==r?void 0:r.substring(r.lastIndexOf("#"));if(null!=l){var o=e.querySelector(l);if(null!=o){t.forEach((function(e){e.style.display=e==o?"block":"none"}));var a=document.getElementById("btn-push-right");null!=a&&(i.style.width="0",a.style.width="20px",i.style.overflow="hidden")}}}))}));var r=document.getElementById("btn-push-right");null!=r&&r.addEventListener("click",(function(){i.style.width="20%",r.style.width="0",i.style.overflow="inherit",document.body.scrollTop=document.documentElement.scrollTop=0}))}},e.prototype.draw=function(){this.targetElement.innerHTML=this.diffHtml,this.config.synchronisedScroll&&this.synchronisedScroll(),this.config.highlight&&this.highlightCode(),this.config.fileListToggle&&this.fileListToggle(this.config.fileListStartVisible)},e.prototype.synchronisedScroll=function(){this.targetElement.querySelectorAll(".d2h-file-wrapper").forEach((function(e){var t=Array().slice.call(e.querySelectorAll(".d2h-file-side-diff")),n=t[0],i=t[1];if(void 0!==n&&void 0!==i){var r=function(e){null!==e&&null!==e.target&&(e.target===n?(i.scrollTop=n.scrollTop,i.scrollLeft=n.scrollLeft):(n.scrollTop=i.scrollTop,n.scrollLeft=i.scrollLeft))};n.addEventListener("scroll",r),i.addEventListener("scroll",r)}}))},e.prototype.fileListToggle=function(e){var t=this.targetElement.querySelector(".d2h-show"),n=this.targetElement.querySelector(".d2h-hide"),i=this.targetElement.querySelector(".d2h-file-list");if(null!==t&&null!==n&&null!==i){var r=function(){t.style.display="none",n.style.display="none",i.style.display="block"},l=function(){t.style.display="none",n.style.display="none",i.style.display="block"};t.addEventListener("click",(function(){return r()})),n.addEventListener("click",(function(){return l()}));var o=this.getHashTag();"files-summary-show"===o?r():"files-summary-hide"===o?l():e?r():l()}},e.prototype.highlightCode=function(){var e=this;if(null===this.hljs)throw new Error("Missing a `highlight.js` implementation. Please provide one when instantiating Diff2HtmlUI.");this.targetElement.querySelectorAll(".d2h-file-wrapper").forEach((function(t){var n,i;t.querySelectorAll(".d2h-code-line-ctn").forEach((function(l){if(null!==e.hljs){var o=l.textContent,a=l.parentNode;if(null!==o&&null!==a&&e.isElement(a)){var s=a.classList.contains("d2h-del")?n:i,f=t.getAttribute("data-lang"),u=f&&e.hljs.getLanguage(f)?e.hljs.highlight(f,o,!0,s):e.hljs.highlightAuto(o);e.instanceOfHighlightResult(u)&&(a.classList.contains("d2h-del")?n=u.top:(a.classList.contains("d2h-ins")||(n=u.top),i=u.top));var d=r.nodeStream(l);if(d.length){var c=document.createElementNS("http://www.w3.org/1999/xhtml","div");c.innerHTML=u.value,u.value=r.mergeStreams(d,r.nodeStream(c),o)}l.classList.add("hljs"),u.language&&l.classList.add(u.language),l.innerHTML=u.value}}}))})),this.showWrapper(),this.mergeLine()},e.prototype.smartSelection=function(){console.warn("Smart selection is now enabled by default with CSS. No need to call this method anymore.")},e.prototype.instanceOfHighlightResult=function(e){return"top"in e},e.prototype.getHashTag=function(){var e=document.URL,t=e.indexOf("#"),n=null;return-1!==t&&(n=e.substr(t+1)),n},e.prototype.isElement=function(e){var t;return null!==e&&void 0!==(null===(t=e)||void 0===t?void 0:t.classList)},e}();t.Diff2HtmlUI=o},function(e,t,n){"use strict";function i(e){return e.replace(/&/gm,"&").replace(/</gm,"<").replace(/>/gm,">")}function r(e){return e.nodeName.toLowerCase()}Object.defineProperty(t,"__esModule",{value:!0}),t.mergeStreams=t.nodeStream=void 0,t.nodeStream=function(e){var t=[],n=function(e,i){for(var l=e.firstChild;l;l=l.nextSibling)3===l.nodeType&&null!==l.nodeValue?i+=l.nodeValue.length:1===l.nodeType&&(t.push({event:"start",offset:i,node:l}),i=n(l,i),r(l).match(/br|hr|img|input/)||t.push({event:"stop",offset:i,node:l}));return i};return n(e,0),t},t.mergeStreams=function(e,t,n){var l=0,o="",a=[];function s(){return e.length&&t.length?e[0].offset!==t[0].offset?e[0].offset<t[0].offset?e:t:"start"===t[0].event?e:t:e.length?e:t}function f(e){if(null===(t=e)||void 0===(null===(n=t)||void 0===n?void 0:n.attributes))throw new Error("Node is not an Element");var t,n;o+="<"+r(e)+" "+Array().map.call(e.attributes,(function(e){return e.nodeName+'="'+i(e.value).replace(/"/g,""")+'"'})).join(" ")+">"}function u(e){o+="</"+r(e)+">"}function d(e){("start"===e.event?f:u)(e.node)}for(;e.length||t.length;){var c=s();if(o+=i(n.substring(l,c[0].offset)),l=c[0].offset,c===e){a.reverse().forEach(u);do{d(c.splice(0,1)[0]),c=s()}while(c===e&&c.length&&c[0].offset===l);a.reverse().forEach(f)}else"start"===c[0].event?a.push(c[0].node):a.pop(),d(c.splice(0,1)[0])}return o+i(n.substr(l))}},function(e,t,n){"use strict";var i=this&&this.__assign||function(){return(i=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}).apply(this,arguments)},r=this&&this.__createBinding||(Object.create?function(e,t,n,i){void 0===i&&(i=n),Object.defineProperty(e,i,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,i){void 0===i&&(i=n),e[i]=t[n]}),l=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return l(t,e),t},a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.html=t.parse=t.defaultDiff2HtmlConfig=void 0;var s=o(n(8)),f=o(n(9)),u=o(n(11)),d=o(n(12)),c=n(0),h=a(n(13));t.defaultDiff2HtmlConfig=i(i(i({},u.defaultLineByLineRendererConfig),d.defaultSideBySideRendererConfig),{outputFormat:c.OutputFormatType.LINE_BY_LINE,drawFileList:!0}),t.parse=function(e,n){return void 0===n&&(n={}),s.parse(e,i(i({},t.defaultDiff2HtmlConfig),n))},t.html=function(e,n){void 0===n&&(n={});var r=i(i({},t.defaultDiff2HtmlConfig),n),l="string"==typeof e?s.parse(e,r):e,o=new h.default(r);return(r.drawFileList?f.render(l,o):"")+("side-by-side"===r.outputFormat?new d.default(o,r).render(l):new u.default(o,r).render(l))}},function(e,t,n){"use strict";var i=this&&this.__spreadArrays||function(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;var i=Array(e),r=0;for(t=0;t<n;t++)for(var l=arguments[t],o=0,a=l.length;o<a;o++,r++)i[r]=l[o];return i};Object.defineProperty(t,"__esModule",{value:!0}),t.parse=void 0;var r=n(0),l=n(3);function o(e,t){var n=e.split(".");return n.length>1?n[n.length-1]:t}function a(e,t){return t.reduce((function(t,n){return t||e.startsWith(n)}),!1)}var s=["a/","b/","i/","w/","c/","o/"];function f(e,t,n){var r=void 0!==n?i(s,[n]):s,o=((t?new RegExp("^"+l.escapeForRegExp(t)+' "?(.+?)"?$'):new RegExp('^"?(.+?)"?$')).exec(e)||[])[1],a=void 0===o?"":o,f=r.find((function(e){return 0===a.indexOf(e)}));return(f?a.slice(f.length):a).replace(/\s+\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}(?:\.\d+)? [+-]\d{4}.*$/,"")}t.parse=function(e,t){void 0===t&&(t={});var n=[],i=null,l=null,s=null,u=null,d=null,c=null,h=null,p=/^old mode (\d{6})/,g=/^new mode (\d{6})/,v=/^deleted file mode (\d{6})/,b=/^new file mode (\d{6})/,m=/^copy from "?(.+)"?/,y=/^copy to "?(.+)"?/,w=/^rename from "?(.+)"?/,S=/^rename to "?(.+)"?/,L=/^similarity index (\d+)%/,x=/^dissimilarity index (\d+)%/,C=/^index ([\da-z]+)\.\.([\da-z]+)\s*(\d{6})?/,T=/^Binary files (.*) and (.*) differ/,N=/^GIT binary patch/,E=/^index ([\da-z]+),([\da-z]+)\.\.([\da-z]+)/,O=/^mode (\d{6}),(\d{6})\.\.(\d{6})/,_=/^new file mode (\d{6})/,H=/^deleted file mode (\d{6}),(\d{6})/,j=e.replace(/\\ No newline at end of file/g,"").replace(/\r\n?/g,"\n").split("\n");function k(){null!==l&&null!==i&&(i.blocks.push(l),l=null)}function P(){null!==i&&(i.oldName||null===c||(i.oldName=c),i.newName||null===h||(i.newName=h),i.newName&&(n.push(i),i=null)),c=null,h=null}function M(){k(),P(),i={blocks:[],deletedLines:0,addedLines:0}}function F(e){var t;k(),null!==i&&((t=/^@@ -(\d+)(?:,\d+)? \+(\d+)(?:,\d+)? @@.*/.exec(e))?(i.isCombined=!1,s=parseInt(t[1],10),d=parseInt(t[2],10)):(t=/^@@@ -(\d+)(?:,\d+)? -(\d+)(?:,\d+)? \+(\d+)(?:,\d+)? @@@.*/.exec(e))?(i.isCombined=!0,s=parseInt(t[1],10),u=parseInt(t[2],10),d=parseInt(t[3],10)):(e.startsWith("@@")&&console.error("Failed to parse lines, starting in 0!"),s=0,d=0,i.isCombined=!1)),l={lines:[],oldStartLine:s,oldStartLine2:u,newStartLine:d,header:e}}return j.forEach((function(e,n){if(e&&!e.startsWith("*")){var u,k=j[n-1],P=j[n+1],I=j[n+2];if(e.startsWith("diff")){M();if((u=/^diff --git "?(.+)"? "?(.+)"?/.exec(e))&&(c=f(u[1],void 0,t.dstPrefix),h=f(u[2],void 0,t.srcPrefix)),null===i)throw new Error("Where is my file !!!");i.isGitDiff=!0}else{if((!i||!i.isGitDiff&&i&&e.startsWith("--- ")&&P.startsWith("+++ ")&&I.startsWith("@@"))&&M(),e.startsWith("--- ")&&P.startsWith("+++ ")||e.startsWith("+++ ")&&k.startsWith("--- ")){if(i&&!i.oldName&&e.startsWith("--- ")&&(u=function(e,t){return f(e,"---",t)}(e,t.srcPrefix)))return i.oldName=u,void(i.language=o(i.oldName,i.language));if(i&&!i.newName&&e.startsWith("+++ ")&&(u=function(e,t){return f(e,"+++",t)}(e,t.dstPrefix)))return i.newName=u,void(i.language=o(i.newName,i.language))}if(i&&(e.startsWith("@@")||i.isGitDiff&&i.oldName&&i.newName&&!l))F(e);else if(l&&(e.startsWith("+")||e.startsWith("-")||e.startsWith(" ")))!function(e){if(null!==i&&null!==l&&null!==s&&null!==d){var t={content:e},n=i.isCombined?["+ "," +","++"]:["+"],o=i.isCombined?["- "," -","--"]:["-"];a(e,n)?(i.addedLines++,t.type=r.LineType.INSERT,t.oldNumber=void 0,t.newNumber=d++):a(e,o)?(i.deletedLines++,t.type=r.LineType.DELETE,t.oldNumber=s++,t.newNumber=void 0):(t.type=r.LineType.CONTEXT,t.oldNumber=s++,t.newNumber=d++),l.lines.push(t)}}(e);else{var D=!function(e,t){for(var n=t;n<j.length-3;){if(e.startsWith("diff"))return!1;if(j[n].startsWith("--- ")&&j[n+1].startsWith("+++ ")&&j[n+2].startsWith("@@"))return!0;n++}return!1}(e,n);if(null===i)throw new Error("Where is my file !!!");(u=p.exec(e))?i.oldMode=u[1]:(u=g.exec(e))?i.newMode=u[1]:(u=v.exec(e))?(i.deletedFileMode=u[1],i.isDeleted=!0):(u=b.exec(e))?(i.newFileMode=u[1],i.isNew=!0):(u=m.exec(e))?(D&&(i.oldName=u[1]),i.isCopy=!0):(u=y.exec(e))?(D&&(i.newName=u[1]),i.isCopy=!0):(u=w.exec(e))?(D&&(i.oldName=u[1]),i.isRename=!0):(u=S.exec(e))?(D&&(i.newName=u[1]),i.isRename=!0):(u=T.exec(e))?(i.isBinary=!0,i.oldName=f(u[1],void 0,t.srcPrefix),i.newName=f(u[2],void 0,t.dstPrefix),F("Binary file")):N.test(e)?(i.isBinary=!0,F(e)):(u=L.exec(e))?i.unchangedPercentage=parseInt(u[1],10):(u=x.exec(e))?i.changedPercentage=parseInt(u[1],10):(u=C.exec(e))?(i.checksumBefore=u[1],i.checksumAfter=u[2],u[3]&&(i.mode=u[3])):(u=E.exec(e))?(i.checksumBefore=[u[2],u[3]],i.checksumAfter=u[1]):(u=O.exec(e))?(i.oldMode=[u[2],u[3]],i.newMode=u[1]):(u=_.exec(e))?(i.newFileMode=u[1],i.isNew=!0):(u=H.exec(e))&&(i.deletedFileMode=u[1],i.isDeleted=!0)}}}})),k(),P(),n}},function(e,t,n){"use strict";var i=this&&this.__createBinding||(Object.create?function(e,t,n,i){void 0===i&&(i=n),Object.defineProperty(e,i,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,i){void 0===i&&(i=n),e[i]=t[n]}),r=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),l=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&i(t,e,n);return r(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.render=void 0;var o=l(n(1));t.render=function(e,t){var n=e.map((function(e){return t.render("file-summary","line",{fileHtmlId:o.getHtmlId(e),oldName:e.oldName,newName:e.newName,fileName:o.filenameDiff(e),deletedLines:"-"+e.deletedLines,addedLines:"+"+e.addedLines},{fileIcon:t.template("icon",o.getFileIcon(e))})})).join("\n");return t.render("file-summary","wrapper",{filesNumber:e.length,files:n})}},function(e,t,n){
/*!
diff v4.0.1
Software License Agreement (BSD License)
Copyright (c) 2009-2015, Kevin Decker <kpdecker@gmail.com>
All rights reserved.
Redistribution and use of this software in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above
copyright notice, this list of conditions and the
following disclaimer.
* Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the
following disclaimer in the documentation and/or other
materials provided with the distribution.
* Neither the name of Kevin Decker nor the names of its
contributors may be used to endorse or promote products
derived from this software without specific prior
written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
@license
*/
!function(e){"use strict";function t(){}function n(e,t,n,i,r){for(var l=0,o=t.length,a=0,s=0;l<o;l++){var f=t[l];if(f.removed){if(f.value=e.join(i.slice(s,s+f.count)),s+=f.count,l&&t[l-1].added){var u=t[l-1];t[l-1]=t[l],t[l]=u}}else{if(!f.added&&r){var d=n.slice(a,a+f.count);d=d.map((function(e,t){var n=i[s+t];return n.length>e.length?n:e})),f.value=e.join(d)}else f.value=e.join(n.slice(a,a+f.count));a+=f.count,f.added||(s+=f.count)}}var c=t[o-1];return o>1&&"string"==typeof c.value&&(c.added||c.removed)&&e.equals("",c.value)&&(t[o-2].value+=c.value,t.pop()),t}function i(e){return{newPos:e.newPos,components:e.components.slice(0)}}t.prototype={diff:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},l=r.callback;"function"==typeof r&&(l=r,r={}),this.options=r;var o=this;function a(e){return l?(setTimeout((function(){l(void 0,e)}),0),!0):e}e=this.castInput(e),t=this.castInput(t),e=this.removeEmpty(this.tokenize(e));var s=(t=this.removeEmpty(this.tokenize(t))).length,f=e.length,u=1,d=s+f,c=[{newPos:-1,components:[]}],h=this.extractCommon(c[0],t,e,0);if(c[0].newPos+1>=s&&h+1>=f)return a([{value:this.join(t),count:t.length}]);function p(){for(var r=-1*u;r<=u;r+=2){var l=void 0,d=c[r-1],h=c[r+1],p=(h?h.newPos:0)-r;d&&(c[r-1]=void 0);var g=d&&d.newPos+1<s,v=h&&0<=p&&p<f;if(g||v){if(!g||v&&d.newPos<h.newPos?(l=i(h),o.pushComponent(l.components,void 0,!0)):((l=d).newPos++,o.pushComponent(l.components,!0,void 0)),p=o.extractCommon(l,t,e,r),l.newPos+1>=s&&p+1>=f)return a(n(o,l.components,t,e,o.useLongestToken));c[r]=l}else c[r]=void 0}u++}if(l)!function e(){setTimeout((function(){if(u>d)return l();p()||e()}),0)}();else for(;u<=d;){var g=p();if(g)return g}},pushComponent:function(e,t,n){var i=e[e.length-1];i&&i.added===t&&i.removed===n?e[e.length-1]={count:i.count+1,added:t,removed:n}:e.push({count:1,added:t,removed:n})},extractCommon:function(e,t,n,i){for(var r=t.length,l=n.length,o=e.newPos,a=o-i,s=0;o+1<r&&a+1<l&&this.equals(t[o+1],n[a+1]);)o++,a++,s++;return s&&e.components.push({count:s}),e.newPos=o,a},equals:function(e,t){return this.options.comparator?this.options.comparator(e,t):e===t||this.options.ignoreCase&&e.toLowerCase()===t.toLowerCase()},removeEmpty:function(e){for(var t=[],n=0;n<e.length;n++)e[n]&&t.push(e[n]);return t},castInput:function(e){return e},tokenize:function(e){return e.split("")},join:function(e){return e.join("")}};var r=new t;function l(e,t){if("function"==typeof e)t.callback=e;else if(e)for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);return t}var o=/^[A-Za-z\xC0-\u02C6\u02C8-\u02D7\u02DE-\u02FF\u1E00-\u1EFF]+$/,a=/\S/,s=new t;s.equals=function(e,t){return this.options.ignoreCase&&(e=e.toLowerCase(),t=t.toLowerCase()),e===t||this.options.ignoreWhitespace&&!a.test(e)&&!a.test(t)},s.tokenize=function(e){for(var t=e.split(/(\s+|[()[\]{}'"]|\b)/),n=0;n<t.length-1;n++)!t[n+1]&&t[n+2]&&o.test(t[n])&&o.test(t[n+2])&&(t[n]+=t[n+2],t.splice(n+1,2),n--);return t};var f=new t;function u(e,t,n){return f.diff(e,t,n)}f.tokenize=function(e){var t=[],n=e.split(/(\n|\r\n)/);n[n.length-1]||n.pop();for(var i=0;i<n.length;i++){var r=n[i];i%2&&!this.options.newlineIsToken?t[t.length-1]+=r:(this.options.ignoreWhitespace&&(r=r.trim()),t.push(r))}return t};var d=new t;d.tokenize=function(e){return e.split(/(\S.+?[.!?])(?=\s+|$)/)};var c=new t;function h(e){return(h="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function p(e){return function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t<e.length;t++)n[t]=e[t];return n}}(e)||function(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}c.tokenize=function(e){return e.split(/([{}:;,]|\s+)/)};var g=Object.prototype.toString,v=new t;function b(e,t,n,i,r){var l,o;for(t=t||[],n=n||[],i&&(e=i(r,e)),l=0;l<t.length;l+=1)if(t[l]===e)return n[l];if("[object Array]"===g.call(e)){for(t.push(e),o=new Array(e.length),n.push(o),l=0;l<e.length;l+=1)o[l]=b(e[l],t,n,i,r);return t.pop(),n.pop(),o}if(e&&e.toJSON&&(e=e.toJSON()),"object"===h(e)&&null!==e){t.push(e),o={},n.push(o);var a,s=[];for(a in e)e.hasOwnProperty(a)&&s.push(a);for(s.sort(),l=0;l<s.length;l+=1)o[a=s[l]]=b(e[a],t,n,i,a);t.pop(),n.pop()}else o=e;return o}v.useLongestToken=!0,v.tokenize=f.tokenize,v.castInput=function(e){var t=this.options,n=t.undefinedReplacement,i=t.stringifyReplacer,r=void 0===i?function(e,t){return void 0===t?n:t}:i;return"string"==typeof e?e:JSON.stringify(b(e,null,null,r),r," ")},v.equals=function(e,n){return t.prototype.equals.call(v,e.replace(/,([\r\n])/g,"$1"),n.replace(/,([\r\n])/g,"$1"))};var m=new t;function y(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.split(/\r\n|[\n\v\f\r\x85]/),i=e.match(/\r\n|[\n\v\f\r\x85]/g)||[],r=[],l=0;function o(){var e={};for(r.push(e);l<n.length;){var i=n[l];if(/^(\-\-\-|\+\+\+|@@)\s/.test(i))break;var o=/^(?:Index:|diff(?: -r \w+)+)\s+(.+?)\s*$/.exec(i);o&&(e.index=o[1]),l++}for(a(e),a(e),e.hunks=[];l<n.length;){var f=n[l];if(/^(Index:|diff|\-\-\-|\+\+\+)\s/.test(f))break;if(/^@@/.test(f))e.hunks.push(s());else{if(f&&t.strict)throw new Error("Unknown line "+(l+1)+" "+JSON.stringify(f));l++}}}function a(e){var t=/^(---|\+\+\+)\s+(.*)$/.exec(n[l]);if(t){var i="---"===t[1]?"old":"new",r=t[2].split("\t",2),o=r[0].replace(/\\\\/g,"\\");/^".*"$/.test(o)&&(o=o.substr(1,o.length-2)),e[i+"FileName"]=o,e[i+"Header"]=(r[1]||"").trim(),l++}}function s(){for(var e=l,r=n[l++].split(/@@ -(\d+)(?:,(\d+))? \+(\d+)(?:,(\d+))? @@/),o={oldStart:+r[1],oldLines:+r[2]||1,newStart:+r[3],newLines:+r[4]||1,lines:[],linedelimiters:[]},a=0,s=0;l<n.length&&!(0===n[l].indexOf("--- ")&&l+2<n.length&&0===n[l+1].indexOf("+++ ")&&0===n[l+2].indexOf("@@"));l++){var f=0==n[l].length&&l!=n.length-1?" ":n[l][0];if("+"!==f&&"-"!==f&&" "!==f&&"\\"!==f)break;o.lines.push(n[l]),o.linedelimiters.push(i[l]||"\n"),"+"===f?a++:"-"===f?s++:" "===f&&(a++,s++)}if(a||1!==o.newLines||(o.newLines=0),s||1!==o.oldLines||(o.oldLines=0),t.strict){if(a!==o.newLines)throw new Error("Added line count did not match for hunk at line "+(e+1));if(s!==o.oldLines)throw new Error("Removed line count did not match for hunk at line "+(e+1))}return o}for(;l<n.length;)o();return r}function w(e,t,n){var i=!0,r=!1,l=!1,o=1;return function a(){if(i&&!l){if(r?o++:i=!1,e+o<=n)return o;l=!0}if(!r)return l||(i=!0),t<=e-o?-o++:(r=!0,a())}}function S(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if("string"==typeof t&&(t=y(t)),Array.isArray(t)){if(t.length>1)throw new Error("applyPatch only works with a single input.");t=t[0]}var i,r,l=e.split(/\r\n|[\n\v\f\r\x85]/),o=e.match(/\r\n|[\n\v\f\r\x85]/g)||[],a=t.hunks,s=n.compareLine||function(e,t,n,i){return t===i},f=0,u=n.fuzzFactor||0,d=0,c=0;function h(e,t){for(var n=0;n<e.lines.length;n++){var i=e.lines[n],r=i.length>0?i[0]:" ",o=i.length>0?i.substr(1):i;if(" "===r||"-"===r){if(!s(t+1,l[t],r,o)&&++f>u)return!1;t++}}return!0}for(var p=0;p<a.length;p++){for(var g=a[p],v=l.length-g.oldLines,b=0,m=c+g.oldStart-1,S=w(m,d,v);void 0!==b;b=S())if(h(g,m+b)){g.offset=c+=b;break}if(void 0===b)return!1;d=g.offset+g.oldStart+g.oldLines}for(var L=0,x=0;x<a.length;x++){var C=a[x],T=C.oldStart+C.offset+L-1;L+=C.newLines-C.oldLines,T<0&&(T=0);for(var N=0;N<C.lines.length;N++){var E=C.lines[N],O=E.length>0?E[0]:" ",_=E.length>0?E.substr(1):E,H=C.linedelimiters[N];if(" "===O)T++;else if("-"===O)l.splice(T,1),o.splice(T,1);else if("+"===O)l.splice(T,0,_),o.splice(T,0,H),T++;else if("\\"===O){var j=C.lines[N-1]?C.lines[N-1][0]:null;"+"===j?i=!0:"-"===j&&(r=!0)}}}if(i)for(;!l[l.length-1];)l.pop(),o.pop();else r&&(l.push(""),o.push("\n"));for(var k=0;k<l.length-1;k++)l[k]=l[k]+o[k];return l.join("")}function L(e,t,n,i,r,l,o){o||(o={}),void 0===o.context&&(o.context=4);var a=u(n,i,o);function s(e){return e.map((function(e){return" "+e}))}a.push({value:"",lines:[]});for(var f=[],d=0,c=0,h=[],g=1,v=1,b=function(e){var t=a[e],r=t.lines||t.value.replace(/\n$/,"").split("\n");if(t.lines=r,t.added||t.removed){var l;if(!d){var u=a[e-1];d=g,c=v,u&&(h=o.context>0?s(u.lines.slice(-o.context)):[],d-=h.length,c-=h.length)}(l=h).push.apply(l,p(r.map((function(e){return(t.added?"+":"-")+e})))),t.added?v+=r.length:g+=r.length}else{if(d)if(r.length<=2*o.context&&e<a.length-2){var b;(b=h).push.apply(b,p(s(r)))}else{var m,y=Math.min(r.length,o.context);(m=h).push.apply(m,p(s(r.slice(0,y))));var w={oldStart:d,oldLines:g-d+y,newStart:c,newLines:v-c+y,lines:h};if(e>=a.length-2&&r.length<=o.context){var S=/\n$/.test(n),L=/\n$/.test(i),x=0==r.length&&h.length>w.oldLines;!S&&x&&h.splice(w.oldLines,0,"\\ No newline at end of file"),(S||x)&&L||h.push("\\ No newline at end of file")}f.push(w),d=0,c=0,h=[]}g+=r.length,v+=r.length}},m=0;m<a.length;m++)b(m);return{oldFileName:e,newFileName:t,oldHeader:r,newHeader:l,hunks:f}}function x(e,t,n,i,r,l,o){var a=L(e,t,n,i,r,l,o),s=[];e==t&&s.push("Index: "+e),s.push("==================================================================="),s.push("--- "+a.oldFileName+(void 0===a.oldHeader?"":"\t"+a.oldHeader)),s.push("+++ "+a.newFileName+(void 0===a.newHeader?"":"\t"+a.newHeader));for(var f=0;f<a.hunks.length;f++){var u=a.hunks[f];s.push("@@ -"+u.oldStart+","+u.oldLines+" +"+u.newStart+","+u.newLines+" @@"),s.push.apply(s,u.lines)}return s.join("\n")+"\n"}function C(e,t){if(t.length>e.length)return!1;for(var n=0;n<t.length;n++)if(t[n]!==e[n])return!1;return!0}function T(e){var t=function e(t){var n=0,i=0;return t.forEach((function(t){if("string"!=typeof t){var r=e(t.mine),l=e(t.theirs);void 0!==n&&(r.oldLines===l.oldLines?n+=r.oldLines:n=void 0),void 0!==i&&(r.newLines===l.newLines?i+=r.newLines:i=void 0)}else void 0===i||"+"!==t[0]&&" "!==t[0]||i++,void 0===n||"-"!==t[0]&&" "!==t[0]||n++})),{oldLines:n,newLines:i}}(e.lines),n=t.oldLines,i=t.newLines;void 0!==n?e.oldLines=n:delete e.oldLines,void 0!==i?e.newLines=i:delete e.newLines}function N(e,t){if("string"==typeof e){if(/^@@/m.test(e)||/^Index:/m.test(e))return y(e)[0];if(!t)throw new Error("Must provide a base reference or pass in a patch");return L(void 0,void 0,t,e)}return e}function E(e){return e.newFileName&&e.newFileName!==e.oldFileName}function O(e,t,n){return t===n?t:(e.conflict=!0,{mine:t,theirs:n})}function _(e,t){return e.oldStart<t.oldStart&&e.oldStart+e.oldLines<t.oldStart}function H(e,t){return{oldStart:e.oldStart,oldLines:e.oldLines,newStart:e.newStart+t,newLines:e.newLines,lines:e.lines}}function j(e,t,n,i,r){var l={offset:t,lines:n,index:0},o={offset:i,lines:r,index:0};for(F(e,l,o),F(e,o,l);l.index<l.lines.length&&o.index<o.lines.length;){var a=l.lines[l.index],s=o.lines[o.index];if("-"!==a[0]&&"+"!==a[0]||"-"!==s[0]&&"+"!==s[0])if("+"===a[0]&&" "===s[0]){var f;(f=e.lines).push.apply(f,p(D(l)))}else if("+"===s[0]&&" "===a[0]){var u;(u=e.lines).push.apply(u,p(D(o)))}else"-"===a[0]&&" "===s[0]?P(e,l,o):"-"===s[0]&&" "===a[0]?P(e,o,l,!0):a===s?(e.lines.push(a),l.index++,o.index++):M(e,D(l),D(o));else k(e,l,o)}I(e,l),I(e,o),T(e)}function k(e,t,n){var i,r,l=D(t),o=D(n);if(A(l)&&A(o)){var a,s;if(C(l,o)&&R(n,l,l.length-o.length))return void(a=e.lines).push.apply(a,p(l));if(C(o,l)&&R(t,o,o.length-l.length))return void(s=e.lines).push.apply(s,p(o))}else if(r=o,(i=l).length===r.length&&C(i,r)){var f;return void(f=e.lines).push.apply(f,p(l))}M(e,l,o)}function P(e,t,n,i){var r,l=D(t),o=function(e,t){for(var n=[],i=[],r=0,l=!1,o=!1;r<t.length&&e.index<e.lines.length;){var a=e.lines[e.index],s=t[r];if("+"===s[0])break;if(l=l||" "!==a[0],i.push(s),r++,"+"===a[0])for(o=!0;"+"===a[0];)n.push(a),a=e.lines[++e.index];s.substr(1)===a.substr(1)?(n.push(a),e.index++):o=!0}if("+"===(t[r]||"")[0]&&l&&(o=!0),o)return n;for(;r<t.length;)i.push(t[r++]);return{merged:i,changes:n}}(n,l);o.merged?(r=e.lines).push.apply(r,p(o.merged)):M(e,i?o:l,i?l:o)}function M(e,t,n){e.conflict=!0,e.lines.push({conflict:!0,mine:t,theirs:n})}function F(e,t,n){for(;t.offset<n.offset&&t.index<t.lines.length;){var i=t.lines[t.index++];e.lines.push(i),t.offset++}}function I(e,t){for(;t.index<t.lines.length;){var n=t.lines[t.index++];e.lines.push(n)}}function D(e){for(var t=[],n=e.lines[e.index][0];e.index<e.lines.length;){var i=e.lines[e.index];if("-"===n&&"+"===i[0]&&(n="+"),n!==i[0])break;t.push(i),e.index++}return t}function A(e){return e.reduce((function(e,t){return e&&"-"===t[0]}),!0)}function R(e,t,n){for(var i=0;i<n;i++){var r=t[t.length-n+i].substr(1);if(e.lines[e.index+i]!==" "+r)return!1}return e.index+=n,!0}m.tokenize=function(e){return e.slice()},m.join=m.removeEmpty=function(e){return e},e.Diff=t,e.diffChars=function(e,t,n){return r.diff(e,t,n)},e.diffWords=function(e,t,n){return n=l(n,{ignoreWhitespace:!0}),s.diff(e,t,n)},e.diffWordsWithSpace=function(e,t,n){return s.diff(e,t,n)},e.diffLines=u,e.diffTrimmedLines=function(e,t,n){var i=l(n,{ignoreWhitespace:!0});return f.diff(e,t,i)},e.diffSentences=function(e,t,n){return d.diff(e,t,n)},e.diffCss=function(e,t,n){return c.diff(e,t,n)},e.diffJson=function(e,t,n){return v.diff(e,t,n)},e.diffArrays=function(e,t,n){return m.diff(e,t,n)},e.structuredPatch=L,e.createTwoFilesPatch=x,e.createPatch=function(e,t,n,i,r,l){return x(e,e,t,n,i,r,l)},e.applyPatch=S,e.applyPatches=function(e,t){"string"==typeof e&&(e=y(e));var n=0;!function i(){var r=e[n++];if(!r)return t.complete();t.loadFile(r,(function(e,n){if(e)return t.complete(e);var l=S(n,r,t);t.patched(r,l,(function(e){if(e)return t.complete(e);i()}))}))}()},e.parsePatch=y,e.merge=function(e,t,n){e=N(e,n),t=N(t,n);var i={};(e.index||t.index)&&(i.index=e.index||t.index),(e.newFileName||t.newFileName)&&(E(e)?E(t)?(i.oldFileName=O(i,e.oldFileName,t.oldFileName),i.newFileName=O(i,e.newFileName,t.newFileName),i.oldHeader=O(i,e.oldHeader,t.oldHeader),i.newHeader=O(i,e.newHeader,t.newHeader)):(i.oldFileName=e.oldFileName,i.newFileName=e.newFileName,i.oldHeader=e.oldHeader,i.newHeader=e.newHeader):(i.oldFileName=t.oldFileName||e.oldFileName,i.newFileName=t.newFileName||e.newFileName,i.oldHeader=t.oldHeader||e.oldHeader,i.newHeader=t.newHeader||e.newHeader)),i.hunks=[];for(var r=0,l=0,o=0,a=0;r<e.hunks.length||l<t.hunks.length;){var s=e.hunks[r]||{oldStart:1/0},f=t.hunks[l]||{oldStart:1/0};if(_(s,f))i.hunks.push(H(s,o)),r++,a+=s.newLines-s.oldLines;else if(_(f,s))i.hunks.push(H(f,a)),l++,o+=f.newLines-f.oldLines;else{var u={oldStart:Math.min(s.oldStart,f.oldStart),oldLines:0,newStart:Math.min(s.newStart+o,f.oldStart+a),newLines:0,lines:[]};j(u,s.oldStart,s.lines,f.oldStart,f.lines),l++,r++,i.hunks.push(u)}}return i},e.convertChangesToDMP=function(e){for(var t,n,i=[],r=0;r<e.length;r++)n=(t=e[r]).added?1:t.removed?-1:0,i.push([n,t.value]);return i},e.convertChangesToXML=function(e){for(var t=[],n=0;n<e.length;n++){var i=e[n];i.added?t.push("<ins>"):i.removed&&t.push("<del>"),t.push((r=i.value,void 0,r.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,"""))),i.added?t.push("</ins>"):i.removed&&t.push("</del>")}var r;return t.join("")},e.canonicalize=b,Object.defineProperty(e,"__esModule",{value:!0})}(t)},function(e,t,n){"use strict";var i=this&&this.__assign||function(){return(i=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}).apply(this,arguments)},r=this&&this.__createBinding||(Object.create?function(e,t,n,i){void 0===i&&(i=n),Object.defineProperty(e,i,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,i){void 0===i&&(i=n),e[i]=t[n]}),l=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return l(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.defaultLineByLineRendererConfig=void 0;var a=o(n(2)),s=o(n(1)),f=n(0);t.defaultLineByLineRendererConfig=i(i({},s.defaultRenderConfig),{renderNothingWhenEmpty:!1,matchingMaxComparisons:2500,maxLineSizeInBlockForComparison:200});var u=function(){function e(e,n){void 0===n&&(n={}),this.hoganUtils=e,this.config=i(i({},t.defaultLineByLineRendererConfig),n)}return e.prototype.render=function(e){var t=this,n=e.map((function(e){var n;return n=e.blocks.length?t.generateFileHtml(e):t.generateEmptyDiff(),t.makeFileDiffHtml(e,n)})).join("\n");return this.hoganUtils.render("generic","wrapper",{content:n})},e.prototype.makeFileDiffHtml=function(e,t){if(this.config.renderNothingWhenEmpty&&Array.isArray(e.blocks)&&0===e.blocks.length)return"";var n=this.hoganUtils.template("line-by-line","file-diff"),i=this.hoganUtils.template("generic","file-path"),r=this.hoganUtils.template("icon","file"),l=this.hoganUtils.template("tag",s.getFileIcon(e));return n.render({file:e,fileHtmlId:s.getHtmlId(e),diffs:t,filePath:i.render({fileDiffName:s.filenameDiff(e)},{fileIcon:r,fileTag:l})})},e.prototype.generateEmptyDiff=function(){return this.hoganUtils.render("generic","empty-diff",{contentClass:"d2h-code-line",CSSLineClass:s.CSSLineClass})},e.prototype.generateFileHtml=function(e){var t=this,n=a.newMatcherFn(a.newDistanceFn((function(t){return s.deconstructLine(t.content,e.isCombined).content})));return e.blocks.map((function(i){var r=t.hoganUtils.render("generic","block-header",{CSSLineClass:s.CSSLineClass,blockHeader:s.escapeForHtml(i.header),lineClass:"d2h-code-linenumber",contentClass:"d2h-code-line"});return t.applyLineGroupping(i).forEach((function(i){var l=i[0],o=i[1],a=i[2];if(o.length&&a.length&&!l.length)t.applyRematchMatching(o,a,n).map((function(n){var i=n[0],l=n[1],o=t.processChangedLines(e.isCombined,i,l),a=o.left,s=o.right;r+=a,r+=s}));else if(l.length)l.forEach((function(n){var i=s.deconstructLine(n.content,e.isCombined),l=i.prefix,o=i.content;r+=t.generateSingleLineHtml({type:s.CSSLineClass.CONTEXT,prefix:l,content:o,oldNumber:n.oldNumber,newNumber:n.newNumber})}));else if(o.length||a.length){var f=t.processChangedLines(e.isCombined,o,a),u=f.left,d=f.right;r+=u,r+=d}else console.error("Unknown state reached while processing groups of lines",l,o,a)})),r})).join("\n")},e.prototype.applyLineGroupping=function(e){for(var t=[],n=[],i=[],r=0;r<e.lines.length;r++){var l=e.lines[r];(l.type!==f.LineType.INSERT&&i.length||l.type===f.LineType.CONTEXT&&n.length>0)&&(t.push([[],n,i]),n=[],i=[]),l.type===f.LineType.CONTEXT?t.push([[l],[],[]]):l.type===f.LineType.INSERT&&0===n.length?t.push([[],[],[l]]):l.type===f.LineType.INSERT&&n.length>0?i.push(l):l.type===f.LineType.DELETE&&n.push(l)}return(n.length||i.length)&&(t.push([[],n,i]),n=[],i=[]),t},e.prototype.applyRematchMatching=function(e,t,n){var i=e.length*t.length,r=Math.max.apply(null,[0].concat(e.concat(t).map((function(e){return e.content.length}))));return i<this.config.matchingMaxComparisons&&r<this.config.maxLineSizeInBlockForComparison&&("lines"===this.config.matching||"words"===this.config.matching)?n(e,t):[[e,t]]},e.prototype.processChangedLines=function(e,t,n){for(var r={right:"",left:""},l=Math.max(t.length,n.length),o=0;o<l;o++){var a=t[o],f=n[o],u=void 0!==a&&void 0!==f?s.diffHighlight(a.content,f.content,e,this.config):void 0,d=void 0!==a&&void 0!==a.oldNumber?i(i({},void 0!==u?{prefix:u.oldLine.prefix,content:u.oldLine.content,type:s.CSSLineClass.DELETE_CHANGES}:i(i({},s.deconstructLine(a.content,e)),{type:s.toCSSClass(a.type)})),{oldNumber:a.oldNumber,newNumber:a.newNumber}):void 0,c=void 0!==f&&void 0!==f.newNumber?i(i({},void 0!==u?{prefix:u.newLine.prefix,content:u.newLine.content,type:s.CSSLineClass.INSERT_CHANGES}:i(i({},s.deconstructLine(f.content,e)),{type:s.toCSSClass(f.type)})),{oldNumber:f.oldNumber,newNumber:f.newNumber}):void 0,h=this.generateLineHtml(d,c),p=h.left,g=h.right;r.left+=p,r.right+=g}return r},e.prototype.generateLineHtml=function(e,t){return{left:this.generateSingleLineHtml(e),right:this.generateSingleLineHtml(t)}},e.prototype.generateSingleLineHtml=function(e){if(void 0===e)return"";var t=this.hoganUtils.render("line-by-line","numbers",{oldNumber:e.oldNumber||"",newNumber:e.newNumber||""});return this.hoganUtils.render("generic","line",{type:e.type,lineClass:"d2h-code-linenumber",contentClass:"d2h-code-line",prefix:" "===e.prefix?" ":e.prefix,content:e.content,lineNumber:t})},e}();t.default=u},function(e,t,n){"use strict";var i=this&&this.__assign||function(){return(i=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}).apply(this,arguments)},r=this&&this.__createBinding||(Object.create?function(e,t,n,i){void 0===i&&(i=n),Object.defineProperty(e,i,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,i){void 0===i&&(i=n),e[i]=t[n]}),l=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return l(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.defaultSideBySideRendererConfig=void 0;var a=o(n(2)),s=o(n(1)),f=n(0);t.defaultSideBySideRendererConfig=i(i({},s.defaultRenderConfig),{renderNothingWhenEmpty:!1,matchingMaxComparisons:2500,maxLineSizeInBlockForComparison:200});var u=function(){function e(e,n){void 0===n&&(n={}),this.hoganUtils=e,this.config=i(i({},t.defaultSideBySideRendererConfig),n)}return e.prototype.render=function(e){var t=this,n=e.map((function(e){var n;return n=e.blocks.length?t.generateFileHtml(e):t.generateEmptyDiff(),t.makeFileDiffHtml(e,n)})).join("\n");return this.hoganUtils.render("generic","wrapper",{content:n})},e.prototype.makeFileDiffHtml=function(e,t){if(this.config.renderNothingWhenEmpty&&Array.isArray(e.blocks)&&0===e.blocks.length)return"";var n=this.hoganUtils.template("side-by-side","file-diff"),i=this.hoganUtils.template("generic","file-path"),r=this.hoganUtils.template("icon","file"),l=this.hoganUtils.template("tag",s.getFileIcon(e));return n.render({file:e,fileHtmlId:s.getHtmlId(e),diffs:t,filePath:i.render({fileDiffName:s.filenameDiff(e)},{fileIcon:r,fileTag:l})})},e.prototype.generateEmptyDiff=function(){return{right:"",left:this.hoganUtils.render("generic","empty-diff",{contentClass:"d2h-code-side-line",CSSLineClass:s.CSSLineClass})}},e.prototype.generateFileHtml=function(e){var t=this,n=a.newMatcherFn(a.newDistanceFn((function(t){return s.deconstructLine(t.content,e.isCombined).content})));return e.blocks.map((function(i){var r={left:t.makeHeaderHtml(i.header),right:t.makeHeaderHtml("")};return t.applyLineGroupping(i).forEach((function(i){var l=i[0],o=i[1],a=i[2];if(o.length&&a.length&&!l.length)t.applyRematchMatching(o,a,n).map((function(n){var i=n[0],l=n[1],o=t.processChangedLines(e.isCombined,i,l),a=o.left,s=o.right;r.left+=a,r.right+=s}));else if(l.length)l.forEach((function(n){var i=s.deconstructLine(n.content,e.isCombined),l=i.prefix,o=i.content,a=t.generateLineHtml({type:s.CSSLineClass.CONTEXT,prefix:l,content:o,number:n.oldNumber},{type:s.CSSLineClass.CONTEXT,prefix:l,content:o,number:n.newNumber}),f=a.left,u=a.right;r.left+=f,r.right+=u}));else if(o.length||a.length){var f=t.processChangedLines(e.isCombined,o,a),u=f.left,d=f.right;r.left+=u,r.right+=d}else console.error("Unknown state reached while processing groups of lines",l,o,a)})),r})).reduce((function(e,t){return{left:e.left+t.left,right:e.right+t.right}}),{left:"",right:""})},e.prototype.applyLineGroupping=function(e){for(var t=[],n=[],i=[],r=0;r<e.lines.length;r++){var l=e.lines[r];(l.type!==f.LineType.INSERT&&i.length||l.type===f.LineType.CONTEXT&&n.length>0)&&(t.push([[],n,i]),n=[],i=[]),l.type===f.LineType.CONTEXT?t.push([[l],[],[]]):l.type===f.LineType.INSERT&&0===n.length?t.push([[],[],[l]]):l.type===f.LineType.INSERT&&n.length>0?i.push(l):l.type===f.LineType.DELETE&&n.push(l)}return(n.length||i.length)&&(t.push([[],n,i]),n=[],i=[]),t},e.prototype.applyRematchMatching=function(e,t,n){var i=e.length*t.length,r=Math.max.apply(null,[0].concat(e.concat(t).map((function(e){return e.content.length}))));return i<this.config.matchingMaxComparisons&&r<this.config.maxLineSizeInBlockForComparison&&("lines"===this.config.matching||"words"===this.config.matching)?n(e,t):[[e,t]]},e.prototype.makeHeaderHtml=function(e){return this.hoganUtils.render("generic","block-header",{CSSLineClass:s.CSSLineClass,blockHeader:s.escapeForHtml(e),lineClass:"d2h-code-side-linenumber",contentClass:"d2h-code-side-line"})},e.prototype.processChangedLines=function(e,t,n){for(var r={right:"",left:""},l=Math.max(t.length,n.length),o=0;o<l;o++){var a=t[o],f=n[o],u=void 0!==a&&void 0!==f?s.diffHighlight(a.content,f.content,e,this.config):void 0,d=void 0!==a&&void 0!==a.oldNumber?i(i({},void 0!==u?{prefix:u.oldLine.prefix,content:u.oldLine.content,type:s.CSSLineClass.DELETE_CHANGES}:i(i({},s.deconstructLine(a.content,e)),{type:s.toCSSClass(a.type)})),{number:a.oldNumber}):void 0,c=void 0!==f&&void 0!==f.newNumber?i(i({},void 0!==u?{prefix:u.newLine.prefix,content:u.newLine.content,type:s.CSSLineClass.INSERT_CHANGES}:i(i({},s.deconstructLine(f.content,e)),{type:s.toCSSClass(f.type)})),{number:f.newNumber}):void 0,h=this.generateLineHtml(d,c),p=h.left,g=h.right;r.left+=p,r.right+=g}return r},e.prototype.generateLineHtml=function(e,t){return{left:this.generateSingleHtml(e),right:this.generateSingleHtml(t)}},e.prototype.generateSingleHtml=function(e){return this.hoganUtils.render("generic","line",{type:(null==e?void 0:e.type)||s.CSSLineClass.CONTEXT+" d2h-emptyplaceholder",lineClass:void 0!==e?"d2h-code-side-linenumber":"d2h-code-side-linenumber