Liferay.Loader.define("liferay!layout-content-page-editor-web$codemirror@5.65.2/addon/edit/continuelist",["module","exports","require","../../lib/codemirror"],(function(e,n,t){window,function(e){"use strict";var n=/^(\s*)(>[> ]*|[*+-] \[[x ]\]\s|[*+-]\s|(\d+)([.)]))(\s*)/,t=/^(\s*)(>[> ]*|[*+-] \[[x ]\]|[*+-]|(\d+)[.)])(\s*)$/,i=/[*+-]\s/;function incrementRemainingMarkdownListNumbers(e,t){var i=t.line,r=0,o=0,a=n.exec(e.getLine(i)),s=a[1];do{var l=i+(r+=1),d=e.getLine(l),c=n.exec(d);if(c){var m=c[1],f=parseInt(a[3],10)+r-o,u=parseInt(c[3],10),g=u;if(s!==m||isNaN(u)){if(s.length>m.length)return;if(s.length<m.length&&1===r)return;o+=1}else f===u&&(g=u+1),f>u&&(g=f+1),e.replaceRange(d.replace(n,m+g+c[4]+c[5]),{line:l,ch:0},{line:l,ch:d.length})}}while(c)}e.commands.newlineAndIndentContinueMarkdownList=function(r){if(r.getOption("disableInput"))return e.Pass;for(var o=r.listSelections(),a=[],s=0;s<o.length;s++){var l=o[s].head,d=r.getStateAfter(l.line),c=e.innerMode(r.getMode(),d);if("markdown"!==c.mode.name&&"markdown"!==c.mode.helperType)return void r.execCommand("newlineAndIndent");var m=!1!==(d=c.state).list,f=0!==d.quote,u=r.getLine(l.line),g=n.exec(u),p=/^\s*$/.test(u.slice(0,l.ch));if(!o[s].empty()||!m&&!f||!g||p)return void r.execCommand("newlineAndIndent");if(t.test(u)){var h=f&&/>\s*$/.test(u),w=!/>\s*$/.test(u);(h||w)&&r.replaceRange("",{line:l.line,ch:0},{line:l.line,ch:l.ch+1}),a[s]="\n"}else{var v=g[1],x=g[5],b=!(i.test(g[2])||g[2].indexOf(">")>=0),L=b?parseInt(g[3],10)+1+g[4]:g[2].replace("x"," ");a[s]="\n"+v+L+x,b&&incrementRemainingMarkdownListNumbers(r,l)}}r.replaceSelections(a)}}("object"==typeof n&&"object"==typeof e?t("../../lib/codemirror"):CodeMirror)}));
//# sourceMappingURL=continuelist.js.map