From 199a644d48bc12d81a0c126657f6536f6723a7b1 Mon Sep 17 00:00:00 2001 From: Laurent David Date: Tue, 19 Mar 2024 07:38:55 +0100 Subject: [PATCH] MDL-81277 lib: Update atto codemirror to 5.65.16 --- .../atto/plugins/html/thirdpartylibs.xml | 2 +- .../moodle-atto_html-codemirror-debug.js | 78 +++++++++++-------- .../moodle-atto_html-codemirror-min.js | 76 +++++++++--------- .../moodle-atto_html-codemirror.js | 78 +++++++++++-------- .../plugins/html/yui/src/codemirror/LICENSE | 6 +- .../html/yui/src/codemirror/js/codemirror.js | 78 +++++++++++-------- 6 files changed, 175 insertions(+), 143 deletions(-) diff --git a/lib/editor/atto/plugins/html/thirdpartylibs.xml b/lib/editor/atto/plugins/html/thirdpartylibs.xml index ceb826cbf70..a4d80374716 100644 --- a/lib/editor/atto/plugins/html/thirdpartylibs.xml +++ b/lib/editor/atto/plugins/html/thirdpartylibs.xml @@ -4,7 +4,7 @@ yui/src/codemirror codemirror CodeMirror is a versatile text editor implemented in JavaScript for the browser. - 5.65.15 + 5.65.16 MIT https://github.com/codemirror/codemirror5 diff --git a/lib/editor/atto/plugins/html/yui/build/moodle-atto_html-codemirror/moodle-atto_html-codemirror-debug.js b/lib/editor/atto/plugins/html/yui/build/moodle-atto_html-codemirror/moodle-atto_html-codemirror-debug.js index 91732ef20b3..8c278937dbe 100644 --- a/lib/editor/atto/plugins/html/yui/build/moodle-atto_html-codemirror/moodle-atto_html-codemirror-debug.js +++ b/lib/editor/atto/plugins/html/yui/build/moodle-atto_html-codemirror/moodle-atto_html-codemirror-debug.js @@ -116,13 +116,14 @@ var define = null; // Remove require.js support in this context. } while (child = child.parentNode) } - function activeElt(doc) { + function activeElt(rootNode) { // IE and Edge may throw an "Unspecified Error" when accessing document.activeElement. // IE < 10 will throw when accessed while the page is loading or in an iframe. // IE > 9 and Edge will throw when accessed in an iframe if document.body is unavailable. + var doc = rootNode.ownerDocument || rootNode; var activeElement; try { - activeElement = doc.activeElement; + activeElement = rootNode.activeElement; } catch(e) { activeElement = doc.body || null; } @@ -150,6 +151,15 @@ var define = null; // Remove require.js support in this context. function doc(cm) { return cm.display.wrapper.ownerDocument } + function root(cm) { + return rootNode(cm.display.wrapper) + } + + function rootNode(element) { + // Detect modern browsers (2017+). + return element.getRootNode ? element.getRootNode() : element.ownerDocument + } + function win(cm) { return doc(cm).defaultView } function bind(f) { @@ -3904,7 +3914,7 @@ var define = null; // Remove require.js support in this context. cm.display.maxLineChanged = false; } - var takeFocus = op.focus && op.focus == activeElt(doc(cm)); + var takeFocus = op.focus && op.focus == activeElt(root(cm)); if (op.preparedSelection) { cm.display.input.showSelection(op.preparedSelection, takeFocus); } if (op.updatedDisplay || op.startHeight != cm.doc.height) @@ -4081,7 +4091,7 @@ var define = null; // Remove require.js support in this context. function selectionSnapshot(cm) { if (cm.hasFocus()) { return null } - var active = activeElt(doc(cm)); + var active = activeElt(root(cm)); if (!active || !contains(cm.display.lineDiv, active)) { return null } var result = {activeElt: active}; if (window.getSelection) { @@ -4097,7 +4107,7 @@ var define = null; // Remove require.js support in this context. } function restoreSelection(snapshot) { - if (!snapshot || !snapshot.activeElt || snapshot.activeElt == activeElt(snapshot.activeElt.ownerDocument)) { return } + if (!snapshot || !snapshot.activeElt || snapshot.activeElt == activeElt(rootNode(snapshot.activeElt))) { return } snapshot.activeElt.focus(); if (!/^(INPUT|TEXTAREA)$/.test(snapshot.activeElt.nodeName) && snapshot.anchorNode && contains(document.body, snapshot.anchorNode) && contains(document.body, snapshot.focusNode)) { @@ -7268,7 +7278,7 @@ var define = null; // Remove require.js support in this context. function onKeyDown(e) { var cm = this; if (e.target && e.target != cm.display.input.getField()) { return } - cm.curOp.focus = activeElt(doc(cm)); + cm.curOp.focus = activeElt(root(cm)); if (signalDOMEvent(cm, e)) { return } // IE does strange things with escape. if (ie && ie_version < 11 && e.keyCode == 27) { e.returnValue = false; } @@ -7430,7 +7440,7 @@ var define = null; // Remove require.js support in this context. function leftButtonDown(cm, pos, repeat, event) { if (ie) { setTimeout(bind(ensureFocus, cm), 0); } - else { cm.curOp.focus = activeElt(doc(cm)); } + else { cm.curOp.focus = activeElt(root(cm)); } var behavior = configureMouse(cm, repeat, event); @@ -7500,19 +7510,19 @@ var define = null; // Remove require.js support in this context. // Normal selection, as opposed to text dragging. function leftButtonSelect(cm, event, start, behavior) { if (ie) { delayBlurEvent(cm); } - var display = cm.display, doc$1 = cm.doc; + var display = cm.display, doc = cm.doc; e_preventDefault(event); - var ourRange, ourIndex, startSel = doc$1.sel, ranges = startSel.ranges; + var ourRange, ourIndex, startSel = doc.sel, ranges = startSel.ranges; if (behavior.addNew && !behavior.extend) { - ourIndex = doc$1.sel.contains(start); + ourIndex = doc.sel.contains(start); if (ourIndex > -1) { ourRange = ranges[ourIndex]; } else { ourRange = new Range(start, start); } } else { - ourRange = doc$1.sel.primary(); - ourIndex = doc$1.sel.primIndex; + ourRange = doc.sel.primary(); + ourIndex = doc.sel.primIndex; } if (behavior.unit == "rectangle") { @@ -7529,18 +7539,18 @@ var define = null; // Remove require.js support in this context. if (!behavior.addNew) { ourIndex = 0; - setSelection(doc$1, new Selection([ourRange], 0), sel_mouse); - startSel = doc$1.sel; + setSelection(doc, new Selection([ourRange], 0), sel_mouse); + startSel = doc.sel; } else if (ourIndex == -1) { ourIndex = ranges.length; - setSelection(doc$1, normalizeSelection(cm, ranges.concat([ourRange]), ourIndex), + setSelection(doc, normalizeSelection(cm, ranges.concat([ourRange]), ourIndex), {scroll: false, origin: "*mouse"}); } else if (ranges.length > 1 && ranges[ourIndex].empty() && behavior.unit == "char" && !behavior.extend) { - setSelection(doc$1, normalizeSelection(cm, ranges.slice(0, ourIndex).concat(ranges.slice(ourIndex + 1)), 0), + setSelection(doc, normalizeSelection(cm, ranges.slice(0, ourIndex).concat(ranges.slice(ourIndex + 1)), 0), {scroll: false, origin: "*mouse"}); - startSel = doc$1.sel; + startSel = doc.sel; } else { - replaceOneSelection(doc$1, ourIndex, ourRange, sel_mouse); + replaceOneSelection(doc, ourIndex, ourRange, sel_mouse); } var lastPos = start; @@ -7550,19 +7560,19 @@ var define = null; // Remove require.js support in this context. if (behavior.unit == "rectangle") { var ranges = [], tabSize = cm.options.tabSize; - var startCol = countColumn(getLine(doc$1, start.line).text, start.ch, tabSize); - var posCol = countColumn(getLine(doc$1, pos.line).text, pos.ch, tabSize); + var startCol = countColumn(getLine(doc, start.line).text, start.ch, tabSize); + var posCol = countColumn(getLine(doc, pos.line).text, pos.ch, tabSize); var left = Math.min(startCol, posCol), right = Math.max(startCol, posCol); for (var line = Math.min(start.line, pos.line), end = Math.min(cm.lastLine(), Math.max(start.line, pos.line)); line <= end; line++) { - var text = getLine(doc$1, line).text, leftPos = findColumn(text, left, tabSize); + var text = getLine(doc, line).text, leftPos = findColumn(text, left, tabSize); if (left == right) { ranges.push(new Range(Pos(line, leftPos), Pos(line, leftPos))); } else if (text.length > leftPos) { ranges.push(new Range(Pos(line, leftPos), Pos(line, findColumn(text, right, tabSize)))); } } if (!ranges.length) { ranges.push(new Range(start, start)); } - setSelection(doc$1, normalizeSelection(cm, startSel.ranges.slice(0, ourIndex).concat(ranges), ourIndex), + setSelection(doc, normalizeSelection(cm, startSel.ranges.slice(0, ourIndex).concat(ranges), ourIndex), {origin: "*mouse", scroll: false}); cm.scrollIntoView(pos); } else { @@ -7577,8 +7587,8 @@ var define = null; // Remove require.js support in this context. anchor = maxPos(oldRange.to(), range.head); } var ranges$1 = startSel.ranges.slice(0); - ranges$1[ourIndex] = bidiSimplify(cm, new Range(clipPos(doc$1, anchor), head)); - setSelection(doc$1, normalizeSelection(cm, ranges$1, ourIndex), sel_mouse); + ranges$1[ourIndex] = bidiSimplify(cm, new Range(clipPos(doc, anchor), head)); + setSelection(doc, normalizeSelection(cm, ranges$1, ourIndex), sel_mouse); } } @@ -7594,9 +7604,9 @@ var define = null; // Remove require.js support in this context. var cur = posFromMouse(cm, e, true, behavior.unit == "rectangle"); if (!cur) { return } if (cmp(cur, lastPos) != 0) { - cm.curOp.focus = activeElt(doc(cm)); + cm.curOp.focus = activeElt(root(cm)); extendTo(cur); - var visible = visibleLines(display, doc$1); + var visible = visibleLines(display, doc); if (cur.line >= visible.to || cur.line < visible.from) { setTimeout(operation(cm, function () {if (counter == curCount) { extend(e); }}), 150); } } else { @@ -7621,7 +7631,7 @@ var define = null; // Remove require.js support in this context. } off(display.wrapper.ownerDocument, "mousemove", move); off(display.wrapper.ownerDocument, "mouseup", up); - doc$1.history.lastSelOrigin = null; + doc.history.lastSelOrigin = null; } var move = operation(cm, function (e) { @@ -8621,7 +8631,7 @@ var define = null; // Remove require.js support in this context. signal(this, "overwriteToggle", this, this.state.overwrite); }, - hasFocus: function() { return this.display.input.getField() == activeElt(doc(this)) }, + hasFocus: function() { return this.display.input.getField() == activeElt(root(this)) }, isReadOnly: function() { return !!(this.options.readOnly || this.doc.cantEdit) }, scrollTo: methodOp(function (x, y) { scrollToCoords(this, x, y); }), @@ -8903,7 +8913,7 @@ var define = null; // Remove require.js support in this context. disableBrowserMagic(te); cm.display.lineSpace.insertBefore(kludge, cm.display.lineSpace.firstChild); te.value = lastCopied.text.join("\n"); - var hadFocus = activeElt(div.ownerDocument); + var hadFocus = activeElt(rootNode(div)); selectInput(te); setTimeout(function () { cm.display.lineSpace.removeChild(kludge); @@ -8926,7 +8936,7 @@ var define = null; // Remove require.js support in this context. ContentEditableInput.prototype.prepareSelection = function () { var result = prepareSelection(this.cm, false); - result.focus = activeElt(this.div.ownerDocument) == this.div; + result.focus = activeElt(rootNode(this.div)) == this.div; return result }; @@ -9022,7 +9032,7 @@ var define = null; // Remove require.js support in this context. ContentEditableInput.prototype.focus = function () { if (this.cm.options.readOnly != "nocursor") { - if (!this.selectionInEditor() || activeElt(this.div.ownerDocument) != this.div) + if (!this.selectionInEditor() || activeElt(rootNode(this.div)) != this.div) { this.showSelection(this.prepareSelection(), true); } this.div.focus(); } @@ -9530,7 +9540,7 @@ var define = null; // Remove require.js support in this context. TextareaInput.prototype.supportsTouch = function () { return false }; TextareaInput.prototype.focus = function () { - if (this.cm.options.readOnly != "nocursor" && (!mobile || activeElt(this.textarea.ownerDocument) != this.textarea)) { + if (this.cm.options.readOnly != "nocursor" && (!mobile || activeElt(rootNode(this.textarea)) != this.textarea)) { try { this.textarea.focus(); } catch (e) {} // IE8 will throw if the textarea is display: none or not in DOM } @@ -9737,7 +9747,7 @@ var define = null; // Remove require.js support in this context. // Set autofocus to true if this textarea is focused, or if it has // autofocus and no other element is focused. if (options.autofocus == null) { - var hasFocus = activeElt(textarea.ownerDocument); + var hasFocus = activeElt(rootNode(textarea)); options.autofocus = hasFocus == textarea || textarea.getAttribute("autofocus") != null && hasFocus == document.body; } @@ -9871,7 +9881,7 @@ var define = null; // Remove require.js support in this context. addLegacyProps(CodeMirror); - CodeMirror.version = "5.65.15"; + CodeMirror.version = "5.65.16"; return CodeMirror; diff --git a/lib/editor/atto/plugins/html/yui/build/moodle-atto_html-codemirror/moodle-atto_html-codemirror-min.js b/lib/editor/atto/plugins/html/yui/build/moodle-atto_html-codemirror/moodle-atto_html-codemirror-min.js index 7e408686ea6..41cfd7cf4ab 100644 --- a/lib/editor/atto/plugins/html/yui/build/moodle-atto_html-codemirror/moodle-atto_html-codemirror-min.js +++ b/lib/editor/atto/plugins/html/yui/build/moodle-atto_html-codemirror/moodle-atto_html-codemirror-min.js @@ -1,38 +1,38 @@ -YUI.add("moodle-atto_html-codemirror",function(e,t){var n,r,i=window.codeMirror;n=this,r=function(){"use strict";var i,f,l,y,c,p,a,m,v,C,u,r,o,s,h,d,g,w,b,S,T,L,D,z,W,P,E,H,I,F,R,B,j,V,K,G,U,q,_,$,X,Y,Z,Q,J,ee,te,ne,re,ie,oe,le,ae,se,ce,ue,de,he,fe,pe,ge,me,ye,ve,be,we,xe,ke,Ce,Se,Te,Le,Me,Ne,Ae,Oe,De,ze,We,Pe,Ee,He,Ie,Fe,e=navigator.userAgent,Re=navigator.platform,Be=/gecko\/\d/i.test(e),je=/MSIE \d/.test(e),Ve=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(e),t=/Edge\/(\d+)/.exec(e),x=je||Ve||t,Ke=x&&(je?document.documentMode||6:+(t||Ve)[1]),Ge=!t&&/WebKit\//.test(e),je=Ge&&/Qt\/\d+\.\d+/.test(e),Ue=!t&&/Chrome\/(\d+)/.exec(e),qe=Ue&&+Ue[1],_e=/Opera\//.test(e),$e=/Apple Computer/.test(navigator.vendor),Xe=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(e),Ye=/PhantomJS/.test(e),Ze=$e&&(/Mobile\/\w+/.test(e)||2t)return i;o.to==t&&(o.from!=o.to&&"before"==n?r=i:h=i),o.from==t&&(o.from!=o.to&&"before"!=n?r=i:h=i)}return null!=r?r:h}function At(e,t,n){this.level=e,this.from=t,this.to=n}function Ot(e,t){var n=e.order;return n=null==n?e.order=d(e.text,t):n}function Dt(e,t){return e._handlers&&e._handlers[t]||g}function zt(e,t,n){var r,i;e.removeEventListener?e.removeEventListener(t,n,!1):e.detachEvent?e.detachEvent("on"+t,n):(r=(e=e._handlers)&&e[t])&&-1<(i=gt(r,n))&&(e[t]=r.slice(0,i).concat(r.slice(i+1)))}function Wt(e,t){var n,r,i=Dt(e,t);if(i.length)for(n=Array.prototype.slice.call(arguments,2),r=0;r=e.size)throw new Error("There is no line "+(t+e.first)+" in the document.");for(n=e;!n.lines;)for(r=0;;++r){if(t<(o=(i=n.children[r]).chunkSize())){n=i;break}t-=o}return n.lines[t]}function Yt(e,t,n){var r=[],i=t.line;return e.iter(t.line,n.line+1,function(e){e=e.text;i==n.line&&(e=e.slice(0,n.ch)),i==t.line&&(e=e.slice(t.ch)),r.push(e),++i}),r}function Zt(e,t,n){var r=[];return e.iter(t,n,function(e){r.push(e.text)}),r}function Qt(e,t){var n,r=t-e.height;if(r)for(n=e;n;n=n.parent)n.height+=r}function Jt(e){var t,n,r,i;if(null==e.parent)return null;for(n=gt((t=e.parent).lines,e),r=t.parent;r;r=(t=r).parent)for(i=0;r.children[i]!=t;++i)n+=r.children[i].chunkSize();return n+t.first}function en(e,t){var n,r,i,o,l,a=e.first;e:do{for(n=0;n=e.first&&tn?A(n,N(e,n).text.length):(e=N(e,(n=t).line).text.length,null==(t=n.ch)||ee.options.maxHighlightLength&&_t(e.doc.mode,r.state),o=un(e,t,r),i&&(r.state=i),t.stateAfter=r.save(!i),t.styles=o.styles,o.classes?t.styleClasses=o.classes:t.styleClasses&&(t.styleClasses=null),n===e.doc.highlightFrontier&&(e.doc.modeFrontier=Math.max(e.doc.modeFrontier,++e.doc.highlightFrontier))),t.styles}function hn(n,r,e){var t,i,o,l=n.doc,a=n.display;return l.mode.startState?(i=(t=function(e,t,n){var r,i,o,l,a,s,c;for(o=e.doc,l=n?-1:t-(e.doc.mode.innerMode?1e3:100),a=t;ll.first&&N(l,t-1).stateAfter,o=i?R.fromSaved(l,i,t):new R(l,Xt(l.mode),t),l.iter(t,r,function(e){fn(n,e.text,o);var t=o.line;e.stateAfter=t==r-1||t%5==0||t>=a.viewFrom&&tt.start)return i;throw new Error("Mode "+e.name+" failed to advance stream.")}function mn(e,t,n,r){var i,o,l=e.doc,a=l.mode,u=N(l,(t=O(l,t)).line),s=hn(e,t.line,n),c=new I(u.text,e.options.tabSize,s);for(r&&(o=[]);(r||c.pose.options.maxHighlightLength?(c=!1,h&&fn(e,t,r,l.pos),l.pos=t.length,null):yn(gn(n,l,r.state,s),d),s&&(f=s[0].name)&&(a="m-"+(a?f+" "+a:f)),!c||o!=a){for(;i=t:o.to>t),(r=r||[]).push(new bn(l,o.from,a?null:o.to)));return r}(r,n,r=0==k(t.from,t.to)),o=function(e,t,n){var r,i,o,l,a;if(e)for(i=0;i=t:o.to>t))&&(o.from!=t||"bookmark"!=l.type||n&&!o.marker.insertLeft)||(a=null==o.from||(l.inclusiveLeft?o.from<=t:o.frome.lastLine())return t;var n,r=N(e,t);if(!En(e,r))return t;for(;n=On(r);)r=n.find(1,!0).line;return Jt(r)+1}function En(e,t){var n,r,i=V&&t.markedSpans;if(i)for(r=0;rn.maxLineLength&&(n.maxLineLength=t,n.maxLine=e)})}function Rn(e,t){if(!e||/^\s*$/.test(e))return null;t=t.addModeClass?U:G;return t[e]||(t[e]=e.replace(/\S+/g,"cm-$&"))}function Bn(e,t){var n,r,i,o,l,a,s=ot("span",null,null,Ge?"padding-right: .1px":null),c={pre:ot("pre",[s],"CodeMirror-line"),content:s,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:e.getOption("lineWrapping")};for(t.measure={},n=0;n<=(t.rest?t.rest.length:0);n++)r=n?t.rest[n-1]:t.line,i=void 0,c.pos=0,c.addToken=Vn,o=e.display.measure,a=l=void 0,(null!=T?T:(a=it(o,document.createTextNode("AخA")),l=y(a,0,1).getBoundingClientRect(),a=y(a,1,2).getBoundingClientRect(),rt(o),l&&l.left!=l.right&&(T=a.right-l.right<3)))&&(i=Ot(r,e.doc.direction))&&(c.addToken=function(d,h){return function(e,t,n,r,u,i,o){var l,a,s,c;for(n=n?n+" cm-force-border":"cm-force-border",a=(l=e.pos)+t.length;;){for(s=void 0,c=0;cl&&s.from<=l);c++);if(s.to>=a)return d(e,t,n,r,u,i,o);d(e,t.slice(0,s.to-l),n,r,null,i,o),r=null,t=t.slice(s.to-l),l=s.to}}}(c.addToken,i)),c.map=[],function(u,e,d){var h,t,f,n,p,g,r,m,y,v,i,o,b,l,w,a,s,x,k,C,c,S,T,L,M=u.markedSpans,N=u.text,A=0;if(M)for(h=N.length,t=0,f=1,n="",r=0;;){if(r==t){m=y=v=g="",i=o=null,r=Infinity;for(b=[],l=void 0,w=0;wt||s.collapsed&&a.to==t&&a.from==t)){if(null!=a.to&&a.to!=t&&r>a.to&&(r=a.to,y=""),s.className&&(m+=" "+s.className),s.css&&(g=(g?g+";":"")+s.css),s.startStyle&&a.from==t&&(v+=" "+s.startStyle),s.endStyle&&a.to==r&&(l=l||[]).push(s.endStyle,a.to),s.title&&((o=o||{}).title=s.title),s.attributes)for(x in s.attributes)(o=o||{})[x]=s.attributes[x];s.collapsed&&(!i||Mn(i.marker,s)<0)&&(i=a)}else a.from>t&&r>a.from&&(r=a.from)}if(l)for(k=0;kn)return{map:e.measure.maps[i],cache:e.measure.caches[i],before:!0}}}function ur(e,t,n,r){return fr(e,hr(e,t),n,r)}function dr(e,t){if(t>=e.display.viewFrom&&t=e.lineN&&tt)&&(i=(o=s-a)-1,s<=t&&(l="right")),null!=i){if(r=e[c+2],a==s&&n==(r.insertLeft?"left":"right")&&(l=n),"left"==n&&0==i)for(;c&&e[c-2]==e[c-3]&&e[c-1].insertLeft;)r=e[2+(c-=3)],l="left";if("right"==n&&i==s-a)for(;c=r.text.length?(t=r.text.length,e="before"):t<=0&&(t=0,e="after"),o?(a=Nt(o,t,e),l=h,a=c(t,a,"before"==e),null!=l&&(a.other=c(t,l,"before"!=e)),a):s("before"==e?t-1:t,"before"==e);function c(e,t,n){return s(n?e-1:e,1==o[t].level!=n)}}function Tr(e,t){var n=0;return t=O(e.doc,t),{left:n=e.options.lineWrapping?n:Pr(e.display)*t.ch,right:n,top:t=Hn(n=N(e.doc,t.line))+rr(e.display),bottom:t+n.height}}function Lr(e,t,n,r,i){e=A(e,t,n);return e.xRel=i,r&&(e.outside=r),e}function Mr(e,t,n){var r,i,o,l,a,s=e.doc;if((n+=e.display.viewOffset)<0)return Lr(s.first,0,null,-1,-1);if(r=en(s,n),(i=s.first+s.size-1)t)&&(!n||Mn(n,i.marker)<0)&&(n=i.marker);return n}(o,(a=function(n,e,u,r,i){var d,h,f,t,p,o,l,g,a,s,c;i-=Hn(e);d=hr(n,e),h=wr(e),f=0,c=e.text.length,t=!0,l=Ot(e,n.doc.direction);l&&(l=(n.options.lineWrapping?zr:Dr)(n,e,u,d,l,r,i),t=1!=l.level,f=t?l.from:l.to-1,c=t?l.to:l.from-1);p=null,o=null,l=Mt(function(e){var t=fr(n,d,e);return t.top+=h,t.bottom+=h,Or(t,r,i,!1)&&(t.top<=i&&t.left<=r&&(p=e,o=t),1)},f,c),g=!1;o?(a=r-o.left=c.bottom?1:0);return l=Lt(e.text,l,1),Lr(u,l,s,g,r-a)}(e,o,r,t,n)).ch+(0r},i,e)}}function Ar(e,t,n,r){return Nr(e,t,n=n||hr(e,t),xr(e,t,fr(e,n,r),"line").top)}function Or(e,t,n,r){return!(e.bottom<=n)&&(e.top>n||(r?e.left:e.right)>t)}function Dr(n,r,i,o,l,a,s){var e,t=Mt(function(e){var e=l[e],t=1!=e.level;return Or(Sr(n,A(i,t?e.to:e.from,t?"before":"after"),"line",r,o),a,s,!0)},0,l.length-1),c=l[t];return 0s&&(c=l[t-1])),c}function zr(u,d,h,f,e,t,n){var r,i,o,l,a,n=Nr(u,d,f,n),s=n.begin,c=n.end;for(/\s/.test(d.text.charAt(c-1))&&c--,i=r=null,o=0;o=c||l.to<=s||(a=(a=fr(u,f,1!=l.level?Math.min(c,l.to)-1:Math.max(s,l.from)).right)c?{from:r.from,to:c,level:r.level}:r}function Wr(e){var t,n;if(null!=e.cachedTextHeight)return e.cachedTextHeight;if(null==X){for(X=M("pre",null,"CodeMirror-line-like"),t=0;t<49;++t)X.appendChild(document.createTextNode("x")),X.appendChild(M("br"));X.appendChild(document.createTextNode("x"))}return it(e.measure,X),3<(n=X.offsetHeight/50)&&(e.cachedTextHeight=n),rt(e.measure),n||1}function Pr(e){var t,n;return null!=e.cachedCharWidth?e.cachedCharWidth:(n=M("span","xxxxxxxxxx"),t=M("pre",[n],"CodeMirror-line-like"),it(e.measure,t),2<(n=((t=n.getBoundingClientRect()).right-t.left)/10)&&(e.cachedCharWidth=n),n||10)}function Er(e){for(var t,n=e.display,r={},i={},o=n.gutters.clientLeft,l=n.gutters.firstChild,a=0;l;l=l.nextSibling,++a)r[t=e.display.gutterSpecs[a].className]=l.offsetLeft+l.clientLeft+o,i[t]=l.clientWidth;return{fixedPos:Hr(n),gutterTotalWidth:n.gutters.offsetWidth,gutterLeft:r,gutterWidth:i,wrapperWidth:n.wrapper.clientWidth}}function Hr(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function Ir(r){var i=Wr(r.display),o=r.options.lineWrapping,l=o&&Math.max(5,r.display.scroller.clientWidth/Pr(r.display)-3);return function(e){var t,n;if(En(r.doc,e))return 0;if(t=0,e.widgets)for(n=0;n=e.display.viewTo)return null;if((t-=e.display.viewFrom)<0)return null;for(n=e.display.view,r=0;rt)&&(i.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=i.viewTo?V&&Wn(e.doc,t)i.viewFrom?Kr(e):(i.viewFrom+=r,i.viewTo+=r):t<=i.viewFrom&&n>=i.viewTo?Kr(e):t<=i.viewFrom?(l=Gr(e,n,n+r,1))?(i.view=i.view.slice(l.index),i.viewFrom=l.lineN,i.viewTo+=r):Kr(e):n>=i.viewTo?(l=Gr(e,t,t,-1))?(i.view=i.view.slice(0,l.index),i.viewTo=l.lineN):Kr(e):(l=Gr(e,t,t,-1),o=Gr(e,n,n+r,1),l&&o?(i.view=i.view.slice(0,l.index).concat(Un(e,l.lineN,o.lineN)).concat(i.view.slice(o.index)),i.viewTo+=r):Kr(e)),(l=i.externalMeasured)&&(n=i.lineN&&t=r.viewTo||null!=(i=r.view[Br(e,t)]).node&&-1==gt(o=i.changes||(i.changes=[]),n)&&o.push(n)}function Kr(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function Gr(e,t,n,r){var i,o,l,a=Br(e,t),s=e.display.view;if(!V||n==e.doc.first+e.doc.size)return{index:a,lineN:n};for(o=e.display.viewFrom,l=0;l=e.display.viewTo||s.to().linet||t==n&&l.to==t)&&(r(Math.max(l.from,t),Math.min(l.to,n),1==l.level?"rtl":"ltr",o),i=!0);i||r(t,n,"ltr")}(b=Ot(r,o.direction),g||0,null==m?w:m,function(e,t,n,r){var u,i,d,o,l,a="ltr"==n,s=x(e,a?"left":"right"),c=x(t-1,a?"right":"left"),h=null==g&&0==e,f=null==m&&t==w,p=0==r,r=!b||r==b.length-1;c.top-s.top<=3?(u=(T?h:f)&&p?C:(a?s:c).left,l=(T?f:h)&&r?S:(a?c:s).right,L(u,s.top,l-u,s.bottom)):(l=a?(i=T&&h&&p?C:s.left,d=T?S:k(e,n,"before"),o=T?C:k(t,n,"after"),T&&f&&r?S:c.right):(i=T?k(e,n,"before"):C,d=!T&&h&&p?S:s.right,o=!T&&f&&r?C:c.left,T?k(t,n,"after"):S),L(i,s.top,d-i,s.bottom),s.bottome.display.sizerWidth&&(u=Math.ceil(r/Pr(e.display)))>e.display.maxLineLength&&(e.display.maxLineLength=u,e.display.maxLine=t.line,e.display.maxLineChanged=!0)}2=o&&(i=en(t,Hn(N(t,n))-e.wrapper.clientHeight),o=n)),{from:i,to:Math.max(o,i+1)}}function ii(e,t){var n,r,i,o,l,a,s=e.display,c=Wr(e.display);return t.top<0&&(t.top=0),n=(e.curOp&&null!=e.curOp.scrollTop?e.curOp:s.scroller).scrollTop,a=sr(e),r={},t.bottom-t.top>a&&(t.bottom=t.top+a),l=e.doc.height+ir(s),o=t.topl-c,t.topn+a&&(i=Math.min(t.top,(c?l:t.bottom)-a))!=n&&(r.scrollTop=i),o=e.options.fixedGutter?0:s.gutters.offsetWidth,c=e.curOp&&null!=e.curOp.scrollLeft?e.curOp.scrollLeft:s.scroller.scrollLeft-o,l=ar(e)-s.gutters.offsetWidth,(a=t.right-t.left>l)&&(t.right=t.left+l),t.left<10?r.scrollLeft=0:t.leftl+c-3&&(r.scrollLeft=t.right+(a?0:10)-l),r}function oi(e,t){null!=t&&(si(e),e.curOp.scrollTop=(null==e.curOp.scrollTop?e.doc:e.curOp).scrollTop+t)}function li(e){si(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function ai(e,t,n){null==t&&null==n||si(e),null!=t&&(e.curOp.scrollLeft=t),null!=n&&(e.curOp.scrollTop=n)}function si(e){var t=e.curOp.scrollToPos;t&&(e.curOp.scrollToPos=null,ci(e,Tr(e,t.from),Tr(e,t.to),t.margin))}function ci(e,t,n,r){t=ii(e,{left:Math.min(t.left,n.left),top:Math.min(t.top,n.top)-r,right:Math.max(t.right,n.right),bottom:Math.max(t.bottom,n.bottom)+r});ai(e,t.scrollLeft,t.scrollTop)}function ui(e,t){Math.abs(e.doc.scrollTop-t)<2||(Be||Mi(e,{top:t}),di(e,t,!0),Be&&Mi(e),Ci(e,100))}function di(e,t,n){t=Math.max(0,Math.min(e.display.scroller.scrollHeight-e.display.scroller.clientHeight,t)),e.display.scroller.scrollTop==t&&!n||(e.doc.scrollTop=t,e.display.scrollbars.setScrollTop(t),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t))}function hi(e,t,n,r){t=Math.max(0,Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth)),(n?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)&&!r||(e.doc.scrollLeft=t,Oi(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t))}function fi(e){var t=e.display,n=t.gutters.offsetWidth,r=Math.round(e.doc.height+ir(e.display));return{clientHeight:t.scroller.clientHeight,viewHeight:t.wrapper.clientHeight,scrollWidth:t.scroller.scrollWidth,clientWidth:t.scroller.clientWidth,viewWidth:t.wrapper.clientWidth,barLeft:e.options.fixedGutter?n:0,docHeight:r,scrollHeight:r+lr(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:n}}function pi(e,t){var n,r,i;for(t=t||fi(e),n=e.display.barWidth,r=e.display.barHeight,gi(e,t),i=0;i<4&&n!=e.display.barWidth||r!=e.display.barHeight;i++)n!=e.display.barWidth&&e.options.lineWrapping&&ti(e),gi(e,fi(e)),n=e.display.barWidth,r=e.display.barHeight}function gi(e,t){var n=e.display,r=n.scrollbars.update(t);n.sizer.style.paddingRight=(n.barWidth=r.right)+"px",n.sizer.style.paddingBottom=(n.barHeight=r.bottom)+"px",n.heightForcer.style.borderBottom=r.bottom+"px solid transparent",r.right&&r.bottom?(n.scrollbarFiller.style.display="block",n.scrollbarFiller.style.height=r.bottom+"px",n.scrollbarFiller.style.width=r.right+"px"):n.scrollbarFiller.style.display="",r.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(n.gutterFiller.style.display="block",n.gutterFiller.style.height=r.bottom+"px",n.gutterFiller.style.width=t.gutterWidth+"px"):n.gutterFiller.style.display=""}function mi(n){n.display.scrollbars&&(n.display.scrollbars.clear(),n.display.scrollbars.addClass&&l(n.display.wrapper,n.display.scrollbars.addClass)),n.display.scrollbars=new Y[n.options.scrollbarStyle](function(e){n.display.wrapper.insertBefore(e,n.display.scrollbarFiller),w(e,"mousedown",function(){n.state.focused&&setTimeout(function(){return n.display.input.focus()},0)}),e.setAttribute("cm-not-content","true")},function(e,t){("horizontal"==t?hi:ui)(n,e)},n),n.display.scrollbars.addClass&&st(n.display.wrapper,n.display.scrollbars.addClass)}function yi(e){e.curOp={cm:e,viewChanged:!1,startHeight:e.doc.height,forceUpdate:!1,updateInput:0,typing:!1,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,focus:!1,id:++Z,markArrays:null},e=e.curOp,q?q.ops.push(e):e.ownsGroup=q={ops:[e],delayedCallbacks:[]}}function vi(e){e=e.curOp;if(e){var t=function(u){for(var e,d,h,f,p,g,m=0;m=y.viewTo)||y.maxLineChanged&&n.options.lineWrapping,t.update=t.mustUpdate&&new Q(n,t.mustUpdate&&{top:t.scrollTop,ensure:t.scrollToPos},t.forceUpdate)}for(h=0;h(i.defaultView.innerHeight||i.documentElement.clientHeight)&&(r=!1),null==r||Ye||(o=M("div","​",null,"position: absolute;\n top: "+(t.top-n.viewOffset-rr(e.display))+"px;\n height: "+(t.bottom-t.top+lr(e)+n.barHeight)+"px;\n left: "+t.left+"px; width: "+Math.max(2,t.right-t.left)+"px;"),e.display.lineSpace.appendChild(o),o.scrollIntoView(r),e.display.lineSpace.removeChild(o)))}(c,w));x=s.maybeHiddenMarkers,k=s.maybeUnhiddenMarkers;if(x)for(C=0;C=l.display.viewTo||(a=+new Date+l.options.workTime,s=hn(l,u.highlightFrontier),c=[],u.iter(s.line,Math.min(u.first+u.size,l.display.viewTo+500),function(e){var t,n,r,i,o;if(s.line>=l.display.viewFrom){for(t=e.styles,n=e.text.length>l.options.maxHighlightLength?_t(u.mode,s.state):null,r=un(l,e,s,!0),n&&(s.state=n),e.styles=r.styles,n=e.styleClasses,(r=r.classes)?e.styleClasses=r:n&&(e.styleClasses=null),i=!t||t.length!=e.styles.length||n!=r&&(!n||!r||n.bgClass!=r.bgClass||n.textClass!=r.textClass),o=0;!i&&oa)return Ci(l,l.options.workDelay),!0}),u.highlightFrontier=s.line,u.modeFrontier=Math.max(u.modeFrontier,s.line),c.length&&bi(l,function(){for(var e=0;e=a.viewFrom&&t.visible.to<=a.viewTo&&(null==a.updateLineNumbers||a.updateLineNumbers>=a.viewTo)&&a.renderedView==a.view&&0==Ur(e))return!1;if( -Di(e)&&(Kr(e),t.dims=Er(e)),n=u.first+u.size,c=Math.max(t.visible.from-e.options.viewportMargin,u.first),i=Math.min(n,t.visible.to+e.options.viewportMargin),a.viewFromi&&a.viewTo-i<20&&(i=Math.min(n,a.viewTo)),V&&(c=Wn(e.doc,c),i=Pn(e.doc,i)),u=c!=a.viewFrom||i!=a.viewTo||a.lastWrapHeight!=t.wrapperHeight||a.lastWrapWidth!=t.wrapperWidth,n=c,c=i,0==(r=(i=e).display).view.length||n>=r.viewTo||c<=r.viewFrom?(r.view=Un(i,n,c),r.viewFrom=n):(r.viewFrom>n?r.view=Un(i,n,r.viewFrom).concat(r.view):r.viewFromc&&(r.view=r.view.slice(0,Br(i,c)))),r.viewTo=c,a.viewOffset=Hn(N(e.doc,a.viewFrom)),e.display.mover.style.top=a.viewOffset+"px",n=Ur(e),!u&&0==n&&!t.force&&a.renderedView==a.view&&(null==a.updateLineNumbers||a.updateLineNumbers>=a.viewTo))return!1;r=!(i=e).hasFocus()&&(o=at(ut(i)))&<(i.display.lineDiv,o)?(o={activeElt:o},window.getSelection&&(l=dt(i).getSelection()).anchorNode&&l.extend&<(i.display.lineDiv,l.anchorNode)&&(o.anchorNode=l.anchorNode,o.anchorOffset=l.anchorOffset,o.focusNode=l.focusNode,o.focusOffset=l.focusOffset),o):null,4=e.display.viewFrom&&t.visible.to<=e.display.viewTo)break;if(!Ti(e,t))break;ti(e),n=fi(e),qr(e),pi(e,n),Ai(e,n),t.force=!1}t.signal(e,"update",e),e.display.viewFrom==e.display.reportedViewFrom&&e.display.viewTo==e.display.reportedViewTo||(t.signal(e,"viewportChange",e,e.display.viewFrom,e.display.viewTo),e.display.reportedViewFrom=e.display.viewFrom,e.display.reportedViewTo=e.display.viewTo)}function Mi(e,t){var n,t=new Q(e,t);Ti(e,t)&&(ti(e),Li(e,t),n=fi(e),qr(e),pi(e,n),Ai(e,n),t.finish())}function Ni(e){var t=e.gutters.offsetWidth;e.sizer.style.marginLeft=t+"px",qn(e,"gutterChanged",e)}function Ai(e,t){e.display.sizer.style.minHeight=t.docHeight+"px",e.display.heightForcer.style.top=t.docHeight+"px",e.display.gutters.style.height=t.docHeight+e.display.barHeight+lr(e)+"px"}function Oi(e){var t,n,r,i,o,l,a=e.display,s=a.view;if(a.alignWidgets||a.gutters.firstChild&&e.options.fixedGutter){for(t=Hr(a)-a.scroller.scrollLeft+e.doc.scrollLeft,n=a.gutters.offsetWidth,r=t+"px",i=0;io.clientWidth,c=o.scrollHeight>o.clientHeight,n&&s||r&&c){if(r&&et&&Ge)e:for(l=t.target,u=i.view;l!=o;l=l.parentNode)for(d=0;di-(e.cm?e.cm.options.historyEventDelay:500)||"*"==t.origin.charAt(0)))&&(a=(a=s).lastOp==r?(eo(a.done),vt(a.done)):a.done.length&&!vt(a.done).ranges?vt(a.done):1s.undoDepth;)s.done.shift(),s.done[0].ranges||s.done.shift();s.done.push(n),s.generation=++s.maxGeneration,s.lastModTime=s.lastSelTime=i,s.lastOp=s.lastSelOp=r,s.lastOrigin=s.lastSelOrigin=t.origin,o||Wt(e,"historyAdded")}function no(e,t,n,r){var i,o,l,a=e.history,s=r&&r.origin;n==a.lastSelOp||s&&a.lastSelOrigin==s&&(a.lastModTime==a.lastSelTime&&a.lastOrigin==s||(e=e,i=s,o=vt(a.done),l=t,"*"==(i=i.charAt(0))||"+"==i&&o.ranges.length==l.ranges.length&&o.somethingSelected()==l.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)))?a.done[a.done.length-1]=t:ro(t,a.done),a.lastSelTime=+new Date,a.lastSelOrigin=s,a.lastSelOp=n,r&&!1!==r.clearRedo&&eo(a.undone)}function ro(e,t){var n=vt(t);n&&n.ranges&&n.equals(e)||t.push(e)}function io(t,n,e,r){var i=n["spans_"+t.id],o=0;t.iter(Math.max(t.first,e),Math.min(t.first+t.size,r),function(e){e.markedSpans&&((i=i||(n["spans_"+t.id]={}))[o]=e.markedSpans),++o})}function oo(e,t){var n,r,i=t["spans_"+e.id];if(!i)return null;for(n=[],r=0;r=t.ch:s.to>t.ch))){if(d&&(Wt(i,"beforeCursorEnter"),i.explicitlyCleared)){if(c.markedSpans){--r;continue}break}if(i.atomic)return u&&(a=i.find(n<0?1:-1),s=void 0,(a=(n<0?l:o)?ko(e,a,-n,a&&a.line==t.line?c:null):a)&&a.line==t.line&&(s=k(a,u))&&(n<0?s<0:0e.first?O(e,A(t.line-1)):null:0e.lastLine())){if(t.from.liner?{from:t.from,to:A(r,N(e,r).text.length),text:[t.text[0]],origin:t.origin}:t).removed=Yt(e,t.from,t.to),u=u||Ki(e,t),e.cm){var h,n,f,r=e.cm,i=t,o=d,l=r.doc,p=r.display,a=i.from,g=i.to,m=!1,s=a.line,c=(r.options.lineWrapping||(s=Jt(zn(N(l,a.line))),l.iter(s,g.line+1,function(e){if(e==p.maxLine)return m=!0})),-1p.maxLineLength&&(p.maxLine=e,p.maxLineLength=t,p.maxLineChanged=!0,m=!1)}),m&&(r.curOp.updateMaxLine=!0)),l),y=a.line;if(c.modeFrontier=Math.min(c.modeFrontier,y),!(c.highlightFrontier=this.string.length},I.prototype.sol=function(){return this.pos==this.lineStart},I.prototype.peek=function(){return this.string.charAt(this.pos)||undefined},I.prototype.next=function(){if(this.post},I.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},I.prototype.skipToEnd=function(){this.pos=this.string.length},I.prototype.skipTo=function(e){e=this.string.indexOf(e,this.pos);if(-1this.maxLookAhead&&(this.maxLookAhead=e),t},R.prototype.baseToken=function(e){if(!this.baseTokens)return null;for(;this.baseTokens[this.baseTokenPos]<=e;)this.baseTokenPos+=2;var t=this.baseTokens[this.baseTokenPos+1];return{type:t&&t.replace(/( |^)overlay .*/,""),size:this.baseTokens[this.baseTokenPos]-e}},R.prototype.nextLine=function(){this.line++,0e.clientWidth+1,r=e.scrollHeight>e.clientHeight+1,i=e.nativeBarWidth;return r?(this.vert.style.display="block",this.vert.style.bottom=n?i+"px":"0",t=e.viewHeight-(n?i:0),this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+t)+"px"):(this.vert.scrollTop=0,this.vert.style.display="",this.vert.firstChild.style.height="0"),n?(this.horiz.style.display="block",this.horiz.style.right=r?i+"px":"0",this.horiz.style.left=e.barLeft+"px",t=e.viewWidth-e.barLeft-(r?i:0),this.horiz.firstChild.style.width=Math.max(0,e.scrollWidth-e.clientWidth+t)+"px"):(this.horiz.style.display="",this.horiz.firstChild.style.width="0"),!this.checkedZeroWidth&&0e.display.maxLineLength&&(e.display.maxLine=c,e.display.maxLineLength=u,e.display.maxLineChanged=!0);null!=r&&e&&this.collapsed&&jr(e,r,i+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&vo(e.doc)),e&&qn(e,"markerCleared",e,this,r,i),t&&vi(e),this.parent&&this.parent.clear()}},oe.prototype.find=function(e,t){var n,r,i,o,l;for(null==e&&"bookmark"==this.type&&(e=1),i=0;i=e.ch)&&i.push(r.marker.parent||r.marker);return i},findMarks:function(i,o,l){i=O(this,i),o=O(this,o);var a=[],s=i.line;return this.iter(i.line,o.line+1,function(e){var t,n,r=e.markedSpans;if(r)for(t=0;t=n.to||null==n.from&&s!=i.line||null!=n.from&&s==o.line&&n.from>=o.ch||l&&!l(n.marker)||a.push(n.marker.parent||n.marker);++s}),a},getAllMarks:function(){var r=[];return this.iter(function(e){var t,n=e.markedSpans;if(n)for(t=0;tt&&(t=e.from),null!=e.to&&e.toe.text.length?null:t}function el(e,t,n){e=Jo(e,t.ch,n);return null==e?null:new A(t.line,e,n<0?"after":"before")}function tl(e,t,n,r,i){var o,l,a,s;return e&&("rtl"==t.doc.direction&&(i=-i),o=Ot(n,t.doc.direction))?(o=i<0==(1==(e=i<0?vt(o):o[0]).level)?"after":"before",0a&&t.push(new ne(A(o,a),A(o,mt(l,i,n))));t.length||t.push(new ne(f,f)),go(g,Ri(h,v.ranges.slice(0,y).concat(t),y),{origin:"*mouse",scroll:!1}),h.scrollIntoView(e)}else c=m,s=hl(h,e,p.unit),e=c.anchor,e=0=t.to||i.linea.bottom?20:0)&&setTimeout(wi(h,function(){s==r&&(l.scroller.scrollTop+=n,o(e))}),50))}:i)(e)}),r=wi(h,i);h.state.selectingText=r,w(l.wrapper.ownerDocument,"mousemove",n),w(l.wrapper.ownerDocument,"mouseup",r)})(t,u,n,d)):Vt(e)==c.scroller&&Ft(e):2==l?(o&&co(s.doc,o),setTimeout(function(){return c.input.focus()},20)):3==l&&(f?s.display.input.onContextMenu(e):Qr(s)))))}function hl(e,t,n){if("char"==n)return new ne(t,t);if("word"==n)return e.findWordAt(t);if("line"==n)return new ne(A(t.line,0),O(e.doc,A(t.line+1,0)));e=n(e,t);return new ne(e.from,e.to)}function fl(e,t,n,r){var i,o,l,a,s;if(t.touches)i=t.touches[0].clientX,o=t.touches[0].clientY;else try{i=t.clientX,o=t.clientY}catch(c){return!1}if(i>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;if(r&&Ft(t),o>(r=(l=e.display).lineDiv.getBoundingClientRect()).bottom||!Ht(e,n))return Bt(t);for(o-=r.top-l.viewOffset,a=0;a=i)return Wt(e,n,e,en(e.doc,o),e.display.gutterSpecs[a].className,t),Bt(t)}function pl(e,t){return fl(e,t,"gutterClick",!0)}function gl(e,t){var n,r;nr(e.display,t)||(r=t,Ht(n=e,"gutterContextMenu")&&fl(n,r,"gutterContextMenu",!1))||Pt(e,t,"contextmenu")||f||e.display.input.onContextMenu(t)}function ml(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),yr(e)}function yl(e,t,n){var n=n&&n!=ke;!t!=!n&&(n=e.display.dragFunctions,(t=t?w:zt)(e.display.scroller,"dragstart",n.start),t(e.display.scroller,"dragenter",n.enter),t(e.display.scroller,"dragover",n.over),t(e.display.scroller,"dragleave",n.leave),t(e.display.scroller,"drop",n.drop))}function vl(e){e.options.lineWrapping?(st(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(l(e.display.wrapper,"CodeMirror-wrap"),Fn(e)),Fr(e),jr(e),yr(e),setTimeout(function(){return pi(e)},100)}function bl(e,t){var n,r,i,o=this;if(!(this instanceof bl))return new bl(e,t);this.options=t=t?ft(t):{},ft(Ce,t,!1),"string"==typeof(n=t.value)?n=new se(n,t.mode,null,t.lineSeparator,t.direction):t.mode&&(n.modeOption=t.mode),this.doc=n,a=new bl.inputStyles[t.inputStyle](this),ml((e=this.display=new Ei(e,n,a,t)).wrapper.CodeMirror=this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),mi(this),this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:!1,delayingBlurEvent:!1,focused:!1,suppressEdits:!1,pasteIncoming:-1,cutIncoming:-1,selectingText:!1,draggingText:!1,highlight:new p,keySeq:null,specialChars:null},t.autofocus&&!Je&&e.input.focus(),x&&Ke<11&&setTimeout(function(){return o.display.input.reset(!0)},20);var u,l,a,s=this,c=s.display;function d(){c.activeTouch&&(u=setTimeout(function(){return c.activeTouch=null},1e3),(l=c.activeTouch).end=+new Date)}function h(e,t){if(null==t.left)return 1;var n=t.left-e.left,t=t.top-e.top;return 400c.first?pt(N(c,t-1).text,null,r):0:"add"==n?l=h+e.options.indentUnit:"subtract"==n?l=h-e.options.indentUnit:"number"==typeof n&&(l=h+n),l=Math.max(0,l),a="",f=0,e.options.indentWithTabs)for(p=Math.floor(l/r);p;--p)f+=r,a+="\t";if(fh,i=L(t),o=null,r&&1h?"cut":"+input")},To(e.doc,c),qn(e,"inputRead",e,c);t&&!r&&Sl(e,t),li(e),e.curOp.updateInput<2&&(e.curOp.updateInput=p),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function Cl(e,t){var n=e.clipboardData&&e.clipboardData.getData("Text");return n&&(e.preventDefault(),t.isReadOnly()||t.options.disableInput||!t.hasFocus()||bi(t,function(){return kl(t,n,0,null,"paste")}),1)}function Sl(e,t){var n,r,i,o,l,a;if(e.options.electricChars&&e.options.smartIndent)for(r=(n=e.doc.sel).ranges.length-1;0<=r;r--)if(!(100<(i=n.ranges[r]).head.ch||r&&n.ranges[r-1].head.line==i.head.line)){if(l=!1,(o=e.getModeAt(i.head)).electricChars){for(a=0;a=n.text.length?(a.ch=n.text.length,a.sticky="before"):a.ch<=0&&(a.ch=0,a.sticky="after"),o=Nt(c,a.ch,a.sticky),i=c[o],"ltr"==t.doc.direction&&i.level%2==0&&(0a.ch:i.from=i.from&&r>=l.begin))?!(o=(i=function(e,t,n){for(var r,i,o,l=function(e,t){return t?new A(a.line,s(e,1),"before"):new A(a.line,e,"after")};0<=e&&e=g.first+g.size||(m=new A(p,m.ch,m.sticky),!(b=N(g,p))))return;m=tl(w,g.cm,b,m.line,x)}else m=l;return 1}if("char"==v||"codepoint"==v)i();else if("column"==v)i(!0);else if("word"==v||"group"==v)for(e=null,o="group"==v,l=g.cm&&g.cm.getHelper(m,"wordChars"),t=!0;!(y<0)||i(!t);t=!1){if(n=Ct(n=b.text.charAt(m.ch)||"\n",l)?"w":o&&"\n"==n?"n":!o||/\s/.test(n)?null:"p",!o||t||n||(n="s"),e&&e!=n){y<0&&(y=1,i(),m.sticky="after");break}if(n&&(e=n),0=a.height){l.hitSide=!0;break}i+=5*n}return l}function Ol(e,t){var n,r,i=dr(e,t.line);return!i||i.hidden?null:(n=cr(i,i=N(e.doc,t.line),t.line),r="left",(i=Ot(i,e.doc.direction))&&(r=Nt(i,t.ch)%2?"right":"left"),(e=pr(n.map,t.ch,r)).offset="right"==e.collapse?e.end:e.start,e)}function Dl(e,t){return t&&(e.bad=!0),e}function zl(e,u,d){var t,h;if(u==e.display.lineDiv){if(!(t=e.display.lineDiv.childNodes[d]))return Dl(e.clipPos(A(e.display.viewTo-1)),!0);u=null,d=0}else for(t=u;;t=t.parentNode){if(!t||t==e.display.lineDiv)return null;if(t.parentNode&&t.parentNode==e.display.lineDiv)break}for(h=0;hl.doc.first&&(n=N(l.doc,e.line-1).text)&&(e=new A(e.line,1),l.replaceRange(t.charAt(0)+l.doc.lineSeparator()+n.charAt(n.length-1),A(e.line-1,n.length-1),e,"+transpose"))),i.push(new ne(e,e)));l.setSelections(i)})},newlineAndIndent:function(r){return bi(r,function(){for(var e,t=r.listSelections(),n=t.length-1;0<=n;n--)r.replaceRange(r.doc.lineSeparator(),t[n].anchor,t[n].head,"+input");for(t=r.listSelections(),e=0;ee&&0==k(t,this.pos)&&n==this.button},ke={toString:function(){return"CodeMirror.Init"}},Ce={},Se={},bl.defaults=Ce,bl.optionHandlers=Se,Te=[],bl.defineInitHook=function(e){return Te.push(e)},Le=null,(t=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new p,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null}).prototype.init=function(e){var t=this,o=this,l=o.cm,a=o.div=e.lineDiv;function s(e){for(var t=e.target;t;t=t.parentNode){if(t==a)return 1;if(/\bCodeMirror-(?:line)?widget\b/.test(t.className))break}}function n(e){var t,n,r,i;if(s(e)&&!Pt(l,e)){if(l.somethingSelected())xl({lineWise:!1,text:l.getSelections()}),"cut"==e.type&&l.replaceSelection("",null,"cut");else{if(!l.options.lineWiseCopyCut)return;xl({lineWise:!0,text:(t=Tl(l)).text}),"cut"==e.type&&l.operation(function(){l.setSelections(t.ranges,0,v),l.replaceSelection("",null,"cut")})}e.clipboardData&&(e.clipboardData.clearData(),r=Le.text.join("\n"),e.clipboardData.setData("Text",r),e.clipboardData.getData("Text")==r)?e.preventDefault():(Ll(r=(n=Ml()).firstChild),l.display.lineSpace.insertBefore(n,l.display.lineSpace.firstChild),r.value=Le.text.join("\n"),i=at(a.ownerDocument),c(r),setTimeout(function(){l.display.lineSpace.removeChild(n),i.focus(),i==a&&o.showPrimarySelection()},50))}}a.contentEditable=!0,Ll(a,l.options.spellcheck,l.options.autocorrect,l.options.autocapitalize),w(a,"paste",function(e){!s(e)||Pt(l,e)||Cl(e,l)||Ke<=11&&setTimeout(wi(l,function(){return t.updateFromDOM()}),20)}),w(a,"compositionstart",function(e){t.composing={data:e.data,done:!1}}),w(a,"compositionupdate",function(e){t.composing||(t.composing={data:e.data,done:!1})}),w(a,"compositionend",function(e){t.composing&&(e.data!=t.composing.data&&t.readFromDOMSoon(),t.composing.done=!0)}),w(a,"touchstart",function(){return o.forceCompositionEnd()}),w(a,"input",function(){t.composing||t.readFromDOMSoon()}),w(a,"copy",n),w(a,"cut",n)},t.prototype.screenReaderLabelChanged=function(e){e?this.div.setAttribute("aria-label",e):this.div.removeAttribute( -"aria-label")},t.prototype.prepareSelection=function(){var e=_r(this.cm,!1);return e.focus=at(this.div.ownerDocument)==this.div,e},t.prototype.showSelection=function(e,t){e&&this.cm.display.view.length&&((e.focus||t)&&this.showPrimarySelection(),this.showMultipleSelections(e))},t.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},t.prototype.showPrimarySelection=function(){var e,t,n,r=this.getSelection(),i=this.cm,o=i.doc.sel.primary(),l=o.from(),o=o.to();if(i.display.viewTo==i.display.viewFrom||l.line>=i.display.viewTo||o.line=i.display.viewFrom&&Ol(i,l)||{node:t[0].measure.map[2],offset:0},l=(l=o.linee.firstLine()&&(t=A(t.line-1,N(e.doc,t.line-1).length)),n.ch==N(e.doc,n.line).text.length&&n.lines.viewTo-1)return!1;if(c=t.line==s.viewFrom||0==(c=Br(e,t.line))?(u=Jt(s.view[0].line),s.view[0].node):(u=Jt(s.view[c].line),s.view[c-1].node.nextSibling),n=(n=Br(e,n.line))==s.view.length-1?(d=s.viewTo-1,s.lineDiv.lastChild):(d=Jt(s.view[n+1].line)-1,s.view[n+1].node.previousSibling),!c)return!1;for(r=e.doc.splitLines(function(l,e,t,f,p){var n="",a=!1,s=l.doc.lineSeparator(),c=!1;function u(){a&&(n+=s,c&&(n+=s),a=c=!1)}function d(e){e&&(u(),n+=e)}for(;!function h(e){var t,n,r,i,o;if(1==e.nodeType){if(n=e.getAttribute("cm-text"))d(n);else if(n=e.getAttribute("cm-marker"))(n=l.findMarks(A(f,0),A(p+1,0),(o=+n,function(e){return e.id==o}))).length&&(t=n[0].find(0))&&d(Yt(l.doc,t.from,t.to).join(s));else if("false"!=e.getAttribute("contenteditable")&&(r=/^(pre|div|p|li|table|br)$/i.test(e.nodeName),/^br$/i.test(e.nodeName)||0!=e.textContent.length)){for(r&&u(),i=0;it.ch&&a.charCodeAt(a.length-l-1)==g.charCodeAt(g.length-l-1);)o--,l++;return r[r.length-1]=a.slice(0,a.length-l).replace(/^\u200b+/,""),r[0]=r[0].slice(o).replace(/\u200b+$/,""),s=A(u,o),c=A(d,i.length?vt(i).length-l:0),1l&&(wl(this,i.head.line,e,!0),l=i.head.line,a==this.doc.sel.primIndex&&li(this));else{for(t=i.from(),i=i.to(),n=Math.max(l,t.line),l=Math.min(this.lastLine(),i.line-(i.ch?0:1))+1,r=n;r>1)?t[2*l-1]:0)>=i)r=l;else{if(!(t[2*l+1]l)&&e.top>t.offsetHeight?s=e.top-t.offsetHeight:e.bottom+t.offsetHeight<=l&&(s=e.bottom),c+t.offsetWidth>o&&(c=o-t.offsetWidth)),t.style.top=s+"px",t.style.left=t.style.right="","right"==i?(c=a.sizer.clientWidth-t.offsetWidth,t.style.right="0px"):("left"==i?c=0:"middle"==i&&(c=(a.sizer.clientWidth-t.offsetWidth)/2),t.style.left=c+"px"),n&&(r=this,l={left:c,top:s,right:c+t.offsetWidth,bottom:s+t.offsetHeight},null!=(l=ii(r,l)).scrollTop&&ui(r,l.scrollTop),null!=l.scrollLeft&&hi(r,l.scrollLeft))},triggerOnKeyDown:xi(sl),triggerOnKeyPress:xi(ul),triggerOnKeyUp:cl,triggerOnMouseDown:xi(dl),execCommand:function(e){if(me.hasOwnProperty(e))return me[e].call(null,this)},triggerElectric:xi(function(e){Sl(this,e)}),findPosH:function(e,t,n,r){var i,o,l=1;for(t<0&&(l=-1,t=-t),i=O(this.doc,e),o=0;o","i")}function o(e,t){var n,r,i,o;for(n in e)for(r=t[n]||(t[n]=[]),o=(i=e[n]).length-1;0<=o;o--)r.unshift(i[o])}n={},d.defineMode("htmlmixed",function(a,e){var t,s=d.getMode(a,{name:"xml",htmlMode:!0,multilineTagIndentFactor:e.multilineTagIndentFactor,multilineTagIndentPastTag:e.multilineTagIndentPastTag,allowMissingTagName:e.allowMissingTagName}),c={},n=e&&e.tags,r=e&&e.scriptTypes;if(o(i,c),n&&o(n,c),r)for(t=r.length-1;0<=t;t--)c.script.unshift(["type",r[t].matches,r[t].mode]);function u(e,t){var n,o,l,r=s.token(e,t.htmlState),i=/\btag\b/.test(r);return i&&!/[<>\s\/]/.test(e.current())&&(n=t.htmlState.tagName&&t.htmlState.tagName.toLowerCase())&&c.hasOwnProperty(n)?t.inTag=n+" ":t.inTag&&i&&/>$/.test(e.current())?(n=/^([\S]+) (.*)/.exec(t.inTag),t.inTag=null,i=">"==e.current()&&function(e,t){for(var n,r=0;r")):null:t.match("--")?r(p("comment","--\x3e")):t.match("DOCTYPE",!0,!0)?(t.eatWhile(/[\w\._\-]/),r(function i(r){return function(e,t){for(var n;null!=(n=e.next());){if("<"==n)return t.tokenize=i(r+1),t.tokenize(e,t);if(">"==n){if(1!=r)return t.tokenize=i(r-1),t.tokenize(e,t);t.tokenize=s;break}}return"meta"}}(1))):null:t.eat("?")?(t.eatWhile(/[\w\._\-]/),n.tokenize=p("meta","?>"),"meta"):(o=t.eat("/")?"closeTag":"openTag",n.tokenize=f,"tag bracket"):"&"==e?(t.eat("#")?t.eat("x")?t.eatWhile(/[a-fA-F\d]/)&&t.eat(";"):t.eatWhile(/[\d]/)&&t.eat(";"):t.eatWhile(/[\w\.\-:]/)&&t.eat(";"))?"atom":"error":(t.eatWhile(/[^&<]/),null)}function f(e,t){var n,r,i=e.next();return">"==i||"/"==i&&e.eat(">")?(t.tokenize=s,o=">"==i?"endTag":"selfcloseTag","tag bracket"):"="==i?(o="equals",null):"<"==i?(t.tokenize=s,t.state=u,t.tagName=t.tagStart=null,(r=t.tokenize(e,t))?r+" tag error":"tag error"):/[\'\"]/.test(i)?(t.tokenize=(n=i,(r=function(e,t){for(;!e.eol();)if(e.next()==n){t.tokenize=f;break}return"string"}).isInAttribute=!0,r),t.stringStartCol=e.column(),t.tokenize(e,t)):(e.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function p(n,r){return function(e,t){for(;!e.eol();){if(e.match(r)){t.tokenize=s;break}e.next()}return n}}function c(e){return e&&e.toLowerCase()}function g(e,t,n){this.prev=e.context,this.tagName=t||"",this.indent=e.indented,this.startOfLine=n,(a.doNotIndent.hasOwnProperty(t)||e.context&&e.context.noIndent)&&(this.noIndent=!0)}function m(e){e.context&&(e.context=e.context.prev)}function y(e,t){for(var n;;){if(!e.context)return;if(n=e.context.tagName,!a.contextGrabbers.hasOwnProperty(c(n))||!a.contextGrabbers[c(n)].hasOwnProperty(c(t)))return;m(e)}}function u(e,t,n){return"openTag"==e?(n.tagStart=t.column(),v):"closeTag"==e?b:u}function v(e,t,n){return"word"==e?(n.tagName=t.current(),l="tag",d):a.allowMissingTagName&&"endTag"==e?(l="tag bracket",d(e,0,n)):(l="error",v)}function b(e,t,n){var r;return"word"==e?(r=t.current(),n.context&&n.context.tagName!=r&&a.implicitlyClosed.hasOwnProperty(c(n.context.tagName))&&m(n),n.context&&n.context.tagName==r||!1===a.matchClosing?(l="tag",i):(l="tag error",w)):a.allowMissingTagName&&"endTag"==e?(l="tag bracket",i(e,0,n)):(l="error",w)}function i(e,t,n){return"endTag"!=e?(l="error",i):(m(n),u)}function w(e,t,n){return l="error",i(e,0,n)}function d(e,t,n){return"word"==e?(l="attribute",x):"endTag"==e||"selfcloseTag"==e?(r=n.tagName,i=n.tagStart,n.tagName=n.tagStart=null,"selfcloseTag"==e||a.autoSelfClosers.hasOwnProperty(c(r))?y(n,r):(y(n,r),n.context=new g(n,r,i==n.indented)),u):(l="error",d);var r,i}function x(e,t,n){return"equals"==e?k:(a.allowMissing||(l="error"),d(e,0,n))}function k(e,t,n){return"string"==e?C:"word"==e&&a.allowUnquoted?(l="string",d):(l="error",d(e,0,n))}function C(e,t,n){return"string"==e?C:d(e,0,n)}return s.isInText=!0,{startState:function(e){var t={tokenize:s,state:u,indented:e||0,tagName:null,tagStart:null,context:null};return null!=e&&(t.baseIndent=e),t},token:function(e,t){if(!t.tagName&&e.sol()&&(t.indented=e.indentation()),e.eatSpace())return null;o=null;var n=t.tokenize(e,t);return(n||o)&&"comment"!=n&&(l=null,t.state=t.state(o||n,e,t),l&&(n="error"==l?n+" error":l)),n},indent:function(e,t,n){var r,i,o=e.context;if(e.tokenize.isInAttribute)return e.tagStart==e.indented?e.stringStartCol+1:e.indented+h;if(o&&o.noIndent)return S.Pass;if(e.tokenize!=f&&e.tokenize!=s)return n?n.match(/^(\s*)/)[0].length:0;if(e.tagName)return!1!==a.multilineTagIndentPastTag?e.tagStart+e.tagName.length+2:e.tagStart+h*(a.multilineTagIndentFactor||1);if(a.alignCDATA&&/$/,blockCommentStart:"\x3c!--",blockCommentEnd:"--\x3e",configuration:a.htmlMode?"html":"xml",helperType:a.htmlMode?"html":"xml",skipAttribute:function(e){e.state==k&&(e.state=d)},xmlCurrentTag:function(e){return e.tagName?{name:e.tagName,close:"closeTag"==e.type}:null},xmlCurrentContext:function(e){for(var t=[],n=e.context;n;n=n.prev)t.push(n.tagName);return t.reverse()}}}),S.defineMIME("text/xml","xml"),S.defineMIME("application/xml","xml"),S.mimeModes.hasOwnProperty("text/html")||S.defineMIME("text/html",{name:"xml",htmlMode:!0})},"object"==typeof exports&&"object"==typeof module?r(require("../../lib/codemirror")):r(n),r=function(nt){"use strict";nt.defineMode("javascript",function(t,p){var r,i,g,a,n,m,y,v,b,w=t.indentUnit,x=p.statementIndent,k=p.jsonld,C=p.json||k,S=!1!==p.trackScope,c=p.typescript,T=p.wordCharacters||/[\w$\xa1-\uffff]/,L=(t=e("keyword a"),m=e("keyword b"),y=e("keyword c"),v=e("keyword d"),b=e("operator"),{"if":e("if"),"while":t,"with":t,"else":m,"do":m,"try":m,"finally":m,"return":v,"break":v,"continue":v,"new":e("new"),"delete":y,"void":y,"throw":y,"debugger":e("debugger"),"var":e("var"),"const":e("var"),"let":e("var"),"function":e("function"),"catch":e("catch"),"for":e("for"),"switch":e("switch"),"case":e("case"),"default":e("default"),"in":b,"typeof":b,"instanceof":b,"true":t={type:"atom",style:"atom"},"false":t,"null":t,undefined:t,NaN:t,Infinity:t,"this":e("this"),"class":e("class"),"super":e("atom"),"yield":y,"export":e("export"),"import":e("import"),"extends":y,"await":y}),M=/[+\-*&%=<>!?|~^@]/,N=/^@(context|id|value|language|type|container|list|set|reverse|index|base|vocab|graph)"/;function e(e){return{type:e,style:"keyword"}}function A(e,t,n){return r=e,i=n,t}function O(e,t){var i,n=e.next();if('"'==n||"'"==n)return t.tokenize=(i=n,function(e,t){var n,r=!1;if(k&&"@"==e.peek()&&e.match(N))return t.tokenize=O,A("jsonld-keyword","meta");for(;null!=(n=e.next())&&(n!=i||r);)r=!r&&"\\"==n;return r||(t.tokenize=O),A("string","string")}),t.tokenize(e,t);if("."==n&&e.match(/^\d[\d_]*(?:[eE][+\-]?[\d_]+)?/))return A("number","number");if("."==n&&e.match(".."))return A("spread","meta");if(/[\[\]{}\(\),;\:\.]/.test(n))return A(n);if("="==n&&e.eat(">"))return A("=>","operator");if("0"==n&&e.match(/^(?:x[\dA-Fa-f_]+|o[0-7_]+|b[01_]+)n?/))return A("number","number");if(/\d/.test(n))return e.match(/^[\d_]*(?:n|(?:\.[\d_]*)?(?:[eE][+\-]?[\d_]+)?)?/),A("number","number");if("/"==n)return e.eat("*")?(t.tokenize=D)(e,t):e.eat("/")?(e.skipToEnd(),A("comment","comment")):tt(e,t,1)?(function(e){for(var t,n=!1,r=!1;null!=(t=e.next());){if(!n){if("/"==t&&!r)return;"["==t?r=!0:r&&"]"==t&&(r=!1)}n=!n&&"\\"==t}}(e),e.match(/^\b(([gimyus])(?![gimyus]*\2))+\b/),A("regexp","string-2")):(e.eat("="),A("operator","operator",e.current()));if("`"==n)return(t.tokenize=z)(e,t);if("#"==n&&"!"==e.peek())return e.skipToEnd(),A("meta","meta");if("#"==n&&e.eatWhile(T))return A("variable","property");if("<"==n&&e.match("!--")||"-"==n&&e.match("->")&&!/\S/.test(e.string.slice(0,e.start)))return e.skipToEnd(),A("comment","comment");if(M.test(n))return">"==n&&t.lexical&&">"==t.lexical.type||(e.eat("=")?"!"!=n&&"="!=n||e.eat("="):/[<>*+\-|&?]/.test(n)&&(e.eat(n),">"==n&&e.eat(n))),"?"==n&&e.eat(".")?A("."):A("operator","operator",e.current());if(T.test(n)){if(e.eatWhile(T),n=e.current(),"."!=t.lastType){if(L.propertyIsEnumerable(n))return A((t=L[n]).type,t.style,n);if("async"==n&&e.match(/^(\s|\/\*([^*]|\*(?!\/))*?\*\/)*[\[\(\w]/,!1))return A("async","keyword",n)}return A("variable","variable",n)}}function D(e,t){for(var n,r=!1;n=e.next();){if("/"==n&&r){t.tokenize=O;break}r="*"==n}return A("comment","comment")}function z(e,t){for(var n,r=!1;null!=(n=e.next());){if(!r&&("`"==n||"$"==n&&e.eat("{"))){t.tokenize=O;break}r=!r&&"\\"==n}return A("quasi","string-2",e.current())}function W(e,t){var n,r,i,o,l,a,s;if(t.fatArrowAt&&(t.fatArrowAt=null),!((n=e.string.indexOf("=>",e.start))<0)){for(i=0,o=!1,l=(n=c&&(r=/:\s*(?:\w+(?:<[^>]*>|\[\])?|\{[^}]*\})\s*$/.exec(e.string.slice(e.start,n)))?r.index:n)-1;0<=l;--l)if(a=e.string.charAt(l),0<=(s="([{}])".indexOf(a))&&s<3){if(!i){++l;break}if(0==--i){"("==a&&(o=!0);break}}else if(3<=s&&s<6)++i;else if(T.test(a))o=!0;else if(/["'\/`]/.test(a))for(;;--l){if(0==l)return;if(e.string.charAt(l-1)==a&&"\\"!=e.string.charAt(l-2)){l--;break}}else if(o&&!i){++l;break}o&&!i&&(t.fatArrowAt=l)}}function P(e,t,n,r,i,o){this.indented=e,this.column=t,this.type=n,this.prev=i,this.info=o,null!=r&&(this.align=r)}function E(e,t,n,r,i){var o=e.cc;for(a.state=e,a.stream=i,a.marked=null,a.cc=o,a.style=t,e.lexical.hasOwnProperty("align")||(e.lexical.align=!0);;)if((o.length?o.pop():C?l:G)(n,r)){for(;o.length&&o[o.length-1].lex;)o.pop()();return a.marked?a.marked:"variable"==n&&function(e,t){var n,r;if(S){for(n=e.localVars;n;n=n.next)if(n.name==t)return 1;for(r=e.context;r;r=r.prev)for(n=r.vars;n;n=n.next)if(n.name==t)return 1}}(e,r)?"variable-2":t}}function s(){for(var e=arguments.length-1;0<=e;e--)a.cc.push(arguments[e])}function u(){return s.apply(null,arguments),!0}function H(e,t){for(var n=t;n;n=n.next)if(n.name==e)return 1}function I(e){var t,n=a.state;if(a.marked="def",S){if(n.context)if("var"==n.lexical.info&&n.context&&n.context.block){if(null!=(t=function r(e,t){{var n;return t?t.block?(n=r(e,t.prev))?n==t.prev?t:new R(n,t.vars,!0):null:H(e,t.vars)?t:new R(t.prev,new B(e,t.vars),!1):null}}(e,n.context)))return void(n.context=t)}else if(!H(e,n.localVars))return void(n.localVars=new B(e,n.localVars));p.globalVars&&!H(e,n.globalVars)&&(n.globalVars=new B(e,n.globalVars))}}function F(e){return"public"==e||"private"==e||"protected"==e||"abstract"==e||"readonly"==e}function R(e,t,n){this.prev=e,this.vars=t,this.block=n}function B(e,t){this.name=e,this.next=t}function j(){ -a.state.context=new R(a.state.context,a.state.localVars,!1),a.state.localVars=n}function V(){a.state.context=new R(a.state.context,a.state.localVars,!0),a.state.localVars=null}function K(){a.state.localVars=a.state.context.vars,a.state.context=a.state.context.prev}function o(r,i){var e=function(){var e,t=a.state,n=t.indented;if("stat"==t.lexical.type)n=t.lexical.indented;else for(e=t.lexical;e&&")"==e.type&&e.align;e=e.prev)n=e.indented;t.lexical=new P(n,a.stream.column(),r,null,t.lexical,i)};return e.lex=!0,e}function d(){var e=a.state;e.lexical.prev&&(")"==e.lexical.type&&(e.indented=e.lexical.indented),e.lexical=e.lexical.prev)}function h(t){return function n(e){return e==t?u():";"==t||"}"==e||")"==e||"]"==e?s():u(n)}}function G(e,t){return"var"==e?u(o("vardef",t),Le,h(";"),d):"keyword a"==e?u(o("form"),_,G,d):"keyword b"==e?u(o("form"),G,d):"keyword d"==e?a.stream.match(/^\s*$/,!1)?u():u(o("stat"),X,h(";"),d):"debugger"==e?u(h(";")):"{"==e?u(o("}"),V,de,d,K):";"==e?u():"if"==e?("else"==a.state.lexical.info&&a.state.cc[a.state.cc.length-1]==d&&a.state.cc.pop()(),u(o("form"),_,G,d,ze)):"function"==e?u(He):"for"==e?u(o("form"),V,We,G,K,d):"class"==e||c&&"interface"==t?(a.marked="keyword",u(o("form","class"==e?e:t),je,d)):"variable"==e?c&&"declare"==t?(a.marked="keyword",u(G)):c&&("module"==t||"enum"==t||"type"==t)&&a.stream.match(/^\s*\w/,!1)?(a.marked="keyword","enum"==t?u(Je):"type"==t?u(Fe,h("operator"),f,h(";")):u(o("form"),Me,h("{"),o("}"),de,d,d)):c&&"namespace"==t?(a.marked="keyword",u(o("form"),l,G,d)):c&&"abstract"==t?(a.marked="keyword",u(G)):u(o("stat"),ie):"switch"==e?u(o("form"),_,h("{"),o("}","switch"),V,de,d,d,K):"case"==e?u(l,h(":")):"default"==e?u(h(":")):"catch"==e?u(o("form"),j,U,G,d,K):"export"==e?u(o("stat"),Ue,d):"import"==e?u(o("stat"),_e,d):"async"==e?u(G):"@"==t?u(l,G):s(o("stat"),l,h(";"),d)}function U(e){if("("==e)return u(Re,h(")"))}function l(e,t){return $(e,t,!1)}function q(e,t){return $(e,t,!0)}function _(e){return"("!=e?s():u(o(")"),X,h(")"),d)}function $(e,t,n){var r,i;if(a.state.fatArrowAt==a.stream.start){if(r=n?te:ee,"("==e)return u(j,o(")"),ce(Re,")"),d,h("=>"),r,K);if("variable"==e)return s(j,Me,h("=>"),r,K)}return r=n?Z:Y,g.hasOwnProperty(e)?u(r):"function"==e?u(He,r):"class"==e||c&&"interface"==t?(a.marked="keyword",u(o("form"),Be,d)):"keyword c"==e||"async"==e?u(n?q:l):"("==e?u(o(")"),X,h(")"),d,r):"operator"==e||"spread"==e?u(n?q:l):"["==e?u(o("]"),Qe,d,r):"{"==e?ue(le,"}",null,r):"quasi"==e?s(Q,r):"new"==e?u((i=n,function(e){return"."==e?u(i?re:ne):"variable"==e&&c?u(Ce,i?Z:Y):s(i?q:l)})):u()}function X(e){return e.match(/[;\}\)\],]/)?s():s(l)}function Y(e,t){return","==e?u(X):Z(e,t,!1)}function Z(e,t,n){var r=0==n?Y:Z,i=0==n?l:q;return"=>"==e?u(j,n?te:ee,K):"operator"==e?/\+\+|--/.test(t)||c&&"!"==t?u(r):c&&"<"==t&&a.stream.match(/^([^<>]|<[^<>]*>)*>\s*\(/,!1)?u(o(">"),ce(f,">"),d,r):"?"==t?u(l,h(":"),i):u(i):"quasi"==e?s(Q,r):";"!=e?"("==e?ue(q,")","call",r):"."==e?u(oe,r):"["==e?u(o("]"),X,h("]"),d,r):c&&"as"==t?(a.marked="keyword",u(f,r)):"regexp"==e?(a.state.lastType=a.marked="operator",a.stream.backUp(a.stream.pos-a.stream.start-1),u(i)):void 0:void 0}function Q(e,t){return"quasi"!=e?s():"${"!=t.slice(t.length-2)?u(Q):u(X,J)}function J(e){if("}"==e)return a.marked="string-2",a.state.tokenize=z,u(Q)}function ee(e){return W(a.stream,a.state),s("{"==e?G:l)}function te(e){return W(a.stream,a.state),s("{"==e?G:q)}function ne(e,t){if("target"==t)return a.marked="keyword",u(Y)}function re(e,t){if("target"==t)return a.marked="keyword",u(Z)}function ie(e){return":"==e?u(d,G):s(Y,h(";"),d)}function oe(e){if("variable"==e)return a.marked="property",u()}function le(e,t){return"async"==e?(a.marked="property",u(le)):"variable"!=e&&"keyword"!=a.style?"number"==e||"string"==e?(a.marked=k?"property":a.style+" property",u(se)):"jsonld-keyword"==e?u(se):c&&F(t)?(a.marked="keyword",u(le)):"["==e?u(l,he,h("]"),se):"spread"==e?u(q,se):"*"==t?(a.marked="keyword",u(le)):":"==e?s(se):void 0:(a.marked="property","get"==t||"set"==t?u(ae):(c&&a.state.fatArrowAt==a.stream.start&&(n=a.stream.match(/^\s*:\s*/,!1))&&(a.state.fatArrowAt=a.stream.pos+n[0].length),u(se)));var n}function ae(e){return"variable"!=e?s(se):(a.marked="property",u(He))}function se(e){return":"==e?u(q):"("==e?s(He):void 0}function ce(r,i,o){function l(e,t){var n;return(o?-1"),f):"quasi"==e?s(be,ke):void 0}function me(e){if("=>"==e)return u(f)}function ye(e){return e.match(/[\}\)\]]/)?u():","==e||";"==e?u(ye):s(ve,ye)}function ve(e,t){return"variable"==e||"keyword"==a.style?(a.marked="property",u(ve)):"?"==t||"number"==e||"string"==e?u(ve):":"==e?u(f):"["==e?u(h("variable"),fe,h("]"),ve):"("==e?s(Ie,ve):e.match(/[;\}\)\],]/)?void 0:u()}function be(e,t){return"quasi"!=e?s():"${"!=t.slice(t.length-2)?u(be):u(f,we)}function we(e){if("}"==e)return a.marked="string-2",a.state.tokenize=z,u(be)}function xe(e,t){return"variable"==e&&a.stream.match(/^\s*[?:]/,!1)||"?"==t?u(xe):":"==e?u(f):"spread"==e?u(xe):s(f)}function ke(e,t){return"<"==t?u(o(">"),ce(f,">"),d,ke -):"|"==t||"."==e||"&"==t?u(f):"["==e?u(f,h("]"),ke):"extends"==t||"implements"==t?(a.marked="keyword",u(f)):"?"==t?u(f,h(":"),f):void 0}function Ce(e,t){if("<"==t)return u(o(">"),ce(f,">"),d,ke)}function Se(){return s(f,Te)}function Te(e,t){if("="==t)return u(f)}function Le(e,t){return"enum"==t?(a.marked="keyword",u(Je)):s(Me,he,Oe,De)}function Me(e,t){return c&&F(t)?(a.marked="keyword",u(Me)):"variable"==e?(I(t),u()):"spread"==e?u(Me):"["==e?ue(Ae,"]"):"{"==e?ue(Ne,"}"):void 0}function Ne(e,t){return"variable"!=e||a.stream.match(/^\s*:/,!1)?("variable"==e&&(a.marked="property"),"spread"==e?u(Me):"}"==e?s():"["==e?u(l,h("]"),h(":"),Ne):u(h(":"),Me,Oe)):(I(t),u(Oe))}function Ae(){return s(Me,Oe)}function Oe(e,t){if("="==t)return u(q)}function De(e){if(","==e)return u(Le)}function ze(e,t){if("keyword b"==e&&"else"==t)return u(o("form","else"),G,d)}function We(e,t){return"await"==t?u(We):"("==e?u(o(")"),Pe,d):void 0}function Pe(e){return"var"==e?u(Le,Ee):("variable"==e?u:s)(Ee)}function Ee(e,t){return")"==e?u():";"==e?u(Ee):"in"==t||"of"==t?(a.marked="keyword",u(l,Ee)):s(l,Ee)}function He(e,t){return"*"==t?(a.marked="keyword",u(He)):"variable"==e?(I(t),u(He)):"("==e?u(j,o(")"),ce(Re,")"),d,pe,G,K):c&&"<"==t?u(o(">"),ce(Se,">"),d,He):void 0}function Ie(e,t){return"*"==t?(a.marked="keyword",u(Ie)):"variable"==e?(I(t),u(Ie)):"("==e?u(j,o(")"),ce(Re,")"),d,pe,K):c&&"<"==t?u(o(">"),ce(Se,">"),d,Ie):void 0}function Fe(e,t){return"keyword"==e||"variable"==e?(a.marked="type",u(Fe)):"<"==t?u(o(">"),ce(Se,">"),d):void 0}function Re(e,t){return"@"==t&&u(l,Re),"spread"==e?u(Re):c&&F(t)?(a.marked="keyword",u(Re)):c&&"this"==e?u(he,Oe):s(Me,he,Oe)}function Be(e,t){return("variable"==e?je:Ve)(e,t)}function je(e,t){if("variable"==e)return I(t),u(Ve)}function Ve(e,t){return"<"==t?u(o(">"),ce(Se,">"),d,Ve):"extends"==t||"implements"==t||c&&","==e?("implements"==t&&(a.marked="keyword"),u(c?f:l,Ve)):"{"==e?u(o("}"),Ke,d):void 0}function Ke(e,t){return"async"==e||"variable"==e&&("static"==t||"get"==t||"set"==t||c&&F(t))&&a.stream.match(/^\s+#?[\w$\xa1-\uffff]/,!1)?(a.marked="keyword",u(Ke)):"variable"==e||"keyword"==a.style?(a.marked="property",u(Ge,Ke)):"number"==e||"string"==e?u(Ge,Ke):"["==e?u(l,he,h("]"),Ge,Ke):"*"==t?(a.marked="keyword",u(Ke)):c&&"("==e?s(Ie,Ke):";"==e||","==e?u(Ke):"}"==e?u():"@"==t?u(l,Ke):void 0}function Ge(e,t){if("!"==t)return u(Ge);if("?"==t)return u(Ge);if(":"==e)return u(f,Oe);if("="==t)return u(q);e=a.state.lexical.prev;return s(e&&"interface"==e.info?Ie:He)}function Ue(e,t){return"*"==t?(a.marked="keyword",u(Ze,h(";"))):"default"==t?(a.marked="keyword",u(l,h(";"))):"{"==e?u(ce(qe,"}"),Ze,h(";")):s(G)}function qe(e,t){return"as"==t?(a.marked="keyword",u(h("variable"))):"variable"==e?s(q,qe):void 0}function _e(e){return"string"==e?u():"("==e?s(l):"."==e?s(Y):s($e,Xe,Ze)}function $e(e,t){return"{"==e?ue($e,"}"):("variable"==e&&I(t),"*"==t&&(a.marked="keyword"),u(Ye))}function Xe(e){if(","==e)return u($e,Xe)}function Ye(e,t){if("as"==t)return a.marked="keyword",u($e)}function Ze(e,t){if("from"==t)return a.marked="keyword",u(l)}function Qe(e){return"]"==e?u():s(ce(q,"]"))}function Je(){return s(o("form"),Me,h("{"),o("}"),ce(et,"}"),d,d)}function et(){return s(Me,Oe)}function tt(e,t,n){return t.tokenize==O&&/^(?:operator|sof|keyword [bcd]|case|new|export|default|spread|[\[{}\(,;:]|=>)$/.test(t.lastType)||"quasi"==t.lastType&&/\{\s*$/.test(e.string.slice(0,e.pos-(n||0)))}return g={atom:!0,number:!0,variable:!0,string:!0,regexp:!0,"this":!0,"import":!0,"jsonld-keyword":!0},a={state:null,column:null,marked:null,cc:null},n=new B("this",new B("arguments",null)),j.lex=V.lex=!0,d.lex=K.lex=!0,{startState:function(e){e={tokenize:O,lastType:"sof",cc:[],lexical:new P((e||0)-w,0,"block",!1),localVars:p.localVars,context:p.localVars&&new R(null,null,!1),indented:e||0};return p.globalVars&&"object"==typeof p.globalVars&&(e.globalVars=p.globalVars),e},token:function(e,t){if(e.sol()&&(t.lexical.hasOwnProperty("align")||(t.lexical.align=!1),t.indented=e.indentation(),W(e,t)),t.tokenize!=D&&e.eatSpace())return null;var n=t.tokenize(e,t);return"comment"==r?n:(t.lastType="operator"!=r||"++"!=i&&"--"!=i?r:"incdec",E(t,n,r,i,e))},indent:function(e,t){var n,r,i,o,l,a,s,c;if(e.tokenize==D||e.tokenize==z)return nt.Pass;if(e.tokenize!=O)return 0;if(n=t&&t.charAt(0),r=e.lexical,!/^\s*else\b/.test(t))for(o=e.cc.length-1;0<=o;--o)if((l=e.cc[o])==d)r=r.prev;else if(l!=ze&&l!=K)break;for(;("stat"==r.type||"form"==r.type)&&("}"==n||(i=e.cc[e.cc.length-1])&&(i==Y||i==Z)&&!/^[,\.=+\-*:?[\(]/.test(t));)r=r.prev;return a=n==(c=(r=x&&")"==r.type&&"stat"==r.prev.type?r.prev:r).type),"vardef"==c?r.indented+("operator"==e.lastType||","==e.lastType?r.info.length+1:0):"form"==c&&"{"==n?r.indented:"form"==c?r.indented+w:"stat"==c?r.indented+(c=t,"operator"==(s=e).lastType||","==s.lastType||M.test(c.charAt(0))||/[,.]/.test(c.charAt(0))?x||w:0):"switch"!=r.info||a||0==p.doubleIndentSwitch?r.align?r.column+(a?0:1):r.indented+(a?0:w):r.indented+(/^(?:case|default)\b/.test(t)?w:2*w)},electricInput:/^\s*(?:case .*?:|default:|\{|\})$/,blockCommentStart:C?null:"/*",blockCommentEnd:C?null:"*/",blockCommentContinue:C?null:" * ",lineComment:C?null:"//",fold:"brace",closeBrackets:"()[]{}''\"\"``",helperType:C?"json":"javascript",jsonldMode:k,jsonMode:C,expressionAllowed:tt,skipExpression:function(e){E(e,"atom","atom","true",new nt.StringStream("",2,null))}}}),nt.registerHelper("wordChars","javascript",/[\w$]/),nt.defineMIME("text/javascript","javascript"),nt.defineMIME("text/ecmascript","javascript"),nt.defineMIME("application/javascript","javascript"),nt.defineMIME("application/x-javascript","javascript"),nt.defineMIME("application/ecmascript","javascript"),nt.defineMIME("application/json",{name:"javascript",json:!0}),nt.defineMIME("application/x-json",{name:"javascript",json:!0}),nt.defineMIME("application/manifest+json",{name:"javascript",json:!0}),nt.defineMIME("application/ld+json",{name:"javascript",jsonld:!0}),nt.defineMIME( -"text/typescript",{name:"javascript",typescript:!0}),nt.defineMIME("application/typescript",{name:"javascript",typescript:!0})},"object"==typeof exports&&"object"==typeof module?r(require("../../lib/codemirror")):r(n),r=function(D){"use strict";var c,u,e,d,t,h,n,f,r,p,i,o,g,m,l,y,a,v;function s(e){for(var t={},n=0;n*\/]/.test(r)?(l="select-op",null):"."==r&&e.match(/^-?[_a-z][_a-z0-9-]*/i)?l="qualifier":/[:;{}\[\]\(\)]/.test(r)?L(null,r):e.match(/^[\w-.]+(?=\()/)?(/^(url(-prefix)?|domain|regexp)$/i.test(e.current())&&(t.tokenize=N),l="variable","variable callee"):/[\w\\\-]/.test(r)?(e.eatWhile(/[\w\\\-]/),l="word","property"):l=null})(e,t);return n&&"object"==typeof n&&(l=n[1],n=n[0]),a=n,"comment"!=l&&(t.state=s[t.state](l,e,t)),a},indent:function(e,t){var e=e.context,t=t&&t.charAt(0),n=e.indent;return(e="prop"!=e.type||"}"!=t&&")"!=t?e:e.prev).prev&&("}"!=t||"block"!=e.type&&"top"!=e.type&&"interpolation"!=e.type&&"restricted_atBlock"!=e.type?(")"!=t||"parens"!=e.type&&"atBlock_parens"!=e.type)&&("{"!=t||"at"!=e.type&&"atBlock"!=e.type)||(n=Math.max(0,e.indent-i)):n=(e=e.prev).indent),n},electricChars:"}",blockCommentStart:"/*",blockCommentEnd:"*/",blockCommentContinue:" * ",lineComment:n,fold:"brace"}}),u=s(c=["domain","regexp","url","url-prefix"]),e=s(v=["all","aural","braille","handheld","print","projection","screen","tty","tv","embossed"]),t=s(d=["width","min-width","max-width","height","min-height","max-height","device-width","min-device-width","max-device-width","device-height","min-device-height","max-device-height","aspect-ratio","min-aspect-ratio","max-aspect-ratio","device-aspect-ratio","min-device-aspect-ratio","max-device-aspect-ratio","color","min-color","max-color","color-index","min-color-index","max-color-index","monochrome","min-monochrome","max-monochrome","resolution","min-resolution","max-resolution","scan","grid","orientation","device-pixel-ratio","min-device-pixel-ratio","max-device-pixel-ratio","pointer","any-pointer","hover","any-hover","prefers-color-scheme","dynamic-range","video-dynamic-range"]),n=s(h=["landscape","portrait","none","coarse","fine","on-demand","hover","interlace","progressive","dark","light","standard","high"]),r=s(f=["align-content","align-items","align-self","alignment-adjust","alignment-baseline","all","anchor-point","animation","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-timing-function","appearance","azimuth","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","binding","bleed","block-size","bookmark-label","bookmark-level","bookmark-state","bookmark-target","border","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-decoration-break","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","color","color-profile","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","content","counter-increment","counter-reset","crop","cue","cue-after","cue-before","cursor","direction","display","dominant-baseline","drop-initial-after-adjust","drop-initial-after-align","drop-initial-before-adjust","drop-initial-before-align","drop-initial-size","drop-initial-value","elevation","empty-cells","fit","fit-content","fit-position","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","float-offset","flow-from","flow-into","font","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-size","font-size-adjust","font-stretch","font-style","font-synthesis","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","gap","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-gap","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-gap","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphens","icon","image-orientation","image-rendering","image-resolution","inline-box-align","inset","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","left","letter-spacing","line-break","line-height","line-height-step","line-stacking","line-stacking-ruby","line-stacking-shift","line-stacking-strategy","list-style","list-style-image","list-style-position","list-style-type","margin","margin-bottom","margin-left","margin-right","margin-top","marks","marquee-direction","marquee-loop","marquee-play-count","marquee-speed","marquee-style","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","move-to","nav-down","nav-index","nav-left","nav-right","nav-up","object-fit","object-position","offset","offset-anchor","offset-distance", -"offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-style","overflow-wrap","overflow-x","overflow-y","padding","padding-bottom","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","page-policy","pause","pause-after","pause-before","perspective","perspective-origin","pitch","pitch-range","place-content","place-items","place-self","play-during","position","presentation-level","punctuation-trim","quotes","region-break-after","region-break-before","region-break-inside","region-fragment","rendering-intent","resize","rest","rest-after","rest-before","richness","right","rotate","rotation","rotation-point","row-gap","ruby-align","ruby-overhang","ruby-position","ruby-span","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-type","shape-image-threshold","shape-inside","shape-margin","shape-outside","size","speak","speak-as","speak-header","speak-numeral","speak-punctuation","speech-rate","stress","string-set","tab-size","table-layout","target","target-name","target-new","target-position","text-align","text-align-last","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-height","text-indent","text-justify","text-orientation","text-outline","text-overflow","text-rendering","text-shadow","text-size-adjust","text-space-collapse","text-transform","text-underline-position","text-wrap","top","touch-action","transform","transform-origin","transform-style","transition","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-select","vertical-align","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","volume","white-space","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","z-index","clip-path","clip-rule","mask","enable-background","filter","flood-color","flood-opacity","lighting-color","stop-color","stop-opacity","pointer-events","color-interpolation","color-interpolation-filters","color-rendering","fill","fill-opacity","fill-rule","image-rendering","marker","marker-end","marker-mid","marker-start","paint-order","shape-rendering","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","text-rendering","baseline-shift","dominant-baseline","glyph-orientation-horizontal","glyph-orientation-vertical","text-anchor","writing-mode"]),i=s(p=["accent-color","aspect-ratio","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","content-visibility","margin-block","margin-block-end","margin-block-start","margin-inline","margin-inline-end","margin-inline-start","overflow-anchor","overscroll-behavior","padding-block","padding-block-end","padding-block-start","padding-inline","padding-inline-end","padding-inline-start","scroll-snap-stop","scrollbar-3d-light-color","scrollbar-arrow-color","scrollbar-base-color","scrollbar-dark-shadow-color","scrollbar-face-color","scrollbar-highlight-color","scrollbar-shadow-color","scrollbar-track-color","searchfield-cancel-button","searchfield-decoration","searchfield-results-button","searchfield-results-decoration","shape-inside","zoom"]),o=s(["font-display","font-family","src","unicode-range","font-variant","font-feature-settings","font-stretch","font-weight","font-style"]),g=s(["additive-symbols","fallback","negative","pad","prefix","range","speak-as","suffix","symbols","system"]),l=s(m=["aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blue","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgreen","darkgrey","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkslategrey","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dimgrey","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","grey","green","greenyellow","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgreen","lightgrey","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightslategrey","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen", -"mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","rebeccapurple","red","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","slategrey","snow","springgreen","steelblue","tan","teal","thistle","tomato","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen"]),a=s(y=["above","absolute","activeborder","additive","activecaption","afar","after-white-space","ahead","alias","all","all-scroll","alphabetic","alternate","always","amharic","amharic-abegede","antialiased","appworkspace","arabic-indic","armenian","asterisks","attr","auto","auto-flow","avoid","avoid-column","avoid-page","avoid-region","axis-pan","background","backwards","baseline","below","bidi-override","binary","bengali","blink","block","block-axis","blur","bold","bolder","border","border-box","both","bottom","break","break-all","break-word","brightness","bullets","button","buttonface","buttonhighlight","buttonshadow","buttontext","calc","cambodian","capitalize","caps-lock-indicator","caption","captiontext","caret","cell","center","checkbox","circle","cjk-decimal","cjk-earthly-branch","cjk-heavenly-stem","cjk-ideographic","clear","clip","close-quote","col-resize","collapse","color","color-burn","color-dodge","column","column-reverse","compact","condensed","conic-gradient","contain","content","contents","content-box","context-menu","continuous","contrast","copy","counter","counters","cover","crop","cross","crosshair","cubic-bezier","currentcolor","cursive","cyclic","darken","dashed","decimal","decimal-leading-zero","default","default-button","dense","destination-atop","destination-in","destination-out","destination-over","devanagari","difference","disc","discard","disclosure-closed","disclosure-open","document","dot-dash","dot-dot-dash","dotted","double","down","drop-shadow","e-resize","ease","ease-in","ease-in-out","ease-out","element","ellipse","ellipsis","embed","end","ethiopic","ethiopic-abegede","ethiopic-abegede-am-et","ethiopic-abegede-gez","ethiopic-abegede-ti-er","ethiopic-abegede-ti-et","ethiopic-halehame-aa-er","ethiopic-halehame-aa-et","ethiopic-halehame-am-et","ethiopic-halehame-gez","ethiopic-halehame-om-et","ethiopic-halehame-sid-et","ethiopic-halehame-so-et","ethiopic-halehame-ti-er","ethiopic-halehame-ti-et","ethiopic-halehame-tig","ethiopic-numeric","ew-resize","exclusion","expanded","extends","extra-condensed","extra-expanded","fantasy","fast","fill","fill-box","fixed","flat","flex","flex-end","flex-start","footnotes","forwards","from","geometricPrecision","georgian","grayscale","graytext","grid","groove","gujarati","gurmukhi","hand","hangul","hangul-consonant","hard-light","hebrew","help","hidden","hide","higher","highlight","highlighttext","hiragana","hiragana-iroha","horizontal","hsl","hsla","hue","hue-rotate","icon","ignore","inactiveborder","inactivecaption","inactivecaptiontext","infinite","infobackground","infotext","inherit","initial","inline","inline-axis","inline-block","inline-flex","inline-grid","inline-table","inset","inside","intrinsic","invert","italic","japanese-formal","japanese-informal","justify","kannada","katakana","katakana-iroha","keep-all","khmer","korean-hangul-formal","korean-hanja-formal","korean-hanja-informal","landscape","lao","large","larger","left","level","lighter","lighten","line-through","linear","linear-gradient","lines","list-item","listbox","listitem","local","logical","loud","lower","lower-alpha","lower-armenian","lower-greek","lower-hexadecimal","lower-latin","lower-norwegian","lower-roman","lowercase","ltr","luminosity","malayalam","manipulation","match","matrix","matrix3d","media-play-button","media-slider","media-sliderthumb","media-volume-slider","media-volume-sliderthumb","medium","menu","menulist","menulist-button","menutext","message-box","middle","min-intrinsic","mix","mongolian","monospace","move","multiple","multiple_mask_images","multiply","myanmar","n-resize","narrower","ne-resize","nesw-resize","no-close-quote","no-drop","no-open-quote","no-repeat","none","normal","not-allowed","nowrap","ns-resize","numbers","numeric","nw-resize","nwse-resize","oblique","octal","opacity","open-quote","optimizeLegibility","optimizeSpeed","oriya","oromo","outset","outside","outside-shape","overlay","overline","padding","padding-box","painted","page","paused","persian","perspective","pinch-zoom","plus-darker","plus-lighter","pointer","polygon","portrait","pre","pre-line","pre-wrap","preserve-3d","progress","push-button","radial-gradient","radio","read-only","read-write","read-write-plaintext-only","rectangle","region","relative","repeat","repeating-linear-gradient","repeating-radial-gradient","repeating-conic-gradient","repeat-x","repeat-y","reset","reverse","rgb","rgba","ridge","right","rotate","rotate3d","rotateX","rotateY","rotateZ","round","row","row-resize","row-reverse","rtl","run-in","running","s-resize","sans-serif","saturate","saturation","scale","scale3d","scaleX","scaleY","scaleZ","screen","scroll","scrollbar","scroll-position","se-resize","searchfield","searchfield-cancel-button","searchfield-decoration","searchfield-results-button","searchfield-results-decoration","self-start","self-end","semi-condensed","semi-expanded","separate","sepia","serif","show","sidama","simp-chinese-formal","simp-chinese-informal","single","skew","skewX","skewY","skip-white-space","slide","slider-horizontal","slider-vertical","sliderthumb-horizontal","sliderthumb-vertical","slow","small","small-caps","small-caption","smaller","soft-light","solid","somali","source-atop","source-in","source-out","source-over","space","space-around","space-between","space-evenly","spell-out","square","square-button","start","static","status-bar","stretch","stroke", -"stroke-box","sub","subpixel-antialiased","svg_masks","super","sw-resize","symbolic","symbols","system-ui","table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row","table-row-group","tamil","telugu","text","text-bottom","text-top","textarea","textfield","thai","thick","thin","threeddarkshadow","threedface","threedhighlight","threedlightshadow","threedshadow","tibetan","tigre","tigrinya-er","tigrinya-er-abegede","tigrinya-et","tigrinya-et-abegede","to","top","trad-chinese-formal","trad-chinese-informal","transform","translate","translate3d","translateX","translateY","translateZ","transparent","ultra-condensed","ultra-expanded","underline","unidirectional-pan","unset","up","upper-alpha","upper-armenian","upper-greek","upper-hexadecimal","upper-latin","upper-norwegian","upper-roman","uppercase","urdu","url","var","vertical","vertical-text","view-box","visible","visibleFill","visiblePainted","visibleStroke","visual","w-resize","wait","wave","wider","window","windowframe","windowtext","words","wrap","wrap-reverse","x-large","x-small","xor","xx-large","xx-small"]),v=c.concat(v).concat(d).concat(h).concat(f).concat(p).concat(m).concat(y),D.registerHelper("hintWords","css",v),D.defineMIME("text/css",{documentTypes:u,mediaTypes:e,mediaFeatures:t,mediaValueKeywords:n,propertyKeywords:r,nonStandardPropertyKeywords:i,fontProperties:o,counterDescriptors:g,colorKeywords:l,valueKeywords:a,tokenHooks:{"/":function(e,t){return!!e.eat("*")&&(t.tokenize=b)(e,t)}},name:"css"}),D.defineMIME("text/x-scss",{mediaTypes:e,mediaFeatures:t,mediaValueKeywords:n,propertyKeywords:r,nonStandardPropertyKeywords:i,colorKeywords:l,valueKeywords:a,fontProperties:o,allowNested:!0,lineComment:"//",tokenHooks:{"/":function(e,t){return e.eat("/")?(e.skipToEnd(),["comment","comment"]):e.eat("*")?(t.tokenize=b)(e,t):["operator","operator"]},":":function(e){return!!e.match(/^\s*\{/,!1)&&[null,null]},$:function(e){return e.match(/^[\w-]+/),e.match(/^\s*:/,!1)?["variable-2","variable-definition"]:["variable-2","variable"]},"#":function(e){return!!e.eat("{")&&[null,"interpolation"]}},name:"css",helperType:"scss"}),D.defineMIME("text/x-less",{mediaTypes:e,mediaFeatures:t,mediaValueKeywords:n,propertyKeywords:r,nonStandardPropertyKeywords:i,colorKeywords:l,valueKeywords:a,fontProperties:o,allowNested:!0,lineComment:"//",tokenHooks:{"/":function(e,t){return e.eat("/")?(e.skipToEnd(),["comment","comment"]):e.eat("*")?(t.tokenize=b)(e,t):["operator","operator"]},"@":function(e){return e.eat("{")?[null,"interpolation"]:!e.match(/^(charset|document|font-face|import|(-(moz|ms|o|webkit)-)?keyframes|media|namespace|page|supports)\b/i,!1)&&(e.eatWhile(/[\w\\\-]/),e.match(/^\s*:/,!1)?["variable-2","variable-definition"]:["variable-2","variable"])},"&":function(){return["atom","atom"]}},name:"css",helperType:"less"}),D.defineMIME("text/x-gss",{documentTypes:u,mediaTypes:e,mediaFeatures:t,propertyKeywords:r,nonStandardPropertyKeywords:i,fontProperties:o,counterDescriptors:g,colorKeywords:l,valueKeywords:a,supportsAtComponent:!0,tokenHooks:{"/":function(e,t){return!!e.eat("*")&&(t.tokenize=b)(e,t)}},name:"css",helperType:"gss"})},"object"==typeof exports&&"object"==typeof module?r(require("../../lib/codemirror")):r(n),e.namespace("M.atto_html").CodeMirror=n,window.CodeMirror=i},"@VERSION@",{requires:["moodle-atto_html-codemirror-skin"]}); \ No newline at end of file +YUI.add("moodle-atto_html-codemirror",function(e,t){var n,r,i=window.codeMirror;n=this,r=function(){"use strict";var i,f,l,y,c,p,a,m,v,C,u,r,o,s,h,d,g,w,b,S,T,L,z,D,W,P,E,H,I,F,R,B,j,V,K,G,U,q,_,$,X,Y,Z,Q,J,ee,te,ne,re,ie,oe,le,ae,se,ce,ue,de,he,fe,pe,ge,me,ye,ve,be,we,xe,ke,Ce,Se,Te,Le,Me,Ne,Ae,Oe,ze,De,We,Pe,Ee,He,Ie,Fe,e=navigator.userAgent,Re=navigator.platform,Be=/gecko\/\d/i.test(e),je=/MSIE \d/.test(e),Ve=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(e),t=/Edge\/(\d+)/.exec(e),x=je||Ve||t,Ke=x&&(je?document.documentMode||6:+(t||Ve)[1]),Ge=!t&&/WebKit\//.test(e),je=Ge&&/Qt\/\d+\.\d+/.test(e),Ue=!t&&/Chrome\/(\d+)/.exec(e),qe=Ue&&+Ue[1],_e=/Opera\//.test(e),$e=/Apple Computer/.test(navigator.vendor),Xe=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(e),Ye=/PhantomJS/.test(e),Ze=$e&&(/Mobile\/\w+/.test(e)||2t)return i;o.to==t&&(o.from!=o.to&&"before"==n?r=i:h=i),o.from==t&&(o.from!=o.to&&"before"!=n?r=i:h=i)}return null!=r?r:h}function zt(e,t,n){this.level=e,this.from=t,this.to=n}function Dt(e,t){var n=e.order;return n=null==n?e.order=d(e.text,t):n}function Wt(e,t){return e._handlers&&e._handlers[t]||g}function Pt(e,t,n){var r,i;e.removeEventListener?e.removeEventListener(t,n,!1):e.detachEvent?e.detachEvent("on"+t,n):(r=(e=e._handlers)&&e[t])&&-1<(i=yt(r,n))&&(e[t]=r.slice(0,i).concat(r.slice(i+1)))}function Et(e,t){var n,r,i=Wt(e,t);if(i.length)for(n=Array.prototype.slice.call(arguments,2),r=0;r=e.size)throw new Error("There is no line "+(t+e.first)+" in the document.");for(n=e;!n.lines;)for(r=0;;++r){if(t<(o=(i=n.children[r]).chunkSize())){n=i;break}t-=o}return n.lines[t]}function Qt(e,t,n){var r=[],i=t.line;return e.iter(t.line,n.line+1,function(e){e=e.text;i==n.line&&(e=e.slice(0,n.ch)),i==t.line&&(e=e.slice(t.ch)),r.push(e),++i}),r}function Jt(e,t,n){var r=[];return e.iter(t,n,function(e){r.push(e.text)}),r}function en(e,t){var n,r=t-e.height;if(r)for(n=e;n;n=n.parent)n.height+=r}function tn(e){var t,n,r,i;if(null==e.parent)return null;for(n=yt((t=e.parent).lines,e),r=t.parent;r;r=(t=r).parent)for(i=0;r.children[i]!=t;++i)n+=r.children[i].chunkSize();return n+t.first}function nn(e,t){var n,r,i,o,l,a=e.first;e:do{for(n=0;n=e.first&&tn?A(n,N(e,n).text.length):(e=N(e,(n=t).line).text.length,null==(t=n.ch)||ee.options.maxHighlightLength&&Xt(e.doc.mode,r.state),o=hn(e,t,r),i&&(r.state=i),t.stateAfter=r.save(!i),t.styles=o.styles,o.classes?t.styleClasses=o.classes:t.styleClasses&&(t.styleClasses=null),n===e.doc.highlightFrontier&&(e.doc.modeFrontier=Math.max(e.doc.modeFrontier,++e.doc.highlightFrontier))),t.styles}function pn(n,r,e){var t,i,o,l=n.doc,a=n.display;return l.mode.startState?(i=(t=function(e,t,n){var r,i,o,l,a,s,c;for(o=e.doc,l=n?-1:t-(e.doc.mode.innerMode?1e3:100),a=t;ll.first&&N(l,t-1).stateAfter,o=i?R.fromSaved(l,i,t):new R(l,Zt(l.mode),t),l.iter(t,r,function(e){gn(n,e.text,o);var t=o.line;e.stateAfter=t==r-1||t%5==0||t>=a.viewFrom&&tt.start)return i;throw new Error("Mode "+e.name+" failed to advance stream.")}function vn(e,t,n,r){var i,o,l=e.doc,a=l.mode,u=N(l,(t=O(l,t)).line),s=pn(e,t.line,n),c=new I(u.text,e.options.tabSize,s);for(r&&(o=[]);(r||c.pose.options.maxHighlightLength?(c=!1,h&&gn(e,t,r,l.pos),l.pos=t.length,null):bn(yn(n,l,r.state,s),d),s&&(f=s[0].name)&&(a="m-"+(a?f+" "+a:f)),!c||o!=a){for(;i=t:o.to>t),(r=r||[]).push(new xn(l, +o.from,a?null:o.to)));return r}(r,n,r=0==k(t.from,t.to)),o=function(e,t,n){var r,i,o,l,a;if(e)for(i=0;i=t:o.to>t))&&(o.from!=t||"bookmark"!=l.type||n&&!o.marker.insertLeft)||(a=null==o.from||(l.inclusiveLeft?o.from<=t:o.frome.lastLine())return t;var n,r=N(e,t);if(!In(e,r))return t;for(;n=Dn(r);)r=n.find(1,!0).line;return tn(r)+1}function In(e,t){var n,r,i=V&&t.markedSpans;if(i)for(r=0;rn.maxLineLength&&(n.maxLineLength=t,n.maxLine=e)})}function jn(e,t){if(!e||/^\s*$/.test(e))return null;t=t.addModeClass?U:G;return t[e]||(t[e]=e.replace(/\S+/g,"cm-$&"))}function Vn(e,t){var n,r,i,o,l,a,s=ot("span",null,null,Ge?"padding-right: .1px":null),c={pre:ot("pre",[s],"CodeMirror-line"),content:s,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:e.getOption("lineWrapping")};for(t.measure={},n=0;n<=(t.rest?t.rest.length:0);n++)r=n?t.rest[n-1]:t.line,i=void 0,c.pos=0,c.addToken=Gn,o=e.display.measure,a=l=void 0,(null!=T?T:(a=it(o,document.createTextNode("AخA")),l=y(a,0,1).getBoundingClientRect(),a=y(a,1,2).getBoundingClientRect(),rt(o),l&&l.left!=l.right&&(T=a.right-l.right<3)))&&(i=Dt(r,e.doc.direction))&&(c.addToken=function(d,h){return function(e,t,n,r,u,i,o){var l,a,s,c;for(n=n?n+" cm-force-border":"cm-force-border",a=(l=e.pos)+t.length;;){for(s=void 0,c=0;cl&&s.from<=l);c++);if(s.to>=a)return d(e,t,n,r,u,i,o);d(e,t.slice(0,s.to-l),n,r,null,i,o),r=null,t=t.slice(s.to-l),l=s.to}}}(c.addToken,i)),c.map=[],function(u,e,d){var h,t,f,n,p,g,r,m,y,v,i,o,b,l,w,a,s,x,k,C,c,S,T,L,M=u.markedSpans,N=u.text,A=0;if(M)for(h=N.length,t=0,f=1,n="",r=0;;){if(r==t){m=y=v=g="",i=o=null,r=Infinity;for(b=[],l=void 0,w=0;wt||s.collapsed&&a.to==t&&a.from==t)){if(null!=a.to&&a.to!=t&&r>a.to&&(r=a.to,y=""),s.className&&(m+=" "+s.className),s.css&&(g=(g?g+";":"")+s.css),s.startStyle&&a.from==t&&(v+=" "+s.startStyle),s.endStyle&&a.to==r&&(l=l||[]).push(s.endStyle,a.to),s.title&&((o=o||{}).title=s.title),s.attributes)for(x in s.attributes)(o=o||{})[x]=s.attributes[x];s.collapsed&&(!i||An(i.marker,s)<0)&&(i=a)}else a.from>t&&r>a.from&&(r=a.from)}if(l)for(k=0;kn)return{map:e.measure.maps[i],cache:e.measure.caches[i],before:!0}}}function hr(e,t,n,r){return gr(e,pr(e,t),n,r)}function fr(e,t){if(t>=e.display.viewFrom&&t=e.lineN&&tt)&&(i=(o=s-a)-1,s<=t&&(l="right")),null!=i){if(r=e[c+2],a==s&&n==(r.insertLeft?"left":"right")&&(l=n),"left"==n&&0==i)for(;c&&e[c-2]==e[c-3]&&e[c-1].insertLeft;)r=e[2+(c-=3)],l="left";if("right"==n&&i==s-a)for(;c=r.text.length?(t=r.text.length,e="before"):t<=0&&(t=0,e="after"),o?(a=Ot(o,t,e),l=h,a=c(t,a,"before"==e),null!=l&&(a.other=c(t,l,"before"!=e)),a):s("before"==e?t-1:t,"before"==e);function c(e,t,n){return s(n?e-1:e,1==o[t].level!=n)}}function Mr(e,t){var n=0;return t=O(e.doc,t),{left:n=e.options.lineWrapping?n:Hr(e.display)*t.ch,right:n,top:t=Fn(n=N(e.doc,t.line))+or(e.display),bottom:t+n.height}}function Nr(e,t,n,r,i){e=A(e,t,n);return e.xRel=i,r&&(e.outside=r),e}function Ar(e,t,n){var r,i,o,l,a,s=e.doc;if((n+=e.display.viewOffset)<0)return Nr(s.first,0,null,-1,-1);if(r=nn(s,n),(i=s.first+s.size-1)t)&&(!n||An(n,i.marker)<0)&&(n=i.marker);return n}(o,(a=function(n,e,u,r,i){var d,h,f,t,p,o,l,g,a,s,c;i-=Fn(e);d=pr(n,e),h=kr(e),f=0,c=e.text.length,t=!0,l=Dt(e,n.doc.direction);l&&(l=(n.options.lineWrapping?Pr:Wr)(n,e,u,d,l,r,i),t=1!=l.level,f=t?l.from:l.to-1,c=t?l.to:l.from-1);p=null,o=null,l=At(function(e){var t=gr(n,d,e);return t.top+=h,t.bottom+=h,Dr(t,r,i,!1)&&(t.top<=i&&t.left<=r&&(p=e,o=t),1)},f,c),g=!1;o?(a=r-o.left=c.bottom?1:0);return l=Nt(e.text,l,1),Nr(u,l,s,g,r-a)}(e,o,r,t,n)).ch+(0r},i,e)}}function zr(e,t,n,r){return Or(e,t,n=n||pr(e,t),Cr(e,t,gr(e,n,r),"line").top)}function Dr(e,t,n,r){return!(e.bottom<=n)&&(e.top>n||(r?e.left:e.right)>t)}function Wr(n,r,i,o,l,a,s){var e,t=At(function(e){var e=l[e],t=1!=e.level;return Dr(Lr(n,A(i,t?e.to:e.from,t?"before":"after"),"line",r,o),a,s,!0)},0,l.length-1),c=l[t];return 0s&&(c=l[t-1])),c}function Pr(u,d,h,f,e,t,n){var r,i,o,l,a,n=Or(u,d,f,n),s=n.begin,c=n.end;for(/\s/.test(d.text.charAt(c-1))&&c--,i=r=null,o=0;o=c||l.to<=s||(a=(a=gr(u,f,1!=l.level?Math.min(c,l.to)-1:Math.max(s,l.from)).right)c?{from:r.from,to:c,level:r.level}:r}function Er(e){var t,n;if(null!=e.cachedTextHeight)return e.cachedTextHeight;if(null==X){for(X=M("pre",null,"CodeMirror-line-like"),t=0;t<49;++t)X.appendChild(document.createTextNode("x")),X.appendChild(M("br"));X.appendChild(document.createTextNode("x"))}return it(e.measure,X),3<(n=X.offsetHeight/50)&&(e.cachedTextHeight=n),rt(e.measure),n||1}function Hr(e){var t,n;return null!=e.cachedCharWidth?e.cachedCharWidth:(n=M("span","xxxxxxxxxx"),t=M("pre",[n],"CodeMirror-line-like"),it(e.measure,t),2<(n=((t=n.getBoundingClientRect()).right-t.left)/10)&&(e.cachedCharWidth=n),n||10)}function Ir(e){for(var t,n=e.display,r={},i={},o=n.gutters.clientLeft,l=n.gutters.firstChild,a=0;l;l=l.nextSibling,++a)r[t=e.display.gutterSpecs[a].className]=l.offsetLeft+l.clientLeft+o,i[t]=l.clientWidth;return{fixedPos:Fr(n),gutterTotalWidth:n.gutters.offsetWidth,gutterLeft:r,gutterWidth:i,wrapperWidth:n.wrapper.clientWidth}}function Fr(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function Rr(r){var i=Er(r.display),o=r.options.lineWrapping,l=o&&Math.max(5,r.display.scroller.clientWidth/Hr(r.display)-3);return function(e){var t,n;if(In(r.doc,e))return 0;if(t=0,e.widgets)for(n=0;n=e.display.viewTo)return null;if((t-=e.display.viewFrom)<0)return null;for(n=e.display.view,r=0;rt)&&(i.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=i.viewTo?V&&En(e.doc,t)i.viewFrom?Ur(e):(i.viewFrom+=r,i.viewTo+=r):t<=i.viewFrom&&n>=i.viewTo?Ur(e):t<=i.viewFrom?(l=qr(e,n,n+r,1))?(i.view=i.view.slice(l.index),i.viewFrom=l.lineN,i.viewTo+=r):Ur(e):n>=i.viewTo?(l=qr(e,t,t,-1))?(i.view=i.view.slice(0,l.index),i.viewTo=l.lineN):Ur(e):(l=qr(e,t,t,-1),o=qr(e,n,n+r,1),l&&o?(i.view=i.view.slice(0,l.index).concat(_n(e,l.lineN,o.lineN)).concat(i.view.slice(o.index)),i.viewTo+=r):Ur(e)),(l=i.externalMeasured)&&(n=i.lineN&&t=r.viewTo||null!=(i=r.view[Vr(e,t)]).node&&-1==yt(o=i.changes||(i.changes=[]),n)&&o.push(n)}function Ur(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function qr(e,t,n,r){var i,o,l,a=Vr(e,t),s=e.display.view;if(!V||n==e.doc.first+e.doc.size)return{index:a,lineN:n};for(o=e.display.viewFrom,l=0;l=e.display.viewTo||s.to().linet||t==n&&l.to==t)&&(r(Math.max(l.from,t),Math.min(l.to,n),1==l.level?"rtl":"ltr",o),i=!0);i||r(t,n,"ltr")}(b=Dt(r,o.direction),g||0,null==m?w:m,function(e,t,n,r){var u,i,d,o,l,a="ltr"==n,s=x(e,a?"left":"right"),c=x(t-1,a?"right":"left"),h=null==g&&0==e,f=null==m&&t==w,p=0==r,r=!b||r==b.length-1;c.top-s.top<=3?(u=(T?h:f)&&p?C:(a?s:c).left,l=(T?f:h)&&r?S:(a?c:s).right,L(u,s.top,l-u,s.bottom)):(l=a?(i=T&&h&&p?C:s.left,d=T?S:k(e,n,"before"),o=T?C:k(t,n,"after"),T&&f&&r?S:c.right):(i=T?k(e,n,"before"):C,d=!T&&h&&p?S:s.right,o=!T&&f&&r?C:c.left,T?k(t,n,"after"):S),L(i,s.top,d-i,s.bottom),s.bottome.display.sizerWidth&&(u=Math.ceil(r/Hr(e.display)))>e.display.maxLineLength&&(e.display.maxLineLength=u,e.display.maxLine=t.line,e.display.maxLineChanged=!0)}2=o&&(i=nn(t,Fn(N(t,n))-e.wrapper.clientHeight),o=n)),{from:i,to:Math.max(o,i+1)}}function li(e,t){var n,r,i,o,l,a,s=e.display,c=Er(e.display);return t.top<0&&(t.top=0),n=(e.curOp&&null!=e.curOp.scrollTop?e.curOp:s.scroller).scrollTop,a=ur(e),r={},t.bottom-t.top>a&&(t.bottom=t.top+a),l=e.doc.height+lr(s),o=t.topl-c,t.topn+a&&(i=Math.min(t.top,(c?l:t.bottom)-a))!=n&&(r.scrollTop=i),o=e.options.fixedGutter?0:s.gutters.offsetWidth,c=e.curOp&&null!=e.curOp.scrollLeft?e.curOp.scrollLeft:s.scroller.scrollLeft-o,l=cr(e)-s.gutters.offsetWidth,(a=t.right-t.left>l)&&(t.right=t.left+l),t.left<10?r.scrollLeft=0:t.leftl+c-3&&(r.scrollLeft=t.right+(a?0:10)-l),r}function ai(e,t){null!=t&&(ui(e),e.curOp.scrollTop=(null==e.curOp.scrollTop?e.doc:e.curOp).scrollTop+t)}function si(e){ui(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function ci(e,t,n){null==t&&null==n||ui(e),null!=t&&(e.curOp.scrollLeft=t),null!=n&&(e.curOp.scrollTop=n)}function ui(e){var t=e.curOp.scrollToPos;t&&(e.curOp.scrollToPos=null,di(e,Mr(e,t.from),Mr(e,t.to),t.margin))}function di(e,t,n,r){t=li(e,{left:Math.min(t.left,n.left),top:Math.min(t.top,n.top)-r,right:Math.max(t.right,n.right),bottom:Math.max(t.bottom,n.bottom)+r});ci(e,t.scrollLeft,t.scrollTop)}function hi(e,t){Math.abs(e.doc.scrollTop-t)<2||(Be||Ai(e,{top:t}),fi(e,t,!0),Be&&Ai(e),Ti(e,100))}function fi(e,t,n){t=Math.max(0,Math.min(e.display.scroller.scrollHeight-e.display.scroller.clientHeight,t)),e.display.scroller.scrollTop==t&&!n||(e.doc.scrollTop=t,e.display.scrollbars.setScrollTop(t),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t))}function pi(e,t,n,r){t=Math.max(0,Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth)),(n?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)&&!r||(e.doc.scrollLeft=t,Di(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t))}function gi(e){var t=e.display,n=t.gutters.offsetWidth,r=Math.round(e.doc.height+lr(e.display));return{clientHeight:t.scroller.clientHeight,viewHeight:t.wrapper.clientHeight,scrollWidth:t.scroller.scrollWidth,clientWidth:t.scroller.clientWidth,viewWidth:t.wrapper.clientWidth,barLeft:e.options.fixedGutter?n:0,docHeight:r,scrollHeight:r+sr(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:n}}function mi(e,t){var n,r,i;for(t=t||gi(e),n=e.display.barWidth,r=e.display.barHeight,yi(e,t),i=0;i<4&&n!=e.display.barWidth||r!=e.display.barHeight;i++)n!=e.display.barWidth&&e.options.lineWrapping&&ri(e),yi(e,gi(e)),n=e.display.barWidth,r=e.display.barHeight}function yi(e,t){var n=e.display,r=n.scrollbars.update(t);n.sizer.style.paddingRight=(n.barWidth=r.right)+"px",n.sizer.style.paddingBottom=(n.barHeight=r.bottom)+"px",n.heightForcer.style.borderBottom=r.bottom+"px solid transparent",r.right&&r.bottom?(n.scrollbarFiller.style.display="block",n.scrollbarFiller.style.height=r.bottom+"px",n.scrollbarFiller.style.width=r.right+"px"):n.scrollbarFiller.style.display="",r.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(n.gutterFiller.style.display="block",n.gutterFiller.style.height=r.bottom+"px",n.gutterFiller.style.width=t.gutterWidth+"px"):n.gutterFiller.style.display=""}function vi(n){n.display.scrollbars&&(n.display.scrollbars.clear(),n.display.scrollbars.addClass&&l(n.display.wrapper,n.display.scrollbars.addClass)),n.display.scrollbars=new Y[n.options.scrollbarStyle](function(e){n.display.wrapper.insertBefore(e,n.display.scrollbarFiller),w(e,"mousedown",function(){n.state.focused&&setTimeout(function(){return n.display.input.focus()},0)}),e.setAttribute("cm-not-content","true")},function(e,t){("horizontal"==t?pi:hi)(n,e)},n),n.display.scrollbars.addClass&&st(n.display.wrapper,n.display.scrollbars.addClass)}function bi(e){e.curOp={cm:e,viewChanged:!1,startHeight:e.doc.height,forceUpdate:!1,updateInput:0,typing:!1,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,focus:!1,id:++Z,markArrays:null},e=e.curOp,q?q.ops.push(e):e.ownsGroup=q={ops:[e],delayedCallbacks:[]}}function wi(e){e=e.curOp;if(e){var t=function(u){for(var e,d,h,f,p,g, +m=0;m=y.viewTo)||y.maxLineChanged&&n.options.lineWrapping,t.update=t.mustUpdate&&new Q(n,t.mustUpdate&&{top:t.scrollTop,ensure:t.scrollToPos},t.forceUpdate)}for(h=0;h(i.defaultView.innerHeight||i.documentElement.clientHeight)&&(r=!1),null==r||Ye||(o=M("div","​",null,"position: absolute;\n top: "+(t.top-n.viewOffset-or(e.display))+"px;\n height: "+(t.bottom-t.top+sr(e)+n.barHeight)+"px;\n left: "+t.left+"px; width: "+Math.max(2,t.right-t.left)+"px;"),e.display.lineSpace.appendChild(o),o.scrollIntoView(r),e.display.lineSpace.removeChild(o)))}(c,w));x=s.maybeHiddenMarkers,k=s.maybeUnhiddenMarkers;if(x)for(C=0;C=l.display.viewTo||(a=+new Date+l.options.workTime,s=pn(l,u.highlightFrontier),c=[],u.iter(s.line,Math.min(u.first+u.size,l.display.viewTo+500),function(e){var t,n,r,i,o;if(s.line>=l.display.viewFrom){for(t=e.styles,n=e.text.length>l.options.maxHighlightLength?Xt(u.mode,s.state):null,r=hn(l,e,s,!0),n&&(s.state=n),e.styles=r.styles,n=e.styleClasses,(r=r.classes)?e.styleClasses=r:n&&(e.styleClasses=null),i=!t||t.length!=e.styles.length||n!=r&&(!n||!r||n.bgClass!=r.bgClass||n.textClass!=r.textClass),o=0;!i&&oa)return Ti(l,l.options.workDelay),!0}),u.highlightFrontier=s.line,u.modeFrontier=Math.max(u.modeFrontier,s.line),c.length&&xi(l,function(){for(var e=0;e=a.viewFrom&&t.visible.to<=a.viewTo&&(null==a.updateLineNumbers||a.updateLineNumbers>=a.viewTo)&&a.renderedView==a.view&&0==_r(e))return!1;if(Wi(e)&&(Ur(e),t.dims=Ir(e)),n=u.first+u.size,c=Math.max(t.visible.from-e.options.viewportMargin,u.first),i=Math.min(n,t.visible.to+e.options.viewportMargin),a.viewFromi&&a.viewTo-i<20&&(i=Math.min(n,a.viewTo)),V&&(c=En(e.doc,c),i=Hn(e.doc,i)),u=c!=a.viewFrom||i!=a.viewTo||a.lastWrapHeight!=t.wrapperHeight||a.lastWrapWidth!=t.wrapperWidth,n=c,c=i,0==(r=(i=e).display).view.length||n>=r.viewTo||c<=r.viewFrom?(r.view=_n(i,n,c),r.viewFrom=n):(r.viewFrom>n?r.view=_n(i,n,r.viewFrom).concat(r.view):r.viewFromc&&(r.view=r.view.slice(0,Vr(i,c)))),r.viewTo=c,a.viewOffset=Fn(N(e.doc,a.viewFrom)),e.display.mover.style.top=a.viewOffset+"px",n=_r(e),!u&&0==n&&!t.force&&a.renderedView==a.view&&(null==a.updateLineNumbers||a.updateLineNumbers>=a.viewTo))return!1;r=!(i=e).hasFocus()&&(o=at(dt(i)))&<(i.display.lineDiv,o)?(o={activeElt:o},window.getSelection&&(l=ft(i).getSelection()).anchorNode&&l.extend&<(i.display.lineDiv,l.anchorNode)&&(o.anchorNode=l.anchorNode,o.anchorOffset=l.anchorOffset,o.focusNode=l.focusNode,o.focusOffset=l.focusOffset),o):null,4=e.display.viewFrom&&t.visible.to<=e.display.viewTo)break;if(!Mi(e,t))break;ri(e),n=gi(e),$r(e),mi(e,n),zi(e,n),t.force=!1}t.signal(e,"update",e),e.display.viewFrom==e.display.reportedViewFrom&&e.display.viewTo==e.display.reportedViewTo||(t.signal(e,"viewportChange",e,e.display.viewFrom,e.display.viewTo),e.display.reportedViewFrom=e.display.viewFrom,e.display.reportedViewTo=e.display.viewTo)}function Ai(e,t){var n,t=new Q(e,t);Mi(e,t)&&(ri(e),Ni(e,t),n=gi(e),$r(e),mi(e,n),zi(e,n),t.finish())}function Oi(e){var t=e.gutters.offsetWidth;e.sizer.style.marginLeft=t+"px",$n(e,"gutterChanged",e)}function zi(e,t){e.display.sizer.style.minHeight=t.docHeight+"px",e.display.heightForcer.style.top=t.docHeight+"px",e.display.gutters.style.height=t.docHeight+e.display.barHeight+sr(e)+"px"}function Di(e){var t,n,r,i,o,l,a=e.display,s=a.view;if(a.alignWidgets||a.gutters.firstChild&&e.options.fixedGutter){for(t=Fr(a)-a.scroller.scrollLeft+e.doc.scrollLeft,n=a.gutters.offsetWidth,r=t+"px",i=0;io.clientWidth,c=o.scrollHeight>o.clientHeight,n&&s||r&&c){if(r&&et&&Ge)e:for(l=t.target,u=i.view;l!=o;l=l.parentNode)for(d=0;di-(e.cm?e.cm.options.historyEventDelay:500)||"*"==t.origin.charAt(0)))&&(a=(a=s).lastOp==r?(no(a.done),wt(a.done)):a.done.length&&!wt(a.done).ranges?wt(a.done):1s.undoDepth;)s.done.shift(),s.done[0].ranges||s.done.shift();s.done.push(n),s.generation=++s.maxGeneration,s.lastModTime=s.lastSelTime=i,s.lastOp=s.lastSelOp=r,s.lastOrigin=s.lastSelOrigin=t.origin,o||Et(e,"historyAdded")}function io(e,t,n,r){var i,o,l,a=e.history,s=r&&r.origin;n==a.lastSelOp||s&&a.lastSelOrigin==s&&(a.lastModTime==a.lastSelTime&&a.lastOrigin==s||(e=e,i=s,o=wt(a.done),l=t,"*"==(i=i.charAt(0))||"+"==i&&o.ranges.length==l.ranges.length&&o.somethingSelected()==l.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)))?a.done[a.done.length-1]=t:oo(t,a.done),a.lastSelTime=+new Date,a.lastSelOrigin=s,a.lastSelOp=n,r&&!1!==r.clearRedo&&no(a.undone)}function oo(e,t){var n=wt(t);n&&n.ranges&&n.equals(e)||t.push(e)}function lo(t,n,e,r){var i=n["spans_"+t.id],o=0;t.iter(Math.max(t.first,e),Math.min(t.first+t.size,r),function(e){e.markedSpans&&((i=i||(n["spans_"+t.id]={}))[o]=e.markedSpans),++o})}function ao(e,t){var n,r,i=t["spans_"+e.id];if(!i)return null;for(n=[],r=0;r=t.ch:s.to>t.ch))){if(d&&(Et(i,"beforeCursorEnter"),i.explicitlyCleared)){if(c.markedSpans){--r;continue}break}if(i.atomic)return u&&(a=i.find(n<0?1:-1),s=void 0,(a=(n<0?l:o)?So(e,a,-n,a&&a.line==t.line?c:null):a)&&a.line==t.line&&(s=k(a,u))&&(n<0?s<0:0e.first?O(e,A(t.line-1)):null:0e.lastLine())){if(t.from.liner?{from:t.from,to:A(r,N(e,r).text.length),text:[t.text[0]],origin:t.origin}:t).removed=Qt(e,t.from,t.to),u=u||Ui(e,t),e.cm){var h,n,f,r=e.cm,i=t,o=d,l=r.doc,p=r.display,a=i.from,g=i.to,m=!1,s=a.line,c=(r.options.lineWrapping||(s=tn(Pn(N(l,a.line))),l.iter(s,g.line+1,function(e){if(e==p.maxLine)return m=!0})),-1p.maxLineLength&&(p.maxLine=e,p.maxLineLength=t,p.maxLineChanged=!0,m=!1)}),m&&(r.curOp.updateMaxLine=!0)),l),y=a.line;if(c.modeFrontier=Math.min(c.modeFrontier,y),!(c.highlightFrontier=this.string.length},I.prototype.sol=function(){return this.pos==this.lineStart},I.prototype.peek=function(){return this.string.charAt(this.pos)||undefined},I.prototype.next=function(){if(this.post},I.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},I.prototype.skipToEnd=function(){this.pos=this.string.length},I.prototype.skipTo=function(e){e=this.string.indexOf(e,this.pos);if(-1this.maxLookAhead&&(this.maxLookAhead=e),t},R.prototype.baseToken=function(e){if(!this.baseTokens)return null;for(;this.baseTokens[this.baseTokenPos]<=e;)this.baseTokenPos+=2;var t=this.baseTokens[this.baseTokenPos+1];return{type:t&&t.replace(/( |^)overlay .*/,""),size:this.baseTokens[this.baseTokenPos]-e}},R.prototype.nextLine=function(){this.line++,0e.clientWidth+1,r=e.scrollHeight>e.clientHeight+1,i=e.nativeBarWidth;return r?(this.vert.style.display="block",this.vert.style.bottom=n?i+"px":"0",t=e.viewHeight-(n?i:0),this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+t)+"px"):(this.vert.scrollTop=0,this.vert.style.display="",this.vert.firstChild.style.height="0"),n?(this.horiz.style.display="block",this.horiz.style.right=r?i+"px":"0",this.horiz.style.left=e.barLeft+"px",t=e.viewWidth-e.barLeft-(r?i:0),this.horiz.firstChild.style.width=Math.max(0,e.scrollWidth-e.clientWidth+t)+"px"):(this.horiz.style.display="",this.horiz.firstChild.style.width="0"),!this.checkedZeroWidth&&0e.display.maxLineLength&&(e.display.maxLine=c,e.display.maxLineLength=u,e.display.maxLineChanged=!0);null!=r&&e&&this.collapsed&&Kr(e,r,i+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&wo(e.doc)),e&&$n(e,"markerCleared",e,this,r,i),t&&wi(e),this.parent&&this.parent.clear()}},oe.prototype.find=function(e,t){var n,r,i,o,l;for(null==e&&"bookmark"==this.type&&(e=1),i=0;i=e.ch)&&i.push(r.marker.parent||r.marker);return i},findMarks:function(i,o,l){i=O(this,i),o=O(this,o);var a=[],s=i.line;return this.iter(i.line,o.line+1,function(e){var t,n,r=e.markedSpans;if(r)for(t=0;t=n.to||null==n.from&&s!=i.line||null!=n.from&&s==o.line&&n.from>=o.ch||l&&!l(n.marker)||a.push(n.marker.parent||n.marker);++s}),a},getAllMarks:function(){var r=[];return this.iter(function(e){var t,n=e.markedSpans;if(n)for(t=0;tt&&(t=e.from),null!=e.to&&e.toe.text.length?null:t}function nl(e,t,n){e=tl(e,t.ch,n);return null==e?null:new A(t.line,e,n<0?"after":"before")}function rl(e,t,n,r,i){var o,l,a,s;return e&&("rtl"==t.doc.direction&&(i=-i),o=Dt(n,t.doc.direction))?(o=i<0==(1==(e=i<0?wt(o):o[0]).level)?"after":"before",0a&&t.push(new ne(A(o,a),A(o,vt(l,i,n))));t.length||t.push(new ne(f,f)),yo(g,ji(h,v.ranges.slice(0,y).concat(t),y),{origin:"*mouse",scroll:!1}),h.scrollIntoView(e)}else c=m,s=pl(h,e,p.unit),e=c.anchor,e=0=t.to||i.linea.bottom?20:0)&&setTimeout(ki(h,function(){s==r&&(l.scroller.scrollTop+=n,o(e))}),50))}:i)(e)}),r=ki(h,i);h.state.selectingText=r,w(l.wrapper.ownerDocument,"mousemove",n),w(l.wrapper.ownerDocument,"mouseup",r)})(t,u,n,d)):Gt(e)==c.scroller&&Bt(e):2==l?(o&&ho(s.doc,o),setTimeout(function(){return c.input.focus()},20)):3==l&&(f?s.display.input.onContextMenu(e):ei(s)))))}function pl(e,t,n){if("char"==n)return new ne(t,t);if("word"==n)return e.findWordAt(t);if("line"==n)return new ne(A(t.line,0),O(e.doc,A(t.line+1,0)));e=n(e,t);return new ne(e.from,e.to)}function gl(e,t,n,r){var i,o,l,a,s;if(t.touches)i=t.touches[0].clientX,o=t.touches[0].clientY;else try{i=t.clientX,o=t.clientY}catch(c){return!1}if(i>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;if(r&&Bt(t),o>(r=(l=e.display).lineDiv.getBoundingClientRect()).bottom||!Ft(e,n))return Vt(t);for(o-=r.top-l.viewOffset,a=0;a=i)return Et(e,n,e,nn(e.doc,o),e.display.gutterSpecs[a].className,t),Vt(t)}function ml(e,t){return gl(e,t,"gutterClick",!0)}function yl(e,t){var n,r;ir(e.display,t)||(r=t,Ft(n=e,"gutterContextMenu")&&gl(n,r,"gutterContextMenu",!1))||Ht(e,t,"contextmenu")||f||e.display.input.onContextMenu(t)}function vl(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),br(e)}function bl(e,t,n){var n=n&&n!=ke;!t!=!n&&(n=e.display.dragFunctions,(t=t?w:Pt)(e.display.scroller,"dragstart",n.start),t(e.display.scroller,"dragenter",n.enter),t(e.display.scroller,"dragover",n.over),t(e.display.scroller,"dragleave",n.leave),t(e.display.scroller,"drop",n.drop))}function wl(e){e.options.lineWrapping?(st(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(l(e.display.wrapper,"CodeMirror-wrap"),Bn(e)),Br(e),Kr(e),br(e),setTimeout(function(){return mi(e)},100)}function xl(e,t){var n,r,i,o=this;if(!(this instanceof xl))return new xl(e,t);this.options=t=t?gt(t):{},gt(Ce,t,!1),"string"==typeof(n=t.value)?n=new se(n,t.mode,null,t.lineSeparator,t.direction):t.mode&&(n.modeOption=t.mode),this.doc=n,a=new xl.inputStyles[t.inputStyle](this),vl((e=this.display=new Ii(e,n,a,t)).wrapper.CodeMirror=this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),vi(this),this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:!1,delayingBlurEvent:!1,focused:!1,suppressEdits:!1,pasteIncoming:-1,cutIncoming:-1,selectingText:!1,draggingText:!1,highlight:new p,keySeq:null,specialChars:null},t.autofocus&&!Je&&e.input.focus(),x&&Ke<11&&setTimeout(function(){return o.display.input.reset(!0)},20);var u,l,a,s=this,c=s.display;function d(){c.activeTouch&&(u=setTimeout(function(){return c.activeTouch=null},1e3),(l=c.activeTouch).end=+new Date)}function h(e,t){if(null==t.left)return 1;var n=t.left-e.left,t=t.top-e.top;return 400c.first?mt(N(c,t-1).text,null,r):0:"add"==n?l=h+e.options.indentUnit:"subtract"==n?l=h-e.options.indentUnit:"number"==typeof n&&(l=h+n),l=Math.max(0,l),a="",f=0,e.options.indentWithTabs)for(p=Math.floor(l/r);p;--p)f+=r,a+="\t";if(fh,i=L(t),o=null,r&&1h?"cut":"+input")},Mo(e.doc,c),$n(e,"inputRead",e,c);t&&!r&&Ll(e,t),si(e),e.curOp.updateInput<2&&(e.curOp.updateInput=p),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function Tl(e,t){var n=e.clipboardData&&e.clipboardData.getData("Text");return n&&(e.preventDefault(),t.isReadOnly()||t.options.disableInput||!t.hasFocus()||xi(t,function(){return Sl(t,n,0,null,"paste")}),1)}function Ll(e,t){var n,r,i,o,l,a;if(e.options.electricChars&&e.options.smartIndent)for(r=(n=e.doc.sel).ranges.length-1;0<=r;r--)if(!(100<(i=n.ranges[r]).head.ch||r&&n.ranges[r-1].head.line==i.head.line)){if(l=!1,(o=e.getModeAt(i.head)).electricChars){for(a=0;a=n.text.length?(a.ch=n.text.length,a.sticky="before"):a.ch<=0&&(a.ch=0,a.sticky="after"),o=Ot(c,a.ch,a.sticky),i=c[o],"ltr"==t.doc.direction&&i.level%2==0&&(0a.ch:i.from=i.from&&r>=l.begin))?!(o=(i=function(e,t,n){for(var r,i,o,l=function(e,t){return t?new A(a.line,s(e,1),"before"):new A(a.line,e,"after")};0<=e&&e=g.first+g.size||(m=new A(p,m.ch,m.sticky),!(b=N(g,p))))return;m=rl(w,g.cm,b,m.line,x)}else m=l;return 1}if("char"==v||"codepoint"==v)i();else if("column"==v)i(!0);else if("word"==v||"group"==v)for(e=null,o="group"==v,l=g.cm&&g.cm.getHelper(m,"wordChars"),t=!0;!(y<0)||i(!t);t=!1){if(n=Tt(n=b.text.charAt(m.ch)||"\n",l)?"w":o&&"\n"==n?"n":!o||/\s/.test(n)?null:"p",!o||t||n||(n="s"),e&&e!=n){y<0&&(y=1,i(),m.sticky="after");break}if(n&&(e=n),0=a.height){l.hitSide=!0;break}i+=5*n}return l}function Dl(e,t){var n,r,i=fr(e,t.line);return!i||i.hidden?null:(n=dr(i,i=N(e.doc,t.line),t.line),r="left",(i=Dt(i,e.doc.direction))&&(r=Ot(i,t.ch)%2?"right":"left"),(e=mr(n.map,t.ch,r)).offset="right"==e.collapse?e.end:e.start,e)}function Wl(e,t){return t&&(e.bad=!0),e}function Pl(e,u,d){var t,h;if(u==e.display.lineDiv){if(!(t=e.display.lineDiv.childNodes[d]))return Wl(e.clipPos(A(e.display.viewTo-1)),!0);u=null,d=0}else for(t=u;;t=t.parentNode){if(!t||t==e.display.lineDiv)return null;if(t.parentNode&&t.parentNode==e.display.lineDiv)break}for(h=0;hl.doc.first&&(n=N(l.doc,e.line-1).text)&&(e=new A(e.line,1),l.replaceRange(t.charAt(0)+l.doc.lineSeparator()+n.charAt(n.length-1),A(e.line-1,n.length-1),e,"+transpose"))),i.push(new ne(e,e)));l.setSelections(i)})},newlineAndIndent:function(r){return xi(r,function(){for(var e,t=r.listSelections(),n=t.length-1;0<=n;n--)r.replaceRange(r.doc.lineSeparator(),t[n].anchor,t[n].head,"+input");for(t=r.listSelections(),e=0;ee&&0==k(t,this.pos)&&n==this.button},ke={toString:function(){return"CodeMirror.Init"}},Ce={},Se={},xl.defaults=Ce,xl.optionHandlers=Se,Te=[],xl.defineInitHook=function(e){return Te.push(e)},Le=null,(t=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new p,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null}).prototype.init=function(e){var t=this,o=this,l=o.cm,a=o.div=e.lineDiv;function s(e){for(var t=e.target;t;t=t.parentNode){if(t==a)return 1;if(/\bCodeMirror-(?:line)?widget\b/.test(t.className))break}}function n(e){var t,n,r,i;if(s(e)&&!Ht(l,e)){if(l.somethingSelected())Cl({lineWise:!1,text:l.getSelections()}),"cut"==e.type&&l.replaceSelection("",null,"cut");else{if(!l.options.lineWiseCopyCut)return;Cl({lineWise:!0,text:(t=Ml(l)).text}),"cut"==e.type&&l.operation(function(){l.setSelections(t.ranges,0,v),l.replaceSelection("",null,"cut")})}e.clipboardData&&(e.clipboardData.clearData(),r=Le.text.join("\n"),e.clipboardData.setData("Text",r),e.clipboardData.getData("Text")==r)?e.preventDefault():(Nl(r=(n=Al()).firstChild),l.display.lineSpace.insertBefore(n,l.display.lineSpace.firstChild),r.value=Le.text.join("\n"),i=at(ht(a)),c(r),setTimeout(function(){l.display.lineSpace.removeChild(n),i.focus(),i==a&&o.showPrimarySelection()},50))}}a.contentEditable=!0,Nl(a,l.options.spellcheck,l.options.autocorrect,l.options.autocapitalize),w(a,"paste",function(e){!s(e)||Ht(l,e)||Tl(e,l)||Ke<=11&&setTimeout(ki(l,function(){return t.updateFromDOM()}),20)}),w(a,"compositionstart",function(e){t.composing={data:e.data,done:!1}}),w(a,"compositionupdate",function(e){t.composing||(t.composing={data:e.data,done:!1})}),w(a,"compositionend",function(e){t.composing&&(e.data!=t.composing.data&&t.readFromDOMSoon(),t.composing.done=!0)}),w(a,"touchstart",function(){return o.forceCompositionEnd()}),w(a,"input",function(){t.composing||t.readFromDOMSoon()}),w(a,"copy",n),w(a,"cut",n)},t.prototype.screenReaderLabelChanged=function(e){e?this.div.setAttribute("aria-label",e):this.div.removeAttribute("aria-label")}, +t.prototype.prepareSelection=function(){var e=Xr(this.cm,!1);return e.focus=at(ht(this.div))==this.div,e},t.prototype.showSelection=function(e,t){e&&this.cm.display.view.length&&((e.focus||t)&&this.showPrimarySelection(),this.showMultipleSelections(e))},t.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},t.prototype.showPrimarySelection=function(){var e,t,n,r=this.getSelection(),i=this.cm,o=i.doc.sel.primary(),l=o.from(),o=o.to();if(i.display.viewTo==i.display.viewFrom||l.line>=i.display.viewTo||o.line=i.display.viewFrom&&Dl(i,l)||{node:t[0].measure.map[2],offset:0},l=(l=o.linee.firstLine()&&(t=A(t.line-1,N(e.doc,t.line-1).length)),n.ch==N(e.doc,n.line).text.length&&n.lines.viewTo-1)return!1;if(c=t.line==s.viewFrom||0==(c=Vr(e,t.line))?(u=tn(s.view[0].line),s.view[0].node):(u=tn(s.view[c].line),s.view[c-1].node.nextSibling),n=(n=Vr(e,n.line))==s.view.length-1?(d=s.viewTo-1,s.lineDiv.lastChild):(d=tn(s.view[n+1].line)-1,s.view[n+1].node.previousSibling),!c)return!1;for(r=e.doc.splitLines(function(l,e,t,f,p){var n="",a=!1,s=l.doc.lineSeparator(),c=!1;function u(){a&&(n+=s,c&&(n+=s),a=c=!1)}function d(e){e&&(u(),n+=e)}for(;!function h(e){var t,n,r,i,o;if(1==e.nodeType){if(n=e.getAttribute("cm-text"))d(n);else if(n=e.getAttribute("cm-marker"))(n=l.findMarks(A(f,0),A(p+1,0),(o=+n,function(e){return e.id==o}))).length&&(t=n[0].find(0))&&d(Qt(l.doc,t.from,t.to).join(s));else if("false"!=e.getAttribute("contenteditable")&&(r=/^(pre|div|p|li|table|br)$/i.test(e.nodeName),/^br$/i.test(e.nodeName)||0!=e.textContent.length)){for(r&&u(),i=0;it.ch&&a.charCodeAt(a.length-l-1)==g.charCodeAt(g.length-l-1);)o--,l++;return r[r.length-1]=a.slice(0,a.length-l).replace(/^\u200b+/,""),r[0]=r[0].slice(o).replace(/\u200b+$/,""),s=A(u,o),c=A(d,i.length?wt(i).length-l:0),1l&&(kl(this,i.head.line,e,!0),l=i.head.line,a==this.doc.sel.primIndex&&si(this));else{for(t=i.from(),i=i.to(),n=Math.max(l,t.line),l=Math.min(this.lastLine(),i.line-(i.ch?0:1))+1,r=n;r>1)?t[2*l-1]:0)>=i)r=l;else{if(!(t[2*l+1]l)&&e.top>t.offsetHeight?s=e.top-t.offsetHeight:e.bottom+t.offsetHeight<=l&&(s=e.bottom),c+t.offsetWidth>o&&(c=o-t.offsetWidth)),t.style.top=s+"px",t.style.left=t.style.right="","right"==i?(c=a.sizer.clientWidth-t.offsetWidth,t.style.right="0px"):("left"==i?c=0:"middle"==i&&(c=(a.sizer.clientWidth-t.offsetWidth)/2),t.style.left=c+"px"),n&&(r=this,l={left:c,top:s,right:c+t.offsetWidth,bottom:s+t.offsetHeight},null!=(l=li(r,l)).scrollTop&&hi(r,l.scrollTop),null!=l.scrollLeft&&pi(r,l.scrollLeft))},triggerOnKeyDown:Ci(ul),triggerOnKeyPress:Ci(hl),triggerOnKeyUp:dl,triggerOnMouseDown:Ci(fl),execCommand:function(e){if(me.hasOwnProperty(e))return me[e].call(null,this)},triggerElectric:Ci(function(e){Ll(this,e)}),findPosH:function(e,t,n,r){var i,o,l=1;for(t<0&&(l=-1,t=-t),i=O(this.doc,e),o=0;o","i")}function o(e,t){var n,r,i,o;for(n in e)for(r=t[n]||(t[n]=[]),o=(i=e[n]).length-1;0<=o;o--)r.unshift(i[o])}n={},d.defineMode("htmlmixed",function(a,e){var t,s=d.getMode(a,{name:"xml",htmlMode:!0,multilineTagIndentFactor:e.multilineTagIndentFactor,multilineTagIndentPastTag:e.multilineTagIndentPastTag,allowMissingTagName:e.allowMissingTagName}),c={},n=e&&e.tags,r=e&&e.scriptTypes;if(o(i,c),n&&o(n,c),r)for(t=r.length-1;0<=t;t--)c.script.unshift(["type",r[t].matches,r[t].mode]);function u(e,t){var n,o,l,r=s.token(e,t.htmlState),i=/\btag\b/.test(r);return i&&!/[<>\s\/]/.test(e.current())&&(n=t.htmlState.tagName&&t.htmlState.tagName.toLowerCase())&&c.hasOwnProperty(n)?t.inTag=n+" ":t.inTag&&i&&/>$/.test(e.current())?(n=/^([\S]+) (.*)/.exec(t.inTag),t.inTag=null,i=">"==e.current()&&function(e,t){for(var n,r=0;r")):null:t.match("--")?r(p("comment","--\x3e")):t.match("DOCTYPE",!0,!0)?(t.eatWhile(/[\w\._\-]/),r(function i(r){return function(e,t){for(var n;null!=(n=e.next());){if("<"==n)return t.tokenize=i(r+1),t.tokenize(e,t);if(">"==n){if(1!=r)return t.tokenize=i(r-1),t.tokenize(e,t);t.tokenize=s;break}}return"meta"}}(1))):null:t.eat("?")?(t.eatWhile(/[\w\._\-]/),n.tokenize=p("meta","?>"),"meta"):(o=t.eat("/")?"closeTag":"openTag",n.tokenize=f,"tag bracket"):"&"==e?(t.eat("#")?t.eat("x")?t.eatWhile(/[a-fA-F\d]/)&&t.eat(";"):t.eatWhile(/[\d]/)&&t.eat(";"):t.eatWhile(/[\w\.\-:]/)&&t.eat(";"))?"atom":"error":(t.eatWhile(/[^&<]/),null)}function f(e,t){var n,r,i=e.next();return">"==i||"/"==i&&e.eat(">")?(t.tokenize=s,o=">"==i?"endTag":"selfcloseTag","tag bracket"):"="==i?(o="equals",null):"<"==i?(t.tokenize=s,t.state=u,t.tagName=t.tagStart=null,(r=t.tokenize(e,t))?r+" tag error":"tag error"):/[\'\"]/.test(i)?(t.tokenize=(n=i,(r=function(e,t){for(;!e.eol();)if(e.next()==n){t.tokenize=f;break}return"string"}).isInAttribute=!0,r),t.stringStartCol=e.column(),t.tokenize(e,t)):(e.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function p(n,r){return function(e,t){for(;!e.eol();){if(e.match(r)){t.tokenize=s;break}e.next()}return n}}function c(e){return e&&e.toLowerCase()}function g(e,t,n){this.prev=e.context,this.tagName=t||"",this.indent=e.indented,this.startOfLine=n,(a.doNotIndent.hasOwnProperty(t)||e.context&&e.context.noIndent)&&(this.noIndent=!0)}function m(e){e.context&&(e.context=e.context.prev)}function y(e,t){for(var n;;){if(!e.context)return;if(n=e.context.tagName,!a.contextGrabbers.hasOwnProperty(c(n))||!a.contextGrabbers[c(n)].hasOwnProperty(c(t)))return;m(e)}}function u(e,t,n){return"openTag"==e?(n.tagStart=t.column(),v):"closeTag"==e?b:u}function v(e,t,n){return"word"==e?(n.tagName=t.current(),l="tag",d):a.allowMissingTagName&&"endTag"==e?(l="tag bracket",d(e,0,n)):(l="error",v)}function b(e,t,n){var r;return"word"==e?(r=t.current(),n.context&&n.context.tagName!=r&&a.implicitlyClosed.hasOwnProperty(c(n.context.tagName))&&m(n),n.context&&n.context.tagName==r||!1===a.matchClosing?(l="tag",i):(l="tag error",w)):a.allowMissingTagName&&"endTag"==e?(l="tag bracket",i(e,0,n)):(l="error",w)}function i(e,t,n){return"endTag"!=e?(l="error",i):(m(n),u)}function w(e,t,n){return l="error",i(e,0,n)}function d(e,t,n){return"word"==e?(l="attribute",x):"endTag"==e||"selfcloseTag"==e?(r=n.tagName,i=n.tagStart,n.tagName=n.tagStart=null,"selfcloseTag"==e||a.autoSelfClosers.hasOwnProperty(c(r))?y(n,r):(y(n,r),n.context=new g(n,r,i==n.indented)),u):(l="error",d);var r,i}function x(e,t,n){return"equals"==e?k:(a.allowMissing||(l="error"),d(e,0,n))}function k(e,t,n){return"string"==e?C:"word"==e&&a.allowUnquoted?(l="string",d):(l="error",d(e,0,n))}function C(e,t,n){return"string"==e?C:d(e,0,n)}return s.isInText=!0,{startState:function(e){var t={tokenize:s,state:u,indented:e||0,tagName:null,tagStart:null,context:null};return null!=e&&(t.baseIndent=e),t},token:function(e,t){if(!t.tagName&&e.sol()&&(t.indented=e.indentation()),e.eatSpace())return null;o=null;var n=t.tokenize(e,t);return(n||o)&&"comment"!=n&&(l=null,t.state=t.state(o||n,e,t),l&&(n="error"==l?n+" error":l)),n},indent:function(e,t,n){var r,i,o=e.context;if(e.tokenize.isInAttribute)return e.tagStart==e.indented?e.stringStartCol+1:e.indented+h;if(o&&o.noIndent)return S.Pass;if(e.tokenize!=f&&e.tokenize!=s)return n?n.match(/^(\s*)/)[0].length:0;if(e.tagName)return!1!==a.multilineTagIndentPastTag?e.tagStart+e.tagName.length+2:e.tagStart+h*(a.multilineTagIndentFactor||1);if(a.alignCDATA&&/$/,blockCommentStart:"\x3c!--",blockCommentEnd:"--\x3e",configuration:a.htmlMode?"html":"xml",helperType:a.htmlMode?"html":"xml",skipAttribute:function(e){e.state==k&&(e.state=d)},xmlCurrentTag:function(e){return e.tagName?{name:e.tagName,close:"closeTag"==e.type}:null},xmlCurrentContext:function(e){for(var t=[],n=e.context;n;n=n.prev)t.push(n.tagName);return t.reverse()}}}),S.defineMIME("text/xml","xml"),S.defineMIME("application/xml","xml"),S.mimeModes.hasOwnProperty("text/html")||S.defineMIME("text/html",{name:"xml",htmlMode:!0})},"object"==typeof exports&&"object"==typeof module?r(require("../../lib/codemirror")):r(n),r=function(nt){"use strict";nt.defineMode("javascript",function(t,p){var r,i,g,a,n,m,y,v,b,w=t.indentUnit,x=p.statementIndent,k=p.jsonld,C=p.json||k,S=!1!==p.trackScope,c=p.typescript,T=p.wordCharacters||/[\w$\xa1-\uffff]/,L=(t=e("keyword a"),m=e("keyword b"),y=e("keyword c"),v=e("keyword d"),b=e("operator"),{"if":e("if"),"while":t,"with":t,"else":m,"do":m,"try":m,"finally":m,"return":v,"break":v,"continue":v,"new":e("new"),"delete":y,"void":y,"throw":y,"debugger":e("debugger"),"var":e("var"),"const":e("var"),"let":e("var"),"function":e("function"),"catch":e("catch"),"for":e("for"),"switch":e("switch"),"case":e("case"),"default":e("default"),"in":b,"typeof":b,"instanceof":b,"true":t={type:"atom",style:"atom"},"false":t,"null":t,undefined:t,NaN:t,Infinity:t,"this":e("this"),"class":e("class"),"super":e("atom"),"yield":y,"export":e("export"),"import":e("import"),"extends":y,"await":y}),M=/[+\-*&%=<>!?|~^@]/,N=/^@(context|id|value|language|type|container|list|set|reverse|index|base|vocab|graph)"/;function e(e){return{type:e,style:"keyword"}}function A(e,t,n){return r=e,i=n,t}function O(e,t){var i,n=e.next();if('"'==n||"'"==n)return t.tokenize=(i=n,function(e,t){var n,r=!1;if(k&&"@"==e.peek()&&e.match(N))return t.tokenize=O,A("jsonld-keyword","meta");for(;null!=(n=e.next())&&(n!=i||r);)r=!r&&"\\"==n;return r||(t.tokenize=O),A("string","string")}),t.tokenize(e,t);if("."==n&&e.match(/^\d[\d_]*(?:[eE][+\-]?[\d_]+)?/))return A("number","number");if("."==n&&e.match(".."))return A("spread","meta");if(/[\[\]{}\(\),;\:\.]/.test(n))return A(n);if("="==n&&e.eat(">"))return A("=>","operator");if("0"==n&&e.match(/^(?:x[\dA-Fa-f_]+|o[0-7_]+|b[01_]+)n?/))return A("number","number");if(/\d/.test(n))return e.match(/^[\d_]*(?:n|(?:\.[\d_]*)?(?:[eE][+\-]?[\d_]+)?)?/),A("number","number");if("/"==n)return e.eat("*")?(t.tokenize=z)(e,t):e.eat("/")?(e.skipToEnd(),A("comment","comment")):tt(e,t,1)?(function(e){for(var t,n=!1,r=!1;null!=(t=e.next());){if(!n){if("/"==t&&!r)return;"["==t?r=!0:r&&"]"==t&&(r=!1)}n=!n&&"\\"==t}}(e),e.match(/^\b(([gimyus])(?![gimyus]*\2))+\b/),A("regexp","string-2")):(e.eat("="),A("operator","operator",e.current()));if("`"==n)return(t.tokenize=D)(e,t);if("#"==n&&"!"==e.peek())return e.skipToEnd(),A("meta","meta");if("#"==n&&e.eatWhile(T))return A("variable","property");if("<"==n&&e.match("!--")||"-"==n&&e.match("->")&&!/\S/.test(e.string.slice(0,e.start)))return e.skipToEnd(),A("comment","comment");if(M.test(n))return">"==n&&t.lexical&&">"==t.lexical.type||(e.eat("=")?"!"!=n&&"="!=n||e.eat("="):/[<>*+\-|&?]/.test(n)&&(e.eat(n),">"==n&&e.eat(n))),"?"==n&&e.eat(".")?A("."):A("operator","operator",e.current());if(T.test(n)){if(e.eatWhile(T),n=e.current(),"."!=t.lastType){if(L.propertyIsEnumerable(n))return A((t=L[n]).type,t.style,n);if("async"==n&&e.match(/^(\s|\/\*([^*]|\*(?!\/))*?\*\/)*[\[\(\w]/,!1))return A("async","keyword",n)}return A("variable","variable",n)}}function z(e,t){for(var n,r=!1;n=e.next();){if("/"==n&&r){t.tokenize=O;break}r="*"==n}return A("comment","comment")}function D(e,t){for(var n,r=!1;null!=(n=e.next());){if(!r&&("`"==n||"$"==n&&e.eat("{"))){t.tokenize=O;break}r=!r&&"\\"==n}return A("quasi","string-2",e.current())}function W(e,t){var n,r,i,o,l,a,s;if(t.fatArrowAt&&(t.fatArrowAt=null),!((n=e.string.indexOf("=>",e.start))<0)){for(i=0,o=!1,l=(n=c&&(r=/:\s*(?:\w+(?:<[^>]*>|\[\])?|\{[^}]*\})\s*$/.exec(e.string.slice(e.start,n)))?r.index:n)-1;0<=l;--l)if(a=e.string.charAt(l),0<=(s="([{}])".indexOf(a))&&s<3){if(!i){++l;break}if(0==--i){"("==a&&(o=!0);break}}else if(3<=s&&s<6)++i;else if(T.test(a))o=!0;else if(/["'\/`]/.test(a))for(;;--l){if(0==l)return;if(e.string.charAt(l-1)==a&&"\\"!=e.string.charAt(l-2)){l--;break}}else if(o&&!i){++l;break}o&&!i&&(t.fatArrowAt=l)}}function P(e,t,n,r,i,o){this.indented=e,this.column=t,this.type=n,this.prev=i,this.info=o,null!=r&&(this.align=r)}function E(e,t,n,r,i){var o=e.cc;for(a.state=e,a.stream=i,a.marked=null,a.cc=o,a.style=t,e.lexical.hasOwnProperty("align")||(e.lexical.align=!0);;)if((o.length?o.pop():C?l:G)(n,r)){for(;o.length&&o[o.length-1].lex;)o.pop()();return a.marked?a.marked:"variable"==n&&function(e,t){var n,r;if(S){for(n=e.localVars;n;n=n.next)if(n.name==t)return 1;for(r=e.context;r;r=r.prev)for(n=r.vars;n;n=n.next)if(n.name==t)return 1}}(e,r)?"variable-2":t}}function s(){for(var e=arguments.length-1;0<=e;e--)a.cc.push(arguments[e])}function u(){return s.apply(null,arguments),!0}function H(e,t){for(var n=t;n;n=n.next)if(n.name==e)return 1}function I(e){var t,n=a.state;if(a.marked="def",S){if(n.context)if("var"==n.lexical.info&&n.context&&n.context.block){if(null!=(t=function r(e,t){{var n;return t?t.block?(n=r(e,t.prev))?n==t.prev?t:new R(n,t.vars,!0):null:H(e,t.vars)?t:new R(t.prev,new B(e,t.vars),!1):null}}(e,n.context)))return void(n.context=t)}else if(!H(e,n.localVars))return void(n.localVars=new B(e,n.localVars));p.globalVars&&!H(e,n.globalVars)&&(n.globalVars=new B(e,n.globalVars))}}function F(e){return"public"==e||"private"==e||"protected"==e||"abstract"==e||"readonly"==e}function R(e,t,n){this.prev=e,this.vars=t,this.block=n}function B(e,t){this.name=e,this.next=t}function j(){a.state.context=new R(a.state.context,a.state.localVars,!1),a.state.localVars=n}function V(){ +a.state.context=new R(a.state.context,a.state.localVars,!0),a.state.localVars=null}function K(){a.state.localVars=a.state.context.vars,a.state.context=a.state.context.prev}function o(r,i){var e=function(){var e,t=a.state,n=t.indented;if("stat"==t.lexical.type)n=t.lexical.indented;else for(e=t.lexical;e&&")"==e.type&&e.align;e=e.prev)n=e.indented;t.lexical=new P(n,a.stream.column(),r,null,t.lexical,i)};return e.lex=!0,e}function d(){var e=a.state;e.lexical.prev&&(")"==e.lexical.type&&(e.indented=e.lexical.indented),e.lexical=e.lexical.prev)}function h(t){return function n(e){return e==t?u():";"==t||"}"==e||")"==e||"]"==e?s():u(n)}}function G(e,t){return"var"==e?u(o("vardef",t),Le,h(";"),d):"keyword a"==e?u(o("form"),_,G,d):"keyword b"==e?u(o("form"),G,d):"keyword d"==e?a.stream.match(/^\s*$/,!1)?u():u(o("stat"),X,h(";"),d):"debugger"==e?u(h(";")):"{"==e?u(o("}"),V,de,d,K):";"==e?u():"if"==e?("else"==a.state.lexical.info&&a.state.cc[a.state.cc.length-1]==d&&a.state.cc.pop()(),u(o("form"),_,G,d,De)):"function"==e?u(He):"for"==e?u(o("form"),V,We,G,K,d):"class"==e||c&&"interface"==t?(a.marked="keyword",u(o("form","class"==e?e:t),je,d)):"variable"==e?c&&"declare"==t?(a.marked="keyword",u(G)):c&&("module"==t||"enum"==t||"type"==t)&&a.stream.match(/^\s*\w/,!1)?(a.marked="keyword","enum"==t?u(Je):"type"==t?u(Fe,h("operator"),f,h(";")):u(o("form"),Me,h("{"),o("}"),de,d,d)):c&&"namespace"==t?(a.marked="keyword",u(o("form"),l,G,d)):c&&"abstract"==t?(a.marked="keyword",u(G)):u(o("stat"),ie):"switch"==e?u(o("form"),_,h("{"),o("}","switch"),V,de,d,d,K):"case"==e?u(l,h(":")):"default"==e?u(h(":")):"catch"==e?u(o("form"),j,U,G,d,K):"export"==e?u(o("stat"),Ue,d):"import"==e?u(o("stat"),_e,d):"async"==e?u(G):"@"==t?u(l,G):s(o("stat"),l,h(";"),d)}function U(e){if("("==e)return u(Re,h(")"))}function l(e,t){return $(e,t,!1)}function q(e,t){return $(e,t,!0)}function _(e){return"("!=e?s():u(o(")"),X,h(")"),d)}function $(e,t,n){var r,i;if(a.state.fatArrowAt==a.stream.start){if(r=n?te:ee,"("==e)return u(j,o(")"),ce(Re,")"),d,h("=>"),r,K);if("variable"==e)return s(j,Me,h("=>"),r,K)}return r=n?Z:Y,g.hasOwnProperty(e)?u(r):"function"==e?u(He,r):"class"==e||c&&"interface"==t?(a.marked="keyword",u(o("form"),Be,d)):"keyword c"==e||"async"==e?u(n?q:l):"("==e?u(o(")"),X,h(")"),d,r):"operator"==e||"spread"==e?u(n?q:l):"["==e?u(o("]"),Qe,d,r):"{"==e?ue(le,"}",null,r):"quasi"==e?s(Q,r):"new"==e?u((i=n,function(e){return"."==e?u(i?re:ne):"variable"==e&&c?u(Ce,i?Z:Y):s(i?q:l)})):u()}function X(e){return e.match(/[;\}\)\],]/)?s():s(l)}function Y(e,t){return","==e?u(X):Z(e,t,!1)}function Z(e,t,n){var r=0==n?Y:Z,i=0==n?l:q;return"=>"==e?u(j,n?te:ee,K):"operator"==e?/\+\+|--/.test(t)||c&&"!"==t?u(r):c&&"<"==t&&a.stream.match(/^([^<>]|<[^<>]*>)*>\s*\(/,!1)?u(o(">"),ce(f,">"),d,r):"?"==t?u(l,h(":"),i):u(i):"quasi"==e?s(Q,r):";"!=e?"("==e?ue(q,")","call",r):"."==e?u(oe,r):"["==e?u(o("]"),X,h("]"),d,r):c&&"as"==t?(a.marked="keyword",u(f,r)):"regexp"==e?(a.state.lastType=a.marked="operator",a.stream.backUp(a.stream.pos-a.stream.start-1),u(i)):void 0:void 0}function Q(e,t){return"quasi"!=e?s():"${"!=t.slice(t.length-2)?u(Q):u(X,J)}function J(e){if("}"==e)return a.marked="string-2",a.state.tokenize=D,u(Q)}function ee(e){return W(a.stream,a.state),s("{"==e?G:l)}function te(e){return W(a.stream,a.state),s("{"==e?G:q)}function ne(e,t){if("target"==t)return a.marked="keyword",u(Y)}function re(e,t){if("target"==t)return a.marked="keyword",u(Z)}function ie(e){return":"==e?u(d,G):s(Y,h(";"),d)}function oe(e){if("variable"==e)return a.marked="property",u()}function le(e,t){return"async"==e?(a.marked="property",u(le)):"variable"!=e&&"keyword"!=a.style?"number"==e||"string"==e?(a.marked=k?"property":a.style+" property",u(se)):"jsonld-keyword"==e?u(se):c&&F(t)?(a.marked="keyword",u(le)):"["==e?u(l,he,h("]"),se):"spread"==e?u(q,se):"*"==t?(a.marked="keyword",u(le)):":"==e?s(se):void 0:(a.marked="property","get"==t||"set"==t?u(ae):(c&&a.state.fatArrowAt==a.stream.start&&(n=a.stream.match(/^\s*:\s*/,!1))&&(a.state.fatArrowAt=a.stream.pos+n[0].length),u(se)));var n}function ae(e){return"variable"!=e?s(se):(a.marked="property",u(He))}function se(e){return":"==e?u(q):"("==e?s(He):void 0}function ce(r,i,o){function l(e,t){var n;return(o?-1"),f):"quasi"==e?s(be,ke):void 0}function me(e){if("=>"==e)return u(f)}function ye(e){return e.match(/[\}\)\]]/)?u():","==e||";"==e?u(ye):s(ve,ye)}function ve(e,t){return"variable"==e||"keyword"==a.style?(a.marked="property",u(ve)):"?"==t||"number"==e||"string"==e?u(ve):":"==e?u(f):"["==e?u(h("variable"),fe,h("]"),ve):"("==e?s(Ie,ve):e.match(/[;\}\)\],]/)?void 0:u()}function be(e,t){return"quasi"!=e?s():"${"!=t.slice(t.length-2)?u(be):u(f,we)}function we(e){if("}"==e)return a.marked="string-2",a.state.tokenize=D,u(be)}function xe(e,t){return"variable"==e&&a.stream.match(/^\s*[?:]/,!1)||"?"==t?u(xe):":"==e?u(f):"spread"==e?u(xe):s(f)}function ke(e,t){return"<"==t?u(o(">"),ce(f,">"),d,ke):"|"==t||"."==e||"&"==t?u(f):"["==e?u(f,h("]"),ke):"extends"==t||"implements"==t?( +a.marked="keyword",u(f)):"?"==t?u(f,h(":"),f):void 0}function Ce(e,t){if("<"==t)return u(o(">"),ce(f,">"),d,ke)}function Se(){return s(f,Te)}function Te(e,t){if("="==t)return u(f)}function Le(e,t){return"enum"==t?(a.marked="keyword",u(Je)):s(Me,he,Oe,ze)}function Me(e,t){return c&&F(t)?(a.marked="keyword",u(Me)):"variable"==e?(I(t),u()):"spread"==e?u(Me):"["==e?ue(Ae,"]"):"{"==e?ue(Ne,"}"):void 0}function Ne(e,t){return"variable"!=e||a.stream.match(/^\s*:/,!1)?("variable"==e&&(a.marked="property"),"spread"==e?u(Me):"}"==e?s():"["==e?u(l,h("]"),h(":"),Ne):u(h(":"),Me,Oe)):(I(t),u(Oe))}function Ae(){return s(Me,Oe)}function Oe(e,t){if("="==t)return u(q)}function ze(e){if(","==e)return u(Le)}function De(e,t){if("keyword b"==e&&"else"==t)return u(o("form","else"),G,d)}function We(e,t){return"await"==t?u(We):"("==e?u(o(")"),Pe,d):void 0}function Pe(e){return"var"==e?u(Le,Ee):("variable"==e?u:s)(Ee)}function Ee(e,t){return")"==e?u():";"==e?u(Ee):"in"==t||"of"==t?(a.marked="keyword",u(l,Ee)):s(l,Ee)}function He(e,t){return"*"==t?(a.marked="keyword",u(He)):"variable"==e?(I(t),u(He)):"("==e?u(j,o(")"),ce(Re,")"),d,pe,G,K):c&&"<"==t?u(o(">"),ce(Se,">"),d,He):void 0}function Ie(e,t){return"*"==t?(a.marked="keyword",u(Ie)):"variable"==e?(I(t),u(Ie)):"("==e?u(j,o(")"),ce(Re,")"),d,pe,K):c&&"<"==t?u(o(">"),ce(Se,">"),d,Ie):void 0}function Fe(e,t){return"keyword"==e||"variable"==e?(a.marked="type",u(Fe)):"<"==t?u(o(">"),ce(Se,">"),d):void 0}function Re(e,t){return"@"==t&&u(l,Re),"spread"==e?u(Re):c&&F(t)?(a.marked="keyword",u(Re)):c&&"this"==e?u(he,Oe):s(Me,he,Oe)}function Be(e,t){return("variable"==e?je:Ve)(e,t)}function je(e,t){if("variable"==e)return I(t),u(Ve)}function Ve(e,t){return"<"==t?u(o(">"),ce(Se,">"),d,Ve):"extends"==t||"implements"==t||c&&","==e?("implements"==t&&(a.marked="keyword"),u(c?f:l,Ve)):"{"==e?u(o("}"),Ke,d):void 0}function Ke(e,t){return"async"==e||"variable"==e&&("static"==t||"get"==t||"set"==t||c&&F(t))&&a.stream.match(/^\s+#?[\w$\xa1-\uffff]/,!1)?(a.marked="keyword",u(Ke)):"variable"==e||"keyword"==a.style?(a.marked="property",u(Ge,Ke)):"number"==e||"string"==e?u(Ge,Ke):"["==e?u(l,he,h("]"),Ge,Ke):"*"==t?(a.marked="keyword",u(Ke)):c&&"("==e?s(Ie,Ke):";"==e||","==e?u(Ke):"}"==e?u():"@"==t?u(l,Ke):void 0}function Ge(e,t){if("!"==t)return u(Ge);if("?"==t)return u(Ge);if(":"==e)return u(f,Oe);if("="==t)return u(q);e=a.state.lexical.prev;return s(e&&"interface"==e.info?Ie:He)}function Ue(e,t){return"*"==t?(a.marked="keyword",u(Ze,h(";"))):"default"==t?(a.marked="keyword",u(l,h(";"))):"{"==e?u(ce(qe,"}"),Ze,h(";")):s(G)}function qe(e,t){return"as"==t?(a.marked="keyword",u(h("variable"))):"variable"==e?s(q,qe):void 0}function _e(e){return"string"==e?u():"("==e?s(l):"."==e?s(Y):s($e,Xe,Ze)}function $e(e,t){return"{"==e?ue($e,"}"):("variable"==e&&I(t),"*"==t&&(a.marked="keyword"),u(Ye))}function Xe(e){if(","==e)return u($e,Xe)}function Ye(e,t){if("as"==t)return a.marked="keyword",u($e)}function Ze(e,t){if("from"==t)return a.marked="keyword",u(l)}function Qe(e){return"]"==e?u():s(ce(q,"]"))}function Je(){return s(o("form"),Me,h("{"),o("}"),ce(et,"}"),d,d)}function et(){return s(Me,Oe)}function tt(e,t,n){return t.tokenize==O&&/^(?:operator|sof|keyword [bcd]|case|new|export|default|spread|[\[{}\(,;:]|=>)$/.test(t.lastType)||"quasi"==t.lastType&&/\{\s*$/.test(e.string.slice(0,e.pos-(n||0)))}return g={atom:!0,number:!0,variable:!0,string:!0,regexp:!0,"this":!0,"import":!0,"jsonld-keyword":!0},a={state:null,column:null,marked:null,cc:null},n=new B("this",new B("arguments",null)),j.lex=V.lex=!0,d.lex=K.lex=!0,{startState:function(e){e={tokenize:O,lastType:"sof",cc:[],lexical:new P((e||0)-w,0,"block",!1),localVars:p.localVars,context:p.localVars&&new R(null,null,!1),indented:e||0};return p.globalVars&&"object"==typeof p.globalVars&&(e.globalVars=p.globalVars),e},token:function(e,t){if(e.sol()&&(t.lexical.hasOwnProperty("align")||(t.lexical.align=!1),t.indented=e.indentation(),W(e,t)),t.tokenize!=z&&e.eatSpace())return null;var n=t.tokenize(e,t);return"comment"==r?n:(t.lastType="operator"!=r||"++"!=i&&"--"!=i?r:"incdec",E(t,n,r,i,e))},indent:function(e,t){var n,r,i,o,l,a,s,c;if(e.tokenize==z||e.tokenize==D)return nt.Pass;if(e.tokenize!=O)return 0;if(n=t&&t.charAt(0),r=e.lexical,!/^\s*else\b/.test(t))for(o=e.cc.length-1;0<=o;--o)if((l=e.cc[o])==d)r=r.prev;else if(l!=De&&l!=K)break;for(;("stat"==r.type||"form"==r.type)&&("}"==n||(i=e.cc[e.cc.length-1])&&(i==Y||i==Z)&&!/^[,\.=+\-*:?[\(]/.test(t));)r=r.prev;return a=n==(c=(r=x&&")"==r.type&&"stat"==r.prev.type?r.prev:r).type),"vardef"==c?r.indented+("operator"==e.lastType||","==e.lastType?r.info.length+1:0):"form"==c&&"{"==n?r.indented:"form"==c?r.indented+w:"stat"==c?r.indented+(c=t,"operator"==(s=e).lastType||","==s.lastType||M.test(c.charAt(0))||/[,.]/.test(c.charAt(0))?x||w:0):"switch"!=r.info||a||0==p.doubleIndentSwitch?r.align?r.column+(a?0:1):r.indented+(a?0:w):r.indented+(/^(?:case|default)\b/.test(t)?w:2*w)},electricInput:/^\s*(?:case .*?:|default:|\{|\})$/,blockCommentStart:C?null:"/*",blockCommentEnd:C?null:"*/",blockCommentContinue:C?null:" * ",lineComment:C?null:"//",fold:"brace",closeBrackets:"()[]{}''\"\"``",helperType:C?"json":"javascript",jsonldMode:k,jsonMode:C,expressionAllowed:tt,skipExpression:function(e){E(e,"atom","atom","true",new nt.StringStream("",2,null))}}}),nt.registerHelper("wordChars","javascript",/[\w$]/),nt.defineMIME("text/javascript","javascript"),nt.defineMIME("text/ecmascript","javascript"),nt.defineMIME("application/javascript","javascript"),nt.defineMIME("application/x-javascript","javascript"),nt.defineMIME("application/ecmascript","javascript"),nt.defineMIME("application/json",{name:"javascript",json:!0}),nt.defineMIME("application/x-json",{name:"javascript",json:!0}),nt.defineMIME("application/manifest+json",{name:"javascript",json:!0}),nt.defineMIME("application/ld+json",{name:"javascript",jsonld:!0}),nt.defineMIME("text/typescript",{name:"javascript",typescript:!0}),nt.defineMIME( +"application/typescript",{name:"javascript",typescript:!0})},"object"==typeof exports&&"object"==typeof module?r(require("../../lib/codemirror")):r(n),r=function(z){"use strict";var c,u,e,d,t,h,n,f,r,p,i,o,g,m,l,y,a,v;function s(e){for(var t={},n=0;n*\/]/.test(r)?(l="select-op",null):"."==r&&e.match(/^-?[_a-z][_a-z0-9-]*/i)?l="qualifier":/[:;{}\[\]\(\)]/.test(r)?L(null,r):e.match(/^[\w-.]+(?=\()/)?(/^(url(-prefix)?|domain|regexp)$/i.test(e.current())&&(t.tokenize=N),l="variable","variable callee"):/[\w\\\-]/.test(r)?(e.eatWhile(/[\w\\\-]/),l="word","property"):l=null})(e,t);return n&&"object"==typeof n&&(l=n[1],n=n[0]),a=n,"comment"!=l&&(t.state=s[t.state](l,e,t)),a},indent:function(e,t){var e=e.context,t=t&&t.charAt(0),n=e.indent;return(e="prop"!=e.type||"}"!=t&&")"!=t?e:e.prev).prev&&("}"!=t||"block"!=e.type&&"top"!=e.type&&"interpolation"!=e.type&&"restricted_atBlock"!=e.type?(")"!=t||"parens"!=e.type&&"atBlock_parens"!=e.type)&&("{"!=t||"at"!=e.type&&"atBlock"!=e.type)||(n=Math.max(0,e.indent-i)):n=(e=e.prev).indent),n},electricChars:"}",blockCommentStart:"/*",blockCommentEnd:"*/",blockCommentContinue:" * ",lineComment:n,fold:"brace"}}),u=s(c=["domain","regexp","url","url-prefix"]),e=s(v=["all","aural","braille","handheld","print","projection","screen","tty","tv","embossed"]),t=s(d=["width","min-width","max-width","height","min-height","max-height","device-width","min-device-width","max-device-width","device-height","min-device-height","max-device-height","aspect-ratio","min-aspect-ratio","max-aspect-ratio","device-aspect-ratio","min-device-aspect-ratio","max-device-aspect-ratio","color","min-color","max-color","color-index","min-color-index","max-color-index","monochrome","min-monochrome","max-monochrome","resolution","min-resolution","max-resolution","scan","grid","orientation","device-pixel-ratio","min-device-pixel-ratio","max-device-pixel-ratio","pointer","any-pointer","hover","any-hover","prefers-color-scheme","dynamic-range","video-dynamic-range"]),n=s(h=["landscape","portrait","none","coarse","fine","on-demand","hover","interlace","progressive","dark","light","standard","high"]),r=s(f=["align-content","align-items","align-self","alignment-adjust","alignment-baseline","all","anchor-point","animation","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-timing-function","appearance","azimuth","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","binding","bleed","block-size","bookmark-label","bookmark-level","bookmark-state","bookmark-target","border","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-decoration-break","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","color","color-profile","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","content","counter-increment","counter-reset","crop","cue","cue-after","cue-before","cursor","direction","display","dominant-baseline","drop-initial-after-adjust","drop-initial-after-align","drop-initial-before-adjust","drop-initial-before-align","drop-initial-size","drop-initial-value","elevation","empty-cells","fit","fit-content","fit-position","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","float-offset","flow-from","flow-into","font","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-size","font-size-adjust","font-stretch","font-style","font-synthesis","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","gap","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-gap","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-gap","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphens","icon","image-orientation","image-rendering","image-resolution","inline-box-align","inset","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","left","letter-spacing","line-break","line-height","line-height-step","line-stacking","line-stacking-ruby","line-stacking-shift","line-stacking-strategy","list-style","list-style-image","list-style-position","list-style-type","margin","margin-bottom","margin-left","margin-right","margin-top","marks","marquee-direction","marquee-loop","marquee-play-count","marquee-speed","marquee-style","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","move-to","nav-down","nav-index","nav-left","nav-right","nav-up","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans", +"outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-style","overflow-wrap","overflow-x","overflow-y","padding","padding-bottom","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","page-policy","pause","pause-after","pause-before","perspective","perspective-origin","pitch","pitch-range","place-content","place-items","place-self","play-during","position","presentation-level","punctuation-trim","quotes","region-break-after","region-break-before","region-break-inside","region-fragment","rendering-intent","resize","rest","rest-after","rest-before","richness","right","rotate","rotation","rotation-point","row-gap","ruby-align","ruby-overhang","ruby-position","ruby-span","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-type","shape-image-threshold","shape-inside","shape-margin","shape-outside","size","speak","speak-as","speak-header","speak-numeral","speak-punctuation","speech-rate","stress","string-set","tab-size","table-layout","target","target-name","target-new","target-position","text-align","text-align-last","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-height","text-indent","text-justify","text-orientation","text-outline","text-overflow","text-rendering","text-shadow","text-size-adjust","text-space-collapse","text-transform","text-underline-position","text-wrap","top","touch-action","transform","transform-origin","transform-style","transition","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-select","vertical-align","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","volume","white-space","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","z-index","clip-path","clip-rule","mask","enable-background","filter","flood-color","flood-opacity","lighting-color","stop-color","stop-opacity","pointer-events","color-interpolation","color-interpolation-filters","color-rendering","fill","fill-opacity","fill-rule","image-rendering","marker","marker-end","marker-mid","marker-start","paint-order","shape-rendering","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","text-rendering","baseline-shift","dominant-baseline","glyph-orientation-horizontal","glyph-orientation-vertical","text-anchor","writing-mode"]),i=s(p=["accent-color","aspect-ratio","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","content-visibility","margin-block","margin-block-end","margin-block-start","margin-inline","margin-inline-end","margin-inline-start","overflow-anchor","overscroll-behavior","padding-block","padding-block-end","padding-block-start","padding-inline","padding-inline-end","padding-inline-start","scroll-snap-stop","scrollbar-3d-light-color","scrollbar-arrow-color","scrollbar-base-color","scrollbar-dark-shadow-color","scrollbar-face-color","scrollbar-highlight-color","scrollbar-shadow-color","scrollbar-track-color","searchfield-cancel-button","searchfield-decoration","searchfield-results-button","searchfield-results-decoration","shape-inside","zoom"]),o=s(["font-display","font-family","src","unicode-range","font-variant","font-feature-settings","font-stretch","font-weight","font-style"]),g=s(["additive-symbols","fallback","negative","pad","prefix","range","speak-as","suffix","symbols","system"]),l=s(m=["aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blue","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgreen","darkgrey","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkslategrey","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dimgrey","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","grey","green","greenyellow","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgreen","lightgrey","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightslategrey","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose", +"moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","rebeccapurple","red","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","slategrey","snow","springgreen","steelblue","tan","teal","thistle","tomato","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen"]),a=s(y=["above","absolute","activeborder","additive","activecaption","afar","after-white-space","ahead","alias","all","all-scroll","alphabetic","alternate","always","amharic","amharic-abegede","antialiased","appworkspace","arabic-indic","armenian","asterisks","attr","auto","auto-flow","avoid","avoid-column","avoid-page","avoid-region","axis-pan","background","backwards","baseline","below","bidi-override","binary","bengali","blink","block","block-axis","blur","bold","bolder","border","border-box","both","bottom","break","break-all","break-word","brightness","bullets","button","buttonface","buttonhighlight","buttonshadow","buttontext","calc","cambodian","capitalize","caps-lock-indicator","caption","captiontext","caret","cell","center","checkbox","circle","cjk-decimal","cjk-earthly-branch","cjk-heavenly-stem","cjk-ideographic","clear","clip","close-quote","col-resize","collapse","color","color-burn","color-dodge","column","column-reverse","compact","condensed","conic-gradient","contain","content","contents","content-box","context-menu","continuous","contrast","copy","counter","counters","cover","crop","cross","crosshair","cubic-bezier","currentcolor","cursive","cyclic","darken","dashed","decimal","decimal-leading-zero","default","default-button","dense","destination-atop","destination-in","destination-out","destination-over","devanagari","difference","disc","discard","disclosure-closed","disclosure-open","document","dot-dash","dot-dot-dash","dotted","double","down","drop-shadow","e-resize","ease","ease-in","ease-in-out","ease-out","element","ellipse","ellipsis","embed","end","ethiopic","ethiopic-abegede","ethiopic-abegede-am-et","ethiopic-abegede-gez","ethiopic-abegede-ti-er","ethiopic-abegede-ti-et","ethiopic-halehame-aa-er","ethiopic-halehame-aa-et","ethiopic-halehame-am-et","ethiopic-halehame-gez","ethiopic-halehame-om-et","ethiopic-halehame-sid-et","ethiopic-halehame-so-et","ethiopic-halehame-ti-er","ethiopic-halehame-ti-et","ethiopic-halehame-tig","ethiopic-numeric","ew-resize","exclusion","expanded","extends","extra-condensed","extra-expanded","fantasy","fast","fill","fill-box","fixed","flat","flex","flex-end","flex-start","footnotes","forwards","from","geometricPrecision","georgian","grayscale","graytext","grid","groove","gujarati","gurmukhi","hand","hangul","hangul-consonant","hard-light","hebrew","help","hidden","hide","higher","highlight","highlighttext","hiragana","hiragana-iroha","horizontal","hsl","hsla","hue","hue-rotate","icon","ignore","inactiveborder","inactivecaption","inactivecaptiontext","infinite","infobackground","infotext","inherit","initial","inline","inline-axis","inline-block","inline-flex","inline-grid","inline-table","inset","inside","intrinsic","invert","italic","japanese-formal","japanese-informal","justify","kannada","katakana","katakana-iroha","keep-all","khmer","korean-hangul-formal","korean-hanja-formal","korean-hanja-informal","landscape","lao","large","larger","left","level","lighter","lighten","line-through","linear","linear-gradient","lines","list-item","listbox","listitem","local","logical","loud","lower","lower-alpha","lower-armenian","lower-greek","lower-hexadecimal","lower-latin","lower-norwegian","lower-roman","lowercase","ltr","luminosity","malayalam","manipulation","match","matrix","matrix3d","media-play-button","media-slider","media-sliderthumb","media-volume-slider","media-volume-sliderthumb","medium","menu","menulist","menulist-button","menutext","message-box","middle","min-intrinsic","mix","mongolian","monospace","move","multiple","multiple_mask_images","multiply","myanmar","n-resize","narrower","ne-resize","nesw-resize","no-close-quote","no-drop","no-open-quote","no-repeat","none","normal","not-allowed","nowrap","ns-resize","numbers","numeric","nw-resize","nwse-resize","oblique","octal","opacity","open-quote","optimizeLegibility","optimizeSpeed","oriya","oromo","outset","outside","outside-shape","overlay","overline","padding","padding-box","painted","page","paused","persian","perspective","pinch-zoom","plus-darker","plus-lighter","pointer","polygon","portrait","pre","pre-line","pre-wrap","preserve-3d","progress","push-button","radial-gradient","radio","read-only","read-write","read-write-plaintext-only","rectangle","region","relative","repeat","repeating-linear-gradient","repeating-radial-gradient","repeating-conic-gradient","repeat-x","repeat-y","reset","reverse","rgb","rgba","ridge","right","rotate","rotate3d","rotateX","rotateY","rotateZ","round","row","row-resize","row-reverse","rtl","run-in","running","s-resize","sans-serif","saturate","saturation","scale","scale3d","scaleX","scaleY","scaleZ","screen","scroll","scrollbar","scroll-position","se-resize","searchfield","searchfield-cancel-button","searchfield-decoration","searchfield-results-button","searchfield-results-decoration","self-start","self-end","semi-condensed","semi-expanded","separate","sepia","serif","show","sidama","simp-chinese-formal","simp-chinese-informal","single","skew","skewX","skewY","skip-white-space","slide","slider-horizontal","slider-vertical","sliderthumb-horizontal","sliderthumb-vertical","slow","small","small-caps","small-caption","smaller","soft-light","solid","somali","source-atop","source-in","source-out","source-over","space","space-around","space-between","space-evenly","spell-out","square","square-button","start","static","status-bar","stretch","stroke","stroke-box","sub","subpixel-antialiased","svg_masks","super","sw-resize","symbolic", +"symbols","system-ui","table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row","table-row-group","tamil","telugu","text","text-bottom","text-top","textarea","textfield","thai","thick","thin","threeddarkshadow","threedface","threedhighlight","threedlightshadow","threedshadow","tibetan","tigre","tigrinya-er","tigrinya-er-abegede","tigrinya-et","tigrinya-et-abegede","to","top","trad-chinese-formal","trad-chinese-informal","transform","translate","translate3d","translateX","translateY","translateZ","transparent","ultra-condensed","ultra-expanded","underline","unidirectional-pan","unset","up","upper-alpha","upper-armenian","upper-greek","upper-hexadecimal","upper-latin","upper-norwegian","upper-roman","uppercase","urdu","url","var","vertical","vertical-text","view-box","visible","visibleFill","visiblePainted","visibleStroke","visual","w-resize","wait","wave","wider","window","windowframe","windowtext","words","wrap","wrap-reverse","x-large","x-small","xor","xx-large","xx-small"]),v=c.concat(v).concat(d).concat(h).concat(f).concat(p).concat(m).concat(y),z.registerHelper("hintWords","css",v),z.defineMIME("text/css",{documentTypes:u,mediaTypes:e,mediaFeatures:t,mediaValueKeywords:n,propertyKeywords:r,nonStandardPropertyKeywords:i,fontProperties:o,counterDescriptors:g,colorKeywords:l,valueKeywords:a,tokenHooks:{"/":function(e,t){return!!e.eat("*")&&(t.tokenize=b)(e,t)}},name:"css"}),z.defineMIME("text/x-scss",{mediaTypes:e,mediaFeatures:t,mediaValueKeywords:n,propertyKeywords:r,nonStandardPropertyKeywords:i,colorKeywords:l,valueKeywords:a,fontProperties:o,allowNested:!0,lineComment:"//",tokenHooks:{"/":function(e,t){return e.eat("/")?(e.skipToEnd(),["comment","comment"]):e.eat("*")?(t.tokenize=b)(e,t):["operator","operator"]},":":function(e){return!!e.match(/^\s*\{/,!1)&&[null,null]},$:function(e){return e.match(/^[\w-]+/),e.match(/^\s*:/,!1)?["variable-2","variable-definition"]:["variable-2","variable"]},"#":function(e){return!!e.eat("{")&&[null,"interpolation"]}},name:"css",helperType:"scss"}),z.defineMIME("text/x-less",{mediaTypes:e,mediaFeatures:t,mediaValueKeywords:n,propertyKeywords:r,nonStandardPropertyKeywords:i,colorKeywords:l,valueKeywords:a,fontProperties:o,allowNested:!0,lineComment:"//",tokenHooks:{"/":function(e,t){return e.eat("/")?(e.skipToEnd(),["comment","comment"]):e.eat("*")?(t.tokenize=b)(e,t):["operator","operator"]},"@":function(e){return e.eat("{")?[null,"interpolation"]:!e.match(/^(charset|document|font-face|import|(-(moz|ms|o|webkit)-)?keyframes|media|namespace|page|supports)\b/i,!1)&&(e.eatWhile(/[\w\\\-]/),e.match(/^\s*:/,!1)?["variable-2","variable-definition"]:["variable-2","variable"])},"&":function(){return["atom","atom"]}},name:"css",helperType:"less"}),z.defineMIME("text/x-gss",{documentTypes:u,mediaTypes:e,mediaFeatures:t,propertyKeywords:r,nonStandardPropertyKeywords:i,fontProperties:o,counterDescriptors:g,colorKeywords:l,valueKeywords:a,supportsAtComponent:!0,tokenHooks:{"/":function(e,t){return!!e.eat("*")&&(t.tokenize=b)(e,t)}},name:"css",helperType:"gss"})},"object"==typeof exports&&"object"==typeof module?r(require("../../lib/codemirror")):r(n),e.namespace("M.atto_html").CodeMirror=n,window.CodeMirror=i},"@VERSION@",{requires:["moodle-atto_html-codemirror-skin"]}); \ No newline at end of file diff --git a/lib/editor/atto/plugins/html/yui/build/moodle-atto_html-codemirror/moodle-atto_html-codemirror.js b/lib/editor/atto/plugins/html/yui/build/moodle-atto_html-codemirror/moodle-atto_html-codemirror.js index 91732ef20b3..8c278937dbe 100644 --- a/lib/editor/atto/plugins/html/yui/build/moodle-atto_html-codemirror/moodle-atto_html-codemirror.js +++ b/lib/editor/atto/plugins/html/yui/build/moodle-atto_html-codemirror/moodle-atto_html-codemirror.js @@ -116,13 +116,14 @@ var define = null; // Remove require.js support in this context. } while (child = child.parentNode) } - function activeElt(doc) { + function activeElt(rootNode) { // IE and Edge may throw an "Unspecified Error" when accessing document.activeElement. // IE < 10 will throw when accessed while the page is loading or in an iframe. // IE > 9 and Edge will throw when accessed in an iframe if document.body is unavailable. + var doc = rootNode.ownerDocument || rootNode; var activeElement; try { - activeElement = doc.activeElement; + activeElement = rootNode.activeElement; } catch(e) { activeElement = doc.body || null; } @@ -150,6 +151,15 @@ var define = null; // Remove require.js support in this context. function doc(cm) { return cm.display.wrapper.ownerDocument } + function root(cm) { + return rootNode(cm.display.wrapper) + } + + function rootNode(element) { + // Detect modern browsers (2017+). + return element.getRootNode ? element.getRootNode() : element.ownerDocument + } + function win(cm) { return doc(cm).defaultView } function bind(f) { @@ -3904,7 +3914,7 @@ var define = null; // Remove require.js support in this context. cm.display.maxLineChanged = false; } - var takeFocus = op.focus && op.focus == activeElt(doc(cm)); + var takeFocus = op.focus && op.focus == activeElt(root(cm)); if (op.preparedSelection) { cm.display.input.showSelection(op.preparedSelection, takeFocus); } if (op.updatedDisplay || op.startHeight != cm.doc.height) @@ -4081,7 +4091,7 @@ var define = null; // Remove require.js support in this context. function selectionSnapshot(cm) { if (cm.hasFocus()) { return null } - var active = activeElt(doc(cm)); + var active = activeElt(root(cm)); if (!active || !contains(cm.display.lineDiv, active)) { return null } var result = {activeElt: active}; if (window.getSelection) { @@ -4097,7 +4107,7 @@ var define = null; // Remove require.js support in this context. } function restoreSelection(snapshot) { - if (!snapshot || !snapshot.activeElt || snapshot.activeElt == activeElt(snapshot.activeElt.ownerDocument)) { return } + if (!snapshot || !snapshot.activeElt || snapshot.activeElt == activeElt(rootNode(snapshot.activeElt))) { return } snapshot.activeElt.focus(); if (!/^(INPUT|TEXTAREA)$/.test(snapshot.activeElt.nodeName) && snapshot.anchorNode && contains(document.body, snapshot.anchorNode) && contains(document.body, snapshot.focusNode)) { @@ -7268,7 +7278,7 @@ var define = null; // Remove require.js support in this context. function onKeyDown(e) { var cm = this; if (e.target && e.target != cm.display.input.getField()) { return } - cm.curOp.focus = activeElt(doc(cm)); + cm.curOp.focus = activeElt(root(cm)); if (signalDOMEvent(cm, e)) { return } // IE does strange things with escape. if (ie && ie_version < 11 && e.keyCode == 27) { e.returnValue = false; } @@ -7430,7 +7440,7 @@ var define = null; // Remove require.js support in this context. function leftButtonDown(cm, pos, repeat, event) { if (ie) { setTimeout(bind(ensureFocus, cm), 0); } - else { cm.curOp.focus = activeElt(doc(cm)); } + else { cm.curOp.focus = activeElt(root(cm)); } var behavior = configureMouse(cm, repeat, event); @@ -7500,19 +7510,19 @@ var define = null; // Remove require.js support in this context. // Normal selection, as opposed to text dragging. function leftButtonSelect(cm, event, start, behavior) { if (ie) { delayBlurEvent(cm); } - var display = cm.display, doc$1 = cm.doc; + var display = cm.display, doc = cm.doc; e_preventDefault(event); - var ourRange, ourIndex, startSel = doc$1.sel, ranges = startSel.ranges; + var ourRange, ourIndex, startSel = doc.sel, ranges = startSel.ranges; if (behavior.addNew && !behavior.extend) { - ourIndex = doc$1.sel.contains(start); + ourIndex = doc.sel.contains(start); if (ourIndex > -1) { ourRange = ranges[ourIndex]; } else { ourRange = new Range(start, start); } } else { - ourRange = doc$1.sel.primary(); - ourIndex = doc$1.sel.primIndex; + ourRange = doc.sel.primary(); + ourIndex = doc.sel.primIndex; } if (behavior.unit == "rectangle") { @@ -7529,18 +7539,18 @@ var define = null; // Remove require.js support in this context. if (!behavior.addNew) { ourIndex = 0; - setSelection(doc$1, new Selection([ourRange], 0), sel_mouse); - startSel = doc$1.sel; + setSelection(doc, new Selection([ourRange], 0), sel_mouse); + startSel = doc.sel; } else if (ourIndex == -1) { ourIndex = ranges.length; - setSelection(doc$1, normalizeSelection(cm, ranges.concat([ourRange]), ourIndex), + setSelection(doc, normalizeSelection(cm, ranges.concat([ourRange]), ourIndex), {scroll: false, origin: "*mouse"}); } else if (ranges.length > 1 && ranges[ourIndex].empty() && behavior.unit == "char" && !behavior.extend) { - setSelection(doc$1, normalizeSelection(cm, ranges.slice(0, ourIndex).concat(ranges.slice(ourIndex + 1)), 0), + setSelection(doc, normalizeSelection(cm, ranges.slice(0, ourIndex).concat(ranges.slice(ourIndex + 1)), 0), {scroll: false, origin: "*mouse"}); - startSel = doc$1.sel; + startSel = doc.sel; } else { - replaceOneSelection(doc$1, ourIndex, ourRange, sel_mouse); + replaceOneSelection(doc, ourIndex, ourRange, sel_mouse); } var lastPos = start; @@ -7550,19 +7560,19 @@ var define = null; // Remove require.js support in this context. if (behavior.unit == "rectangle") { var ranges = [], tabSize = cm.options.tabSize; - var startCol = countColumn(getLine(doc$1, start.line).text, start.ch, tabSize); - var posCol = countColumn(getLine(doc$1, pos.line).text, pos.ch, tabSize); + var startCol = countColumn(getLine(doc, start.line).text, start.ch, tabSize); + var posCol = countColumn(getLine(doc, pos.line).text, pos.ch, tabSize); var left = Math.min(startCol, posCol), right = Math.max(startCol, posCol); for (var line = Math.min(start.line, pos.line), end = Math.min(cm.lastLine(), Math.max(start.line, pos.line)); line <= end; line++) { - var text = getLine(doc$1, line).text, leftPos = findColumn(text, left, tabSize); + var text = getLine(doc, line).text, leftPos = findColumn(text, left, tabSize); if (left == right) { ranges.push(new Range(Pos(line, leftPos), Pos(line, leftPos))); } else if (text.length > leftPos) { ranges.push(new Range(Pos(line, leftPos), Pos(line, findColumn(text, right, tabSize)))); } } if (!ranges.length) { ranges.push(new Range(start, start)); } - setSelection(doc$1, normalizeSelection(cm, startSel.ranges.slice(0, ourIndex).concat(ranges), ourIndex), + setSelection(doc, normalizeSelection(cm, startSel.ranges.slice(0, ourIndex).concat(ranges), ourIndex), {origin: "*mouse", scroll: false}); cm.scrollIntoView(pos); } else { @@ -7577,8 +7587,8 @@ var define = null; // Remove require.js support in this context. anchor = maxPos(oldRange.to(), range.head); } var ranges$1 = startSel.ranges.slice(0); - ranges$1[ourIndex] = bidiSimplify(cm, new Range(clipPos(doc$1, anchor), head)); - setSelection(doc$1, normalizeSelection(cm, ranges$1, ourIndex), sel_mouse); + ranges$1[ourIndex] = bidiSimplify(cm, new Range(clipPos(doc, anchor), head)); + setSelection(doc, normalizeSelection(cm, ranges$1, ourIndex), sel_mouse); } } @@ -7594,9 +7604,9 @@ var define = null; // Remove require.js support in this context. var cur = posFromMouse(cm, e, true, behavior.unit == "rectangle"); if (!cur) { return } if (cmp(cur, lastPos) != 0) { - cm.curOp.focus = activeElt(doc(cm)); + cm.curOp.focus = activeElt(root(cm)); extendTo(cur); - var visible = visibleLines(display, doc$1); + var visible = visibleLines(display, doc); if (cur.line >= visible.to || cur.line < visible.from) { setTimeout(operation(cm, function () {if (counter == curCount) { extend(e); }}), 150); } } else { @@ -7621,7 +7631,7 @@ var define = null; // Remove require.js support in this context. } off(display.wrapper.ownerDocument, "mousemove", move); off(display.wrapper.ownerDocument, "mouseup", up); - doc$1.history.lastSelOrigin = null; + doc.history.lastSelOrigin = null; } var move = operation(cm, function (e) { @@ -8621,7 +8631,7 @@ var define = null; // Remove require.js support in this context. signal(this, "overwriteToggle", this, this.state.overwrite); }, - hasFocus: function() { return this.display.input.getField() == activeElt(doc(this)) }, + hasFocus: function() { return this.display.input.getField() == activeElt(root(this)) }, isReadOnly: function() { return !!(this.options.readOnly || this.doc.cantEdit) }, scrollTo: methodOp(function (x, y) { scrollToCoords(this, x, y); }), @@ -8903,7 +8913,7 @@ var define = null; // Remove require.js support in this context. disableBrowserMagic(te); cm.display.lineSpace.insertBefore(kludge, cm.display.lineSpace.firstChild); te.value = lastCopied.text.join("\n"); - var hadFocus = activeElt(div.ownerDocument); + var hadFocus = activeElt(rootNode(div)); selectInput(te); setTimeout(function () { cm.display.lineSpace.removeChild(kludge); @@ -8926,7 +8936,7 @@ var define = null; // Remove require.js support in this context. ContentEditableInput.prototype.prepareSelection = function () { var result = prepareSelection(this.cm, false); - result.focus = activeElt(this.div.ownerDocument) == this.div; + result.focus = activeElt(rootNode(this.div)) == this.div; return result }; @@ -9022,7 +9032,7 @@ var define = null; // Remove require.js support in this context. ContentEditableInput.prototype.focus = function () { if (this.cm.options.readOnly != "nocursor") { - if (!this.selectionInEditor() || activeElt(this.div.ownerDocument) != this.div) + if (!this.selectionInEditor() || activeElt(rootNode(this.div)) != this.div) { this.showSelection(this.prepareSelection(), true); } this.div.focus(); } @@ -9530,7 +9540,7 @@ var define = null; // Remove require.js support in this context. TextareaInput.prototype.supportsTouch = function () { return false }; TextareaInput.prototype.focus = function () { - if (this.cm.options.readOnly != "nocursor" && (!mobile || activeElt(this.textarea.ownerDocument) != this.textarea)) { + if (this.cm.options.readOnly != "nocursor" && (!mobile || activeElt(rootNode(this.textarea)) != this.textarea)) { try { this.textarea.focus(); } catch (e) {} // IE8 will throw if the textarea is display: none or not in DOM } @@ -9737,7 +9747,7 @@ var define = null; // Remove require.js support in this context. // Set autofocus to true if this textarea is focused, or if it has // autofocus and no other element is focused. if (options.autofocus == null) { - var hasFocus = activeElt(textarea.ownerDocument); + var hasFocus = activeElt(rootNode(textarea)); options.autofocus = hasFocus == textarea || textarea.getAttribute("autofocus") != null && hasFocus == document.body; } @@ -9871,7 +9881,7 @@ var define = null; // Remove require.js support in this context. addLegacyProps(CodeMirror); - CodeMirror.version = "5.65.15"; + CodeMirror.version = "5.65.16"; return CodeMirror; diff --git a/lib/editor/atto/plugins/html/yui/src/codemirror/LICENSE b/lib/editor/atto/plugins/html/yui/src/codemirror/LICENSE index d21bbea5a63..c98e2c6da38 100644 --- a/lib/editor/atto/plugins/html/yui/src/codemirror/LICENSE +++ b/lib/editor/atto/plugins/html/yui/src/codemirror/LICENSE @@ -1,4 +1,6 @@ -Copyright (C) 2014 by Marijn Haverbeke and others +MIT License + +Copyright (C) 2017 by Marijn Haverbeke and others Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal @@ -16,4 +18,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. +THE SOFTWARE. \ No newline at end of file diff --git a/lib/editor/atto/plugins/html/yui/src/codemirror/js/codemirror.js b/lib/editor/atto/plugins/html/yui/src/codemirror/js/codemirror.js index 156fc307dd9..7687cd05380 100644 --- a/lib/editor/atto/plugins/html/yui/src/codemirror/js/codemirror.js +++ b/lib/editor/atto/plugins/html/yui/src/codemirror/js/codemirror.js @@ -112,13 +112,14 @@ } while (child = child.parentNode) } - function activeElt(doc) { + function activeElt(rootNode) { // IE and Edge may throw an "Unspecified Error" when accessing document.activeElement. // IE < 10 will throw when accessed while the page is loading or in an iframe. // IE > 9 and Edge will throw when accessed in an iframe if document.body is unavailable. + var doc = rootNode.ownerDocument || rootNode; var activeElement; try { - activeElement = doc.activeElement; + activeElement = rootNode.activeElement; } catch(e) { activeElement = doc.body || null; } @@ -146,6 +147,15 @@ function doc(cm) { return cm.display.wrapper.ownerDocument } + function root(cm) { + return rootNode(cm.display.wrapper) + } + + function rootNode(element) { + // Detect modern browsers (2017+). + return element.getRootNode ? element.getRootNode() : element.ownerDocument + } + function win(cm) { return doc(cm).defaultView } function bind(f) { @@ -3900,7 +3910,7 @@ cm.display.maxLineChanged = false; } - var takeFocus = op.focus && op.focus == activeElt(doc(cm)); + var takeFocus = op.focus && op.focus == activeElt(root(cm)); if (op.preparedSelection) { cm.display.input.showSelection(op.preparedSelection, takeFocus); } if (op.updatedDisplay || op.startHeight != cm.doc.height) @@ -4077,7 +4087,7 @@ function selectionSnapshot(cm) { if (cm.hasFocus()) { return null } - var active = activeElt(doc(cm)); + var active = activeElt(root(cm)); if (!active || !contains(cm.display.lineDiv, active)) { return null } var result = {activeElt: active}; if (window.getSelection) { @@ -4093,7 +4103,7 @@ } function restoreSelection(snapshot) { - if (!snapshot || !snapshot.activeElt || snapshot.activeElt == activeElt(snapshot.activeElt.ownerDocument)) { return } + if (!snapshot || !snapshot.activeElt || snapshot.activeElt == activeElt(rootNode(snapshot.activeElt))) { return } snapshot.activeElt.focus(); if (!/^(INPUT|TEXTAREA)$/.test(snapshot.activeElt.nodeName) && snapshot.anchorNode && contains(document.body, snapshot.anchorNode) && contains(document.body, snapshot.focusNode)) { @@ -7264,7 +7274,7 @@ function onKeyDown(e) { var cm = this; if (e.target && e.target != cm.display.input.getField()) { return } - cm.curOp.focus = activeElt(doc(cm)); + cm.curOp.focus = activeElt(root(cm)); if (signalDOMEvent(cm, e)) { return } // IE does strange things with escape. if (ie && ie_version < 11 && e.keyCode == 27) { e.returnValue = false; } @@ -7426,7 +7436,7 @@ function leftButtonDown(cm, pos, repeat, event) { if (ie) { setTimeout(bind(ensureFocus, cm), 0); } - else { cm.curOp.focus = activeElt(doc(cm)); } + else { cm.curOp.focus = activeElt(root(cm)); } var behavior = configureMouse(cm, repeat, event); @@ -7496,19 +7506,19 @@ // Normal selection, as opposed to text dragging. function leftButtonSelect(cm, event, start, behavior) { if (ie) { delayBlurEvent(cm); } - var display = cm.display, doc$1 = cm.doc; + var display = cm.display, doc = cm.doc; e_preventDefault(event); - var ourRange, ourIndex, startSel = doc$1.sel, ranges = startSel.ranges; + var ourRange, ourIndex, startSel = doc.sel, ranges = startSel.ranges; if (behavior.addNew && !behavior.extend) { - ourIndex = doc$1.sel.contains(start); + ourIndex = doc.sel.contains(start); if (ourIndex > -1) { ourRange = ranges[ourIndex]; } else { ourRange = new Range(start, start); } } else { - ourRange = doc$1.sel.primary(); - ourIndex = doc$1.sel.primIndex; + ourRange = doc.sel.primary(); + ourIndex = doc.sel.primIndex; } if (behavior.unit == "rectangle") { @@ -7525,18 +7535,18 @@ if (!behavior.addNew) { ourIndex = 0; - setSelection(doc$1, new Selection([ourRange], 0), sel_mouse); - startSel = doc$1.sel; + setSelection(doc, new Selection([ourRange], 0), sel_mouse); + startSel = doc.sel; } else if (ourIndex == -1) { ourIndex = ranges.length; - setSelection(doc$1, normalizeSelection(cm, ranges.concat([ourRange]), ourIndex), + setSelection(doc, normalizeSelection(cm, ranges.concat([ourRange]), ourIndex), {scroll: false, origin: "*mouse"}); } else if (ranges.length > 1 && ranges[ourIndex].empty() && behavior.unit == "char" && !behavior.extend) { - setSelection(doc$1, normalizeSelection(cm, ranges.slice(0, ourIndex).concat(ranges.slice(ourIndex + 1)), 0), + setSelection(doc, normalizeSelection(cm, ranges.slice(0, ourIndex).concat(ranges.slice(ourIndex + 1)), 0), {scroll: false, origin: "*mouse"}); - startSel = doc$1.sel; + startSel = doc.sel; } else { - replaceOneSelection(doc$1, ourIndex, ourRange, sel_mouse); + replaceOneSelection(doc, ourIndex, ourRange, sel_mouse); } var lastPos = start; @@ -7546,19 +7556,19 @@ if (behavior.unit == "rectangle") { var ranges = [], tabSize = cm.options.tabSize; - var startCol = countColumn(getLine(doc$1, start.line).text, start.ch, tabSize); - var posCol = countColumn(getLine(doc$1, pos.line).text, pos.ch, tabSize); + var startCol = countColumn(getLine(doc, start.line).text, start.ch, tabSize); + var posCol = countColumn(getLine(doc, pos.line).text, pos.ch, tabSize); var left = Math.min(startCol, posCol), right = Math.max(startCol, posCol); for (var line = Math.min(start.line, pos.line), end = Math.min(cm.lastLine(), Math.max(start.line, pos.line)); line <= end; line++) { - var text = getLine(doc$1, line).text, leftPos = findColumn(text, left, tabSize); + var text = getLine(doc, line).text, leftPos = findColumn(text, left, tabSize); if (left == right) { ranges.push(new Range(Pos(line, leftPos), Pos(line, leftPos))); } else if (text.length > leftPos) { ranges.push(new Range(Pos(line, leftPos), Pos(line, findColumn(text, right, tabSize)))); } } if (!ranges.length) { ranges.push(new Range(start, start)); } - setSelection(doc$1, normalizeSelection(cm, startSel.ranges.slice(0, ourIndex).concat(ranges), ourIndex), + setSelection(doc, normalizeSelection(cm, startSel.ranges.slice(0, ourIndex).concat(ranges), ourIndex), {origin: "*mouse", scroll: false}); cm.scrollIntoView(pos); } else { @@ -7573,8 +7583,8 @@ anchor = maxPos(oldRange.to(), range.head); } var ranges$1 = startSel.ranges.slice(0); - ranges$1[ourIndex] = bidiSimplify(cm, new Range(clipPos(doc$1, anchor), head)); - setSelection(doc$1, normalizeSelection(cm, ranges$1, ourIndex), sel_mouse); + ranges$1[ourIndex] = bidiSimplify(cm, new Range(clipPos(doc, anchor), head)); + setSelection(doc, normalizeSelection(cm, ranges$1, ourIndex), sel_mouse); } } @@ -7590,9 +7600,9 @@ var cur = posFromMouse(cm, e, true, behavior.unit == "rectangle"); if (!cur) { return } if (cmp(cur, lastPos) != 0) { - cm.curOp.focus = activeElt(doc(cm)); + cm.curOp.focus = activeElt(root(cm)); extendTo(cur); - var visible = visibleLines(display, doc$1); + var visible = visibleLines(display, doc); if (cur.line >= visible.to || cur.line < visible.from) { setTimeout(operation(cm, function () {if (counter == curCount) { extend(e); }}), 150); } } else { @@ -7617,7 +7627,7 @@ } off(display.wrapper.ownerDocument, "mousemove", move); off(display.wrapper.ownerDocument, "mouseup", up); - doc$1.history.lastSelOrigin = null; + doc.history.lastSelOrigin = null; } var move = operation(cm, function (e) { @@ -8617,7 +8627,7 @@ signal(this, "overwriteToggle", this, this.state.overwrite); }, - hasFocus: function() { return this.display.input.getField() == activeElt(doc(this)) }, + hasFocus: function() { return this.display.input.getField() == activeElt(root(this)) }, isReadOnly: function() { return !!(this.options.readOnly || this.doc.cantEdit) }, scrollTo: methodOp(function (x, y) { scrollToCoords(this, x, y); }), @@ -8899,7 +8909,7 @@ disableBrowserMagic(te); cm.display.lineSpace.insertBefore(kludge, cm.display.lineSpace.firstChild); te.value = lastCopied.text.join("\n"); - var hadFocus = activeElt(div.ownerDocument); + var hadFocus = activeElt(rootNode(div)); selectInput(te); setTimeout(function () { cm.display.lineSpace.removeChild(kludge); @@ -8922,7 +8932,7 @@ ContentEditableInput.prototype.prepareSelection = function () { var result = prepareSelection(this.cm, false); - result.focus = activeElt(this.div.ownerDocument) == this.div; + result.focus = activeElt(rootNode(this.div)) == this.div; return result }; @@ -9018,7 +9028,7 @@ ContentEditableInput.prototype.focus = function () { if (this.cm.options.readOnly != "nocursor") { - if (!this.selectionInEditor() || activeElt(this.div.ownerDocument) != this.div) + if (!this.selectionInEditor() || activeElt(rootNode(this.div)) != this.div) { this.showSelection(this.prepareSelection(), true); } this.div.focus(); } @@ -9526,7 +9536,7 @@ TextareaInput.prototype.supportsTouch = function () { return false }; TextareaInput.prototype.focus = function () { - if (this.cm.options.readOnly != "nocursor" && (!mobile || activeElt(this.textarea.ownerDocument) != this.textarea)) { + if (this.cm.options.readOnly != "nocursor" && (!mobile || activeElt(rootNode(this.textarea)) != this.textarea)) { try { this.textarea.focus(); } catch (e) {} // IE8 will throw if the textarea is display: none or not in DOM } @@ -9733,7 +9743,7 @@ // Set autofocus to true if this textarea is focused, or if it has // autofocus and no other element is focused. if (options.autofocus == null) { - var hasFocus = activeElt(textarea.ownerDocument); + var hasFocus = activeElt(rootNode(textarea)); options.autofocus = hasFocus == textarea || textarea.getAttribute("autofocus") != null && hasFocus == document.body; } @@ -9867,7 +9877,7 @@ addLegacyProps(CodeMirror); - CodeMirror.version = "5.65.15"; + CodeMirror.version = "5.65.16"; return CodeMirror;