UNPKG

diff2html

Version:

Fast Diff to colorized HTML

1 lines 90.2 kB
!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 r in n)("object"==typeof exports?exports:e)[r]=n[r]}}(this,(()=>{return e={25(e,t,n){"use strict";var r,i=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0}),t.wordsWithSpaceDiff=t.wordDiff=void 0,t.diffWords=function(e,n,r){return null==(null==r?void 0:r.ignoreWhitespace)||r.ignoreWhitespace?t.wordDiff.diff(e,n,r):d(e,n,r)},t.diffWordsWithSpace=d;var s=n(188),o=n(665),l="a-zA-Z0-9_\\u{AD}\\u{C0}-\\u{D6}\\u{D8}-\\u{F6}\\u{F8}-\\u{2C6}\\u{2C8}-\\u{2D7}\\u{2DE}-\\u{2FF}\\u{1E00}-\\u{1EFF}",a=new RegExp("[".concat(l,"]+|\\s+|[^").concat(l,"]"),"ug"),c=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i(t,e),t.prototype.equals=function(e,t,n){return n.ignoreCase&&(e=e.toLowerCase(),t=t.toLowerCase()),e.trim()===t.trim()},t.prototype.tokenize=function(e,t){var n;if(void 0===t&&(t={}),t.intlSegmenter){var r=t.intlSegmenter;if("word"!=r.resolvedOptions().granularity)throw new Error('The segmenter passed must have a granularity of "word"');n=[];for(var i=0,s=Array.from(r.segment(e));i<s.length;i++){var o=s[i].segment;n.length&&/\s/.test(n[n.length-1])&&/\s/.test(o)?n[n.length-1]+=o:n.push(o)}}else n=e.match(a)||[];var l=[],c=null;return n.forEach((function(e){/\s/.test(e)?null==c?l.push(e):l.push(l.pop()+e):null!=c&&/\s/.test(c)?l[l.length-1]==c?l.push(l.pop()+e):l.push(c+e):l.push(e),c=e})),l},t.prototype.join=function(e){return e.map((function(e,t){return 0==t?e:e.replace(/^\s+/,"")})).join("")},t.prototype.postProcess=function(e,t){if(!e||t.oneChangePerToken)return e;var n=null,r=null,i=null;return e.forEach((function(e){e.added?r=e:e.removed?i=e:((r||i)&&f(n,i,r,e),n=e,r=null,i=null)})),(r||i)&&f(n,i,r,null),e},t}(s.default);function f(e,t,n,r){if(t&&n){var i=(0,o.leadingWs)(t.value),s=(0,o.trailingWs)(t.value),l=(0,o.leadingWs)(n.value),a=(0,o.trailingWs)(n.value);if(e){var c=(0,o.longestCommonPrefix)(i,l);e.value=(0,o.replaceSuffix)(e.value,l,c),t.value=(0,o.removePrefix)(t.value,c),n.value=(0,o.removePrefix)(n.value,c)}if(r){var f=(0,o.longestCommonSuffix)(s,a);r.value=(0,o.replacePrefix)(r.value,a,f),t.value=(0,o.removeSuffix)(t.value,f),n.value=(0,o.removeSuffix)(n.value,f)}}else if(n){if(e){var u=(0,o.leadingWs)(n.value);n.value=n.value.substring(u.length)}r&&(u=(0,o.leadingWs)(r.value),r.value=r.value.substring(u.length))}else if(e&&r){var d=(0,o.leadingWs)(r.value),p=(0,o.leadingWs)(t.value),h=(0,o.trailingWs)(t.value),g=(0,o.longestCommonPrefix)(d,p);t.value=(0,o.removePrefix)(t.value,g);var b=(0,o.longestCommonSuffix)((0,o.removePrefix)(d,g),h);t.value=(0,o.removeSuffix)(t.value,b),r.value=(0,o.replacePrefix)(r.value,d,b),e.value=(0,o.replaceSuffix)(e.value,d,d.slice(0,d.length-b.length))}else if(r){var m=(0,o.leadingWs)(r.value),v=(0,o.trailingWs)(t.value),y=(0,o.maximumOverlap)(v,m);t.value=(0,o.removeSuffix)(t.value,y)}else if(e){var w=(0,o.trailingWs)(e.value),j=(0,o.leadingWs)(t.value);y=(0,o.maximumOverlap)(w,j),t.value=(0,o.removePrefix)(t.value,y)}}t.wordDiff=new c;var u=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i(t,e),t.prototype.tokenize=function(e){var t=new RegExp("(\\r?\\n)|[".concat(l,"]+|[^\\S\\n\\r]+|[^").concat(l,"]"),"ug");return e.match(t)||[]},t}(s.default);function d(e,n,r){return t.wordsWithSpaceDiff.diff(e,n,r)}t.wordsWithSpaceDiff=new u},42(e,t,n){"use strict";var r,i=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0}),t.cssDiff=void 0,t.diffCss=function(e,n,r){return t.cssDiff.diff(e,n,r)};var s=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i(t,e),t.prototype.tokenize=function(e){return e.split(/([{}:;,]|\s+)/)},t}(n(188).default);t.cssDiff=new s},92(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Diff2HtmlUI=t.defaultDiff2HtmlUIConfig=void 0;const r=n(206),i=n(166);t.defaultDiff2HtmlUIConfig=Object.assign(Object.assign({},i.defaultDiff2HtmlConfig),{synchronisedScroll:!0,highlight:!0,fileListToggle:!0,fileListStartVisible:!1,highlightLanguages:new Map,smartSelection:!0,fileContentToggle:!0,stickyFileHeaders:!0}),t.Diff2HtmlUI=class{constructor(e,n,r={},s){this.hljs=null,this.currentSelectionColumnId=-1,this.config=Object.assign(Object.assign({},t.defaultDiff2HtmlUIConfig),r),this.diffHtml=void 0!==n?(0,i.html)(n,this.config):e.innerHTML,this.targetElement=e,void 0!==s&&(this.hljs=s)}draw(){this.targetElement.innerHTML=this.diffHtml,this.config.synchronisedScroll&&this.synchronisedScroll(),this.config.highlight&&this.highlightCode(),this.config.fileListToggle&&this.fileListToggle(this.config.fileListStartVisible),this.config.fileContentToggle&&this.fileContentToggle(),this.config.stickyFileHeaders&&this.stickyFileHeaders()}synchronisedScroll(){this.targetElement.querySelectorAll(".d2h-file-wrapper").forEach((e=>{const[t,n]=Array().slice.call(e.querySelectorAll(".d2h-file-side-diff"));if(void 0===t||void 0===n)return;const r=e=>{null!==e&&null!==e.target&&(e.target===t?(n.scrollTop=t.scrollTop,n.scrollLeft=t.scrollLeft):(t.scrollTop=n.scrollTop,t.scrollLeft=n.scrollLeft))};t.addEventListener("scroll",r),n.addEventListener("scroll",r)}))}fileListToggle(e){const t=this.targetElement.querySelector(".d2h-show"),n=this.targetElement.querySelector(".d2h-hide"),r=this.targetElement.querySelector(".d2h-file-list");if(null===t||null===n||null===r)return;const i=()=>{t.style.display="none",n.style.display="inline",r.style.display="block"},s=()=>{t.style.display="inline",n.style.display="none",r.style.display="none"};t.addEventListener("click",(()=>i())),n.addEventListener("click",(()=>s()));const o=this.getHashTag();"files-summary-show"===o?i():"files-summary-hide"===o?s():e?i():s()}fileContentToggle(){this.targetElement.querySelectorAll(".d2h-file-collapse").forEach((e=>{e.style.display="flex";const t=t=>{var n;const r=null===(n=e.closest(".d2h-file-wrapper"))||void 0===n?void 0:n.querySelector(t);null!=r&&(e.classList.toggle("d2h-selected"),r.classList.toggle("d2h-d-none"))};e.addEventListener("click",(n=>(n=>{e!==n.target&&(t(".d2h-file-diff"),t(".d2h-files-diff"))})(n)))}))}highlightCode(){const e=this.hljs;if(null===e)throw new Error("Missing a `highlight.js` implementation. Please provide one when instantiating Diff2HtmlUI.");this.targetElement.querySelectorAll(".d2h-file-wrapper").forEach((t=>{const n=t.getAttribute("data-lang");this.config.highlightLanguages instanceof Map||(this.config.highlightLanguages=new Map(Object.entries(this.config.highlightLanguages)));let i=n&&this.config.highlightLanguages.has(n)?this.config.highlightLanguages.get(n):n?(0,r.getLanguage)(n):"plaintext";void 0===e.getLanguage(i)&&(i="plaintext"),t.querySelectorAll(".d2h-code-line-ctn").forEach((t=>{const n=t.textContent,s=t.parentNode;if(null===n||null===s||!this.isElement(s))return;const o=(0,r.closeTags)(e.highlight(n,{language:i,ignoreIllegals:!0})),l=(0,r.nodeStream)(t);if(l.length){const e=document.createElementNS("http://www.w3.org/1999/xhtml","div");e.innerHTML=o.value,o.value=(0,r.mergeStreams)(l,(0,r.nodeStream)(e),n)}t.classList.add("hljs"),o.language&&t.classList.add(o.language),t.innerHTML=o.value}))}))}stickyFileHeaders(){this.targetElement.querySelectorAll(".d2h-file-header").forEach((e=>{e.classList.add("d2h-sticky-header")}))}smartSelection(){console.warn("Smart selection is now enabled by default with CSS. No need to call this method anymore.")}getHashTag(){const e=document.URL,t=e.indexOf("#");let n=null;return-1!==t&&(n=e.substr(t+1)),n}isElement(e){return null!==e&&void 0!==(null==e?void 0:e.classList)}}},111(e,t,n){var r=n(453);r.Template=n(766).Template,r.template=r.Template,e.exports=r},151(e,t,n){"use strict";var r,i=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),s=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||(r=function(e){return r=Object.getOwnPropertyNames||function(e){var t=[];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[t.length]=n);return t},r(e)},function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n=r(e),o=0;o<n.length;o++)"default"!==n[o]&&i(t,e,n[o]);return s(t,e),t});Object.defineProperty(t,"__esModule",{value:!0}),t.defaultSideBySideRendererConfig=void 0;const l=o(n(598)),a=o(n(302)),c=n(613),f=n(185);t.defaultSideBySideRendererConfig=Object.assign(Object.assign({},a.defaultRenderConfig),{renderNothingWhenEmpty:!1,matchingMaxComparisons:2500,maxLineSizeInBlockForComparison:200});const u="generic";t.default=class{constructor(e,n={}){this.hoganUtils=e,this.config=Object.assign(Object.assign({},t.defaultSideBySideRendererConfig),n)}render(e){const t=e.map((e=>{let t;return t=e.blocks.length?this.generateFileHtml(e):this.generateEmptyDiff(),this.makeFileDiffHtml(e,t)})).join("\n");return this.hoganUtils.render(u,"wrapper",{colorScheme:a.colorSchemeToCss(this.config.colorScheme),content:t})}makeFileDiffHtml(e,t){if(this.config.renderNothingWhenEmpty&&Array.isArray(e.blocks)&&0===e.blocks.length)return"";const n=this.hoganUtils.template("side-by-side","file-diff"),r=this.hoganUtils.template(u,"file-path"),i=this.hoganUtils.template("icon","file"),s=this.hoganUtils.template("tag",a.getFileIcon(e));return n.render({file:e,fileHtmlId:a.getHtmlId(e),diffs:t,filePath:r.render({fileDiffName:a.filenameDiff(e)},{fileIcon:i,fileTag:s})})}generateEmptyDiff(){return{right:"",left:this.hoganUtils.render(u,"empty-diff",{contentClass:"d2h-code-side-line",CSSLineClass:a.CSSLineClass})}}generateFileHtml(e){const t=l.newMatcherFn(l.newDistanceFn((t=>a.deconstructLine(t.content,e.isCombined).content)));return e.blocks.map((n=>{const r={left:this.makeHeaderHtml(n.header,e),right:this.makeHeaderHtml("")};return this.applyLineGroupping(n).forEach((([n,i,s])=>{if(i.length&&s.length&&!n.length)this.applyRematchMatching(i,s,t).map((([t,n])=>{const{left:i,right:s}=this.processChangedLines(e.isCombined,t,n);r.left+=i,r.right+=s}));else if(n.length)n.forEach((t=>{const{prefix:n,content:i}=a.deconstructLine(t.content,e.isCombined),{left:s,right:o}=this.generateLineHtml({type:a.CSSLineClass.CONTEXT,prefix:n,content:i,number:t.oldNumber},{type:a.CSSLineClass.CONTEXT,prefix:n,content:i,number:t.newNumber});r.left+=s,r.right+=o}));else if(i.length||s.length){const{left:t,right:n}=this.processChangedLines(e.isCombined,i,s);r.left+=t,r.right+=n}else console.error("Unknown state reached while processing groups of lines",n,i,s)})),r})).reduce(((e,t)=>({left:e.left+t.left,right:e.right+t.right})),{left:"",right:""})}applyLineGroupping(e){const t=[];let n=[],r=[];for(let i=0;i<e.lines.length;i++){const s=e.lines[i];(s.type!==c.LineType.INSERT&&r.length||s.type===c.LineType.CONTEXT&&n.length>0)&&(t.push([[],n,r]),n=[],r=[]),s.type===c.LineType.CONTEXT?t.push([[s],[],[]]):s.type===c.LineType.INSERT&&0===n.length?t.push([[],[],[s]]):s.type===c.LineType.INSERT&&n.length>0?r.push(s):s.type===c.LineType.DELETE&&n.push(s)}return(n.length||r.length)&&(t.push([[],n,r]),n=[],r=[]),t}applyRematchMatching(e,t,n){const r=e.length*t.length,i=(0,f.max)(e.concat(t).map((e=>e.content.length)));return r<this.config.matchingMaxComparisons&&i<this.config.maxLineSizeInBlockForComparison&&("lines"===this.config.matching||"words"===this.config.matching)?n(e,t):[[e,t]]}makeHeaderHtml(e,t){return this.hoganUtils.render(u,"block-header",{CSSLineClass:a.CSSLineClass,blockHeader:(null==t?void 0:t.isTooBig)?e:a.escapeForHtml(e),lineClass:"d2h-code-side-linenumber",contentClass:"d2h-code-side-line"})}processChangedLines(e,t,n){const r={right:"",left:""},i=Math.max(t.length,n.length);for(let s=0;s<i;s++){const i=t[s],o=n[s],l=void 0!==i&&void 0!==o?a.diffHighlight(i.content,o.content,e,this.config):void 0,c=void 0!==i&&void 0!==i.oldNumber?Object.assign(Object.assign({},void 0!==l?{prefix:l.oldLine.prefix,content:l.oldLine.content,type:a.CSSLineClass.DELETE_CHANGES}:Object.assign(Object.assign({},a.deconstructLine(i.content,e)),{type:a.toCSSClass(i.type)})),{number:i.oldNumber}):void 0,f=void 0!==o&&void 0!==o.newNumber?Object.assign(Object.assign({},void 0!==l?{prefix:l.newLine.prefix,content:l.newLine.content,type:a.CSSLineClass.INSERT_CHANGES}:Object.assign(Object.assign({},a.deconstructLine(o.content,e)),{type:a.toCSSClass(o.type)})),{number:o.newNumber}):void 0,{left:u,right:d}=this.generateLineHtml(c,f);r.left+=u,r.right+=d}return r}generateLineHtml(e,t){return{left:this.generateSingleHtml(e),right:this.generateSingleHtml(t)}}generateSingleHtml(e){const t="d2h-code-side-linenumber",n="d2h-code-side-line";return this.hoganUtils.render(u,"line",{type:(null==e?void 0:e.type)||`${a.CSSLineClass.CONTEXT} d2h-emptyplaceholder`,lineClass:void 0!==e?t:`${t} d2h-code-side-emptyplaceholder`,contentClass:void 0!==e?n:`${n} d2h-code-side-emptyplaceholder`,prefix:" "===(null==e?void 0:e.prefix)?"&nbsp;":null==e?void 0:e.prefix,content:null==e?void 0:e.content,lineNumber:null==e?void 0:e.number})}}},166(e,t,n){"use strict";var r,i=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),s=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||(r=function(e){return r=Object.getOwnPropertyNames||function(e){var t=[];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[t.length]=n);return t},r(e)},function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n=r(e),o=0;o<n.length;o++)"default"!==n[o]&&i(t,e,n[o]);return s(t,e),t}),l=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.defaultDiff2HtmlConfig=void 0,t.parse=function(e,n={}){return a.parse(e,Object.assign(Object.assign({},t.defaultDiff2HtmlConfig),n))},t.html=function(e,n={}){const r=Object.assign(Object.assign({},t.defaultDiff2HtmlConfig),n),i="string"==typeof e?a.parse(e,r):e,s=new p.default(r),{colorScheme:o}=r,l={colorScheme:o};return(r.drawFileList?new c.FileListRenderer(s,l).render(i):"")+("side-by-side"===r.outputFormat?new u.default(s,r).render(i):new f.default(s,r).render(i))};const a=o(n(957)),c=n(501),f=o(n(895)),u=o(n(151)),d=n(613),p=l(n(178));t.defaultDiff2HtmlConfig=Object.assign(Object.assign(Object.assign({},f.defaultLineByLineRendererConfig),u.defaultSideBySideRendererConfig),{outputFormat:d.OutputFormatType.LINE_BY_LINE,drawFileList:!0})},178(e,t,n){"use strict";var r,i=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),s=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||(r=function(e){return r=Object.getOwnPropertyNames||function(e){var t=[];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[t.length]=n);return t},r(e)},function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n=r(e),o=0;o<n.length;o++)"default"!==n[o]&&i(t,e,n[o]);return s(t,e),t});Object.defineProperty(t,"__esModule",{value:!0});const l=o(n(111)),a=n(488);t.default=class{constructor({compiledTemplates:e={},rawTemplates:t={}}){const n=Object.entries(t).reduce(((e,[t,n])=>{const r=l.compile(n,{asString:!1});return Object.assign(Object.assign({},e),{[t]:r})}),{});this.preCompiledTemplates=Object.assign(Object.assign(Object.assign({},a.defaultTemplates),e),n)}static compile(e){return l.compile(e,{asString:!1})}render(e,t,n,r,i){const s=this.templateKey(e,t);try{return this.preCompiledTemplates[s].render(n,r,i)}catch(e){throw new Error(`Could not find template to render '${s}'`)}}template(e,t){return this.preCompiledTemplates[this.templateKey(e,t)]}templateKey(e,t){return`${e}-${t}`}}},185(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.escapeForRegExp=function(e){return e.replace(n,"\\$&")},t.unifyPath=function(e){return e?e.replace(/\\/g,"/"):e},t.hashCode=function(e){let t,n,r,i=0;for(t=0,r=e.length;t<r;t++)n=e.charCodeAt(t),i=(i<<5)-i+n,i|=0;return i},t.max=function(e){const t=e.length;let n=-1/0;for(let r=0;r<t;r++)n=Math.max(n,e[r]);return n};const n=RegExp("["+["-","[","]","/","{","}","(",")","*","+","?",".","\\","^","$","|"].join("\\")+"]","g")},188(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(){}return e.prototype.diff=function(e,t,n){var r;void 0===n&&(n={}),"function"==typeof n?(r=n,n={}):"callback"in n&&(r=n.callback);var i=this.castInput(e,n),s=this.castInput(t,n),o=this.removeEmpty(this.tokenize(i,n)),l=this.removeEmpty(this.tokenize(s,n));return this.diffWithOptionsObj(o,l,n,r)},e.prototype.diffWithOptionsObj=function(e,t,n,r){var i,s=this,o=function(e){return e=s.postProcess(e,n),r?void setTimeout((function(){r(e)}),0):e},l=t.length,a=e.length,c=1,f=l+a;null!=n.maxEditLength&&(f=Math.min(f,n.maxEditLength));var u=null!==(i=n.timeout)&&void 0!==i?i:1/0,d=Date.now()+u,p=[{oldPos:-1,lastComponent:void 0}],h=this.extractCommon(p[0],t,e,0,n);if(p[0].oldPos+1>=a&&h+1>=l)return o(this.buildValues(p[0].lastComponent,t,e));var g=-1/0,b=1/0,m=function(){for(var r=Math.max(g,-c);r<=Math.min(b,c);r+=2){var i=void 0,f=p[r-1],u=p[r+1];f&&(p[r-1]=void 0);var d=!1;if(u){var m=u.oldPos-r;d=u&&0<=m&&m<l}var v=f&&f.oldPos+1<a;if(d||v){if(i=!v||d&&f.oldPos<u.oldPos?s.addToPath(u,!0,!1,0,n):s.addToPath(f,!1,!0,1,n),h=s.extractCommon(i,t,e,r,n),i.oldPos+1>=a&&h+1>=l)return o(s.buildValues(i.lastComponent,t,e))||!0;p[r]=i,i.oldPos+1>=a&&(b=Math.min(b,r-1)),h+1>=l&&(g=Math.max(g,r+1))}else p[r]=void 0}c++};if(r)!function e(){setTimeout((function(){if(c>f||Date.now()>d)return r(void 0);m()||e()}),0)}();else for(;c<=f&&Date.now()<=d;){var v=m();if(v)return v}},e.prototype.addToPath=function(e,t,n,r,i){var s=e.lastComponent;return s&&!i.oneChangePerToken&&s.added===t&&s.removed===n?{oldPos:e.oldPos+r,lastComponent:{count:s.count+1,added:t,removed:n,previousComponent:s.previousComponent}}:{oldPos:e.oldPos+r,lastComponent:{count:1,added:t,removed:n,previousComponent:s}}},e.prototype.extractCommon=function(e,t,n,r,i){for(var s=t.length,o=n.length,l=e.oldPos,a=l-r,c=0;a+1<s&&l+1<o&&this.equals(n[l+1],t[a+1],i);)a++,l++,c++,i.oneChangePerToken&&(e.lastComponent={count:1,previousComponent:e.lastComponent,added:!1,removed:!1});return c&&!i.oneChangePerToken&&(e.lastComponent={count:c,previousComponent:e.lastComponent,added:!1,removed:!1}),e.oldPos=l,a},e.prototype.equals=function(e,t,n){return n.comparator?n.comparator(e,t):e===t||!!n.ignoreCase&&e.toLowerCase()===t.toLowerCase()},e.prototype.removeEmpty=function(e){for(var t=[],n=0;n<e.length;n++)e[n]&&t.push(e[n]);return t},e.prototype.castInput=function(e,t){return e},e.prototype.tokenize=function(e,t){return Array.from(e)},e.prototype.join=function(e){return e.join("")},e.prototype.postProcess=function(e,t){return e},Object.defineProperty(e.prototype,"useLongestToken",{get:function(){return!1},enumerable:!1,configurable:!0}),e.prototype.buildValues=function(e,t,n){for(var r,i=[];e;)i.push(e),r=e.previousComponent,delete e.previousComponent,e=r;i.reverse();for(var s=i.length,o=0,l=0,a=0;o<s;o++){var c=i[o];if(c.removed)c.value=this.join(n.slice(a,a+c.count)),a+=c.count;else{if(!c.added&&this.useLongestToken){var f=t.slice(l,l+c.count);f=f.map((function(e,t){var r=n[a+t];return r.length>e.length?r:e})),c.value=this.join(f)}else c.value=this.join(t.slice(l,l+c.count));l+=c.count,c.added||(a+=c.count)}}return i},e}();t.default=n},206(e,t){"use strict";function n(e){return e.replace(/&/gm,"&amp;").replace(/</gm,"&lt;").replace(/>/gm,"&gt;")}function r(e){return e.nodeName.toLowerCase()}Object.defineProperty(t,"__esModule",{value:!0}),t.nodeStream=function(e){const t=[],n=(e,i)=>{for(let s=e.firstChild;s;s=s.nextSibling)3===s.nodeType&&null!==s.nodeValue?i+=s.nodeValue.length:1===s.nodeType&&(t.push({event:"start",offset:i,node:s}),i=n(s,i),r(s).match(/br|hr|img|input/)||t.push({event:"stop",offset:i,node:s}));return i};return n(e,0),t},t.mergeStreams=function(e,t,i){let s=0,o="";const l=[];function a(){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 c(e){if(null===(t=e)||void 0===(null==t?void 0:t.attributes))throw new Error("Node is not an Element");var t;o+=`<${r(e)} ${Array().map.call(e.attributes,(e=>`${e.nodeName}="${n(e.value).replace(/"/g,"&quot;")}"`)).join(" ")}>`}function f(e){o+="</"+r(e)+">"}function u(e){("start"===e.event?c:f)(e.node)}for(;e.length||t.length;){let t=a();if(o+=n(i.substring(s,t[0].offset)),s=t[0].offset,t===e){l.reverse().forEach(f);do{u(t.splice(0,1)[0]),t=a()}while(t===e&&t.length&&t[0].offset===s);l.reverse().forEach(c)}else"start"===t[0].event?l.push(t[0].node):l.pop(),u(t.splice(0,1)[0])}return o+n(i.substr(s))},t.closeTags=function(e){const t=new Array;return e.value=e.value.split("\n").map((e=>{const n=t.map((e=>`<span class="${e}">`)).join(""),r=e.matchAll(/(<span class="(.*?)">|<\/span>)/g);return Array.from(r).forEach((e=>{"</span>"===e[0]?t.shift():t.unshift(e[2])})),n+e+"</span>".repeat(t.length)})).join("\n"),e},t.getLanguage=function(e){var t;return null!==(t=i[e])&&void 0!==t?t:"plaintext"};const i={"1c":"1c",abnf:"abnf",accesslog:"accesslog",as:"actionscript",adb:"ada",ada:"ada",ads:"ada",angelscript:"angelscript",apache:"apache",applescript:"applescript",scpt:"applescript",arcade:"arcade",cpp:"cpp",hpp:"cpp",arduino:"arduino",ino:"arduino",armasm:"armasm",arm:"armasm",xml:"xml",html:"xml",xhtml:"xml",rss:"xml",atom:"xml",xjb:"xml",xsd:"xml",xsl:"xml",plist:"xml",svg:"xml",asciidoc:"asciidoc",adoc:"asciidoc",asc:"asciidoc",aspectj:"aspectj",ahk:"autohotkey",ahkl:"autohotkey",au3:"autoit",avrasm:"avrasm",awk:"awk",axapta:"axapta","x++":"axapta",bash:"bash",sh:"bash",zsh:"bash",b:"basic",bnf:"bnf",bf:"brainfuck",c:"c",h:"c",cats:"c",idc:"c",cal:"cal",capnproto:"capnproto",capnp:"capnproto",ceylon:"ceylon",clean:"clean",clj:"clojure",boot:"clojure",cl2:"clojure",cljc:"clojure",cljs:"clojure","cljs.hl":"clojure",cljscm:"clojure",cljx:"clojure",hic:"clojure","clojure-repl":"clojure-repl",cmake:"cmake","cmake.in":"cmake",coffee:"coffeescript",_coffee:"coffeescript",cake:"coffeescript",cjsx:"coffeescript",iced:"coffeescript",cson:"coffeescript",coq:"coq",cos:"cos",cls:"cos",crmsh:"crmsh",crm:"crmsh",pcmk:"crmsh",cr:"crystal",cs:"csharp",csx:"csharp",csp:"csp",css:"css",d:"d",di:"d",md:"markdown",markdown:"markdown",mdown:"markdown",mdwn:"markdown",mkd:"markdown",mkdn:"markdown",mkdown:"markdown",ronn:"markdown",workbook:"markdown",dart:"dart",dpr:"delphi",dfm:"delphi",pas:"delphi",pascal:"delphi",diff:"diff",patch:"diff",django:"django",jinja:"django",dns:"dns",zone:"dns",bind:"dns",dockerfile:"dockerfile",docker:"dockerfile",dos:"dos",bat:"dos",cmd:"dos",dsconfig:"dsconfig",dts:"dts",dust:"dust",dst:"dust",ebnf:"ebnf",ex:"elixir",exs:"elixir",elm:"elm",rb:"ruby",builder:"ruby",eye:"ruby",gemspec:"ruby",god:"ruby",jbuilder:"ruby",mspec:"ruby",pluginspec:"ruby",podspec:"ruby",rabl:"ruby",rake:"ruby",rbuild:"ruby",rbw:"ruby",rbx:"ruby",ru:"ruby",ruby:"ruby",spec:"ruby",thor:"ruby",watchr:"ruby",erb:"erb","erlang-repl":"erlang-repl",erl:"erlang","app.src":"erlang",escript:"erlang",hrl:"erlang",xrl:"erlang",yrl:"erlang",excel:"excel",xls:"excel",xlsx:"excel",fix:"fix",flix:"flix",f90:"fortran",f:"fortran",f03:"fortran",f08:"fortran",f77:"fortran",f95:"fortran",for:"fortran",fpp:"fortran",fs:"fsharp",fsx:"fsharp",gams:"gams",gms:"gams",gauss:"gauss",gss:"gauss",gcode:"gcode",nc:"gcode",gherkin:"gherkin",glsl:"glsl",fp:"glsl",frag:"glsl",frg:"glsl",fsh:"glsl",fshader:"glsl",geo:"glsl",geom:"glsl",glslv:"glsl",gshader:"glsl",shader:"glsl",tesc:"glsl",tese:"glsl",vert:"glsl",vrx:"glsl",vsh:"glsl",vshader:"glsl",gml:"gml",go:"go",bal:"go",golo:"golo",gololang:"golo",gradle:"gradle",groovy:"groovy",grt:"groovy",gtpl:"groovy",gvy:"groovy",haml:"haml","haml.deface":"haml",handlebars:"handlebars",hbs:"handlebars","html.hbs":"handlebars","html.handlebars":"handlebars",hs:"haskell",hsc:"haskell",idr:"haskell",purs:"haskell",hx:"haxe",hxsl:"haxe",hsp:"hsp",htmlbars:"htmlbars",http:"http",https:"http",hy:"hy",inform7:"inform7",i7:"inform7",ini:"ini",toml:"ini",cfg:"ini",prefs:"ini",irpf90:"irpf90",isbl:"isbl",java:"java",jsp:"java",js:"javascript",jsx:"javascript",_js:"javascript",bones:"javascript",es:"javascript",es6:"javascript",gs:"javascript",jake:"javascript",jsb:"javascript",jscad:"javascript",jsfl:"javascript",jsm:"javascript",jss:"javascript",mjs:"javascript",njs:"javascript",pac:"javascript",sjs:"javascript",ssjs:"javascript",xsjs:"javascript",xsjslib:"javascript",cfc:"javascript","jboss-cli":"jboss-cli",json:"json",avsc:"json",geojson:"json",gltf:"json","JSON-tmLanguage":"json",jsonl:"json",tfstate:"json","tfstate.backup":"json",topojson:"json",webapp:"json",webmanifest:"json",jl:"julia","julia-repl":"julia-repl",kt:"kotlin",ktm:"kotlin",kts:"kotlin",lasso:"lasso",lassoscript:"lasso",tex:"latex",ldif:"ldif",leaf:"leaf",less:"less",lisp:"lisp",factor:"lisp",livecodeserver:"livecodeserver",ls:"livescript",_ls:"livescript",llvm:"llvm",lsl:"lsl",lua:"lua",nse:"lua",p8:"lua",pd_lua:"lua",rbxs:"lua",wlua:"lua",mak:"makefile",make:"makefile",mk:"makefile",mkfile:"makefile",mathematica:"mathematica",mma:"mathematica",wl:"mathematica",matlab:"matlab",maxima:"maxima",mel:"mel",mercury:"mercury",mipsasm:"mipsasm",miz:"mizar",voc:"mizar",al:"perl",cgi:"perl",fcgi:"perl",perl:"perl",ph:"perl",plx:"perl",pl:"perl",pm:"perl",psgi:"perl",t:"perl",mojolicious:"mojolicious",monkey:"monkey",monkey2:"monkey",moonscript:"moonscript",moon:"moonscript",n1ql:"n1ql",nginxconf:"nginx",nim:"nim",nimrod:"nim",nix:"nix",nsi:"nsis",nsh:"nsis",m:"objectivec",objc:"objectivec",mm:"objectivec","obj-c":"objectivec","obj-c++":"objectivec","objective-c++":"objectivec",fun:"ocaml",sig:"ocaml",ml:"ocaml",mli:"ocaml",eliom:"ocaml",eliomi:"ocaml",ml4:"ocaml",mll:"ocaml",mly:"ocaml",openscad:"openscad",oxygene:"oxygene",parser3:"parser3",pf:"pf","pf.conf":"pf",pgsql:"pgsql",postgres:"pgsql",postgresql:"pgsql",php:"php",aw:"php",ctp:"php",inc:"php",php3:"php",php4:"php",php5:"php",phps:"php",phpt:"php","php-template":"php-template",plaintext:"plaintext",txt:"plaintext",text:"plaintext",pony:"pony",ps:"powershell",ps1:"powershell",psd1:"powershell",psm1:"powershell",pde:"processing",profile:"profile",pro:"prolog",prolog:"prolog",yap:"prolog",properties:"properties",proto:"protobuf",puppet:"puppet",pp:"puppet",purebasic:"purebasic",py:"python",bzl:"python",gyp:"python",gypi:"python",lmi:"python",py3:"python",pyde:"python",pyi:"python",pyp:"python",pyt:"python",pyw:"python",rpy:"python",tac:"python",wsgi:"python",xpy:"python","python-repl":"python-repl",pycon:"python-repl",q:"q",k:"q",kdb:"q",qml:"qml",r:"r",rd:"r",rsx:"r",reasonml:"reasonml",re:"reasonml",rib:"rib",roboconf:"roboconf",graph:"roboconf",instances:"roboconf",routeros:"routeros",rsl:"rsl",ruleslanguage:"ruleslanguage",rs:"rust","rs.in":"rust",sas:"sas",scala:"scala",kojo:"scala",sbt:"scala",sc:"scala",scm:"scheme",sch:"scheme",sld:"scheme",sls:"scheme",sps:"scheme",ss:"scheme",rkt:"scheme",scilab:"scilab",scss:"scss",shell:"shell",smali:"smali",st:"smalltalk",sml:"sml",sqf:"sqf",sql:"sql",cql:"sql",ddl:"sql",mysql:"sql",prc:"sql",tab:"sql",udf:"sql",viw:"sql",stan:"stan",stanfuncs:"stan",stata:"stata",step21:"step21",step:"step21",stp:"step21",styl:"stylus",subunit:"subunit",swift:"swift",taggerscript:"taggerscript",yml:"yaml",mir:"yaml",reek:"yaml",rviz:"yaml","sublime-syntax":"yaml",syntax:"yaml",yaml:"yaml","yaml-tmlanguage":"yaml","yml.mysql":"yaml",tap:"tap",tcl:"tcl",adp:"tcl",tm:"tcl",thrift:"thrift",tp:"tp",twig:"twig",craftcms:"twig",ts:"typescript",tsx:"typescript",vala:"vala",vbnet:"vbnet",vb:"vbnet",vbscript:"vbscript",vbs:"vbscript","vbscript-html":"vbscript-html",v:"verilog",veo:"verilog",vhdl:"vhdl",vhd:"vhdl",vhf:"vhdl",vhi:"vhdl",vho:"vhdl",vhs:"vhdl",vht:"vhdl",vhw:"vhdl",vim:"vim",x86asm:"x86asm",xl:"xl",xquery:"xquery",xpath:"xquery",xq:"xquery",zephir:"zephir",zep:"zephir"}},302(e,t,n){"use strict";var r,i=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),s=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||(r=function(e){return r=Object.getOwnPropertyNames||function(e){var t=[];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[t.length]=n);return t},r(e)},function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n=r(e),o=0;o<n.length;o++)"default"!==n[o]&&i(t,e,n[o]);return s(t,e),t});Object.defineProperty(t,"__esModule",{value:!0}),t.defaultRenderConfig=t.CSSLineClass=void 0,t.toCSSClass=function(e){switch(e){case f.LineType.CONTEXT:return t.CSSLineClass.CONTEXT;case f.LineType.INSERT:return t.CSSLineClass.INSERTS;case f.LineType.DELETE:return t.CSSLineClass.DELETES}},t.colorSchemeToCss=function(e){switch(e){case f.ColorSchemeType.DARK:return"d2h-dark-color-scheme";case f.ColorSchemeType.AUTO:return"d2h-auto-color-scheme";case f.ColorSchemeType.LIGHT:default:return"d2h-light-color-scheme"}},t.escapeForHtml=b,t.deconstructLine=m,t.filenameDiff=v,t.getHtmlId=function(e){return`d2h-${(0,a.hashCode)(v(e)).toString().slice(-6)}`},t.getFileIcon=function(e){let 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,i={}){const{matching:s,maxLineLengthHighlight:o,matchWordsThreshold:a,diffStyle:c}=Object.assign(Object.assign({},t.defaultRenderConfig),i),f=m(e,r,!1),u=m(n,r,!1);if(f.content.length>o||u.content.length>o)return{oldLine:{prefix:f.prefix,content:b(f.content)},newLine:{prefix:u.prefix,content:b(u.content)}};const h="char"===c?l.diffChars(f.content,u.content):l.diffWordsWithSpace(f.content,u.content),v=[];if("word"===c&&"words"===s){const e=h.filter((e=>e.removed)),t=h.filter((e=>e.added));p(t,e).forEach((e=>{1===e[0].length&&1===e[1].length&&d(e[0][0],e[1][0])<a&&(v.push(e[0][0]),v.push(e[1][0]))}))}const y=h.reduce(((e,t)=>{const n=t.added?"ins":t.removed?"del":null,r=v.indexOf(t)>-1?' class="d2h-change"':"",i=b(t.value);return null!==n?`${e}<${n}${r}>${i}</${n}>`:`${e}${i}`}),"");return{oldLine:{prefix:f.prefix,content:(w=y,w.replace(/(<ins[^>]*>((.|\n)*?)<\/ins>)/g,""))},newLine:{prefix:u.prefix,content:g(y)}};var w};const l=o(n(801)),a=n(185),c=o(n(598)),f=n(613);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:f.LineMatchingType.NONE,matchWordsThreshold:.25,maxLineLengthHighlight:1e4,diffStyle:f.DiffStyleType.WORD,colorScheme:f.ColorSchemeType.LIGHT};const u="/",d=c.newDistanceFn((e=>e.value)),p=c.newMatcherFn(d);function h(e){return-1!==e.indexOf("dev/null")}function g(e){return e.replace(/(<del[^>]*>((.|\n)*?)<\/del>)/g,"")}function b(e){return e.slice(0).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#x27;").replace(/\//g,"&#x2F;")}function m(e,t,n=!0){const r=function(e){return e?2:1}(t);return{prefix:e.substring(0,r),content:n?b(e.substring(r)):e.substring(r)}}function v(e){const t=(0,a.unifyPath)(e.oldName),n=(0,a.unifyPath)(e.newName);if(t===n||h(t)||h(n))return h(n)?t:n;{const e=[],r=[],i=t.split(u),s=n.split(u);let o=0,l=i.length-1,a=s.length-1;for(;o<l&&o<a&&i[o]===s[o];)e.push(s[o]),o+=1;for(;l>o&&a>o&&i[l]===s[a];)r.unshift(s[a]),l-=1,a-=1;const c=e.join(u),f=r.join(u),d=i.slice(o,l+1).join(u),p=s.slice(o,a+1).join(u);return c.length&&f.length?c+u+"{"+d+" → "+p+"}"+u+f:c.length?c+u+"{"+d+" → "+p+"}":f.length?"{"+d+" → "+p+"}"+u+f:t+" → "+n}}},363(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parsePatch=function(e){var t=e.split(/\n/),n=[],r=0;function i(){var e={};for(n.push(e);r<t.length;){var i=t[r];if(/^(---|\+\+\+|@@)\s/.test(i))break;var l=/^(?:Index:|diff(?: -r \w+)+)\s+/.exec(i);l&&(e.index=i.substring(l[0].length).trim()),r++}for(s(e),s(e),e.hunks=[];r<t.length&&(i=t[r],!/^(Index:\s|diff\s|---\s|\+\+\+\s|===================================================================)/.test(i));)if(/^@@/.test(i))e.hunks.push(o());else{if(i)throw new Error("Unknown line "+(r+1)+" "+JSON.stringify(i));r++}}function s(e){var n=/^(---|\+\+\+)\s+/.exec(t[r]);if(n){var i=n[1],s=t[r].substring(3).trim().split("\t",2),o=(s[1]||"").trim(),l=s[0].replace(/\\\\/g,"\\");l.startsWith('"')&&l.endsWith('"')&&(l=l.substr(1,l.length-2)),"---"===i?(e.oldFileName=l,e.oldHeader=o):(e.newFileName=l,e.newHeader=o),r++}}function o(){var e,n=r,i=t[r++].split(/@@ -(\d+)(?:,(\d+))? \+(\d+)(?:,(\d+))? @@/),s={oldStart:+i[1],oldLines:void 0===i[2]?1:+i[2],newStart:+i[3],newLines:void 0===i[4]?1:+i[4],lines:[]};0===s.oldLines&&(s.oldStart+=1),0===s.newLines&&(s.newStart+=1);for(var o=0,l=0;r<t.length&&(l<s.oldLines||o<s.newLines||(null===(e=t[r])||void 0===e?void 0:e.startsWith("\\")));r++){var a=0==t[r].length&&r!=t.length-1?" ":t[r][0];if("+"!==a&&"-"!==a&&" "!==a&&"\\"!==a)throw new Error("Hunk at line ".concat(n+1," contained invalid line ").concat(t[r]));s.lines.push(t[r]),"+"===a?o++:"-"===a?l++:" "===a&&(o++,l++)}if(o||1!==s.newLines||(s.newLines=0),l||1!==s.oldLines||(s.oldLines=0),o!==s.newLines)throw new Error("Added line count did not match for hunk at line "+(n+1));if(l!==s.oldLines)throw new Error("Removed line count did not match for hunk at line "+(n+1));return s}for(;r<t.length;)i();return n}},406(e,t){"use strict";var n=this&&this.__assign||function(){return n=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},n.apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.reversePatch=function e(t){return Array.isArray(t)?t.map((function(t){return e(t)})).reverse():n(n({},t),{oldFileName:t.newFileName,oldHeader:t.newHeader,newFileName:t.oldFileName,newHeader:t.oldHeader,hunks:t.hunks.map((function(e){return{oldLines:e.newLines,oldStart:e.newStart,newLines:e.oldLines,newStart:e.oldStart,lines:e.lines.map((function(e){return e.startsWith("-")?"+".concat(e.slice(1)):e.startsWith("+")?"-".concat(e.slice(1)):e}))}}))})}},453(e,t){!function(e){var t=/\S/,n=/\"/g,r=/\n/g,i=/\r/g,s=/\\/g,o=/\u2028/,l=/\u2029/;function a(e){return e.trim?e.trim():e.replace(/^\s*|\s*$/g,"")}function c(e,t,n){if(t.charAt(n)!=e.charAt(0))return!1;for(var r=1,i=e.length;r<i;r++)if(t.charAt(n+r)!=e.charAt(r))return!1;return!0}e.tags={"#":1,"^":2,"<":3,$:4,"/":5,"!":6,">":7,"=":8,_v:9,"{":10,"&":11,_t:12},e.scan=function(n,r){var i,s=n.length,o=0,l=null,f=null,u="",d=[],p=!1,h=0,g=0,b="{{",m="}}";function v(){u.length>0&&(d.push({tag:"_t",text:new String(u)}),u="")}function y(n,r){if(v(),n&&function(){for(var n=!0,r=g;r<d.length;r++)if(!(n=e.tags[d[r].tag]<e.tags._v||"_t"==d[r].tag&&null===d[r].text.match(t)))return!1;return n}())for(var i,s=g;s<d.length;s++)d[s].text&&((i=d[s+1])&&">"==i.tag&&(i.indent=d[s].text.toString()),d.splice(s,1));else r||d.push({tag:"\n"});p=!1,g=d.length}function w(e,t){var n="="+m,r=e.indexOf(n,t),i=a(e.substring(e.indexOf("=",t)+1,r)).split(" ");return b=i[0],m=i[i.length-1],r+n.length-1}for(r&&(r=r.split(" "),b=r[0],m=r[1]),h=0;h<s;h++)0==o?c(b,n,h)?(--h,v(),o=1):"\n"==n.charAt(h)?y(p):u+=n.charAt(h):1==o?(h+=b.length-1,"="==(l=(f=e.tags[n.charAt(h+1)])?n.charAt(h+1):"_v")?(h=w(n,h),o=0):(f&&h++,o=2),p=h):c(m,n,h)?(d.push({tag:l,n:a(u),otag:b,ctag:m,i:"/"==l?p-b.length:h+m.length}),u="",h+=m.length-1,o=0,"{"==l&&("}}"==m?h++:"}"===(i=d[d.length-1]).n.substr(i.n.length-1)&&(i.n=i.n.substring(0,i.n.length-1)))):u+=n.charAt(h);return y(p,!0),d};var f={_t:!0,"\n":!0,$:!0,"/":!0};function u(t,n,r,i){var s,o=[],l=null,a=null;for(s=r[r.length-1];t.length>0;){if(a=t.shift(),s&&"<"==s.tag&&!(a.tag in f))throw new Error("Illegal content in < super tag.");if(e.tags[a.tag]<=e.tags.$||d(a,i))r.push(a),a.nodes=u(t,a.tag,r,i);else{if("/"==a.tag){if(0===r.length)throw new Error("Closing tag without opener: /"+a.n);if(l=r.pop(),a.n!=l.n&&!p(a.n,l.n,i))throw new Error("Nesting error: "+l.n+" vs. "+a.n);return l.end=a.i,o}"\n"==a.tag&&(a.last=0==t.length||"\n"==t[0].tag)}o.push(a)}if(r.length>0)throw new Error("missing closing tag: "+r.pop().n);return o}function d(e,t){for(var n=0,r=t.length;n<r;n++)if(t[n].o==e.n)return e.tag="#",!0}function p(e,t,n){for(var r=0,i=n.length;r<i;r++)if(n[r].c==e&&n[r].o==t)return!0}function h(e){var t=[];for(var n in e.partials)t.push('"'+b(n)+'":{name:"'+b(e.partials[n].name)+'", '+h(e.partials[n])+"}");return"partials: {"+t.join(",")+"}, subs: "+function(e){var t=[];for(var n in e)t.push('"'+b(n)+'": function(c,p,t,i) {'+e[n]+"}");return"{ "+t.join(",")+" }"}(e.subs)}e.stringify=function(t,n,r){return"{code: function (c,p,i) { "+e.wrapMain(t.code)+" },"+h(t)+"}"};var g=0;function b(e){return e.replace(s,"\\\\").replace(n,'\\"').replace(r,"\\n").replace(i,"\\r").replace(o,"\\u2028").replace(l,"\\u2029")}function m(e){return~e.indexOf(".")?"d":"f"}function v(e,t){var n="<"+(t.prefix||"")+e.n+g++;return t.partials[n]={name:e.n,partials:{}},t.code+='t.b(t.rp("'+b(n)+'",c,p,"'+(e.indent||"")+'"));',n}function y(e,t){t.code+="t.b(t.t(t."+m(e.n)+'("'+b(e.n)+'",c,p,0)));'}function w(e){return"t.b("+e+");"}e.generate=function(t,n,r){g=0;var i={code:"",subs:{},partials:{}};return e.walk(t,i),r.asString?this.stringify(i,n,r):this.makeTemplate(i,n,r)},e.wrapMain=function(e){return'var t=this;t.b(i=i||"");'+e+"return t.fl();"},e.template=e.Template,e.makeTemplate=function(e,t,n){var r=this.makePartials(e);return r.code=new Function("c","p","i",this.wrapMain(e.code)),new this.template(r,t,this,n)},e.makePartials=function(e){var t,n={subs:{},partials:e.partials,name:e.name};for(t in n.partials)n.partials[t]=this.makePartials(n.partials[t]);for(t in e.subs)n.subs[t]=new Function("c","p","t","i",e.subs[t]);return n},e.codegen={"#":function(t,n){n.code+="if(t.s(t."+m(t.n)+'("'+b(t.n)+'",c,p,1),c,p,0,'+t.i+","+t.end+',"'+t.otag+" "+t.ctag+'")){t.rs(c,p,function(c,p,t){',e.walk(t.nodes,n),n.code+="});c.pop();}"},"^":function(t,n){n.code+="if(!t.s(t."+m(t.n)+'("'+b(t.n)+'",c,p,1),c,p,1,0,0,"")){',e.walk(t.nodes,n),n.code+="};"},">":v,"<":function(t,n){var r={partials:{},code:"",subs:{},inPartial:!0};e.walk(t.nodes,r);var i=n.partials[v(t,n)];i.subs=r.subs,i.partials=r.partials},$:function(t,n){var r={subs:{},code:"",partials:n.partials,prefix:t.n};e.walk(t.nodes,r),n.subs[t.n]=r.code,n.inPartial||(n.code+='t.sub("'+b(t.n)+'",c,p,i);')},"\n":function(e,t){t.code+=w('"\\n"'+(e.last?"":" + i"))},_v:function(e,t){t.code+="t.b(t.v(t."+m(e.n)+'("'+b(e.n)+'",c,p,0)));'},_t:function(e,t){t.code+=w('"'+b(e.text)+'"')},"{":y,"&":y},e.walk=function(t,n){for(var r,i=0,s=t.length;i<s;i++)(r=e.codegen[t[i].tag])&&r(t[i],n);return n},e.parse=function(e,t,n){return u(e,0,[],(n=n||{}).sectionTags||[])},e.cache={},e.cacheKey=function(e,t){return[e,!!t.asString,!!t.disableLambda,t.delimiters,!!t.modelGet].join("||")},e.compile=function(t,n){n=n||{};var r=e.cacheKey(t,n),i=this.cache[r];if(i){var s=i.partials;for(var o in s)delete s[o].instance;return i}return i=this.generate(this.parse(this.scan(t,n.delimiters),t,n),t,n),this.cache[r]=i}}(t)},484(e,t,n){"use strict";var r,i=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0}),t.sentenceDiff=void 0,t.diffSentences=function(e,n,r){return t.sentenceDiff.diff(e,n,r)};var s=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i(t,e),t.prototype.tokenize=function(e){for(var t,n,r=[],i=0,s=0;s<e.length;s++){if(s==e.length-1){r.push(e.slice(i));break}if(("."==(n=e[s])||"!"==n||"?"==n)&&e[s+1].match(/\s/)){for(r.push(e.slice(i,s+1)),s=i=s+1;null===(t=e[s+1])||void 0===t?void 0:t.match(/\s/);)s++;r.push(e.slice(i,s+1)),i=s+1}}return r},t}(n(188).default);t.sentenceDiff=new s},488(e,t,n){"use strict";var r,i=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),s=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||(r=function(e){return r=Object.getOwnPropertyNames||function(e){var t=[];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[t.length]=n);return t},r(e)},function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n=r(e),o=0;o<n.length;o++)"default"!==n[o]&&i(t,e,n[o]);return s(t,e),t});Object.defineProperty(t,"__esModule",{value:!0}),t.defaultTemplates=void 0;const l=o(n(111));t.defaultTemplates={},t.defaultTemplates["file-summary-line"]=new l.Template({code:function(e,t,n){var r=this;return r.b(n=n||""),r.b('<li class="d2h-file-list-line">'),r.b("\n"+n),r.b(' <span class="d2h-file-name-wrapper">'),r.b("\n"+n),r.b(r.rp("<fileIcon0",e,t," ")),r.b(' <a href="#'),r.b(r.v(r.f("fileHtmlId",e,t,0))),r.b('" class="d2h-file-name">'),r.b(r.v(r.f("fileName",e,t,0))),r.b("</a>"),r.b("\n"+n),r.b(' <span class="d2h-file-stats">'),r.b("\n"+n),r.b(' <span class="d2h-lines-added">'),r.b(r.v(r.f("addedLines",e,t,0))),r.b("</span>"),r.b("\n"+n),r.b(' <span class="d2h-lines-deleted">'),r.b(r.v(r.f("deletedLines",e,t,0))),r.b("</span>"),r.b("\n"+n),r.b(" </span>"),r.b("\n"+n),r.b(" </span>"),r.b("\n"+n),r.b("</li>"),r.fl()},partials:{"<fileIcon0":{name:"fileIcon",partials:{},subs:{}}},subs:{}}),t.defaultTemplates["file-summary-wrapper"]=new l.Template({code:function(e,t,n){var r=this;return r.b(n=n||""),r.b('<div class="d2h-file-list-wrapper '),r.b(r.v(r.f("colorScheme",e,t,0))),r.b('">'),r.b("\n"+n),r.b(' <div class="d2h-file-list-header">'),r.b("\n"+n),r.b(' <span class="d2h-file-list-title">Files changed ('),r.b(r.v(r.f("filesNumber",e,t,0))),r.b(")</span>"),r.b("\n"+n),r.b(' <a class="d2h-file-switch d2h-hide">hide</a>'),r.b("\n"+n),r.b(' <a class="d2h-file-switch d2h-show">show</a>'),r.b("\n"+n),r.b(" </div>"),r.b("\n"+n),r.b(' <ol class="d2h-file-list">'),r.b("\n"+n),r.b(" "),r.b(r.t(r.f("files",e,t,0))),r.b("\n"+n),r.b(" </ol>"),r.b("\n"+n),r.b("</div>"),r.fl()},partials:{},subs:{}}),t.defaultTemplates["generic-block-header"]=new l.Template({code:function(e,t,n){var r=this;return r.b(n=n||""),r.b("<tr>"),r.b("\n"+n),r.b(' <td class="'),r.b(r.v(r.f("lineClass",e,t,0))),r.b(" "),r.b(r.v(r.d("CSSLineClass.INFO",e,t,0))),r.b('"></td>'),r.b("\n"+n),r.b(' <td class="'),r.b(r.v(r.d("CSSLineClass.INFO",e,t,0))),r.b('">'),r.b("\n"+n),r.b(' <div class="'),r.b(r.v(r.f("contentClass",e,t,0))),r.b('">'),r.s(r.f("blockHeader",e,t,1),e,t,0,156,173,"{{ }}")&&(r.rs(e,t,(function(e,t,n){n.b(n.t(n.f("blockHeader",e,t,0)))})),e.pop()),r.s(r.f("blockHeader",e,t,1),e,t,1,0,0,"")||r.b("&nbsp;"),r.b("</div>"),r.b("\n"+n),r.b(" </td>"),r.b("\n"+n),r.b("</tr>"),r.fl()},partials:{},subs:{}}),t.defaultTemplates["generic-empty-diff"]=new l.Template({code:function(e,t,n){var r=this;return r.b(n=n||""),r.b("<tr>"),r.b("\n"+n),r.b(' <td class="'),r.b(r.v(r.d("CSSLineClass.INFO",e,t,0))),r.b('">'),r.b("\n"+n),r.b(' <div class="'),r.b(r.v(r.f("contentClass",e,t,0))),r.b('">'),r.b("\n"+n),r.b(" File without changes"),r.b("\n"+n),r.b(" </div>"),r.b("\n"+n),r.b(" </td>"),r.b("\n"+n),r.b("</tr>"),r.fl()},partials:{},subs:{}}),t.defaultTemplates["generic-file-path"]=new l.Template({code:function(e,t,n){var r=this;return r.b(n=n||""),r.b('<span class="d2h-file-name-wrapper">'),r.b("\n"+n),r.b(r.rp("<fileIcon0",e,t," ")),r.b(' <span class="d2h-file-name">'),r.b(r.v(r.f("fileDiffName",e,t,0))),r.b("</span>"),r.b("\n"+n),r.b(r.rp("<fileTag1",e,t," ")),r.b("</span>"),r.b("\n"+n),r.b('<label class="d2h-file-collapse">'),r.b("\n"+n),r.b(' <input class="d2h-file-collapse-input" type="checkbox" name="viewed" value="viewed">'),r.b("\n"+n),r.b(" Viewed"),r.b("\n"+n),r.b("</label>"),r.fl()},partials:{"<fileIcon0":{name:"fileIcon",partials:{},subs:{}},"<fileTag1":{name:"fileTag",partials:{},subs:{}}},subs:{}}),t.defaultTemplates["generic-line"]=new l.Template({code:function(e,t,n){var r=this;return r.b(n=n||""),r.b("<tr>"),r.b("\n"+n),r.b(' <td class="'),r.b(r.v(r.f("lineClass",e,t,0))),r.b(" "),r.b(r.v(r.f("type",e,t,0))),r.b('">'),r.b("\n"+n),r.b(" "),r.b(r.t(r.f("lineNumber",e,t,0))),r.b("\n"+n),r.b(" </td>"),r.b("\n"+n),r.b(' <td class="'),r.b(r.v(r.f("type",e,t,0))),r.b('">'),r.b("\n"+n),r.b(' <div class="'),r.b(r.v(r.f("contentClass",e,t,0))),r.b('">'),r.b("\n"+n),r.s(r.f("prefix",e,t,1),e,t,0,162,238,"{{ }}")&&(r.rs(e,t,(function(e,t,r){r.b(' <span class="d2h-code-line-prefix">'),r.b(r.t(r.f("prefix",e,t,0))),r.b("</span>"),r.b("\n"+n)})),e.pop()),r.s(r.f("prefix",e,t,1),e,t,1,0,0,"")||(r.b(' <span class="d2h-code-line-prefix">&nbsp;</span>'),r.b("\n"+n)),r.s(r.f("content",e,t,1),e,t,0,371,445,"{{ }}")&&(r.rs(e,t,(function(e,t,r){r.b(' <span class="d2h-code-line-ctn">'),r.b(r.t(r.f("content",e,t,0))),r.b("</span>"),r.b("\n"+n)})),e.pop()),r.s(r.f("content",e,t,1),e,t,1,0,0,"")||(r.b(' <span class="d2h-code-line-ctn"><br></span>'),r.b("\n"+n)),r.b(" </div>"),r.b("\n"+n),r.b(" </td>"),r.b("\n"+n),r.b("</tr>"),r.fl()},partials:{},subs:{}}),t.defaultTemplates["generic-wrapper"]=new l.Template({code:function(e,t,n){var r=this;return r.b(n=n||""),r.b('<div class="d2h-wrapper '),r.b(r.v(r.f("colorScheme",e,t,0))),r.b('">'),r.b("\n"+n),r.b(" "),r.b(r.t(r.f("content",e,t,0))),r.b("\n"+n),r.b("</div>"),r.fl()},partials:{},subs:{}}),t.defaultTemplates["icon-file-added"]=new l.Template({code:function(e,t,n){var r=this;return r.b(n=n||""),r.b('<svg aria-hidden="true" class="d2h-icon d2h-added" height="16" title="added" version="1.1" viewBox="0 0 14 16"'),r.b("\n"+n),r.b(' width="14">'),r.b("\n"+n),r.b(' <path d="M13 1H1C0.45 1 0 1.45 0 2v12c0 0.55 0.45 1 1 1h12c0.55 0 1-0.45 1-1V2c0-0.55-0.45-1-1-1z m0 13H1V2h12v12zM6 9H3V7h3V4h2v3h3v2H8v3H6V9z"></path>'),r.b("\n"+n),r.b("</svg>"),r.fl()},partials:{},subs:{}}),t.defaultTemplates["icon-file-changed"]=new l.Template({code:function(e,t,n){var r=this;return r.b(n=n||""),r.b('<svg aria-hidden="true" class="d2h-icon d2h-changed" height="16" title="modified" version="1.1"'),r.b("\n"+n),r.b(' viewBox="0 0 14 16" width="14">'),r.b("\n"+n),r.b(' <path d="M13 1H1C0.45 1 0 1.45 0 2v12c0 0.55 0.45 1 1 1h12c0.55 0 1-0.45 1-1V2c0-0.55-0.45-1-1-1z m0 13H1V2h12v12zM4 8c0-1.66 1.34-3 3-3s3 1.34 3 3-1.34 3-3 3-3-1.34-3-3z"></path>'),r.b("\n"+n),r.b("</svg>"),r.fl()},partials:{},subs:{}}),t.defaultTemplates["icon-file-deleted"]=new l.Template({code:function(e,t,n){var r=this;return r.b(n=n||""),r.b('<svg aria-hidden="true" class="d2h-icon d2h-deleted" height="16" title="removed" version="1.1"'),r.b("\n"+n),r.b(' viewBox="0 0 14 16" width="14">'),r.b("\n"+n),r.b(' <path d="M13 1H1C0.45 1 0 1.45 0 2v12c0 0.55 0.45 1 1 1h12c0.55 0 1-0.45 1-1V2c0-0.55-0.45-1-1-1z m0 13H1V2h12v12zM11 9H3V7h8v2z"></path>'),r.b("\n"+n),r.b("</svg>"),r.fl()},partials:{},subs:{}}),t.defaultTemplates["icon-file-renamed"]=new l.Template({code:function(e,t,n){var r=this;return r.b(n=n||""),r.b('<svg aria-hidden="true" class="d2h-icon d2h-moved" height="16" title="renamed" version="1.1"')