extractCSS is an online tool which can extract ids, classes and inline styles from HTML document and output them as CSS stylesheet. All you have to do is to type or paste your HTML document and let extractCSS to do the rest for you!
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/js/codemirror.min.js b/js/codemirror.min.js
new file mode 100644
index 0000000..91dc9d3
--- /dev/null
+++ b/js/codemirror.min.js
@@ -0,0 +1 @@
+window.CodeMirror=(function(){var bC=/gecko\/\d/i.test(navigator.userAgent);var ct=/MSIE \d/.test(navigator.userAgent);var bz=ct&&(document.documentMode==null||document.documentMode<8);var by=ct&&(document.documentMode==null||document.documentMode<9);var b2=/WebKit\//.test(navigator.userAgent);var cw=b2&&/Qt\/\d+\.\d+/.test(navigator.userAgent);var ca=/Chrome\//.test(navigator.userAgent);var dO=/Opera\//.test(navigator.userAgent);var ae=/Apple Computer/.test(navigator.vendor);var aD=/KHTML\//.test(navigator.userAgent);var bN=/Mac OS X 1\d\D([7-9]|\d\d)\D/.test(navigator.userAgent);var b7=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(navigator.userAgent);var dL=/PhantomJS/.test(navigator.userAgent);var dm=/AppleWebKit/.test(navigator.userAgent)&&/Mobile\/\w+/.test(navigator.userAgent);var cO=dm||/Android|webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(navigator.userAgent);var bl=dm||/Mac/.test(navigator.platform);var am=/windows/i.test(navigator.platform);var c0=dO&&navigator.userAgent.match(/Version\/(\d*\.\d*)/);if(c0){c0=Number(c0[1])}if(c0&&c0>=15){dO=false;b2=true}var bb=bl&&(cw||dO&&(c0==null||c0<12.11));var bR=bC||(ct&&!by);var ec=false,az=false;function z(eh,ei){if(!(this instanceof z)){return new z(eh,ei)}this.options=ei=ei||{};for(var ej in dp){if(!ei.hasOwnProperty(ej)&&dp.hasOwnProperty(ej)){ei[ej]=dp[ej]}}bt(ei);var en=typeof ei.value=="string"?0:ei.value.first;var em=this.display=f(eh,en);em.wrapper.CodeMirror=this;cK(this);if(ei.autofocus&&!cO){c3(this)}this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:false,focused:false,suppressEdits:false,pasteIncoming:false,draggingText:false,highlight:new eg()};bW(this);if(ei.lineWrapping){this.display.wrapper.className+=" CodeMirror-wrap"}var el=ei.value;if(typeof el=="string"){el=new Y(ei.value,ei.mode)}b3(this,cJ)(this,el);if(ct){setTimeout(bI(dH,this,true),20)}d1(this);var eo;try{eo=(document.activeElement==em.input)}catch(ek){}if(eo||(ei.autofocus&&!cO)){setTimeout(bI(bM,this),20)}else{ar(this)}b3(this,function(){for(var eq in aG){if(aG.propertyIsEnumerable(eq)){aG[eq](this,ei[eq],br)}}for(var ep=0;epej.maxLineLength){ej.maxLineLength=ek;ej.maxLine=el}})}function bt(eh){var ej=false;for(var ei=0;ei(en.scroller.clientWidth+1);var ej=el>(en.scroller.clientHeight+1);if(ej){en.scrollbarV.style.display="block";en.scrollbarV.style.bottom=em?i(en.measure)+"px":"0";en.scrollbarV.firstChild.style.height=(el-en.scroller.clientHeight+en.scrollbarV.clientHeight)+"px"}else{en.scrollbarV.style.display=""}if(em){en.scrollbarH.style.display="block";en.scrollbarH.style.right=ej?i(en.measure)+"px":"0";en.scrollbarH.firstChild.style.width=(en.scroller.scrollWidth-en.scroller.clientWidth+en.scrollbarH.clientWidth)+"px"}else{en.scrollbarH.style.display=""}if(em&&ej){en.scrollbarFiller.style.display="block";en.scrollbarFiller.style.height=en.scrollbarFiller.style.width=i(en.measure)+"px"}else{en.scrollbarFiller.style.display=""}if(em&&eh.options.coverGutterNextToScrollbar&&eh.options.fixedGutter){en.gutterFiller.style.display="block";en.gutterFiller.style.height=i(en.measure)+"px";en.gutterFiller.style.width=en.gutters.offsetWidth+"px"}else{en.gutterFiller.style.display=""}if(bN&&i(en.measure)===0){en.scrollbarV.style.minWidth=en.scrollbarH.style.minHeight=b7?"18px":"12px"}}function bk(em,el,ek){var ej=em.scroller.scrollTop,eh=em.wrapper.clientHeight;if(typeof ek=="number"){ej=ek}else{if(ek){ej=ek.top;eh=ek.bottom-ek.top}}ej=Math.floor(ej-dr(em));var ei=Math.ceil(ej+eh);return{from:a2(el,ej),to:a2(el,ei)}}function c7(eh){var en=eh.display;if(!en.alignWidgets&&(!en.gutters.firstChild||!eh.options.fixedGutter)){return}var ek=cC(en)-en.scroller.scrollLeft+eh.doc.scrollLeft;var em=en.gutters.offsetWidth,ej=ek+"px";for(var eo=en.lineDiv.firstChild;eo;eo=eo.nextSibling){if(eo.alignable){for(var el=0,ei=eo.alignable;el=eh.display.showingFrom&&en.to<=eh.display.showingTo){break}ek=[]}if(ei){M(eh,"update",eh);if(eh.display.showingFrom!=ej||eh.display.showingTo!=eo){M(eh,"viewportChange",eh,eh.display.showingFrom,eh.display.showingTo)}}return ei}function cd(el,ez,ei,ex){var er=el.display,eA=el.doc;if(!er.wrapper.clientWidth){er.showingFrom=er.showingTo=eA.first;er.viewOffset=0;return}if(!ex&&ez.length==0&&ei.from>er.showingFrom&&ei.toeh&&er.showingTo-eh<20){eh=Math.min(ek,er.showingTo)}if(az){eq=a9(t(eA,dw(eA,eq)));while(eh=eu[0].to){eu=[]}else{eu=dG(eu,ez)}if(az){for(var es=0;esen.from){en.to=ey}else{eu.splice(es--,1);break}}}}var ep=0;for(var es=0;eseh){en.to=eh}if(en.from>=en.to){eu.splice(es--,1)}else{ep+=en.to-en.from}}if(!ex&&ep==eh-eq&&eq==er.showingFrom&&eh==er.showingTo){h(el);return}eu.sort(function(eC,eB){return eC.from-eB.from});try{var em=document.activeElement}catch(et){}if(ep<(eh-eq)*0.7){er.lineDiv.style.display="none"}bA(el,eq,eh,eu,ej);er.lineDiv.style.display="";if(em&&document.activeElement!=em&&em.offsetHeight){em.focus()}var eo=eq!=er.showingFrom||eh!=er.showingTo||er.lastSizeC!=er.wrapper.clientHeight;if(eo){er.lastSizeC=er.wrapper.clientHeight;cN(el,400)}er.showingFrom=eq;er.showingTo=eh;aB(el);h(el);return true}function aB(ep){var em=ep.display;var ei=em.lineDiv.offsetTop;for(var eh=em.lineDiv.firstChild,eq;eh;eh=eh.nextSibling){if(eh.lineObj){if(bz){var el=eh.offsetTop+eh.offsetHeight;eq=el-ei;ei=el}else{var ek=al(eh);eq=ek.bottom-ek.top}var eo=eh.lineObj.height-eq;if(eq<2){eq=au(em)}if(eo>0.001||eo<-0.001){ea(eh.lineObj,eq);var en=eh.lineObj.widgets;if(en){for(var ej=0;ej=em.to){eh.push(em)}else{if(en.from>em.from){eh.push({from:em.from,to:en.from})}if(en.toek){while(er.lineObj!=eD){er=el(er)}if(es&&ei<=ek&&er.lineNumber){n(er.lineNumber,cV(eq.options,ek))}er=er.nextSibling}else{if(eD.widgets){for(var ex=0,eC=er,ez;eC&&ex<20;++ex,eC=eC.nextSibling){if(eC.lineObj==eD&&/div/i.test(eC.nodeName)){ez=eC;break}}}var eu=ag(eq,eD,ek,ep,ez);if(eu!=ez){eh.insertBefore(eu,er)}else{while(er!=ez){er=el(er)}er=er.nextSibling}eu.lineObj=eD}}++ek});while(er){er=el(er)}}function ag(em,eo,ep,es,ei){var ey=cx(em,eo);var eB=eo.gutterMarkers,ez=em.display,en;if(!em.options.lineNumbers&&!eB&&!eo.bgClass&&!eo.wrapClass&&!eo.widgets){return ey}if(ei){ei.alignable=null;var eC=true,ek=0,ej=null;for(var eu=ei.firstChild,et;eu;eu=et){et=eu.nextSibling;if(!/\bCodeMirror-linewidget\b/.test(eu.className)){ei.removeChild(eu)}else{for(var eA=0;eA3){eu(eI,eG.top,null,eG.bottom);eI=ej;if(eG.bottomev.bottom||eH.bottom==ev.bottom&&eH.right>ev.right){ev=eH}if(eI=eh.display.showingTo){return}var ei=+new Date+eh.options.workTime;var ej=bj(ek.mode,cp(eh,ek.frontier));var em=[],el;ek.iter(ek.frontier,Math.min(ek.first+ek.size,eh.display.showingTo+500),function(en){if(ek.frontier>=eh.display.showingFrom){var ep=en.styles;en.styles=dR(eh,en,ej);var eq=!ep||ep.length!=en.styles.length;for(var eo=0;!eq&&eoei){cN(eh,eh.options.workDelay);return true}});if(em.length){b3(eh,function(){for(var en=0;enej;--eq){if(eq<=em.first){return em.first}var ep=dw(em,eq-1);if(ep.stateAfter&&(!ek||eq<=em.frontier)){return eq}var eo=bc(ep.text,null,en.options.tabSize);if(el==null||ei>eo){el=eq-1;ei=eo}}return el}function cp(eh,en,ei){var el=eh.doc,ek=eh.display;if(!el.mode.startState){return true}var em=bK(eh,en,ei),ej=em>el.first&&dw(el,em-1).stateAfter;if(!ej){ej=bi(el.mode)}else{ej=bj(el.mode,ej)}el.iter(em,en,function(eo){cn(eh,eo,ej);var ep=em==en-1||em%5==0||em>=ek.showingFrom&&emel?"left":eoel?em.left:em.right,top:em.top,bottom:em.bottom}}function dq(eh,ei){var ek=eh.display.measureLineCache;for(var el=0;el100){var ej=document.createDocumentFragment();var er=10,eu=et.childNodes.length;for(var ey=0,es=Math.ceil(eu/er);eyeA){eI=eA}if(eG<0){eG=0}for(var eD=eh.length-2;eD>=0;eD-=2){var eF=eh[eD],eH=eh[eD+1];if(eF>eI||eH=eI||eG<=eF&&eI>=eH||Math.min(eI,eH)-Math.max(eG,eF)>=(eI-eG)>>1){eh[eD]=Math.min(eG,eF);eh[eD+1]=Math.max(eI,eH);break}}if(eD<0){eD=eh.length;eh.push(eG,eI)}return{left:eE.left-ei.left,right:eE.right-ei.left,top:eD,bottom:null}}function eC(eD){eD.bottom=eh[eD.top+1];eD.top=eh[eD.top]}for(var ey=0,el;ey1){ek=eB[ey]=ez(en[0]);ek.rightSide=ez(en[en.length-1])}}if(!ek){ek=eB[ey]=ez(al(ev))}if(el.measureRight){ek.right=al(el.measureRight).left}if(el.leftSide){ek.leftSide=ez(al(el.leftSide))}}}for(var ey=0,el;eyet.from){return el(ev-1)}return el(ev,eu)}var en=a(eo),eh=ep.ch;if(!en){return el(eh)}var ei=ah(en,eh);var ek=er(eh,ei);if(dn!=null){ek.other=er(eh,dn)}return ek}function d5(eh,ei,ej,el){var ek=new I(eh,ei);ek.xRel=el;if(ej){ek.outside=true}return ek}function d0(eo,el,ek){var en=eo.doc;ek+=eo.display.viewOffset;if(ek<0){return d5(en.first,0,true,-1)}var ei=a2(en,ek),ep=en.first+en.size-1;if(ei>ep){return d5(en.first+en.size-1,dw(en,ep).text.length,true,1)}if(el<0){el=0}for(;;){var ej=dw(en,ei);var eq=b1(eo,ej,ei,el,ek);var em=cX(ej);var eh=em&&em.find();if(em&&(eq.ch>eh.from.ch||eq.ch==eh.from.ch&&eq.xRel>0)){ei=eh.to.line}else{return eq}}}function b1(er,ej,eu,et,es){var eq=es-a8(er,ej);var en=false,eA=2*er.display.wrapper.clientWidth;var ez=a5(er,ej);function eE(eG){var eH=cA(er,I(eu,eG),"line",ej,ez);en=true;if(eq>eH.bottom){return eH.left-eA}else{if(eqei){return d5(eu,ek,em,1)}for(;;){if(ew?ek==eB||ek==q(ej,eB,1):ek-eB<=1){var ev=etet){ek=eF;ei=el;if(em=en){ei+=1000}ey=eo}else{eB=eF;ex=el;eh=en;ey-=eo}}}var ai;function au(ej){if(ej.cachedTextHeight!=null){return ej.cachedTextHeight}if(ai==null){ai=d6("pre");for(var ei=0;ei<49;++ei){ai.appendChild(document.createTextNode("x"));ai.appendChild(d6("br"))}ai.appendChild(document.createTextNode("x"))}bd(ej.measure,ai);var eh=ai.offsetHeight/50;if(eh>3){ej.cachedTextHeight=eh}cD(ej.measure);return eh||1}function cr(ek){if(ek.cachedCharWidth!=null){return ek.cachedCharWidth}var eh=d6("span","x");var ej=d6("pre",[eh]);bd(ek.measure,ej);var ei=eh.offsetWidth;if(ei>2){ek.cachedCharWidth=ei}return ei||10}var cH=0;function bS(eh){eh.curOp={changes:[],forceUpdate:false,updateInput:null,userSelChange:null,textChanged:null,selectionChanged:false,cursorActivity:false,updateMaxLine:false,updateScrollPos:false,id:++cH};if(!bF++){aO=[]}}function U(et){var eo=et.curOp,es=et.doc,ep=et.display;et.curOp=null;if(eo.updateMaxLine){d8(et)}if(ep.maxLineChanged&&!et.options.lineWrapping&&ep.maxLine){var ei=c8(et,ep.maxLine);ep.sizer.style.minWidth=Math.max(0,ei+3+aK)+"px";ep.maxLineChanged=false;var eq=Math.max(0,ep.sizer.offsetLeft+ep.sizer.offsetWidth-ep.scroller.clientWidth);if(eq1000||et.indexOf("\n")>-1){en.value=es.display.prevInput=""}else{es.display.prevInput=et}if(ej){U(es)}es.state.pasteIncoming=false;return true}function dH(eh,ej){var ei,ek,em=eh.doc;if(!dV(em.sel.from,em.sel.to)){eh.display.prevInput="";ei=b9&&(em.sel.to.line-em.sel.from.line>100||(ek=eh.getSelection()).length>1000);var el=ei?"-":ek||eh.getSelection();eh.display.input.value=el;if(eh.state.focused){cv(eh.display.input)}if(ct&&!by){eh.display.inputHasSelection=el}}else{if(ej){eh.display.prevInput=eh.display.input.value="";if(ct&&!by){eh.display.inputHasSelection=null}}}eh.display.inaccurateSelection=ei}function c3(eh){if(eh.options.readOnly!="nocursor"&&(!cO||document.activeElement!=eh.display.input)){eh.display.input.focus()}}function Q(eh){return eh.options.readOnly||eh.doc.cantEdit}function d1(ei){var en=ei.display;bg(en.scroller,"mousedown",b3(ei,cW));if(ct){bg(en.scroller,"dblclick",b3(ei,function(eq){if(ap(ei,eq)){return}var er=bB(ei,eq);if(!er||k(ei,eq)||aC(ei.display,eq)){return}bP(eq);var ep=Z(dw(ei.doc,er.line).text,er);d3(ei.doc,ep.from,ep.to)}))}else{bg(en.scroller,"dblclick",function(ep){ap(ei,ep)||bP(ep)})}bg(en.lineSpace,"selectstart",function(ep){if(!aC(en,ep)){bP(ep)}});if(!bR){bg(en.scroller,"contextmenu",function(ep){ab(ei,ep)})}bg(en.scroller,"scroll",function(){if(en.scroller.clientHeight){D(ei,en.scroller.scrollTop);a0(ei,en.scroller.scrollLeft,true);af(ei,"scroll",ei)}});bg(en.scrollbarV,"scroll",function(){if(en.scroller.clientHeight){D(ei,en.scrollbarV.scrollTop)}});bg(en.scrollbarH,"scroll",function(){if(en.scroller.clientHeight){a0(ei,en.scrollbarH.scrollLeft)}});bg(en.scroller,"mousewheel",function(ep){b(ei,ep)});bg(en.scroller,"DOMMouseScroll",function(ep){b(ei,ep)});function eo(){if(ei.state.focused){setTimeout(bI(c3,ei),0)}}bg(en.scrollbarH,"mousedown",eo);bg(en.scrollbarV,"mousedown",eo);bg(en.wrapper,"scroll",function(){en.wrapper.scrollTop=en.wrapper.scrollLeft=0});var eh;function el(){if(eh==null){eh=setTimeout(function(){eh=null;en.cachedCharWidth=en.cachedTextHeight=cY=null;R(ei);bV(ei,bI(O,ei))},100)}}bg(window,"resize",el);function ek(){for(var ep=en.wrapper.parentNode;ep&&ep!=document.body;ep=ep.parentNode){}if(ep){setTimeout(ek,5000)}else{cM(window,"resize",el)}}setTimeout(ek,5000);bg(en.input,"keyup",b3(ei,function(ep){if(ap(ei,ep)||ei.options.onKeyEvent&&ei.options.onKeyEvent(ei,W(ep))){return}if(ep.keyCode==16){ei.doc.sel.shift=false}}));bg(en.input,"input",bI(u,ei));bg(en.input,"keydown",b3(ei,m));bg(en.input,"keypress",b3(ei,bJ));bg(en.input,"focus",bI(bM,ei));bg(en.input,"blur",bI(ar,ei));function ej(ep){if(ap(ei,ep)||ei.options.onDragEvent&&ei.options.onDragEvent(ei,W(ep))){return}cU(ep)}if(ei.options.dragDrop){bg(en.scroller,"dragstart",function(ep){G(ei,ep)});bg(en.scroller,"dragenter",ej);bg(en.scroller,"dragover",ej);bg(en.scroller,"drop",b3(ei,aJ))}bg(en.scroller,"paste",function(ep){if(aC(en,ep)){return}c3(ei);u(ei)});bg(en.input,"paste",function(){ei.state.pasteIncoming=true;u(ei)});function em(){if(en.inaccurateSelection){en.prevInput="";en.inaccurateSelection=false;en.input.value=ei.getSelection();cv(en.input)}}bg(en.input,"cut",em);bg(en.input,"copy",em);if(aD){bg(en.sizer,"mouseup",function(){if(document.activeElement==en.input){en.input.blur()}c3(ei)})}}function aC(ei,eh){for(var ej=B(eh);ej!=ei.wrapper;ej=ej.parentNode){if(!ej||ej.ignoreEvents||ej.parentNode==ei.sizer&&ej!=ei.mover){return true}}}function bB(ei,en,ek){var em=ei.display;if(!ek){var el=B(en);if(el==em.scrollbarH||el==em.scrollbarH.firstChild||el==em.scrollbarV||el==em.scrollbarV.firstChild||el==em.scrollbarFiller||el==em.gutterFiller){return null}}var eh,eo,ej=al(em.lineSpace);try{eh=en.clientX;eo=en.clientY}catch(en){return null}return d0(ei,eh-ej.left,eo-ej.top)}var cg,cb;function cW(ez){if(ap(this,ez)){return}var ek=this,eu=ek.display,eB=ek.doc,es=eB.sel;es.shift=ez.shiftKey;if(aC(eu,ez)){if(!b2){eu.scroller.draggable=false;setTimeout(function(){eu.scroller.draggable=true},100)}return}if(k(ek,ez)){return}var ej=bB(ek,ez);switch(dY(ez)){case 3:if(bR){ab.call(ek,ek,ez)}return;case 2:if(ej){d3(ek.doc,ej)}setTimeout(bI(c3,ek),20);bP(ez);return}if(!ej){if(B(ez)==eu.scroller){bP(ez)}return}if(!ek.state.focused){bM(ek)}var eh=+new Date,ei="single";if(cb&&cb.time>eh-400&&dV(cb.pos,ej)){ei="triple";bP(ez);setTimeout(bI(c3,ek),20);aM(ek,ej.line)}else{if(cg&&cg.time>eh-400&&dV(cg.pos,ej)){ei="double";cb={time:eh,pos:ej};bP(ez);var ew=Z(dw(eB,ej.line).text,ej);d3(ek.doc,ew.from,ew.to)}else{cg={time:eh,pos:ej}}}var el=ej;if(ek.options.dragDrop&&dd&&!Q(ek)&&!dV(es.from,es.to)&&!dx(ej,es.from)&&!dx(es.to,ej)&&ei=="single"){var ev=b3(ek,function(eC){if(b2){eu.scroller.draggable=false}ek.state.draggingText=false;cM(document,"mouseup",ev);cM(eu.scroller,"drop",ev);if(Math.abs(ez.clientX-eC.clientX)+Math.abs(ez.clientY-eC.clientY)<10){bP(eC);d3(ek.doc,ej);c3(ek)}});if(b2){eu.scroller.draggable=true}ek.state.draggingText=ev;if(eu.scroller.dragDrop){eu.scroller.dragDrop()}bg(document,"mouseup",ev);bg(eu.scroller,"drop",ev);return}bP(ez);if(ei=="single"){d3(ek.doc,dW(eB,ej))}var eA=es.from,ep=es.to,et=ej;function ex(eD){if(dV(et,eD)){return}et=eD;if(ei=="single"){d3(ek.doc,dW(eB,ej),eD);return}eA=dW(eB,eA);ep=dW(eB,ep);if(ei=="double"){var eC=Z(dw(eB,eD.line).text,eD);if(dx(eD,eA)){d3(ek.doc,eC.from,ep)}else{d3(ek.doc,eA,eC.to)}}else{if(ei=="triple"){if(dx(eD,eA)){d3(ek.doc,ep,dW(eB,I(eD.line,0)))}else{d3(ek.doc,eA,dW(eB,I(eD.line+1,0)))}}}}var eq=al(eu.wrapper);var em=0;function ey(eE){var eC=++em;var eG=bB(ek,eE,true);if(!eG){return}if(!dV(eG,el)){if(!ek.state.focused){bM(ek)}el=eG;ex(eG);var eF=bk(eu,eB);if(eG.line>=eF.to||eG.lineeq.bottom?20:0;if(eD){setTimeout(b3(ek,function(){if(em!=eC){return}eu.scroller.scrollTop+=eD;ey(eE)}),50)}}}function eo(eC){em=Infinity;bP(eC);c3(ek);cM(document,"mousemove",er);cM(document,"mouseup",en)}var er=b3(ek,function(eC){if(!ct&&!dY(eC)){eo(eC)}else{ey(eC)}});var en=b3(ek,eo);bg(document,"mousemove",er);bg(document,"mouseup",en)}function k(ep,en){var eo=ep.display;try{var ei=en.clientX,eh=en.clientY}catch(en){return false}if(ei>=Math.floor(al(eo.gutters).right)){return false}bP(en);if(!dC(ep,"gutterClick")){return true}var em=al(eo.lineDiv);if(eh>em.bottom){return true}eh-=em.top-eo.viewOffset;for(var ek=0;ek=ei){var eq=a2(ep.doc,eh);var ej=ep.options.gutters[ek];M(ep,"gutterClick",ep,eq,ej,en);break}}return true}var N=0;function aJ(en){var ep=this;if(ap(ep,en)||aC(ep.display,en)||(ep.options.onDragEvent&&ep.options.onDragEvent(ep,W(en)))){return}bP(en);if(ct){N=+new Date}var eo=bB(ep,en,true),eh=en.dataTransfer.files;if(!eo||Q(ep)){return}if(eh&&eh.length&&window.FileReader&&window.File){var ej=eh.length,er=Array(ej),ei=0;var ek=function(eu,et){var es=new FileReader;es.onload=function(){er[et]=es.result;if(++ei==ej){eo=dW(ep.doc,eo);aH(ep.doc,{from:eo,to:eo,text:aw(er.join("\n")),origin:"paste"},"around")}};es.readAsText(eu)};for(var el=0;elem.clientWidth||ep&&em.scrollHeight>em.clientHeight)){return}if(ep&&bl&&b2){for(var eo=ei.target;eo!=em;eo=eo.parentNode){if(eo.lineObj){en.display.currentWheelTarget=eo;break}}}if(eq&&!bC&&!dO&&bu!=null){if(ep){D(en,Math.max(0,Math.min(em.scrollTop+ep*bu,em.scrollHeight-em.clientHeight)))}a0(en,Math.max(0,Math.min(em.scrollLeft+eq*bu,em.scrollWidth-em.clientWidth)));bP(ei);ek.wheelStartX=null;return}if(ep&&bu!=null){var eh=ep*bu;var el=en.doc.scrollTop,ej=el+ek.wrapper.clientHeight;if(eh<0){el=Math.max(0,el+eh-50)}else{ej=Math.min(en.doc.height,ej+eh+50)}cu(en,[],{top:el,bottom:ej})}if(dD<20){if(ek.wheelStartX==null){ek.wheelStartX=em.scrollLeft;ek.wheelStartY=em.scrollTop;ek.wheelDX=eq;ek.wheelDY=ep;setTimeout(function(){if(ek.wheelStartX==null){return}var er=em.scrollLeft-ek.wheelStartX;var et=em.scrollTop-ek.wheelStartY;var es=(et&&ek.wheelDY&&et/ek.wheelDY)||(er&&ek.wheelDX&&er/ek.wheelDX);ek.wheelStartX=ek.wheelStartY=null;if(!es){return}bu=(bu*dD+es)/(dD+1);++dD},200)}else{ek.wheelDX+=eq;ek.wheelDY+=ep}}}function d2(ei,el,eh){if(typeof el=="string"){el=c5[el];if(!el){return false}}if(ei.display.pollingFast&&bv(ei)){ei.display.pollingFast=false}var em=ei.doc,ek=em.sel.shift,ej=false;try{if(Q(ei)){ei.state.suppressEdits=true}if(eh){em.sel.shift=false}ej=el(ei)!=bq}finally{em.sel.shift=ek;ei.state.suppressEdits=false}return ej}function ck(eh){var ei=eh.state.keyMaps.slice(0);if(eh.options.extraKeys){ei.push(eh.options.extraKeys)}ei.push(eh.options.keyMap);return ei}var X;function dA(eh,en){var ei=d4(eh.options.keyMap),el=ei.auto;clearTimeout(X);if(el&&!c4(en)){X=setTimeout(function(){if(d4(eh.options.keyMap)==ei){eh.options.keyMap=(el.call?el.call(null,eh):el);ef(eh)}},50)}var ek=dJ(en,true),em=false;if(!ek){return false}var ej=ck(eh);if(en.shiftKey){em=g("Shift-"+ek,ej,function(eo){return d2(eh,eo,true)})||g(ek,ej,function(eo){if(typeof eo=="string"?/^go[A-Z]/.test(eo):eo.motion){return d2(eh,eo)}})}else{em=g(ek,ej,function(eo){return d2(eh,eo)})}if(em){bP(en);l(eh);if(by){en.oldKeyCode=en.keyCode;en.keyCode=0}M(eh,"keyHandled",eh,ek,en)}return em}function cQ(eh,ek,ei){var ej=g("'"+ei+"'",ck(eh),function(el){return d2(eh,el,true)});if(ej){bP(ek);l(eh);M(eh,"keyHandled",eh,"'"+ei+"'",ek)}return ej}var cf=null;function m(ek){var eh=this;if(!eh.state.focused){bM(eh)}if(ct&&ek.keyCode==27){ek.returnValue=false}if(ap(eh,ek)||eh.options.onKeyEvent&&eh.options.onKeyEvent(eh,W(ek))){return}var ei=ek.keyCode;eh.doc.sel.shift=ei==16||ek.shiftKey;var ej=dA(eh,ek);if(dO){cf=ej?ei:null;if(!ej&&ei==88&&!b9&&(bl?ek.metaKey:ek.ctrlKey)){eh.replaceSelection("")}}}function bJ(el){var eh=this;if(ap(eh,el)||eh.options.onKeyEvent&&eh.options.onKeyEvent(eh,W(el))){return}var ek=el.keyCode,ei=el.charCode;if(dO&&ek==cf){cf=null;bP(el);return}if(((dO&&(!el.which||el.which<10))||aD)&&dA(eh,el)){return}var ej=String.fromCharCode(ei==null?ek:ei);if(this.options.electricChars&&this.doc.mode.electricChars&&this.options.smartIndent&&!Q(this)&&this.doc.mode.electricChars.indexOf(ej)>-1){setTimeout(b3(eh,function(){L(eh,eh.doc.sel.to.line,"smart")}),75)}if(cQ(eh,el,ej)){return}if(ct&&!by){eh.display.inputHasSelection=null}u(eh)}function bM(eh){if(eh.options.readOnly=="nocursor"){return}if(!eh.state.focused){af(eh,"focus",eh);eh.state.focused=true;if(eh.display.wrapper.className.search(/\bCodeMirror-focused\b/)==-1){eh.display.wrapper.className+=" CodeMirror-focused"}dH(eh,true)}aN(eh);l(eh)}function ar(eh){if(eh.state.focused){af(eh,"blur",eh);eh.state.focused=false;eh.display.wrapper.className=eh.display.wrapper.className.replace(" CodeMirror-focused","")}clearInterval(eh.display.blinker);setTimeout(function(){if(!eh.state.focused){eh.doc.sel.shift=false}},150)}var dS;function ab(eq,el){if(ap(eq,el,"contextmenu")){return}var en=eq.display,ei=eq.doc.sel;if(aC(en,el)){return}var ep=bB(eq,el),eh=en.scroller.scrollTop;if(!ep||dO){return}if(dV(ei.from,ei.to)||dx(ep,ei.from)||!dx(ep,ei.to)){b3(eq,be)(eq.doc,ep,ep)}var em=en.input.style.cssText;en.inputDiv.style.position="absolute";en.input.style.cssText="position: fixed; width: 30px; height: 30px; top: "+(el.clientY-5)+"px; left: "+(el.clientX-5)+"px; z-index: 1000; background: white; outline: none;border-width: 0; outline: none; overflow: hidden; opacity: .05; -ms-opacity: .05; filter: alpha(opacity=5);";c3(eq);dH(eq,true);if(dV(ei.from,ei.to)){en.input.value=en.prevInput=" "}function ek(){if(en.input.selectionStart!=null){var er=en.input.value=" "+(dV(ei.from,ei.to)?"":en.input.value);en.prevInput=" ";en.input.selectionStart=1;en.input.selectionEnd=er.length}}function eo(){en.inputDiv.style.position="relative";en.input.style.cssText=em;if(by){en.scrollbarV.scrollTop=en.scroller.scrollTop=eh}aN(eq);if(en.input.selectionStart!=null){if(!ct||by){ek()}clearTimeout(dS);var er=0,es=function(){if(en.prevInput==" "&&en.input.selectionStart==0){b3(eq,c5.selectAll)(eq)}else{if(er++<10){dS=setTimeout(es,500)}else{dH(eq)}}};dS=setTimeout(es,200)}}if(ct&&!by){ek()}if(bR){cU(el);var ej=function(){cM(window,"mouseup",ej);setTimeout(eo,20)};bg(window,"mouseup",ej)}else{setTimeout(eo,50)}}var bZ=z.changeEnd=function(eh){if(!eh.text){return eh.to}return I(eh.from.line+eh.text.length-1,dU(eh.text).length+(eh.text.length==1?eh.from.ch:0))};function c6(el,en,em){if(!dx(en.from,em)){return dW(el,em)}var ek=(en.text.length-1)-(en.to.line-en.from.line);if(em.line>en.to.line+ek){var ej=em.line-ek,ei=el.first+el.size-1;if(ej>ei){return I(ei,dw(el,ei).text.length)}return dK(em,dw(el,ej).text.length)}if(em.line==en.to.line+ek){return dK(em,dU(en.text).length+(en.text.length==1?en.from.ch:0)+dw(el,en.to.line).text.length-en.to.ch)}var eh=em.line-en.from.line;return dK(em,en.text[eh].length+(eh?0:en.from.ch))}function dB(ei,el,ej){if(ej&&typeof ej=="object"){return{anchor:c6(ei,el,ej.anchor),head:c6(ei,el,ej.head)}}if(ej=="start"){return{anchor:el.from,head:el.from}}var eh=bZ(el);if(ej=="around"){return{anchor:el.from,head:eh}}if(ej=="end"){return{anchor:eh,head:eh}}var ek=function(eo){if(dx(eo,el.from)){return eo}if(!dx(el.to,eo)){return eh}var em=eo.line+el.text.length-(el.to.line-el.from.line)-1,en=eo.ch;if(eo.line==el.to.line){en+=eh.ch-el.to.ch}return I(em,en)};return{anchor:ek(ei.sel.anchor),head:ek(ei.sel.head)}}function cz(ei,ek,ej){var eh={canceled:false,from:ek.from,to:ek.to,text:ek.text,origin:ek.origin,cancel:function(){this.canceled=true}};if(ej){eh.update=function(eo,en,em,el){if(eo){this.from=dW(ei,eo)}if(en){this.to=dW(ei,en)}if(em){this.text=em}if(el!==undefined){this.origin=el}}}af(ei,"beforeChange",ei,eh);if(ei.cm){af(ei.cm,"beforeChange",ei.cm,eh)}if(eh.canceled){return null}return{from:eh.from,to:eh.to,text:eh.text,origin:eh.origin}}function aH(ek,em,el,ej){if(ek.cm){if(!ek.cm.curOp){return b3(ek.cm,aH)(ek,em,el,ej)}if(ek.cm.state.suppressEdits){return}}if(dC(ek,"beforeChange")||ek.cm&&dC(ek.cm,"beforeChange")){em=cz(ek,em,true);if(!em){return}}var ei=ec&&!ej&&bQ(ek,em.from,em.to);if(ei){for(var eh=ei.length-1;eh>=1;--eh){an(ek,{from:ei[eh].from,to:ei[eh].to,text:[""]})}if(ei.length){an(ek,{from:ei[0].from,to:ei[0].to,text:em.text},el)}}else{an(ek,em,el)}}function an(ej,el,ek){var ei=dB(ej,el,ek);da(ej,el,ei,ej.cm?ej.cm.curOp.id:NaN);cL(ej,el,ei,cR(ej,el));var eh=[];cG(ej,function(en,em){if(!em&&ce(eh,en.history)==-1){cs(en.history,el);eh.push(en.history)}cL(en,el,null,cR(en,el))})}function bn(eq,en){if(eq.cm&&eq.cm.state.suppressEdits){return}var em=eq.history;var ei=(en=="undo"?em.done:em.undone).pop();if(!ei){return}var eo={changes:[],anchorBefore:ei.anchorAfter,headBefore:ei.headAfter,anchorAfter:ei.anchorBefore,headAfter:ei.headBefore,generation:em.generation};(en=="undo"?em.undone:em.done).push(eo);em.generation=ei.generation||++em.maxGeneration;var ej=dC(eq,"beforeChange")||eq.cm&&dC(eq.cm,"beforeChange");for(var ek=ei.changes.length-1;ek>=0;--ek){var ep=ei.changes[ek];ep.origin=en;if(ej&&!cz(eq,ep,false)){(en=="undo"?em.done:em.undone).length=0;return}eo.changes.push(cl(eq,ep));var eh=ek?dB(eq,ep,null):{anchor:ei.anchorBefore,head:ei.headBefore};cL(eq,ep,eh,cI(eq,ep));var el=[];cG(eq,function(es,er){if(!er&&ce(el,es.history)==-1){cs(es.history,ep);el.push(es.history)}cL(es,ep,null,cI(es,ep))})}}function dE(eh,ej){function ei(ek){return I(ek.line+ej,ek.ch)}eh.first+=ej;if(eh.cm){O(eh.cm,eh.first,eh.first,ej)}eh.sel.head=ei(eh.sel.head);eh.sel.anchor=ei(eh.sel.anchor);eh.sel.from=ei(eh.sel.from);eh.sel.to=ei(eh.sel.to)}function cL(el,em,ek,ei){if(el.cm&&!el.cm.curOp){return b3(el.cm,cL)(el,em,ek,ei)}if(em.to.lineel.lastLine()){return}if(em.from.lineej){em={from:em.from,to:I(ej,dw(el,ej).text.length),text:[em.text[0]],origin:em.origin}}em.removed=d7(el,em.from,em.to);if(!ek){ek=dB(el,em,null)}if(el.cm){aj(el.cm,em,ei,ek)}else{dP(el,em,ei,ek)}}function aj(er,en,ek,eh){var eq=er.doc,em=er.display,eo=en.from,ep=en.to;var ei=false,ej=eo.line;if(!er.options.lineWrapping){ej=a9(t(eq,dw(eq,eo.line)));eq.iter(ej,ep.line+1,function(eu){if(eu==em.maxLine){ei=true;return true}})}if(!dx(eq.sel.head,en.from)&&!dx(en.to,eq.sel.head)){er.curOp.cursorActivity=true}dP(eq,en,ek,eh,aF(er));if(!er.options.lineWrapping){eq.iter(ej,eo.line+en.text.length,function(ev){var eu=cS(eq,ev);if(eu>em.maxLineLength){em.maxLine=ev;em.maxLineLength=eu;em.maxLineChanged=true;ei=false}});if(ei){er.curOp.updateMaxLine=true}}eq.frontier=Math.min(eq.frontier,eo.line);cN(er,400);var et=en.text.length-(ep.line-eo.line)-1;O(er,eo.line,ep.line+1,et);if(dC(er,"change")){var el={from:eo,to:ep,text:en.text,removed:en.removed,origin:en.origin};if(er.curOp.textChanged){for(var es=er.curOp.textChanged;es.next;es=es.next){}es.next=el}else{er.curOp.textChanged=el}}}function ax(ek,ej,em,el,eh){if(!el){el=em}if(dx(el,em)){var ei=el;el=em;em=ei}if(typeof ej=="string"){ej=aw(ej)}aH(ek,{from:em,to:el,text:ej,origin:eh},null)}function I(eh,ei){if(!(this instanceof I)){return new I(eh,ei)}this.line=eh;this.ch=ei}z.Pos=I;function dV(ei,eh){return ei.line==eh.line&&ei.ch==eh.ch}function dx(ei,eh){return ei.lineeh){return I(eh,dw(ei,eh).text.length)}return dK(ej,dw(ei,ej.line).text.length)}function dK(ej,ei){var eh=ej.ch;if(eh==null||eh>ei){return I(ej.line,ei)}else{if(eh<0){return I(ej.line,0)}else{return ej}}}function bo(ei,eh){return eh>=ei.first&&eh=ej.ch:eh.to>ej.ch))){if(en){af(ei,"beforeCursorEnter");if(ei.explicitlyCleared){if(!es.markedSpans){break}else{--el;continue}}}if(!ei.atomic){continue}var eo=ei.find()[ek<0?"from":"to"];if(dV(eo,ej)){eo.ch+=ek;if(eo.ch<0){if(eo.line>eq.first){eo=dW(eq,I(eo.line-1))}else{eo=null}}else{if(eo.ch>es.text.length){if(eo.line(window.innerHeight||document.documentElement.clientHeight)){eh=false}}if(eh!=null&&!dL){var ek=em.cursor.style.display=="none";if(ek){em.cursor.style.display="";em.cursor.style.left=el.left+"px";em.cursor.style.top=(el.top-em.viewOffset)+"px"}em.cursor.scrollIntoView(eh);if(ek){em.cursor.style.display="none"}}}function v(eh,eo,el){if(el==null){el=0}for(;;){var em=false,ek=cA(eh,eo);var en=y(eh,ek.left,ek.top-el,ek.left,ek.bottom+el);var ei=eh.doc.scrollTop,ej=eh.doc.scrollLeft;if(en.scrollTop!=null){D(eh,en.scrollTop);if(Math.abs(eh.doc.scrollTop-ei)>1){em=true}}if(en.scrollLeft!=null){a0(eh,en.scrollLeft);if(Math.abs(eh.doc.scrollLeft-ej)>1){em=true}}if(!em){return ek}}}function x(eh,ej,el,ei,ek){var em=y(eh,ej,el,ei,ek);if(em.scrollTop!=null){D(eh,em.scrollTop)}if(em.scrollLeft!=null){a0(eh,em.scrollLeft)}}function y(en,ev,ek,eu,ej){var es=en.display,er=au(en.display);if(ek<0){ek=0}var ei=es.scroller.clientHeight-aK,eq=es.scroller.scrollTop,ep={};var ex=en.doc.height+a4(es);var ey=ekex-er;if(ekeq+ei){var eo=Math.min(ek,(et?ex:ej)-ei);if(eo!=eq){ep.scrollTop=eo}}}var em=es.scroller.clientWidth-aK,eh=es.scroller.scrollLeft;ev+=es.gutters.offsetWidth;eu+=es.gutters.offsetWidth;var el=es.gutters.offsetWidth;var ew=evem+eh-3){ep.scrollLeft=eu+10-em}}return ep}function w(eh,ej,ei){eh.curOp.updateScrollPos={scrollLeft:ej==null?eh.doc.scrollLeft:ej,scrollTop:ei==null?eh.doc.scrollTop:ei}}function bU(ei,ek,ej){var el=ei.curOp.updateScrollPos||(ei.curOp.updateScrollPos={scrollLeft:ei.doc.scrollLeft,scrollTop:ei.doc.scrollTop});var eh=ei.display.scroller;el.scrollTop=Math.max(0,Math.min(eh.scrollHeight-eh.clientHeight,el.scrollTop+ej));el.scrollLeft=Math.max(0,Math.min(eh.scrollWidth-eh.clientWidth,el.scrollLeft+ek))}function L(et,ek,es,ej){var er=et.doc;if(es==null){es="add"}if(es=="smart"){if(!et.doc.mode.indent){es="prev"}else{var ei=cp(et,ek)}}var en=et.options.tabSize;var eu=dw(er,ek),em=bc(eu.text,null,en);var eh=eu.text.match(/^\s*/)[0],ep;if(es=="smart"){ep=et.doc.mode.indent(ei,eu.text.slice(eh.length),eu.text);if(ep==bq){if(!ej){return}es="prev"}}if(es=="prev"){if(ek>er.first){ep=bc(dw(er,ek-1).text,null,en)}else{ep=0}}else{if(es=="add"){ep=em+et.options.indentUnit}else{if(es=="subtract"){ep=em-et.options.indentUnit}else{if(typeof es=="number"){ep=em+es}}}}ep=Math.max(0,ep);var eq="",eo=0;if(et.options.indentWithTabs){for(var el=Math.floor(ep/en);el;--el){eo+=en;eq+="\t"}}if(eo=ey.first+ey.size){return(ev=false)}ep=ez;return eh=dw(ey,ez)}function eu(eA){var ez=(em?q:P)(eh,eq,es,true);if(ez==null){if(!eA&&ew()){if(em){eq=(es<0?bY:bO)(eh)}else{eq=es<0?eh.text.length:0}}else{return(ev=false)}}else{eq=ez}return true}if(er=="char"){eu()}else{if(er=="column"){eu(true)}else{if(er=="word"||er=="group"){var et=null,en=er=="group";for(var el=true;;el=false){if(es<0&&!eu(!el)){break}var ei=eh.text.charAt(eq)||"\n";var ej=bL(ei)?"w":!en?null:/\s/.test(ei)?null:"p";if(et&&et!=ej){if(es<0){es=1;eu()}break}if(ej){et=ej}if(es>0&&!eu(!el)){break}}}}}var eo=bf(ey,I(ep,eq),ex,true);if(!ev){eo.hitSide=true}return eo}function aR(ep,ek,eh,eo){var en=ep.doc,em=ek.left,el;if(eo=="page"){var ej=Math.min(ep.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight);el=ek.top+eh*(ej-(eh<0?1.5:0.5)*au(ep.display))}else{if(eo=="line"){el=eh>0?ek.bottom+3:ek.top-3}}for(;;){var ei=d0(ep,em,el);if(!ei.outside){break}if(eh<0?el<=0:el>=en.height){ei.hitSide=true;break}el+=eh*5}return ei}function Z(ek,em){var el=em.ch,ej=em.ch;if(ek){if((em.xRel<0||ej==ek.length)&&el){--el}else{++ej}var ei=ek.charAt(el);var eh=bL(ei)?bL:/\s/.test(ei)?function(en){return/\s/.test(en)}:function(en){return !/\s/.test(en)&&!bL(en)};while(el>0&&eh(ek.charAt(el-1))){--el}while(ej>1;if((eh?ej[eh*2-1]:0)>=ei){el=eh}else{if(ej[eh*2+1]ek){ei=ek;eh=true}}var ej=dw(this.doc,ei);return df(this,dw(this.doc,ei),{top:0,left:0},el||"page").top+(eh?ej.height:0)},defaultTextHeight:function(){return au(this.display)},defaultCharWidth:function(){return cr(this.display)},setGutterMarker:b3(null,function(eh,ei,ej){return c1(this,eh,function(ek){var el=ek.gutterMarkers||(ek.gutterMarkers={});el[ei]=ej;if(!ej&&di(el)){ek.gutterMarkers=null}return true})}),clearGutter:b3(null,function(ej){var eh=this,ek=eh.doc,ei=ek.first;ek.iter(function(el){if(el.gutterMarkers&&el.gutterMarkers[ej]){el.gutterMarkers[ej]=null;O(eh,ei,ei+1);if(di(el.gutterMarkers)){el.gutterMarkers=null}}++ei})}),addLineClass:b3(null,function(ej,ei,eh){return c1(this,ej,function(ek){var el=ei=="text"?"textClass":ei=="background"?"bgClass":"wrapClass";if(!ek[el]){ek[el]=eh}else{if(new RegExp("(?:^|\\s)"+eh+"(?:$|\\s)").test(ek[el])){return false}else{ek[el]+=" "+eh}}return true})}),removeLineClass:b3(null,function(ej,ei,eh){return c1(this,ej,function(el){var eo=ei=="text"?"textClass":ei=="background"?"bgClass":"wrapClass";var en=el[eo];if(!en){return false}else{if(eh==null){el[eo]=null}else{var em=en.match(new RegExp("(?:^|\\s+)"+eh+"(?:$|\\s+)"));if(!em){return false}var ek=em.index+em[0].length;el[eo]=en.slice(0,em.index)+(!em.index||ek==en.length?"":" ")+en.slice(ek)||null}}return true})}),addLineWidget:b3(null,function(ej,ei,eh){return a3(this,ej,ei,eh)}),removeLineWidget:function(eh){eh.clear()},lineInfo:function(eh){if(typeof eh=="number"){if(!bo(this.doc,eh)){return null}var ei=eh;eh=dw(this.doc,eh);if(!eh){return null}}else{var ei=a9(eh);if(ei==null){return null}}return{line:ei,handle:eh,text:eh.text,gutterMarkers:eh.gutterMarkers,textClass:eh.textClass,bgClass:eh.bgClass,wrapClass:eh.wrapClass,widgets:eh.widgets}},getViewport:function(){return{from:this.display.showingFrom,to:this.display.showingTo}},addWidget:function(em,ej,eo,ek,eq){var el=this.display;em=cA(this,dW(this.doc,em));var en=em.bottom,ei=em.left;ej.style.position="absolute";el.sizer.appendChild(ej);if(ek=="over"){en=em.top}else{if(ek=="above"||ek=="near"){var eh=Math.max(el.wrapper.clientHeight,this.doc.height),ep=Math.max(el.sizer.clientWidth,el.lineSpace.clientWidth);if((ek=="above"||em.bottom+ej.offsetHeight>eh)&&em.top>ej.offsetHeight){en=em.top-ej.offsetHeight}else{if(em.bottom+ej.offsetHeight<=eh){en=em.bottom}}if(ei+ej.offsetWidth>ep){ei=ep-ej.offsetWidth}}}ej.style.top=en+"px";ej.style.left=ej.style.right="";if(eq=="right"){ei=el.sizer.clientWidth-ej.offsetWidth;ej.style.right="0px"}else{if(eq=="left"){ei=0}else{if(eq=="middle"){ei=(el.sizer.clientWidth-ej.offsetWidth)/2}}ej.style.left=ei+"px"}if(eo){x(this,ei,en,ei+ej.offsetWidth,en+ej.offsetHeight)}},triggerOnKeyDown:b3(null,m),execCommand:function(eh){return c5[eh](this)},findPosH:function(en,ek,el,ei){var eh=1;if(ek<0){eh=-1;ek=-ek}for(var ej=0,em=dW(this.doc,en);ej2){ej.dependencies=[];for(var ei=2;ei0&&ej.ch=this.string.length},sol:function(){return this.pos==0},peek:function(){return this.string.charAt(this.pos)||undefined},next:function(){if(this.posei},eatSpace:function(){var eh=this.pos;while(/[\s\u00a0]/.test(this.string.charAt(this.pos))){++this.pos}return this.pos>eh},skipToEnd:function(){this.pos=this.string.length},skipTo:function(eh){var ei=this.string.indexOf(eh,this.pos);if(ei>-1){this.pos=ei;return true}},backUp:function(eh){this.pos-=eh},column:function(){if(this.lastColumnPos0){return null}if(ej&&ei!==false){this.pos+=ej[0].length}return ej}},current:function(){return this.string.slice(this.start,this.pos)}};z.StringStream=dh;function F(ei,eh){this.lines=[];this.type=eh;this.doc=ei}z.TextMarker=F;aW(F);F.prototype.clear=function(){if(this.explicitlyCleared){return}var eo=this.doc.cm,ei=eo&&!eo.curOp;if(ei){bS(eo)}if(dC(this,"clear")){var ep=this.find();if(ep){M(this,"clear",ep.from,ep.to)}}var ej=null,em=null;for(var ek=0;ekeo.display.maxLineLength){eo.display.maxLine=eh;eo.display.maxLineLength=el;eo.display.maxLineChanged=true}}}if(ej!=null&&eo){O(eo,ej,em+1)}this.lines.length=0;this.explicitlyCleared=true;if(this.atomic&&this.doc.cantEdit){this.doc.cantEdit=false;if(eo){cZ(eo)}}if(ei){U(eo)}};F.prototype.find=function(){var em,el;for(var ei=0;ei=eh.display.showingFrom&&ek.from.line=ej:ep.to>ej);(eo||(eo=[])).push({from:ep.from,to:ek?null:ep.to,marker:em})}}}return eo}function ad(ei,ek,en){if(ei){for(var el=0,eo;el=ek:ep.to>ek);if(ej||em.type=="bookmark"&&ep.from==ek&&(!en||ep.marker.insertLeft)){var eh=ep.from==null||(em.inclusiveLeft?ep.from<=ek:ep.from0&&en){for(var ek=0;ekek)&&(!em||em.widtheo.options.maxHighlightLength){ej=false;ep.pos=Math.min(eq.length,ep.start+50000);eh=null}else{eh=ek.token(ep,ei)}if(!ej||em!=eh){if(enep){el.splice(em,1,ep,el[em+1],eq)}em+=2;eh=Math.min(ep,eq)}if(!er){return}if(ek.opaque){el.splice(et,em-et,ep,er);em=et+2}else{for(;et="\ud800"&&eh<"\udbff"&&emel)){if(ey.to!=null&&eD>ey.to){eD=ey.to;eC=""}if(ev.className){eh+=" "+ev.className}if(ev.startStyle&&ey.from==el){et+=" "+ev.startStyle}if(ev.endStyle&&ey.to==eD){eC+=" "+ev.endStyle}if(ev.title&&!eE){eE=ev.title}if(ev.collapsed&&(!ej||ej.marker.sizeel&&eD>ey.from){eD=ey.from}}if(ev.type=="bookmark"&&ey.from==el&&ev.replacedWith){eq=ev}}if(ej&&(ej.from||0)==el){K(ew,(ej.to==null?eA:ej.to)-el,ej.marker,ej.from==null);if(ej.to==null){return ej.marker.find()}}if(eq&&!ej){K(ew,0,eq)}}if(el>=eA){break}var er=Math.min(eA,eD);while(true){if(es){var ei=el+es.length;if(!ej){var ek=ei>er?es.slice(0,er-el):es;ew.addToken(ew,ek,eB?eB+eh:eh,et,el+ek.length==eD?eC:"",eE)}if(ei>=er){es=es.slice(er-el);el=er;break}el=ei;et=""}es=en.slice(eu,eu=eo[ez++]);eB=j(eo[ez++])}}}function dP(ey,ep,el,et,en){function ek(ez){return el?el[ez]:null}function eo(ez,eB,eA){cT(ez,eB,eA,en);M(ez,"change",ez,ep)}var eu=ep.from,ei=ep.to,er=ep.text;var eq=dw(ey,eu.line),eh=dw(ey,ei.line);var ej=dU(er),ew=ek(er.length-1),es=ei.line-eu.line;if(eu.ch==0&&ei.ch==0&&ej==""){for(var ev=0,ex=er.length-1,em=[];ev1){ey.remove(eu.line+1,es-1)}ey.insert(eu.line+1,em)}}}M(ey,"change",ey,ep);be(ey,et.anchor,et.head,null,true)}function dl(ei){this.lines=ei;this.parent=null;for(var ej=0,ek=ei.length,eh=0;ej50){while(eh.lines.length>50){var ek=eh.lines.splice(eh.lines.length-25,25);var en=new dl(ek);eh.height-=en.height;this.children.splice(ej+1,0,en);en.parent=this}this.maybeSpill()}break}ei-=em}},maybeSpill:function(){if(this.children.length<=10){return}var ek=this;do{var ei=ek.children.splice(ek.children.length-5,5);var ej=new dN(ei);if(!ek.parent){var el=new dN(ek.children);el.parent=ek;ek.children=[el,ej];ek=el}else{ek.size-=ej.size;ek.height-=ej.height;var eh=ce(ek.parent.children,ek);ek.parent.children.splice(eh+1,0,ej)}ej.parent=ek.parent}while(ek.children.length>10);ek.parent.maybeSpill()},iterN:function(eh,eo,en){for(var ei=0,el=this.children.length;ei=el.ch)){ek.push(ej.marker.parent||ej.marker)}}}return ek},getAllMarks:function(){var eh=[];this.iter(function(ej){var ei=ej.markedSpans;if(ei){for(var ek=0;ekei){eh=ei;return true}ei-=el;++ej});return dW(this,I(ej,eh))},indexFromPos:function(ei){ei=dW(this,ei);var eh=ei.ch;if(ei.lineek){ek=eh.from}if(eh.to!=null&&eh.toej-em.cm.options.historyEventDelay)||eo.origin.charAt(0)=="*"))){var ei=dU(en.changes);if(dV(eo.from,eo.to)&&dV(eo.from,ei.to)){ei.to=bZ(eo)}else{en.changes.push(cl(em,eo))}en.anchorAfter=el.anchor;en.headAfter=el.head}else{en={changes:[cl(em,eo)],generation:ek.generation,anchorBefore:em.sel.anchor,headBefore:em.sel.head,anchorAfter:el.anchor,headAfter:el.head};ek.done.push(en);ek.generation=++ek.maxGeneration;while(ek.done.length>ek.undoDepth){ek.done.shift()}}ek.lastTime=ej;ek.lastOp=eh;ek.lastOrigin=eo.origin}function aL(ej){if(!ej){return null}for(var ei=0,eh;ei-1){dU(eq)[eh]=eo[eh];delete eo[eh]}}}}}}return ei}function dj(ek,ej,ei,eh){if(ei0}z.on=bg;z.off=cM;z.signal=af;function aW(eh){eh.prototype.on=function(ei,ej){bg(this,ei,ej)};eh.prototype.off=function(ei,ej){cM(this,ei,ej)}}var aK=30;var bq=z.Pass={toString:function(){return"CodeMirror.Pass"}};function eg(){this.id=null}eg.prototype={set:function(eh,ei){clearTimeout(this.id);this.id=setTimeout(ei,eh)}};function bc(ej,eh,el,em,ei){if(eh==null){eh=ej.search(/[^\s\u00a0]/);if(eh==-1){eh=ej.length}}for(var ek=em||0,en=ei||0;ek"\x80"&&(eh.toUpperCase()!=eh.toLowerCase()||aE.test(eh))}function di(eh){for(var ei in eh){if(eh.hasOwnProperty(ei)&&eh[ei]){return false}}return true}var dI=/[\u0300-\u036F\u0483-\u0487\u0488-\u0489\u0591-\u05BD\u05BF\u05C1-\u05C2\u05C4-\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7-\u06E8\u06EA-\u06ED\uA66F\uA670-\uA672\uA674-\uA67D\uA69F\udc00-\udfff]/;function d6(eh,el,ek,ej){var em=document.createElement(eh);if(ek){em.className=ek}if(ej){em.style.cssText=ej}if(typeof el=="string"){n(em,el)}else{if(el){for(var ei=0;ei0;--eh){ei.removeChild(ei.firstChild)}return ei}function bd(eh,ei){return cD(eh).appendChild(ei)}function n(eh,ei){if(by){eh.innerHTML="";eh.appendChild(document.createTextNode(ei))}else{eh.textContent=ei}}function al(eh){return eh.getBoundingClientRect()}z.replaceGetRect=function(eh){al=eh};var dd=function(){if(by){return false}var eh=d6("div");return"draggable" in eh||"dragDrop" in eh}();function bp(){return false}if(bC){bp=function(ei,eh){return ei.charCodeAt(eh-1)==36&&ei.charCodeAt(eh)==39}}else{if(ae&&!/Version\/([6-9]|\d\d)\b/.test(navigator.userAgent)){bp=function(ei,eh){return/\-[^ \-?]|\?[^ !\'\"\),.\-\/:;\?\]\}]/.test(ei.slice(eh-1,eh+1))}}else{if(b2&&!/Chrome\/(?:29|[3-9]\d|\d\d\d)\./.test(navigator.userAgent)){bp=function(ei,eh){if(eh>1&&ei.charCodeAt(eh-1)==45){if(/\w/.test(ei.charAt(eh-2))&&/[^\-?\.]/.test(ei.charAt(eh))){return true}if(eh>2&&/[\d\.,]/.test(ei.charAt(eh-2))&&/[\d\.,]/.test(ei.charAt(eh))){return false}}return/[~!#%&*)=+}\]|\"\.>,:;][({[<]|-[^\-?\.\u2010-\u201f\u2026]|\?[\w~`@#$%\^&*(_=+{[|><]|…[\w~`@#$%\^&*(_=+{[><]/.test(ei.slice(eh-1,eh+1))}}}}var cY;function i(eh){if(cY!=null){return cY}var ei=d6("div",null,null,"width: 50px; height: 50px; overflow-x: scroll");bd(eh,ei);if(ei.offsetWidth){cY=ei.offsetHeight-ei.clientHeight}return cY||0}var dX;function aP(eh){if(dX==null){var ei=d6("span","\u200b");bd(eh,d6("span",[ei,document.createTextNode("x")]));if(eh.firstChild.offsetHeight!=0){dX=ei.offsetWidth<=1&&ei.offsetHeight>2&&!bz}}if(dX){return d6("span","\u200b")}else{return d6("span","\u00a0",null,"display: inline-block; width: 1px; margin-right: -1px")}}var aw="\n\nb".split(/\n/).length!=3?function(em){var en=0,eh=[],el=em.length;while(en<=el){var ek=em.indexOf("\n",en);if(ek==-1){ek=em.length}var ej=em.slice(en,em.charAt(ek-1)=="\r"?ek-1:ek);var ei=ej.indexOf("\r");if(ei!=-1){eh.push(ej.slice(0,ei));en+=ei+1}else{eh.push(ej);en=ek+1}}return eh}:function(eh){return eh.split(/\r\n?|\n/)};z.splitLines=aw;var aT=window.getSelection?function(ei){try{return ei.selectionStart!=ei.selectionEnd}catch(eh){return false}}:function(ej){try{var eh=ej.ownerDocument.selection.createRange()}catch(ei){}if(!eh||eh.parentElement()!=ej){return false}return eh.compareEndPoints("StartToEnd",eh)!=0};var b9=(function(){var eh=d6("div");if("oncopy" in eh){return true}eh.setAttribute("oncopy","return;");return typeof eh.oncopy=="function"})();var dy={3:"Enter",8:"Backspace",9:"Tab",13:"Enter",16:"Shift",17:"Ctrl",18:"Alt",19:"Pause",20:"CapsLock",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"PrintScrn",45:"Insert",46:"Delete",59:";",91:"Mod",92:"Mod",93:"Mod",109:"-",107:"=",127:"Delete",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",63276:"PageUp",63277:"PageDown",63275:"End",63273:"Home",63234:"Left",63232:"Up",63235:"Right",63233:"Down",63302:"Insert",63272:"Delete"};z.keyNames=dy;(function(){for(var eh=0;eh<10;eh++){dy[eh+48]=String(eh)}for(var eh=65;eh<=90;eh++){dy[eh]=String.fromCharCode(eh)}for(var eh=1;eh<=12;eh++){dy[eh+111]=dy[eh+63235]="F"+eh}})();function cE(eh,en,em,el){if(!eh){return el(en,em,"ltr")}var ek=false;for(var ej=0;ejen||en==em&&ei.to==en){el(Math.max(ei.from,en),Math.min(ei.to,em),ei.level==1?"rtl":"ltr");ek=true}}if(!ek){el(en,em,"ltr")}}function co(eh){return eh.level%2?eh.to:eh.from}function ed(eh){return eh.level%2?eh.from:eh.to}function bO(ei){var eh=a(ei);return eh?co(eh[0]):0}function bY(ei){var eh=a(ei);if(!eh){return ei.text.length}return ed(dU(eh))}function aU(ei,el){var ej=dw(ei.doc,el);var em=t(ei.doc,ej);if(em!=ej){el=a9(em)}var eh=a(em);var ek=!eh?0:eh[0].level%2?bY(em):bO(em);return I(el,ek)}function cy(ej,em){var ei,ek;while(ei=cX(ek=dw(ej.doc,em))){em=ei.find().to.line}var eh=a(ek);var el=!eh?ek.text.length:eh[0].level%2?bO(ek):bY(ek);return I(em,el)}function V(ei,ej,eh){var ek=ei[0].level;if(ej==ek){return true}if(eh==ek){return false}return ejel){dn=null;return ei}if(ek.from==el||ek.to==el){if(ej==null){ej=ei}else{if(V(eh,ek.level,eh[ej].level)){dn=ej;return ei}else{dn=ei;return ej}}}}dn=null;return ej}function dv(eh,ek,ei,ej){if(!ej){return ek+ei}do{ek+=ei}while(ek>0&&dI.test(eh.text.charAt(ek)));return ek}function q(eh,eo,ej,ek){var el=a(eh);if(!el){return P(eh,eo,ej,ek)}var en=ah(el,eo),ei=el[en];var em=dv(eh,eo,ei.level%2?-ej:ej,ek);for(;;){if(em>ei.from&&em0)==ei.level%2?ei.to:ei.from}else{ei=el[en+=ej];if(!ei){return null}if((ej>0)==ei.level%2){em=dv(eh,ei.to,-1,ek)}else{em=dv(eh,ei.from,1,ek)}}}}function P(eh,el,ei,ej){var ek=el+ei;if(ej){while(ek>0&&dI.test(eh.text.charAt(ek))){ek+=ei}}return ek<0||ek>eh.text.length?null:ek}var aI=(function(){var en="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLL";var el="rrrrrrrrrrrr,rNNmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmrrrrrrrnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmNmmmmrrrrrrrrrrrrrrrrrr";function ek(eq){if(eq<=255){return en.charAt(eq)}else{if(1424<=eq&&eq<=1524){return"R"}else{if(1536<=eq&&eq<=1791){return el.charAt(eq-1536)}else{if(1792<=eq&&eq<=2220){return"r"}else{return"L"}}}}}var eh=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;var ep=/[stwN]/,ej=/[LRr]/,ei=/[Lb1n]/,em=/[1n]/;var eo="L";return function(eA){if(!eh.test(eA)){return false}var eG=eA.length,ew=[];for(var eF=0,es;eF*\/]/.test(q)){return g(null,"select-op")}else{if(q=="."&&s.match(/^-?[_a-z][_a-z0-9-]*/i)){return g("qualifier","qualifier")}else{if(q==":"){return g("operator",q)}else{if(/[;{}\[\]\(\)]/.test(q)){return g(null,q)}else{if(q=="u"&&s.match("rl(")){s.backUp(1);r.tokenize=f;return g("property","variable")}else{s.eatWhile(/[\w\\\-]/);return g("property","variable")}}}}}}}}}}}}}}function m(p,q){return function(u,s){var t=false,r;while((r=u.next())!=null){if(r==p&&!t){break}t=!t&&r=="\\"}if(!t){if(q){u.backUp(1)}s.tokenize=c}return g("string","string")}}function f(q,p){q.next();if(!q.match(/\s*[\"\']/,false)){p.tokenize=m(")",true)}else{p.tokenize=c}return g(null,"(")}return{startState:function(p){return{tokenize:c,baseIndent:p||0,stack:[],lastToken:null}},token:function(t,r){r.tokenize=r.tokenize||c;if(r.tokenize==c&&t.eatSpace()){return null}var q=r.tokenize(t,r);if(q&&typeof q!="string"){q=g(q[0],q[1])}var p=r.stack[r.stack.length-1];if(q=="variable"){if(i=="variable-definition"){r.stack.push("propertyValue")}return r.lastToken="variable-2"}else{if(q=="property"){var s=t.current().toLowerCase();if(p=="propertyValue"){if(h.hasOwnProperty(s)){q="string-2"}else{if(l.hasOwnProperty(s)){q="keyword"}else{q="variable-2"}}}else{if(p=="rule"){if(!j.hasOwnProperty(s)){q+=" error"}}else{if(p=="block"){if(j.hasOwnProperty(s)){q="property"}else{if(l.hasOwnProperty(s)){q="keyword"}else{if(h.hasOwnProperty(s)){q="string-2"}else{q="tag"}}}}else{if(!p||p=="@media{"){q="tag"}else{if(p=="@media"){if(n[t.current()]){q="attribute"}else{if(/^(only|not)$/.test(s)){q="keyword"}else{if(s=="and"){q="error"}else{if(k.hasOwnProperty(s)){q="error"}else{q="attribute error"}}}}}else{if(p=="@mediaType"){if(n.hasOwnProperty(s)){q="attribute"}else{if(s=="and"){q="operator"}else{if(/^(only|not)$/.test(s)){q="error"}else{q="error"}}}}else{if(p=="@mediaType("){if(j.hasOwnProperty(s)){}else{if(n.hasOwnProperty(s)){q="error"}else{if(s=="and"){q="operator"}else{if(/^(only|not)$/.test(s)){q="error"}else{q+=" error"}}}}}else{if(p=="@import"){q="tag"}else{q="error"}}}}}}}}}else{if(q=="atom"){if(!p||p=="@media{"||p=="block"){q="builtin"}else{if(p=="propertyValue"){if(!/^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/.test(t.current())){q+=" error"}}else{q="error"}}}else{if(p=="@media"&&i=="{"){q="error"}}}}if(i=="{"){if(p=="@media"||p=="@mediaType"){r.stack[r.stack.length-1]="@media{"}else{var u=a?"block":"rule";r.stack.push(u)}}else{if(i=="}"){if(p=="interpolation"){q="operator"}r.stack.pop();if(p=="propertyValue"){r.stack.pop()}}else{if(i=="interpolation"){r.stack.push("interpolation")}else{if(i=="@media"){r.stack.push("@media")}else{if(i=="@import"){r.stack.push("@import")}else{if(p=="@media"&&/\b(keyword|attribute)\b/.test(q)){r.stack[r.stack.length-1]="@mediaType"}else{if(p=="@mediaType"&&t.current()==","){r.stack[r.stack.length-1]="@media"}else{if(i=="("){if(p=="@media"||p=="@mediaType"){r.stack[r.stack.length-1]="@mediaType";r.stack.push("@mediaType(")}}else{if(i==")"){if(p=="propertyValue"&&r.stack[r.stack.length-2]=="@mediaType("){r.stack.pop();r.stack.pop()}else{if(p=="@mediaType("){r.stack.pop()}}}else{if(i==":"&&r.lastToken=="property"){r.stack.push("propertyValue")}else{if(p=="propertyValue"&&i==";"){r.stack.pop()}else{if(p=="@import"&&i==";"){r.stack.pop()}}}}}}}}}}}}return r.lastToken=q},indent:function(q,p){var r=q.stack.length;if(/^\}/.test(p)){r-=q.stack[r-1]=="propertyValue"?2:1}return q.baseIndent+r*e},electricChars:"}",blockCommentStart:"/*",blockCommentEnd:"*/",fold:"brace"}});(function(){function b(k){var j={};for(var h=0;h=2&&k==">"){m.tokenize=null;break}l=(k=="-")?l+1:0}return["comment","comment"]}if(j.eat("!")){i.tokenize=h;return h(j,i)}},"/":function(i,h){if(i.eat("*")){h.tokenize=a;return a(i,h)}return false}},name:"css-base"});CodeMirror.defineMIME("text/x-scss",{atMediaTypes:e,atMediaFeatures:g,propertyKeywords:d,colorKeywords:c,valueKeywords:f,allowNested:true,hooks:{"$":function(h){h.match(/^[\w-]+/);if(h.peek()==":"){return["variable","variable-definition"]}return["variable","variable"]},"/":function(i,h){if(i.eat("/")){i.skipToEnd();return["comment","comment"]}else{if(i.eat("*")){h.tokenize=a;return a(i,h)}else{return["operator","operator"]}}},"#":function(h){if(h.eat("{")){return["operator","interpolation"]}else{h.eatWhile(/[\w\\\-]/);return["atom","hash"]}}},name:"css-base"})})();CodeMirror.defineMode("javascript",function(P,U){var x=P.indentUnit;var Z=U.statementIndent;var Y=U.json;var B=U.typescript;var b=function(){function al(an){return{type:an,style:"keyword"}}var ag=al("keyword a"),ae=al("keyword b"),ad=al("keyword c");var af=al("operator"),aj={type:"atom",style:"atom"};var ah={"if":al("if"),"while":ag,"with":ag,"else":ae,"do":ae,"try":ae,"finally":ae,"return":ad,"break":ad,"continue":ad,"new":ad,"delete":ad,"throw":ad,"var":al("var"),"const":al("var"),let:al("var"),"function":al("function"),"catch":al("catch"),"for":al("for"),"switch":al("switch"),"case":al("case"),"default":al("default"),"in":af,"typeof":af,"instanceof":af,"true":aj,"false":aj,"null":aj,"undefined":aj,"NaN":aj,"Infinity":aj,"this":al("this")};if(B){var am={type:"variable",style:"variable-3"};var ai={"interface":al("interface"),"class":al("class"),"extends":al("extends"),constructor:al("constructor"),"public":al("public"),"private":al("private"),"protected":al("protected"),"static":al("static"),"super":al("super"),string:am,number:am,bool:am,any:am};for(var ak in ai){ah[ak]=ai[ak]}}return ah}();var V=/[+\-*&%=<>!?|~^]/;function ab(af,ae,ad){ae.tokenize=ad;return ad(af,ae)}function h(ag,ad){var af=false,ae;while((ae=ag.next())!=null){if(ae==ad&&!af){return false}af=!af&&ae=="\\"}return af}var ac,q;function I(af,ae,ad){ac=af;q=ad;return ae}function m(ah,af){var ad=ah.next();if(ad=='"'||ad=="'"){return ab(ah,af,C(ad))}else{if(/[\[\]{}\(\),;\:\.]/.test(ad)){return I(ad)}else{if(ad=="0"&&ah.eat(/x/i)){ah.eatWhile(/[\da-f]/i);return I("number","number")}else{if(/\d/.test(ad)||ad=="-"&&ah.eat(/\d/)){ah.match(/^\d*(?:\.\d*)?(?:[eE][+\-]?\d+)?/);return I("number","number")}else{if(ad=="/"){if(ah.eat("*")){return ab(ah,af,f)}else{if(ah.eat("/")){ah.skipToEnd();return I("comment","comment")}else{if(af.lastType=="operator"||af.lastType=="keyword c"||/^[\[{}\(,;:]$/.test(af.lastType)){h(ah,"/");ah.eatWhile(/[gimy]/);return I("regexp","string-2")}else{ah.eatWhile(V);return I("operator",null,ah.current())}}}}else{if(ad=="#"){ah.skipToEnd();return I("error","error")}else{if(V.test(ad)){ah.eatWhile(V);return I("operator",null,ah.current())}else{ah.eatWhile(/[\w\$_]/);var ag=ah.current(),ae=b.propertyIsEnumerable(ag)&&b[ag];return(ae&&af.lastType!=".")?I(ae.type,ae.style,ag):I("variable","variable",ag)}}}}}}}}function C(ad){return function(af,ae){if(!h(af,ad)){ae.tokenize=m}return I("string","string")}}function f(ag,af){var ad=false,ae;while(ae=ag.next()){if(ae=="/"&&ad){af.tokenize=m;break}ad=(ae=="*")}return I("comment","comment")}var l={atom:true,number:true,variable:true,string:true,regexp:true,"this":true};function v(ai,ae,ad,ah,af,ag){this.indented=ai;this.column=ae;this.type=ad;this.prev=af;this.info=ag;if(ah!=null){this.align=ah}}function y(af,ae){for(var ad=af.localVars;ad;ad=ad.next){if(ad.name==ae){return true}}}function K(ah,ae,ad,ag,ai){var aj=ah.cc;w.state=ah;w.stream=ai;w.marked=null,w.cc=aj;if(!ah.lexical.hasOwnProperty("align")){ah.lexical.align=true}while(true){var af=aj.length?aj.pop():Y?z:A;if(af(ad,ag)){while(aj.length&&aj[aj.length-1].lex){aj.pop()()}if(w.marked){return w.marked}if(ad=="variable"&&y(ah,ag)){return"variable-2"}return ae}}}var w={state:null,column:null,marked:null,cc:null};function a(){for(var ad=arguments.length-1;ad>=0;ad--){w.cc.push(arguments[ad])}}function N(){a.apply(null,arguments);return true}function n(ae){function ad(ah){for(var ag=ah;ag;ag=ag.next){if(ag.name==ae){return true}}return false}var af=w.state;if(af.context){w.marked="def";if(ad(af.localVars)){return}af.localVars={name:ae,next:af.localVars}}else{if(ad(af.globalVars)){return}af.globalVars={name:ae,next:af.globalVars}}}var J={name:"this",next:{name:"arguments"}};function u(){w.state.context={prev:w.state.context,vars:w.state.localVars};w.state.localVars=J}function t(){w.state.localVars=w.state.context.vars;w.state.context=w.state.context.prev}function k(ae,af){var ad=function(){var ah=w.state,ag=ah.indented;if(ah.lexical.type=="stat"){ag=ah.lexical.indented}ah.lexical=new v(ag,w.stream.column(),ae,null,ah.lexical,af)};ad.lex=true;return ad}function M(){var ad=w.state;if(ad.lexical.prev){if(ad.lexical.type==")"){ad.indented=ad.lexical.indented}ad.lexical=ad.lexical.prev}}M.lex=true;function c(ad){return function(ae){if(ae==ad){return N()}else{if(ad==";"){return a()}else{return N(arguments.callee)}}}}function A(ad){if(ad=="var"){return N(k("vardef"),Q,c(";"),M)}if(ad=="keyword a"){return N(k("form"),z,A,M)}if(ad=="keyword b"){return N(k("form"),A,M)}if(ad=="{"){return N(k("}"),o,M)}if(ad==";"){return N()}if(ad=="if"){return N(k("form"),z,A,M,L)}if(ad=="function"){return N(i)}if(ad=="for"){return N(k("form"),c("("),k(")"),g,c(")"),M,A,M)}if(ad=="variable"){return N(k("stat"),H)}if(ad=="switch"){return N(k("form"),z,k("}","switch"),c("{"),o,M,M)}if(ad=="case"){return N(z,c(":"))}if(ad=="default"){return N(c(":"))}if(ad=="catch"){return N(k("form"),u,c("("),r,c(")"),A,M,t)}return a(k("stat"),z,c(";"),M)}function z(ad){return S(ad,false)}function T(ad){return S(ad,true)}function S(ad,af){var ae=af?j:F;if(l.hasOwnProperty(ad)){return N(ae)}if(ad=="function"){return N(i)}if(ad=="keyword c"){return N(af?E:G)}if(ad=="("){return N(k(")"),G,c(")"),M,ae)}if(ad=="operator"){return N(af?T:z)}if(ad=="["){return N(k("]"),W(T,"]"),M,ae)}if(ad=="{"){return N(k("}"),W(p,"}"),M,ae)}return N()}function G(ad){if(ad.match(/[;\}\)\],]/)){return a()}return a(z)}function E(ad){if(ad.match(/[;\}\)\],]/)){return a()}return a(T)}function F(ad,ae){if(ad==","){return N(z)}return j(ad,ae,false)}function j(ad,af,ah){var ae=ah==false?F:j;var ag=ah==false?z:T;if(ad=="operator"){if(/\+\+|--/.test(af)){return N(ae)}if(af=="?"){return N(z,c(":"),ag)}return N(ag)}if(ad==";"){return}if(ad=="("){return N(k(")","call"),W(T,")"),M,ae)}if(ad=="."){return N(X,ae)}if(ad=="["){return N(k("]"),G,c("]"),M,ae)}}function H(ad){if(ad==":"){return N(M,A)}return a(F,c(";"),M)}function X(ad){if(ad=="variable"){w.marked="property";return N()}}function p(ad,ae){if(ad=="variable"){w.marked="property";if(ae=="get"||ae=="set"){return N(D)}}else{if(ad=="number"||ad=="string"){w.marked=ad+" property"}}if(l.hasOwnProperty(ad)){return N(c(":"),T)}}function D(ad){if(ad==":"){return N(z)}if(ad!="variable"){return N(c(":"),z)}w.marked="property";return N(i)}function W(af,ad){function ae(ah){if(ah==","){var ag=w.state.lexical;if(ag.info=="call"){ag.pos=(ag.pos||0)+1}return N(af,ae)}if(ah==ad){return N()}return N(c(ad))}return function(ag){if(ag==ad){return N()}else{return a(af,ae)}}}function o(ad){if(ad=="}"){return N()}return a(A,o)}function s(ad){if(ad==":"){return N(aa)}return a()}function aa(ad){if(ad=="variable"){w.marked="variable-3";return N()}return a()}function Q(ad,ae){if(ad=="variable"){n(ae);return B?N(s,O):N(O)}return a()}function O(ad,ae){if(ae=="="){return N(T,O)}if(ad==","){return N(Q)}}function L(ad,ae){if(ad=="keyword b"&&ae=="else"){return N(k("form"),A,M)}}function g(ad){if(ad=="var"){return N(Q,c(";"),e)}if(ad==";"){return N(e)}if(ad=="variable"){return N(R)}return a(z,c(";"),e)}function R(ad,ae){if(ae=="in"){return N(z)}return N(F,e)}function e(ad,ae){if(ad==";"){return N(d)}if(ae=="in"){return N(z)}return a(z,c(";"),d)}function d(ad){if(ad!=")"){N(z)}}function i(ad,ae){if(ad=="variable"){n(ae);return N(i)}if(ad=="("){return N(k(")"),u,W(r,")"),M,A,t)}}function r(ad,ae){if(ad=="variable"){n(ae);return B?N(s):N()}}return{startState:function(ad){return{tokenize:m,lastType:null,cc:[],lexical:new v((ad||0)-x,0,"block",false),localVars:U.localVars,globalVars:U.globalVars,context:U.localVars&&{vars:U.localVars},indented:0}},token:function(af,ae){if(af.sol()){if(!ae.lexical.hasOwnProperty("align")){ae.lexical.align=false}ae.indented=af.indentation()}if(ae.tokenize!=f&&af.eatSpace()){return null}var ad=ae.tokenize(af,ae);if(ac=="comment"){return ad}ae.lastType=ac=="operator"&&(q=="++"||q=="--")?"incdec":ac;return K(ae,ad,ac,q,af)},indent:function(aj,ad){if(aj.tokenize==f){return CodeMirror.Pass}if(aj.tokenize!=m){return 0}var ai=ad&&ad.charAt(0),ag=aj.lexical;for(var af=aj.cc.length-1;af>=0;--af){var ak=aj.cc[af];if(ak==M){ag=ag.prev}else{if(ak!=L||/^else\b/.test(ad)){break}}}if(ag.type=="stat"&&ai=="}"){ag=ag.prev}if(Z&&ag.type==")"&&ag.prev.type=="stat"){ag=ag.prev}var ah=ag.type,ae=ai==ah;if(ah=="vardef"){return ag.indented+(aj.lastType=="operator"||aj.lastType==","?4:0)}else{if(ah=="form"&&ai=="{"){return ag.indented}else{if(ah=="form"){return ag.indented+x}else{if(ah=="stat"){return ag.indented+(aj.lastType=="operator"||aj.lastType==","?Z||x:0)}else{if(ag.info=="switch"&&!ae&&U.doubleIndentSwitch!=false){return ag.indented+(/^(?:case|default)\b/.test(ad)?x:2*x)}else{if(ag.align){return ag.column+(ae?0:1)}else{return ag.indented+(ae?0:x)}}}}}}},electricChars:":{}",blockCommentStart:Y?null:"/*",blockCommentEnd:Y?null:"*/",lineComment:Y?null:"//",fold:"brace",helperType:Y?"json":"javascript",jsonMode:Y}});CodeMirror.defineMIME("text/javascript","javascript");CodeMirror.defineMIME("text/ecmascript","javascript");CodeMirror.defineMIME("application/javascript","javascript");CodeMirror.defineMIME("application/ecmascript","javascript");CodeMirror.defineMIME("application/json",{name:"javascript",json:true});CodeMirror.defineMIME("application/x-json",{name:"javascript",json:true});CodeMirror.defineMIME("text/typescript",{name:"javascript",typescript:true});CodeMirror.defineMIME("application/typescript",{name:"javascript",typescript:true});CodeMirror.defineMode("xml",function(B,l){var s=B.indentUnit;var A=l.multilineTagIndentFactor||1;var c=l.multilineTagIndentPastTag||true;var y=l.htmlMode?{autoSelfClosers:{area:true,base:true,br:true,col:true,command:true,embed:true,frame:true,hr:true,img:true,input:true,keygen:true,link:true,meta:true,param:true,source:true,track:true,wbr:true},implicitlyClosed:{dd:true,li:true,optgroup:true,option:true,p:true,rp:true,rt:true,tbody:true,td:true,tfoot:true,th:true,tr:true},contextGrabbers:{dd:{dd:true,dt:true},dt:{dd:true,dt:true},li:{li:true},option:{option:true,optgroup:true},optgroup:{optgroup:true},p:{address:true,article:true,aside:true,blockquote:true,dir:true,div:true,dl:true,fieldset:true,footer:true,form:true,h1:true,h2:true,h3:true,h4:true,h5:true,h6:true,header:true,hgroup:true,hr:true,menu:true,nav:true,ol:true,p:true,pre:true,section:true,table:true,ul:true},rp:{rp:true,rt:true},rt:{rp:true,rt:true},tbody:{tbody:true,tfoot:true},td:{td:true,th:true},tfoot:{tbody:true},th:{td:true,th:true},thead:{tbody:true,tfoot:true},tr:{tr:true}},doNotIndent:{pre:true},allowUnquoted:true,allowMissing:true}:{autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:false,allowMissing:false};var b=l.alignCDATA;var g,h;function p(I,H){function F(K){H.tokenize=K;return K(I,H)}var G=I.next();if(G=="<"){if(I.eat("!")){if(I.eat("[")){if(I.match("CDATA[")){return F(x("atom","]]>"))}else{return null}}else{if(I.match("--")){return F(x("comment","-->"))}else{if(I.match("DOCTYPE",true,true)){I.eatWhile(/[\w\._\-]/);return F(C(1))}else{return null}}}}else{if(I.eat("?")){I.eatWhile(/[\w\._\-]/);H.tokenize=x("meta","?>");return"meta"}else{var D=I.eat("/");g="";var J;while((J=I.eat(/[^\s\u00a0=<>\"\'\/?]/))){g+=J}if(!g){return"error"}h=D?"closeTag":"openTag";H.tokenize=o;return"tag"}}}else{if(G=="&"){var E;if(I.eat("#")){if(I.eat("x")){E=I.eatWhile(/[a-fA-F\d]/)&&I.eat(";")}else{E=I.eatWhile(/[\d]/)&&I.eat(";")}}else{E=I.eatWhile(/[\w\.\-:]/)&&I.eat(";")}return E?"atom":"error"}else{I.eatWhile(/[^&<]/);return null}}}function o(F,E){var D=F.next();if(D==">"||(D=="/"&&F.eat(">"))){E.tokenize=p;h=D==">"?"endTag":"selfcloseTag";return"tag"}else{if(D=="="){h="equals";return null}else{if(D=="<"){return"error"}else{if(/[\'\"]/.test(D)){E.tokenize=k(D);E.stringStartCol=F.column();return E.tokenize(F,E)}else{F.eatWhile(/[^\s\u00a0=<>\"\']/);return"word"}}}}}function k(D){var E=function(G,F){while(!G.eol()){if(G.next()==D){F.tokenize=o;break}}return"string"};E.isInAttribute=true;return E}function x(E,D){return function(G,F){while(!G.eol()){if(G.match(D)){F.tokenize=p;break}G.next()}return E}}function C(D){return function(G,F){var E;while((E=G.next())!=null){if(E=="<"){F.tokenize=C(D+1);return F.tokenize(G,F)}else{if(E==">"){if(D==1){F.tokenize=p;break}else{F.tokenize=C(D-1);return F.tokenize(G,F)}}}}return"meta"}}var m,z,i;function a(){for(var D=arguments.length-1;D>=0;D--){m.cc.push(arguments[D])}}function f(){a.apply(null,arguments);return true}function j(D,F){var E=y.doNotIndent.hasOwnProperty(D)||(m.context&&m.context.noIndent);m.context={prev:m.context,tagName:D,indent:m.indented,startOfLine:F,noIndent:E}}function v(){if(m.context){m.context=m.context.prev}}function e(D){if(D=="openTag"){m.tagName=g;m.tagStart=z.column();return f(n,d(m.startOfLine))}else{if(D=="closeTag"){var E=false;if(m.context){if(m.context.tagName!=g){if(y.implicitlyClosed.hasOwnProperty(m.context.tagName.toLowerCase())){v()}E=!m.context||m.context.tagName!=g}}else{E=true}if(E){i="error"}return f(t(E))}}return f()}function d(D){return function(F){var E=m.tagName;m.tagName=m.tagStart=null;if(F=="selfcloseTag"||(F=="endTag"&&y.autoSelfClosers.hasOwnProperty(E.toLowerCase()))){r(E.toLowerCase());return f()}if(F=="endTag"){r(E.toLowerCase());j(E,D);return f()}return f()}}function t(D){return function(E){if(D){i="error"}if(E=="endTag"){v();return f()}i="error";return f(arguments.callee)}}function r(E){var D;while(true){if(!m.context){return}D=m.context.tagName.toLowerCase();if(!y.contextGrabbers.hasOwnProperty(D)||!y.contextGrabbers[D].hasOwnProperty(E)){return}v()}}function n(D){if(D=="word"){i="attribute";return f(q,n)}if(D=="endTag"||D=="selfcloseTag"){return a()}i="error";return f(n)}function q(D){if(D=="equals"){return f(w,n)}if(!y.allowMissing){i="error"}else{if(D=="word"){i="attribute"}}return(D=="endTag"||D=="selfcloseTag")?a():f()}function w(D){if(D=="string"){return f(u)}if(D=="word"&&y.allowUnquoted){i="string";return f()}i="error";return(D=="endTag"||D=="selfCloseTag")?a():f()}function u(D){if(D=="string"){return f(u)}else{return a()}}return{startState:function(){return{tokenize:p,cc:[],indented:0,startOfLine:true,tagName:null,tagStart:null,context:null}},token:function(G,F){if(!F.tagName&&G.sol()){F.startOfLine=true;F.indented=G.indentation()}if(G.eatSpace()){return null}i=h=g=null;var E=F.tokenize(G,F);F.type=h;if((E||h)&&E!="comment"){m=F;z=G;while(true){var D=F.cc.pop()||e;if(D(h||E)){break}}}F.startOfLine=false;return i||E},indent:function(G,D,F){var E=G.context;if(G.tokenize.isInAttribute){return G.stringStartCol+1}if((G.tokenize!=o&&G.tokenize!=p)||E&&E.noIndent){return F?F.match(/^(\s*)/)[0].length:0}if(G.tagName){if(c){return G.tagStart+G.tagName.length+2}else{return G.tagStart+s*A}}if(b&&/",configuration:l.htmlMode?"html":"xml",helperType:l.htmlMode?"html":"xml"}});CodeMirror.defineMIME("text/xml","xml");CodeMirror.defineMIME("application/xml","xml");if(!CodeMirror.mimeModes.hasOwnProperty("text/html")){CodeMirror.defineMIME("text/html",{name:"xml",htmlMode:true})};
\ No newline at end of file
diff --git a/js/cssbeautify.js b/js/cssbeautify.js
new file mode 100644
index 0000000..39f35aa
--- /dev/null
+++ b/js/cssbeautify.js
@@ -0,0 +1,470 @@
+/*
+ Copyright (C) 2013 Sencha Inc.
+ Copyright (C) 2012 Sencha Inc.
+ Copyright (C) 2011 Sencha Inc.
+
+ Author: Ariya Hidayat.
+
+ Permission is hereby granted, free of charge, to any person obtaining a copy
+ of this software and associated documentation files (the "Software"), to deal
+ in the Software without restriction, including without limitation the rights
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ copies of the Software, and to permit persons to whom the Software is
+ furnished to do so, subject to the following conditions:
+
+ The above copyright notice and this permission notice shall be included in
+ all copies or substantial portions of the Software.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ THE SOFTWARE.
+*/
+
+/*jslint continue: true, indent: 4 */
+/*global exports:true, module:true, window:true */
+
+(function () {
+
+ 'use strict';
+
+ function cssbeautify(style, opt) {
+
+ var options, index = 0, length = style.length, blocks, formatted = '',
+ ch, ch2, str, state, State, depth, quote, comment,
+ openbracesuffix = true,
+ autosemicolon = false,
+ trimRight;
+
+ options = arguments.length > 1 ? opt : {};
+ if (typeof options.indent === 'undefined') {
+ options.indent = ' ';
+ }
+ if (typeof options.openbrace === 'string') {
+ openbracesuffix = (options.openbrace === 'end-of-line');
+ }
+ if (typeof options.autosemicolon === 'boolean') {
+ autosemicolon = options.autosemicolon;
+ }
+
+ function isWhitespace(c) {
+ return (c === ' ') || (c === '\n') || (c === '\t') || (c === '\r') || (c === '\f');
+ }
+
+ function isQuote(c) {
+ return (c === '\'') || (c === '"');
+ }
+
+ // FIXME: handle Unicode characters
+ function isName(c) {
+ return (ch >= 'a' && ch <= 'z') ||
+ (ch >= 'A' && ch <= 'Z') ||
+ (ch >= '0' && ch <= '9') ||
+ '-_*.:#'.indexOf(c) >= 0;
+ }
+
+ function appendIndent() {
+ var i;
+ for (i = depth; i > 0; i -= 1) {
+ formatted += options.indent;
+ }
+ }
+
+ function openBlock() {
+ formatted = trimRight(formatted);
+ if (openbracesuffix) {
+ formatted += ' {';
+ } else {
+ formatted += '\n';
+ appendIndent();
+ formatted += '{';
+ }
+ if (ch2 !== '\n') {
+ formatted += '\n';
+ }
+ depth += 1;
+ }
+
+ function closeBlock() {
+ var ch;
+ depth -= 1;
+ formatted = trimRight(formatted);
+
+ if (autosemicolon) {
+ ch = formatted.charAt(formatted.length - 1);
+ if (ch !== ';' && ch !== '{') {
+ formatted += ';';
+ }
+ }
+
+ formatted += '\n';
+ appendIndent();
+ formatted += '}';
+ blocks.push(formatted);
+ formatted = '';
+ }
+
+ if (String.prototype.trimRight) {
+ trimRight = function (s) {
+ return s.trimRight();
+ };
+ } else {
+ // old Internet Explorer
+ trimRight = function (s) {
+ return s.replace(/\s+$/, '');
+ };
+ }
+
+ State = {
+ Start: 0,
+ AtRule: 1,
+ Block: 2,
+ Selector: 3,
+ Ruleset: 4,
+ Property: 5,
+ Separator: 6,
+ Expression: 7,
+ URL: 8
+ };
+
+ depth = 0;
+ state = State.Start;
+ comment = false;
+ blocks = [];
+
+ // We want to deal with LF (\n) only
+ style = style.replace(/\r\n/g, '\n');
+
+ while (index < length) {
+ ch = style.charAt(index);
+ ch2 = style.charAt(index + 1);
+ index += 1;
+
+ // Inside a string literal?
+ if (isQuote(quote)) {
+ formatted += ch;
+ if (ch === quote) {
+ quote = null;
+ }
+ if (ch === '\\' && ch2 === quote) {
+ // Don't treat escaped character as the closing quote
+ formatted += ch2;
+ index += 1;
+ }
+ continue;
+ }
+
+ // Starting a string literal?
+ if (isQuote(ch)) {
+ formatted += ch;
+ quote = ch;
+ continue;
+ }
+
+ // Comment
+ if (comment) {
+ formatted += ch;
+ if (ch === '*' && ch2 === '/') {
+ comment = false;
+ formatted += ch2;
+ index += 1;
+ }
+ continue;
+ } else {
+ if (ch === '/' && ch2 === '*') {
+ comment = true;
+ formatted += ch;
+ formatted += ch2;
+ index += 1;
+ continue;
+ }
+ }
+
+ if (state === State.Start) {
+
+ if (blocks.length === 0) {
+ if (isWhitespace(ch) && formatted.length === 0) {
+ continue;
+ }
+ }
+
+ // Copy white spaces and control characters
+ if (ch <= ' ' || ch.charCodeAt(0) >= 128) {
+ state = State.Start;
+ formatted += ch;
+ continue;
+ }
+
+ // Selector or at-rule
+ if (isName(ch) || (ch === '[') || (ch === '@')) {
+
+ // Clear trailing whitespaces and linefeeds.
+ str = trimRight(formatted);
+
+ if (str.length === 0) {
+ // If we have empty string after removing all the trailing
+ // spaces, that means we are right after a block.
+ // Ensure a blank line as the separator.
+ if (blocks.length > 0) {
+ formatted = '\n\n';
+ }
+ } else {
+ // After finishing a ruleset or directive statement,
+ // there should be one blank line.
+ if (str.charAt(str.length - 1) === '}' ||
+ str.charAt(str.length - 1) === ';') {
+
+ formatted = str + '\n\n';
+ } else {
+ // After block comment, keep all the linefeeds but
+ // start from the first column (remove whitespaces prefix).
+ while (true) {
+ ch2 = formatted.charAt(formatted.length - 1);
+ if (ch2 !== ' ' && ch2.charCodeAt(0) !== 9) {
+ break;
+ }
+ formatted = formatted.substr(0, formatted.length - 1);
+ }
+ }
+ }
+ formatted += ch;
+ state = (ch === '@') ? State.AtRule : State.Selector;
+ continue;
+ }
+ }
+
+ if (state === State.AtRule) {
+
+ // ';' terminates a statement.
+ if (ch === ';') {
+ formatted += ch;
+ state = State.Start;
+ continue;
+ }
+
+ // '{' starts a block
+ if (ch === '{') {
+ str = trimRight(formatted);
+ openBlock();
+ state = (str === '@font-face') ? State.Ruleset : State.Block;
+ continue;
+ }
+
+ formatted += ch;
+ continue;
+ }
+
+ if (state === State.Block) {
+
+ // Selector
+ if (isName(ch)) {
+
+ // Clear trailing whitespaces and linefeeds.
+ str = trimRight(formatted);
+
+ if (str.length === 0) {
+ // If we have empty string after removing all the trailing
+ // spaces, that means we are right after a block.
+ // Ensure a blank line as the separator.
+ if (blocks.length > 0) {
+ formatted = '\n\n';
+ }
+ } else {
+ // Insert blank line if necessary.
+ if (str.charAt(str.length - 1) === '}') {
+ formatted = str + '\n\n';
+ } else {
+ // After block comment, keep all the linefeeds but
+ // start from the first column (remove whitespaces prefix).
+ while (true) {
+ ch2 = formatted.charAt(formatted.length - 1);
+ if (ch2 !== ' ' && ch2.charCodeAt(0) !== 9) {
+ break;
+ }
+ formatted = formatted.substr(0, formatted.length - 1);
+ }
+ }
+ }
+
+ appendIndent();
+ formatted += ch;
+ state = State.Selector;
+ continue;
+ }
+
+ // '}' resets the state.
+ if (ch === '}') {
+ closeBlock();
+ state = State.Start;
+ continue;
+ }
+
+ formatted += ch;
+ continue;
+ }
+
+ if (state === State.Selector) {
+
+ // '{' starts the ruleset.
+ if (ch === '{') {
+ openBlock();
+ state = State.Ruleset;
+ continue;
+ }
+
+ // '}' resets the state.
+ if (ch === '}') {
+ closeBlock();
+ state = State.Start;
+ continue;
+ }
+
+ formatted += ch;
+ continue;
+ }
+
+ if (state === State.Ruleset) {
+
+ // '}' finishes the ruleset.
+ if (ch === '}') {
+ closeBlock();
+ state = State.Start;
+ if (depth > 0) {
+ state = State.Block;
+ }
+ continue;
+ }
+
+ // Make sure there is no blank line or trailing spaces inbetween
+ if (ch === '\n') {
+ formatted = trimRight(formatted);
+ formatted += '\n';
+ continue;
+ }
+
+ // property name
+ if (!isWhitespace(ch)) {
+ formatted = trimRight(formatted);
+ formatted += '\n';
+ appendIndent();
+ formatted += ch;
+ state = State.Property;
+ continue;
+ }
+ formatted += ch;
+ continue;
+ }
+
+ if (state === State.Property) {
+
+ // ':' concludes the property.
+ if (ch === ':') {
+ formatted = trimRight(formatted);
+ formatted += ': ';
+ state = State.Expression;
+ if (isWhitespace(ch2)) {
+ state = State.Separator;
+ }
+ continue;
+ }
+
+ // '}' finishes the ruleset.
+ if (ch === '}') {
+ closeBlock();
+ state = State.Start;
+ if (depth > 0) {
+ state = State.Block;
+ }
+ continue;
+ }
+
+ formatted += ch;
+ continue;
+ }
+
+ if (state === State.Separator) {
+
+ // Non-whitespace starts the expression.
+ if (!isWhitespace(ch)) {
+ formatted += ch;
+ state = State.Expression;
+ continue;
+ }
+
+ // Anticipate string literal.
+ if (isQuote(ch2)) {
+ state = State.Expression;
+ }
+
+ continue;
+ }
+
+ if (state === State.Expression) {
+
+ // '}' finishes the ruleset.
+ if (ch === '}') {
+ closeBlock();
+ state = State.Start;
+ if (depth > 0) {
+ state = State.Block;
+ }
+ continue;
+ }
+
+ // ';' completes the declaration.
+ if (ch === ';') {
+ formatted = trimRight(formatted);
+ formatted += ';\n';
+ state = State.Ruleset;
+ continue;
+ }
+
+ formatted += ch;
+
+ if (ch === '(') {
+ if (formatted.charAt(formatted.length - 2) === 'l' &&
+ formatted.charAt(formatted.length - 3) === 'r' &&
+ formatted.charAt(formatted.length - 4) === 'u') {
+
+ // URL starts with '(' and closes with ')'.
+ state = State.URL;
+ continue;
+ }
+ }
+
+ continue;
+ }
+
+ if (state === State.URL) {
+
+
+ // ')' finishes the URL (only if it is not escaped).
+ if (ch === ')' && formatted.charAt(formatted.length - 1 !== '\\')) {
+ formatted += ch;
+ state = State.Expression;
+ continue;
+ }
+ }
+
+ // The default action is to copy the character (to prevent
+ // infinite loop).
+ formatted += ch;
+ }
+
+ formatted = blocks.join('') + formatted;
+
+ return formatted;
+ }
+
+ if (typeof exports !== 'undefined') {
+ // Node.js module.
+ module.exports = exports = cssbeautify;
+ } else if (typeof window === 'object') {
+ // Browser loading.
+ window.cssbeautify = cssbeautify;
+ }
+
+}());
diff --git a/js/cssbeautify.min.js b/js/cssbeautify.min.js
new file mode 100644
index 0000000..86b9e42
--- /dev/null
+++ b/js/cssbeautify.min.js
@@ -0,0 +1 @@
+(function(){function a(s,f){var h,m=0,i=s.length,t,e="",p,g,q,k,o,y,u,d,r=true,j=false,n;h=arguments.length>1?f:{};if(typeof h.indent==="undefined"){h.indent=" "}if(typeof h.openbrace==="string"){r=(h.openbrace==="end-of-line")}if(typeof h.autosemicolon==="boolean"){j=h.autosemicolon}function l(z){return(z===" ")||(z==="\n")||(z==="\t")||(z==="\r")||(z==="\f")}function b(z){return(z==="'")||(z==='"')}function c(z){return(p>="a"&&p<="z")||(p>="A"&&p<="Z")||(p>="0"&&p<="9")||"-_*.:#".indexOf(z)>=0}function x(){var z;for(z=y;z>0;z-=1){e+=h.indent}}function w(){e=n(e);if(r){e+=" {"}else{e+="\n";x();e+="{"}if(g!=="\n"){e+="\n"}y+=1}function v(){var z;y-=1;e=n(e);if(j){z=e.charAt(e.length-1);if(z!==";"&&z!=="{"){e+=";"}}e+="\n";x();e+="}";t.push(e);e=""}if(String.prototype.trimRight){n=function(z){return z.trimRight()}}else{n=function(z){return z.replace(/\s+$/,"")}}o={Start:0,AtRule:1,Block:2,Selector:3,Ruleset:4,Property:5,Separator:6,Expression:7,URL:8};y=0;k=o.Start;d=false;t=[];s=s.replace(/\r\n/g,"\n");while(m=128){k=o.Start;e+=p;continue}if(c(p)||(p==="[")||(p==="@")){q=n(e);if(q.length===0){if(t.length>0){e="\n\n"}}else{if(q.charAt(q.length-1)==="}"||q.charAt(q.length-1)===";"){e=q+"\n\n"}else{while(true){g=e.charAt(e.length-1);if(g!==" "&&g.charCodeAt(0)!==9){break}e=e.substr(0,e.length-1)}}}e+=p;k=(p==="@")?o.AtRule:o.Selector;continue}}if(k===o.AtRule){if(p===";"){e+=p;k=o.Start;continue}if(p==="{"){q=n(e);w();k=(q==="@font-face")?o.Ruleset:o.Block;continue}e+=p;continue}if(k===o.Block){if(c(p)){q=n(e);if(q.length===0){if(t.length>0){e="\n\n"}}else{if(q.charAt(q.length-1)==="}"){e=q+"\n\n"}else{while(true){g=e.charAt(e.length-1);if(g!==" "&&g.charCodeAt(0)!==9){break}e=e.substr(0,e.length-1)}}}x();e+=p;k=o.Selector;continue}if(p==="}"){v();k=o.Start;continue}e+=p;continue}if(k===o.Selector){if(p==="{"){w();k=o.Ruleset;continue}if(p==="}"){v();k=o.Start;continue}e+=p;continue}if(k===o.Ruleset){if(p==="}"){v();k=o.Start;if(y>0){k=o.Block}continue}if(p==="\n"){e=n(e);e+="\n";continue}if(!l(p)){e=n(e);e+="\n";x();e+=p;k=o.Property;continue}e+=p;continue}if(k===o.Property){if(p===":"){e=n(e);e+=": ";k=o.Expression;if(l(g)){k=o.Separator}continue}if(p==="}"){v();k=o.Start;if(y>0){k=o.Block}continue}e+=p;continue}if(k===o.Separator){if(!l(p)){e+=p;k=o.Expression;continue}if(b(g)){k=o.Expression}continue}if(k===o.Expression){if(p==="}"){v();k=o.Start;if(y>0){k=o.Block}continue}if(p===";"){e=n(e);e+=";\n";k=o.Ruleset;continue}e+=p;if(p==="("){if(e.charAt(e.length-2)==="l"&&e.charAt(e.length-3)==="r"&&e.charAt(e.length-4)==="u"){k=o.URL;continue}}continue}if(k===o.URL){if(p===")"&&e.charAt(e.length-1!=="\\")){e+=p;k=o.Expression;continue}}e+=p}e=t.join("")+e;return e}if(typeof exports!=="undefined"){module.exports=exports=a}else{if(typeof window==="object"){window.cssbeautify=a}}}());
\ No newline at end of file
diff --git a/js/custom.js b/js/custom.js
new file mode 100644
index 0000000..33ed5a2
--- /dev/null
+++ b/js/custom.js
@@ -0,0 +1,93 @@
+$(document).ready(function()
+{
+ var input = CodeMirror.fromTextArea(document.getElementById("input"), {
+ lineNumbers: true,
+ matchBrackets: false,
+ lineWrapping: true,
+ mode: 'text/html'
+ }),
+ output = CodeMirror.fromTextArea(document.getElementById("output"), {
+ lineNumbers: true,
+ matchBrackets: false,
+ lineWrapping: true,
+ readOnly: true,
+ mode: 'css'
+ }),
+ checkboxes = $('input[type="checkbox"]'),
+ radios = $('input[type="radio"]');
+
+ $('input').iCheck({
+ checkboxClass: 'icheckbox_futurico',
+ radioClass: 'iradio_futurico'
+ });
+
+ checkboxes.on('ifChecked', function(){
+ $(this).val('on');
+ });
+ checkboxes.on('ifUnchecked', function(){
+ $(this).val('off');
+ });
+ radios.on('ifChanged', function(){
+ $(this).val($(this).val());
+ });
+
+ $('#select_all').click(function(e)
+ {
+ e.preventDefault();
+
+ var start = output.firstLine(), end = output.lastLine() + 1;
+ output.setSelection({line: start, ch: 0}, {line:end, ch: 0});
+ });
+
+ $('#extract_form').on('submit', function(e)
+ {
+ e.preventDefault();
+
+ var input_val = $('').append($('#input').val()),
+ extract_ids = $('#extract_ids').val(),
+ extract_classes = $('#extract_classes').val(),
+ extract_inline = $('#extract_inline').val(),
+ extract_children = $('#extract_children').val(),
+ indent = $('input[name="indent"]:checked').val(),
+ openbrace = $('input[name="openbrace"]:checked').val(),
+ autosemicolon = $('#autosemicolon').val(),
+ options = {
+ extractInline : extract_inline,
+ extractChildren : extract_children
+ },
+ cssboptions = {
+ openbrace : openbrace
+ };
+
+ if (indent === 'twospaces')
+ {
+ cssboptions.indent = ' ';
+ }
+ else if (indent === 'tab')
+ {
+ cssboptions.indent = '\t';
+ }
+ else
+ {
+ cssboptions.indent = ' ';
+ }
+
+ if (autosemicolon === 'on')
+ {
+ cssboptions.autosemicolon = true;
+ }
+
+ if (extract_ids === 'on' && extract_classes === 'on')
+ {
+ output.setValue(extractCSS.extractIDs(input_val, options, cssboptions)+'\n\n'+extractCSS.extractClasses(input_val, options, cssboptions));
+ }
+ else if (extract_ids === 'on' && extract_classes !== 'on')
+ {
+ output.setValue(extractCSS.extractIDs(input_val, options, cssboptions));
+ }
+ else
+ {
+ output.setValue(extractCSS.extractClasses(input_val, options, cssboptions));
+ }
+ });
+});
\ No newline at end of file
diff --git a/js/extractcss.js b/js/extractcss.js
new file mode 100644
index 0000000..ce5edb0
--- /dev/null
+++ b/js/extractcss.js
@@ -0,0 +1,169 @@
+/**
+ * extractcss.js
+ * https://github.com/adnantopal/extractcss
+ * http://extractcss.com/
+ * Author: @adnantopal
+ * Copyright 2013, Adnan Topal (atopal.com)
+ * Licensed under the MIT license.
+ */
+var extractCSS = {
+ extractClasses : function( data, options, cssboptions )
+ {
+ var allClassesTmp = {},
+ allClasses = [],
+ classStyle = '',
+ output = '';
+
+ $(data).find('*[class=""]').removeAttr('class');
+
+ $.each($(data).find('*[class]'), function()
+ {
+ var split = ($(this).attr('class').trim().length > 0 ? $(this).attr('class').trim().split(/\s+/).reverse() : false);
+ for (var i=split.length;--i>-1;)
+ {
+ allClassesTmp[ split[i] ] = 1;
+
+ if (i == '0' && split[i].length > 0 && $(data).find('.'+split[i]+' > *').length && options.extractChildren === 'on')
+ {
+ $.each($(data).find('.'+split[i]+' > *'), function()
+ {
+ if (!$(this).attr('class') && !$(this).attr('id'))
+ {
+ var childTag = $(this).prop('tagName').toLowerCase(),
+ children = '',
+ ib = 0,
+ il = $(this).find("*").length;
+
+ allClassesTmp[ split[i] + ' > ' + childTag ] = 1;
+
+ for(;ib ' + $(this).find("*").eq(ib).prop('tagName').toLowerCase();
+ if ($(data).find('.' + split[i] + ' > ' + childTag + ' ' + children).length)
+ {
+ allClassesTmp[ split[i] + ' > ' + childTag + children ] = 1;
+ }
+ else
+ {
+ return;
+ }
+ }
+ }
+ }
+ }
+ });
+ }
+ }
+ });
+
+ for (var i in allClassesTmp)
+ {
+ allClasses.push(i);
+ }
+
+ var is = 0,
+ isl = allClasses.length;
+ for (; is 0 ? $(this).attr('id').trim().split(/\s+/).reverse() : false);
+ for (var i=split.length;--i>-1;)
+ {
+ allIDsTmp[ split[i] ] = 1;
+
+ if (i == '0' && $(data).find('#'+split[i]+' > *').length && options.extractChildren === 'on')
+ {
+ $.each($(data).find('#'+split[i]+' > *'), function()
+ {
+ if (!$(this).attr('class') && !$(this).attr('id'))
+ {
+ var childTag = $(this).prop('tagName').toLowerCase(),
+ children = '',
+ ib = 0,
+ il = $(this).find("*").length;
+
+ allIDsTmp[ split[i] + ' > ' + childTag ] = 1;
+
+ for(;ib ' + $(this).find("*").eq(ib).prop('tagName').toLowerCase();
+ if ($(data).find('.' + split[i] + ' > ' + childTag + ' ' + children).length)
+ {
+ allIDsTmp[ split[i] + ' > ' + childTag + children ] = 1;
+ }
+ else
+ {
+ return;
+ }
+ }
+ }
+ }
+ }
+ });
+ }
+ }
+ });
+
+ for (var i in allIDsTmp)
+ {
+ allIDs.push(i);
+ }
+
+ var is = 0,
+ isl = allIDs.length;
+ for (; isB&&(B=-50);e(this);return b.each(function(){K(this);var a=f(this),b=this,c=b.id,d=
+-B+"%",e=100+2*B+"%",e={position:"absolute",top:d,left:d,display:"block",width:e,height:e,margin:0,padding:0,background:"#fff",border:0,opacity:0},d=G?{position:"absolute",visibility:"hidden"}:B?e:{position:"absolute",opacity:0},h="checkbox"==b[l]?g.checkboxClass||"icheckbox":g.radioClass||"i"+x,k=f(D+'[for="'+c+'"]').add(a.closest(D)),q=a.wrap('')[r]("ifCreated").parent().append(g.insert),e=f('').css(e).appendTo(q);a.data(n,{o:g,s:a.attr("style")}).css(d);
+g.inheritClass&&q[t](b.className);g.inheritID&&c&&q.attr("id",n+"-"+c);"static"==q.css("position")&&q.css("position","relative");C(a,!0,E);if(k.length)k.on("click.i mouseenter.i mouseleave.i touchbegin.i touchend.i",function(c){var d=c[l],e=f(this);if(!b[u])if("click"==d?C(a,!1,!0):z&&(/ve|nd/.test(d)?(q[A](m),e[A](s)):(q[t](m),e[t](s))),G)c.stopPropagation();else return!1});a.on("click.i focus.i blur.i keyup.i keydown.i keypress.i",function(c){var d=c[l];c=c.keyCode;if("click"==d)return!1;if("keydown"==
+d&&32==c)return b[l]==x&&b[j]||(b[j]?w(a,j):p(a,j)),!1;if("keyup"==d&&b[l]==x)!b[j]&&p(a,j);else if(/us|ur/.test(d))q["blur"==d?A:t](y)});e.on("click mousedown mouseup mouseover mouseout touchbegin.i touchend.i",function(d){var c=d[l],e=/wn|up/.test(c)?v:m;if(!b[u]){if("click"==c)C(a,!1,!0);else{if(/wn|er|in/.test(c))q[t](e);else q[A](e+" "+v);if(k.length&&z&&e==m)k[/ut|nd/.test(c)?A:t](s)}if(G)d.stopPropagation();else return!1}})})}return this}})(jQuery);
\ No newline at end of file