1import{t as e}from"./QTnfLwEv.js";var t=e(((e,t)=>{ace.define(`ace/ext/diff/scroll_diff_decorator`,[`require`,`exports`,`module`,`ace/layer/decorators`],function(e,t,n){var r=this&&this.__extends||(function(){var e=function(t,n){return e=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])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),i=this&&this.__values||function(e){var t=typeof Symbol==`function`&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length==`number`)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw TypeError(t?`Object is not iterable.`:`Symbol.iterator is not defined.`)};t.ScrollDiffDecorator=function(e){r(t,e);function t(t,n,r){var i=e.call(this,t,n)||this;return i.colors.dark.delete=`rgba(255, 18, 18, 1)`,i.colors.dark.insert=`rgba(18, 136, 18, 1)`,i.colors.light.delete=`rgb(255,51,51)`,i.colors.light.insert=`rgb(32,133,72)`,i.$zones=[],i.$forInlineDiff=r,i}return t.prototype.addZone=function(e,t,n){this.$zones.push({startRow:e,endRow:t,type:n})},t.prototype.setSessions=function(e,t){this.sessionA=e,this.sessionB=t},t.prototype.$updateDecorators=function(t){if(typeof this.canvas.getContext==`function`&&(e.prototype.$updateDecorators.call(this,t),this.$zones.length>0)){var n=this.renderer.theme.isDark===!0?this.colors.dark:this.colors.light,r=this.canvas.getContext(`2d`);this.$setDiffDecorators(r,n)}},t.prototype.$transformPosition=function(e,t){return t==`delete`?this.sessionA.documentToScreenRow(e,0):this.sessionB.documentToScreenRow(e,0)},t.prototype.$setDiffDecorators=function(e,t){var n,r,a=this;function o(e,t){return e.from===t.from?e.to-t.to:e.from-t.from}var s=this.$zones;if(s){var c=[];[s.filter(function(e){return e.type===`delete`}),s.filter(function(e){return e.type===`insert`})].forEach(function(e){e.forEach(function(e,n){var r=a.$transformPosition(e.startRow,e.type)*a.lineHeight,i=a.$transformPosition(e.endRow,e.type)*a.lineHeight+a.lineHeight,o=Math.round(a.heightRatio*r),s=Math.round(a.heightRatio*i),l=1,u=Math.round((o+s)/2),d=s-u;d<a.halfMinDecorationHeight&&(d=a.halfMinDecorationHeight);var f=c[c.length-1];n>0&&f&&f.type===e.type&&u-d<f.to+l&&(u=c[c.length-1].to+l+d),u-d<0&&(u=d),u+d>a.canvasHeight&&(u=a.canvasHeight-d),c.push({type:e.type,from:u-d,to:u+d,color:t[e.type]||null})})}),c=c.sort(o);try{for(var l=i(c),u=l.next();!u.done;u=l.next()){var d=u.value;e.fillStyle=d.color||null;var f=d.from,p=d.to-f;this.$forInlineDiff?e.fillRect(this.oneZoneWidth,f,2*this.oneZoneWidth,p):d.type==`delete`?e.fillRect(this.oneZoneWidth,f,this.oneZoneWidth,p):e.fillRect(2*this.oneZoneWidth,f,this.oneZoneWidth,p)}}catch(e){n={error:e}}finally{try{u&&!u.done&&(r=l.return)&&r.call(l)}finally{if(n)throw n.error}}}},t.prototype.setZoneWidth=function(){this.oneZoneWidth=Math.round(this.canvasWidth/3)},t}(e("../../layer/decorators").Decorator)}),ace.define(`ace/ext/diff/styles-css.js`,[`require`,`exports`,`module`],function(e,t,n){t.cssText=` 2/* 3 * Line Markers 4 */ 5.ace_diff { 6 position: absolute; 7 z-index: 0; 8} 9.ace_diff.inline { 10 z-index: 20; 11} 12/* 13 * Light Colors 14 */ 15.ace_diff.insert { 16 background-color: #EFFFF1; 17} 18.ace_diff.delete { 19 background-color: #FFF1F1; 20} 21.ace_diff.aligned_diff { 22 background: rgba(206, 194, 191, 0.26); 23 background: repeating-linear-gradient( 24 45deg, 25 rgba(122, 111, 108, 0.26), 26 rgba(122, 111, 108, 0.26) 5px, 27 rgba(0, 0, 0, 0) 5px, 28 rgba(0, 0, 0, 0) 10px 29 ); 30} 31 32.ace_diff.insert.inline { 33 background-color: rgb(74 251 74 / 18%); 34} 35.ace_diff.delete.inline { 36 background-color: rgb(251 74 74 / 15%); 37} 38 39.ace_diff.delete.inline.empty { 40 background-color: rgba(255, 128, 79, 0.7); 41 width: 2px !important; 42} 43 44.ace_diff.insert.inline.empty { 45 background-color: rgba(49, 230, 96, 0.7); 46 width: 2px !important; 47} 48 49.ace_diff-active-line { 50 border-bottom: 1px solid; 51 border-top: 1px solid; 52 background: transparent; 53 position: absolute; 54 box-sizing: border-box; 55 border-color: #9191ac; 56} 57 58.ace_dark .ace_diff-active-line { 59 background: transparent; 60 border-color: #75777a; 61} 62 63 64/* gutter changes */ 65.ace_mini-diff_gutter-enabled > .ace_gutter-cell, 66.ace_mini-diff_gutter-enabled > .ace_gutter-cell_svg-icons { 67 padding-right: 13px; 68} 69 70.ace_mini-diff_gutter_other > .ace_gutter-cell, 71.ace_mini-diff_gutter_other > .ace_gutter-cell_svg-icons { 72 display: none; 73} 74 75.ace_mini-diff_gutter_other { 76 pointer-events: none; 77} 78 79 80.ace_mini-diff_gutter-enabled > .mini-diff-added { 81 background-color: #EFFFF1; 82 border-left: 3px solid #2BB534;
83 padding-left: 16px; 84 display: block; 85} 86 87.ace_mini-diff_gutter-enabled > .mini-diff-deleted { 88 background-color: #FFF1F1; 89 border-left: 3px solid #EA7158; 90 padding-left: 16px; 91 display: block; 92} 93 94 95.ace_mini-diff_gutter-enabled > .mini-diff-added:after { 96 position: absolute; 97 right: 2px; 98 content: "+"; 99 background-color: inherit; 100} 101 102.ace_mini-diff_gutter-enabled > .mini-diff-deleted:after { 103 position: absolute; 104 right: 2px; 105 content: "-"; 106 background-color: inherit; 107} 108.ace_fade-fold-widgets:hover > .ace_folding-enabled > .mini-diff-added:after, 109.ace_fade-fold-widgets:hover > .ace_folding-enabled > .mini-diff-deleted:after { 110 display: none; 111} 112 113.ace_diff_other .ace_selection { 114 filter: drop-shadow(1px 2px 3px darkgray); 115} 116 117.ace_hidden_marker-layer .ace_bracket, 118.ace_hidden_marker-layer .ace_error_bracket { 119 display: none; 120} 121 122 123 124/* 125 * Dark Colors 126 */ 127 128.ace_dark .ace_diff.insert { 129 background-color: #212E25; 130} 131.ace_dark .ace_diff.delete { 132 background-color: #3F2222; 133} 134 135.ace_dark .ace_mini-diff_gutter-enabled > .mini-diff-added { 136 background-color: #212E25; 137 border-left-color:#00802F; 138} 139 140.ace_dark .ace_mini-diff_gutter-enabled > .mini-diff-deleted { 141 background-color: #3F2222; 142 border-left-color: #9C3838; 143} 144 145`}),ace.define(`ace/ext/diff/gutter_decorator`,[`require`,`exports`,`module`,`ace/lib/dom`],function(e,t,n){var r=e("../../lib/dom");t.MinimalGutterDiffDecorator=function(){function e(e,t){this.gutterClass=`ace_mini-diff_gutter-enabled`,this.gutterCellsClasses={add:`mini-diff-added`,delete:`mini-diff-deleted`},this.editor=e,this.type=t,this.chunks=[],this.attachToEditor()}return e.prototype.attachToEditor=function(){this.renderGutters=this.renderGutters.bind(this),r.addCssClass(this.editor.renderer.$gutterLayer.element,this.gutterClass),this.editor.renderer.$gutterLayer.on(`afterRender`,this.renderGutters)},e.prototype.renderGutters=function(e,t){var n=this,r=this.editor.renderer.$gutterLayer.$lines.cells;r.forEach(function(e){e.element.classList.remove(Object.values(n.gutterCellsClasses))});var i=this.type===-1?`old`:`new`,a=this.type===-1?this.gutterCellsClasses.delete:this.gutterCellsClasses.add;this.chunks.forEach(function(e){var t=e[i].start.row,n=e[i].end.row-1;r.forEach(function(e){e.row>=t&&e.row<=n&&e.element.classList.add(a)})})},e.prototype.setDecorations=function(e){this.chunks=e,this.renderGutters()},e.prototype.dispose=function(){r.removeCssClass(this.editor.renderer.$gutterLayer.element,this.gutterClass),this.editor.renderer.$gutterLayer.off(`afterRender`,this.renderGutters)},e}()}),ace.define(`ace/ext/diff/base_diff_view`,[`require`,`exports`,`module`,`ace/lib/oop`,`ace/range`,`ace/lib/dom`,`ace/config`,`ace/line_widgets`,`ace/ext/diff/scroll_diff_decorator`,`ace/ext/diff/styles-css.js`,`ace/editor`,`ace/virtual_renderer`,`ace/undomanager`,`ace/layer/decorators`,`ace/theme/textmate`,`ace/multi_select`,`ace/edit_session`,`ace/ext/diff/gutter_decorator`],function(e,t,n){var r=this&&this.__read||function(e,t){var n=typeof Symbol==`function`&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,a=[],o;try{for(;(t===void 0||t-- >0)&&!(i=r.next()).done;)a.push(i.value)}catch(e){o={error:e}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return a};e("../../lib/oop");var i=e("../../range").Range,a=e("../../lib/dom"),o=e("../../config"),s=e("../../line_widgets").LineWidgets,c=e("./scroll_diff_decorator").ScrollDiffDecorator,l=e("./styles-css.js").cssText,u=e("../../editor").Editor,d=e("../../virtual_renderer").VirtualRenderer,f=e("../../undomanager").UndoManager,p=e("../../layer/decorators").Decorator;e("../../theme/textmate"),e("../../multi_select");var m=e("../../edit_session").EditSession,h=e("./gutter_decorator").MinimalGutterDiffDecorator,g={compute:function(e,t,n){return[]}};a.importCssString(l,`diffview.css`,!1);var _=function(){function e(e,t){this.onChangeTheme=this.onChangeTheme.bind(this),this.onInput=this.onInput.bind(this),this.onChangeFold=this.onChangeFold.bind(this),this.realign=this.realign.bind(this),this.onSelect=this.onSelect.bind(this),this.onChangeWrapLimit=this.onChangeWrapLimit.bind(this),this.realignPending=!1,this.diffSession,this.chunks,this.inlineDiffEditor=e||!1,this.currentDiffIndex=0,this.diffProvider=g,t&&(this.container=t),this.$ignoreTrimWhitespace=!1,this.$maxDiffs=5e3,this.$maxComputationTimeMs=150,this.$syncSelections=!1,this.$foldUnchangedOnInput=!1,this.markerB=new b(this,1),this.markerA=new b(this,-1)}return e.prototype.$setupModels=function(e){e.diffProvider&&this.setProvider(e.diffProvider),this.showSideA=e.inline==null?!0:e.inline===`a`;var t={scrollPastEnd:.5,highlightActiveLine:!1,highlightGutterLine:!1,animatedScroll:!0,
145customScrollbar:!0,vScrollBarAlwaysVisible:!0,fadeFoldWidgets:!0,showFoldWidgets:!0,selectionStyle:`text`};if(this.savedOptionsA=e.editorA&&e.editorA.getOptions(t),this.savedOptionsB=e.editorB&&e.editorB.getOptions(t),(!this.inlineDiffEditor||e.inline===`a`)&&(this.editorA=e.editorA||this.$setupModel(e.sessionA,e.valueA),this.container&&this.container.appendChild(this.editorA.container),this.editorA.setOptions(t)),(!this.inlineDiffEditor||e.inline===`b`)&&(this.editorB=e.editorB||this.$setupModel(e.sessionB,e.valueB),this.container&&this.container.appendChild(this.editorB.container),this.editorB.setOptions(t)),this.inlineDiffEditor){this.activeEditor=this.showSideA?this.editorA:this.editorB,this.otherSession=this.showSideA?this.sessionB:this.sessionA;var n=this.activeEditor.getOptions();n.readOnly=!0,delete n.mode,this.otherEditor=new u(new d(null),void 0,n),this.showSideA?this.editorB=this.otherEditor:this.editorA=this.otherEditor}this.setDiffSession({sessionA:e.sessionA||(e.editorA?e.editorA.session:new m(e.valueA||``)),sessionB:e.sessionB||(e.editorB?e.editorB.session:new m(e.valueB||``)),chunks:[]}),this.otherEditor&&this.activeEditor&&this.otherSession.setOption(`wrap`,this.activeEditor.getOption(`wrap`)),this.setupScrollbars()},e.prototype.addGutterDecorators=function(){this.gutterDecoratorA||=new h(this.editorA,-1),this.gutterDecoratorB||=new h(this.editorB,1)},e.prototype.$setupModel=function(e,t){var n=new u(new d,e);return n.session.setUndoManager(new f),t!=null&&n.setValue(t,-1),n},e.prototype.foldUnchanged=function(){for(var e=this.chunks,t=`-`.repeat(120),n={old:new i(0,0,0,0),new:new i(0,0,0,0)},r=!1,a=0;a<e.length+1;a++){var o=e[a]||{old:new i(this.sessionA.getLength(),0,this.sessionA.getLength(),0),new:new i(this.sessionB.getLength(),0,this.sessionB.getLength(),0)},s=o.new.start.row-n.new.end.row-5;if(s>2){var c=n.old.end.row+2,l=this.sessionA.addFold(t,new i(c,0,c+s,Number.MAX_VALUE));c=n.new.end.row+2;var u=this.sessionB.addFold(t,new i(c,0,c+s,Number.MAX_VALUE));(l||u)&&(r=!0),u&&l&&(l.other=u,u.other=l)}n=o}return r},e.prototype.unfoldUnchanged=function(){for(var e=this.sessionA.getAllFolds(),t=e.length-1;t>=0;t--){var n=e[t];n.placeholder.length==120&&this.sessionA.removeFold(n)}},e.prototype.toggleFoldUnchanged=function(){this.foldUnchanged()||this.unfoldUnchanged()},e.prototype.setDiffSession=function(e){this.diffSession&&(this.$detachSessionsEventHandlers(),this.clearSelectionMarkers()),this.diffSession=e,this.sessionA=this.sessionB=null,this.diffSession&&(this.chunks=this.diffSession.chunks||[],this.editorA&&this.editorA.setSession(e.sessionA),this.editorB&&this.editorB.setSession(e.sessionB),this.sessionA=this.diffSession.sessionA,this.sessionB=this.diffSession.sessionB,this.$attachSessionsEventHandlers(),this.initSelectionMarkers()),this.otherSession=this.showSideA?this.sessionB:this.sessionA},e.prototype.$attachSessionsEventHandlers=function(){},e.prototype.$detachSessionsEventHandlers=function(){},e.prototype.getDiffSession=function(){return this.diffSession},e.prototype.setTheme=function(e){this.editorA&&this.editorA.setTheme(e),this.editorB&&this.editorB.setTheme(e)},e.prototype.getTheme=function(){return(this.editorA||this.editorB).getTheme()},e.prototype.onChangeTheme=function(e){var t=e&&e.theme||this.getTheme();this.editorA&&this.editorA.getTheme()!==t&&this.editorA.setTheme(t),this.editorB&&this.editorB.getTheme()!==t&&this.editorB.setTheme(t)},e.prototype.resize=function(e){this.editorA&&this.editorA.resize(e),this.editorB&&this.editorB.resize(e)},e.prototype.scheduleOnInput=function(){var e=this;this.$onInputTimer||=setTimeout(function(){e.$onInputTimer=null,e.onInput()})},e.prototype.onInput=function(){var e=this;this.$onInputTimer&&clearTimeout(this.$onInputTimer);var t=this.sessionA.doc.getAllLines(),n=this.sessionB.doc.getAllLines();this.selectionRangeA=null,this.selectionRangeB=null;var r=this.$diffLines(t,n);this.diffSession.chunks=this.chunks=r,this.gutterDecoratorA&&this.gutterDecoratorA.setDecorations(r),this.gutterDecoratorB&&this.gutterDecoratorB.setDecorations(r),!(this.chunks&&this.chunks.length>this.$maxDiffs)&&(this.align(),this.editorA&&this.editorA.renderer.updateBackMarkers(),this.editorB&&this.editorB.renderer.updateBackMarkers(),setTimeout(function(){e.updateScrollBarDecorators()},0),this.$foldUnchangedOnInput&&this.foldUnchanged())},e.prototype.setupScrollbars=function(){var e=this,t=function(t){setTimeout(function(){e.$setScrollBarDecorators(t),e.updateScrollBarDecorators()},0)};this.inlineDiffEditor?t(this.activeEditor.renderer):(t(this.editorA.renderer),t(this.editorB.renderer))},e.prototype.$setScrollBarDecorators=function(e){e.$scrollDecorator&&e.$scrollDecorator.destroy(),e.$scrollDecorator=new c(e.scrollBarV,e,this.inlineDiffEditor),e.$scrollDecorator.setSessions(this.sessionA,this.sessionB),e.scrollBarV.setVisible(!0),e.scrollBarV.element.style.bottom=e.scrollBarH.getHeight()+`px`},e.prototype.$resetDecorators=function(e){e.$scrollDecorator&&e.$scrollDecorator.destroy(),e.$scrollDecorator=new p(e.scrollBarV,e)},e.prototype.updateScrollBarDecorators=function(){var e=this;
145if(this.inlineDiffEditor){if(!this.activeEditor)return;this.activeEditor.renderer.$scrollDecorator.$zones=[]}else{if(!this.editorA||!this.editorB)return;this.editorA.renderer.$scrollDecorator.$zones=[],this.editorB.renderer.$scrollDecorator.$zones=[]}var t=function(e,t){e&&typeof e.renderer.$scrollDecorator.addZone==`function`&&(t.old.start.row!=t.old.end.row&&e.renderer.$scrollDecorator.addZone(t.old.start.row,t.old.end.row-1,`delete`),t.new.start.row!=t.new.end.row&&e.renderer.$scrollDecorator.addZone(t.new.start.row,t.new.end.row-1,`insert`))};this.inlineDiffEditor?(this.chunks&&this.chunks.forEach(function(n){t(e.activeEditor,n)}),this.activeEditor.renderer.$scrollDecorator.$updateDecorators(this.activeEditor.renderer.layerConfig)):(this.chunks&&this.chunks.forEach(function(n){t(e.editorA,n),t(e.editorB,n)}),this.editorA.renderer.$scrollDecorator.$updateDecorators(this.editorA.renderer.layerConfig),this.editorB.renderer.$scrollDecorator.$updateDecorators(this.editorB.renderer.layerConfig))},e.prototype.$diffLines=function(e,t){return this.diffProvider.compute(e,t,{ignoreTrimWhitespace:this.$ignoreTrimWhitespace,maxComputationTimeMs:this.$maxComputationTimeMs})},e.prototype.setProvider=function(e){this.diffProvider=e},e.prototype.$addWidget=function(e,t){var n=e.lineWidgets[t.row];n&&(t.rowsAbove+=n.rowsAbove>t.rowsAbove?n.rowsAbove:t.rowsAbove,t.rowCount+=n.rowCount),e.lineWidgets[t.row]=t,e.widgetManager.lineWidgets[t.row]=t,e.$resetRowCache(t.row);var r=e.getFoldAt(t.row,0);r&&e.widgetManager.updateOnFold({data:r,action:`add`},e)},e.prototype.$initWidgets=function(e){var t=e.session;t.widgetManager||(t.widgetManager=new s(t),t.widgetManager.attach(e)),e.session.lineWidgets=[],e.session.widgetManager.lineWidgets=[],e.session.$resetRowCache(0)},e.prototype.$screenRow=function(e,t){var n=t.documentToScreenPosition(e).row,r=e.row-t.getLength()+1;return r>0&&(n+=r),n},e.prototype.align=function(){},e.prototype.onChangeWrapLimit=function(e,t){},e.prototype.onSelect=function(e,t){this.searchHighlight(t),this.syncSelect(t)},e.prototype.syncSelect=function(e){if(!this.$updatingSelection){var t=e.session===this.sessionA,n=e.getRange(),r=t?this.selectionRangeA:this.selectionRangeB;if(!(r&&n.isEqual(r))){t?this.selectionRangeA=n:this.selectionRangeB=n,this.$updatingSelection=!0;var i=this.transformRange(n,t);this.$syncSelections&&(t?this.editorB:this.editorA).session.selection.setSelectionRange(i),this.$updatingSelection=!1,t?(this.selectionRangeA=n,this.selectionRangeB=i):(this.selectionRangeA=i,this.selectionRangeB=n),this.updateSelectionMarker(this.syncSelectionMarkerA,this.sessionA,this.selectionRangeA),this.updateSelectionMarker(this.syncSelectionMarkerB,this.sessionB,this.selectionRangeB)}}},e.prototype.updateSelectionMarker=function(e,t,n){e.setRange(n),t._signal(`changeFrontMarker`)},e.prototype.onChangeFold=function(e,t){var n=e.data;if(!(this.$syncingFold||!n||!e.action)){this.scheduleRealign();var r=t===this.sessionA,i=r?this.sessionB:this.sessionA;if(e.action===`remove`&&(n.other?(n.other.other=null,i.removeFold(n.other)):n.lineWidget&&(i.widgetManager.addLineWidget(n.lineWidget),n.lineWidget=null,i.$editor&&i.$editor.renderer.updateBackMarkers())),e.action===`add`){var a=this.transformRange(n.range,r);if(a.isEmpty()){var o=a.start.row+1;i.lineWidgets[o]&&(n.lineWidget=i.lineWidgets[o],i.widgetManager.removeLineWidget(n.lineWidget),i.$editor&&i.$editor.renderer.updateBackMarkers())}else this.$syncingFold=!0,n.other=i.addFold(n.placeholder,a),n.other&&(n.other.other=n),this.$syncingFold=!1}}},e.prototype.scheduleRealign=function(){this.realignPending||(this.realignPending=!0,this.editorA.renderer.on(`beforeRender`,this.realign),this.editorB.renderer.on(`beforeRender`,this.realign))},e.prototype.realign=function(){this.realignPending=!0,this.editorA.renderer.off(`beforeRender`,this.realign),this.editorB.renderer.off(`beforeRender`,this.realign),this.align(),this.realignPending=!1},e.prototype.detach=function(){!this.editorA||!this.editorB||(this.savedOptionsA&&this.editorA.setOptions(this.savedOptionsA),this.savedOptionsB&&this.editorB.setOptions(this.savedOptionsB),this.editorA.renderer.off(`beforeRender`,this.realign),this.editorB.renderer.off(`beforeRender`,this.realign),this.$detachEventHandlers(),this.$removeLineWidgets(this.sessionA),this.$removeLineWidgets(this.sessionB),this.gutterDecoratorA&&this.gutterDecoratorA.dispose(),this.gutterDecoratorB&&this.gutterDecoratorB.dispose(),this.sessionA.selection.clearSelection(),this.sessionB.selection.clearSelection(),this.savedOptionsA&&this.savedOptionsA.customScrollbar&&this.$resetDecorators(this.editorA.renderer),this.savedOptionsB&&this.savedOptionsB.customScrollbar&&this.$resetDecorators(this.editorB.renderer))},e.prototype.$removeLineWidgets=function(e){e.lineWidgets=[],e.widgetManager.lineWidgets=[],e._signal(`changeFold`,{data:{start:{row:0}}})},e.prototype.$detachEventHandlers=function(){},e.prototype.destroy=function(){this.detach(),this.editorA&&this.editorA.destroy(),this.editorB&&this.editorB.destroy(),this.editorA=this.editorB=null},e.prototype.gotoNext=function(e){var t=this.activeEditor||this.editorA;this.inlineDiffEditor&&(t=this.editorA);var n=t==this.editorA,r=t.selection.lead.row,a=this.findChunkIndex(this.chunks,r,n),o=this.chunks[a+e]||this.chunks[a],s=t.session.getScrollTop();if(o){var c=o[n?`old`:`new`],l=Math.max(c.start.row,c.end.row-1);t.selection.setRange(new i(l,0,l,0))}t.renderer.scrollSelectionIntoView(t.selection.lead,t.selection.anchor,.5),t.renderer.animateScrolling(s)},e.prototype.firstDiffSelected=function(){return this.currentDiffIndex<=1},e.prototype.lastDiffSelected=function(){return this.currentDiffIndex>this.chunks.length-1},e.prototype.transformRange=function(e,t){return i.fromPoints(this.transformPosition(e.start,t),this.transformPosition(e.end,t))},e.prototype.transformPosition=function(e,t){var n=this.findChunkIndex(this.chunks,e.row,t),i=this.chunks[n],a=this.sessionB.doc.clonePos,o=a(e),s=r(t?[`old`,`new`]:[`new`,`old`],2),c=s[0],l=s[1],u=0,d=!1;if(i)if(i[c].end.row<=e.row)o.row-=i[c].end.row-i[l].end.row;else if(i.charChanges)for(var f=0;f<i.charChanges.length;f++){var p=i.charChanges[f],m=p[c],h=p[l];if(!(m.end.row<e.row)){if(m.start.row>e.row)break;if(m.isMultiLine()&&m.contains(e.row,e.column)){o.row=h.start.row+e.row-m.start.row;var g=h.end.row;h.end.column===0&&g--,o.row>g&&(o.row=g,o.column=(t?this.sessionB:this.sessionA).getLine(g).length,d=!0),o.row=Math.min(o.row,g)}else{if(o.row=h.start.row,m.start.column>e.column)break;d=!0,!m.isEmpty()&&m.contains(e.row,e.column)?(o.column=h.start.column,u=e.column-m.start.column,u=Math.min(u,h.end.column-h.start.column)):(o=a(h.end),u=e.column-m.end.column)}}}else i[c].start.row<=e.row&&(o.row+=i[l].start.row-i[c].start.row,o.row>=i[l].end.row&&(o.row=i[l].end.row-1,o.column=(t?this.sessionB:this.sessionA).getLine(o.row).length));if(!d){var _=r(t?[this.sessionA,this.sessionB]:[this.sessionB,this.sessionA],2),v=_[0],y=_[1];u-=this.$getDeltaIndent(v,y,e.row,o.row)}return o.column+=u,o},e.prototype.$getDeltaIndent=function(e,t,n,r){return this.$getIndent(e,n)-this.$getIndent(t,r)},e.prototype.$getIndent=function(e,t){return e.getLine(t).match(/^\s*/)[0].length},e.prototype.printDiffs=function(){this.chunks.forEach(function(e){console.log(e.toString())})},e.prototype.findChunkIndex=function(e,t,n){for(var r=0;r<e.length;r++){var i=e[r],a=n?i.old:i.new;if(!(a.end.row<t)&&a.start.row>t)break}return this.currentDiffIndex=r,r-1},e.prototype.searchHighlight=function(e){if(!(this.$syncSelections||this.inlineDiffEditor)){var t=e.session,n=t===this.sessionA?this.sessionB:this.sessionA;n.highlight(t.$searchHighlight.regExp),n._signal(`changeBackMarker`)}},e.prototype.initSelectionMarkers=function(){this.syncSelectionMarkerA=new x,this.syncSelectionMarkerB=new x,this.sessionA.addDynamicMarker(this.syncSelectionMarkerA,!0),this.sessionB.addDynamicMarker(this.syncSelectionMarkerB,!0)},e.prototype.clearSelectionMarkers=function(){this.sessionA.removeMarker(this.syncSelectionMarkerA.id),this.sessionB.removeMarker(this.syncSelectionMarkerB.id)},e}();o.defineOptions(_.prototype,`DiffView`,{showOtherLineNumbers:{set:function(e){this.gutterLayer&&(this.gutterLayer.$renderer=e?null:v,this.editorA.renderer.updateFull())},initialValue:!0},folding:{set:function(e){if(this.editorA.setOption(`showFoldWidgets`,e),this.editorB.setOption(`showFoldWidgets`,e),!e){var t=[],n=[];this.chunks&&this.chunks.forEach(function(e){t.push(e.old.start,e.old.end),n.push(e.new.start,e.new.end)}),this.sessionA.unfold(t),this.sessionB.unfold(n)}}},syncSelections:{set:function(e){}},ignoreTrimWhitespace:{set:function(e){this.scheduleOnInput()}},wrap:{set:function(e){this.sessionA.setOption(`wrap`,e),this.sessionB.setOption(`wrap`,e)}},maxDiffs:{value:5e3},theme:{set:function(e){this.setTheme(e)},get:function(){return this.editorA.getTheme()}}});var v={getText:function(e){return``},getWidth:function(){return 0}};t.BaseDiffView=_;var y=function(){function e(t,n,r){this.old=t,this.new=n,this.charChanges=r&&r.map(function(t){return new e(new i(t.originalStartLineNumber,t.originalStartColumn,t.originalEndLineNumber,t.originalEndColumn),new i(t.modifiedStartLineNumber,t.modifiedStartColumn,t.modifiedEndLineNumber,t.modifiedEndColumn))})}return e}(),b=function(){function e(e,t){this.id,this.diffView=e,this.type=t}return e.prototype.update=function(e,t,n,r){var a,o,s,c=this.diffView;
145this.type===-1?(a=`old`,o=`delete`,s=`insert`):(a=`new`,o=`insert`,s=`delete`);var l=c.$ignoreTrimWhitespace,u=c.chunks;if(n.lineWidgets&&!c.inlineDiffEditor)for(var d=r.firstRow;d<=r.lastRow;d++){var f=n.lineWidgets[d];if(!(!f||f.hidden)){var p=n.documentToScreenRow(d,0);if(f.rowsAbove>0){var m=new i(p-f.rowsAbove,0,p-1,Number.MAX_VALUE);t.drawFullLineMarker(e,m,`ace_diff aligned_diff`,r)}var h=p+f.rowCount-(f.rowsAbove||0),m=new i(p+1,0,h,Number.MAX_VALUE);t.drawFullLineMarker(e,m,`ace_diff aligned_diff`,r)}}u.forEach(function(c){var u=c[a].start.row,d=c[a].end.row;if(!(d<r.firstRow||u>r.lastRow)){var f=new i(u,0,d-1,1<<30);if(u!==d&&(f=f.toScreenRange(n),t.drawFullLineMarker(e,f,`ace_diff `+o,r)),c.charChanges)for(var p=0;p<c.charChanges.length;p++){var m=c.charChanges[p][a];if(m.end.column==0&&m.end.row>m.start.row&&m.end.row==c[a].end.row&&(m.end.row--,m.end.column=Number.MAX_VALUE),l)for(var h=m.start.row;h<=m.end.row;h++){var g=void 0,_=void 0,v=n.getLine(h).match(/^\s*/)[0].length,y=n.getLine(h).length;g=h===m.start.row?m.start.column:v,_=h===m.end.row?m.end.column:y;var b=new i(h,g,h,_),x=b.toScreenRange(n);if(!(v===g&&y===_)){var S=`inline `+o;b.isEmpty()&&g!==0&&(S=`inline `+s+` empty`),t.drawSingleLineMarker(e,x,`ace_diff `+S,r)}}else{var C=new i(m.start.row,m.start.column,m.end.row,m.end.column),x=C.toScreenRange(n),S=`inline `+o;C.isEmpty()&&m.start.column!==0&&(S=`inline empty `+s),x.isMultiLine()?t.drawTextMarker(e,x,`ace_diff `+S,r):t.drawSingleLineMarker(e,x,`ace_diff `+S,r)}}}})},e}(),x=function(){function e(){this.id,this.type=`fullLine`,this.clazz=`ace_diff-active-line`}return e.prototype.update=function(e,t,n,r){},e.prototype.setRange=function(e){var t=e.clone();t.end.column++,this.range=t},e}();t.DiffChunk=y,t.DiffHighlight=b}),ace.define(`ace/ext/diff/inline_diff_view`,[`require`,`exports`,`module`,`ace/ext/diff/base_diff_view`,`ace/virtual_renderer`,`ace/config`],function(e,t,n){var r=this&&this.__extends||(function(){var e=function(t,n){return e=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])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),i=e("./base_diff_view").BaseDiffView,a=e("../../virtual_renderer").VirtualRenderer,o=e("../../config");t.InlineDiffView=function(e){r(t,e);function t(t,n){var r=this;return t||={},t.inline=t.inline||`a`,r=e.call(this,!0,n)||this,r.init(t),r}return t.prototype.init=function(e){this.onSelect=this.onSelect.bind(this),this.onAfterRender=this.onAfterRender.bind(this),this.$setupModels(e),this.onChangeTheme(),o.resetOptions(this),o._signal(`diffView`,this);var t=this.activeEditor.renderer.$padding;this.addGutterDecorators(),this.otherEditor.renderer.setPadding(t),this.textLayer=this.otherEditor.renderer.$textLayer,this.markerLayer=this.otherEditor.renderer.$markerBack,this.gutterLayer=this.otherEditor.renderer.$gutterLayer,this.cursorLayer=this.otherEditor.renderer.$cursorLayer,this.otherEditor.renderer.$updateCachedSize=function(){};var n=this.activeEditor.renderer.$textLayer.element;n.parentNode.insertBefore(this.textLayer.element,n);var r=this.activeEditor.renderer.$markerBack.element;r.parentNode.insertBefore(this.markerLayer.element,r.nextSibling);var i=this.activeEditor.renderer.$gutterLayer.element;i.parentNode.insertBefore(this.gutterLayer.element,i.nextSibling),i.style.position=`absolute`,this.gutterLayer.element.style.position=`absolute`,this.gutterLayer.element.style.width=`100%`,this.gutterLayer.element.classList.add(`ace_mini-diff_gutter_other`),this.gutterLayer.$updateGutterWidth=function(){},this.initMouse(),this.initTextInput(),this.initTextLayer(),this.initRenderer(),this.$attachEventHandlers(),this.selectEditor(this.activeEditor)},t.prototype.initRenderer=function(e){var t=this;e?delete this.activeEditor.renderer.$getLongestLine:this.editorA.renderer.$getLongestLine=this.editorB.renderer.$getLongestLine=function(){var e=a.prototype.$getLongestLine;return Math.max(e.call(t.editorA.renderer),e.call(t.editorB.renderer))}},t.prototype.initTextLayer=function(){var e=this.textLayer.$renderLine,t=this;this.otherEditor.renderer.$textLayer.$renderLine=function(n,i,a){r(t.chunks,i)&&e.call(this,n,i,a)};var n=this.showSideA?`new`:`old`;function r(e,t){for(var r=0,i=e.length-1,a=-1;r<i;){var o=Math.floor((r+i)/2),s=e[o][n].start.row;if(s<t)a=o,r=o+1;else if(s>t)i=o-1;else{a=o;break}}e[a+1]&&e[a+1][n].start.row<=t&&a++;var c=e[a]&&e[a][n];return!!(c&&c.end.row>t)}},t.prototype.initTextInput=function(e){e?(this.otherEditor.textInput=this.othertextInput,this.otherEditor.container=this.otherEditorContainer):(this.othertextInput=this.otherEditor.textInput,this.otherEditor.textInput=this.activeEditor.textInput,this.otherEditorContainer=this.otherEditor.container,this.otherEditor.container=this.activeEditor.container)},t.prototype.selectEditor=function(e){e==this.activeEditor?(this.otherEditor.selection.clearSelection(),this.activeEditor.textInput.setHost(this.activeEditor),this.activeEditor.setStyle(`ace_diff_other`,!1),this.cursorLayer.element.remove(),this.activeEditor.renderer.$cursorLayer.element.style.display=`block`,this.showSideA&&(this.sessionA.removeMarker(this.syncSelectionMarkerA.id),this.sessionA.addDynamicMarker(this.syncSelectionMarkerA,!0)),this.markerLayer.element.classList.add(`ace_hidden_marker-layer`),this.activeEditor.renderer.$markerBack.element.classList.remove(`ace_hidden_marker-layer`),this.removeBracketHighlight(this.otherEditor)):(this.activeEditor.selection.clearSelection(),this.activeEditor.textInput.setHost(this.otherEditor),this.activeEditor.setStyle(`ace_diff_other`),this.activeEditor.renderer.$cursorLayer.element.parentNode.appendChild(this.cursorLayer.element),this.activeEditor.renderer.$cursorLayer.element.style.display=`none`,this.activeEditor.$isFocused&&this.otherEditor.onFocus(),this.showSideA&&this.sessionA.removeMarker(this.syncSelectionMarkerA.id),this.markerLayer.element.classList.remove(`ace_hidden_marker-layer`),this.activeEditor.renderer.$markerBack.element.classList.add(`ace_hidden_marker-layer`),this.removeBracketHighlight(this.activeEditor))},t.prototype.removeBracketHighlight=function(e){var t=e.session;t.$bracketHighlight&&=(t.$bracketHighlight.markerIds.forEach(function(e){t.removeMarker(e)}),null)},t.prototype.initMouse=function(){var e=this;this.otherEditor.renderer.$loop=this.activeEditor.renderer.$loop,this.otherEditor.renderer.scroller={getBoundingClientRect:function(){return e.activeEditor.renderer.scroller.getBoundingClientRect()},style:this.activeEditor.renderer.scroller.style};var t=function(t){if(t.domEvent){var n=t.editor.renderer.pixelToScreenCoordinates(t.clientX,t.clientY),r=e.activeEditor.session,i=e.otherEditor.session,a=r.screenToDocumentPosition(n.row,n.column,n.offsetX),o=i.screenToDocumentPosition(n.row,n.column,n.offsetX),s=r.documentToScreenPosition(a),c=i.documentToScreenPosition(o);t.editor==e.activeEditor&&(c.row==n.row&&s.row!=n.row?(t.type==`mousedown`&&e.selectEditor(e.otherEditor),t.propagationStopped=!0,t.defaultPrevented=!0,e.otherEditor.$mouseHandler.onMouseEvent(t.type,t.domEvent)):t.type==`mousedown`&&e.selectEditor(e.activeEditor))}},n=[`mousedown`,`click`,`mouseup`,`dblclick`,`tripleclick`,`quadclick`];
145n.forEach(function(n){e.activeEditor.on(n,t,!0),e.activeEditor.on(`gutter`+n,t,!0)});var r=function(t){e.activeEditor.onFocus(t)},i=function(t){e.activeEditor.onBlur(t)};this.otherEditor.on(`focus`,r),this.otherEditor.on(`blur`,i),this.onMouseDetach=function(){n.forEach(function(n){e.activeEditor.off(n,t,!0),e.activeEditor.off(`gutter`+n,t,!0)}),e.otherEditor.off(`focus`,r),e.otherEditor.off(`blur`,i)}},t.prototype.align=function(){var e=this;this.$initWidgets(e.editorA),this.$initWidgets(e.editorB),e.chunks.forEach(function(t){var n=e.$screenRow(t.old.end,e.sessionA)-e.$screenRow(t.old.start,e.sessionA),r=e.$screenRow(t.new.end,e.sessionB)-e.$screenRow(t.new.start,e.sessionB);e.$addWidget(e.sessionA,{rowCount:r,rowsAbove:t.old.end.row===0?r:0,row:t.old.end.row===0?0:t.old.end.row-1}),e.$addWidget(e.sessionB,{rowCount:n,rowsAbove:n,row:t.new.start.row})}),e.sessionA._emit(`changeFold`,{data:{start:{row:0}}}),e.sessionB._emit(`changeFold`,{data:{start:{row:0}}})},t.prototype.onChangeWrapLimit=function(e,t){this.otherSession.setOption(`wrap`,t.getOption(`wrap`)),this.otherSession.adjustWrapLimit(t.$wrapLimit),this.scheduleRealign(),this.activeEditor.renderer.updateFull()},t.prototype.$attachSessionsEventHandlers=function(){this.$attachSessionEventHandlers(this.editorA,this.markerA),this.$attachSessionEventHandlers(this.editorB,this.markerB);var e=this.activeEditor.session;e.on(`changeWrapLimit`,this.onChangeWrapLimit),e.on(`changeWrapMode`,this.onChangeWrapLimit)},t.prototype.$attachSessionEventHandlers=function(e,t){e.session.on(`changeFold`,this.onChangeFold),e.session.addDynamicMarker(t),e.selection.on(`changeCursor`,this.onSelect),e.selection.on(`changeSelection`,this.onSelect)},t.prototype.$detachSessionsEventHandlers=function(){this.$detachSessionHandlers(this.editorA,this.markerA),this.$detachSessionHandlers(this.editorB,this.markerB),this.otherSession.bgTokenizer.lines.fill(void 0);var e=this.activeEditor.session;e.off(`changeWrapLimit`,this.onChangeWrapLimit),e.off(`changeWrapMode`,this.onChangeWrapLimit)},t.prototype.$detachSessionHandlers=function(e,t){e.session.removeMarker(t.id),e.selection.off(`changeCursor`,this.onSelect),e.selection.off(`changeSelection`,this.onSelect),e.session.off(`changeFold`,this.onChangeFold)},t.prototype.$attachEventHandlers=function(){this.activeEditor.on(`input`,this.onInput),this.activeEditor.renderer.on(`afterRender`,this.onAfterRender),this.otherSession.on(`change`,this.onInput)},t.prototype.$detachEventHandlers=function(){this.$detachSessionsEventHandlers(),this.activeEditor.off(`input`,this.onInput),this.activeEditor.renderer.off(`afterRender`,this.onAfterRender),this.otherSession.off(`change`,this.onInput),this.textLayer.element.textContent=``,this.textLayer.element.remove(),this.gutterLayer.element.textContent=``,this.gutterLayer.element.remove(),this.markerLayer.element.textContent=``,this.markerLayer.element.remove(),this.onMouseDetach(),this.selectEditor(this.activeEditor),this.clearSelectionMarkers(),this.otherEditor.setSession(null),this.otherEditor.renderer.$loop=null,this.initTextInput(!0),this.initRenderer(!0),this.otherEditor.destroy()},t.prototype.onAfterRender=function(e,t){var n=t.layerConfig,r=this.otherSession,i=this.otherEditor.renderer;r.$scrollTop=t.scrollTop,r.$scrollLeft=t.scrollLeft,[`characterWidth`,`lineHeight`,`scrollTop`,`scrollLeft`,`scrollMargin`,`$padding`,`$size`,`layerConfig`,`$horizScroll`,`$vScroll`].forEach(function(e){i[e]=t[e]}),i.$computeLayerConfig();var a=i.layerConfig;this.gutterLayer.update(a),a.firstRowScreen=n.firstRowScreen,i.$cursorLayer.config=a,i.$cursorLayer.update(a),(e&i.CHANGE_LINES||e&i.CHANGE_FULL||e&i.CHANGE_SCROLL||e&i.CHANGE_TEXT)&&this.textLayer.update(a),this.markerLayer.setMarkers(this.otherSession.getMarkers()),this.markerLayer.update(a)},t.prototype.detach=function(){e.prototype.detach.call(this),this.otherEditor&&this.otherEditor.destroy()},t}(i)}),ace.define(`ace/ext/diff/split_diff_view`,[`require`,`exports`,`module`,`ace/ext/diff/base_diff_view`,`ace/config`],function(e,t,n){var r=this&&this.__extends||(function(){var e=function(t,n){return e=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])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);e(t,n);function r(){this.constructor=t}
145t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),i=e("./base_diff_view").BaseDiffView,a=e("../../config");t.SplitDiffView=function(e){r(t,e);function t(t){var n=this;return t||={},n=e.call(this)||this,n.init(t),n}return t.prototype.init=function(e){this.onChangeTheme=this.onChangeTheme.bind(this),this.onMouseWheel=this.onMouseWheel.bind(this),this.onScroll=this.onScroll.bind(this),this.$setupModels(e),this.addGutterDecorators(),this.onChangeTheme(),a.resetOptions(this),a._signal(`diffView`,this),this.$attachEventHandlers()},t.prototype.onChangeWrapLimit=function(){this.scheduleRealign()},t.prototype.align=function(){var e=this;this.$initWidgets(e.editorA),this.$initWidgets(e.editorB),e.chunks.forEach(function(t){var n=e.$screenRow(t.old.start,e.sessionA),r=e.$screenRow(t.new.start,e.sessionB);n<r?e.$addWidget(e.sessionA,{rowCount:r-n,rowsAbove:t.old.start.row===0?r-n:0,row:t.old.start.row===0?0:t.old.start.row-1}):n>r&&e.$addWidget(e.sessionB,{rowCount:n-r,rowsAbove:t.new.start.row===0?n-r:0,row:t.new.start.row===0?0:t.new.start.row-1});var n=e.$screenRow(t.old.end,e.sessionA),r=e.$screenRow(t.new.end,e.sessionB);n<r?e.$addWidget(e.sessionA,{rowCount:r-n,rowsAbove:t.old.end.row===0?r-n:0,row:t.old.end.row===0?0:t.old.end.row-1}):n>r&&e.$addWidget(e.sessionB,{rowCount:n-r,rowsAbove:t.new.end.row===0?n-r:0,row:t.new.end.row===0?0:t.new.end.row-1})}),e.sessionA._emit(`changeFold`,{data:{start:{row:0}}}),e.sessionB._emit(`changeFold`,{data:{start:{row:0}}})},t.prototype.onScroll=function(e,t){this.syncScroll(this.sessionA===t?this.editorA.renderer:this.editorB.renderer)},t.prototype.syncScroll=function(e){if(this.$syncScroll!=0){var t=this.editorA.renderer,n=this.editorB.renderer,r=e==t;if(!(t.$scrollAnimation&&n.$scrollAnimation)){var i=Date.now();if(!(this.scrollSetBy!=e&&i-this.scrollSetAt<500)){var a=r?t:n;if(this.scrollSetBy!=e&&(r&&this.scrollA==a.session.getScrollTop()||!r&&this.scrollB==a.session.getScrollTop()))return;var o=r?n:t,s=a.session.getScrollTop();this.$syncScroll=!1,r?(this.scrollA=a.session.getScrollTop(),this.scrollB=s):(this.scrollA=s,this.scrollB=a.session.getScrollTop()),this.scrollSetBy=e,o.session.setScrollTop(s),this.$syncScroll=!0,this.scrollSetAt=i}}}},t.prototype.onMouseWheel=function(e){if(!e.getAccelKey()){e.getShiftKey()&&e.wheelY&&!e.wheelX&&(e.wheelX=e.wheelY,e.wheelY=0);var t=e.editor;if(!t.renderer.isScrollableBy(e.wheelX*e.speed,e.wheelY*e.speed)){var n=t==this.editorA?this.editorB:this.editorA;return n.renderer.isScrollableBy(e.wheelX*e.speed,e.wheelY*e.speed)&&n.renderer.scrollBy(e.wheelX*e.speed,e.wheelY*e.speed),e.stop()}}},t.prototype.$attachSessionsEventHandlers=function(){this.$attachSessionEventHandlers(this.editorA,this.markerA),this.$attachSessionEventHandlers(this.editorB,this.markerB)},t.prototype.$attachSessionEventHandlers=function(e,t){e.session.on(`changeScrollTop`,this.onScroll),e.session.on(`changeFold`,this.onChangeFold),e.session.addDynamicMarker(t),e.selection.on(`changeCursor`,this.onSelect),e.selection.on(`changeSelection`,this.onSelect),e.session.on(`changeWrapLimit`,this.onChangeWrapLimit),e.session.on(`changeWrapMode`,this.onChangeWrapLimit)},t.prototype.$detachSessionsEventHandlers=function(){this.$detachSessionHandlers(this.editorA,this.markerA),this.$detachSessionHandlers(this.editorB,this.markerB)},t.prototype.$detachSessionHandlers=function(e,t){e.session.off(`changeScrollTop`,this.onScroll),e.session.off(`changeFold`,this.onChangeFold),e.session.removeMarker(t.id),e.selection.off(`changeCursor`,this.onSelect),e.selection.off(`changeSelection`,this.onSelect),e.session.off(`changeWrapLimit`,this.onChangeWrapLimit),e.session.off(`changeWrapMode`,this.onChangeWrapLimit)},t.prototype.$attachEventHandlers=function(){this.editorA.renderer.on(`themeChange`,this.onChangeTheme),this.editorB.renderer.on(`themeChange`,this.onChangeTheme),this.editorA.on(`mousewheel`,this.onMouseWheel),this.editorB.on(`mousewheel`,this.onMouseWheel),this.editorA.on(`input`,this.onInput),this.editorB.on(`input`,this.onInput)},t.prototype.$detachEventHandlers=function(){this.$detachSessionsEventHandlers(),this.clearSelectionMarkers(),this.editorA.renderer.off(`themeChange`,this.onChangeTheme),this.editorB.renderer.off(`themeChange`,this.onChangeTheme),this.$detachEditorEventHandlers(this.editorA),this.$detachEditorEventHandlers(this.editorB)},t.prototype.$detachEditorEventHandlers=function(e){e.off(`mousewheel`,this.onMouseWheel),e.off(`input`,this.onInput)},t}(i)}),ace.define(`ace/ext/diff/providers/default`,[`require`,`exports`,`module`,`ace/range`,`ace/ext/diff/base_diff_view`],function(e,t,n){var r=this&&this.__extends||(function(){var e=function(t,n){return e=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])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);e(t,n);function r(){this.constructor=t}
145t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),i=this&&this.__generator||function(e,t){var n={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},r,i,a,o=Object.create((typeof Iterator==`function`?Iterator:Object).prototype);return o.next=s(0),o.throw=s(1),o.return=s(2),typeof Symbol==`function`&&(o[Symbol.iterator]=function(){return this}),o;function s(e){return function(t){return c([e,t])}}function c(s){if(r)throw TypeError(`Generator is already executing.`);for(;o&&(o=0,s[0]&&(n=0)),n;)try{if(r=1,i&&(a=s[0]&2?i.return:s[0]?i.throw||((a=i.return)&&a.call(i),0):i.next)&&!(a=a.call(i,s[1])).done)return a;switch(i=0,a&&(s=[s[0]&2,a.value]),s[0]){case 0:case 1:a=s;break;case 4:return n.label++,{value:s[1],done:!1};case 5:n.label++,i=s[1],s=[0];continue;case 7:s=n.ops.pop(),n.trys.pop();continue;default:if((a=n.trys,!(a=a.length>0&&a[a.length-1]))&&(s[0]===6||s[0]===2)){n=0;continue}if(s[0]===3&&(!a||s[1]>a[0]&&s[1]<a[3])){n.label=s[1];break}if(s[0]===6&&n.label<a[1]){n.label=a[1],a=s;break}if(a&&n.label<a[2]){n.label=a[2],n.ops.push(s);break}a[2]&&n.ops.pop(),n.trys.pop();continue}s=t.call(e,n)}catch(e){s=[6,e],i=0}finally{r=a=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}},a=this&&this.__values||function(e){var t=typeof Symbol==`function`&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length==`number`)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw TypeError(t?`Object is not iterable.`:`Symbol.iterator is not defined.`)},o,s,c,l,u,d;function f(e,t,n){if(n===void 0&&(n=function(e,t){return e===t}),e===t)return!0;if(!e||!t||e.length!==t.length)return!1;for(var r=0,i=e.length;r<i;r++)if(!n(e[r],t[r]))return!1;return!0}function p(e,t){var n,r,o,s,c,l,u,d;return i(this,function(i){switch(i.label){case 0:i.trys.push([0,8,9,10]),o=a(e),s=o.next(),i.label=1;case 1:return s.done?[3,7]:(c=s.value,r!==void 0&&t(r,c)?(n.push(c),[3,5]):[3,2]);case 2:return n?[4,n]:[3,4];case 3:i.sent(),i.label=4;case 4:n=[c],i.label=5;case 5:r=c,i.label=6;case 6:return s=o.next(),[3,1];case 7:return[3,10];case 8:return l=i.sent(),u={error:l},[3,10];case 9:try{s&&!s.done&&(d=o.return)&&d.call(o)}finally{if(u)throw u.error}return[7];case 10:return n?[4,n]:[3,12];case 11:i.sent(),i.label=12;case 12:return[2]}})}function m(e,t){for(var n=0;n<=e.length;n++)t(n===0?void 0:e[n-1],n===e.length?void 0:e[n])}function h(e,t){for(var n=0;n<e.length;n++)t(n===0?void 0:e[n-1],e[n],n+1===e.length?void 0:e[n+1])}function g(e,t){var n,r;try{for(var i=a(t),o=i.next();!o.done;o=i.next()){var s=o.value;e.push(s)}}catch(e){n={error:e}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}}function _(e,t){return function(n,r){return t(e(n),e(r))}}var v=function(e,t){return e-t};function y(e){return function(t,n){return-e(t,n)}}var b=function(e){r(t,e);function t(n){var r=e.call(this,n||`An unexpected bug occurred.`)||this;return Object.setPrototypeOf(r,t.prototype),r}return t}(Error);function x(e,t){if(t===void 0&&(t=`unexpected state`),!e)throw new b(`Assertion Failed: ${t}`)}function S(e){e()}function C(e,t){for(var n=0;n<e.length-1;){var r=e[n],i=e[n+1];if(!t(r,i))return!1;n++}return!0}var w=function(){function e(e,t){if(this.start=e,this.endExclusive=t,e>t)throw new b(`Invalid range: ${this.toString()}`)}return e.fromTo=function(t,n){return new e(t,n)},e.addRange=function(t,n){for(var r=0;r<n.length&&n[r].endExclusive<t.start;)r++;for(var i=r;i<n.length&&n[i].start<=t.endExclusive;)i++;if(r===i)n.splice(r,0,t);else{var a=Math.min(t.start,n[r].start),o=Math.max(t.endExclusive,n[i-1].endExclusive);n.splice(r,i-r,new e(a,o))}},e.tryCreate=function(t,n){if(!(t>n))return new e(t,n)},e.ofLength=function(t){return new e(0,t)},e.ofStartAndLength=function(t,n){return new e(t,t+n)},e.emptyAt=function(t){return new e(t,t)},Object.defineProperty(e.prototype,"isEmpty",{get:function(){return this.start===this.endExclusive},enumerable:!1,configurable:!0}),e.prototype.delta=function(t){return new e(this.start+t,this.endExclusive+t)},e.prototype.deltaStart=function(t){return new e(this.start+t,this.endExclusive)},e.prototype.deltaEnd=function(t){return new e(this.start,this.endExclusive+t)},Object.defineProperty(e.prototype,"length",{get:function(){return this.endExclusive-this.start}
145,enumerable:!1,configurable:!0}),e.prototype.toString=function(){return`[${this.start}, ${this.endExclusive})`},e.prototype.equals=function(e){return this.start===e.start&&this.endExclusive===e.endExclusive},e.prototype.containsRange=function(e){return this.start<=e.start&&e.endExclusive<=this.endExclusive},e.prototype.contains=function(e){return this.start<=e&&e<this.endExclusive},e.prototype.join=function(t){return new e(Math.min(this.start,t.start),Math.max(this.endExclusive,t.endExclusive))},e.prototype.intersect=function(t){var n=Math.max(this.start,t.start),r=Math.min(this.endExclusive,t.endExclusive);if(n<=r)return new e(n,r)},e.prototype.intersectionLength=function(e){var t=Math.max(this.start,e.start),n=Math.min(this.endExclusive,e.endExclusive);return Math.max(0,n-t)},e.prototype.intersects=function(e){return Math.max(this.start,e.start)<Math.min(this.endExclusive,e.endExclusive)},e.prototype.intersectsOrTouches=function(e){return Math.max(this.start,e.start)<=Math.min(this.endExclusive,e.endExclusive)},e.prototype.isBefore=function(e){return this.endExclusive<=e.start},e.prototype.isAfter=function(e){return this.start>=e.endExclusive},e.prototype.slice=function(e){return e.slice(this.start,this.endExclusive)},e.prototype.substring=function(e){return e.substring(this.start,this.endExclusive)},e.prototype.clip=function(e){if(this.isEmpty)throw new b(`Invalid clipping range: ${this.toString()}`);return Math.max(this.start,Math.min(this.endExclusive-1,e))},e.prototype.clipCyclic=function(e){if(this.isEmpty)throw new b(`Invalid clipping range: ${this.toString()}`);return e<this.start?this.endExclusive-(this.start-e)%this.length:e>=this.endExclusive?this.start+(e-this.start)%this.length:e},e.prototype.map=function(e){for(var t=[],n=this.start;n<this.endExclusive;n++)t.push(e(n));return t},e.prototype.forEach=function(e){for(var t=this.start;t<this.endExclusive;t++)e(t)},e}(),T=function(){function e(e,t){this.lineNumber=e,this.column=t}return e.prototype.equals=function(t){return e.equals(this,t)},e.equals=function(e,t){return!e&&!t?!0:!!e&&!!t&&e.lineNumber===t.lineNumber&&e.column===t.column},e.prototype.isBefore=function(t){return e.isBefore(this,t)},e.isBefore=function(e,t){return e.lineNumber<t.lineNumber?!0:t.lineNumber<e.lineNumber?!1:e.column<t.column},e.prototype.isBeforeOrEqual=function(t){return e.isBeforeOrEqual(this,t)},e.isBeforeOrEqual=function(e,t){return e.lineNumber<t.lineNumber?!0:t.lineNumber<e.lineNumber?!1:e.column<=t.column},e}(),E=function(){function e(e,t,n,r){e>n||e===n&&t>r?(this.startLineNumber=n,this.startColumn=r,this.endLineNumber=e,this.endColumn=t):(this.startLineNumber=e,this.startColumn=t,this.endLineNumber=n,this.endColumn=r)}return e.prototype.isEmpty=function(){return e.isEmpty(this)},e.isEmpty=function(e){return e.startLineNumber===e.endLineNumber&&e.startColumn===e.endColumn},e.prototype.containsPosition=function(t){return e.containsPosition(this,t)},e.containsPosition=function(e,t){return!(t.lineNumber<e.startLineNumber||t.lineNumber>e.endLineNumber||t.lineNumber===e.startLineNumber&&t.column<e.startColumn||t.lineNumber===e.endLineNumber&&t.column>e.endColumn)},e.prototype.containsRange=function(t){return e.containsRange(this,t)},e.containsRange=function(e,t){return!(t.startLineNumber<e.startLineNumber||t.endLineNumber<e.startLineNumber||t.startLineNumber>e.endLineNumber||t.endLineNumber>e.endLineNumber||t.startLineNumber===e.startLineNumber&&t.startColumn<e.startColumn||t.endLineNumber===e.endLineNumber&&t.endColumn>e.endColumn)},e.prototype.strictContainsRange=function(t){return e.strictContainsRange(this,t)},e.strictContainsRange=function(e,t){return!(t.startLineNumber<e.startLineNumber||t.endLineNumber<e.startLineNumber||t.startLineNumber>e.endLineNumber||t.endLineNumber>e.endLineNumber||t.startLineNumber===e.startLineNumber&&t.startColumn<=e.startColumn||t.endLineNumber===e.endLineNumber&&t.endColumn>=e.endColumn)},e.prototype.plusRange=function(t){return e.plusRange(this,t)},e.plusRange=function(t,n){var r,i,a,o;return n.startLineNumber<t.startLineNumber?(r=n.startLineNumber,i=n.startColumn):n.startLineNumber===t.startLineNumber?(r=n.startLineNumber,i=Math.min(n.startColumn,t.startColumn)):(r=t.startLineNumber,i=t.startColumn),n.endLineNumber>t.endLineNumber?(a=n.endLineNumber,o=n.endColumn):n.endLineNumber===t.endLineNumber?(a=n.endLineNumber,o=Math.max(n.endColumn,t.endColumn)):(a=t.endLineNumber,o=t.endColumn),new e(r,i,a,o)},e.prototype.intersectRanges=function(t){return e.intersectRanges(this,t)},e.intersectRanges=function(t,n){var r=t.startLineNumber,i=t.startColumn,a=t.endLineNumber,o=t.endColumn,s=n.startLineNumber,c=n.startColumn,l=n.endLineNumber,u=n.endColumn;return r<s?(r=s,i=c):r===s&&(i=Math.max(i,c)),a>l?(a=l,o=u):a===l&&(o=Math.min(o,u)),r>a||r===a&&i>o?null:new e(r,i,a,o)},e.prototype.equalsRange=function(t){return e.equalsRange(this,t)},e.equalsRange=function(e,t){return!e&&!t?!0:!!e&&!!t&&e.startLineNumber===t.startLineNumber&&e.startColumn===t.startColumn&&e.endLineNumber===t.endLineNumber&&e.endColumn===t.endColumn},e.prototype.getEndPosition=function(){return e.getEndPosition(this)},e.getEndPosition=function(e){return new T(e.endLineNumber,e.endColumn)},e.prototype.getStartPosition=function(){return e.getStartPosition(this)},e.getStartPosition=function(e){return new T(e.startLineNumber,e.startColumn)},e.prototype.collapseToStart=function(){return e.collapseToStart(this)},e.collapseToStart=function(t){return new e(t.startLineNumber,t.startColumn,t.startLineNumber,t.startColumn)},e.prototype.collapseToEnd=function(){return e.collapseToEnd(this)},e.collapseToEnd=function(t){return new e(t.endLineNumber,t.endColumn,t.endLineNumber,t.endColumn)},e.fromPositions=function(t,n){return n===void 0&&(n=t),new e(t.lineNumber,t.column,n.lineNumber,n.column)},e}();function D(e,t){var n=O(e,t);return n===-1?void 0:e[n]}function O(e,t,n,r){n===void 0&&(n=0),r===void 0&&(r=e.length);for(var i=n,a=r;i<a;){var o=Math.floor((i+a)/2);t(e[o])?i=o+1:a=o}return i-1}function k(e,t){var n=A(e,t);return n===e.length?void 0:e[n]}function A(e,t,n,r){n===void 0&&(n=0),r===void 0&&(r=e.length);for(var i=n,a=r;i<a;){var o=Math.floor((i+a)/2);t(e[o])?a=o:i=o+1}return i}var j=function(){function e(e){this._array=e,this._findLastMonotonousLastIdx=0}return e.prototype.findLastMonotonous=function(e){var t,n;if(s.assertInvariants){if(this._prevFindLastPredicate)try{for(var r=a(this._array),i=r.next();!i.done;i=r.next()){var o=i.value;if(this._prevFindLastPredicate(o)&&!e(o))throw Error(`MonotonousArray: current predicate must be weaker than (or equal to) the previous predicate.`)}}catch(e){t={error:e}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(t)throw t.error}}this._prevFindLastPredicate=e}var c=O(this._array,e,this._findLastMonotonousLastIdx);return this._findLastMonotonousLastIdx=c+1,c===-1?void 0:this._array[c]},e}();s=j,(function(){s.assertInvariants=!1})();var M=function(){function e(e,t){if(e>t)throw new b(`startLineNumber ${e} cannot be after endLineNumberExclusive ${t}`);this.startLineNumber=e,this.endLineNumberExclusive=t}return e.fromRangeInclusive=function(t){return new e(t.startLineNumber,t.endLineNumber+1)},e.join=function(t){if(t.length===0)throw new b(`lineRanges cannot be empty`);for(var n=t[0].startLineNumber,r=t[0].endLineNumberExclusive,i=1;i<t.length;i++)n=Math.min(n,t[i].startLineNumber),r=Math.max(r,t[i].endLineNumberExclusive);return new e(n,r)},e.ofLength=function(t,n){return new e(t,t+n)},Object.defineProperty(e.prototype,"isEmpty",{get:function(){return this.startLineNumber===this.endLineNumberExclusive}
145,enumerable:!1,configurable:!0}),e.prototype.delta=function(t){return new e(this.startLineNumber+t,this.endLineNumberExclusive+t)},Object.defineProperty(e.prototype,"length",{get:function(){return this.endLineNumberExclusive-this.startLineNumber},enumerable:!1,configurable:!0}),e.prototype.join=function(t){return new e(Math.min(this.startLineNumber,t.startLineNumber),Math.max(this.endLineNumberExclusive,t.endLineNumberExclusive))},e.prototype.intersect=function(t){var n=Math.max(this.startLineNumber,t.startLineNumber),r=Math.min(this.endLineNumberExclusive,t.endLineNumberExclusive);if(n<=r)return new e(n,r)},e.prototype.overlapOrTouch=function(e){return this.startLineNumber<=e.endLineNumberExclusive&&e.startLineNumber<=this.endLineNumberExclusive},e.prototype.toInclusiveRange=function(){return this.isEmpty?null:new E(this.startLineNumber,1,this.endLineNumberExclusive-1,2**53-1)},e.prototype.toOffsetRange=function(){return new w(this.startLineNumber-1,this.endLineNumberExclusive-1)},e}(),N=function(){function e(e){e===void 0&&(e=[]),this._normalizedRanges=e}return Object.defineProperty(e.prototype,"ranges",{get:function(){return this._normalizedRanges},enumerable:!1,configurable:!0}),e.prototype.addRange=function(e){if(e.length!==0){var t=A(this._normalizedRanges,function(t){return t.endLineNumberExclusive>=e.startLineNumber}),n=O(this._normalizedRanges,function(t){return t.startLineNumber<=e.endLineNumberExclusive})+1;if(t===n)this._normalizedRanges.splice(t,0,e);else if(t===n-1){var r=this._normalizedRanges[t];this._normalizedRanges[t]=r.join(e)}else{var r=this._normalizedRanges[t].join(this._normalizedRanges[n-1]).join(e);this._normalizedRanges.splice(t,n-t,r)}}},e.prototype.contains=function(e){var t=D(this._normalizedRanges,function(t){return t.startLineNumber<=e});return!!t&&t.endLineNumberExclusive>e},e.prototype.subtractFrom=function(t){var n=A(this._normalizedRanges,function(e){return e.endLineNumberExclusive>=t.startLineNumber}),r=O(this._normalizedRanges,function(e){return e.startLineNumber<=t.endLineNumberExclusive})+1;if(n===r)return new e([t]);for(var i=[],a=t.startLineNumber,o=n;o<r;o++){var s=this._normalizedRanges[o];s.startLineNumber>a&&i.push(new M(a,s.startLineNumber)),a=s.endLineNumberExclusive}return a<t.endLineNumberExclusive&&i.push(new M(a,t.endLineNumberExclusive)),new e(i)},e.prototype.getIntersection=function(t){for(var n=[],r=0,i=0;r<this._normalizedRanges.length&&i<t._normalizedRanges.length;){var a=this._normalizedRanges[r],o=t._normalizedRanges[i],s=a.intersect(o);s&&!s.isEmpty&&n.push(s),a.endLineNumberExclusive<o.endLineNumberExclusive?r++:i++}return new e(n)},e.prototype.getWithDelta=function(t){return new e(this._normalizedRanges.map(function(e){return e.delta(t)}))},e}(),P=function(){function e(e,t){this.lineCount=e,this.columnCount=t}return e.prototype.toLineRange=function(){return M.ofLength(1,this.lineCount)},e.prototype.addToPosition=function(e){return this.lineCount===0?new T(e.lineNumber,e.column+this.columnCount):new T(e.lineNumber+this.lineCount,this.columnCount+1)},e}();c=P,(function(){c.zero=new c(0,0)})();var F=function(e){r(t,e);function t(t){return e.call(this,function(e){return t[e-1]},t.length)||this}return t}(function(){function e(e,t){x(t>=1),this._getLineContent=e,this._lineCount=t}return e.prototype.getValueOfRange=function(e){if(e.startLineNumber===e.endLineNumber)return this._getLineContent(e.startLineNumber).substring(e.startColumn-1,e.endColumn-1);for(var t=this._getLineContent(e.startLineNumber).substring(e.startColumn-1),n=e.startLineNumber+1;n<e.endLineNumber;n++)t+=` 146`+this._getLineContent(n);return t+=` 147`+this._getLineContent(e.endLineNumber).substring(0,e.endColumn-1),t},e.prototype.getLineLength=function(e){return this._getLineContent(e).length},Object.defineProperty(e.prototype,"length",{get:function(){var e=this._getLineContent(this._lineCount);return new P(this._lineCount-1,e.length)},enumerable:!1,configurable:!0}),e}()),I=function(){function e(e,t,n){this.changes=e,this.moves=t,this.hitTimeout=n}return e}(),L=function(){function e(e,t){this.lineRangeMapping=e,this.changes=t}return e}(),R=function(){function e(e,t){this.original=e,this.modified=t}return e.prototype.join=function(t){return new e(this.original.join(t.original),this.modified.join(t.modified))},Object.defineProperty(e.prototype,"changedLineCount",{get:function(){return Math.max(this.original.length,this.modified.length)}
147,enumerable:!1,configurable:!0}),e.prototype.toRangeMapping=function(){var e=this.original.toInclusiveRange(),t=this.modified.toInclusiveRange();if(e&&t)return new H(e,t);if(this.original.startLineNumber===1||this.modified.startLineNumber===1){if(!(this.modified.startLineNumber===1&&this.original.startLineNumber===1))throw new b(`not a valid diff`);return new H(new E(this.original.startLineNumber,1,this.original.endLineNumberExclusive,1),new E(this.modified.startLineNumber,1,this.modified.endLineNumberExclusive,1))}else return new H(new E(this.original.startLineNumber-1,2**53-1,this.original.endLineNumberExclusive-1,2**53-1),new E(this.modified.startLineNumber-1,2**53-1,this.modified.endLineNumberExclusive-1,2**53-1))},e.prototype.toRangeMapping2=function(e,t){if(B(this.original.endLineNumberExclusive,e)&&B(this.modified.endLineNumberExclusive,t))return new H(new E(this.original.startLineNumber,1,this.original.endLineNumberExclusive,1),new E(this.modified.startLineNumber,1,this.modified.endLineNumberExclusive,1));if(!this.original.isEmpty&&!this.modified.isEmpty)return new H(E.fromPositions(new T(this.original.startLineNumber,1),z(new T(this.original.endLineNumberExclusive-1,2**53-1),e)),E.fromPositions(new T(this.modified.startLineNumber,1),z(new T(this.modified.endLineNumberExclusive-1,2**53-1),t)));if(this.original.startLineNumber>1&&this.modified.startLineNumber>1)return new H(E.fromPositions(z(new T(this.original.startLineNumber-1,2**53-1),e),z(new T(this.original.endLineNumberExclusive-1,2**53-1),e)),E.fromPositions(z(new T(this.modified.startLineNumber-1,2**53-1),t),z(new T(this.modified.endLineNumberExclusive-1,2**53-1),t)));throw new b},e}();function z(e,t){if(e.lineNumber<1)return new T(1,1);if(e.lineNumber>t.length)return new T(t.length,t[t.length-1].length+1);var n=t[e.lineNumber-1];return e.column>n.length+1?new T(e.lineNumber,n.length+1):e}function B(e,t){return e>=1&&e<=t.length}var V=function(e){r(t,e);function t(t,n,r){var i=e.call(this,t,n)||this;return i.innerChanges=r,i}return t.fromRangeMappings=function(e){return new t(M.join(e.map(function(e){return M.fromRangeInclusive(e.originalRange)})),M.join(e.map(function(e){return M.fromRangeInclusive(e.modifiedRange)})),e)},t.prototype.flip=function(){return new t(this.modified,this.original,this.innerChanges?.map(function(e){return e.flip()}))},t.prototype.withInnerChangesFromLineRanges=function(){return new t(this.original,this.modified,[this.toRangeMapping()])},t}(R),H=function(){function e(e,t){this.originalRange=e,this.modifiedRange=t}return e.join=function(e){if(e.length===0)throw new b(`Cannot join an empty list of range mappings`);for(var t=e[0],n=1;n<e.length;n++)t=t.join(e[n]);return t},e.assertSorted=function(e){for(var t=1;t<e.length;t++){var n=e[t-1],r=e[t];if(!(n.originalRange.getEndPosition().isBeforeOrEqual(r.originalRange.getStartPosition())&&n.modifiedRange.getEndPosition().isBeforeOrEqual(r.modifiedRange.getStartPosition())))throw new b(`Range mappings must be sorted`)}},e.prototype.flip=function(){return new e(this.modifiedRange,this.originalRange)},e.prototype.join=function(t){return new e(this.originalRange.plusRange(t.originalRange),this.modifiedRange.plusRange(t.modifiedRange))},e}();function U(e,t,n,r){var i,o;r===void 0&&(r=!1);var s=[];try{for(var c=a(p(e.map(function(e){return W(e,t,n)}),function(e,t){return e.original.overlapOrTouch(t.original)||e.modified.overlapOrTouch(t.modified)})),l=c.next();!l.done;l=c.next()){var u=l.value,d=u[0],f=u[u.length-1];s.push(new V(d.original.join(f.original),d.modified.join(f.modified),u.map(function(e){return e.innerChanges[0]})))}}catch(e){i={error:e}}finally{try{l&&!l.done&&(o=c.return)&&o.call(c)}finally{if(i)throw i.error}}return S(function(){return!r&&s.length>0&&(s[0].modified.startLineNumber!==s[0].original.startLineNumber||n.length.lineCount-s[s.length-1].modified.endLineNumberExclusive!==t.length.lineCount-s[s.length-1].original.endLineNumberExclusive)?!1:C(s,function(e,t){return t.original.startLineNumber-e.original.endLineNumberExclusive===t.modified.startLineNumber-e.modified.endLineNumberExclusive&&e.original.endLineNumberExclusive<t.original.startLineNumber&&e.modified.endLineNumberExclusive<t.modified.startLineNumber})}),s}function W(e,t,n){var r=0,i=0;return e.modifiedRange.endColumn===1&&e.originalRange.endColumn===1&&e.originalRange.startLineNumber+r<=e.originalRange.endLineNumber&&e.modifiedRange.startLineNumber+r<=e.modifiedRange.endLineNumber&&(i=-1),e.modifiedRange.startColumn-1>=n.getLineLength(e.modifiedRange.startLineNumber)&&e.originalRange.startColumn-1>=t.getLineLength(e.originalRange.startLineNumber)&&e.originalRange.startLineNumber<=e.originalRange.endLineNumber+i&&e.modifiedRange.startLineNumber<=e.modifiedRange.endLineNumber+i&&(r=1),new V(new M(e.originalRange.startLineNumber+r,e.originalRange.endLineNumber+1+i),new M(e.modifiedRange.startLineNumber+r,e.modifiedRange.endLineNumber+1+i),[e])}var G=function(){function e(e,t){this.diffs=e,this.hitTimeout=t}
147return e.trivial=function(t,n){return new e([new K(w.ofLength(t.length),w.ofLength(n.length))],!1)},e.trivialTimedOut=function(t,n){return new e([new K(w.ofLength(t.length),w.ofLength(n.length))],!0)},e}(),K=function(){function e(e,t){this.seq1Range=e,this.seq2Range=t}return e.invert=function(t,n){var r=[];return m(t,function(t,i){r.push(e.fromOffsetPairs(t?t.getEndExclusives():q.zero,i?i.getStarts():new q(n,(t?t.seq2Range.endExclusive-t.seq1Range.endExclusive:0)+n)))}),r},e.fromOffsetPairs=function(t,n){return new e(new w(t.offset1,n.offset1),new w(t.offset2,n.offset2))},e.assertSorted=function(e){var t,n,r=void 0;try{for(var i=a(e),o=i.next();!o.done;o=i.next()){var s=o.value;if(r&&!(r.seq1Range.endExclusive<=s.seq1Range.start&&r.seq2Range.endExclusive<=s.seq2Range.start))throw new b(`Sequence diffs must be sorted`);r=s}}catch(e){t={error:e}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(t)throw t.error}}},e.prototype.swap=function(){return new e(this.seq2Range,this.seq1Range)},e.prototype.join=function(t){return new e(this.seq1Range.join(t.seq1Range),this.seq2Range.join(t.seq2Range))},e.prototype.delta=function(t){return t===0?this:new e(this.seq1Range.delta(t),this.seq2Range.delta(t))},e.prototype.deltaStart=function(t){return t===0?this:new e(this.seq1Range.deltaStart(t),this.seq2Range.deltaStart(t))},e.prototype.deltaEnd=function(t){return t===0?this:new e(this.seq1Range.deltaEnd(t),this.seq2Range.deltaEnd(t))},e.prototype.intersect=function(t){var n=this.seq1Range.intersect(t.seq1Range),r=this.seq2Range.intersect(t.seq2Range);if(!(!n||!r))return new e(n,r)},e.prototype.getStarts=function(){return new q(this.seq1Range.start,this.seq2Range.start)},e.prototype.getEndExclusives=function(){return new q(this.seq1Range.endExclusive,this.seq2Range.endExclusive)},e}(),q=function(){function e(e,t){this.offset1=e,this.offset2=t}return e.prototype.delta=function(e){return e===0?this:new l(this.offset1+e,this.offset2+e)},e.prototype.equals=function(e){return this.offset1===e.offset1&&this.offset2===e.offset2},e}();l=q,(function(){l.zero=new l(0,0)})(),(function(){l.max=new l(2**53-1,2**53-1)})();var J=function(){function e(){}return e.prototype.isValid=function(){return!0},e}();u=J,(function(){u.instance=new u})();var Y=function(){function e(e){if(this.timeout=e,this.startTime=Date.now(),this.valid=!0,e<=0)throw new b(`timeout must be positive`)}return e.prototype.isValid=function(){return!(Date.now()-this.startTime<this.timeout)&&this.valid&&(this.valid=!1),this.valid},e.prototype.disable=function(){this.timeout=2**53-1,this.isValid=function(){return!0},this.valid=!0},e}(),X=function(){function e(e,t){this.width=e,this.height=t,this.array=[],this.array=Array(e*t)}return e.prototype.get=function(e,t){return this.array[e+t*this.width]},e.prototype.set=function(e,t,n){this.array[e+t*this.width]=n},e}();function Z(e){return e===32||e===9}var ee=function(){function e(e,t,n){this.range=e,this.lines=t,this.source=n,this.histogram=[];for(var r=0,i=e.startLineNumber-1;i<e.endLineNumberExclusive-1;i++){for(var a=t[i],o=0;o<a.length;o++){r++;var s=a[o],c=d.getKey(s);this.histogram[c]=(this.histogram[c]||0)+1}r++;var l=d.getKey(` 148`);this.histogram[l]=(this.histogram[l]||0)+1}this.totalCount=r}return e.getKey=function(e){var t=this.chrKeys.get(e);return t===void 0&&(t=this.chrKeys.size,this.chrKeys.set(e,t)),t},e.prototype.computeSimilarity=function(e){for(var t=0,n=Math.max(this.histogram.length,e.histogram.length),r=0;r<n;r++)t+=Math.abs((this.histogram[r]??0)-(e.histogram[r]??0));return 1-t/(this.totalCount+e.totalCount)},e}();d=ee,(function(){d.chrKeys=new Map})();var te=function(){function e(){}return e.prototype.compute=function(e,t,n,r){if(n===void 0&&(n=J.instance),e.length===0||t.length===0)return G.trivial(e,t);for(var i=new X(e.length,t.length),a=new X(e.length,t.length),o=new X(e.length,t.length),s=0;s<e.length;s++)for(var c=0;c<t.length;c++){if(!n.isValid())return G.trivialTimedOut(e,t);var l=s===0?0:i.get(s-1,c),u=c===0?0:i.get(s,c-1),d=void 0;e.getElement(s)===t.getElement(c)?(d=s===0||c===0?0:i.get(s-1,c-1),s>0&&c>0&&a.get(s-1,c-1)===3&&(d+=o.get(s-1,c-1)),d+=r?r(s,c):1):d=-1;var f=Math.max(l,u,d);if(f===d){var p=s>0&&c>0?o.get(s-1,c-1):0;o.set(s,c,p+1),a.set(s,c,3)}
148else f===l?(o.set(s,c,0),a.set(s,c,1)):f===u&&(o.set(s,c,0),a.set(s,c,2));i.set(s,c,f)}var m=[],h=e.length,g=t.length;function _(e,t){(e+1!==h||t+1!==g)&&m.push(new K(new w(e+1,h),new w(t+1,g))),h=e,g=t}for(var v=e.length-1,y=t.length-1;v>=0&&y>=0;)a.get(v,y)===3?(_(v,y),v--,y--):a.get(v,y)===1?v--:y--;return _(-1,-1),m.reverse(),new G(m,!1)},e}(),ne=function(){function e(){}return e.prototype.compute=function(e,t,n){if(n===void 0&&(n=J.instance),e.length===0||t.length===0)return G.trivial(e,t);var r=e,i=t;function a(e,t){for(;e<r.length&&t<i.length&&r.getElement(e)===i.getElement(t);)e++,t++;return e}var o=0,s=new ie;s.set(0,a(0,0));var c=new ae;c.set(0,s.get(0)===0?null:new re(null,0,0,s.get(0)));var l=0;loop:for(;;){if(o++,!n.isValid())return G.trivialTimedOut(r,i);var u=-Math.min(o,i.length+o%2),d=Math.min(o,r.length+o%2);for(l=u;l<=d;l+=2){var f=l===d?-1:s.get(l+1),p=l===u?-1:s.get(l-1)+1,m=Math.min(Math.max(f,p),r.length),h=m-l;if(!(m>r.length||h>i.length)){var g=a(m,h);s.set(l,g);var _=m===f?c.get(l+1):c.get(l-1);if(c.set(l,g===m?_:new re(_,m,h,g-m)),s.get(l)===r.length&&s.get(l)-l===i.length)break loop}}}for(var v=c.get(l),y=[],b=r.length,x=i.length;;){var S=v?v.x+v.length:0,C=v?v.y+v.length:0;if((S!==b||C!==x)&&y.push(new K(new w(S,b),new w(C,x))),!v)break;b=v.x,x=v.y,v=v.prev}return y.reverse(),new G(y,!1)},e}(),re=function(){function e(e,t,n,r){this.prev=e,this.x=t,this.y=n,this.length=r}return e}(),ie=function(){function e(){this.positiveArr=new Int32Array(10),this.negativeArr=new Int32Array(10)}return e.prototype.get=function(e){return e<0?(e=-e-1,this.negativeArr[e]):this.positiveArr[e]},e.prototype.set=function(e,t){if(e<0){if(e=-e-1,e>=this.negativeArr.length){var n=this.negativeArr;this.negativeArr=new Int32Array(n.length*2),this.negativeArr.set(n)}this.negativeArr[e]=t}else{if(e>=this.positiveArr.length){var n=this.positiveArr;this.positiveArr=new Int32Array(n.length*2),this.positiveArr.set(n)}this.positiveArr[e]=t}},e}(),ae=function(){function e(){this.positiveArr=[],this.negativeArr=[]}return e.prototype.get=function(e){return e<0?(e=-e-1,this.negativeArr[e]):this.positiveArr[e]},e.prototype.set=function(e,t){e<0?(e=-e-1,this.negativeArr[e]=t):this.positiveArr[e]=t},e}(),oe=function(){function e(){this.map=new Map}return e.prototype.add=function(e,t){var n=this.map.get(e);n||(n=new Set,this.map.set(e,n)),n.add(t)},e.prototype.forEach=function(e,t){var n=this.map.get(e);n&&n.forEach(t)},e.prototype.get=function(e){return this.map.get(e)||new Set},e}(),Q=function(){function e(e,t,n){this.lines=e,this.range=t,this.considerWhitespaceChanges=n,this.elements=[],this.firstElementOffsetByLineIdx=[],this.lineStartOffsets=[],this.trimmedWsLengthsByLineIdx=[],this.firstElementOffsetByLineIdx.push(0);for(var r=this.range.startLineNumber;r<=this.range.endLineNumber;r++){var i=e[r-1],a=0;r===this.range.startLineNumber&&this.range.startColumn>1&&(a=this.range.startColumn-1,i=i.substring(a)),this.lineStartOffsets.push(a);var o=0;if(!n){var s=i.trimStart();o=i.length-s.length,i=s.trimEnd()}this.trimmedWsLengthsByLineIdx.push(o);for(var c=r===this.range.endLineNumber?Math.min(this.range.endColumn-1-a-o,i.length):i.length,l=0;l<c;l++)this.elements.push(i.charCodeAt(l));r<this.range.endLineNumber&&(this.elements.push(10),this.firstElementOffsetByLineIdx.push(this.elements.length))}}return e.prototype.toString=function(){return`Slice: "${this.text}"`},Object.defineProperty(e.prototype,"text",{get:function(){return this.getText(new w(0,this.length))},enumerable:!1,configurable:!0}),e.prototype.getText=function(e){return this.elements.slice(e.start,e.endExclusive).map(function(e){return String.fromCharCode(e)}).join(``)},e.prototype.getElement=function(e){return this.elements[e]},Object.defineProperty(e.prototype,"length",{get:function(){return this.elements.length},enumerable:!1,configurable:!0}),e.prototype.getBoundaryScore=function(e){var t=ue(e>0?this.elements[e-1]:-1),n=ue(e<this.elements.length?this.elements[e]:-1);if(t===7&&n===8)return 0;if(t===8)return 150;var r=0;return t!==n&&(r+=10,t===0&&n===1&&(r+=1)),r+=le(t),r+=le(n),r},e.prototype.translateOffset=function(e,t){t===void 0&&(t=`right`);var n=O(this.firstElementOffsetByLineIdx,function(t){return t<=e}),r=e-this.firstElementOffsetByLineIdx[n];return new T(this.range.startLineNumber+n,1+this.lineStartOffsets[n]+r+(r===0&&t===`left`?0:this.trimmedWsLengthsByLineIdx[n]))},e.prototype.translateRange=function(e){var t=this.translateOffset(e.start,`right`),n=this.translateOffset(e.endExclusive,`left`);return n.isBefore(t)?E.fromPositions(n,n):E.fromPositions(t,n)},e.prototype.findWordContaining=function(e){if(!(e<0||e>=this.elements.length)&&$(this.elements[e])){for(var t=e;t>0&&$(this.elements[t-1]);)t--;for(var n=e;n<this.elements.length&&$(this.elements[n]);)n++;return new w(t,n)}},e.prototype.findSubWordContaining=function(e){if(!(e<0||e>=this.elements.length)&&$(this.elements[e])){for(var t=e;t>0&&$(this.elements[t-1])&&!se(this.elements[t]);)t--;for(var n=e;n<this.elements.length&&$(this.elements[n])&&!se(this.elements[n]);)n++;return new w(t,n)}},e.prototype.countLinesIn=function(e){return this.translateOffset(e.endExclusive).lineNumber-this.translateOffset(e.start).lineNumber},e.prototype.isStronglyEqual=function(e,t){return this.elements[e]===this.elements[t]},e.prototype.extendToFullLines=function(e){return new w(D(this.firstElementOffsetByLineIdx,function(t){return t<=e.start})??0,k(this.firstElementOffsetByLineIdx,function(t){return e.endExclusive<=t})??this.elements.length)},e}();function $(e){return e>=97&&e<=122||e>=65&&e<=90||e>=48&&e<=57}function se(e){return e>=65&&e<=90}var ce=(o={}
148,o[0]=0,o[1]=0,o[2]=0,o[3]=10,o[4]=2,o[5]=30,o[6]=3,o[7]=10,o[8]=10,o);function le(e){return ce[e]}function ue(e){return e===10?8:e===13?7:Z(e)?6:e>=97&&e<=122?0:e>=65&&e<=90?1:e>=48&&e<=57?2:e===-1?3:e===44||e===59?5:4}function de(e,t,n,r,i,a){var o=pe(e,t,n,a),s=o.moves,c=o.excludedChanges;if(!a.isValid())return[];var l=me(e.filter(function(e){return!c.has(e)}),r,i,t,n,a);return g(s,l),s=ge(s),s=s.filter(function(e){var n=e.original.toOffsetRange().slice(t).map(function(e){return e.trim()});return n.join(` 149`).length>=15&&fe(n,function(e){return e.length>=2})>=2}),s=_e(e,s),s}function fe(e,t){var n,r,i=0;try{for(var o=a(e),s=o.next();!s.done;s=o.next()){var c=s.value;t(c)&&i++}}catch(e){n={error:e}}finally{try{s&&!s.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}return i}function pe(e,t,n,r){var i,o,s,c,l=[],u=e.filter(function(e){return e.modified.isEmpty&&e.original.length>=3}).map(function(e){return new ee(e.original,t,e)}),d=new Set(e.filter(function(e){return e.original.isEmpty&&e.modified.length>=3}).map(function(e){return new ee(e.modified,n,e)})),f=new Set;try{for(var p=a(u),m=p.next();!m.done;m=p.next()){var h=m.value,g=-1,_=void 0;try{for(var v=(s=void 0,a(d)),y=v.next();!y.done;y=v.next()){var b=y.value,x=h.computeSimilarity(b);x>g&&(g=x,_=b)}}catch(e){s={error:e}}finally{try{y&&!y.done&&(c=v.return)&&c.call(v)}finally{if(s)throw s.error}}if(g>.9&&_&&(d.delete(_),l.push(new R(h.range,_.range)),f.add(h.source),f.add(_.source)),!r.isValid())return{moves:l,excludedChanges:f}}}catch(e){i={error:e}}finally{try{m&&!m.done&&(o=p.return)&&o.call(p)}finally{if(i)throw i.error}}return{moves:l,excludedChanges:f}}function me(e,t,n,r,i,o){var s,c,l,u,d,f,p,m,h=[],g=new oe;try{for(var b=a(e),x=b.next();!x.done;x=b.next())for(var S=x.value,C=S.original.startLineNumber;C<S.original.endLineNumberExclusive-2;C++){var w=`${t[C-1]}:${t[C+1-1]}:${t[C+2-1]}`;g.add(w,{range:new M(C,C+3)})}}catch(e){s={error:e}}finally{try{x&&!x.done&&(c=b.return)&&c.call(b)}finally{if(s)throw s.error}}var T=[];e.sort(_(function(e){return e.modified.startLineNumber},v));var E=function(e){for(var t=[],r=function(e){var r=`${n[e-1]}:${n[e+1-1]}:${n[e+2-1]}`,i=new M(e,e+3),o=[];g.forEach(r,function(e){var n,r,s=e.range;try{for(var c=(n=void 0,a(t)),l=c.next();!l.done;l=c.next()){var u=l.value;if(u.originalLineRange.endLineNumberExclusive+1===s.endLineNumberExclusive&&u.modifiedLineRange.endLineNumberExclusive+1===i.endLineNumberExclusive){u.originalLineRange=new M(u.originalLineRange.startLineNumber,s.endLineNumberExclusive),u.modifiedLineRange=new M(u.modifiedLineRange.startLineNumber,i.endLineNumberExclusive),o.push(u);return}}}catch(e){n={error:e}}finally{try{l&&!l.done&&(r=c.return)&&r.call(c)}finally{if(n)throw n.error}}var d={modifiedLineRange:i,originalLineRange:s};T.push(d),o.push(d)}),t=o},i=e.modified.startLineNumber;i<e.modified.endLineNumberExclusive-2;i++)r(i);if(!o.isValid())return{value:[]}};try{for(var O=a(e),k=O.next();!k.done;k=O.next()){var S=k.value,A=E(S);if(typeof A==`object`)return A.value}}catch(e){l={error:e}}finally{try{k&&!k.done&&(u=O.return)&&u.call(O)}finally{if(l)throw l.error}}T.sort(y(_(function(e){return e.modifiedLineRange.length},v)));var P=new N,F=new N;try{for(var I=a(T),L=I.next();!L.done;L=I.next()){var z=L.value,B=z.modifiedLineRange.startLineNumber-z.originalLineRange.startLineNumber,V=P.subtractFrom(z.modifiedLineRange),H=F.subtractFrom(z.originalLineRange).getWithDelta(B),U=V.getIntersection(H);try{for(var W=(p=void 0,a(U.ranges)),G=W.next();!G.done;G=W.next()){var K=G.value;if(!(K.length<3)){var q=K,J=K.delta(-B);h.push(new R(J,q)),P.addRange(q),F.addRange(J)}}}catch(e){p={error:e}}finally{try{G&&!G.done&&(m=W.return)&&m.call(W)}finally{if(p)throw p.error}}}}catch(e){d={error:e}}finally{try{L&&!L.done&&(f=I.return)&&f.call(I)}finally{if(d)throw d.error}}h.sort(_(function(e){return e.original.startLineNumber},v));for(var Y=new j(e),X=function(t){var n=h[t],a=Y.findLastMonotonous(function(e){return e.original.startLineNumber<=n.original.startLineNumber}),s=D(e,function(e){return e.modified.startLineNumber<=n.modified.startLineNumber}),c=Math.max(n.original.startLineNumber-a.original.startLineNumber,n.modified.startLineNumber-s.modified.startLineNumber),l=Y.findLastMonotonous(function(e){return e.original.startLineNumber<n.original.endLineNumberExclusive}),u=D(e,function(e){return e.modified.startLineNumber<n.modified.endLineNumberExclusive}),d=Math.max(l.original.endLineNumberExclusive-n.original.endLineNumberExclusive,u.modified.endLineNumberExclusive-n.modified.endLineNumberExclusive),f=void 0;for(f=0;f<c;f++){var p=n.original.startLineNumber-f-1,m=n.modified.startLineNumber-f-1;if(p>r.length||m>i.length||P.contains(m)||F.contains(p)||!he(r[p-1],i[m-1],o))break}f>0&&(F.addRange(new M(n.original.startLineNumber-f,n.original.startLineNumber)),P.addRange(new M(n.modified.startLineNumber-f,n.modified.startLineNumber)));var g=void 0;for(g=0;g<d;g++){var p=n.original.endLineNumberExclusive+g,m=n.modified.endLineNumberExclusive+g;if(p>r.length||m>i.length||P.contains(m)||F.contains(p)||!he(r[p-1],i[m-1],o))break}g>0&&(F.addRange(new M(n.original.endLineNumberExclusive,n.original.endLineNumberExclusive+g)),P.addRange(new M(n.modified.endLineNumberExclusive,n.modified.endLineNumberExclusive+g))),(f>0||g>0)&&(h[t]=new R(new M(n.original.startLineNumber-f,n.original.endLineNumberExclusive+g),new M(n.modified.startLineNumber-f,n.modified.endLineNumberExclusive+g)))},C=0;C<h.length;C++)X(C);return h}function he(e,t,n){var r,i;if(e.trim()===t.trim())return!0;
149if(e.length>300&&t.length>300)return!1;var o=new ne().compute(new Q([e],new E(1,1,1,e.length),!1),new Q([t],new E(1,1,1,t.length),!1),n),s=0,c=K.invert(o.diffs,e.length);try{for(var l=a(c),u=l.next();!u.done;u=l.next())u.value.seq1Range.forEach(function(t){Z(e.charCodeAt(t))||s++})}catch(e){r={error:e}}finally{try{u&&!u.done&&(i=l.return)&&i.call(l)}finally{if(r)throw r.error}}function d(t){for(var n=0,r=0;r<e.length;r++)Z(t.charCodeAt(r))||n++;return n}var f=d(e.length>t.length?e:t);return s/f>.6&&f>10}function ge(e){if(e.length===0)return e;e.sort(_(function(e){return e.original.startLineNumber},v));for(var t=[e[0]],n=1;n<e.length;n++){var r=t[t.length-1],i=e[n],a=i.original.startLineNumber-r.original.endLineNumberExclusive,o=i.modified.startLineNumber-r.modified.endLineNumberExclusive;if(a>=0&&o>=0&&a+o<=2){t[t.length-1]=r.join(i);continue}t.push(i)}return t}function _e(e,t){var n=new j(e);return t=t.filter(function(t){return(n.findLastMonotonous(function(e){return e.original.startLineNumber<t.original.endLineNumberExclusive})||new R(new M(1,1),new M(1,1)))!==D(e,function(e){return e.modified.startLineNumber<t.modified.endLineNumberExclusive})}),t}function ve(e,t,n){var r=n;return r=ye(e,t,r),r=ye(e,t,r),r=be(e,t,r),r}function ye(e,t,n){if(n.length===0)return n;var r=[];r.push(n[0]);for(var i=1;i<n.length;i++){var a=r[r.length-1],o=n[i];if(o.seq1Range.isEmpty||o.seq2Range.isEmpty){var s=o.seq1Range.start-a.seq1Range.endExclusive,c=void 0;for(c=1;c<=s&&!(e.getElement(o.seq1Range.start-c)!==e.getElement(o.seq1Range.endExclusive-c)||t.getElement(o.seq2Range.start-c)!==t.getElement(o.seq2Range.endExclusive-c));c++);if(c--,c===s){r[r.length-1]=new K(new w(a.seq1Range.start,o.seq1Range.endExclusive-s),new w(a.seq2Range.start,o.seq2Range.endExclusive-s));continue}o=o.delta(-c)}r.push(o)}for(var l=[],i=0;i<r.length-1;i++){var u=r[i+1],o=r[i];if(o.seq1Range.isEmpty||o.seq2Range.isEmpty){var s=u.seq1Range.start-o.seq1Range.endExclusive,c=void 0;for(c=0;c<s&&!(!e.isStronglyEqual(o.seq1Range.start+c,o.seq1Range.endExclusive+c)||!t.isStronglyEqual(o.seq2Range.start+c,o.seq2Range.endExclusive+c));c++);if(c===s){r[i+1]=new K(new w(o.seq1Range.start+s,u.seq1Range.endExclusive),new w(o.seq2Range.start+s,u.seq2Range.endExclusive));continue}c>0&&(o=o.delta(c))}l.push(o)}return r.length>0&&l.push(r[r.length-1]),l}function be(e,t,n){if(!e.getBoundaryScore||!t.getBoundaryScore)return n;for(var r=0;r<n.length;r++){var i=r>0?n[r-1]:void 0,a=n[r],o=r+1<n.length?n[r+1]:void 0,s=new w(i?i.seq1Range.endExclusive+1:0,o?o.seq1Range.start-1:e.length),c=new w(i?i.seq2Range.endExclusive+1:0,o?o.seq2Range.start-1:t.length);a.seq1Range.isEmpty?n[r]=xe(a,e,t,s,c):a.seq2Range.isEmpty&&(n[r]=xe(a.swap(),t,e,c,s).swap())}return n}function xe(e,t,n,r,i){for(var a=100,o=1;e.seq1Range.start-o>=r.start&&e.seq2Range.start-o>=i.start&&n.isStronglyEqual(e.seq2Range.start-o,e.seq2Range.endExclusive-o)&&o<a;)o++;o--;for(var s=0;e.seq1Range.start+s<r.endExclusive&&e.seq2Range.endExclusive+s<i.endExclusive&&n.isStronglyEqual(e.seq2Range.start+s,e.seq2Range.endExclusive+s)&&s<a;)s++;if(o===0&&s===0)return e;for(var c=0,l=-1,u=-o;u<=s;u++){var d=e.seq2Range.start+u,f=e.seq2Range.endExclusive+u,p=e.seq1Range.start+u,m=t.getBoundaryScore(p)+n.getBoundaryScore(d)+n.getBoundaryScore(f);m>l&&(l=m,c=u)}return e.delta(c)}function Se(e,t,n){var r,i,o=[];try{for(var s=a(n),c=s.next();!c.done;c=s.next()){var l=c.value,u=o[o.length-1];if(!u){o.push(l);continue}l.seq1Range.start-u.seq1Range.endExclusive<=2||l.seq2Range.start-u.seq2Range.endExclusive<=2?o[o.length-1]=new K(u.seq1Range.join(l.seq1Range),u.seq2Range.join(l.seq2Range)):o.push(l)}}catch(e){r={error:e}}finally{try{c&&!c.done&&(i=s.return)&&i.call(s)}finally{if(r)throw r.error}}return o}function Ce(e,t,n,r,i){i===void 0&&(i=!1);var a=K.invert(n,e.length),o=[],s=new q(0,0);function c(n,c){if(!(n.offset1<s.offset1||n.offset2<s.offset2)){var l=r(e,n.offset1),u=r(t,n.offset2);if(!(!l||!u)){for(var d=new K(l,u),f=d.intersect(c),p=f.seq1Range.length,m=f.seq2Range.length;a.length>0;){var h=a[0];if(!(h.seq1Range.intersects(d.seq1Range)||h.seq2Range.intersects(d.seq2Range)))break;var g=new K(r(e,h.seq1Range.start),r(t,h.seq2Range.start)),_=g.intersect(h);if(p+=_.seq1Range.length,m+=_.seq2Range.length,d=d.join(g),d.seq1Range.endExclusive>=h.seq1Range.endExclusive)a.shift();else break}(i&&p+m<d.seq1Range.length+d.seq2Range.length||p+m<(d.seq1Range.length+d.seq2Range.length)*2/3)&&o.push(d),s=d.getEndExclusives()}}}for(;a.length>0;){var l=a.shift();l.seq1Range.isEmpty||(c(l.getStarts(),l),c(l.getEndExclusives().delta(-1),l))}return we(n,o)}function we(e,t){for(var n=[];e.length>0||t.length>0;){var r=e[0],i=t[0],a=void 0;a=r&&(!i||r.seq1Range.start<i.seq1Range.start)?e.shift():t.shift(),n.length>0&&n[n.length-1].seq1Range.endExclusive>=a.seq1Range.start?n[n.length-1]=n[n.length-1].join(a):n.push(a)}return n}function Te(e,t,n){var r=n;if(r.length===0)return r;var i=0,a;do{a=!1;for(var o=[r[0]],s=function(t){var n=function(t,n){var r=new w(s.seq1Range.endExclusive,i.seq1Range.start);return e.getText(r).replace(/\s/g,``).length<=4&&(t.seq1Range.length+t.seq2Range.length>5||n.seq1Range.length+n.seq2Range.length>5)},i=r[t],s=o[o.length-1];n(s,i)?(a=!0,o[o.length-1]=o[o.length-1].join(i)):o.push(i)},c=1;c<r.length;c++)s(c);r=o}while(i++<10&&a);return r}function Ee(e,t,n){var r=n;if(r.length===0)return r;var i=0,a;do{a=!1;for(var o=[r[0]],s=function(n){var i=function(n,r){var i=new w(c.seq1Range.endExclusive,s.seq1Range.start);if(e.countLinesIn(i)>5||i.length>500)return!1;var a=e.getText(i).trim();if(a.length>20||a.split(/\r\n|\r|\n/).length>1)return!1;var o=e.countLinesIn(n.seq1Range),l=n.seq1Range.length,u=t.countLinesIn(n.seq2Range),d=n.seq2Range.length,f=e.countLinesIn(r.seq1Range),p=r.seq1Range.length,m=t.countLinesIn(r.seq2Range),h=r.seq2Range.length,g=130;function _(e){return Math.min(e,g)}return(_(o*40+l)**1.5+_(u*40+d)**1.5)**1.5+(_(f*40+p)**1.5+_(m*40+h)**1.5)**1.5>(g**1.5)**1.5*1.3},s=r[n],c=o[o.length-1];i(c,s)?(a=!0,o[o.length-1]=o[o.length-1].join(s)):o.push(s)},c=1;c<r.length;c++)s(c);r=o}while(i++<10&&a);var l=[];return h(r,function(t,n,r){var i=n;function a(e){return e.length>0&&e.trim().length<=3&&n.seq1Range.length+n.seq2Range.length>100}var o=e.extendToFullLines(n.seq1Range),s=e.getText(new w(o.start,n.seq1Range.start));a(s)&&(i=i.deltaStart(-s.length));var c=e.getText(new w(n.seq1Range.endExclusive,o.endExclusive));a(c)&&(i=i.deltaEnd(c.length));var u=K.fromOffsetPairs(t?t.getEndExclusives():q.zero,r?r.getStarts():q.max),d=i.intersect(u);l.length>0&&d.getStarts().equals(l[l.length-1].getEndExclusives())?l[l.length-1]=l[l.length-1].join(d):l.push(d)}),l}var De=function(){function e(e,t){this.trimmedHash=e,this.lines=t}return e.prototype.getElement=function(e){return this.trimmedHash[e]},Object.defineProperty(e.prototype,"length",{get:function(){return this.trimmedHash.length}
149,enumerable:!1,configurable:!0}),e.prototype.getBoundaryScore=function(e){return 1e3-((e===0?0:Oe(this.lines[e-1]))+(e===this.lines.length?0:Oe(this.lines[e])))},e.prototype.getText=function(e){return this.lines.slice(e.start,e.endExclusive).join(` 150`)},e.prototype.isStronglyEqual=function(e,t){return this.lines[e]===this.lines[t]},e}();function Oe(e){for(var t=0;t<e.length&&(e.charCodeAt(t)===32||e.charCodeAt(t)===9);)t++;return t}var ke=function(){function e(){this.dynamicProgrammingDiffing=new te,this.myersDiffingAlgorithm=new ne}return e.prototype.computeDiff=function(e,t,n){var r,i,o=this;if(e.length<=1&&f(e,t,function(e,t){return e===t}))return new I([],[],!1);if(e.length===1&&e[0].length===0||t.length===1&&t[0].length===0)return new I([new V(new M(1,e.length+1),new M(1,t.length+1),[new H(new E(1,1,e.length,e[e.length-1].length+1),new E(1,1,t.length,t[t.length-1].length+1))])],[],!1);var s=n.maxComputationTimeMs===0?J.instance:new Y(n.maxComputationTimeMs),c=!n.ignoreTrimWhitespace,l=new Map;function u(e){var t=l.get(e);return t===void 0&&(t=l.size,l.set(e,t)),t}var d=e.map(function(e){return u(e.trim())}),p=t.map(function(e){return u(e.trim())}),m=new De(d,e),h=new De(p,t),g=(function(){return m.length+h.length<1700?o.dynamicProgrammingDiffing.compute(m,h,s,function(n,r){return e[n]===t[r]?t[r].length===0?.1:1+Math.log(1+t[r].length):.99}):o.myersDiffingAlgorithm.compute(m,h,s)})(),_=g.diffs,v=g.hitTimeout;_=ve(m,h,_),_=Te(m,h,_);var y=[],b=function(r){var i,l;if(c)for(var u=0;u<r;u++){var d=x+u,f=C+u;if(e[d]!==t[f]){var p=o.refineDiff(e,t,new K(new w(d,d+1),new w(f,f+1)),s,c,n);try{for(var m=(i=void 0,a(p.mappings)),h=m.next();!h.done;h=m.next()){var g=h.value;y.push(g)}}catch(e){i={error:e}}finally{try{h&&!h.done&&(l=m.return)&&l.call(m)}finally{if(i)throw i.error}}p.hitTimeout&&(v=!0)}}},x=0,C=0,T=function(r){var i,o;S(function(){return r.seq1Range.start-x===r.seq2Range.start-C}),b(r.seq1Range.start-x),x=r.seq1Range.endExclusive,C=r.seq2Range.endExclusive;var l=D.refineDiff(e,t,r,s,c,n);l.hitTimeout&&(v=!0);try{for(var u=(i=void 0,a(l.mappings)),d=u.next();!d.done;d=u.next()){var f=d.value;y.push(f)}}catch(e){i={error:e}}finally{try{d&&!d.done&&(o=u.return)&&o.call(u)}finally{if(i)throw i.error}}},D=this;try{for(var O=a(_),k=O.next();!k.done;k=O.next()){var A=k.value;T(A)}}catch(e){r={error:e}}finally{try{k&&!k.done&&(i=O.return)&&i.call(O)}finally{if(r)throw r.error}}b(e.length-x);var j=U(y,new F(e),new F(t)),N=[];return n.computeMoves&&(N=this.computeMoves(j,e,t,d,p,s,c,n)),S(function(){var n,r,i,o;function s(e,t){if(e.lineNumber<1||e.lineNumber>t.length)return!1;var n=t[e.lineNumber-1];return!(e.column<1||e.column>n.length+1)}function c(e,t){return!(e.startLineNumber<1||e.startLineNumber>t.length+1||e.endLineNumberExclusive<1||e.endLineNumberExclusive>t.length+1)}try{for(var l=a(j),u=l.next();!u.done;u=l.next()){var d=u.value;if(!d.innerChanges)return!1;try{for(var f=(i=void 0,a(d.innerChanges)),p=f.next();!p.done;p=f.next()){var m=p.value;if(!(s(m.modifiedRange.getStartPosition(),t)&&s(m.modifiedRange.getEndPosition(),t)&&s(m.originalRange.getStartPosition(),e)&&s(m.originalRange.getEndPosition(),e)))return!1}}catch(e){i={error:e}}finally{try{p&&!p.done&&(o=f.return)&&o.call(f)}finally{if(i)throw i.error}}if(!c(d.modified,t)||!c(d.original,e))return!1}}catch(e){n={error:e}}finally{try{u&&!u.done&&(r=l.return)&&r.call(l)}finally{if(n)throw n.error}}return!0}),new I(j,N,v)},e.prototype.computeMoves=function(e,t,n,r,i,a,o,s){var c=this;return de(e,t,n,r,i,a).map(function(e){return new L(e,U(c.refineDiff(t,n,new K(e.original.toOffsetRange(),e.modified.toOffsetRange()),a,o,s).mappings,new F(t),new F(n),!0))})},e.prototype.refineDiff=function(e,t,n,r,i,a){var o=Ae(n).toRangeMapping2(e,t),s=new Q(e,o.originalRange,i),c=new Q(t,o.modifiedRange,i),l=s.length+c.length<500?this.dynamicProgrammingDiffing.compute(s,c,r):this.myersDiffingAlgorithm.compute(s,c,r),u=l.diffs;return u=ve(s,c,u),u=Ce(s,c,u,function(e,t){return e.findWordContaining(t)}),a.extendToSubwords&&(u=Ce(s,c,u,function(e,t){return e.findSubWordContaining(t)},!0)),u=Se(s,c,u),u=Ee(s,c,u),{mappings:u.map(function(e){return new H(s.translateRange(e.seq1Range),c.translateRange(e.seq2Range))}),hitTimeout:l.hitTimeout}},e}();function Ae(e){return new R(new M(e.seq1Range.start+1,e.seq1Range.endExclusive+1),new M(e.seq2Range.start+1,e.seq2Range.endExclusive+1))}function je(e,t,n){return new ke().computeDiff(e,t,n)?.changes.map(function(e){var t,n,r,i,a=e.innerChanges;return t=e.original.startLineNumber-1,n=e.original.endLineNumberExclusive-1,r=e.modified.startLineNumber-1,i=e.modified.endLineNumberExclusive-1,{origStart:t,origEnd:n,editStart:r,editEnd:i,charChanges:a?.map(function(e){return{originalStartLineNumber:e.originalRange.startLineNumber-1,originalStartColumn:e.originalRange.startColumn-1,originalEndLineNumber:e.originalRange.endLineNumber-1,originalEndColumn:e.originalRange.endColumn-1,modifiedStartLineNumber:e.modifiedRange.startLineNumber-1,modifiedStartColumn:e.modifiedRange.startColumn-1,modifiedEndLineNumber:e.modifiedRange.endLineNumber-1,modifiedEndColumn:e.modifiedRange.endColumn-1}})}})}t.computeDiff=je;var Me=e("../../../range").Range,Ne=e("../base_diff_view").DiffChunk;t.DiffProvider=function(){function e(){}return e.prototype.compute=function(e,t,n){return n||={},n.maxComputationTimeMs||=500,(je(e,t,n)||[]).map(function(e){return new Ne(new Me(e.origStart,0,e.origEnd,0),new Me(e.editStart,0,e.editEnd,0),e.charChanges)})},e}()}),ace.define(`ace/ext/diff`,[`require`,`exports`,`module`,`ace/ext/diff/inline_diff_view`,`ace/ext/diff/split_diff_view`,`ace/ext/diff/providers/default`],function(e,t,n){var r=e("./diff/inline_diff_view").InlineDiffView,i=e("./diff/split_diff_view").SplitDiffView,a=e("./diff/providers/default").DiffProvider;function o(e,t){e||={},e.diffProvider=e.diffProvider||new a;var n=e.inline?new r(e):new i(e);return t&&n.setOptions(t),n}t.InlineDiffView=r,t.SplitDiffView=i,t.DiffProvider=a,t.createDiffView=o}),(function(){ace.require([`ace/ext/diff`],function(n){typeof t==`object`&&typeof e==`object`&&t&&(t.exports=n)})})()}));export default t();
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.