!function(t,e){"object"==typeofexports&&"object"==typeofmodule?module.exports=e(require("jQuery"),require("CodeMirror")):"function"==typeofdefine&&define.amd?define("mergely",["jQuery","CodeMirror"],e):"object"==typeofexports?exports.mergely=e(require("jQuery"),require("CodeMirror")):t.mergely=e(t.jQuery,t.CodeMirror)}(window,(function(t,e){returnfunction(t){vare={};functioni(s){if(e[s])returne[s].exports;varr=e[s]={i:s,l:!1,exports:{}};returnt[s].call(r.exports,r,r.exports,i),r.l=!0,r.exports}returni.m=t,i.c=e,i.d=function(t,e,s){i.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:s})},i.r=function(t){"undefined"!=typeofSymbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},i.t=function(t,e){if(1&e&&(t=i(t)),8&e)returnt;if(4&e&&"object"==typeoft&&t&&t.__esModule)returnt;vars=Object.create(null);if(i.r(s),Object.defineProperty(s,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeoft)for(varrint)i.d(s,r,function(e){returnt[e]}.bind(null,r));returns},i.n=function(t){vare=t&&t.__esModule?function(){returnt.default}:function(){returnt};returni.d(e,"a",e),e},i.o=function(t,e){returnObject.prototype.hasOwnProperty.call(t,e)},i.p="",i(i.s=3)}([function(t,e){functioni(t,e){vari=arguments.length>2&&void0!==arguments[2]?arguments[2]:{},r=i.ignorews,n=void0!==r&&r,o=i.ignoreaccents,h=void0!==o&&o,l=i.ignorecase,a=void0!==l&&l;this.codeify=news(t,e,{ignorews:n,ignoreaccents:h,ignorecase:a});varc={codes:this.codeify.getCodes("lhs"),modified:{}},d={codes:this.codeify.getCodes("rhs"),modified:{}},g=[],f=[];this._lcs(c,0,c.codes.length,d,0,d.codes.length,f,g),this._optimize(c),this._optimize(d),this.items=this._create_diffs(c,d)}functions(t,e,i){this._max_code=0,this._diff_codes={},this.ctxs={},this.options=i,this.lhs="string"==typeoft?t.split("\n"):t,this.rhs="string"==typeofe?e.split("\n"):e}i.prototype.changes=function(){returnthis.items},i.prototype.getLines=function(t){returnthis.codeify.getLines(t)},i.prototype.normal_form=function(){for(vart="",e=0;e<this.items.length;++e){vari=this.items[e],s="c";0==i.lhs_deleted_count&&i.rhs_inserted_count>0?s="a":i.lhs_deleted_count>0&&0==i.rhs_inserted_count&&(s="d"),t+=(1==i.lhs_deleted_count?i.lhs_start+1:0==i.lhs_deleted_count?i.lhs_start:i.lhs_start+1+","+(i.lhs_start+i.lhs_deleted_count))+s+(1==i.rhs_inserted_count?i.rhs_start+1:0==i.rhs_inserted_count?i.rhs_start:i.rhs_start+1+","+(i.rhs_start+i.rhs_inserted_count))+"\n";varr=this.getLines("lhs"),n=this.getLines("rhs");if(n&&r){varo=void0;for(o=i.lhs_start;o<i.lhs_start+i.lhs_deleted_count;++o)t+="< "+r[o]+"\n";for(i.rhs_inserted_count&&i.lhs_deleted_count&&(t+="---\n"),o=i.rhs_start;o<i.rhs_start+i.rhs_inserted_count;++o)t+="> "+n[o]+"\n"}}returnt},i.prototype._lcs=function(t,e,i,s,r,n,o,h){for(;e<i&&r<n&&t.codes[e]==s.codes[r];)++e,++r;for(;e<i&&r<n&&t.codes[i-1]==s.codes[n-1];)--i,--n;if(e==i)for(;r<n;)s.modified[r++]=!0;elseif(r==n)for(;e<i;)t.modified[e++]=!0;else{varl=this._sms(t,e,i,s,r,n,o,h);this._lcs(t,e,l.x,s,r,l.y,o,h),this._lcs(t,l.x,i,s,l.y,n,o,h)}},i.prototype._sms=function(t,e,i,s,r,n,o,h){varl=t.codes.length+s.codes.length+1,a=e-r,c=i-n,d=0!=(1&i-e-(n-r)),g=l-a,f=l-c,p=(i-e+n-r)/2+1;h[g+a+1]=e,o[f+c-1]=i;for(varu,m,_={x:0,y:0},y=0;y<=p;++y){for(varv=a-y;v<=a+y;v+=2){for(v==a-y?u=h[g+v+1]:(u=h[g+v-1]+1,v<a+y&&h[g+v+1]>=u&&(u=h[g+v+1])),m=u-v;u<i&&m<n&&t.codes[u]==s.codes[m];)u++,m++;if(h[g+v]=u,d&&c-y<v&&v<c+y&&o[f+v]<=h[g+v])return_.x=h[g+v],_.y=h[g+v]-v,_}for(k=c-y;k<=c+y;k+=2){for(k==c+y?u=o[f+k-1]:(u=o[f+k+1]-1,k>c-y&&o[f+k-1]<u&&(u=o[f+k-1])),m=u-k;u>e&&m>r&&t.codes[u-1]==s.codes[m-1];)u--,m--;if(o[f+k]=u,!d&&a-y<=k&&k<=a+y&&o[f+k]<=h[g+k])return_.x=h[g+k],_.y=h[g+k]-k,_}}throw"the algorithm should never come here."},i.prototype._optimize=function(t){for(vare=0,i=0;e<t.codes.length;){for(;e<t.codes.length&&(null==t.modified[e]||0==t.modified[e]);)e++;for(i=e;i<t.codes.length&&1==t.modified[i];)i++;i<t.codes.length&&t.codes[e]==t.codes[i]?(t.modified[e]=!1,t.modified[i]=!0):