(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-d5e303e8"],{"0293":function(t,e,n){(function(t){t(n("fd08"))})((function(t){"use strict";t.defineMode("javascript",(function(e,n){var i,r,s=e.indentUnit,o=n.statementIndent,a=n.jsonld,l=n.json||a,u=n.typescript,h=n.wordCharacters||/[\w$\xa1-\uffff]/,c=function(){function t(t){return{type:t,style:"keyword"}}var e=t("keyword a"),n=t("keyword b"),i=t("keyword c"),r=t("keyword d"),s=t("operator"),o={type:"atom",style:"atom"};return{if:t("if"),while:e,with:e,else:n,do:n,try:n,finally:n,return:r,break:r,continue:r,new:t("new"),delete:i,void:i,throw:i,debugger:t("debugger"),var:t("var"),const:t("var"),let:t("var"),function:t("function"),catch:t("catch"),for:t("for"),switch:t("switch"),case:t("case"),default:t("default"),in:s,typeof:s,instanceof:s,true:o,false:o,null:o,undefined:o,NaN:o,Infinity:o,this:t("this"),class:t("class"),super:t("atom"),yield:i,export:t("export"),import:t("import"),extends:i,await:i}}(),p=/[+\-*&%=<>!?|~^@]/,_=/^@(context|id|value|language|type|container|list|set|reverse|index|base|vocab|graph)"/;function f(t){var e,n=!1,i=!1;while(null!=(e=t.next())){if(!n){if("/"==e&&!i)return;"["==e?i=!0:i&&"]"==e&&(i=!1)}n=!n&&"\\"==e}}function d(t,e,n){return i=t,r=n,e}function g(t,e){var n=t.next();if('"'==n||"'"==n)return e.tokenize=m(n),e.tokenize(t,e);if("."==n&&t.match(/^\d[\d_]*(?:[eE][+\-]?[\d_]+)?/))return d("number","number");if("."==n&&t.match(".."))return d("spread","meta");if(/[\[\]{}\(\),;\:\.]/.test(n))return d(n);if("="==n&&t.eat(">"))return d("=>","operator");if("0"==n&&t.match(/^(?:x[\dA-Fa-f_]+|o[0-7_]+|b[01_]+)n?/))return d("number","number");if(/\d/.test(n))return t.match(/^[\d_]*(?:n|(?:\.[\d_]*)?(?:[eE][+\-]?[\d_]+)?)?/),d("number","number");if("/"==n)return t.eat("*")?(e.tokenize=v,v(t,e)):t.eat("/")?(t.skipToEnd(),d("comment","comment")):ee(t,e,1)?(f(t),t.match(/^\b(([gimyus])(?![gimyus]*\2))+\b/),d("regexp","string-2")):(t.eat("="),d("operator","operator",t.current()));if("`"==n)return e.tokenize=y,y(t,e);if("#"==n&&"!"==t.peek())return t.skipToEnd(),d("meta","meta");if("#"==n&&t.eatWhile(h))return d("variable","property");if("<"==n&&t.match("!--")||"-"==n&&t.match("->")&&!/\S/.test(t.string.slice(0,t.start)))return t.skipToEnd(),d("comment","comment");if(p.test(n))return">"==n&&e.lexical&&">"==e.lexical.type||(t.eat("=")?"!"!=n&&"="!=n||t.eat("="):/[<>*+\-|&?]/.test(n)&&(t.eat(n),">"==n&&t.eat(n))),"?"==n&&t.eat(".")?d("."):d("operator","operator",t.current());if(h.test(n)){t.eatWhile(h);var i=t.current();if("."!=e.lastType){if(c.propertyIsEnumerable(i)){var r=c[i];return d(r.type,r.style,i)}if("async"==i&&t.match(/^(\s|\/\*([^*]|\*(?!\/))*?\*\/)*[\[\(\w]/,!1))return d("async","keyword",i)}return d("variable","variable",i)}}function m(t){return function(e,n){var i,r=!1;if(a&&"@"==e.peek()&&e.match(_))return n.tokenize=g,d("jsonld-keyword","meta");while(null!=(i=e.next())){if(i==t&&!r)break;r=!r&&"\\"==i}return r||(n.tokenize=g),d("string","string")}}function v(t,e){var n,i=!1;while(n=t.next()){if("/"==n&&i){e.tokenize=g;break}i="*"==n}return d("comment","comment")}function y(t,e){var n,i=!1;while(null!=(n=t.next())){if(!i&&("`"==n||"$"==n&&t.eat("{"))){e.tokenize=g;break}i=!i&&"\\"==n}return d("quasi","string-2",t.current())}var b="([{}])";function w(t,e){e.fatArrowAt&&(e.fatArrowAt=null);var n=t.string.indexOf("=>",t.start);if(!(n<0)){if(u){var i=/:\s*(?:\w+(?:<[^>]*>|\[\])?|\{[^}]*\})\s*$/.exec(t.string.slice(t.start,n));i&&(n=i.index)}for(var r=0,s=!1,o=n-1;o>=0;--o){var a=t.string.charAt(o),l=b.indexOf(a);if(l>=0&&l<3){if(!r){++o;break}if(0==--r){"("==a&&(s=!0);break}}else if(l>=3&&l<6)++r;else if(h.test(a))s=!0;else if(/["'\/`]/.test(a))for(;;--o){if(0==o)return;var c=t.string.charAt(o-1);if(c==a&&"\\"!=t.string.charAt(o-2)){o--;break}}else if(s&&!r){++o;break}}s&&!r&&(e.fatArrowAt=o)}}var x={atom:!0,number:!0,variable:!0,string:!0,regexp:!0,this:!0,"jsonld-keyword":!0};function k(t,e,n,i,r,s){this.indented=t,this.column=e,this.type=n,this.prev=r,this.info=s,null!=i&&(this.align=i)}function C(t,e){for(var n=t.localVars;n;n=n.next)if(n.name==e)return!0;for(var i=t.context;i;i=i.prev)for(n=i.vars;n;n=n.next)if(n.name==e)return!0}function S(t,e,n,i,r){var s=t.cc;T.state=t,T.stream=r,T.marked=null,T.cc=s,T.style=e,t.lexical.hasOwnProperty("align")||(t.lexical.align=!0);while(1){var o=s.length?s.pop():l?K:H;if(o(n,i)){while(s.length&&s[s.length-1].lex)s.pop()();return T.marked?T.marked:"variable"==n&&C(t,i)?"variable-2":e}}}var T={state:null,column:null,marked:null,cc:null};function O(){for(var t=arguments.length-1;t>=0;t--)T.cc.push(arguments[t])}function L(){return O.apply(null,arguments),!0}function E(t,e){for(var n=e;n;n=n.next)if(n.name==t)return!0;return!1}function A(t){var e=T.state;if(T.marked="def",e.context)if("var"==e.lexical.info&&e.context&&e.context.block){var i=M(t,e.context);if(null!=i)return void(e.context=i)}else if(!E(t,e.localVars))return void(e.localVars=new D(t,e.localVars));n.globalVars&&!E(t,e.globalVars)&&(e.globalVars=new D(t,e.globalVars))}function M(t,e){if(e){if(e.block){var n=M(t,e.prev);return n?n==e.prev?e:new R(n,e.vars,!0):null}return E(t,e.vars)?e:new R(e.prev,new D(t,e.vars),!1)}return null}function N(t){return"public"==t||"private"==t||"protected"==t||"abstract"==t||"readonly"==t}function R(t,e,n){this.prev=t,this.vars=e,this.block=n}function D(t,e){this.name=t,this.next=e}var W=new D("this",new D("arguments",null));function P(){T.state.context=new R(T.state.context,T.state.localVars,!1),T.state.localVars=W}function z(){T.state.context=new R(T.state.context,T.state.localVars,!0),T.state.localVars=null}function I(){T.state.localVars=T.state.context.vars,T.state.context=T.state.context.prev}function j(t,e){var n=function(){var n=T.state,i=n.indented;if("stat"==n.lexical.type)i=n.lexical.indented;else for(var r=n.lexical;r&&")"==r.type&&r.align;r=r.prev)i=r.indented;n.lexical=new k(i,T.stream.column(),t,null,n.lexical,e)};return n.lex=!0,n}function F(){var t=T.state;t.lexical.prev&&(")"==t.lexical.type&&(t.indented=t.lexical.indented),t.lexical=t.lexical.prev)}function B(t){function e(n){return n==t?L():";"==t||"}"==n||")"==n||"]"==n?O():L(e)}return e}function H(t,e){return"var"==t?L(j("vardef",e),St,B(";"),F):"keyword a"==t?L(j("form"),G,H,F):"keyword b"==t?L(j("form"),H,F):"keyword d"==t?T.stream.match(/^\s*$/,!1)?L():L(j("stat"),$,B(";"),F):"debugger"==t?L(B(";")):"{"==t?L(j("}"),z,ct,F,I):";"==t?L():"if"==t?("else"==T.state.lexical.info&&T.state.cc[T.state.cc.length-1]==F&&T.state.cc.pop()(),L(j("form"),G,H,F,Mt)):"function"==t?L(Wt):"for"==t?L(j("form"),Nt,H,F):"class"==t||u&&"interface"==e?(T.marked="keyword",L(j("form","class"==t?t:e),Ft,F)):"variable"==t?u&&"declare"==e?(T.marked="keyword",L(H)):u&&("module"==e||"enum"==e||"type"==e)&&T.stream.match(/^\s*\w/,!1)?(T.marked="keyword","enum"==e?L(Zt):"type"==e?L(zt,B("operator"),gt,B(";")):L(j("form"),Tt,B("{"),j("}"),ct,F,F)):u&&"namespace"==e?(T.marked="keyword",L(j("form"),K,H,F)):u&&"abstract"==e?(T.marked="keyword",L(H)):L(j("stat"),rt):"switch"==t?L(j("form"),G,B("{"),j("}","switch"),z,ct,F,F,I):"case"==t?L(K,B(":")):"default"==t?L(B(":")):"catch"==t?L(j("form"),P,U,H,F,I):"export"==t?L(j("stat"),Kt,F):"import"==t?L(j("stat"),Gt,F):"async"==t?L(H):"@"==e?L(K,H):O(j("stat"),K,B(";"),F)}function U(t){if("("==t)return L(It,B(")"))}function K(t,e){return X(t,e,!1)}function V(t,e){return X(t,e,!0)}function G(t){return"("!=t?O():L(j(")"),$,B(")"),F)}function X(t,e,n){if(T.state.fatArrowAt==T.stream.start){var i=n?tt:J;if("("==t)return L(P,j(")"),ut(It,")"),F,B("=>"),i,I);if("variable"==t)return O(P,Tt,B("=>"),i,I)}var r=n?Y:q;return x.hasOwnProperty(t)?L(r):"function"==t?L(Wt,r):"class"==t||u&&"interface"==e?(T.marked="keyword",L(j("form"),jt,F)):"keyword c"==t||"async"==t?L(n?V:K):"("==t?L(j(")"),$,B(")"),F,r):"operator"==t||"spread"==t?L(n?V:K):"["==t?L(j("]"),Qt,F,r):"{"==t?ht(ot,"}",null,r):"quasi"==t?O(Q,r):"new"==t?L(et(n)):"import"==t?L(K):L()}function $(t){return t.match(/[;\}\)\],]/)?O():O(K)}function q(t,e){return","==t?L($):Y(t,e,!1)}function Y(t,e,n){var i=0==n?q:Y,r=0==n?K:V;return"=>"==t?L(P,n?tt:J,I):"operator"==t?/\+\+|--/.test(e)||u&&"!"==e?L(i):u&&"<"==e&&T.stream.match(/^([^<>]|<[^<>]*>)*>\s*\(/,!1)?L(j(">"),ut(gt,">"),F,i):"?"==e?L(K,B(":"),r):L(r):"quasi"==t?O(Q,i):";"!=t?"("==t?ht(V,")","call",i):"."==t?L(st,i):"["==t?L(j("]"),$,B("]"),F,i):u&&"as"==e?(T.marked="keyword",L(gt,i)):"regexp"==t?(T.state.lastType=T.marked="operator",T.stream.backUp(T.stream.pos-T.stream.start-1),L(r)):void 0:void 0}function Q(t,e){return"quasi"!=t?O():"${"!=e.slice(e.length-2)?L(Q):L(K,Z)}function Z(t){if("}"==t)return T.marked="string-2",T.state.tokenize=y,L(Q)}function J(t){return w(T.stream,T.state),O("{"==t?H:K)}function tt(t){return w(T.stream,T.state),O("{"==t?H:V)}function et(t){return function(e){return"."==e?L(t?it:nt):"variable"==e&&u?L(xt,t?Y:q):O(t?V:K)}}function nt(t,e){if("target"==e)return T.marked="keyword",L(q)}function it(t,e){if("target"==e)return T.marked="keyword",L(Y)}function rt(t){return":"==t?L(F,H):O(q,B(";"),F)}function st(t){if("variable"==t)return T.marked="property",L()}function ot(t,e){return"async"==t?(T.marked="property",L(ot)):"variable"==t||"keyword"==T.style?(T.marked="property","get"==e||"set"==e?L(at):(u&&T.state.fatArrowAt==T.stream.start&&(n=T.stream.match(/^\s*:\s*/,!1))&&(T.state.fatArrowAt=T.stream.pos+n[0].length),L(lt))):"number"==t||"string"==t?(T.marked=a?"property":T.style+" property",L(lt)):"jsonld-keyword"==t?L(lt):u&&N(e)?(T.marked="keyword",L(ot)):"["==t?L(K,pt,B("]"),lt):"spread"==t?L(V,lt):"*"==e?(T.marked="keyword",L(ot)):":"==t?O(lt):void 0;var n}function at(t){return"variable"!=t?O(lt):(T.marked="property",L(Wt))}function lt(t){return":"==t?L(V):"("==t?O(Wt):void 0}function ut(t,e,n){function i(r,s){if(n?n.indexOf(r)>-1:","==r){var o=T.state.lexical;return"call"==o.info&&(o.pos=(o.pos||0)+1),L((function(n,i){return n==e||i==e?O():O(t)}),i)}return r==e||s==e?L():n&&n.indexOf(";")>-1?O(t):L(B(e))}return function(n,r){return n==e||r==e?L():O(t,i)}}function ht(t,e,n){for(var i=3;i"),gt):void 0}function mt(t){if("=>"==t)return L(gt)}function vt(t){return t.match(/[\}\)\]]/)?L():","==t||";"==t?L(vt):O(yt,vt)}function yt(t,e){return"variable"==t||"keyword"==T.style?(T.marked="property",L(yt)):"?"==e||"number"==t||"string"==t?L(yt):":"==t?L(gt):"["==t?L(B("variable"),_t,B("]"),yt):"("==t?O(Pt,yt):t.match(/[;\}\)\],]/)?void 0:L()}function bt(t,e){return"variable"==t&&T.stream.match(/^\s*[?:]/,!1)||"?"==e?L(bt):":"==t?L(gt):"spread"==t?L(bt):O(gt)}function wt(t,e){return"<"==e?L(j(">"),ut(gt,">"),F,wt):"|"==e||"."==t||"&"==e?L(gt):"["==t?L(gt,B("]"),wt):"extends"==e||"implements"==e?(T.marked="keyword",L(gt)):"?"==e?L(gt,B(":"),gt):void 0}function xt(t,e){if("<"==e)return L(j(">"),ut(gt,">"),F,wt)}function kt(){return O(gt,Ct)}function Ct(t,e){if("="==e)return L(gt)}function St(t,e){return"enum"==e?(T.marked="keyword",L(Zt)):O(Tt,pt,Et,At)}function Tt(t,e){return u&&N(e)?(T.marked="keyword",L(Tt)):"variable"==t?(A(e),L()):"spread"==t?L(Tt):"["==t?ht(Lt,"]"):"{"==t?ht(Ot,"}"):void 0}function Ot(t,e){return"variable"!=t||T.stream.match(/^\s*:/,!1)?("variable"==t&&(T.marked="property"),"spread"==t?L(Tt):"}"==t?O():"["==t?L(K,B("]"),B(":"),Ot):L(B(":"),Tt,Et)):(A(e),L(Et))}function Lt(){return O(Tt,Et)}function Et(t,e){if("="==e)return L(V)}function At(t){if(","==t)return L(St)}function Mt(t,e){if("keyword b"==t&&"else"==e)return L(j("form","else"),H,F)}function Nt(t,e){return"await"==e?L(Nt):"("==t?L(j(")"),Rt,F):void 0}function Rt(t){return"var"==t?L(St,Dt):"variable"==t?L(Dt):O(Dt)}function Dt(t,e){return")"==t?L():";"==t?L(Dt):"in"==e||"of"==e?(T.marked="keyword",L(K,Dt)):O(K,Dt)}function Wt(t,e){return"*"==e?(T.marked="keyword",L(Wt)):"variable"==t?(A(e),L(Wt)):"("==t?L(P,j(")"),ut(It,")"),F,ft,H,I):u&&"<"==e?L(j(">"),ut(kt,">"),F,Wt):void 0}function Pt(t,e){return"*"==e?(T.marked="keyword",L(Pt)):"variable"==t?(A(e),L(Pt)):"("==t?L(P,j(")"),ut(It,")"),F,ft,I):u&&"<"==e?L(j(">"),ut(kt,">"),F,Pt):void 0}function zt(t,e){return"keyword"==t||"variable"==t?(T.marked="type",L(zt)):"<"==e?L(j(">"),ut(kt,">"),F):void 0}function It(t,e){return"@"==e&&L(K,It),"spread"==t?L(It):u&&N(e)?(T.marked="keyword",L(It)):u&&"this"==t?L(pt,Et):O(Tt,pt,Et)}function jt(t,e){return"variable"==t?Ft(t,e):Bt(t,e)}function Ft(t,e){if("variable"==t)return A(e),L(Bt)}function Bt(t,e){return"<"==e?L(j(">"),ut(kt,">"),F,Bt):"extends"==e||"implements"==e||u&&","==t?("implements"==e&&(T.marked="keyword"),L(u?gt:K,Bt)):"{"==t?L(j("}"),Ht,F):void 0}function Ht(t,e){return"async"==t||"variable"==t&&("static"==e||"get"==e||"set"==e||u&&N(e))&&T.stream.match(/^\s+[\w$\xa1-\uffff]/,!1)?(T.marked="keyword",L(Ht)):"variable"==t||"keyword"==T.style?(T.marked="property",L(Ut,Ht)):"number"==t||"string"==t?L(Ut,Ht):"["==t?L(K,pt,B("]"),Ut,Ht):"*"==e?(T.marked="keyword",L(Ht)):u&&"("==t?O(Pt,Ht):";"==t||","==t?L(Ht):"}"==t?L():"@"==e?L(K,Ht):void 0}function Ut(t,e){if("?"==e)return L(Ut);if(":"==t)return L(gt,Et);if("="==e)return L(V);var n=T.state.lexical.prev,i=n&&"interface"==n.info;return O(i?Pt:Wt)}function Kt(t,e){return"*"==e?(T.marked="keyword",L(Yt,B(";"))):"default"==e?(T.marked="keyword",L(K,B(";"))):"{"==t?L(ut(Vt,"}"),Yt,B(";")):O(H)}function Vt(t,e){return"as"==e?(T.marked="keyword",L(B("variable"))):"variable"==t?O(V,Vt):void 0}function Gt(t){return"string"==t?L():"("==t?O(K):O(Xt,$t,Yt)}function Xt(t,e){return"{"==t?ht(Xt,"}"):("variable"==t&&A(e),"*"==e&&(T.marked="keyword"),L(qt))}function $t(t){if(","==t)return L(Xt,$t)}function qt(t,e){if("as"==e)return T.marked="keyword",L(Xt)}function Yt(t,e){if("from"==e)return T.marked="keyword",L(K)}function Qt(t){return"]"==t?L():O(ut(V,"]"))}function Zt(){return O(j("form"),Tt,B("{"),j("}"),ut(Jt,"}"),F,F)}function Jt(){return O(Tt,Et)}function te(t,e){return"operator"==t.lastType||","==t.lastType||p.test(e.charAt(0))||/[,.]/.test(e.charAt(0))}function ee(t,e,n){return e.tokenize==g&&/^(?:operator|sof|keyword [bcd]|case|new|export|default|spread|[\[{}\(,;:]|=>)$/.test(e.lastType)||"quasi"==e.lastType&&/\{\s*$/.test(t.string.slice(0,t.pos-(n||0)))}return I.lex=!0,F.lex=!0,{startState:function(t){var e={tokenize:g,lastType:"sof",cc:[],lexical:new k((t||0)-s,0,"block",!1),localVars:n.localVars,context:n.localVars&&new R(null,null,!1),indented:t||0};return n.globalVars&&"object"==typeof n.globalVars&&(e.globalVars=n.globalVars),e},token:function(t,e){if(t.sol()&&(e.lexical.hasOwnProperty("align")||(e.lexical.align=!1),e.indented=t.indentation(),w(t,e)),e.tokenize!=v&&t.eatSpace())return null;var n=e.tokenize(t,e);return"comment"==i?n:(e.lastType="operator"!=i||"++"!=r&&"--"!=r?i:"incdec",S(e,n,i,r,t))},indent:function(e,i){if(e.tokenize==v||e.tokenize==y)return t.Pass;if(e.tokenize!=g)return 0;var r,a=i&&i.charAt(0),l=e.lexical;if(!/^\s*else\b/.test(i))for(var u=e.cc.length-1;u>=0;--u){var h=e.cc[u];if(h==F)l=l.prev;else if(h!=Mt)break}while(("stat"==l.type||"form"==l.type)&&("}"==a||(r=e.cc[e.cc.length-1])&&(r==q||r==Y)&&!/^[,\.=+\-*:?[\(]/.test(i)))l=l.prev;o&&")"==l.type&&"stat"==l.prev.type&&(l=l.prev);var c=l.type,p=a==c;return"vardef"==c?l.indented+("operator"==e.lastType||","==e.lastType?l.info.length+1:0):"form"==c&&"{"==a?l.indented:"form"==c?l.indented+s:"stat"==c?l.indented+(te(e,i)?o||s:0):"switch"!=l.info||p||0==n.doubleIndentSwitch?l.align?l.column+(p?0:1):l.indented+(p?0:s):l.indented+(/^(?:case|default)\b/.test(i)?s:2*s)},electricInput:/^\s*(?:case .*?:|default:|\{|\})$/,blockCommentStart:l?null:"/*",blockCommentEnd:l?null:"*/",blockCommentContinue:l?null:" * ",lineComment:l?null:"//",fold:"brace",closeBrackets:"()[]{}''\"\"``",helperType:l?"json":"javascript",jsonldMode:a,jsonMode:l,expressionAllowed:ee,skipExpression:function(t){var e=t.cc[t.cc.length-1];e!=K&&e!=V||t.cc.pop()}}})),t.registerHelper("wordChars","javascript",/[\w$]/),t.defineMIME("text/javascript","javascript"),t.defineMIME("text/ecmascript","javascript"),t.defineMIME("application/javascript","javascript"),t.defineMIME("application/x-javascript","javascript"),t.defineMIME("application/ecmascript","javascript"),t.defineMIME("application/json",{name:"javascript",json:!0}),t.defineMIME("application/x-json",{name:"javascript",json:!0}),t.defineMIME("application/manifest+json",{name:"javascript",json:!0}),t.defineMIME("application/ld+json",{name:"javascript",jsonld:!0}),t.defineMIME("text/typescript",{name:"javascript",typescript:!0}),t.defineMIME("application/typescript",{name:"javascript",typescript:!0})}))},"0377":function(t,e,n){var i,r;(function(){var n=function(t){var e={};function n(i){if(e[i])return e[i].exports;var r=e[i]={i:i,l:!1,exports:{}};return t[i].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=t,n.c=e,n.d=function(t,e,i){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:i})},n.r=function(t){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"===typeof t&&t&&t.__esModule)return t;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var r in t)n.d(i,r,function(e){return t[e]}.bind(null,r));return i},n.n=function(t){var e=t&&t.__esModule?function(){return t["default"]}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=0)}([function(t,e,n){"use strict";var i=n(1).Beautifier,r=n(5).Options;function s(t,e){var n=new i(t,e);return n.beautify()}t.exports=s,t.exports.defaultOptions=function(){return new r}},function(t,e,n){"use strict";var i=n(2).Output,r=n(3).Token,s=n(4),o=n(5).Options,a=n(7).Tokenizer,l=n(7).line_starters,u=n(7).positionable_operators,h=n(7).TOKEN;function c(t,e){return-1!==e.indexOf(t)}function p(t){return t.replace(/^\s+/g,"")}function _(t){for(var e={},n=0;nn&&(n=t.line_indent_level));var i={mode:e,parent:t,last_token:t?t.last_token:new r(h.START_BLOCK,""),last_word:t?t.last_word:"",declaration_statement:!1,declaration_assignment:!1,multiline_frame:!1,inline_frame:!1,if_block:!1,else_block:!1,do_block:!1,do_while:!1,import_block:!1,in_case_statement:!1,in_case:!1,case_body:!1,indentation_level:n,alignment:0,line_indent_level:t?t.line_indent_level:n,start_line_index:this._output.get_line_number(),ternary_depth:0};return i},O.prototype._reset=function(t){var e=t.match(/^[\t ]*/)[0];this._last_last_text="",this._output=new i(this._options,e),this._output.raw=this._options.test_output_raw,this._flag_store=[],this.set_mode(b.BlockStatement);var n=new a(t,this._options);return this._tokens=n.tokenize(),t},O.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var t,e=this._reset(this._source_text),n=this._options.eol;"auto"===this._options.eol&&(n="\n",e&&s.lineBreak.test(e||"")&&(n=e.match(s.lineBreak)[0]));var i=this._tokens.next();while(i)this.handle_token(i),this._last_last_text=this._flags.last_token.text,this._flags.last_token=i,i=this._tokens.next();return t=this._output.get_code(n),t},O.prototype.handle_token=function(t,e){t.type===h.START_EXPR?this.handle_start_expr(t):t.type===h.END_EXPR?this.handle_end_expr(t):t.type===h.START_BLOCK?this.handle_start_block(t):t.type===h.END_BLOCK?this.handle_end_block(t):t.type===h.WORD||t.type===h.RESERVED?this.handle_word(t):t.type===h.SEMICOLON?this.handle_semicolon(t):t.type===h.STRING?this.handle_string(t):t.type===h.EQUALS?this.handle_equals(t):t.type===h.OPERATOR?this.handle_operator(t):t.type===h.COMMA?this.handle_comma(t):t.type===h.BLOCK_COMMENT?this.handle_block_comment(t,e):t.type===h.COMMENT?this.handle_comment(t,e):t.type===h.DOT?this.handle_dot(t):t.type===h.EOF?this.handle_eof(t):(t.type,h.UNKNOWN,this.handle_unknown(t,e))},O.prototype.handle_whitespace_and_comments=function(t,e){var n=t.newlines,i=this._options.keep_array_indentation&&k(this._flags.mode);if(t.comments_before){var r=t.comments_before.next();while(r)this.handle_whitespace_and_comments(r,e),this.handle_token(r,e),r=t.comments_before.next()}if(i)for(var s=0;s0,e);else if(this._options.max_preserve_newlines&&n>this._options.max_preserve_newlines&&(n=this._options.max_preserve_newlines),this._options.preserve_newlines&&n>1){this.print_newline(!1,e);for(var o=1;o0&&(!this._flags.parent||this._flags.indentation_level>this._flags.parent.indentation_level)&&(this._flags.indentation_level-=1,this._output.set_indent(this._flags.indentation_level,this._flags.alignment))},O.prototype.set_mode=function(t){this._flags?(this._flag_store.push(this._flags),this._previous_flags=this._flags):this._previous_flags=this.create_flags(null,t),this._flags=this.create_flags(this._previous_flags,t),this._output.set_indent(this._flags.indentation_level,this._flags.alignment)},O.prototype.restore_mode=function(){this._flag_store.length>0&&(this._previous_flags=this._flags,this._flags=this._flag_store.pop(),this._previous_flags.mode===b.Statement&&w(this._output,this._previous_flags),this._output.set_indent(this._flags.indentation_level,this._flags.alignment))},O.prototype.start_of_object_property=function(){return this._flags.parent.mode===b.ObjectLiteral&&this._flags.mode===b.Statement&&(":"===this._flags.last_token.text&&0===this._flags.ternary_depth||d(this._flags.last_token,["get","set"]))},O.prototype.start_of_statement=function(t){var e=!1;return e=e||d(this._flags.last_token,["var","let","const"])&&t.type===h.WORD,e=e||f(this._flags.last_token,"do"),e=e||!(this._flags.parent.mode===b.ObjectLiteral&&this._flags.mode===b.Statement)&&d(this._flags.last_token,L)&&!t.newlines,e=e||f(this._flags.last_token,"else")&&!(f(t,"if")&&!t.comments_before),e=e||this._flags.last_token.type===h.END_EXPR&&(this._previous_flags.mode===b.ForInitializer||this._previous_flags.mode===b.Conditional),e=e||this._flags.last_token.type===h.WORD&&this._flags.mode===b.BlockStatement&&!this._flags.in_case&&!("--"===t.text||"++"===t.text)&&"function"!==this._last_last_text&&t.type!==h.WORD&&t.type!==h.RESERVED,e=e||this._flags.mode===b.ObjectLiteral&&(":"===this._flags.last_token.text&&0===this._flags.ternary_depth||d(this._flags.last_token,["get","set"])),!!e&&(this.set_mode(b.Statement),this.indent(),this.handle_whitespace_and_comments(t,!0),this.start_of_object_property()||this.allow_wrap_or_preserved_newline(t,d(t,["do","for","if","while"])),!0)},O.prototype.handle_start_expr=function(t){this.start_of_statement(t)||this.handle_whitespace_and_comments(t);var e=b.Expression;if("["===t.text){if(this._flags.last_token.type===h.WORD||")"===this._flags.last_token.text)return d(this._flags.last_token,l)&&(this._output.space_before_token=!0),this.print_token(t),this.set_mode(e),this.indent(),void(this._options.space_in_paren&&(this._output.space_before_token=!0));e=b.ArrayLiteral,k(this._flags.mode)&&("["!==this._flags.last_token.text&&(","!==this._flags.last_token.text||"]"!==this._last_last_text&&"}"!==this._last_last_text)||this._options.keep_array_indentation||this.print_newline()),c(this._flags.last_token.type,[h.START_EXPR,h.END_EXPR,h.WORD,h.OPERATOR])||(this._output.space_before_token=!0)}else{if(this._flags.last_token.type===h.RESERVED)"for"===this._flags.last_token.text?(this._output.space_before_token=this._options.space_before_conditional,e=b.ForInitializer):c(this._flags.last_token.text,["if","while"])?(this._output.space_before_token=this._options.space_before_conditional,e=b.Conditional):c(this._flags.last_word,["await","async"])?this._output.space_before_token=!0:"import"===this._flags.last_token.text&&""===t.whitespace_before?this._output.space_before_token=!1:(c(this._flags.last_token.text,l)||"catch"===this._flags.last_token.text)&&(this._output.space_before_token=!0);else if(this._flags.last_token.type===h.EQUALS||this._flags.last_token.type===h.OPERATOR)this.start_of_object_property()||this.allow_wrap_or_preserved_newline(t);else if(this._flags.last_token.type===h.WORD){this._output.space_before_token=!1;var n=this._tokens.peek(-3);if(this._options.space_after_named_function&&n){var i=this._tokens.peek(-4);d(n,["async","function"])||"*"===n.text&&d(i,["async","function"])?this._output.space_before_token=!0:this._flags.mode===b.ObjectLiteral&&("{"!==n.text&&","!==n.text&&("*"!==n.text||"{"!==i.text&&","!==i.text)||(this._output.space_before_token=!0))}}else this.allow_wrap_or_preserved_newline(t);(this._flags.last_token.type===h.RESERVED&&("function"===this._flags.last_word||"typeof"===this._flags.last_word)||"*"===this._flags.last_token.text&&(c(this._last_last_text,["function","yield"])||this._flags.mode===b.ObjectLiteral&&c(this._last_last_text,["{",","])))&&(this._output.space_before_token=this._options.space_after_anon_function)}";"===this._flags.last_token.text||this._flags.last_token.type===h.START_BLOCK?this.print_newline():this._flags.last_token.type!==h.END_EXPR&&this._flags.last_token.type!==h.START_EXPR&&this._flags.last_token.type!==h.END_BLOCK&&"."!==this._flags.last_token.text&&this._flags.last_token.type!==h.COMMA||this.allow_wrap_or_preserved_newline(t,t.newlines),this.print_token(t),this.set_mode(e),this._options.space_in_paren&&(this._output.space_before_token=!0),this.indent()},O.prototype.handle_end_expr=function(t){while(this._flags.mode===b.Statement)this.restore_mode();this.handle_whitespace_and_comments(t),this._flags.multiline_frame&&this.allow_wrap_or_preserved_newline(t,"]"===t.text&&k(this._flags.mode)&&!this._options.keep_array_indentation),this._options.space_in_paren&&(this._flags.last_token.type!==h.START_EXPR||this._options.space_in_empty_paren?this._output.space_before_token=!0:(this._output.trim(),this._output.space_before_token=!1)),this.deindent(),this.print_token(t),this.restore_mode(),w(this._output,this._previous_flags),this._flags.do_while&&this._previous_flags.mode===b.Conditional&&(this._previous_flags.mode=b.Expression,this._flags.do_block=!1,this._flags.do_while=!1)},O.prototype.handle_start_block=function(t){this.handle_whitespace_and_comments(t);var e=this._tokens.peek(),n=this._tokens.peek(1);"switch"===this._flags.last_word&&this._flags.last_token.type===h.END_EXPR?(this.set_mode(b.BlockStatement),this._flags.in_case_statement=!0):this._flags.case_body?this.set_mode(b.BlockStatement):n&&(c(n.text,[":",","])&&c(e.type,[h.STRING,h.WORD,h.RESERVED])||c(e.text,["get","set","..."])&&c(n.type,[h.WORD,h.RESERVED]))?c(this._last_last_text,["class","interface"])?this.set_mode(b.BlockStatement):this.set_mode(b.ObjectLiteral):this._flags.last_token.type===h.OPERATOR&&"=>"===this._flags.last_token.text?this.set_mode(b.BlockStatement):c(this._flags.last_token.type,[h.EQUALS,h.START_EXPR,h.COMMA,h.OPERATOR])||d(this._flags.last_token,["return","throw","import","default"])?this.set_mode(b.ObjectLiteral):this.set_mode(b.BlockStatement);var i=!e.comments_before&&"}"===e.text,r=i&&"function"===this._flags.last_word&&this._flags.last_token.type===h.END_EXPR;if(this._options.brace_preserve_inline){var s=0,o=null;this._flags.inline_frame=!0;do{if(s+=1,o=this._tokens.peek(s-1),o.newlines){this._flags.inline_frame=!1;break}}while(o.type!==h.EOF&&(o.type!==h.END_BLOCK||o.opened!==t))}("expand"===this._options.brace_style||"none"===this._options.brace_style&&t.newlines)&&!this._flags.inline_frame?this._flags.last_token.type!==h.OPERATOR&&(r||this._flags.last_token.type===h.EQUALS||d(this._flags.last_token,g)&&"else"!==this._flags.last_token.text)?this._output.space_before_token=!0:this.print_newline(!1,!0):(!k(this._previous_flags.mode)||this._flags.last_token.type!==h.START_EXPR&&this._flags.last_token.type!==h.COMMA||((this._flags.last_token.type===h.COMMA||this._options.space_in_paren)&&(this._output.space_before_token=!0),(this._flags.last_token.type===h.COMMA||this._flags.last_token.type===h.START_EXPR&&this._flags.inline_frame)&&(this.allow_wrap_or_preserved_newline(t),this._previous_flags.multiline_frame=this._previous_flags.multiline_frame||this._flags.multiline_frame,this._flags.multiline_frame=!1)),this._flags.last_token.type!==h.OPERATOR&&this._flags.last_token.type!==h.START_EXPR&&(this._flags.last_token.type!==h.START_BLOCK||this._flags.inline_frame?this._output.space_before_token=!0:this.print_newline())),this.print_token(t),this.indent(),i||this._options.brace_preserve_inline&&this._flags.inline_frame||this.print_newline()},O.prototype.handle_end_block=function(t){this.handle_whitespace_and_comments(t);while(this._flags.mode===b.Statement)this.restore_mode();var e=this._flags.last_token.type===h.START_BLOCK;this._flags.inline_frame&&!e?this._output.space_before_token=!0:"expand"===this._options.brace_style?e||this.print_newline():e||(k(this._flags.mode)&&this._options.keep_array_indentation?(this._options.keep_array_indentation=!1,this.print_newline(),this._options.keep_array_indentation=!0):this.print_newline()),this.restore_mode(),this.print_token(t)},O.prototype.handle_word=function(t){if(t.type===h.RESERVED)if(c(t.text,["set","get"])&&this._flags.mode!==b.ObjectLiteral)t.type=h.WORD;else if("import"===t.text&&"("===this._tokens.peek().text)t.type=h.WORD;else if(c(t.text,["as","from"])&&!this._flags.import_block)t.type=h.WORD;else if(this._flags.mode===b.ObjectLiteral){var e=this._tokens.peek();":"===e.text&&(t.type=h.WORD)}if(this.start_of_statement(t)?d(this._flags.last_token,["var","let","const"])&&t.type===h.WORD&&(this._flags.declaration_statement=!0):!t.newlines||C(this._flags.mode)||this._flags.last_token.type===h.OPERATOR&&"--"!==this._flags.last_token.text&&"++"!==this._flags.last_token.text||this._flags.last_token.type===h.EQUALS||!this._options.preserve_newlines&&d(this._flags.last_token,["var","let","const","set","get"])?this.handle_whitespace_and_comments(t):(this.handle_whitespace_and_comments(t),this.print_newline()),this._flags.do_block&&!this._flags.do_while){if(f(t,"while"))return this._output.space_before_token=!0,this.print_token(t),this._output.space_before_token=!0,void(this._flags.do_while=!0);this.print_newline(),this._flags.do_block=!1}if(this._flags.if_block)if(!this._flags.else_block&&f(t,"else"))this._flags.else_block=!0;else{while(this._flags.mode===b.Statement)this.restore_mode();this._flags.if_block=!1,this._flags.else_block=!1}if(this._flags.in_case_statement&&d(t,["case","default"]))return this.print_newline(),this._flags.last_token.type!==h.END_BLOCK&&(this._flags.case_body||this._options.jslint_happy)&&this.deindent(),this._flags.case_body=!1,this.print_token(t),void(this._flags.in_case=!0);if(this._flags.last_token.type!==h.COMMA&&this._flags.last_token.type!==h.START_EXPR&&this._flags.last_token.type!==h.EQUALS&&this._flags.last_token.type!==h.OPERATOR||this.start_of_object_property()||this.allow_wrap_or_preserved_newline(t),f(t,"function"))return(c(this._flags.last_token.text,["}",";"])||this._output.just_added_newline()&&!c(this._flags.last_token.text,["(","[","{",":","=",","])&&this._flags.last_token.type!==h.OPERATOR)&&(this._output.just_added_blankline()||t.comments_before||(this.print_newline(),this.print_newline(!0))),this._flags.last_token.type===h.RESERVED||this._flags.last_token.type===h.WORD?d(this._flags.last_token,["get","set","new","export"])||d(this._flags.last_token,L)||f(this._flags.last_token,"default")&&"export"===this._last_last_text||"declare"===this._flags.last_token.text?this._output.space_before_token=!0:this.print_newline():this._flags.last_token.type===h.OPERATOR||"="===this._flags.last_token.text?this._output.space_before_token=!0:(this._flags.multiline_frame||!C(this._flags.mode)&&!k(this._flags.mode))&&this.print_newline(),this.print_token(t),void(this._flags.last_word=t.text);var n="NONE";if(this._flags.last_token.type===h.END_BLOCK?this._previous_flags.inline_frame?n="SPACE":d(t,["else","catch","finally","from"])?"expand"===this._options.brace_style||"end-expand"===this._options.brace_style||"none"===this._options.brace_style&&t.newlines?n="NEWLINE":(n="SPACE",this._output.space_before_token=!0):n="NEWLINE":this._flags.last_token.type===h.SEMICOLON&&this._flags.mode===b.BlockStatement?n="NEWLINE":this._flags.last_token.type===h.SEMICOLON&&C(this._flags.mode)?n="SPACE":this._flags.last_token.type===h.STRING?n="NEWLINE":this._flags.last_token.type===h.RESERVED||this._flags.last_token.type===h.WORD||"*"===this._flags.last_token.text&&(c(this._last_last_text,["function","yield"])||this._flags.mode===b.ObjectLiteral&&c(this._last_last_text,["{",","]))?n="SPACE":this._flags.last_token.type===h.START_BLOCK?n=this._flags.inline_frame?"SPACE":"NEWLINE":this._flags.last_token.type===h.END_EXPR&&(this._output.space_before_token=!0,n="NEWLINE"),d(t,l)&&")"!==this._flags.last_token.text&&(n=this._flags.inline_frame||"else"===this._flags.last_token.text||"export"===this._flags.last_token.text?"SPACE":"NEWLINE"),d(t,["else","catch","finally"]))if((this._flags.last_token.type!==h.END_BLOCK||this._previous_flags.mode!==b.BlockStatement||"expand"===this._options.brace_style||"end-expand"===this._options.brace_style||"none"===this._options.brace_style&&t.newlines)&&!this._flags.inline_frame)this.print_newline();else{this._output.trim(!0);var i=this._output.current_line;"}"!==i.last()&&this.print_newline(),this._output.space_before_token=!0}else"NEWLINE"===n?d(this._flags.last_token,g)||"declare"===this._flags.last_token.text&&d(t,["var","let","const"])?this._output.space_before_token=!0:this._flags.last_token.type!==h.END_EXPR?this._flags.last_token.type===h.START_EXPR&&d(t,["var","let","const"])||":"===this._flags.last_token.text||(f(t,"if")&&f(t.previous,"else")?this._output.space_before_token=!0:this.print_newline()):d(t,l)&&")"!==this._flags.last_token.text&&this.print_newline():this._flags.multiline_frame&&k(this._flags.mode)&&","===this._flags.last_token.text&&"}"===this._last_last_text?this.print_newline():"SPACE"===n&&(this._output.space_before_token=!0);!t.previous||t.previous.type!==h.WORD&&t.previous.type!==h.RESERVED||(this._output.space_before_token=!0),this.print_token(t),this._flags.last_word=t.text,t.type===h.RESERVED&&("do"===t.text?this._flags.do_block=!0:"if"===t.text?this._flags.if_block=!0:"import"===t.text?this._flags.import_block=!0:this._flags.import_block&&f(t,"from")&&(this._flags.import_block=!1))},O.prototype.handle_semicolon=function(t){this.start_of_statement(t)?this._output.space_before_token=!1:this.handle_whitespace_and_comments(t);var e=this._tokens.peek();while(this._flags.mode===b.Statement&&(!this._flags.if_block||!f(e,"else"))&&!this._flags.do_block)this.restore_mode();this._flags.import_block&&(this._flags.import_block=!1),this.print_token(t)},O.prototype.handle_string=function(t){(!t.text.startsWith("`")||0!==t.newlines||""!==t.whitespace_before||")"!==t.previous.text&&this._flags.last_token.type!==h.WORD)&&(this.start_of_statement(t)?this._output.space_before_token=!0:(this.handle_whitespace_and_comments(t),this._flags.last_token.type===h.RESERVED||this._flags.last_token.type===h.WORD||this._flags.inline_frame?this._output.space_before_token=!0:this._flags.last_token.type===h.COMMA||this._flags.last_token.type===h.START_EXPR||this._flags.last_token.type===h.EQUALS||this._flags.last_token.type===h.OPERATOR?this.start_of_object_property()||this.allow_wrap_or_preserved_newline(t):!t.text.startsWith("`")||this._flags.last_token.type!==h.END_EXPR||"]"!==t.previous.text&&")"!==t.previous.text||0!==t.newlines?this.print_newline():this._output.space_before_token=!0)),this.print_token(t)},O.prototype.handle_equals=function(t){this.start_of_statement(t)||this.handle_whitespace_and_comments(t),this._flags.declaration_statement&&(this._flags.declaration_assignment=!0),this._output.space_before_token=!0,this.print_token(t),this._output.space_before_token=!0},O.prototype.handle_comma=function(t){this.handle_whitespace_and_comments(t,!0),this.print_token(t),this._output.space_before_token=!0,this._flags.declaration_statement?(C(this._flags.parent.mode)&&(this._flags.declaration_assignment=!1),this._flags.declaration_assignment?(this._flags.declaration_assignment=!1,this.print_newline(!1,!0)):this._options.comma_first&&this.allow_wrap_or_preserved_newline(t)):this._flags.mode===b.ObjectLiteral||this._flags.mode===b.Statement&&this._flags.parent.mode===b.ObjectLiteral?(this._flags.mode===b.Statement&&this.restore_mode(),this._flags.inline_frame||this.print_newline()):this._options.comma_first&&this.allow_wrap_or_preserved_newline(t)},O.prototype.handle_operator=function(t){var e="*"===t.text&&(d(this._flags.last_token,["function","yield"])||c(this._flags.last_token.type,[h.START_BLOCK,h.COMMA,h.END_BLOCK,h.SEMICOLON])),n=c(t.text,["-","+"])&&(c(this._flags.last_token.type,[h.START_BLOCK,h.START_EXPR,h.EQUALS,h.OPERATOR])||c(this._flags.last_token.text,l)||","===this._flags.last_token.text);if(this.start_of_statement(t));else{var i=!e;this.handle_whitespace_and_comments(t,i)}if(d(this._flags.last_token,g))return this._output.space_before_token=!0,void this.print_token(t);if("*"!==t.text||this._flags.last_token.type!==h.DOT)if("::"!==t.text){if(this._flags.last_token.type===h.OPERATOR&&c(this._options.operator_position,y)&&this.allow_wrap_or_preserved_newline(t),":"===t.text&&this._flags.in_case)return this.print_token(t),this._flags.in_case=!1,this._flags.case_body=!0,void(this._tokens.peek().type!==h.START_BLOCK?(this.indent(),this.print_newline()):this._output.space_before_token=!0);var r=!0,s=!0,o=!1;if(":"===t.text?0===this._flags.ternary_depth?r=!1:(this._flags.ternary_depth-=1,o=!0):"?"===t.text&&(this._flags.ternary_depth+=1),!n&&!e&&this._options.preserve_newlines&&c(t.text,u)){var a=":"===t.text,p=a&&o,_=a&&!o;switch(this._options.operator_position){case v.before_newline:return this._output.space_before_token=!_,this.print_token(t),a&&!p||this.allow_wrap_or_preserved_newline(t),void(this._output.space_before_token=!0);case v.after_newline:return this._output.space_before_token=!0,!a||p?this._tokens.peek().newlines?this.print_newline(!1,!0):this.allow_wrap_or_preserved_newline(t):this._output.space_before_token=!1,this.print_token(t),void(this._output.space_before_token=!0);case v.preserve_newline:return _||this.allow_wrap_or_preserved_newline(t),r=!(this._output.just_added_newline()||_),this._output.space_before_token=r,this.print_token(t),void(this._output.space_before_token=!0)}}if(e){this.allow_wrap_or_preserved_newline(t),r=!1;var f=this._tokens.peek();s=f&&c(f.type,[h.WORD,h.RESERVED])}else"..."===t.text?(this.allow_wrap_or_preserved_newline(t),r=this._flags.last_token.type===h.START_BLOCK,s=!1):(c(t.text,["--","++","!","~"])||n)&&(this._flags.last_token.type!==h.COMMA&&this._flags.last_token.type!==h.START_EXPR||this.allow_wrap_or_preserved_newline(t),r=!1,s=!1,!t.newlines||"--"!==t.text&&"++"!==t.text||this.print_newline(!1,!0),";"===this._flags.last_token.text&&C(this._flags.mode)&&(r=!0),this._flags.last_token.type===h.RESERVED?r=!0:this._flags.last_token.type===h.END_EXPR?r=!("]"===this._flags.last_token.text&&("--"===t.text||"++"===t.text)):this._flags.last_token.type===h.OPERATOR&&(r=c(t.text,["--","-","++","+"])&&c(this._flags.last_token.text,["--","-","++","+"]),c(t.text,["+","-"])&&c(this._flags.last_token.text,["--","++"])&&(s=!0)),(this._flags.mode!==b.BlockStatement||this._flags.inline_frame)&&this._flags.mode!==b.Statement||"{"!==this._flags.last_token.text&&";"!==this._flags.last_token.text||this.print_newline());this._output.space_before_token=this._output.space_before_token||r,this.print_token(t),this._output.space_before_token=s}else this.print_token(t);else this.print_token(t)},O.prototype.handle_block_comment=function(t,e){return this._output.raw?(this._output.add_raw_token(t),void(t.directives&&"end"===t.directives.preserve&&(this._output.raw=this._options.test_output_raw))):t.directives?(this.print_newline(!1,e),this.print_token(t),"start"===t.directives.preserve&&(this._output.raw=!0),void this.print_newline(!1,!0)):s.newline.test(t.text)||t.newlines?void this.print_block_commment(t,e):(this._output.space_before_token=!0,this.print_token(t),void(this._output.space_before_token=!0))},O.prototype.print_block_commment=function(t,e){var n,i=x(t.text),r=!1,s=!1,o=t.whitespace_before,a=o.length;if(this.print_newline(!1,e),this.print_token_line_indentation(t),this._output.add_token(i[0]),this.print_newline(!1,e),i.length>1){for(i=i.slice(1),r=S(i,"*"),s=T(i,o),r&&(this._flags.alignment=1),n=0;n0&&(e=new Array(t.indent_level+1).join(this.__indent_string)),this.__base_string=e,this.__base_string_length=e.length}function s(t,e){this.__indent_cache=new r(t,e),this.raw=!1,this._end_with_newline=t.end_with_newline,this.indent_size=t.indent_size,this.wrap_line_length=t.wrap_line_length,this.indent_empty_lines=t.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new i(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}i.prototype.clone_empty=function(){var t=new i(this.__parent);return t.set_indent(this.__indent_count,this.__alignment_count),t},i.prototype.item=function(t){return t<0?this.__items[this.__items.length+t]:this.__items[t]},i.prototype.has_match=function(t){for(var e=this.__items.length-1;e>=0;e--)if(this.__items[e].match(t))return!0;return!1},i.prototype.set_indent=function(t,e){this.is_empty()&&(this.__indent_count=t||0,this.__alignment_count=e||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},i.prototype._set_wrap_point=function(){this.__parent.wrap_line_length&&(this.__wrap_point_index=this.__items.length,this.__wrap_point_character_count=this.__character_count,this.__wrap_point_indent_count=this.__parent.next_line.__indent_count,this.__wrap_point_alignment_count=this.__parent.next_line.__alignment_count)},i.prototype._should_wrap=function(){return this.__wrap_point_index&&this.__character_count>this.__parent.wrap_line_length&&this.__wrap_point_character_count>this.__parent.next_line.__character_count},i.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var t=this.__parent.current_line;return t.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),t.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),t.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count," "===t.__items[0]&&(t.__items.splice(0,1),t.__character_count-=1),!0}return!1},i.prototype.is_empty=function(){return 0===this.__items.length},i.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},i.prototype.push=function(t){this.__items.push(t);var e=t.lastIndexOf("\n");-1!==e?this.__character_count=t.length-e:this.__character_count+=t.length},i.prototype.pop=function(){var t=null;return this.is_empty()||(t=this.__items.pop(),this.__character_count-=t.length),t},i.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},i.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},i.prototype.trim=function(){while(" "===this.last())this.__items.pop(),this.__character_count-=1},i.prototype.toString=function(){var t="";return this.is_empty()?this.__parent.indent_empty_lines&&(t=this.__parent.get_indent_string(this.__indent_count)):(t=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),t+=this.__items.join("")),t},r.prototype.get_indent_size=function(t,e){var n=this.__base_string_length;return e=e||0,t<0&&(n=0),n+=t*this.__indent_size,n+=e,n},r.prototype.get_indent_string=function(t,e){var n=this.__base_string;return e=e||0,t<0&&(t=0,n=""),e+=t*this.__indent_size,this.__ensure_cache(e),n+=this.__cache[e],n},r.prototype.__ensure_cache=function(t){while(t>=this.__cache.length)this.__add_column()},r.prototype.__add_column=function(){var t=this.__cache.length,e=0,n="";this.__indent_size&&t>=this.__indent_size&&(e=Math.floor(t/this.__indent_size),t-=e*this.__indent_size,n=new Array(e+1).join(this.__indent_string)),t&&(n+=new Array(t+1).join(" ")),this.__cache.push(n)},s.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},s.prototype.get_line_number=function(){return this.__lines.length},s.prototype.get_indent_string=function(t,e){return this.__indent_cache.get_indent_string(t,e)},s.prototype.get_indent_size=function(t,e){return this.__indent_cache.get_indent_size(t,e)},s.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},s.prototype.add_new_line=function(t){return!(this.is_empty()||!t&&this.just_added_newline())&&(this.raw||this.__add_outputline(),!0)},s.prototype.get_code=function(t){this.trim(!0);var e=this.current_line.pop();e&&("\n"===e[e.length-1]&&(e=e.replace(/\n+$/g,"")),this.current_line.push(e)),this._end_with_newline&&this.__add_outputline();var n=this.__lines.join("\n");return"\n"!==t&&(n=n.replace(/[\n]/g,t)),n},s.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},s.prototype.set_indent=function(t,e){return t=t||0,e=e||0,this.next_line.set_indent(t,e),this.__lines.length>1?(this.current_line.set_indent(t,e),!0):(this.current_line.set_indent(),!1)},s.prototype.add_raw_token=function(t){for(var e=0;e1&&this.current_line.is_empty())this.__lines.pop(),this.current_line=this.__lines[this.__lines.length-1],this.current_line.trim();this.previous_line=this.__lines.length>1?this.__lines[this.__lines.length-2]:null},s.prototype.just_added_newline=function(){return this.current_line.is_empty()},s.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},s.prototype.ensure_empty_line_above=function(t,e){var n=this.__lines.length-2;while(n>=0){var r=this.__lines[n];if(r.is_empty())break;if(0!==r.item(0).indexOf(t)&&r.item(-1)!==e){this.__lines.splice(n+1,0,new i(this)),this.previous_line=this.__lines[this.__lines.length-2];break}n--}},t.exports.Output=s},function(t,e,n){"use strict";function i(t,e,n,i){this.type=t,this.text=e,this.comments_before=null,this.newlines=n||0,this.whitespace_before=i||"",this.parent=null,this.next=null,this.previous=null,this.opened=null,this.closed=null,this.directives=null}t.exports.Token=i},function(t,e,n){"use strict";var i="\\x23\\x24\\x40\\x41-\\x5a\\x5f\\x61-\\x7a",r="\\x24\\x30-\\x39\\x41-\\x5a\\x5f\\x61-\\x7a",s="\\xaa\\xb5\\xba\\xc0-\\xd6\\xd8-\\xf6\\xf8-\\u02c1\\u02c6-\\u02d1\\u02e0-\\u02e4\\u02ec\\u02ee\\u0370-\\u0374\\u0376\\u0377\\u037a-\\u037d\\u0386\\u0388-\\u038a\\u038c\\u038e-\\u03a1\\u03a3-\\u03f5\\u03f7-\\u0481\\u048a-\\u0527\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u05d0-\\u05ea\\u05f0-\\u05f2\\u0620-\\u064a\\u066e\\u066f\\u0671-\\u06d3\\u06d5\\u06e5\\u06e6\\u06ee\\u06ef\\u06fa-\\u06fc\\u06ff\\u0710\\u0712-\\u072f\\u074d-\\u07a5\\u07b1\\u07ca-\\u07ea\\u07f4\\u07f5\\u07fa\\u0800-\\u0815\\u081a\\u0824\\u0828\\u0840-\\u0858\\u08a0\\u08a2-\\u08ac\\u0904-\\u0939\\u093d\\u0950\\u0958-\\u0961\\u0971-\\u0977\\u0979-\\u097f\\u0985-\\u098c\\u098f\\u0990\\u0993-\\u09a8\\u09aa-\\u09b0\\u09b2\\u09b6-\\u09b9\\u09bd\\u09ce\\u09dc\\u09dd\\u09df-\\u09e1\\u09f0\\u09f1\\u0a05-\\u0a0a\\u0a0f\\u0a10\\u0a13-\\u0a28\\u0a2a-\\u0a30\\u0a32\\u0a33\\u0a35\\u0a36\\u0a38\\u0a39\\u0a59-\\u0a5c\\u0a5e\\u0a72-\\u0a74\\u0a85-\\u0a8d\\u0a8f-\\u0a91\\u0a93-\\u0aa8\\u0aaa-\\u0ab0\\u0ab2\\u0ab3\\u0ab5-\\u0ab9\\u0abd\\u0ad0\\u0ae0\\u0ae1\\u0b05-\\u0b0c\\u0b0f\\u0b10\\u0b13-\\u0b28\\u0b2a-\\u0b30\\u0b32\\u0b33\\u0b35-\\u0b39\\u0b3d\\u0b5c\\u0b5d\\u0b5f-\\u0b61\\u0b71\\u0b83\\u0b85-\\u0b8a\\u0b8e-\\u0b90\\u0b92-\\u0b95\\u0b99\\u0b9a\\u0b9c\\u0b9e\\u0b9f\\u0ba3\\u0ba4\\u0ba8-\\u0baa\\u0bae-\\u0bb9\\u0bd0\\u0c05-\\u0c0c\\u0c0e-\\u0c10\\u0c12-\\u0c28\\u0c2a-\\u0c33\\u0c35-\\u0c39\\u0c3d\\u0c58\\u0c59\\u0c60\\u0c61\\u0c85-\\u0c8c\\u0c8e-\\u0c90\\u0c92-\\u0ca8\\u0caa-\\u0cb3\\u0cb5-\\u0cb9\\u0cbd\\u0cde\\u0ce0\\u0ce1\\u0cf1\\u0cf2\\u0d05-\\u0d0c\\u0d0e-\\u0d10\\u0d12-\\u0d3a\\u0d3d\\u0d4e\\u0d60\\u0d61\\u0d7a-\\u0d7f\\u0d85-\\u0d96\\u0d9a-\\u0db1\\u0db3-\\u0dbb\\u0dbd\\u0dc0-\\u0dc6\\u0e01-\\u0e30\\u0e32\\u0e33\\u0e40-\\u0e46\\u0e81\\u0e82\\u0e84\\u0e87\\u0e88\\u0e8a\\u0e8d\\u0e94-\\u0e97\\u0e99-\\u0e9f\\u0ea1-\\u0ea3\\u0ea5\\u0ea7\\u0eaa\\u0eab\\u0ead-\\u0eb0\\u0eb2\\u0eb3\\u0ebd\\u0ec0-\\u0ec4\\u0ec6\\u0edc-\\u0edf\\u0f00\\u0f40-\\u0f47\\u0f49-\\u0f6c\\u0f88-\\u0f8c\\u1000-\\u102a\\u103f\\u1050-\\u1055\\u105a-\\u105d\\u1061\\u1065\\u1066\\u106e-\\u1070\\u1075-\\u1081\\u108e\\u10a0-\\u10c5\\u10c7\\u10cd\\u10d0-\\u10fa\\u10fc-\\u1248\\u124a-\\u124d\\u1250-\\u1256\\u1258\\u125a-\\u125d\\u1260-\\u1288\\u128a-\\u128d\\u1290-\\u12b0\\u12b2-\\u12b5\\u12b8-\\u12be\\u12c0\\u12c2-\\u12c5\\u12c8-\\u12d6\\u12d8-\\u1310\\u1312-\\u1315\\u1318-\\u135a\\u1380-\\u138f\\u13a0-\\u13f4\\u1401-\\u166c\\u166f-\\u167f\\u1681-\\u169a\\u16a0-\\u16ea\\u16ee-\\u16f0\\u1700-\\u170c\\u170e-\\u1711\\u1720-\\u1731\\u1740-\\u1751\\u1760-\\u176c\\u176e-\\u1770\\u1780-\\u17b3\\u17d7\\u17dc\\u1820-\\u1877\\u1880-\\u18a8\\u18aa\\u18b0-\\u18f5\\u1900-\\u191c\\u1950-\\u196d\\u1970-\\u1974\\u1980-\\u19ab\\u19c1-\\u19c7\\u1a00-\\u1a16\\u1a20-\\u1a54\\u1aa7\\u1b05-\\u1b33\\u1b45-\\u1b4b\\u1b83-\\u1ba0\\u1bae\\u1baf\\u1bba-\\u1be5\\u1c00-\\u1c23\\u1c4d-\\u1c4f\\u1c5a-\\u1c7d\\u1ce9-\\u1cec\\u1cee-\\u1cf1\\u1cf5\\u1cf6\\u1d00-\\u1dbf\\u1e00-\\u1f15\\u1f18-\\u1f1d\\u1f20-\\u1f45\\u1f48-\\u1f4d\\u1f50-\\u1f57\\u1f59\\u1f5b\\u1f5d\\u1f5f-\\u1f7d\\u1f80-\\u1fb4\\u1fb6-\\u1fbc\\u1fbe\\u1fc2-\\u1fc4\\u1fc6-\\u1fcc\\u1fd0-\\u1fd3\\u1fd6-\\u1fdb\\u1fe0-\\u1fec\\u1ff2-\\u1ff4\\u1ff6-\\u1ffc\\u2071\\u207f\\u2090-\\u209c\\u2102\\u2107\\u210a-\\u2113\\u2115\\u2119-\\u211d\\u2124\\u2126\\u2128\\u212a-\\u212d\\u212f-\\u2139\\u213c-\\u213f\\u2145-\\u2149\\u214e\\u2160-\\u2188\\u2c00-\\u2c2e\\u2c30-\\u2c5e\\u2c60-\\u2ce4\\u2ceb-\\u2cee\\u2cf2\\u2cf3\\u2d00-\\u2d25\\u2d27\\u2d2d\\u2d30-\\u2d67\\u2d6f\\u2d80-\\u2d96\\u2da0-\\u2da6\\u2da8-\\u2dae\\u2db0-\\u2db6\\u2db8-\\u2dbe\\u2dc0-\\u2dc6\\u2dc8-\\u2dce\\u2dd0-\\u2dd6\\u2dd8-\\u2dde\\u2e2f\\u3005-\\u3007\\u3021-\\u3029\\u3031-\\u3035\\u3038-\\u303c\\u3041-\\u3096\\u309d-\\u309f\\u30a1-\\u30fa\\u30fc-\\u30ff\\u3105-\\u312d\\u3131-\\u318e\\u31a0-\\u31ba\\u31f0-\\u31ff\\u3400-\\u4db5\\u4e00-\\u9fcc\\ua000-\\ua48c\\ua4d0-\\ua4fd\\ua500-\\ua60c\\ua610-\\ua61f\\ua62a\\ua62b\\ua640-\\ua66e\\ua67f-\\ua697\\ua6a0-\\ua6ef\\ua717-\\ua71f\\ua722-\\ua788\\ua78b-\\ua78e\\ua790-\\ua793\\ua7a0-\\ua7aa\\ua7f8-\\ua801\\ua803-\\ua805\\ua807-\\ua80a\\ua80c-\\ua822\\ua840-\\ua873\\ua882-\\ua8b3\\ua8f2-\\ua8f7\\ua8fb\\ua90a-\\ua925\\ua930-\\ua946\\ua960-\\ua97c\\ua984-\\ua9b2\\ua9cf\\uaa00-\\uaa28\\uaa40-\\uaa42\\uaa44-\\uaa4b\\uaa60-\\uaa76\\uaa7a\\uaa80-\\uaaaf\\uaab1\\uaab5\\uaab6\\uaab9-\\uaabd\\uaac0\\uaac2\\uaadb-\\uaadd\\uaae0-\\uaaea\\uaaf2-\\uaaf4\\uab01-\\uab06\\uab09-\\uab0e\\uab11-\\uab16\\uab20-\\uab26\\uab28-\\uab2e\\uabc0-\\uabe2\\uac00-\\ud7a3\\ud7b0-\\ud7c6\\ud7cb-\\ud7fb\\uf900-\\ufa6d\\ufa70-\\ufad9\\ufb00-\\ufb06\\ufb13-\\ufb17\\ufb1d\\ufb1f-\\ufb28\\ufb2a-\\ufb36\\ufb38-\\ufb3c\\ufb3e\\ufb40\\ufb41\\ufb43\\ufb44\\ufb46-\\ufbb1\\ufbd3-\\ufd3d\\ufd50-\\ufd8f\\ufd92-\\ufdc7\\ufdf0-\\ufdfb\\ufe70-\\ufe74\\ufe76-\\ufefc\\uff21-\\uff3a\\uff41-\\uff5a\\uff66-\\uffbe\\uffc2-\\uffc7\\uffca-\\uffcf\\uffd2-\\uffd7\\uffda-\\uffdc",o="\\u0300-\\u036f\\u0483-\\u0487\\u0591-\\u05bd\\u05bf\\u05c1\\u05c2\\u05c4\\u05c5\\u05c7\\u0610-\\u061a\\u0620-\\u0649\\u0672-\\u06d3\\u06e7-\\u06e8\\u06fb-\\u06fc\\u0730-\\u074a\\u0800-\\u0814\\u081b-\\u0823\\u0825-\\u0827\\u0829-\\u082d\\u0840-\\u0857\\u08e4-\\u08fe\\u0900-\\u0903\\u093a-\\u093c\\u093e-\\u094f\\u0951-\\u0957\\u0962-\\u0963\\u0966-\\u096f\\u0981-\\u0983\\u09bc\\u09be-\\u09c4\\u09c7\\u09c8\\u09d7\\u09df-\\u09e0\\u0a01-\\u0a03\\u0a3c\\u0a3e-\\u0a42\\u0a47\\u0a48\\u0a4b-\\u0a4d\\u0a51\\u0a66-\\u0a71\\u0a75\\u0a81-\\u0a83\\u0abc\\u0abe-\\u0ac5\\u0ac7-\\u0ac9\\u0acb-\\u0acd\\u0ae2-\\u0ae3\\u0ae6-\\u0aef\\u0b01-\\u0b03\\u0b3c\\u0b3e-\\u0b44\\u0b47\\u0b48\\u0b4b-\\u0b4d\\u0b56\\u0b57\\u0b5f-\\u0b60\\u0b66-\\u0b6f\\u0b82\\u0bbe-\\u0bc2\\u0bc6-\\u0bc8\\u0bca-\\u0bcd\\u0bd7\\u0be6-\\u0bef\\u0c01-\\u0c03\\u0c46-\\u0c48\\u0c4a-\\u0c4d\\u0c55\\u0c56\\u0c62-\\u0c63\\u0c66-\\u0c6f\\u0c82\\u0c83\\u0cbc\\u0cbe-\\u0cc4\\u0cc6-\\u0cc8\\u0cca-\\u0ccd\\u0cd5\\u0cd6\\u0ce2-\\u0ce3\\u0ce6-\\u0cef\\u0d02\\u0d03\\u0d46-\\u0d48\\u0d57\\u0d62-\\u0d63\\u0d66-\\u0d6f\\u0d82\\u0d83\\u0dca\\u0dcf-\\u0dd4\\u0dd6\\u0dd8-\\u0ddf\\u0df2\\u0df3\\u0e34-\\u0e3a\\u0e40-\\u0e45\\u0e50-\\u0e59\\u0eb4-\\u0eb9\\u0ec8-\\u0ecd\\u0ed0-\\u0ed9\\u0f18\\u0f19\\u0f20-\\u0f29\\u0f35\\u0f37\\u0f39\\u0f41-\\u0f47\\u0f71-\\u0f84\\u0f86-\\u0f87\\u0f8d-\\u0f97\\u0f99-\\u0fbc\\u0fc6\\u1000-\\u1029\\u1040-\\u1049\\u1067-\\u106d\\u1071-\\u1074\\u1082-\\u108d\\u108f-\\u109d\\u135d-\\u135f\\u170e-\\u1710\\u1720-\\u1730\\u1740-\\u1750\\u1772\\u1773\\u1780-\\u17b2\\u17dd\\u17e0-\\u17e9\\u180b-\\u180d\\u1810-\\u1819\\u1920-\\u192b\\u1930-\\u193b\\u1951-\\u196d\\u19b0-\\u19c0\\u19c8-\\u19c9\\u19d0-\\u19d9\\u1a00-\\u1a15\\u1a20-\\u1a53\\u1a60-\\u1a7c\\u1a7f-\\u1a89\\u1a90-\\u1a99\\u1b46-\\u1b4b\\u1b50-\\u1b59\\u1b6b-\\u1b73\\u1bb0-\\u1bb9\\u1be6-\\u1bf3\\u1c00-\\u1c22\\u1c40-\\u1c49\\u1c5b-\\u1c7d\\u1cd0-\\u1cd2\\u1d00-\\u1dbe\\u1e01-\\u1f15\\u200c\\u200d\\u203f\\u2040\\u2054\\u20d0-\\u20dc\\u20e1\\u20e5-\\u20f0\\u2d81-\\u2d96\\u2de0-\\u2dff\\u3021-\\u3028\\u3099\\u309a\\ua640-\\ua66d\\ua674-\\ua67d\\ua69f\\ua6f0-\\ua6f1\\ua7f8-\\ua800\\ua806\\ua80b\\ua823-\\ua827\\ua880-\\ua881\\ua8b4-\\ua8c4\\ua8d0-\\ua8d9\\ua8f3-\\ua8f7\\ua900-\\ua909\\ua926-\\ua92d\\ua930-\\ua945\\ua980-\\ua983\\ua9b3-\\ua9c0\\uaa00-\\uaa27\\uaa40-\\uaa41\\uaa4c-\\uaa4d\\uaa50-\\uaa59\\uaa7b\\uaae0-\\uaae9\\uaaf2-\\uaaf3\\uabc0-\\uabe1\\uabec\\uabed\\uabf0-\\uabf9\\ufb20-\\ufb28\\ufe00-\\ufe0f\\ufe20-\\ufe26\\ufe33\\ufe34\\ufe4d-\\ufe4f\\uff10-\\uff19\\uff3f",a="(?:\\\\u[0-9a-fA-F]{4}|["+i+s+"])",l="(?:\\\\u[0-9a-fA-F]{4}|["+r+s+o+"])*";e.identifier=new RegExp(a+l,"g"),e.identifierStart=new RegExp(a),e.identifierMatch=new RegExp("(?:\\\\u[0-9a-fA-F]{4}|["+r+s+o+"])+");e.newline=/[\n\r\u2028\u2029]/,e.lineBreak=new RegExp("\r\n|"+e.newline.source),e.allLineBreaks=new RegExp(e.lineBreak.source,"g")},function(t,e,n){"use strict";var i=n(6).Options,r=["before-newline","after-newline","preserve-newline"];function s(t){i.call(this,t,"js");var e=this.raw_options.brace_style||null;"expand-strict"===e?this.raw_options.brace_style="expand":"collapse-preserve-inline"===e?this.raw_options.brace_style="collapse,preserve-inline":void 0!==this.raw_options.braces_on_own_line&&(this.raw_options.brace_style=this.raw_options.braces_on_own_line?"expand":"collapse");var n=this._get_selection_list("brace_style",["collapse","expand","end-expand","none","preserve-inline"]);this.brace_preserve_inline=!1,this.brace_style="collapse";for(var s=0;s>> === !== << && >= ** != == <= >> || ?? |> < / - + > : & % ? ^ | *".split(" "),m=">>>= ... >>= <<= === >>> !== **= => ^= :: /= << <= == && -= >= >> != -- += ** || ?? ++ %= &= *= |= |> = ! ? > < : / ^ - + * & % ~ |";m=m.replace(/[-[\]{}()*+?.,\\^$|#]/g,"\\$&"),m="\\?\\.(?!\\d) "+m,m=m.replace(/ /g,"|");var v,y=new RegExp(m),b="continue,try,throw,return,var,let,const,if,switch,case,default,for,while,break,function,import,export".split(","),w=b.concat(["do","in","of","else","get","set","new","catch","finally","typeof","yield","async","await","from","as"]),x=new RegExp("^(?:"+w.join("|")+")$"),k=function(t,e){r.call(this,t,e),this._patterns.whitespace=this._patterns.whitespace.matching(/\u00A0\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff/.source,/\u2028\u2029/.source);var n=new l(this._input),i=new u(this._input).read_options(this._options);this.__patterns={template:i,identifier:i.starting_with(a.identifier).matching(a.identifierMatch),number:n.matching(_),punct:n.matching(y),comment:n.starting_with(/\/\//).until(/[\n\r\u2028\u2029]/),block_comment:n.starting_with(/\/\*/).until_after(/\*\//),html_comment_start:n.matching(//),include:n.starting_with(/#include/).until_after(a.lineBreak),shebang:n.starting_with(/#!/).until_after(a.lineBreak),xml:n.matching(/[\s\S]*?<(\/?)([-a-zA-Z:0-9_.]+|{[\s\S]+?}|!\[CDATA\[[\s\S]*?\]\]|)(\s+{[\s\S]+?}|\s+[-a-zA-Z:0-9_.]+|\s+[-a-zA-Z:0-9_.]+\s*=\s*('[^']*'|"[^"]*"|{[\s\S]+?}))*\s*(\/?)\s*>/),single_quote:i.until(/['\\\n\r\u2028\u2029]/),double_quote:i.until(/["\\\n\r\u2028\u2029]/),template_text:i.until(/[`\\$]/),template_expression:i.until(/[`}\\]/)}};function C(t){var e="",n=0,r=new i(t),s=null;while(r.hasNext())if(s=r.match(/([\s]|[^\\]|\\\\)+/g),s&&(e+=s[0]),"\\"===r.peek()){if(r.next(),"x"===r.peek())s=r.match(/x([0-9A-Fa-f]{2})/g);else{if("u"!==r.peek()){e+="\\",r.hasNext()&&(e+=r.next());continue}s=r.match(/u([0-9A-Fa-f]{4})/g)}if(!s)return t;if(n=parseInt(s[1],16),n>126&&n<=255&&0===s[0].indexOf("x"))return t;if(n>=0&&n<32){e+="\\"+s[0];continue}e+=34===n||39===n||92===n?"\\"+String.fromCharCode(n):String.fromCharCode(n)}return e}k.prototype=new r,k.prototype._is_comment=function(t){return t.type===c.COMMENT||t.type===c.BLOCK_COMMENT||t.type===c.UNKNOWN},k.prototype._is_opening=function(t){return t.type===c.START_BLOCK||t.type===c.START_EXPR},k.prototype._is_closing=function(t,e){return(t.type===c.END_BLOCK||t.type===c.END_EXPR)&&e&&("]"===t.text&&"["===e.text||")"===t.text&&"("===e.text||"}"===t.text&&"{"===e.text)},k.prototype._reset=function(){v=!1},k.prototype._get_next_token=function(t,e){var n=null;this._readWhitespace();var i=this._input.peek();return null===i?this._create_token(c.EOF,""):(n=n||this._read_non_javascript(i),n=n||this._read_string(i),n=n||this._read_word(t),n=n||this._read_singles(i),n=n||this._read_comment(i),n=n||this._read_regexp(i,t),n=n||this._read_xml(i,t),n=n||this._read_punctuation(),n=n||this._create_token(c.UNKNOWN,this._input.next()),n)},k.prototype._read_word=function(t){var e;return e=this.__patterns.identifier.read(),""!==e?(e=e.replace(a.allLineBreaks,"\n"),t.type!==c.DOT&&(t.type!==c.RESERVED||"set"!==t.text&&"get"!==t.text)&&x.test(e)?"in"===e||"of"===e?this._create_token(c.OPERATOR,e):this._create_token(c.RESERVED,e):this._create_token(c.WORD,e)):(e=this.__patterns.number.read(),""!==e?this._create_token(c.WORD,e):void 0)},k.prototype._read_singles=function(t){var e=null;return"("===t||"["===t?e=this._create_token(c.START_EXPR,t):")"===t||"]"===t?e=this._create_token(c.END_EXPR,t):"{"===t?e=this._create_token(c.START_BLOCK,t):"}"===t?e=this._create_token(c.END_BLOCK,t):";"===t?e=this._create_token(c.SEMICOLON,t):"."===t&&d.test(this._input.peek(1))?e=this._create_token(c.DOT,t):","===t&&(e=this._create_token(c.COMMA,t)),e&&this._input.next(),e},k.prototype._read_punctuation=function(){var t=this.__patterns.punct.read();if(""!==t)return"="===t?this._create_token(c.EQUALS,t):"?."===t?this._create_token(c.DOT,t):this._create_token(c.OPERATOR,t)},k.prototype._read_non_javascript=function(t){var e="";if("#"===t){if(this._is_first_token()&&(e=this.__patterns.shebang.read(),e))return this._create_token(c.UNKNOWN,e.trim()+"\n");if(e=this.__patterns.include.read(),e)return this._create_token(c.UNKNOWN,e.trim()+"\n");t=this._input.next();var n="#";if(this._input.hasNext()&&this._input.testChar(f)){do{t=this._input.next(),n+=t}while(this._input.hasNext()&&"#"!==t&&"="!==t);return"#"===t||("["===this._input.peek()&&"]"===this._input.peek(1)?(n+="[]",this._input.next(),this._input.next()):"{"===this._input.peek()&&"}"===this._input.peek(1)&&(n+="{}",this._input.next(),this._input.next())),this._create_token(c.WORD,n)}this._input.back()}else if("<"===t&&this._is_first_token()){if(e=this.__patterns.html_comment_start.read(),e){while(this._input.hasNext()&&!this._input.testChar(a.newline))e+=this._input.next();return v=!0,this._create_token(c.COMMENT,e)}}else if(v&&"-"===t&&(e=this.__patterns.html_comment_end.read(),e))return v=!1,this._create_token(c.COMMENT,e);return null},k.prototype._read_comment=function(t){var e=null;if("/"===t){var n="";if("*"===this._input.peek(1)){n=this.__patterns.block_comment.read();var i=p.get_directives(n);i&&"start"===i.ignore&&(n+=p.readIgnored(this._input)),n=n.replace(a.allLineBreaks,"\n"),e=this._create_token(c.BLOCK_COMMENT,n),e.directives=i}else"/"===this._input.peek(1)&&(n=this.__patterns.comment.read(),e=this._create_token(c.COMMENT,n))}return e},k.prototype._read_string=function(t){if("`"===t||"'"===t||'"'===t){var e=this._input.next();return this.has_char_escapes=!1,e+="`"===t?this._read_string_recursive("`",!0,"${"):this._read_string_recursive(t),this.has_char_escapes&&this._options.unescape_strings&&(e=C(e)),this._input.peek()===t&&(e+=this._input.next()),e=e.replace(a.allLineBreaks,"\n"),this._create_token(c.STRING,e)}return null},k.prototype._allow_regexp_or_xml=function(t){return t.type===c.RESERVED&&h(t.text,["return","case","throw","else","do","typeof","yield"])||t.type===c.END_EXPR&&")"===t.text&&t.opened.previous.type===c.RESERVED&&h(t.opened.previous.text,["if","while","for"])||h(t.type,[c.COMMENT,c.START_EXPR,c.START_BLOCK,c.START,c.END_BLOCK,c.OPERATOR,c.EQUALS,c.EOF,c.SEMICOLON,c.COMMA])},k.prototype._read_regexp=function(t,e){if("/"===t&&this._allow_regexp_or_xml(e)){var n=this._input.next(),i=!1,r=!1;while(this._input.hasNext()&&(i||r||this._input.peek()!==t)&&!this._input.testChar(a.newline))n+=this._input.peek(),i?i=!1:(i="\\"===this._input.peek(),"["===this._input.peek()?r=!0:"]"===this._input.peek()&&(r=!1)),this._input.next();return this._input.peek()===t&&(n+=this._input.next(),n+=this._input.read(a.identifier)),this._create_token(c.STRING,n)}return null},k.prototype._read_xml=function(t,e){if(this._options.e4x&&"<"===t&&this._allow_regexp_or_xml(e)){var n="",i=this.__patterns.xml.read_match();if(i){var r=i[2].replace(/^{\s+/,"{").replace(/\s+}$/,"}"),s=0===r.indexOf("{"),o=0;while(i){var l=!!i[1],u=i[2],h=!!i[i.length-1]||"![CDATA["===u.slice(0,8);if(!h&&(u===r||s&&u.replace(/^{\s+/,"{").replace(/\s+}$/,"}"))&&(l?--o:++o),n+=i[0],o<=0)break;i=this.__patterns.xml.read_match()}return i||(n+=this._input.match(/[\s\S]*/g)[0]),n=n.replace(a.allLineBreaks,"\n"),this._create_token(c.STRING,n)}}return null},k.prototype._read_string_recursive=function(t,e,n){var i,r;"'"===t?r=this.__patterns.single_quote:'"'===t?r=this.__patterns.double_quote:"`"===t?r=this.__patterns.template_text:"}"===t&&(r=this.__patterns.template_expression);var s=r.read(),o="";while(this._input.hasNext()){if(o=this._input.next(),o===t||!e&&a.newline.test(o)){this._input.back();break}"\\"===o&&this._input.hasNext()?(i=this._input.peek(),"x"===i||"u"===i?this.has_char_escapes=!0:"\r"===i&&"\n"===this._input.peek(1)&&this._input.next(),o+=this._input.next()):n&&("${"===n&&"$"===o&&"{"===this._input.peek()&&(o+=this._input.next()),n===o&&(o+="`"===t?this._read_string_recursive("}",e,"`"):this._read_string_recursive("`",e,"${"),this._input.hasNext()&&(o+=this._input.next()))),o+=r.read(),s+=o}return s},t.exports.Tokenizer=k,t.exports.TOKEN=c,t.exports.positionable_operators=g.slice(),t.exports.line_starters=b.slice()},function(t,e,n){"use strict";var i=RegExp.prototype.hasOwnProperty("sticky");function r(t){this.__input=t||"",this.__input_length=this.__input.length,this.__position=0}r.prototype.restart=function(){this.__position=0},r.prototype.back=function(){this.__position>0&&(this.__position-=1)},r.prototype.hasNext=function(){return this.__position=0&&t=0&&e=t.length&&this.__input.substring(e-t.length,e).toLowerCase()===t},t.exports.InputScanner=r},function(t,e,n){"use strict";var i=n(8).InputScanner,r=n(3).Token,s=n(10).TokenStream,o=n(11).WhitespacePattern,a={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},l=function(t,e){this._input=new i(t),this._options=e||{},this.__tokens=null,this._patterns={},this._patterns.whitespace=new o(this._input)};l.prototype.tokenize=function(){var t;this._input.restart(),this.__tokens=new s,this._reset();var e=new r(a.START,""),n=null,i=[],o=new s;while(e.type!==a.EOF){t=this._get_next_token(e,n);while(this._is_comment(t))o.add(t),t=this._get_next_token(e,n);o.isEmpty()||(t.comments_before=o,o=new s),t.parent=n,this._is_opening(t)?(i.push(n),n=t):n&&this._is_closing(t,n)&&(t.opened=n,n.closed=t,n=i.pop(),t.parent=n),t.previous=e,e.next=t,this.__tokens.add(t),e=t}return this.__tokens},l.prototype._is_first_token=function(){return this.__tokens.isEmpty()},l.prototype._reset=function(){},l.prototype._get_next_token=function(t,e){this._readWhitespace();var n=this._input.read(/.+/g);return n?this._create_token(a.RAW,n):this._create_token(a.EOF,"")},l.prototype._is_comment=function(t){return!1},l.prototype._is_opening=function(t){return!1},l.prototype._is_closing=function(t,e){return!1},l.prototype._create_token=function(t,e){var n=new r(t,e,this._patterns.whitespace.newline_count,this._patterns.whitespace.whitespace_before_token);return n},l.prototype._readWhitespace=function(){return this._patterns.whitespace.read()},t.exports.Tokenizer=l,t.exports.TOKEN=a},function(t,e,n){"use strict";function i(t){this.__tokens=[],this.__tokens_length=this.__tokens.length,this.__position=0,this.__parent_token=t}i.prototype.restart=function(){this.__position=0},i.prototype.isEmpty=function(){return 0===this.__tokens_length},i.prototype.hasNext=function(){return this.__position=0&&t/),erb:n.starting_with(/<%[^%]/).until_after(/[^%]%>/),django:n.starting_with(/{%/).until_after(/%}/),django_value:n.starting_with(/{{/).until_after(/}}/),django_comment:n.starting_with(/{#/).until_after(/#}/),smarty:n.starting_with(/{(?=[^}{\s\n])/).until_after(/[^\s\n]}/),smarty_comment:n.starting_with(/{\*/).until_after(/\*}/),smarty_literal:n.starting_with(/{literal}/).until_after(/{\/literal}/)}}s.prototype=new i,s.prototype._create=function(){return new s(this._input,this)},s.prototype._update=function(){this.__set_templated_pattern()},s.prototype.disable=function(t){var e=this._create();return e._disabled[t]=!0,e._update(),e},s.prototype.read_options=function(t){var e=this._create();for(var n in r)e._disabled[n]=-1===t.templating.indexOf(n);return e._update(),e},s.prototype.exclude=function(t){var e=this._create();return e._excluded[t]=!0,e._update(),e},s.prototype.read=function(){var t="";t=this._match_pattern?this._input.read(this._starting_pattern):this._input.read(this._starting_pattern,this.__template_pattern);var e=this._read_template();while(e)this._match_pattern?e+=this._input.read(this._match_pattern):e+=this._input.readUntil(this.__template_pattern),t+=e,e=this._read_template();return this._until_after&&(t+=this._input.readUntilAfter(this._until_pattern)),t},s.prototype.__set_templated_pattern=function(){var t=[];this._disabled.php||t.push(this.__patterns.php._starting_pattern.source),this._disabled.handlebars||t.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.erb||t.push(this.__patterns.erb._starting_pattern.source),this._disabled.django||(t.push(this.__patterns.django._starting_pattern.source),t.push(this.__patterns.django_value._starting_pattern.source),t.push(this.__patterns.django_comment._starting_pattern.source)),this._disabled.smarty||t.push(this.__patterns.smarty._starting_pattern.source),this._until_pattern&&t.push(this._until_pattern.source),this.__template_pattern=this._input.get_regexp("(?:"+t.join("|")+")")},s.prototype._read_template=function(){var t="",e=this._input.peek();if("<"===e){var n=this._input.peek(1);this._disabled.php||this._excluded.php||"?"!==n||(t=t||this.__patterns.php.read()),this._disabled.erb||this._excluded.erb||"%"!==n||(t=t||this.__patterns.erb.read())}else"{"===e&&(this._disabled.handlebars||this._excluded.handlebars||(t=t||this.__patterns.handlebars_comment.read(),t=t||this.__patterns.handlebars_unescaped.read(),t=t||this.__patterns.handlebars.read()),this._disabled.django||(this._excluded.django||this._excluded.handlebars||(t=t||this.__patterns.django_value.read()),this._excluded.django||(t=t||this.__patterns.django_comment.read(),t=t||this.__patterns.django.read())),this._disabled.smarty||this._disabled.django&&this._disabled.handlebars&&(t=t||this.__patterns.smarty_comment.read(),t=t||this.__patterns.smarty_literal.read(),t=t||this.__patterns.smarty.read()));return t},t.exports.TemplatablePattern=s}]),s=n;i=[],r=function(){return{js_beautify:s}}.apply(e,i),void 0===r||(t.exports=r)})()},1461:function(t,e,n){},"30cb":function(t,e,n){"use strict";var i,r;function s(t,e,n){var i=function(e,n){return t.js_beautify(e,n)};return i.js=t.js_beautify,i.css=e.css_beautify,i.html=n.html_beautify,i.js_beautify=t.js_beautify,i.css_beautify=e.css_beautify,i.html_beautify=n.html_beautify,i}i=[n("0377"),n("5d59"),n("d399")],r=function(t,e,n){return s(t,e,n)}.apply(e,i),void 0===r||(t.exports=r)},"5d59":function(t,e,n){var i,r;(function(){var n=function(t){var e={};function n(i){if(e[i])return e[i].exports;var r=e[i]={i:i,l:!1,exports:{}};return t[i].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=t,n.c=e,n.d=function(t,e,i){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:i})},n.r=function(t){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"===typeof t&&t&&t.__esModule)return t;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var r in t)n.d(i,r,function(e){return t[e]}.bind(null,r));return i},n.n=function(t){var e=t&&t.__esModule?function(){return t["default"]}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=15)}([,,function(t,e,n){"use strict";function i(t){this.__parent=t,this.__character_count=0,this.__indent_count=-1,this.__alignment_count=0,this.__wrap_point_index=0,this.__wrap_point_character_count=0,this.__wrap_point_indent_count=-1,this.__wrap_point_alignment_count=0,this.__items=[]}function r(t,e){this.__cache=[""],this.__indent_size=t.indent_size,this.__indent_string=t.indent_char,t.indent_with_tabs||(this.__indent_string=new Array(t.indent_size+1).join(t.indent_char)),e=e||"",t.indent_level>0&&(e=new Array(t.indent_level+1).join(this.__indent_string)),this.__base_string=e,this.__base_string_length=e.length}function s(t,e){this.__indent_cache=new r(t,e),this.raw=!1,this._end_with_newline=t.end_with_newline,this.indent_size=t.indent_size,this.wrap_line_length=t.wrap_line_length,this.indent_empty_lines=t.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new i(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}i.prototype.clone_empty=function(){var t=new i(this.__parent);return t.set_indent(this.__indent_count,this.__alignment_count),t},i.prototype.item=function(t){return t<0?this.__items[this.__items.length+t]:this.__items[t]},i.prototype.has_match=function(t){for(var e=this.__items.length-1;e>=0;e--)if(this.__items[e].match(t))return!0;return!1},i.prototype.set_indent=function(t,e){this.is_empty()&&(this.__indent_count=t||0,this.__alignment_count=e||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},i.prototype._set_wrap_point=function(){this.__parent.wrap_line_length&&(this.__wrap_point_index=this.__items.length,this.__wrap_point_character_count=this.__character_count,this.__wrap_point_indent_count=this.__parent.next_line.__indent_count,this.__wrap_point_alignment_count=this.__parent.next_line.__alignment_count)},i.prototype._should_wrap=function(){return this.__wrap_point_index&&this.__character_count>this.__parent.wrap_line_length&&this.__wrap_point_character_count>this.__parent.next_line.__character_count},i.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var t=this.__parent.current_line;return t.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),t.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),t.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count," "===t.__items[0]&&(t.__items.splice(0,1),t.__character_count-=1),!0}return!1},i.prototype.is_empty=function(){return 0===this.__items.length},i.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},i.prototype.push=function(t){this.__items.push(t);var e=t.lastIndexOf("\n");-1!==e?this.__character_count=t.length-e:this.__character_count+=t.length},i.prototype.pop=function(){var t=null;return this.is_empty()||(t=this.__items.pop(),this.__character_count-=t.length),t},i.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},i.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},i.prototype.trim=function(){while(" "===this.last())this.__items.pop(),this.__character_count-=1},i.prototype.toString=function(){var t="";return this.is_empty()?this.__parent.indent_empty_lines&&(t=this.__parent.get_indent_string(this.__indent_count)):(t=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),t+=this.__items.join("")),t},r.prototype.get_indent_size=function(t,e){var n=this.__base_string_length;return e=e||0,t<0&&(n=0),n+=t*this.__indent_size,n+=e,n},r.prototype.get_indent_string=function(t,e){var n=this.__base_string;return e=e||0,t<0&&(t=0,n=""),e+=t*this.__indent_size,this.__ensure_cache(e),n+=this.__cache[e],n},r.prototype.__ensure_cache=function(t){while(t>=this.__cache.length)this.__add_column()},r.prototype.__add_column=function(){var t=this.__cache.length,e=0,n="";this.__indent_size&&t>=this.__indent_size&&(e=Math.floor(t/this.__indent_size),t-=e*this.__indent_size,n=new Array(e+1).join(this.__indent_string)),t&&(n+=new Array(t+1).join(" ")),this.__cache.push(n)},s.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},s.prototype.get_line_number=function(){return this.__lines.length},s.prototype.get_indent_string=function(t,e){return this.__indent_cache.get_indent_string(t,e)},s.prototype.get_indent_size=function(t,e){return this.__indent_cache.get_indent_size(t,e)},s.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},s.prototype.add_new_line=function(t){return!(this.is_empty()||!t&&this.just_added_newline())&&(this.raw||this.__add_outputline(),!0)},s.prototype.get_code=function(t){this.trim(!0);var e=this.current_line.pop();e&&("\n"===e[e.length-1]&&(e=e.replace(/\n+$/g,"")),this.current_line.push(e)),this._end_with_newline&&this.__add_outputline();var n=this.__lines.join("\n");return"\n"!==t&&(n=n.replace(/[\n]/g,t)),n},s.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},s.prototype.set_indent=function(t,e){return t=t||0,e=e||0,this.next_line.set_indent(t,e),this.__lines.length>1?(this.current_line.set_indent(t,e),!0):(this.current_line.set_indent(),!1)},s.prototype.add_raw_token=function(t){for(var e=0;e1&&this.current_line.is_empty())this.__lines.pop(),this.current_line=this.__lines[this.__lines.length-1],this.current_line.trim();this.previous_line=this.__lines.length>1?this.__lines[this.__lines.length-2]:null},s.prototype.just_added_newline=function(){return this.current_line.is_empty()},s.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},s.prototype.ensure_empty_line_above=function(t,e){var n=this.__lines.length-2;while(n>=0){var r=this.__lines[n];if(r.is_empty())break;if(0!==r.item(0).indexOf(t)&&r.item(-1)!==e){this.__lines.splice(n+1,0,new i(this)),this.previous_line=this.__lines[this.__lines.length-2];break}n--}},t.exports.Output=s},,,,function(t,e,n){"use strict";function i(t,e){this.raw_options=r(t,e),this.disabled=this._get_boolean("disabled"),this.eol=this._get_characters("eol","auto"),this.end_with_newline=this._get_boolean("end_with_newline"),this.indent_size=this._get_number("indent_size",4),this.indent_char=this._get_characters("indent_char"," "),this.indent_level=this._get_number("indent_level"),this.preserve_newlines=this._get_boolean("preserve_newlines",!0),this.max_preserve_newlines=this._get_number("max_preserve_newlines",32786),this.preserve_newlines||(this.max_preserve_newlines=0),this.indent_with_tabs=this._get_boolean("indent_with_tabs","\t"===this.indent_char),this.indent_with_tabs&&(this.indent_char="\t",1===this.indent_size&&(this.indent_size=4)),this.wrap_line_length=this._get_number("wrap_line_length",this._get_number("max_char")),this.indent_empty_lines=this._get_boolean("indent_empty_lines"),this.templating=this._get_selection_list("templating",["auto","none","django","erb","handlebars","php","smarty"],["auto"])}function r(t,e){var n,i={};for(n in t=s(t),t)n!==e&&(i[n]=t[n]);if(e&&t[e])for(n in t[e])i[n]=t[e][n];return i}function s(t){var e,n={};for(e in t){var i=e.replace(/-/g,"_");n[i]=t[e]}return n}i.prototype._get_array=function(t,e){var n=this.raw_options[t],i=e||[];return"object"===typeof n?null!==n&&"function"===typeof n.concat&&(i=n.concat()):"string"===typeof n&&(i=n.split(/[^a-zA-Z0-9_\/\-]+/)),i},i.prototype._get_boolean=function(t,e){var n=this.raw_options[t],i=void 0===n?!!e:!!n;return i},i.prototype._get_characters=function(t,e){var n=this.raw_options[t],i=e||"";return"string"===typeof n&&(i=n.replace(/\\r/,"\r").replace(/\\n/,"\n").replace(/\\t/,"\t")),i},i.prototype._get_number=function(t,e){var n=this.raw_options[t];e=parseInt(e,10),isNaN(e)&&(e=0);var i=parseInt(n,10);return isNaN(i)&&(i=e),i},i.prototype._get_selection=function(t,e,n){var i=this._get_selection_list(t,e,n);if(1!==i.length)throw new Error("Invalid Option Value: The option '"+t+"' can only be one of the following values:\n"+e+"\nYou passed in: '"+this.raw_options[t]+"'");return i[0]},i.prototype._get_selection_list=function(t,e,n){if(!e||0===e.length)throw new Error("Selection list cannot be empty.");if(n=n||[e[0]],!this._is_valid_selection(n,e))throw new Error("Invalid Default Value!");var i=this._get_array(t,n);if(!this._is_valid_selection(i,e))throw new Error("Invalid Option Value: The option '"+t+"' can contain only the following values:\n"+e+"\nYou passed in: '"+this.raw_options[t]+"'");return i},i.prototype._is_valid_selection=function(t,e){return t.length&&e.length&&!t.some((function(t){return-1===e.indexOf(t)}))},t.exports.Options=i,t.exports.normalizeOpts=s,t.exports.mergeOpts=r},,function(t,e,n){"use strict";var i=RegExp.prototype.hasOwnProperty("sticky");function r(t){this.__input=t||"",this.__input_length=this.__input.length,this.__position=0}r.prototype.restart=function(){this.__position=0},r.prototype.back=function(){this.__position>0&&(this.__position-=1)},r.prototype.hasNext=function(){return this.__position=0&&t=0&&e=t.length&&this.__input.substring(e-t.length,e).toLowerCase()===t},t.exports.InputScanner=r},,,,,function(t,e,n){"use strict";function i(t,e){t="string"===typeof t?t:t.source,e="string"===typeof e?e:e.source,this.__directives_block_pattern=new RegExp(t+/ beautify( \w+[:]\w+)+ /.source+e,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(t+/\sbeautify\signore:end\s/.source+e,"g")}i.prototype.get_directives=function(t){if(!t.match(this.__directives_block_pattern))return null;var e={};this.__directive_pattern.lastIndex=0;var n=this.__directive_pattern.exec(t);while(n)e[n[1]]=n[2],n=this.__directive_pattern.exec(t);return e},i.prototype.readIgnored=function(t){return t.readUntilAfter(this.__directives_end_ignore_pattern)},t.exports.Directives=i},,function(t,e,n){"use strict";var i=n(16).Beautifier,r=n(17).Options;function s(t,e){var n=new i(t,e);return n.beautify()}t.exports=s,t.exports.defaultOptions=function(){return new r}},function(t,e,n){"use strict";var i=n(17).Options,r=n(2).Output,s=n(8).InputScanner,o=n(13).Directives,a=new o(/\/\*/,/\*\//),l=/\r\n|[\r\n]/,u=/\r\n|[\r\n]/g,h=/\s/,c=/(?:\s|\n)+/g,p=/\/\*(?:[\s\S]*?)((?:\*\/)|$)/g,_=/\/\/(?:[^\n\r\u2028\u2029]*)/g;function f(t,e){this._source_text=t||"",this._options=new i(e),this._ch=null,this._input=null,this.NESTED_AT_RULE={"@page":!0,"@font-face":!0,"@keyframes":!0,"@media":!0,"@supports":!0,"@document":!0},this.CONDITIONAL_GROUP_RULE={"@media":!0,"@supports":!0,"@document":!0}}f.prototype.eatString=function(t){var e="";this._ch=this._input.next();while(this._ch){if(e+=this._ch,"\\"===this._ch)e+=this._input.next();else if(-1!==t.indexOf(this._ch)||"\n"===this._ch)break;this._ch=this._input.next()}return e},f.prototype.eatWhitespace=function(t){var e=h.test(this._input.peek()),n=0;while(h.test(this._input.peek()))this._ch=this._input.next(),t&&"\n"===this._ch&&(0===n||n0&&this._indentLevel--},f.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var t=this._source_text,e=this._options.eol;"auto"===e&&(e="\n",t&&l.test(t||"")&&(e=t.match(l)[0])),t=t.replace(u,"\n");var n=t.match(/^[\t ]*/)[0];this._output=new r(this._options,n),this._input=new s(t),this._indentLevel=0,this._nestedLevel=0,this._ch=null;var i,o,f,d=0,g=!1,m=!1,v=!1,y=!1,b=!1,w=this._ch;while(1){if(i=this._input.read(c),o=""!==i,f=w,this._ch=this._input.next(),"\\"===this._ch&&this._input.hasNext()&&(this._ch+=this._input.next()),w=this._ch,!this._ch)break;if("/"===this._ch&&"*"===this._input.peek()){this._output.add_new_line(),this._input.back();var x=this._input.read(p),k=a.get_directives(x);k&&"start"===k.ignore&&(x+=a.readIgnored(this._input)),this.print_string(x),this.eatWhitespace(!0),this._output.add_new_line()}else if("/"===this._ch&&"/"===this._input.peek())this._output.space_before_token=!0,this._input.back(),this.print_string(this._input.read(_)),this.eatWhitespace(!0);else if("@"===this._ch)if(this.preserveSingleSpace(o),"{"===this._input.peek())this.print_string(this._ch+this.eatString("}"));else{this.print_string(this._ch);var C=this._input.peekUntilAfter(/[: ,;{}()[\]\/='"]/g);C.match(/[ :]$/)&&(C=this.eatString(": ").replace(/\s$/,""),this.print_string(C),this._output.space_before_token=!0),C=C.replace(/\s$/,""),"extend"===C?y=!0:"import"===C&&(b=!0),C in this.NESTED_AT_RULE?(this._nestedLevel+=1,C in this.CONDITIONAL_GROUP_RULE&&(v=!0)):g||0!==d||-1===C.indexOf(":")||(m=!0,this.indent())}else"#"===this._ch&&"{"===this._input.peek()?(this.preserveSingleSpace(o),this.print_string(this._ch+this.eatString("}"))):"{"===this._ch?(m&&(m=!1,this.outdent()),v?(v=!1,g=this._indentLevel>=this._nestedLevel):g=this._indentLevel>=this._nestedLevel-1,this._options.newline_between_rules&&g&&this._output.previous_line&&"{"!==this._output.previous_line.item(-1)&&this._output.ensure_empty_line_above("/",","),this._output.space_before_token=!0,"expand"===this._options.brace_style?(this._output.add_new_line(),this.print_string(this._ch),this.indent(),this._output.set_indent(this._indentLevel)):(this.indent(),this.print_string(this._ch)),this.eatWhitespace(!0),this._output.add_new_line()):"}"===this._ch?(this.outdent(),this._output.add_new_line(),"{"===f&&this._output.trim(!0),b=!1,y=!1,m&&(this.outdent(),m=!1),this.print_string(this._ch),g=!1,this._nestedLevel&&this._nestedLevel--,this.eatWhitespace(!0),this._output.add_new_line(),this._options.newline_between_rules&&!this._output.just_added_blankline()&&"}"!==this._input.peek()&&this._output.add_new_line(!0)):":"===this._ch?!g&&!v||this._input.lookBack("&")||this.foundNestedPseudoClass()||this._input.lookBack("(")||y||0!==d?(this._input.lookBack(" ")&&(this._output.space_before_token=!0),":"===this._input.peek()?(this._ch=this._input.next(),this.print_string("::")):this.print_string(":")):(this.print_string(":"),m||(m=!0,this._output.space_before_token=!0,this.eatWhitespace(!0),this.indent())):'"'===this._ch||"'"===this._ch?(this.preserveSingleSpace(o),this.print_string(this._ch+this.eatString(this._ch)),this.eatWhitespace(!0)):";"===this._ch?0===d?(m&&(this.outdent(),m=!1),y=!1,b=!1,this.print_string(this._ch),this.eatWhitespace(!0),"/"!==this._input.peek()&&this._output.add_new_line()):(this.print_string(this._ch),this.eatWhitespace(!0),this._output.space_before_token=!0):"("===this._ch?this._input.lookBack("url")?(this.print_string(this._ch),this.eatWhitespace(),d++,this.indent(),this._ch=this._input.next(),")"===this._ch||'"'===this._ch||"'"===this._ch?this._input.back():this._ch&&(this.print_string(this._ch+this.eatString(")")),d&&(d--,this.outdent()))):(this.preserveSingleSpace(o),this.print_string(this._ch),this.eatWhitespace(),d++,this.indent()):")"===this._ch?(d&&(d--,this.outdent()),this.print_string(this._ch)):","===this._ch?(this.print_string(this._ch),this.eatWhitespace(!0),!this._options.selector_separator_newline||m||0!==d||b?this._output.space_before_token=!0:this._output.add_new_line()):">"!==this._ch&&"+"!==this._ch&&"~"!==this._ch||m||0!==d?"]"===this._ch?this.print_string(this._ch):"["===this._ch?(this.preserveSingleSpace(o),this.print_string(this._ch)):"="===this._ch?(this.eatWhitespace(),this.print_string("="),h.test(this._ch)&&(this._ch="")):"!"!==this._ch||this._input.lookBack("\\")?(this.preserveSingleSpace(o),this.print_string(this._ch)):(this.print_string(" "),this.print_string(this._ch)):this._options.space_around_combinator?(this._output.space_before_token=!0,this.print_string(this._ch),this._output.space_before_token=!0):(this.print_string(this._ch),this.eatWhitespace(),this._ch&&h.test(this._ch)&&(this._ch=""))}var S=this._output.get_code(e);return S},t.exports.Beautifier=f},function(t,e,n){"use strict";var i=n(6).Options;function r(t){i.call(this,t,"css"),this.selector_separator_newline=this._get_boolean("selector_separator_newline",!0),this.newline_between_rules=this._get_boolean("newline_between_rules",!0);var e=this._get_boolean("space_around_selector_separator");this.space_around_combinator=this._get_boolean("space_around_combinator")||e;var n=this._get_selection_list("brace_style",["collapse","expand","end-expand","none","preserve-inline"]);this.brace_style="collapse";for(var r=0;r0&&(e=new Array(t.indent_level+1).join(this.__indent_string)),this.__base_string=e,this.__base_string_length=e.length}function s(t,e){this.__indent_cache=new r(t,e),this.raw=!1,this._end_with_newline=t.end_with_newline,this.indent_size=t.indent_size,this.wrap_line_length=t.wrap_line_length,this.indent_empty_lines=t.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new i(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}i.prototype.clone_empty=function(){var t=new i(this.__parent);return t.set_indent(this.__indent_count,this.__alignment_count),t},i.prototype.item=function(t){return t<0?this.__items[this.__items.length+t]:this.__items[t]},i.prototype.has_match=function(t){for(var e=this.__items.length-1;e>=0;e--)if(this.__items[e].match(t))return!0;return!1},i.prototype.set_indent=function(t,e){this.is_empty()&&(this.__indent_count=t||0,this.__alignment_count=e||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},i.prototype._set_wrap_point=function(){this.__parent.wrap_line_length&&(this.__wrap_point_index=this.__items.length,this.__wrap_point_character_count=this.__character_count,this.__wrap_point_indent_count=this.__parent.next_line.__indent_count,this.__wrap_point_alignment_count=this.__parent.next_line.__alignment_count)},i.prototype._should_wrap=function(){return this.__wrap_point_index&&this.__character_count>this.__parent.wrap_line_length&&this.__wrap_point_character_count>this.__parent.next_line.__character_count},i.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var t=this.__parent.current_line;return t.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),t.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),t.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count," "===t.__items[0]&&(t.__items.splice(0,1),t.__character_count-=1),!0}return!1},i.prototype.is_empty=function(){return 0===this.__items.length},i.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},i.prototype.push=function(t){this.__items.push(t);var e=t.lastIndexOf("\n");-1!==e?this.__character_count=t.length-e:this.__character_count+=t.length},i.prototype.pop=function(){var t=null;return this.is_empty()||(t=this.__items.pop(),this.__character_count-=t.length),t},i.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},i.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},i.prototype.trim=function(){while(" "===this.last())this.__items.pop(),this.__character_count-=1},i.prototype.toString=function(){var t="";return this.is_empty()?this.__parent.indent_empty_lines&&(t=this.__parent.get_indent_string(this.__indent_count)):(t=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),t+=this.__items.join("")),t},r.prototype.get_indent_size=function(t,e){var n=this.__base_string_length;return e=e||0,t<0&&(n=0),n+=t*this.__indent_size,n+=e,n},r.prototype.get_indent_string=function(t,e){var n=this.__base_string;return e=e||0,t<0&&(t=0,n=""),e+=t*this.__indent_size,this.__ensure_cache(e),n+=this.__cache[e],n},r.prototype.__ensure_cache=function(t){while(t>=this.__cache.length)this.__add_column()},r.prototype.__add_column=function(){var t=this.__cache.length,e=0,n="";this.__indent_size&&t>=this.__indent_size&&(e=Math.floor(t/this.__indent_size),t-=e*this.__indent_size,n=new Array(e+1).join(this.__indent_string)),t&&(n+=new Array(t+1).join(" ")),this.__cache.push(n)},s.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},s.prototype.get_line_number=function(){return this.__lines.length},s.prototype.get_indent_string=function(t,e){return this.__indent_cache.get_indent_string(t,e)},s.prototype.get_indent_size=function(t,e){return this.__indent_cache.get_indent_size(t,e)},s.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},s.prototype.add_new_line=function(t){return!(this.is_empty()||!t&&this.just_added_newline())&&(this.raw||this.__add_outputline(),!0)},s.prototype.get_code=function(t){this.trim(!0);var e=this.current_line.pop();e&&("\n"===e[e.length-1]&&(e=e.replace(/\n+$/g,"")),this.current_line.push(e)),this._end_with_newline&&this.__add_outputline();var n=this.__lines.join("\n");return"\n"!==t&&(n=n.replace(/[\n]/g,t)),n},s.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},s.prototype.set_indent=function(t,e){return t=t||0,e=e||0,this.next_line.set_indent(t,e),this.__lines.length>1?(this.current_line.set_indent(t,e),!0):(this.current_line.set_indent(),!1)},s.prototype.add_raw_token=function(t){for(var e=0;e1&&this.current_line.is_empty())this.__lines.pop(),this.current_line=this.__lines[this.__lines.length-1],this.current_line.trim();this.previous_line=this.__lines.length>1?this.__lines[this.__lines.length-2]:null},s.prototype.just_added_newline=function(){return this.current_line.is_empty()},s.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},s.prototype.ensure_empty_line_above=function(t,e){var n=this.__lines.length-2;while(n>=0){var r=this.__lines[n];if(r.is_empty())break;if(0!==r.item(0).indexOf(t)&&r.item(-1)!==e){this.__lines.splice(n+1,0,new i(this)),this.previous_line=this.__lines[this.__lines.length-2];break}n--}},t.exports.Output=s},function(t,e,n){"use strict";function i(t,e,n,i){this.type=t,this.text=e,this.comments_before=null,this.newlines=n||0,this.whitespace_before=i||"",this.parent=null,this.next=null,this.previous=null,this.opened=null,this.closed=null,this.directives=null}t.exports.Token=i},,,function(t,e,n){"use strict";function i(t,e){this.raw_options=r(t,e),this.disabled=this._get_boolean("disabled"),this.eol=this._get_characters("eol","auto"),this.end_with_newline=this._get_boolean("end_with_newline"),this.indent_size=this._get_number("indent_size",4),this.indent_char=this._get_characters("indent_char"," "),this.indent_level=this._get_number("indent_level"),this.preserve_newlines=this._get_boolean("preserve_newlines",!0),this.max_preserve_newlines=this._get_number("max_preserve_newlines",32786),this.preserve_newlines||(this.max_preserve_newlines=0),this.indent_with_tabs=this._get_boolean("indent_with_tabs","\t"===this.indent_char),this.indent_with_tabs&&(this.indent_char="\t",1===this.indent_size&&(this.indent_size=4)),this.wrap_line_length=this._get_number("wrap_line_length",this._get_number("max_char")),this.indent_empty_lines=this._get_boolean("indent_empty_lines"),this.templating=this._get_selection_list("templating",["auto","none","django","erb","handlebars","php","smarty"],["auto"])}function r(t,e){var n,i={};for(n in t=s(t),t)n!==e&&(i[n]=t[n]);if(e&&t[e])for(n in t[e])i[n]=t[e][n];return i}function s(t){var e,n={};for(e in t){var i=e.replace(/-/g,"_");n[i]=t[e]}return n}i.prototype._get_array=function(t,e){var n=this.raw_options[t],i=e||[];return"object"===typeof n?null!==n&&"function"===typeof n.concat&&(i=n.concat()):"string"===typeof n&&(i=n.split(/[^a-zA-Z0-9_\/\-]+/)),i},i.prototype._get_boolean=function(t,e){var n=this.raw_options[t],i=void 0===n?!!e:!!n;return i},i.prototype._get_characters=function(t,e){var n=this.raw_options[t],i=e||"";return"string"===typeof n&&(i=n.replace(/\\r/,"\r").replace(/\\n/,"\n").replace(/\\t/,"\t")),i},i.prototype._get_number=function(t,e){var n=this.raw_options[t];e=parseInt(e,10),isNaN(e)&&(e=0);var i=parseInt(n,10);return isNaN(i)&&(i=e),i},i.prototype._get_selection=function(t,e,n){var i=this._get_selection_list(t,e,n);if(1!==i.length)throw new Error("Invalid Option Value: The option '"+t+"' can only be one of the following values:\n"+e+"\nYou passed in: '"+this.raw_options[t]+"'");return i[0]},i.prototype._get_selection_list=function(t,e,n){if(!e||0===e.length)throw new Error("Selection list cannot be empty.");if(n=n||[e[0]],!this._is_valid_selection(n,e))throw new Error("Invalid Default Value!");var i=this._get_array(t,n);if(!this._is_valid_selection(i,e))throw new Error("Invalid Option Value: The option '"+t+"' can contain only the following values:\n"+e+"\nYou passed in: '"+this.raw_options[t]+"'");return i},i.prototype._is_valid_selection=function(t,e){return t.length&&e.length&&!t.some((function(t){return-1===e.indexOf(t)}))},t.exports.Options=i,t.exports.normalizeOpts=s,t.exports.mergeOpts=r},,function(t,e,n){"use strict";var i=RegExp.prototype.hasOwnProperty("sticky");function r(t){this.__input=t||"",this.__input_length=this.__input.length,this.__position=0}r.prototype.restart=function(){this.__position=0},r.prototype.back=function(){this.__position>0&&(this.__position-=1)},r.prototype.hasNext=function(){return this.__position=0&&t=0&&e=t.length&&this.__input.substring(e-t.length,e).toLowerCase()===t},t.exports.InputScanner=r},function(t,e,n){"use strict";var i=n(8).InputScanner,r=n(3).Token,s=n(10).TokenStream,o=n(11).WhitespacePattern,a={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},l=function(t,e){this._input=new i(t),this._options=e||{},this.__tokens=null,this._patterns={},this._patterns.whitespace=new o(this._input)};l.prototype.tokenize=function(){var t;this._input.restart(),this.__tokens=new s,this._reset();var e=new r(a.START,""),n=null,i=[],o=new s;while(e.type!==a.EOF){t=this._get_next_token(e,n);while(this._is_comment(t))o.add(t),t=this._get_next_token(e,n);o.isEmpty()||(t.comments_before=o,o=new s),t.parent=n,this._is_opening(t)?(i.push(n),n=t):n&&this._is_closing(t,n)&&(t.opened=n,n.closed=t,n=i.pop(),t.parent=n),t.previous=e,e.next=t,this.__tokens.add(t),e=t}return this.__tokens},l.prototype._is_first_token=function(){return this.__tokens.isEmpty()},l.prototype._reset=function(){},l.prototype._get_next_token=function(t,e){this._readWhitespace();var n=this._input.read(/.+/g);return n?this._create_token(a.RAW,n):this._create_token(a.EOF,"")},l.prototype._is_comment=function(t){return!1},l.prototype._is_opening=function(t){return!1},l.prototype._is_closing=function(t,e){return!1},l.prototype._create_token=function(t,e){var n=new r(t,e,this._patterns.whitespace.newline_count,this._patterns.whitespace.whitespace_before_token);return n},l.prototype._readWhitespace=function(){return this._patterns.whitespace.read()},t.exports.Tokenizer=l,t.exports.TOKEN=a},function(t,e,n){"use strict";function i(t){this.__tokens=[],this.__tokens_length=this.__tokens.length,this.__position=0,this.__parent_token=t}i.prototype.restart=function(){this.__position=0},i.prototype.isEmpty=function(){return 0===this.__tokens_length},i.prototype.hasNext=function(){return this.__position=0&&t/),erb:n.starting_with(/<%[^%]/).until_after(/[^%]%>/),django:n.starting_with(/{%/).until_after(/%}/),django_value:n.starting_with(/{{/).until_after(/}}/),django_comment:n.starting_with(/{#/).until_after(/#}/),smarty:n.starting_with(/{(?=[^}{\s\n])/).until_after(/[^\s\n]}/),smarty_comment:n.starting_with(/{\*/).until_after(/\*}/),smarty_literal:n.starting_with(/{literal}/).until_after(/{\/literal}/)}}s.prototype=new i,s.prototype._create=function(){return new s(this._input,this)},s.prototype._update=function(){this.__set_templated_pattern()},s.prototype.disable=function(t){var e=this._create();return e._disabled[t]=!0,e._update(),e},s.prototype.read_options=function(t){var e=this._create();for(var n in r)e._disabled[n]=-1===t.templating.indexOf(n);return e._update(),e},s.prototype.exclude=function(t){var e=this._create();return e._excluded[t]=!0,e._update(),e},s.prototype.read=function(){var t="";t=this._match_pattern?this._input.read(this._starting_pattern):this._input.read(this._starting_pattern,this.__template_pattern);var e=this._read_template();while(e)this._match_pattern?e+=this._input.read(this._match_pattern):e+=this._input.readUntil(this.__template_pattern),t+=e,e=this._read_template();return this._until_after&&(t+=this._input.readUntilAfter(this._until_pattern)),t},s.prototype.__set_templated_pattern=function(){var t=[];this._disabled.php||t.push(this.__patterns.php._starting_pattern.source),this._disabled.handlebars||t.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.erb||t.push(this.__patterns.erb._starting_pattern.source),this._disabled.django||(t.push(this.__patterns.django._starting_pattern.source),t.push(this.__patterns.django_value._starting_pattern.source),t.push(this.__patterns.django_comment._starting_pattern.source)),this._disabled.smarty||t.push(this.__patterns.smarty._starting_pattern.source),this._until_pattern&&t.push(this._until_pattern.source),this.__template_pattern=this._input.get_regexp("(?:"+t.join("|")+")")},s.prototype._read_template=function(){var t="",e=this._input.peek();if("<"===e){var n=this._input.peek(1);this._disabled.php||this._excluded.php||"?"!==n||(t=t||this.__patterns.php.read()),this._disabled.erb||this._excluded.erb||"%"!==n||(t=t||this.__patterns.erb.read())}else"{"===e&&(this._disabled.handlebars||this._excluded.handlebars||(t=t||this.__patterns.handlebars_comment.read(),t=t||this.__patterns.handlebars_unescaped.read(),t=t||this.__patterns.handlebars.read()),this._disabled.django||(this._excluded.django||this._excluded.handlebars||(t=t||this.__patterns.django_value.read()),this._excluded.django||(t=t||this.__patterns.django_comment.read(),t=t||this.__patterns.django.read())),this._disabled.smarty||this._disabled.django&&this._disabled.handlebars&&(t=t||this.__patterns.smarty_comment.read(),t=t||this.__patterns.smarty_literal.read(),t=t||this.__patterns.smarty.read()));return t},t.exports.TemplatablePattern=s},,,,function(t,e,n){"use strict";var i=n(19).Beautifier,r=n(20).Options;function s(t,e,n,r){var s=new i(t,e,n,r);return s.beautify()}t.exports=s,t.exports.defaultOptions=function(){return new r}},function(t,e,n){"use strict";var i=n(20).Options,r=n(2).Output,s=n(21).Tokenizer,o=n(21).TOKEN,a=/\r\n|[\r\n]/,l=/\r\n|[\r\n]/g,u=function(t,e){this.indent_level=0,this.alignment_size=0,this.max_preserve_newlines=t.max_preserve_newlines,this.preserve_newlines=t.preserve_newlines,this._output=new r(t,e)};u.prototype.current_line_has_match=function(t){return this._output.current_line.has_match(t)},u.prototype.set_space_before_token=function(t,e){this._output.space_before_token=t,this._output.non_breaking_space=e},u.prototype.set_wrap_point=function(){this._output.set_indent(this.indent_level,this.alignment_size),this._output.set_wrap_point()},u.prototype.add_raw_token=function(t){this._output.add_raw_token(t)},u.prototype.print_preserved_newlines=function(t){var e=0;t.type!==o.TEXT&&t.previous.type!==o.TEXT&&(e=t.newlines?1:0),this.preserve_newlines&&(e=t.newlines0);return 0!==e},u.prototype.traverse_whitespace=function(t){return!(!t.whitespace_before&&!t.newlines)&&(this.print_preserved_newlines(t)||(this._output.space_before_token=!0),!0)},u.prototype.previous_token_wrapped=function(){return this._output.previous_token_wrapped},u.prototype.print_newline=function(t){this._output.add_new_line(t)},u.prototype.print_token=function(t){t.text&&(this._output.set_indent(this.indent_level,this.alignment_size),this._output.add_token(t.text))},u.prototype.indent=function(){this.indent_level++},u.prototype.get_full_indent=function(t){return t=this.indent_level+(t||0),t<1?"":this._output.get_indent_string(t)};var h=function(t){var e=null,n=t.next;while(n.type!==o.EOF&&t.closed!==n){if(n.type===o.ATTRIBUTE&&"type"===n.text){n.next&&n.next.type===o.EQUALS&&n.next.next&&n.next.next.type===o.VALUE&&(e=n.next.next.text);break}n=n.next}return e},c=function(t,e){var n=null,i=null;return e.closed?("script"===t?n="text/javascript":"style"===t&&(n="text/css"),n=h(e)||n,n.search("text/css")>-1?i="css":n.search(/module|((text|application|dojo)\/(x-)?(javascript|ecmascript|jscript|livescript|(ld\+)?json|method|aspect))/)>-1?i="javascript":n.search(/(text|application|dojo)\/(x-)?(html)/)>-1?i="html":n.search(/test\/null/)>-1&&(i="null"),i):null};function p(t,e){return-1!==e.indexOf(t)}function _(t,e,n){this.parent=t||null,this.tag=e?e.tag_name:"",this.indent_level=n||0,this.parser_token=e||null}function f(t){this._printer=t,this._current_frame=null}function d(t,e,n,r){this._source_text=t||"",e=e||{},this._js_beautify=n,this._css_beautify=r,this._tag_stack=null;var s=new i(e,"html");this._options=s,this._is_wrap_attributes_force="force"===this._options.wrap_attributes.substr(0,"force".length),this._is_wrap_attributes_force_expand_multiline="force-expand-multiline"===this._options.wrap_attributes,this._is_wrap_attributes_force_aligned="force-aligned"===this._options.wrap_attributes,this._is_wrap_attributes_aligned_multiple="aligned-multiple"===this._options.wrap_attributes,this._is_wrap_attributes_preserve="preserve"===this._options.wrap_attributes.substr(0,"preserve".length),this._is_wrap_attributes_preserve_aligned="preserve-aligned"===this._options.wrap_attributes}f.prototype.get_parser_token=function(){return this._current_frame?this._current_frame.parser_token:null},f.prototype.record_tag=function(t){var e=new _(this._current_frame,t,this._printer.indent_level);this._current_frame=e},f.prototype._try_pop_frame=function(t){var e=null;return t&&(e=t.parser_token,this._printer.indent_level=t.indent_level,this._current_frame=t.parent),e},f.prototype._get_frame=function(t,e){var n=this._current_frame;while(n){if(-1!==t.indexOf(n.tag))break;if(e&&-1!==e.indexOf(n.tag)){n=null;break}n=n.parent}return n},f.prototype.try_pop=function(t,e){var n=this._get_frame([t],e);return this._try_pop_frame(n)},f.prototype.indent_to_tag=function(t){var e=this._get_frame(t);e&&(this._printer.indent_level=e.indent_level)},d.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var t=this._source_text,e=this._options.eol;"auto"===this._options.eol&&(e="\n",t&&a.test(t)&&(e=t.match(a)[0])),t=t.replace(l,"\n");var n=t.match(/^[\t ]*/)[0],i={text:"",type:""},r=new g,h=new u(this._options,n),c=new s(t,this._options).tokenize();this._tag_stack=new f(h);var p=null,_=c.next();while(_.type!==o.EOF)_.type===o.TAG_OPEN||_.type===o.COMMENT?(p=this._handle_tag_open(h,_,r,i),r=p):_.type===o.ATTRIBUTE||_.type===o.EQUALS||_.type===o.VALUE||_.type===o.TEXT&&!r.tag_complete?p=this._handle_inside_tag(h,_,r,c):_.type===o.TAG_CLOSE?p=this._handle_tag_close(h,_,r):_.type===o.TEXT?p=this._handle_text(h,_,r):h.add_raw_token(_),i=p,_=c.next();var d=h._output.get_code(e);return d},d.prototype._handle_tag_close=function(t,e,n){var i={text:e.text,type:e.type};return t.alignment_size=0,n.tag_complete=!0,t.set_space_before_token(e.newlines||""!==e.whitespace_before,!0),n.is_unformatted?t.add_raw_token(e):("<"===n.tag_start_char&&(t.set_space_before_token("/"===e.text[0],!0),this._is_wrap_attributes_force_expand_multiline&&n.has_wrapped_attrs&&t.print_newline(!1)),t.print_token(e)),!n.indent_content||n.is_unformatted||n.is_content_unformatted||(t.indent(),n.indent_content=!1),n.is_inline_element||n.is_unformatted||n.is_content_unformatted||t.set_wrap_point(),i},d.prototype._handle_inside_tag=function(t,e,n,i){var r=n.has_wrapped_attrs,s={text:e.text,type:e.type};if(t.set_space_before_token(e.newlines||""!==e.whitespace_before,!0),n.is_unformatted)t.add_raw_token(e);else if("{"===n.tag_start_char&&e.type===o.TEXT)t.print_preserved_newlines(e)?(e.newlines=0,t.add_raw_token(e)):t.print_token(e);else{if(e.type===o.ATTRIBUTE?(t.set_space_before_token(!0),n.attr_count+=1):(e.type===o.EQUALS||e.type===o.VALUE&&e.previous.type===o.EQUALS)&&t.set_space_before_token(!1),e.type===o.ATTRIBUTE&&"<"===n.tag_start_char&&((this._is_wrap_attributes_preserve||this._is_wrap_attributes_preserve_aligned)&&(t.traverse_whitespace(e),r=r||0!==e.newlines),this._is_wrap_attributes_force)){var a=n.attr_count>1;if(this._is_wrap_attributes_force_expand_multiline&&1===n.attr_count){var l,u=!0,h=0;do{if(l=i.peek(h),l.type===o.ATTRIBUTE){u=!1;break}h+=1}while(h<4&&l.type!==o.EOF&&l.type!==o.TAG_CLOSE);a=!u}a&&(t.print_newline(!1),r=!0)}t.print_token(e),r=r||t.previous_token_wrapped(),n.has_wrapped_attrs=r}return s},d.prototype._handle_text=function(t,e,n){var i={text:e.text,type:"TK_CONTENT"};return n.custom_beautifier_name?this._print_custom_beatifier_text(t,e,n):n.is_unformatted||n.is_content_unformatted?t.add_raw_token(e):(t.traverse_whitespace(e),t.print_token(e)),i},d.prototype._print_custom_beatifier_text=function(t,e,n){var i=this;if(""!==e.text){var r,s=e.text,o=1,a="",l="";"javascript"===n.custom_beautifier_name&&"function"===typeof this._js_beautify?r=this._js_beautify:"css"===n.custom_beautifier_name&&"function"===typeof this._css_beautify?r=this._css_beautify:"html"===n.custom_beautifier_name&&(r=function(t,e){var n=new d(t,e,i._js_beautify,i._css_beautify);return n.beautify()}),"keep"===this._options.indent_scripts?o=0:"separate"===this._options.indent_scripts&&(o=-t.indent_level);var u=t.get_full_indent(o);if(s=s.replace(/\n[ \t]*$/,""),"html"!==n.custom_beautifier_name&&"<"===s[0]&&s.match(/^(|]]>)$/.exec(s);if(!h)return void t.add_raw_token(e);a=u+h[1]+"\n",s=h[4],h[5]&&(l=u+h[5]),s=s.replace(/\n[ \t]*$/,""),(h[2]||-1!==h[3].indexOf("\n"))&&(h=h[3].match(/[ \t]+$/),h&&(e.whitespace_before=h[0]))}if(s)if(r){var c=function(){this.eol="\n"};c.prototype=this._options.raw_options;var p=new c;s=r(u+s,p)}else{var _=e.whitespace_before;_&&(s=s.replace(new RegExp("\n("+_+")?","g"),"\n")),s=u+s.replace(/\n/g,"\n"+u)}a&&(s=s?a+s+"\n"+l:a+l),t.print_newline(!1),s&&(e.text=s,e.whitespace_before="",e.newlines=0,t.add_raw_token(e),t.print_newline(!0))}},d.prototype._handle_tag_open=function(t,e,n,i){var r=this._get_tag_open_token(e);return!n.is_unformatted&&!n.is_content_unformatted||n.is_empty_element||e.type!==o.TAG_OPEN||0!==e.text.indexOf("]*)/),this.tag_check=n?n[1]:""):(n=e.text.match(/^{{(?:[\^]|#\*?)?([^\s}]+)/),this.tag_check=n?n[1]:"","{{#>"===e.text&&">"===this.tag_check&&null!==e.next&&(this.tag_check=e.next.text)),this.tag_check=this.tag_check.toLowerCase(),e.type===o.COMMENT&&(this.tag_complete=!0),this.is_start_tag="/"!==this.tag_check.charAt(0),this.tag_name=this.is_start_tag?this.tag_check:this.tag_check.substr(1),this.is_end_tag=!this.is_start_tag||e.closed&&"/>"===e.closed.text,this.is_end_tag=this.is_end_tag||"{"===this.tag_start_char&&(this.text.length<3||/[^#\^]/.test(this.text.charAt(2)))):this.tag_complete=!0};d.prototype._get_tag_open_token=function(t){var e=new g(this._tag_stack.get_parser_token(),t);return e.alignment_size=this._options.wrap_attributes_indent_size,e.is_end_tag=e.is_end_tag||p(e.tag_check,this._options.void_elements),e.is_empty_element=e.tag_complete||e.is_start_tag&&e.is_end_tag,e.is_unformatted=!e.tag_complete&&p(e.tag_check,this._options.unformatted),e.is_content_unformatted=!e.is_empty_element&&p(e.tag_check,this._options.content_unformatted),e.is_inline_element=p(e.tag_name,this._options.inline)||"{"===e.tag_start_char,e},d.prototype._set_tag_position=function(t,e,n,i,r){if(n.is_empty_element||(n.is_end_tag?n.start_tag_token=this._tag_stack.try_pop(n.tag_name):(this._do_optional_end_element(n)&&(n.is_inline_element||t.print_newline(!1)),this._tag_stack.record_tag(n),"script"!==n.tag_name&&"style"!==n.tag_name||n.is_unformatted||n.is_content_unformatted||(n.custom_beautifier_name=c(n.tag_check,e)))),p(n.tag_check,this._options.extra_liners)&&(t.print_newline(!1),t._output.just_added_blankline()||t.print_newline(!0)),n.is_empty_element){if("{"===n.tag_start_char&&"else"===n.tag_check){this._tag_stack.indent_to_tag(["if","unless","each"]),n.indent_content=!0;var s=t.current_line_has_match(/{{#if/);s||t.print_newline(!1)}"!--"===n.tag_name&&r.type===o.TAG_CLOSE&&i.is_end_tag&&-1===n.text.indexOf("\n")||(n.is_inline_element||n.is_unformatted||t.print_newline(!1),this._calcluate_parent_multiline(t,n))}else if(n.is_end_tag){var a=!1;a=n.start_tag_token&&n.start_tag_token.multiline_content,a=a||!n.is_inline_element&&!(i.is_inline_element||i.is_unformatted)&&!(r.type===o.TAG_CLOSE&&n.start_tag_token===i)&&"TK_CONTENT"!==r.type,(n.is_content_unformatted||n.is_unformatted)&&(a=!1),a&&t.print_newline(!1)}else n.indent_content=!n.custom_beautifier_name,"<"===n.tag_start_char&&("html"===n.tag_name?n.indent_content=this._options.indent_inner_html:"head"===n.tag_name?n.indent_content=this._options.indent_head_inner_html:"body"===n.tag_name&&(n.indent_content=this._options.indent_body_inner_html)),n.is_inline_element||n.is_unformatted||"TK_CONTENT"===r.type&&!n.is_content_unformatted||t.print_newline(!1),this._calcluate_parent_multiline(t,n)},d.prototype._calcluate_parent_multiline=function(t,e){!e.parent||!t._output.just_added_newline()||(e.is_inline_element||e.is_unformatted)&&e.parent.is_inline_element||(e.parent.multiline_content=!0)};var m=["address","article","aside","blockquote","details","div","dl","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hr","main","nav","ol","p","pre","section","table","ul"],v=["a","audio","del","ins","map","noscript","video"];d.prototype._do_optional_end_element=function(t){var e=null;if(!t.is_empty_element&&t.is_start_tag&&t.parent){if("body"===t.tag_name)e=e||this._tag_stack.try_pop("head");else if("li"===t.tag_name)e=e||this._tag_stack.try_pop("li",["ol","ul"]);else if("dd"===t.tag_name||"dt"===t.tag_name)e=e||this._tag_stack.try_pop("dt",["dl"]),e=e||this._tag_stack.try_pop("dd",["dl"]);else if("p"===t.parent.tag_name&&-1!==m.indexOf(t.tag_name)){var n=t.parent.parent;n&&-1!==v.indexOf(n.tag_name)||(e=e||this._tag_stack.try_pop("p"))}else"rp"===t.tag_name||"rt"===t.tag_name?(e=e||this._tag_stack.try_pop("rt",["ruby","rtc"]),e=e||this._tag_stack.try_pop("rp",["ruby","rtc"])):"optgroup"===t.tag_name?e=e||this._tag_stack.try_pop("optgroup",["select"]):"option"===t.tag_name?e=e||this._tag_stack.try_pop("option",["select","datalist","optgroup"]):"colgroup"===t.tag_name?e=e||this._tag_stack.try_pop("caption",["table"]):"thead"===t.tag_name?(e=e||this._tag_stack.try_pop("caption",["table"]),e=e||this._tag_stack.try_pop("colgroup",["table"])):"tbody"===t.tag_name||"tfoot"===t.tag_name?(e=e||this._tag_stack.try_pop("caption",["table"]),e=e||this._tag_stack.try_pop("colgroup",["table"]),e=e||this._tag_stack.try_pop("thead",["table"]),e=e||this._tag_stack.try_pop("tbody",["table"])):"tr"===t.tag_name?(e=e||this._tag_stack.try_pop("caption",["table"]),e=e||this._tag_stack.try_pop("colgroup",["table"]),e=e||this._tag_stack.try_pop("tr",["table","thead","tbody","tfoot"])):"th"!==t.tag_name&&"td"!==t.tag_name||(e=e||this._tag_stack.try_pop("td",["table","thead","tbody","tfoot","tr"]),e=e||this._tag_stack.try_pop("th",["table","thead","tbody","tfoot","tr"]));return t.parent=this._tag_stack.get_parser_token(),e}},t.exports.Beautifier=d},function(t,e,n){"use strict";var i=n(6).Options;function r(t){i.call(this,t,"html"),1===this.templating.length&&"auto"===this.templating[0]&&(this.templating=["django","erb","handlebars","php"]),this.indent_inner_html=this._get_boolean("indent_inner_html"),this.indent_body_inner_html=this._get_boolean("indent_body_inner_html",!0),this.indent_head_inner_html=this._get_boolean("indent_head_inner_html",!0),this.indent_handlebars=this._get_boolean("indent_handlebars",!0),this.wrap_attributes=this._get_selection("wrap_attributes",["auto","force","force-aligned","force-expand-multiline","aligned-multiple","preserve","preserve-aligned"]),this.wrap_attributes_indent_size=this._get_number("wrap_attributes_indent_size",this.indent_size),this.extra_liners=this._get_array("extra_liners",["head","body","/html"]),this.inline=this._get_array("inline",["a","abbr","area","audio","b","bdi","bdo","br","button","canvas","cite","code","data","datalist","del","dfn","em","embed","i","iframe","img","input","ins","kbd","keygen","label","map","mark","math","meter","noscript","object","output","progress","q","ruby","s","samp","select","small","span","strong","sub","sup","svg","template","textarea","time","u","var","video","wbr","text","acronym","big","strike","tt"]),this.void_elements=this._get_array("void_elements",["area","base","br","col","embed","hr","img","input","keygen","link","menuitem","meta","param","source","track","wbr","!doctype","?xml","basefont","isindex"]),this.unformatted=this._get_array("unformatted",[]),this.content_unformatted=this._get_array("content_unformatted",["pre","textarea"]),this.unformatted_content_delimiter=this._get_characters("unformatted_content_delimiter"),this.indent_scripts=this._get_selection("indent_scripts",["normal","keep","separate"])}r.prototype=new i,t.exports.Options=r},function(t,e,n){"use strict";var i=n(9).Tokenizer,r=n(9).TOKEN,s=n(13).Directives,o=n(14).TemplatablePattern,a=n(12).Pattern,l={TAG_OPEN:"TK_TAG_OPEN",TAG_CLOSE:"TK_TAG_CLOSE",ATTRIBUTE:"TK_ATTRIBUTE",EQUALS:"TK_EQUALS",VALUE:"TK_VALUE",COMMENT:"TK_COMMENT",TEXT:"TK_TEXT",UNKNOWN:"TK_UNKNOWN",START:r.START,RAW:r.RAW,EOF:r.EOF},u=new s(/<\!--/,/-->/),h=function(t,e){i.call(this,t,e),this._current_tag_name="";var n=new o(this._input).read_options(this._options),r=new a(this._input);if(this.__patterns={word:n.until(/[\n\r\t <]/),single_quote:n.until_after(/'/),double_quote:n.until_after(/"/),attribute:n.until(/[\n\r\t =>]|\/>/),element_name:n.until(/[\n\r\t >\/]/),handlebars_comment:r.starting_with(/{{!--/).until_after(/--}}/),handlebars:r.starting_with(/{{/).until_after(/}}/),handlebars_open:r.until(/[\n\r\t }]/),handlebars_raw_close:r.until(/}}/),comment:r.starting_with(//),cdata:r.starting_with(//),conditional_comment:r.starting_with(//),processing:r.starting_with(/<\?/).until_after(/\?>/)},this._options.indent_handlebars&&(this.__patterns.word=this.__patterns.word.exclude("handlebars")),this._unformatted_content_delimiter=null,this._options.unformatted_content_delimiter){var s=this._input.get_literal_regexp(this._options.unformatted_content_delimiter);this.__patterns.unformatted_content_delimiter=r.matching(s).until_after(s)}};h.prototype=new i,h.prototype._is_comment=function(t){return!1},h.prototype._is_opening=function(t){return t.type===l.TAG_OPEN},h.prototype._is_closing=function(t,e){return t.type===l.TAG_CLOSE&&e&&((">"===t.text||"/>"===t.text)&&"<"===e.text[0]||"}}"===t.text&&"{"===e.text[0]&&"{"===e.text[1])},h.prototype._reset=function(){this._current_tag_name=""},h.prototype._get_next_token=function(t,e){var n=null;this._readWhitespace();var i=this._input.peek();return null===i?this._create_token(l.EOF,""):(n=n||this._read_open_handlebars(i,e),n=n||this._read_attribute(i,t,e),n=n||this._read_close(i,e),n=n||this._read_raw_content(i,t,e),n=n||this._read_content_word(i),n=n||this._read_comment_or_cdata(i),n=n||this._read_processing(i),n=n||this._read_open(i,e),n=n||this._create_token(l.UNKNOWN,this._input.next()),n)},h.prototype._read_comment_or_cdata=function(t){var e=null,n=null,i=null;if("<"===t){var r=this._input.peek(1);"!"===r&&(n=this.__patterns.comment.read(),n?(i=u.get_directives(n),i&&"start"===i.ignore&&(n+=u.readIgnored(this._input))):n=this.__patterns.cdata.read()),n&&(e=this._create_token(l.COMMENT,n),e.directives=i)}return e},h.prototype._read_processing=function(t){var e=null,n=null,i=null;if("<"===t){var r=this._input.peek(1);"!"!==r&&"?"!==r||(n=this.__patterns.conditional_comment.read(),n=n||this.__patterns.processing.read()),n&&(e=this._create_token(l.COMMENT,n),e.directives=i)}return e},h.prototype._read_open=function(t,e){var n=null,i=null;return e||"<"===t&&(n=this._input.next(),"/"===this._input.peek()&&(n+=this._input.next()),n+=this.__patterns.element_name.read(),i=this._create_token(l.TAG_OPEN,n)),i},h.prototype._read_open_handlebars=function(t,e){var n=null,i=null;return e||this._options.indent_handlebars&&"{"===t&&"{"===this._input.peek(1)&&("!"===this._input.peek(2)?(n=this.__patterns.handlebars_comment.read(),n=n||this.__patterns.handlebars.read(),i=this._create_token(l.COMMENT,n)):(n=this.__patterns.handlebars_open.read(),i=this._create_token(l.TAG_OPEN,n))),i},h.prototype._read_close=function(t,e){var n=null,i=null;return e&&("<"===e.text[0]&&(">"===t||"/"===t&&">"===this._input.peek(1))?(n=this._input.next(),"/"===t&&(n+=this._input.next()),i=this._create_token(l.TAG_CLOSE,n)):"{"===e.text[0]&&"}"===t&&"}"===this._input.peek(1)&&(this._input.next(),this._input.next(),i=this._create_token(l.TAG_CLOSE,"}}"))),i},h.prototype._read_attribute=function(t,e,n){var i=null,r="";if(n&&"<"===n.text[0])if("="===t)i=this._create_token(l.EQUALS,this._input.next());else if('"'===t||"'"===t){var s=this._input.next();s+='"'===t?this.__patterns.double_quote.read():this.__patterns.single_quote.read(),i=this._create_token(l.VALUE,s)}else r=this.__patterns.attribute.read(),r&&(i=e.type===l.EQUALS?this._create_token(l.VALUE,r):this._create_token(l.ATTRIBUTE,r));return i},h.prototype._is_content_unformatted=function(t){return-1===this._options.void_elements.indexOf(t)&&(-1!==this._options.content_unformatted.indexOf(t)||-1!==this._options.unformatted.indexOf(t))},h.prototype._read_raw_content=function(t,e,n){var i="";if(n&&"{"===n.text[0])i=this.__patterns.handlebars_raw_close.read();else if(e.type===l.TAG_CLOSE&&"<"===e.opened.text[0]&&"/"!==e.text[0]){var r=e.opened.text.substr(1).toLowerCase();if("script"===r||"style"===r){var s=this._read_comment_or_cdata(t);if(s)return s.type=l.TEXT,s;i=this._input.readUntil(new RegExp("","ig"))}else this._is_content_unformatted(r)&&(i=this._input.readUntil(new RegExp("","ig")))}return i?this._create_token(l.TEXT,i):null},h.prototype._read_content_word=function(t){var e="";if(this._options.unformatted_content_delimiter&&t===this._options.unformatted_content_delimiter[0]&&(e=this.__patterns.unformatted_content_delimiter.read()),e||(e=this.__patterns.word.read()),e)return this._create_token(l.TEXT,e)},t.exports.Tokenizer=h,t.exports.TOKEN=l}]),o=s;i=[n,n("0377"),n("5d59")],r=function(t){var e=n("0377"),i=n("5d59");return{html_beautify:function(t,n){return o(t,n,e.js_beautify,i.css_beautify)}}}.apply(e,i),void 0===r||(t.exports=r)})()},d975:function(t,e,n){},f3d7:function(t,e,n){(function(t){t(n("fd08"))})((function(t){var e=t.Pos;function n(t,e){for(var n=0,i=t.length;no.ch&&(a.end=o.ch,a.string=a.string.slice(0,o.ch-a.start)):a={start:o.ch,end:o.ch,string:"",state:a.state,type:"."==a.string?"property":null};var u=a;while("property"==u.type){if(u=r(n,e(o.line,u.start)),"."!=u.string)return;if(u=r(n,e(o.line,u.start)),!h)var h=[];h.push(u)}return{list:f(a,h,i,s),from:e(o.line,a.start),to:e(o.line,a.end)}}}}function s(t,e){return r(t,c,(function(t,e){return t.getTokenAt(e)}),e)}function o(t,e){var n=t.getTokenAt(e);return e.ch==n.start+1&&"."==n.string.charAt(0)?(n.end=n.start,n.string=".",n.type="property"):/^\.[\w$_]*$/.test(n.string)&&(n.type="property",n.start++,n.string=n.string.replace(/\./,"")),n}function a(t,e){return r(t,p,o,e)}t.registerHelper("hint","javascript",s),t.registerHelper("hint","coffeescript",a);var l="charAt charCodeAt indexOf lastIndexOf substring substr slice trim trimLeft trimRight toUpperCase toLowerCase split concat match replace search".split(" "),u="length concat join splice push pop shift unshift slice reverse sort indexOf lastIndexOf every some filter forEach map reduce reduceRight ".split(" "),h="prototype apply call bind".split(" "),c="break case catch class const continue debugger default delete do else export extends false finally for function if in import instanceof new null return super switch this throw true try typeof var void while with yield".split(" "),p="and break catch class continue delete do else extends false finally for if in instanceof isnt new no not null of off on or return switch then throw true try typeof until void while with yes".split(" ");function _(t,e){if(Object.getOwnPropertyNames&&Object.getPrototypeOf)for(var n=t;n;n=Object.getPrototypeOf(n))Object.getOwnPropertyNames(n).forEach(e);else for(var i in t)e(i)}function f(t,e,r,s){var o=[],a=t.string,c=s&&s.globalScope||window;function p(t){0!=t.lastIndexOf(a,0)||i(o,t)||o.push(t)}function f(t){"string"==typeof t?n(l,p):t instanceof Array?n(u,p):t instanceof Function&&n(h,p),_(t,p)}if(e&&e.length){var d,g=e.pop();g.type&&0===g.type.indexOf("variable")?(s&&s.additionalContext&&(d=s.additionalContext[g.string]),s&&!1===s.useGlobalScope||(d=d||c[g.string])):"string"==g.type?d="":"atom"==g.type?d=1:"function"==g.type&&(null==c.jQuery||"$"!=g.string&&"jQuery"!=g.string||"function"!=typeof c.jQuery?null!=c._&&"_"==g.string&&"function"==typeof c._&&(d=c._()):d=c.jQuery());while(null!=d&&e.length)d=d[e.pop().string];null!=d&&f(d)}else{for(var m=t.state.localVars;m;m=m.next)p(m.name);for(var v=t.state.context;v;v=v.prev)for(m=v.vars;m;m=m.next)p(m.name);for(m=t.state.globalVars;m;m=m.next)p(m.name);if(s&&null!=s.additionalContext)for(var y in s.additionalContext)p(y);s&&!1===s.useGlobalScope||f(c),n(r,p)}return o}}))},fd08:function(t,e,n){(function(e,n){t.exports=n()})(0,(function(){"use strict";var t=navigator.userAgent,e=navigator.platform,n=/gecko\/\d/i.test(t),i=/MSIE \d/.test(t),r=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(t),s=/Edge\/(\d+)/.exec(t),o=i||r||s,a=o&&(i?document.documentMode||6:+(s||r)[1]),l=!s&&/WebKit\//.test(t),u=l&&/Qt\/\d+\.\d+/.test(t),h=!s&&/Chrome\//.test(t),c=/Opera\//.test(t),p=/Apple Computer/.test(navigator.vendor),_=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(t),f=/PhantomJS/.test(t),d=p&&(/Mobile\/\w+/.test(t)||navigator.maxTouchPoints>2),g=/Android/.test(t),m=d||g||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(t),v=d||/Mac/.test(e),y=/\bCrOS\b/.test(t),b=/win/i.test(e),w=c&&t.match(/Version\/(\d*\.\d*)/);w&&(w=Number(w[1])),w&&w>=15&&(c=!1,l=!0);var x=v&&(u||c&&(null==w||w<12.11)),k=n||o&&a>=9;function C(t){return new RegExp("(^|\\s)"+t+"(?:$|\\s)\\s*")}var S,T=function(t,e){var n=t.className,i=C(e).exec(n);if(i){var r=n.slice(i.index+i[0].length);t.className=n.slice(0,i.index)+(r?i[1]+r:"")}};function O(t){for(var e=t.childNodes.length;e>0;--e)t.removeChild(t.firstChild);return t}function L(t,e){return O(t).appendChild(e)}function E(t,e,n,i){var r=document.createElement(t);if(n&&(r.className=n),i&&(r.style.cssText=i),"string"==typeof e)r.appendChild(document.createTextNode(e));else if(e)for(var s=0;s=e)return o+(e-s);o+=a-s,o+=n-o%n,s=a+1}}d?W=function(t){t.selectionStart=0,t.selectionEnd=t.value.length}:o&&(W=function(t){try{t.select()}catch(e){}});var j=function(){this.id=null,this.f=null,this.time=0,this.handler=P(this.onTimeout,this)};function F(t,e){for(var n=0;n=e)return i+Math.min(o,e-r);if(r+=s-i,r+=n-r%n,i=s+1,r>=e)return i}}var X=[""];function $(t){while(X.length<=t)X.push(q(X)+" ");return X[t]}function q(t){return t[t.length-1]}function Y(t,e){for(var n=[],i=0;i"€"&&(t.toUpperCase()!=t.toLowerCase()||tt.test(t))}function nt(t,e){return e?!!(e.source.indexOf("\\w")>-1&&et(t))||e.test(t):et(t)}function it(t){for(var e in t)if(t.hasOwnProperty(e)&&t[e])return!1;return!0}var rt=/[\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]/;function st(t){return t.charCodeAt(0)>=768&&rt.test(t)}function ot(t,e,n){while((n<0?e>0:en?-1:1;;){if(e==n)return e;var r=(e+n)/2,s=i<0?Math.ceil(r):Math.floor(r);if(s==e)return t(s)?e:n;t(s)?n=s:e=s+i}}function lt(t,e,n,i){if(!t)return i(e,n,"ltr",0);for(var r=!1,s=0;se||e==n&&o.to==e)&&(i(Math.max(o.from,e),Math.min(o.to,n),1==o.level?"rtl":"ltr",s),r=!0)}r||i(e,n,"ltr")}var ut=null;function ht(t,e,n){var i;ut=null;for(var r=0;re)return r;s.to==e&&(s.from!=s.to&&"before"==n?i=r:ut=r),s.from==e&&(s.from!=s.to&&"before"!=n?i=r:ut=r)}return null!=i?i:ut}var ct=function(){var t="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",e="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function n(n){return n<=247?t.charAt(n):1424<=n&&n<=1524?"R":1536<=n&&n<=1785?e.charAt(n-1536):1774<=n&&n<=2220?"r":8192<=n&&n<=8203?"w":8204==n?"b":"L"}var i=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,r=/[stwN]/,s=/[LRr]/,o=/[Lb1n]/,a=/[1n]/;function l(t,e,n){this.level=t,this.from=e,this.to=n}return function(t,e){var u="ltr"==e?"L":"R";if(0==t.length||"ltr"==e&&!i.test(t))return!1;for(var h=t.length,c=[],p=0;p-1&&(i[e]=r.slice(0,s).concat(r.slice(s+1)))}}}function mt(t,e){var n=dt(t,e);if(n.length)for(var i=Array.prototype.slice.call(arguments,2),r=0;r0}function wt(t){t.prototype.on=function(t,e){ft(this,t,e)},t.prototype.off=function(t,e){gt(this,t,e)}}function xt(t){t.preventDefault?t.preventDefault():t.returnValue=!1}function kt(t){t.stopPropagation?t.stopPropagation():t.cancelBubble=!0}function Ct(t){return null!=t.defaultPrevented?t.defaultPrevented:0==t.returnValue}function St(t){xt(t),kt(t)}function Tt(t){return t.target||t.srcElement}function Ot(t){var e=t.which;return null==e&&(1&t.button?e=1:2&t.button?e=3:4&t.button&&(e=2)),v&&t.ctrlKey&&1==e&&(e=3),e}var Lt,Et,At=function(){if(o&&a<9)return!1;var t=E("div");return"draggable"in t||"dragDrop"in t}();function Mt(t){if(null==Lt){var e=E("span","​");L(t,E("span",[e,document.createTextNode("x")])),0!=t.firstChild.offsetHeight&&(Lt=e.offsetWidth<=1&&e.offsetHeight>2&&!(o&&a<8))}var n=Lt?E("span","​"):E("span"," ",null,"display: inline-block; width: 1px; margin-right: -1px");return n.setAttribute("cm-text",""),n}function Nt(t){if(null!=Et)return Et;var e=L(t,document.createTextNode("AخA")),n=S(e,0,1).getBoundingClientRect(),i=S(e,1,2).getBoundingClientRect();return O(t),!(!n||n.left==n.right)&&(Et=i.right-n.right<3)}var Rt=3!="\n\nb".split(/\n/).length?function(t){var e=0,n=[],i=t.length;while(e<=i){var r=t.indexOf("\n",e);-1==r&&(r=t.length);var s=t.slice(e,"\r"==t.charAt(r-1)?r-1:r),o=s.indexOf("\r");-1!=o?(n.push(s.slice(0,o)),e+=o+1):(n.push(s),e=r+1)}return n}:function(t){return t.split(/\r\n?|\n/)},Dt=window.getSelection?function(t){try{return t.selectionStart!=t.selectionEnd}catch(e){return!1}}:function(t){var e;try{e=t.ownerDocument.selection.createRange()}catch(n){}return!(!e||e.parentElement()!=t)&&0!=e.compareEndPoints("StartToEnd",e)},Wt=function(){var t=E("div");return"oncopy"in t||(t.setAttribute("oncopy","return;"),"function"==typeof t.oncopy)}(),Pt=null;function zt(t){if(null!=Pt)return Pt;var e=L(t,E("span","x")),n=e.getBoundingClientRect(),i=S(e,0,1).getBoundingClientRect();return Pt=Math.abs(n.left-i.left)>1}var It={},jt={};function Ft(t,e){arguments.length>2&&(e.dependencies=Array.prototype.slice.call(arguments,2)),It[t]=e}function Bt(t,e){jt[t]=e}function Ht(t){if("string"==typeof t&&jt.hasOwnProperty(t))t=jt[t];else if(t&&"string"==typeof t.name&&jt.hasOwnProperty(t.name)){var e=jt[t.name];"string"==typeof e&&(e={name:e}),t=J(e,t),t.name=e.name}else{if("string"==typeof t&&/^[\w\-]+\/[\w\-]+\+xml$/.test(t))return Ht("application/xml");if("string"==typeof t&&/^[\w\-]+\/[\w\-]+\+json$/.test(t))return Ht("application/json")}return"string"==typeof t?{name:t}:t||{name:"null"}}function Ut(t,e){e=Ht(e);var n=It[e.name];if(!n)return Ut(t,"text/plain");var i=n(t,e);if(Kt.hasOwnProperty(e.name)){var r=Kt[e.name];for(var s in r)r.hasOwnProperty(s)&&(i.hasOwnProperty(s)&&(i["_"+s]=i[s]),i[s]=r[s])}if(i.name=e.name,e.helperType&&(i.helperType=e.helperType),e.modeProps)for(var o in e.modeProps)i[o]=e.modeProps[o];return i}var Kt={};function Vt(t,e){var n=Kt.hasOwnProperty(t)?Kt[t]:Kt[t]={};z(e,n)}function Gt(t,e){if(!0===e)return e;if(t.copyState)return t.copyState(e);var n={};for(var i in e){var r=e[i];r instanceof Array&&(r=r.concat([])),n[i]=r}return n}function Xt(t,e){var n;while(t.innerMode){if(n=t.innerMode(e),!n||n.mode==t)break;e=n.state,t=n.mode}return n||{mode:t,state:e}}function $t(t,e,n){return!t.startState||t.startState(e,n)}var qt=function(t,e,n){this.pos=this.start=0,this.string=t,this.tabSize=e||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=n};function Yt(t,e){if(e-=t.first,e<0||e>=t.size)throw new Error("There is no line "+(e+t.first)+" in the document.");var n=t;while(!n.lines)for(var i=0;;++i){var r=n.children[i],s=r.chunkSize();if(e=t.first&&en?re(n,Yt(t,n).text.length):pe(e,Yt(t,e.line).text.length)}function pe(t,e){var n=t.ch;return null==n||n>e?re(t.line,e):n<0?re(t.line,0):t}function _e(t,e){for(var n=[],i=0;i=this.string.length},qt.prototype.sol=function(){return this.pos==this.lineStart},qt.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},qt.prototype.next=function(){if(this.pose},qt.prototype.eatSpace=function(){var t=this.pos;while(/[\s\u00a0]/.test(this.string.charAt(this.pos)))++this.pos;return this.pos>t},qt.prototype.skipToEnd=function(){this.pos=this.string.length},qt.prototype.skipTo=function(t){var e=this.string.indexOf(t,this.pos);if(e>-1)return this.pos=e,!0},qt.prototype.backUp=function(t){this.pos-=t},qt.prototype.column=function(){return this.lastColumnPos0?null:(i&&!1!==e&&(this.pos+=i[0].length),i)}var r=function(t){return n?t.toLowerCase():t},s=this.string.substr(this.pos,t.length);if(r(s)==r(t))return!1!==e&&(this.pos+=t.length),!0},qt.prototype.current=function(){return this.string.slice(this.start,this.pos)},qt.prototype.hideFirstChars=function(t,e){this.lineStart+=t;try{return e()}finally{this.lineStart-=t}},qt.prototype.lookAhead=function(t){var e=this.lineOracle;return e&&e.lookAhead(t)},qt.prototype.baseToken=function(){var t=this.lineOracle;return t&&t.baseToken(this.pos)};var fe=function(t,e){this.state=t,this.lookAhead=e},de=function(t,e,n,i){this.state=e,this.doc=t,this.line=n,this.maxLookAhead=i||0,this.baseTokens=null,this.baseTokenPos=1};function ge(t,e,n,i){var r=[t.state.modeGen],s={};Se(t,e.text,t.doc.mode,n,(function(t,e){return r.push(t,e)}),s,i);for(var o=n.state,a=function(i){n.baseTokens=r;var a=t.state.overlays[i],l=1,u=0;n.state=!0,Se(t,e.text,a.mode,n,(function(t,e){var n=l;while(ut&&r.splice(l,1,t,r[l+1],i),l+=2,u=Math.min(t,i)}if(e)if(a.opaque)r.splice(n,l-n,t,"overlay "+e),l=n+2;else for(;nt.options.maxHighlightLength&&Gt(t.doc.mode,i.state),s=ge(t,e,i);r&&(i.state=r),e.stateAfter=i.save(!r),e.styles=s.styles,s.classes?e.styleClasses=s.classes:e.styleClasses&&(e.styleClasses=null),n===t.doc.highlightFrontier&&(t.doc.modeFrontier=Math.max(t.doc.modeFrontier,++t.doc.highlightFrontier))}return e.styles}function ve(t,e,n){var i=t.doc,r=t.display;if(!i.mode.startState)return new de(i,!0,e);var s=Te(t,e,n),o=s>i.first&&Yt(i,s-1).stateAfter,a=o?de.fromSaved(i,o,s):new de(i,$t(i.mode),s);return i.iter(s,e,(function(n){ye(t,n.text,a);var i=a.line;n.stateAfter=i==e-1||i%5==0||i>=r.viewFrom&&ie.start)return s}throw new Error("Mode "+t.name+" failed to advance stream.")}de.prototype.lookAhead=function(t){var e=this.doc.getLine(this.line+t);return null!=e&&t>this.maxLookAhead&&(this.maxLookAhead=t),e},de.prototype.baseToken=function(t){if(!this.baseTokens)return null;while(this.baseTokens[this.baseTokenPos]<=t)this.baseTokenPos+=2;var e=this.baseTokens[this.baseTokenPos+1];return{type:e&&e.replace(/( |^)overlay .*/,""),size:this.baseTokens[this.baseTokenPos]-t}},de.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},de.fromSaved=function(t,e,n){return e instanceof fe?new de(t,Gt(t.mode,e.state),n,e.lookAhead):new de(t,Gt(t.mode,e),n)},de.prototype.save=function(t){var e=!1!==t?Gt(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new fe(e,this.maxLookAhead):e};var xe=function(t,e,n){this.start=t.start,this.end=t.pos,this.string=t.current(),this.type=e||null,this.state=n};function ke(t,e,n,i){var r,s=t.doc,o=s.mode;e=ce(s,e);var a,l=Yt(s,e.line),u=ve(t,e.line,n),h=new qt(l.text,t.options.tabSize,u);i&&(a=[]);while((i||h.post.options.maxHighlightLength?(a=!1,o&&ye(t,e,i,c.pos),c.pos=e.length,l=null):l=Ce(we(n,c,i.state,p),s),p){var _=p[0].name;_&&(l="m-"+(l?_+" "+l:_))}if(!a||h!=l){while(uo;--a){if(a<=s.first)return s.first;var l=Yt(s,a-1),u=l.stateAfter;if(u&&(!n||a+(u instanceof fe?u.lookAhead:0)<=s.modeFrontier))return a;var h=I(l.text,null,t.options.tabSize);(null==r||i>h)&&(r=a-1,i=h)}return r}function Oe(t,e){if(t.modeFrontier=Math.min(t.modeFrontier,e),!(t.highlightFrontiern;i--){var r=Yt(t,i).stateAfter;if(r&&(!(r instanceof fe)||i+r.lookAhead=e:s.to>e);(i||(i=[])).push(new Ne(o,s.from,l?null:s.to))}}return i}function ze(t,e,n){var i;if(t)for(var r=0;r=e:s.to>e);if(a||s.from==e&&"bookmark"==o.type&&(!n||s.marker.insertLeft)){var l=null==s.from||(o.inclusiveLeft?s.from<=e:s.from0&&a)for(var b=0;b0)){var h=[l,1],c=se(u.from,a.from),p=se(u.to,a.to);(c<0||!o.inclusiveLeft&&!c)&&h.push({from:u.from,to:a.from}),(p>0||!o.inclusiveRight&&!p)&&h.push({from:a.to,to:u.to}),r.splice.apply(r,h),l+=h.length-3}}return r}function Be(t){var e=t.markedSpans;if(e){for(var n=0;ne)&&(!n||Ve(n,s.marker)<0)&&(n=s.marker)}return n}function Ye(t,e,n,i,r){var s=Yt(t,e),o=Ee&&s.markedSpans;if(o)for(var a=0;a=0&&c<=0||h<=0&&c>=0)&&(h<=0&&(l.marker.inclusiveRight&&r.inclusiveLeft?se(u.to,n)>=0:se(u.to,n)>0)||h>=0&&(l.marker.inclusiveRight&&r.inclusiveLeft?se(u.from,i)<=0:se(u.from,i)<0)))return!0}}}function Qe(t){var e;while(e=Xe(t))t=e.find(-1,!0).line;return t}function Ze(t){var e;while(e=$e(t))t=e.find(1,!0).line;return t}function Je(t){var e,n;while(e=$e(t))t=e.find(1,!0).line,(n||(n=[])).push(t);return n}function tn(t,e){var n=Yt(t,e),i=Qe(n);return n==i?e:te(i)}function en(t,e){if(e>t.lastLine())return e;var n,i=Yt(t,e);if(!nn(t,i))return e;while(n=$e(i))i=n.find(1,!0).line;return te(i)+1}function nn(t,e){var n=Ee&&e.markedSpans;if(n)for(var i=void 0,r=0;re.maxLineLength&&(e.maxLineLength=n,e.maxLine=t)}))}var ln=function(t,e,n){this.text=t,He(this,e),this.height=n?n(this):1};function un(t,e,n,i){t.text=e,t.stateAfter&&(t.stateAfter=null),t.styles&&(t.styles=null),null!=t.order&&(t.order=null),Be(t),He(t,n);var r=i?i(t):1;r!=t.height&&Jt(t,r)}function hn(t){t.parent=null,Be(t)}ln.prototype.lineNo=function(){return te(this)},wt(ln);var cn={},pn={};function _n(t,e){if(!t||/^\s*$/.test(t))return null;var n=e.addModeClass?pn:cn;return n[t]||(n[t]=t.replace(/\S+/g,"cm-$&"))}function fn(t,e){var n=A("span",null,null,l?"padding-right: .1px":null),i={pre:A("pre",[n],"CodeMirror-line"),content:n,col:0,pos:0,cm:t,trailingSpace:!1,splitSpaces:t.getOption("lineWrapping")};e.measure={};for(var r=0;r<=(e.rest?e.rest.length:0);r++){var s=r?e.rest[r-1]:e.line,o=void 0;i.pos=0,i.addToken=gn,Nt(t.display.measure)&&(o=pt(s,t.doc.direction))&&(i.addToken=vn(i.addToken,o)),i.map=[];var a=e!=t.display.externalMeasured&&te(s);bn(s,i,me(t,s,a)),s.styleClasses&&(s.styleClasses.bgClass&&(i.bgClass=D(s.styleClasses.bgClass,i.bgClass||"")),s.styleClasses.textClass&&(i.textClass=D(s.styleClasses.textClass,i.textClass||""))),0==i.map.length&&i.map.push(0,0,i.content.appendChild(Mt(t.display.measure))),0==r?(e.measure.map=i.map,e.measure.cache={}):((e.measure.maps||(e.measure.maps=[])).push(i.map),(e.measure.caches||(e.measure.caches=[])).push({}))}if(l){var u=i.content.lastChild;(/\bcm-tab\b/.test(u.className)||u.querySelector&&u.querySelector(".cm-tab"))&&(i.content.className="cm-tab-wrap-hack")}return mt(t,"renderLine",t,e.line,i.pre),i.pre.className&&(i.textClass=D(i.pre.className,i.textClass||"")),i}function dn(t){var e=E("span","•","cm-invalidchar");return e.title="\\u"+t.charCodeAt(0).toString(16),e.setAttribute("aria-label",e.title),e}function gn(t,e,n,i,r,s,l){if(e){var u,h=t.splitSpaces?mn(e,t.trailingSpace):e,c=t.cm.state.specialChars,p=!1;if(c.test(e)){u=document.createDocumentFragment();var _=0;while(1){c.lastIndex=_;var f=c.exec(e),d=f?f.index-_:e.length-_;if(d){var g=document.createTextNode(h.slice(_,_+d));o&&a<9?u.appendChild(E("span",[g])):u.appendChild(g),t.map.push(t.pos,t.pos+d,g),t.col+=d,t.pos+=d}if(!f)break;_+=d+1;var m=void 0;if("\t"==f[0]){var v=t.cm.options.tabSize,y=v-t.col%v;m=u.appendChild(E("span",$(y),"cm-tab")),m.setAttribute("role","presentation"),m.setAttribute("cm-text","\t"),t.col+=y}else"\r"==f[0]||"\n"==f[0]?(m=u.appendChild(E("span","\r"==f[0]?"␍":"␤","cm-invalidchar")),m.setAttribute("cm-text",f[0]),t.col+=1):(m=t.cm.options.specialCharPlaceholder(f[0]),m.setAttribute("cm-text",f[0]),o&&a<9?u.appendChild(E("span",[m])):u.appendChild(m),t.col+=1);t.map.push(t.pos,t.pos+1,m),t.pos++}}else t.col+=e.length,u=document.createTextNode(h),t.map.push(t.pos,t.pos+e.length,u),o&&a<9&&(p=!0),t.pos+=e.length;if(t.trailingSpace=32==h.charCodeAt(e.length-1),n||i||r||p||s||l){var b=n||"";i&&(b+=i),r&&(b+=r);var w=E("span",[u],b,s);if(l)for(var x in l)l.hasOwnProperty(x)&&"style"!=x&&"class"!=x&&w.setAttribute(x,l[x]);return t.content.appendChild(w)}t.content.appendChild(u)}}function mn(t,e){if(t.length>1&&!/ /.test(t))return t;for(var n=e,i="",r=0;ru&&c.from<=u)break;if(c.to>=h)return t(n,i,r,s,o,a,l);t(n,i.slice(0,c.to-u),r,s,null,a,l),s=null,i=i.slice(c.to-u),u=c.to}}}function yn(t,e,n,i){var r=!i&&n.widgetNode;r&&t.map.push(t.pos,t.pos+e,r),!i&&t.cm.display.input.needsContentAttribute&&(r||(r=t.content.appendChild(document.createElement("span"))),r.setAttribute("cm-marker",n.id)),r&&(t.cm.display.input.setUneditable(r),t.content.appendChild(r)),t.pos+=e,t.trailingSpace=!1}function bn(t,e,n){var i=t.markedSpans,r=t.text,s=0;if(i)for(var o,a,l,u,h,c,p,_=r.length,f=0,d=1,g="",m=0;;){if(m==f){l=u=h=a="",p=null,c=null,m=1/0;for(var v=[],y=void 0,b=0;bf||x.collapsed&&w.to==f&&w.from==f)){if(null!=w.to&&w.to!=f&&m>w.to&&(m=w.to,u=""),x.className&&(l+=" "+x.className),x.css&&(a=(a?a+";":"")+x.css),x.startStyle&&w.from==f&&(h+=" "+x.startStyle),x.endStyle&&w.to==m&&(y||(y=[])).push(x.endStyle,w.to),x.title&&((p||(p={})).title=x.title),x.attributes)for(var k in x.attributes)(p||(p={}))[k]=x.attributes[k];x.collapsed&&(!c||Ve(c.marker,x)<0)&&(c=w)}else w.from>f&&m>w.from&&(m=w.from)}if(y)for(var C=0;C=_)break;var T=Math.min(_,m);while(1){if(g){var O=f+g.length;if(!c){var L=O>T?g.slice(0,T-f):g;e.addToken(e,L,o?o+l:l,h,f+L.length==m?u:"",a,p)}if(O>=T){g=g.slice(T-f),f=T;break}f=O,h=""}g=r.slice(s,s=n[d++]),o=_n(n[d++],e.cm.options)}}else for(var E=1;E2&&s.push((l.bottom+u.top)/2-n.top)}}s.push(n.bottom-n.top)}}function Qn(t,e,n){if(t.line==e)return{map:t.measure.map,cache:t.measure.cache};for(var i=0;in)return{map:t.measure.maps[r],cache:t.measure.caches[r],before:!0}}function Zn(t,e){e=Qe(e);var n=te(e),i=t.display.externalMeasured=new wn(t.doc,e,n);i.lineN=n;var r=i.built=fn(t,i);return i.text=r.pre,L(t.display.lineMeasure,r.pre),i}function Jn(t,e,n,i){return ni(t,ei(t,e),n,i)}function ti(t,e){if(e>=t.display.viewFrom&&e=n.lineN&&ee)&&(s=l-a,r=s-1,e>=l&&(o="right")),null!=r){if(i=t[u+2],a==l&&n==(i.insertLeft?"left":"right")&&(o=n),"left"==n&&0==r)while(u&&t[u-2]==t[u-3]&&t[u-1].insertLeft)i=t[2+(u-=3)],o="left";if("right"==n&&r==l-a)while(u=0;r--)if((n=t[r]).left!=n.right)break;return n}function ai(t,e,n,i){var r,s=si(e.map,n,i),l=s.node,u=s.start,h=s.end,c=s.collapse;if(3==l.nodeType){for(var p=0;p<4;p++){while(u&&st(e.line.text.charAt(s.coverStart+u)))--u;while(s.coverStart+h0&&(c=i="right"),r=t.options.lineWrapping&&(_=l.getClientRects()).length>1?_["right"==i?_.length-1:0]:l.getBoundingClientRect()}if(o&&a<9&&!u&&(!r||!r.left&&!r.right)){var f=l.parentNode.getClientRects()[0];r=f?{left:f.left,right:f.left+Ei(t.display),top:f.top,bottom:f.bottom}:ri}for(var d=r.top-e.rect.top,g=r.bottom-e.rect.top,m=(d+g)/2,v=e.view.measure.heights,y=0;y=i.text.length?(l=i.text.length,u="before"):l<=0&&(l=0,u="after"),!a)return o("before"==u?l-1:l,"before"==u);function h(t,e,n){var i=a[e],r=1==i.level;return o(n?t-1:t,r!=n)}var c=ht(a,l,u),p=ut,_=h(l,c,"before"==u);return null!=p&&(_.other=h(l,p,"before"!=u)),_}function yi(t,e){var n=0;e=ce(t.doc,e),t.options.lineWrapping||(n=Ei(t.display)*e.ch);var i=Yt(t.doc,e.line),r=sn(i)+Kn(t.display);return{left:n,right:n,top:r,bottom:r+i.height}}function bi(t,e,n,i,r){var s=re(t,e,n);return s.xRel=r,i&&(s.outside=i),s}function wi(t,e,n){var i=t.doc;if(n+=t.display.viewOffset,n<0)return bi(i.first,0,null,-1,-1);var r=ee(i,n),s=i.first+i.size-1;if(r>s)return bi(i.first+i.size-1,Yt(i,s).text.length,null,1,1);e<0&&(e=0);for(var o=Yt(i,r);;){var a=Si(t,o,r,e,n),l=qe(o,a.ch+(a.xRel>0||a.outside>0?1:0));if(!l)return a;var u=l.find(1);if(u.line==r)return u;o=Yt(i,r=u.line)}}function xi(t,e,n,i){i-=fi(e);var r=e.text.length,s=at((function(e){return ni(t,n,e-1).bottom<=i}),r,0);return r=at((function(e){return ni(t,n,e).top>i}),s,r),{begin:s,end:r}}function ki(t,e,n,i){n||(n=ei(t,e));var r=di(t,e,ni(t,n,i),"line").top;return xi(t,e,n,r)}function Ci(t,e,n,i){return!(t.bottom<=n)&&(t.top>n||(i?t.left:t.right)>e)}function Si(t,e,n,i,r){r-=sn(e);var s=ei(t,e),o=fi(e),a=0,l=e.text.length,u=!0,h=pt(e,t.doc.direction);if(h){var c=(t.options.lineWrapping?Oi:Ti)(t,e,n,s,h,i,r);u=1!=c.level,a=u?c.from:c.to-1,l=u?c.to:c.from-1}var p,_,f=null,d=null,g=at((function(e){var n=ni(t,s,e);return n.top+=o,n.bottom+=o,!!Ci(n,i,r,!1)&&(n.top<=r&&n.left<=i&&(f=e,d=n),!0)}),a,l),m=!1;if(d){var v=i-d.left=b.bottom?1:0}return g=ot(e.text,g,1),bi(n,g,_,m,i-p)}function Ti(t,e,n,i,r,s,o){var a=at((function(a){var l=r[a],u=1!=l.level;return Ci(vi(t,re(n,u?l.to:l.from,u?"before":"after"),"line",e,i),s,o,!0)}),0,r.length-1),l=r[a];if(a>0){var u=1!=l.level,h=vi(t,re(n,u?l.from:l.to,u?"after":"before"),"line",e,i);Ci(h,s,o,!0)&&h.top>o&&(l=r[a-1])}return l}function Oi(t,e,n,i,r,s,o){var a=xi(t,e,i,o),l=a.begin,u=a.end;/\s/.test(e.text.charAt(u-1))&&u--;for(var h=null,c=null,p=0;p=u||_.to<=l)){var f=1!=_.level,d=ni(t,i,f?Math.min(u,_.to)-1:Math.max(l,_.from)).right,g=dg)&&(h=_,c=g)}}return h||(h=r[r.length-1]),h.fromu&&(h={from:h.from,to:u,level:h.level}),h}function Li(t){if(null!=t.cachedTextHeight)return t.cachedTextHeight;if(null==ii){ii=E("pre",null,"CodeMirror-line-like");for(var e=0;e<49;++e)ii.appendChild(document.createTextNode("x")),ii.appendChild(E("br"));ii.appendChild(document.createTextNode("x"))}L(t.measure,ii);var n=ii.offsetHeight/50;return n>3&&(t.cachedTextHeight=n),O(t.measure),n||1}function Ei(t){if(null!=t.cachedCharWidth)return t.cachedCharWidth;var e=E("span","xxxxxxxxxx"),n=E("pre",[e],"CodeMirror-line-like");L(t.measure,n);var i=e.getBoundingClientRect(),r=(i.right-i.left)/10;return r>2&&(t.cachedCharWidth=r),r||10}function Ai(t){for(var e=t.display,n={},i={},r=e.gutters.clientLeft,s=e.gutters.firstChild,o=0;s;s=s.nextSibling,++o){var a=t.display.gutterSpecs[o].className;n[a]=s.offsetLeft+s.clientLeft+r,i[a]=s.clientWidth}return{fixedPos:Mi(e),gutterTotalWidth:e.gutters.offsetWidth,gutterLeft:n,gutterWidth:i,wrapperWidth:e.wrapper.clientWidth}}function Mi(t){return t.scroller.getBoundingClientRect().left-t.sizer.getBoundingClientRect().left}function Ni(t){var e=Li(t.display),n=t.options.lineWrapping,i=n&&Math.max(5,t.display.scroller.clientWidth/Ei(t.display)-3);return function(r){if(nn(t.doc,r))return 0;var s=0;if(r.widgets)for(var o=0;o0&&(l=Yt(t.doc,u.line).text).length==u.ch){var h=I(l,l.length,t.options.tabSize)-l.length;u=re(u.line,Math.max(0,Math.round((s-Gn(t.display).left)/Ei(t.display))-h))}return u}function Wi(t,e){if(e>=t.display.viewTo)return null;if(e-=t.display.viewFrom,e<0)return null;for(var n=t.display.view,i=0;ie)&&(r.updateLineNumbers=e),t.curOp.viewChanged=!0,e>=r.viewTo)Ee&&tn(t.doc,e)r.viewFrom?Ii(t):(r.viewFrom+=i,r.viewTo+=i);else if(e<=r.viewFrom&&n>=r.viewTo)Ii(t);else if(e<=r.viewFrom){var s=ji(t,n,n+i,1);s?(r.view=r.view.slice(s.index),r.viewFrom=s.lineN,r.viewTo+=i):Ii(t)}else if(n>=r.viewTo){var o=ji(t,e,e,-1);o?(r.view=r.view.slice(0,o.index),r.viewTo=o.lineN):Ii(t)}else{var a=ji(t,e,e,-1),l=ji(t,n,n+i,1);a&&l?(r.view=r.view.slice(0,a.index).concat(xn(t,a.lineN,l.lineN)).concat(r.view.slice(l.index)),r.viewTo+=i):Ii(t)}var u=r.externalMeasured;u&&(n=r.lineN&&e=i.viewTo)){var s=i.view[Wi(t,e)];if(null!=s.node){var o=s.changes||(s.changes=[]);-1==F(o,n)&&o.push(n)}}}function Ii(t){t.display.viewFrom=t.display.viewTo=t.doc.first,t.display.view=[],t.display.viewOffset=0}function ji(t,e,n,i){var r,s=Wi(t,e),o=t.display.view;if(!Ee||n==t.doc.first+t.doc.size)return{index:s,lineN:n};for(var a=t.display.viewFrom,l=0;l0){if(s==o.length-1)return null;r=a+o[s].size-e,s++}else r=a-e;e+=r,n+=r}while(tn(t.doc,n)!=n){if(s==(i<0?0:o.length-1))return null;n+=i*o[s-(i<0?1:0)].size,s+=i}return{index:s,lineN:n}}function Fi(t,e,n){var i=t.display,r=i.view;0==r.length||e>=i.viewTo||n<=i.viewFrom?(i.view=xn(t,e,n),i.viewFrom=e):(i.viewFrom>e?i.view=xn(t,e,i.viewFrom).concat(i.view):i.viewFromn&&(i.view=i.view.slice(0,Wi(t,n)))),i.viewTo=n}function Bi(t){for(var e=t.display.view,n=0,i=0;i=t.display.viewTo||a.to().line0?e.blinker=setInterval((function(){t.hasFocus()||Qi(t),e.cursorDiv.style.visibility=(n=!n)?"":"hidden"}),t.options.cursorBlinkRate):t.options.cursorBlinkRate<0&&(e.cursorDiv.style.visibility="hidden")}}function $i(t){t.hasFocus()||(t.display.input.focus(),t.state.focused||Yi(t))}function qi(t){t.state.delayingBlurEvent=!0,setTimeout((function(){t.state.delayingBlurEvent&&(t.state.delayingBlurEvent=!1,t.state.focused&&Qi(t))}),100)}function Yi(t,e){t.state.delayingBlurEvent&&!t.state.draggingText&&(t.state.delayingBlurEvent=!1),"nocursor"!=t.options.readOnly&&(t.state.focused||(mt(t,"focus",t,e),t.state.focused=!0,R(t.display.wrapper,"CodeMirror-focused"),t.curOp||t.display.selForContextMenu==t.doc.sel||(t.display.input.reset(),l&&setTimeout((function(){return t.display.input.reset(!0)}),20)),t.display.input.receivedFocus()),Xi(t))}function Qi(t,e){t.state.delayingBlurEvent||(t.state.focused&&(mt(t,"blur",t,e),t.state.focused=!1,T(t.display.wrapper,"CodeMirror-focused")),clearInterval(t.display.blinker),setTimeout((function(){t.state.focused||(t.display.shift=!1)}),150))}function Zi(t){for(var e=t.display,n=e.lineDiv.offsetTop,i=0;i.005||p<-.005)&&(Jt(r.line,l),Ji(r.line),r.rest))for(var _=0;_t.display.sizerWidth){var f=Math.ceil(u/Ei(t.display));f>t.display.maxLineLength&&(t.display.maxLineLength=f,t.display.maxLine=r.line,t.display.maxLineChanged=!0)}}}}function Ji(t){if(t.widgets)for(var e=0;e=o&&(s=ee(e,sn(Yt(e,l))-t.wrapper.clientHeight),o=l)}return{from:s,to:Math.max(o,s+1)}}function er(t,e){if(!vt(t,"scrollCursorIntoView")){var n=t.display,i=n.sizer.getBoundingClientRect(),r=null;if(e.top+i.top<0?r=!0:e.bottom+i.top>(window.innerHeight||document.documentElement.clientHeight)&&(r=!1),null!=r&&!f){var s=E("div","​",null,"position: absolute;\n top: "+(e.top-n.viewOffset-Kn(t.display))+"px;\n height: "+(e.bottom-e.top+Xn(t)+n.barHeight)+"px;\n left: "+e.left+"px; width: "+Math.max(2,e.right-e.left)+"px;");t.display.lineSpace.appendChild(s),s.scrollIntoView(r),t.display.lineSpace.removeChild(s)}}}function nr(t,e,n,i){var r;null==i&&(i=0),t.options.lineWrapping||e!=n||(e=e.ch?re(e.line,"before"==e.sticky?e.ch-1:e.ch,"after"):e,n="before"==e.sticky?re(e.line,e.ch+1,"before"):e);for(var s=0;s<5;s++){var o=!1,a=vi(t,e),l=n&&n!=e?vi(t,n):a;r={left:Math.min(a.left,l.left),top:Math.min(a.top,l.top)-i,right:Math.max(a.left,l.left),bottom:Math.max(a.bottom,l.bottom)+i};var u=rr(t,r),h=t.doc.scrollTop,c=t.doc.scrollLeft;if(null!=u.scrollTop&&(cr(t,u.scrollTop),Math.abs(t.doc.scrollTop-h)>1&&(o=!0)),null!=u.scrollLeft&&(_r(t,u.scrollLeft),Math.abs(t.doc.scrollLeft-c)>1&&(o=!0)),!o)break}return r}function ir(t,e){var n=rr(t,e);null!=n.scrollTop&&cr(t,n.scrollTop),null!=n.scrollLeft&&_r(t,n.scrollLeft)}function rr(t,e){var n=t.display,i=Li(t.display);e.top<0&&(e.top=0);var r=t.curOp&&null!=t.curOp.scrollTop?t.curOp.scrollTop:n.scroller.scrollTop,s=qn(t),o={};e.bottom-e.top>s&&(e.bottom=e.top+s);var a=t.doc.height+Vn(n),l=e.topa-i;if(e.topr+s){var h=Math.min(e.top,(u?a:e.bottom)-s);h!=r&&(o.scrollTop=h)}var c=t.options.fixedGutter?0:n.gutters.offsetWidth,p=t.curOp&&null!=t.curOp.scrollLeft?t.curOp.scrollLeft:n.scroller.scrollLeft-c,_=$n(t)-n.gutters.offsetWidth,f=e.right-e.left>_;return f&&(e.right=e.left+_),e.left<10?o.scrollLeft=0:e.left_+p-3&&(o.scrollLeft=e.right+(f?0:10)-_),o}function sr(t,e){null!=e&&(ur(t),t.curOp.scrollTop=(null==t.curOp.scrollTop?t.doc.scrollTop:t.curOp.scrollTop)+e)}function or(t){ur(t);var e=t.getCursor();t.curOp.scrollToPos={from:e,to:e,margin:t.options.cursorScrollMargin}}function ar(t,e,n){null==e&&null==n||ur(t),null!=e&&(t.curOp.scrollLeft=e),null!=n&&(t.curOp.scrollTop=n)}function lr(t,e){ur(t),t.curOp.scrollToPos=e}function ur(t){var e=t.curOp.scrollToPos;if(e){t.curOp.scrollToPos=null;var n=yi(t,e.from),i=yi(t,e.to);hr(t,n,i,e.margin)}}function hr(t,e,n,i){var r=rr(t,{left:Math.min(e.left,n.left),top:Math.min(e.top,n.top)-i,right:Math.max(e.right,n.right),bottom:Math.max(e.bottom,n.bottom)+i});ar(t,r.scrollLeft,r.scrollTop)}function cr(t,e){Math.abs(t.doc.scrollTop-e)<2||(n||Hr(t,{top:e}),pr(t,e,!0),n&&Hr(t),Dr(t,100))}function pr(t,e,n){e=Math.max(0,Math.min(t.display.scroller.scrollHeight-t.display.scroller.clientHeight,e)),(t.display.scroller.scrollTop!=e||n)&&(t.doc.scrollTop=e,t.display.scrollbars.setScrollTop(e),t.display.scroller.scrollTop!=e&&(t.display.scroller.scrollTop=e))}function _r(t,e,n,i){e=Math.max(0,Math.min(e,t.display.scroller.scrollWidth-t.display.scroller.clientWidth)),(n?e==t.doc.scrollLeft:Math.abs(t.doc.scrollLeft-e)<2)&&!i||(t.doc.scrollLeft=e,Gr(t),t.display.scroller.scrollLeft!=e&&(t.display.scroller.scrollLeft=e),t.display.scrollbars.setScrollLeft(e))}function fr(t){var e=t.display,n=e.gutters.offsetWidth,i=Math.round(t.doc.height+Vn(t.display));return{clientHeight:e.scroller.clientHeight,viewHeight:e.wrapper.clientHeight,scrollWidth:e.scroller.scrollWidth,clientWidth:e.scroller.clientWidth,viewWidth:e.wrapper.clientWidth,barLeft:t.options.fixedGutter?n:0,docHeight:i,scrollHeight:i+Xn(t)+e.barHeight,nativeBarWidth:e.nativeBarWidth,gutterWidth:n}}var dr=function(t,e,n){this.cm=n;var i=this.vert=E("div",[E("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),r=this.horiz=E("div",[E("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");i.tabIndex=r.tabIndex=-1,t(i),t(r),ft(i,"scroll",(function(){i.clientHeight&&e(i.scrollTop,"vertical")})),ft(r,"scroll",(function(){r.clientWidth&&e(r.scrollLeft,"horizontal")})),this.checkedZeroWidth=!1,o&&a<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};dr.prototype.update=function(t){var e=t.scrollWidth>t.clientWidth+1,n=t.scrollHeight>t.clientHeight+1,i=t.nativeBarWidth;if(n){this.vert.style.display="block",this.vert.style.bottom=e?i+"px":"0";var r=t.viewHeight-(e?i:0);this.vert.firstChild.style.height=Math.max(0,t.scrollHeight-t.clientHeight+r)+"px"}else this.vert.style.display="",this.vert.firstChild.style.height="0";if(e){this.horiz.style.display="block",this.horiz.style.right=n?i+"px":"0",this.horiz.style.left=t.barLeft+"px";var s=t.viewWidth-t.barLeft-(n?i:0);this.horiz.firstChild.style.width=Math.max(0,t.scrollWidth-t.clientWidth+s)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&t.clientHeight>0&&(0==i&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:n?i:0,bottom:e?i:0}},dr.prototype.setScrollLeft=function(t){this.horiz.scrollLeft!=t&&(this.horiz.scrollLeft=t),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},dr.prototype.setScrollTop=function(t){this.vert.scrollTop!=t&&(this.vert.scrollTop=t),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},dr.prototype.zeroWidthHack=function(){var t=v&&!_?"12px":"18px";this.horiz.style.height=this.vert.style.width=t,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new j,this.disableVert=new j},dr.prototype.enableZeroWidthBar=function(t,e,n){function i(){var r=t.getBoundingClientRect(),s="vert"==n?document.elementFromPoint(r.right-1,(r.top+r.bottom)/2):document.elementFromPoint((r.right+r.left)/2,r.bottom-1);s!=t?t.style.pointerEvents="none":e.set(1e3,i)}t.style.pointerEvents="auto",e.set(1e3,i)},dr.prototype.clear=function(){var t=this.horiz.parentNode;t.removeChild(this.horiz),t.removeChild(this.vert)};var gr=function(){};function mr(t,e){e||(e=fr(t));var n=t.display.barWidth,i=t.display.barHeight;vr(t,e);for(var r=0;r<4&&n!=t.display.barWidth||i!=t.display.barHeight;r++)n!=t.display.barWidth&&t.options.lineWrapping&&Zi(t),vr(t,fr(t)),n=t.display.barWidth,i=t.display.barHeight}function vr(t,e){var n=t.display,i=n.scrollbars.update(e);n.sizer.style.paddingRight=(n.barWidth=i.right)+"px",n.sizer.style.paddingBottom=(n.barHeight=i.bottom)+"px",n.heightForcer.style.borderBottom=i.bottom+"px solid transparent",i.right&&i.bottom?(n.scrollbarFiller.style.display="block",n.scrollbarFiller.style.height=i.bottom+"px",n.scrollbarFiller.style.width=i.right+"px"):n.scrollbarFiller.style.display="",i.bottom&&t.options.coverGutterNextToScrollbar&&t.options.fixedGutter?(n.gutterFiller.style.display="block",n.gutterFiller.style.height=i.bottom+"px",n.gutterFiller.style.width=e.gutterWidth+"px"):n.gutterFiller.style.display=""}gr.prototype.update=function(){return{bottom:0,right:0}},gr.prototype.setScrollLeft=function(){},gr.prototype.setScrollTop=function(){},gr.prototype.clear=function(){};var yr={native:dr,null:gr};function br(t){t.display.scrollbars&&(t.display.scrollbars.clear(),t.display.scrollbars.addClass&&T(t.display.wrapper,t.display.scrollbars.addClass)),t.display.scrollbars=new yr[t.options.scrollbarStyle]((function(e){t.display.wrapper.insertBefore(e,t.display.scrollbarFiller),ft(e,"mousedown",(function(){t.state.focused&&setTimeout((function(){return t.display.input.focus()}),0)})),e.setAttribute("cm-not-content","true")}),(function(e,n){"horizontal"==n?_r(t,e):cr(t,e)}),t),t.display.scrollbars.addClass&&R(t.display.wrapper,t.display.scrollbars.addClass)}var wr=0;function xr(t){t.curOp={cm:t,viewChanged:!1,startHeight:t.doc.height,forceUpdate:!1,updateInput:0,typing:!1,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,focus:!1,id:++wr},Cn(t.curOp)}function kr(t){var e=t.curOp;e&&Tn(e,(function(t){for(var e=0;e=n.viewTo)||n.maxLineChanged&&e.options.lineWrapping,t.update=t.mustUpdate&&new Pr(e,t.mustUpdate&&{top:t.scrollTop,ensure:t.scrollToPos},t.forceUpdate)}function Tr(t){t.updatedDisplay=t.mustUpdate&&Fr(t.cm,t.update)}function Or(t){var e=t.cm,n=e.display;t.updatedDisplay&&Zi(e),t.barMeasure=fr(e),n.maxLineChanged&&!e.options.lineWrapping&&(t.adjustWidthTo=Jn(e,n.maxLine,n.maxLine.text.length).left+3,e.display.sizerWidth=t.adjustWidthTo,t.barMeasure.scrollWidth=Math.max(n.scroller.clientWidth,n.sizer.offsetLeft+t.adjustWidthTo+Xn(e)+e.display.barWidth),t.maxScrollLeft=Math.max(0,n.sizer.offsetLeft+t.adjustWidthTo-$n(e))),(t.updatedDisplay||t.selectionChanged)&&(t.preparedSelection=n.input.prepareSelection())}function Lr(t){var e=t.cm;null!=t.adjustWidthTo&&(e.display.sizer.style.minWidth=t.adjustWidthTo+"px",t.maxScrollLeft=t.display.viewTo)){var n=+new Date+t.options.workTime,i=ve(t,e.highlightFrontier),r=[];e.iter(i.line,Math.min(e.first+e.size,t.display.viewTo+500),(function(s){if(i.line>=t.display.viewFrom){var o=s.styles,a=s.text.length>t.options.maxHighlightLength?Gt(e.mode,i.state):null,l=ge(t,s,i,!0);a&&(i.state=a),s.styles=l.styles;var u=s.styleClasses,h=l.classes;h?s.styleClasses=h:u&&(s.styleClasses=null);for(var c=!o||o.length!=s.styles.length||u!=h&&(!u||!h||u.bgClass!=h.bgClass||u.textClass!=h.textClass),p=0;!c&&pn)return Dr(t,t.options.workDelay),!0})),e.highlightFrontier=i.line,e.modeFrontier=Math.max(e.modeFrontier,i.line),r.length&&Ar(t,(function(){for(var e=0;e=n.viewFrom&&e.visible.to<=n.viewTo&&(null==n.updateLineNumbers||n.updateLineNumbers>=n.viewTo)&&n.renderedView==n.view&&0==Bi(t))return!1;Xr(t)&&(Ii(t),e.dims=Ai(t));var r=i.first+i.size,s=Math.max(e.visible.from-t.options.viewportMargin,i.first),o=Math.min(r,e.visible.to+t.options.viewportMargin);n.viewFromo&&n.viewTo-o<20&&(o=Math.min(r,n.viewTo)),Ee&&(s=tn(t.doc,s),o=en(t.doc,o));var a=s!=n.viewFrom||o!=n.viewTo||n.lastWrapHeight!=e.wrapperHeight||n.lastWrapWidth!=e.wrapperWidth;Fi(t,s,o),n.viewOffset=sn(Yt(t.doc,n.viewFrom)),t.display.mover.style.top=n.viewOffset+"px";var l=Bi(t);if(!a&&0==l&&!e.force&&n.renderedView==n.view&&(null==n.updateLineNumbers||n.updateLineNumbers>=n.viewTo))return!1;var u=Ir(t);return l>4&&(n.lineDiv.style.display="none"),Ur(t,n.updateLineNumbers,e.dims),l>4&&(n.lineDiv.style.display=""),n.renderedView=n.view,jr(u),O(n.cursorDiv),O(n.selectionDiv),n.gutters.style.height=n.sizer.style.minHeight=0,a&&(n.lastWrapHeight=e.wrapperHeight,n.lastWrapWidth=e.wrapperWidth,Dr(t,400)),n.updateLineNumbers=null,!0}function Br(t,e){for(var n=e.viewport,i=!0;;i=!1){if(i&&t.options.lineWrapping&&e.oldDisplayWidth!=$n(t))i&&(e.visible=tr(t.display,t.doc,n));else if(n&&null!=n.top&&(n={top:Math.min(t.doc.height+Vn(t.display)-qn(t),n.top)}),e.visible=tr(t.display,t.doc,n),e.visible.from>=t.display.viewFrom&&e.visible.to<=t.display.viewTo)break;if(!Fr(t,e))break;Zi(t);var r=fr(t);Hi(t),mr(t,r),Vr(t,r),e.force=!1}e.signal(t,"update",t),t.display.viewFrom==t.display.reportedViewFrom&&t.display.viewTo==t.display.reportedViewTo||(e.signal(t,"viewportChange",t,t.display.viewFrom,t.display.viewTo),t.display.reportedViewFrom=t.display.viewFrom,t.display.reportedViewTo=t.display.viewTo)}function Hr(t,e){var n=new Pr(t,e);if(Fr(t,n)){Zi(t),Br(t,n);var i=fr(t);Hi(t),mr(t,i),Vr(t,i),n.finish()}}function Ur(t,e,n){var i=t.display,r=t.options.lineNumbers,s=i.lineDiv,o=s.firstChild;function a(e){var n=e.nextSibling;return l&&v&&t.display.currentWheelTarget==e?e.style.display="none":e.parentNode.removeChild(e),n}for(var u=i.view,h=i.viewFrom,c=0;c-1&&(_=!1),An(t,p,h,n)),_&&(O(p.lineNumber),p.lineNumber.appendChild(document.createTextNode(ie(t.options,h)))),o=p.node.nextSibling}else{var f=In(t,p,h,n);s.insertBefore(f,o)}h+=p.size}while(o)o=a(o)}function Kr(t){var e=t.gutters.offsetWidth;t.sizer.style.marginLeft=e+"px"}function Vr(t,e){t.display.sizer.style.minHeight=e.docHeight+"px",t.display.heightForcer.style.top=e.docHeight+"px",t.display.gutters.style.height=e.docHeight+t.display.barHeight+Xn(t)+"px"}function Gr(t){var e=t.display,n=e.view;if(e.alignWidgets||e.gutters.firstChild&&t.options.fixedGutter){for(var i=Mi(e)-e.scroller.scrollLeft+t.doc.scrollLeft,r=e.gutters.offsetWidth,s=i+"px",o=0;oa.clientWidth,h=a.scrollHeight>a.clientHeight;if(r&&u||s&&h){if(s&&v&&l)t:for(var p=e.target,_=o.view;p!=a;p=p.parentNode)for(var f=0;f<_.length;f++)if(_[f].node==p){t.display.currentWheelTarget=p;break t}if(r&&!n&&!c&&null!=Jr)return s&&h&&cr(t,Math.max(0,a.scrollTop+s*Jr)),_r(t,Math.max(0,a.scrollLeft+r*Jr)),(!s||s&&h)&&xt(e),void(o.wheelStartX=null);if(s&&null!=Jr){var d=s*Jr,g=t.doc.scrollTop,m=g+o.wrapper.clientHeight;d<0?g=Math.max(0,g+d-50):m=Math.min(t.doc.height,m+d+50),Hr(t,{top:g,bottom:m})}Zr<20&&(null==o.wheelStartX?(o.wheelStartX=a.scrollLeft,o.wheelStartY=a.scrollTop,o.wheelDX=r,o.wheelDY=s,setTimeout((function(){if(null!=o.wheelStartX){var t=a.scrollLeft-o.wheelStartX,e=a.scrollTop-o.wheelStartY,n=e&&o.wheelDY&&e/o.wheelDY||t&&o.wheelDX&&t/o.wheelDX;o.wheelStartX=o.wheelStartY=null,n&&(Jr=(Jr*Zr+n)/(Zr+1),++Zr)}}),200)):(o.wheelDX+=r,o.wheelDY+=s))}}o?Jr=-.53:n?Jr=15:h?Jr=-.7:p&&(Jr=-1/3);var is=function(t,e){this.ranges=t,this.primIndex=e};is.prototype.primary=function(){return this.ranges[this.primIndex]},is.prototype.equals=function(t){if(t==this)return!0;if(t.primIndex!=this.primIndex||t.ranges.length!=this.ranges.length)return!1;for(var e=0;e=0&&se(t,i.to())<=0)return n}return-1};var rs=function(t,e){this.anchor=t,this.head=e};function ss(t,e,n){var i=t&&t.options.selectionsMayTouch,r=e[n];e.sort((function(t,e){return se(t.from(),e.from())})),n=F(e,r);for(var s=1;s0:l>=0){var u=ue(a.from(),o.from()),h=le(a.to(),o.to()),c=a.empty()?o.from()==o.head:a.from()==a.head;s<=n&&--n,e.splice(--s,2,new rs(c?h:u,c?u:h))}}return new is(e,n)}function os(t,e){return new is([new rs(t,e||t)],0)}function as(t){return t.text?re(t.from.line+t.text.length-1,q(t.text).length+(1==t.text.length?t.from.ch:0)):t.to}function ls(t,e){if(se(t,e.from)<0)return t;if(se(t,e.to)<=0)return as(e);var n=t.line+e.text.length-(e.to.line-e.from.line)-1,i=t.ch;return t.line==e.to.line&&(i+=as(e).ch-e.to.ch),re(n,i)}function us(t,e){for(var n=[],i=0;i1&&t.remove(a.line+1,f-1),t.insert(a.line+1,m)}Ln(t,"change",t,e)}function gs(t,e,n){function i(t,r,s){if(t.linked)for(var o=0;o1&&!t.done[t.done.length-2].ranges?(t.done.pop(),q(t.done)):void 0}function Cs(t,e,n,i){var r=t.history;r.undone.length=0;var s,o,a=+new Date;if((r.lastOp==i||r.lastOrigin==e.origin&&e.origin&&("+"==e.origin.charAt(0)&&r.lastModTime>a-(t.cm?t.cm.options.historyEventDelay:500)||"*"==e.origin.charAt(0)))&&(s=ks(r,r.lastOp==i)))o=q(s.changes),0==se(e.from,e.to)&&0==se(e.from,o.to)?o.to=as(e):s.changes.push(ws(t,e));else{var l=q(r.done);l&&l.ranges||Os(t.sel,r.done),s={changes:[ws(t,e)],generation:r.generation},r.done.push(s);while(r.done.length>r.undoDepth)r.done.shift(),r.done[0].ranges||r.done.shift()}r.done.push(n),r.generation=++r.maxGeneration,r.lastModTime=r.lastSelTime=a,r.lastOp=r.lastSelOp=i,r.lastOrigin=r.lastSelOrigin=e.origin,o||mt(t,"historyAdded")}function Ss(t,e,n,i){var r=e.charAt(0);return"*"==r||"+"==r&&n.ranges.length==i.ranges.length&&n.somethingSelected()==i.somethingSelected()&&new Date-t.history.lastSelTime<=(t.cm?t.cm.options.historyEventDelay:500)}function Ts(t,e,n,i){var r=t.history,s=i&&i.origin;n==r.lastSelOp||s&&r.lastSelOrigin==s&&(r.lastModTime==r.lastSelTime&&r.lastOrigin==s||Ss(t,s,q(r.done),e))?r.done[r.done.length-1]=e:Os(e,r.done),r.lastSelTime=+new Date,r.lastSelOrigin=s,r.lastSelOp=n,i&&!1!==i.clearRedo&&xs(r.undone)}function Os(t,e){var n=q(e);n&&n.ranges&&n.equals(t)||e.push(t)}function Ls(t,e,n,i){var r=e["spans_"+t.id],s=0;t.iter(Math.max(t.first,n),Math.min(t.first+t.size,i),(function(n){n.markedSpans&&((r||(r=e["spans_"+t.id]={}))[s]=n.markedSpans),++s}))}function Es(t){if(!t)return null;for(var e,n=0;n-1&&(q(a)[c]=u[c],delete u[c])}}}return i}function Rs(t,e,n,i){if(i){var r=t.anchor;if(n){var s=se(e,r)<0;s!=se(n,r)<0?(r=e,e=n):s!=se(e,n)<0&&(e=n)}return new rs(r,e)}return new rs(n||e,e)}function Ds(t,e,n,i,r){null==r&&(r=t.cm&&(t.cm.display.shift||t.extend)),Fs(t,new is([Rs(t.sel.primary(),e,n,r)],0),i)}function Ws(t,e,n){for(var i=[],r=t.cm&&(t.cm.display.shift||t.extend),s=0;s=e.ch:a.to>e.ch))){if(r&&(mt(l,"beforeCursorEnter"),l.explicitlyCleared)){if(s.markedSpans){--o;continue}break}if(!l.atomic)continue;if(n){var c=l.find(i<0?1:-1),p=void 0;if((i<0?h:u)&&(c=Xs(t,c,-i,c&&c.line==e.line?s:null)),c&&c.line==e.line&&(p=se(c,n))&&(i<0?p<0:p>0))return Vs(t,c,e,i,r)}var _=l.find(i<0?-1:1);return(i<0?u:h)&&(_=Xs(t,_,i,_.line==e.line?s:null)),_?Vs(t,_,e,i,r):null}}return e}function Gs(t,e,n,i,r){var s=i||1,o=Vs(t,e,n,s,r)||!r&&Vs(t,e,n,s,!0)||Vs(t,e,n,-s,r)||!r&&Vs(t,e,n,-s,!0);return o||(t.cantEdit=!0,re(t.first,0))}function Xs(t,e,n,i){return n<0&&0==e.ch?e.line>t.first?ce(t,re(e.line-1)):null:n>0&&e.ch==(i||Yt(t,e.line)).text.length?e.line=0;--r)Qs(t,{from:i[r].from,to:i[r].to,text:r?[""]:e.text,origin:e.origin});else Qs(t,e)}}function Qs(t,e){if(1!=e.text.length||""!=e.text[0]||0!=se(e.from,e.to)){var n=us(t,e);Cs(t,e,n,t.cm?t.cm.curOp.id:NaN),to(t,e,n,Ie(t,e));var i=[];gs(t,(function(t,n){n||-1!=F(i,t.history)||(so(t.history,e),i.push(t.history)),to(t,e,null,Ie(t,e))}))}}function Zs(t,e,n){var i=t.cm&&t.cm.state.suppressEdits;if(!i||n){for(var r,s=t.history,o=t.sel,a="undo"==e?s.done:s.undone,l="undo"==e?s.undone:s.done,u=0;u=0;--_){var f=p(_);if(f)return f.v}}}}function Js(t,e){if(0!=e&&(t.first+=e,t.sel=new is(Y(t.sel.ranges,(function(t){return new rs(re(t.anchor.line+e,t.anchor.ch),re(t.head.line+e,t.head.ch))})),t.sel.primIndex),t.cm)){Pi(t.cm,t.first,t.first-e,e);for(var n=t.cm.display,i=n.viewFrom;it.lastLine())){if(e.from.lines&&(e={from:e.from,to:re(s,Yt(t,s).text.length),text:[e.text[0]],origin:e.origin}),e.removed=Qt(t,e.from,e.to),n||(n=us(t,e)),t.cm?eo(t.cm,e,i):ds(t,e,i),Bs(t,n,U),t.cantEdit&&Gs(t,re(t.firstLine(),0))&&(t.cantEdit=!1)}}function eo(t,e,n){var i=t.doc,r=t.display,s=e.from,o=e.to,a=!1,l=s.line;t.options.lineWrapping||(l=te(Qe(Yt(i,s.line))),i.iter(l,o.line+1,(function(t){if(t==r.maxLine)return a=!0,!0}))),i.sel.contains(e.from,e.to)>-1&&yt(t),ds(i,e,n,Ni(t)),t.options.lineWrapping||(i.iter(l,s.line+e.text.length,(function(t){var e=on(t);e>r.maxLineLength&&(r.maxLine=t,r.maxLineLength=e,r.maxLineChanged=!0,a=!1)})),a&&(t.curOp.updateMaxLine=!0)),Oe(i,s.line),Dr(t,400);var u=e.text.length-(o.line-s.line)-1;e.full?Pi(t):s.line!=o.line||1!=e.text.length||fs(t.doc,e)?Pi(t,s.line,o.line+1,u):zi(t,s.line,"text");var h=bt(t,"changes"),c=bt(t,"change");if(c||h){var p={from:s,to:o,text:e.text,removed:e.removed,origin:e.origin};c&&Ln(t,"change",t,p),h&&(t.curOp.changeObjs||(t.curOp.changeObjs=[])).push(p)}t.display.selForContextMenu=null}function no(t,e,n,i,r){var s;i||(i=n),se(i,n)<0&&(s=[i,n],n=s[0],i=s[1]),"string"==typeof e&&(e=t.splitLines(e)),Ys(t,{from:n,to:i,text:e,origin:r})}function io(t,e,n,i){n1||!(this.children[0]instanceof ao))){var a=[];this.collapse(a),this.children=[new ao(a)],this.children[0].parent=this}},collapse:function(t){for(var e=0;e50){for(var o=r.lines.length%25+25,a=o;a10);t.parent.maybeSpill()}},iterN:function(t,e,n){for(var i=0;i0||0==o&&!1!==s.clearWhenEmpty)return s;if(s.replacedWith&&(s.collapsed=!0,s.widgetNode=A("span",[s.replacedWith],"CodeMirror-widget"),i.handleMouseEvents||s.widgetNode.setAttribute("cm-ignore-events","true"),i.insertLeft&&(s.widgetNode.insertLeft=!0)),s.collapsed){if(Ye(t,e.line,e,n,s)||e.line!=n.line&&Ye(t,n.line,e,n,s))throw new Error("Inserting collapsed marker partially overlapping an existing one");Me()}s.addToHistory&&Cs(t,{from:e,to:n,origin:"markText"},t.sel,NaN);var a,l=e.line,u=t.cm;if(t.iter(l,n.line+1,(function(t){u&&s.collapsed&&!u.options.lineWrapping&&Qe(t)==u.display.maxLine&&(a=!0),s.collapsed&&l!=e.line&&Jt(t,0),We(t,new Ne(s,l==e.line?e.ch:null,l==n.line?n.ch:null)),++l})),s.collapsed&&t.iter(e.line,n.line+1,(function(e){nn(t,e)&&Jt(e,0)})),s.clearOnEnter&&ft(s,"beforeCursorEnter",(function(){return s.clear()})),s.readOnly&&(Ae(),(t.history.done.length||t.history.undone.length)&&t.clearHistory()),s.collapsed&&(s.id=++po,s.atomic=!0),u){if(a&&(u.curOp.updateMaxLine=!0),s.collapsed)Pi(u,e.line,n.line+1);else if(s.className||s.startStyle||s.endStyle||s.css||s.attributes||s.title)for(var h=e.line;h<=n.line;h++)zi(u,h,"text");s.atomic&&Us(u.doc),Ln(u,"markerAdded",u,s)}return s}_o.prototype.clear=function(){if(!this.explicitlyCleared){var t=this.doc.cm,e=t&&!t.curOp;if(e&&xr(t),bt(this,"clear")){var n=this.find();n&&Ln(this,"clear",n.from,n.to)}for(var i=null,r=null,s=0;st.display.maxLineLength&&(t.display.maxLine=u,t.display.maxLineLength=h,t.display.maxLineChanged=!0)}null!=i&&t&&this.collapsed&&Pi(t,i,r+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,t&&Us(t.doc)),t&&Ln(t,"markerCleared",t,this,i,r),e&&kr(t),this.parent&&this.parent.clear()}},_o.prototype.find=function(t,e){var n,i;null==t&&"bookmark"==this.type&&(t=1);for(var r=0;r=0;l--)Ys(this,i[l]);a?js(this,a):this.cm&&or(this.cm)})),undo:Rr((function(){Zs(this,"undo")})),redo:Rr((function(){Zs(this,"redo")})),undoSelection:Rr((function(){Zs(this,"undo",!0)})),redoSelection:Rr((function(){Zs(this,"redo",!0)})),setExtending:function(t){this.extend=t},getExtending:function(){return this.extend},historySize:function(){for(var t=this.history,e=0,n=0,i=0;i=t.ch)&&e.push(r.marker.parent||r.marker)}return e},findMarks:function(t,e,n){t=ce(this,t),e=ce(this,e);var i=[],r=t.line;return this.iter(t.line,e.line+1,(function(s){var o=s.markedSpans;if(o)for(var a=0;a=l.to||null==l.from&&r!=t.line||null!=l.from&&r==e.line&&l.from>=e.ch||n&&!n(l.marker)||i.push(l.marker.parent||l.marker)}++r})),i},getAllMarks:function(){var t=[];return this.iter((function(e){var n=e.markedSpans;if(n)for(var i=0;it)return e=t,!0;t-=s,++n})),ce(this,re(n,e))},indexFromPos:function(t){t=ce(this,t);var e=t.ch;if(t.linee&&(e=t.from),null!=t.to&&t.to-1)return e.state.draggingText(t),void setTimeout((function(){return e.display.input.focus()}),20);try{var c=t.dataTransfer.getData("Text");if(c){var p;if(e.state.draggingText&&!e.state.draggingText.copy&&(p=e.listSelections()),Bs(e.doc,os(n,n)),p)for(var _=0;_=0;e--)no(t.doc,"",i[e].from,i[e].to,"+delete");or(t)}))}function Go(t,e,n){var i=ot(t.text,e+n,n);return i<0||i>t.text.length?null:i}function Xo(t,e,n){var i=Go(t,e.ch,n);return null==i?null:new re(e.line,i,n<0?"after":"before")}function $o(t,e,n,i,r){if(t){"rtl"==e.doc.direction&&(r=-r);var s=pt(n,e.doc.direction);if(s){var o,a=r<0?q(s):s[0],l=r<0==(1==a.level),u=l?"after":"before";if(a.level>0||"rtl"==e.doc.direction){var h=ei(e,n);o=r<0?n.text.length-1:0;var c=ni(e,h,o).top;o=at((function(t){return ni(e,h,t).top==c}),r<0==(1==a.level)?a.from:a.to-1,o),"before"==u&&(o=Go(n,o,1))}else o=r<0?a.to:a.from;return new re(i,o,u)}}return new re(i,r<0?n.text.length:0,r<0?"before":"after")}function qo(t,e,n,i){var r=pt(e,t.doc.direction);if(!r)return Xo(e,n,i);n.ch>=e.text.length?(n.ch=e.text.length,n.sticky="before"):n.ch<=0&&(n.ch=0,n.sticky="after");var s=ht(r,n.ch,n.sticky),o=r[s];if("ltr"==t.doc.direction&&o.level%2==0&&(i>0?o.to>n.ch:o.from=o.from&&p>=h.begin)){var _=c?"before":"after";return new re(n.line,p,_)}}var f=function(t,e,i){for(var s=function(t,e){return e?new re(n.line,l(t,1),"before"):new re(n.line,t,"after")};t>=0&&t0==(1!=o.level),u=a?i.begin:l(i.end,-1);if(o.from<=u&&u0?h.end:l(h.begin,-1);return null==g||i>0&&g==e.text.length||(d=f(i>0?0:r.length-1,i,u(g)),!d)?null:d}zo.basic={Left:"goCharLeft",Right:"goCharRight",Up:"goLineUp",Down:"goLineDown",End:"goLineEnd",Home:"goLineStartSmart",PageUp:"goPageUp",PageDown:"goPageDown",Delete:"delCharAfter",Backspace:"delCharBefore","Shift-Backspace":"delCharBefore",Tab:"defaultTab","Shift-Tab":"indentAuto",Enter:"newlineAndIndent",Insert:"toggleOverwrite",Esc:"singleSelection"},zo.pcDefault={"Ctrl-A":"selectAll","Ctrl-D":"deleteLine","Ctrl-Z":"undo","Shift-Ctrl-Z":"redo","Ctrl-Y":"redo","Ctrl-Home":"goDocStart","Ctrl-End":"goDocEnd","Ctrl-Up":"goLineUp","Ctrl-Down":"goLineDown","Ctrl-Left":"goGroupLeft","Ctrl-Right":"goGroupRight","Alt-Left":"goLineStart","Alt-Right":"goLineEnd","Ctrl-Backspace":"delGroupBefore","Ctrl-Delete":"delGroupAfter","Ctrl-S":"save","Ctrl-F":"find","Ctrl-G":"findNext","Shift-Ctrl-G":"findPrev","Shift-Ctrl-F":"replace","Shift-Ctrl-R":"replaceAll","Ctrl-[":"indentLess","Ctrl-]":"indentMore","Ctrl-U":"undoSelection","Shift-Ctrl-U":"redoSelection","Alt-U":"redoSelection",fallthrough:"basic"},zo.emacsy={"Ctrl-F":"goCharRight","Ctrl-B":"goCharLeft","Ctrl-P":"goLineUp","Ctrl-N":"goLineDown","Alt-F":"goWordRight","Alt-B":"goWordLeft","Ctrl-A":"goLineStart","Ctrl-E":"goLineEnd","Ctrl-V":"goPageDown","Shift-Ctrl-V":"goPageUp","Ctrl-D":"delCharAfter","Ctrl-H":"delCharBefore","Alt-D":"delWordAfter","Alt-Backspace":"delWordBefore","Ctrl-K":"killLine","Ctrl-T":"transposeChars","Ctrl-O":"openLine"},zo.macDefault={"Cmd-A":"selectAll","Cmd-D":"deleteLine","Cmd-Z":"undo","Shift-Cmd-Z":"redo","Cmd-Y":"redo","Cmd-Home":"goDocStart","Cmd-Up":"goDocStart","Cmd-End":"goDocEnd","Cmd-Down":"goDocEnd","Alt-Left":"goGroupLeft","Alt-Right":"goGroupRight","Cmd-Left":"goLineLeft","Cmd-Right":"goLineRight","Alt-Backspace":"delGroupBefore","Ctrl-Alt-Backspace":"delGroupAfter","Alt-Delete":"delGroupAfter","Cmd-S":"save","Cmd-F":"find","Cmd-G":"findNext","Shift-Cmd-G":"findPrev","Cmd-Alt-F":"replace","Shift-Cmd-Alt-F":"replaceAll","Cmd-[":"indentLess","Cmd-]":"indentMore","Cmd-Backspace":"delWrappedLineLeft","Cmd-Delete":"delWrappedLineRight","Cmd-U":"undoSelection","Shift-Cmd-U":"redoSelection","Ctrl-Up":"goDocStart","Ctrl-Down":"goDocEnd",fallthrough:["basic","emacsy"]},zo["default"]=v?zo.macDefault:zo.pcDefault;var Yo={selectAll:$s,singleSelection:function(t){return t.setSelection(t.getCursor("anchor"),t.getCursor("head"),U)},killLine:function(t){return Vo(t,(function(e){if(e.empty()){var n=Yt(t.doc,e.head.line).text.length;return e.head.ch==n&&e.head.line0)r=new re(r.line,r.ch+1),t.replaceRange(s.charAt(r.ch-1)+s.charAt(r.ch-2),re(r.line,r.ch-2),r,"+transpose");else if(r.line>t.doc.first){var o=Yt(t.doc,r.line-1).text;o&&(r=new re(r.line,1),t.replaceRange(s.charAt(0)+t.doc.lineSeparator()+o.charAt(o.length-1),re(r.line-1,o.length-1),r,"+transpose"))}n.push(new rs(r,r))}t.setSelections(n)}))},newlineAndIndent:function(t){return Ar(t,(function(){for(var e=t.listSelections(),n=e.length-1;n>=0;n--)t.replaceRange(t.doc.lineSeparator(),e[n].anchor,e[n].head,"+input");e=t.listSelections();for(var i=0;i-1&&(se((r=a.ranges[r]).from(),e)<0||e.xRel>0)&&(se(r.to(),e)>0||e.xRel<0)?wa(t,i,e,s):ka(t,i,e,s)}function wa(t,e,n,i){var r=t.display,s=!1,u=Mr(t,(function(e){l&&(r.scroller.draggable=!1),t.state.draggingText=!1,t.state.delayingBlurEvent&&(t.hasFocus()?t.state.delayingBlurEvent=!1:qi(t)),gt(r.wrapper.ownerDocument,"mouseup",u),gt(r.wrapper.ownerDocument,"mousemove",h),gt(r.scroller,"dragstart",c),gt(r.scroller,"drop",u),s||(xt(e),i.addNew||Ds(t.doc,n,null,null,i.extend),l&&!p||o&&9==a?setTimeout((function(){r.wrapper.ownerDocument.body.focus({preventScroll:!0}),r.input.focus()}),20):r.input.focus())})),h=function(t){s=s||Math.abs(e.clientX-t.clientX)+Math.abs(e.clientY-t.clientY)>=10},c=function(){return s=!0};l&&(r.scroller.draggable=!0),t.state.draggingText=u,u.copy=!i.moveOnDrag,ft(r.wrapper.ownerDocument,"mouseup",u),ft(r.wrapper.ownerDocument,"mousemove",h),ft(r.scroller,"dragstart",c),ft(r.scroller,"drop",u),t.state.delayingBlurEvent=!0,setTimeout((function(){return r.input.focus()}),20),r.scroller.dragDrop&&r.scroller.dragDrop()}function xa(t,e,n){if("char"==n)return new rs(e,e);if("word"==n)return t.findWordAt(e);if("line"==n)return new rs(re(e.line,0),ce(t.doc,re(e.line+1,0)));var i=n(t,e);return new rs(i.from,i.to)}function ka(t,e,n,i){o&&qi(t);var r=t.display,s=t.doc;xt(e);var a,l,u=s.sel,h=u.ranges;if(i.addNew&&!i.extend?(l=s.sel.contains(n),a=l>-1?h[l]:new rs(n,n)):(a=s.sel.primary(),l=s.sel.primIndex),"rectangle"==i.unit)i.addNew||(a=new rs(n,n)),n=Di(t,e,!0,!0),l=-1;else{var c=xa(t,n,i.unit);a=i.extend?Rs(a,c.anchor,c.head,i.extend):c}i.addNew?-1==l?(l=h.length,Fs(s,ss(t,h.concat([a]),l),{scroll:!1,origin:"*mouse"})):h.length>1&&h[l].empty()&&"char"==i.unit&&!i.extend?(Fs(s,ss(t,h.slice(0,l).concat(h.slice(l+1)),0),{scroll:!1,origin:"*mouse"}),u=s.sel):Ps(s,l,a,K):(l=0,Fs(s,new is([a],0),K),u=s.sel);var p=n;function _(e){if(0!=se(p,e))if(p=e,"rectangle"==i.unit){for(var r=[],o=t.options.tabSize,h=I(Yt(s,n.line).text,n.ch,o),c=I(Yt(s,e.line).text,e.ch,o),_=Math.min(h,c),f=Math.max(h,c),d=Math.min(n.line,e.line),g=Math.min(t.lastLine(),Math.max(n.line,e.line));d<=g;d++){var m=Yt(s,d).text,v=G(m,_,o);_==f?r.push(new rs(re(d,v),re(d,v))):m.length>v&&r.push(new rs(re(d,v),re(d,G(m,f,o))))}r.length||r.push(new rs(n,n)),Fs(s,ss(t,u.ranges.slice(0,l).concat(r),l),{origin:"*mouse",scroll:!1}),t.scrollIntoView(e)}else{var y,b=a,w=xa(t,e,i.unit),x=b.anchor;se(w.anchor,x)>0?(y=w.head,x=ue(b.from(),w.anchor)):(y=w.anchor,x=le(b.to(),w.head));var k=u.ranges.slice(0);k[l]=Ca(t,new rs(ce(s,x),y)),Fs(s,ss(t,k,l),K)}}var f=r.wrapper.getBoundingClientRect(),d=0;function g(e){var n=++d,o=Di(t,e,!0,"rectangle"==i.unit);if(o)if(0!=se(o,p)){t.curOp.focus=N(),_(o);var a=tr(r,s);(o.line>=a.to||o.linef.bottom?20:0;l&&setTimeout(Mr(t,(function(){d==n&&(r.scroller.scrollTop+=l,g(e))})),50)}}function m(e){t.state.selectingText=!1,d=1/0,e&&(xt(e),r.input.focus()),gt(r.wrapper.ownerDocument,"mousemove",v),gt(r.wrapper.ownerDocument,"mouseup",y),s.history.lastSelOrigin=null}var v=Mr(t,(function(t){0!==t.buttons&&Ot(t)?g(t):m(t)})),y=Mr(t,m);t.state.selectingText=y,ft(r.wrapper.ownerDocument,"mousemove",v),ft(r.wrapper.ownerDocument,"mouseup",y)}function Ca(t,e){var n=e.anchor,i=e.head,r=Yt(t.doc,n.line);if(0==se(n,i)&&n.sticky==i.sticky)return e;var s=pt(r);if(!s)return e;var o=ht(s,n.ch,n.sticky),a=s[o];if(a.from!=n.ch&&a.to!=n.ch)return e;var l,u=o+(a.from==n.ch==(1!=a.level)?0:1);if(0==u||u==s.length)return e;if(i.line!=n.line)l=(i.line-n.line)*("ltr"==t.doc.direction?1:-1)>0;else{var h=ht(s,i.ch,i.sticky),c=h-o||(i.ch-n.ch)*(1==a.level?-1:1);l=h==u-1||h==u?c<0:c>0}var p=s[u+(l?-1:0)],_=l==(1==p.level),f=_?p.from:p.to,d=_?"after":"before";return n.ch==f&&n.sticky==d?e:new rs(new re(n.line,f,d),i)}function Sa(t,e,n,i){var r,s;if(e.touches)r=e.touches[0].clientX,s=e.touches[0].clientY;else try{r=e.clientX,s=e.clientY}catch(p){return!1}if(r>=Math.floor(t.display.gutters.getBoundingClientRect().right))return!1;i&&xt(e);var o=t.display,a=o.lineDiv.getBoundingClientRect();if(s>a.bottom||!bt(t,n))return Ct(e);s-=a.top-o.viewOffset;for(var l=0;l=r){var h=ee(t.doc,s),c=t.display.gutterSpecs[l];return mt(t,n,t,h,c.className,e),Ct(e)}}}function Ta(t,e){return Sa(t,e,"gutterClick",!0)}function Oa(t,e){Un(t.display,e)||La(t,e)||vt(t,e,"contextmenu")||k||t.display.input.onContextMenu(e)}function La(t,e){return!!bt(t,"gutterContextMenu")&&Sa(t,e,"gutterContextMenu",!1)}function Ea(t){t.display.wrapper.className=t.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+t.options.theme.replace(/(^|\s)\s*/g," cm-s-"),ci(t)}da.prototype.compare=function(t,e,n){return this.time+fa>t&&0==se(e,this.pos)&&n==this.button};var Aa={toString:function(){return"CodeMirror.Init"}},Ma={},Na={};function Ra(t){var e=t.optionHandlers;function n(n,i,r,s){t.defaults[n]=i,r&&(e[n]=s?function(t,e,n){n!=Aa&&r(t,e,n)}:r)}t.defineOption=n,t.Init=Aa,n("value","",(function(t,e){return t.setValue(e)}),!0),n("mode",null,(function(t,e){t.doc.modeOption=e,ps(t)}),!0),n("indentUnit",2,ps,!0),n("indentWithTabs",!1),n("smartIndent",!0),n("tabSize",4,(function(t){_s(t),ci(t),Pi(t)}),!0),n("lineSeparator",null,(function(t,e){if(t.doc.lineSep=e,e){var n=[],i=t.doc.first;t.doc.iter((function(t){for(var r=0;;){var s=t.text.indexOf(e,r);if(-1==s)break;r=s+e.length,n.push(re(i,s))}i++}));for(var r=n.length-1;r>=0;r--)no(t.doc,e,n[r],re(n[r].line,n[r].ch+e.length))}})),n("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b\u200e\u200f\u2028\u2029\ufeff\ufff9-\ufffc]/g,(function(t,e,n){t.state.specialChars=new RegExp(e.source+(e.test("\t")?"":"|\t"),"g"),n!=Aa&&t.refresh()})),n("specialCharPlaceholder",dn,(function(t){return t.refresh()}),!0),n("electricChars",!0),n("inputStyle",m?"contenteditable":"textarea",(function(){throw new Error("inputStyle can not (yet) be changed in a running editor")}),!0),n("spellcheck",!1,(function(t,e){return t.getInputField().spellcheck=e}),!0),n("autocorrect",!1,(function(t,e){return t.getInputField().autocorrect=e}),!0),n("autocapitalize",!1,(function(t,e){return t.getInputField().autocapitalize=e}),!0),n("rtlMoveVisually",!b),n("wholeLineUpdateBefore",!0),n("theme","default",(function(t){Ea(t),Yr(t)}),!0),n("keyMap","default",(function(t,e,n){var i=Ko(e),r=n!=Aa&&Ko(n);r&&r.detach&&r.detach(t,i),i.attach&&i.attach(t,r||null)})),n("extraKeys",null),n("configureMouse",null),n("lineWrapping",!1,Wa,!0),n("gutters",[],(function(t,e){t.display.gutterSpecs=$r(e,t.options.lineNumbers),Yr(t)}),!0),n("fixedGutter",!0,(function(t,e){t.display.gutters.style.left=e?Mi(t.display)+"px":"0",t.refresh()}),!0),n("coverGutterNextToScrollbar",!1,(function(t){return mr(t)}),!0),n("scrollbarStyle","native",(function(t){br(t),mr(t),t.display.scrollbars.setScrollTop(t.doc.scrollTop),t.display.scrollbars.setScrollLeft(t.doc.scrollLeft)}),!0),n("lineNumbers",!1,(function(t,e){t.display.gutterSpecs=$r(t.options.gutters,e),Yr(t)}),!0),n("firstLineNumber",1,Yr,!0),n("lineNumberFormatter",(function(t){return t}),Yr,!0),n("showCursorWhenSelecting",!1,Hi,!0),n("resetSelectionOnContextMenu",!0),n("lineWiseCopyCut",!0),n("pasteLinesPerSelection",!0),n("selectionsMayTouch",!1),n("readOnly",!1,(function(t,e){"nocursor"==e&&(Qi(t),t.display.input.blur()),t.display.input.readOnlyChanged(e)})),n("screenReaderLabel",null,(function(t,e){e=""===e?null:e,t.display.input.screenReaderLabelChanged(e)})),n("disableInput",!1,(function(t,e){e||t.display.input.reset()}),!0),n("dragDrop",!0,Da),n("allowDropFileTypes",null),n("cursorBlinkRate",530),n("cursorScrollMargin",0),n("cursorHeight",1,Hi,!0),n("singleCursorHeightPerLine",!0,Hi,!0),n("workTime",100),n("workDelay",100),n("flattenSpans",!0,_s,!0),n("addModeClass",!1,_s,!0),n("pollInterval",100),n("undoDepth",200,(function(t,e){return t.doc.history.undoDepth=e})),n("historyEventDelay",1250),n("viewportMargin",10,(function(t){return t.refresh()}),!0),n("maxHighlightLength",1e4,_s,!0),n("moveInputWithCursor",!0,(function(t,e){e||t.display.input.resetPosition()})),n("tabindex",null,(function(t,e){return t.display.input.getField().tabIndex=e||""})),n("autofocus",null),n("direction","ltr",(function(t,e){return t.doc.setDirection(e)}),!0),n("phrases",null)}function Da(t,e,n){var i=n&&n!=Aa;if(!e!=!i){var r=t.display.dragFunctions,s=e?ft:gt;s(t.display.scroller,"dragstart",r.start),s(t.display.scroller,"dragenter",r.enter),s(t.display.scroller,"dragover",r.over),s(t.display.scroller,"dragleave",r.leave),s(t.display.scroller,"drop",r.drop)}}function Wa(t){t.options.lineWrapping?(R(t.display.wrapper,"CodeMirror-wrap"),t.display.sizer.style.minWidth="",t.display.sizerWidth=null):(T(t.display.wrapper,"CodeMirror-wrap"),an(t)),Ri(t),Pi(t),ci(t),setTimeout((function(){return mr(t)}),100)}function Pa(t,e){var n=this;if(!(this instanceof Pa))return new Pa(t,e);this.options=e=e?z(e):{},z(Ma,e,!1);var i=e.value;"string"==typeof i?i=new xo(i,e.mode,null,e.lineSeparator,e.direction):e.mode&&(i.modeOption=e.mode),this.doc=i;var r=new Pa.inputStyles[e.inputStyle](this),s=this.display=new Qr(t,i,r,e);for(var u in s.wrapper.CodeMirror=this,Ea(this),e.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),br(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 j,keySeq:null,specialChars:null},e.autofocus&&!m&&s.input.focus(),o&&a<11&&setTimeout((function(){return n.display.input.reset(!0)}),20),za(this),Ao(),xr(this),this.curOp.forceUpdate=!0,ms(this,i),e.autofocus&&!m||this.hasFocus()?setTimeout((function(){n.hasFocus()&&!n.state.focused&&Yi(n)}),20):Qi(this),Na)Na.hasOwnProperty(u)&&Na[u](this,e[u],Aa);Xr(this),e.finishInit&&e.finishInit(this);for(var h=0;h400}ft(e.scroller,"touchstart",(function(r){if(!vt(t,r)&&!s(r)&&!Ta(t,r)){e.input.ensurePolled(),clearTimeout(n);var o=+new Date;e.activeTouch={start:o,moved:!1,prev:o-i.end<=300?i:null},1==r.touches.length&&(e.activeTouch.left=r.touches[0].pageX,e.activeTouch.top=r.touches[0].pageY)}})),ft(e.scroller,"touchmove",(function(){e.activeTouch&&(e.activeTouch.moved=!0)})),ft(e.scroller,"touchend",(function(n){var i=e.activeTouch;if(i&&!Un(e,n)&&null!=i.left&&!i.moved&&new Date-i.start<300){var s,o=t.coordsChar(e.activeTouch,"page");s=!i.prev||l(i,i.prev)?new rs(o,o):!i.prev.prev||l(i,i.prev.prev)?t.findWordAt(o):new rs(re(o.line,0),ce(t.doc,re(o.line+1,0))),t.setSelection(s.anchor,s.head),t.focus(),xt(n)}r()})),ft(e.scroller,"touchcancel",r),ft(e.scroller,"scroll",(function(){e.scroller.clientHeight&&(cr(t,e.scroller.scrollTop),_r(t,e.scroller.scrollLeft,!0),mt(t,"scroll",t))})),ft(e.scroller,"mousewheel",(function(e){return ns(t,e)})),ft(e.scroller,"DOMMouseScroll",(function(e){return ns(t,e)})),ft(e.wrapper,"scroll",(function(){return e.wrapper.scrollTop=e.wrapper.scrollLeft=0})),e.dragFunctions={enter:function(e){vt(t,e)||St(e)},over:function(e){vt(t,e)||(To(t,e),St(e))},start:function(e){return So(t,e)},drop:Mr(t,Co),leave:function(e){vt(t,e)||Oo(t)}};var u=e.input.getField();ft(u,"keyup",(function(e){return ha.call(t,e)})),ft(u,"keydown",Mr(t,la)),ft(u,"keypress",Mr(t,ca)),ft(u,"focus",(function(e){return Yi(t,e)})),ft(u,"blur",(function(e){return Qi(t,e)}))}Pa.defaults=Ma,Pa.optionHandlers=Na;var Ia=[];function ja(t,e,n,i){var r,s=t.doc;null==n&&(n="add"),"smart"==n&&(s.mode.indent?r=ve(t,e).state:n="prev");var o=t.options.tabSize,a=Yt(s,e),l=I(a.text,null,o);a.stateAfter&&(a.stateAfter=null);var u,h=a.text.match(/^\s*/)[0];if(i||/\S/.test(a.text)){if("smart"==n&&(u=s.mode.indent(r,a.text.slice(h.length),a.text),u==H||u>150)){if(!i)return;n="prev"}}else u=0,n="not";"prev"==n?u=e>s.first?I(Yt(s,e-1).text,null,o):0:"add"==n?u=l+t.options.indentUnit:"subtract"==n?u=l-t.options.indentUnit:"number"==typeof n&&(u=l+n),u=Math.max(0,u);var c="",p=0;if(t.options.indentWithTabs)for(var _=Math.floor(u/o);_;--_)p+=o,c+="\t";if(po,l=Rt(e),u=null;if(a&&i.ranges.length>1)if(Fa&&Fa.text.join("\n")==e){if(i.ranges.length%Fa.text.length==0){u=[];for(var h=0;h=0;p--){var _=i.ranges[p],f=_.from(),d=_.to();_.empty()&&(n&&n>0?f=re(f.line,f.ch-n):t.state.overwrite&&!a?d=re(d.line,Math.min(Yt(s,d.line).text.length,d.ch+q(l).length)):a&&Fa&&Fa.lineWise&&Fa.text.join("\n")==l.join("\n")&&(f=d=re(f.line,0)));var g={from:f,to:d,text:u?u[p%u.length]:l,origin:r||(a?"paste":t.state.cutIncoming>o?"cut":"+input")};Ys(t.doc,g),Ln(t,"inputRead",t,g)}e&&!a&&Ka(t,e),or(t),t.curOp.updateInput<2&&(t.curOp.updateInput=c),t.curOp.typing=!0,t.state.pasteIncoming=t.state.cutIncoming=-1}function Ua(t,e){var n=t.clipboardData&&t.clipboardData.getData("Text");if(n)return t.preventDefault(),e.isReadOnly()||e.options.disableInput||Ar(e,(function(){return Ha(e,n,0,null,"paste")})),!0}function Ka(t,e){if(t.options.electricChars&&t.options.smartIndent)for(var n=t.doc.sel,i=n.ranges.length-1;i>=0;i--){var r=n.ranges[i];if(!(r.head.ch>100||i&&n.ranges[i-1].head.line==r.head.line)){var s=t.getModeAt(r.head),o=!1;if(s.electricChars){for(var a=0;a-1){o=ja(t,r.head.line,"smart");break}}else s.electricInput&&s.electricInput.test(Yt(t.doc,r.head.line).text.slice(0,r.head.ch))&&(o=ja(t,r.head.line,"smart"));o&&Ln(t,"electricInput",t,r.head.line)}}}function Va(t){for(var e=[],n=[],i=0;in&&(ja(this,r.head.line,t,!0),n=r.head.line,i==this.doc.sel.primIndex&&or(this));else{var s=r.from(),o=r.to(),a=Math.max(n,s.line);n=Math.min(this.lastLine(),o.line-(o.ch?0:1))+1;for(var l=a;l0&&Ps(this.doc,i,new rs(s,u[i].to()),U)}}})),getTokenAt:function(t,e){return ke(this,t,e)},getLineTokens:function(t,e){return ke(this,re(t),e,!0)},getTokenTypeAt:function(t){t=ce(this.doc,t);var e,n=me(this,Yt(this.doc,t.line)),i=0,r=(n.length-1)/2,s=t.ch;if(0==s)e=n[2];else for(;;){var o=i+r>>1;if((o?n[2*o-1]:0)>=s)r=o;else{if(!(n[2*o+1]s&&(t=s,r=!0),i=Yt(this.doc,t)}else i=t;return di(this,i,{top:0,left:0},e||"page",n||r).top+(r?this.doc.height-sn(i):0)},defaultTextHeight:function(){return Li(this.display)},defaultCharWidth:function(){return Ei(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(t,e,n,i,r){var s=this.display;t=vi(this,ce(this.doc,t));var o=t.bottom,a=t.left;if(e.style.position="absolute",e.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(e),s.sizer.appendChild(e),"over"==i)o=t.top;else if("above"==i||"near"==i){var l=Math.max(s.wrapper.clientHeight,this.doc.height),u=Math.max(s.sizer.clientWidth,s.lineSpace.clientWidth);("above"==i||t.bottom+e.offsetHeight>l)&&t.top>e.offsetHeight?o=t.top-e.offsetHeight:t.bottom+e.offsetHeight<=l&&(o=t.bottom),a+e.offsetWidth>u&&(a=u-e.offsetWidth)}e.style.top=o+"px",e.style.left=e.style.right="","right"==r?(a=s.sizer.clientWidth-e.offsetWidth,e.style.right="0px"):("left"==r?a=0:"middle"==r&&(a=(s.sizer.clientWidth-e.offsetWidth)/2),e.style.left=a+"px"),n&&ir(this,{left:a,top:o,right:a+e.offsetWidth,bottom:o+e.offsetHeight})},triggerOnKeyDown:Nr(la),triggerOnKeyPress:Nr(ca),triggerOnKeyUp:ha,triggerOnMouseDown:Nr(ma),execCommand:function(t){if(Yo.hasOwnProperty(t))return Yo[t].call(null,this)},triggerElectric:Nr((function(t){Ka(this,t)})),findPosH:function(t,e,n,i){var r=1;e<0&&(r=-1,e=-e);for(var s=ce(this.doc,t),o=0;o0&&a(n.charAt(i-1)))--i;while(r.5||this.options.lineWrapping)&&Ri(this),mt(this,"refresh",this)})),swapDoc:Nr((function(t){var e=this.doc;return e.cm=null,this.state.selectingText&&this.state.selectingText(),ms(this,t),ci(this),this.display.input.reset(),ar(this,t.scrollLeft,t.scrollTop),this.curOp.forceScroll=!0,Ln(this,"swapDoc",this,e),e})),phrase:function(t){var e=this.options.phrases;return e&&Object.prototype.hasOwnProperty.call(e,t)?e[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}},wt(t),t.registerHelper=function(e,i,r){n.hasOwnProperty(e)||(n[e]=t[e]={_global:[]}),n[e][i]=r},t.registerGlobalHelper=function(e,i,r,s){t.registerHelper(e,i,s),n[e]._global.push({pred:r,val:s})}}function qa(t,e,n,i,r){var s=e,o=n,a=Yt(t,e.line),l=r&&"rtl"==t.direction?-n:n;function u(){var n=e.line+l;return!(n=t.first+t.size)&&(e=new re(n,e.ch,e.sticky),a=Yt(t,n))}function h(s){var o;if("codepoint"==i){var h=a.text.charCodeAt(e.ch+(n>0?0:-1));if(isNaN(h))o=null;else{var c=n>0?h>=55296&&h<56320:h>=56320&&h<57343;o=new re(e.line,Math.max(0,Math.min(a.text.length,e.ch+n*(c?2:1))),-n)}}else o=r?qo(t.cm,a,e,n):Xo(a,e,n);if(null==o){if(s||!u())return!1;e=$o(r,t.cm,a,e.line,l)}else e=o;return!0}if("char"==i||"codepoint"==i)h();else if("column"==i)h(!0);else if("word"==i||"group"==i)for(var c=null,p="group"==i,_=t.cm&&t.cm.getHelper(e,"wordChars"),f=!0;;f=!1){if(n<0&&!h(!f))break;var d=a.text.charAt(e.ch)||"\n",g=nt(d,_)?"w":p&&"\n"==d?"n":!p||/\s/.test(d)?null:"p";if(!p||f||g||(g="s"),c&&c!=g){n<0&&(n=1,h(),e.sticky="after");break}if(g&&(c=g),n>0&&!h(!f))break}var m=Gs(t,e,s,o,!0);return oe(s,m)&&(m.hitSide=!0),m}function Ya(t,e,n,i){var r,s,o=t.doc,a=e.left;if("page"==i){var l=Math.min(t.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),u=Math.max(l-.5*Li(t.display),3);r=(n>0?e.bottom:e.top)+n*u}else"line"==i&&(r=n>0?e.bottom+3:e.top-3);for(;;){if(s=wi(t,a,r),!s.outside)break;if(n<0?r<=0:r>=o.height){s.hitSide=!0;break}r+=5*n}return s}var Qa=function(t){this.cm=t,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new j,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};function Za(t,e){var n=ti(t,e.line);if(!n||n.hidden)return null;var i=Yt(t.doc,e.line),r=Qn(n,i,e.line),s=pt(i,t.doc.direction),o="left";if(s){var a=ht(s,e.ch);o=a%2?"right":"left"}var l=si(r.map,e.ch,o);return l.offset="right"==l.collapse?l.end:l.start,l}function Ja(t){for(var e=t;e;e=e.parentNode)if(/CodeMirror-gutter-wrapper/.test(e.className))return!0;return!1}function tl(t,e){return e&&(t.bad=!0),t}function el(t,e,n,i,r){var s="",o=!1,a=t.doc.lineSeparator(),l=!1;function u(t){return function(e){return e.id==t}}function h(){o&&(s+=a,l&&(s+=a),o=l=!1)}function c(t){t&&(h(),s+=t)}function p(e){if(1==e.nodeType){var n=e.getAttribute("cm-text");if(n)return void c(n);var s,_=e.getAttribute("cm-marker");if(_){var f=t.findMarks(re(i,0),re(r+1,0),u(+_));return void(f.length&&(s=f[0].find(0))&&c(Qt(t.doc,s.from,s.to).join(a)))}if("false"==e.getAttribute("contenteditable"))return;var d=/^(pre|div|p|li|table|br)$/i.test(e.nodeName);if(!/^br$/i.test(e.nodeName)&&0==e.textContent.length)return;d&&h();for(var g=0;g=e.display.viewTo||s.line=e.display.viewFrom&&Za(e,r)||{node:l[0].measure.map[2],offset:0},h=s.linei.firstLine()&&(o=re(o.line-1,Yt(i.doc,o.line-1).length)),a.ch==Yt(i.doc,a.line).text.length&&a.liner.viewTo-1)return!1;o.line==r.viewFrom||0==(t=Wi(i,o.line))?(e=te(r.view[0].line),n=r.view[0].node):(e=te(r.view[t].line),n=r.view[t-1].node.nextSibling);var l,u,h=Wi(i,a.line);if(h==r.view.length-1?(l=r.viewTo-1,u=r.lineDiv.lastChild):(l=te(r.view[h+1].line)-1,u=r.view[h+1].node.previousSibling),!n)return!1;var c=i.doc.splitLines(el(i,n,u,e,l)),p=Qt(i.doc,re(e,0),re(l,Yt(i.doc,l).text.length));while(c.length>1&&p.length>1)if(q(c)==q(p))c.pop(),p.pop(),l--;else{if(c[0]!=p[0])break;c.shift(),p.shift(),e++}var _=0,f=0,d=c[0],g=p[0],m=Math.min(d.length,g.length);while(_o.ch&&v.charCodeAt(v.length-f-1)==y.charCodeAt(y.length-f-1))_--,f++;c[c.length-1]=v.slice(0,v.length-f).replace(/^\u200b+/,""),c[0]=c[0].slice(_).replace(/\u200b+$/,"");var w=re(e,_),x=re(l,p.length?q(p).length-f:0);return c.length>1||c[0]||se(w,x)?(no(i.doc,c,w,x,"+input"),!0):void 0},Qa.prototype.ensurePolled=function(){this.forceCompositionEnd()},Qa.prototype.reset=function(){this.forceCompositionEnd()},Qa.prototype.forceCompositionEnd=function(){this.composing&&(clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus())},Qa.prototype.readFromDOMSoon=function(){var t=this;null==this.readDOMTimeout&&(this.readDOMTimeout=setTimeout((function(){if(t.readDOMTimeout=null,t.composing){if(!t.composing.done)return;t.composing=null}t.updateFromDOM()}),80))},Qa.prototype.updateFromDOM=function(){var t=this;!this.cm.isReadOnly()&&this.pollContent()||Ar(this.cm,(function(){return Pi(t.cm)}))},Qa.prototype.setUneditable=function(t){t.contentEditable="false"},Qa.prototype.onKeyPress=function(t){0==t.charCode||this.composing||(t.preventDefault(),this.cm.isReadOnly()||Mr(this.cm,Ha)(this.cm,String.fromCharCode(null==t.charCode?t.keyCode:t.charCode),0))},Qa.prototype.readOnlyChanged=function(t){this.div.contentEditable=String("nocursor"!=t)},Qa.prototype.onContextMenu=function(){},Qa.prototype.resetPosition=function(){},Qa.prototype.needsContentAttribute=!0;var rl=function(t){this.cm=t,this.prevInput="",this.pollingFast=!1,this.polling=new j,this.hasSelection=!1,this.composing=null};function sl(t,e){if(e=e?z(e):{},e.value=t.value,!e.tabindex&&t.tabIndex&&(e.tabindex=t.tabIndex),!e.placeholder&&t.placeholder&&(e.placeholder=t.placeholder),null==e.autofocus){var n=N();e.autofocus=n==t||null!=t.getAttribute("autofocus")&&n==document.body}function i(){t.value=a.getValue()}var r;if(t.form&&(ft(t.form,"submit",i),!e.leaveSubmitMethodAlone)){var s=t.form;r=s.submit;try{var o=s.submit=function(){i(),s.submit=r,s.submit(),s.submit=o}}catch(l){}}e.finishInit=function(n){n.save=i,n.getTextArea=function(){return t},n.toTextArea=function(){n.toTextArea=isNaN,i(),t.parentNode.removeChild(n.getWrapperElement()),t.style.display="",t.form&&(gt(t.form,"submit",i),e.leaveSubmitMethodAlone||"function"!=typeof t.form.submit||(t.form.submit=r))}},t.style.display="none";var a=Pa((function(e){return t.parentNode.insertBefore(e,t.nextSibling)}),e);return a}function ol(t){t.off=gt,t.on=ft,t.wheelEventPixels=es,t.Doc=xo,t.splitLines=Rt,t.countColumn=I,t.findColumn=G,t.isWordChar=et,t.Pass=H,t.signal=mt,t.Line=ln,t.changeEnd=as,t.scrollbarModel=yr,t.Pos=re,t.cmpPos=se,t.modes=It,t.mimeModes=jt,t.resolveMode=Ht,t.getMode=Ut,t.modeExtensions=Kt,t.extendMode=Vt,t.copyState=Gt,t.startState=$t,t.innerMode=Xt,t.commands=Yo,t.keyMap=zo,t.keyName=Uo,t.isModifierKey=Bo,t.lookupKey=Fo,t.normalizeKeyMap=jo,t.StringStream=qt,t.SharedTextMarker=go,t.TextMarker=_o,t.LineWidget=uo,t.e_preventDefault=xt,t.e_stopPropagation=kt,t.e_stop=St,t.addClass=R,t.contains=M,t.rmClass=T,t.keyNames=Ro}rl.prototype.init=function(t){var e=this,n=this,i=this.cm;this.createField(t);var r=this.textarea;function s(t){if(!vt(i,t)){if(i.somethingSelected())Ba({lineWise:!1,text:i.getSelections()});else{if(!i.options.lineWiseCopyCut)return;var e=Va(i);Ba({lineWise:!0,text:e.text}),"cut"==t.type?i.setSelections(e.ranges,null,U):(n.prevInput="",r.value=e.text.join("\n"),W(r))}"cut"==t.type&&(i.state.cutIncoming=+new Date)}}t.wrapper.insertBefore(this.wrapper,t.wrapper.firstChild),d&&(r.style.width="0px"),ft(r,"input",(function(){o&&a>=9&&e.hasSelection&&(e.hasSelection=null),n.poll()})),ft(r,"paste",(function(t){vt(i,t)||Ua(t,i)||(i.state.pasteIncoming=+new Date,n.fastPoll())})),ft(r,"cut",s),ft(r,"copy",s),ft(t.scroller,"paste",(function(e){if(!Un(t,e)&&!vt(i,e)){if(!r.dispatchEvent)return i.state.pasteIncoming=+new Date,void n.focus();var s=new Event("paste");s.clipboardData=e.clipboardData,r.dispatchEvent(s)}})),ft(t.lineSpace,"selectstart",(function(e){Un(t,e)||xt(e)})),ft(r,"compositionstart",(function(){var t=i.getCursor("from");n.composing&&n.composing.range.clear(),n.composing={start:t,range:i.markText(t,i.getCursor("to"),{className:"CodeMirror-composing"})}})),ft(r,"compositionend",(function(){n.composing&&(n.poll(),n.composing.range.clear(),n.composing=null)}))},rl.prototype.createField=function(t){this.wrapper=Xa(),this.textarea=this.wrapper.firstChild},rl.prototype.screenReaderLabelChanged=function(t){t?this.textarea.setAttribute("aria-label",t):this.textarea.removeAttribute("aria-label")},rl.prototype.prepareSelection=function(){var t=this.cm,e=t.display,n=t.doc,i=Ui(t);if(t.options.moveInputWithCursor){var r=vi(t,n.sel.primary().head,"div"),s=e.wrapper.getBoundingClientRect(),o=e.lineDiv.getBoundingClientRect();i.teTop=Math.max(0,Math.min(e.wrapper.clientHeight-10,r.top+o.top-s.top)),i.teLeft=Math.max(0,Math.min(e.wrapper.clientWidth-10,r.left+o.left-s.left))}return i},rl.prototype.showSelection=function(t){var e=this.cm,n=e.display;L(n.cursorDiv,t.cursors),L(n.selectionDiv,t.selection),null!=t.teTop&&(this.wrapper.style.top=t.teTop+"px",this.wrapper.style.left=t.teLeft+"px")},rl.prototype.reset=function(t){if(!this.contextMenuPending&&!this.composing){var e=this.cm;if(e.somethingSelected()){this.prevInput="";var n=e.getSelection();this.textarea.value=n,e.state.focused&&W(this.textarea),o&&a>=9&&(this.hasSelection=n)}else t||(this.prevInput=this.textarea.value="",o&&a>=9&&(this.hasSelection=null))}},rl.prototype.getField=function(){return this.textarea},rl.prototype.supportsTouch=function(){return!1},rl.prototype.focus=function(){if("nocursor"!=this.cm.options.readOnly&&(!m||N()!=this.textarea))try{this.textarea.focus()}catch(t){}},rl.prototype.blur=function(){this.textarea.blur()},rl.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},rl.prototype.receivedFocus=function(){this.slowPoll()},rl.prototype.slowPoll=function(){var t=this;this.pollingFast||this.polling.set(this.cm.options.pollInterval,(function(){t.poll(),t.cm.state.focused&&t.slowPoll()}))},rl.prototype.fastPoll=function(){var t=!1,e=this;function n(){var i=e.poll();i||t?(e.pollingFast=!1,e.slowPoll()):(t=!0,e.polling.set(60,n))}e.pollingFast=!0,e.polling.set(20,n)},rl.prototype.poll=function(){var t=this,e=this.cm,n=this.textarea,i=this.prevInput;if(this.contextMenuPending||!e.state.focused||Dt(n)&&!i&&!this.composing||e.isReadOnly()||e.options.disableInput||e.state.keySeq)return!1;var r=n.value;if(r==i&&!e.somethingSelected())return!1;if(o&&a>=9&&this.hasSelection===r||v&&/[\uf700-\uf7ff]/.test(r))return e.display.input.reset(),!1;if(e.doc.sel==e.display.selForContextMenu){var s=r.charCodeAt(0);if(8203!=s||i||(i="​"),8666==s)return this.reset(),this.cm.execCommand("undo")}var l=0,u=Math.min(i.length,r.length);while(l1e3||r.indexOf("\n")>-1?n.value=t.prevInput="":t.prevInput=r,t.composing&&(t.composing.range.clear(),t.composing.range=e.markText(t.composing.start,e.getCursor("to"),{className:"CodeMirror-composing"}))})),!0},rl.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},rl.prototype.onKeyPress=function(){o&&a>=9&&(this.hasSelection=null),this.fastPoll()},rl.prototype.onContextMenu=function(t){var e=this,n=e.cm,i=n.display,r=e.textarea;e.contextMenuPending&&e.contextMenuPending();var s=Di(n,t),u=i.scroller.scrollTop;if(s&&!c){var h=n.options.resetSelectionOnContextMenu;h&&-1==n.doc.sel.contains(s)&&Mr(n,Fs)(n.doc,os(s),U);var p,_=r.style.cssText,f=e.wrapper.style.cssText,d=e.wrapper.offsetParent.getBoundingClientRect();if(e.wrapper.style.cssText="position: static",r.style.cssText="position: absolute; width: 30px; height: 30px;\n top: "+(t.clientY-d.top-5)+"px; left: "+(t.clientX-d.left-5)+"px;\n z-index: 1000; background: "+(o?"rgba(255, 255, 255, .05)":"transparent")+";\n outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);",l&&(p=window.scrollY),i.input.focus(),l&&window.scrollTo(null,p),i.input.reset(),n.somethingSelected()||(r.value=e.prevInput=" "),e.contextMenuPending=v,i.selForContextMenu=n.doc.sel,clearTimeout(i.detectingSelectAll),o&&a>=9&&m(),k){St(t);var g=function(){gt(window,"mouseup",g),setTimeout(v,20)};ft(window,"mouseup",g)}else setTimeout(v,50)}function m(){if(null!=r.selectionStart){var t=n.somethingSelected(),s="​"+(t?r.value:"");r.value="⇚",r.value=s,e.prevInput=t?"":"​",r.selectionStart=1,r.selectionEnd=s.length,i.selForContextMenu=n.doc.sel}}function v(){if(e.contextMenuPending==v&&(e.contextMenuPending=!1,e.wrapper.style.cssText=f,r.style.cssText=_,o&&a<9&&i.scrollbars.setScrollTop(i.scroller.scrollTop=u),null!=r.selectionStart)){(!o||o&&a<9)&&m();var t=0,s=function(){i.selForContextMenu==n.doc.sel&&0==r.selectionStart&&r.selectionEnd>0&&"​"==e.prevInput?Mr(n,$s)(n):t++<10?i.detectingSelectAll=setTimeout(s,500):(i.selForContextMenu=null,i.input.reset())};i.detectingSelectAll=setTimeout(s,200)}}},rl.prototype.readOnlyChanged=function(t){t||this.reset(),this.textarea.disabled="nocursor"==t,this.textarea.readOnly=!!t},rl.prototype.setUneditable=function(){},rl.prototype.needsContentAttribute=!1,Ra(Pa),$a(Pa);var al="iter insert remove copy getEditor constructor".split(" ");for(var ll in xo.prototype)xo.prototype.hasOwnProperty(ll)&&F(al,ll)<0&&(Pa.prototype[ll]=function(t){return function(){return t.apply(this.doc,arguments)}}(xo.prototype[ll]));return wt(xo),Pa.inputStyles={textarea:rl,contenteditable:Qa},Pa.defineMode=function(t){Pa.defaults.mode||"null"==t||(Pa.defaults.mode=t),Ft.apply(this,arguments)},Pa.defineMIME=Bt,Pa.defineMode("null",(function(){return{token:function(t){return t.skipToEnd()}}})),Pa.defineMIME("text/plain","null"),Pa.defineExtension=function(t,e){Pa.prototype[t]=e},Pa.defineDocExtension=function(t,e){xo.prototype[t]=e},Pa.fromTextArea=sl,ol(Pa),Pa.version="5.59.4",Pa}))}}]);