!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):e.CodeMirror=t()}(this,function(){"use strict";function e(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}function t(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function r(e,r){return t(e).appendChild(r)}function n(e,t,r,n){var i=document.createElement(e);if(r&&(i.className=r),n&&(i.style.cssText=n),"string"==typeof t)i.appendChild(document.createTextNode(t));else if(t)for(var o=0;o=t)return a+(t-o);a+=s-o,a+=r-a%r,o=s+1}}function h(e,t){for(var r=0;r=t)return n+Math.min(a,t-i);if(i+=o-n,i+=r-i%r,n=o+1,i>=t)return n}}function p(e){for(;Ga.length<=e;)Ga.push(m(Ga)+" ");return Ga[e]}function m(e){return e[e.length-1]}function g(e,t){for(var r=[],n=0;n"€"&&(e.toUpperCase()!=e.toLowerCase()||$a.test(e))}function w(e,t){return t?!!(t.source.indexOf("\\w")>-1&&k(e))||t.test(e):k(e)}function x(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}function T(e){return e.charCodeAt(0)>=768&&qa.test(e)}function S(e,t,r){for(;(r<0?t>0:tr?-1:1;;){if(t==r)return t;var i=(t+r)/2,o=n<0?Math.ceil(i):Math.floor(i);if(o==t)return e(o)?t:r;e(o)?r=o:t=o+n}}function L(e,t,r){var o=this;this.input=r,o.scrollbarFiller=n("div",null,"CodeMirror-scrollbar-filler"),o.scrollbarFiller.setAttribute("cm-not-content","true"),o.gutterFiller=n("div",null,"CodeMirror-gutter-filler"),o.gutterFiller.setAttribute("cm-not-content","true"),o.lineDiv=i("div",null,"CodeMirror-code"),o.selectionDiv=n("div",null,null,"position: relative; z-index: 1"),o.cursorDiv=n("div",null,"CodeMirror-cursors"),o.measure=n("div",null,"CodeMirror-measure"),o.lineMeasure=n("div",null,"CodeMirror-measure"),o.lineSpace=i("div",[o.measure,o.lineMeasure,o.selectionDiv,o.cursorDiv,o.lineDiv],null,"position: relative; outline: none");var a=i("div",[o.lineSpace],"CodeMirror-lines");o.mover=n("div",[a],null,"position: relative"),o.sizer=n("div",[o.mover],"CodeMirror-sizer"),o.sizerWidth=null,o.heightForcer=n("div",null,null,"position: absolute; height: "+Ha+"px; width: 1px;"),o.gutters=n("div",null,"CodeMirror-gutters"),o.lineGutter=null,o.scroller=n("div",[o.sizer,o.heightForcer,o.gutters],"CodeMirror-scroll"),o.scroller.setAttribute("tabIndex","-1"),o.wrapper=n("div",[o.scrollbarFiller,o.gutterFiller,o.scroller],"CodeMirror"),ga&&va<8&&(o.gutters.style.zIndex=-1,o.scroller.style.paddingRight=0),ya||ha&&_a||(o.scroller.draggable=!0),e&&(e.appendChild?e.appendChild(o.wrapper):e(o.wrapper)),o.viewFrom=o.viewTo=t.first,o.reportedViewFrom=o.reportedViewTo=t.first,o.view=[],o.renderedView=null,o.externalMeasured=null,o.viewOffset=0,o.lastWrapHeight=o.lastWrapWidth=0,o.updateLineNumbers=null,o.nativeBarWidth=o.barHeight=o.barWidth=0,o.scrollbarsClipped=!1,o.lineNumWidth=o.lineNumInnerWidth=o.lineNumChars=null,o.alignWidgets=!1,o.cachedCharWidth=o.cachedTextHeight=o.cachedPaddingH=null,o.maxLine=null,o.maxLineLength=0,o.maxLineChanged=!1,o.wheelDX=o.wheelDY=o.wheelStartX=o.wheelStartY=null,o.shift=!1,o.selForContextMenu=null,o.activeTouch=null,r.init(o)}function _(e,t){if((t-=e.first)<0||t>=e.size)throw new Error("There is no line "+(t+e.first)+" in the document.");for(var r=e;!r.lines;)for(var n=0;;++n){var i=r.children[n],o=i.chunkSize();if(t=e.first&&tr?I(r,_(e,r).text.length):V(t,_(e,t.line).text.length)}function V(e,t){var r=e.ch;return null==r||r>t?I(e.line,t):r<0?I(e.line,0):e}function Y(e,t){for(var r=[],n=0;n=t:o.to>t);(n||(n=[])).push(new q(a,o.from,s?null:o.to))}}return n}function Z(e,t,r){var n;if(e)for(var i=0;i=t:o.to>t)||o.from==t&&"bookmark"==a.type&&(!r||o.marker.insertLeft)){var s=null==o.from||(a.inclusiveLeft?o.from<=t:o.from0&&s)for(var k=0;k0)){var c=[l,1],d=D(u.from,s.from),f=D(u.to,s.to);(d<0||!a.inclusiveLeft&&!d)&&c.push({from:u.from,to:s.from}),(f>0||!a.inclusiveRight&&!f)&&c.push({from:s.to,to:u.to}),i.splice.apply(i,c),l+=c.length-3}}return i}function re(e){var t=e.markedSpans;if(t){for(var r=0;r=0&&d<=0||c<=0&&d>=0)&&(c<=0&&(l.marker.inclusiveRight&&i.inclusiveLeft?D(u.to,r)>=0:D(u.to,r)>0)||c>=0&&(l.marker.inclusiveRight&&i.inclusiveLeft?D(u.from,n)<=0:D(u.from,n)<0)))return!0}}}function de(e){for(var t;t=le(e);)e=t.find(-1,!0).line;return e}function he(e){for(var t;t=ue(e);)e=t.find(1,!0).line;return e}function fe(e){for(var t,r;t=ue(e);)e=t.find(1,!0).line,(r||(r=[])).push(e);return r}function pe(e,t){var r=_(e,t),n=de(r);return r==n?t:N(n)}function me(e,t){if(t>e.lastLine())return t;var r,n=_(e,t);if(!ge(e,n))return t;for(;r=ue(n);)n=r.find(1,!0).line;return N(n)+1}function ge(e,t){var r=Ka&&t.markedSpans;if(r)for(var n=void 0,i=0;it.maxLineLength&&(t.maxLineLength=r,t.maxLine=e)})}function we(e,t,r,n){if(!e)return n(t,r,"ltr",0);for(var i=!1,o=0;ot||t==r&&a.to==t)&&(n(Math.max(a.from,t),Math.min(a.to,r),1==a.level?"rtl":"ltr",o),i=!0)}i||n(t,r,"ltr")}function xe(e,t,r){var n;Xa=null;for(var i=0;it)return i;o.to==t&&(o.from!=o.to&&"before"==r?n=i:Xa=i),o.from==t&&(o.from!=o.to&&"before"!=r?n=i:Xa=i)}return null!=n?n:Xa}function Te(e,t){var r=e.order;return null==r&&(r=e.order=Qa(e.text,t)),r}function Se(e,t){return e._handlers&&e._handlers[t]||Za}function Ce(e,t,r){if(e.removeEventListener)e.removeEventListener(t,r,!1);else if(e.detachEvent)e.detachEvent("on"+t,r);else{var n=e._handlers,i=n&&n[t];if(i){var o=h(i,r);o>-1&&(n[t]=i.slice(0,o).concat(i.slice(o+1)))}}}function Le(e,t){var r=Se(e,t);if(r.length)for(var n=Array.prototype.slice.call(arguments,2),i=0;i0}function Ae(e){e.prototype.on=function(e,t){Ja(this,e,t)},e.prototype.off=function(e,t){Ce(this,e,t)}}function Ne(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function Oe(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function Re(e){return null!=e.defaultPrevented?e.defaultPrevented:0==e.returnValue}function Pe(e){Ne(e),Oe(e)}function Ie(e){return e.target||e.srcElement}function De(e){var t=e.which;return null==t&&(1&e.button?t=1:2&e.button?t=3:4&e.button&&(t=2)),Ea&&e.ctrlKey&&1==t&&(t=3),t}function ze(e){if(null==Wa){var t=n("span","​");r(e,n("span",[t,document.createTextNode("x")])),0!=e.firstChild.offsetHeight&&(Wa=t.offsetWidth<=1&&t.offsetHeight>2&&!(ga&&va<8))}var i=Wa?n("span","​"):n("span"," ",null,"display: inline-block; width: 1px; margin-right: -1px");return i.setAttribute("cm-text",""),i}function We(e){if(null!=Fa)return Fa;var n=r(e,document.createTextNode("AخA")),i=Oa(n,0,1).getBoundingClientRect(),o=Oa(n,1,2).getBoundingClientRect();return t(e),!(!i||i.left==i.right)&&(Fa=o.right-i.right<3)}function Fe(e){if(null!=is)return is;var t=r(e,n("span","x")),i=t.getBoundingClientRect(),o=Oa(t,0,1).getBoundingClientRect();return is=Math.abs(i.left-o.left)>1}function He(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),os[e]=t}function Ue(e){if("string"==typeof e&&as.hasOwnProperty(e))e=as[e];else if(e&&"string"==typeof e.name&&as.hasOwnProperty(e.name)){var t=as[e.name];"string"==typeof t&&(t={name:t}),(e=b(t,e)).name=t.name}else{if("string"==typeof e&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return Ue("application/xml");if("string"==typeof e&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return Ue("application/json")}return"string"==typeof e?{name:e}:e||{name:"null"}}function Be(e,t){t=Ue(t);var r=os[t.name];if(!r)return Be(e,"text/plain");var n=r(e,t);if(ss.hasOwnProperty(t.name)){var i=ss[t.name];for(var o in i)i.hasOwnProperty(o)&&(n.hasOwnProperty(o)&&(n["_"+o]=n[o]),n[o]=i[o])}if(n.name=t.name,t.helperType&&(n.helperType=t.helperType),t.modeProps)for(var a in t.modeProps)n[a]=t.modeProps[a];return n}function Ve(e,t){c(t,ss.hasOwnProperty(e)?ss[e]:ss[e]={})}function Ye(e,t){if(!0===t)return t;if(e.copyState)return e.copyState(t);var r={};for(var n in t){var i=t[n];i instanceof Array&&(i=i.concat([])),r[n]=i}return r}function Ge(e,t){for(var r;e.innerMode&&(r=e.innerMode(t))&&r.mode!=e;)t=r.state,e=r.mode;return r||{mode:e,state:t}}function $e(e,t,r){return!e.startState||e.startState(t,r)}function qe(e,t,r,n){var i=[e.state.modeGen],o={};tt(e,t.text,e.doc.mode,r,function(e,t){return i.push(e,t)},o,n);for(var a=r.state,s=0;se&&i.splice(l,1,e,i[l+1],n),l+=2,u=Math.min(e,n)}if(t)if(s.opaque)i.splice(r,l-r,e,"overlay "+t),l=r+2;else for(;re.options.maxHighlightLength&&Ye(e.doc.mode,n.state),o=qe(e,t,n);i&&(n.state=i),t.stateAfter=n.save(!i),t.styles=o.styles,o.classes?t.styleClasses=o.classes:t.styleClasses&&(t.styleClasses=null),r===e.doc.highlightFrontier&&(e.doc.modeFrontier=Math.max(e.doc.modeFrontier,++e.doc.highlightFrontier))}return t.styles}function Ke(e,t,r){var n=e.doc,i=e.display;if(!n.mode.startState)return new cs(n,!0,t);var o=rt(e,t,r),a=o>n.first&&_(n,o-1).stateAfter,s=a?cs.fromSaved(n,a,o):new cs(n,$e(n.mode),o);return n.iter(o,t,function(r){Xe(e,r.text,s);var n=s.line;r.stateAfter=n==t-1||n%5==0||n>=i.viewFrom&&nt.start)return o}throw new Error("Mode "+e.name+" failed to advance stream.")}function Je(e,t,r,n){var i,o,a=e.doc,s=a.mode,l=_(a,(t=B(a,t)).line),u=Ke(e,t.line,r),c=new ls(l.text,e.options.tabSize,u);for(n&&(o=[]);(n||c.pose.options.maxHighlightLength?(s=!1,a&&Xe(e,t,n,d.pos),d.pos=t.length,l=null):l=et(Ze(r,d,n.state,h),o),h){var f=h[0].name;f&&(l="m-"+(l?f+" "+l:f))}if(!s||c!=l){for(;ua;--s){if(s<=o.first)return o.first;var l=_(o,s-1),u=l.stateAfter;if(u&&(!r||s+(u instanceof us?u.lookAhead:0)<=o.modeFrontier))return s;var c=d(l.text,null,e.options.tabSize);(null==i||n>c)&&(i=s-1,n=c)}return i}function nt(e,t){if(e.modeFrontier=Math.min(e.modeFrontier,t),!(e.highlightFrontierr;n--){var i=_(e,n).stateAfter;if(i&&(!(i instanceof us)||n+i.lookAhead1&&!/ /.test(e))return e;for(var r=t,n="",i=0;iu&&d.from<=u);h++);if(d.to>=c)return e(r,n,i,o,a,s,l);e(r,n.slice(0,d.to-u),i,o,null,s,l),o=null,n=n.slice(d.to-u),u=d.to}}}function ht(e,t,r,n){var i=!n&&r.widgetNode;i&&e.map.push(e.pos,e.pos+t,i),!n&&e.cm.display.input.needsContentAttribute&&(i||(i=e.content.appendChild(document.createElement("span"))),i.setAttribute("cm-marker",r.id)),i&&(e.cm.display.input.setUneditable(i),e.content.appendChild(i)),e.pos+=t,e.trailingSpace=!1}function ft(e,t,r){var n=e.markedSpans,i=e.text,o=0;if(n)for(var a,s,l,u,c,d,h,f=i.length,p=0,m=1,g="",v=0;;){if(v==p){l=u=c=d=s="",h=null,v=1/0;for(var y=[],b=void 0,k=0;kp||x.collapsed&&w.to==p&&w.from==p)?(null!=w.to&&w.to!=p&&v>w.to&&(v=w.to,u=""),x.className&&(l+=" "+x.className),x.css&&(s=(s?s+";":"")+x.css),x.startStyle&&w.from==p&&(c+=" "+x.startStyle),x.endStyle&&w.to==v&&(b||(b=[])).push(x.endStyle,w.to),x.title&&!d&&(d=x.title),x.collapsed&&(!h||ae(h.marker,x)<0)&&(h=w)):w.from>p&&v>w.from&&(v=w.from)}if(b)for(var T=0;T=f)break;for(var C=Math.min(f,v);;){if(g){var L=p+g.length;if(!h){var _=L>C?g.slice(0,C-p):g;t.addToken(t,_,a?a+l:l,c,p+_.length==v?u:"",d,s)}if(L>=C){g=g.slice(C-p),p=C;break}p=L,c=""}g=i.slice(o,o=r[m++]),a=at(r[m++],t.cm.options)}}else for(var E=1;E2&&o.push((l.bottom+u.top)/2-r.top)}}o.push(r.bottom-r.top)}}function Bt(e,t,r){if(e.line==t)return{map:e.measure.map,cache:e.measure.cache};for(var n=0;nr)return{map:e.measure.maps[i],cache:e.measure.caches[i],before:!0}}function Vt(e,t){var n=N(t=de(t)),i=e.display.externalMeasured=new pt(e.doc,t,n);i.lineN=n;var o=i.built=st(e,i);return i.text=o.pre,r(e.display.lineMeasure,o.pre),i}function Yt(e,t,r,n){return qt(e,$t(e,t),r,n)}function Gt(e,t){if(t>=e.display.viewFrom&&t=r.lineN&&tt)&&(i=(o=l-s)-1,t>=l&&(a="right")),null!=i){if(n=e[u+2],s==l&&r==(n.insertLeft?"left":"right")&&(a=r),"left"==r&&0==i)for(;u&&e[u-2]==e[u-3]&&e[u-1].insertLeft;)n=e[2+(u-=3)],a="left";if("right"==r&&i==l-s)for(;u=0&&(r=e[i]).left==r.right;i--);return r}function Xt(e,t,r,n){var i,o=jt(t.map,r,n),a=o.node,s=o.start,l=o.end,u=o.collapse;if(3==a.nodeType){for(var c=0;c<4;c++){for(;s&&T(t.line.text.charAt(o.coverStart+s));)--s;for(;o.coverStart+l0&&(u=n="right");var d;i=e.options.lineWrapping&&(d=a.getClientRects()).length>1?d["right"==n?d.length-1:0]:a.getBoundingClientRect()}if(ga&&va<9&&!s&&(!i||!i.left&&!i.right)){var h=a.parentNode.getClientRects()[0];i=h?{left:h.left,right:h.left+yr(e.display),top:h.top,bottom:h.bottom}:ys}for(var f=i.top-t.rect.top,p=i.bottom-t.rect.top,m=(f+p)/2,g=t.view.measure.heights,v=0;v=n.text.length?(u=n.text.length,c="before"):u<=0&&(u=0,c="after"),!l)return a("before"==c?u-1:u,"before"==c);var d=xe(l,u,c),h=Xa,f=s(u,d,"before"==c);return null!=h&&(f.other=s(u,h,"before"!=c)),f}function lr(e,t){var r=0;t=B(e.doc,t),e.options.lineWrapping||(r=yr(e.display)*t.ch);var n=_(e.doc,t.line),i=ye(n)+It(e.display);return{left:r,right:r,top:i,bottom:i+n.height}}function ur(e,t,r,n,i){var o=I(e,t,r);return o.xRel=i,n&&(o.outside=!0),o}function cr(e,t,r){var n=e.doc;if((r+=e.display.viewOffset)<0)return ur(n.first,0,null,!0,-1);var i=O(n,r),o=n.first+n.size-1;if(i>o)return ur(n.first+n.size-1,_(n,o).text.length,null,!0,1);t<0&&(t=0);for(var a=_(n,i);;){var s=pr(e,a,i,t,r),l=ue(a),u=l&&l.find(0,!0);if(!l||!(s.ch>u.from.ch||s.ch==u.from.ch&&s.xRel>0))return s;i=N(a=u.to.line)}}function dr(e,t,r,n){n-=nr(t);var i=t.text.length,o=C(function(t){return qt(e,r,t-1).bottom<=n},i,0);return i=C(function(t){return qt(e,r,t).top>n},o,i),{begin:o,end:i}}function hr(e,t,r,n){return r||(r=$t(e,t)),dr(e,t,r,ir(e,t,qt(e,r,n),"line").top)}function fr(e,t,r,n){return!(e.bottom<=r)&&(e.top>r||(n?e.left:e.right)>t)}function pr(e,t,r,n,i){i-=ye(t);var o=$t(e,t),a=nr(t),s=0,l=t.text.length,u=!0,c=Te(t,e.doc.direction);if(c){var d=(e.options.lineWrapping?gr:mr)(e,t,r,o,c,n,i);s=(u=1!=d.level)?d.from:d.to-1,l=u?d.to:d.from-1}var h,f,p=null,m=null,g=C(function(t){var r=qt(e,o,t);return r.top+=a,r.bottom+=a,!!fr(r,n,i,!1)&&(r.top<=i&&r.left<=n&&(p=t,m=r),!0)},s,l),v=!1;if(m){var y=n-m.left=k.bottom}return g=S(t.text,g,1),ur(r,g,f,v,n-h)}function mr(e,t,r,n,i,o,a){var s=C(function(s){var l=i[s],u=1!=l.level;return fr(sr(e,I(r,u?l.to:l.from,u?"before":"after"),"line",t,n),o,a,!0)},0,i.length-1),l=i[s];if(s>0){var u=1!=l.level,c=sr(e,I(r,u?l.from:l.to,u?"after":"before"),"line",t,n);fr(c,o,a,!0)&&c.top>a&&(l=i[s-1])}return l}function gr(e,t,r,n,i,o,a){var s=dr(e,t,n,a),l=s.begin,u=s.end;/\s/.test(t.text.charAt(u-1))&&u--;for(var c=null,d=null,h=0;h=u||f.to<=l)){var p=qt(e,n,1!=f.level?Math.min(u,f.to)-1:Math.max(l,f.from)).right,m=pm)&&(c=f,d=m)}}return c||(c=i[i.length-1]),c.fromu&&(c={from:c.from,to:u,level:c.level}),c}function vr(e){if(null!=e.cachedTextHeight)return e.cachedTextHeight;if(null==fs){fs=n("pre");for(var i=0;i<49;++i)fs.appendChild(document.createTextNode("x")),fs.appendChild(n("br"));fs.appendChild(document.createTextNode("x"))}r(e.measure,fs);var o=fs.offsetHeight/50;return o>3&&(e.cachedTextHeight=o),t(e.measure),o||1}function yr(e){if(null!=e.cachedCharWidth)return e.cachedCharWidth;var t=n("span","xxxxxxxxxx"),i=n("pre",[t]);r(e.measure,i);var o=t.getBoundingClientRect(),a=(o.right-o.left)/10;return a>2&&(e.cachedCharWidth=a),a||10}function br(e){for(var t=e.display,r={},n={},i=t.gutters.clientLeft,o=t.gutters.firstChild,a=0;o;o=o.nextSibling,++a)r[e.options.gutters[a]]=o.offsetLeft+o.clientLeft+i,n[e.options.gutters[a]]=o.clientWidth;return{fixedPos:kr(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:r,gutterWidth:n,wrapperWidth:t.wrapper.clientWidth}}function kr(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function wr(e){var t=vr(e.display),r=e.options.lineWrapping,n=r&&Math.max(5,e.display.scroller.clientWidth/yr(e.display)-3);return function(i){if(ge(e.doc,i))return 0;var o=0;if(i.widgets)for(var a=0;a=e.display.viewTo)return null;if((t-=e.display.viewFrom)<0)return null;for(var r=e.display.view,n=0;n=e.display.viewTo||s.to().line0?t.blinker=setInterval(function(){return t.cursorDiv.style.visibility=(r=!r)?"":"hidden"},e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}}function Nr(e){e.state.focused||(e.display.input.focus(),Rr(e))}function Or(e){e.state.delayingBlurEvent=!0,setTimeout(function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,Pr(e))},100)}function Rr(e,t){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1),"nocursor"!=e.options.readOnly&&(e.state.focused||(Le(e,"focus",e,t),e.state.focused=!0,s(e.display.wrapper,"CodeMirror-focused"),e.curOp||e.display.selForContextMenu==e.doc.sel||(e.display.input.reset(),ya&&setTimeout(function(){return e.display.input.reset(!0)},20)),e.display.input.receivedFocus()),Ar(e))}function Pr(e,t){e.state.delayingBlurEvent||(e.state.focused&&(Le(e,"blur",e,t),e.state.focused=!1,Ia(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout(function(){e.state.focused||(e.display.shift=!1)},150))}function Ir(e){for(var t=e.display,r=t.lineDiv.offsetTop,n=0;n.005||l<-.005)&&(A(i.line,o),Dr(i.line),i.rest))for(var u=0;u=a&&(o=O(t,ye(_(t,l))-e.wrapper.clientHeight),a=l)}return{from:o,to:Math.max(a,o+1)}}function Wr(e){var t=e.display,r=t.view;if(t.alignWidgets||t.gutters.firstChild&&e.options.fixedGutter){for(var n=kr(t)-t.scroller.scrollLeft+e.doc.scrollLeft,i=t.gutters.offsetWidth,o=n+"px",a=0;a(window.innerHeight||document.documentElement.clientHeight)&&(o=!1),null!=o&&!Sa){var a=n("div","​",null,"position: absolute;\n top: "+(t.top-r.viewOffset-It(e.display))+"px;\n height: "+(t.bottom-t.top+Wt(e)+r.barHeight)+"px;\n left: "+t.left+"px; width: "+Math.max(2,t.right-t.left)+"px;");e.display.lineSpace.appendChild(a),a.scrollIntoView(o),e.display.lineSpace.removeChild(a)}}}function Ur(e,t,r,n){null==n&&(n=0);var i;e.options.lineWrapping||t!=r||(r="before"==(t=t.ch?I(t.line,"before"==t.sticky?t.ch-1:t.ch,"after"):t).sticky?I(t.line,t.ch+1,"before"):t);for(var o=0;o<5;o++){var a=!1,s=sr(e,t),l=r&&r!=t?sr(e,r):s,u=Vr(e,i={left:Math.min(s.left,l.left),top:Math.min(s.top,l.top)-n,right:Math.max(s.left,l.left),bottom:Math.max(s.bottom,l.bottom)+n}),c=e.doc.scrollTop,d=e.doc.scrollLeft;if(null!=u.scrollTop&&(Xr(e,u.scrollTop),Math.abs(e.doc.scrollTop-c)>1&&(a=!0)),null!=u.scrollLeft&&(Zr(e,u.scrollLeft),Math.abs(e.doc.scrollLeft-d)>1&&(a=!0)),!a)break}return i}function Br(e,t){var r=Vr(e,t);null!=r.scrollTop&&Xr(e,r.scrollTop),null!=r.scrollLeft&&Zr(e,r.scrollLeft)}function Vr(e,t){var r=e.display,n=vr(e.display);t.top<0&&(t.top=0);var i=e.curOp&&null!=e.curOp.scrollTop?e.curOp.scrollTop:r.scroller.scrollTop,o=Ht(e),a={};t.bottom-t.top>o&&(t.bottom=t.top+o);var s=e.doc.height+Dt(r),l=t.tops-n;if(t.topi+o){var c=Math.min(t.top,(u?s:t.bottom)-o);c!=i&&(a.scrollTop=c)}var d=e.curOp&&null!=e.curOp.scrollLeft?e.curOp.scrollLeft:r.scroller.scrollLeft,h=Ft(e)-(e.options.fixedGutter?r.gutters.offsetWidth:0),f=t.right-t.left>h;return f&&(t.right=t.left+h),t.left<10?a.scrollLeft=0:t.lefth+d-3&&(a.scrollLeft=t.right+(f?0:10)-h),a}function Yr(e,t){null!=t&&(jr(e),e.curOp.scrollTop=(null==e.curOp.scrollTop?e.doc.scrollTop:e.curOp.scrollTop)+t)}function Gr(e){jr(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function $r(e,t,r){null==t&&null==r||jr(e),null!=t&&(e.curOp.scrollLeft=t),null!=r&&(e.curOp.scrollTop=r)}function qr(e,t){jr(e),e.curOp.scrollToPos=t}function jr(e){var t=e.curOp.scrollToPos;t&&(e.curOp.scrollToPos=null,Kr(e,lr(e,t.from),lr(e,t.to),t.margin))}function Kr(e,t,r,n){var i=Vr(e,{left:Math.min(t.left,r.left),top:Math.min(t.top,r.top)-n,right:Math.max(t.right,r.right),bottom:Math.max(t.bottom,r.bottom)+n});$r(e,i.scrollLeft,i.scrollTop)}function Xr(e,t){Math.abs(e.doc.scrollTop-t)<2||(ha||Mn(e,{top:t}),Qr(e,t,!0),ha&&Mn(e),xn(e,100))}function Qr(e,t,r){t=Math.min(e.display.scroller.scrollHeight-e.display.scroller.clientHeight,t),(e.display.scroller.scrollTop!=t||r)&&(e.doc.scrollTop=t,e.display.scrollbars.setScrollTop(t),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t))}function Zr(e,t,r,n){t=Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth),(r?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)&&!n||(e.doc.scrollLeft=t,Wr(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t))}function Jr(e){var t=e.display,r=t.gutters.offsetWidth,n=Math.round(e.doc.height+Dt(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?r:0,docHeight:n,scrollHeight:n+Wt(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:r}}function en(e,t){t||(t=Jr(e));var r=e.display.barWidth,n=e.display.barHeight;tn(e,t);for(var i=0;i<4&&r!=e.display.barWidth||n!=e.display.barHeight;i++)r!=e.display.barWidth&&e.options.lineWrapping&&Ir(e),tn(e,Jr(e)),r=e.display.barWidth,n=e.display.barHeight}function tn(e,t){var r=e.display,n=r.scrollbars.update(t);r.sizer.style.paddingRight=(r.barWidth=n.right)+"px",r.sizer.style.paddingBottom=(r.barHeight=n.bottom)+"px",r.heightForcer.style.borderBottom=n.bottom+"px solid transparent",n.right&&n.bottom?(r.scrollbarFiller.style.display="block",r.scrollbarFiller.style.height=n.bottom+"px",r.scrollbarFiller.style.width=n.right+"px"):r.scrollbarFiller.style.display="",n.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(r.gutterFiller.style.display="block",r.gutterFiller.style.height=n.bottom+"px",r.gutterFiller.style.width=t.gutterWidth+"px"):r.gutterFiller.style.display=""}function rn(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&Ia(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new ws[e.options.scrollbarStyle](function(t){e.display.wrapper.insertBefore(t,e.display.scrollbarFiller),Ja(t,"mousedown",function(){e.state.focused&&setTimeout(function(){return e.display.input.focus()},0)}),t.setAttribute("cm-not-content","true")},function(t,r){"horizontal"==r?Zr(e,t):Xr(e,t)},e),e.display.scrollbars.addClass&&s(e.display.wrapper,e.display.scrollbars.addClass)}function nn(e){e.curOp={cm:e,viewChanged:!1,startHeight:e.doc.height,forceUpdate:!1,updateInput:null,typing:!1,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,focus:!1,id:++xs},gt(e.curOp)}function on(e){yt(e.curOp,function(e){for(var t=0;t=r.viewTo)||r.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new Ts(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function ln(e){e.updatedDisplay=e.mustUpdate&&_n(e.cm,e.update)}function un(e){var t=e.cm,r=t.display;e.updatedDisplay&&Ir(t),e.barMeasure=Jr(t),r.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=Yt(t,r.maxLine,r.maxLine.text.length).left+3,t.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(r.scroller.clientWidth,r.sizer.offsetLeft+e.adjustWidthTo+Wt(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,r.sizer.offsetLeft+e.adjustWidthTo-Ft(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=r.input.prepareSelection())}function cn(e){var t=e.cm;null!=e.adjustWidthTo&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeftt)&&(i.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=i.viewTo)Ka&&pe(e.doc,t)i.viewFrom?yn(e):(i.viewFrom+=n,i.viewTo+=n);else if(t<=i.viewFrom&&r>=i.viewTo)yn(e);else if(t<=i.viewFrom){var o=bn(e,r,r+n,1);o?(i.view=i.view.slice(o.index),i.viewFrom=o.lineN,i.viewTo+=n):yn(e)}else if(r>=i.viewTo){var a=bn(e,t,t,-1);a?(i.view=i.view.slice(0,a.index),i.viewTo=a.lineN):yn(e)}else{var s=bn(e,t,t,-1),l=bn(e,r,r+n,1);s&&l?(i.view=i.view.slice(0,s.index).concat(mt(e,s.lineN,l.lineN)).concat(i.view.slice(l.index)),i.viewTo+=n):yn(e)}var u=i.externalMeasured;u&&(r=i.lineN&&t=n.viewTo)){var o=n.view[Sr(e,t)];if(null!=o.node){var a=o.changes||(o.changes=[]);-1==h(a,r)&&a.push(r)}}}function yn(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function bn(e,t,r,n){var i,o=Sr(e,t),a=e.display.view;if(!Ka||r==e.doc.first+e.doc.size)return{index:o,lineN:r};for(var s=e.display.viewFrom,l=0;l0){if(o==a.length-1)return null;i=s+a[o].size-t,o++}else i=s-t;t+=i,r+=i}for(;pe(e.doc,r)!=r;){if(o==(n<0?0:a.length-1))return null;r+=n*a[o-(n<0?1:0)].size,o+=n}return{index:o,lineN:r}}function kn(e,t,r){var n=e.display;0==n.view.length||t>=n.viewTo||r<=n.viewFrom?(n.view=mt(e,t,r),n.viewFrom=t):(n.viewFrom>t?n.view=mt(e,t,n.viewFrom).concat(n.view):n.viewFromr&&(n.view=n.view.slice(0,Sr(e,r)))),n.viewTo=r}function wn(e){for(var t=e.display.view,r=0,n=0;n=e.display.viewTo)){var r=+new Date+e.options.workTime,n=Ke(e,t.highlightFrontier),i=[];t.iter(n.line,Math.min(t.first+t.size,e.display.viewTo+500),function(o){if(n.line>=e.display.viewFrom){var a=o.styles,s=o.text.length>e.options.maxHighlightLength?Ye(t.mode,n.state):null,l=qe(e,o,n,!0);s&&(n.state=s),o.styles=l.styles;var u=o.styleClasses,c=l.classes;c?o.styleClasses=c:u&&(o.styleClasses=null);for(var d=!a||a.length!=o.styles.length||u!=c&&(!u||!c||u.bgClass!=c.bgClass||u.textClass!=c.textClass),h=0;!d&&hr)return xn(e,e.options.workDelay),!0}),t.highlightFrontier=n.line,t.modeFrontier=Math.max(t.modeFrontier,n.line),i.length&&hn(e,function(){for(var t=0;t=n.viewFrom&&r.visible.to<=n.viewTo&&(null==n.updateLineNumbers||n.updateLineNumbers>=n.viewTo)&&n.renderedView==n.view&&0==wn(e))return!1;Fr(e)&&(yn(e),r.dims=br(e));var o=i.first+i.size,a=Math.max(r.visible.from-e.options.viewportMargin,i.first),s=Math.min(o,r.visible.to+e.options.viewportMargin);n.viewFroms&&n.viewTo-s<20&&(s=Math.min(o,n.viewTo)),Ka&&(a=pe(e.doc,a),s=me(e.doc,s));var l=a!=n.viewFrom||s!=n.viewTo||n.lastWrapHeight!=r.wrapperHeight||n.lastWrapWidth!=r.wrapperWidth;kn(e,a,s),n.viewOffset=ye(_(e.doc,n.viewFrom)),e.display.mover.style.top=n.viewOffset+"px";var u=wn(e);if(!l&&0==u&&!r.force&&n.renderedView==n.view&&(null==n.updateLineNumbers||n.updateLineNumbers>=n.viewTo))return!1;var c=Cn(e);return u>4&&(n.lineDiv.style.display="none"),An(e,n.updateLineNumbers,r.dims),u>4&&(n.lineDiv.style.display=""),n.renderedView=n.view,Ln(c),t(n.cursorDiv),t(n.selectionDiv),n.gutters.style.height=n.sizer.style.minHeight=0,l&&(n.lastWrapHeight=r.wrapperHeight,n.lastWrapWidth=r.wrapperWidth,xn(e,400)),n.updateLineNumbers=null,!0}function En(e,t){for(var r=t.viewport,n=!0;(n&&e.options.lineWrapping&&t.oldDisplayWidth!=Ft(e)||(r&&null!=r.top&&(r={top:Math.min(e.doc.height+Dt(e.display)-Ht(e),r.top)}),t.visible=zr(e.display,e.doc,r),!(t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)))&&_n(e,t);n=!1){Ir(e);var i=Jr(e);Cr(e),en(e,i),On(e,i),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 Mn(e,t){var r=new Ts(e,t);if(_n(e,r)){Ir(e),En(e,r);var n=Jr(e);Cr(e),en(e,n),On(e,n),r.finish()}}function An(e,r,n){function i(t){var r=t.nextSibling;return ya&&Ea&&e.display.currentWheelTarget==t?t.style.display="none":t.parentNode.removeChild(t),r}for(var o=e.display,a=e.options.lineNumbers,s=o.lineDiv,l=s.firstChild,u=o.view,c=o.viewFrom,d=0;d-1&&(p=!1),wt(e,f,c,n)),p&&(t(f.lineNumber),f.lineNumber.appendChild(document.createTextNode(P(e.options,c)))),l=f.node.nextSibling}else{var m=Mt(e,f,c,n);s.insertBefore(m,l)}c+=f.size}for(;l;)l=i(l)}function Nn(e){var t=e.display.gutters.offsetWidth;e.display.sizer.style.marginLeft=t+"px"}function On(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+Wt(e)+"px"}function Rn(e){var r=e.display.gutters,i=e.options.gutters;t(r);for(var o=0;o-1&&!e.lineNumbers&&(e.gutters=e.gutters.slice(0),e.gutters.splice(t,1))}function In(e){var t=e.wheelDeltaX,r=e.wheelDeltaY;return null==t&&e.detail&&e.axis==e.HORIZONTAL_AXIS&&(t=e.detail),null==r&&e.detail&&e.axis==e.VERTICAL_AXIS?r=e.detail:null==r&&(r=e.wheelDelta),{x:t,y:r}}function Dn(e){var t=In(e);return t.x*=Cs,t.y*=Cs,t}function zn(e,t){var r=In(t),n=r.x,i=r.y,o=e.display,a=o.scroller,s=a.scrollWidth>a.clientWidth,l=a.scrollHeight>a.clientHeight;if(n&&s||i&&l){if(i&&Ea&&ya)e:for(var u=t.target,c=o.view;u!=a;u=u.parentNode)for(var d=0;d=0){var a=H(o.from(),i.from()),s=F(o.to(),i.to()),l=o.empty()?i.from()==i.head:o.from()==o.head;n<=t&&--t,e.splice(--n,2,new _s(l?s:a,l?a:s))}}return new Ls(e,t)}function Fn(e,t){return new Ls([new _s(e,t||e)],0)}function Hn(e){return e.text?I(e.from.line+e.text.length-1,m(e.text).length+(1==e.text.length?e.from.ch:0)):e.to}function Un(e,t){if(D(e,t.from)<0)return e;if(D(e,t.to)<=0)return Hn(t);var r=e.line+t.text.length-(t.to.line-t.from.line)-1,n=e.ch;return e.line==t.to.line&&(n+=Hn(t).ch-t.to.ch),I(r,n)}function Bn(e,t){for(var r=[],n=0;n1&&e.remove(s.line+1,p-1),e.insert(s.line+1,y)}bt(e,"change",e,t)}function Kn(e,t,r){function n(e,i,o){if(e.linked)for(var a=0;a1&&!e.done[e.done.length-2].ranges?(e.done.pop(),m(e.done)):void 0}function ni(e,t,r,n){var i=e.history;i.undone.length=0;var o,a,s=+new Date;if((i.lastOp==n||i.lastOrigin==t.origin&&t.origin&&("+"==t.origin.charAt(0)&&e.cm&&i.lastModTime>s-e.cm.options.historyEventDelay||"*"==t.origin.charAt(0)))&&(o=ri(i,i.lastOp==n)))a=m(o.changes),0==D(t.from,t.to)&&0==D(t.from,a.to)?a.to=Hn(t):o.changes.push(ei(e,t));else{var l=m(i.done);for(l&&l.ranges||ai(e.sel,i.done),o={changes:[ei(e,t)],generation:i.generation},i.done.push(o);i.done.length>i.undoDepth;)i.done.shift(),i.done[0].ranges||i.done.shift()}i.done.push(r),i.generation=++i.maxGeneration,i.lastModTime=i.lastSelTime=s,i.lastOp=i.lastSelOp=n,i.lastOrigin=i.lastSelOrigin=t.origin,a||Le(e,"historyAdded")}function ii(e,t,r,n){var i=t.charAt(0);return"*"==i||"+"==i&&r.ranges.length==n.ranges.length&&r.somethingSelected()==n.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}function oi(e,t,r,n){var i=e.history,o=n&&n.origin;r==i.lastSelOp||o&&i.lastSelOrigin==o&&(i.lastModTime==i.lastSelTime&&i.lastOrigin==o||ii(e,o,m(i.done),t))?i.done[i.done.length-1]=t:ai(t,i.done),i.lastSelTime=+new Date,i.lastSelOrigin=o,i.lastSelOp=r,n&&!1!==n.clearRedo&&ti(i.undone)}function ai(e,t){var r=m(t);r&&r.ranges&&r.equals(e)||t.push(e)}function si(e,t,r,n){var i=t["spans_"+e.id],o=0;e.iter(Math.max(e.first,r),Math.min(e.first+e.size,n),function(r){r.markedSpans&&((i||(i=t["spans_"+e.id]={}))[o]=r.markedSpans),++o})}function li(e){if(!e)return null;for(var t,r=0;r-1&&(m(s)[d]=u[d],delete u[d])}}}return n}function hi(e,t,r,n){if(n){var i=e.anchor;if(r){var o=D(t,i)<0;o!=D(r,i)<0?(i=t,t=r):o!=D(t,r)<0&&(t=r)}return new _s(i,t)}return new _s(r||t,t)}function fi(e,t,r,n,i){null==i&&(i=e.cm&&(e.cm.display.shift||e.extend)),bi(e,new Ls([hi(e.sel.primary(),t,r,i)],0),n)}function pi(e,t,r){for(var n=[],i=e.cm&&(e.cm.display.shift||e.extend),o=0;o=t.ch:s.to>t.ch))){if(i&&(Le(l,"beforeCursorEnter"),l.explicitlyCleared)){if(o.markedSpans){--a;continue}break}if(!l.atomic)continue;if(r){var u=l.find(n<0?1:-1),c=void 0;if((n<0?l.inclusiveRight:l.inclusiveLeft)&&(u=Li(e,u,-n,u&&u.line==t.line?o:null)),u&&u.line==t.line&&(c=D(u,r))&&(n<0?c<0:c>0))return Si(e,u,t,n,i)}var d=l.find(n<0?-1:1);return(n<0?l.inclusiveLeft:l.inclusiveRight)&&(d=Li(e,d,n,d.line==t.line?o:null)),d?Si(e,d,t,n,i):null}}return t}function Ci(e,t,r,n,i){var o=n||1,a=Si(e,t,r,o,i)||!i&&Si(e,t,r,o,!0)||Si(e,t,r,-o,i)||!i&&Si(e,t,r,-o,!0);return a||(e.cantEdit=!0,I(e.first,0))}function Li(e,t,r,n){return r<0&&0==t.ch?t.line>e.first?B(e,I(t.line-1)):null:r>0&&t.ch==(n||_(e,t.line)).text.length?t.line=0;--i)Ai(e,{from:n[i].from,to:n[i].to,text:i?[""]:t.text,origin:t.origin});else Ai(e,t)}}function Ai(e,t){if(1!=t.text.length||""!=t.text[0]||0!=D(t.from,t.to)){var r=Bn(e,t);ni(e,t,r,e.cm?e.cm.curOp.id:NaN),Ri(e,t,r,J(e,t));var n=[];Kn(e,function(e,r){r||-1!=h(n,e.history)||(Wi(e.history,t),n.push(e.history)),Ri(e,t,null,J(e,t))})}}function Ni(e,t,r){if(!e.cm||!e.cm.state.suppressEdits||r){for(var n,i=e.history,o=e.sel,a="undo"==t?i.done:i.undone,s="undo"==t?i.undone:i.done,l=0;l=0;--d){var f=function(r){var i=n.changes[r];if(i.origin=t,c&&!Ei(e,i,!1))return a.length=0,{};u.push(ei(e,i));var o=r?Bn(e,i):m(a);Ri(e,i,o,ci(e,i)),!r&&e.cm&&e.cm.scrollIntoView({from:i.from,to:Hn(i)});var s=[];Kn(e,function(e,t){t||-1!=h(s,e.history)||(Wi(e.history,i),s.push(e.history)),Ri(e,i,null,ci(e,i))})}(d);if(f)return f.v}}}}function Oi(e,t){if(0!=t&&(e.first+=t,e.sel=new Ls(g(e.sel.ranges,function(e){return new _s(I(e.anchor.line+t,e.anchor.ch),I(e.head.line+t,e.head.ch))}),e.sel.primIndex),e.cm)){gn(e.cm,e.first,e.first-t,t);for(var r=e.cm.display,n=r.viewFrom;ne.lastLine())){if(t.from.lineo&&(t={from:t.from,to:I(o,_(e,o).text.length),text:[t.text[0]],origin:t.origin}),t.removed=E(e,t.from,t.to),r||(r=Bn(e,t)),e.cm?Pi(e.cm,t,n):jn(e,t,n),ki(e,r,Ba)}}function Pi(e,t,r){var n=e.doc,i=e.display,o=t.from,a=t.to,s=!1,l=o.line;e.options.lineWrapping||(l=N(de(_(n,o.line))),n.iter(l,a.line+1,function(e){if(e==i.maxLine)return s=!0,!0})),n.sel.contains(t.from,t.to)>-1&&Ee(e),jn(n,t,r,wr(e)),e.options.lineWrapping||(n.iter(l,o.line+t.text.length,function(e){var t=be(e);t>i.maxLineLength&&(i.maxLine=e,i.maxLineLength=t,i.maxLineChanged=!0,s=!1)}),s&&(e.curOp.updateMaxLine=!0)),nt(n,o.line),xn(e,400);var u=t.text.length-(a.line-o.line)-1;t.full?gn(e):o.line!=a.line||1!=t.text.length||qn(e.doc,t)?gn(e,o.line,a.line+1,u):vn(e,o.line,"text");var c=Me(e,"changes"),d=Me(e,"change");if(d||c){var h={from:o,to:a,text:t.text,removed:t.removed,origin:t.origin};d&&bt(e,"change",e,h),c&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(h)}e.display.selForContextMenu=null}function Ii(e,t,r,n,i){if(n||(n=r),D(n,r)<0){var o;r=(o=[n,r])[0],n=o[1]}"string"==typeof t&&(t=e.splitLines(t)),Mi(e,{from:r,to:n,text:t,origin:i})}function Di(e,t,r,n){r0||0==s&&!1!==a.clearWhenEmpty)return a;if(a.replacedWith&&(a.collapsed=!0,a.widgetNode=i("span",[a.replacedWith],"CodeMirror-widget"),n.handleMouseEvents||a.widgetNode.setAttribute("cm-ignore-events","true"),n.insertLeft&&(a.widgetNode.insertLeft=!0)),a.collapsed){if(ce(e,t.line,t,r,a)||t.line!=r.line&&ce(e,r.line,t,r,a))throw new Error("Inserting collapsed marker partially overlapping an existing one");$()}a.addToHistory&&ni(e,{from:t,to:r,origin:"markText"},e.sel,NaN);var l,u=t.line,d=e.cm;if(e.iter(u,r.line+1,function(e){d&&a.collapsed&&!d.options.lineWrapping&&de(e)==d.display.maxLine&&(l=!0),a.collapsed&&u!=t.line&&A(e,0),X(e,new q(a,u==t.line?t.ch:null,u==r.line?r.ch:null)),++u}),a.collapsed&&e.iter(t.line,r.line+1,function(t){ge(e,t)&&A(t,0)}),a.clearOnEnter&&Ja(a,"beforeCursorEnter",function(){return a.clear()}),a.readOnly&&(G(),(e.history.done.length||e.history.undone.length)&&e.clearHistory()),a.collapsed&&(a.id=++Ms,a.atomic=!0),d){if(l&&(d.curOp.updateMaxLine=!0),a.collapsed)gn(d,t.line,r.line+1);else if(a.className||a.title||a.startStyle||a.endStyle||a.css)for(var h=t.line;h<=r.line;h++)vn(d,h,"text");a.atomic&&xi(d.doc),bt(d,"markerAdded",d,a)}return a}function Gi(e,t,r,n,i){(n=c(n)).shared=!1;var o=[Yi(e,t,r,n,i)],a=o[0],s=n.widgetNode;return Kn(e,function(e){s&&(n.widgetNode=s.cloneNode(!0)),o.push(Yi(e,B(e,t),B(e,r),n,i));for(var l=0;l-1)return t.state.draggingText(e),void setTimeout(function(){return t.display.input.focus()},20);try{var l=e.dataTransfer.getData("Text");if(l){var u;if(t.state.draggingText&&!t.state.draggingText.copy&&(u=t.listSelections()),ki(t.doc,Fn(r,r)),u)for(var c=0;c=0;t--)Ii(e.doc,"",n[t].from,n[t].to,"+delete");Gr(e)})}function ho(e,t,r){var n=S(e.text,t+r,r);return n<0||n>e.text.length?null:n}function fo(e,t,r){var n=ho(e,t.ch,r);return null==n?null:new I(t.line,n,r<0?"after":"before")}function po(e,t,r,n,i){if(e){var o=Te(r,t.doc.direction);if(o){var a,s=i<0?m(o):o[0],l=i<0==(1==s.level)?"after":"before";if(s.level>0||"rtl"==t.doc.direction){var u=$t(t,r);a=i<0?r.text.length-1:0;var c=qt(t,u,a).top;a=C(function(e){return qt(t,u,e).top==c},i<0==(1==s.level)?s.from:s.to-1,a),"before"==l&&(a=ho(r,a,1))}else a=i<0?s.to:s.from;return new I(n,a,l)}}return new I(n,i<0?r.text.length:0,i<0?"before":"after")}function mo(e,t,r,n){var i=Te(t,e.doc.direction);if(!i)return fo(t,r,n);r.ch>=t.text.length?(r.ch=t.text.length,r.sticky="before"):r.ch<=0&&(r.ch=0,r.sticky="after");var o=xe(i,r.ch,r.sticky),a=i[o];if("ltr"==e.doc.direction&&a.level%2==0&&(n>0?a.to>r.ch:a.from=a.from&&h>=c.begin)){var f=d?"before":"after";return new I(r.line,h,f)}}var p=function(e,t,n){for(var o=function(e,t){return t?new I(r.line,l(e,1),"before"):new I(r.line,e,"after")};e>=0&&e0==(1!=a.level),u=s?n.begin:l(n.end,-1);if(a.from<=u&&u0?c.end:l(c.begin,-1);return null==g||n>0&&g==t.text.length||!(m=p(n>0?0:i.length-1,n,u(g)))?null:m}function go(e,t){var r=_(e.doc,t),n=de(r);return n!=r&&(t=N(n)),po(!0,e,n,t,1)}function vo(e,t){var r=_(e.doc,t),n=he(r);return n!=r&&(t=N(n)),po(!0,e,r,t,-1)}function yo(e,t){var r=go(e,t.line),n=_(e.doc,r.line),i=Te(n,e.doc.direction);if(!i||0==i[0].level){var o=Math.max(0,n.text.search(/\S/)),a=t.line==r.line&&t.ch<=o&&t.ch;return I(r.line,a?0:o,r.sticky)}return r}function bo(e,t,r){if("string"==typeof t&&!(t=Us[t]))return!1;e.display.input.ensurePolled();var n=e.display.shift,i=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),r&&(e.display.shift=!1),i=t(e)!=Ua}finally{e.display.shift=n,e.state.suppressEdits=!1}return i}function ko(e,t,r){for(var n=0;n-1&&(D((i=s.ranges[i]).from(),t)<0||t.xRel>0)&&(D(i.to(),t)>0||t.xRel<0)?Po(e,n,t,o):Do(e,n,t,o)}function Po(e,t,r,n){var i=e.display,o=!1,a=fn(e,function(t){ya&&(i.scroller.draggable=!1),e.state.draggingText=!1,Ce(document,"mouseup",a),Ce(document,"mousemove",s),Ce(i.scroller,"dragstart",l),Ce(i.scroller,"drop",a),o||(Ne(t),n.addNew||fi(e.doc,r,null,null,n.extend),ya||ga&&9==va?setTimeout(function(){document.body.focus(),i.input.focus()},20):i.input.focus())}),s=function(e){o=o||Math.abs(t.clientX-e.clientX)+Math.abs(t.clientY-e.clientY)>=10},l=function(){return o=!0};ya&&(i.scroller.draggable=!0),e.state.draggingText=a,a.copy=!n.moveOnDrag,i.scroller.dragDrop&&i.scroller.dragDrop(),Ja(document,"mouseup",a),Ja(document,"mousemove",s),Ja(i.scroller,"dragstart",l),Ja(i.scroller,"drop",a),Or(e),setTimeout(function(){return i.input.focus()},20)}function Io(e,t,r){if("char"==r)return new _s(t,t);if("word"==r)return e.findWordAt(t);if("line"==r)return new _s(I(t.line,0),B(e.doc,I(t.line+1,0)));var n=r(e,t);return new _s(n.from,n.to)}function Do(e,t,r,n){function i(t){if(0!=D(v,t))if(v=t,"rectangle"==n.unit){for(var i=[],o=e.options.tabSize,a=d(_(u,r.line).text,r.ch,o),s=d(_(u,t.line).text,t.ch,o),l=Math.min(a,s),m=Math.max(a,s),g=Math.min(r.line,t.line),y=Math.min(e.lastLine(),Math.max(r.line,t.line));g<=y;g++){var b=_(u,g).text,k=f(b,l,o);l==m?i.push(new _s(I(g,k),I(g,k))):b.length>k&&i.push(new _s(I(g,k),I(g,f(b,m,o))))}i.length||i.push(new _s(r,r)),bi(u,Wn(p.ranges.slice(0,h).concat(i),h),{origin:"*mouse",scroll:!1}),e.scrollIntoView(t)}else{var w,x=c,T=Io(e,t,n.unit),S=x.anchor;D(T.anchor,S)>0?(w=T.head,S=H(x.from(),T.anchor)):(w=T.anchor,S=F(x.to(),T.head));var C=p.ranges.slice(0);C[h]=zo(e,new _s(B(u,S),w)),bi(u,Wn(C,h),Va)}}function o(t){var r=++b,s=Tr(e,t,!0,"rectangle"==n.unit);if(s)if(0!=D(s,v)){e.curOp.focus=a(),i(s);var c=zr(l,u);(s.line>=c.to||s.liney.bottom?20:0;d&&setTimeout(fn(e,function(){b==r&&(l.scroller.scrollTop+=d,o(t))}),50)}}function s(t){e.state.selectingText=!1,b=1/0,Ne(t),l.input.focus(),Ce(document,"mousemove",k),Ce(document,"mouseup",w),u.history.lastSelOrigin=null}var l=e.display,u=e.doc;Ne(t);var c,h,p=u.sel,m=p.ranges;if(n.addNew&&!n.extend?(h=u.sel.contains(r),c=h>-1?m[h]:new _s(r,r)):(c=u.sel.primary(),h=u.sel.primIndex),"rectangle"==n.unit)n.addNew||(c=new _s(r,r)),r=Tr(e,t,!0,!0),h=-1;else{var g=Io(e,r,n.unit);c=n.extend?hi(c,g.anchor,g.head,n.extend):g}n.addNew?-1==h?(h=m.length,bi(u,Wn(m.concat([c]),h),{scroll:!1,origin:"*mouse"})):m.length>1&&m[h].empty()&&"char"==n.unit&&!n.extend?(bi(u,Wn(m.slice(0,h).concat(m.slice(h+1)),0),{scroll:!1,origin:"*mouse"}),p=u.sel):mi(u,h,c,Va):(h=0,bi(u,new Ls([c],0),Va),p=u.sel);var v=r,y=l.wrapper.getBoundingClientRect(),b=0,k=fn(e,function(e){De(e)?o(e):s(e)}),w=fn(e,s);e.state.selectingText=w,Ja(document,"mousemove",k),Ja(document,"mouseup",w)}function zo(e,t){var r=t.anchor,n=t.head,i=_(e.doc,r.line);if(0==D(r,n)&&r.sticky==n.sticky)return t;var o=Te(i);if(!o)return t;var a=xe(o,r.ch,r.sticky),s=o[a];if(s.from!=r.ch&&s.to!=r.ch)return t;var l=a+(s.from==r.ch==(1!=s.level)?0:1);if(0==l||l==o.length)return t;var u;if(n.line!=r.line)u=(n.line-r.line)*("ltr"==e.doc.direction?1:-1)>0;else{var c=xe(o,n.ch,n.sticky),d=c-a||(n.ch-r.ch)*(1==s.level?-1:1);u=c==l-1||c==l?d<0:d>0}var h=o[l+(u?-1:0)],f=u==(1==h.level),p=f?h.from:h.to,m=f?"after":"before";return r.ch==p&&r.sticky==m?t:new _s(new I(r.line,p,m),n)}function Wo(e,t,r,n){var i,o;if(t.touches)i=t.touches[0].clientX,o=t.touches[0].clientY;else try{i=t.clientX,o=t.clientY}catch(t){return!1}if(i>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;n&&Ne(t);var a=e.display,s=a.lineDiv.getBoundingClientRect();if(o>s.bottom||!Me(e,r))return Re(t);o-=s.top-a.viewOffset;for(var l=0;l=i)return Le(e,r,e,O(e.doc,o),e.options.gutters[l],t),Re(t)}}function Fo(e,t){return Wo(e,t,"gutterClick",!0)}function Ho(e,t){Pt(e.display,t)||Uo(e,t)||_e(e,t,"contextmenu")||e.display.input.onContextMenu(t)}function Uo(e,t){return!!Me(e,"gutterContextMenu")&&Wo(e,t,"gutterContextMenu",!1)}function Bo(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),er(e)}function Vo(e){Rn(e),gn(e),Wr(e)}function Yo(e,t,r){if(!t!=!(r&&r!=qs)){var n=e.display.dragFunctions,i=t?Ja:Ce;i(e.display.scroller,"dragstart",n.start),i(e.display.scroller,"dragenter",n.enter),i(e.display.scroller,"dragover",n.over),i(e.display.scroller,"dragleave",n.leave),i(e.display.scroller,"drop",n.drop)}}function Go(e){e.options.lineWrapping?(s(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(Ia(e.display.wrapper,"CodeMirror-wrap"),ke(e)),xr(e),gn(e),er(e),setTimeout(function(){return en(e)},100)}function $o(e,t){var r=this;if(!(this instanceof $o))return new $o(e,t);this.options=t=t?c(t):{},c(js,t,!1),Pn(t);var n=t.value;"string"==typeof n&&(n=new Rs(n,t.mode,null,t.lineSeparator,t.direction)),this.doc=n;var i=new $o.inputStyles[t.inputStyle](this),o=this.display=new L(e,n,i);o.wrapper.CodeMirror=this,Rn(this),Bo(this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),rn(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 za,keySeq:null,specialChars:null},t.autofocus&&!_a&&o.input.focus(),ga&&va<11&&setTimeout(function(){return r.display.input.reset(!0)},20),qo(this),eo(),nn(this),this.curOp.forceUpdate=!0,Xn(this,n),t.autofocus&&!_a||this.hasFocus()?setTimeout(u(Rr,this),20):Pr(this);for(var a in Ks)Ks.hasOwnProperty(a)&&Ks[a](r,t[a],qs);Fr(this),t.finishInit&&t.finishInit(this);for(var s=0;s400}var i=e.display;Ja(i.scroller,"mousedown",fn(e,Ao)),ga&&va<11?Ja(i.scroller,"dblclick",fn(e,function(t){if(!_e(e,t)){var r=Tr(e,t);if(r&&!Fo(e,t)&&!Pt(e.display,t)){Ne(t);var n=e.findWordAt(r);fi(e.doc,n.anchor,n.head)}}})):Ja(i.scroller,"dblclick",function(t){return _e(e,t)||Ne(t)}),Pa||Ja(i.scroller,"contextmenu",function(t){return Ho(e,t)});var o,a={end:0};Ja(i.scroller,"touchstart",function(t){if(!_e(e,t)&&!r(t)&&!Fo(e,t)){i.input.ensurePolled(),clearTimeout(o);var n=+new Date;i.activeTouch={start:n,moved:!1,prev:n-a.end<=300?a:null},1==t.touches.length&&(i.activeTouch.left=t.touches[0].pageX,i.activeTouch.top=t.touches[0].pageY)}}),Ja(i.scroller,"touchmove",function(){i.activeTouch&&(i.activeTouch.moved=!0)}),Ja(i.scroller,"touchend",function(r){var o=i.activeTouch;if(o&&!Pt(i,r)&&null!=o.left&&!o.moved&&new Date-o.start<300){var a,s=e.coordsChar(i.activeTouch,"page");a=!o.prev||n(o,o.prev)?new _s(s,s):!o.prev.prev||n(o,o.prev.prev)?e.findWordAt(s):new _s(I(s.line,0),B(e.doc,I(s.line+1,0))),e.setSelection(a.anchor,a.head),e.focus(),Ne(r)}t()}),Ja(i.scroller,"touchcancel",t),Ja(i.scroller,"scroll",function(){i.scroller.clientHeight&&(Xr(e,i.scroller.scrollTop),Zr(e,i.scroller.scrollLeft,!0),Le(e,"scroll",e))}),Ja(i.scroller,"mousewheel",function(t){return zn(e,t)}),Ja(i.scroller,"DOMMouseScroll",function(t){return zn(e,t)}),Ja(i.wrapper,"scroll",function(){return i.wrapper.scrollTop=i.wrapper.scrollLeft=0}),i.dragFunctions={enter:function(t){_e(e,t)||Pe(t)},over:function(t){_e(e,t)||(Qi(e,t),Pe(t))},start:function(t){return Xi(e,t)},drop:fn(e,Ki),leave:function(t){_e(e,t)||Zi(e)}};var s=i.input.getField();Ja(s,"keyup",function(t){return _o.call(e,t)}),Ja(s,"keydown",fn(e,Co)),Ja(s,"keypress",fn(e,Eo)),Ja(s,"focus",function(t){return Rr(e,t)}),Ja(s,"blur",function(t){return Pr(e,t)})}function jo(e,t,r,n){var i,o=e.doc;null==r&&(r="add"),"smart"==r&&(o.mode.indent?i=Ke(e,t).state:r="prev");var a=e.options.tabSize,s=_(o,t),l=d(s.text,null,a);s.stateAfter&&(s.stateAfter=null);var u,c=s.text.match(/^\s*/)[0];if(n||/\S/.test(s.text)){if("smart"==r&&((u=o.mode.indent(i,s.text.slice(c.length),s.text))==Ua||u>150)){if(!n)return;r="prev"}}else u=0,r="not";"prev"==r?u=t>o.first?d(_(o,t-1).text,null,a):0:"add"==r?u=l+e.options.indentUnit:"subtract"==r?u=l-e.options.indentUnit:"number"==typeof r&&(u=l+r),u=Math.max(0,u);var h="",f=0;if(e.options.indentWithTabs)for(var m=Math.floor(u/a);m;--m)f+=a,h+="\t";if(f1)if(Qs&&Qs.text.join("\n")==t){if(n.ranges.length%Qs.text.length==0){l=[];for(var u=0;u=0;d--){var h=n.ranges[d],f=h.from(),p=h.to();h.empty()&&(r&&r>0?f=I(f.line,f.ch-r):e.state.overwrite&&!a?p=I(p.line,Math.min(_(o,p.line).text.length,p.ch+m(s).length)):Qs&&Qs.lineWise&&Qs.text.join("\n")==t&&(f=p=I(f.line,0))),c=e.curOp.updateInput;var v={from:f,to:p,text:l?l[d%l.length]:s,origin:i||(a?"paste":e.state.cutIncoming?"cut":"+input")};Mi(e.doc,v),bt(e,"inputRead",e,v)}t&&!a&&Zo(e,t),Gr(e),e.curOp.updateInput=c,e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=!1}function Qo(e,t){var r=e.clipboardData&&e.clipboardData.getData("Text");if(r)return e.preventDefault(),t.isReadOnly()||t.options.disableInput||hn(t,function(){return Xo(t,r,0,null,"paste")}),!0}function Zo(e,t){if(e.options.electricChars&&e.options.smartIndent)for(var r=e.doc.sel,n=r.ranges.length-1;n>=0;n--){var i=r.ranges[n];if(!(i.head.ch>100||n&&r.ranges[n-1].head.line==i.head.line)){var o=e.getModeAt(i.head),a=!1;if(o.electricChars){for(var s=0;s-1){a=jo(e,i.head.line,"smart");break}}else o.electricInput&&o.electricInput.test(_(e.doc,i.head.line).text.slice(0,i.head.ch))&&(a=jo(e,i.head.line,"smart"));a&&bt(e,"electricInput",e,i.head.line)}}}function Jo(e){for(var t=[],r=[],n=0;n=e.first+e.size)&&(t=new I(n,t.ch,t.sticky),u=_(e,n))}function a(n){var a;if(null==(a=i?mo(e.cm,u,t,r):fo(u,t,r))){if(n||!o())return!1;t=po(i,e.cm,u,t.line,r)}else t=a;return!0}var s=t,l=r,u=_(e,t.line);if("char"==n)a();else if("column"==n)a(!0);else if("word"==n||"group"==n)for(var c=null,d="group"==n,h=e.cm&&e.cm.getHelper(t,"wordChars"),f=!0;!(r<0)||a(!f);f=!1){var p=u.text.charAt(t.ch)||"\n",m=w(p,h)?"w":d&&"\n"==p?"n":!d||/\s/.test(p)?null:"p";if(!d||f||m||(m="s"),c&&c!=m){r<0&&(r=1,a(),t.sticky="after");break}if(m&&(c=m),r>0&&!a(!f))break}var g=Ci(e,t,s,l,!0);return z(s,g)&&(g.hitSide=!0),g}function na(e,t,r,n){var i,o=e.doc,a=t.left;if("page"==n){var s=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),l=Math.max(s-.5*vr(e.display),3);i=(r>0?t.bottom:t.top)+r*l}else"line"==n&&(i=r>0?t.bottom+3:t.top-3);for(var u;(u=cr(e,a,i)).outside;){if(r<0?i<=0:i>=o.height){u.hitSide=!0;break}i+=5*r}return u}function ia(e,t){var r=Gt(e,t.line);if(!r||r.hidden)return null;var n=_(e.doc,t.line),i=Bt(r,n,t.line),o=Te(n,e.doc.direction),a="left";o&&(a=xe(o,t.ch)%2?"right":"left");var s=jt(i.map,t.ch,a);return s.offset="right"==s.collapse?s.end:s.start,s}function oa(e){for(var t=e;t;t=t.parentNode)if(/CodeMirror-gutter-wrapper/.test(t.className))return!0;return!1}function aa(e,t){return t&&(e.bad=!0),e}function sa(e,t,r,n,i){function o(e){return function(t){return t.id==e}}function a(){c&&(u+=d,c=!1)}function s(e){e&&(a(),u+=e)}function l(t){if(1==t.nodeType){var r=t.getAttribute("cm-text");if(null!=r)return void s(r||t.textContent.replace(/\u200b/g,""));var u,h=t.getAttribute("cm-marker");if(h){var f=e.findMarks(I(n,0),I(i+1,0),o(+h));return void(f.length&&(u=f[0].find(0))&&s(E(e.doc,u.from,u.to).join(d)))}if("false"==t.getAttribute("contenteditable"))return;var p=/^(pre|div|p)$/i.test(t.nodeName);p&&a();for(var m=0;m=15&&(wa=!1,ya=!0);var Oa,Ra=Ea&&(ba||wa&&(null==Na||Na<12.11)),Pa=ha||ga&&va>=9,Ia=function(t,r){var n=t.className,i=e(r).exec(n);if(i){var o=n.slice(i.index+i[0].length);t.className=n.slice(0,i.index)+(o?i[1]+o:"")}};Oa=document.createRange?function(e,t,r,n){var i=document.createRange();return i.setEnd(n||e,r),i.setStart(e,t),i}:function(e,t,r){var n=document.body.createTextRange();try{n.moveToElementText(e.parentNode)}catch(e){return n}return n.collapse(!0),n.moveEnd("character",r),n.moveStart("character",t),n};var Da=function(e){e.select()};Ca?Da=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:ga&&(Da=function(e){try{e.select()}catch(e){}});var za=function(){this.id=null};za.prototype.set=function(e,t){clearTimeout(this.id),this.id=setTimeout(t,e)};var Wa,Fa,Ha=30,Ua={toString:function(){return"CodeMirror.Pass"}},Ba={scroll:!1},Va={origin:"*mouse"},Ya={origin:"+move"},Ga=[""],$a=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/,qa=/[\u0300-\u036f\u0483-\u0489\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u065e\u0670\u06d6-\u06dc\u06de-\u06e4\u06e7\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0900-\u0902\u093c\u0941-\u0948\u094d\u0951-\u0955\u0962\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2\u09e3\u0a01\u0a02\u0a3c\u0a41\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a70\u0a71\u0a75\u0a81\u0a82\u0abc\u0ac1-\u0ac5\u0ac7\u0ac8\u0acd\u0ae2\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0d3e\u0d41-\u0d44\u0d4d\u0d57\u0d62\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0f18\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86\u0f87\u0f90-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039\u103a\u103d\u103e\u1058\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085\u1086\u108d\u109d\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193b\u1a17\u1a18\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80\u1b81\u1ba2-\u1ba5\u1ba8\u1ba9\u1c2c-\u1c33\u1c36\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1dc0-\u1de6\u1dfd-\u1dff\u200c\u200d\u20d0-\u20f0\u2cef-\u2cf1\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua66f-\ua672\ua67c\ua67d\ua6f0\ua6f1\ua802\ua806\ua80b\ua825\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\uaa29-\uaa2e\uaa31\uaa32\uaa35\uaa36\uaa43\uaa4c\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uabe5\uabe8\uabed\udc00-\udfff\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\uff9e\uff9f]/,ja=!1,Ka=!1,Xa=null,Qa=function(){function e(e){return e<=247?r.charAt(e):1424<=e&&e<=1524?"R":1536<=e&&e<=1785?n.charAt(e-1536):1774<=e&&e<=2220?"r":8192<=e&&e<=8203?"w":8204==e?"b":"L"}function t(e,t,r){this.level=e,this.from=t,this.to=r}var r="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",n="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111",i=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,o=/[stwN]/,a=/[LRr]/,s=/[Lb1n]/,l=/[1n]/;return function(r,n){var u="ltr"==n?"L":"R";if(0==r.length||"ltr"==n&&!i.test(r))return!1;for(var c=r.length,d=[],h=0;h=this.string.length},ls.prototype.sol=function(){return this.pos==this.lineStart},ls.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},ls.prototype.next=function(){if(this.post},ls.prototype.eatSpace=function(){for(var e=this,t=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++e.pos;return this.pos>t},ls.prototype.skipToEnd=function(){this.pos=this.string.length},ls.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},ls.prototype.backUp=function(e){this.pos-=e},ls.prototype.column=function(){return this.lastColumnPos0?null:(n&&!1!==t&&(this.pos+=n[0].length),n)}var i=function(e){return r?e.toLowerCase():e};if(i(this.string.substr(this.pos,e.length))==i(e))return!1!==t&&(this.pos+=e.length),!0},ls.prototype.current=function(){return this.string.slice(this.start,this.pos)},ls.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},ls.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},ls.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};var us=function(e,t){this.state=e,this.lookAhead=t},cs=function(e,t,r,n){this.state=t,this.doc=e,this.line=r,this.maxLookAhead=n||0,this.baseTokens=null,this.baseTokenPos=1};cs.prototype.lookAhead=function(e){var t=this.doc.getLine(this.line+e);return null!=t&&e>this.maxLookAhead&&(this.maxLookAhead=e),t},cs.prototype.baseToken=function(e){var t=this;if(!this.baseTokens)return null;for(;this.baseTokens[this.baseTokenPos]<=e;)t.baseTokenPos+=2;var r=this.baseTokens[this.baseTokenPos+1];return{type:r&&r.replace(/( |^)overlay .*/,""),size:this.baseTokens[this.baseTokenPos]-e}},cs.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},cs.fromSaved=function(e,t,r){return t instanceof us?new cs(e,Ye(e.mode,t.state),r,t.lookAhead):new cs(e,Ye(e.mode,t),r)},cs.prototype.save=function(e){var t=!1!==e?Ye(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new us(t,this.maxLookAhead):t};var ds=function(e,t,r){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=t||null,this.state=r},hs=function(e,t,r){this.text=e,ne(this,t),this.height=r?r(this):1};hs.prototype.lineNo=function(){return N(this)},Ae(hs);var fs,ps={},ms={},gs=null,vs=null,ys={left:0,right:0,top:0,bottom:0},bs=function(e,t,r){this.cm=r;var i=this.vert=n("div",[n("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),o=this.horiz=n("div",[n("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");e(i),e(o),Ja(i,"scroll",function(){i.clientHeight&&t(i.scrollTop,"vertical")}),Ja(o,"scroll",function(){o.clientWidth&&t(o.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,ga&&va<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};bs.prototype.update=function(e){var t=e.scrollWidth>e.clientWidth+1,r=e.scrollHeight>e.clientHeight+1,n=e.nativeBarWidth;if(r){this.vert.style.display="block",this.vert.style.bottom=t?n+"px":"0";var i=e.viewHeight-(t?n:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+i)+"px"}else this.vert.style.display="",this.vert.firstChild.style.height="0";if(t){this.horiz.style.display="block",this.horiz.style.right=r?n+"px":"0",this.horiz.style.left=e.barLeft+"px";var o=e.viewWidth-e.barLeft-(r?n:0);this.horiz.firstChild.style.width=Math.max(0,e.scrollWidth-e.clientWidth+o)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&e.clientHeight>0&&(0==n&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:r?n:0,bottom:t?n:0}},bs.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},bs.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},bs.prototype.zeroWidthHack=function(){var e=Ea&&!Ta?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new za,this.disableVert=new za},bs.prototype.enableZeroWidthBar=function(e,t,r){function n(){var i=e.getBoundingClientRect();("vert"==r?document.elementFromPoint(i.right-1,(i.top+i.bottom)/2):document.elementFromPoint((i.right+i.left)/2,i.bottom-1))!=e?e.style.pointerEvents="none":t.set(1e3,n)}e.style.pointerEvents="auto",t.set(1e3,n)},bs.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var ks=function(){};ks.prototype.update=function(){return{bottom:0,right:0}},ks.prototype.setScrollLeft=function(){},ks.prototype.setScrollTop=function(){},ks.prototype.clear=function(){};var ws={native:bs,null:ks},xs=0,Ts=function(e,t,r){var n=e.display;this.viewport=t,this.visible=zr(n,e.doc,t),this.editorIsHidden=!n.wrapper.offsetWidth,this.wrapperHeight=n.wrapper.clientHeight,this.wrapperWidth=n.wrapper.clientWidth,this.oldDisplayWidth=Ft(e),this.force=r,this.dims=br(e),this.events=[]};Ts.prototype.signal=function(e,t){Me(e,t)&&this.events.push(arguments)},Ts.prototype.finish=function(){for(var e=this,t=0;t=0&&D(e,i.to())<=0)return n}return-1};var _s=function(e,t){this.anchor=e,this.head=t};_s.prototype.from=function(){return H(this.anchor,this.head)},_s.prototype.to=function(){return F(this.anchor,this.head)},_s.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch},Hi.prototype={chunkSize:function(){return this.lines.length},removeInner:function(e,t){for(var r=this,n=e,i=e+t;n1||!(this.children[0]instanceof Hi))){var l=[];this.collapse(l),this.children=[new Hi(l)],this.children[0].parent=this}},collapse:function(e){for(var t=this,r=0;r50){for(var s=o.lines.length%25+25,l=s;l10);e.parent.maybeSpill()}},iterN:function(e,t,r){for(var n=this,i=0;it.display.maxLineLength&&(t.display.maxLine=c,t.display.maxLineLength=d,t.display.maxLineChanged=!0)}null!=i&&t&&this.collapsed&&gn(t,i,o+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,t&&xi(t.doc)),t&&bt(t,"markerCleared",t,this,i,o),r&&on(t),this.parent&&this.parent.clear()}},As.prototype.find=function(e,t){var r=this;null==e&&"bookmark"==this.type&&(e=1);for(var n,i,o=0;o=0;u--)Mi(n,i[u]);l?yi(this,l):this.cm&&Gr(this.cm)}),undo:mn(function(){Ni(this,"undo")}),redo:mn(function(){Ni(this,"redo")}),undoSelection:mn(function(){Ni(this,"undo",!0)}),redoSelection:mn(function(){Ni(this,"redo",!0)}),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,t=0,r=0,n=0;n=e.ch)&&t.push(i.marker.parent||i.marker)}return t},findMarks:function(e,t,r){e=B(this,e),t=B(this,t);var n=[],i=e.line;return this.iter(e.line,t.line+1,function(o){var a=o.markedSpans;if(a)for(var s=0;s=l.to||null==l.from&&i!=e.line||null!=l.from&&i==t.line&&l.from>=t.ch||r&&!r(l.marker)||n.push(l.marker.parent||l.marker)}++i}),n},getAllMarks:function(){var e=[];return this.iter(function(t){var r=t.markedSpans;if(r)for(var n=0;ne)return t=e,!0;e-=o,++r}),B(this,I(r,t))},indexFromPos:function(e){var t=(e=B(this,e)).ch;if(e.linet&&(t=e.from),null!=e.to&&e.to0)i=new I(i.line,i.ch+1),e.replaceRange(o.charAt(i.ch-1)+o.charAt(i.ch-2),I(i.line,i.ch-2),i,"+transpose");else if(i.line>e.doc.first){var a=_(e.doc,i.line-1).text;a&&(i=new I(i.line,1),e.replaceRange(o.charAt(0)+e.doc.lineSeparator()+a.charAt(a.length-1),I(i.line-1,a.length-1),i,"+transpose"))}r.push(new _s(i,i))}e.setSelections(r)})},newlineAndIndent:function(e){return hn(e,function(){for(var t=e.listSelections(),r=t.length-1;r>=0;r--)e.replaceRange(e.doc.lineSeparator(),t[r].anchor,t[r].head,"+input");t=e.listSelections();for(var n=0;ne&&0==D(t,this.pos)&&r==this.button};var Gs,$s,qs={toString:function(){return"CodeMirror.Init"}},js={},Ks={};$o.defaults=js,$o.optionHandlers=Ks;var Xs=[];$o.defineInitHook=function(e){return Xs.push(e)};var Qs=null,Zs=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new za,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};Zs.prototype.init=function(e){function t(e){if(!_e(i,e)){if(i.somethingSelected())Ko({lineWise:!1,text:i.getSelections()}),"cut"==e.type&&i.replaceSelection("",null,"cut");else{if(!i.options.lineWiseCopyCut)return;var t=Jo(i);Ko({lineWise:!0,text:t.text}),"cut"==e.type&&i.operation(function(){i.setSelections(t.ranges,0,Ba),i.replaceSelection("",null,"cut")})}if(e.clipboardData){e.clipboardData.clearData();var r=Qs.text.join("\n");if(e.clipboardData.setData("Text",r),e.clipboardData.getData("Text")==r)return void e.preventDefault()}var a=ta(),s=a.firstChild;i.display.lineSpace.insertBefore(a,i.display.lineSpace.firstChild),s.value=Qs.text.join("\n");var l=document.activeElement;Da(s),setTimeout(function(){i.display.lineSpace.removeChild(a),l.focus(),l==o&&n.showPrimarySelection()},50)}}var r=this,n=this,i=n.cm,o=n.div=e.lineDiv;ea(o,i.options.spellcheck),Ja(o,"paste",function(e){_e(i,e)||Qo(e,i)||va<=11&&setTimeout(fn(i,function(){return r.updateFromDOM()}),20)}),Ja(o,"compositionstart",function(e){r.composing={data:e.data,done:!1}}),Ja(o,"compositionupdate",function(e){r.composing||(r.composing={data:e.data,done:!1})}),Ja(o,"compositionend",function(e){r.composing&&(e.data!=r.composing.data&&r.readFromDOMSoon(),r.composing.done=!0)}),Ja(o,"touchstart",function(){return n.forceCompositionEnd()}),Ja(o,"input",function(){r.composing||r.readFromDOMSoon()}),Ja(o,"copy",t),Ja(o,"cut",t)},Zs.prototype.prepareSelection=function(){var e=Lr(this.cm,!1);return e.focus=this.cm.state.focused,e},Zs.prototype.showSelection=function(e,t){e&&this.cm.display.view.length&&((e.focus||t)&&this.showPrimarySelection(),this.showMultipleSelections(e))},Zs.prototype.showPrimarySelection=function(){var e=window.getSelection(),t=this.cm,r=t.doc.sel.primary(),n=r.from(),i=r.to();if(t.display.viewTo==t.display.viewFrom||n.line>=t.display.viewTo||i.line=t.display.viewFrom&&ia(t,n)||{node:s[0].measure.map[2],offset:0},u=i.linee.firstLine()&&(n=I(n.line-1,_(e.doc,n.line-1).length)),i.ch==_(e.doc,i.line).text.length&&i.linet.viewTo-1)return!1;var o,a,s;n.line==t.viewFrom||0==(o=Sr(e,n.line))?(a=N(t.view[0].line),s=t.view[0].node):(a=N(t.view[o].line),s=t.view[o-1].node.nextSibling);var l,u,c=Sr(e,i.line);if(c==t.view.length-1?(l=t.viewTo-1,u=t.lineDiv.lastChild):(l=N(t.view[c+1].line)-1,u=t.view[c+1].node.previousSibling),!s)return!1;for(var d=e.doc.splitLines(sa(e,s,u,a,l)),h=E(e.doc,I(a,0),I(l,_(e.doc,l).text.length));d.length>1&&h.length>1;)if(m(d)==m(h))d.pop(),h.pop(),l--;else{if(d[0]!=h[0])break;d.shift(),h.shift(),a++}for(var f=0,p=0,g=d[0],v=h[0],y=Math.min(g.length,v.length);fn.ch&&b.charCodeAt(b.length-p-1)==k.charCodeAt(k.length-p-1);)f--,p++;d[d.length-1]=b.slice(0,b.length-p).replace(/^\u200b+/,""),d[0]=d[0].slice(f).replace(/\u200b+$/,"");var x=I(a,f),T=I(l,h.length?m(h).length-p:0);return d.length>1||d[0]||D(x,T)?(Ii(e.doc,d,x,T,"+input"),!0):void 0},Zs.prototype.ensurePolled=function(){this.forceCompositionEnd()},Zs.prototype.reset=function(){this.forceCompositionEnd()},Zs.prototype.forceCompositionEnd=function(){this.composing&&(clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus())},Zs.prototype.readFromDOMSoon=function(){var e=this;null==this.readDOMTimeout&&(this.readDOMTimeout=setTimeout(function(){if(e.readDOMTimeout=null,e.composing){if(!e.composing.done)return;e.composing=null}e.updateFromDOM()},80))},Zs.prototype.updateFromDOM=function(){var e=this;!this.cm.isReadOnly()&&this.pollContent()||hn(this.cm,function(){return gn(e.cm)})},Zs.prototype.setUneditable=function(e){e.contentEditable="false"},Zs.prototype.onKeyPress=function(e){0!=e.charCode&&(e.preventDefault(),this.cm.isReadOnly()||fn(this.cm,Xo)(this.cm,String.fromCharCode(null==e.charCode?e.keyCode:e.charCode),0))},Zs.prototype.readOnlyChanged=function(e){this.div.contentEditable=String("nocursor"!=e)},Zs.prototype.onContextMenu=function(){},Zs.prototype.resetPosition=function(){},Zs.prototype.needsContentAttribute=!0;var Js=function(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new za,this.hasSelection=!1,this.composing=null};Js.prototype.init=function(e){function t(e){if(!_e(i,e)){if(i.somethingSelected())Ko({lineWise:!1,text:i.getSelections()});else{if(!i.options.lineWiseCopyCut)return;var t=Jo(i);Ko({lineWise:!0,text:t.text}),"cut"==e.type?i.setSelections(t.ranges,null,Ba):(n.prevInput="",a.value=t.text.join("\n"),Da(a))}"cut"==e.type&&(i.state.cutIncoming=!0)}}var r=this,n=this,i=this.cm,o=this.wrapper=ta(),a=this.textarea=o.firstChild;e.wrapper.insertBefore(o,e.wrapper.firstChild),Ca&&(a.style.width="0px"),Ja(a,"input",function(){ga&&va>=9&&r.hasSelection&&(r.hasSelection=null),n.poll()}),Ja(a,"paste",function(e){_e(i,e)||Qo(e,i)||(i.state.pasteIncoming=!0,n.fastPoll())}),Ja(a,"cut",t),Ja(a,"copy",t),Ja(e.scroller,"paste",function(t){Pt(e,t)||_e(i,t)||(i.state.pasteIncoming=!0,n.focus())}),Ja(e.lineSpace,"selectstart",function(t){Pt(e,t)||Ne(t)}),Ja(a,"compositionstart",function(){var e=i.getCursor("from");n.composing&&n.composing.range.clear(),n.composing={start:e,range:i.markText(e,i.getCursor("to"),{className:"CodeMirror-composing"})}}),Ja(a,"compositionend",function(){n.composing&&(n.poll(),n.composing.range.clear(),n.composing=null)})},Js.prototype.prepareSelection=function(){var e=this.cm,t=e.display,r=e.doc,n=Lr(e);if(e.options.moveInputWithCursor){var i=sr(e,r.sel.primary().head,"div"),o=t.wrapper.getBoundingClientRect(),a=t.lineDiv.getBoundingClientRect();n.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,i.top+a.top-o.top)),n.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,i.left+a.left-o.left))}return n},Js.prototype.showSelection=function(e){var t=this.cm.display;r(t.cursorDiv,e.cursors),r(t.selectionDiv,e.selection),null!=e.teTop&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},Js.prototype.reset=function(e){if(!this.contextMenuPending&&!this.composing){var t=this.cm;if(t.somethingSelected()){this.prevInput="";var r=t.getSelection();this.textarea.value=r,t.state.focused&&Da(this.textarea),ga&&va>=9&&(this.hasSelection=r)}else e||(this.prevInput=this.textarea.value="",ga&&va>=9&&(this.hasSelection=null))}},Js.prototype.getField=function(){return this.textarea},Js.prototype.supportsTouch=function(){return!1},Js.prototype.focus=function(){if("nocursor"!=this.cm.options.readOnly&&(!_a||a()!=this.textarea))try{this.textarea.focus()}catch(e){}},Js.prototype.blur=function(){this.textarea.blur()},Js.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},Js.prototype.receivedFocus=function(){this.slowPoll()},Js.prototype.slowPoll=function(){var e=this;this.pollingFast||this.polling.set(this.cm.options.pollInterval,function(){e.poll(),e.cm.state.focused&&e.slowPoll()})},Js.prototype.fastPoll=function(){function e(){r.poll()||t?(r.pollingFast=!1,r.slowPoll()):(t=!0,r.polling.set(60,e))}var t=!1,r=this;r.pollingFast=!0,r.polling.set(20,e)},Js.prototype.poll=function(){var e=this,t=this.cm,r=this.textarea,n=this.prevInput;if(this.contextMenuPending||!t.state.focused||rs(r)&&!n&&!this.composing||t.isReadOnly()||t.options.disableInput||t.state.keySeq)return!1;var i=r.value;if(i==n&&!t.somethingSelected())return!1;if(ga&&va>=9&&this.hasSelection===i||Ea&&/[\uf700-\uf7ff]/.test(i))return t.display.input.reset(),!1;if(t.doc.sel==t.display.selForContextMenu){var o=i.charCodeAt(0);if(8203!=o||n||(n="​"),8666==o)return this.reset(),this.cm.execCommand("undo")}for(var a=0,s=Math.min(n.length,i.length);a1e3||i.indexOf("\n")>-1?r.value=e.prevInput="":e.prevInput=i,e.composing&&(e.composing.range.clear(),e.composing.range=t.markText(e.composing.start,t.getCursor("to"),{className:"CodeMirror-composing"}))}),!0},Js.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},Js.prototype.onKeyPress=function(){ga&&va>=9&&(this.hasSelection=null),this.fastPoll()},Js.prototype.onContextMenu=function(e){function t(){if(null!=a.selectionStart){var e=i.somethingSelected(),t="​"+(e?a.value:"");a.value="⇚",a.value=t,n.prevInput=e?"":"​",a.selectionStart=1,a.selectionEnd=t.length,o.selForContextMenu=i.doc.sel}}function r(){if(n.contextMenuPending=!1,n.wrapper.style.cssText=c,a.style.cssText=u,ga&&va<9&&o.scrollbars.setScrollTop(o.scroller.scrollTop=l),null!=a.selectionStart){(!ga||ga&&va<9)&&t();var e=0,r=function(){o.selForContextMenu==i.doc.sel&&0==a.selectionStart&&a.selectionEnd>0&&"​"==n.prevInput?fn(i,_i)(i):e++<10?o.detectingSelectAll=setTimeout(r,500):(o.selForContextMenu=null,o.input.reset())};o.detectingSelectAll=setTimeout(r,200)}}var n=this,i=n.cm,o=i.display,a=n.textarea,s=Tr(i,e),l=o.scroller.scrollTop;if(s&&!wa){i.options.resetSelectionOnContextMenu&&-1==i.doc.sel.contains(s)&&fn(i,bi)(i.doc,Fn(s),Ba);var u=a.style.cssText,c=n.wrapper.style.cssText;n.wrapper.style.cssText="position: absolute";var d=n.wrapper.getBoundingClientRect();a.style.cssText="position: absolute; width: 30px; height: 30px;\n top: "+(e.clientY-d.top-5)+"px; left: "+(e.clientX-d.left-5)+"px;\n z-index: 1000; background: "+(ga?"rgba(255, 255, 255, .05)":"transparent")+";\n outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);";var h;if(ya&&(h=window.scrollY),o.input.focus(),ya&&window.scrollTo(null,h),o.input.reset(),i.somethingSelected()||(a.value=n.prevInput=" "),n.contextMenuPending=!0,o.selForContextMenu=i.doc.sel,clearTimeout(o.detectingSelectAll),ga&&va>=9&&t(),Pa){Pe(e);var f=function(){Ce(window,"mouseup",f),setTimeout(r,20)};Ja(window,"mouseup",f)}else setTimeout(r,50)}},Js.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled="nocursor"==e},Js.prototype.setUneditable=function(){},Js.prototype.needsContentAttribute=!1,function(e){function t(t,n,i,o){e.defaults[t]=n,i&&(r[t]=o?function(e,t,r){r!=qs&&i(e,t,r)}:i)}var r=e.optionHandlers;e.defineOption=t,e.Init=qs,t("value","",function(e,t){return e.setValue(t)},!0),t("mode",null,function(e,t){e.doc.modeOption=t,Gn(e)},!0),t("indentUnit",2,Gn,!0),t("indentWithTabs",!1),t("smartIndent",!0),t("tabSize",4,function(e){$n(e),er(e),gn(e)},!0),t("lineSeparator",null,function(e,t){if(e.doc.lineSep=t,t){var r=[],n=e.doc.first;e.doc.iter(function(e){for(var i=0;;){var o=e.text.indexOf(t,i);if(-1==o)break;i=o+t.length,r.push(I(n,o))}n++});for(var i=r.length-1;i>=0;i--)Ii(e.doc,t,r[i],I(r[i].line,r[i].ch+t.length))}}),t("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b-\u200f\u2028\u2029\ufeff]/g,function(e,t,r){e.state.specialChars=new RegExp(t.source+(t.test("\t")?"":"|\t"),"g"),r!=qs&&e.refresh()}),t("specialCharPlaceholder",lt,function(e){return e.refresh()},!0),t("electricChars",!0),t("inputStyle",_a?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),t("spellcheck",!1,function(e,t){return e.getInputField().spellcheck=t},!0),t("rtlMoveVisually",!Aa),t("wholeLineUpdateBefore",!0),t("theme","default",function(e){Bo(e),Vo(e)},!0),t("keyMap","default",function(e,t,r){var n=uo(t),i=r!=qs&&uo(r);i&&i.detach&&i.detach(e,n),n.attach&&n.attach(e,i||null)}),t("extraKeys",null),t("configureMouse",null),t("lineWrapping",!1,Go,!0),t("gutters",[],function(e){Pn(e.options),Vo(e)},!0),t("fixedGutter",!0,function(e,t){e.display.gutters.style.left=t?kr(e.display)+"px":"0",e.refresh()},!0),t("coverGutterNextToScrollbar",!1,function(e){return en(e)},!0),t("scrollbarStyle","native",function(e){rn(e),en(e),e.display.scrollbars.setScrollTop(e.doc.scrollTop),e.display.scrollbars.setScrollLeft(e.doc.scrollLeft)},!0),t("lineNumbers",!1,function(e){Pn(e.options),Vo(e)},!0),t("firstLineNumber",1,Vo,!0),t("lineNumberFormatter",function(e){return e},Vo,!0),t("showCursorWhenSelecting",!1,Cr,!0),t("resetSelectionOnContextMenu",!0),t("lineWiseCopyCut",!0),t("pasteLinesPerSelection",!0),t("readOnly",!1,function(e,t){"nocursor"==t&&(Pr(e),e.display.input.blur()),e.display.input.readOnlyChanged(t)}),t("disableInput",!1,function(e,t){t||e.display.input.reset()},!0),t("dragDrop",!0,Yo),t("allowDropFileTypes",null),t("cursorBlinkRate",530),t("cursorScrollMargin",0),t("cursorHeight",1,Cr,!0),t("singleCursorHeightPerLine",!0,Cr,!0),t("workTime",100),t("workDelay",100),t("flattenSpans",!0,$n,!0),t("addModeClass",!1,$n,!0),t("pollInterval",100),t("undoDepth",200,function(e,t){return e.doc.history.undoDepth=t}),t("historyEventDelay",1250),t("viewportMargin",10,function(e){return e.refresh()},!0),t("maxHighlightLength",1e4,$n,!0),t("moveInputWithCursor",!0,function(e,t){t||e.display.input.resetPosition()}),t("tabindex",null,function(e,t){return e.display.input.getField().tabIndex=t||""}),t("autofocus",null),t("direction","ltr",function(e,t){return e.doc.setDirection(t)},!0)}($o),function(e){var t=e.optionHandlers,r=e.helpers={};e.prototype={constructor:e,focus:function(){window.focus(),this.display.input.focus()},setOption:function(e,r){var n=this.options,i=n[e];n[e]==r&&"mode"!=e||(n[e]=r,t.hasOwnProperty(e)&&fn(this,t[e])(this,r,i),Le(this,"optionChange",this,e))},getOption:function(e){return this.options[e]},getDoc:function(){return this.doc},addKeyMap:function(e,t){this.state.keyMaps[t?"push":"unshift"](uo(e))},removeKeyMap:function(e){for(var t=this.state.keyMaps,r=0;rn&&(jo(t,o.head.line,e,!0),n=o.head.line,i==t.doc.sel.primIndex&&Gr(t));else{var a=o.from(),s=o.to(),l=Math.max(n,a.line);n=Math.min(t.lastLine(),s.line-(s.ch?0:1))+1;for(var u=l;u0&&mi(t.doc,i,new _s(a,c[i].to()),Ba)}}}),getTokenAt:function(e,t){return Je(this,e,t)},getLineTokens:function(e,t){return Je(this,I(e),t,!0)},getTokenTypeAt:function(e){e=B(this.doc,e);var t,r=je(this,_(this.doc,e.line)),n=0,i=(r.length-1)/2,o=e.ch;if(0==o)t=r[2];else for(;;){var a=n+i>>1;if((a?r[2*a-1]:0)>=o)i=a;else{if(!(r[2*a+1]o&&(e=o,i=!0),n=_(this.doc,e)}else n=e;return ir(this,n,{top:0,left:0},t||"page",r||i).top+(i?this.doc.height-ye(n):0)},defaultTextHeight:function(){return vr(this.display)},defaultCharWidth:function(){return yr(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(e,t,r,n,i){var o=this.display,a=(e=sr(this,B(this.doc,e))).bottom,s=e.left;if(t.style.position="absolute",t.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(t),o.sizer.appendChild(t),"over"==n)a=e.top;else if("above"==n||"near"==n){var l=Math.max(o.wrapper.clientHeight,this.doc.height),u=Math.max(o.sizer.clientWidth,o.lineSpace.clientWidth);("above"==n||e.bottom+t.offsetHeight>l)&&e.top>t.offsetHeight?a=e.top-t.offsetHeight:e.bottom+t.offsetHeight<=l&&(a=e.bottom),s+t.offsetWidth>u&&(s=u-t.offsetWidth)}t.style.top=a+"px",t.style.left=t.style.right="","right"==i?(s=o.sizer.clientWidth-t.offsetWidth,t.style.right="0px"):("left"==i?s=0:"middle"==i&&(s=(o.sizer.clientWidth-t.offsetWidth)/2),t.style.left=s+"px"),r&&Br(this,{left:s,top:a,right:s+t.offsetWidth,bottom:a+t.offsetHeight})},triggerOnKeyDown:pn(Co),triggerOnKeyPress:pn(Eo),triggerOnKeyUp:_o,triggerOnMouseDown:pn(Ao),execCommand:function(e){if(Us.hasOwnProperty(e))return Us[e].call(null,this)},triggerElectric:pn(function(e){Zo(this,e)}),findPosH:function(e,t,r,n){var i=this,o=1;t<0&&(o=-1,t=-t);for(var a=B(this.doc,e),s=0;s0&&a(t.charAt(r-1));)--r;for(;n.5)&&xr(this),Le(this,"refresh",this)}),swapDoc:pn(function(e){var t=this.doc;return t.cm=null,Xn(this,e),er(this),this.display.input.reset(),$r(this,e.scrollLeft,e.scrollTop),this.curOp.forceScroll=!0,bt(this,"swapDoc",this,t),t}),getInputField:function(){return this.display.input.getField()},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}},Ae(e),e.registerHelper=function(t,n,i){r.hasOwnProperty(t)||(r[t]=e[t]={_global:[]}),r[t][n]=i},e.registerGlobalHelper=function(t,n,i,o){e.registerHelper(t,n,o),r[t]._global.push({pred:i,val:o})}}($o);var el="iter insert remove copy getEditor constructor".split(" ");for(var tl in Rs.prototype)Rs.prototype.hasOwnProperty(tl)&&h(el,tl)<0&&($o.prototype[tl]=function(e){return function(){return e.apply(this.doc,arguments)}}(Rs.prototype[tl]));return Ae(Rs),$o.inputStyles={textarea:Js,contenteditable:Zs},$o.defineMode=function(e){$o.defaults.mode||"null"==e||($o.defaults.mode=e),He.apply(this,arguments)},$o.defineMIME=function(e,t){as[e]=t},$o.defineMode("null",function(){return{token:function(e){return e.skipToEnd()}}}),$o.defineMIME("text/plain","null"),$o.defineExtension=function(e,t){$o.prototype[e]=t},$o.defineDocExtension=function(e,t){Rs.prototype[e]=t},$o.fromTextArea=function(e,t){function r(){e.value=l.getValue()}if(t=t?c(t):{},t.value=e.value,!t.tabindex&&e.tabIndex&&(t.tabindex=e.tabIndex),!t.placeholder&&e.placeholder&&(t.placeholder=e.placeholder),null==t.autofocus){var n=a();t.autofocus=n==e||null!=e.getAttribute("autofocus")&&n==document.body}var i;if(e.form&&(Ja(e.form,"submit",r),!t.leaveSubmitMethodAlone)){var o=e.form;i=o.submit;try{var s=o.submit=function(){r(),o.submit=i,o.submit(),o.submit=s}}catch(e){}}t.finishInit=function(t){t.save=r,t.getTextArea=function(){return e},t.toTextArea=function(){t.toTextArea=isNaN,r(),e.parentNode.removeChild(t.getWrapperElement()),e.style.display="",e.form&&(Ce(e.form,"submit",r),"function"==typeof e.form.submit&&(e.form.submit=i))}},e.style.display="none";var l=$o(function(t){return e.parentNode.insertBefore(t,e.nextSibling)},t);return l},function(e){e.off=Ce,e.on=Ja,e.wheelEventPixels=Dn,e.Doc=Rs,e.splitLines=ts,e.countColumn=d,e.findColumn=f,e.isWordChar=k,e.Pass=Ua,e.signal=Le,e.Line=hs,e.changeEnd=Hn,e.scrollbarModel=ws,e.Pos=I,e.cmpPos=D,e.modes=os,e.mimeModes=as,e.resolveMode=Ue,e.getMode=Be,e.modeExtensions=ss,e.extendMode=Ve,e.copyState=Ye,e.startState=$e,e.innerMode=Ge,e.commands=Us,e.keyMap=Hs,e.keyName=lo,e.isModifierKey=ao,e.lookupKey=oo,e.normalizeKeyMap=io,e.StringStream=ls,e.SharedTextMarker=Ns,e.TextMarker=As,e.LineWidget=Es,e.e_preventDefault=Ne,e.e_stopPropagation=Oe,e.e_stop=Pe,e.addClass=s,e.contains=o,e.rmClass=Ia,e.keyNames=Ds}($o),$o.version="5.33.0",$o}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";function t(e){for(var t={},r=0;r*\/]/.test(r)?n(null,"select-op"):"."==r&&e.match(/^-?[_a-z][_a-z0-9-]*/i)?n("qualifier","qualifier"):/[:;{}\[\]\(\)]/.test(r)?n(null,r):("u"==r||"U"==r)&&e.match(/rl(-prefix)?\(/i)||("d"==r||"D"==r)&&e.match("omain(",!0,!0)||("r"==r||"R"==r)&&e.match("egexp(",!0,!0)?(e.backUp(1),t.tokenize=a,n("property","word")):/[\w\\\-]/.test(r)?(e.eatWhile(/[\w\\\-]/),n("property","word")):n(null,null):/[\d.]/.test(e.peek())?(e.eatWhile(/[\w.%]/),n("number","unit")):e.match(/^-[\w\\\-]+/)?(e.eatWhile(/[\w\\\-]/),e.match(/^\s*:/,!1)?n("variable-2","variable-definition"):n("variable-2","variable")):e.match(/^\w+-/)?n("meta","meta"):void 0}function o(e){return function(t,r){for(var i,o=!1;null!=(i=t.next());){if(i==e&&!o){")"==e&&t.backUp(1);break}o=!o&&"\\"==i}return(i==e||!o&&")"!=e)&&(r.tokenize=null),n("string","string")}}function a(e,t){return e.next(),e.match(/\s*[\"\')]/,!1)?t.tokenize=null:t.tokenize=o(")"),n(null,"(")}function s(e,t,r){this.type=e,this.indent=t,this.prev=r}function l(e,t,r,n){return e.context=new s(r,t.indentation()+(!1===n?0:g),e.context),r}function u(e){return e.context.prev&&(e.context=e.context.prev),e.context.type}function c(e,t,r){return N[r.context.type](e,t,r)}function d(e,t,r,n){for(var i=n||1;i>0;i--)r.context=r.context.prev;return c(e,t,r)}function h(e){var t=e.current().toLowerCase();m=_.hasOwnProperty(t)?"atom":L.hasOwnProperty(t)?"keyword":"variable"}var f=r.inline;r.propertyKeywords||(r=e.resolveMode("text/css"));var p,m,g=t.indentUnit,v=r.tokenHooks,y=r.documentTypes||{},b=r.mediaTypes||{},k=r.mediaFeatures||{},w=r.mediaValueKeywords||{},x=r.propertyKeywords||{},T=r.nonStandardPropertyKeywords||{},S=r.fontProperties||{},C=r.counterDescriptors||{},L=r.colorKeywords||{},_=r.valueKeywords||{},E=r.allowNested,M=r.lineComment,A=!0===r.supportsAtComponent,N={};return N.top=function(e,t,r){if("{"==e)return l(r,t,"block");if("}"==e&&r.context.prev)return u(r);if(A&&/@component/i.test(e))return l(r,t,"atComponentBlock");if(/^@(-moz-)?document$/i.test(e))return l(r,t,"documentTypes");if(/^@(media|supports|(-moz-)?document|import)$/i.test(e))return l(r,t,"atBlock");if(/^@(font-face|counter-style)/i.test(e))return r.stateArg=e,"restricted_atBlock_before";if(/^@(-(moz|ms|o|webkit)-)?keyframes$/i.test(e))return"keyframes";if(e&&"@"==e.charAt(0))return l(r,t,"at");if("hash"==e)m="builtin";else if("word"==e)m="tag";else{if("variable-definition"==e)return"maybeprop";if("interpolation"==e)return l(r,t,"interpolation");if(":"==e)return"pseudo";if(E&&"("==e)return l(r,t,"parens")}return r.context.type},N.block=function(e,t,r){if("word"==e){var n=t.current().toLowerCase();return x.hasOwnProperty(n)?(m="property","maybeprop"):T.hasOwnProperty(n)?(m="string-2","maybeprop"):E?(m=t.match(/^\s*:(?:\s|$)/,!1)?"property":"tag","block"):(m+=" error","maybeprop")}return"meta"==e?"block":E||"hash"!=e&&"qualifier"!=e?N.top(e,t,r):(m="error","block")},N.maybeprop=function(e,t,r){return":"==e?l(r,t,"prop"):c(e,t,r)},N.prop=function(e,t,r){if(";"==e)return u(r);if("{"==e&&E)return l(r,t,"propBlock");if("}"==e||"{"==e)return d(e,t,r);if("("==e)return l(r,t,"parens");if("hash"!=e||/^#([0-9a-fA-f]{3,4}|[0-9a-fA-f]{6}|[0-9a-fA-f]{8})$/.test(t.current())){if("word"==e)h(t);else if("interpolation"==e)return l(r,t,"interpolation")}else m+=" error";return"prop"},N.propBlock=function(e,t,r){return"}"==e?u(r):"word"==e?(m="property","maybeprop"):r.context.type},N.parens=function(e,t,r){return"{"==e||"}"==e?d(e,t,r):")"==e?u(r):"("==e?l(r,t,"parens"):"interpolation"==e?l(r,t,"interpolation"):("word"==e&&h(t),"parens")},N.pseudo=function(e,t,r){return"meta"==e?"pseudo":"word"==e?(m="variable-3",r.context.type):c(e,t,r)},N.documentTypes=function(e,t,r){return"word"==e&&y.hasOwnProperty(t.current())?(m="tag",r.context.type):N.atBlock(e,t,r)},N.atBlock=function(e,t,r){if("("==e)return l(r,t,"atBlock_parens");if("}"==e||";"==e)return d(e,t,r);if("{"==e)return u(r)&&l(r,t,E?"block":"top");if("interpolation"==e)return l(r,t,"interpolation");if("word"==e){var n=t.current().toLowerCase();m="only"==n||"not"==n||"and"==n||"or"==n?"keyword":b.hasOwnProperty(n)?"attribute":k.hasOwnProperty(n)?"property":w.hasOwnProperty(n)?"keyword":x.hasOwnProperty(n)?"property":T.hasOwnProperty(n)?"string-2":_.hasOwnProperty(n)?"atom":L.hasOwnProperty(n)?"keyword":"error"}return r.context.type},N.atComponentBlock=function(e,t,r){return"}"==e?d(e,t,r):"{"==e?u(r)&&l(r,t,E?"block":"top",!1):("word"==e&&(m="error"),r.context.type)},N.atBlock_parens=function(e,t,r){return")"==e?u(r):"{"==e||"}"==e?d(e,t,r,2):N.atBlock(e,t,r)},N.restricted_atBlock_before=function(e,t,r){return"{"==e?l(r,t,"restricted_atBlock"):"word"==e&&"@counter-style"==r.stateArg?(m="variable","restricted_atBlock_before"):c(e,t,r)},N.restricted_atBlock=function(e,t,r){return"}"==e?(r.stateArg=null,u(r)):"word"==e?(m="@font-face"==r.stateArg&&!S.hasOwnProperty(t.current().toLowerCase())||"@counter-style"==r.stateArg&&!C.hasOwnProperty(t.current().toLowerCase())?"error":"property","maybeprop"):"restricted_atBlock"},N.keyframes=function(e,t,r){return"word"==e?(m="variable","keyframes"):"{"==e?l(r,t,"top"):c(e,t,r)},N.at=function(e,t,r){return";"==e?u(r):"{"==e||"}"==e?d(e,t,r):("word"==e?m="tag":"hash"==e&&(m="builtin"),"at")},N.interpolation=function(e,t,r){return"}"==e?u(r):"{"==e||";"==e?d(e,t,r):("word"==e?m="variable":"variable"!=e&&"("!=e&&")"!=e&&(m="error"),"interpolation")},{startState:function(e){return{tokenize:null,state:f?"block":"top",stateArg:null,context:new s(f?"block":"top",e||0,null)}},token:function(e,t){if(!t.tokenize&&e.eatSpace())return null;var r=(t.tokenize||i)(e,t);return r&&"object"==typeof r&&(p=r[1],r=r[0]),m=r,"comment"!=p&&(t.state=N[t.state](p,e,t)),m},indent:function(e,t){var r=e.context,n=t&&t.charAt(0),i=r.indent;return"prop"!=r.type||"}"!=n&&")"!=n||(r=r.prev),r.prev&&("}"!=n||"block"!=r.type&&"top"!=r.type&&"interpolation"!=r.type&&"restricted_atBlock"!=r.type?(")"!=n||"parens"!=r.type&&"atBlock_parens"!=r.type)&&("{"!=n||"at"!=r.type&&"atBlock"!=r.type)||(i=Math.max(0,r.indent-g)):i=(r=r.prev).indent),i},electricChars:"}",blockCommentStart:"/*",blockCommentEnd:"*/",blockCommentContinue:" * ",lineComment:M,fold:"brace"}});var n=["domain","regexp","url","url-prefix"],i=t(n),o=["all","aural","braille","handheld","print","projection","screen","tty","tv","embossed"],a=t(o),s=["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"],l=t(s),u=["landscape","portrait","none","coarse","fine","on-demand","hover","interlace","progressive"],c=t(u),d=["align-content","align-items","align-self","alignment-adjust","alignment-baseline","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","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-repeat","background-size","baseline-shift","binding","bleed","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","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-position","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","float-offset","flow-from","flow-into","font","font-feature-settings","font-family","font-kerning","font-language-override","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-weight","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","justify-content","justify-items","justify-self","left","letter-spacing","line-break","line-height","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","max-height","max-width","min-height","min-width","move-to","nav-down","nav-index","nav-left","nav-right","nav-up","object-fit","object-position","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","rotation","rotation-point","ruby-align","ruby-overhang","ruby-position","ruby-span","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-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-style","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-height","text-indent","text-justify","text-outline","text-overflow","text-shadow","text-size-adjust","text-space-collapse","text-transform","text-underline-position","text-wrap","top","transform","transform-origin","transform-style","transition","transition-delay","transition-duration","transition-property","transition-timing-function","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","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","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"],h=t(d),f=["scrollbar-arrow-color","scrollbar-base-color","scrollbar-dark-shadow-color","scrollbar-face-color","scrollbar-highlight-color","scrollbar-shadow-color","scrollbar-3d-light-color","scrollbar-track-color","shape-inside","searchfield-cancel-button","searchfield-decoration","searchfield-results-button","searchfield-results-decoration","zoom"],p=t(f),m=t(["font-family","src","unicode-range","font-variant","font-feature-settings","font-stretch","font-weight","font-style"]),g=t(["additive-symbols","fallback","negative","pad","prefix","range","speak-as","suffix","symbols","system"]),v=["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","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","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","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","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","snow","springgreen","steelblue","tan","teal","thistle","tomato","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen"],y=t(v),b=["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","background","backwards","baseline","below","bidi-override","binary","bengali","blink","block","block-axis","bold","bolder","border","border-box","both","bottom","break","break-all","break-word","bullets","button","button-bevel","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","contain","content","contents","content-box","context-menu","continuous","copy","counter","counters","cover","crop","cross","crosshair","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","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","fixed","flat","flex","flex-end","flex-start","footnotes","forwards","from","geometricPrecision","georgian","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","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","match","matrix","matrix3d","media-controls-background","media-current-time-display","media-fullscreen-button","media-mute-button","media-play-button","media-return-to-realtime-button","media-rewind-button","media-seek-back-button","media-seek-forward-button","media-slider","media-sliderthumb","media-time-remaining-display","media-volume-slider","media-volume-slider-container","media-volume-sliderthumb","medium","menu","menulist","menulist-button","menulist-text","menulist-textfield","menutext","message-box","middle","min-intrinsic","mix","mongolian","monospace","move","multiple","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","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","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","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","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","sub","subpixel-antialiased","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","unset","up","upper-alpha","upper-armenian","upper-greek","upper-hexadecimal","upper-latin","upper-norwegian","upper-roman","uppercase","urdu","url","var","vertical","vertical-text","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"],k=t(b),w=n.concat(o).concat(s).concat(u).concat(d).concat(f).concat(v).concat(b);e.registerHelper("hintWords","css",w),e.defineMIME("text/css",{documentTypes:i,mediaTypes:a,mediaFeatures:l,mediaValueKeywords:c,propertyKeywords:h,nonStandardPropertyKeywords:p,fontProperties:m,counterDescriptors:g,colorKeywords:y,valueKeywords:k,tokenHooks:{"/":function(e,t){return!!e.eat("*")&&(t.tokenize=r,r(e,t))}},name:"css"}),e.defineMIME("text/x-scss",{mediaTypes:a,mediaFeatures:l,mediaValueKeywords:c,propertyKeywords:h,nonStandardPropertyKeywords:p,colorKeywords:y,valueKeywords:k,fontProperties:m,allowNested:!0,lineComment:"//",tokenHooks:{"/":function(e,t){return e.eat("/")?(e.skipToEnd(),["comment","comment"]):e.eat("*")?(t.tokenize=r,r(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"}),e.defineMIME("text/x-less",{mediaTypes:a,mediaFeatures:l,mediaValueKeywords:c,propertyKeywords:h,nonStandardPropertyKeywords:p,colorKeywords:y,valueKeywords:k,fontProperties:m,allowNested:!0,lineComment:"//",tokenHooks:{"/":function(e,t){return e.eat("/")?(e.skipToEnd(),["comment","comment"]):e.eat("*")?(t.tokenize=r,r(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"}),e.defineMIME("text/x-gss",{documentTypes:i,mediaTypes:a,mediaFeatures:l,propertyKeywords:h,nonStandardPropertyKeywords:p,fontProperties:m,counterDescriptors:g,colorKeywords:y,valueKeywords:k,supportsAtComponent:!0,tokenHooks:{"/":function(e,t){return!!e.eat("*")&&(t.tokenize=r,r(e,t))}},name:"css",helperType:"gss"})});var exports=exports||{},CSSLint=function(){function Reporter(e,t){this.messages=[],this.stats=[],this.lines=e,this.ruleset=t}var parserlib={};!function(){function e(){this._listeners={}}function t(e){this._input=e.replace(/\n\r?/g,"\n"),this._line=1,this._col=1,this._cursor=0}function r(e,t,r){this.col=r,this.line=t,this.message=e}function n(e,t,r,n){this.col=r,this.line=t,this.text=e,this.type=n}function i(e,r){this._reader=e?new t(e.toString()):null,this._token=null,this._tokenData=r,this._lt=[],this._ltIndex=0,this._ltIndexCache=[]}e.prototype={constructor:e,addListener:function(e,t){this._listeners[e]||(this._listeners[e]=[]),this._listeners[e].push(t)},fire:function(e){if("string"==typeof e&&(e={type:e}),void 0!==e.target&&(e.target=this),void 0===e.type)throw new Error("Event object missing 'type' property.");if(this._listeners[e.type])for(var t=this._listeners[e.type].concat(),r=0,n=t.length;r=0&&this._ltIndex-1&&!n[t.type].hide&&(t.channel=n[t.type].channel,this._token=t,this._lt.push(t),this._ltIndexCache.push(this._lt.length-this._ltIndex+i),this._lt.length>5&&this._lt.shift(),this._ltIndexCache.length>5&&this._ltIndexCache.shift(),this._ltIndex=this._lt.length),(r=n[t.type])&&(r.hide||void 0!==r.channel&&e!==r.channel)?this.get(e):t.type},LA:function(e){var t,r=e;if(e>0){if(e>5)throw new Error("Too much lookahead.");for(;r;)t=this.get(),r--;for(;rthis._tokenData.length?"UNKNOWN_TOKEN":this._tokenData[e].name},tokenType:function(e){return this._tokenData[e]||-1},unget:function(){if(!this._ltIndexCache.length)throw new Error("Too much lookahead.");this._ltIndex-=this._ltIndexCache.pop(),this._token=this._lt[this._ltIndex-1]}},parserlib.util={StringReader:t,SyntaxError:r,SyntaxUnit:n,EventTarget:e,TokenStreamBase:i}}(),function(){function Combinator(e,t,r){SyntaxUnit.call(this,e,t,r,Parser.COMBINATOR_TYPE),this.type="unknown",/^\s+$/.test(e)?this.type="descendant":">"==e?this.type="child":"+"==e?this.type="adjacent-sibling":"~"==e&&(this.type="sibling")}function MediaFeature(e,t){SyntaxUnit.call(this,"("+e+(null!==t?":"+t:"")+")",e.startLine,e.startCol,Parser.MEDIA_FEATURE_TYPE),this.name=e,this.value=t}function MediaQuery(e,t,r,n,i){SyntaxUnit.call(this,(e?e+" ":"")+(t||"")+(t&&r.length>0?" and ":"")+r.join(" and "),n,i,Parser.MEDIA_QUERY_TYPE),this.modifier=e,this.mediaType=t,this.features=r}function Parser(e){EventTarget.call(this),this.options=e||{},this._tokenStream=null}function PropertyName(e,t,r,n){SyntaxUnit.call(this,e,r,n,Parser.PROPERTY_NAME_TYPE),this.hack=t}function PropertyValue(e,t,r){SyntaxUnit.call(this,e.join(" "),t,r,Parser.PROPERTY_VALUE_TYPE),this.parts=e}function PropertyValueIterator(e){this._i=0,this._parts=e.parts,this._marks=[],this.value=e}function PropertyValuePart(text,line,col){SyntaxUnit.call(this,text,line,col,Parser.PROPERTY_VALUE_PART_TYPE),this.type="unknown";var temp;if(/^([+\-]?[\d\.]+)([a-z]+)$/i.test(text))switch(this.type="dimension",this.value=+RegExp.$1,this.units=RegExp.$2,this.units.toLowerCase()){case"em":case"rem":case"ex":case"px":case"cm":case"mm":case"in":case"pt":case"pc":case"ch":case"vh":case"vw":case"vm":this.type="length";break;case"deg":case"rad":case"grad":this.type="angle";break;case"ms":case"s":this.type="time";break;case"hz":case"khz":this.type="frequency";break;case"dpi":case"dpcm":this.type="resolution"}else/^([+\-]?[\d\.]+)%$/i.test(text)?(this.type="percentage",this.value=+RegExp.$1):/^([+\-]?[\d\.]+)%$/i.test(text)?(this.type="percentage",this.value=+RegExp.$1):/^([+\-]?\d+)$/i.test(text)?(this.type="integer",this.value=+RegExp.$1):/^([+\-]?[\d\.]+)$/i.test(text)?(this.type="number",this.value=+RegExp.$1):/^#([a-f0-9]{3,6})/i.test(text)?(this.type="color",3==(temp=RegExp.$1).length?(this.red=parseInt(temp.charAt(0)+temp.charAt(0),16),this.green=parseInt(temp.charAt(1)+temp.charAt(1),16),this.blue=parseInt(temp.charAt(2)+temp.charAt(2),16)):(this.red=parseInt(temp.substring(0,2),16),this.green=parseInt(temp.substring(2,4),16),this.blue=parseInt(temp.substring(4,6),16))):/^rgb\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)/i.test(text)?(this.type="color",this.red=+RegExp.$1,this.green=+RegExp.$2,this.blue=+RegExp.$3):/^rgb\(\s*(\d+)%\s*,\s*(\d+)%\s*,\s*(\d+)%\s*\)/i.test(text)?(this.type="color",this.red=255*+RegExp.$1/100,this.green=255*+RegExp.$2/100,this.blue=255*+RegExp.$3/100):/^rgba\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*([\d\.]+)\s*\)/i.test(text)?(this.type="color",this.red=+RegExp.$1,this.green=+RegExp.$2,this.blue=+RegExp.$3,this.alpha=+RegExp.$4):/^rgba\(\s*(\d+)%\s*,\s*(\d+)%\s*,\s*(\d+)%\s*,\s*([\d\.]+)\s*\)/i.test(text)?(this.type="color",this.red=255*+RegExp.$1/100,this.green=255*+RegExp.$2/100,this.blue=255*+RegExp.$3/100,this.alpha=+RegExp.$4):/^hsl\(\s*(\d+)\s*,\s*(\d+)%\s*,\s*(\d+)%\s*\)/i.test(text)?(this.type="color",this.hue=+RegExp.$1,this.saturation=+RegExp.$2/100,this.lightness=+RegExp.$3/100):/^hsla\(\s*(\d+)\s*,\s*(\d+)%\s*,\s*(\d+)%\s*,\s*([\d\.]+)\s*\)/i.test(text)?(this.type="color",this.hue=+RegExp.$1,this.saturation=+RegExp.$2/100,this.lightness=+RegExp.$3/100,this.alpha=+RegExp.$4):/^url\(["']?([^\)"']+)["']?\)/i.test(text)?(this.type="uri",this.uri=RegExp.$1):/^([^\(]+)\(/i.test(text)?(this.type="function",this.name=RegExp.$1,this.value=text):/^["'][^"']*["']/.test(text)?(this.type="string",this.value=eval(text)):Colors[text.toLowerCase()]?(this.type="color",temp=Colors[text.toLowerCase()].substring(1),this.red=parseInt(temp.substring(0,2),16),this.green=parseInt(temp.substring(2,4),16),this.blue=parseInt(temp.substring(4,6),16)):/^[\,\/]$/.test(text)?(this.type="operator",this.value=text):/^[a-z\-\u0080-\uFFFF][a-z0-9\-\u0080-\uFFFF]*$/i.test(text)&&(this.type="identifier",this.value=text)}function Selector(e,t,r){SyntaxUnit.call(this,e.join(" "),t,r,Parser.SELECTOR_TYPE),this.parts=e,this.specificity=Specificity.calculate(this)}function SelectorPart(e,t,r,n,i){SyntaxUnit.call(this,r,n,i,Parser.SELECTOR_PART_TYPE),this.elementName=e,this.modifiers=t}function SelectorSubPart(e,t,r,n){SyntaxUnit.call(this,e,r,n,Parser.SELECTOR_SUB_PART_TYPE),this.type=t,this.args=[]}function Specificity(e,t,r,n){this.a=e,this.b=t,this.c=r,this.d=n}function isHexDigit(e){return null!==e&&h.test(e)}function isDigit(e){return null!==e&&/\d/.test(e)}function isWhitespace(e){return null!==e&&/\s/.test(e)}function isNewLine(e){return null!==e&&nl.test(e)}function isNameStart(e){return null!==e&&/[a-z_\u0080-\uFFFF\\]/i.test(e)}function isNameChar(e){return null!==e&&(isNameStart(e)||/[0-9\-\\]/.test(e))}function isIdentStart(e){return null!==e&&(isNameStart(e)||/\-\\/.test(e))}function mix(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r]);return e}function TokenStream(e){TokenStreamBase.call(this,e,Tokens)}function ValidationError(e,t,r){this.col=r,this.line=t,this.message=e}var EventTarget=parserlib.util.EventTarget,TokenStreamBase=parserlib.util.TokenStreamBase,StringReader=parserlib.util.StringReader,SyntaxError=parserlib.util.SyntaxError,SyntaxUnit=parserlib.util.SyntaxUnit,Colors={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370d8",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#d87093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32",activeBorder:"Active window border.",activecaption:"Active window caption.",appworkspace:"Background color of multiple document interface.",background:"Desktop background.",buttonface:"The face background color for 3-D elements that appear 3-D due to one layer of surrounding border.",buttonhighlight:"The color of the border facing the light source for 3-D elements that appear 3-D due to one layer of surrounding border.",buttonshadow:"The color of the border away from the light source for 3-D elements that appear 3-D due to one layer of surrounding border.",buttontext:"Text on push buttons.",captiontext:"Text in caption, size box, and scrollbar arrow box.",graytext:"Grayed (disabled) text. This color is set to #000 if the current display driver does not support a solid gray color.",highlight:"Item(s) selected in a control.",highlighttext:"Text of item(s) selected in a control.",inactiveborder:"Inactive window border.",inactivecaption:"Inactive window caption.",inactivecaptiontext:"Color of text in an inactive caption.",infobackground:"Background color for tooltip controls.",infotext:"Text color for tooltip controls.",menu:"Menu background.",menutext:"Text in menus.",scrollbar:"Scroll bar gray area.",threeddarkshadow:"The color of the darker (generally outer) of the two borders away from the light source for 3-D elements that appear 3-D due to two concentric layers of surrounding border.",threedface:"The face background color for 3-D elements that appear 3-D due to two concentric layers of surrounding border.",threedhighlight:"The color of the lighter (generally outer) of the two borders facing the light source for 3-D elements that appear 3-D due to two concentric layers of surrounding border.",threedlightshadow:"The color of the darker (generally inner) of the two borders facing the light source for 3-D elements that appear 3-D due to two concentric layers of surrounding border.",threedshadow:"The color of the lighter (generally inner) of the two borders away from the light source for 3-D elements that appear 3-D due to two concentric layers of surrounding border.",window:"Window background.",windowframe:"Window frame.",windowtext:"Text in windows."};Combinator.prototype=new SyntaxUnit,Combinator.prototype.constructor=Combinator,MediaFeature.prototype=new SyntaxUnit,MediaFeature.prototype.constructor=MediaFeature,MediaQuery.prototype=new SyntaxUnit,MediaQuery.prototype.constructor=MediaQuery,Parser.DEFAULT_TYPE=0,Parser.COMBINATOR_TYPE=1,Parser.MEDIA_FEATURE_TYPE=2,Parser.MEDIA_QUERY_TYPE=3,Parser.PROPERTY_NAME_TYPE=4,Parser.PROPERTY_VALUE_TYPE=5,Parser.PROPERTY_VALUE_PART_TYPE=6,Parser.SELECTOR_TYPE=7,Parser.SELECTOR_PART_TYPE=8,Parser.SELECTOR_SUB_PART_TYPE=9,Parser.prototype=function(){var e,t=new EventTarget,r={constructor:Parser,DEFAULT_TYPE:0,COMBINATOR_TYPE:1,MEDIA_FEATURE_TYPE:2,MEDIA_QUERY_TYPE:3,PROPERTY_NAME_TYPE:4,PROPERTY_VALUE_TYPE:5,PROPERTY_VALUE_PART_TYPE:6,SELECTOR_TYPE:7,SELECTOR_PART_TYPE:8,SELECTOR_SUB_PART_TYPE:9,_stylesheet:function(){var e,t,r,n=this._tokenStream;for(this.fire("startstylesheet"),this._charset(),this._skipCruft();n.peek()==Tokens.IMPORT_SYM;)this._import(),this._skipCruft();for(;n.peek()==Tokens.NAMESPACE_SYM;)this._namespace(),this._skipCruft();for(r=n.peek();r>Tokens.EOF;){try{switch(r){case Tokens.MEDIA_SYM:this._media(),this._skipCruft();break;case Tokens.PAGE_SYM:this._page(),this._skipCruft();break;case Tokens.FONT_FACE_SYM:this._font_face(),this._skipCruft();break;case Tokens.KEYFRAMES_SYM:this._keyframes(),this._skipCruft();break;case Tokens.VIEWPORT_SYM:this._viewport(),this._skipCruft();break;case Tokens.UNKNOWN_SYM:if(n.get(),this.options.strict)throw new SyntaxError("Unknown @ rule.",n.LT(0).startLine,n.LT(0).startCol);for(this.fire({type:"error",error:null,message:"Unknown @ rule: "+n.LT(0).value+".",line:n.LT(0).startLine,col:n.LT(0).startCol}),e=0;n.advance([Tokens.LBRACE,Tokens.RBRACE])==Tokens.LBRACE;)e++;for(;e;)n.advance([Tokens.RBRACE]),e--;break;case Tokens.S:this._readWhitespace();break;default:if(!this._ruleset())switch(r){case Tokens.CHARSET_SYM:throw t=n.LT(1),this._charset(!1),new SyntaxError("@charset not allowed here.",t.startLine,t.startCol);case Tokens.IMPORT_SYM:throw t=n.LT(1),this._import(!1),new SyntaxError("@import not allowed here.",t.startLine,t.startCol);case Tokens.NAMESPACE_SYM:throw t=n.LT(1),this._namespace(!1),new SyntaxError("@namespace not allowed here.",t.startLine,t.startCol);default:n.get(),this._unexpectedToken(n.token())}}}catch(e){if(!(e instanceof SyntaxError)||this.options.strict)throw e;this.fire({type:"error",error:e,message:e.message,line:e.line,col:e.col})}r=n.peek()}r!=Tokens.EOF&&this._unexpectedToken(n.token()),this.fire("endstylesheet")},_charset:function(e){var t,r,n,i=this._tokenStream;i.match(Tokens.CHARSET_SYM)&&(r=i.token().startLine,n=i.token().startCol,this._readWhitespace(),i.mustMatch(Tokens.STRING),t=i.token().value,this._readWhitespace(),i.mustMatch(Tokens.SEMICOLON),!1!==e&&this.fire({type:"charset",charset:t,line:r,col:n}))},_import:function(e){var t,r,n=this._tokenStream,i=[];n.mustMatch(Tokens.IMPORT_SYM),r=n.token(),this._readWhitespace(),n.mustMatch([Tokens.STRING,Tokens.URI]),t=n.token().value.replace(/(?:url\()?["']([^"']+)["']\)?/,"$1"),this._readWhitespace(),i=this._media_query_list(),n.mustMatch(Tokens.SEMICOLON),this._readWhitespace(),!1!==e&&this.fire({type:"import",uri:t,media:i,line:r.startLine,col:r.startCol})},_namespace:function(e){var t,r,n,i,o=this._tokenStream;o.mustMatch(Tokens.NAMESPACE_SYM),t=o.token().startLine,r=o.token().startCol,this._readWhitespace(),o.match(Tokens.IDENT)&&(n=o.token().value,this._readWhitespace()),o.mustMatch([Tokens.STRING,Tokens.URI]),i=o.token().value.replace(/(?:url\()?["']([^"']+)["']\)?/,"$1"),this._readWhitespace(),o.mustMatch(Tokens.SEMICOLON),this._readWhitespace(),!1!==e&&this.fire({type:"namespace",prefix:n,uri:i,line:t,col:r})},_media:function(){var e,t,r,n=this._tokenStream;for(n.mustMatch(Tokens.MEDIA_SYM),e=n.token().startLine,t=n.token().startCol,this._readWhitespace(),r=this._media_query_list(),n.mustMatch(Tokens.LBRACE),this._readWhitespace(),this.fire({type:"startmedia",media:r,line:e,col:t});;)if(n.peek()==Tokens.PAGE_SYM)this._page();else if(n.peek()==Tokens.FONT_FACE_SYM)this._font_face();else if(!this._ruleset())break;n.mustMatch(Tokens.RBRACE),this._readWhitespace(),this.fire({type:"endmedia",media:r,line:e,col:t})},_media_query_list:function(){var e=this._tokenStream,t=[];for(this._readWhitespace(),e.peek()!=Tokens.IDENT&&e.peek()!=Tokens.LPAREN||t.push(this._media_query());e.match(Tokens.COMMA);)this._readWhitespace(),t.push(this._media_query());return t},_media_query:function(){var e=this._tokenStream,t=null,r=null,n=null,i=[];if(e.match(Tokens.IDENT)&&("only"!=(r=e.token().value.toLowerCase())&&"not"!=r?(e.unget(),r=null):n=e.token()),this._readWhitespace(),e.peek()==Tokens.IDENT?(t=this._media_type(),null===n&&(n=e.token())):e.peek()==Tokens.LPAREN&&(null===n&&(n=e.LT(1)),i.push(this._media_expression())),null===t&&0===i.length)return null;for(this._readWhitespace();e.match(Tokens.IDENT);)"and"!=e.token().value.toLowerCase()&&this._unexpectedToken(e.token()),this._readWhitespace(),i.push(this._media_expression());return new MediaQuery(r,t,i,n.startLine,n.startCol)},_media_type:function(){return this._media_feature()},_media_expression:function(){var e,t=this._tokenStream,r=null,n=null;return t.mustMatch(Tokens.LPAREN),r=this._media_feature(),this._readWhitespace(),t.match(Tokens.COLON)&&(this._readWhitespace(),e=t.LT(1),n=this._expression()),t.mustMatch(Tokens.RPAREN),this._readWhitespace(),new MediaFeature(r,n?new SyntaxUnit(n,e.startLine,e.startCol):null)},_media_feature:function(){var e=this._tokenStream;return e.mustMatch(Tokens.IDENT),SyntaxUnit.fromToken(e.token())},_page:function(){var e,t,r=this._tokenStream,n=null,i=null;r.mustMatch(Tokens.PAGE_SYM),e=r.token().startLine,t=r.token().startCol,this._readWhitespace(),r.match(Tokens.IDENT)&&"auto"===(n=r.token().value).toLowerCase()&&this._unexpectedToken(r.token()),r.peek()==Tokens.COLON&&(i=this._pseudo_page()),this._readWhitespace(),this.fire({type:"startpage",id:n,pseudo:i,line:e,col:t}),this._readDeclarations(!0,!0),this.fire({type:"endpage",id:n,pseudo:i,line:e,col:t})},_margin:function(){var e,t,r=this._tokenStream,n=this._margin_sym();return!!n&&(e=r.token().startLine,t=r.token().startCol,this.fire({type:"startpagemargin",margin:n,line:e,col:t}),this._readDeclarations(!0),this.fire({type:"endpagemargin",margin:n,line:e,col:t}),!0)},_margin_sym:function(){var e=this._tokenStream;return e.match([Tokens.TOPLEFTCORNER_SYM,Tokens.TOPLEFT_SYM,Tokens.TOPCENTER_SYM,Tokens.TOPRIGHT_SYM,Tokens.TOPRIGHTCORNER_SYM,Tokens.BOTTOMLEFTCORNER_SYM,Tokens.BOTTOMLEFT_SYM,Tokens.BOTTOMCENTER_SYM,Tokens.BOTTOMRIGHT_SYM,Tokens.BOTTOMRIGHTCORNER_SYM,Tokens.LEFTTOP_SYM,Tokens.LEFTMIDDLE_SYM,Tokens.LEFTBOTTOM_SYM,Tokens.RIGHTTOP_SYM,Tokens.RIGHTMIDDLE_SYM,Tokens.RIGHTBOTTOM_SYM])?SyntaxUnit.fromToken(e.token()):null},_pseudo_page:function(){var e=this._tokenStream;return e.mustMatch(Tokens.COLON),e.mustMatch(Tokens.IDENT),e.token().value},_font_face:function(){var e,t,r=this._tokenStream;r.mustMatch(Tokens.FONT_FACE_SYM),e=r.token().startLine,t=r.token().startCol,this._readWhitespace(),this.fire({type:"startfontface",line:e,col:t}),this._readDeclarations(!0),this.fire({type:"endfontface",line:e,col:t})},_viewport:function(){var e,t,r=this._tokenStream;r.mustMatch(Tokens.VIEWPORT_SYM),e=r.token().startLine,t=r.token().startCol,this._readWhitespace(),this.fire({type:"startviewport",line:e,col:t}),this._readDeclarations(!0),this.fire({type:"endviewport",line:e,col:t})},_operator:function(e){var t=this._tokenStream,r=null;return(t.match([Tokens.SLASH,Tokens.COMMA])||e&&t.match([Tokens.PLUS,Tokens.STAR,Tokens.MINUS]))&&(r=t.token(),this._readWhitespace()),r?PropertyValuePart.fromToken(r):null},_combinator:function(){var e,t=this._tokenStream,r=null;return t.match([Tokens.PLUS,Tokens.GREATER,Tokens.TILDE])&&(r=new Combinator((e=t.token()).value,e.startLine,e.startCol),this._readWhitespace()),r},_unary_operator:function(){var e=this._tokenStream;return e.match([Tokens.MINUS,Tokens.PLUS])?e.token().value:null},_property:function(){var e,t,r,n,i=this._tokenStream,o=null,a=null;return i.peek()==Tokens.STAR&&this.options.starHack&&(i.get(),a=(t=i.token()).value,r=t.startLine,n=t.startCol),i.match(Tokens.IDENT)&&("_"==(e=(t=i.token()).value).charAt(0)&&this.options.underscoreHack&&(a="_",e=e.substring(1)),o=new PropertyName(e,a,r||t.startLine,n||t.startCol),this._readWhitespace()),o},_ruleset:function(){var e,t=this._tokenStream;try{e=this._selectors_group()}catch(e){if(!(e instanceof SyntaxError)||this.options.strict)throw e;if(this.fire({type:"error",error:e,message:e.message,line:e.line,col:e.col}),t.advance([Tokens.RBRACE])!=Tokens.RBRACE)throw e;return!0}return e&&(this.fire({type:"startrule",selectors:e,line:e[0].line,col:e[0].col}),this._readDeclarations(!0),this.fire({type:"endrule",selectors:e,line:e[0].line,col:e[0].col})),e},_selectors_group:function(){var e,t=this._tokenStream,r=[];if(null!==(e=this._selector()))for(r.push(e);t.match(Tokens.COMMA);)this._readWhitespace(),null!==(e=this._selector())?r.push(e):this._unexpectedToken(t.LT(1));return r.length?r:null},_selector:function(){var e=this._tokenStream,t=[],r=null,n=null,i=null;if(null===(r=this._simple_selector_sequence()))return null;for(t.push(r);;)if(null!==(n=this._combinator()))t.push(n),null===(r=this._simple_selector_sequence())?this._unexpectedToken(e.LT(1)):t.push(r);else{if(!this._readWhitespace())break;i=new Combinator(e.token().value,e.token().startLine,e.token().startCol),n=this._combinator(),null===(r=this._simple_selector_sequence())?null!==n&&this._unexpectedToken(e.LT(1)):(null!==n?t.push(n):t.push(i),t.push(r))}return new Selector(t,t[0].line,t[0].col)},_simple_selector_sequence:function(){var e,t,r=this._tokenStream,n=null,i=[],o="",a=[function(){return r.match(Tokens.HASH)?new SelectorSubPart(r.token().value,"id",r.token().startLine,r.token().startCol):null},this._class,this._attrib,this._pseudo,this._negation],s=0,l=a.length,u=null;for(e=r.LT(1).startLine,t=r.LT(1).startCol,(n=this._type_selector())||(n=this._universal()),null!==n&&(o+=n);;){if(r.peek()===Tokens.S)break;for(;s1&&e.unget()),null)},_class:function(){var e,t=this._tokenStream;return t.match(Tokens.DOT)?(t.mustMatch(Tokens.IDENT),e=t.token(),new SelectorSubPart("."+e.value,"class",e.startLine,e.startCol-1)):null},_element_name:function(){var e,t=this._tokenStream;return t.match(Tokens.IDENT)?(e=t.token(),new SelectorSubPart(e.value,"elementName",e.startLine,e.startCol)):null},_namespace_prefix:function(){var e=this._tokenStream,t="";return e.LA(1)!==Tokens.PIPE&&e.LA(2)!==Tokens.PIPE||(e.match([Tokens.IDENT,Tokens.STAR])&&(t+=e.token().value),e.mustMatch(Tokens.PIPE),t+="|"),t.length?t:null},_universal:function(){var e,t=this._tokenStream,r="";return(e=this._namespace_prefix())&&(r+=e),t.match(Tokens.STAR)&&(r+="*"),r.length?r:null},_attrib:function(){var e,t,r=this._tokenStream,n=null;return r.match(Tokens.LBRACKET)?(t=r.token(),n=t.value,n+=this._readWhitespace(),(e=this._namespace_prefix())&&(n+=e),r.mustMatch(Tokens.IDENT),n+=r.token().value,n+=this._readWhitespace(),r.match([Tokens.PREFIXMATCH,Tokens.SUFFIXMATCH,Tokens.SUBSTRINGMATCH,Tokens.EQUALS,Tokens.INCLUDES,Tokens.DASHMATCH])&&(n+=r.token().value,n+=this._readWhitespace(),r.mustMatch([Tokens.IDENT,Tokens.STRING]),n+=r.token().value,n+=this._readWhitespace()),r.mustMatch(Tokens.RBRACKET),new SelectorSubPart(n+"]","attribute",t.startLine,t.startCol)):null},_pseudo:function(){var e,t,r=this._tokenStream,n=null,i=":";return r.match(Tokens.COLON)&&(r.match(Tokens.COLON)&&(i+=":"),r.match(Tokens.IDENT)?(n=r.token().value,e=r.token().startLine,t=r.token().startCol-i.length):r.peek()==Tokens.FUNCTION&&(e=r.LT(1).startLine,t=r.LT(1).startCol-i.length,n=this._functional_pseudo()),n&&(n=new SelectorSubPart(i+n,"pseudo",e,t))),n},_functional_pseudo:function(){var e=this._tokenStream,t=null;return e.match(Tokens.FUNCTION)&&(t=e.token().value,t+=this._readWhitespace(),t+=this._expression(),e.mustMatch(Tokens.RPAREN),t+=")"),t},_expression:function(){for(var e=this._tokenStream,t="";e.match([Tokens.PLUS,Tokens.MINUS,Tokens.DIMENSION,Tokens.NUMBER,Tokens.STRING,Tokens.IDENT,Tokens.LENGTH,Tokens.FREQ,Tokens.ANGLE,Tokens.TIME,Tokens.RESOLUTION,Tokens.SLASH]);)t+=e.token().value,t+=this._readWhitespace();return t.length?t:null},_negation:function(){var e,t,r,n=this._tokenStream,i="",o=null;return n.match(Tokens.NOT)&&(i=n.token().value,e=n.token().startLine,t=n.token().startCol,i+=this._readWhitespace(),i+=r=this._negation_arg(),i+=this._readWhitespace(),n.match(Tokens.RPAREN),(o=new SelectorSubPart(i+=n.token().value,"not",e,t)).args.push(r)),o},_negation_arg:function(){var e,t,r=this._tokenStream,n=[this._type_selector,this._universal,function(){return r.match(Tokens.HASH)?new SelectorSubPart(r.token().value,"id",r.token().startLine,r.token().startCol):null},this._class,this._attrib,this._pseudo],i=null,o=0,a=n.length;for(e=r.LT(1).startLine,t=r.LT(1).startCol;o0?new PropertyValue(t,t[0].line,t[0].col):null},_term:function(){var e,t,r,n=this._tokenStream,i=null,o=null;return null!==(i=this._unary_operator())&&(t=n.token().startLine,r=n.token().startCol),n.peek()==Tokens.IE_FUNCTION&&this.options.ieFilters?(o=this._ie_function(),null===i&&(t=n.token().startLine,r=n.token().startCol)):n.match([Tokens.NUMBER,Tokens.PERCENTAGE,Tokens.LENGTH,Tokens.ANGLE,Tokens.TIME,Tokens.FREQ,Tokens.STRING,Tokens.IDENT,Tokens.URI,Tokens.UNICODE_RANGE])?(o=n.token().value,null===i&&(t=n.token().startLine,r=n.token().startCol),this._readWhitespace()):null===(e=this._hexcolor())?(null===i&&(t=n.LT(1).startLine,r=n.LT(1).startCol),null===o&&(o=n.LA(3)==Tokens.EQUALS&&this.options.ieFilters?this._ie_function():this._function())):(o=e.value,null===i&&(t=e.startLine,r=e.startCol)),null!==o?new PropertyValuePart(null!==i?i+o:o,t,r):null},_function:function(){var e,t=this._tokenStream,r=null,n=null;if(t.match(Tokens.FUNCTION)){if(r=t.token().value,this._readWhitespace(),n=this._expr(!0),r+=n,this.options.ieFilters&&t.peek()==Tokens.EQUALS)do{for(this._readWhitespace()&&(r+=t.token().value),t.LA(0)==Tokens.COMMA&&(r+=t.token().value),t.match(Tokens.IDENT),r+=t.token().value,t.match(Tokens.EQUALS),r+=t.token().value,e=t.peek();e!=Tokens.COMMA&&e!=Tokens.S&&e!=Tokens.RPAREN;)t.get(),r+=t.token().value,e=t.peek()}while(t.match([Tokens.COMMA,Tokens.S]));t.match(Tokens.RPAREN),r+=")",this._readWhitespace()}return r},_ie_function:function(){var e,t=this._tokenStream,r=null;if(t.match([Tokens.IE_FUNCTION,Tokens.FUNCTION])){r=t.token().value;do{for(this._readWhitespace()&&(r+=t.token().value),t.LA(0)==Tokens.COMMA&&(r+=t.token().value),t.match(Tokens.IDENT),r+=t.token().value,t.match(Tokens.EQUALS),r+=t.token().value,e=t.peek();e!=Tokens.COMMA&&e!=Tokens.S&&e!=Tokens.RPAREN;)t.get(),r+=t.token().value,e=t.peek()}while(t.match([Tokens.COMMA,Tokens.S]));t.match(Tokens.RPAREN),r+=")",this._readWhitespace()}return r},_hexcolor:function(){var e,t=this._tokenStream,r=null;if(t.match(Tokens.HASH)){if(r=t.token(),e=r.value,!/#[a-f0-9]{3,6}/i.test(e))throw new SyntaxError("Expected a hex color but found '"+e+"' at line "+r.startLine+", col "+r.startCol+".",r.startLine,r.startCol);this._readWhitespace()}return r},_keyframes:function(){var e,t,r,n=this._tokenStream,i="";for(n.mustMatch(Tokens.KEYFRAMES_SYM),e=n.token(),/^@\-([^\-]+)\-/.test(e.value)&&(i=RegExp.$1),this._readWhitespace(),r=this._keyframe_name(),this._readWhitespace(),n.mustMatch(Tokens.LBRACE),this.fire({type:"startkeyframes",name:r,prefix:i,line:e.startLine,col:e.startCol}),this._readWhitespace(),t=n.peek();t==Tokens.IDENT||t==Tokens.PERCENTAGE;)this._keyframe_rule(),this._readWhitespace(),t=n.peek();this.fire({type:"endkeyframes",name:r,prefix:i,line:e.startLine,col:e.startCol}),this._readWhitespace(),n.mustMatch(Tokens.RBRACE)},_keyframe_name:function(){var e=this._tokenStream;return e.mustMatch([Tokens.IDENT,Tokens.STRING]),SyntaxUnit.fromToken(e.token())},_keyframe_rule:function(){this._tokenStream;var e=this._key_list();this.fire({type:"startkeyframerule",keys:e,line:e[0].line,col:e[0].col}),this._readDeclarations(!0),this.fire({type:"endkeyframerule",keys:e,line:e[0].line,col:e[0].col})},_key_list:function(){var e=this._tokenStream,t=[];for(t.push(this._key()),this._readWhitespace();e.match(Tokens.COMMA);)this._readWhitespace(),t.push(this._key()),this._readWhitespace();return t},_key:function(){var e,t=this._tokenStream;if(t.match(Tokens.PERCENTAGE))return SyntaxUnit.fromToken(t.token());if(t.match(Tokens.IDENT)){if(e=t.token(),/from|to/i.test(e.value))return SyntaxUnit.fromToken(e);t.unget()}this._unexpectedToken(t.LT(1))},_skipCruft:function(){for(;this._tokenStream.match([Tokens.S,Tokens.CDO,Tokens.CDC]););},_readDeclarations:function(e,t){var r,n=this._tokenStream;this._readWhitespace(),e&&n.mustMatch(Tokens.LBRACE),this._readWhitespace();try{for(;;){if(n.match(Tokens.SEMICOLON)||t&&this._margin());else{if(!this._declaration())break;if(!n.match(Tokens.SEMICOLON))break}this._readWhitespace()}n.mustMatch(Tokens.RBRACE),this._readWhitespace()}catch(e){if(!(e instanceof SyntaxError)||this.options.strict)throw e;if(this.fire({type:"error",error:e,message:e.message,line:e.line,col:e.col}),(r=n.advance([Tokens.SEMICOLON,Tokens.RBRACE]))==Tokens.SEMICOLON)this._readDeclarations(!1,t);else if(r!=Tokens.RBRACE)throw e}},_readWhitespace:function(){for(var e=this._tokenStream,t="";e.match(Tokens.S);)t+=e.token().value;return t},_unexpectedToken:function(e){throw new SyntaxError("Unexpected token '"+e.value+"' at line "+e.startLine+", col "+e.startCol+".",e.startLine,e.startCol)},_verifyEnd:function(){this._tokenStream.LA(1)!=Tokens.EOF&&this._unexpectedToken(this._tokenStream.LT(1))},_validateProperty:function(e,t){Validation.validate(e,t)},parse:function(e){this._tokenStream=new TokenStream(e,Tokens),this._stylesheet()},parseStyleSheet:function(e){return this.parse(e)},parseMediaQuery:function(e){this._tokenStream=new TokenStream(e,Tokens);var t=this._media_query();return this._verifyEnd(),t},parsePropertyValue:function(e){this._tokenStream=new TokenStream(e,Tokens),this._readWhitespace();var t=this._expr();return this._readWhitespace(),this._verifyEnd(),t},parseRule:function(e){this._tokenStream=new TokenStream(e,Tokens),this._readWhitespace();var t=this._ruleset();return this._readWhitespace(),this._verifyEnd(),t},parseSelector:function(e){this._tokenStream=new TokenStream(e,Tokens),this._readWhitespace();var t=this._selector();return this._readWhitespace(),this._verifyEnd(),t},parseStyleAttribute:function(e){e+="}",this._tokenStream=new TokenStream(e,Tokens),this._readDeclarations()}};for(e in r)r.hasOwnProperty(e)&&(t[e]=r[e]);return t}();var Properties={"alignment-adjust":"auto | baseline | before-edge | text-before-edge | middle | central | after-edge | text-after-edge | ideographic | alphabetic | hanging | mathematical | | ","alignment-baseline":"baseline | use-script | before-edge | text-before-edge | after-edge | text-after-edge | central | middle | ideographic | alphabetic | hanging | mathematical",animation:1,"animation-delay":{multi:"