(function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,(function(r){var n=e[i][1][r];return o(n||r)}),p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;iarr.length)len=arr.length;for(var i=0,arr2=new Array(len);icode){return false}pos+=set[i+1];if(pos>=code){return true}}return false}function isIdentifierStart(code,astral){if(code<65){return code===36}if(code<91){return true}if(code<97){return code===95}if(code<123){return true}if(code<=65535){return code>=170&&nonASCIIidentifierStart.test(String.fromCharCode(code))}if(astral===false){return false}return isInAstralSet(code,astralIdentifierStartCodes)}function isIdentifierChar(code,astral){if(code<48){return code===36}if(code<58){return true}if(code<65){return false}if(code<91){return true}if(code<97){return code===95}if(code<123){return true}if(code<=65535){return code>=170&&nonASCIIidentifier.test(String.fromCharCode(code))}if(astral===false){return false}return isInAstralSet(code,astralIdentifierStartCodes)||isInAstralSet(code,astralIdentifierCodes)}var TokenType=function TokenType(label,conf){if(conf===void 0)conf={};this.label=label;this.keyword=conf.keyword;this.beforeExpr=!!conf.beforeExpr;this.startsExpr=!!conf.startsExpr;this.isLoop=!!conf.isLoop;this.isAssign=!!conf.isAssign;this.prefix=!!conf.prefix;this.postfix=!!conf.postfix;this.binop=conf.binop||null;this.updateContext=null};function binop(name,prec){return new TokenType(name,{beforeExpr:true,binop:prec})}var beforeExpr={beforeExpr:true},startsExpr={startsExpr:true};var keywords={};function kw(name,options){if(options===void 0)options={};options.keyword=name;return keywords[name]=new TokenType(name,options)}var types$1={num:new TokenType("num",startsExpr),regexp:new TokenType("regexp",startsExpr),string:new TokenType("string",startsExpr),name:new TokenType("name",startsExpr),privateId:new TokenType("privateId",startsExpr),eof:new TokenType("eof"),bracketL:new TokenType("[",{beforeExpr:true,startsExpr:true}),bracketR:new TokenType("]"),braceL:new TokenType("{",{beforeExpr:true,startsExpr:true}),braceR:new TokenType("}"),parenL:new TokenType("(",{beforeExpr:true,startsExpr:true}),parenR:new TokenType(")"),comma:new TokenType(",",beforeExpr),semi:new TokenType(";",beforeExpr),colon:new TokenType(":",beforeExpr),dot:new TokenType("."),question:new TokenType("?",beforeExpr),questionDot:new TokenType("?."),arrow:new TokenType("=>",beforeExpr),template:new TokenType("template"),invalidTemplate:new TokenType("invalidTemplate"),ellipsis:new TokenType("...",beforeExpr),backQuote:new TokenType("`",startsExpr),dollarBraceL:new TokenType("${",{beforeExpr:true,startsExpr:true}),eq:new TokenType("=",{beforeExpr:true,isAssign:true}),assign:new TokenType("_=",{beforeExpr:true,isAssign:true}),incDec:new TokenType("++/--",{prefix:true,postfix:true,startsExpr:true}),prefix:new TokenType("!/~",{beforeExpr:true,prefix:true,startsExpr:true}),logicalOR:binop("||",1),logicalAND:binop("&&",2),bitwiseOR:binop("|",3),bitwiseXOR:binop("^",4),bitwiseAND:binop("&",5),equality:binop("==/!=/===/!==",6),relational:binop("/<=/>=",7),bitShift:binop("<>/>>>",8),plusMin:new TokenType("+/-",{beforeExpr:true,binop:9,prefix:true,startsExpr:true}),modulo:binop("%",10),star:binop("*",10),slash:binop("/",10),starstar:new TokenType("**",{beforeExpr:true}),coalesce:binop("??",1),_break:kw("break"),_case:kw("case",beforeExpr),_catch:kw("catch"),_continue:kw("continue"),_debugger:kw("debugger"),_default:kw("default",beforeExpr),_do:kw("do",{isLoop:true,beforeExpr:true}),_else:kw("else",beforeExpr),_finally:kw("finally"),_for:kw("for",{isLoop:true}),_function:kw("function",startsExpr),_if:kw("if"),_return:kw("return",beforeExpr),_switch:kw("switch"),_throw:kw("throw",beforeExpr),_try:kw("try"),_var:kw("var"),_const:kw("const"),_while:kw("while",{isLoop:true}),_with:kw("with"),_new:kw("new",{beforeExpr:true,startsExpr:true}),_this:kw("this",startsExpr),_super:kw("super",startsExpr),_class:kw("class",startsExpr),_extends:kw("extends",beforeExpr),_export:kw("export"),_import:kw("import",startsExpr),_null:kw("null",startsExpr),_true:kw("true",startsExpr),_false:kw("false",startsExpr),_in:kw("in",{beforeExpr:true,binop:7}),_instanceof:kw("instanceof",{beforeExpr:true,binop:7}),_typeof:kw("typeof",{beforeExpr:true,prefix:true,startsExpr:true}),_void:kw("void",{beforeExpr:true,prefix:true,startsExpr:true}),_delete:kw("delete",{beforeExpr:true,prefix:true,startsExpr:true})};var lineBreak=/\r\n?|\n|\u2028|\u2029/;var lineBreakG=new RegExp(lineBreak.source,"g");function isNewLine(code){return code===10||code===13||code===8232||code===8233}function nextLineBreak(code,from,end){if(end===void 0)end=code.length;for(var i=from;i>10)+55296,(code&1023)+56320)}var loneSurrogate=/(?:[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])/;var Position=function Position(line,col){this.line=line;this.column=col};Position.prototype.offset=function offset(n){return new Position(this.line,this.column+n)};var SourceLocation=function SourceLocation(p,start,end){this.start=start;this.end=end;if(p.sourceFile!==null){this.source=p.sourceFile}};function getLineInfo(input,offset){for(var line=1,cur=0;;){var nextBreak=nextLineBreak(input,cur,offset);if(nextBreak<0){return new Position(line,offset-cur)}++line;cur=nextBreak}}var defaultOptions={ecmaVersion:null,sourceType:"script",onInsertedSemicolon:null,onTrailingComma:null,allowReserved:null,allowReturnOutsideFunction:false,allowImportExportEverywhere:false,allowAwaitOutsideFunction:null,allowSuperOutsideMethod:null,allowHashBang:false,locations:false,onToken:null,onComment:null,ranges:false,program:null,sourceFile:null,directSourceFile:null,preserveParens:false};var warnedAboutEcmaVersion=false;function getOptions(opts){var options={};for(var opt in defaultOptions){options[opt]=opts&&hasOwn(opts,opt)?opts[opt]:defaultOptions[opt]}if(options.ecmaVersion==="latest"){options.ecmaVersion=1e8}else if(options.ecmaVersion==null){if(!warnedAboutEcmaVersion&&typeof console==="object"&&console.warn){warnedAboutEcmaVersion=true;console.warn("Since Acorn 8.0.0, options.ecmaVersion is required.\nDefaulting to 2020, but this will stop working in the future.")}options.ecmaVersion=11}else if(options.ecmaVersion>=2015){options.ecmaVersion-=2009}if(options.allowReserved==null){options.allowReserved=options.ecmaVersion<5}if(!opts||opts.allowHashBang==null){options.allowHashBang=options.ecmaVersion>=14}if(isArray(options.onToken)){var tokens=options.onToken;options.onToken=function(token){return tokens.push(token)}}if(isArray(options.onComment)){options.onComment=pushComment(options,options.onComment)}return options}function pushComment(options,array){return function(block,text,start,end,startLoc,endLoc){var comment={type:block?"Block":"Line",value:text,start:start,end:end};if(options.locations){comment.loc=new SourceLocation(this,startLoc,endLoc)}if(options.ranges){comment.range=[start,end]}array.push(comment)}}var SCOPE_TOP=1,SCOPE_FUNCTION=2,SCOPE_ASYNC=4,SCOPE_GENERATOR=8,SCOPE_ARROW=16,SCOPE_SIMPLE_CATCH=32,SCOPE_SUPER=64,SCOPE_DIRECT_SUPER=128,SCOPE_CLASS_STATIC_BLOCK=256,SCOPE_VAR=SCOPE_TOP|SCOPE_FUNCTION|SCOPE_CLASS_STATIC_BLOCK;function functionFlags(async,generator){return SCOPE_FUNCTION|(async?SCOPE_ASYNC:0)|(generator?SCOPE_GENERATOR:0)}var BIND_NONE=0,BIND_VAR=1,BIND_LEXICAL=2,BIND_FUNCTION=3,BIND_SIMPLE_CATCH=4,BIND_OUTSIDE=5;var Parser=function Parser(options,input,startPos){this.options=options=getOptions(options);this.sourceFile=options.sourceFile;this.keywords=wordsRegexp(keywords$1[options.ecmaVersion>=6?6:options.sourceType==="module"?"5module":5]);var reserved="";if(options.allowReserved!==true){reserved=reservedWords[options.ecmaVersion>=6?6:options.ecmaVersion===5?5:3];if(options.sourceType==="module"){reserved+=" await"}}this.reservedWords=wordsRegexp(reserved);var reservedStrict=(reserved?reserved+" ":"")+reservedWords.strict;this.reservedWordsStrict=wordsRegexp(reservedStrict);this.reservedWordsStrictBind=wordsRegexp(reservedStrict+" "+reservedWords.strictBind);this.input=String(input);this.containsEsc=false;if(startPos){this.pos=startPos;this.lineStart=this.input.lastIndexOf("\n",startPos-1)+1;this.curLine=this.input.slice(0,this.lineStart).split(lineBreak).length}else{this.pos=this.lineStart=0;this.curLine=1}this.type=types$1.eof;this.value=null;this.start=this.end=this.pos;this.startLoc=this.endLoc=this.curPosition();this.lastTokEndLoc=this.lastTokStartLoc=null;this.lastTokStart=this.lastTokEnd=this.pos;this.context=this.initialContext();this.exprAllowed=true;this.inModule=options.sourceType==="module";this.strict=this.inModule||this.strictDirective(this.pos);this.potentialArrowAt=-1;this.potentialArrowInForAwait=false;this.yieldPos=this.awaitPos=this.awaitIdentPos=0;this.labels=[];this.undefinedExports=Object.create(null);if(this.pos===0&&options.allowHashBang&&this.input.slice(0,2)==="#!"){this.skipLineComment(2)}this.scopeStack=[];this.enterScope(SCOPE_TOP);this.regexpState=null;this.privateNameStack=[]};var prototypeAccessors={inFunction:{configurable:true},inGenerator:{configurable:true},inAsync:{configurable:true},canAwait:{configurable:true},allowSuper:{configurable:true},allowDirectSuper:{configurable:true},treatFunctionsAsVar:{configurable:true},allowNewDotTarget:{configurable:true},inClassStaticBlock:{configurable:true}};Parser.prototype.parse=function parse(){var node=this.options.program||this.startNode();this.nextToken();return this.parseTopLevel(node)};prototypeAccessors.inFunction.get=function(){return(this.currentVarScope().flags&SCOPE_FUNCTION)>0};prototypeAccessors.inGenerator.get=function(){return(this.currentVarScope().flags&SCOPE_GENERATOR)>0&&!this.currentVarScope().inClassFieldInit};prototypeAccessors.inAsync.get=function(){return(this.currentVarScope().flags&SCOPE_ASYNC)>0&&!this.currentVarScope().inClassFieldInit};prototypeAccessors.canAwait.get=function(){for(var i=this.scopeStack.length-1;i>=0;i--){var scope=this.scopeStack[i];if(scope.inClassFieldInit||scope.flags&SCOPE_CLASS_STATIC_BLOCK){return false}if(scope.flags&SCOPE_FUNCTION){return(scope.flags&SCOPE_ASYNC)>0}}return this.inModule&&this.options.ecmaVersion>=13||this.options.allowAwaitOutsideFunction};prototypeAccessors.allowSuper.get=function(){var ref=this.currentThisScope();var flags=ref.flags;var inClassFieldInit=ref.inClassFieldInit;return(flags&SCOPE_SUPER)>0||inClassFieldInit||this.options.allowSuperOutsideMethod};prototypeAccessors.allowDirectSuper.get=function(){return(this.currentThisScope().flags&SCOPE_DIRECT_SUPER)>0};prototypeAccessors.treatFunctionsAsVar.get=function(){return this.treatFunctionsAsVarInScope(this.currentScope())};prototypeAccessors.allowNewDotTarget.get=function(){var ref=this.currentThisScope();var flags=ref.flags;var inClassFieldInit=ref.inClassFieldInit;return(flags&(SCOPE_FUNCTION|SCOPE_CLASS_STATIC_BLOCK))>0||inClassFieldInit};prototypeAccessors.inClassStaticBlock.get=function(){return(this.currentVarScope().flags&SCOPE_CLASS_STATIC_BLOCK)>0};Parser.extend=function extend(){var plugins=[],len=arguments.length;while(len--)plugins[len]=arguments[len];var cls=this;for(var i=0;i=,?^&]/.test(next)||next==="!"&&this.input.charAt(end+1)==="=")}start+=match[0].length;skipWhiteSpace.lastIndex=start;start+=skipWhiteSpace.exec(this.input)[0].length;if(this.input[start]===";"){start++}}};pp$9.eat=function(type){if(this.type===type){this.next();return true}else{return false}};pp$9.isContextual=function(name){return this.type===types$1.name&&this.value===name&&!this.containsEsc};pp$9.eatContextual=function(name){if(!this.isContextual(name)){return false}this.next();return true};pp$9.expectContextual=function(name){if(!this.eatContextual(name)){this.unexpected()}};pp$9.canInsertSemicolon=function(){return this.type===types$1.eof||this.type===types$1.braceR||lineBreak.test(this.input.slice(this.lastTokEnd,this.start))};pp$9.insertSemicolon=function(){if(this.canInsertSemicolon()){if(this.options.onInsertedSemicolon){this.options.onInsertedSemicolon(this.lastTokEnd,this.lastTokEndLoc)}return true}};pp$9.semicolon=function(){if(!this.eat(types$1.semi)&&!this.insertSemicolon()){this.unexpected()}};pp$9.afterTrailingComma=function(tokType,notNext){if(this.type===tokType){if(this.options.onTrailingComma){this.options.onTrailingComma(this.lastTokStart,this.lastTokStartLoc)}if(!notNext){this.next()}return true}};pp$9.expect=function(type){this.eat(type)||this.unexpected()};pp$9.unexpected=function(pos){this.raise(pos!=null?pos:this.start,"Unexpected token")};var DestructuringErrors=function DestructuringErrors(){this.shorthandAssign=this.trailingComma=this.parenthesizedAssign=this.parenthesizedBind=this.doubleProto=-1};pp$9.checkPatternErrors=function(refDestructuringErrors,isAssign){if(!refDestructuringErrors){return}if(refDestructuringErrors.trailingComma>-1){this.raiseRecoverable(refDestructuringErrors.trailingComma,"Comma is not permitted after the rest element")}var parens=isAssign?refDestructuringErrors.parenthesizedAssign:refDestructuringErrors.parenthesizedBind;if(parens>-1){this.raiseRecoverable(parens,isAssign?"Assigning to rvalue":"Parenthesized pattern")}};pp$9.checkExpressionErrors=function(refDestructuringErrors,andThrow){if(!refDestructuringErrors){return false}var shorthandAssign=refDestructuringErrors.shorthandAssign;var doubleProto=refDestructuringErrors.doubleProto;if(!andThrow){return shorthandAssign>=0||doubleProto>=0}if(shorthandAssign>=0){this.raise(shorthandAssign,"Shorthand property assignments are valid only in destructuring patterns")}if(doubleProto>=0){this.raiseRecoverable(doubleProto,"Redefinition of __proto__ property")}};pp$9.checkYieldAwaitInDefaultParams=function(){if(this.yieldPos&&(!this.awaitPos||this.yieldPos55295&&nextCh<56320){return true}if(isIdentifierStart(nextCh,true)){var pos=next+1;while(isIdentifierChar(nextCh=this.input.charCodeAt(pos),true)){++pos}if(nextCh===92||nextCh>55295&&nextCh<56320){return true}var ident=this.input.slice(next,pos);if(!keywordRelationalOperator.test(ident)){return true}}return false};pp$8.isAsyncFunction=function(){if(this.options.ecmaVersion<8||!this.isContextual("async")){return false}skipWhiteSpace.lastIndex=this.pos;var skip=skipWhiteSpace.exec(this.input);var next=this.pos+skip[0].length,after;return!lineBreak.test(this.input.slice(this.pos,next))&&this.input.slice(next,next+8)==="function"&&(next+8===this.input.length||!(isIdentifierChar(after=this.input.charCodeAt(next+8))||after>55295&&after<56320))};pp$8.parseStatement=function(context,topLevel,exports){var starttype=this.type,node=this.startNode(),kind;if(this.isLet(context)){starttype=types$1._var;kind="let"}switch(starttype){case types$1._break:case types$1._continue:return this.parseBreakContinueStatement(node,starttype.keyword);case types$1._debugger:return this.parseDebuggerStatement(node);case types$1._do:return this.parseDoStatement(node);case types$1._for:return this.parseForStatement(node);case types$1._function:if(context&&(this.strict||context!=="if"&&context!=="label")&&this.options.ecmaVersion>=6){this.unexpected()}return this.parseFunctionStatement(node,false,!context);case types$1._class:if(context){this.unexpected()}return this.parseClass(node,true);case types$1._if:return this.parseIfStatement(node);case types$1._return:return this.parseReturnStatement(node);case types$1._switch:return this.parseSwitchStatement(node);case types$1._throw:return this.parseThrowStatement(node);case types$1._try:return this.parseTryStatement(node);case types$1._const:case types$1._var:kind=kind||this.value;if(context&&kind!=="var"){this.unexpected()}return this.parseVarStatement(node,kind);case types$1._while:return this.parseWhileStatement(node);case types$1._with:return this.parseWithStatement(node);case types$1.braceL:return this.parseBlock(true,node);case types$1.semi:return this.parseEmptyStatement(node);case types$1._export:case types$1._import:if(this.options.ecmaVersion>10&&starttype===types$1._import){skipWhiteSpace.lastIndex=this.pos;var skip=skipWhiteSpace.exec(this.input);var next=this.pos+skip[0].length,nextCh=this.input.charCodeAt(next);if(nextCh===40||nextCh===46){return this.parseExpressionStatement(node,this.parseExpression())}}if(!this.options.allowImportExportEverywhere){if(!topLevel){this.raise(this.start,"'import' and 'export' may only appear at the top level")}if(!this.inModule){this.raise(this.start,"'import' and 'export' may appear only with 'sourceType: module'")}}return starttype===types$1._import?this.parseImport(node):this.parseExport(node,exports);default:if(this.isAsyncFunction()){if(context){this.unexpected()}this.next();return this.parseFunctionStatement(node,true,!context)}var maybeName=this.value,expr=this.parseExpression();if(starttype===types$1.name&&expr.type==="Identifier"&&this.eat(types$1.colon)){return this.parseLabeledStatement(node,maybeName,expr,context)}else{return this.parseExpressionStatement(node,expr)}}};pp$8.parseBreakContinueStatement=function(node,keyword){var isBreak=keyword==="break";this.next();if(this.eat(types$1.semi)||this.insertSemicolon()){node.label=null}else if(this.type!==types$1.name){this.unexpected()}else{node.label=this.parseIdent();this.semicolon()}var i=0;for(;i=6){this.eat(types$1.semi)}else{this.semicolon()}return this.finishNode(node,"DoWhileStatement")};pp$8.parseForStatement=function(node){this.next();var awaitAt=this.options.ecmaVersion>=9&&this.canAwait&&this.eatContextual("await")?this.lastTokStart:-1;this.labels.push(loopLabel);this.enterScope(0);this.expect(types$1.parenL);if(this.type===types$1.semi){if(awaitAt>-1){this.unexpected(awaitAt)}return this.parseFor(node,null)}var isLet=this.isLet();if(this.type===types$1._var||this.type===types$1._const||isLet){var init$1=this.startNode(),kind=isLet?"let":this.value;this.next();this.parseVar(init$1,true,kind);this.finishNode(init$1,"VariableDeclaration");if((this.type===types$1._in||this.options.ecmaVersion>=6&&this.isContextual("of"))&&init$1.declarations.length===1){if(this.options.ecmaVersion>=9){if(this.type===types$1._in){if(awaitAt>-1){this.unexpected(awaitAt)}}else{node.await=awaitAt>-1}}return this.parseForIn(node,init$1)}if(awaitAt>-1){this.unexpected(awaitAt)}return this.parseFor(node,init$1)}var startsWithLet=this.isContextual("let"),isForOf=false;var refDestructuringErrors=new DestructuringErrors;var init=this.parseExpression(awaitAt>-1?"await":true,refDestructuringErrors);if(this.type===types$1._in||(isForOf=this.options.ecmaVersion>=6&&this.isContextual("of"))){if(this.options.ecmaVersion>=9){if(this.type===types$1._in){if(awaitAt>-1){this.unexpected(awaitAt)}}else{node.await=awaitAt>-1}}if(startsWithLet&&isForOf){this.raise(init.start,"The left-hand side of a for-of loop may not start with 'let'.")}this.toAssignable(init,false,refDestructuringErrors);this.checkLValPattern(init);return this.parseForIn(node,init)}else{this.checkExpressionErrors(refDestructuringErrors,true)}if(awaitAt>-1){this.unexpected(awaitAt)}return this.parseFor(node,init)};pp$8.parseFunctionStatement=function(node,isAsync,declarationPosition){this.next();return this.parseFunction(node,FUNC_STATEMENT|(declarationPosition?0:FUNC_HANGING_STATEMENT),false,isAsync)};pp$8.parseIfStatement=function(node){this.next();node.test=this.parseParenExpression();node.consequent=this.parseStatement("if");node.alternate=this.eat(types$1._else)?this.parseStatement("if"):null;return this.finishNode(node,"IfStatement")};pp$8.parseReturnStatement=function(node){if(!this.inFunction&&!this.options.allowReturnOutsideFunction){this.raise(this.start,"'return' outside of function")}this.next();if(this.eat(types$1.semi)||this.insertSemicolon()){node.argument=null}else{node.argument=this.parseExpression();this.semicolon()}return this.finishNode(node,"ReturnStatement")};pp$8.parseSwitchStatement=function(node){this.next();node.discriminant=this.parseParenExpression();node.cases=[];this.expect(types$1.braceL);this.labels.push(switchLabel);this.enterScope(0);var cur;for(var sawDefault=false;this.type!==types$1.braceR;){if(this.type===types$1._case||this.type===types$1._default){var isCase=this.type===types$1._case;if(cur){this.finishNode(cur,"SwitchCase")}node.cases.push(cur=this.startNode());cur.consequent=[];this.next();if(isCase){cur.test=this.parseExpression()}else{if(sawDefault){this.raiseRecoverable(this.lastTokStart,"Multiple default clauses")}sawDefault=true;cur.test=null}this.expect(types$1.colon)}else{if(!cur){this.unexpected()}cur.consequent.push(this.parseStatement(null))}}this.exitScope();if(cur){this.finishNode(cur,"SwitchCase")}this.next();this.labels.pop();return this.finishNode(node,"SwitchStatement")};pp$8.parseThrowStatement=function(node){this.next();if(lineBreak.test(this.input.slice(this.lastTokEnd,this.start))){this.raise(this.lastTokEnd,"Illegal newline after throw")}node.argument=this.parseExpression();this.semicolon();return this.finishNode(node,"ThrowStatement")};var empty$1=[];pp$8.parseCatchClauseParam=function(){var param=this.parseBindingAtom();var simple=param.type==="Identifier";this.enterScope(simple?SCOPE_SIMPLE_CATCH:0);this.checkLValPattern(param,simple?BIND_SIMPLE_CATCH:BIND_LEXICAL);this.expect(types$1.parenR);return param};pp$8.parseTryStatement=function(node){this.next();node.block=this.parseBlock();node.handler=null;if(this.type===types$1._catch){var clause=this.startNode();this.next();if(this.eat(types$1.parenL)){clause.param=this.parseCatchClauseParam()}else{if(this.options.ecmaVersion<10){this.unexpected()}clause.param=null;this.enterScope(0)}clause.body=this.parseBlock(false);this.exitScope();node.handler=this.finishNode(clause,"CatchClause")}node.finalizer=this.eat(types$1._finally)?this.parseBlock():null;if(!node.handler&&!node.finalizer){this.raise(node.start,"Missing catch or finally clause")}return this.finishNode(node,"TryStatement")};pp$8.parseVarStatement=function(node,kind,allowMissingInitializer){this.next();this.parseVar(node,false,kind,allowMissingInitializer);this.semicolon();return this.finishNode(node,"VariableDeclaration")};pp$8.parseWhileStatement=function(node){this.next();node.test=this.parseParenExpression();this.labels.push(loopLabel);node.body=this.parseStatement("while");this.labels.pop();return this.finishNode(node,"WhileStatement")};pp$8.parseWithStatement=function(node){if(this.strict){this.raise(this.start,"'with' in strict mode")}this.next();node.object=this.parseParenExpression();node.body=this.parseStatement("with");return this.finishNode(node,"WithStatement")};pp$8.parseEmptyStatement=function(node){this.next();return this.finishNode(node,"EmptyStatement")};pp$8.parseLabeledStatement=function(node,maybeName,expr,context){for(var i$1=0,list=this.labels;i$1=0;i--){var label$1=this.labels[i];if(label$1.statementStart===node.start){label$1.statementStart=this.start;label$1.kind=kind}else{break}}this.labels.push({name:maybeName,kind:kind,statementStart:this.start});node.body=this.parseStatement(context?context.indexOf("label")===-1?context+"label":context:"label");this.labels.pop();node.label=expr;return this.finishNode(node,"LabeledStatement")};pp$8.parseExpressionStatement=function(node,expr){node.expression=expr;this.semicolon();return this.finishNode(node,"ExpressionStatement")};pp$8.parseBlock=function(createNewLexicalScope,node,exitStrict){if(createNewLexicalScope===void 0)createNewLexicalScope=true;if(node===void 0)node=this.startNode();node.body=[];this.expect(types$1.braceL);if(createNewLexicalScope){this.enterScope(0)}while(this.type!==types$1.braceR){var stmt=this.parseStatement(null);node.body.push(stmt)}if(exitStrict){this.strict=false}this.next();if(createNewLexicalScope){this.exitScope()}return this.finishNode(node,"BlockStatement")};pp$8.parseFor=function(node,init){node.init=init;this.expect(types$1.semi);node.test=this.type===types$1.semi?null:this.parseExpression();this.expect(types$1.semi);node.update=this.type===types$1.parenR?null:this.parseExpression();this.expect(types$1.parenR);node.body=this.parseStatement("for");this.exitScope();this.labels.pop();return this.finishNode(node,"ForStatement")};pp$8.parseForIn=function(node,init){var isForIn=this.type===types$1._in;this.next();if(init.type==="VariableDeclaration"&&init.declarations[0].init!=null&&(!isForIn||this.options.ecmaVersion<8||this.strict||init.kind!=="var"||init.declarations[0].id.type!=="Identifier")){this.raise(init.start,(isForIn?"for-in":"for-of")+" loop variable declaration may not have an initializer")}node.left=init;node.right=isForIn?this.parseExpression():this.parseMaybeAssign();this.expect(types$1.parenR);node.body=this.parseStatement("for");this.exitScope();this.labels.pop();return this.finishNode(node,isForIn?"ForInStatement":"ForOfStatement")};pp$8.parseVar=function(node,isFor,kind,allowMissingInitializer){node.declarations=[];node.kind=kind;for(;;){var decl=this.startNode();this.parseVarId(decl,kind);if(this.eat(types$1.eq)){decl.init=this.parseMaybeAssign(isFor)}else if(!allowMissingInitializer&&kind==="const"&&!(this.type===types$1._in||this.options.ecmaVersion>=6&&this.isContextual("of"))){this.unexpected()}else if(!allowMissingInitializer&&decl.id.type!=="Identifier"&&!(isFor&&(this.type===types$1._in||this.isContextual("of")))){this.raise(this.lastTokEnd,"Complex binding patterns require an initialization value")}else{decl.init=null}node.declarations.push(this.finishNode(decl,"VariableDeclarator"));if(!this.eat(types$1.comma)){break}}return node};pp$8.parseVarId=function(decl,kind){decl.id=this.parseBindingAtom();this.checkLValPattern(decl.id,kind==="var"?BIND_VAR:BIND_LEXICAL,false)};var FUNC_STATEMENT=1,FUNC_HANGING_STATEMENT=2,FUNC_NULLABLE_ID=4;pp$8.parseFunction=function(node,statement,allowExpressionBody,isAsync,forInit){this.initFunction(node);if(this.options.ecmaVersion>=9||this.options.ecmaVersion>=6&&!isAsync){if(this.type===types$1.star&&statement&FUNC_HANGING_STATEMENT){this.unexpected()}node.generator=this.eat(types$1.star)}if(this.options.ecmaVersion>=8){node.async=!!isAsync}if(statement&FUNC_STATEMENT){node.id=statement&FUNC_NULLABLE_ID&&this.type!==types$1.name?null:this.parseIdent();if(node.id&&!(statement&FUNC_HANGING_STATEMENT)){this.checkLValSimple(node.id,this.strict||node.generator||node.async?this.treatFunctionsAsVar?BIND_VAR:BIND_LEXICAL:BIND_FUNCTION)}}var oldYieldPos=this.yieldPos,oldAwaitPos=this.awaitPos,oldAwaitIdentPos=this.awaitIdentPos;this.yieldPos=0;this.awaitPos=0;this.awaitIdentPos=0;this.enterScope(functionFlags(node.async,node.generator));if(!(statement&FUNC_STATEMENT)){node.id=this.type===types$1.name?this.parseIdent():null}this.parseFunctionParams(node);this.parseFunctionBody(node,allowExpressionBody,false,forInit);this.yieldPos=oldYieldPos;this.awaitPos=oldAwaitPos;this.awaitIdentPos=oldAwaitIdentPos;return this.finishNode(node,statement&FUNC_STATEMENT?"FunctionDeclaration":"FunctionExpression")};pp$8.parseFunctionParams=function(node){this.expect(types$1.parenL);node.params=this.parseBindingList(types$1.parenR,false,this.options.ecmaVersion>=8);this.checkYieldAwaitInDefaultParams()};pp$8.parseClass=function(node,isStatement){this.next();var oldStrict=this.strict;this.strict=true;this.parseClassId(node,isStatement);this.parseClassSuper(node);var privateNameMap=this.enterClassBody();var classBody=this.startNode();var hadConstructor=false;classBody.body=[];this.expect(types$1.braceL);while(this.type!==types$1.braceR){var element=this.parseClassElement(node.superClass!==null);if(element){classBody.body.push(element);if(element.type==="MethodDefinition"&&element.kind==="constructor"){if(hadConstructor){this.raiseRecoverable(element.start,"Duplicate constructor in the same class")}hadConstructor=true}else if(element.key&&element.key.type==="PrivateIdentifier"&&isPrivateNameConflicted(privateNameMap,element)){this.raiseRecoverable(element.key.start,"Identifier '#"+element.key.name+"' has already been declared")}}}this.strict=oldStrict;this.next();node.body=this.finishNode(classBody,"ClassBody");this.exitClassBody();return this.finishNode(node,isStatement?"ClassDeclaration":"ClassExpression")};pp$8.parseClassElement=function(constructorAllowsSuper){if(this.eat(types$1.semi)){return null}var ecmaVersion=this.options.ecmaVersion;var node=this.startNode();var keyName="";var isGenerator=false;var isAsync=false;var kind="method";var isStatic=false;if(this.eatContextual("static")){if(ecmaVersion>=13&&this.eat(types$1.braceL)){this.parseClassStaticBlock(node);return node}if(this.isClassElementNameStart()||this.type===types$1.star){isStatic=true}else{keyName="static"}}node.static=isStatic;if(!keyName&&ecmaVersion>=8&&this.eatContextual("async")){if((this.isClassElementNameStart()||this.type===types$1.star)&&!this.canInsertSemicolon()){isAsync=true}else{keyName="async"}}if(!keyName&&(ecmaVersion>=9||!isAsync)&&this.eat(types$1.star)){isGenerator=true}if(!keyName&&!isAsync&&!isGenerator){var lastValue=this.value;if(this.eatContextual("get")||this.eatContextual("set")){if(this.isClassElementNameStart()){kind=lastValue}else{keyName=lastValue}}}if(keyName){node.computed=false;node.key=this.startNodeAt(this.lastTokStart,this.lastTokStartLoc);node.key.name=keyName;this.finishNode(node.key,"Identifier")}else{this.parseClassElementName(node)}if(ecmaVersion<13||this.type===types$1.parenL||kind!=="method"||isGenerator||isAsync){var isConstructor=!node.static&&checkKeyName(node,"constructor");var allowsDirectSuper=isConstructor&&constructorAllowsSuper;if(isConstructor&&kind!=="method"){this.raise(node.key.start,"Constructor can't have get/set modifier")}node.kind=isConstructor?"constructor":kind;this.parseClassMethod(node,isGenerator,isAsync,allowsDirectSuper)}else{this.parseClassField(node)}return node};pp$8.isClassElementNameStart=function(){return this.type===types$1.name||this.type===types$1.privateId||this.type===types$1.num||this.type===types$1.string||this.type===types$1.bracketL||this.type.keyword};pp$8.parseClassElementName=function(element){if(this.type===types$1.privateId){if(this.value==="constructor"){this.raise(this.start,"Classes can't have an element named '#constructor'")}element.computed=false;element.key=this.parsePrivateIdent()}else{this.parsePropertyName(element)}};pp$8.parseClassMethod=function(method,isGenerator,isAsync,allowsDirectSuper){var key=method.key;if(method.kind==="constructor"){if(isGenerator){this.raise(key.start,"Constructor can't be a generator")}if(isAsync){this.raise(key.start,"Constructor can't be an async method")}}else if(method.static&&checkKeyName(method,"prototype")){this.raise(key.start,"Classes may not have a static property named prototype")}var value=method.value=this.parseMethod(isGenerator,isAsync,allowsDirectSuper);if(method.kind==="get"&&value.params.length!==0){this.raiseRecoverable(value.start,"getter should have no params")}if(method.kind==="set"&&value.params.length!==1){this.raiseRecoverable(value.start,"setter should have exactly one param")}if(method.kind==="set"&&value.params[0].type==="RestElement"){this.raiseRecoverable(value.params[0].start,"Setter cannot use rest params")}return this.finishNode(method,"MethodDefinition")};pp$8.parseClassField=function(field){if(checkKeyName(field,"constructor")){this.raise(field.key.start,"Classes can't have a field named 'constructor'")}else if(field.static&&checkKeyName(field,"prototype")){this.raise(field.key.start,"Classes can't have a static field named 'prototype'")}if(this.eat(types$1.eq)){var scope=this.currentThisScope();var inClassFieldInit=scope.inClassFieldInit;scope.inClassFieldInit=true;field.value=this.parseMaybeAssign();scope.inClassFieldInit=inClassFieldInit}else{field.value=null}this.semicolon();return this.finishNode(field,"PropertyDefinition")};pp$8.parseClassStaticBlock=function(node){node.body=[];var oldLabels=this.labels;this.labels=[];this.enterScope(SCOPE_CLASS_STATIC_BLOCK|SCOPE_SUPER);while(this.type!==types$1.braceR){var stmt=this.parseStatement(null);node.body.push(stmt)}this.next();this.exitScope();this.labels=oldLabels;return this.finishNode(node,"StaticBlock")};pp$8.parseClassId=function(node,isStatement){if(this.type===types$1.name){node.id=this.parseIdent();if(isStatement){this.checkLValSimple(node.id,BIND_LEXICAL,false)}}else{if(isStatement===true){this.unexpected()}node.id=null}};pp$8.parseClassSuper=function(node){node.superClass=this.eat(types$1._extends)?this.parseExprSubscripts(null,false):null};pp$8.enterClassBody=function(){var element={declared:Object.create(null),used:[]};this.privateNameStack.push(element);return element.declared};pp$8.exitClassBody=function(){var ref=this.privateNameStack.pop();var declared=ref.declared;var used=ref.used;var len=this.privateNameStack.length;var parent=len===0?null:this.privateNameStack[len-1];for(var i=0;i=11){if(this.eatContextual("as")){node.exported=this.parseModuleExportName();this.checkExport(exports,node.exported,this.lastTokStart)}else{node.exported=null}}this.expectContextual("from");if(this.type!==types$1.string){this.unexpected()}node.source=this.parseExprAtom();this.semicolon();return this.finishNode(node,"ExportAllDeclaration")};pp$8.parseExport=function(node,exports){this.next();if(this.eat(types$1.star)){return this.parseExportAllDeclaration(node,exports)}if(this.eat(types$1._default)){this.checkExport(exports,"default",this.lastTokStart);node.declaration=this.parseExportDefaultDeclaration();return this.finishNode(node,"ExportDefaultDeclaration")}if(this.shouldParseExportStatement()){node.declaration=this.parseExportDeclaration(node);if(node.declaration.type==="VariableDeclaration"){this.checkVariableExport(exports,node.declaration.declarations)}else{this.checkExport(exports,node.declaration.id,node.declaration.id.start)}node.specifiers=[];node.source=null}else{node.declaration=null;node.specifiers=this.parseExportSpecifiers(exports);if(this.eatContextual("from")){if(this.type!==types$1.string){this.unexpected()}node.source=this.parseExprAtom()}else{for(var i=0,list=node.specifiers;i=13&&this.type===types$1.string){var stringLiteral=this.parseLiteral(this.value);if(loneSurrogate.test(stringLiteral.value)){this.raise(stringLiteral.start,"An export name cannot include a lone surrogate.")}return stringLiteral}return this.parseIdent(true)};pp$8.adaptDirectivePrologue=function(statements){for(var i=0;i=5&&statement.type==="ExpressionStatement"&&statement.expression.type==="Literal"&&typeof statement.expression.value==="string"&&(this.input[statement.start]==='"'||this.input[statement.start]==="'")};var pp$7=Parser.prototype;pp$7.toAssignable=function(node,isBinding,refDestructuringErrors){if(this.options.ecmaVersion>=6&&node){switch(node.type){case"Identifier":if(this.inAsync&&node.name==="await"){this.raise(node.start,"Cannot use 'await' as identifier inside an async function")}break;case"ObjectPattern":case"ArrayPattern":case"AssignmentPattern":case"RestElement":break;case"ObjectExpression":node.type="ObjectPattern";if(refDestructuringErrors){this.checkPatternErrors(refDestructuringErrors,true)}for(var i=0,list=node.properties;i=8&&!containsEsc&&id.name==="async"&&!this.canInsertSemicolon()&&this.eat(types$1._function)){this.overrideContext(types.f_expr);return this.parseFunction(this.startNodeAt(startPos,startLoc),0,false,true,forInit)}if(canBeArrow&&!this.canInsertSemicolon()){if(this.eat(types$1.arrow)){return this.parseArrowExpression(this.startNodeAt(startPos,startLoc),[id],false,forInit)}if(this.options.ecmaVersion>=8&&id.name==="async"&&this.type===types$1.name&&!containsEsc&&(!this.potentialArrowInForAwait||this.value!=="of"||this.containsEsc)){id=this.parseIdent(false);if(this.canInsertSemicolon()||!this.eat(types$1.arrow)){this.unexpected()}return this.parseArrowExpression(this.startNodeAt(startPos,startLoc),[id],true,forInit)}}return id;case types$1.regexp:var value=this.value;node=this.parseLiteral(value.value);node.regex={pattern:value.pattern,flags:value.flags};return node;case types$1.num:case types$1.string:return this.parseLiteral(this.value);case types$1._null:case types$1._true:case types$1._false:node=this.startNode();node.value=this.type===types$1._null?null:this.type===types$1._true;node.raw=this.type.keyword;this.next();return this.finishNode(node,"Literal");case types$1.parenL:var start=this.start,expr=this.parseParenAndDistinguishExpression(canBeArrow,forInit);if(refDestructuringErrors){if(refDestructuringErrors.parenthesizedAssign<0&&!this.isSimpleAssignTarget(expr)){refDestructuringErrors.parenthesizedAssign=start}if(refDestructuringErrors.parenthesizedBind<0){refDestructuringErrors.parenthesizedBind=start}}return expr;case types$1.bracketL:node=this.startNode();this.next();node.elements=this.parseExprList(types$1.bracketR,true,true,refDestructuringErrors);return this.finishNode(node,"ArrayExpression");case types$1.braceL:this.overrideContext(types.b_expr);return this.parseObj(false,refDestructuringErrors);case types$1._function:node=this.startNode();this.next();return this.parseFunction(node,0);case types$1._class:return this.parseClass(this.startNode(),false);case types$1._new:return this.parseNew();case types$1.backQuote:return this.parseTemplate();case types$1._import:if(this.options.ecmaVersion>=11){return this.parseExprImport(forNew)}else{return this.unexpected()}default:return this.parseExprAtomDefault()}};pp$5.parseExprAtomDefault=function(){this.unexpected()};pp$5.parseExprImport=function(forNew){var node=this.startNode();if(this.containsEsc){this.raiseRecoverable(this.start,"Escape sequence in keyword import")}var meta=this.parseIdent(true);if(this.type===types$1.parenL&&!forNew){return this.parseDynamicImport(node)}else if(this.type===types$1.dot){node.meta=meta;return this.parseImportMeta(node)}else{this.unexpected()}};pp$5.parseDynamicImport=function(node){this.next();node.source=this.parseMaybeAssign();if(!this.eat(types$1.parenR)){var errorPos=this.start;if(this.eat(types$1.comma)&&this.eat(types$1.parenR)){this.raiseRecoverable(errorPos,"Trailing comma is not allowed in import()")}else{this.unexpected(errorPos)}}return this.finishNode(node,"ImportExpression")};pp$5.parseImportMeta=function(node){this.next();var containsEsc=this.containsEsc;node.property=this.parseIdent(true);if(node.property.name!=="meta"){this.raiseRecoverable(node.property.start,"The only valid meta property for import is 'import.meta'")}if(containsEsc){this.raiseRecoverable(node.start,"'import.meta' must not contain escaped characters")}if(this.options.sourceType!=="module"&&!this.options.allowImportExportEverywhere){this.raiseRecoverable(node.start,"Cannot use 'import.meta' outside a module")}return this.finishNode(node,"MetaProperty")};pp$5.parseLiteral=function(value){var node=this.startNode();node.value=value;node.raw=this.input.slice(this.start,this.end);if(node.raw.charCodeAt(node.raw.length-1)===110){node.bigint=node.raw.slice(0,-1).replace(/_/g,"")}this.next();return this.finishNode(node,"Literal")};pp$5.parseParenExpression=function(){this.expect(types$1.parenL);var val=this.parseExpression();this.expect(types$1.parenR);return val};pp$5.shouldParseArrow=function(exprList){return!this.canInsertSemicolon()};pp$5.parseParenAndDistinguishExpression=function(canBeArrow,forInit){var startPos=this.start,startLoc=this.startLoc,val,allowTrailingComma=this.options.ecmaVersion>=8;if(this.options.ecmaVersion>=6){this.next();var innerStartPos=this.start,innerStartLoc=this.startLoc;var exprList=[],first=true,lastIsComma=false;var refDestructuringErrors=new DestructuringErrors,oldYieldPos=this.yieldPos,oldAwaitPos=this.awaitPos,spreadStart;this.yieldPos=0;this.awaitPos=0;while(this.type!==types$1.parenR){first?first=false:this.expect(types$1.comma);if(allowTrailingComma&&this.afterTrailingComma(types$1.parenR,true)){lastIsComma=true;break}else if(this.type===types$1.ellipsis){spreadStart=this.start;exprList.push(this.parseParenItem(this.parseRestBinding()));if(this.type===types$1.comma){this.raiseRecoverable(this.start,"Comma is not permitted after the rest element")}break}else{exprList.push(this.parseMaybeAssign(false,refDestructuringErrors,this.parseParenItem))}}var innerEndPos=this.lastTokEnd,innerEndLoc=this.lastTokEndLoc;this.expect(types$1.parenR);if(canBeArrow&&this.shouldParseArrow(exprList)&&this.eat(types$1.arrow)){this.checkPatternErrors(refDestructuringErrors,false);this.checkYieldAwaitInDefaultParams();this.yieldPos=oldYieldPos;this.awaitPos=oldAwaitPos;return this.parseParenArrowList(startPos,startLoc,exprList,forInit)}if(!exprList.length||lastIsComma){this.unexpected(this.lastTokStart)}if(spreadStart){this.unexpected(spreadStart)}this.checkExpressionErrors(refDestructuringErrors,true);this.yieldPos=oldYieldPos||this.yieldPos;this.awaitPos=oldAwaitPos||this.awaitPos;if(exprList.length>1){val=this.startNodeAt(innerStartPos,innerStartLoc);val.expressions=exprList;this.finishNodeAt(val,"SequenceExpression",innerEndPos,innerEndLoc)}else{val=exprList[0]}}else{val=this.parseParenExpression()}if(this.options.preserveParens){var par=this.startNodeAt(startPos,startLoc);par.expression=val;return this.finishNode(par,"ParenthesizedExpression")}else{return val}};pp$5.parseParenItem=function(item){return item};pp$5.parseParenArrowList=function(startPos,startLoc,exprList,forInit){return this.parseArrowExpression(this.startNodeAt(startPos,startLoc),exprList,false,forInit)};var empty=[];pp$5.parseNew=function(){if(this.containsEsc){this.raiseRecoverable(this.start,"Escape sequence in keyword new")}var node=this.startNode();var meta=this.parseIdent(true);if(this.options.ecmaVersion>=6&&this.eat(types$1.dot)){node.meta=meta;var containsEsc=this.containsEsc;node.property=this.parseIdent(true);if(node.property.name!=="target"){this.raiseRecoverable(node.property.start,"The only valid meta property for new is 'new.target'")}if(containsEsc){this.raiseRecoverable(node.start,"'new.target' must not contain escaped characters")}if(!this.allowNewDotTarget){this.raiseRecoverable(node.start,"'new.target' can only be used in functions and class static block")}return this.finishNode(node,"MetaProperty")}var startPos=this.start,startLoc=this.startLoc;node.callee=this.parseSubscripts(this.parseExprAtom(null,false,true),startPos,startLoc,true,false);if(this.eat(types$1.parenL)){node.arguments=this.parseExprList(types$1.parenR,this.options.ecmaVersion>=8,false)}else{node.arguments=empty}return this.finishNode(node,"NewExpression")};pp$5.parseTemplateElement=function(ref){var isTagged=ref.isTagged;var elem=this.startNode();if(this.type===types$1.invalidTemplate){if(!isTagged){this.raiseRecoverable(this.start,"Bad escape sequence in untagged template literal")}elem.value={raw:this.value,cooked:null}}else{elem.value={raw:this.input.slice(this.start,this.end).replace(/\r\n?/g,"\n"),cooked:this.value}}this.next();elem.tail=this.type===types$1.backQuote;return this.finishNode(elem,"TemplateElement")};pp$5.parseTemplate=function(ref){if(ref===void 0)ref={};var isTagged=ref.isTagged;if(isTagged===void 0)isTagged=false;var node=this.startNode();this.next();node.expressions=[];var curElt=this.parseTemplateElement({isTagged:isTagged});node.quasis=[curElt];while(!curElt.tail){if(this.type===types$1.eof){this.raise(this.pos,"Unterminated template literal")}this.expect(types$1.dollarBraceL);node.expressions.push(this.parseExpression());this.expect(types$1.braceR);node.quasis.push(curElt=this.parseTemplateElement({isTagged:isTagged}))}this.next();return this.finishNode(node,"TemplateLiteral")};pp$5.isAsyncProp=function(prop){return!prop.computed&&prop.key.type==="Identifier"&&prop.key.name==="async"&&(this.type===types$1.name||this.type===types$1.num||this.type===types$1.string||this.type===types$1.bracketL||this.type.keyword||this.options.ecmaVersion>=9&&this.type===types$1.star)&&!lineBreak.test(this.input.slice(this.lastTokEnd,this.start))};pp$5.parseObj=function(isPattern,refDestructuringErrors){var node=this.startNode(),first=true,propHash={};node.properties=[];this.next();while(!this.eat(types$1.braceR)){if(!first){this.expect(types$1.comma);if(this.options.ecmaVersion>=5&&this.afterTrailingComma(types$1.braceR)){break}}else{first=false}var prop=this.parseProperty(isPattern,refDestructuringErrors);if(!isPattern){this.checkPropClash(prop,propHash,refDestructuringErrors)}node.properties.push(prop)}return this.finishNode(node,isPattern?"ObjectPattern":"ObjectExpression")};pp$5.parseProperty=function(isPattern,refDestructuringErrors){var prop=this.startNode(),isGenerator,isAsync,startPos,startLoc;if(this.options.ecmaVersion>=9&&this.eat(types$1.ellipsis)){if(isPattern){prop.argument=this.parseIdent(false);if(this.type===types$1.comma){this.raiseRecoverable(this.start,"Comma is not permitted after the rest element")}return this.finishNode(prop,"RestElement")}prop.argument=this.parseMaybeAssign(false,refDestructuringErrors);if(this.type===types$1.comma&&refDestructuringErrors&&refDestructuringErrors.trailingComma<0){refDestructuringErrors.trailingComma=this.start}return this.finishNode(prop,"SpreadElement")}if(this.options.ecmaVersion>=6){prop.method=false;prop.shorthand=false;if(isPattern||refDestructuringErrors){startPos=this.start;startLoc=this.startLoc}if(!isPattern){isGenerator=this.eat(types$1.star)}}var containsEsc=this.containsEsc;this.parsePropertyName(prop);if(!isPattern&&!containsEsc&&this.options.ecmaVersion>=8&&!isGenerator&&this.isAsyncProp(prop)){isAsync=true;isGenerator=this.options.ecmaVersion>=9&&this.eat(types$1.star);this.parsePropertyName(prop)}else{isAsync=false}this.parsePropertyValue(prop,isPattern,isGenerator,isAsync,startPos,startLoc,refDestructuringErrors,containsEsc);return this.finishNode(prop,"Property")};pp$5.parseGetterSetter=function(prop){prop.kind=prop.key.name;this.parsePropertyName(prop);prop.value=this.parseMethod(false);var paramCount=prop.kind==="get"?0:1;if(prop.value.params.length!==paramCount){var start=prop.value.start;if(prop.kind==="get"){this.raiseRecoverable(start,"getter should have no params")}else{this.raiseRecoverable(start,"setter should have exactly one param")}}else{if(prop.kind==="set"&&prop.value.params[0].type==="RestElement"){this.raiseRecoverable(prop.value.params[0].start,"Setter cannot use rest params")}}};pp$5.parsePropertyValue=function(prop,isPattern,isGenerator,isAsync,startPos,startLoc,refDestructuringErrors,containsEsc){if((isGenerator||isAsync)&&this.type===types$1.colon){this.unexpected()}if(this.eat(types$1.colon)){prop.value=isPattern?this.parseMaybeDefault(this.start,this.startLoc):this.parseMaybeAssign(false,refDestructuringErrors);prop.kind="init"}else if(this.options.ecmaVersion>=6&&this.type===types$1.parenL){if(isPattern){this.unexpected()}prop.kind="init";prop.method=true;prop.value=this.parseMethod(isGenerator,isAsync)}else if(!isPattern&&!containsEsc&&this.options.ecmaVersion>=5&&!prop.computed&&prop.key.type==="Identifier"&&(prop.key.name==="get"||prop.key.name==="set")&&(this.type!==types$1.comma&&this.type!==types$1.braceR&&this.type!==types$1.eq)){if(isGenerator||isAsync){this.unexpected()}this.parseGetterSetter(prop)}else if(this.options.ecmaVersion>=6&&!prop.computed&&prop.key.type==="Identifier"){if(isGenerator||isAsync){this.unexpected()}this.checkUnreserved(prop.key);if(prop.key.name==="await"&&!this.awaitIdentPos){this.awaitIdentPos=startPos}prop.kind="init";if(isPattern){prop.value=this.parseMaybeDefault(startPos,startLoc,this.copyNode(prop.key))}else if(this.type===types$1.eq&&refDestructuringErrors){if(refDestructuringErrors.shorthandAssign<0){refDestructuringErrors.shorthandAssign=this.start}prop.value=this.parseMaybeDefault(startPos,startLoc,this.copyNode(prop.key))}else{prop.value=this.copyNode(prop.key)}prop.shorthand=true}else{this.unexpected()}};pp$5.parsePropertyName=function(prop){if(this.options.ecmaVersion>=6){if(this.eat(types$1.bracketL)){prop.computed=true;prop.key=this.parseMaybeAssign();this.expect(types$1.bracketR);return prop.key}else{prop.computed=false}}return prop.key=this.type===types$1.num||this.type===types$1.string?this.parseExprAtom():this.parseIdent(this.options.allowReserved!=="never")};pp$5.initFunction=function(node){node.id=null;if(this.options.ecmaVersion>=6){node.generator=node.expression=false}if(this.options.ecmaVersion>=8){node.async=false}};pp$5.parseMethod=function(isGenerator,isAsync,allowDirectSuper){var node=this.startNode(),oldYieldPos=this.yieldPos,oldAwaitPos=this.awaitPos,oldAwaitIdentPos=this.awaitIdentPos;this.initFunction(node);if(this.options.ecmaVersion>=6){node.generator=isGenerator}if(this.options.ecmaVersion>=8){node.async=!!isAsync}this.yieldPos=0;this.awaitPos=0;this.awaitIdentPos=0;this.enterScope(functionFlags(isAsync,node.generator)|SCOPE_SUPER|(allowDirectSuper?SCOPE_DIRECT_SUPER:0));this.expect(types$1.parenL);node.params=this.parseBindingList(types$1.parenR,false,this.options.ecmaVersion>=8);this.checkYieldAwaitInDefaultParams();this.parseFunctionBody(node,false,true,false);this.yieldPos=oldYieldPos;this.awaitPos=oldAwaitPos;this.awaitIdentPos=oldAwaitIdentPos;return this.finishNode(node,"FunctionExpression")};pp$5.parseArrowExpression=function(node,params,isAsync,forInit){var oldYieldPos=this.yieldPos,oldAwaitPos=this.awaitPos,oldAwaitIdentPos=this.awaitIdentPos;this.enterScope(functionFlags(isAsync,false)|SCOPE_ARROW);this.initFunction(node);if(this.options.ecmaVersion>=8){node.async=!!isAsync}this.yieldPos=0;this.awaitPos=0;this.awaitIdentPos=0;node.params=this.toAssignableList(params,true);this.parseFunctionBody(node,true,false,forInit);this.yieldPos=oldYieldPos;this.awaitPos=oldAwaitPos;this.awaitIdentPos=oldAwaitIdentPos;return this.finishNode(node,"ArrowFunctionExpression")};pp$5.parseFunctionBody=function(node,isArrowFunction,isMethod,forInit){var isExpression=isArrowFunction&&this.type!==types$1.braceL;var oldStrict=this.strict,useStrict=false;if(isExpression){node.body=this.parseMaybeAssign(forInit);node.expression=true;this.checkParams(node,false)}else{var nonSimple=this.options.ecmaVersion>=7&&!this.isSimpleParamList(node.params);if(!oldStrict||nonSimple){useStrict=this.strictDirective(this.end);if(useStrict&&nonSimple){this.raiseRecoverable(node.start,"Illegal 'use strict' directive in function with non-simple parameter list")}}var oldLabels=this.labels;this.labels=[];if(useStrict){this.strict=true}this.checkParams(node,!oldStrict&&!useStrict&&!isArrowFunction&&!isMethod&&this.isSimpleParamList(node.params));if(this.strict&&node.id){this.checkLValSimple(node.id,BIND_OUTSIDE)}node.body=this.parseBlock(false,undefined,useStrict&&!oldStrict);node.expression=false;this.adaptDirectivePrologue(node.body.body);this.labels=oldLabels}this.exitScope()};pp$5.isSimpleParamList=function(params){for(var i=0,list=params;i-1||scope.functions.indexOf(name)>-1||scope.var.indexOf(name)>-1;scope.lexical.push(name);if(this.inModule&&scope.flags&SCOPE_TOP){delete this.undefinedExports[name]}}else if(bindingType===BIND_SIMPLE_CATCH){var scope$1=this.currentScope();scope$1.lexical.push(name)}else if(bindingType===BIND_FUNCTION){var scope$2=this.currentScope();if(this.treatFunctionsAsVar){redeclared=scope$2.lexical.indexOf(name)>-1}else{redeclared=scope$2.lexical.indexOf(name)>-1||scope$2.var.indexOf(name)>-1}scope$2.functions.push(name)}else{for(var i=this.scopeStack.length-1;i>=0;--i){var scope$3=this.scopeStack[i];if(scope$3.lexical.indexOf(name)>-1&&!(scope$3.flags&SCOPE_SIMPLE_CATCH&&scope$3.lexical[0]===name)||!this.treatFunctionsAsVarInScope(scope$3)&&scope$3.functions.indexOf(name)>-1){redeclared=true;break}scope$3.var.push(name);if(this.inModule&&scope$3.flags&SCOPE_TOP){delete this.undefinedExports[name]}if(scope$3.flags&SCOPE_VAR){break}}}if(redeclared){this.raiseRecoverable(pos,"Identifier '"+name+"' has already been declared")}};pp$3.checkLocalExport=function(id){if(this.scopeStack[0].lexical.indexOf(id.name)===-1&&this.scopeStack[0].var.indexOf(id.name)===-1){this.undefinedExports[id.name]=id}};pp$3.currentScope=function(){return this.scopeStack[this.scopeStack.length-1]};pp$3.currentVarScope=function(){for(var i=this.scopeStack.length-1;;i--){var scope=this.scopeStack[i];if(scope.flags&SCOPE_VAR){return scope}}};pp$3.currentThisScope=function(){for(var i=this.scopeStack.length-1;;i--){var scope=this.scopeStack[i];if(scope.flags&SCOPE_VAR&&!(scope.flags&SCOPE_ARROW)){return scope}}};var Node=function Node(parser,pos,loc){this.type="";this.start=pos;this.end=0;if(parser.options.locations){this.loc=new SourceLocation(parser,loc)}if(parser.options.directSourceFile){this.sourceFile=parser.options.directSourceFile}if(parser.options.ranges){this.range=[pos,0]}};var pp$2=Parser.prototype;pp$2.startNode=function(){return new Node(this,this.start,this.startLoc)};pp$2.startNodeAt=function(pos,loc){return new Node(this,pos,loc)};function finishNodeAt(node,type,pos,loc){node.type=type;node.end=pos;if(this.options.locations){node.loc.end=loc}if(this.options.ranges){node.range[1]=pos}return node}pp$2.finishNode=function(node,type){return finishNodeAt.call(this,node,type,this.lastTokEnd,this.lastTokEndLoc)};pp$2.finishNodeAt=function(node,type,pos,loc){return finishNodeAt.call(this,node,type,pos,loc)};pp$2.copyNode=function(node){var newNode=new Node(this,node.start,this.startLoc);for(var prop in node){newNode[prop]=node[prop]}return newNode};var ecma9BinaryProperties="ASCII ASCII_Hex_Digit AHex Alphabetic Alpha Any Assigned Bidi_Control Bidi_C Bidi_Mirrored Bidi_M Case_Ignorable CI Cased Changes_When_Casefolded CWCF Changes_When_Casemapped CWCM Changes_When_Lowercased CWL Changes_When_NFKC_Casefolded CWKCF Changes_When_Titlecased CWT Changes_When_Uppercased CWU Dash Default_Ignorable_Code_Point DI Deprecated Dep Diacritic Dia Emoji Emoji_Component Emoji_Modifier Emoji_Modifier_Base Emoji_Presentation Extender Ext Grapheme_Base Gr_Base Grapheme_Extend Gr_Ext Hex_Digit Hex IDS_Binary_Operator IDSB IDS_Trinary_Operator IDST ID_Continue IDC ID_Start IDS Ideographic Ideo Join_Control Join_C Logical_Order_Exception LOE Lowercase Lower Math Noncharacter_Code_Point NChar Pattern_Syntax Pat_Syn Pattern_White_Space Pat_WS Quotation_Mark QMark Radical Regional_Indicator RI Sentence_Terminal STerm Soft_Dotted SD Terminal_Punctuation Term Unified_Ideograph UIdeo Uppercase Upper Variation_Selector VS White_Space space XID_Continue XIDC XID_Start XIDS";var ecma10BinaryProperties=ecma9BinaryProperties+" Extended_Pictographic";var ecma11BinaryProperties=ecma10BinaryProperties;var ecma12BinaryProperties=ecma11BinaryProperties+" EBase EComp EMod EPres ExtPict";var ecma13BinaryProperties=ecma12BinaryProperties;var ecma14BinaryProperties=ecma13BinaryProperties;var unicodeBinaryProperties={9:ecma9BinaryProperties,10:ecma10BinaryProperties,11:ecma11BinaryProperties,12:ecma12BinaryProperties,13:ecma13BinaryProperties,14:ecma14BinaryProperties};var ecma14BinaryPropertiesOfStrings="Basic_Emoji Emoji_Keycap_Sequence RGI_Emoji_Modifier_Sequence RGI_Emoji_Flag_Sequence RGI_Emoji_Tag_Sequence RGI_Emoji_ZWJ_Sequence RGI_Emoji";var unicodeBinaryPropertiesOfStrings={9:"",10:"",11:"",12:"",13:"",14:ecma14BinaryPropertiesOfStrings};var unicodeGeneralCategoryValues="Cased_Letter LC Close_Punctuation Pe Connector_Punctuation Pc Control Cc cntrl Currency_Symbol Sc Dash_Punctuation Pd Decimal_Number Nd digit Enclosing_Mark Me Final_Punctuation Pf Format Cf Initial_Punctuation Pi Letter L Letter_Number Nl Line_Separator Zl Lowercase_Letter Ll Mark M Combining_Mark Math_Symbol Sm Modifier_Letter Lm Modifier_Symbol Sk Nonspacing_Mark Mn Number N Open_Punctuation Ps Other C Other_Letter Lo Other_Number No Other_Punctuation Po Other_Symbol So Paragraph_Separator Zp Private_Use Co Punctuation P punct Separator Z Space_Separator Zs Spacing_Mark Mc Surrogate Cs Symbol S Titlecase_Letter Lt Unassigned Cn Uppercase_Letter Lu";var ecma9ScriptValues="Adlam Adlm Ahom Anatolian_Hieroglyphs Hluw Arabic Arab Armenian Armn Avestan Avst Balinese Bali Bamum Bamu Bassa_Vah Bass Batak Batk Bengali Beng Bhaiksuki Bhks Bopomofo Bopo Brahmi Brah Braille Brai Buginese Bugi Buhid Buhd Canadian_Aboriginal Cans Carian Cari Caucasian_Albanian Aghb Chakma Cakm Cham Cham Cherokee Cher Common Zyyy Coptic Copt Qaac Cuneiform Xsux Cypriot Cprt Cyrillic Cyrl Deseret Dsrt Devanagari Deva Duployan Dupl Egyptian_Hieroglyphs Egyp Elbasan Elba Ethiopic Ethi Georgian Geor Glagolitic Glag Gothic Goth Grantha Gran Greek Grek Gujarati Gujr Gurmukhi Guru Han Hani Hangul Hang Hanunoo Hano Hatran Hatr Hebrew Hebr Hiragana Hira Imperial_Aramaic Armi Inherited Zinh Qaai Inscriptional_Pahlavi Phli Inscriptional_Parthian Prti Javanese Java Kaithi Kthi Kannada Knda Katakana Kana Kayah_Li Kali Kharoshthi Khar Khmer Khmr Khojki Khoj Khudawadi Sind Lao Laoo Latin Latn Lepcha Lepc Limbu Limb Linear_A Lina Linear_B Linb Lisu Lisu Lycian Lyci Lydian Lydi Mahajani Mahj Malayalam Mlym Mandaic Mand Manichaean Mani Marchen Marc Masaram_Gondi Gonm Meetei_Mayek Mtei Mende_Kikakui Mend Meroitic_Cursive Merc Meroitic_Hieroglyphs Mero Miao Plrd Modi Mongolian Mong Mro Mroo Multani Mult Myanmar Mymr Nabataean Nbat New_Tai_Lue Talu Newa Newa Nko Nkoo Nushu Nshu Ogham Ogam Ol_Chiki Olck Old_Hungarian Hung Old_Italic Ital Old_North_Arabian Narb Old_Permic Perm Old_Persian Xpeo Old_South_Arabian Sarb Old_Turkic Orkh Oriya Orya Osage Osge Osmanya Osma Pahawh_Hmong Hmng Palmyrene Palm Pau_Cin_Hau Pauc Phags_Pa Phag Phoenician Phnx Psalter_Pahlavi Phlp Rejang Rjng Runic Runr Samaritan Samr Saurashtra Saur Sharada Shrd Shavian Shaw Siddham Sidd SignWriting Sgnw Sinhala Sinh Sora_Sompeng Sora Soyombo Soyo Sundanese Sund Syloti_Nagri Sylo Syriac Syrc Tagalog Tglg Tagbanwa Tagb Tai_Le Tale Tai_Tham Lana Tai_Viet Tavt Takri Takr Tamil Taml Tangut Tang Telugu Telu Thaana Thaa Thai Thai Tibetan Tibt Tifinagh Tfng Tirhuta Tirh Ugaritic Ugar Vai Vaii Warang_Citi Wara Yi Yiii Zanabazar_Square Zanb";var ecma10ScriptValues=ecma9ScriptValues+" Dogra Dogr Gunjala_Gondi Gong Hanifi_Rohingya Rohg Makasar Maka Medefaidrin Medf Old_Sogdian Sogo Sogdian Sogd";var ecma11ScriptValues=ecma10ScriptValues+" Elymaic Elym Nandinagari Nand Nyiakeng_Puachue_Hmong Hmnp Wancho Wcho";var ecma12ScriptValues=ecma11ScriptValues+" Chorasmian Chrs Diak Dives_Akuru Khitan_Small_Script Kits Yezi Yezidi";var ecma13ScriptValues=ecma12ScriptValues+" Cypro_Minoan Cpmn Old_Uyghur Ougr Tangsa Tnsa Toto Vithkuqi Vith";var ecma14ScriptValues=ecma13ScriptValues+" Hrkt Katakana_Or_Hiragana Kawi Nag_Mundari Nagm Unknown Zzzz";var unicodeScriptValues={9:ecma9ScriptValues,10:ecma10ScriptValues,11:ecma11ScriptValues,12:ecma12ScriptValues,13:ecma13ScriptValues,14:ecma14ScriptValues};var data={};function buildUnicodeData(ecmaVersion){var d=data[ecmaVersion]={binary:wordsRegexp(unicodeBinaryProperties[ecmaVersion]+" "+unicodeGeneralCategoryValues),binaryOfStrings:wordsRegexp(unicodeBinaryPropertiesOfStrings[ecmaVersion]),nonBinary:{General_Category:wordsRegexp(unicodeGeneralCategoryValues),Script:wordsRegexp(unicodeScriptValues[ecmaVersion])}};d.nonBinary.Script_Extensions=d.nonBinary.Script;d.nonBinary.gc=d.nonBinary.General_Category;d.nonBinary.sc=d.nonBinary.Script;d.nonBinary.scx=d.nonBinary.Script_Extensions}for(var i=0,list=[9,10,11,12,13,14];i=6?"uy":"")+(parser.options.ecmaVersion>=9?"s":"")+(parser.options.ecmaVersion>=13?"d":"")+(parser.options.ecmaVersion>=15?"v":"");this.unicodeProperties=data[parser.options.ecmaVersion>=14?14:parser.options.ecmaVersion];this.source="";this.flags="";this.start=0;this.switchU=false;this.switchV=false;this.switchN=false;this.pos=0;this.lastIntValue=0;this.lastStringValue="";this.lastAssertionIsQuantifiable=false;this.numCapturingParens=0;this.maxBackReference=0;this.groupNames=[];this.backReferenceNames=[]};RegExpValidationState.prototype.reset=function reset(start,pattern,flags){var unicodeSets=flags.indexOf("v")!==-1;var unicode=flags.indexOf("u")!==-1;this.start=start|0;this.source=pattern+"";this.flags=flags;if(unicodeSets&&this.parser.options.ecmaVersion>=15){this.switchU=true;this.switchV=true;this.switchN=true}else{this.switchU=unicode&&this.parser.options.ecmaVersion>=6;this.switchV=false;this.switchN=unicode&&this.parser.options.ecmaVersion>=9}};RegExpValidationState.prototype.raise=function raise(message){this.parser.raiseRecoverable(this.start,"Invalid regular expression: /"+this.source+"/: "+message)};RegExpValidationState.prototype.at=function at(i,forceU){if(forceU===void 0)forceU=false;var s=this.source;var l=s.length;if(i>=l){return-1}var c=s.charCodeAt(i);if(!(forceU||this.switchU)||c<=55295||c>=57344||i+1>=l){return c}var next=s.charCodeAt(i+1);return next>=56320&&next<=57343?(c<<10)+next-56613888:c};RegExpValidationState.prototype.nextIndex=function nextIndex(i,forceU){if(forceU===void 0)forceU=false;var s=this.source;var l=s.length;if(i>=l){return l}var c=s.charCodeAt(i),next;if(!(forceU||this.switchU)||c<=55295||c>=57344||i+1>=l||(next=s.charCodeAt(i+1))<56320||next>57343){return i+1}return i+2};RegExpValidationState.prototype.current=function current(forceU){if(forceU===void 0)forceU=false;return this.at(this.pos,forceU)};RegExpValidationState.prototype.lookahead=function lookahead(forceU){if(forceU===void 0)forceU=false;return this.at(this.nextIndex(this.pos,forceU),forceU)};RegExpValidationState.prototype.advance=function advance(forceU){if(forceU===void 0)forceU=false;this.pos=this.nextIndex(this.pos,forceU)};RegExpValidationState.prototype.eat=function eat(ch,forceU){if(forceU===void 0)forceU=false;if(this.current(forceU)===ch){this.advance(forceU);return true}return false};RegExpValidationState.prototype.eatChars=function eatChars(chs,forceU){if(forceU===void 0)forceU=false;var pos=this.pos;for(var i=0,list=chs;i-1){this.raise(state.start,"Duplicate regular expression flag")}if(flag==="u"){u=true}if(flag==="v"){v=true}}if(this.options.ecmaVersion>=15&&u&&v){this.raise(state.start,"Invalid regular expression flag")}};pp$1.validateRegExpPattern=function(state){this.regexp_pattern(state);if(!state.switchN&&this.options.ecmaVersion>=9&&state.groupNames.length>0){state.switchN=true;this.regexp_pattern(state)}};pp$1.regexp_pattern=function(state){state.pos=0;state.lastIntValue=0;state.lastStringValue="";state.lastAssertionIsQuantifiable=false;state.numCapturingParens=0;state.maxBackReference=0;state.groupNames.length=0;state.backReferenceNames.length=0;this.regexp_disjunction(state);if(state.pos!==state.source.length){if(state.eat(41)){state.raise("Unmatched ')'")}if(state.eat(93)||state.eat(125)){state.raise("Lone quantifier brackets")}}if(state.maxBackReference>state.numCapturingParens){state.raise("Invalid escape")}for(var i=0,list=state.backReferenceNames;i=9){lookbehind=state.eat(60)}if(state.eat(61)||state.eat(33)){this.regexp_disjunction(state);if(!state.eat(41)){state.raise("Unterminated group")}state.lastAssertionIsQuantifiable=!lookbehind;return true}}state.pos=start;return false};pp$1.regexp_eatQuantifier=function(state,noError){if(noError===void 0)noError=false;if(this.regexp_eatQuantifierPrefix(state,noError)){state.eat(63);return true}return false};pp$1.regexp_eatQuantifierPrefix=function(state,noError){return state.eat(42)||state.eat(43)||state.eat(63)||this.regexp_eatBracedQuantifier(state,noError)};pp$1.regexp_eatBracedQuantifier=function(state,noError){var start=state.pos;if(state.eat(123)){var min=0,max=-1;if(this.regexp_eatDecimalDigits(state)){min=state.lastIntValue;if(state.eat(44)&&this.regexp_eatDecimalDigits(state)){max=state.lastIntValue}if(state.eat(125)){if(max!==-1&&max=9){this.regexp_groupSpecifier(state)}else if(state.current()===63){state.raise("Invalid group")}this.regexp_disjunction(state);if(state.eat(41)){state.numCapturingParens+=1;return true}state.raise("Unterminated group")}return false};pp$1.regexp_eatExtendedAtom=function(state){return state.eat(46)||this.regexp_eatReverseSolidusAtomEscape(state)||this.regexp_eatCharacterClass(state)||this.regexp_eatUncapturingGroup(state)||this.regexp_eatCapturingGroup(state)||this.regexp_eatInvalidBracedQuantifier(state)||this.regexp_eatExtendedPatternCharacter(state)};pp$1.regexp_eatInvalidBracedQuantifier=function(state){if(this.regexp_eatBracedQuantifier(state,true)){state.raise("Nothing to repeat")}return false};pp$1.regexp_eatSyntaxCharacter=function(state){var ch=state.current();if(isSyntaxCharacter(ch)){state.lastIntValue=ch;state.advance();return true}return false};function isSyntaxCharacter(ch){return ch===36||ch>=40&&ch<=43||ch===46||ch===63||ch>=91&&ch<=94||ch>=123&&ch<=125}pp$1.regexp_eatPatternCharacters=function(state){var start=state.pos;var ch=0;while((ch=state.current())!==-1&&!isSyntaxCharacter(ch)){state.advance()}return state.pos!==start};pp$1.regexp_eatExtendedPatternCharacter=function(state){var ch=state.current();if(ch!==-1&&ch!==36&&!(ch>=40&&ch<=43)&&ch!==46&&ch!==63&&ch!==91&&ch!==94&&ch!==124){state.advance();return true}return false};pp$1.regexp_groupSpecifier=function(state){if(state.eat(63)){if(this.regexp_eatGroupName(state)){if(state.groupNames.indexOf(state.lastStringValue)!==-1){state.raise("Duplicate capture group name")}state.groupNames.push(state.lastStringValue);return}state.raise("Invalid group")}};pp$1.regexp_eatGroupName=function(state){state.lastStringValue="";if(state.eat(60)){if(this.regexp_eatRegExpIdentifierName(state)&&state.eat(62)){return true}state.raise("Invalid capture group name")}return false};pp$1.regexp_eatRegExpIdentifierName=function(state){state.lastStringValue="";if(this.regexp_eatRegExpIdentifierStart(state)){state.lastStringValue+=codePointToString(state.lastIntValue);while(this.regexp_eatRegExpIdentifierPart(state)){state.lastStringValue+=codePointToString(state.lastIntValue)}return true}return false};pp$1.regexp_eatRegExpIdentifierStart=function(state){var start=state.pos;var forceU=this.options.ecmaVersion>=11;var ch=state.current(forceU);state.advance(forceU);if(ch===92&&this.regexp_eatRegExpUnicodeEscapeSequence(state,forceU)){ch=state.lastIntValue}if(isRegExpIdentifierStart(ch)){state.lastIntValue=ch;return true}state.pos=start;return false};function isRegExpIdentifierStart(ch){return isIdentifierStart(ch,true)||ch===36||ch===95}pp$1.regexp_eatRegExpIdentifierPart=function(state){var start=state.pos;var forceU=this.options.ecmaVersion>=11;var ch=state.current(forceU);state.advance(forceU);if(ch===92&&this.regexp_eatRegExpUnicodeEscapeSequence(state,forceU)){ch=state.lastIntValue}if(isRegExpIdentifierPart(ch)){state.lastIntValue=ch;return true}state.pos=start;return false};function isRegExpIdentifierPart(ch){return isIdentifierChar(ch,true)||ch===36||ch===95||ch===8204||ch===8205}pp$1.regexp_eatAtomEscape=function(state){if(this.regexp_eatBackReference(state)||this.regexp_eatCharacterClassEscape(state)||this.regexp_eatCharacterEscape(state)||state.switchN&&this.regexp_eatKGroupName(state)){return true}if(state.switchU){if(state.current()===99){state.raise("Invalid unicode escape")}state.raise("Invalid escape")}return false};pp$1.regexp_eatBackReference=function(state){var start=state.pos;if(this.regexp_eatDecimalEscape(state)){var n=state.lastIntValue;if(state.switchU){if(n>state.maxBackReference){state.maxBackReference=n}return true}if(n<=state.numCapturingParens){return true}state.pos=start}return false};pp$1.regexp_eatKGroupName=function(state){if(state.eat(107)){if(this.regexp_eatGroupName(state)){state.backReferenceNames.push(state.lastStringValue);return true}state.raise("Invalid named reference")}return false};pp$1.regexp_eatCharacterEscape=function(state){return this.regexp_eatControlEscape(state)||this.regexp_eatCControlLetter(state)||this.regexp_eatZero(state)||this.regexp_eatHexEscapeSequence(state)||this.regexp_eatRegExpUnicodeEscapeSequence(state,false)||!state.switchU&&this.regexp_eatLegacyOctalEscapeSequence(state)||this.regexp_eatIdentityEscape(state)};pp$1.regexp_eatCControlLetter=function(state){var start=state.pos;if(state.eat(99)){if(this.regexp_eatControlLetter(state)){return true}state.pos=start}return false};pp$1.regexp_eatZero=function(state){if(state.current()===48&&!isDecimalDigit(state.lookahead())){state.lastIntValue=0;state.advance();return true}return false};pp$1.regexp_eatControlEscape=function(state){var ch=state.current();if(ch===116){state.lastIntValue=9;state.advance();return true}if(ch===110){state.lastIntValue=10;state.advance();return true}if(ch===118){state.lastIntValue=11;state.advance();return true}if(ch===102){state.lastIntValue=12;state.advance();return true}if(ch===114){state.lastIntValue=13;state.advance();return true}return false};pp$1.regexp_eatControlLetter=function(state){var ch=state.current();if(isControlLetter(ch)){state.lastIntValue=ch%32;state.advance();return true}return false};function isControlLetter(ch){return ch>=65&&ch<=90||ch>=97&&ch<=122}pp$1.regexp_eatRegExpUnicodeEscapeSequence=function(state,forceU){if(forceU===void 0)forceU=false;var start=state.pos;var switchU=forceU||state.switchU;if(state.eat(117)){if(this.regexp_eatFixedHexDigits(state,4)){var lead=state.lastIntValue;if(switchU&&lead>=55296&&lead<=56319){var leadSurrogateEnd=state.pos;if(state.eat(92)&&state.eat(117)&&this.regexp_eatFixedHexDigits(state,4)){var trail=state.lastIntValue;if(trail>=56320&&trail<=57343){state.lastIntValue=(lead-55296)*1024+(trail-56320)+65536;return true}}state.pos=leadSurrogateEnd;state.lastIntValue=lead}return true}if(switchU&&state.eat(123)&&this.regexp_eatHexDigits(state)&&state.eat(125)&&isValidUnicode(state.lastIntValue)){return true}if(switchU){state.raise("Invalid unicode escape")}state.pos=start}return false};function isValidUnicode(ch){return ch>=0&&ch<=1114111}pp$1.regexp_eatIdentityEscape=function(state){if(state.switchU){if(this.regexp_eatSyntaxCharacter(state)){return true}if(state.eat(47)){state.lastIntValue=47;return true}return false}var ch=state.current();if(ch!==99&&(!state.switchN||ch!==107)){state.lastIntValue=ch;state.advance();return true}return false};pp$1.regexp_eatDecimalEscape=function(state){state.lastIntValue=0;var ch=state.current();if(ch>=49&&ch<=57){do{state.lastIntValue=10*state.lastIntValue+(ch-48);state.advance()}while((ch=state.current())>=48&&ch<=57);return true}return false};var CharSetNone=0;var CharSetOk=1;var CharSetString=2;pp$1.regexp_eatCharacterClassEscape=function(state){var ch=state.current();if(isCharacterClassEscape(ch)){state.lastIntValue=-1;state.advance();return CharSetOk}var negate=false;if(state.switchU&&this.options.ecmaVersion>=9&&((negate=ch===80)||ch===112)){state.lastIntValue=-1;state.advance();var result;if(state.eat(123)&&(result=this.regexp_eatUnicodePropertyValueExpression(state))&&state.eat(125)){if(negate&&result===CharSetString){state.raise("Invalid property name")}return result}state.raise("Invalid property name")}return CharSetNone};function isCharacterClassEscape(ch){return ch===100||ch===68||ch===115||ch===83||ch===119||ch===87}pp$1.regexp_eatUnicodePropertyValueExpression=function(state){var start=state.pos;if(this.regexp_eatUnicodePropertyName(state)&&state.eat(61)){var name=state.lastStringValue;if(this.regexp_eatUnicodePropertyValue(state)){var value=state.lastStringValue;this.regexp_validateUnicodePropertyNameAndValue(state,name,value);return CharSetOk}}state.pos=start;if(this.regexp_eatLoneUnicodePropertyNameOrValue(state)){var nameOrValue=state.lastStringValue;return this.regexp_validateUnicodePropertyNameOrValue(state,nameOrValue)}return CharSetNone};pp$1.regexp_validateUnicodePropertyNameAndValue=function(state,name,value){if(!hasOwn(state.unicodeProperties.nonBinary,name)){state.raise("Invalid property name")}if(!state.unicodeProperties.nonBinary[name].test(value)){state.raise("Invalid property value")}};pp$1.regexp_validateUnicodePropertyNameOrValue=function(state,nameOrValue){if(state.unicodeProperties.binary.test(nameOrValue)){return CharSetOk}if(state.switchV&&state.unicodeProperties.binaryOfStrings.test(nameOrValue)){return CharSetString}state.raise("Invalid property name")};pp$1.regexp_eatUnicodePropertyName=function(state){var ch=0;state.lastStringValue="";while(isUnicodePropertyNameCharacter(ch=state.current())){state.lastStringValue+=codePointToString(ch);state.advance()}return state.lastStringValue!==""};function isUnicodePropertyNameCharacter(ch){return isControlLetter(ch)||ch===95}pp$1.regexp_eatUnicodePropertyValue=function(state){var ch=0;state.lastStringValue="";while(isUnicodePropertyValueCharacter(ch=state.current())){state.lastStringValue+=codePointToString(ch);state.advance()}return state.lastStringValue!==""};function isUnicodePropertyValueCharacter(ch){return isUnicodePropertyNameCharacter(ch)||isDecimalDigit(ch)}pp$1.regexp_eatLoneUnicodePropertyNameOrValue=function(state){return this.regexp_eatUnicodePropertyValue(state)};pp$1.regexp_eatCharacterClass=function(state){if(state.eat(91)){var negate=state.eat(94);var result=this.regexp_classContents(state);if(!state.eat(93)){state.raise("Unterminated character class")}if(negate&&result===CharSetString){state.raise("Negated character class may contain strings")}return true}return false};pp$1.regexp_classContents=function(state){if(state.current()===93){return CharSetOk}if(state.switchV){return this.regexp_classSetExpression(state)}this.regexp_nonEmptyClassRanges(state);return CharSetOk};pp$1.regexp_nonEmptyClassRanges=function(state){while(this.regexp_eatClassAtom(state)){var left=state.lastIntValue;if(state.eat(45)&&this.regexp_eatClassAtom(state)){var right=state.lastIntValue;if(state.switchU&&(left===-1||right===-1)){state.raise("Invalid character class")}if(left!==-1&&right!==-1&&left>right){state.raise("Range out of order in character class")}}}};pp$1.regexp_eatClassAtom=function(state){var start=state.pos;if(state.eat(92)){if(this.regexp_eatClassEscape(state)){return true}if(state.switchU){var ch$1=state.current();if(ch$1===99||isOctalDigit(ch$1)){state.raise("Invalid class escape")}state.raise("Invalid escape")}state.pos=start}var ch=state.current();if(ch!==93){state.lastIntValue=ch;state.advance();return true}return false};pp$1.regexp_eatClassEscape=function(state){var start=state.pos;if(state.eat(98)){state.lastIntValue=8;return true}if(state.switchU&&state.eat(45)){state.lastIntValue=45;return true}if(!state.switchU&&state.eat(99)){if(this.regexp_eatClassControlLetter(state)){return true}state.pos=start}return this.regexp_eatCharacterClassEscape(state)||this.regexp_eatCharacterEscape(state)};pp$1.regexp_classSetExpression=function(state){var result=CharSetOk,subResult;if(this.regexp_eatClassSetRange(state));else if(subResult=this.regexp_eatClassSetOperand(state)){if(subResult===CharSetString){result=CharSetString}var start=state.pos;while(state.eatChars([38,38])){if(state.current()!==38&&(subResult=this.regexp_eatClassSetOperand(state))){if(subResult!==CharSetString){result=CharSetOk}continue}state.raise("Invalid character in character class")}if(start!==state.pos){return result}while(state.eatChars([45,45])){if(this.regexp_eatClassSetOperand(state)){continue}state.raise("Invalid character in character class")}if(start!==state.pos){return result}}else{state.raise("Invalid character in character class")}for(;;){if(this.regexp_eatClassSetRange(state)){continue}subResult=this.regexp_eatClassSetOperand(state);if(!subResult){return result}if(subResult===CharSetString){result=CharSetString}}};pp$1.regexp_eatClassSetRange=function(state){var start=state.pos;if(this.regexp_eatClassSetCharacter(state)){var left=state.lastIntValue;if(state.eat(45)&&this.regexp_eatClassSetCharacter(state)){var right=state.lastIntValue;if(left!==-1&&right!==-1&&left>right){state.raise("Range out of order in character class")}return true}state.pos=start}return false};pp$1.regexp_eatClassSetOperand=function(state){if(this.regexp_eatClassSetCharacter(state)){return CharSetOk}return this.regexp_eatClassStringDisjunction(state)||this.regexp_eatNestedClass(state)};pp$1.regexp_eatNestedClass=function(state){var start=state.pos;if(state.eat(91)){var negate=state.eat(94);var result=this.regexp_classContents(state);if(state.eat(93)){if(negate&&result===CharSetString){state.raise("Negated character class may contain strings")}return result}state.pos=start}if(state.eat(92)){var result$1=this.regexp_eatCharacterClassEscape(state);if(result$1){return result$1}state.pos=start}return null};pp$1.regexp_eatClassStringDisjunction=function(state){var start=state.pos;if(state.eatChars([92,113])){if(state.eat(123)){var result=this.regexp_classStringDisjunctionContents(state);if(state.eat(125)){return result}}else{state.raise("Invalid escape")}state.pos=start}return null};pp$1.regexp_classStringDisjunctionContents=function(state){var result=this.regexp_classString(state);while(state.eat(124)){if(this.regexp_classString(state)===CharSetString){result=CharSetString}}return result};pp$1.regexp_classString=function(state){var count=0;while(this.regexp_eatClassSetCharacter(state)){count++}return count===1?CharSetOk:CharSetString};pp$1.regexp_eatClassSetCharacter=function(state){var start=state.pos;if(state.eat(92)){if(this.regexp_eatCharacterEscape(state)||this.regexp_eatClassSetReservedPunctuator(state)){return true}if(state.eat(98)){state.lastIntValue=8;return true}state.pos=start;return false}var ch=state.current();if(ch<0||ch===state.lookahead()&&isClassSetReservedDoublePunctuatorCharacter(ch)){return false}if(isClassSetSyntaxCharacter(ch)){return false}state.advance();state.lastIntValue=ch;return true};function isClassSetReservedDoublePunctuatorCharacter(ch){return ch===33||ch>=35&&ch<=38||ch>=42&&ch<=44||ch===46||ch>=58&&ch<=64||ch===94||ch===96||ch===126}function isClassSetSyntaxCharacter(ch){return ch===40||ch===41||ch===45||ch===47||ch>=91&&ch<=93||ch>=123&&ch<=125}pp$1.regexp_eatClassSetReservedPunctuator=function(state){var ch=state.current();if(isClassSetReservedPunctuator(ch)){state.lastIntValue=ch;state.advance();return true}return false};function isClassSetReservedPunctuator(ch){return ch===33||ch===35||ch===37||ch===38||ch===44||ch===45||ch>=58&&ch<=62||ch===64||ch===96||ch===126}pp$1.regexp_eatClassControlLetter=function(state){var ch=state.current();if(isDecimalDigit(ch)||ch===95){state.lastIntValue=ch%32;state.advance();return true}return false};pp$1.regexp_eatHexEscapeSequence=function(state){var start=state.pos;if(state.eat(120)){if(this.regexp_eatFixedHexDigits(state,2)){return true}if(state.switchU){state.raise("Invalid escape")}state.pos=start}return false};pp$1.regexp_eatDecimalDigits=function(state){var start=state.pos;var ch=0;state.lastIntValue=0;while(isDecimalDigit(ch=state.current())){state.lastIntValue=10*state.lastIntValue+(ch-48);state.advance()}return state.pos!==start};function isDecimalDigit(ch){return ch>=48&&ch<=57}pp$1.regexp_eatHexDigits=function(state){var start=state.pos;var ch=0;state.lastIntValue=0;while(isHexDigit(ch=state.current())){state.lastIntValue=16*state.lastIntValue+hexToInt(ch);state.advance()}return state.pos!==start};function isHexDigit(ch){return ch>=48&&ch<=57||ch>=65&&ch<=70||ch>=97&&ch<=102}function hexToInt(ch){if(ch>=65&&ch<=70){return 10+(ch-65)}if(ch>=97&&ch<=102){return 10+(ch-97)}return ch-48}pp$1.regexp_eatLegacyOctalEscapeSequence=function(state){if(this.regexp_eatOctalDigit(state)){var n1=state.lastIntValue;if(this.regexp_eatOctalDigit(state)){var n2=state.lastIntValue;if(n1<=3&&this.regexp_eatOctalDigit(state)){state.lastIntValue=n1*64+n2*8+state.lastIntValue}else{state.lastIntValue=n1*8+n2}}else{state.lastIntValue=n1}return true}return false};pp$1.regexp_eatOctalDigit=function(state){var ch=state.current();if(isOctalDigit(ch)){state.lastIntValue=ch-48;state.advance();return true}state.lastIntValue=0;return false};function isOctalDigit(ch){return ch>=48&&ch<=55}pp$1.regexp_eatFixedHexDigits=function(state,length){var start=state.pos;state.lastIntValue=0;for(var i=0;i=this.input.length){return this.finishToken(types$1.eof)}if(curContext.override){return curContext.override(this)}else{this.readToken(this.fullCharCodeAtPos())}};pp.readToken=function(code){if(isIdentifierStart(code,this.options.ecmaVersion>=6)||code===92){return this.readWord()}return this.getTokenFromCode(code)};pp.fullCharCodeAtPos=function(){var code=this.input.charCodeAt(this.pos);if(code<=55295||code>=56320){return code}var next=this.input.charCodeAt(this.pos+1);return next<=56319||next>=57344?code:(code<<10)+next-56613888};pp.skipBlockComment=function(){var startLoc=this.options.onComment&&this.curPosition();var start=this.pos,end=this.input.indexOf("*/",this.pos+=2);if(end===-1){this.raise(this.pos-2,"Unterminated comment")}this.pos=end+2;if(this.options.locations){for(var nextBreak=void 0,pos=start;(nextBreak=nextLineBreak(this.input,pos,this.pos))>-1;){++this.curLine;pos=this.lineStart=nextBreak}}if(this.options.onComment){this.options.onComment(true,this.input.slice(start+2,end),start,this.pos,startLoc,this.curPosition())}};pp.skipLineComment=function(startSkip){var start=this.pos;var startLoc=this.options.onComment&&this.curPosition();var ch=this.input.charCodeAt(this.pos+=startSkip);while(this.pos8&&ch<14||ch>=5760&&nonASCIIwhitespace.test(String.fromCharCode(ch))){++this.pos}else{break loop}}}};pp.finishToken=function(type,val){this.end=this.pos;if(this.options.locations){this.endLoc=this.curPosition()}var prevType=this.type;this.type=type;this.value=val;this.updateContext(prevType)};pp.readToken_dot=function(){var next=this.input.charCodeAt(this.pos+1);if(next>=48&&next<=57){return this.readNumber(true)}var next2=this.input.charCodeAt(this.pos+2);if(this.options.ecmaVersion>=6&&next===46&&next2===46){this.pos+=3;return this.finishToken(types$1.ellipsis)}else{++this.pos;return this.finishToken(types$1.dot)}};pp.readToken_slash=function(){var next=this.input.charCodeAt(this.pos+1);if(this.exprAllowed){++this.pos;return this.readRegexp()}if(next===61){return this.finishOp(types$1.assign,2)}return this.finishOp(types$1.slash,1)};pp.readToken_mult_modulo_exp=function(code){var next=this.input.charCodeAt(this.pos+1);var size=1;var tokentype=code===42?types$1.star:types$1.modulo;if(this.options.ecmaVersion>=7&&code===42&&next===42){++size;tokentype=types$1.starstar;next=this.input.charCodeAt(this.pos+2)}if(next===61){return this.finishOp(types$1.assign,size+1)}return this.finishOp(tokentype,size)};pp.readToken_pipe_amp=function(code){var next=this.input.charCodeAt(this.pos+1);if(next===code){if(this.options.ecmaVersion>=12){var next2=this.input.charCodeAt(this.pos+2);if(next2===61){return this.finishOp(types$1.assign,3)}}return this.finishOp(code===124?types$1.logicalOR:types$1.logicalAND,2)}if(next===61){return this.finishOp(types$1.assign,2)}return this.finishOp(code===124?types$1.bitwiseOR:types$1.bitwiseAND,1)};pp.readToken_caret=function(){var next=this.input.charCodeAt(this.pos+1);if(next===61){return this.finishOp(types$1.assign,2)}return this.finishOp(types$1.bitwiseXOR,1)};pp.readToken_plus_min=function(code){var next=this.input.charCodeAt(this.pos+1);if(next===code){if(next===45&&!this.inModule&&this.input.charCodeAt(this.pos+2)===62&&(this.lastTokEnd===0||lineBreak.test(this.input.slice(this.lastTokEnd,this.pos)))){this.skipLineComment(3);this.skipSpace();return this.nextToken()}return this.finishOp(types$1.incDec,2)}if(next===61){return this.finishOp(types$1.assign,2)}return this.finishOp(types$1.plusMin,1)};pp.readToken_lt_gt=function(code){var next=this.input.charCodeAt(this.pos+1);var size=1;if(next===code){size=code===62&&this.input.charCodeAt(this.pos+2)===62?3:2;if(this.input.charCodeAt(this.pos+size)===61){return this.finishOp(types$1.assign,size+1)}return this.finishOp(types$1.bitShift,size)}if(next===33&&code===60&&!this.inModule&&this.input.charCodeAt(this.pos+2)===45&&this.input.charCodeAt(this.pos+3)===45){this.skipLineComment(4);this.skipSpace();return this.nextToken()}if(next===61){size=2}return this.finishOp(types$1.relational,size)};pp.readToken_eq_excl=function(code){var next=this.input.charCodeAt(this.pos+1);if(next===61){return this.finishOp(types$1.equality,this.input.charCodeAt(this.pos+2)===61?3:2)}if(code===61&&next===62&&this.options.ecmaVersion>=6){this.pos+=2;return this.finishToken(types$1.arrow)}return this.finishOp(code===61?types$1.eq:types$1.prefix,1)};pp.readToken_question=function(){var ecmaVersion=this.options.ecmaVersion;if(ecmaVersion>=11){var next=this.input.charCodeAt(this.pos+1);if(next===46){var next2=this.input.charCodeAt(this.pos+2);if(next2<48||next2>57){return this.finishOp(types$1.questionDot,2)}}if(next===63){if(ecmaVersion>=12){var next2$1=this.input.charCodeAt(this.pos+2);if(next2$1===61){return this.finishOp(types$1.assign,3)}}return this.finishOp(types$1.coalesce,2)}}return this.finishOp(types$1.question,1)};pp.readToken_numberSign=function(){var ecmaVersion=this.options.ecmaVersion;var code=35;if(ecmaVersion>=13){++this.pos;code=this.fullCharCodeAtPos();if(isIdentifierStart(code,true)||code===92){return this.finishToken(types$1.privateId,this.readWord1())}}this.raise(this.pos,"Unexpected character '"+codePointToString(code)+"'")};pp.getTokenFromCode=function(code){switch(code){case 46:return this.readToken_dot();case 40:++this.pos;return this.finishToken(types$1.parenL);case 41:++this.pos;return this.finishToken(types$1.parenR);case 59:++this.pos;return this.finishToken(types$1.semi);case 44:++this.pos;return this.finishToken(types$1.comma);case 91:++this.pos;return this.finishToken(types$1.bracketL);case 93:++this.pos;return this.finishToken(types$1.bracketR);case 123:++this.pos;return this.finishToken(types$1.braceL);case 125:++this.pos;return this.finishToken(types$1.braceR);case 58:++this.pos;return this.finishToken(types$1.colon);case 96:if(this.options.ecmaVersion<6){break}++this.pos;return this.finishToken(types$1.backQuote);case 48:var next=this.input.charCodeAt(this.pos+1);if(next===120||next===88){return this.readRadixNumber(16)}if(this.options.ecmaVersion>=6){if(next===111||next===79){return this.readRadixNumber(8)}if(next===98||next===66){return this.readRadixNumber(2)}}case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return this.readNumber(false);case 34:case 39:return this.readString(code);case 47:return this.readToken_slash();case 37:case 42:return this.readToken_mult_modulo_exp(code);case 124:case 38:return this.readToken_pipe_amp(code);case 94:return this.readToken_caret();case 43:case 45:return this.readToken_plus_min(code);case 60:case 62:return this.readToken_lt_gt(code);case 61:case 33:return this.readToken_eq_excl(code);case 63:return this.readToken_question();case 126:return this.finishOp(types$1.prefix,1);case 35:return this.readToken_numberSign()}this.raise(this.pos,"Unexpected character '"+codePointToString(code)+"'")};pp.finishOp=function(type,size){var str=this.input.slice(this.pos,this.pos+size);this.pos+=size;return this.finishToken(type,str)};pp.readRegexp=function(){var escaped,inClass,start=this.pos;for(;;){if(this.pos>=this.input.length){this.raise(start,"Unterminated regular expression")}var ch=this.input.charAt(this.pos);if(lineBreak.test(ch)){this.raise(start,"Unterminated regular expression")}if(!escaped){if(ch==="["){inClass=true}else if(ch==="]"&&inClass){inClass=false}else if(ch==="/"&&!inClass){break}escaped=ch==="\\"}else{escaped=false}++this.pos}var pattern=this.input.slice(start,this.pos);++this.pos;var flagsStart=this.pos;var flags=this.readWord1();if(this.containsEsc){this.unexpected(flagsStart)}var state=this.regexpState||(this.regexpState=new RegExpValidationState(this));state.reset(start,pattern,flags);this.validateRegExpFlags(state);this.validateRegExpPattern(state);var value=null;try{value=new RegExp(pattern,flags)}catch(e){}return this.finishToken(types$1.regexp,{pattern:pattern,flags:flags,value:value})};pp.readInt=function(radix,len,maybeLegacyOctalNumericLiteral){var allowSeparators=this.options.ecmaVersion>=12&&len===undefined;var isLegacyOctalNumericLiteral=maybeLegacyOctalNumericLiteral&&this.input.charCodeAt(this.pos)===48;var start=this.pos,total=0,lastCode=0;for(var i=0,e=len==null?Infinity:len;i=97){val=code-97+10}else if(code>=65){val=code-65+10}else if(code>=48&&code<=57){val=code-48}else{val=Infinity}if(val>=radix){break}lastCode=code;total=total*radix+val}if(allowSeparators&&lastCode===95){this.raiseRecoverable(this.pos-1,"Numeric separator is not allowed at the last of digits")}if(this.pos===start||len!=null&&this.pos-start!==len){return null}return total};function stringToNumber(str,isLegacyOctalNumericLiteral){if(isLegacyOctalNumericLiteral){return parseInt(str,8)}return parseFloat(str.replace(/_/g,""))}function stringToBigInt(str){if(typeof BigInt!=="function"){return null}return BigInt(str.replace(/_/g,""))}pp.readRadixNumber=function(radix){var start=this.pos;this.pos+=2;var val=this.readInt(radix);if(val==null){this.raise(this.start+2,"Expected number in radix "+radix)}if(this.options.ecmaVersion>=11&&this.input.charCodeAt(this.pos)===110){val=stringToBigInt(this.input.slice(start,this.pos));++this.pos}else if(isIdentifierStart(this.fullCharCodeAtPos())){this.raise(this.pos,"Identifier directly after number")}return this.finishToken(types$1.num,val)};pp.readNumber=function(startsWithDot){var start=this.pos;if(!startsWithDot&&this.readInt(10,undefined,true)===null){this.raise(start,"Invalid number")}var octal=this.pos-start>=2&&this.input.charCodeAt(start)===48;if(octal&&this.strict){this.raise(start,"Invalid number")}var next=this.input.charCodeAt(this.pos);if(!octal&&!startsWithDot&&this.options.ecmaVersion>=11&&next===110){var val$1=stringToBigInt(this.input.slice(start,this.pos));++this.pos;if(isIdentifierStart(this.fullCharCodeAtPos())){this.raise(this.pos,"Identifier directly after number")}return this.finishToken(types$1.num,val$1)}if(octal&&/[89]/.test(this.input.slice(start,this.pos))){octal=false}if(next===46&&!octal){++this.pos;this.readInt(10);next=this.input.charCodeAt(this.pos)}if((next===69||next===101)&&!octal){next=this.input.charCodeAt(++this.pos);if(next===43||next===45){++this.pos}if(this.readInt(10)===null){this.raise(start,"Invalid number")}}if(isIdentifierStart(this.fullCharCodeAtPos())){this.raise(this.pos,"Identifier directly after number")}var val=stringToNumber(this.input.slice(start,this.pos),octal);return this.finishToken(types$1.num,val)};pp.readCodePoint=function(){var ch=this.input.charCodeAt(this.pos),code;if(ch===123){if(this.options.ecmaVersion<6){this.unexpected()}var codePos=++this.pos;code=this.readHexChar(this.input.indexOf("}",this.pos)-this.pos);++this.pos;if(code>1114111){this.invalidStringToken(codePos,"Code point out of bounds")}}else{code=this.readHexChar(4)}return code};pp.readString=function(quote){var out="",chunkStart=++this.pos;for(;;){if(this.pos>=this.input.length){this.raise(this.start,"Unterminated string constant")}var ch=this.input.charCodeAt(this.pos);if(ch===quote){break}if(ch===92){out+=this.input.slice(chunkStart,this.pos);out+=this.readEscapedChar(false);chunkStart=this.pos}else if(ch===8232||ch===8233){if(this.options.ecmaVersion<10){this.raise(this.start,"Unterminated string constant")}++this.pos;if(this.options.locations){this.curLine++;this.lineStart=this.pos}}else{if(isNewLine(ch)){this.raise(this.start,"Unterminated string constant")}++this.pos}}out+=this.input.slice(chunkStart,this.pos++);return this.finishToken(types$1.string,out)};var INVALID_TEMPLATE_ESCAPE_ERROR={};pp.tryReadTemplateToken=function(){this.inTemplateElement=true;try{this.readTmplToken()}catch(err){if(err===INVALID_TEMPLATE_ESCAPE_ERROR){this.readInvalidTemplateToken()}else{throw err}}this.inTemplateElement=false};pp.invalidStringToken=function(position,message){if(this.inTemplateElement&&this.options.ecmaVersion>=9){throw INVALID_TEMPLATE_ESCAPE_ERROR}else{this.raise(position,message)}};pp.readTmplToken=function(){var out="",chunkStart=this.pos;for(;;){if(this.pos>=this.input.length){this.raise(this.start,"Unterminated template")}var ch=this.input.charCodeAt(this.pos);if(ch===96||ch===36&&this.input.charCodeAt(this.pos+1)===123){if(this.pos===this.start&&(this.type===types$1.template||this.type===types$1.invalidTemplate)){if(ch===36){this.pos+=2;return this.finishToken(types$1.dollarBraceL)}else{++this.pos;return this.finishToken(types$1.backQuote)}}out+=this.input.slice(chunkStart,this.pos);return this.finishToken(types$1.template,out)}if(ch===92){out+=this.input.slice(chunkStart,this.pos);out+=this.readEscapedChar(true);chunkStart=this.pos}else if(isNewLine(ch)){out+=this.input.slice(chunkStart,this.pos);++this.pos;switch(ch){case 13:if(this.input.charCodeAt(this.pos)===10){++this.pos}case 10:out+="\n";break;default:out+=String.fromCharCode(ch);break}if(this.options.locations){++this.curLine;this.lineStart=this.pos}chunkStart=this.pos}else{++this.pos}}};pp.readInvalidTemplateToken=function(){for(;this.pos=48&&ch<=55){var octalStr=this.input.substr(this.pos-1,3).match(/^[0-7]+/)[0];var octal=parseInt(octalStr,8);if(octal>255){octalStr=octalStr.slice(0,-1);octal=parseInt(octalStr,8)}this.pos+=octalStr.length-1;ch=this.input.charCodeAt(this.pos);if((octalStr!=="0"||ch===56||ch===57)&&(this.strict||inTemplate)){this.invalidStringToken(this.pos-1-octalStr.length,inTemplate?"Octal literal in template string":"Octal literal in strict mode")}return String.fromCharCode(octal)}if(isNewLine(ch)){return""}return String.fromCharCode(ch)}};pp.readHexChar=function(len){var codePos=this.pos;var n=this.readInt(16,len);if(n===null){this.invalidStringToken(codePos,"Bad character escape sequence")}return n};pp.readWord1=function(){this.containsEsc=false;var word="",first=true,chunkStart=this.pos;var astral=this.options.ecmaVersion>=6;while(this.posbytes){end=bytes}if(start>=bytes||start>=end||bytes===0){return new ArrayBuffer(0)}var abv=new Uint8Array(arraybuffer);var result=new Uint8Array(end-start);for(var i=start,ii=0;i * @license MIT */function compare(a,b){if(a===b){return 0}var x=a.length;var y=b.length;for(var i=0,len=Math.min(x,y);i=0){var next_line=out.indexOf("\n",idx+1);out=out.substring(next_line+1)}this.stack=out}}};util.inherits(assert.AssertionError,Error);function truncate(s,n){if(typeof s==="string"){return s.length=0;i--){if(ka[i]!==kb[i])return false}for(i=ka.length-1;i>=0;i--){key=ka[i];if(!_deepEqual(a[key],b[key],strict,actualVisitedObjects))return false}return true}assert.notDeepEqual=function notDeepEqual(actual,expected,message){if(_deepEqual(actual,expected,false)){fail(actual,expected,message,"notDeepEqual",assert.notDeepEqual)}};assert.notDeepStrictEqual=notDeepStrictEqual;function notDeepStrictEqual(actual,expected,message){if(_deepEqual(actual,expected,true)){fail(actual,expected,message,"notDeepStrictEqual",notDeepStrictEqual)}}assert.strictEqual=function strictEqual(actual,expected,message){if(actual!==expected){fail(actual,expected,message,"===",assert.strictEqual)}};assert.notStrictEqual=function notStrictEqual(actual,expected,message){if(actual===expected){fail(actual,expected,message,"!==",assert.notStrictEqual)}};function expectedException(actual,expected){if(!actual||!expected){return false}if(Object.prototype.toString.call(expected)=="[object RegExp]"){return expected.test(actual)}try{if(actual instanceof expected){return true}}catch(e){}if(Error.isPrototypeOf(expected)){return false}return expected.call({},actual)===true}function _tryBlock(block){var error;try{block()}catch(e){error=e}return error}function _throws(shouldThrow,block,expected,message){var actual;if(typeof block!=="function"){throw new TypeError('"block" argument must be a function')}if(typeof expected==="string"){message=expected;expected=null}actual=_tryBlock(block);message=(expected&&expected.name?" ("+expected.name+").":".")+(message?" "+message:".");if(shouldThrow&&!actual){fail(actual,expected,"Missing expected exception"+message)}var userProvidedMessage=typeof message==="string";var isUnwantedException=!shouldThrow&&util.isError(actual);var isUnexpectedException=!shouldThrow&&actual&&!expected;if(isUnwantedException&&userProvidedMessage&&expectedException(actual,expected)||isUnexpectedException){fail(actual,expected,"Got unwanted exception"+message)}if(shouldThrow&&actual&&expected&&!expectedException(actual,expected)||!shouldThrow&&actual){throw actual}}assert.throws=function(block,error,message){_throws(true,block,error,message)};assert.doesNotThrow=function(block,error,message){_throws(false,block,error,message)};assert.ifError=function(err){if(err)throw err};function strict(value,message){if(!value)fail(value,true,message,"==",strict)}assert.strict=objectAssign(strict,assert,{equal:assert.strictEqual,deepEqual:assert.deepStrictEqual,notEqual:assert.notStrictEqual,notDeepEqual:assert.notDeepStrictEqual});assert.strict.strict=assert.strict;var objectKeys=Object.keys||function(obj){var keys=[];for(var key in obj){if(hasOwn.call(obj,key))keys.push(key)}return keys}}).call(this)}).call(this,typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{"object-assign":151,"util/":25}],23:[function(require,module,exports){if(typeof Object.create==="function"){module.exports=function inherits(ctor,superCtor){ctor.super_=superCtor;ctor.prototype=Object.create(superCtor.prototype,{constructor:{value:ctor,enumerable:false,writable:true,configurable:true}})}}else{module.exports=function inherits(ctor,superCtor){ctor.super_=superCtor;var TempCtor=function(){};TempCtor.prototype=superCtor.prototype;ctor.prototype=new TempCtor;ctor.prototype.constructor=ctor}}},{}],24:[function(require,module,exports){module.exports=function isBuffer(arg){return arg&&typeof arg==="object"&&typeof arg.copy==="function"&&typeof arg.fill==="function"&&typeof arg.readUInt8==="function"}},{}],25:[function(require,module,exports){(function(process,global){(function(){var formatRegExp=/%[sdj%]/g;exports.format=function(f){if(!isString(f)){var objects=[];for(var i=0;i=len)return x;switch(x){case"%s":return String(args[i++]);case"%d":return Number(args[i++]);case"%j":try{return JSON.stringify(args[i++])}catch(_){return"[Circular]"}default:return x}}));for(var x=args[i];i=3)ctx.depth=arguments[2];if(arguments.length>=4)ctx.colors=arguments[3];if(isBoolean(opts)){ctx.showHidden=opts}else if(opts){exports._extend(ctx,opts)}if(isUndefined(ctx.showHidden))ctx.showHidden=false;if(isUndefined(ctx.depth))ctx.depth=2;if(isUndefined(ctx.colors))ctx.colors=false;if(isUndefined(ctx.customInspect))ctx.customInspect=true;if(ctx.colors)ctx.stylize=stylizeWithColor;return formatValue(ctx,obj,ctx.depth)}exports.inspect=inspect;inspect.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]};inspect.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"};function stylizeWithColor(str,styleType){var style=inspect.styles[styleType];if(style){return"["+inspect.colors[style][0]+"m"+str+"["+inspect.colors[style][1]+"m"}else{return str}}function stylizeNoColor(str,styleType){return str}function arrayToHash(array){var hash={};array.forEach((function(val,idx){hash[val]=true}));return hash}function formatValue(ctx,value,recurseTimes){if(ctx.customInspect&&value&&isFunction(value.inspect)&&value.inspect!==exports.inspect&&!(value.constructor&&value.constructor.prototype===value)){var ret=value.inspect(recurseTimes,ctx);if(!isString(ret)){ret=formatValue(ctx,ret,recurseTimes)}return ret}var primitive=formatPrimitive(ctx,value);if(primitive){return primitive}var keys=Object.keys(value);var visibleKeys=arrayToHash(keys);if(ctx.showHidden){keys=Object.getOwnPropertyNames(value)}if(isError(value)&&(keys.indexOf("message")>=0||keys.indexOf("description")>=0)){return formatError(value)}if(keys.length===0){if(isFunction(value)){var name=value.name?": "+value.name:"";return ctx.stylize("[Function"+name+"]","special")}if(isRegExp(value)){return ctx.stylize(RegExp.prototype.toString.call(value),"regexp")}if(isDate(value)){return ctx.stylize(Date.prototype.toString.call(value),"date")}if(isError(value)){return formatError(value)}}var base="",array=false,braces=["{","}"];if(isArray(value)){array=true;braces=["[","]"]}if(isFunction(value)){var n=value.name?": "+value.name:"";base=" [Function"+n+"]"}if(isRegExp(value)){base=" "+RegExp.prototype.toString.call(value)}if(isDate(value)){base=" "+Date.prototype.toUTCString.call(value)}if(isError(value)){base=" "+formatError(value)}if(keys.length===0&&(!array||value.length==0)){return braces[0]+base+braces[1]}if(recurseTimes<0){if(isRegExp(value)){return ctx.stylize(RegExp.prototype.toString.call(value),"regexp")}else{return ctx.stylize("[Object]","special")}}ctx.seen.push(value);var output;if(array){output=formatArray(ctx,value,recurseTimes,visibleKeys,keys)}else{output=keys.map((function(key){return formatProperty(ctx,value,recurseTimes,visibleKeys,key,array)}))}ctx.seen.pop();return reduceToSingleString(output,base,braces)}function formatPrimitive(ctx,value){if(isUndefined(value))return ctx.stylize("undefined","undefined");if(isString(value)){var simple="'"+JSON.stringify(value).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return ctx.stylize(simple,"string")}if(isNumber(value))return ctx.stylize(""+value,"number");if(isBoolean(value))return ctx.stylize(""+value,"boolean");if(isNull(value))return ctx.stylize("null","null")}function formatError(value){return"["+Error.prototype.toString.call(value)+"]"}function formatArray(ctx,value,recurseTimes,visibleKeys,keys){var output=[];for(var i=0,l=value.length;i-1){if(array){str=str.split("\n").map((function(line){return" "+line})).join("\n").substr(2)}else{str="\n"+str.split("\n").map((function(line){return" "+line})).join("\n")}}}else{str=ctx.stylize("[Circular]","special")}}if(isUndefined(name)){if(array&&key.match(/^\d+$/)){return str}name=JSON.stringify(""+key);if(name.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)){name=name.substr(1,name.length-2);name=ctx.stylize(name,"name")}else{name=name.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'");name=ctx.stylize(name,"string")}}return name+": "+str}function reduceToSingleString(output,base,braces){var numLinesEst=0;var length=output.reduce((function(prev,cur){numLinesEst++;if(cur.indexOf("\n")>=0)numLinesEst++;return prev+cur.replace(/\u001b\[\d\d?m/g,"").length+1}),0);if(length>60){return braces[0]+(base===""?"":base+"\n ")+" "+output.join(",\n ")+" "+braces[1]}return braces[0]+base+" "+output.join(", ")+" "+braces[1]}function isArray(ar){return Array.isArray(ar)}exports.isArray=isArray;function isBoolean(arg){return typeof arg==="boolean"}exports.isBoolean=isBoolean;function isNull(arg){return arg===null}exports.isNull=isNull;function isNullOrUndefined(arg){return arg==null}exports.isNullOrUndefined=isNullOrUndefined;function isNumber(arg){return typeof arg==="number"}exports.isNumber=isNumber;function isString(arg){return typeof arg==="string"}exports.isString=isString;function isSymbol(arg){return typeof arg==="symbol"}exports.isSymbol=isSymbol;function isUndefined(arg){return arg===void 0}exports.isUndefined=isUndefined;function isRegExp(re){return isObject(re)&&objectToString(re)==="[object RegExp]"}exports.isRegExp=isRegExp;function isObject(arg){return typeof arg==="object"&&arg!==null}exports.isObject=isObject;function isDate(d){return isObject(d)&&objectToString(d)==="[object Date]"}exports.isDate=isDate;function isError(e){return isObject(e)&&(objectToString(e)==="[object Error]"||e instanceof Error)}exports.isError=isError;function isFunction(arg){return typeof arg==="function"}exports.isFunction=isFunction;function isPrimitive(arg){return arg===null||typeof arg==="boolean"||typeof arg==="number"||typeof arg==="string"||typeof arg==="symbol"||typeof arg==="undefined"}exports.isPrimitive=isPrimitive;exports.isBuffer=require("./support/isBuffer");function objectToString(o){return Object.prototype.toString.call(o)}function pad(n){return n<10?"0"+n.toString(10):n.toString(10)}var months=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function timestamp(){var d=new Date;var time=[pad(d.getHours()),pad(d.getMinutes()),pad(d.getSeconds())].join(":");return[d.getDate(),months[d.getMonth()],time].join(" ")}exports.log=function(){console.log("%s - %s",timestamp(),exports.format.apply(exports,arguments))};exports.inherits=require("inherits");exports._extend=function(origin,add){if(!add||!isObject(add))return origin;var keys=Object.keys(add);var i=keys.length;while(i--){origin[keys[i]]=add[keys[i]]}return origin};function hasOwnProperty(obj,prop){return Object.prototype.hasOwnProperty.call(obj,prop)}}).call(this)}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{"./support/isBuffer":24,_process:160,inherits:23}],26:[function(require,module,exports){(function(global,factory){if(typeof define==="function"&&define.amd){define(["exports","./defaultTraveler","./attachComments"],factory)}else if(typeof exports!=="undefined"){factory(exports,require("./defaultTraveler"),require("./attachComments"))}else{var mod={exports:{}};factory(mod.exports,global.defaultTraveler,global.attachComments);global.astravel=mod.exports}})(this,(function(exports,_defaultTraveler,_attachComments){"use strict";exports.__esModule=true;exports.makeTraveler=exports.attachComments=exports.defaultTraveler=undefined;var _defaultTraveler2=_interopRequireDefault(_defaultTraveler);var _attachComments2=_interopRequireDefault(_attachComments);function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function makeTraveler(properties){return _defaultTraveler2.default.makeChild(properties)}exports.defaultTraveler=_defaultTraveler2.default;exports.attachComments=_attachComments2.default;exports.makeTraveler=makeTraveler}))},{"./attachComments":27,"./defaultTraveler":28}],27:[function(require,module,exports){(function(global,factory){if(typeof define==="function"&&define.amd){define(["exports","./defaultTraveler"],factory)}else if(typeof exports!=="undefined"){factory(exports,require("./defaultTraveler"))}else{var mod={exports:{}};factory(mod.exports,global.defaultTraveler);global.attachComments=mod.exports}})(this,(function(exports,_defaultTraveler){"use strict";exports.__esModule=true;exports.default=function(node,comments){customTraveler[node.type](node,{comments:comments,index:0});return node};var _defaultTraveler2=_interopRequireDefault(_defaultTraveler);function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function attachComments(parent,children,findHeadingComments,state,traveler){var index=state.index,comments=state.comments;var comment=comments[index];var boundComments=void 0,trailingComments=void 0;if(comment!=null){if(children==null||children.length===0){boundComments=parent.comments!=null?parent.comments:[];while(comment!=null&&comment.end0&&arguments[0]!==undefined?arguments[0]:{};var traveler=Object.create(this);traveler.super=this;for(var key in properties){traveler[key]=properties[key]}return traveler},Program:function Program(node,state){var statements=node.body,length=statements.length;for(var i=0;i":9,"<=":9,">=":9,in:9,instanceof:9,"<<":10,">>":10,">>>":10,"+":11,"-":11,"*":12,"%":12,"/":12,"**":13};var NEEDS_PARENTHESES=17;exports.NEEDS_PARENTHESES=NEEDS_PARENTHESES;var EXPRESSIONS_PRECEDENCE={ArrayExpression:20,TaggedTemplateExpression:20,ThisExpression:20,Identifier:20,PrivateIdentifier:20,Literal:18,TemplateLiteral:20,Super:20,SequenceExpression:20,MemberExpression:19,ChainExpression:19,CallExpression:19,NewExpression:19,ArrowFunctionExpression:NEEDS_PARENTHESES,ClassExpression:NEEDS_PARENTHESES,FunctionExpression:NEEDS_PARENTHESES,ObjectExpression:NEEDS_PARENTHESES,UpdateExpression:16,UnaryExpression:15,AwaitExpression:15,BinaryExpression:14,LogicalExpression:13,ConditionalExpression:4,AssignmentExpression:3,YieldExpression:2,RestElement:1};exports.EXPRESSIONS_PRECEDENCE=EXPRESSIONS_PRECEDENCE;function formatSequence(state,nodes){var generator=state.generator;state.write("(");if(nodes!=null&&nodes.length>0){generator[nodes[0].type](nodes[0],state);var length=nodes.length;for(var i=1;i0){state.write(lineEnd);for(var i=1;i0){generator.VariableDeclarator(declarations[0],state);for(var i=1;i0){state.write(lineEnd);if(writeComments&&node.comments!=null){formatComments(state,node.comments,statementIndent,lineEnd)}var length=statements.length;for(var i=0;i0){for(;i0){state.write(", ")}var specifier=specifiers[i];var type=specifier.type[6];if(type==="D"){state.write(specifier.local.name,specifier);i++}else if(type==="N"){state.write("* as "+specifier.local.name,specifier);i++}else{break}}if(i0){for(var i=0;;){var specifier=specifiers[i];var name=specifier.local.name;state.write(name,specifier);if(name!==specifier.exported.name){state.write(" as "+specifier.exported.name)}if(++i ");if(node.body.type[0]==="O"){state.write("(");this.ObjectExpression(node.body,state);state.write(")")}else{this[node.body.type](node.body,state)}},ThisExpression:function ThisExpression(node,state){state.write("this",node)},Super:function Super(node,state){state.write("super",node)},RestElement:RestElement=function RestElement(node,state){state.write("...");this[node.argument.type](node.argument,state)},SpreadElement:RestElement,YieldExpression:function YieldExpression(node,state){state.write(node.delegate?"yield*":"yield");if(node.argument){state.write(" ");this[node.argument.type](node.argument,state)}},AwaitExpression:function AwaitExpression(node,state){state.write("await ",node);formatExpression(state,node.argument,node)},TemplateLiteral:function TemplateLiteral(node,state){var quasis=node.quasis,expressions=node.expressions;state.write("`");var length=expressions.length;for(var i=0;i0){var elements=node.elements,length=elements.length;for(var i=0;;){var element=elements[i];if(element!=null){this[element.type](element,state)}if(++i0){state.write(lineEnd);if(writeComments&&node.comments!=null){formatComments(state,node.comments,propertyIndent,lineEnd)}var comma=","+lineEnd;var properties=node.properties,length=properties.length;for(var i=0;;){var property=properties[i];if(writeComments&&property.comments!=null){formatComments(state,property.comments,propertyIndent,lineEnd)}state.write(propertyIndent);this[property.type](property,state);if(++i0){var properties=node.properties,length=properties.length;for(var i=0;;){this[properties[i].type](properties[i],state);if(++i1||type[0]==="U"&&(type[1]==="n"||type[1]==="p")&&argument.prefix&&argument.operator[0]===operator&&(operator==="+"||operator==="-"))){state.write(" ")}if(needsParentheses){state.write(operator.length>1?" (":"(");this[type](argument,state);state.write(")")}else{this[type](argument,state)}}else{this[node.argument.type](node.argument,state);state.write(node.operator)}},UpdateExpression:function UpdateExpression(node,state){if(node.prefix){state.write(node.operator);this[node.argument.type](node.argument,state)}else{this[node.argument.type](node.argument,state);state.write(node.operator)}},AssignmentExpression:function AssignmentExpression(node,state){this[node.left.type](node.left,state);state.write(" "+node.operator+" ");this[node.right.type](node.right,state)},AssignmentPattern:function AssignmentPattern(node,state){this[node.left.type](node.left,state);state.write(" = ");this[node.right.type](node.right,state)},BinaryExpression:BinaryExpression=function BinaryExpression(node,state){var isIn=node.operator==="in";if(isIn){state.write("(")}formatExpression(state,node.left,node,false);state.write(" "+node.operator+" ");formatExpression(state,node.right,node,true);if(isIn){state.write(")")}},LogicalExpression:BinaryExpression,ConditionalExpression:function ConditionalExpression(node,state){var test=node.test;var precedence=state.expressionsPrecedence[test.type];if(precedence===NEEDS_PARENTHESES||precedence<=state.expressionsPrecedence.ConditionalExpression){state.write("(");this[test.type](test,state);state.write(")")}else{this[test.type](test,state)}state.write(" ? ");this[node.consequent.type](node.consequent,state);state.write(" : ");this[node.alternate.type](node.alternate,state)},NewExpression:function NewExpression(node,state){state.write("new ");var precedence=state.expressionsPrecedence[node.callee.type];if(precedence===NEEDS_PARENTHESES||precedence0){if(this.lineEndSize>0&&(lineEnd.length===1?code[length-1]===lineEnd:code.endsWith(lineEnd))){this.line+=this.lineEndSize;this.column=0}else{this.column+=length}}}},{key:"toString",value:function toString(){return this.output}}]);return State}();function generate(node,options){var state=new State(options);state.generator[node.type](node,state);return state.output}},{}],30:[function(require,module,exports){module.exports=Backoff;function Backoff(opts){opts=opts||{};this.ms=opts.min||100;this.max=opts.max||1e4;this.factor=opts.factor||2;this.jitter=opts.jitter>0&&opts.jitter<=1?opts.jitter:0;this.attempts=0}Backoff.prototype.duration=function(){var ms=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var rand=Math.random();var deviation=Math.floor(rand*this.jitter*ms);ms=(Math.floor(rand*10)&1)==0?ms-deviation:ms+deviation}return Math.min(ms,this.max)|0};Backoff.prototype.reset=function(){this.attempts=0};Backoff.prototype.setMin=function(min){this.ms=min};Backoff.prototype.setMax=function(max){this.max=max};Backoff.prototype.setJitter=function(jitter){this.jitter=jitter}},{}],31:[function(require,module,exports){(function(chars){"use strict";exports.encode=function(arraybuffer){var bytes=new Uint8Array(arraybuffer),i,len=bytes.length,base64="";for(i=0;i>2];base64+=chars[(bytes[i]&3)<<4|bytes[i+1]>>4];base64+=chars[(bytes[i+1]&15)<<2|bytes[i+2]>>6];base64+=chars[bytes[i+2]&63]}if(len%3===2){base64=base64.substring(0,base64.length-1)+"="}else if(len%3===1){base64=base64.substring(0,base64.length-2)+"=="}return base64};exports.decode=function(base64){var bufferLength=base64.length*.75,len=base64.length,i,p=0,encoded1,encoded2,encoded3,encoded4;if(base64[base64.length-1]==="="){bufferLength--;if(base64[base64.length-2]==="="){bufferLength--}}var arraybuffer=new ArrayBuffer(bufferLength),bytes=new Uint8Array(arraybuffer);for(i=0;i>4;bytes[p++]=(encoded2&15)<<4|encoded3>>2;bytes[p++]=(encoded3&3)<<6|encoded4&63}return arraybuffer}})("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/")},{}],32:[function(require,module,exports){"use strict";exports.byteLength=byteLength;exports.toByteArray=toByteArray;exports.fromByteArray=fromByteArray;var lookup=[];var revLookup=[];var Arr=typeof Uint8Array!=="undefined"?Uint8Array:Array;var code="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(var i=0,len=code.length;i0){throw new Error("Invalid string. Length must be a multiple of 4")}var validLen=b64.indexOf("=");if(validLen===-1)validLen=len;var placeHoldersLen=validLen===len?0:4-validLen%4;return[validLen,placeHoldersLen]}function byteLength(b64){var lens=getLens(b64);var validLen=lens[0];var placeHoldersLen=lens[1];return(validLen+placeHoldersLen)*3/4-placeHoldersLen}function _byteLength(b64,validLen,placeHoldersLen){return(validLen+placeHoldersLen)*3/4-placeHoldersLen}function toByteArray(b64){var tmp;var lens=getLens(b64);var validLen=lens[0];var placeHoldersLen=lens[1];var arr=new Arr(_byteLength(b64,validLen,placeHoldersLen));var curByte=0;var len=placeHoldersLen>0?validLen-4:validLen;var i;for(i=0;i>16&255;arr[curByte++]=tmp>>8&255;arr[curByte++]=tmp&255}if(placeHoldersLen===2){tmp=revLookup[b64.charCodeAt(i)]<<2|revLookup[b64.charCodeAt(i+1)]>>4;arr[curByte++]=tmp&255}if(placeHoldersLen===1){tmp=revLookup[b64.charCodeAt(i)]<<10|revLookup[b64.charCodeAt(i+1)]<<4|revLookup[b64.charCodeAt(i+2)]>>2;arr[curByte++]=tmp>>8&255;arr[curByte++]=tmp&255}return arr}function tripletToBase64(num){return lookup[num>>18&63]+lookup[num>>12&63]+lookup[num>>6&63]+lookup[num&63]}function encodeChunk(uint8,start,end){var tmp;var output=[];for(var i=start;ilen2?len2:i+maxChunkLength))}if(extraBytes===1){tmp=uint8[len-1];parts.push(lookup[tmp>>2]+lookup[tmp<<4&63]+"==")}else if(extraBytes===2){tmp=(uint8[len-2]<<8)+uint8[len-1];parts.push(lookup[tmp>>10]+lookup[tmp>>4&63]+lookup[tmp<<2&63]+"=")}return parts.join("")}},{}],33:[function(require,module,exports){var BlobBuilder=typeof BlobBuilder!=="undefined"?BlobBuilder:typeof WebKitBlobBuilder!=="undefined"?WebKitBlobBuilder:typeof MSBlobBuilder!=="undefined"?MSBlobBuilder:typeof MozBlobBuilder!=="undefined"?MozBlobBuilder:false;var blobSupported=function(){try{var a=new Blob(["hi"]);return a.size===2}catch(e){return false}}();var blobSupportsArrayBufferView=blobSupported&&function(){try{var b=new Blob([new Uint8Array([1,2])]);return b.size===2}catch(e){return false}}();var blobBuilderSupported=BlobBuilder&&BlobBuilder.prototype.append&&BlobBuilder.prototype.getBlob;function mapArrayBufferViews(ary){return ary.map((function(chunk){if(chunk.buffer instanceof ArrayBuffer){var buf=chunk.buffer;if(chunk.byteLength!==buf.byteLength){var copy=new Uint8Array(chunk.byteLength);copy.set(new Uint8Array(buf,chunk.byteOffset,chunk.byteLength));buf=copy.buffer}return buf}return chunk}))}function BlobBuilderConstructor(ary,options){options=options||{};var bb=new BlobBuilder;mapArrayBufferViews(ary).forEach((function(part){bb.append(part)}));return options.type?bb.getBlob(options.type):bb.getBlob()}function BlobConstructor(ary,options){return new Blob(mapArrayBufferViews(ary),options||{})}if(typeof Blob!=="undefined"){BlobBuilderConstructor.prototype=Blob.prototype;BlobConstructor.prototype=Blob.prototype}module.exports=function(){if(blobSupported){return blobSupportsArrayBufferView?Blob:BlobConstructor}else if(blobBuilderSupported){return BlobBuilderConstructor}else{return undefined}}()},{}],34:[function(require,module,exports){},{}],35:[function(require,module,exports){(function(Buffer){(function(){ /*! * The buffer module from node.js, for the browser. * * @author Feross Aboukhadijeh * @license MIT */ "use strict";var base64=require("base64-js");var ieee754=require("ieee754");exports.Buffer=Buffer;exports.SlowBuffer=SlowBuffer;exports.INSPECT_MAX_BYTES=50;var K_MAX_LENGTH=2147483647;exports.kMaxLength=K_MAX_LENGTH;Buffer.TYPED_ARRAY_SUPPORT=typedArraySupport();if(!Buffer.TYPED_ARRAY_SUPPORT&&typeof console!=="undefined"&&typeof console.error==="function"){console.error("This browser lacks typed array (Uint8Array) support which is required by "+"`buffer` v5.x. Use `buffer` v4.x if you require old browser support.")}function typedArraySupport(){try{var arr=new Uint8Array(1);arr.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}};return arr.foo()===42}catch(e){return false}}Object.defineProperty(Buffer.prototype,"parent",{enumerable:true,get:function(){if(!Buffer.isBuffer(this))return undefined;return this.buffer}});Object.defineProperty(Buffer.prototype,"offset",{enumerable:true,get:function(){if(!Buffer.isBuffer(this))return undefined;return this.byteOffset}});function createBuffer(length){if(length>K_MAX_LENGTH){throw new RangeError('The value "'+length+'" is invalid for option "size"')}var buf=new Uint8Array(length);buf.__proto__=Buffer.prototype;return buf}function Buffer(arg,encodingOrOffset,length){if(typeof arg==="number"){if(typeof encodingOrOffset==="string"){throw new TypeError('The "string" argument must be of type string. Received type number')}return allocUnsafe(arg)}return from(arg,encodingOrOffset,length)}if(typeof Symbol!=="undefined"&&Symbol.species!=null&&Buffer[Symbol.species]===Buffer){Object.defineProperty(Buffer,Symbol.species,{value:null,configurable:true,enumerable:false,writable:false})}Buffer.poolSize=8192;function from(value,encodingOrOffset,length){if(typeof value==="string"){return fromString(value,encodingOrOffset)}if(ArrayBuffer.isView(value)){return fromArrayLike(value)}if(value==null){throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, "+"or Array-like Object. Received type "+typeof value)}if(isInstance(value,ArrayBuffer)||value&&isInstance(value.buffer,ArrayBuffer)){return fromArrayBuffer(value,encodingOrOffset,length)}if(typeof value==="number"){throw new TypeError('The "value" argument must not be of type number. Received type number')}var valueOf=value.valueOf&&value.valueOf();if(valueOf!=null&&valueOf!==value){return Buffer.from(valueOf,encodingOrOffset,length)}var b=fromObject(value);if(b)return b;if(typeof Symbol!=="undefined"&&Symbol.toPrimitive!=null&&typeof value[Symbol.toPrimitive]==="function"){return Buffer.from(value[Symbol.toPrimitive]("string"),encodingOrOffset,length)}throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, "+"or Array-like Object. Received type "+typeof value)}Buffer.from=function(value,encodingOrOffset,length){return from(value,encodingOrOffset,length)};Buffer.prototype.__proto__=Uint8Array.prototype;Buffer.__proto__=Uint8Array;function assertSize(size){if(typeof size!=="number"){throw new TypeError('"size" argument must be of type number')}else if(size<0){throw new RangeError('The value "'+size+'" is invalid for option "size"')}}function alloc(size,fill,encoding){assertSize(size);if(size<=0){return createBuffer(size)}if(fill!==undefined){return typeof encoding==="string"?createBuffer(size).fill(fill,encoding):createBuffer(size).fill(fill)}return createBuffer(size)}Buffer.alloc=function(size,fill,encoding){return alloc(size,fill,encoding)};function allocUnsafe(size){assertSize(size);return createBuffer(size<0?0:checked(size)|0)}Buffer.allocUnsafe=function(size){return allocUnsafe(size)};Buffer.allocUnsafeSlow=function(size){return allocUnsafe(size)};function fromString(string,encoding){if(typeof encoding!=="string"||encoding===""){encoding="utf8"}if(!Buffer.isEncoding(encoding)){throw new TypeError("Unknown encoding: "+encoding)}var length=byteLength(string,encoding)|0;var buf=createBuffer(length);var actual=buf.write(string,encoding);if(actual!==length){buf=buf.slice(0,actual)}return buf}function fromArrayLike(array){var length=array.length<0?0:checked(array.length)|0;var buf=createBuffer(length);for(var i=0;i=K_MAX_LENGTH){throw new RangeError("Attempt to allocate Buffer larger than maximum "+"size: 0x"+K_MAX_LENGTH.toString(16)+" bytes")}return length|0}function SlowBuffer(length){if(+length!=length){length=0}return Buffer.alloc(+length)}Buffer.isBuffer=function isBuffer(b){return b!=null&&b._isBuffer===true&&b!==Buffer.prototype};Buffer.compare=function compare(a,b){if(isInstance(a,Uint8Array))a=Buffer.from(a,a.offset,a.byteLength);if(isInstance(b,Uint8Array))b=Buffer.from(b,b.offset,b.byteLength);if(!Buffer.isBuffer(a)||!Buffer.isBuffer(b)){throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array')}if(a===b)return 0;var x=a.length;var y=b.length;for(var i=0,len=Math.min(x,y);i2&&arguments[2]===true;if(!mustMatch&&len===0)return 0;var loweredCase=false;for(;;){switch(encoding){case"ascii":case"latin1":case"binary":return len;case"utf8":case"utf-8":return utf8ToBytes(string).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return len*2;case"hex":return len>>>1;case"base64":return base64ToBytes(string).length;default:if(loweredCase){return mustMatch?-1:utf8ToBytes(string).length}encoding=(""+encoding).toLowerCase();loweredCase=true}}}Buffer.byteLength=byteLength;function slowToString(encoding,start,end){var loweredCase=false;if(start===undefined||start<0){start=0}if(start>this.length){return""}if(end===undefined||end>this.length){end=this.length}if(end<=0){return""}end>>>=0;start>>>=0;if(end<=start){return""}if(!encoding)encoding="utf8";while(true){switch(encoding){case"hex":return hexSlice(this,start,end);case"utf8":case"utf-8":return utf8Slice(this,start,end);case"ascii":return asciiSlice(this,start,end);case"latin1":case"binary":return latin1Slice(this,start,end);case"base64":return base64Slice(this,start,end);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return utf16leSlice(this,start,end);default:if(loweredCase)throw new TypeError("Unknown encoding: "+encoding);encoding=(encoding+"").toLowerCase();loweredCase=true}}}Buffer.prototype._isBuffer=true;function swap(b,n,m){var i=b[n];b[n]=b[m];b[m]=i}Buffer.prototype.swap16=function swap16(){var len=this.length;if(len%2!==0){throw new RangeError("Buffer size must be a multiple of 16-bits")}for(var i=0;imax)str+=" ... ";return""};Buffer.prototype.compare=function compare(target,start,end,thisStart,thisEnd){if(isInstance(target,Uint8Array)){target=Buffer.from(target,target.offset,target.byteLength)}if(!Buffer.isBuffer(target)){throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. '+"Received type "+typeof target)}if(start===undefined){start=0}if(end===undefined){end=target?target.length:0}if(thisStart===undefined){thisStart=0}if(thisEnd===undefined){thisEnd=this.length}if(start<0||end>target.length||thisStart<0||thisEnd>this.length){throw new RangeError("out of range index")}if(thisStart>=thisEnd&&start>=end){return 0}if(thisStart>=thisEnd){return-1}if(start>=end){return 1}start>>>=0;end>>>=0;thisStart>>>=0;thisEnd>>>=0;if(this===target)return 0;var x=thisEnd-thisStart;var y=end-start;var len=Math.min(x,y);var thisCopy=this.slice(thisStart,thisEnd);var targetCopy=target.slice(start,end);for(var i=0;i2147483647){byteOffset=2147483647}else if(byteOffset<-2147483648){byteOffset=-2147483648}byteOffset=+byteOffset;if(numberIsNaN(byteOffset)){byteOffset=dir?0:buffer.length-1}if(byteOffset<0)byteOffset=buffer.length+byteOffset;if(byteOffset>=buffer.length){if(dir)return-1;else byteOffset=buffer.length-1}else if(byteOffset<0){if(dir)byteOffset=0;else return-1}if(typeof val==="string"){val=Buffer.from(val,encoding)}if(Buffer.isBuffer(val)){if(val.length===0){return-1}return arrayIndexOf(buffer,val,byteOffset,encoding,dir)}else if(typeof val==="number"){val=val&255;if(typeof Uint8Array.prototype.indexOf==="function"){if(dir){return Uint8Array.prototype.indexOf.call(buffer,val,byteOffset)}else{return Uint8Array.prototype.lastIndexOf.call(buffer,val,byteOffset)}}return arrayIndexOf(buffer,[val],byteOffset,encoding,dir)}throw new TypeError("val must be string, number or Buffer")}function arrayIndexOf(arr,val,byteOffset,encoding,dir){var indexSize=1;var arrLength=arr.length;var valLength=val.length;if(encoding!==undefined){encoding=String(encoding).toLowerCase();if(encoding==="ucs2"||encoding==="ucs-2"||encoding==="utf16le"||encoding==="utf-16le"){if(arr.length<2||val.length<2){return-1}indexSize=2;arrLength/=2;valLength/=2;byteOffset/=2}}function read(buf,i){if(indexSize===1){return buf[i]}else{return buf.readUInt16BE(i*indexSize)}}var i;if(dir){var foundIndex=-1;for(i=byteOffset;iarrLength)byteOffset=arrLength-valLength;for(i=byteOffset;i>=0;i--){var found=true;for(var j=0;jremaining){length=remaining}}var strLen=string.length;if(length>strLen/2){length=strLen/2}for(var i=0;i>>0;if(isFinite(length)){length=length>>>0;if(encoding===undefined)encoding="utf8"}else{encoding=length;length=undefined}}else{throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported")}var remaining=this.length-offset;if(length===undefined||length>remaining)length=remaining;if(string.length>0&&(length<0||offset<0)||offset>this.length){throw new RangeError("Attempt to write outside buffer bounds")}if(!encoding)encoding="utf8";var loweredCase=false;for(;;){switch(encoding){case"hex":return hexWrite(this,string,offset,length);case"utf8":case"utf-8":return utf8Write(this,string,offset,length);case"ascii":return asciiWrite(this,string,offset,length);case"latin1":case"binary":return latin1Write(this,string,offset,length);case"base64":return base64Write(this,string,offset,length);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ucs2Write(this,string,offset,length);default:if(loweredCase)throw new TypeError("Unknown encoding: "+encoding);encoding=(""+encoding).toLowerCase();loweredCase=true}}};Buffer.prototype.toJSON=function toJSON(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function base64Slice(buf,start,end){if(start===0&&end===buf.length){return base64.fromByteArray(buf)}else{return base64.fromByteArray(buf.slice(start,end))}}function utf8Slice(buf,start,end){end=Math.min(buf.length,end);var res=[];var i=start;while(i239?4:firstByte>223?3:firstByte>191?2:1;if(i+bytesPerSequence<=end){var secondByte,thirdByte,fourthByte,tempCodePoint;switch(bytesPerSequence){case 1:if(firstByte<128){codePoint=firstByte}break;case 2:secondByte=buf[i+1];if((secondByte&192)===128){tempCodePoint=(firstByte&31)<<6|secondByte&63;if(tempCodePoint>127){codePoint=tempCodePoint}}break;case 3:secondByte=buf[i+1];thirdByte=buf[i+2];if((secondByte&192)===128&&(thirdByte&192)===128){tempCodePoint=(firstByte&15)<<12|(secondByte&63)<<6|thirdByte&63;if(tempCodePoint>2047&&(tempCodePoint<55296||tempCodePoint>57343)){codePoint=tempCodePoint}}break;case 4:secondByte=buf[i+1];thirdByte=buf[i+2];fourthByte=buf[i+3];if((secondByte&192)===128&&(thirdByte&192)===128&&(fourthByte&192)===128){tempCodePoint=(firstByte&15)<<18|(secondByte&63)<<12|(thirdByte&63)<<6|fourthByte&63;if(tempCodePoint>65535&&tempCodePoint<1114112){codePoint=tempCodePoint}}}}if(codePoint===null){codePoint=65533;bytesPerSequence=1}else if(codePoint>65535){codePoint-=65536;res.push(codePoint>>>10&1023|55296);codePoint=56320|codePoint&1023}res.push(codePoint);i+=bytesPerSequence}return decodeCodePointsArray(res)}var MAX_ARGUMENTS_LENGTH=4096;function decodeCodePointsArray(codePoints){var len=codePoints.length;if(len<=MAX_ARGUMENTS_LENGTH){return String.fromCharCode.apply(String,codePoints)}var res="";var i=0;while(ilen)end=len;var out="";for(var i=start;ilen){start=len}if(end<0){end+=len;if(end<0)end=0}else if(end>len){end=len}if(endlength)throw new RangeError("Trying to access beyond buffer length")}Buffer.prototype.readUIntLE=function readUIntLE(offset,byteLength,noAssert){offset=offset>>>0;byteLength=byteLength>>>0;if(!noAssert)checkOffset(offset,byteLength,this.length);var val=this[offset];var mul=1;var i=0;while(++i>>0;byteLength=byteLength>>>0;if(!noAssert){checkOffset(offset,byteLength,this.length)}var val=this[offset+--byteLength];var mul=1;while(byteLength>0&&(mul*=256)){val+=this[offset+--byteLength]*mul}return val};Buffer.prototype.readUInt8=function readUInt8(offset,noAssert){offset=offset>>>0;if(!noAssert)checkOffset(offset,1,this.length);return this[offset]};Buffer.prototype.readUInt16LE=function readUInt16LE(offset,noAssert){offset=offset>>>0;if(!noAssert)checkOffset(offset,2,this.length);return this[offset]|this[offset+1]<<8};Buffer.prototype.readUInt16BE=function readUInt16BE(offset,noAssert){offset=offset>>>0;if(!noAssert)checkOffset(offset,2,this.length);return this[offset]<<8|this[offset+1]};Buffer.prototype.readUInt32LE=function readUInt32LE(offset,noAssert){offset=offset>>>0;if(!noAssert)checkOffset(offset,4,this.length);return(this[offset]|this[offset+1]<<8|this[offset+2]<<16)+this[offset+3]*16777216};Buffer.prototype.readUInt32BE=function readUInt32BE(offset,noAssert){offset=offset>>>0;if(!noAssert)checkOffset(offset,4,this.length);return this[offset]*16777216+(this[offset+1]<<16|this[offset+2]<<8|this[offset+3])};Buffer.prototype.readIntLE=function readIntLE(offset,byteLength,noAssert){offset=offset>>>0;byteLength=byteLength>>>0;if(!noAssert)checkOffset(offset,byteLength,this.length);var val=this[offset];var mul=1;var i=0;while(++i=mul)val-=Math.pow(2,8*byteLength);return val};Buffer.prototype.readIntBE=function readIntBE(offset,byteLength,noAssert){offset=offset>>>0;byteLength=byteLength>>>0;if(!noAssert)checkOffset(offset,byteLength,this.length);var i=byteLength;var mul=1;var val=this[offset+--i];while(i>0&&(mul*=256)){val+=this[offset+--i]*mul}mul*=128;if(val>=mul)val-=Math.pow(2,8*byteLength);return val};Buffer.prototype.readInt8=function readInt8(offset,noAssert){offset=offset>>>0;if(!noAssert)checkOffset(offset,1,this.length);if(!(this[offset]&128))return this[offset];return(255-this[offset]+1)*-1};Buffer.prototype.readInt16LE=function readInt16LE(offset,noAssert){offset=offset>>>0;if(!noAssert)checkOffset(offset,2,this.length);var val=this[offset]|this[offset+1]<<8;return val&32768?val|4294901760:val};Buffer.prototype.readInt16BE=function readInt16BE(offset,noAssert){offset=offset>>>0;if(!noAssert)checkOffset(offset,2,this.length);var val=this[offset+1]|this[offset]<<8;return val&32768?val|4294901760:val};Buffer.prototype.readInt32LE=function readInt32LE(offset,noAssert){offset=offset>>>0;if(!noAssert)checkOffset(offset,4,this.length);return this[offset]|this[offset+1]<<8|this[offset+2]<<16|this[offset+3]<<24};Buffer.prototype.readInt32BE=function readInt32BE(offset,noAssert){offset=offset>>>0;if(!noAssert)checkOffset(offset,4,this.length);return this[offset]<<24|this[offset+1]<<16|this[offset+2]<<8|this[offset+3]};Buffer.prototype.readFloatLE=function readFloatLE(offset,noAssert){offset=offset>>>0;if(!noAssert)checkOffset(offset,4,this.length);return ieee754.read(this,offset,true,23,4)};Buffer.prototype.readFloatBE=function readFloatBE(offset,noAssert){offset=offset>>>0;if(!noAssert)checkOffset(offset,4,this.length);return ieee754.read(this,offset,false,23,4)};Buffer.prototype.readDoubleLE=function readDoubleLE(offset,noAssert){offset=offset>>>0;if(!noAssert)checkOffset(offset,8,this.length);return ieee754.read(this,offset,true,52,8)};Buffer.prototype.readDoubleBE=function readDoubleBE(offset,noAssert){offset=offset>>>0;if(!noAssert)checkOffset(offset,8,this.length);return ieee754.read(this,offset,false,52,8)};function checkInt(buf,value,offset,ext,max,min){if(!Buffer.isBuffer(buf))throw new TypeError('"buffer" argument must be a Buffer instance');if(value>max||valuebuf.length)throw new RangeError("Index out of range")}Buffer.prototype.writeUIntLE=function writeUIntLE(value,offset,byteLength,noAssert){value=+value;offset=offset>>>0;byteLength=byteLength>>>0;if(!noAssert){var maxBytes=Math.pow(2,8*byteLength)-1;checkInt(this,value,offset,byteLength,maxBytes,0)}var mul=1;var i=0;this[offset]=value&255;while(++i>>0;byteLength=byteLength>>>0;if(!noAssert){var maxBytes=Math.pow(2,8*byteLength)-1;checkInt(this,value,offset,byteLength,maxBytes,0)}var i=byteLength-1;var mul=1;this[offset+i]=value&255;while(--i>=0&&(mul*=256)){this[offset+i]=value/mul&255}return offset+byteLength};Buffer.prototype.writeUInt8=function writeUInt8(value,offset,noAssert){value=+value;offset=offset>>>0;if(!noAssert)checkInt(this,value,offset,1,255,0);this[offset]=value&255;return offset+1};Buffer.prototype.writeUInt16LE=function writeUInt16LE(value,offset,noAssert){value=+value;offset=offset>>>0;if(!noAssert)checkInt(this,value,offset,2,65535,0);this[offset]=value&255;this[offset+1]=value>>>8;return offset+2};Buffer.prototype.writeUInt16BE=function writeUInt16BE(value,offset,noAssert){value=+value;offset=offset>>>0;if(!noAssert)checkInt(this,value,offset,2,65535,0);this[offset]=value>>>8;this[offset+1]=value&255;return offset+2};Buffer.prototype.writeUInt32LE=function writeUInt32LE(value,offset,noAssert){value=+value;offset=offset>>>0;if(!noAssert)checkInt(this,value,offset,4,4294967295,0);this[offset+3]=value>>>24;this[offset+2]=value>>>16;this[offset+1]=value>>>8;this[offset]=value&255;return offset+4};Buffer.prototype.writeUInt32BE=function writeUInt32BE(value,offset,noAssert){value=+value;offset=offset>>>0;if(!noAssert)checkInt(this,value,offset,4,4294967295,0);this[offset]=value>>>24;this[offset+1]=value>>>16;this[offset+2]=value>>>8;this[offset+3]=value&255;return offset+4};Buffer.prototype.writeIntLE=function writeIntLE(value,offset,byteLength,noAssert){value=+value;offset=offset>>>0;if(!noAssert){var limit=Math.pow(2,8*byteLength-1);checkInt(this,value,offset,byteLength,limit-1,-limit)}var i=0;var mul=1;var sub=0;this[offset]=value&255;while(++i>0)-sub&255}return offset+byteLength};Buffer.prototype.writeIntBE=function writeIntBE(value,offset,byteLength,noAssert){value=+value;offset=offset>>>0;if(!noAssert){var limit=Math.pow(2,8*byteLength-1);checkInt(this,value,offset,byteLength,limit-1,-limit)}var i=byteLength-1;var mul=1;var sub=0;this[offset+i]=value&255;while(--i>=0&&(mul*=256)){if(value<0&&sub===0&&this[offset+i+1]!==0){sub=1}this[offset+i]=(value/mul>>0)-sub&255}return offset+byteLength};Buffer.prototype.writeInt8=function writeInt8(value,offset,noAssert){value=+value;offset=offset>>>0;if(!noAssert)checkInt(this,value,offset,1,127,-128);if(value<0)value=255+value+1;this[offset]=value&255;return offset+1};Buffer.prototype.writeInt16LE=function writeInt16LE(value,offset,noAssert){value=+value;offset=offset>>>0;if(!noAssert)checkInt(this,value,offset,2,32767,-32768);this[offset]=value&255;this[offset+1]=value>>>8;return offset+2};Buffer.prototype.writeInt16BE=function writeInt16BE(value,offset,noAssert){value=+value;offset=offset>>>0;if(!noAssert)checkInt(this,value,offset,2,32767,-32768);this[offset]=value>>>8;this[offset+1]=value&255;return offset+2};Buffer.prototype.writeInt32LE=function writeInt32LE(value,offset,noAssert){value=+value;offset=offset>>>0;if(!noAssert)checkInt(this,value,offset,4,2147483647,-2147483648);this[offset]=value&255;this[offset+1]=value>>>8;this[offset+2]=value>>>16;this[offset+3]=value>>>24;return offset+4};Buffer.prototype.writeInt32BE=function writeInt32BE(value,offset,noAssert){value=+value;offset=offset>>>0;if(!noAssert)checkInt(this,value,offset,4,2147483647,-2147483648);if(value<0)value=4294967295+value+1;this[offset]=value>>>24;this[offset+1]=value>>>16;this[offset+2]=value>>>8;this[offset+3]=value&255;return offset+4};function checkIEEE754(buf,value,offset,ext,max,min){if(offset+ext>buf.length)throw new RangeError("Index out of range");if(offset<0)throw new RangeError("Index out of range")}function writeFloat(buf,value,offset,littleEndian,noAssert){value=+value;offset=offset>>>0;if(!noAssert){checkIEEE754(buf,value,offset,4,34028234663852886e22,-34028234663852886e22)}ieee754.write(buf,value,offset,littleEndian,23,4);return offset+4}Buffer.prototype.writeFloatLE=function writeFloatLE(value,offset,noAssert){return writeFloat(this,value,offset,true,noAssert)};Buffer.prototype.writeFloatBE=function writeFloatBE(value,offset,noAssert){return writeFloat(this,value,offset,false,noAssert)};function writeDouble(buf,value,offset,littleEndian,noAssert){value=+value;offset=offset>>>0;if(!noAssert){checkIEEE754(buf,value,offset,8,17976931348623157e292,-17976931348623157e292)}ieee754.write(buf,value,offset,littleEndian,52,8);return offset+8}Buffer.prototype.writeDoubleLE=function writeDoubleLE(value,offset,noAssert){return writeDouble(this,value,offset,true,noAssert)};Buffer.prototype.writeDoubleBE=function writeDoubleBE(value,offset,noAssert){return writeDouble(this,value,offset,false,noAssert)};Buffer.prototype.copy=function copy(target,targetStart,start,end){if(!Buffer.isBuffer(target))throw new TypeError("argument should be a Buffer");if(!start)start=0;if(!end&&end!==0)end=this.length;if(targetStart>=target.length)targetStart=target.length;if(!targetStart)targetStart=0;if(end>0&&end=this.length)throw new RangeError("Index out of range");if(end<0)throw new RangeError("sourceEnd out of bounds");if(end>this.length)end=this.length;if(target.length-targetStart=0;--i){target[i+targetStart]=this[i+start]}}else{Uint8Array.prototype.set.call(target,this.subarray(start,end),targetStart)}return len};Buffer.prototype.fill=function fill(val,start,end,encoding){if(typeof val==="string"){if(typeof start==="string"){encoding=start;start=0;end=this.length}else if(typeof end==="string"){encoding=end;end=this.length}if(encoding!==undefined&&typeof encoding!=="string"){throw new TypeError("encoding must be a string")}if(typeof encoding==="string"&&!Buffer.isEncoding(encoding)){throw new TypeError("Unknown encoding: "+encoding)}if(val.length===1){var code=val.charCodeAt(0);if(encoding==="utf8"&&code<128||encoding==="latin1"){val=code}}}else if(typeof val==="number"){val=val&255}if(start<0||this.length>>0;end=end===undefined?this.length:end>>>0;if(!val)val=0;var i;if(typeof val==="number"){for(i=start;i55295&&codePoint<57344){if(!leadSurrogate){if(codePoint>56319){if((units-=3)>-1)bytes.push(239,191,189);continue}else if(i+1===length){if((units-=3)>-1)bytes.push(239,191,189);continue}leadSurrogate=codePoint;continue}if(codePoint<56320){if((units-=3)>-1)bytes.push(239,191,189);leadSurrogate=codePoint;continue}codePoint=(leadSurrogate-55296<<10|codePoint-56320)+65536}else if(leadSurrogate){if((units-=3)>-1)bytes.push(239,191,189)}leadSurrogate=null;if(codePoint<128){if((units-=1)<0)break;bytes.push(codePoint)}else if(codePoint<2048){if((units-=2)<0)break;bytes.push(codePoint>>6|192,codePoint&63|128)}else if(codePoint<65536){if((units-=3)<0)break;bytes.push(codePoint>>12|224,codePoint>>6&63|128,codePoint&63|128)}else if(codePoint<1114112){if((units-=4)<0)break;bytes.push(codePoint>>18|240,codePoint>>12&63|128,codePoint>>6&63|128,codePoint&63|128)}else{throw new Error("Invalid code point")}}return bytes}function asciiToBytes(str){var byteArray=[];for(var i=0;i>8;lo=c%256;byteArray.push(lo);byteArray.push(hi)}return byteArray}function base64ToBytes(str){return base64.toByteArray(base64clean(str))}function blitBuffer(src,dst,offset,length){for(var i=0;i=dst.length||i>=src.length)break;dst[i+offset]=src[i]}return i}function isInstance(obj,type){return obj instanceof type||obj!=null&&obj.constructor!=null&&obj.constructor.name!=null&&obj.constructor.name===type.name}function numberIsNaN(obj){return obj!==obj}}).call(this)}).call(this,require("buffer").Buffer)},{"base64-js":32,buffer:35,ieee754:100}],36:[function(require,module,exports){"use strict";var GetIntrinsic=require("get-intrinsic");var callBind=require("./");var $indexOf=callBind(GetIntrinsic("String.prototype.indexOf"));module.exports=function callBoundIntrinsic(name,allowMissing){var intrinsic=GetIntrinsic(name,!!allowMissing);if(typeof intrinsic==="function"&&$indexOf(name,".prototype.")>-1){return callBind(intrinsic)}return intrinsic}},{"./":37,"get-intrinsic":86}],37:[function(require,module,exports){"use strict";var bind=require("function-bind");var GetIntrinsic=require("get-intrinsic");var $apply=GetIntrinsic("%Function.prototype.apply%");var $call=GetIntrinsic("%Function.prototype.call%");var $reflectApply=GetIntrinsic("%Reflect.apply%",true)||bind.call($call,$apply);var $gOPD=GetIntrinsic("%Object.getOwnPropertyDescriptor%",true);var $defineProperty=GetIntrinsic("%Object.defineProperty%",true);var $max=GetIntrinsic("%Math.max%");if($defineProperty){try{$defineProperty({},"a",{value:1})}catch(e){$defineProperty=null}}module.exports=function callBind(originalFunction){var func=$reflectApply(bind,$call,arguments);if($gOPD&&$defineProperty){var desc=$gOPD(func,"length");if(desc.configurable){$defineProperty(func,"length",{value:1+$max(0,originalFunction.length-(arguments.length-1))})}}return func};var applyBind=function applyBind(){return $reflectApply(bind,$apply,arguments)};if($defineProperty){$defineProperty(module.exports,"apply",{value:applyBind})}else{module.exports.apply=applyBind}},{"function-bind":84,"get-intrinsic":86}],38:[function(require,module,exports){var EventEmitter=require("events").EventEmitter;var storage=require("./lib/storage");var logger=require("./lib/logger");var debug=require("./lib/debug");var copy=require("./lib/copy");var help=require("./lib/help");var perf=require("./lib/perf");var log=require("./lib/log");var getAllRoutes=require("wayfarer/get-all-routes");module.exports=expose;function expose(opts){opts=opts||{};store.storeName="choo-devtools";return store;function store(state,emitter,app){var localEmitter=new EventEmitter;if(typeof window!=="undefined"){logger(state,emitter,opts)}emitter.on("DOMContentLoaded",(function(){if(typeof window==="undefined")return;window.choo={};window.choo.state=state;window.choo.emit=function(){emitter.emit.apply(emitter,arguments)};window.choo.on=function(eventName,listener){emitter.on(eventName,listener)};debug(state,emitter,app,localEmitter);log(state,emitter,app,localEmitter);perf(state,emitter,app,localEmitter);window.choo.copy=copy;if(app.router&&app.router.router){window.choo.routes=Object.keys(getAllRoutes(app.router.router))}storage();help()}))}}},{"./lib/copy":39,"./lib/debug":40,"./lib/help":41,"./lib/log":42,"./lib/logger":43,"./lib/perf":44,"./lib/storage":45,events:81,"wayfarer/get-all-routes":224}],39:[function(require,module,exports){var stateCopy=require("state-copy");var pluck=require("plucker");module.exports=copy;function copy(state){var isStateString=state&&typeof state==="string";var isChooPath=isStateString&&arguments.length===1&&state.indexOf("state.")===0;if(!state||typeof state==="function")state=window.choo.state;if(isChooPath)[].push.call(arguments,{state:window.choo.state});stateCopy(isStateString?pluck.apply(this,arguments):state)}},{plucker:158,"state-copy":215}],40:[function(require,module,exports){var onChange=require("object-change-callsite");var nanologger=require("nanologger");var assert=require("assert");var enabledMessage="Debugging enabled. To disable run: `choo.debug = false`";var disabledMessage="Debugging disabled. We hope it was helpful! 🙌";module.exports=debug;function debug(state,emitter,app,localEmitter){var log=nanologger("choo-devtools");var enabled=window.localStorage.logLevel==="debug";if(enabled)log.info(enabledMessage);state=onChange(state,(function(attr,value,callsite){if(!enabled)return;callsite=callsite.split("\n")[1].replace(/^ +/,"");log.info("state."+attr,value,"\n"+callsite)}));app.state=state;Object.defineProperty(window.choo,"debug",{get:function(){window.localStorage.logLevel="debug";localEmitter.emit("debug",true);enabled=true;return enabledMessage},set:function(bool){assert.equal(typeof bool,"boolean","choo-devtools.debug: bool should be type boolean");window.localStorage.logLevel=bool?"debug":"info";enabled=bool;localEmitter.emit("debug",enabled);if(enabled)log.info(enabledMessage);else log.info(disabledMessage)}})}},{assert:22,nanologger:141,"object-change-callsite":152}],41:[function(require,module,exports){module.exports=help;function help(){Object.defineProperty(window.choo,"help",{get:get,set:noop});function get(){setTimeout((function(){print("copy","Serialize the current state to the clipboard.");print("debug","Enable Choo debug mode.");print("emit","Emit an event in the Choo emitter.");print("help","Print usage information.");print("log","Print the last 150 events emitted.");print("on","Listen for an event in the Choo emitter.");print("once","Listen for an event once in the Choo emitter.");print("perf","Print out performance metrics");print("state","Print the Choo state object.");print("storage","Print browser storage information.")}),0);return"Choo command overview"}}function print(cmd,desc){var color="#cc99cc";console.log(" %cchoo."+cmd,"color: "+color,"— "+desc)}function noop(){}},{}],42:[function(require,module,exports){var removeItems=require("remove-array-items");var scheduler=require("nanoscheduler")();var nanologger=require("nanologger");var _log=nanologger("choo");var clone=require("clone");var MAX_HISTORY_LENGTH=150;module.exports=log;function log(state,emitter,app,localEmitter){var shouldDebug=window.localStorage.logLevel==="debug";var history=[];var i=0;var shouldWarn=true;localEmitter.on("debug",(function(bool){shouldDebug=bool}));window.choo._history=history;window.choo.history=showHistory;Object.defineProperty(window.choo,"log",{get:showHistory,set:noop});Object.defineProperty(window.choo,"history",{get:showHistory,set:noop});emitter.on("*",(function(name,data){i+=1;var entry=new Event(name,data,state);history.push(entry);scheduler.push((function(){var length=history.length;if(length>MAX_HISTORY_LENGTH){removeItems(history,0,length-MAX_HISTORY_LENGTH)}}))}));function showHistory(){setTimeout((function(){console.table(history)}),0);var events=i===1?"event":"events";var msg=i+" "+events+" recorded, showing the last "+MAX_HISTORY_LENGTH+".";if(shouldDebug===false){msg+=" Enable state capture by calling `choo.debug`."}else{msg+=" Disable state capture by calling `choo.debug = false`."}return msg}function Event(name,data,state){this.name=name;this.data=data===undefined?"":data;this.state=shouldDebug?tryClone(state):""}function tryClone(state){try{var _state=clone(state);if(!shouldWarn)shouldWarn=true;return _state}catch(ex){if(shouldWarn){_log.warn("Could not clone your app state. Make sure to have a serializable state so it can be cloned");shouldWarn=false}return""}}}function noop(){}},{clone:53,nanologger:141,nanoscheduler:149,"remove-array-items":168}],43:[function(require,module,exports){var scheduler=require("nanoscheduler")();var nanologger=require("nanologger");var Hooks=require("choo-hooks");module.exports=logger;function logger(state,emitter,opts){var initialRender=true;var hooks=Hooks(emitter);var log=nanologger("choo");hooks.on("log:debug",logger("debug"));hooks.on("log:info",logger("info"));hooks.on("log:warn",logger("warn"));hooks.on("log:error",logger("error"));hooks.on("log:fatal",logger("fatal"));hooks.on("event",(function(eventName,data,timing){if(opts.filter&&!opts.filter(eventName,data,timing))return;if(timing){var duration=timing.duration.toFixed();var level=duration<50?"info":"warn";if(data!==undefined)logger(level)(eventName,data,duration+"ms");else logger(level)(eventName,duration+"ms")}else{if(data!==undefined)logger("info")(eventName,data);else logger("info")(eventName)}}));hooks.on("unhandled",(function(eventName,data){logger("error")("No listeners for "+eventName)}));hooks.on("DOMContentLoaded",(function(timing){if(!timing)return logger("info")("DOMContentLoaded");var level=timing.interactive<1e3?"info":"warn";logger(level)("DOMContentLoaded",timing.interactive+"ms to interactive")}));hooks.on("render",(function(timings){if(!timings||!timings.render)return logger("info")("render");var duration=timings.render.duration.toFixed();var msg="render";if(initialRender){initialRender=false;msg="initial "+msg}var fps=Math.min((600/duration).toFixed(),60);if(fps===60){logger("info")(msg,fps+"fps",duration+"ms")}else{var times={render:timings.render.duration.toFixed()+"ms"};if(timings.morph)times.morph=timings.morph.duration.toFixed()+"ms";logger("warn")(msg,fps+"fps",duration+"ms",times)}}));hooks.on("resource-timing-buffer-full",(function(){logger("error")("The browser's Resource Resource timing buffer is full. Cannot store any more timing information")}));hooks.start();function logger(level){return function(){var args=[];for(var i=0,len=arguments.length;imaxTime)maxTime=totalTime;var median=getMedian(stat.entries);if(median>maxMedian)maxMedian=median;var name=self.rename(stat.name);return new PerfEntry(name,totalTime,median,stat.count)}));var barLength=10;fmt.forEach((function(entry){var totalTime=entry["Total Time (ms)"];var median=entry["Median (ms)"];entry[" "]=createBar(totalTime/maxTime*100/barLength);entry[" "]=createBar(median/maxMedian*100/barLength)}));function createBar(len){var str="";for(var i=0,max=Math.round(len);i is not the same type as the new node <"+newTree.nodeName.toLowerCase()+">.");var morphTiming=nanotiming("choo.morph");nanomorph(self._tree,newTree);morphTiming();renderTiming()})));documentReady((function(){self.emitter.emit(self._events.DOMCONTENTLOADED);self._loaded=true}));startTiming();return this._tree};Choo.prototype.mount=function mount(selector){var mountTiming=nanotiming("choo.mount('"+selector+"')");if(typeof window!=="object"){assert.ok(typeof selector==="string","choo.mount: selector should be type String");this.selector=selector;mountTiming();return this}assert.ok(typeof selector==="string"||typeof selector==="object","choo.mount: selector should be type String or HTMLElement");var self=this;documentReady((function(){var renderTiming=nanotiming("choo.render");var newTree=self.start();if(typeof selector==="string"){self._tree=document.querySelector(selector)}else{self._tree=selector}assert.ok(self._tree,"choo.mount: could not query selector: "+selector);assert.equal(self._tree.nodeName,newTree.nodeName,"choo.mount: The target node <"+self._tree.nodeName.toLowerCase()+"> is not the same type as the new node <"+newTree.nodeName.toLowerCase()+">.");var morphTiming=nanotiming("choo.morph");nanomorph(self._tree,newTree);morphTiming();renderTiming()}));mountTiming()};Choo.prototype.toString=function(location,state){state=state||{};state.components=state.components||{};state.events=Object.assign({},state.events,this._events);assert.notEqual(typeof window,"object","choo.mount: window was found. .toString() must be called in Node, use .start() or .mount() if running in the browser");assert.equal(typeof location,"string","choo.toString: location should be type string");assert.equal(typeof state,"object","choo.toString: state should be type object");this._setCache(state);this._matchRoute(state,location);this.emitter.removeAllListeners();this._stores.forEach((function(initStore){initStore(state)}));var html=this._prerender(state);assert.ok(html,"choo.toString: no valid value returned for the route "+location);assert(!Array.isArray(html),"choo.toString: return value was an array for the route "+location);return typeof html.outerHTML==="string"?html.outerHTML:html.toString()};Choo.prototype._matchRoute=function(state,locationOverride){var location,queryString;if(locationOverride){location=locationOverride.replace(/\?.+$/,"").replace(/\/$/,"");if(!this._hashEnabled)location=location.replace(/#.+$/,"");queryString=locationOverride}else{location=window.location.pathname.replace(/\/$/,"");if(this._hashEnabled)location+=window.location.hash.replace(/^#/,"/");queryString=window.location.search}var matched=this.router.match(location);this._handler=matched.cb;state.href=location;state.query=nanoquery(queryString);state.route=matched.route;state.params=matched.params};Choo.prototype._prerender=function(state){var routeTiming=nanotiming("choo.prerender('"+state.route+"')");var res=this._handler(state,this.emit);routeTiming();return res};Choo.prototype._setCache=function(state){var cache=new Cache(state,this.emitter.emit.bind(this.emitter),this._cache);state.cache=renderComponent;function renderComponent(Component,id){assert.equal(typeof Component,"function","choo.state.cache: Component should be type function");var args=[];for(var i=0,len=arguments.length;i */ module.exports=clipboardCopy;function clipboardCopy(text){if(navigator.clipboard){return navigator.clipboard.writeText(text).catch((function(err){throw err!==undefined?err:new DOMException("The request is not allowed","NotAllowedError")}))}var span=document.createElement("span");span.textContent=text;span.style.whiteSpace="pre";span.style.webkitUserSelect="auto";span.style.userSelect="all";document.body.appendChild(span);var selection=window.getSelection();var range=window.document.createRange();selection.removeAllRanges();range.selectNode(span);selection.addRange(range);var success=false;try{success=window.document.execCommand("copy")}catch(err){console.log("error",err)}selection.removeAllRanges();window.document.body.removeChild(span);return success?Promise.resolve():Promise.reject(new DOMException("The request is not allowed","NotAllowedError"))}},{}],53:[function(require,module,exports){(function(Buffer){(function(){var clone=function(){"use strict";function _instanceof(obj,type){return type!=null&&obj instanceof type}var nativeMap;try{nativeMap=Map}catch(_){nativeMap=function(){}}var nativeSet;try{nativeSet=Set}catch(_){nativeSet=function(){}}var nativePromise;try{nativePromise=Promise}catch(_){nativePromise=function(){}}function clone(parent,circular,depth,prototype,includeNonEnumerable){if(typeof circular==="object"){depth=circular.depth;prototype=circular.prototype;includeNonEnumerable=circular.includeNonEnumerable;circular=circular.circular}var allParents=[];var allChildren=[];var useBuffer=typeof Buffer!="undefined";if(typeof circular=="undefined")circular=true;if(typeof depth=="undefined")depth=Infinity;function _clone(parent,depth){if(parent===null)return null;if(depth===0)return parent;var child;var proto;if(typeof parent!="object"){return parent}if(_instanceof(parent,nativeMap)){child=new nativeMap}else if(_instanceof(parent,nativeSet)){child=new nativeSet}else if(_instanceof(parent,nativePromise)){child=new nativePromise((function(resolve,reject){parent.then((function(value){resolve(_clone(value,depth-1))}),(function(err){reject(_clone(err,depth-1))}))}))}else if(clone.__isArray(parent)){child=[]}else if(clone.__isRegExp(parent)){child=new RegExp(parent.source,__getRegExpFlags(parent));if(parent.lastIndex)child.lastIndex=parent.lastIndex}else if(clone.__isDate(parent)){child=new Date(parent.getTime())}else if(useBuffer&&Buffer.isBuffer(parent)){if(Buffer.allocUnsafe){child=Buffer.allocUnsafe(parent.length)}else{child=new Buffer(parent.length)}parent.copy(child);return child}else if(_instanceof(parent,Error)){child=Object.create(parent)}else{if(typeof prototype=="undefined"){proto=Object.getPrototypeOf(parent);child=Object.create(proto)}else{child=Object.create(prototype);proto=prototype}}if(circular){var index=allParents.indexOf(parent);if(index!=-1){return allChildren[index]}allParents.push(parent);allChildren.push(child)}if(_instanceof(parent,nativeMap)){parent.forEach((function(value,key){var keyChild=_clone(key,depth-1);var valueChild=_clone(value,depth-1);child.set(keyChild,valueChild)}))}if(_instanceof(parent,nativeSet)){parent.forEach((function(value){var entryChild=_clone(value,depth-1);child.add(entryChild)}))}for(var i in parent){var attrs;if(proto){attrs=Object.getOwnPropertyDescriptor(proto,i)}if(attrs&&attrs.set==null){continue}child[i]=_clone(parent[i],depth-1)}if(Object.getOwnPropertySymbols){var symbols=Object.getOwnPropertySymbols(parent);for(var i=0;i=d||(f.line>=d&&(f=l(d,0)),d=g.line,null==b?this.uncomment(g,f,c)?b="un":(this.lineComment(g,f,c),b="line"):"un"==b?this.uncomment(g,f,c):this.lineComment(g,f,c))}}));r.defineExtension("lineComment",(function(c,d,a){a||(a=E);var b=this,e=G(b,c),g=b.getLine(c.line);if(null!=g&&!J(b,c,g)){var f=a.lineComment||e.lineComment;if(f){var m=Math.min(0!=d.ch||d.line==c.line?d.line+1:d.line,b.lastLine()+1),v=null==a.padding?" ":a.padding,k=a.commentBlankLines||c.line==d.line;b.operation((function(){if(a.indent){for(var q=null,h=c.line;hn.length)q=n}for(h=c.line;hm||b.operation((function(){if(0!=a.fullLines){var k=u.test(b.getLine(m));b.replaceRange(v+f,l(m));b.replaceRange(g+v,l(c.line,0));var q=a.blockCommentLead||e.blockCommentLead;if(null!=q)for(var h=c.line+1;h<=m;++h)(h!=m||k)&&b.replaceRange(q+v,l(h,0))}else k=0==K(b.getCursor("to"),d),q=!b.somethingSelected(),b.replaceRange(f,d),k&&b.setSelection(q?d:b.getCursor("from"),d),b.replaceRange(g,c)}))}}));r.defineExtension("uncomment",(function(c,d,a){a||(a=E);var b=this,e=G(b,c),g=Math.min(0!=d.ch||d.line==c.line?d.line:d.line-1,b.lastLine()),f=Math.min(c.line,g),m=a.lineComment||e.lineComment,v=[],k=null==a.padding?" ":a.padding,q;a:if(m){for(var h=f;h<=g;++h){var n=b.getLine(h),t=n.indexOf(m);-1x||(A.slice(w,w+k.length)==k&&(w+=k.length),q=!0,b.replaceRange("",l(p,x),l(p,w)))}}));if(q)return!0}var y=a.blockCommentStart||e.blockCommentStart,z=a.blockCommentEnd||e.blockCommentEnd;if(!y||!z)return!1;var H=a.blockCommentLead||e.blockCommentLead,C=b.getLine(f),D=C.indexOf(y);if(-1==D)return!1;var F=g==f?C:b.getLine(g),B=F.indexOf(z,g==f?D+y.length:0);a=l(f,D+1);e=l(g,B+1);if(-1==B||!/comment/.test(b.getTokenTypeAt(a))||!/comment/.test(b.getTokenTypeAt(e))||-1c.ch&&(d.end=c.ch,d.string=d.string.slice(0,c.ch-d.start)):d={start:c.ch,end:c.ch,string:"",state:d.state,type:"."==d.string?"property":null};for(g=d;"property"==g.type;){g=l(a,r(c.line,g.start));if("."!=g.string)return;g=l(a,r(c.line,g.start));if(!p)var p=[];p.push(g)}return{list:u(d,p,b,e),from:r(c.line,d.start),to:r(c.line,d.end)}}}}function v(a,b){a=a.getTokenAt(b);b.ch==a.start+1&&"."==a.string.charAt(0)?(a.end=a.start,a.string=".",a.type="property"):/^\.[\w$_]*$/.test(a.string)&&(a.type="property",a.start++,a.string=a.string.replace(/\./,""));return a}function u(a,b,l,e){function c(h){var k;if(k=0==h.lastIndexOf(p,0)){a:if(Array.prototype.indexOf)k=-1!=g.indexOf(h);else{for(k=g.length;k--;)if(g[k]===h){k=!0;break a}k=!1}k=!k}k&&g.push(h)}function d(h){"string"==typeof h?q(w,c):h instanceof Array?q(x,c):h instanceof Function&&q(y,c);if(Object.getOwnPropertyNames&&Object.getPrototypeOf)for(;h;h=Object.getPrototypeOf(h))Object.getOwnPropertyNames(h).forEach(c);else for(var k in h)c(k)}var g=[],p=a.string,n=e&&e.globalScope||window;if(b&&b.length){a=b.pop();var f;a.type&&0===a.type.indexOf("variable")?(e&&e.additionalContext&&(f=e.additionalContext[a.string]),e&&!1===e.useGlobalScope||(f=f||n[a.string])):"string"==a.type?f="":"atom"==a.type?f=1:"function"==a.type&&(null==n.jQuery||"$"!=a.string&&"jQuery"!=a.string||"function"!=typeof n.jQuery?null!=n._&&"_"==a.string&&"function"==typeof n._&&(f=n._()):f=n.jQuery());for(;null!=f&&b.length;)f=f[b.pop().string];null!=f&&d(f)}else{for(b=a.state.localVars;b;b=b.next)c(b.name);for(f=a.state.context;f;f=f.prev)for(b=f.vars;b;b=b.next)c(b.name);for(b=a.state.globalVars;b;b=b.next)c(b.name);if(e&&null!=e.additionalContext)for(var z in e.additionalContext)c(z);e&&!1===e.useGlobalScope||d(n);q(l,c)}return g}var r=m.Pos;m.registerHelper("hint","javascript",(function(a,b){return t(a,A,(function(l,e){return l.getTokenAt(e)}),b)}));m.registerHelper("hint","coffeescript",(function(a,b){return t(a,B,v,b)}));var w="charAt charCodeAt indexOf lastIndexOf substring substr slice trim trimLeft trimRight toUpperCase toLowerCase split concat match replace search".split(" "),x="length concat join splice push pop shift unshift slice reverse sort indexOf lastIndexOf every some filter forEach map reduce reduceRight ".split(" "),y=["prototype","apply","call","bind"],A="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(" "),B="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(" ")}))},{"../../lib/codemirror":58}],56:[function(require,module,exports){(function(h){"object"==typeof exports&&"object"==typeof module?h(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],h):h(CodeMirror)})((function(h){function B(a,b){this.cm=a;this.options=b;this.widget=null;this.tick=this.debounce=0;this.startPos=this.cm.getCursor("start");this.startLen=this.cm.getLine(this.startPos.line).length-this.cm.getSelection().length;if(this.options.updateOnCursorActivity){var c=this;a.on("cursorActivity",this.activityFunc=function(){c.cursorActivity()})}}function K(a,b){function c(r,g){var m="string"!=typeof g?function(k){return g(k,b)}:d.hasOwnProperty(g)?d[g]:g;p[r]=m}var d={Up:function(){b.moveFocus(-1)},Down:function(){b.moveFocus(1)},PageUp:function(){b.moveFocus(-b.menuSize()+1,!0)},PageDown:function(){b.moveFocus(b.menuSize()-1,!0)},Home:function(){b.setFocus(0)},End:function(){b.setFocus(b.length-1)},Enter:b.pick,Tab:b.pick,Esc:b.close};/Mac/.test(navigator.platform)&&(d["Ctrl-P"]=function(){b.moveFocus(-1)},d["Ctrl-N"]=function(){b.moveFocus(1)});var e=a.options.customKeys,p=e?{}:d;if(e)for(var f in e)e.hasOwnProperty(f)&&c(f,e[f]);if(a=a.options.extraKeys)for(f in a)a.hasOwnProperty(f)&&c(f,a[f]);return p}function C(a,b){for(;b&&b!=a;){if("LI"===b.nodeName.toUpperCase()&&b.parentNode==a)return b;b=b.parentNode}}function D(a,b){this.id="cm-complete-"+Math.floor(Math.random(1e6));this.completion=a;this.data=b;this.picked=!1;var c=this,d=a.cm,e=d.getInputField().ownerDocument,p=e.defaultView||e.parentWindow,f=this.hints=e.createElement("ul");f.setAttribute("role","listbox");f.setAttribute("aria-expanded","true");f.id=this.id;f.className="CodeMirror-hints "+a.cm.options.theme;this.selectedHint=b.selectedHint||0;for(var r=b.list,g=0;gf.clientHeight+1:!1,u;setTimeout((function(){u=d.getScrollInfo()}));if(0z&&(f.style.height=(y=z)+"px"),f.style.top=(x=g.top-y)+q+"px",E=!1):f.style.height=t-n.top-2+"px"}q=n.right-k;F&&(q+=d.display.nativeBarWidth);0k&&(f.style.width=k-5+"px",q-=n.right-n.left-k),f.style.left=(w=Math.max(g.left-q-m,0))+"px");if(F)for(g=f.firstChild;g;g=g.nextSibling)g.style.paddingRight=d.display.nativeBarWidth+"px";d.addKeyMap(this.keyMap=K(a,{moveFocus:function(l,v){c.changeActive(c.selectedHint+l,v)},setFocus:function(l){c.changeActive(l)},menuSize:function(){return c.screenAmount()},length:r.length,close:function(){a.close()},pick:function(){c.pick()},data:b}));if(a.options.closeOnUnfocus){var G;d.on("blur",this.onBlur=function(){G=setTimeout((function(){a.close()}),100)});d.on("focus",this.onFocus=function(){clearTimeout(G)})}d.on("scroll",this.onScroll=function(){var l=d.getScrollInfo(),v=d.getWrapperElement().getBoundingClientRect();u||(u=d.getScrollInfo());var H=x+u.top-l.top,A=H-(p.pageYOffset||(e.documentElement||e.body).scrollTop);E||(A+=f.offsetHeight);if(A<=v.top||A>=v.bottom)return a.close();f.style.top=H+"px";f.style.left=w+u.left-l.left+"px"});h.on(f,"dblclick",(function(l){(l=C(f,l.target||l.srcElement))&&null!=l.hintId&&(c.changeActive(l.hintId),c.pick())}));h.on(f,"click",(function(l){(l=C(f,l.target||l.srcElement))&&null!=l.hintId&&(c.changeActive(l.hintId),a.options.completeOnSingleClick&&c.pick())}));h.on(f,"mousedown",(function(){setTimeout((function(){d.focus()}),20)}));g=this.getSelectedHintRange();0===g.from&&0===g.to||this.scrollToActive();h.signal(b,"select",r[this.selectedHint],f.childNodes[this.selectedHint]);return!0}function L(a,b){if(!a.somethingSelected())return b;a=[];for(var c=0;c=this.data.list.length?a=b?this.data.list.length-1:0:0>a&&(a=b?0:this.data.list.length-1);if(this.selectedHint!=a){if(b=this.hints.childNodes[this.selectedHint])b.className=b.className.replace(" CodeMirror-hint-active",""),b.removeAttribute("aria-selected");b=this.hints.childNodes[this.selectedHint=a];b.className+=" CodeMirror-hint-active";b.setAttribute("aria-selected","true");this.completion.cm.getInputField().setAttribute("aria-activedescendant",b.id);this.scrollToActive();h.signal(this.data,"select",this.data.list[this.selectedHint],b)}},scrollToActive:function(){var a=this.getSelectedHintRange(),b=this.hints.childNodes[a.from];a=this.hints.childNodes[a.to];var c=this.hints.firstChild;b.offsetTopthis.hints.scrollTop+this.hints.clientHeight&&(this.hints.scrollTop=a.offsetTop+a.offsetHeight-this.hints.clientHeight+c.offsetTop)},screenAmount:function(){return Math.floor(this.hints.clientHeight/this.hints.firstChild.offsetHeight)||1},getSelectedHintRange:function(){var a=this.completion.options.scrollMargin||0;return{from:Math.max(0,this.selectedHint-a),to:Math.min(this.data.list.length-1,this.selectedHint+a)}}};h.registerHelper("hint","auto",{resolve:function(a,b){var c=a.getHelpers(b,"hint"),d;return c.length?(a=function(e,p,f){function r(m){if(m==g.length)return p(null);I(g[m],e,f,(function(k){k&&0,]/,closeOnPick:!0,closeOnUnfocus:!0,updateOnCursorActivity:!0,completeOnSingleClick:!0,container:null,customKeys:null,extraKeys:null,paddingForScrollbar:!0,moveOnOverlap:!0};h.defineOption("hintOptions",null)}))},{"../../lib/codemirror":58}],57:[function(require,module,exports){(function(global){(function(){var $jscomp=$jscomp||{};$jscomp.scope={};$jscomp.findInternal=function(a,d,c){a instanceof String&&(a=String(a));for(var e=a.length,f=0;f>>0,$jscomp.propertyToPolyfillSymbol[f]=$jscomp.IS_SYMBOL_NATIVE?$jscomp.global.Symbol(f):$jscomp.POLYFILL_PREFIX+c+"$"+f),$jscomp.defineProperty(e,$jscomp.propertyToPolyfillSymbol[f],{configurable:!0,writable:!0,value:d})))};$jscomp.polyfill("Array.prototype.find",(function(a){return a?a:function(d,c){return $jscomp.findInternal(this,d,c).v}}),"es6","es3");(function(a){"object"==typeof exports&&"object"==typeof module?a(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],a):a(CodeMirror)})((function(a){function d(b){b.state.markedSelection&&b.operation((function(){r(b)}))}function c(b){b.state.markedSelection&&b.state.markedSelection.length&&b.operation((function(){f(b)}))}function e(b,g,h,k){if(0!=p(g,h))for(var l=b.state.markedSelection,n=b.state.markedSelectionStyle,q=g.line;;){var t=q==g.line?g:v(q,0);q+=u;var w=q>=h.line,x=w?h:v(q,0);t=b.markText(t,x,{className:n});null==k?l.push(t):l.splice(k++,0,t);if(w)break}}function f(b){b=b.state.markedSelection;for(var g=0;g=p(h,l.from))return m(b);for(;0p(g,l.from)&&(l.to.line-g.linep(h,n.to);)k.pop().clear(),n=k[k.length-1].find();0>>0,$jscomp.propertyToPolyfillSymbol[M]=$jscomp.IS_SYMBOL_NATIVE?$jscomp.global.Symbol(M):$jscomp.POLYFILL_PREFIX+D+"$"+M),$jscomp.defineProperty(v,$jscomp.propertyToPolyfillSymbol[M],{configurable:!0,writable:!0,value:E})))};$jscomp.polyfill("Array.prototype.find",(function(y){return y?y:function(E,D){return $jscomp.findInternal(this,E,D).v}}),"es6","es3");(function(y,E){"object"===typeof exports&&"undefined"!==typeof module?module.exports=E():"function"===typeof define&&define.amd?define(E):(y=y||self,y.CodeMirror=E())})(this,(function(){function y(a){return new RegExp("(^|\\s)"+a+"(?:$|\\s)\\s*")}function E(a){for(var b=a.childNodes.length;0f||f>=b)return e+(b-c);e+=f-c;e+=d-e%d;c=f+1}}function ea(a,b){for(var d=0;d=b)return c+Math.min(g,b-e);e+=f-c;e+=d-e%d;c=f+1;if(e>=b)return c}}function id(a){for(;vc.length<=a;)vc.push(J(vc)+" ");return vc[a]}function J(a){return a[a.length-1]}function wc(a,b){for(var d=[],c=0;cd?0d?-1:1;;){if(b==d)return b;var e=(b+d)/2;e=0>c?Math.ceil(e):Math.floor(e);if(e==b)return a(e)?b:d;a(e)?d=e:b=e+c}}function Bg(a,b,d,c){if(!a)return c(b,d,"ltr",0);for(var e=!1,f=0;fb||b==d&&g.to==b)c(Math.max(g.from,b),Math.min(g.to,d),1==g.level?"rtl":"ltr",f),e=!0}e||c(b,d,"ltr")}function Kb(a,b,d){var c;Lb=null;for(var e=0;eb)return e;f.to==b&&(f.from!=f.to&&"before"==d?c=e:Lb=e);f.from==b&&(f.from!=f.to&&"before"!=d?c=e:Lb=e)}return null!=c?c:Lb}function Ja(a,b){var d=a.order;null==d&&(d=a.order=Cg(a.text,b));return d}function ta(a,b,d){if(a.removeEventListener)a.removeEventListener(b,d,!1);else if(a.detachEvent)a.detachEvent("on"+b,d);else{var c=(a=a._handlers)&&a[b];c&&(d=ea(c,d),-1b||b>=a.size)throw Error("There is no line "+(b+a.first)+" in the document.");for(;!a.lines;)for(var d=0;;++d){var c=a.children[d],e=c.chunkSize();if(b=a.first&&bB(a,b)?b:a}function Bc(a,b){return 0>B(a,b)?a:b}function C(a,b){if(b.lined)return t(d,w(a,d).text.length);a=w(a,b.line).text.length;d=b.ch;b=null==d||d>a?t(b.line,a):0>d?t(b.line,0):b;return b}function xe(a,b){for(var d=[],c=0;cp&&e.splice(m,1,p,e[m+1],u);m+=2;n=Math.min(p,u)}if(q)if(l.opaque)e.splice(r,m-r,p,"overlay "+q),m=r+2;else for(;ra.options.maxHighlightLength&&$a(a.doc.mode,c.state),f=ye(a,b,c);e&&(c.state=e);b.stateAfter=c.save(!e);b.styles=f.styles;f.classes?b.styleClasses=f.classes:b.styleClasses&&(b.styleClasses=null);d===a.doc.highlightFrontier&&(a.doc.modeFrontier=Math.max(a.doc.modeFrontier,++a.doc.highlightFrontier))}return b.styles}function Ob(a,b,d){var c=a.doc,e=a.display;if(!c.mode.startState)return new Fa(c,!0,b);var f=Fg(a,b,d),g=f>c.first&&w(c,f-1).stateAfter,h=g?Fa.fromSaved(c,g,f):new Fa(c,we(c.mode),f);c.iter(f,b,(function(k){td(a,k.text,h);var l=h.line;k.stateAfter=l==b-1||0==l%5||l>=e.viewFrom&&le;e++){c&&(c[0]=od(a,d).mode);var f=a.token(b,d);if(b.pos>b.start)return f}throw Error("Mode "+a.name+" failed to advance stream.")}function Ce(a,b,d,c){var e=a.doc,f=e.mode;b=C(e,b);var g=w(e,b.line);d=Ob(a,b.line,d);a=new X(g.text,a.options.tabSize,d);var h;for(c&&(h=[]);(c||a.posa.options.maxHighlightLength){h=!1;g&&td(a,b,c,m.pos);m.pos=b.length;var p=null}else p=Ee(ud(d,m,c.state,n),f);if(n){var q=n[0].name;q&&(p="m-"+(p?q+" "+p:q))}if(!h||l!=p){for(;kg;--b){if(b<=f.first)return f.first;var h=w(f,b-1),k=h.stateAfter;if(k&&(!d||b+(k instanceof Cc?k.lookAhead:0)<=f.modeFrontier))return b;h=wa(h.text,null,a.options.tabSize);if(null==e||c>h)e=b-1,c=h}return e}function Gg(a,b){a.modeFrontier=Math.min(a.modeFrontier,b);if(!(a.highlightFrontierd;c--){var e=w(a,c).stateAfter;if(e&&(!(e instanceof Cc)||c+e.lookAhead=a:k.to>a);(g||(g=[])).push(new Dc(l,k.from,m?null:k.to))}}d=g;var n;if(c)for(g=0;g=e:h.to>e)||h.from==e&&"bookmark"==k.type&&(!f||h.marker.insertLeft))l=null==h.from||(k.inclusiveLeft?h.from<=e:h.fromB(g.to,e.from)||0k||!d.inclusiveLeft&&!k)&&h.push({from:g.from,to:e.from});(0wd(e,d.marker)))var e=d.marker;return e}function Ie(a,b,d,c,e){a=w(a,b);if(a=Ka&&a.markedSpans)for(b=0;b=k||0>=h&&0<=k)&&(0>=h&&(f.marker.inclusiveRight&&e.inclusiveLeft?0<=B(g.to,d):0=B(g.from,c):0>B(g.from,c))))return!0}}}function za(a){for(var b;b=sb(a,!0);)a=b.find(-1,!0).line;return a}function xd(a,b){a=w(a,b);var d=za(a);return a==d?b:N(d)}function Je(a,b){if(b>a.lastLine())return b;var d=w(a,b);if(!Pa(a,d))return b;for(;a=sb(d,!1);)d=a.find(1,!0).line;return N(d)+1}function Pa(a,b){var d=Ka&&b.markedSpans;if(d)for(var c,e=0;eb.maxLineLength&&(b.maxLineLength=c,b.maxLine=d)}))}function Ke(a,b){if(!a||/^\s*$/.test(a))return null;b=b.addModeClass?Ig:Jg;return b[a]||(b[a]=a.replace(/\S+/g,"cm-$&"))}function Le(a,b){var d=M("span",null,null,fa?"padding-right: .1px":null);d={pre:M("pre",[d],"CodeMirror-line"),content:d,col:0,pos:0,cm:a,trailingSpace:!1,splitSpaces:a.getOption("lineWrapping")};b.measure={};for(var c=0;c<=(b.rest?b.rest.length:0);c++){var e=c?b.rest[c-1]:b.line,f=void 0;d.pos=0;d.addToken=Kg;var g=a.display.measure;if(null!=Ad)g=Ad;else{var h=D(g,document.createTextNode("AخA")),k=Qb(h,0,1).getBoundingClientRect();h=Qb(h,1,2).getBoundingClientRect();E(g);g=k&&k.left!=k.right?Ad=3>h.right-k.right:!1}g&&(f=Ja(e,a.doc.direction))&&(d.addToken=Lg(d.addToken,f));d.map=[];var l=b!=a.display.externalMeasured&&N(e);a:{var m=h=k=g=void 0,n=void 0,p=void 0,q=void 0;f=d;l=Ae(a,e,l);var r=e.markedSpans,u=e.text,A=0;if(r)for(var Y=u.length,x=0,P=1,K="",Q=0;;){if(Q==x){n=m=h=p="";k=g=null;Q=Infinity;for(var S=[],F=void 0,R=0;Rx||L.collapsed&&H.to==x&&H.from==x)){null!=H.to&&H.to!=x&&Q>H.to&&(Q=H.to,m="");L.className&&(n+=" "+L.className);L.css&&(p=(p?p+";":"")+L.css);L.startStyle&&H.from==x&&(h+=" "+L.startStyle);L.endStyle&&H.to==Q&&(F||(F=[])).push(L.endStyle,H.to);L.title&&((g||(g={})).title=L.title);if(L.attributes)for(var ha in L.attributes)(g||(g={}))[ha]=L.attributes[ha];L.collapsed&&(!k||0>wd(k.marker,L))&&(k=H)}else H.from>x&&Q>H.from&&(Q=H.from)}if(F)for(R=0;R=Y)break;for(S=Math.min(Y,Q);;){if(K){F=x+K.length;k||(R=F>S?K.slice(0,S-x):K,f.addToken(f,R,q?q+n:n,h,x+R.length==Q?m:"",p,g));if(F>=S){K=K.slice(S-x);x=S;break}x=F;h=""}K=u.slice(A,A=l[P++]);q=Ke(l[P++],f.cm.options)}}else for(g=1;g=m.offsetWidth&&2T))),h=Bd?v("span","​"):v("span"," ",null,"display: inline-block; width: 1px; margin-right: -1px"),h.setAttribute("cm-text",""),f.call(e,0,0,k.call(g,h)));0==c?(b.measure.map=d.map,b.measure.cache={}):((b.measure.maps||(b.measure.maps=[])).push(d.map),(b.measure.caches||(b.measure.caches=[])).push({}))}fa&&(ha=d.content.lastChild,/\bcm-tab\b/.test(ha.className)||ha.querySelector&&ha.querySelector(".cm-tab"))&&(d.content.className="cm-tab-wrap-hack");W(a,"renderLine",a,b.line,d.pre);d.pre.className&&(d.textClass=fd(d.pre.className,d.textClass||""));return d}function Mg(a){var b=v("span","•","cm-invalidchar");b.title="\\u"+a.charCodeAt(0).toString(16);b.setAttribute("aria-label",b.title);return b}function Kg(a,b,d,c,e,f,g){if(b){if(a.splitSpaces){var h=a.trailingSpace;if(1T?h.appendChild(v("span",[r])):h.appendChild(r);a.map.push(a.pos,a.pos+q,r);a.col+=q;a.pos+=q}if(!p)break;n+=q+1;"\t"==p[0]?(p=a.cm.options.tabSize,p-=a.col%p,q=h.appendChild(v("span",id(p),"cm-tab")),q.setAttribute("role","presentation"),q.setAttribute("cm-text","\t"),a.col+=p):("\r"==p[0]||"\n"==p[0]?(q=h.appendChild(v("span","\r"==p[0]?"␍":"␤","cm-invalidchar")),q.setAttribute("cm-text",p[0])):(q=a.cm.options.specialCharPlaceholder(p[0]),q.setAttribute("cm-text",p[0]),G&&9>T?h.appendChild(v("span",[q])):h.appendChild(q)),a.col+=1);a.map.push(a.pos,a.pos+1,q);a.pos++}}else a.col+=b.length,h=document.createTextNode(k),a.map.push(a.pos,a.pos+b.length,h),G&&9>T&&(m=!0),a.pos+=b.length;a.trailingSpace=32==k.charCodeAt(b.length-1);if(d||c||e||m||f||g){b=d||"";c&&(b+=c);e&&(b+=e);c=v("span",[h],b,f);if(g)for(var u in g)g.hasOwnProperty(u)&&"style"!=u&&"class"!=u&&c.setAttribute(u,g[u]);return a.content.appendChild(c)}a.content.appendChild(h)}}function Lg(a,b){return function(d,c,e,f,g,h,k){e=e?e+" cm-force-border":"cm-force-border";for(var l=d.pos,m=l+c.length;;){for(var n=void 0,p=0;pl&&n.from<=l);p++);if(n.to>=m)return a(d,c,e,f,g,h,k);a(d,c.slice(0,n.to-l),e,f,null,h,k);f=null;c=c.slice(n.to-l);l=n.to}}}function Me(a,b,d,c){var e=!c&&d.widgetNode;e&&a.map.push(a.pos,a.pos+b,e);!c&&a.cm.display.input.needsContentAttribute&&(e||(e=a.content.appendChild(document.createElement("span"))),e.setAttribute("cm-marker",d.id));e&&(a.cm.display.input.setUneditable(e),a.content.appendChild(e));a.pos+=b;a.trailingSpace=!1}function Ne(a,b,d){for(var c=this.line=b,e;c=sb(c,!1);)c=c.find(1,!0).line,(e||(e=[])).push(c);this.size=(this.rest=e)?N(J(this.rest))-d+1:1;this.node=this.text=null;this.hidden=Pa(a,b)}function Fc(a,b,d){var c=[],e;for(e=b;eT&&(a.node.style.zIndex=2));return a.node}function Pe(a,b){var d=a.display.externalMeasured;return d&&d.line==b.line?(a.display.externalMeasured=null,b.measure=d.measure,d.built):Le(a,b)}function Cd(a,b){var d=b.bgClass?b.bgClass+" "+(b.line.bgClass||""):b.line.bgClass;d&&(d+=" CodeMirror-linebackground");if(b.background)d?b.background.className=d:(b.background.parentNode.removeChild(b.background),b.background=null);else if(d){var c=Sb(b);b.background=c.insertBefore(v("div",null,d),c.firstChild);a.display.input.setUneditable(b.background)}b.line.wrapClass?Sb(b).className=b.line.wrapClass:b.node!=b.text&&(b.node.className="");b.text.className=(b.textClass?b.textClass+" "+(b.line.textClass||""):b.line.textClass)||""}function Qe(a,b,d,c){b.gutter&&(b.node.removeChild(b.gutter),b.gutter=null);b.gutterBackground&&(b.node.removeChild(b.gutterBackground),b.gutterBackground=null);if(b.line.gutterClass){var e=Sb(b);b.gutterBackground=v("div",null,"CodeMirror-gutter-background "+b.line.gutterClass,"left: "+(a.options.fixedGutter?c.fixedPos:-c.gutterTotalWidth)+"px; width: "+c.gutterTotalWidth+"px");a.display.input.setUneditable(b.gutterBackground);e.insertBefore(b.gutterBackground,b.text)}e=b.line.gutterMarkers;if(a.options.lineNumbers||e){var f=Sb(b),g=b.gutter=v("div",null,"CodeMirror-gutter-wrapper","left: "+(a.options.fixedGutter?c.fixedPos:-c.gutterTotalWidth)+"px");g.setAttribute("aria-hidden","true");a.display.input.setUneditable(g);f.insertBefore(g,b.text);b.line.gutterClass&&(g.className+=" "+b.line.gutterClass);!a.options.lineNumbers||e&&e["CodeMirror-linenumbers"]||(b.lineNumber=g.appendChild(v("div",qd(a.options,d),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+c.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+a.display.lineNumInnerWidth+"px")));if(e)for(b=0;bd)return{map:a.measure.maps[b],cache:a.measure.caches[b],before:!0}}}function Fd(a,b){if(b>=a.display.viewFrom&&b=a.lineN&&bp;p++){for(;h&&kd(b.line.text.charAt(g.coverStart+h));)--h;for(;g.coverStart+kT&&0==h&&k==g.coverEnd-g.coverStart)var q=c.parentNode.getBoundingClientRect();else{q=Qb(c,h,k).getClientRects();k=We;if("left"==m)for(l=0;lT&&((p=!window.screen||null==screen.logicalXDPI||screen.logicalXDPI==screen.deviceXDPI)||(null!=Hd?p=Hd:(m=D(a.display.measure,v("span","x")),p=m.getBoundingClientRect(),m=Qb(m,0,1).getBoundingClientRect(),p=Hd=1T)||h||q&&(q.left||q.right)||(q=(q=c.parentNode.getClientRects()[0])?{left:q.left,right:q.left+ub(a.display),top:q.top,bottom:q.bottom}:We);c=q.top-b.rect.top;h=q.bottom-b.rect.top;p=(c+h)/2;m=b.view.measure.heights;for(g=0;gb)f=k-h,e=f-1,b>=k&&(g="right");if(null!=e){c=a[l+2];h==k&&d==(c.insertLeft?"left":"right")&&(g=d);if("left"==d&&0==e)for(;l&&a[l-2]==a[l-3]&&a[l-1].insertLeft;)c=a[(l-=3)+2],g="left";if("right"==d&&e==k-h)for(;l=c.text.length?(l=c.text.length,b="before"):0>=l&&(l=0,b="after");if(!k)return g("before"==b?l-1:l,"before"==b);var m=Kb(k,l,b),n=Lb;m=h(l,m,"before"==b);null!=n&&(m.other=h(l,n,"before"!=b));return m}function bf(a,b){var d=0;b=C(a.doc,b);a.options.lineWrapping||(d=ub(a.display)*b.ch);b=w(a.doc,b.line);a=Ga(b)+a.display.lineSpace.offsetTop;return{left:d,right:d,top:a,bottom:a+b.height}}function Jd(a,b,d,c,e){a=t(a,b,d);a.xRel=e;c&&(a.outside=c);return a}function Kd(a,b,d){var c=a.doc;d+=a.display.viewOffset;if(0>d)return Jd(c.first,0,null,-1,-1);var e=bb(c,d),f=c.first+c.size-1;if(e>f)return Jd(c.first+c.size-1,w(c,f).text.length,null,1,1);0>b&&(b=0);for(var g=w(c,e);;){f=Qg(a,g,e,b,d);var h=void 0;var k=f.ch+(0k)&&(!h||0>wd(h,m.marker))&&(h=m.marker)}if(!h)return f;f=h.find(1);if(f.line==e)return f;g=w(c,e=f.line)}}function cf(a,b,d,c){c-=Id(b);b=b.text.length;var e=Jb((function(f){return Aa(a,d,f-1).bottom<=c}),b,0);b=Jb((function(f){return Aa(a,d,f).top>c}),e,b);return{begin:e,end:b}}function df(a,b,d,c){d||(d=eb(a,b));c=Hc(a,b,Aa(a,d,c),"line").top;return cf(a,b,d,c)}function Ld(a,b,d,c){return a.bottom<=d?!1:a.top>d?!0:(c?a.left:a.right)>b}function Qg(a,b,d,c,e){e-=Ga(b);var f=eb(a,b),g=Id(b),h=0,k=b.text.length,l=!0,m=Ja(b,a.doc.direction);m&&(m=(a.options.lineWrapping?Rg:Sg)(a,b,d,f,m,c,e),h=(l=1!=m.level)?m.from:m.to-1,k=l?m.to:m.from-1);var n=null,p=null;m=Jb((function(r){var u=Aa(a,f,r);u.top+=g;u.bottom+=g;if(!Ld(u,c,e,!1))return!1;u.top<=e&&u.left<=c&&(n=r,p=u);return!0}),h,k);var q=!1;p?(h=c-p.left=q.bottom?1:0);m=se(b.text,m,1);return Jd(d,m,l,q,c-h)}function Sg(a,b,d,c,e,f,g){var h=Jb((function(m){m=e[m];var n=1!=m.level;return Ld(Ba(a,t(d,n?m.to:m.from,n?"before":"after"),"line",b,c),f,g,!0)}),0,e.length-1),k=e[h];if(0g&&(k=e[h-1])}return k}function Rg(a,b,d,c,e,f,g){g=cf(a,b,c,g);d=g.begin;g=g.end;/\s/.test(b.text.charAt(g-1))&&g--;for(var h=b=null,k=0;k=g||l.to<=d)){var m=Aa(a,c,1!=l.level?Math.min(g,l.to)-1:Math.max(d,l.from)).right;m=mm)b=l,h=m}}b||(b=e[e.length-1]);b.fromg&&(b={from:b.from,to:g,level:b.level});return b}function vb(a){if(null!=a.cachedTextHeight)return a.cachedTextHeight;if(null==fb){fb=v("pre",null,"CodeMirror-line-like");for(var b=0;49>b;++b)fb.appendChild(document.createTextNode("x")),fb.appendChild(v("br"));fb.appendChild(document.createTextNode("x"))}D(a.measure,fb);b=fb.offsetHeight/50;3=a.display.viewTo)return null;b-=a.display.viewFrom;if(0>b)return null;a=a.display.view;for(var d=0;db)return d}function ma(a,b,d,c){null==b&&(b=a.doc.first);null==d&&(d=a.doc.first+a.doc.size);c||(c=0);var e=a.display;c&&db)&&(e.updateLineNumbers=b);a.curOp.viewChanged=!0;if(b>=e.viewTo)Ka&&xd(a.doc,b)e.viewFrom?Ra(a):(e.viewFrom+=c,e.viewTo+=c);else if(b<=e.viewFrom&&d>=e.viewTo)Ra(a);else if(b<=e.viewFrom){var f=Jc(a,d,d+c,1);f?(e.view=e.view.slice(f.index),e.viewFrom=f.lineN,e.viewTo+=c):Ra(a)}else if(d>=e.viewTo)(f=Jc(a,b,b,-1))?(e.view=e.view.slice(0,f.index),e.viewTo=f.lineN):Ra(a);else{f=Jc(a,b,b,-1);var g=Jc(a,d,d+c,1);f&&g?(e.view=e.view.slice(0,f.index).concat(Fc(a,f.lineN,g.lineN)).concat(e.view.slice(g.index)),e.viewTo+=c):Ra(a)}if(a=e.externalMeasured)d=e.lineN&&b=c.viewTo||(a=c.view[db(a,b)],null!=a.node&&(a=a.changes||(a.changes=[]),-1==ea(a,d)&&a.push(d)))}function Ra(a){a.display.viewFrom=a.display.viewTo=a.doc.first;a.display.view=[];a.display.viewOffset=0}function Jc(a,b,d,c){var e=db(a,b),f=a.display.view;if(!Ka||d==a.doc.first+a.doc.size)return{index:e,lineN:d};for(var g=a.display.viewFrom,h=0;hc?0:f.length-1))return null;d+=c*f[e-(0>c?1:0)].size;e+=c}return{index:e,lineN:d}}function ff(a){a=a.display.view;for(var b=0,d=0;d=a.display.viewTo||k.to().liner&&(r=0);r=Math.round(r);A=Math.round(A);h.appendChild(v("div",null,"CodeMirror-selected","position: absolute; left: "+q+"px;\n top: "+r+"px; width: "+(null==u?m-q:u)+"px;\n height: "+(A-r)+"px"))}function e(q,r,u){function A(F,R){return Ic(a,t(q,F),"div",x,R)}function Y(F,R,H){F=df(a,x,null,F);R="ltr"==R==("after"==H)?"left":"right";H="after"==H?F.begin:F.end-(/\s/.test(x.text.charAt(F.end-1))?2:1);return A(H,R)[R]}var x=w(g,q),P=x.text.length,K,Q,S=Ja(x,g.direction);Bg(S,r||0,null==u?P:u,(function(F,R,H,L){var ha="ltr"==H,na=A(F,ha?"left":"right"),ua=A(R-1,ha?"right":"left"),hb=null==r&&0==F,ib=null==u&&R==P,Pd=0==L;L=!S||L==S.length-1;3>=ua.top-na.top?(R=(n?hb:ib)&&Pd?l:(ha?na:ua).left,c(R,na.top,((n?ib:hb)&&L?m:(ha?ua:na).right)-R,na.bottom)):(ha?(ha=n&&hb&&Pd?l:na.left,hb=n?m:Y(F,H,"before"),F=n?l:Y(R,H,"after"),ib=n&&ib&&L?m:ua.right):(ha=n?Y(F,H,"before"):l,hb=!n&&hb&&Pd?m:na.right,F=!n&&ib&&L?l:ua.left,ib=n?Y(R,H,"after"):m),c(ha,na.top,hb-ha,na.bottom),na.bottomKc(na,K))K=na;0>Kc(ua,K)&&(K=ua);if(!Q||0>Kc(na,Q))Q=na;0>Kc(ua,Q)&&(Q=ua)}));return{start:K,end:Q}}var f=a.display,g=a.doc,h=document.createDocumentFragment(),k=Te(a.display),l=k.left,m=Math.max(f.sizerWidth,cb(a)-f.sizer.offsetLeft)-k.right,n="ltr"==g.direction;f=b.from();b=b.to();if(f.line==b.line)e(f.line,f.ch,b.ch);else{var p=w(g,f.line);k=w(g,b.line);k=za(p)==za(k);f=e(f.line,f.ch,k?p.text.length+1:null).end;b=e(b.line,k?0:null,b.ch).start;k&&(f.topa.options.cursorBlinkRate&&(b.cursorDiv.style.visibility="hidden")}}function hf(a){a.hasFocus()||(a.display.input.focus(),a.state.focused||Rd(a))}function Sd(a){a.state.delayingBlurEvent=!0;setTimeout((function(){a.state.delayingBlurEvent&&(a.state.delayingBlurEvent=!1,a.state.focused&&wb(a))}),100)}function Rd(a,b){a.state.delayingBlurEvent&&!a.state.draggingText&&(a.state.delayingBlurEvent=!1);"nocursor"!=a.options.readOnly&&(a.state.focused||(W(a,"focus",a,b),a.state.focused=!0,Ya(a.display.wrapper,"CodeMirror-focused"),a.curOp||a.display.selForContextMenu==a.doc.sel||(a.display.input.reset(),fa&&setTimeout((function(){return a.display.input.reset(!0)}),20)),a.display.input.receivedFocus()),Qd(a))}function wb(a,b){a.state.delayingBlurEvent||(a.state.focused&&(W(a,"blur",a,b),a.state.focused=!1,jb(a.display.wrapper,"CodeMirror-focused")),clearInterval(a.display.blinker),setTimeout((function(){a.state.focused||(a.display.shift=!1)}),150))}function Lc(a){for(var b=a.display,d=b.lineDiv.offsetTop,c=Math.max(0,b.scroller.getBoundingClientRect().top),e=b.lineDiv.getBoundingClientRect().top,f=0,g=0;gT){k=h.node.offsetTop+h.node.offsetHeight;var m=k-d;d=k}else{var n=h.node.getBoundingClientRect();m=n.bottom-n.top;!k&&h.text.firstChild&&(l=h.text.firstChild.getBoundingClientRect().right-n.left-1)}k=h.line.height-m;if(.005k)if(ea.display.sizerWidth&&(l=Math.ceil(l/ub(a.display)),l>a.display.maxLineLength&&(a.display.maxLineLength=l,a.display.maxLine=h.line,a.display.maxLineChanged=!0))}}2=e&&(c=bb(b,Ga(w(b,d))-a.wrapper.clientHeight),e=d)}return{from:c,to:Math.max(e,c+1)}}function Td(a,b){var d=a.display,c=vb(a.display);0>b.top&&(b.top=0);var e=a.curOp&&null!=a.curOp.scrollTop?a.curOp.scrollTop:d.scroller.scrollTop,f=Ed(a),g={};b.bottom-b.top>f&&(b.bottom=b.top+f);var h=a.doc.height+Dd(d),k=b.toph-c;b.tope+f&&(f=Math.min(b.top,(c?h:b.bottom)-f),f!=e&&(g.scrollTop=f));e=a.options.fixedGutter?0:d.gutters.offsetWidth;f=a.curOp&&null!=a.curOp.scrollLeft?a.curOp.scrollLeft:d.scroller.scrollLeft-e;a=cb(a)-d.gutters.offsetWidth;if(d=b.right-b.left>a)b.right=b.left+a;10>b.left?g.scrollLeft=0:b.lefta+f-3&&(g.scrollLeft=b.right+(d?0:10)-a);return g}function Nc(a,b){null!=b&&(Oc(a),a.curOp.scrollTop=(null==a.curOp.scrollTop?a.doc.scrollTop:a.curOp.scrollTop)+b)}function xb(a){Oc(a);var b=a.getCursor();a.curOp.scrollToPos={from:b,to:b,margin:a.options.cursorScrollMargin}}function Wb(a,b,d){null==b&&null==d||Oc(a);null!=b&&(a.curOp.scrollLeft=b);null!=d&&(a.curOp.scrollTop=d)}function Oc(a){var b=a.curOp.scrollToPos;if(b){a.curOp.scrollToPos=null;var d=bf(a,b.from),c=bf(a,b.to);kf(a,d,c,b.margin)}}function kf(a,b,d,c){b=Td(a,{left:Math.min(b.left,d.left),top:Math.min(b.top,d.top)-c,right:Math.max(b.right,d.right),bottom:Math.max(b.bottom,d.bottom)+c});Wb(a,b.scrollLeft,b.scrollTop)}function Xb(a,b){2>Math.abs(a.doc.scrollTop-b)||(Ma||Ud(a,{top:b}),lf(a,b,!0),Ma&&Ud(a),Yb(a,100))}function lf(a,b,d){b=Math.max(0,Math.min(a.display.scroller.scrollHeight-a.display.scroller.clientHeight,b));if(a.display.scroller.scrollTop!=b||d)a.doc.scrollTop=b,a.display.scrollbars.setScrollTop(b),a.display.scroller.scrollTop!=b&&(a.display.scroller.scrollTop=b)}function kb(a,b,d,c){b=Math.max(0,Math.min(b,a.display.scroller.scrollWidth-a.display.scroller.clientWidth));(d?b==a.doc.scrollLeft:2>Math.abs(a.doc.scrollLeft-b))&&!c||(a.doc.scrollLeft=b,mf(a),a.display.scroller.scrollLeft!=b&&(a.display.scroller.scrollLeft=b),a.display.scrollbars.setScrollLeft(b))}function Zb(a){var b=a.display,d=b.gutters.offsetWidth,c=Math.round(a.doc.height+Dd(a.display));return{clientHeight:b.scroller.clientHeight,viewHeight:b.wrapper.clientHeight,scrollWidth:b.scroller.scrollWidth,clientWidth:b.scroller.clientWidth,viewWidth:b.wrapper.clientWidth,barLeft:a.options.fixedGutter?d:0,docHeight:c,scrollHeight:c+Ha(a)+b.barHeight,nativeBarWidth:b.nativeBarWidth,gutterWidth:d}}function yb(a,b){b||(b=Zb(a));var d=a.display.barWidth,c=a.display.barHeight;nf(a,b);for(b=0;4>b&&d!=a.display.barWidth||c!=a.display.barHeight;b++)d!=a.display.barWidth&&a.options.lineWrapping&&Lc(a),nf(a,Zb(a)),d=a.display.barWidth,c=a.display.barHeight}function nf(a,b){var d=a.display,c=d.scrollbars.update(b);d.sizer.style.paddingRight=(d.barWidth=c.right)+"px";d.sizer.style.paddingBottom=(d.barHeight=c.bottom)+"px";d.heightForcer.style.borderBottom=c.bottom+"px solid transparent";c.right&&c.bottom?(d.scrollbarFiller.style.display="block",d.scrollbarFiller.style.height=c.bottom+"px",d.scrollbarFiller.style.width=c.right+"px"):d.scrollbarFiller.style.display="";c.bottom&&a.options.coverGutterNextToScrollbar&&a.options.fixedGutter?(d.gutterFiller.style.display="block",d.gutterFiller.style.height=c.bottom+"px",d.gutterFiller.style.width=b.gutterWidth+"px"):d.gutterFiller.style.display=""}function of(a){a.display.scrollbars&&(a.display.scrollbars.clear(),a.display.scrollbars.addClass&&jb(a.display.wrapper,a.display.scrollbars.addClass));a.display.scrollbars=new pf[a.options.scrollbarStyle]((function(b){a.display.wrapper.insertBefore(b,a.display.scrollbarFiller);z(b,"mousedown",(function(){a.state.focused&&setTimeout((function(){return a.display.input.focus()}),0)}));b.setAttribute("cm-not-content","true")}),(function(b,d){"horizontal"==d?kb(a,b):Xb(a,b)}),a);a.display.scrollbars.addClass&&Ya(a.display.wrapper,a.display.scrollbars.addClass)}function lb(a){a.curOp={cm:a,viewChanged:!1,startHeight:a.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:++Ug,markArrays:null};a=a.curOp;tb?tb.ops.push(a):a.ownsGroup=tb={ops:[a],delayedCallbacks:[]}}function mb(a){(a=a.curOp)&&Ng(a,(function(b){for(var d=0;d=f.viewTo)||f.maxLineChanged&&e.options.lineWrapping;c.update=c.mustUpdate&&new Pc(e,c.mustUpdate&&{top:c.scrollTop,ensure:c.scrollToPos},c.forceUpdate)}for(d=0;dn;n++){var p=!1;h=Ba(e,k);var q=l&&l!=k?Ba(e,l):h;h={left:Math.min(h.left,q.left),top:Math.min(h.top,q.top)-m,right:Math.max(h.left,q.left),bottom:Math.max(h.bottom,q.bottom)+m};q=Td(e,h);var r=e.doc.scrollTop,u=e.doc.scrollLeft;null!=q.scrollTop&&(Xb(e,q.scrollTop),1l.top+n.top?k=!0:l.bottom+n.top>(p.defaultView.innerHeight||p.documentElement.clientHeight)&&(k=!1),null==k||Vg||(l=v("div","​",null,"position: absolute;\n top: "+(l.top-m.viewOffset-e.display.lineSpace.offsetTop)+"px;\n height: "+(l.bottom-l.top+Ha(e)+m.barHeight)+"px;\n left: "+l.left+"px; width: "+Math.max(2,l.right-l.left)+"px;"),e.display.lineSpace.appendChild(l),l.scrollIntoView(k),e.display.lineSpace.removeChild(l)))}l=c.maybeHiddenMarkers;k=c.maybeUnhiddenMarkers;if(l)for(m=0;m=a.display.viewTo)){var d=+new Date+a.options.workTime,c=Ob(a,b.highlightFrontier),e=[];b.iter(c.line,Math.min(b.first+b.size,a.display.viewTo+500),(function(f){if(c.line>=a.display.viewFrom){var g=f.styles,h=f.text.length>a.options.maxHighlightLength?$a(b.mode,c.state):null,k=ye(a,f,c,!0);h&&(c.state=h);f.styles=k.styles;h=f.styleClasses;(k=k.classes)?f.styleClasses=k:h&&(f.styleClasses=null);k=!g||g.length!=f.styles.length||h!=k&&(!h||!k||h.bgClass!=k.bgClass||h.textClass!=k.textClass);for(h=0;!k&&hd)return Yb(a,a.options.workDelay),!0}));b.highlightFrontier=c.line;b.modeFrontier=Math.max(b.modeFrontier,c.line);e.length&&ra(a,(function(){for(var f=0;f=d.viewFrom&&b.visible.to<=d.viewTo&&(null==d.updateLineNumbers||d.updateLineNumbers>=d.viewTo)&&d.renderedView==d.view&&0==ff(a))return!1;rf(a)&&(Ra(a),b.dims=Gd(a));var e=c.first+c.size,f=Math.max(b.visible.from-a.options.viewportMargin,c.first),g=Math.min(e,b.visible.to+a.options.viewportMargin);d.viewFromf-d.viewFrom&&(f=Math.max(c.first,d.viewFrom));d.viewTo>g&&20>d.viewTo-g&&(g=Math.min(e,d.viewTo));Ka&&(f=xd(a.doc,f),g=Je(a.doc,g));c=f!=d.viewFrom||g!=d.viewTo||d.lastWrapHeight!=b.wrapperHeight||d.lastWrapWidth!=b.wrapperWidth;e=a.display;0==e.view.length||f>=e.viewTo||g<=e.viewFrom?(e.view=Fc(a,f,g),e.viewFrom=f):(e.viewFrom>f?e.view=Fc(a,f,e.viewFrom).concat(e.view):e.viewFromg&&(e.view=e.view.slice(0,db(a,g))));e.viewTo=g;d.viewOffset=Ga(w(a.doc,d.viewFrom));a.display.mover.style.top=d.viewOffset+"px";g=ff(a);if(!c&&0==g&&!b.force&&d.renderedView==d.view&&(null==d.updateLineNumbers||d.updateLineNumbers>=d.viewTo))return!1;a.hasFocus()?f=null:(f=ka(qa(a)))&&ja(a.display.lineDiv,f)?(f={activeElt:f},window.getSelection&&(e=qa(a).defaultView.getSelection(),e.anchorNode&&e.extend&&ja(a.display.lineDiv,e.anchorNode)&&(f.anchorNode=e.anchorNode,f.anchorOffset=e.anchorOffset,f.focusNode=e.focusNode,f.focusOffset=e.focusOffset))):f=null;4=a.display.viewFrom&&b.visible.to<=a.display.viewTo)break;if(!Vd(a,b))break;Lc(a);c=Zb(a);Vb(a);yb(a,c);Wd(a,c);b.force=!1}b.signal(a,"update",a);if(a.display.viewFrom!=a.display.reportedViewFrom||a.display.viewTo!=a.display.reportedViewTo)b.signal(a,"viewportChange",a,a.display.viewFrom,a.display.viewTo),a.display.reportedViewFrom=a.display.viewFrom,a.display.reportedViewTo=a.display.viewTo}function Ud(a,b){b=new Pc(a,b);if(Vd(a,b)){Lc(a);qf(a,b);var d=Zb(a);Vb(a);yb(a,d);Wd(a,d);b.finish()}}function Xg(a,b,d){function c(p){var q=p.nextSibling;fa&&ya&&a.display.currentWheelTarget==p?p.style.display="none":p.parentNode.removeChild(p);return q}var e=a.display,f=a.options.lineNumbers,g=e.lineDiv,h=g.firstChild,k=e.view;e=e.viewFrom;for(var l=0;lT&&(this.gutters.style.zIndex=-1,this.scroller.style.paddingRight=0);fa||Ma&&ac||(this.scroller.draggable=!0);a&&(a.appendChild?a.appendChild(this.wrapper):a(this.wrapper));this.reportedViewFrom=this.reportedViewTo=this.viewFrom=this.viewTo=b.first;this.view=[];this.externalMeasured=this.renderedView=null;this.lastWrapHeight=this.lastWrapWidth=this.viewOffset=0;this.updateLineNumbers=null;this.nativeBarWidth=this.barHeight=this.barWidth=0;this.scrollbarsClipped=!1;this.lineNumWidth=this.lineNumInnerWidth=this.lineNumChars=null;this.alignWidgets=!1;this.maxLine=this.cachedCharWidth=this.cachedTextHeight=this.cachedPaddingH=null;this.maxLineLength=0;this.maxLineChanged=!1;this.wheelDX=this.wheelDY=this.wheelStartX=this.wheelStartY=null;this.shift=!1;this.activeTouch=this.selForContextMenu=null;this.gutterSpecs=Yd(c.gutters,c.lineNumbers);sf(this);d.init(this)}function uf(a){var b=a.wheelDeltaX,d=a.wheelDeltaY;null==b&&a.detail&&a.axis==a.HORIZONTAL_AXIS&&(b=a.detail);null==d&&a.detail&&a.axis==a.VERTICAL_AXIS?d=a.detail:null==d&&(d=a.wheelDelta);return{x:b,y:d}}function Zg(a){a=uf(a);a.x*=Na;a.y*=Na;return a}function vf(a,b){Qa&&102==tf&&(null==a.display.chromeScrollHack?a.display.sizer.style.pointerEvents="none":clearTimeout(a.display.chromeScrollHack),a.display.chromeScrollHack=setTimeout((function(){a.display.chromeScrollHack=null;a.display.sizer.style.pointerEvents=""}),100));var d=uf(b),c=d.x;d=d.y;var e=Na;0===b.deltaMode&&(c=b.deltaX,d=b.deltaY,e=1);var f=a.display,g=f.scroller,h=g.scrollWidth>g.clientWidth,k=g.scrollHeight>g.clientHeight;if(c&&h||d&&k){if(d&&ya&&fa){h=b.target;var l=f.view;a:for(;h!=g;h=h.parentNode)for(var m=0;me?k=Math.max(0,k+e-50):h=Math.min(a.doc.height,h+e+50),Ud(a,{top:k,bottom:h})),20>Qc&&0!==b.deltaMode&&(null==f.wheelStartX?(f.wheelStartX=g.scrollLeft,f.wheelStartY=g.scrollTop,f.wheelDX=c,f.wheelDY=d,setTimeout((function(){if(null!=f.wheelStartX){var n=g.scrollLeft-f.wheelStartX,p=g.scrollTop-f.wheelStartY;n=p&&f.wheelDY&&p/f.wheelDY||n&&f.wheelDX&&n/f.wheelDX;f.wheelStartX=f.wheelStartY=null;n&&(Na=(Na*Qc+n)/(Qc+1),++Qc)}}),200)):(f.wheelDX+=c,f.wheelDY+=d))):(d&&k&&Xb(a,Math.max(0,g.scrollTop+d*e)),kb(a,Math.max(0,g.scrollLeft+c*e)),(!d||d&&k)&&la(b),f.wheelStartX=null)}}function Da(a,b,d){a=a&&a.options.selectionsMayTouch;d=b[d];b.sort((function(k,l){return B(k.from(),l.from())}));d=ea(b,d);for(var c=1;cB(a,b.from))return a;if(0>=B(a,b.to))return Ta(b);var d=a.line+b.text.length-(b.to.line-b.from.line)-1,c=a.ch;a.line==b.to.line&&(c+=Ta(b).ch-b.to.ch);return t(d,c)}function Zd(a,b){for(var d=[],c=0;cf-(a.cm?a.cm.options.historyEventDelay:500)||"*"==b.origin.charAt(0))){if(e.lastOp==c){Cf(e.done);var h=J(e.done)}else e.done.length&&!J(e.done).ranges?h=J(e.done):1e.undoDepth;)e.done.shift(),e.done[0].ranges||e.done.shift();e.done.push(d);e.generation=++e.maxGeneration;e.lastModTime=e.lastSelTime=f;e.lastOp=e.lastSelOp=c;e.lastOrigin=e.lastSelOrigin=b.origin;k||W(a,"historyAdded")}function Sc(a,b){var d=J(b);d&&d.ranges&&d.equals(a)||b.push(a)}function Bf(a,b,d,c){var e=b["spans_"+a.id],f=0;a.iter(Math.max(a.first,d),Math.min(a.first+a.size,c),(function(g){g.markedSpans&&((e||(e=b["spans_"+a.id]={}))[f]=g.markedSpans);++f}))}function Ef(a,b){var d;if(d=b["spans_"+a.id]){for(var c=[],e=0;eB(b,a),c!=0>B(d,a)?(a=b,b=d):c!=0>B(b,d)&&(b=d)),new I(a,b)):new I(d||b,b)}function Tc(a,b,d,c,e){null==e&&(e=a.cm&&(a.cm.display.shift||a.extend));da(a,new va([ce(a.sel.primary(),b,d,e)],0),c)}function Ff(a,b,d){for(var c=[],e=a.cm&&(a.cm.display.shift||a.extend),f=0;fB(b.primary().head,a.sel.primary().head)?-1:1);Hf(a,If(a,b,c,!0));d&&!1===d.scroll||!a.cm||"nocursor"==a.cm.getOption("readOnly")||xb(a.cm)}function Hf(a,b){b.equals(a.sel)||(a.sel=b,a.cm&&(a.cm.curOp.updateInput=1,a.cm.curOp.selectionChanged=!0,te(a.cm)),aa(a,"cursorActivity",a))}function Jf(a){Hf(a,If(a,a.sel,null,!1))}function If(a,b,d,c){for(var e,f=0;f=b.ch:h.to>b.ch))){if(e&&(W(k,"beforeCursorEnter"),k.explicitlyCleared))if(f.markedSpans){--g;continue}else break;if(k.atomic){if(d){g=k.find(0>c?1:-1);h=void 0;if(0>c?m:l)g=Kf(a,g,-c,g&&g.line==b.line?f:null);if(g&&g.line==b.line&&(h=B(g,d))&&(0>c?0>h:0c?-1:1);if(0>c?l:m)d=Kf(a,d,c,d.line==b.line?f:null);return d?Bb(a,d,b,c,e):null}}}return b}function Vc(a,b,d,c,e){c=c||1;b=Bb(a,b,d,c,e)||!e&&Bb(a,b,d,c,!0)||Bb(a,b,d,-c,e)||!e&&Bb(a,b,d,-c,!0);return b?b:(a.cantEdit=!0,t(a.first,0))}function Kf(a,b,d,c){return 0>d&&0==b.ch?b.line>a.first?C(a,t(b.line-1)):null:0a.lastLine())){if(b.from.linee&&(b={from:b.from,to:t(e,w(a,e).text.length),text:[b.text[0]],origin:b.origin});b.removed=ab(a,b.from,b.to);d||(d=Zd(a,b));a.cm?bh(a.cm,b,c):ae(a,b,c);Uc(a,d,Ia);a.cantEdit&&Vc(a,t(a.firstLine(),0))&&(a.cantEdit=!1)}}function bh(a,b,d){var c=a.doc,e=a.display,f=b.from,g=b.to,h=!1,k=f.line;a.options.lineWrapping||(k=N(za(w(c,f.line))),c.iter(k,g.line+1,(function(l){if(l==e.maxLine)return h=!0})));-1e.maxLineLength&&(e.maxLine=l,e.maxLineLength=m,e.maxLineChanged=!0,h=!1)})),h&&(a.curOp.updateMaxLine=!0));Gg(c,f.line);Yb(a,400);d=b.text.length-(g.line-f.line)-1;b.full?ma(a):f.line!=g.line||1!=b.text.length||yf(a.doc,b)?ma(a,f.line,g.line+1,d):Sa(a,f.line,"text");d=xa(a,"changes");if((c=xa(a,"change"))||d)b={from:f,to:g,text:b.text,removed:b.removed,origin:b.origin},c&&aa(a,"change",a,b),d&&(a.curOp.changeObjs||(a.curOp.changeObjs=[])).push(b);a.display.selForContextMenu=null}function Db(a,b,d,c,e){c||(c=d);0>B(c,d)&&(c=[c,d],d=c[0],c=c[1]);"string"==typeof b&&(b=a.splitLines(b));Cb(a,{from:d,to:c,text:b,origin:e})}function Rf(a,b,d,c){d=B(f.from,J(c).to);){var g=c.pop();if(0>B(g.from,f.from)){f.from=g.from;break}}c.push(f)}ra(a,(function(){for(var h=c.length-1;0<=h;h--)Db(a.doc,"",c[h].from,c[h].to,"+delete");xb(a)}))}function ee(a,b,d){b=se(a.text,b+d,d);return 0>b||b>a.text.length?null:b}function fe(a,b,d){a=ee(a,b.ch,d);return null==a?null:new t(b.line,a,0>d?"after":"before")}function ge(a,b,d,c,e){if(a&&("rtl"==b.doc.direction&&(e=-e),a=Ja(d,b.doc.direction))){a=0>e?J(a):a[0];var f=0>e==(1==a.level)?"after":"before";if(0e?d.text.length-1:0;var k=Aa(b,g,h).top;h=Jb((function(l){return Aa(b,g,l).top==k}),0>e==(1==a.level)?a.from:a.to-1,h);"before"==f&&(h=ee(d,h,1))}else h=0>e?a.to:a.from;return new t(c,h,f)}return new t(c,0>e?d.text.length:0,0>e?"before":"after")}function kh(a,b,d,c){var e=Ja(b,a.doc.direction);if(!e)return fe(b,d,c);d.ch>=b.text.length?(d.ch=b.text.length,d.sticky="before"):0>=d.ch&&(d.ch=0,d.sticky="after");var f=Kb(e,d.ch,d.sticky),g=e[f];if("ltr"==a.doc.direction&&0==g.level%2&&(0d.ch:g.fromc,p=h(d,n?1:-1);if(null!=p&&(n?p<=g.to&&p<=m.end:p>=g.from&&p>=m.begin))return new t(d.line,p,n?"before":"after")}g=function(q,r,u){for(var A=function(K,Q){return Q?new t(d.line,h(K,1),"before"):new t(d.line,K,"after")};0<=q&&qT&&27==a.keyCode&&(a.returnValue=!1);var b=a.keyCode;this.display.shift=16==b||a.shiftKey;var d=eg(this,a);Ca&&(he=d?b:null,!d&&88==b&&!nh&&(ya?a.metaKey:a.ctrlKey)&&this.replaceSelection("",null,"cut"));Ma&&!ya&&!d&&46==b&&a.shiftKey&&!a.ctrlKey&&document.execCommand&&document.execCommand("cut");18!=b||/\bCodeMirror-crosshair\b/.test(this.display.lineDiv.className)||oh(this)}}function oh(a){function b(c){18!=c.keyCode&&c.altKey||(jb(d,"CodeMirror-crosshair"),ta(document,"keyup",b),ta(document,"mouseover",b))}var d=a.display.lineDiv;Ya(d,"CodeMirror-crosshair");z(document,"keyup",b);z(document,"mouseover",b)}function gg(a){16==a.keyCode&&(this.doc.sel.shift=!1);Z(this,a)}function hg(a){if(!(a.target&&a.target!=this.display.input.getField()||La(this.display,a)||Z(this,a)||a.ctrlKey&&!a.altKey||ya&&a.metaKey)){var b=a.keyCode,d=a.charCode;if(Ca&&b==he)he=null,la(a);else if(!Ca||a.which&&!(10>a.which)||!eg(this,a))if(b=String.fromCharCode(null==d?b:d),"\b"!=b&&!mh(this,a,b))this.display.input.onKeyPress(a)}}function ph(a,b){var d=+new Date;if(lc&&lc.compare(d,a,b))return mc=lc=null,"triple";if(mc&&mc.compare(d,a,b))return lc=new ie(d,a,b),mc=null,"double";mc=new ie(d,a,b);lc=null;return"single"}function ig(a){var b=this.display;if(!(Z(this,a)||b.activeTouch&&b.input.supportsTouch()))if(b.input.ensurePolled(),b.shift=a.shiftKey,La(b,a))fa||(b.scroller.draggable=!1,setTimeout((function(){return b.scroller.draggable=!0}),100));else if(!$c(this,a,"gutterClick",!0)){var d=gb(this,a),c=ve(a),e=d?ph(d,c):"single";qa(this).defaultView.focus();1==c&&this.state.selectingText&&this.state.selectingText(a);if(!d||!qh(this,c,d,e,a))if(1==c)d?rh(this,d,e,a):(a.target||a.srcElement)==b.scroller&&la(a);else if(2==c)d&&Tc(this.doc,d),setTimeout((function(){return b.input.focus()}),20);else if(3==c)if(je)this.display.input.onContextMenu(a);else Sd(this)}}function qh(a,b,d,c,e){var f="Click";"double"==c?f="Double"+f:"triple"==c&&(f="Triple"+f);return kc(a,Zf((1==b?"Left":2==b?"Middle":"Right")+f,e),e,(function(g){"string"==typeof g&&(g=jc[g]);if(!g)return!1;var h=!1;try{a.isReadOnly()&&(a.state.suppressEdits=!0),h=g(a,d)!=Zc}finally{a.state.suppressEdits=!1}return h}))}function rh(a,b,d,c){G?setTimeout(gd(hf,a),0):a.curOp.focus=ka(qa(a));var e=a.getOption("configureMouse");e=e?e(a,d,c):{};null==e.unit&&(e.unit=(sh?c.shiftKey&&c.metaKey:c.altKey)?"rectangle":"single"==d?"char":"double"==d?"word":"line");if(null==e.extend||a.doc.extend)e.extend=a.doc.extend||c.shiftKey;null==e.addNew&&(e.addNew=ya?c.metaKey:c.ctrlKey);null==e.moveOnDrag&&(e.moveOnDrag=!(ya?c.altKey:c.ctrlKey));var f=a.doc.sel,g;a.options.dragDrop&&th&&!a.isReadOnly()&&"single"==d&&-1<(g=f.contains(b))&&(0>B((g=f.ranges[g]).from(),b)||0b.xRel)?uh(a,c,b,e):vh(a,c,b,e)}function uh(a,b,d,c){var e=a.display,f=!1,g=ba(a,(function(l){fa&&(e.scroller.draggable=!1);a.state.draggingText=!1;a.state.delayingBlurEvent&&(a.hasFocus()?a.state.delayingBlurEvent=!1:Sd(a));ta(e.wrapper.ownerDocument,"mouseup",g);ta(e.wrapper.ownerDocument,"mousemove",h);ta(e.scroller,"dragstart",k);ta(e.scroller,"drop",g);f||(la(l),c.addNew||Tc(a.doc,d,null,null,c.extend),fa&&!ad||G&&9==T?setTimeout((function(){e.wrapper.ownerDocument.body.focus({preventScroll:!0});e.input.focus()}),20):e.input.focus())})),h=function(l){f=f||10<=Math.abs(b.clientX-l.clientX)+Math.abs(b.clientY-l.clientY)},k=function(){return f=!0};fa&&(e.scroller.draggable=!0);a.state.draggingText=g;g.copy=!c.moveOnDrag;z(e.wrapper.ownerDocument,"mouseup",g);z(e.wrapper.ownerDocument,"mousemove",h);z(e.scroller,"dragstart",k);z(e.scroller,"drop",g);a.state.delayingBlurEvent=!0;setTimeout((function(){return e.input.focus()}),20);e.scroller.dragDrop&&e.scroller.dragDrop()}function jg(a,b,d){if("char"==d)return new I(b,b);if("word"==d)return a.findWordAt(b);if("line"==d)return new I(t(b.line,0),C(a.doc,t(b.line+1,0)));a=d(a,b);return new I(a.from,a.to)}function vh(a,b,d,c){function e(x){if(0!=B(q,x))if(q=x,"rectangle"==c.unit){var P=[],K=a.options.tabSize,Q=wa(w(k,d.line).text,d.ch,K),S=wa(w(k,x.line).text,x.ch,K),F=Math.min(Q,S);Q=Math.max(Q,S);S=Math.min(d.line,x.line);for(var R=Math.min(a.lastLine(),Math.max(d.line,x.line));S<=R;S++){var H=w(k,S).text,L=hd(H,F,K);F==Q?P.push(new I(t(S,L),t(S,L))):H.length>L&&P.push(new I(t(S,L),t(S,hd(H,Q,K))))}P.length||P.push(new I(d,d));da(k,Da(a,l.ranges.slice(0,n).concat(P),n),{origin:"*mouse",scroll:!1});a.scrollIntoView(x)}else P=p,F=jg(a,x,c.unit),x=P.anchor,0=Q.to||K.liner.bottom?20:0;S&&setTimeout(ba(a,(function(){u==P&&(h.scroller.scrollTop+=S,f(x))})),50)}}function g(x){a.state.selectingText=!1;u=Infinity;x&&(la(x),h.input.focus());ta(h.wrapper.ownerDocument,"mousemove",A);ta(h.wrapper.ownerDocument,"mouseup",Y);k.history.lastSelOrigin=null}G&&Sd(a);var h=a.display,k=a.doc;la(b);var l=k.sel,m=l.ranges;if(c.addNew&&!c.extend){var n=k.sel.contains(d);var p=-1f:0=Math.floor(a.display.gutters.getBoundingClientRect().right))return!1;c&&la(b);c=a.display;var g=c.lineDiv.getBoundingClientRect();if(f>g.bottom||!xa(a,d))return ld(b);f-=g.top-c.viewOffset;for(g=0;g=e)return e=bb(a.doc,f),W(a,d,a,e,a.display.gutterSpecs[g].className,b),ld(b)}}function kg(a,b){var d;(d=La(a.display,b))||(d=xa(a,"gutterContextMenu")?$c(a,b,"gutterContextMenu",!1):!1);if(!d&&!Z(a,b,"contextmenu")&&!je)a.display.input.onContextMenu(b)}function lg(a){a.display.wrapper.className=a.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+a.options.theme.replace(/(^|\s)\s*/g," cm-s-");Ub(a)}function xh(a,b,d){!b!=!(d&&d!=Hb)&&(d=a.display.dragFunctions,b=b?z:ta,b(a.display.scroller,"dragstart",d.start),b(a.display.scroller,"dragenter",d.enter),b(a.display.scroller,"dragover",d.over),b(a.display.scroller,"dragleave",d.leave),b(a.display.scroller,"drop",d.drop))}function yh(a){a.options.lineWrapping?(Ya(a.display.wrapper,"CodeMirror-wrap"),a.display.sizer.style.minWidth="",a.display.sizerWidth=null):(jb(a.display.wrapper,"CodeMirror-wrap"),zd(a));Nd(a);ma(a);Ub(a);setTimeout((function(){return yb(a)}),100)}function U(a,b){var d=this;if(!(this instanceof U))return new U(a,b);this.options=b=b?Za(b):{};Za(mg,b,!1);var c=b.value;"string"==typeof c?c=new oa(c,b.mode,null,b.lineSeparator,b.direction):b.mode&&(c.modeOption=b.mode);this.doc=c;var e=new U.inputStyles[b.inputStyle](this);a=this.display=new Yg(a,c,e,b);a.wrapper.CodeMirror=this;lg(this);b.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap");of(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 Xa,keySeq:null,specialChars:null};b.autofocus&&!ac&&a.input.focus();G&&11>T&&setTimeout((function(){return d.display.input.reset(!0)}),20);zh(this);ng||(gh(),ng=!0);lb(this);this.curOp.forceUpdate=!0;zf(this,c);b.autofocus&&!ac||this.hasFocus()?setTimeout((function(){d.hasFocus()&&!d.state.focused&&Rd(d)}),20):wb(this);for(var f in bd)if(bd.hasOwnProperty(f))bd[f](this,b[f],Hb);rf(this);b.finishInit&&b.finishInit(this);for(c=0;cT?z(c.scroller,"dblclick",ba(a,(function(h){if(!Z(a,h)){var k=gb(a,h);!k||$c(a,h,"gutterClick",!0)||La(a.display,h)||(la(h),h=a.findWordAt(k),Tc(a.doc,h.anchor,h.head))}}))):z(c.scroller,"dblclick",(function(h){return Z(a,h)||la(h)}));z(c.scroller,"contextmenu",(function(h){return kg(a,h)}));z(c.input.getField(),"contextmenu",(function(h){c.scroller.contains(h.target)||kg(a,h)}));var e,f={end:0};z(c.scroller,"touchstart",(function(h){var k;if(k=!Z(a,h))1!=h.touches.length?k=!1:(k=h.touches[0],k=1>=k.radiusX&&1>=k.radiusY),k=!k;k&&!$c(a,h,"gutterClick",!0)&&(c.input.ensurePolled(),clearTimeout(e),k=+new Date,c.activeTouch={start:k,moved:!1,prev:300>=k-f.end?f:null},1==h.touches.length&&(c.activeTouch.left=h.touches[0].pageX,c.activeTouch.top=h.touches[0].pageY))}));z(c.scroller,"touchmove",(function(){c.activeTouch&&(c.activeTouch.moved=!0)}));z(c.scroller,"touchend",(function(h){var k=c.activeTouch;if(k&&!La(c,h)&&null!=k.left&&!k.moved&&300>new Date-k.start){var l=a.coordsChar(c.activeTouch,"page");k=!k.prev||d(k,k.prev)?new I(l,l):!k.prev.prev||d(k,k.prev.prev)?a.findWordAt(l):new I(t(l.line,0),C(a.doc,t(l.line+1,0)));a.setSelection(k.anchor,k.head);a.focus();la(h)}b()}));z(c.scroller,"touchcancel",b);z(c.scroller,"scroll",(function(){c.scroller.clientHeight&&(Xb(a,c.scroller.scrollTop),kb(a,c.scroller.scrollLeft,!0),W(a,"scroll",a))}));z(c.scroller,"mousewheel",(function(h){return vf(a,h)}));z(c.scroller,"DOMMouseScroll",(function(h){return vf(a,h)}));z(c.wrapper,"scroll",(function(){return c.wrapper.scrollTop=c.wrapper.scrollLeft=0}));c.dragFunctions={enter:function(h){Z(a,h)||Mb(h)},over:function(h){if(!Z(a,h)){var k=gb(a,h);if(k){var l=document.createDocumentFragment();Od(a,k,l);a.display.dragCursor||(a.display.dragCursor=v("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),a.display.lineSpace.insertBefore(a.display.dragCursor,a.display.cursorDiv));D(a.display.dragCursor,l)}Mb(h)}},start:function(h){if(G&&(!a.state.draggingText||100>+new Date-Wf))Mb(h);else if(!Z(a,h)&&!La(a.display,h)&&(h.dataTransfer.setData("Text",a.getSelection()),h.dataTransfer.effectAllowed="copyMove",h.dataTransfer.setDragImage&&!ad)){var k=v("img",null,null,"position: fixed; left: 0; top: 0;");k.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==";Ca&&(k.width=k.height=1,a.display.wrapper.appendChild(k),k._top=k.offsetTop);h.dataTransfer.setDragImage(k,0,0);Ca&&k.parentNode.removeChild(k)}},drop:ba(a,fh),leave:function(h){Z(a,h)||Vf(a)}};var g=c.input.getField();z(g,"keyup",(function(h){return gg.call(a,h)}));z(g,"keydown",ba(a,fg));z(g,"keypress",ba(a,hg));z(g,"focus",(function(h){return Rd(a,h)}));z(g,"blur",(function(h){return wb(a,h)}))}function nc(a,b,d,c){var e=a.doc,f;null==d&&(d="add");"smart"==d&&(e.mode.indent?f=Ob(a,b).state:d="prev");var g=a.options.tabSize,h=w(e,b),k=wa(h.text,null,g);h.stateAfter&&(h.stateAfter=null);var l=h.text.match(/^\s*/)[0];if(!c&&!/\S/.test(h.text)){var m=0;d="not"}else if("smart"==d&&(m=e.mode.indent(f,h.text.slice(l.length),h.text),m==Zc||150e.first?wa(w(e,b-1).text,null,g):0:"add"==d?m=k+a.options.indentUnit:"subtract"==d?m=k-a.options.indentUnit:"number"==typeof d&&(m=k+d);m=Math.max(0,m);d="";c=0;if(a.options.indentWithTabs)for(a=Math.floor(m/g);a;--a)c+=g,d+="\t";cg,k=ne(b),l=null;if(h&&1g?"cut":"+input")};Cb(a.doc,p);aa(a,"inputRead",a,p)}b&&!h&&og(a,b);xb(a);2>a.curOp.updateInput&&(a.curOp.updateInput=m);a.curOp.typing=!0;a.state.pasteIncoming=a.state.cutIncoming=-1}function pg(a,b){var d=a.clipboardData&&a.clipboardData.getData("Text");if(d)return a.preventDefault(),b.isReadOnly()||b.options.disableInput||!b.hasFocus()||ra(b,(function(){return me(b,d,0,null,"paste")})),!0}function og(a,b){if(a.options.electricChars&&a.options.smartIndent)for(var d=a.doc.sel,c=d.ranges.length-1;0<=c;c--){var e=d.ranges[c];if(!(100A:56320<=A&&57343>A)?2:1))),-d)}else A=e?kh(a.cm,k,b,d):fe(k,b,d);if(null==A){if(u=!u)u=b.line+l,u=a.first+a.size?u=!1:(b=new t(u,b.ch,b.sticky),u=k=w(a,u));if(u)b=ge(e,a.cm,k,b.line,l);else return!1}else b=A;return!0}var g=b,h=d,k=w(a,b.line),l=e&&"rtl"==a.direction?-d:d;if("char"==c||"codepoint"==c)f();else if("column"==c)f(!0);else if("word"==c||"group"==c)for(var m=null,n="group"==c,p=a.cm&&a.cm.getHelper(b,"wordChars"),q=!0;!(0>d)||f(!q);q=!1){var r=k.text.charAt(b.ch)||"\n";r=xc(r,p)?"w":n&&"\n"==r?"n":!n||/\s/.test(r)?null:"p";!n||q||r||(r="s");if(m&&m!=r){0>d&&(d=1,f(),b.sticky="after");break}r&&(m=r);if(0d?0>=g:g>=e.height){b.hitSide=!0;break}g+=5*d}return b}function ug(a,b){var d=Fd(a,b.line);if(!d||d.hidden)return null;var c=w(a.doc,b.line);d=Ue(d,c,b.line);a=Ja(c,a.doc.direction);c="left";a&&(c=Kb(a,b.ch)%2?"right":"left");b=Ve(d.map,b.ch,c);b.offset="right"==b.collapse?b.end:b.start;return b}function Ah(a){for(;a;a=a.parentNode)if(/CodeMirror-gutter-wrapper/.test(a.className))return!0;return!1}function Ib(a,b){b&&(a.bad=!0);return a}function Bh(a,b,d,c,e){function f(q){return function(r){return r.id==q}}function g(){m&&(l+=n,p&&(l+=n),m=p=!1)}function h(q){q&&(g(),l+=q)}function k(q){if(1==q.nodeType){var r=q.getAttribute("cm-text");if(r)h(r);else{r=q.getAttribute("cm-marker");var u;if(r)q=a.findMarks(t(c,0),t(e+1,0),f(+r)),q.length&&(u=q[0].find(0))&&h(ab(a.doc,u.from,u.to).join(n));else if("false"!=q.getAttribute("contenteditable")&&(u=/^(pre|div|p|li|table|br)$/i.test(q.nodeName),/^br$/i.test(q.nodeName)||0!=q.textContent.length)){u&&g();for(r=0;rq?k.map:l[q],u=0;uq?a.line:a.rest[q]);q=r[u]+p;if(0>p||A!=m)q=r[u+(p?1:0)];return t(n,q)}}}var e=a.text.firstChild,f=!1;if(!b||!ja(e,b))return Ib(t(N(a.line),0),!0);if(b==e&&(f=!0,b=e.childNodes[d],d=0,!b))return d=a.rest?J(a.rest):a.line,Ib(t(N(d),d.text.length),f);var g=3==b.nodeType?b:null,h=b;g||1!=b.childNodes.length||3!=b.firstChild.nodeType||(g=b.firstChild,d&&(d=g.nodeValue.length));for(;h.parentNode!=e;)h=h.parentNode;var k=a.measure,l=k.maps;if(b=c(g,h,d))return Ib(b,f);e=h.nextSibling;for(g=g?g.nodeValue.length-d:0;e;e=e.nextSibling){if(b=c(e,e.firstChild,0))return Ib(t(b.line,b.ch-g),f);g+=e.textContent.length}for(h=h.previousSibling;h;h=h.previousSibling){if(b=c(h,h.firstChild,-1))return Ib(t(b.line,b.ch+d),f);d+=h.textContent.length}}var pa=navigator.userAgent,vg=navigator.platform,Ma=/gecko\/\d/i.test(pa),wg=/MSIE \d/.test(pa),xg=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(pa),dd=/Edge\/(\d+)/.exec(pa),G=wg||xg||dd,T=G&&(wg?document.documentMode||6:+(dd||xg)[1]),fa=!dd&&/WebKit\//.test(pa),Dh=fa&&/Qt\/\d+\.\d+/.test(pa),Qa=!dd&&/Chrome\/(\d+)/.exec(pa),tf=Qa&&+Qa[1],Ca=/Opera\//.test(pa),ad=/Apple Computer/.test(navigator.vendor),Eh=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(pa),Vg=/PhantomJS/.test(pa),oc=ad&&(/Mobile\/\w+/.test(pa)||2nb)),je=Ma||G&&9<=T,jb=function(a,b){var d=a.className;if(b=y(b).exec(d)){var c=d.slice(b.index+b[0].length);a.className=d.slice(0,b.index)+(c?b[1]+c:"")}};var Qb=document.createRange?function(a,b,d,c){var e=document.createRange();e.setEnd(c||a,d);e.setStart(a,b);return e}:function(a,b,d){var c=document.body.createTextRange();try{c.moveToElementText(a.parentNode)}catch(e){return c}c.collapse(!0);c.moveEnd("character",d);c.moveStart("character",b);return c};var pc=function(a){a.select()};oc?pc=function(a){a.selectionStart=0;a.selectionEnd=a.value.length}:G&&(pc=function(a){try{a.select()}catch(b){}});var Xa=function(){this.f=this.id=null;this.time=0;this.handler=gd(this.onTimeout,this)};Xa.prototype.onTimeout=function(a){a.id=0;a.time<=+new Date?a.f():setTimeout(a.handler,a.time-+new Date)};Xa.prototype.set=function(a,b){this.f=b;b=+new Date+a;if(!this.id||b=r?"bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN".charAt(r):1424<=r&&1524>=r?"R":1536<=r&&1785>=r?"nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111".charAt(r-1536):1774<=r&&2220>=r?"r":8192<=r&&8203>=r?"w":8204==r?"b":"L";q.call(p,r)}n=0;for(p=k;nT)return!1;var a=v("div");return"draggable"in a||"dragDrop"in a}(),Bd,Ad,ne=3!="\n\nb".split(/\n/).length?function(a){for(var b=0,d=[],c=a.length;b<=c;){var e=a.indexOf("\n",b);-1==e&&(e=a.length);var f=a.slice(b,"\r"==a.charAt(e-1)?e-1:e),g=f.indexOf("\r");-1!=g?(d.push(f.slice(0,g)),b+=g+1):(d.push(f),b=e+1)}return d}:function(a){return a.split(/\r\n?|\n/)},Gh=window.getSelection?function(a){try{return a.selectionStart!=a.selectionEnd}catch(b){return!1}}:function(a){try{var b=a.ownerDocument.selection.createRange()}catch(d){}return b&&b.parentElement()==a?0!=b.compareEndPoints("StartToEnd",b):!1},nh=function(){var a=v("div");if("oncopy"in a)return!0;a.setAttribute("oncopy","return;");return"function"==typeof a.oncopy}(),Hd=null,md={},qb={},rb={},X=function(a,b,d){this.pos=this.start=0;this.string=a;this.tabSize=b||8;this.lineStart=this.lastColumnPos=this.lastColumnValue=0;this.lineOracle=d};X.prototype.eol=function(){return this.pos>=this.string.length};X.prototype.sol=function(){return this.pos==this.lineStart};X.prototype.peek=function(){return this.string.charAt(this.pos)||void 0};X.prototype.next=function(){if(this.posb};X.prototype.eatSpace=function(){for(var a=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>a};X.prototype.skipToEnd=function(){this.pos=this.string.length};X.prototype.skipTo=function(a){a=this.string.indexOf(a,this.pos);if(-1this.maxLookAhead&&(this.maxLookAhead=a);return b};Fa.prototype.baseToken=function(a){if(!this.baseTokens)return null;for(;this.baseTokens[this.baseTokenPos]<=a;)this.baseTokenPos+=2;var b=this.baseTokens[this.baseTokenPos+1];return{type:b&&b.replace(/( |^)overlay .*/,""),size:this.baseTokens[this.baseTokenPos]-a}};Fa.prototype.nextLine=function(){this.line++;0T&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};ob.prototype.update=function(a){var b=a.scrollWidth>a.clientWidth+1,d=a.scrollHeight>a.clientHeight+1,c=a.nativeBarWidth;d?(this.vert.style.display="block",this.vert.style.bottom=b?c+"px":"0",this.vert.firstChild.style.height=Math.max(0,a.scrollHeight-a.clientHeight+(a.viewHeight-(b?c:0)))+"px"):(this.vert.scrollTop=0,this.vert.style.display="",this.vert.firstChild.style.height="0");b?(this.horiz.style.display="block",this.horiz.style.right=d?c+"px":"0",this.horiz.style.left=a.barLeft+"px",this.horiz.firstChild.style.width=Math.max(0,a.scrollWidth-a.clientWidth+(a.viewWidth-a.barLeft-(d?c:0)))+"px"):(this.horiz.style.display="",this.horiz.firstChild.style.width="0");!this.checkedZeroWidth&&0=B(a,c.to()))return d}return-1};var I=function(a,b){this.anchor=a;this.head=b};I.prototype.from=function(){return Bc(this.anchor,this.head)};I.prototype.to=function(){return Ac(this.anchor,this.head)};I.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch};ec.prototype={chunkSize:function(){return this.lines.length},removeInner:function(a,b){for(var d=a,c=a+b;dthis.size-b&&(1=this.children.length)){var a=this;do{var b=a.children.splice(a.children.length-5,5);b=new fc(b);if(a.parent){a.size-=b.size;a.height-=b.height;var d=ea(a.parent.children,a);a.parent.children.splice(d+1,0,b)}else d=new fc(a.children),d.parent=a,a.children=[d,b],a=d;b.parent=a.parent}while(10a.display.maxLineLength&&(a.display.maxLine=f,a.display.maxLineLength=g,a.display.maxLineChanged=!0);null!=d&&a&&this.collapsed&&ma(a,d,c+1);this.lines.length=0;this.explicitlyCleared=!0;this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,a&&Jf(a.doc));a&&aa(a,"markerCleared",a,this,d,c);b&&mb(a);this.parent&&this.parent.clear()}};Va.prototype.find=function(a,b){null==a&&"bookmark"==this.type&&(a=1);for(var d,c,e=0;eB(h.head,h.anchor),a[f]=new I(h?k:g,h?g:k)):a[f]=new I(g,g)}a=new va(a,this.sel.primIndex)}b=a;for(a=c.length-1;0<=a;a--)Cb(this,c[a]);b?Gf(this,b):this.cm&&xb(this.cm)})),undo:ca((function(){Wc(this,"undo")})),redo:ca((function(){Wc(this,"redo")})),undoSelection:ca((function(){Wc(this,"undo",!0)})),redoSelection:ca((function(){Wc(this,"redo",!0)})),setExtending:function(a){this.extend=a},getExtending:function(){return this.extend},historySize:function(){for(var a=this.history,b=0,d=0,c=0;c=a.ch)&&b.push(e.marker.parent||e.marker)}return b},findMarks:function(a,b,d){a=C(this,a);b=C(this,b);var c=[],e=a.line;this.iter(a.line,b.line+1,(function(f){if(f=f.markedSpans)for(var g=0;g=h.to||null==h.from&&e!=a.line||null!=h.from&&e==b.line&&h.from>=b.ch||d&&!d(h.marker)||c.push(h.marker.parent||h.marker)}++e}));return c},getAllMarks:function(){var a=[];this.iter((function(b){if(b=b.markedSpans)for(var d=0;da)return b=a,!0;a-=e;++d}));return C(this,t(d,b))},indexFromPos:function(a){a=C(this,a);var b=a.ch;if(a.linea.ch)return 0;var d=this.lineSeparator().length;this.iter(this.first,a.line,(function(c){b+=c.text.length+d}));return b},copy:function(a){var b=new oa(pd(this,this.first,this.first+this.size),this.modeOption,this.first,this.lineSep,this.direction);b.scrollTop=this.scrollTop;b.scrollLeft=this.scrollLeft;b.sel=this.sel;b.extend=!1;a&&(b.history.undoDepth=this.history.undoDepth,b.setHistory(this.getHistory()));return b},linkedDoc:function(a){a||(a={});var b=this.first,d=this.first+this.size;null!=a.from&&a.from>b&&(b=a.from);null!=a.to&&a.tosc;sc++)Wa[sc+48]=Wa[sc+96]=String(sc);for(var ed=65;90>=ed;ed++)Wa[ed]=String.fromCharCode(ed);for(var tc=1;12>=tc;tc++)Wa[tc+111]=Wa[tc+63235]="F"+tc;var ic={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"},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"},emacsy:{"Ctrl-F":"goCharRight","Ctrl-B":"goCharLeft","Ctrl-P":"goLineUp","Ctrl-N":"goLineDown","Ctrl-A":"goLineStart","Ctrl-E":"goLineEnd","Ctrl-V":"goPageDown","Shift-Ctrl-V":"goPageUp","Ctrl-D":"delCharAfter","Ctrl-H":"delCharBefore","Alt-Backspace":"delWordBefore","Ctrl-K":"killLine","Ctrl-T":"transposeChars","Ctrl-O":"openLine"},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"]}};ic["default"]=ya?ic.macDefault:ic.pcDefault;var jc={selectAll:Lf,singleSelection:function(a){return a.setSelection(a.getCursor("anchor"),a.getCursor("head"),Ia)},killLine:function(a){return Gb(a,(function(b){if(b.empty()){var d=w(a.doc,b.head.line).text.length;return b.head.ch==d&&b.head.linea.doc.first){var g=w(a.doc,e.line-1).text;g&&(e=new t(e.line,1),a.replaceRange(f.charAt(0)+a.doc.lineSeparator()+g.charAt(g.length-1),t(e.line-1,g.length-1),e,"+transpose"))}d.push(new I(e,e))}a.setSelections(d)}))},newlineAndIndent:function(a){return ra(a,(function(){for(var b=a.listSelections(),d=b.length-1;0<=d;d--)a.replaceRange(a.doc.lineSeparator(),b[d].anchor,b[d].head,"+input");b=a.listSelections();for(d=0;da&&0==B(b,this.pos)&&d==this.button};var mc,lc,Hb={toString:function(){return"CodeMirror.Init"}},mg={},bd={};U.defaults=mg;U.optionHandlers=bd;var le=[];U.defineInitHook=function(a){return le.push(a)};var sa=null,O=function(a){this.cm=a;this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null;this.polling=new Xa;this.composing=null;this.gracePeriod=!1;this.readDOMTimeout=null};O.prototype.init=function(a){function b(h){for(h=h.target;h;h=h.parentNode){if(h==g)return!0;if(/\bCodeMirror-(?:line)?widget\b/.test(h.className))break}return!1}function d(h){if(b(h)&&!Z(f,h)){if(f.somethingSelected())sa={lineWise:!1,text:f.getSelections()},"cut"==h.type&&f.replaceSelection("",null,"cut");else if(f.options.lineWiseCopyCut){var k=qg(f);sa={lineWise:!0,text:k.text};"cut"==h.type&&f.operation((function(){f.setSelections(k.ranges,0,Ia);f.replaceSelection("",null,"cut")}))}else return;if(h.clipboardData){h.clipboardData.clearData();var l=sa.text.join("\n");h.clipboardData.setData("Text",l);if(h.clipboardData.getData("Text")==l){h.preventDefault();return}}var m=sg();h=m.firstChild;f.display.lineSpace.insertBefore(m,f.display.lineSpace.firstChild);h.value=sa.text.join("\n");var n=ka(g.ownerDocument);pc(h);setTimeout((function(){f.display.lineSpace.removeChild(m);n.focus();n==g&&e.showPrimarySelection()}),50)}}var c=this,e=this,f=e.cm,g=e.div=a.lineDiv;g.contentEditable=!0;rg(g,f.options.spellcheck,f.options.autocorrect,f.options.autocapitalize);z(g,"paste",(function(h){!b(h)||Z(f,h)||pg(h,f)||11>=T&&setTimeout(ba(f,(function(){return c.updateFromDOM()})),20)}));z(g,"compositionstart",(function(h){c.composing={data:h.data,done:!1}}));z(g,"compositionupdate",(function(h){c.composing||(c.composing={data:h.data,done:!1})}));z(g,"compositionend",(function(h){c.composing&&(h.data!=c.composing.data&&c.readFromDOMSoon(),c.composing.done=!0)}));z(g,"touchstart",(function(){return e.forceCompositionEnd()}));z(g,"input",(function(){c.composing||c.readFromDOMSoon()}));z(g,"copy",d);z(g,"cut",d)};O.prototype.screenReaderLabelChanged=function(a){a?this.div.setAttribute("aria-label",a):this.div.removeAttribute("aria-label")};O.prototype.prepareSelection=function(){var a=gf(this.cm,!1);a.focus=ka(this.div.ownerDocument)==this.div;return a};O.prototype.showSelection=function(a,b){a&&this.cm.display.view.length&&((a.focus||b)&&this.showPrimarySelection(),this.showMultipleSelections(a))};O.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()};O.prototype.showPrimarySelection=function(){var a=this.getSelection(),b=this.cm,d=b.doc.sel.primary(),c=d.from();d=d.to();if(b.display.viewTo==b.display.viewFrom||c.line>=b.display.viewTo||d.line=b.display.viewFrom&&ug(b,c)||{node:e[0].measure.map[2],offset:0},d=d.linea.firstLine()&&(c=t(c.line-1,w(a.doc,c.line-1).length));e.ch==w(a.doc,e.line).text.length&&e.lineb.viewTo-1)return!1;var f;c.line==b.viewFrom||0==(f=db(a,c.line))?(d=N(b.view[0].line),f=b.view[0].node):(d=N(b.view[f].line),f=b.view[f-1].node.nextSibling);var g=db(a,e.line);g==b.view.length-1?(e=b.viewTo-1,b=b.lineDiv.lastChild):(e=N(b.view[g+1].line)-1,b=b.view[g+1].node.previousSibling);if(!f)return!1;b=a.doc.splitLines(Bh(a,f,b,d,e));for(f=ab(a.doc,t(d,0),t(e,w(a.doc,e).text.length));1c.ch&&k.charCodeAt(k.length-g-1)==l.charCodeAt(l.length-g-1);)h--,g++;b[b.length-1]=k.slice(0,k.length-g).replace(/^\u200b+/,"");b[0]=b[0].slice(h).replace(/\u200b+$/,"");c=t(d,h);d=t(e,f.length?J(f).length-g:0);if(1T&&f.scrollbars.setScrollTop(f.scroller.scrollTop=k),null!=g.selectionStart)){(!G||G&&9>T)&&b();var q=0,r=function(){f.selForContextMenu==e.doc.sel&&0==g.selectionStart&&0q++?f.detectingSelectAll=setTimeout(r,500):(f.selForContextMenu=null,f.input.reset())};f.detectingSelectAll=setTimeout(r,200)}}var c=this,e=c.cm,f=e.display,g=c.textarea;c.contextMenuPending&&c.contextMenuPending();var h=gb(e,a),k=f.scroller.scrollTop;if(h&&!Ca){e.options.resetSelectionOnContextMenu&&-1==e.doc.sel.contains(h)&&ba(e,da)(e.doc,Oa(h),Ia);var l=g.style.cssText,m=c.wrapper.style.cssText;h=c.wrapper.offsetParent.getBoundingClientRect();c.wrapper.style.cssText="position: static";g.style.cssText="position: absolute; width: 30px; height: 30px;\n top: "+(a.clientY-h.top-5)+"px; left: "+(a.clientX-h.left-5)+"px;\n z-index: 1000; background: "+(G?"rgba(255, 255, 255, .05)":"transparent")+";\n outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);";if(fa)var n=g.ownerDocument.defaultView.scrollY;f.input.focus();fa&&g.ownerDocument.defaultView.scrollTo(null,n);f.input.reset();e.somethingSelected()||(g.value=c.prevInput=" ");c.contextMenuPending=d;f.selForContextMenu=e.doc.sel;clearTimeout(f.detectingSelectAll);G&&9<=T&&b();if(je){Mb(a);var p=function(){ta(window,"mouseup",p);setTimeout(d,20)};z(window,"mouseup",p)}else setTimeout(d,50)}};V.prototype.readOnlyChanged=function(a){a||this.reset();this.textarea.disabled="nocursor"==a;this.textarea.readOnly=!!a};V.prototype.setUneditable=function(){};V.prototype.needsContentAttribute=!1;(function(a){function b(c,e,f,g){a.defaults[c]=e;f&&(d[c]=g?function(h,k,l){l!=Hb&&f(h,k,l)}:f)}var d=a.optionHandlers;a.defineOption=b;a.Init=Hb;b("value","",(function(c,e){return c.setValue(e)}),!0);b("mode",null,(function(c,e){c.doc.modeOption=e;$d(c)}),!0);b("indentUnit",2,$d,!0);b("indentWithTabs",!1);b("smartIndent",!0);b("tabSize",4,(function(c){bc(c);Ub(c);ma(c)}),!0);b("lineSeparator",null,(function(c,e){if(c.doc.lineSep=e){var f=[],g=c.doc.first;c.doc.iter((function(k){for(var l=0;;){var m=k.text.indexOf(e,l);if(-1==m)break;l=m+e.length;f.push(t(g,m))}g++}));for(var h=f.length-1;0<=h;h--)Db(c.doc,e,f[h],t(f[h].line,f[h].ch+e.length))}}));b("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b\u200e\u200f\u2028\u2029\u202d\u202e\u2066\u2067\u2069\ufeff\ufff9-\ufffc]/g,(function(c,e,f){c.state.specialChars=new RegExp(e.source+(e.test("\t")?"":"|\t"),"g");f!=Hb&&c.refresh()}));b("specialCharPlaceholder",Mg,(function(c){return c.refresh()}),!0);b("electricChars",!0);b("inputStyle",ac?"contenteditable":"textarea",(function(){throw Error("inputStyle can not (yet) be changed in a running editor")}),!0);b("spellcheck",!1,(function(c,e){return c.getInputField().spellcheck=e}),!0);b("autocorrect",!1,(function(c,e){return c.getInputField().autocorrect=e}),!0);b("autocapitalize",!1,(function(c,e){return c.getInputField().autocapitalize=e}),!0);b("rtlMoveVisually",!Fh);b("wholeLineUpdateBefore",!0);b("theme","default",(function(c){lg(c);$b(c)}),!0);b("keyMap","default",(function(c,e,f){e=Xc(e);(f=f!=Hb&&Xc(f))&&f.detach&&f.detach(c,e);e.attach&&e.attach(c,f||null)}));b("extraKeys",null);b("configureMouse",null);b("lineWrapping",!1,yh,!0);b("gutters",[],(function(c,e){c.display.gutterSpecs=Yd(e,c.options.lineNumbers);$b(c)}),!0);b("fixedGutter",!0,(function(c,e){c.display.gutters.style.left=e?Md(c.display)+"px":"0";c.refresh()}),!0);b("coverGutterNextToScrollbar",!1,(function(c){return yb(c)}),!0);b("scrollbarStyle","native",(function(c){of(c);yb(c);c.display.scrollbars.setScrollTop(c.doc.scrollTop);c.display.scrollbars.setScrollLeft(c.doc.scrollLeft)}),!0);b("lineNumbers",!1,(function(c,e){c.display.gutterSpecs=Yd(c.options.gutters,e);$b(c)}),!0);b("firstLineNumber",1,$b,!0);b("lineNumberFormatter",(function(c){return c}),$b,!0);b("showCursorWhenSelecting",!1,Vb,!0);b("resetSelectionOnContextMenu",!0);b("lineWiseCopyCut",!0);b("pasteLinesPerSelection",!0);b("selectionsMayTouch",!1);b("readOnly",!1,(function(c,e){"nocursor"==e&&(wb(c),c.display.input.blur());c.display.input.readOnlyChanged(e)}));b("screenReaderLabel",null,(function(c,e){c.display.input.screenReaderLabelChanged(""===e?null:e)}));b("disableInput",!1,(function(c,e){e||c.display.input.reset()}),!0);b("dragDrop",!0,xh);b("allowDropFileTypes",null);b("cursorBlinkRate",530);b("cursorScrollMargin",0);b("cursorHeight",1,Vb,!0);b("singleCursorHeightPerLine",!0,Vb,!0);b("workTime",100);b("workDelay",100);b("flattenSpans",!0,bc,!0);b("addModeClass",!1,bc,!0);b("pollInterval",100);b("undoDepth",200,(function(c,e){return c.doc.history.undoDepth=e}));b("historyEventDelay",1250);b("viewportMargin",10,(function(c){return c.refresh()}),!0);b("maxHighlightLength",1e4,bc,!0);b("moveInputWithCursor",!0,(function(c,e){e||c.display.input.resetPosition()}));b("tabindex",null,(function(c,e){return c.display.input.getField().tabIndex=e||""}));b("autofocus",null);b("direction","ltr",(function(c,e){return c.doc.setDirection(e)}),!0);b("phrases",null)})(U);(function(a){var b=a.optionHandlers,d=a.helpers={};a.prototype={constructor:a,focus:function(){qa(this).defaultView.focus();this.display.input.focus()},setOption:function(c,e){var f=this.options,g=f[c];if(f[c]!=e||"mode"==c)f[c]=e,b.hasOwnProperty(c)&&ba(this,b[c])(this,e,g),W(this,"optionChange",this,c)},getOption:function(c){return this.options[c]},getDoc:function(){return this.doc},addKeyMap:function(c,e){this.state.keyMaps[e?"push":"unshift"](Xc(c))},removeKeyMap:function(c){for(var e=this.state.keyMaps,f=0;ff&&(nc(this,h.head.line,c,!0),f=h.head.line,g==this.doc.sel.primIndex&&xb(this));else{var k=h.from();h=h.to();var l=Math.max(f,k.line);f=Math.min(this.lastLine(),h.line-(h.ch?0:1))+1;for(h=l;h>1;if((h?e[2*h-1]:0)>=c)g=h;else if(e[2*h+1]f?e:0==f?null:e.slice(0,f-1)},getModeAt:function(c){var e=this.doc.mode;return e.innerMode?a.innerMode(e,this.getTokenAt(c).state).mode:e},getHelper:function(c,e){return this.getHelpers(c,e)[0]},getHelpers:function(c,e){var f=[];if(!d.hasOwnProperty(e))return f;var g=d[e];c=this.getModeAt(c);if("string"==typeof c[e])g[c[e]]&&f.push(g[c[e]]);else if(c[e])for(var h=0;hh&&(c=h,g=!0);c=w(this.doc,c)}return Hc(this,c,{top:0,left:0},e||"page",f||g).top+(g?this.doc.height-Ga(c):0)},defaultTextHeight:function(){return vb(this.display)},defaultCharWidth:function(){return ub(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(c,e,f,g,h){var k=this.display;c=Ba(this,C(this.doc,c));var l=c.bottom,m=c.left;e.style.position="absolute";e.setAttribute("cm-ignore-events","true");this.display.input.setUneditable(e);k.sizer.appendChild(e);if("over"==g)l=c.top;else if("above"==g||"near"==g){var n=Math.max(k.wrapper.clientHeight,this.doc.height),p=Math.max(k.sizer.clientWidth,k.lineSpace.clientWidth);("above"==g||c.bottom+e.offsetHeight>n)&&c.top>e.offsetHeight?l=c.top-e.offsetHeight:c.bottom+e.offsetHeight<=n&&(l=c.bottom);m+e.offsetWidth>p&&(m=p-e.offsetWidth)}e.style.top=l+"px";e.style.left=e.style.right="";"right"==h?(m=k.sizer.clientWidth-e.offsetWidth,e.style.right="0px"):("left"==h?m=0:"middle"==h&&(m=(k.sizer.clientWidth-e.offsetWidth)/2),e.style.left=m+"px");f&&(c=Td(this,{left:m,top:l,right:m+e.offsetWidth,bottom:l+e.offsetHeight}),null!=c.scrollTop&&Xb(this,c.scrollTop),null!=c.scrollLeft&&kb(this,c.scrollLeft))},triggerOnKeyDown:ia(fg),triggerOnKeyPress:ia(hg),triggerOnKeyUp:gg,triggerOnMouseDown:ia(ig),execCommand:function(c){if(jc.hasOwnProperty(c))return jc[c].call(null,this)},triggerElectric:ia((function(c){og(this,c)})),findPosH:function(c,e,f,g){var h=1;0>e&&(h=-1,e=-e);c=C(this.doc,c);for(var k=0;kc?g.from():g.to()}),qc)})),deleteH:ia((function(c,e){var f=this.doc;this.doc.sel.somethingSelected()?f.replaceSelection("",null,"+delete"):Gb(this,(function(g){var h=oe(f,g.head,c,e,!1);return 0>c?{from:h,to:g.head}:{from:g.head,to:h}}))})),findPosV:function(c,e,f,g){var h=1;0>e&&(h=-1,e=-e);var k=C(this.doc,c);for(c=0;cc?m.from():m.to();var n=Ba(f,m.head,"div");null!=m.goalColumn&&(n.left=m.goalColumn);h.push(n.left);var p=tg(f,n,c,e);"page"==e&&m==g.sel.primary()&&Nc(f,Ic(f,p,"div").top-n.top);return p}),qc);if(h.length)for(var l=0;lea(Ih,uc)&&(U.prototype[uc]=function(a){return function(){return a.apply(this.doc,arguments)}}(oa.prototype[uc]));pb(oa);U.inputStyles={textarea:V,contenteditable:O};U.defineMode=function(a){U.defaults.mode||"null"==a||(U.defaults.mode=a);Dg.apply(this,arguments)};U.defineMIME=function(a,b){qb[a]=b};U.defineMode("null",(function(){return{token:function(a){return a.skipToEnd()}}}));U.defineMIME("text/plain","null");U.defineExtension=function(a,b){U.prototype[a]=b};U.defineDocExtension=function(a,b){oa.prototype[a]=b};U.fromTextArea=function(a,b){function d(){a.value=h.getValue()}b=b?Za(b):{};b.value=a.value;!b.tabindex&&a.tabIndex&&(b.tabindex=a.tabIndex);!b.placeholder&&a.placeholder&&(b.placeholder=a.placeholder);if(null==b.autofocus){var c=ka(a.ownerDocument);b.autofocus=c==a||null!=a.getAttribute("autofocus")&&c==document.body}if(a.form&&(z(a.form,"submit",d),!b.leaveSubmitMethodAlone)){var e=a.form;var f=e.submit;try{var g=e.submit=function(){d();e.submit=f;e.submit();e.submit=g}}catch(k){}}b.finishInit=function(k){k.save=d;k.getTextArea=function(){return a};k.toTextArea=function(){k.toTextArea=isNaN;d();a.parentNode.removeChild(k.getWrapperElement());a.style.display="";a.form&&(ta(a.form,"submit",d),b.leaveSubmitMethodAlone||"function"!=typeof a.form.submit||(a.form.submit=f))}};a.style.display="none";var h=U((function(k){return a.parentNode.insertBefore(k,a.nextSibling)}),b);return h};(function(a){a.off=ta;a.on=z;a.wheelEventPixels=Zg;a.Doc=oa;a.splitLines=ne;a.countColumn=wa;a.findColumn=hd;a.isWordChar=jd;a.Pass=Zc;a.signal=W;a.Line=zb;a.changeEnd=Ta;a.scrollbarModel=pf;a.Pos=t;a.cmpPos=B;a.modes=md;a.mimeModes=qb;a.resolveMode=zc;a.getMode=nd;a.modeExtensions=rb;a.extendMode=Eg;a.copyState=$a;a.startState=we;a.innerMode=od;a.commands=jc;a.keyMap=ic;a.keyName=ag;a.isModifierKey=Yf;a.lookupKey=Fb;a.normalizeKeyMap=jh;a.StringStream=X;a.SharedTextMarker=hc;a.TextMarker=Va;a.LineWidget=gc;a.e_preventDefault=la;a.e_stopPropagation=ue;a.e_stop=Mb;a.addClass=Ya;a.contains=ja;a.rmClass=jb;a.keyNames=Wa})(U);U.version="5.65.9";return U}))}).call(this)}).call(this,typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{}],59:[function(require,module,exports){(function(v){"object"==typeof exports&&"object"==typeof module?v(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],v):v(CodeMirror)})((function(v){v.defineMode("javascript",(function(Ua,A){var p,w,f;function u(a,b,d){V=a;ca=d;return b}function I(a,b){var d=a.next();if('"'==d||"'"==d)return b.tokenize=Va(d),b.tokenize(a,b);if("."==d&&a.match(/^\d[\d_]*(?:[eE][+\-]?[\d_]+)?/))return u("number","number");if("."==d&&a.match(".."))return u("spread","meta");if(/[\[\]{}\(\),;:\.]/.test(d))return u(d);if("="==d&&a.eat(">"))return u("=>","operator");if("0"==d&&a.match(/^(?:x[\dA-Fa-f_]+|o[0-7_]+|b[01_]+)n?/))return u("number","number");if(/\d/.test(d))return a.match(/^[\d_]*(?:n|(?:\.[\d_]*)?(?:[eE][+\-]?[\d_]+)?)?/),u("number","number");if("/"==d){if(a.eat("*"))return b.tokenize=da,da(a,b);if(a.eat("/"))return a.skipToEnd(),u("comment","comment");if(Aa(a,b,1)){a:for(var e=b=!1;null!=(d=a.next());){if(!b){if("/"==d&&!e)break a;"["==d?e=!0:e&&"]"==d&&(e=!1)}b=!b&&"\\"==d}a.match(/^\b(([gimyus])(?![gimyus]*\2))+\b/);return u("regexp","string-2")}a.eat("=");return u("operator","operator",a.current())}if("`"==d)return b.tokenize=W,W(a,b);if("#"==d&&"!"==a.peek())return a.skipToEnd(),u("meta","meta");if("#"==d&&a.eatWhile(ea))return u("variable","property");if("<"==d&&a.match("!--")||"-"==d&&a.match("->")&&!/\S/.test(a.string.slice(0,a.start)))return a.skipToEnd(),u("comment","comment");if(Ba.test(d))return">"==d&&b.lexical&&">"==b.lexical.type||(a.eat("=")?"!"!=d&&"="!=d||a.eat("="):/[<>*+\-|&?]/.test(d)&&(a.eat(d),">"==d&&a.eat(d))),"?"==d&&a.eat(".")?u("."):u("operator","operator",a.current());if(ea.test(d)){a.eatWhile(ea);d=a.current();if("."!=b.lastType){if(Ca.propertyIsEnumerable(d))return a=Ca[d],u(a.type,a.style,d);if("async"==d&&a.match(/^(\s|\/\*([^*]|\*(?!\/))*?\*\/)*[\[\(\w]/,!1))return u("async","keyword",d)}return u("variable","variable",d)}}function Va(a){return function(b,d){var e=!1,h;if(fa&&"@"==b.peek()&&b.match(Wa))return d.tokenize=I,u("jsonld-keyword","meta");for(;null!=(h=b.next())&&(h!=a||e);)e=!e&&"\\"==h;e||(d.tokenize=I);return u("string","string")}}function da(a,b){for(var d=!1,e;e=a.next();){if("/"==e&&d){b.tokenize=I;break}d="*"==e}return u("comment","comment")}function W(a,b){for(var d=!1,e;null!=(e=a.next());){if(!d&&("`"==e||"$"==e&&a.eat("{"))){b.tokenize=I;break}d=!d&&"\\"==e}return u("quasi","string-2",a.current())}function qa(a,b){b.fatArrowAt&&(b.fatArrowAt=null);var d=a.string.indexOf("=>",a.start);if(!(0>d)){if(r){var e=/:\s*(?:\w+(?:<[^>]*>|\[\])?|\{[^}]*\})\s*$/.exec(a.string.slice(a.start,d));e&&(d=e.index)}e=0;var h=!1;for(--d;0<=d;--d){var m=a.string.charAt(d),y="([{}])".indexOf(m);if(0<=y&&3>y){if(!e){++d;break}if(0==--e){"("==m&&(h=!0);break}}else if(3<=y&&6>y)++e;else if(ea.test(m))h=!0;else if(/["'\/`]/.test(m))for(;;--d){if(0==d)return;if(a.string.charAt(d-1)==m&&"\\"!=a.string.charAt(d-2)){d--;break}}else if(h&&!e){++d;break}}h&&!e&&(b.fatArrowAt=d)}}function Da(a,b,d,e,h,m){this.indented=a;this.column=b;this.type=d;this.prev=h;this.info=m;null!=e&&(this.align=e)}function Ea(a,b,d,e,h){var m=a.cc;p=a;w=h;f=null;ra=m;X=b;a.lexical.hasOwnProperty("align")||(a.lexical.align=!0);for(;;)if((m.length?m.pop():J?t:x)(d,e)){for(;m.length&&m[m.length-1].lex;)m.pop()();if(f)return f;if(d="variable"==d)a:if(Fa){for(d=a.localVars;d;d=d.next)if(d.name==e){d=!0;break a}for(a=a.context;a;a=a.prev)for(d=a.vars;d;d=d.next)if(d.name==e){d=!0;break a}d=void 0}else d=!1;return d?"variable-2":b}}function k(){for(var a=arguments.length-1;0<=a;a--)ra.push(arguments[a])}function c(){k.apply(null,arguments);return!0}function sa(a,b){for(;b;b=b.next)if(b.name==a)return!0;return!1}function O(a){var b=p;f="def";if(Fa){if(b.context)if("var"==b.lexical.info&&b.context&&b.context.block){var d=Ga(a,b.context);if(null!=d){b.context=d;return}}else if(!sa(a,b.localVars)){b.localVars=new Y(a,b.localVars);return}A.globalVars&&!sa(a,b.globalVars)&&(b.globalVars=new Y(a,b.globalVars))}}function Ga(a,b){return b?b.block?(a=Ga(a,b.prev))?a==b.prev?b:new Z(a,b.vars,!0):null:sa(a,b.vars)?b:new Z(b.prev,new Y(a,b.vars),!1):null}function ha(a){return"public"==a||"private"==a||"protected"==a||"abstract"==a||"readonly"==a}function Z(a,b,d){this.prev=a;this.vars=b;this.block=d}function Y(a,b){this.name=a;this.next=b}function K(){p.context=new Z(p.context,p.localVars,!1);p.localVars=Xa}function ia(){p.context=new Z(p.context,p.localVars,!0);p.localVars=null}function C(){p.localVars=p.context.vars;p.context=p.context.prev}function l(a,b){var d=function(){var e=p,h=e.indented;if("stat"==e.lexical.type)h=e.lexical.indented;else for(var m=e.lexical;m&&")"==m.type&&m.align;m=m.prev)h=m.indented;e.lexical=new Da(h,w.column(),a,null,e.lexical,b)};d.lex=!0;return d}function g(){var a=p;a.lexical.prev&&(")"==a.lexical.type&&(a.indented=a.lexical.indented),a.lexical=a.lexical.prev)}function n(a){function b(d){return d==a?c():";"==a||"}"==d||")"==d||"]"==d?k():c(b)}return b}function x(a,b){return"var"==a?c(l("vardef",b),ta,n(";"),g):"keyword a"==a?c(l("form"),ua,x,g):"keyword b"==a?c(l("form"),x,g):"keyword d"==a?w.match(/^\s*$/,!1)?c():c(l("stat"),P,n(";"),g):"debugger"==a?c(n(";")):"{"==a?c(l("}"),ia,ja,g,C):";"==a?c():"if"==a?("else"==p.lexical.info&&p.cc[p.cc.length-1]==g&&p.cc.pop()(),c(l("form"),ua,x,g,Ha)):"function"==a?c(G):"for"==a?c(l("form"),ia,Ia,x,C,g):"class"==a||r&&"interface"==b?(f="keyword",c(l("form","class"==a?a:b),Ja,g)):"variable"==a?r&&"declare"==b?(f="keyword",c(x)):r&&("module"==b||"enum"==b||"type"==b)&&w.match(/^\s*\w/,!1)?(f="keyword","enum"==b?c(Ka):"type"==b?c(La,n("operator"),q,n(";")):c(l("form"),D,n("{"),l("}"),ja,g,g)):r&&"namespace"==b?(f="keyword",c(l("form"),t,x,g)):r&&"abstract"==b?(f="keyword",c(x)):c(l("stat"),Ya):"switch"==a?c(l("form"),ua,n("{"),l("}","switch"),ia,ja,g,g,C):"case"==a?c(t,n(":")):"default"==a?c(n(":")):"catch"==a?c(l("form"),K,Za,x,g,C):"export"==a?c(l("stat"),$a,g):"import"==a?c(l("stat"),ab,g):"async"==a?c(x):"@"==b?c(t,x):k(l("stat"),t,n(";"),g)}function Za(a){if("("==a)return c(L,n(")"))}function t(a,b){return Ma(a,b,!1)}function B(a,b){return Ma(a,b,!0)}function ua(a){return"("!=a?k():c(l(")"),P,n(")"),g)}function Ma(a,b,d){if(p.fatArrowAt==w.start){var e=d?Na:Oa;if("("==a)return c(K,l(")"),z(L,")"),g,n("=>"),e,C);if("variable"==a)return k(K,D,n("=>"),e,C)}e=d?Q:M;return bb.hasOwnProperty(a)?c(e):"function"==a?c(G,e):"class"==a||r&&"interface"==b?(f="keyword",c(l("form"),cb,g)):"keyword c"==a||"async"==a?c(d?B:t):"("==a?c(l(")"),P,n(")"),g,e):"operator"==a||"spread"==a?c(d?B:t):"["==a?c(l("]"),db,g,e):"{"==a?aa(ka,"}",null,e):"quasi"==a?k(la,e):"new"==a?c(eb(d)):c()}function P(a){return a.match(/[;\}\)\],]/)?k():k(t)}function M(a,b){return","==a?c(P):Q(a,b,!1)}function Q(a,b,d){var e=0==d?M:Q,h=0==d?t:B;if("=>"==a)return c(K,d?Na:Oa,C);if("operator"==a)return/\+\+|--/.test(b)||r&&"!"==b?c(e):r&&"<"==b&&w.match(/^([^<>]|<[^<>]*>)*>\s*\(/,!1)?c(l(">"),z(q,">"),g,e):"?"==b?c(t,n(":"),h):c(h);if("quasi"==a)return k(la,e);if(";"!=a){if("("==a)return aa(B,")","call",e);if("."==a)return c(fb,e);if("["==a)return c(l("]"),P,n("]"),g,e);if(r&&"as"==b)return f="keyword",c(q,e);if("regexp"==a)return p.lastType=f="operator",w.backUp(w.pos-w.start-1),c(h)}}function la(a,b){return"quasi"!=a?k():"${"!=b.slice(b.length-2)?c(la):c(P,gb)}function gb(a){if("}"==a)return f="string-2",p.tokenize=W,c(la)}function Oa(a){qa(w,p);return k("{"==a?x:t)}function Na(a){qa(w,p);return k("{"==a?x:B)}function eb(a){return function(b){return"."==b?c(a?hb:ib):"variable"==b&&r?c(jb,a?Q:M):k(a?B:t)}}function ib(a,b){if("target"==b)return f="keyword",c(M)}function hb(a,b){if("target"==b)return f="keyword",c(Q)}function Ya(a){return":"==a?c(g,x):k(M,n(";"),g)}function fb(a){if("variable"==a)return f="property",c()}function ka(a,b){if("async"==a)return f="property",c(ka);if("variable"==a||"keyword"==X){f="property";if("get"==b||"set"==b)return c(kb);var d;r&&p.fatArrowAt==w.start&&(d=w.match(/^\s*:\s*/,!1))&&(p.fatArrowAt=w.pos+d[0].length);return c(N)}if("number"==a||"string"==a)return f=fa?"property":X+" property",c(N);if("jsonld-keyword"==a)return c(N);if(r&&ha(b))return f="keyword",c(ka);if("["==a)return c(t,R,n("]"),N);if("spread"==a)return c(B,N);if("*"==b)return f="keyword",c(ka);if(":"==a)return k(N)}function kb(a){if("variable"!=a)return k(N);f="property";return c(G)}function N(a){if(":"==a)return c(B);if("("==a)return k(G)}function z(a,b,d){function e(h,m){return(d?-1"),q);if("quasi"==a)return k(ya,E)}function nb(a){if("=>"==a)return c(q)}function wa(a){return a.match(/[\}\)\]]/)?c():","==a||";"==a?c(wa):k(ba,wa)}function ba(a,b){if("variable"==a||"keyword"==X)return f="property",c(ba);if("?"==b||"number"==a||"string"==a)return c(ba);if(":"==a)return c(q);if("["==a)return c(n("variable"),lb,n("]"),ba);if("("==a)return k(S,ba);if(!a.match(/[;\}\)\],]/))return c()}function ya(a,b){return"quasi"!=a?k():"${"!=b.slice(b.length-2)?c(ya):c(q,ob)}function ob(a){if("}"==a)return f="string-2",p.tokenize=W,c(ya)}function xa(a,b){return"variable"==a&&w.match(/^\s*[?:]/,!1)||"?"==b?c(xa):":"==a?c(q):"spread"==a?c(xa):k(q)}function E(a,b){if("<"==b)return c(l(">"),z(q,">"),g,E);if("|"==b||"."==a||"&"==b)return c(q);if("["==a)return c(q,n("]"),E);if("extends"==b||"implements"==b)return f="keyword",c(q);if("?"==b)return c(q,n(":"),q)}function jb(a,b){if("<"==b)return c(l(">"),z(q,">"),g,E)}function ma(){return k(q,pb)}function pb(a,b){if("="==b)return c(q)}function ta(a,b){return"enum"==b?(f="keyword",c(Ka)):k(D,R,H,qb)}function D(a,b){if(r&&ha(b))return f="keyword",c(D);if("variable"==a)return O(b),c();if("spread"==a)return c(D);if("["==a)return aa(rb,"]");if("{"==a)return aa(Qa,"}")}function Qa(a,b){if("variable"==a&&!w.match(/^\s*:/,!1))return O(b),c(H);"variable"==a&&(f="property");return"spread"==a?c(D):"}"==a?k():"["==a?c(t,n("]"),n(":"),Qa):c(n(":"),D,H)}function rb(){return k(D,H)}function H(a,b){if("="==b)return c(B)}function qb(a){if(","==a)return c(ta)}function Ha(a,b){if("keyword b"==a&&"else"==b)return c(l("form","else"),x,g)}function Ia(a,b){if("await"==b)return c(Ia);if("("==a)return c(l(")"),sb,g)}function sb(a){return"var"==a?c(ta,T):"variable"==a?c(T):k(T)}function T(a,b){return")"==a?c():";"==a?c(T):"in"==b||"of"==b?(f="keyword",c(t,T)):k(t,T)}function G(a,b){if("*"==b)return f="keyword",c(G);if("variable"==a)return O(b),c(G);if("("==a)return c(K,l(")"),z(L,")"),g,Pa,x,C);if(r&&"<"==b)return c(l(">"),z(ma,">"),g,G)}function S(a,b){if("*"==b)return f="keyword",c(S);if("variable"==a)return O(b),c(S);if("("==a)return c(K,l(")"),z(L,")"),g,Pa,C);if(r&&"<"==b)return c(l(">"),z(ma,">"),g,S)}function La(a,b){if("keyword"==a||"variable"==a)return f="type",c(La);if("<"==b)return c(l(">"),z(ma,">"),g)}function L(a,b){"@"==b&&c(t,L);return"spread"==a?c(L):r&&ha(b)?(f="keyword",c(L)):r&&"this"==a?c(R,H):k(D,R,H)}function cb(a,b){return"variable"==a?Ja(a,b):na(a,b)}function Ja(a,b){if("variable"==a)return O(b),c(na)}function na(a,b){if("<"==b)return c(l(">"),z(ma,">"),g,na);if("extends"==b||"implements"==b||r&&","==a)return"implements"==b&&(f="keyword"),c(r?q:t,na);if("{"==a)return c(l("}"),F,g)}function F(a,b){if("async"==a||"variable"==a&&("static"==b||"get"==b||"set"==b||r&&ha(b))&&w.match(/^\s+[\w$\xa1-\uffff]/,!1))return f="keyword",c(F);if("variable"==a||"keyword"==X)return f="property",c(oa,F);if("number"==a||"string"==a)return c(oa,F);if("["==a)return c(t,R,n("]"),oa,F);if("*"==b)return f="keyword",c(F);if(r&&"("==a)return k(S,F);if(";"==a||","==a)return c(F);if("}"==a)return c();if("@"==b)return c(t,F)}function oa(a,b){if("!"==b||"?"==b)return c(oa);if(":"==a)return c(q,H);if("="==b)return c(B);a=p.lexical.prev;return k(a&&"interface"==a.info?S:G)}function $a(a,b){return"*"==b?(f="keyword",c(za,n(";"))):"default"==b?(f="keyword",c(t,n(";"))):"{"==a?c(z(Ra,"}"),za,n(";")):k(x)}function Ra(a,b){if("as"==b)return f="keyword",c(n("variable"));if("variable"==a)return k(B,Ra)}function ab(a){return"string"==a?c():"("==a?k(t):"."==a?k(M):k(pa,Sa,za)}function pa(a,b){if("{"==a)return aa(pa,"}");"variable"==a&&O(b);"*"==b&&(f="keyword");return c(tb)}function Sa(a){if(","==a)return c(pa,Sa)}function tb(a,b){if("as"==b)return f="keyword",c(pa)}function za(a,b){if("from"==b)return f="keyword",c(t)}function db(a){return"]"==a?c():k(z(B,"]"))}function Ka(){return k(l("form"),D,n("{"),l("}"),z(ub,"}"),g,g)}function ub(){return k(D,H)}function Aa(a,b,d){return b.tokenize==I&&/^(?:operator|sof|keyword [bcd]|case|new|export|default|spread|[\[{}\(,;:]|=>)$/.test(b.lastType)||"quasi"==b.lastType&&/\{\s*$/.test(a.string.slice(0,a.pos-(d||0)))}var U=Ua.indentUnit,Ta=A.statementIndent,fa=A.jsonld,J=A.json||fa,Fa=!1!==A.trackScope,r=A.typescript,ea=A.wordCharacters||/[\w$\xa1-\uffff]/,Ca=function(){function a(va){return{type:va,style:"keyword"}}var b=a("keyword a"),d=a("keyword b"),e=a("keyword c"),h=a("keyword d"),m=a("operator"),y={type:"atom",style:"atom"};return{if:a("if"),while:b,with:b,else:d,do:d,try:d,finally:d,return:h,break:h,continue:h,new:a("new"),delete:e,void:e,throw:e,debugger:a("debugger"),var:a("var"),const:a("var"),let:a("var"),function:a("function"),catch:a("catch"),for:a("for"),switch:a("switch"),case:a("case"),default:a("default"),in:m,typeof:m,instanceof:m,true:y,false:y,null:y,undefined:y,NaN:y,Infinity:y,this:a("this"),class:a("class"),super:a("atom"),yield:e,export:a("export"),import:a("import"),extends:e,await:e}}(),Ba=/[+\-*&%=<>!?|~^@]/,Wa=/^@(context|id|value|language|type|container|list|set|reverse|index|base|vocab|graph)"/,V,ca,bb={atom:!0,number:!0,variable:!0,string:!0,regexp:!0,this:!0,import:!0,"jsonld-keyword":!0};var ra=f=p=null;var X=w=void 0;var Xa=new Y("this",new Y("arguments",null));K.lex=ia.lex=!0;C.lex=!0;g.lex=!0;return{startState:function(a){a={tokenize:I,lastType:"sof",cc:[],lexical:new Da((a||0)-U,0,"block",!1),localVars:A.localVars,context:A.localVars&&new Z(null,null,!1),indented:a||0};A.globalVars&&"object"==typeof A.globalVars&&(a.globalVars=A.globalVars);return a},token:function(a,b){a.sol()&&(b.lexical.hasOwnProperty("align")||(b.lexical.align=!1),b.indented=a.indentation(),qa(a,b));if(b.tokenize!=da&&a.eatSpace())return null;var d=b.tokenize(a,b);if("comment"==V)return d;b.lastType="operator"!=V||"++"!=ca&&"--"!=ca?V:"incdec";return Ea(b,d,V,ca,a)},indent:function(a,b){if(a.tokenize==da||a.tokenize==W)return v.Pass;if(a.tokenize!=I)return 0;var d=b&&b.charAt(0),e=a.lexical,h;if(!/^\s*else\b/.test(b))for(var m=a.cc.length-1;0<=m;--m){var y=a.cc[m];if(y==g)e=e.prev;else if(y!=Ha&&y!=C)break}for(;!("stat"!=e.type&&"form"!=e.type||"}"!=d&&(!(h=a.cc[a.cc.length-1])||h!=M&&h!=Q||/^[,\.=+\-*:?[\(]/.test(b)));)e=e.prev;Ta&&")"==e.type&&"stat"==e.prev.type&&(e=e.prev);h=e.type;m=d==h;return"vardef"==h?e.indented+("operator"==a.lastType||","==a.lastType?e.info.length+1:0):"form"==h&&"{"==d?e.indented:"form"==h?e.indented+U:"stat"==h?(d=e.indented,a="operator"==a.lastType||","==a.lastType||Ba.test(b.charAt(0))||/[,.]/.test(b.charAt(0)),d+(a?Ta||U:0)):"switch"!=e.info||m||0==A.doubleIndentSwitch?e.align?e.column+(m?0:1):e.indented+(m?0:U):e.indented+(/^(?:case|default)\b/.test(b)?U:2*U)},electricInput:/^\s*(?:case .*?:|default:|\{|\})$/,blockCommentStart:J?null:"/*",blockCommentEnd:J?null:"*/",blockCommentContinue:J?null:" * ",lineComment:J?null:"//",fold:"brace",closeBrackets:"()[]{}''\"\"``",helperType:J?"json":"javascript",jsonldMode:fa,jsonMode:J,expressionAllowed:Aa,skipExpression:function(a){Ea(a,"atom","atom","true",new v.StringStream("",2,null))}}}));v.registerHelper("wordChars","javascript",/[\w$]/);v.defineMIME("text/javascript","javascript");v.defineMIME("text/ecmascript","javascript");v.defineMIME("application/javascript","javascript");v.defineMIME("application/x-javascript","javascript");v.defineMIME("application/ecmascript","javascript");v.defineMIME("application/json",{name:"javascript",json:!0});v.defineMIME("application/x-json",{name:"javascript",json:!0});v.defineMIME("application/manifest+json",{name:"javascript",json:!0});v.defineMIME("application/ld+json",{name:"javascript",jsonld:!0});v.defineMIME("text/typescript",{name:"javascript",typescript:!0});v.defineMIME("application/typescript",{name:"javascript",typescript:!0})}))},{"../../lib/codemirror":58}],60:[function(require,module,exports){var slice=[].slice;module.exports=function(obj,fn){if("string"==typeof fn)fn=obj[fn];if("function"!=typeof fn)throw new Error("bind() requires a function");var args=slice.call(arguments,2);return function(){return fn.apply(obj,args.concat(slice.call(arguments)))}}},{}],61:[function(require,module,exports){if(typeof module!=="undefined"){module.exports=Emitter}function Emitter(obj){if(obj)return mixin(obj)}function mixin(obj){for(var key in Emitter.prototype){obj[key]=Emitter.prototype[key]}return obj}Emitter.prototype.on=Emitter.prototype.addEventListener=function(event,fn){this._callbacks=this._callbacks||{};(this._callbacks["$"+event]=this._callbacks["$"+event]||[]).push(fn);return this};Emitter.prototype.once=function(event,fn){function on(){this.off(event,on);fn.apply(this,arguments)}on.fn=fn;this.on(event,on);return this};Emitter.prototype.off=Emitter.prototype.removeListener=Emitter.prototype.removeAllListeners=Emitter.prototype.removeEventListener=function(event,fn){this._callbacks=this._callbacks||{};if(0==arguments.length){this._callbacks={};return this}var callbacks=this._callbacks["$"+event];if(!callbacks)return this;if(1==arguments.length){delete this._callbacks["$"+event];return this}var cb;for(var i=0;i0){this.extraHeaders=opts.extraHeaders}if(opts.localAddress){this.localAddress=opts.localAddress}}this.id=null;this.upgrades=null;this.pingInterval=null;this.pingTimeout=null;this.pingIntervalTimer=null;this.pingTimeoutTimer=null;this.open()}Socket.priorWebsocketSuccess=false;Emitter(Socket.prototype);Socket.protocol=parser.protocol;Socket.Socket=Socket;Socket.Transport=require("./transport");Socket.transports=require("./transports/index");Socket.parser=require("engine.io-parser");Socket.prototype.createTransport=function(name){debug('creating transport "%s"',name);var query=clone(this.query);query.EIO=parser.protocol;query.transport=name;var options=this.transportOptions[name]||{};if(this.id)query.sid=this.id;var transport=new transports[name]({query:query,socket:this,agent:options.agent||this.agent,hostname:options.hostname||this.hostname,port:options.port||this.port,secure:options.secure||this.secure,path:options.path||this.path,forceJSONP:options.forceJSONP||this.forceJSONP,jsonp:options.jsonp||this.jsonp,forceBase64:options.forceBase64||this.forceBase64,enablesXDR:options.enablesXDR||this.enablesXDR,withCredentials:options.withCredentials||this.withCredentials,timestampRequests:options.timestampRequests||this.timestampRequests,timestampParam:options.timestampParam||this.timestampParam,policyPort:options.policyPort||this.policyPort,pfx:options.pfx||this.pfx,key:options.key||this.key,passphrase:options.passphrase||this.passphrase,cert:options.cert||this.cert,ca:options.ca||this.ca,ciphers:options.ciphers||this.ciphers,rejectUnauthorized:options.rejectUnauthorized||this.rejectUnauthorized,perMessageDeflate:options.perMessageDeflate||this.perMessageDeflate,extraHeaders:options.extraHeaders||this.extraHeaders,forceNode:options.forceNode||this.forceNode,localAddress:options.localAddress||this.localAddress,requestTimeout:options.requestTimeout||this.requestTimeout,protocols:options.protocols||void 0,isReactNative:this.isReactNative});return transport};function clone(obj){var o={};for(var i in obj){if(obj.hasOwnProperty(i)){o[i]=obj[i]}}return o}Socket.prototype.open=function(){var transport;if(this.rememberUpgrade&&Socket.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1){transport="websocket"}else if(0===this.transports.length){var self=this;setTimeout((function(){self.emit("error","No transports available")}),0);return}else{transport=this.transports[0]}this.readyState="opening";try{transport=this.createTransport(transport)}catch(e){this.transports.shift();this.open();return}transport.open();this.setTransport(transport)};Socket.prototype.setTransport=function(transport){debug("setting transport %s",transport.name);var self=this;if(this.transport){debug("clearing existing transport %s",this.transport.name);this.transport.removeAllListeners()}this.transport=transport;transport.on("drain",(function(){self.onDrain()})).on("packet",(function(packet){self.onPacket(packet)})).on("error",(function(e){self.onError(e)})).on("close",(function(){self.onClose("transport close")}))};Socket.prototype.probe=function(name){debug('probing transport "%s"',name);var transport=this.createTransport(name,{probe:1});var failed=false;var self=this;Socket.priorWebsocketSuccess=false;function onTransportOpen(){if(self.onlyBinaryUpgrades){var upgradeLosesBinary=!this.supportsBinary&&self.transport.supportsBinary;failed=failed||upgradeLosesBinary}if(failed)return;debug('probe transport "%s" opened',name);transport.send([{type:"ping",data:"probe"}]);transport.once("packet",(function(msg){if(failed)return;if("pong"===msg.type&&"probe"===msg.data){debug('probe transport "%s" pong',name);self.upgrading=true;self.emit("upgrading",transport);if(!transport)return;Socket.priorWebsocketSuccess="websocket"===transport.name;debug('pausing current transport "%s"',self.transport.name);self.transport.pause((function(){if(failed)return;if("closed"===self.readyState)return;debug("changing transport and sending upgrade packet");cleanup();self.setTransport(transport);transport.send([{type:"upgrade"}]);self.emit("upgrade",transport);transport=null;self.upgrading=false;self.flush()}))}else{debug('probe transport "%s" failed',name);var err=new Error("probe error");err.transport=transport.name;self.emit("upgradeError",err)}}))}function freezeTransport(){if(failed)return;failed=true;cleanup();transport.close();transport=null}function onerror(err){var error=new Error("probe error: "+err);error.transport=transport.name;freezeTransport();debug('probe transport "%s" failed because of error: %s',name,err);self.emit("upgradeError",error)}function onTransportClose(){onerror("transport closed")}function onclose(){onerror("socket closed")}function onupgrade(to){if(transport&&to.name!==transport.name){debug('"%s" works - aborting "%s"',to.name,transport.name);freezeTransport()}}function cleanup(){transport.removeListener("open",onTransportOpen);transport.removeListener("error",onerror);transport.removeListener("close",onTransportClose);self.removeListener("close",onclose);self.removeListener("upgrading",onupgrade)}transport.once("open",onTransportOpen);transport.once("error",onerror);transport.once("close",onTransportClose);this.once("close",onclose);this.once("upgrading",onupgrade);transport.open()};Socket.prototype.onOpen=function(){debug("socket open");this.readyState="open";Socket.priorWebsocketSuccess="websocket"===this.transport.name;this.emit("open");this.flush();if("open"===this.readyState&&this.upgrade&&this.transport.pause){debug("starting upgrade probes");for(var i=0,l=this.upgrades.length;i';iframe=document.createElement(html)}catch(e){iframe=document.createElement("iframe");iframe.name=self.iframeId;iframe.src="javascript:0"}iframe.id=self.iframeId;self.form.appendChild(iframe);self.iframe=iframe}initIframe();data=data.replace(rEscapedNewline,"\\\n");this.area.value=data.replace(rNewline,"\\n");try{this.form.submit()}catch(e){}if(this.iframe.attachEvent){this.iframe.onreadystatechange=function(){if(self.iframe.readyState==="complete"){complete()}}}else{this.iframe.onload=complete}}},{"../globalThis":64,"./polling":71,"component-inherit":62}],70:[function(require,module,exports){var XMLHttpRequest=require("./xmlhttprequest");var Polling=require("./polling");var Emitter=require("component-emitter");var inherit=require("component-inherit");var debug=require("debug")("engine.io-client:polling-xhr");var globalThis=require("../globalThis");module.exports=XHR;module.exports.Request=Request;function empty(){}function XHR(opts){Polling.call(this,opts);this.requestTimeout=opts.requestTimeout;this.extraHeaders=opts.extraHeaders;if(typeof location!=="undefined"){var isSSL="https:"===location.protocol;var port=location.port;if(!port){port=isSSL?443:80}this.xd=typeof location!=="undefined"&&opts.hostname!==location.hostname||port!==opts.port;this.xs=opts.secure!==isSSL}}inherit(XHR,Polling);XHR.prototype.supportsBinary=true;XHR.prototype.request=function(opts){opts=opts||{};opts.uri=this.uri();opts.xd=this.xd;opts.xs=this.xs;opts.agent=this.agent||false;opts.supportsBinary=this.supportsBinary;opts.enablesXDR=this.enablesXDR;opts.withCredentials=this.withCredentials;opts.pfx=this.pfx;opts.key=this.key;opts.passphrase=this.passphrase;opts.cert=this.cert;opts.ca=this.ca;opts.ciphers=this.ciphers;opts.rejectUnauthorized=this.rejectUnauthorized;opts.requestTimeout=this.requestTimeout;opts.extraHeaders=this.extraHeaders;return new Request(opts)};XHR.prototype.doWrite=function(data,fn){var isBinary=typeof data!=="string"&&data!==undefined;var req=this.request({method:"POST",data:data,isBinary:isBinary});var self=this;req.on("success",fn);req.on("error",(function(err){self.onError("xhr post error",err)}));this.sendXhr=req};XHR.prototype.doPoll=function(){debug("xhr poll");var req=this.request();var self=this;req.on("data",(function(data){self.onData(data)}));req.on("error",(function(err){self.onError("xhr poll error",err)}));this.pollXhr=req};function Request(opts){this.method=opts.method||"GET";this.uri=opts.uri;this.xd=!!opts.xd;this.xs=!!opts.xs;this.async=false!==opts.async;this.data=undefined!==opts.data?opts.data:null;this.agent=opts.agent;this.isBinary=opts.isBinary;this.supportsBinary=opts.supportsBinary;this.enablesXDR=opts.enablesXDR;this.withCredentials=opts.withCredentials;this.requestTimeout=opts.requestTimeout;this.pfx=opts.pfx;this.key=opts.key;this.passphrase=opts.passphrase;this.cert=opts.cert;this.ca=opts.ca;this.ciphers=opts.ciphers;this.rejectUnauthorized=opts.rejectUnauthorized;this.extraHeaders=opts.extraHeaders;this.create()}Emitter(Request.prototype);Request.prototype.create=function(){var opts={agent:this.agent,xdomain:this.xd,xscheme:this.xs,enablesXDR:this.enablesXDR};opts.pfx=this.pfx;opts.key=this.key;opts.passphrase=this.passphrase;opts.cert=this.cert;opts.ca=this.ca;opts.ciphers=this.ciphers;opts.rejectUnauthorized=this.rejectUnauthorized;var xhr=this.xhr=new XMLHttpRequest(opts);var self=this;try{debug("xhr open %s: %s",this.method,this.uri);xhr.open(this.method,this.uri,this.async);try{if(this.extraHeaders){xhr.setDisableHeaderCheck&&xhr.setDisableHeaderCheck(true);for(var i in this.extraHeaders){if(this.extraHeaders.hasOwnProperty(i)){xhr.setRequestHeader(i,this.extraHeaders[i])}}}}catch(e){}if("POST"===this.method){try{if(this.isBinary){xhr.setRequestHeader("Content-type","application/octet-stream")}else{xhr.setRequestHeader("Content-type","text/plain;charset=UTF-8")}}catch(e){}}try{xhr.setRequestHeader("Accept","*/*")}catch(e){}if("withCredentials"in xhr){xhr.withCredentials=this.withCredentials}if(this.requestTimeout){xhr.timeout=this.requestTimeout}if(this.hasXDR()){xhr.onload=function(){self.onLoad()};xhr.onerror=function(){self.onError(xhr.responseText)}}else{xhr.onreadystatechange=function(){if(xhr.readyState===2){try{var contentType=xhr.getResponseHeader("Content-Type");if(self.supportsBinary&&contentType==="application/octet-stream"||contentType==="application/octet-stream; charset=UTF-8"){xhr.responseType="arraybuffer"}}catch(e){}}if(4!==xhr.readyState)return;if(200===xhr.status||1223===xhr.status){self.onLoad()}else{setTimeout((function(){self.onError(typeof xhr.status==="number"?xhr.status:0)}),0)}}}debug("xhr data %s",this.data);xhr.send(this.data)}catch(e){setTimeout((function(){self.onError(e)}),0);return}if(typeof document!=="undefined"){this.index=Request.requestsCount++;Request.requests[this.index]=this}};Request.prototype.onSuccess=function(){this.emit("success");this.cleanup()};Request.prototype.onData=function(data){this.emit("data",data);this.onSuccess()};Request.prototype.onError=function(err){this.emit("error",err);this.cleanup(true)};Request.prototype.cleanup=function(fromError){if("undefined"===typeof this.xhr||null===this.xhr){return}if(this.hasXDR()){this.xhr.onload=this.xhr.onerror=empty}else{this.xhr.onreadystatechange=empty}if(fromError){try{this.xhr.abort()}catch(e){}}if(typeof document!=="undefined"){delete Request.requests[this.index]}this.xhr=null};Request.prototype.onLoad=function(){var data;try{var contentType;try{contentType=this.xhr.getResponseHeader("Content-Type")}catch(e){}if(contentType==="application/octet-stream"||contentType==="application/octet-stream; charset=UTF-8"){data=this.xhr.response||this.xhr.responseText}else{data=this.xhr.responseText}}catch(e){this.onError(e)}if(null!=data){this.onData(data)}};Request.prototype.hasXDR=function(){return typeof XDomainRequest!=="undefined"&&!this.xs&&this.enablesXDR};Request.prototype.abort=function(){this.cleanup()};Request.requestsCount=0;Request.requests={};if(typeof document!=="undefined"){if(typeof attachEvent==="function"){attachEvent("onunload",unloadHandler)}else if(typeof addEventListener==="function"){var terminationEvent="onpagehide"in globalThis?"pagehide":"unload";addEventListener(terminationEvent,unloadHandler,false)}}function unloadHandler(){for(var i in Request.requests){if(Request.requests.hasOwnProperty(i)){Request.requests[i].abort()}}}},{"../globalThis":64,"./polling":71,"./xmlhttprequest":73,"component-emitter":61,"component-inherit":62,debug:74}],71:[function(require,module,exports){var Transport=require("../transport");var parseqs=require("parseqs");var parser=require("engine.io-parser");var inherit=require("component-inherit");var yeast=require("yeast");var debug=require("debug")("engine.io-client:polling");module.exports=Polling;var hasXHR2=function(){var XMLHttpRequest=require("./xmlhttprequest");var xhr=new XMLHttpRequest({xdomain:false});return null!=xhr.responseType}();function Polling(opts){var forceBase64=opts&&opts.forceBase64;if(!hasXHR2||forceBase64){this.supportsBinary=false}Transport.call(this,opts)}inherit(Polling,Transport);Polling.prototype.name="polling";Polling.prototype.doOpen=function(){this.poll()};Polling.prototype.pause=function(onPause){var self=this;this.readyState="pausing";function pause(){debug("paused");self.readyState="paused";onPause()}if(this.polling||!this.writable){var total=0;if(this.polling){debug("we are currently polling - waiting to pause");total++;this.once("pollComplete",(function(){debug("pre-pause polling complete");--total||pause()}))}if(!this.writable){debug("we are currently writing - waiting to pause");total++;this.once("drain",(function(){debug("pre-pause writing complete");--total||pause()}))}}else{pause()}};Polling.prototype.poll=function(){debug("polling");this.polling=true;this.doPoll();this.emit("poll")};Polling.prototype.onData=function(data){var self=this;debug("polling got data %s",data);var callback=function(packet,index,total){if("opening"===self.readyState&&packet.type==="open"){self.onOpen()}if("close"===packet.type){self.onClose();return false}self.onPacket(packet)};parser.decodePayload(data,this.socket.binaryType,callback);if("closed"!==this.readyState){this.polling=false;this.emit("pollComplete");if("open"===this.readyState){this.poll()}else{debug('ignoring poll - transport state "%s"',this.readyState)}}};Polling.prototype.doClose=function(){var self=this;function close(){debug("writing close packet");self.write([{type:"close"}])}if("open"===this.readyState){debug("transport open - closing");close()}else{debug("transport not open - deferring close");this.once("open",close)}};Polling.prototype.write=function(packets){var self=this;this.writable=false;var callbackfn=function(){self.writable=true;self.emit("drain")};parser.encodePayload(packets,this.supportsBinary,(function(data){self.doWrite(data,callbackfn)}))};Polling.prototype.uri=function(){var query=this.query||{};var schema=this.secure?"https":"http";var port="";if(false!==this.timestampRequests){query[this.timestampParam]=yeast()}if(!this.supportsBinary&&!query.sid){query.b64=1}query=parseqs.encode(query);if(this.port&&("https"===schema&&Number(this.port)!==443||"http"===schema&&Number(this.port)!==80)){port=":"+this.port}if(query.length){query="?"+query}var ipv6=this.hostname.indexOf(":")!==-1;return schema+"://"+(ipv6?"["+this.hostname+"]":this.hostname)+port+this.path+query}},{"../transport":67,"./xmlhttprequest":73,"component-inherit":62,debug:74,"engine.io-parser":77,parseqs:156,yeast:227}],72:[function(require,module,exports){(function(Buffer){(function(){var Transport=require("../transport");var parser=require("engine.io-parser");var parseqs=require("parseqs");var inherit=require("component-inherit");var yeast=require("yeast");var debug=require("debug")("engine.io-client:websocket");var BrowserWebSocket,NodeWebSocket;if(typeof WebSocket!=="undefined"){BrowserWebSocket=WebSocket}else if(typeof self!=="undefined"){BrowserWebSocket=self.WebSocket||self.MozWebSocket}if(typeof window==="undefined"){try{NodeWebSocket=require("ws")}catch(e){}}var WebSocketImpl=BrowserWebSocket||NodeWebSocket;module.exports=WS;function WS(opts){var forceBase64=opts&&opts.forceBase64;if(forceBase64){this.supportsBinary=false}this.perMessageDeflate=opts.perMessageDeflate;this.usingBrowserWebSocket=BrowserWebSocket&&!opts.forceNode;this.protocols=opts.protocols;if(!this.usingBrowserWebSocket){WebSocketImpl=NodeWebSocket}Transport.call(this,opts)}inherit(WS,Transport);WS.prototype.name="websocket";WS.prototype.supportsBinary=true;WS.prototype.doOpen=function(){if(!this.check()){return}var uri=this.uri();var protocols=this.protocols;var opts={};if(!this.isReactNative){opts.agent=this.agent;opts.perMessageDeflate=this.perMessageDeflate;opts.pfx=this.pfx;opts.key=this.key;opts.passphrase=this.passphrase;opts.cert=this.cert;opts.ca=this.ca;opts.ciphers=this.ciphers;opts.rejectUnauthorized=this.rejectUnauthorized}if(this.extraHeaders){opts.headers=this.extraHeaders}if(this.localAddress){opts.localAddress=this.localAddress}try{this.ws=this.usingBrowserWebSocket&&!this.isReactNative?protocols?new WebSocketImpl(uri,protocols):new WebSocketImpl(uri):new WebSocketImpl(uri,protocols,opts)}catch(err){return this.emit("error",err)}if(this.ws.binaryType===undefined){this.supportsBinary=false}if(this.ws.supports&&this.ws.supports.binary){this.supportsBinary=true;this.ws.binaryType="nodebuffer"}else{this.ws.binaryType="arraybuffer"}this.addEventListeners()};WS.prototype.addEventListeners=function(){var self=this;this.ws.onopen=function(){self.onOpen()};this.ws.onclose=function(){self.onClose()};this.ws.onmessage=function(ev){self.onData(ev.data)};this.ws.onerror=function(e){self.onError("websocket error",e)}};WS.prototype.write=function(packets){var self=this;this.writable=false;var total=packets.length;for(var i=0,l=total;i=31||typeof navigator!=="undefined"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}exports.formatters.j=function(v){try{return JSON.stringify(v)}catch(err){return"[UnexpectedJSONParseError]: "+err.message}};function formatArgs(args){var useColors=this.useColors;args[0]=(useColors?"%c":"")+this.namespace+(useColors?" %c":" ")+args[0]+(useColors?"%c ":" ")+"+"+exports.humanize(this.diff);if(!useColors)return;var c="color: "+this.color;args.splice(1,0,c,"color: inherit");var index=0;var lastC=0;args[0].replace(/%[a-zA-Z%]/g,(function(match){if("%%"===match)return;index++;if("%c"===match){lastC=index}}));args.splice(lastC,0,c)}function log(){return"object"===typeof console&&console.log&&Function.prototype.apply.call(console.log,console,arguments)}function save(namespaces){try{if(null==namespaces){exports.storage.removeItem("debug")}else{exports.storage.debug=namespaces}}catch(e){}}function load(){var r;try{r=exports.storage.debug}catch(e){}if(!r&&typeof process!=="undefined"&&"env"in process){r=process.env.DEBUG}return r}exports.enable(load());function localstorage(){try{return window.localStorage}catch(e){}}}).call(this)}).call(this,require("_process"))},{"./debug":75,_process:160}],75:[function(require,module,exports){exports=module.exports=createDebug.debug=createDebug["default"]=createDebug;exports.coerce=coerce;exports.disable=disable;exports.enable=enable;exports.enabled=enabled;exports.humanize=require("ms");exports.instances=[];exports.names=[];exports.skips=[];exports.formatters={};function selectColor(namespace){var hash=0,i;for(i in namespace){hash=(hash<<5)-hash+namespace.charCodeAt(i);hash|=0}return exports.colors[Math.abs(hash)%exports.colors.length]}function createDebug(namespace){var prevTime;function debug(){if(!debug.enabled)return;var self=debug;var curr=+new Date;var ms=curr-(prevTime||curr);self.diff=ms;self.prev=prevTime;self.curr=curr;prevTime=curr;var args=new Array(arguments.length);for(var i=0;i0){return parse(val)}else if(type==="number"&&isNaN(val)===false){return options.long?fmtLong(val):fmtShort(val)}throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(val))};function parse(str){str=String(str);if(str.length>100){return}var match=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(str);if(!match){return}var n=parseFloat(match[1]);var type=(match[2]||"ms").toLowerCase();switch(type){case"years":case"year":case"yrs":case"yr":case"y":return n*y;case"days":case"day":case"d":return n*d;case"hours":case"hour":case"hrs":case"hr":case"h":return n*h;case"minutes":case"minute":case"mins":case"min":case"m":return n*m;case"seconds":case"second":case"secs":case"sec":case"s":return n*s;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return n;default:return undefined}}function fmtShort(ms){if(ms>=d){return Math.round(ms/d)+"d"}if(ms>=h){return Math.round(ms/h)+"h"}if(ms>=m){return Math.round(ms/m)+"m"}if(ms>=s){return Math.round(ms/s)+"s"}return ms+"ms"}function fmtLong(ms){return plural(ms,d,"day")||plural(ms,h,"hour")||plural(ms,m,"minute")||plural(ms,s,"second")||ms+" ms"}function plural(ms,n,name){if(ms1){return{type:packetslist[type],data:data.substring(1)}}else{return{type:packetslist[type]}}}var asArray=new Uint8Array(data);var type=asArray[0];var rest=sliceBuffer(data,1);if(Blob&&binaryType==="blob"){rest=new Blob([rest])}return{type:packetslist[type],data:rest}};function tryDecode(data){try{data=utf8.decode(data,{strict:false})}catch(e){return false}return data}exports.decodeBase64Packet=function(msg,binaryType){var type=packetslist[msg.charAt(0)];if(!base64encoder){return{type:type,data:{base64:true,data:msg.substr(1)}}}var data=base64encoder.decode(msg.substr(1));if(binaryType==="blob"&&Blob){data=new Blob([data])}return{type:type,data:data}};exports.encodePayload=function(packets,supportsBinary,callback){if(typeof supportsBinary==="function"){callback=supportsBinary;supportsBinary=null}var isBinary=hasBinary(packets);if(supportsBinary&&isBinary){if(Blob&&!dontSendBlobs){return exports.encodePayloadAsBlob(packets,callback)}return exports.encodePayloadAsArrayBuffer(packets,callback)}if(!packets.length){return callback("0:")}function setLengthHeader(message){return message.length+":"+message}function encodeOne(packet,doneCallback){exports.encodePacket(packet,!isBinary?false:supportsBinary,false,(function(message){doneCallback(null,setLengthHeader(message))}))}map(packets,encodeOne,(function(err,results){return callback(results.join(""))}))};function map(ary,each,done){var result=new Array(ary.length);var next=after(ary.length,done);var eachWithIndex=function(i,el,cb){each(el,(function(error,msg){result[i]=msg;cb(error,result)}))};for(var i=0;i0){var tailArray=new Uint8Array(bufferTail);var isString=tailArray[0]===0;var msgLength="";for(var i=1;;i++){if(tailArray[i]===255)break;if(msgLength.length>310){return callback(err,0,1)}msgLength+=tailArray[i]}bufferTail=sliceBuffer(bufferTail,2+msgLength.length);msgLength=parseInt(msgLength);var msg=sliceBuffer(bufferTail,0,msgLength);if(isString){try{msg=String.fromCharCode.apply(null,new Uint8Array(msg))}catch(e){var typed=new Uint8Array(msg);msg="";for(var i=0;i=55296&&value<=56319&&counter65535){value-=65536;output+=stringFromCharCode(value>>>10&1023|55296);value=56320|value&1023}output+=stringFromCharCode(value)}return output}function checkScalarValue(codePoint,strict){if(codePoint>=55296&&codePoint<=57343){if(strict){throw Error("Lone surrogate U+"+codePoint.toString(16).toUpperCase()+" is not a scalar value")}return false}return true}function createByte(codePoint,shift){return stringFromCharCode(codePoint>>shift&63|128)}function encodeCodePoint(codePoint,strict){if((codePoint&4294967168)==0){return stringFromCharCode(codePoint)}var symbol="";if((codePoint&4294965248)==0){symbol=stringFromCharCode(codePoint>>6&31|192)}else if((codePoint&4294901760)==0){if(!checkScalarValue(codePoint,strict)){codePoint=65533}symbol=stringFromCharCode(codePoint>>12&15|224);symbol+=createByte(codePoint,6)}else if((codePoint&4292870144)==0){symbol=stringFromCharCode(codePoint>>18&7|240);symbol+=createByte(codePoint,12);symbol+=createByte(codePoint,6)}symbol+=stringFromCharCode(codePoint&63|128);return symbol}function utf8encode(string,opts){opts=opts||{};var strict=false!==opts.strict;var codePoints=ucs2decode(string);var length=codePoints.length;var index=-1;var codePoint;var byteString="";while(++index=byteCount){throw Error("Invalid byte index")}var continuationByte=byteArray[byteIndex]&255;byteIndex++;if((continuationByte&192)==128){return continuationByte&63}throw Error("Invalid continuation byte")}function decodeSymbol(strict){var byte1;var byte2;var byte3;var byte4;var codePoint;if(byteIndex>byteCount){throw Error("Invalid byte index")}if(byteIndex==byteCount){return false}byte1=byteArray[byteIndex]&255;byteIndex++;if((byte1&128)==0){return byte1}if((byte1&224)==192){byte2=readContinuationByte();codePoint=(byte1&31)<<6|byte2;if(codePoint>=128){return codePoint}else{throw Error("Invalid continuation byte")}}if((byte1&240)==224){byte2=readContinuationByte();byte3=readContinuationByte();codePoint=(byte1&15)<<12|byte2<<6|byte3;if(codePoint>=2048){return checkScalarValue(codePoint,strict)?codePoint:65533}else{throw Error("Invalid continuation byte")}}if((byte1&248)==240){byte2=readContinuationByte();byte3=readContinuationByte();byte4=readContinuationByte();codePoint=(byte1&7)<<18|byte2<<12|byte3<<6|byte4;if(codePoint>=65536&&codePoint<=1114111){return codePoint}}throw Error("Invalid UTF-8 detected")}var byteArray;var byteCount;var byteIndex;function utf8decode(byteString,opts){opts=opts||{};var strict=false!==opts.strict;byteArray=ucs2decode(byteString);byteCount=byteArray.length;byteIndex=0;var codePoints=[];var tmp;while((tmp=decodeSymbol(strict))!==false){codePoints.push(tmp)}return ucs2encode(codePoints)}module.exports={version:"2.1.2",encode:utf8encode,decode:utf8decode}},{}],80:[function(require,module,exports){"use strict";function assign(obj,props){for(const key in props){Object.defineProperty(obj,key,{value:props[key],enumerable:true,configurable:true})}return obj}function createError(err,code,props){if(!err||typeof err==="string"){throw new TypeError("Please pass an Error to err-code")}if(!props){props={}}if(typeof code==="object"){props=code;code=""}if(code){props.code=code}try{return assign(err,props)}catch(_){props.message=err.message;props.stack=err.stack;const ErrClass=function(){};ErrClass.prototype=Object.create(Object.getPrototypeOf(err));const output=assign(new ErrClass,props);return output}}module.exports=createError},{}],81:[function(require,module,exports){"use strict";var R=typeof Reflect==="object"?Reflect:null;var ReflectApply=R&&typeof R.apply==="function"?R.apply:function ReflectApply(target,receiver,args){return Function.prototype.apply.call(target,receiver,args)};var ReflectOwnKeys;if(R&&typeof R.ownKeys==="function"){ReflectOwnKeys=R.ownKeys}else if(Object.getOwnPropertySymbols){ReflectOwnKeys=function ReflectOwnKeys(target){return Object.getOwnPropertyNames(target).concat(Object.getOwnPropertySymbols(target))}}else{ReflectOwnKeys=function ReflectOwnKeys(target){return Object.getOwnPropertyNames(target)}}function ProcessEmitWarning(warning){if(console&&console.warn)console.warn(warning)}var NumberIsNaN=Number.isNaN||function NumberIsNaN(value){return value!==value};function EventEmitter(){EventEmitter.init.call(this)}module.exports=EventEmitter;module.exports.once=once;EventEmitter.EventEmitter=EventEmitter;EventEmitter.prototype._events=undefined;EventEmitter.prototype._eventsCount=0;EventEmitter.prototype._maxListeners=undefined;var defaultMaxListeners=10;function checkListener(listener){if(typeof listener!=="function"){throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof listener)}}Object.defineProperty(EventEmitter,"defaultMaxListeners",{enumerable:true,get:function(){return defaultMaxListeners},set:function(arg){if(typeof arg!=="number"||arg<0||NumberIsNaN(arg)){throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+arg+".")}defaultMaxListeners=arg}});EventEmitter.init=function(){if(this._events===undefined||this._events===Object.getPrototypeOf(this)._events){this._events=Object.create(null);this._eventsCount=0}this._maxListeners=this._maxListeners||undefined};EventEmitter.prototype.setMaxListeners=function setMaxListeners(n){if(typeof n!=="number"||n<0||NumberIsNaN(n)){throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+n+".")}this._maxListeners=n;return this};function _getMaxListeners(that){if(that._maxListeners===undefined)return EventEmitter.defaultMaxListeners;return that._maxListeners}EventEmitter.prototype.getMaxListeners=function getMaxListeners(){return _getMaxListeners(this)};EventEmitter.prototype.emit=function emit(type){var args=[];for(var i=1;i0)er=args[0];if(er instanceof Error){throw er}var err=new Error("Unhandled error."+(er?" ("+er.message+")":""));err.context=er;throw err}var handler=events[type];if(handler===undefined)return false;if(typeof handler==="function"){ReflectApply(handler,this,args)}else{var len=handler.length;var listeners=arrayClone(handler,len);for(var i=0;i0&&existing.length>m&&!existing.warned){existing.warned=true;var w=new Error("Possible EventEmitter memory leak detected. "+existing.length+" "+String(type)+" listeners "+"added. Use emitter.setMaxListeners() to "+"increase limit");w.name="MaxListenersExceededWarning";w.emitter=target;w.type=type;w.count=existing.length;ProcessEmitWarning(w)}}return target}EventEmitter.prototype.addListener=function addListener(type,listener){return _addListener(this,type,listener,false)};EventEmitter.prototype.on=EventEmitter.prototype.addListener;EventEmitter.prototype.prependListener=function prependListener(type,listener){return _addListener(this,type,listener,true)};function onceWrapper(){if(!this.fired){this.target.removeListener(this.type,this.wrapFn);this.fired=true;if(arguments.length===0)return this.listener.call(this.target);return this.listener.apply(this.target,arguments)}}function _onceWrap(target,type,listener){var state={fired:false,wrapFn:undefined,target:target,type:type,listener:listener};var wrapped=onceWrapper.bind(state);wrapped.listener=listener;state.wrapFn=wrapped;return wrapped}EventEmitter.prototype.once=function once(type,listener){checkListener(listener);this.on(type,_onceWrap(this,type,listener));return this};EventEmitter.prototype.prependOnceListener=function prependOnceListener(type,listener){checkListener(listener);this.prependListener(type,_onceWrap(this,type,listener));return this};EventEmitter.prototype.removeListener=function removeListener(type,listener){var list,events,position,i,originalListener;checkListener(listener);events=this._events;if(events===undefined)return this;list=events[type];if(list===undefined)return this;if(list===listener||list.listener===listener){if(--this._eventsCount===0)this._events=Object.create(null);else{delete events[type];if(events.removeListener)this.emit("removeListener",type,list.listener||listener)}}else if(typeof list!=="function"){position=-1;for(i=list.length-1;i>=0;i--){if(list[i]===listener||list[i].listener===listener){originalListener=list[i].listener;position=i;break}}if(position<0)return this;if(position===0)list.shift();else{spliceOne(list,position)}if(list.length===1)events[type]=list[0];if(events.removeListener!==undefined)this.emit("removeListener",type,originalListener||listener)}return this};EventEmitter.prototype.off=EventEmitter.prototype.removeListener;EventEmitter.prototype.removeAllListeners=function removeAllListeners(type){var listeners,events,i;events=this._events;if(events===undefined)return this;if(events.removeListener===undefined){if(arguments.length===0){this._events=Object.create(null);this._eventsCount=0}else if(events[type]!==undefined){if(--this._eventsCount===0)this._events=Object.create(null);else delete events[type]}return this}if(arguments.length===0){var keys=Object.keys(events);var key;for(i=0;i=0;i--){this.removeListener(type,listeners[i])}}return this};function _listeners(target,type,unwrap){var events=target._events;if(events===undefined)return[];var evlistener=events[type];if(evlistener===undefined)return[];if(typeof evlistener==="function")return unwrap?[evlistener.listener||evlistener]:[evlistener];return unwrap?unwrapListeners(evlistener):arrayClone(evlistener,evlistener.length)}EventEmitter.prototype.listeners=function listeners(type){return _listeners(this,type,true)};EventEmitter.prototype.rawListeners=function rawListeners(type){return _listeners(this,type,false)};EventEmitter.listenerCount=function(emitter,type){if(typeof emitter.listenerCount==="function"){return emitter.listenerCount(type)}else{return listenerCount.call(emitter,type)}};EventEmitter.prototype.listenerCount=listenerCount;function listenerCount(type){var events=this._events;if(events!==undefined){var evlistener=events[type];if(typeof evlistener==="function"){return 1}else if(evlistener!==undefined){return evlistener.length}}return 0}EventEmitter.prototype.eventNames=function eventNames(){return this._eventsCount>0?ReflectOwnKeys(this._events):[]};function arrayClone(arr,n){var copy=new Array(n);for(var i=0;ioptions.depthLimit){setReplace(LIMIT_REPLACE_NODE,val,k,parent);return}if(typeof options.edgesLimit!=="undefined"&&edgeIndex+1>options.edgesLimit){setReplace(LIMIT_REPLACE_NODE,val,k,parent);return}stack.push(val);if(Array.isArray(val)){for(i=0;ib){return 1}return 0}function deterministicStringify(obj,replacer,spacer,options){if(typeof options==="undefined"){options=defaultOptions()}var tmp=deterministicDecirc(obj,"",0,[],undefined,0,options)||obj;var res;try{if(replacerStack.length===0){res=JSON.stringify(tmp,replacer,spacer)}else{res=JSON.stringify(tmp,replaceGetterValues(replacer),spacer)}}catch(_){return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{while(arr.length!==0){var part=arr.pop();if(part.length===4){Object.defineProperty(part[0],part[1],part[3])}else{part[0][part[1]]=part[2]}}}return res}function deterministicDecirc(val,k,edgeIndex,stack,parent,depth,options){depth+=1;var i;if(typeof val==="object"&&val!==null){for(i=0;ioptions.depthLimit){setReplace(LIMIT_REPLACE_NODE,val,k,parent);return}if(typeof options.edgesLimit!=="undefined"&&edgeIndex+1>options.edgesLimit){setReplace(LIMIT_REPLACE_NODE,val,k,parent);return}stack.push(val);if(Array.isArray(val)){for(i=0;i0){for(var i=0;i1&&typeof allowMissing!=="boolean"){throw new $TypeError('"allowMissing" argument must be a boolean')}if($exec(/^%?[^%]*%?$/,name)===null){throw new $SyntaxError("`%` may not be present anywhere but at the beginning and end of the intrinsic name")}var parts=stringToPath(name);var intrinsicBaseName=parts.length>0?parts[0]:"";var intrinsic=getBaseIntrinsic("%"+intrinsicBaseName+"%",allowMissing);var intrinsicRealName=intrinsic.name;var value=intrinsic.value;var skipFurtherCaching=false;var alias=intrinsic.alias;if(alias){intrinsicBaseName=alias[0];$spliceApply(parts,$concat([0,1],alias))}for(var i=1,isOwn=true;i=parts.length){var desc=$gOPD(value,part);isOwn=!!desc;if(isOwn&&"get"in desc&&!("originalValue"in desc.get)){value=desc.get}else{value=value[part]}}else{isOwn=hasOwn(value,part);value=value[part]}if(isOwn&&!skipFurtherCaching){INTRINSICS[intrinsicRealName]=value}}}return value}},{"function-bind":84,has:95,"has-proto":92,"has-symbols":93}],87:[function(require,module,exports){(function(global){(function(){var topLevel=typeof global!=="undefined"?global:typeof window!=="undefined"?window:{};var minDoc=require("min-document");var doccy;if(typeof document!=="undefined"){doccy=document}else{doccy=topLevel["__GLOBAL_DOCUMENT_CACHE@4"];if(!doccy){doccy=topLevel["__GLOBAL_DOCUMENT_CACHE@4"]=minDoc}}module.exports=doccy}).call(this)}).call(this,typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{"min-document":34}],88:[function(require,module,exports){(function(global){(function(){var win;if(typeof window!=="undefined"){win=window}else if(typeof global!=="undefined"){win=global}else if(typeof self!=="undefined"){win=self}else{win={}}module.exports=win}).call(this)}).call(this,typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{}],89:[function(require,module,exports){(function(Buffer){(function(){var isArray=require("isarray");var toString=Object.prototype.toString;var withNativeBlob=typeof Blob==="function"||typeof Blob!=="undefined"&&toString.call(Blob)==="[object BlobConstructor]";var withNativeFile=typeof File==="function"||typeof File!=="undefined"&&toString.call(File)==="[object FileConstructor]";module.exports=hasBinary;function hasBinary(obj){if(!obj||typeof obj!=="object"){return false}if(isArray(obj)){for(var i=0,l=obj.length;i1){stack.pop();stack[stack.length-1][0][2][ix]=h(cur[0],cur[1],cur[2].length?cur[2]:undefined)}}else if(s===OPEN){var c=[p[1],{},[]];cur[2].push(c);stack.push([c,cur[2].length-1])}else if(s===ATTR_KEY||s===VAR&&p[1]===ATTR_KEY){var key="";var copyKey;for(;i1&&/^\s*$/.test(tree[2][0])){tree[2].shift()}if(tree[2].length>2||tree[2].length===2&&/\S/.test(tree[2][1])){if(opts.createFragment)return opts.createFragment(tree[2]);throw new Error("multiple root elements must be wrapped in an enclosing tag")}if(Array.isArray(tree[2][0])&&typeof tree[2][0][0]==="string"&&Array.isArray(tree[2][0][2])){tree[2][0]=h(tree[2][0][0],tree[2][0][1],tree[2][0][2])}return tree[2][0];function parse(str){var res=[];if(state===ATTR_VALUE_W)state=ATTR;for(var i=0;i"&&!quot(state)&&state!==COMMENT){if(state===OPEN&®.length){res.push([OPEN,reg])}else if(state===ATTR_KEY){res.push([ATTR_KEY,reg])}else if(state===ATTR_VALUE&®.length){res.push([ATTR_VALUE,reg])}res.push([CLOSE]);reg="";state=TEXT}else if(state===COMMENT&&/-$/.test(reg)&&c==="-"){if(opts.comments){res.push([ATTR_VALUE,reg.substr(0,reg.length-1)])}reg="";state=TEXT}else if(state===OPEN&&/^!--$/.test(reg)){if(opts.comments){res.push([OPEN,reg],[ATTR_KEY,"comment"],[ATTR_EQ])}reg=c;state=COMMENT}else if(state===TEXT||state===COMMENT){reg+=c}else if(state===OPEN&&c==="/"&®.length){}else if(state===OPEN&&/\s/.test(c)){if(reg.length){res.push([OPEN,reg])}reg="";state=ATTR}else if(state===OPEN){reg+=c}else if(state===ATTR&&/[^\s"'=/]/.test(c)){state=ATTR_KEY;reg=c}else if(state===ATTR&&/\s/.test(c)){if(reg.length)res.push([ATTR_KEY,reg]);res.push([ATTR_BREAK])}else if(state===ATTR_KEY&&/\s/.test(c)){res.push([ATTR_KEY,reg]);reg="";state=ATTR_KEY_W}else if(state===ATTR_KEY&&c==="="){res.push([ATTR_KEY,reg],[ATTR_EQ]);reg="";state=ATTR_VALUE_W}else if(state===ATTR_KEY){reg+=c}else if((state===ATTR_KEY_W||state===ATTR)&&c==="="){res.push([ATTR_EQ]);state=ATTR_VALUE_W}else if((state===ATTR_KEY_W||state===ATTR)&&!/\s/.test(c)){res.push([ATTR_BREAK]);if(/[\w-]/.test(c)){reg+=c;state=ATTR_KEY}else state=ATTR}else if(state===ATTR_VALUE_W&&c==='"'){state=ATTR_VALUE_DQ}else if(state===ATTR_VALUE_W&&c==="'"){state=ATTR_VALUE_SQ}else if(state===ATTR_VALUE_DQ&&c==='"'){res.push([ATTR_VALUE,reg],[ATTR_BREAK]);reg="";state=ATTR}else if(state===ATTR_VALUE_SQ&&c==="'"){res.push([ATTR_VALUE,reg],[ATTR_BREAK]);reg="";state=ATTR}else if(state===ATTR_VALUE_W&&!/\s/.test(c)){state=ATTR_VALUE;i--}else if(state===ATTR_VALUE&&/\s/.test(c)){res.push([ATTR_VALUE,reg],[ATTR_BREAK]);reg="";state=ATTR}else if(state===ATTR_VALUE||state===ATTR_VALUE_SQ||state===ATTR_VALUE_DQ){reg+=c}}if(state===TEXT&®.length){res.push([TEXT,reg]);reg=""}else if(state===ATTR_VALUE&®.length){res.push([ATTR_VALUE,reg]);reg=""}else if(state===ATTR_VALUE_DQ&®.length){res.push([ATTR_VALUE,reg]);reg=""}else if(state===ATTR_VALUE_SQ&®.length){res.push([ATTR_VALUE,reg]);reg=""}else if(state===ATTR_KEY){res.push([ATTR_KEY,reg]);reg=""}return res}};function strfn(x){if(typeof x==="function")return x;else if(typeof x==="string")return x;else if(x&&typeof x==="object")return x;else if(x===null||x===undefined)return x;else return concat("",x)}};function quot(state){return state===ATTR_VALUE_SQ||state===ATTR_VALUE_DQ}var closeRE=RegExp("^("+["area","base","basefont","bgsound","br","col","command","embed","frame","hr","img","input","isindex","keygen","link","meta","param","source","track","wbr","!--","animate","animateTransform","circle","cursor","desc","ellipse","feBlend","feColorMatrix","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","font-face-format","font-face-name","font-face-uri","glyph","glyphRef","hkern","image","line","missing-glyph","mpath","path","polygon","polyline","rect","set","stop","tref","use","view","vkern"].join("|")+")(?:[.#][a-zA-Z0-9-￿_:-]+)*$");function selfClosing(tag){return closeRE.test(tag)}},{"hyperscript-attribute-to-property":96}],98:[function(require,module,exports){"use strict";var _classCallCheck=require("@babel/runtime/helpers/classCallCheck");var _createClass=require("@babel/runtime/helpers/createClass");function _interopDefaultLegacy(e){return e&&typeof e==="object"&&"default"in e?e:{default:e}}var _classCallCheck__default=_interopDefaultLegacy(_classCallCheck);var _createClass__default=_interopDefaultLegacy(_createClass);var arr=[];var each=arr.forEach;var slice=arr.slice;function defaults(obj){each.call(slice.call(arguments,1),(function(source){if(source){for(var prop in source){if(obj[prop]===undefined)obj[prop]=source[prop]}}}));return obj}var fieldContentRegExp=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/;var serializeCookie=function serializeCookie(name,val,options){var opt=options||{};opt.path=opt.path||"/";var value=encodeURIComponent(val);var str="".concat(name,"=").concat(value);if(opt.maxAge>0){var maxAge=opt.maxAge-0;if(Number.isNaN(maxAge))throw new Error("maxAge should be a Number");str+="; Max-Age=".concat(Math.floor(maxAge))}if(opt.domain){if(!fieldContentRegExp.test(opt.domain)){throw new TypeError("option domain is invalid")}str+="; Domain=".concat(opt.domain)}if(opt.path){if(!fieldContentRegExp.test(opt.path)){throw new TypeError("option path is invalid")}str+="; Path=".concat(opt.path)}if(opt.expires){if(typeof opt.expires.toUTCString!=="function"){throw new TypeError("option expires is invalid")}str+="; Expires=".concat(opt.expires.toUTCString())}if(opt.httpOnly)str+="; HttpOnly";if(opt.secure)str+="; Secure";if(opt.sameSite){var sameSite=typeof opt.sameSite==="string"?opt.sameSite.toLowerCase():opt.sameSite;switch(sameSite){case true:str+="; SameSite=Strict";break;case"lax":str+="; SameSite=Lax";break;case"strict":str+="; SameSite=Strict";break;case"none":str+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}}return str};var cookie={create:function create(name,value,minutes,domain){var cookieOptions=arguments.length>4&&arguments[4]!==undefined?arguments[4]:{path:"/",sameSite:"strict"};if(minutes){cookieOptions.expires=new Date;cookieOptions.expires.setTime(cookieOptions.expires.getTime()+minutes*60*1e3)}if(domain)cookieOptions.domain=domain;document.cookie=serializeCookie(name,encodeURIComponent(value),cookieOptions)},read:function read(name){var nameEQ="".concat(name,"=");var ca=document.cookie.split(";");for(var i=0;i-1){search=window.location.hash.substring(window.location.hash.indexOf("?"))}var query=search.substring(1);var params=query.split("&");for(var i=0;i0){var key=params[i].substring(0,pos);if(key===options.lookupQuerystring){found=params[i].substring(pos+1)}}}}return found}};var hasLocalStorageSupport=null;var localStorageAvailable=function localStorageAvailable(){if(hasLocalStorageSupport!==null)return hasLocalStorageSupport;try{hasLocalStorageSupport=window!=="undefined"&&window.localStorage!==null;var testKey="i18next.translate.boo";window.localStorage.setItem(testKey,"foo");window.localStorage.removeItem(testKey)}catch(e){hasLocalStorageSupport=false}return hasLocalStorageSupport};var localStorage={name:"localStorage",lookup:function lookup(options){var found;if(options.lookupLocalStorage&&localStorageAvailable()){var lng=window.localStorage.getItem(options.lookupLocalStorage);if(lng)found=lng}return found},cacheUserLanguage:function cacheUserLanguage(lng,options){if(options.lookupLocalStorage&&localStorageAvailable()){window.localStorage.setItem(options.lookupLocalStorage,lng)}}};var hasSessionStorageSupport=null;var sessionStorageAvailable=function sessionStorageAvailable(){if(hasSessionStorageSupport!==null)return hasSessionStorageSupport;try{hasSessionStorageSupport=window!=="undefined"&&window.sessionStorage!==null;var testKey="i18next.translate.boo";window.sessionStorage.setItem(testKey,"foo");window.sessionStorage.removeItem(testKey)}catch(e){hasSessionStorageSupport=false}return hasSessionStorageSupport};var sessionStorage={name:"sessionStorage",lookup:function lookup(options){var found;if(options.lookupSessionStorage&&sessionStorageAvailable()){var lng=window.sessionStorage.getItem(options.lookupSessionStorage);if(lng)found=lng}return found},cacheUserLanguage:function cacheUserLanguage(lng,options){if(options.lookupSessionStorage&&sessionStorageAvailable()){window.sessionStorage.setItem(options.lookupSessionStorage,lng)}}};var navigator$1={name:"navigator",lookup:function lookup(options){var found=[];if(typeof navigator!=="undefined"){if(navigator.languages){for(var i=0;i0?found:undefined}};var htmlTag={name:"htmlTag",lookup:function lookup(options){var found;var htmlTag=options.htmlTag||(typeof document!=="undefined"?document.documentElement:null);if(htmlTag&&typeof htmlTag.getAttribute==="function"){found=htmlTag.getAttribute("lang")}return found}};var path={name:"path",lookup:function lookup(options){var found;if(typeof window!=="undefined"){var language=window.location.pathname.match(/\/([a-zA-Z-]*)/g);if(language instanceof Array){if(typeof options.lookupFromPathIndex==="number"){if(typeof language[options.lookupFromPathIndex]!=="string"){return undefined}found=language[options.lookupFromPathIndex].replace("/","")}else{found=language[0].replace("/","")}}}return found}};var subdomain={name:"subdomain",lookup:function lookup(options){var lookupFromSubdomainIndex=typeof options.lookupFromSubdomainIndex==="number"?options.lookupFromSubdomainIndex+1:1;var language=typeof window!=="undefined"&&window.location&&window.location.hostname&&window.location.hostname.match(/^(\w{2,5})\.(([a-z0-9-]{1,63}\.[a-z]{2,6})|localhost)/i);if(!language)return undefined;return language[lookupFromSubdomainIndex]}};function getDefaults(){return{order:["querystring","cookie","localStorage","sessionStorage","navigator","htmlTag"],lookupQuerystring:"lng",lookupCookie:"i18next",lookupLocalStorage:"i18nextLng",lookupSessionStorage:"i18nextLng",caches:["localStorage"],excludeCacheFor:["cimode"]}}var Browser=function(){function Browser(services){var options=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};_classCallCheck__default["default"](this,Browser);this.type="languageDetector";this.detectors={};this.init(services,options)}_createClass__default["default"](Browser,[{key:"init",value:function init(services){var options=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};var i18nOptions=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{};this.services=services;this.options=defaults(options,this.options||{},getDefaults());if(this.options.lookupFromUrlIndex)this.options.lookupFromPathIndex=this.options.lookupFromUrlIndex;this.i18nOptions=i18nOptions;this.addDetector(cookie$1);this.addDetector(querystring);this.addDetector(localStorage);this.addDetector(sessionStorage);this.addDetector(navigator$1);this.addDetector(htmlTag);this.addDetector(path);this.addDetector(subdomain)}},{key:"addDetector",value:function addDetector(detector){this.detectors[detector.name]=detector}},{key:"detect",value:function detect(detectionOrder){var _this=this;if(!detectionOrder)detectionOrder=this.options.order;var detected=[];detectionOrder.forEach((function(detectorName){if(_this.detectors[detectorName]){var lookup=_this.detectors[detectorName].lookup(_this.options);if(lookup&&typeof lookup==="string")lookup=[lookup];if(lookup)detected=detected.concat(lookup)}}));if(this.services.languageUtils.getBestMatchFromCodes)return detected;return detected.length>0?detected[0]:null}},{key:"cacheUserLanguage",value:function cacheUserLanguage(lng,caches){var _this2=this;if(!caches)caches=this.options.caches;if(!caches)return;if(this.options.excludeCacheFor&&this.options.excludeCacheFor.indexOf(lng)>-1)return;caches.forEach((function(cacheName){if(_this2.detectors[cacheName])_this2.detectors[cacheName].cacheUserLanguage(lng,_this2.options)}))}}]);return Browser}();Browser.type="languageDetector";module.exports=Browser},{"@babel/runtime/helpers/classCallCheck":5,"@babel/runtime/helpers/createClass":6}],99:[function(require,module,exports){"use strict";var _typeof=require("@babel/runtime/helpers/typeof");var _classCallCheck=require("@babel/runtime/helpers/classCallCheck");var _createClass=require("@babel/runtime/helpers/createClass");var _assertThisInitialized=require("@babel/runtime/helpers/assertThisInitialized");var _inherits=require("@babel/runtime/helpers/inherits");var _possibleConstructorReturn=require("@babel/runtime/helpers/possibleConstructorReturn");var _getPrototypeOf=require("@babel/runtime/helpers/getPrototypeOf");var _defineProperty=require("@babel/runtime/helpers/defineProperty");var _toArray=require("@babel/runtime/helpers/toArray");function _interopDefaultLegacy(e){return e&&typeof e==="object"&&"default"in e?e:{default:e}}var _typeof__default=_interopDefaultLegacy(_typeof);var _classCallCheck__default=_interopDefaultLegacy(_classCallCheck);var _createClass__default=_interopDefaultLegacy(_createClass);var _assertThisInitialized__default=_interopDefaultLegacy(_assertThisInitialized);var _inherits__default=_interopDefaultLegacy(_inherits);var _possibleConstructorReturn__default=_interopDefaultLegacy(_possibleConstructorReturn);var _getPrototypeOf__default=_interopDefaultLegacy(_getPrototypeOf);var _defineProperty__default=_interopDefaultLegacy(_defineProperty);var _toArray__default=_interopDefaultLegacy(_toArray);function ownKeys(object,enumerableOnly){var keys=Object.keys(object);if(Object.getOwnPropertySymbols){var symbols=Object.getOwnPropertySymbols(object);if(enumerableOnly){symbols=symbols.filter((function(sym){return Object.getOwnPropertyDescriptor(object,sym).enumerable}))}keys.push.apply(keys,symbols)}return keys}function _objectSpread(target){for(var i=1;i1&&arguments[1]!==undefined?arguments[1]:{};_classCallCheck__default["default"](this,Logger);this.init(concreteLogger,options)}_createClass__default["default"](Logger,[{key:"init",value:function init(concreteLogger){var options=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};this.prefix=options.prefix||"i18next:";this.logger=concreteLogger||consoleLogger;this.options=options;this.debug=options.debug}},{key:"setDebug",value:function setDebug(bool){this.debug=bool}},{key:"log",value:function log(){for(var _len=arguments.length,args=new Array(_len),_key=0;_key<_len;_key++){args[_key]=arguments[_key]}return this.forward(args,"log","",true)}},{key:"warn",value:function warn(){for(var _len2=arguments.length,args=new Array(_len2),_key2=0;_key2<_len2;_key2++){args[_key2]=arguments[_key2]}return this.forward(args,"warn","",true)}},{key:"error",value:function error(){for(var _len3=arguments.length,args=new Array(_len3),_key3=0;_key3<_len3;_key3++){args[_key3]=arguments[_key3]}return this.forward(args,"error","")}},{key:"deprecate",value:function deprecate(){for(var _len4=arguments.length,args=new Array(_len4),_key4=0;_key4<_len4;_key4++){args[_key4]=arguments[_key4]}return this.forward(args,"warn","WARNING DEPRECATED: ",true)}},{key:"forward",value:function forward(args,lvl,prefix,debugOnly){if(debugOnly&&!this.debug)return null;if(typeof args[0]==="string")args[0]="".concat(prefix).concat(this.prefix," ").concat(args[0]);return this.logger[lvl](args)}},{key:"create",value:function create(moduleName){return new Logger(this.logger,_objectSpread(_objectSpread({},{prefix:"".concat(this.prefix,":").concat(moduleName,":")}),this.options))}},{key:"clone",value:function clone(options){options=options||this.options;options.prefix=options.prefix||this.prefix;return new Logger(this.logger,options)}}]);return Logger}();var baseLogger=new Logger;var EventEmitter=function(){function EventEmitter(){_classCallCheck__default["default"](this,EventEmitter);this.observers={}}_createClass__default["default"](EventEmitter,[{key:"on",value:function on(events,listener){var _this=this;events.split(" ").forEach((function(event){_this.observers[event]=_this.observers[event]||[];_this.observers[event].push(listener)}));return this}},{key:"off",value:function off(event,listener){if(!this.observers[event])return;if(!listener){delete this.observers[event];return}this.observers[event]=this.observers[event].filter((function(l){return l!==listener}))}},{key:"emit",value:function emit(event){for(var _len=arguments.length,args=new Array(_len>1?_len-1:0),_key=1;_key<_len;_key++){args[_key-1]=arguments[_key]}if(this.observers[event]){var cloned=[].concat(this.observers[event]);cloned.forEach((function(observer){observer.apply(void 0,args)}))}if(this.observers["*"]){var _cloned=[].concat(this.observers["*"]);_cloned.forEach((function(observer){observer.apply(observer,[event].concat(args))}))}}}]);return EventEmitter}();function defer(){var res;var rej;var promise=new Promise((function(resolve,reject){res=resolve;rej=reject}));promise.resolve=res;promise.reject=rej;return promise}function makeString(object){if(object==null)return"";return""+object}function copy(a,s,t){a.forEach((function(m){if(s[m])t[m]=s[m]}))}function getLastOfPath(object,path,Empty){function cleanKey(key){return key&&key.indexOf("###")>-1?key.replace(/###/g,"."):key}function canNotTraverseDeeper(){return!object||typeof object==="string"}var stack=typeof path!=="string"?[].concat(path):path.split(".");while(stack.length>1){if(canNotTraverseDeeper())return{};var key=cleanKey(stack.shift());if(!object[key]&&Empty)object[key]=new Empty;if(Object.prototype.hasOwnProperty.call(object,key)){object=object[key]}else{object={}}}if(canNotTraverseDeeper())return{};return{obj:object,k:cleanKey(stack.shift())}}function setPath(object,path,newValue){var _getLastOfPath=getLastOfPath(object,path,Object),obj=_getLastOfPath.obj,k=_getLastOfPath.k;obj[k]=newValue}function pushPath(object,path,newValue,concat){var _getLastOfPath2=getLastOfPath(object,path,Object),obj=_getLastOfPath2.obj,k=_getLastOfPath2.k;obj[k]=obj[k]||[];if(concat)obj[k]=obj[k].concat(newValue);if(!concat)obj[k].push(newValue)}function getPath(object,path){var _getLastOfPath3=getLastOfPath(object,path),obj=_getLastOfPath3.obj,k=_getLastOfPath3.k;if(!obj)return undefined;return obj[k]}function getPathWithDefaults(data,defaultData,key){var value=getPath(data,key);if(value!==undefined){return value}return getPath(defaultData,key)}function deepExtend(target,source,overwrite){for(var prop in source){if(prop!=="__proto__"&&prop!=="constructor"){if(prop in target){if(typeof target[prop]==="string"||target[prop]instanceof String||typeof source[prop]==="string"||source[prop]instanceof String){if(overwrite)target[prop]=source[prop]}else{deepExtend(target[prop],source[prop],overwrite)}}else{target[prop]=source[prop]}}}return target}function regexEscape(str){return str.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}var _entityMap={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};function escape(data){if(typeof data==="string"){return data.replace(/[&<>"'\/]/g,(function(s){return _entityMap[s]}))}return data}var isIE10=typeof window!=="undefined"&&window.navigator&&typeof window.navigator.userAgentData==="undefined"&&window.navigator.userAgent&&window.navigator.userAgent.indexOf("MSIE")>-1;var chars=[" ",",","?","!",";"];function looksLikeObjectPath(key,nsSeparator,keySeparator){nsSeparator=nsSeparator||"";keySeparator=keySeparator||"";var possibleChars=chars.filter((function(c){return nsSeparator.indexOf(c)<0&&keySeparator.indexOf(c)<0}));if(possibleChars.length===0)return true;var r=new RegExp("(".concat(possibleChars.map((function(c){return c==="?"?"\\?":c})).join("|"),")"));var matched=!r.test(key);if(!matched){var ki=key.indexOf(keySeparator);if(ki>0&&!r.test(key.substring(0,ki))){matched=true}}return matched}function ownKeys$1(object,enumerableOnly){var keys=Object.keys(object);if(Object.getOwnPropertySymbols){var symbols=Object.getOwnPropertySymbols(object);if(enumerableOnly){symbols=symbols.filter((function(sym){return Object.getOwnPropertyDescriptor(object,sym).enumerable}))}keys.push.apply(keys,symbols)}return keys}function _objectSpread$1(target){for(var i=1;i2&&arguments[2]!==undefined?arguments[2]:".";if(!obj)return undefined;if(obj[path])return obj[path];var paths=path.split(keySeparator);var current=obj;for(var i=0;ii+j){j++;p=paths.slice(i,i+j).join(keySeparator);mix=current[p]}if(mix===undefined)return undefined;if(mix===null)return null;if(path.endsWith(p)){if(typeof mix==="string")return mix;if(p&&typeof mix[p]==="string")return mix[p]}var joinedPath=paths.slice(i+j).join(keySeparator);if(joinedPath)return deepFind(mix,joinedPath,keySeparator);return undefined}current=current[paths[i]]}return current}var ResourceStore=function(_EventEmitter){_inherits__default["default"](ResourceStore,_EventEmitter);var _super=_createSuper(ResourceStore);function ResourceStore(data){var _this;var options=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{ns:["translation"],defaultNS:"translation"};_classCallCheck__default["default"](this,ResourceStore);_this=_super.call(this);if(isIE10){EventEmitter.call(_assertThisInitialized__default["default"](_this))}_this.data=data||{};_this.options=options;if(_this.options.keySeparator===undefined){_this.options.keySeparator="."}if(_this.options.ignoreJSONStructure===undefined){_this.options.ignoreJSONStructure=true}return _this}_createClass__default["default"](ResourceStore,[{key:"addNamespaces",value:function addNamespaces(ns){if(this.options.ns.indexOf(ns)<0){this.options.ns.push(ns)}}},{key:"removeNamespaces",value:function removeNamespaces(ns){var index=this.options.ns.indexOf(ns);if(index>-1){this.options.ns.splice(index,1)}}},{key:"getResource",value:function getResource(lng,ns,key){var options=arguments.length>3&&arguments[3]!==undefined?arguments[3]:{};var keySeparator=options.keySeparator!==undefined?options.keySeparator:this.options.keySeparator;var ignoreJSONStructure=options.ignoreJSONStructure!==undefined?options.ignoreJSONStructure:this.options.ignoreJSONStructure;var path=[lng,ns];if(key&&typeof key!=="string")path=path.concat(key);if(key&&typeof key==="string")path=path.concat(keySeparator?key.split(keySeparator):key);if(lng.indexOf(".")>-1){path=lng.split(".")}var result=getPath(this.data,path);if(result||!ignoreJSONStructure||typeof key!=="string")return result;return deepFind(this.data&&this.data[lng]&&this.data[lng][ns],key,keySeparator)}},{key:"addResource",value:function addResource(lng,ns,key,value){var options=arguments.length>4&&arguments[4]!==undefined?arguments[4]:{silent:false};var keySeparator=this.options.keySeparator;if(keySeparator===undefined)keySeparator=".";var path=[lng,ns];if(key)path=path.concat(keySeparator?key.split(keySeparator):key);if(lng.indexOf(".")>-1){path=lng.split(".");value=ns;ns=path[1]}this.addNamespaces(ns);setPath(this.data,path,value);if(!options.silent)this.emit("added",lng,ns,key,value)}},{key:"addResources",value:function addResources(lng,ns,resources){var options=arguments.length>3&&arguments[3]!==undefined?arguments[3]:{silent:false};for(var m in resources){if(typeof resources[m]==="string"||Object.prototype.toString.apply(resources[m])==="[object Array]")this.addResource(lng,ns,m,resources[m],{silent:true})}if(!options.silent)this.emit("added",lng,ns,resources)}},{key:"addResourceBundle",value:function addResourceBundle(lng,ns,resources,deep,overwrite){var options=arguments.length>5&&arguments[5]!==undefined?arguments[5]:{silent:false};var path=[lng,ns];if(lng.indexOf(".")>-1){path=lng.split(".");deep=resources;resources=ns;ns=path[1]}this.addNamespaces(ns);var pack=getPath(this.data,path)||{};if(deep){deepExtend(pack,resources,overwrite)}else{pack=_objectSpread$1(_objectSpread$1({},pack),resources)}setPath(this.data,path,pack);if(!options.silent)this.emit("added",lng,ns,resources)}},{key:"removeResourceBundle",value:function removeResourceBundle(lng,ns){if(this.hasResourceBundle(lng,ns)){delete this.data[lng][ns]}this.removeNamespaces(ns);this.emit("removed",lng,ns)}},{key:"hasResourceBundle",value:function hasResourceBundle(lng,ns){return this.getResource(lng,ns)!==undefined}},{key:"getResourceBundle",value:function getResourceBundle(lng,ns){if(!ns)ns=this.options.defaultNS;if(this.options.compatibilityAPI==="v1")return _objectSpread$1(_objectSpread$1({},{}),this.getResource(lng,ns));return this.getResource(lng,ns)}},{key:"getDataByLanguage",value:function getDataByLanguage(lng){return this.data[lng]}},{key:"hasLanguageSomeTranslations",value:function hasLanguageSomeTranslations(lng){var data=this.getDataByLanguage(lng);var n=data&&Object.keys(data)||[];return!!n.find((function(v){return data[v]&&Object.keys(data[v]).length>0}))}},{key:"toJSON",value:function toJSON(){return this.data}}]);return ResourceStore}(EventEmitter);var postProcessor={processors:{},addPostProcessor:function addPostProcessor(module){this.processors[module.name]=module},handle:function handle(processors,value,key,options,translator){var _this=this;processors.forEach((function(processor){if(_this.processors[processor])value=_this.processors[processor].process(value,key,options,translator)}));return value}};function ownKeys$2(object,enumerableOnly){var keys=Object.keys(object);if(Object.getOwnPropertySymbols){var symbols=Object.getOwnPropertySymbols(object);if(enumerableOnly){symbols=symbols.filter((function(sym){return Object.getOwnPropertyDescriptor(object,sym).enumerable}))}keys.push.apply(keys,symbols)}return keys}function _objectSpread$2(target){for(var i=1;i1&&arguments[1]!==undefined?arguments[1]:{};_classCallCheck__default["default"](this,Translator);_this=_super.call(this);if(isIE10){EventEmitter.call(_assertThisInitialized__default["default"](_this))}copy(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],services,_assertThisInitialized__default["default"](_this));_this.options=options;if(_this.options.keySeparator===undefined){_this.options.keySeparator="."}_this.logger=baseLogger.create("translator");return _this}_createClass__default["default"](Translator,[{key:"changeLanguage",value:function changeLanguage(lng){if(lng)this.language=lng}},{key:"exists",value:function exists(key){var options=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{interpolation:{}};if(key===undefined||key===null){return false}var resolved=this.resolve(key,options);return resolved&&resolved.res!==undefined}},{key:"extractFromKey",value:function extractFromKey(key,options){var nsSeparator=options.nsSeparator!==undefined?options.nsSeparator:this.options.nsSeparator;if(nsSeparator===undefined)nsSeparator=":";var keySeparator=options.keySeparator!==undefined?options.keySeparator:this.options.keySeparator;var namespaces=options.ns||this.options.defaultNS||[];var wouldCheckForNsInKey=nsSeparator&&key.indexOf(nsSeparator)>-1;var seemsNaturalLanguage=!this.options.userDefinedKeySeparator&&!options.keySeparator&&!this.options.userDefinedNsSeparator&&!options.nsSeparator&&!looksLikeObjectPath(key,nsSeparator,keySeparator);if(wouldCheckForNsInKey&&!seemsNaturalLanguage){var m=key.match(this.interpolator.nestingRegexp);if(m&&m.length>0){return{key:key,namespaces:namespaces}}var parts=key.split(nsSeparator);if(nsSeparator!==keySeparator||nsSeparator===keySeparator&&this.options.ns.indexOf(parts[0])>-1)namespaces=parts.shift();key=parts.join(keySeparator)}if(typeof namespaces==="string")namespaces=[namespaces];return{key:key,namespaces:namespaces}}},{key:"translate",value:function translate(keys,options,lastKey){var _this2=this;if(_typeof__default["default"](options)!=="object"&&this.options.overloadTranslationOptionHandler){options=this.options.overloadTranslationOptionHandler(arguments)}if(!options)options={};if(keys===undefined||keys===null)return"";if(!Array.isArray(keys))keys=[String(keys)];var returnDetails=options.returnDetails!==undefined?options.returnDetails:this.options.returnDetails;var keySeparator=options.keySeparator!==undefined?options.keySeparator:this.options.keySeparator;var _this$extractFromKey=this.extractFromKey(keys[keys.length-1],options),key=_this$extractFromKey.key,namespaces=_this$extractFromKey.namespaces;var namespace=namespaces[namespaces.length-1];var lng=options.lng||this.language;var appendNamespaceToCIMode=options.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(lng&&lng.toLowerCase()==="cimode"){if(appendNamespaceToCIMode){var nsSeparator=options.nsSeparator||this.options.nsSeparator;if(returnDetails){resolved.res="".concat(namespace).concat(nsSeparator).concat(key);return resolved}return"".concat(namespace).concat(nsSeparator).concat(key)}if(returnDetails){resolved.res=key;return resolved}return key}var resolved=this.resolve(keys,options);var res=resolved&&resolved.res;var resUsedKey=resolved&&resolved.usedKey||key;var resExactUsedKey=resolved&&resolved.exactUsedKey||key;var resType=Object.prototype.toString.apply(res);var noObject=["[object Number]","[object Function]","[object RegExp]"];var joinArrays=options.joinArrays!==undefined?options.joinArrays:this.options.joinArrays;var handleAsObjectInI18nFormat=!this.i18nFormat||this.i18nFormat.handleAsObject;var handleAsObject=typeof res!=="string"&&typeof res!=="boolean"&&typeof res!=="number";if(handleAsObjectInI18nFormat&&res&&handleAsObject&&noObject.indexOf(resType)<0&&!(typeof joinArrays==="string"&&resType==="[object Array]")){if(!options.returnObjects&&!this.options.returnObjects){if(!this.options.returnedObjectHandler){this.logger.warn("accessing an object - but returnObjects options is not enabled!")}var r=this.options.returnedObjectHandler?this.options.returnedObjectHandler(resUsedKey,res,_objectSpread$2(_objectSpread$2({},options),{},{ns:namespaces})):"key '".concat(key," (").concat(this.language,")' returned an object instead of string.");if(returnDetails){resolved.res=r;return resolved}return r}if(keySeparator){var resTypeIsArray=resType==="[object Array]";var copy=resTypeIsArray?[]:{};var newKeyToUse=resTypeIsArray?resExactUsedKey:resUsedKey;for(var m in res){if(Object.prototype.hasOwnProperty.call(res,m)){var deepKey="".concat(newKeyToUse).concat(keySeparator).concat(m);copy[m]=this.translate(deepKey,_objectSpread$2(_objectSpread$2({},options),{joinArrays:false,ns:namespaces}));if(copy[m]===deepKey)copy[m]=res[m]}}res=copy}}else if(handleAsObjectInI18nFormat&&typeof joinArrays==="string"&&resType==="[object Array]"){res=res.join(joinArrays);if(res)res=this.extendTranslation(res,keys,options,lastKey)}else{var usedDefault=false;var usedKey=false;var needsPluralHandling=options.count!==undefined&&typeof options.count!=="string";var hasDefaultValue=Translator.hasDefaultValue(options);var defaultValueSuffix=needsPluralHandling?this.pluralResolver.getSuffix(lng,options.count,options):"";var defaultValue=options["defaultValue".concat(defaultValueSuffix)]||options.defaultValue;if(!this.isValidLookup(res)&&hasDefaultValue){usedDefault=true;res=defaultValue}if(!this.isValidLookup(res)){usedKey=true;res=key}var missingKeyNoValueFallbackToKey=options.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey;var resForMissing=missingKeyNoValueFallbackToKey&&usedKey?undefined:res;var updateMissing=hasDefaultValue&&defaultValue!==res&&this.options.updateMissing;if(usedKey||usedDefault||updateMissing){this.logger.log(updateMissing?"updateKey":"missingKey",lng,namespace,key,updateMissing?defaultValue:res);if(keySeparator){var fk=this.resolve(key,_objectSpread$2(_objectSpread$2({},options),{},{keySeparator:false}));if(fk&&fk.res)this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}var lngs=[];var fallbackLngs=this.languageUtils.getFallbackCodes(this.options.fallbackLng,options.lng||this.language);if(this.options.saveMissingTo==="fallback"&&fallbackLngs&&fallbackLngs[0]){for(var i=0;i1&&arguments[1]!==undefined?arguments[1]:{};var found;var usedKey;var exactUsedKey;var usedLng;var usedNS;if(typeof keys==="string")keys=[keys];keys.forEach((function(k){if(_this4.isValidLookup(found))return;var extracted=_this4.extractFromKey(k,options);var key=extracted.key;usedKey=key;var namespaces=extracted.namespaces;if(_this4.options.fallbackNS)namespaces=namespaces.concat(_this4.options.fallbackNS);var needsPluralHandling=options.count!==undefined&&typeof options.count!=="string";var needsZeroSuffixLookup=needsPluralHandling&&!options.ordinal&&options.count===0&&_this4.pluralResolver.shouldUseIntlApi();var needsContextHandling=options.context!==undefined&&(typeof options.context==="string"||typeof options.context==="number")&&options.context!=="";var codes=options.lngs?options.lngs:_this4.languageUtils.toResolveHierarchy(options.lng||_this4.language,options.fallbackLng);namespaces.forEach((function(ns){if(_this4.isValidLookup(found))return;usedNS=ns;if(!checkedLoadedFor["".concat(codes[0],"-").concat(ns)]&&_this4.utils&&_this4.utils.hasLoadedNamespace&&!_this4.utils.hasLoadedNamespace(usedNS)){checkedLoadedFor["".concat(codes[0],"-").concat(ns)]=true;_this4.logger.warn('key "'.concat(usedKey,'" for languages "').concat(codes.join(", "),'" won\'t get resolved as namespace "').concat(usedNS,'" was not yet loaded'),"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")}codes.forEach((function(code){if(_this4.isValidLookup(found))return;usedLng=code;var finalKeys=[key];if(_this4.i18nFormat&&_this4.i18nFormat.addLookupKeys){_this4.i18nFormat.addLookupKeys(finalKeys,key,code,ns,options)}else{var pluralSuffix;if(needsPluralHandling)pluralSuffix=_this4.pluralResolver.getSuffix(code,options.count,options);var zeroSuffix="".concat(_this4.options.pluralSeparator,"zero");if(needsPluralHandling){finalKeys.push(key+pluralSuffix);if(needsZeroSuffixLookup){finalKeys.push(key+zeroSuffix)}}if(needsContextHandling){var contextKey="".concat(key).concat(_this4.options.contextSeparator).concat(options.context);finalKeys.push(contextKey);if(needsPluralHandling){finalKeys.push(contextKey+pluralSuffix);if(needsZeroSuffixLookup){finalKeys.push(contextKey+zeroSuffix)}}}}var possibleKey;while(possibleKey=finalKeys.pop()){if(!_this4.isValidLookup(found)){exactUsedKey=possibleKey;found=_this4.getResource(code,ns,possibleKey,options)}}}))}))}));return{res:found,usedKey:usedKey,exactUsedKey:exactUsedKey,usedLng:usedLng,usedNS:usedNS}}},{key:"isValidLookup",value:function isValidLookup(res){return res!==undefined&&!(!this.options.returnNull&&res===null)&&!(!this.options.returnEmptyString&&res==="")}},{key:"getResource",value:function getResource(code,ns,key){var options=arguments.length>3&&arguments[3]!==undefined?arguments[3]:{};if(this.i18nFormat&&this.i18nFormat.getResource)return this.i18nFormat.getResource(code,ns,key,options);return this.resourceStore.getResource(code,ns,key,options)}}],[{key:"hasDefaultValue",value:function hasDefaultValue(options){var prefix="defaultValue";for(var option in options){if(Object.prototype.hasOwnProperty.call(options,option)&&prefix===option.substring(0,prefix.length)&&undefined!==options[option]){return true}}return false}}]);return Translator}(EventEmitter);function capitalize(string){return string.charAt(0).toUpperCase()+string.slice(1)}var LanguageUtil=function(){function LanguageUtil(options){_classCallCheck__default["default"](this,LanguageUtil);this.options=options;this.supportedLngs=this.options.supportedLngs||false;this.logger=baseLogger.create("languageUtils")}_createClass__default["default"](LanguageUtil,[{key:"getScriptPartFromCode",value:function getScriptPartFromCode(code){if(!code||code.indexOf("-")<0)return null;var p=code.split("-");if(p.length===2)return null;p.pop();if(p[p.length-1].toLowerCase()==="x")return null;return this.formatLanguageCode(p.join("-"))}},{key:"getLanguagePartFromCode",value:function getLanguagePartFromCode(code){if(!code||code.indexOf("-")<0)return code;var p=code.split("-");return this.formatLanguageCode(p[0])}},{key:"formatLanguageCode",value:function formatLanguageCode(code){if(typeof code==="string"&&code.indexOf("-")>-1){var specialCases=["hans","hant","latn","cyrl","cans","mong","arab"];var p=code.split("-");if(this.options.lowerCaseLng){p=p.map((function(part){return part.toLowerCase()}))}else if(p.length===2){p[0]=p[0].toLowerCase();p[1]=p[1].toUpperCase();if(specialCases.indexOf(p[1].toLowerCase())>-1)p[1]=capitalize(p[1].toLowerCase())}else if(p.length===3){p[0]=p[0].toLowerCase();if(p[1].length===2)p[1]=p[1].toUpperCase();if(p[0]!=="sgn"&&p[2].length===2)p[2]=p[2].toUpperCase();if(specialCases.indexOf(p[1].toLowerCase())>-1)p[1]=capitalize(p[1].toLowerCase());if(specialCases.indexOf(p[2].toLowerCase())>-1)p[2]=capitalize(p[2].toLowerCase())}return p.join("-")}return this.options.cleanCode||this.options.lowerCaseLng?code.toLowerCase():code}},{key:"isSupportedCode",value:function isSupportedCode(code){if(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs){code=this.getLanguagePartFromCode(code)}return!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(code)>-1}},{key:"getBestMatchFromCodes",value:function getBestMatchFromCodes(codes){var _this=this;if(!codes)return null;var found;codes.forEach((function(code){if(found)return;var cleanedLng=_this.formatLanguageCode(code);if(!_this.options.supportedLngs||_this.isSupportedCode(cleanedLng))found=cleanedLng}));if(!found&&this.options.supportedLngs){codes.forEach((function(code){if(found)return;var lngOnly=_this.getLanguagePartFromCode(code);if(_this.isSupportedCode(lngOnly))return found=lngOnly;found=_this.options.supportedLngs.find((function(supportedLng){if(supportedLng.indexOf(lngOnly)===0)return supportedLng}))}))}if(!found)found=this.getFallbackCodes(this.options.fallbackLng)[0];return found}},{key:"getFallbackCodes",value:function getFallbackCodes(fallbacks,code){if(!fallbacks)return[];if(typeof fallbacks==="function")fallbacks=fallbacks(code);if(typeof fallbacks==="string")fallbacks=[fallbacks];if(Object.prototype.toString.apply(fallbacks)==="[object Array]")return fallbacks;if(!code)return fallbacks["default"]||[];var found=fallbacks[code];if(!found)found=fallbacks[this.getScriptPartFromCode(code)];if(!found)found=fallbacks[this.formatLanguageCode(code)];if(!found)found=fallbacks[this.getLanguagePartFromCode(code)];if(!found)found=fallbacks["default"];return found||[]}},{key:"toResolveHierarchy",value:function toResolveHierarchy(code,fallbackCode){var _this2=this;var fallbackCodes=this.getFallbackCodes(fallbackCode||this.options.fallbackLng||[],code);var codes=[];var addCode=function addCode(c){if(!c)return;if(_this2.isSupportedCode(c)){codes.push(c)}else{_this2.logger.warn("rejecting language code not found in supportedLngs: ".concat(c))}};if(typeof code==="string"&&code.indexOf("-")>-1){if(this.options.load!=="languageOnly")addCode(this.formatLanguageCode(code));if(this.options.load!=="languageOnly"&&this.options.load!=="currentOnly")addCode(this.getScriptPartFromCode(code));if(this.options.load!=="currentOnly")addCode(this.getLanguagePartFromCode(code))}else if(typeof code==="string"){addCode(this.formatLanguageCode(code))}fallbackCodes.forEach((function(fc){if(codes.indexOf(fc)<0)addCode(_this2.formatLanguageCode(fc))}));return codes}}]);return LanguageUtil}();var sets=[{lngs:["ach","ak","am","arn","br","fil","gun","ln","mfe","mg","mi","oc","pt","pt-BR","tg","tl","ti","tr","uz","wa"],nr:[1,2],fc:1},{lngs:["af","an","ast","az","bg","bn","ca","da","de","dev","el","en","eo","es","et","eu","fi","fo","fur","fy","gl","gu","ha","hi","hu","hy","ia","it","kk","kn","ku","lb","mai","ml","mn","mr","nah","nap","nb","ne","nl","nn","no","nso","pa","pap","pms","ps","pt-PT","rm","sco","se","si","so","son","sq","sv","sw","ta","te","tk","ur","yo"],nr:[1,2],fc:2},{lngs:["ay","bo","cgg","fa","ht","id","ja","jbo","ka","km","ko","ky","lo","ms","sah","su","th","tt","ug","vi","wo","zh"],nr:[1],fc:3},{lngs:["be","bs","cnr","dz","hr","ru","sr","uk"],nr:[1,2,5],fc:4},{lngs:["ar"],nr:[0,1,2,3,11,100],fc:5},{lngs:["cs","sk"],nr:[1,2,5],fc:6},{lngs:["csb","pl"],nr:[1,2,5],fc:7},{lngs:["cy"],nr:[1,2,3,8],fc:8},{lngs:["fr"],nr:[1,2],fc:9},{lngs:["ga"],nr:[1,2,3,7,11],fc:10},{lngs:["gd"],nr:[1,2,3,20],fc:11},{lngs:["is"],nr:[1,2],fc:12},{lngs:["jv"],nr:[0,1],fc:13},{lngs:["kw"],nr:[1,2,3,4],fc:14},{lngs:["lt"],nr:[1,2,10],fc:15},{lngs:["lv"],nr:[1,2,0],fc:16},{lngs:["mk"],nr:[1,2],fc:17},{lngs:["mnk"],nr:[0,1,2],fc:18},{lngs:["mt"],nr:[1,2,11,20],fc:19},{lngs:["or"],nr:[2,1],fc:2},{lngs:["ro"],nr:[1,2,20],fc:20},{lngs:["sl"],nr:[5,1,2,3],fc:21},{lngs:["he","iw"],nr:[1,2,20,21],fc:22}];var _rulesPluralsTypes={1:function _(n){return Number(n>1)},2:function _(n){return Number(n!=1)},3:function _(n){return 0},4:function _(n){return Number(n%10==1&&n%100!=11?0:n%10>=2&&n%10<=4&&(n%100<10||n%100>=20)?1:2)},5:function _(n){return Number(n==0?0:n==1?1:n==2?2:n%100>=3&&n%100<=10?3:n%100>=11?4:5)},6:function _(n){return Number(n==1?0:n>=2&&n<=4?1:2)},7:function _(n){return Number(n==1?0:n%10>=2&&n%10<=4&&(n%100<10||n%100>=20)?1:2)},8:function _(n){return Number(n==1?0:n==2?1:n!=8&&n!=11?2:3)},9:function _(n){return Number(n>=2)},10:function _(n){return Number(n==1?0:n==2?1:n<7?2:n<11?3:4)},11:function _(n){return Number(n==1||n==11?0:n==2||n==12?1:n>2&&n<20?2:3)},12:function _(n){return Number(n%10!=1||n%100==11)},13:function _(n){return Number(n!==0)},14:function _(n){return Number(n==1?0:n==2?1:n==3?2:3)},15:function _(n){return Number(n%10==1&&n%100!=11?0:n%10>=2&&(n%100<10||n%100>=20)?1:2)},16:function _(n){return Number(n%10==1&&n%100!=11?0:n!==0?1:2)},17:function _(n){return Number(n==1||n%10==1&&n%100!=11?0:1)},18:function _(n){return Number(n==0?0:n==1?1:2)},19:function _(n){return Number(n==1?0:n==0||n%100>1&&n%100<11?1:n%100>10&&n%100<20?2:3)},20:function _(n){return Number(n==1?0:n==0||n%100>0&&n%100<20?1:2)},21:function _(n){return Number(n%100==1?1:n%100==2?2:n%100==3||n%100==4?3:0)},22:function _(n){return Number(n==1?0:n==2?1:(n<0||n>10)&&n%10==0?2:3)}};var deprecatedJsonVersions=["v1","v2","v3"];var suffixesOrder={zero:0,one:1,two:2,few:3,many:4,other:5};function createRules(){var rules={};sets.forEach((function(set){set.lngs.forEach((function(l){rules[l]={numbers:set.nr,plurals:_rulesPluralsTypes[set.fc]}}))}));return rules}var PluralResolver=function(){function PluralResolver(languageUtils){var options=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};_classCallCheck__default["default"](this,PluralResolver);this.languageUtils=languageUtils;this.options=options;this.logger=baseLogger.create("pluralResolver");if((!this.options.compatibilityJSON||this.options.compatibilityJSON==="v4")&&(typeof Intl==="undefined"||!Intl.PluralRules)){this.options.compatibilityJSON="v3";this.logger.error("Your environment seems not to be Intl API compatible, use an Intl.PluralRules polyfill. Will fallback to the compatibilityJSON v3 format handling.")}this.rules=createRules()}_createClass__default["default"](PluralResolver,[{key:"addRule",value:function addRule(lng,obj){this.rules[lng]=obj}},{key:"getRule",value:function getRule(code){var options=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};if(this.shouldUseIntlApi()){try{return new Intl.PluralRules(code,{type:options.ordinal?"ordinal":"cardinal"})}catch(_unused){return}}return this.rules[code]||this.rules[this.languageUtils.getLanguagePartFromCode(code)]}},{key:"needsPlural",value:function needsPlural(code){var options=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};var rule=this.getRule(code,options);if(this.shouldUseIntlApi()){return rule&&rule.resolvedOptions().pluralCategories.length>1}return rule&&rule.numbers.length>1}},{key:"getPluralFormsOfKey",value:function getPluralFormsOfKey(code,key){var options=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{};return this.getSuffixes(code,options).map((function(suffix){return"".concat(key).concat(suffix)}))}},{key:"getSuffixes",value:function getSuffixes(code){var _this=this;var options=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};var rule=this.getRule(code,options);if(!rule){return[]}if(this.shouldUseIntlApi()){return rule.resolvedOptions().pluralCategories.sort((function(pluralCategory1,pluralCategory2){return suffixesOrder[pluralCategory1]-suffixesOrder[pluralCategory2]})).map((function(pluralCategory){return"".concat(_this.options.prepend).concat(pluralCategory)}))}return rule.numbers.map((function(number){return _this.getSuffix(code,number,options)}))}},{key:"getSuffix",value:function getSuffix(code,count){var options=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{};var rule=this.getRule(code,options);if(rule){if(this.shouldUseIntlApi()){return"".concat(this.options.prepend).concat(rule.select(count))}return this.getSuffixRetroCompatible(rule,count)}this.logger.warn("no plural rule found for: ".concat(code));return""}},{key:"getSuffixRetroCompatible",value:function getSuffixRetroCompatible(rule,count){var _this2=this;var idx=rule.noAbs?rule.plurals(count):rule.plurals(Math.abs(count));var suffix=rule.numbers[idx];if(this.options.simplifyPluralSuffix&&rule.numbers.length===2&&rule.numbers[0]===1){if(suffix===2){suffix="plural"}else if(suffix===1){suffix=""}}var returnSuffix=function returnSuffix(){return _this2.options.prepend&&suffix.toString()?_this2.options.prepend+suffix.toString():suffix.toString()};if(this.options.compatibilityJSON==="v1"){if(suffix===1)return"";if(typeof suffix==="number")return"_plural_".concat(suffix.toString());return returnSuffix()}else if(this.options.compatibilityJSON==="v2"){return returnSuffix()}else if(this.options.simplifyPluralSuffix&&rule.numbers.length===2&&rule.numbers[0]===1){return returnSuffix()}return this.options.prepend&&idx.toString()?this.options.prepend+idx.toString():idx.toString()}},{key:"shouldUseIntlApi",value:function shouldUseIntlApi(){return!deprecatedJsonVersions.includes(this.options.compatibilityJSON)}}]);return PluralResolver}();function ownKeys$3(object,enumerableOnly){var keys=Object.keys(object);if(Object.getOwnPropertySymbols){var symbols=Object.getOwnPropertySymbols(object);if(enumerableOnly){symbols=symbols.filter((function(sym){return Object.getOwnPropertyDescriptor(object,sym).enumerable}))}keys.push.apply(keys,symbols)}return keys}function _objectSpread$3(target){for(var i=1;i0&&arguments[0]!==undefined?arguments[0]:{};_classCallCheck__default["default"](this,Interpolator);this.logger=baseLogger.create("interpolator");this.options=options;this.format=options.interpolation&&options.interpolation.format||function(value){return value};this.init(options)}_createClass__default["default"](Interpolator,[{key:"init",value:function init(){var options=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};if(!options.interpolation)options.interpolation={escapeValue:true};var iOpts=options.interpolation;this.escape=iOpts.escape!==undefined?iOpts.escape:escape;this.escapeValue=iOpts.escapeValue!==undefined?iOpts.escapeValue:true;this.useRawValueToEscape=iOpts.useRawValueToEscape!==undefined?iOpts.useRawValueToEscape:false;this.prefix=iOpts.prefix?regexEscape(iOpts.prefix):iOpts.prefixEscaped||"{{";this.suffix=iOpts.suffix?regexEscape(iOpts.suffix):iOpts.suffixEscaped||"}}";this.formatSeparator=iOpts.formatSeparator?iOpts.formatSeparator:iOpts.formatSeparator||",";this.unescapePrefix=iOpts.unescapeSuffix?"":iOpts.unescapePrefix||"-";this.unescapeSuffix=this.unescapePrefix?"":iOpts.unescapeSuffix||"";this.nestingPrefix=iOpts.nestingPrefix?regexEscape(iOpts.nestingPrefix):iOpts.nestingPrefixEscaped||regexEscape("$t(");this.nestingSuffix=iOpts.nestingSuffix?regexEscape(iOpts.nestingSuffix):iOpts.nestingSuffixEscaped||regexEscape(")");this.nestingOptionsSeparator=iOpts.nestingOptionsSeparator?iOpts.nestingOptionsSeparator:iOpts.nestingOptionsSeparator||",";this.maxReplaces=iOpts.maxReplaces?iOpts.maxReplaces:1e3;this.alwaysFormat=iOpts.alwaysFormat!==undefined?iOpts.alwaysFormat:false;this.resetRegExp()}},{key:"reset",value:function reset(){if(this.options)this.init(this.options)}},{key:"resetRegExp",value:function resetRegExp(){var regexpStr="".concat(this.prefix,"(.+?)").concat(this.suffix);this.regexp=new RegExp(regexpStr,"g");var regexpUnescapeStr="".concat(this.prefix).concat(this.unescapePrefix,"(.+?)").concat(this.unescapeSuffix).concat(this.suffix);this.regexpUnescape=new RegExp(regexpUnescapeStr,"g");var nestingRegexpStr="".concat(this.nestingPrefix,"(.+?)").concat(this.nestingSuffix);this.nestingRegexp=new RegExp(nestingRegexpStr,"g")}},{key:"interpolate",value:function interpolate(str,data,lng,options){var _this=this;var match;var value;var replaces;var defaultData=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{};function regexSafe(val){return val.replace(/\$/g,"$$$$")}var handleFormat=function handleFormat(key){if(key.indexOf(_this.formatSeparator)<0){var path=getPathWithDefaults(data,defaultData,key);return _this.alwaysFormat?_this.format(path,undefined,lng,_objectSpread$3(_objectSpread$3(_objectSpread$3({},options),data),{},{interpolationkey:key})):path}var p=key.split(_this.formatSeparator);var k=p.shift().trim();var f=p.join(_this.formatSeparator).trim();return _this.format(getPathWithDefaults(data,defaultData,k),f,lng,_objectSpread$3(_objectSpread$3(_objectSpread$3({},options),data),{},{interpolationkey:k}))};this.resetRegExp();var missingInterpolationHandler=options&&options.missingInterpolationHandler||this.options.missingInterpolationHandler;var skipOnVariables=options&&options.interpolation&&options.interpolation.skipOnVariables!==undefined?options.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;var todos=[{regex:this.regexpUnescape,safeValue:function safeValue(val){return regexSafe(val)}},{regex:this.regexp,safeValue:function safeValue(val){return _this.escapeValue?regexSafe(_this.escape(val)):regexSafe(val)}}];todos.forEach((function(todo){replaces=0;while(match=todo.regex.exec(str)){var matchedVar=match[1].trim();value=handleFormat(matchedVar);if(value===undefined){if(typeof missingInterpolationHandler==="function"){var temp=missingInterpolationHandler(str,match,options);value=typeof temp==="string"?temp:""}else if(options&&options.hasOwnProperty(matchedVar)){value=""}else if(skipOnVariables){value=match[0];continue}else{_this.logger.warn("missed to pass in variable ".concat(matchedVar," for interpolating ").concat(str));value=""}}else if(typeof value!=="string"&&!_this.useRawValueToEscape){value=makeString(value)}var safeValue=todo.safeValue(value);str=str.replace(match[0],safeValue);if(skipOnVariables){todo.regex.lastIndex+=value.length;todo.regex.lastIndex-=match[0].length}else{todo.regex.lastIndex=0}replaces++;if(replaces>=_this.maxReplaces){break}}}));return str}},{key:"nest",value:function nest(str,fc){var _this2=this;var options=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{};var match;var value;var clonedOptions=_objectSpread$3({},options);clonedOptions.applyPostProcessor=false;delete clonedOptions.defaultValue;function handleHasOptions(key,inheritedOptions){var sep=this.nestingOptionsSeparator;if(key.indexOf(sep)<0)return key;var c=key.split(new RegExp("".concat(sep,"[ ]*{")));var optionsString="{".concat(c[1]);key=c[0];optionsString=this.interpolate(optionsString,clonedOptions);var matchedSingleQuotes=optionsString.match(/'/g);var matchedDoubleQuotes=optionsString.match(/"/g);if(matchedSingleQuotes&&matchedSingleQuotes.length%2===0&&!matchedDoubleQuotes||matchedDoubleQuotes.length%2!==0){optionsString=optionsString.replace(/'/g,'"')}try{clonedOptions=JSON.parse(optionsString);if(inheritedOptions)clonedOptions=_objectSpread$3(_objectSpread$3({},inheritedOptions),clonedOptions)}catch(e){this.logger.warn("failed parsing options string in nesting for key ".concat(key),e);return"".concat(key).concat(sep).concat(optionsString)}delete clonedOptions.defaultValue;return key}while(match=this.nestingRegexp.exec(str)){var formatters=[];var doReduce=false;if(match[0].indexOf(this.formatSeparator)!==-1&&!/{.*}/.test(match[1])){var r=match[1].split(this.formatSeparator).map((function(elem){return elem.trim()}));match[1]=r.shift();formatters=r;doReduce=true}value=fc(handleHasOptions.call(this,match[1].trim(),clonedOptions),clonedOptions);if(value&&match[0]===str&&typeof value!=="string")return value;if(typeof value!=="string")value=makeString(value);if(!value){this.logger.warn("missed to resolve ".concat(match[1]," for nesting ").concat(str));value=""}if(doReduce){value=formatters.reduce((function(v,f){return _this2.format(v,f,options.lng,_objectSpread$3(_objectSpread$3({},options),{},{interpolationkey:match[1].trim()}))}),value.trim())}str=str.replace(match[0],value);this.regexp.lastIndex=0}return str}}]);return Interpolator}();function ownKeys$4(object,enumerableOnly){var keys=Object.keys(object);if(Object.getOwnPropertySymbols){var symbols=Object.getOwnPropertySymbols(object);if(enumerableOnly){symbols=symbols.filter((function(sym){return Object.getOwnPropertyDescriptor(object,sym).enumerable}))}keys.push.apply(keys,symbols)}return keys}function _objectSpread$4(target){for(var i=1;i-1){var p=formatStr.split("(");formatName=p[0].toLowerCase().trim();var optStr=p[1].substring(0,p[1].length-1);if(formatName==="currency"&&optStr.indexOf(":")<0){if(!formatOptions.currency)formatOptions.currency=optStr.trim()}else if(formatName==="relativetime"&&optStr.indexOf(":")<0){if(!formatOptions.range)formatOptions.range=optStr.trim()}else{var opts=optStr.split(";");opts.forEach((function(opt){if(!opt)return;var _opt$split=opt.split(":"),_opt$split2=_toArray__default["default"](_opt$split),key=_opt$split2[0],rest=_opt$split2.slice(1);var val=rest.join(":").trim().replace(/^'+|'+$/g,"");if(!formatOptions[key.trim()])formatOptions[key.trim()]=val;if(val==="false")formatOptions[key.trim()]=false;if(val==="true")formatOptions[key.trim()]=true;if(!isNaN(val))formatOptions[key.trim()]=parseInt(val,10)}))}}return{formatName:formatName,formatOptions:formatOptions}}function createCachedFormatter(fn){var cache={};return function invokeFormatter(val,lng,options){var key=lng+JSON.stringify(options);var formatter=cache[key];if(!formatter){formatter=fn(lng,options);cache[key]=formatter}return formatter(val)}}var Formatter=function(){function Formatter(){var options=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};_classCallCheck__default["default"](this,Formatter);this.logger=baseLogger.create("formatter");this.options=options;this.formats={number:createCachedFormatter((function(lng,options){var formatter=new Intl.NumberFormat(lng,options);return function(val){return formatter.format(val)}})),currency:createCachedFormatter((function(lng,options){var formatter=new Intl.NumberFormat(lng,_objectSpread$4(_objectSpread$4({},options),{},{style:"currency"}));return function(val){return formatter.format(val)}})),datetime:createCachedFormatter((function(lng,options){var formatter=new Intl.DateTimeFormat(lng,_objectSpread$4({},options));return function(val){return formatter.format(val)}})),relativetime:createCachedFormatter((function(lng,options){var formatter=new Intl.RelativeTimeFormat(lng,_objectSpread$4({},options));return function(val){return formatter.format(val,options.range||"day")}})),list:createCachedFormatter((function(lng,options){var formatter=new Intl.ListFormat(lng,_objectSpread$4({},options));return function(val){return formatter.format(val)}}))};this.init(options)}_createClass__default["default"](Formatter,[{key:"init",value:function init(services){var options=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{interpolation:{}};var iOpts=options.interpolation;this.formatSeparator=iOpts.formatSeparator?iOpts.formatSeparator:iOpts.formatSeparator||","}},{key:"add",value:function add(name,fc){this.formats[name.toLowerCase().trim()]=fc}},{key:"addCached",value:function addCached(name,fc){this.formats[name.toLowerCase().trim()]=createCachedFormatter(fc)}},{key:"format",value:function format(value,_format,lng,options){var _this=this;var formats=_format.split(this.formatSeparator);var result=formats.reduce((function(mem,f){var _parseFormatStr=parseFormatStr(f),formatName=_parseFormatStr.formatName,formatOptions=_parseFormatStr.formatOptions;if(_this.formats[formatName]){var formatted=mem;try{var valOptions=options&&options.formatParams&&options.formatParams[options.interpolationkey]||{};var l=valOptions.locale||valOptions.lng||options.locale||options.lng||lng;formatted=_this.formats[formatName](mem,l,_objectSpread$4(_objectSpread$4(_objectSpread$4({},formatOptions),options),valOptions))}catch(error){_this.logger.warn(error)}return formatted}else{_this.logger.warn("there was no format function for ".concat(formatName))}return mem}),value);return result}}]);return Formatter}();function ownKeys$5(object,enumerableOnly){var keys=Object.keys(object);if(Object.getOwnPropertySymbols){var symbols=Object.getOwnPropertySymbols(object);if(enumerableOnly){symbols=symbols.filter((function(sym){return Object.getOwnPropertyDescriptor(object,sym).enumerable}))}keys.push.apply(keys,symbols)}return keys}function _objectSpread$5(target){for(var i=1;i3&&arguments[3]!==undefined?arguments[3]:{};_classCallCheck__default["default"](this,Connector);_this=_super.call(this);if(isIE10){EventEmitter.call(_assertThisInitialized__default["default"](_this))}_this.backend=backend;_this.store=store;_this.services=services;_this.languageUtils=services.languageUtils;_this.options=options;_this.logger=baseLogger.create("backendConnector");_this.waitingReads=[];_this.maxParallelReads=options.maxParallelReads||10;_this.readingCalls=0;_this.maxRetries=options.maxRetries>=0?options.maxRetries:5;_this.retryTimeout=options.retryTimeout>=1?options.retryTimeout:350;_this.state={};_this.queue=[];if(_this.backend&&_this.backend.init){_this.backend.init(services,options.backend,options)}return _this}_createClass__default["default"](Connector,[{key:"queueLoad",value:function queueLoad(languages,namespaces,options,callback){var _this2=this;var toLoad={};var pending={};var toLoadLanguages={};var toLoadNamespaces={};languages.forEach((function(lng){var hasAllNamespaces=true;namespaces.forEach((function(ns){var name="".concat(lng,"|").concat(ns);if(!options.reload&&_this2.store.hasResourceBundle(lng,ns)){_this2.state[name]=2}else if(_this2.state[name]<0);else if(_this2.state[name]===1){if(pending[name]===undefined)pending[name]=true}else{_this2.state[name]=1;hasAllNamespaces=false;if(pending[name]===undefined)pending[name]=true;if(toLoad[name]===undefined)toLoad[name]=true;if(toLoadNamespaces[ns]===undefined)toLoadNamespaces[ns]=true}}));if(!hasAllNamespaces)toLoadLanguages[lng]=true}));if(Object.keys(toLoad).length||Object.keys(pending).length){this.queue.push({pending:pending,pendingCount:Object.keys(pending).length,loaded:{},errors:[],callback:callback})}return{toLoad:Object.keys(toLoad),pending:Object.keys(pending),toLoadLanguages:Object.keys(toLoadLanguages),toLoadNamespaces:Object.keys(toLoadNamespaces)}}},{key:"loaded",value:function loaded(name,err,data){var s=name.split("|");var lng=s[0];var ns=s[1];if(err)this.emit("failedLoading",lng,ns,err);if(data){this.store.addResourceBundle(lng,ns,data)}this.state[name]=err?-1:2;var loaded={};this.queue.forEach((function(q){pushPath(q.loaded,[lng],ns);removePending(q,name);if(err)q.errors.push(err);if(q.pendingCount===0&&!q.done){Object.keys(q.loaded).forEach((function(l){if(!loaded[l])loaded[l]={};var loadedKeys=q.loaded[l];if(loadedKeys.length){loadedKeys.forEach((function(ns){if(loaded[l][ns]===undefined)loaded[l][ns]=true}))}}));q.done=true;if(q.errors.length){q.callback(q.errors)}else{q.callback()}}}));this.emit("loaded",loaded);this.queue=this.queue.filter((function(q){return!q.done}))}},{key:"read",value:function read(lng,ns,fcName){var _this3=this;var tried=arguments.length>3&&arguments[3]!==undefined?arguments[3]:0;var wait=arguments.length>4&&arguments[4]!==undefined?arguments[4]:this.retryTimeout;var callback=arguments.length>5?arguments[5]:undefined;if(!lng.length)return callback(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:lng,ns:ns,fcName:fcName,tried:tried,wait:wait,callback:callback});return}this.readingCalls++;return this.backend[fcName](lng,ns,(function(err,data){_this3.readingCalls--;if(_this3.waitingReads.length>0){var next=_this3.waitingReads.shift();_this3.read(next.lng,next.ns,next.fcName,next.tried,next.wait,next.callback)}if(err&&data&&tried<_this3.maxRetries){setTimeout((function(){_this3.read.call(_this3,lng,ns,fcName,tried+1,wait*2,callback)}),wait);return}callback(err,data)}))}},{key:"prepareLoading",value:function prepareLoading(languages,namespaces){var _this4=this;var options=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{};var callback=arguments.length>3?arguments[3]:undefined;if(!this.backend){this.logger.warn("No backend was added via i18next.use. Will not load resources.");return callback&&callback()}if(typeof languages==="string")languages=this.languageUtils.toResolveHierarchy(languages);if(typeof namespaces==="string")namespaces=[namespaces];var toLoad=this.queueLoad(languages,namespaces,options,callback);if(!toLoad.toLoad.length){if(!toLoad.pending.length)callback();return null}toLoad.toLoad.forEach((function(name){_this4.loadOne(name)}))}},{key:"load",value:function load(languages,namespaces,callback){this.prepareLoading(languages,namespaces,{},callback)}},{key:"reload",value:function reload(languages,namespaces,callback){this.prepareLoading(languages,namespaces,{reload:true},callback)}},{key:"loadOne",value:function loadOne(name){var _this5=this;var prefix=arguments.length>1&&arguments[1]!==undefined?arguments[1]:"";var s=name.split("|");var lng=s[0];var ns=s[1];this.read(lng,ns,"read",undefined,undefined,(function(err,data){if(err)_this5.logger.warn("".concat(prefix,"loading namespace ").concat(ns," for language ").concat(lng," failed"),err);if(!err&&data)_this5.logger.log("".concat(prefix,"loaded namespace ").concat(ns," for language ").concat(lng),data);_this5.loaded(name,err,data)}))}},{key:"saveMissing",value:function saveMissing(languages,namespace,key,fallbackValue,isUpdate){var options=arguments.length>5&&arguments[5]!==undefined?arguments[5]:{};if(this.services.utils&&this.services.utils.hasLoadedNamespace&&!this.services.utils.hasLoadedNamespace(namespace)){this.logger.warn('did not save key "'.concat(key,'" as the namespace "').concat(namespace,'" was not yet loaded'),"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");return}if(key===undefined||key===null||key==="")return;if(this.backend&&this.backend.create){this.backend.create(languages,namespace,key,fallbackValue,null,_objectSpread$5(_objectSpread$5({},options),{},{isUpdate:isUpdate}))}if(!languages||!languages[0])return;this.store.addResource(languages[0],namespace,key,fallbackValue)}}]);return Connector}(EventEmitter);function get(){return{debug:false,initImmediate:true,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:false,supportedLngs:false,nonExplicitSupportedLngs:false,load:"all",preload:false,simplifyPluralSuffix:true,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:false,saveMissing:false,updateMissing:false,saveMissingTo:"fallback",saveMissingPlurals:true,missingKeyHandler:false,missingInterpolationHandler:false,postProcess:false,postProcessPassResolved:false,returnNull:true,returnEmptyString:true,returnObjects:false,joinArrays:false,returnedObjectHandler:false,parseMissingKeyHandler:false,appendNamespaceToMissingKey:false,appendNamespaceToCIMode:false,overloadTranslationOptionHandler:function handle(args){var ret={};if(_typeof__default["default"](args[1])==="object")ret=args[1];if(typeof args[1]==="string")ret.defaultValue=args[1];if(typeof args[2]==="string")ret.tDescription=args[2];if(_typeof__default["default"](args[2])==="object"||_typeof__default["default"](args[3])==="object"){var options=args[3]||args[2];Object.keys(options).forEach((function(key){ret[key]=options[key]}))}return ret},interpolation:{escapeValue:true,format:function format(value,_format,lng,options){return value},prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:true}}}function transformOptions(options){if(typeof options.ns==="string")options.ns=[options.ns];if(typeof options.fallbackLng==="string")options.fallbackLng=[options.fallbackLng];if(typeof options.fallbackNS==="string")options.fallbackNS=[options.fallbackNS];if(options.supportedLngs&&options.supportedLngs.indexOf("cimode")<0){options.supportedLngs=options.supportedLngs.concat(["cimode"])}return options}function ownKeys$6(object,enumerableOnly){var keys=Object.keys(object);if(Object.getOwnPropertySymbols){var symbols=Object.getOwnPropertySymbols(object);if(enumerableOnly){symbols=symbols.filter((function(sym){return Object.getOwnPropertyDescriptor(object,sym).enumerable}))}keys.push.apply(keys,symbols)}return keys}function _objectSpread$6(target){for(var i=1;i0&&arguments[0]!==undefined?arguments[0]:{};var callback=arguments.length>1?arguments[1]:undefined;_classCallCheck__default["default"](this,I18n);_this=_super.call(this);if(isIE10){EventEmitter.call(_assertThisInitialized__default["default"](_this))}_this.options=transformOptions(options);_this.services={};_this.logger=baseLogger;_this.modules={external:[]};bindMemberFunctions(_assertThisInitialized__default["default"](_this));if(callback&&!_this.isInitialized&&!options.isClone){if(!_this.options.initImmediate){_this.init(options,callback);return _possibleConstructorReturn__default["default"](_this,_assertThisInitialized__default["default"](_this))}setTimeout((function(){_this.init(options,callback)}),0)}return _this}_createClass__default["default"](I18n,[{key:"init",value:function init(){var _this2=this;var options=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};var callback=arguments.length>1?arguments[1]:undefined;if(typeof options==="function"){callback=options;options={}}if(!options.defaultNS&&options.defaultNS!==false&&options.ns){if(typeof options.ns==="string"){options.defaultNS=options.ns}else if(options.ns.indexOf("translation")<0){options.defaultNS=options.ns[0]}}var defOpts=get();this.options=_objectSpread$6(_objectSpread$6(_objectSpread$6({},defOpts),this.options),transformOptions(options));if(this.options.compatibilityAPI!=="v1"){this.options.interpolation=_objectSpread$6(_objectSpread$6({},defOpts.interpolation),this.options.interpolation)}if(options.keySeparator!==undefined){this.options.userDefinedKeySeparator=options.keySeparator}if(options.nsSeparator!==undefined){this.options.userDefinedNsSeparator=options.nsSeparator}function createClassOnDemand(ClassOrObject){if(!ClassOrObject)return null;if(typeof ClassOrObject==="function")return new ClassOrObject;return ClassOrObject}if(!this.options.isClone){if(this.modules.logger){baseLogger.init(createClassOnDemand(this.modules.logger),this.options)}else{baseLogger.init(null,this.options)}var formatter;if(this.modules.formatter){formatter=this.modules.formatter}else if(typeof Intl!=="undefined"){formatter=Formatter}var lu=new LanguageUtil(this.options);this.store=new ResourceStore(this.options.resources,this.options);var s=this.services;s.logger=baseLogger;s.resourceStore=this.store;s.languageUtils=lu;s.pluralResolver=new PluralResolver(lu,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix});if(formatter&&(!this.options.interpolation.format||this.options.interpolation.format===defOpts.interpolation.format)){s.formatter=createClassOnDemand(formatter);s.formatter.init(s,this.options);this.options.interpolation.format=s.formatter.format.bind(s.formatter)}s.interpolator=new Interpolator(this.options);s.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)};s.backendConnector=new Connector(createClassOnDemand(this.modules.backend),s.resourceStore,s,this.options);s.backendConnector.on("*",(function(event){for(var _len=arguments.length,args=new Array(_len>1?_len-1:0),_key=1;_key<_len;_key++){args[_key-1]=arguments[_key]}_this2.emit.apply(_this2,[event].concat(args))}));if(this.modules.languageDetector){s.languageDetector=createClassOnDemand(this.modules.languageDetector);s.languageDetector.init(s,this.options.detection,this.options)}if(this.modules.i18nFormat){s.i18nFormat=createClassOnDemand(this.modules.i18nFormat);if(s.i18nFormat.init)s.i18nFormat.init(this)}this.translator=new Translator(this.services,this.options);this.translator.on("*",(function(event){for(var _len2=arguments.length,args=new Array(_len2>1?_len2-1:0),_key2=1;_key2<_len2;_key2++){args[_key2-1]=arguments[_key2]}_this2.emit.apply(_this2,[event].concat(args))}));this.modules.external.forEach((function(m){if(m.init)m.init(_this2)}))}this.format=this.options.interpolation.format;if(!callback)callback=noop;if(this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){var codes=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);if(codes.length>0&&codes[0]!=="dev")this.options.lng=codes[0]}if(!this.services.languageDetector&&!this.options.lng){this.logger.warn("init: no languageDetector is used and no lng is defined")}var storeApi=["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"];storeApi.forEach((function(fcName){_this2[fcName]=function(){var _this2$store;return(_this2$store=_this2.store)[fcName].apply(_this2$store,arguments)}}));var storeApiChained=["addResource","addResources","addResourceBundle","removeResourceBundle"];storeApiChained.forEach((function(fcName){_this2[fcName]=function(){var _this2$store2;(_this2$store2=_this2.store)[fcName].apply(_this2$store2,arguments);return _this2}}));var deferred=defer();var load=function load(){var finish=function finish(err,t){if(_this2.isInitialized&&!_this2.initializedStoreOnce)_this2.logger.warn("init: i18next is already initialized. You should call init just once!");_this2.isInitialized=true;if(!_this2.options.isClone)_this2.logger.log("initialized",_this2.options);_this2.emit("initialized",_this2.options);deferred.resolve(t);callback(err,t)};if(_this2.languages&&_this2.options.compatibilityAPI!=="v1"&&!_this2.isInitialized)return finish(null,_this2.t.bind(_this2));_this2.changeLanguage(_this2.options.lng,finish)};if(this.options.resources||!this.options.initImmediate){load()}else{setTimeout(load,0)}return deferred}},{key:"loadResources",value:function loadResources(language){var _this3=this;var callback=arguments.length>1&&arguments[1]!==undefined?arguments[1]:noop;var usedCallback=callback;var usedLng=typeof language==="string"?language:this.language;if(typeof language==="function")usedCallback=language;if(!this.options.resources||this.options.partialBundledLanguages){if(usedLng&&usedLng.toLowerCase()==="cimode")return usedCallback();var toLoad=[];var append=function append(lng){if(!lng)return;var lngs=_this3.services.languageUtils.toResolveHierarchy(lng);lngs.forEach((function(l){if(toLoad.indexOf(l)<0)toLoad.push(l)}))};if(!usedLng){var fallbacks=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);fallbacks.forEach((function(l){return append(l)}))}else{append(usedLng)}if(this.options.preload){this.options.preload.forEach((function(l){return append(l)}))}this.services.backendConnector.load(toLoad,this.options.ns,(function(e){if(!e&&!_this3.resolvedLanguage&&_this3.language)_this3.setResolvedLanguage(_this3.language);usedCallback(e)}))}else{usedCallback(null)}}},{key:"reloadResources",value:function reloadResources(lngs,ns,callback){var deferred=defer();if(!lngs)lngs=this.languages;if(!ns)ns=this.options.ns;if(!callback)callback=noop;this.services.backendConnector.reload(lngs,ns,(function(err){deferred.resolve();callback(err)}));return deferred}},{key:"use",value:function use(module){if(!module)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!module.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");if(module.type==="backend"){this.modules.backend=module}if(module.type==="logger"||module.log&&module.warn&&module.error){this.modules.logger=module}if(module.type==="languageDetector"){this.modules.languageDetector=module}if(module.type==="i18nFormat"){this.modules.i18nFormat=module}if(module.type==="postProcessor"){postProcessor.addPostProcessor(module)}if(module.type==="formatter"){this.modules.formatter=module}if(module.type==="3rdParty"){this.modules.external.push(module)}return this}},{key:"setResolvedLanguage",value:function setResolvedLanguage(l){if(!l||!this.languages)return;if(["cimode","dev"].indexOf(l)>-1)return;for(var li=0;li-1)continue;if(this.store.hasLanguageSomeTranslations(lngInLngs)){this.resolvedLanguage=lngInLngs;break}}}},{key:"changeLanguage",value:function changeLanguage(lng,callback){var _this4=this;this.isLanguageChangingTo=lng;var deferred=defer();this.emit("languageChanging",lng);var setLngProps=function setLngProps(l){_this4.language=l;_this4.languages=_this4.services.languageUtils.toResolveHierarchy(l);_this4.resolvedLanguage=undefined;_this4.setResolvedLanguage(l)};var done=function done(err,l){if(l){setLngProps(l);_this4.translator.changeLanguage(l);_this4.isLanguageChangingTo=undefined;_this4.emit("languageChanged",l);_this4.logger.log("languageChanged",l)}else{_this4.isLanguageChangingTo=undefined}deferred.resolve((function(){return _this4.t.apply(_this4,arguments)}));if(callback)callback(err,(function(){return _this4.t.apply(_this4,arguments)}))};var setLng=function setLng(lngs){if(!lng&&!lngs&&_this4.services.languageDetector)lngs=[];var l=typeof lngs==="string"?lngs:_this4.services.languageUtils.getBestMatchFromCodes(lngs);if(l){if(!_this4.language){setLngProps(l)}if(!_this4.translator.language)_this4.translator.changeLanguage(l);if(_this4.services.languageDetector)_this4.services.languageDetector.cacheUserLanguage(l)}_this4.loadResources(l,(function(err){done(err,l)}))};if(!lng&&this.services.languageDetector&&!this.services.languageDetector.async){setLng(this.services.languageDetector.detect())}else if(!lng&&this.services.languageDetector&&this.services.languageDetector.async){this.services.languageDetector.detect(setLng)}else{setLng(lng)}return deferred}},{key:"getFixedT",value:function getFixedT(lng,ns,keyPrefix){var _this5=this;var fixedT=function fixedT(key,opts){var options;if(_typeof__default["default"](opts)!=="object"){for(var _len3=arguments.length,rest=new Array(_len3>2?_len3-2:0),_key3=2;_key3<_len3;_key3++){rest[_key3-2]=arguments[_key3]}options=_this5.options.overloadTranslationOptionHandler([key,opts].concat(rest))}else{options=_objectSpread$6({},opts)}options.lng=options.lng||fixedT.lng;options.lngs=options.lngs||fixedT.lngs;options.ns=options.ns||fixedT.ns;options.keyPrefix=options.keyPrefix||keyPrefix||fixedT.keyPrefix;var keySeparator=_this5.options.keySeparator||".";var resultKey=options.keyPrefix?"".concat(options.keyPrefix).concat(keySeparator).concat(key):key;return _this5.t(resultKey,options)};if(typeof lng==="string"){fixedT.lng=lng}else{fixedT.lngs=lng}fixedT.ns=ns;fixedT.keyPrefix=keyPrefix;return fixedT}},{key:"t",value:function t(){var _this$translator;return this.translator&&(_this$translator=this.translator).translate.apply(_this$translator,arguments)}},{key:"exists",value:function exists(){var _this$translator2;return this.translator&&(_this$translator2=this.translator).exists.apply(_this$translator2,arguments)}},{key:"setDefaultNamespace",value:function setDefaultNamespace(ns){this.options.defaultNS=ns}},{key:"hasLoadedNamespace",value:function hasLoadedNamespace(ns){var _this6=this;var options=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};if(!this.isInitialized){this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages);return false}if(!this.languages||!this.languages.length){this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages);return false}var lng=this.resolvedLanguage||this.languages[0];var fallbackLng=this.options?this.options.fallbackLng:false;var lastLng=this.languages[this.languages.length-1];if(lng.toLowerCase()==="cimode")return true;var loadNotPending=function loadNotPending(l,n){var loadState=_this6.services.backendConnector.state["".concat(l,"|").concat(n)];return loadState===-1||loadState===2};if(options.precheck){var preResult=options.precheck(this,loadNotPending);if(preResult!==undefined)return preResult}if(this.hasResourceBundle(lng,ns))return true;if(!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages)return true;if(loadNotPending(lng,ns)&&(!fallbackLng||loadNotPending(lastLng,ns)))return true;return false}},{key:"loadNamespaces",value:function loadNamespaces(ns,callback){var _this7=this;var deferred=defer();if(!this.options.ns){callback&&callback();return Promise.resolve()}if(typeof ns==="string")ns=[ns];ns.forEach((function(n){if(_this7.options.ns.indexOf(n)<0)_this7.options.ns.push(n)}));this.loadResources((function(err){deferred.resolve();if(callback)callback(err)}));return deferred}},{key:"loadLanguages",value:function loadLanguages(lngs,callback){var deferred=defer();if(typeof lngs==="string")lngs=[lngs];var preloaded=this.options.preload||[];var newLngs=lngs.filter((function(lng){return preloaded.indexOf(lng)<0}));if(!newLngs.length){if(callback)callback();return Promise.resolve()}this.options.preload=preloaded.concat(newLngs);this.loadResources((function(err){deferred.resolve();if(callback)callback(err)}));return deferred}},{key:"dir",value:function dir(lng){if(!lng)lng=this.resolvedLanguage||(this.languages&&this.languages.length>0?this.languages[0]:this.language);if(!lng)return"rtl";var rtlLngs=["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"];return rtlLngs.indexOf(this.services.languageUtils.getLanguagePartFromCode(lng))>-1||lng.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}},{key:"cloneInstance",value:function cloneInstance(){var _this8=this;var options=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};var callback=arguments.length>1&&arguments[1]!==undefined?arguments[1]:noop;var mergedOptions=_objectSpread$6(_objectSpread$6(_objectSpread$6({},this.options),options),{isClone:true});var clone=new I18n(mergedOptions);if(options.debug!==undefined||options.prefix!==undefined){clone.logger=clone.logger.clone(options)}var membersToCopy=["store","services","language"];membersToCopy.forEach((function(m){clone[m]=_this8[m]}));clone.services=_objectSpread$6({},this.services);clone.services.utils={hasLoadedNamespace:clone.hasLoadedNamespace.bind(clone)};clone.translator=new Translator(clone.services,clone.options);clone.translator.on("*",(function(event){for(var _len4=arguments.length,args=new Array(_len4>1?_len4-1:0),_key4=1;_key4<_len4;_key4++){args[_key4-1]=arguments[_key4]}clone.emit.apply(clone,[event].concat(args))}));clone.init(mergedOptions,callback);clone.translator.options=clone.options;clone.translator.backendConnector.services.utils={hasLoadedNamespace:clone.hasLoadedNamespace.bind(clone)};return clone}},{key:"toJSON",value:function toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}]);return I18n}(EventEmitter);_defineProperty__default["default"](I18n,"createInstance",(function(){var options=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};var callback=arguments.length>1?arguments[1]:undefined;return new I18n(options,callback)}));var instance=I18n.createInstance();instance.createInstance=I18n.createInstance;module.exports=instance},{"@babel/runtime/helpers/assertThisInitialized":4,"@babel/runtime/helpers/classCallCheck":5,"@babel/runtime/helpers/createClass":6,"@babel/runtime/helpers/defineProperty":7,"@babel/runtime/helpers/getPrototypeOf":8,"@babel/runtime/helpers/inherits":9,"@babel/runtime/helpers/possibleConstructorReturn":12,"@babel/runtime/helpers/toArray":14,"@babel/runtime/helpers/typeof":17}],100:[function(require,module,exports){ /*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh */ exports.read=function(buffer,offset,isLE,mLen,nBytes){var e,m;var eLen=nBytes*8-mLen-1;var eMax=(1<>1;var nBits=-7;var i=isLE?nBytes-1:0;var d=isLE?-1:1;var s=buffer[offset+i];i+=d;e=s&(1<<-nBits)-1;s>>=-nBits;nBits+=eLen;for(;nBits>0;e=e*256+buffer[offset+i],i+=d,nBits-=8){}m=e&(1<<-nBits)-1;e>>=-nBits;nBits+=mLen;for(;nBits>0;m=m*256+buffer[offset+i],i+=d,nBits-=8){}if(e===0){e=1-eBias}else if(e===eMax){return m?NaN:(s?-1:1)*Infinity}else{m=m+Math.pow(2,mLen);e=e-eBias}return(s?-1:1)*m*Math.pow(2,e-mLen)};exports.write=function(buffer,value,offset,isLE,mLen,nBytes){var e,m,c;var eLen=nBytes*8-mLen-1;var eMax=(1<>1;var rt=mLen===23?Math.pow(2,-24)-Math.pow(2,-77):0;var i=isLE?0:nBytes-1;var d=isLE?1:-1;var s=value<0||value===0&&1/value<0?1:0;value=Math.abs(value);if(isNaN(value)||value===Infinity){m=isNaN(value)?1:0;e=eMax}else{e=Math.floor(Math.log(value)/Math.LN2);if(value*(c=Math.pow(2,-e))<1){e--;c*=2}if(e+eBias>=1){value+=rt/c}else{value+=rt*Math.pow(2,1-eBias)}if(value*c>=2){e++;c/=2}if(e+eBias>=eMax){m=0;e=eMax}else if(e+eBias>=1){m=(value*c-1)*Math.pow(2,mLen);e=e+eBias}else{m=value*Math.pow(2,eBias-1)*Math.pow(2,mLen);e=0}}for(;mLen>=8;buffer[offset+i]=m&255,i+=d,m/=256,mLen-=8){}e=e<0;buffer[offset+i]=e&255,i+=d,e/=256,eLen-=8){}buffer[offset+i-d]|=s*128}},{}],101:[function(require,module,exports){var indexOf=[].indexOf;module.exports=function(arr,obj){if(indexOf)return arr.indexOf(obj);for(var i=0;i0){this.__position-=1}};InputScanner.prototype.hasNext=function(){return this.__position=0&&index=0&&index=testVal.length&&this.__input.substring(start-testVal.length,start).toLowerCase()===testVal};module.exports.InputScanner=InputScanner},{}],106:[function(require,module,exports){"use strict";function Options(options,merge_child_field){this.raw_options=_mergeOpts(options,merge_child_field);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",true);this.max_preserve_newlines=this._get_number("max_preserve_newlines",32786);if(!this.preserve_newlines){this.max_preserve_newlines=0}this.indent_with_tabs=this._get_boolean("indent_with_tabs",this.indent_char==="\t");if(this.indent_with_tabs){this.indent_char="\t";if(this.indent_size===1){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"])}Options.prototype._get_array=function(name,default_value){var option_value=this.raw_options[name];var result=default_value||[];if(typeof option_value==="object"){if(option_value!==null&&typeof option_value.concat==="function"){result=option_value.concat()}}else if(typeof option_value==="string"){result=option_value.split(/[^a-zA-Z0-9_\/\-]+/)}return result};Options.prototype._get_boolean=function(name,default_value){var option_value=this.raw_options[name];var result=option_value===undefined?!!default_value:!!option_value;return result};Options.prototype._get_characters=function(name,default_value){var option_value=this.raw_options[name];var result=default_value||"";if(typeof option_value==="string"){result=option_value.replace(/\\r/,"\r").replace(/\\n/,"\n").replace(/\\t/,"\t")}return result};Options.prototype._get_number=function(name,default_value){var option_value=this.raw_options[name];default_value=parseInt(default_value,10);if(isNaN(default_value)){default_value=0}var result=parseInt(option_value,10);if(isNaN(result)){result=default_value}return result};Options.prototype._get_selection=function(name,selection_list,default_value){var result=this._get_selection_list(name,selection_list,default_value);if(result.length!==1){throw new Error("Invalid Option Value: The option '"+name+"' can only be one of the following values:\n"+selection_list+"\nYou passed in: '"+this.raw_options[name]+"'")}return result[0]};Options.prototype._get_selection_list=function(name,selection_list,default_value){if(!selection_list||selection_list.length===0){throw new Error("Selection list cannot be empty.")}default_value=default_value||[selection_list[0]];if(!this._is_valid_selection(default_value,selection_list)){throw new Error("Invalid Default Value!")}var result=this._get_array(name,default_value);if(!this._is_valid_selection(result,selection_list)){throw new Error("Invalid Option Value: The option '"+name+"' can contain only the following values:\n"+selection_list+"\nYou passed in: '"+this.raw_options[name]+"'")}return result};Options.prototype._is_valid_selection=function(result,selection_list){return result.length&&selection_list.length&&!result.some((function(item){return selection_list.indexOf(item)===-1}))};function _mergeOpts(allOptions,childFieldName){var finalOpts={};allOptions=_normalizeOpts(allOptions);var name;for(name in allOptions){if(name!==childFieldName){finalOpts[name]=allOptions[name]}}if(childFieldName&&allOptions[childFieldName]){for(name in allOptions[childFieldName]){finalOpts[name]=allOptions[childFieldName][name]}}return finalOpts}function _normalizeOpts(options){var convertedOpts={};var key;for(key in options){var newKey=key.replace(/-/g,"_");convertedOpts[newKey]=options[key]}return convertedOpts}module.exports.Options=Options;module.exports.normalizeOpts=_normalizeOpts;module.exports.mergeOpts=_mergeOpts},{}],107:[function(require,module,exports){"use strict";function OutputLine(parent){this.__parent=parent;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=[]}OutputLine.prototype.clone_empty=function(){var line=new OutputLine(this.__parent);line.set_indent(this.__indent_count,this.__alignment_count);return line};OutputLine.prototype.item=function(index){if(index<0){return this.__items[this.__items.length+index]}else{return this.__items[index]}};OutputLine.prototype.has_match=function(pattern){for(var lastCheckedOutput=this.__items.length-1;lastCheckedOutput>=0;lastCheckedOutput--){if(this.__items[lastCheckedOutput].match(pattern)){return true}}return false};OutputLine.prototype.set_indent=function(indent,alignment){if(this.is_empty()){this.__indent_count=indent||0;this.__alignment_count=alignment||0;this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count)}};OutputLine.prototype._set_wrap_point=function(){if(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}};OutputLine.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};OutputLine.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var next=this.__parent.current_line;next.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count);next.__items=this.__items.slice(this.__wrap_point_index);this.__items=this.__items.slice(0,this.__wrap_point_index);next.__character_count+=this.__character_count-this.__wrap_point_character_count;this.__character_count=this.__wrap_point_character_count;if(next.__items[0]===" "){next.__items.splice(0,1);next.__character_count-=1}return true}return false};OutputLine.prototype.is_empty=function(){return this.__items.length===0};OutputLine.prototype.last=function(){if(!this.is_empty()){return this.__items[this.__items.length-1]}else{return null}};OutputLine.prototype.push=function(item){this.__items.push(item);var last_newline_index=item.lastIndexOf("\n");if(last_newline_index!==-1){this.__character_count=item.length-last_newline_index}else{this.__character_count+=item.length}};OutputLine.prototype.pop=function(){var item=null;if(!this.is_empty()){item=this.__items.pop();this.__character_count-=item.length}return item};OutputLine.prototype._remove_indent=function(){if(this.__indent_count>0){this.__indent_count-=1;this.__character_count-=this.__parent.indent_size}};OutputLine.prototype._remove_wrap_indent=function(){if(this.__wrap_point_indent_count>0){this.__wrap_point_indent_count-=1}};OutputLine.prototype.trim=function(){while(this.last()===" "){this.__items.pop();this.__character_count-=1}};OutputLine.prototype.toString=function(){var result="";if(this.is_empty()){if(this.__parent.indent_empty_lines){result=this.__parent.get_indent_string(this.__indent_count)}}else{result=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count);result+=this.__items.join("")}return result};function IndentStringCache(options,baseIndentString){this.__cache=[""];this.__indent_size=options.indent_size;this.__indent_string=options.indent_char;if(!options.indent_with_tabs){this.__indent_string=new Array(options.indent_size+1).join(options.indent_char)}baseIndentString=baseIndentString||"";if(options.indent_level>0){baseIndentString=new Array(options.indent_level+1).join(this.__indent_string)}this.__base_string=baseIndentString;this.__base_string_length=baseIndentString.length}IndentStringCache.prototype.get_indent_size=function(indent,column){var result=this.__base_string_length;column=column||0;if(indent<0){result=0}result+=indent*this.__indent_size;result+=column;return result};IndentStringCache.prototype.get_indent_string=function(indent_level,column){var result=this.__base_string;column=column||0;if(indent_level<0){indent_level=0;result=""}column+=indent_level*this.__indent_size;this.__ensure_cache(column);result+=this.__cache[column];return result};IndentStringCache.prototype.__ensure_cache=function(column){while(column>=this.__cache.length){this.__add_column()}};IndentStringCache.prototype.__add_column=function(){var column=this.__cache.length;var indent=0;var result="";if(this.__indent_size&&column>=this.__indent_size){indent=Math.floor(column/this.__indent_size);column-=indent*this.__indent_size;result=new Array(indent+1).join(this.__indent_string)}if(column){result+=new Array(column+1).join(" ")}this.__cache.push(result)};function Output(options,baseIndentString){this.__indent_cache=new IndentStringCache(options,baseIndentString);this.raw=false;this._end_with_newline=options.end_with_newline;this.indent_size=options.indent_size;this.wrap_line_length=options.wrap_line_length;this.indent_empty_lines=options.indent_empty_lines;this.__lines=[];this.previous_line=null;this.current_line=null;this.next_line=new OutputLine(this);this.space_before_token=false;this.non_breaking_space=false;this.previous_token_wrapped=false;this.__add_outputline()}Output.prototype.__add_outputline=function(){this.previous_line=this.current_line;this.current_line=this.next_line.clone_empty();this.__lines.push(this.current_line)};Output.prototype.get_line_number=function(){return this.__lines.length};Output.prototype.get_indent_string=function(indent,column){return this.__indent_cache.get_indent_string(indent,column)};Output.prototype.get_indent_size=function(indent,column){return this.__indent_cache.get_indent_size(indent,column)};Output.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()};Output.prototype.add_new_line=function(force_newline){if(this.is_empty()||!force_newline&&this.just_added_newline()){return false}if(!this.raw){this.__add_outputline()}return true};Output.prototype.get_code=function(eol){this.trim(true);var last_item=this.current_line.pop();if(last_item){if(last_item[last_item.length-1]==="\n"){last_item=last_item.replace(/\n+$/g,"")}this.current_line.push(last_item)}if(this._end_with_newline){this.__add_outputline()}var sweet_code=this.__lines.join("\n");if(eol!=="\n"){sweet_code=sweet_code.replace(/[\n]/g,eol)}return sweet_code};Output.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()};Output.prototype.set_indent=function(indent,alignment){indent=indent||0;alignment=alignment||0;this.next_line.set_indent(indent,alignment);if(this.__lines.length>1){this.current_line.set_indent(indent,alignment);return true}this.current_line.set_indent();return false};Output.prototype.add_raw_token=function(token){for(var x=0;x1&&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};Output.prototype.just_added_newline=function(){return this.current_line.is_empty()};Output.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()};Output.prototype.ensure_empty_line_above=function(starts_with,ends_with){var index=this.__lines.length-2;while(index>=0){var potentialEmptyLine=this.__lines[index];if(potentialEmptyLine.is_empty()){break}else if(potentialEmptyLine.item(0).indexOf(starts_with)!==0&&potentialEmptyLine.item(-1)!==ends_with){this.__lines.splice(index+1,0,new OutputLine(this));this.previous_line=this.__lines[this.__lines.length-2];break}index--}};module.exports.Output=Output},{}],108:[function(require,module,exports){"use strict";function Pattern(input_scanner,parent){this._input=input_scanner;this._starting_pattern=null;this._match_pattern=null;this._until_pattern=null;this._until_after=false;if(parent){this._starting_pattern=this._input.get_regexp(parent._starting_pattern,true);this._match_pattern=this._input.get_regexp(parent._match_pattern,true);this._until_pattern=this._input.get_regexp(parent._until_pattern);this._until_after=parent._until_after}}Pattern.prototype.read=function(){var result=this._input.read(this._starting_pattern);if(!this._starting_pattern||result){result+=this._input.read(this._match_pattern,this._until_pattern,this._until_after)}return result};Pattern.prototype.read_match=function(){return this._input.match(this._match_pattern)};Pattern.prototype.until_after=function(pattern){var result=this._create();result._until_after=true;result._until_pattern=this._input.get_regexp(pattern);result._update();return result};Pattern.prototype.until=function(pattern){var result=this._create();result._until_after=false;result._until_pattern=this._input.get_regexp(pattern);result._update();return result};Pattern.prototype.starting_with=function(pattern){var result=this._create();result._starting_pattern=this._input.get_regexp(pattern,true);result._update();return result};Pattern.prototype.matching=function(pattern){var result=this._create();result._match_pattern=this._input.get_regexp(pattern,true);result._update();return result};Pattern.prototype._create=function(){return new Pattern(this._input,this)};Pattern.prototype._update=function(){};module.exports.Pattern=Pattern},{}],109:[function(require,module,exports){"use strict";var Pattern=require("./pattern").Pattern;var template_names={django:false,erb:false,handlebars:false,php:false,smarty:false};function TemplatablePattern(input_scanner,parent){Pattern.call(this,input_scanner,parent);this.__template_pattern=null;this._disabled=Object.assign({},template_names);this._excluded=Object.assign({},template_names);if(parent){this.__template_pattern=this._input.get_regexp(parent.__template_pattern);this._excluded=Object.assign(this._excluded,parent._excluded);this._disabled=Object.assign(this._disabled,parent._disabled)}var pattern=new Pattern(input_scanner);this.__patterns={handlebars_comment:pattern.starting_with(/{{!--/).until_after(/--}}/),handlebars_unescaped:pattern.starting_with(/{{{/).until_after(/}}}/),handlebars:pattern.starting_with(/{{/).until_after(/}}/),php:pattern.starting_with(/<\?(?:[= ]|php)/).until_after(/\?>/),erb:pattern.starting_with(/<%[^%]/).until_after(/[^%]%>/),django:pattern.starting_with(/{%/).until_after(/%}/),django_value:pattern.starting_with(/{{/).until_after(/}}/),django_comment:pattern.starting_with(/{#/).until_after(/#}/),smarty:pattern.starting_with(/{(?=[^}{\s\n])/).until_after(/[^\s\n]}/),smarty_comment:pattern.starting_with(/{\*/).until_after(/\*}/),smarty_literal:pattern.starting_with(/{literal}/).until_after(/{\/literal}/)}}TemplatablePattern.prototype=new Pattern;TemplatablePattern.prototype._create=function(){return new TemplatablePattern(this._input,this)};TemplatablePattern.prototype._update=function(){this.__set_templated_pattern()};TemplatablePattern.prototype.disable=function(language){var result=this._create();result._disabled[language]=true;result._update();return result};TemplatablePattern.prototype.read_options=function(options){var result=this._create();for(var language in template_names){result._disabled[language]=options.templating.indexOf(language)===-1}result._update();return result};TemplatablePattern.prototype.exclude=function(language){var result=this._create();result._excluded[language]=true;result._update();return result};TemplatablePattern.prototype.read=function(){var result="";if(this._match_pattern){result=this._input.read(this._starting_pattern)}else{result=this._input.read(this._starting_pattern,this.__template_pattern)}var next=this._read_template();while(next){if(this._match_pattern){next+=this._input.read(this._match_pattern)}else{next+=this._input.readUntil(this.__template_pattern)}result+=next;next=this._read_template()}if(this._until_after){result+=this._input.readUntilAfter(this._until_pattern)}return result};TemplatablePattern.prototype.__set_templated_pattern=function(){var items=[];if(!this._disabled.php){items.push(this.__patterns.php._starting_pattern.source)}if(!this._disabled.handlebars){items.push(this.__patterns.handlebars._starting_pattern.source)}if(!this._disabled.erb){items.push(this.__patterns.erb._starting_pattern.source)}if(!this._disabled.django){items.push(this.__patterns.django._starting_pattern.source);items.push(this.__patterns.django_value._starting_pattern.source);items.push(this.__patterns.django_comment._starting_pattern.source)}if(!this._disabled.smarty){items.push(this.__patterns.smarty._starting_pattern.source)}if(this._until_pattern){items.push(this._until_pattern.source)}this.__template_pattern=this._input.get_regexp("(?:"+items.join("|")+")")};TemplatablePattern.prototype._read_template=function(){var resulting_string="";var c=this._input.peek();if(c==="<"){var peek1=this._input.peek(1);if(!this._disabled.php&&!this._excluded.php&&peek1==="?"){resulting_string=resulting_string||this.__patterns.php.read()}if(!this._disabled.erb&&!this._excluded.erb&&peek1==="%"){resulting_string=resulting_string||this.__patterns.erb.read()}}else if(c==="{"){if(!this._disabled.handlebars&&!this._excluded.handlebars){resulting_string=resulting_string||this.__patterns.handlebars_comment.read();resulting_string=resulting_string||this.__patterns.handlebars_unescaped.read();resulting_string=resulting_string||this.__patterns.handlebars.read()}if(!this._disabled.django){if(!this._excluded.django&&!this._excluded.handlebars){resulting_string=resulting_string||this.__patterns.django_value.read()}if(!this._excluded.django){resulting_string=resulting_string||this.__patterns.django_comment.read();resulting_string=resulting_string||this.__patterns.django.read()}}if(!this._disabled.smarty){if(this._disabled.django&&this._disabled.handlebars){resulting_string=resulting_string||this.__patterns.smarty_comment.read();resulting_string=resulting_string||this.__patterns.smarty_literal.read();resulting_string=resulting_string||this.__patterns.smarty.read()}}}return resulting_string};module.exports.TemplatablePattern=TemplatablePattern},{"./pattern":108}],110:[function(require,module,exports){"use strict";function Token(type,text,newlines,whitespace_before){this.type=type;this.text=text;this.comments_before=null;this.newlines=newlines||0;this.whitespace_before=whitespace_before||"";this.parent=null;this.next=null;this.previous=null;this.opened=null;this.closed=null;this.directives=null}module.exports.Token=Token},{}],111:[function(require,module,exports){"use strict";var InputScanner=require("../core/inputscanner").InputScanner;var Token=require("../core/token").Token;var TokenStream=require("../core/tokenstream").TokenStream;var WhitespacePattern=require("./whitespacepattern").WhitespacePattern;var TOKEN={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"};var Tokenizer=function(input_string,options){this._input=new InputScanner(input_string);this._options=options||{};this.__tokens=null;this._patterns={};this._patterns.whitespace=new WhitespacePattern(this._input)};Tokenizer.prototype.tokenize=function(){this._input.restart();this.__tokens=new TokenStream;this._reset();var current;var previous=new Token(TOKEN.START,"");var open_token=null;var open_stack=[];var comments=new TokenStream;while(previous.type!==TOKEN.EOF){current=this._get_next_token(previous,open_token);while(this._is_comment(current)){comments.add(current);current=this._get_next_token(previous,open_token)}if(!comments.isEmpty()){current.comments_before=comments;comments=new TokenStream}current.parent=open_token;if(this._is_opening(current)){open_stack.push(open_token);open_token=current}else if(open_token&&this._is_closing(current,open_token)){current.opened=open_token;open_token.closed=current;open_token=open_stack.pop();current.parent=open_token}current.previous=previous;previous.next=current;this.__tokens.add(current);previous=current}return this.__tokens};Tokenizer.prototype._is_first_token=function(){return this.__tokens.isEmpty()};Tokenizer.prototype._reset=function(){};Tokenizer.prototype._get_next_token=function(previous_token,open_token){this._readWhitespace();var resulting_string=this._input.read(/.+/g);if(resulting_string){return this._create_token(TOKEN.RAW,resulting_string)}else{return this._create_token(TOKEN.EOF,"")}};Tokenizer.prototype._is_comment=function(current_token){return false};Tokenizer.prototype._is_opening=function(current_token){return false};Tokenizer.prototype._is_closing=function(current_token,open_token){return false};Tokenizer.prototype._create_token=function(type,text){var token=new Token(type,text,this._patterns.whitespace.newline_count,this._patterns.whitespace.whitespace_before_token);return token};Tokenizer.prototype._readWhitespace=function(){return this._patterns.whitespace.read()};module.exports.Tokenizer=Tokenizer;module.exports.TOKEN=TOKEN},{"../core/inputscanner":105,"../core/token":110,"../core/tokenstream":112,"./whitespacepattern":113}],112:[function(require,module,exports){"use strict";function TokenStream(parent_token){this.__tokens=[];this.__tokens_length=this.__tokens.length;this.__position=0;this.__parent_token=parent_token}TokenStream.prototype.restart=function(){this.__position=0};TokenStream.prototype.isEmpty=function(){return this.__tokens_length===0};TokenStream.prototype.hasNext=function(){return this.__position=0&&index0){this._indentLevel--}};Beautifier.prototype.beautify=function(){if(this._options.disabled){return this._source_text}var source_text=this._source_text;var eol=this._options.eol;if(eol==="auto"){eol="\n";if(source_text&&lineBreak.test(source_text||"")){eol=source_text.match(lineBreak)[0]}}source_text=source_text.replace(allLineBreaks,"\n");var baseIndentString=source_text.match(/^[\t ]*/)[0];this._output=new Output(this._options,baseIndentString);this._input=new InputScanner(source_text);this._indentLevel=0;this._nestedLevel=0;this._ch=null;var parenLevel=0;var insideRule=false;var insidePropertyValue=false;var enteringConditionalGroup=false;var insideNonNestedAtRule=false;var insideScssMap=false;var topCharacter=this._ch;var insideNonSemiColonValues=false;var whitespace;var isAfterSpace;var previous_ch;while(true){whitespace=this._input.read(whitespacePattern);isAfterSpace=whitespace!=="";previous_ch=topCharacter;this._ch=this._input.next();if(this._ch==="\\"&&this._input.hasNext()){this._ch+=this._input.next()}topCharacter=this._ch;if(!this._ch){break}else if(this._ch==="/"&&this._input.peek()==="*"){this._output.add_new_line();this._input.back();var comment=this._input.read(block_comment_pattern);var directives=directives_core.get_directives(comment);if(directives&&directives.ignore==="start"){comment+=directives_core.readIgnored(this._input)}this.print_string(comment);this.eatWhitespace(true);this._output.add_new_line()}else if(this._ch==="/"&&this._input.peek()==="/"){this._output.space_before_token=true;this._input.back();this.print_string(this._input.read(comment_pattern));this.eatWhitespace(true)}else if(this._ch==="$"){this.preserveSingleSpace(isAfterSpace);this.print_string(this._ch);var variable=this._input.peekUntilAfter(/[: ,;{}()[\]\/='"]/g);if(variable.match(/[ :]$/)){variable=this.eatString(": ").replace(/\s$/,"");this.print_string(variable);this._output.space_before_token=true}variable=variable.replace(/\s$/,"");if(parenLevel===0&&variable.indexOf(":")!==-1){insidePropertyValue=true;this.indent()}}else if(this._ch==="@"){this.preserveSingleSpace(isAfterSpace);if(this._input.peek()==="{"){this.print_string(this._ch+this.eatString("}"))}else{this.print_string(this._ch);var variableOrRule=this._input.peekUntilAfter(/[: ,;{}()[\]\/='"]/g);if(variableOrRule.match(/[ :]$/)){variableOrRule=this.eatString(": ").replace(/\s$/,"");this.print_string(variableOrRule);this._output.space_before_token=true}variableOrRule=variableOrRule.replace(/\s$/,"");if(parenLevel===0&&variableOrRule.indexOf(":")!==-1){insidePropertyValue=true;this.indent()}else if(variableOrRule in this.NESTED_AT_RULE){this._nestedLevel+=1;if(variableOrRule in this.CONDITIONAL_GROUP_RULE){enteringConditionalGroup=true}}else if(parenLevel===0&&!insidePropertyValue){insideNonNestedAtRule=true}}}else if(this._ch==="#"&&this._input.peek()==="{"){this.preserveSingleSpace(isAfterSpace);this.print_string(this._ch+this.eatString("}"))}else if(this._ch==="{"){if(insidePropertyValue){insidePropertyValue=false;this.outdent()}insideNonNestedAtRule=false;if(enteringConditionalGroup){enteringConditionalGroup=false;insideRule=this._indentLevel>=this._nestedLevel}else{insideRule=this._indentLevel>=this._nestedLevel-1}if(this._options.newline_between_rules&&insideRule){if(this._output.previous_line&&this._output.previous_line.item(-1)!=="{"){this._output.ensure_empty_line_above("/",",")}}this._output.space_before_token=true;if(this._options.brace_style==="expand"){this._output.add_new_line();this.print_string(this._ch);this.indent();this._output.set_indent(this._indentLevel)}else{if(previous_ch==="("){this._output.space_before_token=false}else if(previous_ch!==","){this.indent()}this.print_string(this._ch)}this.eatWhitespace(true);this._output.add_new_line()}else if(this._ch==="}"){this.outdent();this._output.add_new_line();if(previous_ch==="{"){this._output.trim(true)}if(insidePropertyValue){this.outdent();insidePropertyValue=false}this.print_string(this._ch);insideRule=false;if(this._nestedLevel){this._nestedLevel--}this.eatWhitespace(true);this._output.add_new_line();if(this._options.newline_between_rules&&!this._output.just_added_blankline()){if(this._input.peek()!=="}"){this._output.add_new_line(true)}}if(this._input.peek()===")"){this._output.trim(true);if(this._options.brace_style==="expand"){this._output.add_new_line(true)}}}else if(this._ch===":"){for(var i=0;i"||this._ch==="+"||this._ch==="~")&&!insidePropertyValue&&parenLevel===0){if(this._options.space_around_combinator){this._output.space_before_token=true;this.print_string(this._ch);this._output.space_before_token=true}else{this.print_string(this._ch);this.eatWhitespace();if(this._ch&&whitespaceChar.test(this._ch)){this._ch=""}}}else if(this._ch==="]"){this.print_string(this._ch)}else if(this._ch==="["){this.preserveSingleSpace(isAfterSpace);this.print_string(this._ch)}else if(this._ch==="="){this.eatWhitespace();this.print_string("=");if(whitespaceChar.test(this._ch)){this._ch=""}}else if(this._ch==="!"&&!this._input.lookBack("\\")){this._output.space_before_token=true;this.print_string(this._ch)}else{var preserveAfterSpace=previous_ch==='"'||previous_ch==="'";this.preserveSingleSpace(preserveAfterSpace||isAfterSpace);this.print_string(this._ch);if(!this._output.just_added_newline()&&this._input.peek()==="\n"&&insideNonSemiColonValues){this._output.add_new_line()}}}var sweetCode=this._output.get_code(eol);return sweetCode};module.exports.Beautifier=Beautifier},{"../core/directives":104,"../core/inputscanner":105,"../core/output":107,"./options":116}],115:[function(require,module,exports){"use strict";var Beautifier=require("./beautifier").Beautifier,Options=require("./options").Options;function css_beautify(source_text,options){var beautifier=new Beautifier(source_text,options);return beautifier.beautify()}module.exports=css_beautify;module.exports.defaultOptions=function(){return new Options}},{"./beautifier":114,"./options":116}],116:[function(require,module,exports){"use strict";var BaseOptions=require("../core/options").Options;function Options(options){BaseOptions.call(this,options,"css");this.selector_separator_newline=this._get_boolean("selector_separator_newline",true);this.newline_between_rules=this._get_boolean("newline_between_rules",true);var space_around_selector_separator=this._get_boolean("space_around_selector_separator");this.space_around_combinator=this._get_boolean("space_around_combinator")||space_around_selector_separator;var brace_style_split=this._get_selection_list("brace_style",["collapse","expand","end-expand","none","preserve-inline"]);this.brace_style="collapse";for(var bs=0;bs0)}return newlines!==0};Printer.prototype.traverse_whitespace=function(raw_token){if(raw_token.whitespace_before||raw_token.newlines){if(!this.print_preserved_newlines(raw_token)){this._output.space_before_token=true}return true}return false};Printer.prototype.previous_token_wrapped=function(){return this._output.previous_token_wrapped};Printer.prototype.print_newline=function(force){this._output.add_new_line(force)};Printer.prototype.print_token=function(token){if(token.text){this._output.set_indent(this.indent_level,this.alignment_size);this._output.add_token(token.text)}};Printer.prototype.indent=function(){this.indent_level++};Printer.prototype.get_full_indent=function(level){level=this.indent_level+(level||0);if(level<1){return""}return this._output.get_indent_string(level)};var get_type_attribute=function(start_token){var result=null;var raw_token=start_token.next;while(raw_token.type!==TOKEN.EOF&&start_token.closed!==raw_token){if(raw_token.type===TOKEN.ATTRIBUTE&&raw_token.text==="type"){if(raw_token.next&&raw_token.next.type===TOKEN.EQUALS&&raw_token.next.next&&raw_token.next.next.type===TOKEN.VALUE){result=raw_token.next.next.text}break}raw_token=raw_token.next}return result};var get_custom_beautifier_name=function(tag_check,raw_token){var typeAttribute=null;var result=null;if(!raw_token.closed){return null}if(tag_check==="script"){typeAttribute="text/javascript"}else if(tag_check==="style"){typeAttribute="text/css"}typeAttribute=get_type_attribute(raw_token)||typeAttribute;if(typeAttribute.search("text/css")>-1){result="css"}else if(typeAttribute.search(/module|((text|application|dojo)\/(x-)?(javascript|ecmascript|jscript|livescript|(ld\+)?json|method|aspect))/)>-1){result="javascript"}else if(typeAttribute.search(/(text|application|dojo)\/(x-)?(html)/)>-1){result="html"}else if(typeAttribute.search(/test\/null/)>-1){result="null"}return result};function in_array(what,arr){return arr.indexOf(what)!==-1}function TagFrame(parent,parser_token,indent_level){this.parent=parent||null;this.tag=parser_token?parser_token.tag_name:"";this.indent_level=indent_level||0;this.parser_token=parser_token||null}function TagStack(printer){this._printer=printer;this._current_frame=null}TagStack.prototype.get_parser_token=function(){return this._current_frame?this._current_frame.parser_token:null};TagStack.prototype.record_tag=function(parser_token){var new_frame=new TagFrame(this._current_frame,parser_token,this._printer.indent_level);this._current_frame=new_frame};TagStack.prototype._try_pop_frame=function(frame){var parser_token=null;if(frame){parser_token=frame.parser_token;this._printer.indent_level=frame.indent_level;this._current_frame=frame.parent}return parser_token};TagStack.prototype._get_frame=function(tag_list,stop_list){var frame=this._current_frame;while(frame){if(tag_list.indexOf(frame.tag)!==-1){break}else if(stop_list&&stop_list.indexOf(frame.tag)!==-1){frame=null;break}frame=frame.parent}return frame};TagStack.prototype.try_pop=function(tag,stop_list){var frame=this._get_frame([tag],stop_list);return this._try_pop_frame(frame)};TagStack.prototype.indent_to_tag=function(tag_list){var frame=this._get_frame(tag_list);if(frame){this._printer.indent_level=frame.indent_level}};function Beautifier(source_text,options,js_beautify,css_beautify){this._source_text=source_text||"";options=options||{};this._js_beautify=js_beautify;this._css_beautify=css_beautify;this._tag_stack=null;var optionHtml=new Options(options,"html");this._options=optionHtml;this._is_wrap_attributes_force=this._options.wrap_attributes.substr(0,"force".length)==="force";this._is_wrap_attributes_force_expand_multiline=this._options.wrap_attributes==="force-expand-multiline";this._is_wrap_attributes_force_aligned=this._options.wrap_attributes==="force-aligned";this._is_wrap_attributes_aligned_multiple=this._options.wrap_attributes==="aligned-multiple";this._is_wrap_attributes_preserve=this._options.wrap_attributes.substr(0,"preserve".length)==="preserve";this._is_wrap_attributes_preserve_aligned=this._options.wrap_attributes==="preserve-aligned"}Beautifier.prototype.beautify=function(){if(this._options.disabled){return this._source_text}var source_text=this._source_text;var eol=this._options.eol;if(this._options.eol==="auto"){eol="\n";if(source_text&&lineBreak.test(source_text)){eol=source_text.match(lineBreak)[0]}}source_text=source_text.replace(allLineBreaks,"\n");var baseIndentString=source_text.match(/^[\t ]*/)[0];var last_token={text:"",type:""};var last_tag_token=new TagOpenParserToken;var printer=new Printer(this._options,baseIndentString);var tokens=new Tokenizer(source_text,this._options).tokenize();this._tag_stack=new TagStack(printer);var parser_token=null;var raw_token=tokens.next();while(raw_token.type!==TOKEN.EOF){if(raw_token.type===TOKEN.TAG_OPEN||raw_token.type===TOKEN.COMMENT){parser_token=this._handle_tag_open(printer,raw_token,last_tag_token,last_token,tokens);last_tag_token=parser_token}else if(raw_token.type===TOKEN.ATTRIBUTE||raw_token.type===TOKEN.EQUALS||raw_token.type===TOKEN.VALUE||raw_token.type===TOKEN.TEXT&&!last_tag_token.tag_complete){parser_token=this._handle_inside_tag(printer,raw_token,last_tag_token,last_token)}else if(raw_token.type===TOKEN.TAG_CLOSE){parser_token=this._handle_tag_close(printer,raw_token,last_tag_token)}else if(raw_token.type===TOKEN.TEXT){parser_token=this._handle_text(printer,raw_token,last_tag_token)}else{printer.add_raw_token(raw_token)}last_token=parser_token;raw_token=tokens.next()}var sweet_code=printer._output.get_code(eol);return sweet_code};Beautifier.prototype._handle_tag_close=function(printer,raw_token,last_tag_token){var parser_token={text:raw_token.text,type:raw_token.type};printer.alignment_size=0;last_tag_token.tag_complete=true;printer.set_space_before_token(raw_token.newlines||raw_token.whitespace_before!=="",true);if(last_tag_token.is_unformatted){printer.add_raw_token(raw_token)}else{if(last_tag_token.tag_start_char==="<"){printer.set_space_before_token(raw_token.text[0]==="/",true);if(this._is_wrap_attributes_force_expand_multiline&&last_tag_token.has_wrapped_attrs){printer.print_newline(false)}}printer.print_token(raw_token)}if(last_tag_token.indent_content&&!(last_tag_token.is_unformatted||last_tag_token.is_content_unformatted)){printer.indent();last_tag_token.indent_content=false}if(!last_tag_token.is_inline_element&&!(last_tag_token.is_unformatted||last_tag_token.is_content_unformatted)){printer.set_wrap_point()}return parser_token};Beautifier.prototype._handle_inside_tag=function(printer,raw_token,last_tag_token,last_token){var wrapped=last_tag_token.has_wrapped_attrs;var parser_token={text:raw_token.text,type:raw_token.type};printer.set_space_before_token(raw_token.newlines||raw_token.whitespace_before!=="",true);if(last_tag_token.is_unformatted){printer.add_raw_token(raw_token)}else if(last_tag_token.tag_start_char==="{"&&raw_token.type===TOKEN.TEXT){if(printer.print_preserved_newlines(raw_token)){raw_token.newlines=0;printer.add_raw_token(raw_token)}else{printer.print_token(raw_token)}}else{if(raw_token.type===TOKEN.ATTRIBUTE){printer.set_space_before_token(true)}else if(raw_token.type===TOKEN.EQUALS){printer.set_space_before_token(false)}else if(raw_token.type===TOKEN.VALUE&&raw_token.previous.type===TOKEN.EQUALS){printer.set_space_before_token(false)}if(raw_token.type===TOKEN.ATTRIBUTE&&last_tag_token.tag_start_char==="<"){if(this._is_wrap_attributes_preserve||this._is_wrap_attributes_preserve_aligned){printer.traverse_whitespace(raw_token);wrapped=wrapped||raw_token.newlines!==0}if(this._is_wrap_attributes_force&&last_tag_token.attr_count>=this._options.wrap_attributes_min_attrs&&(last_token.type!==TOKEN.TAG_OPEN||this._is_wrap_attributes_force_expand_multiline)){printer.print_newline(false);wrapped=true}}printer.print_token(raw_token);wrapped=wrapped||printer.previous_token_wrapped();last_tag_token.has_wrapped_attrs=wrapped}return parser_token};Beautifier.prototype._handle_text=function(printer,raw_token,last_tag_token){var parser_token={text:raw_token.text,type:"TK_CONTENT"};if(last_tag_token.custom_beautifier_name){this._print_custom_beatifier_text(printer,raw_token,last_tag_token)}else if(last_tag_token.is_unformatted||last_tag_token.is_content_unformatted){printer.add_raw_token(raw_token)}else{printer.traverse_whitespace(raw_token);printer.print_token(raw_token)}return parser_token};Beautifier.prototype._print_custom_beatifier_text=function(printer,raw_token,last_tag_token){var local=this;if(raw_token.text!==""){var text=raw_token.text,_beautifier,script_indent_level=1,pre="",post="";if(last_tag_token.custom_beautifier_name==="javascript"&&typeof this._js_beautify==="function"){_beautifier=this._js_beautify}else if(last_tag_token.custom_beautifier_name==="css"&&typeof this._css_beautify==="function"){_beautifier=this._css_beautify}else if(last_tag_token.custom_beautifier_name==="html"){_beautifier=function(html_source,options){var beautifier=new Beautifier(html_source,options,local._js_beautify,local._css_beautify);return beautifier.beautify()}}if(this._options.indent_scripts==="keep"){script_indent_level=0}else if(this._options.indent_scripts==="separate"){script_indent_level=-printer.indent_level}var indentation=printer.get_full_indent(script_indent_level);text=text.replace(/\n[ \t]*$/,"");if(last_tag_token.custom_beautifier_name!=="html"&&text[0]==="<"&&text.match(/^(|]]>)$/.exec(text);if(!matched){printer.add_raw_token(raw_token);return}pre=indentation+matched[1]+"\n";text=matched[4];if(matched[5]){post=indentation+matched[5]}text=text.replace(/\n[ \t]*$/,"");if(matched[2]||matched[3].indexOf("\n")!==-1){matched=matched[3].match(/[ \t]+$/);if(matched){raw_token.whitespace_before=matched[0]}}}if(text){if(_beautifier){var Child_options=function(){this.eol="\n"};Child_options.prototype=this._options.raw_options;var child_options=new Child_options;text=_beautifier(indentation+text,child_options)}else{var white=raw_token.whitespace_before;if(white){text=text.replace(new RegExp("\n("+white+")?","g"),"\n")}text=indentation+text.replace(/\n/g,"\n"+indentation)}}if(pre){if(!text){text=pre+post}else{text=pre+text+"\n"+post}}printer.print_newline(false);if(text){raw_token.text=text;raw_token.whitespace_before="";raw_token.newlines=0;printer.add_raw_token(raw_token);printer.print_newline(true)}}};Beautifier.prototype._handle_tag_open=function(printer,raw_token,last_tag_token,last_token,tokens){var parser_token=this._get_tag_open_token(raw_token);if((last_tag_token.is_unformatted||last_tag_token.is_content_unformatted)&&!last_tag_token.is_empty_element&&raw_token.type===TOKEN.TAG_OPEN&&!parser_token.is_start_tag){printer.add_raw_token(raw_token);parser_token.start_tag_token=this._tag_stack.try_pop(parser_token.tag_name)}else{printer.traverse_whitespace(raw_token);this._set_tag_position(printer,raw_token,parser_token,last_tag_token,last_token);if(!parser_token.is_inline_element){printer.set_wrap_point()}printer.print_token(raw_token)}if(parser_token.is_start_tag&&this._is_wrap_attributes_force){var peek_index=0;var peek_token;do{peek_token=tokens.peek(peek_index);if(peek_token.type===TOKEN.ATTRIBUTE){parser_token.attr_count+=1}peek_index+=1}while(peek_token.type!==TOKEN.EOF&&peek_token.type!==TOKEN.TAG_CLOSE)}if(this._is_wrap_attributes_force_aligned||this._is_wrap_attributes_aligned_multiple||this._is_wrap_attributes_preserve_aligned){parser_token.alignment_size=raw_token.text.length+1}if(!parser_token.tag_complete&&!parser_token.is_unformatted){printer.alignment_size=parser_token.alignment_size}return parser_token};var TagOpenParserToken=function(parent,raw_token){this.parent=parent||null;this.text="";this.type="TK_TAG_OPEN";this.tag_name="";this.is_inline_element=false;this.is_unformatted=false;this.is_content_unformatted=false;this.is_empty_element=false;this.is_start_tag=false;this.is_end_tag=false;this.indent_content=false;this.multiline_content=false;this.custom_beautifier_name=null;this.start_tag_token=null;this.attr_count=0;this.has_wrapped_attrs=false;this.alignment_size=0;this.tag_complete=false;this.tag_start_char="";this.tag_check="";if(!raw_token){this.tag_complete=true}else{var tag_check_match;this.tag_start_char=raw_token.text[0];this.text=raw_token.text;if(this.tag_start_char==="<"){tag_check_match=raw_token.text.match(/^<([^\s>]*)/);this.tag_check=tag_check_match?tag_check_match[1]:""}else{tag_check_match=raw_token.text.match(/^{{~?(?:[\^]|#\*?)?([^\s}]+)/);this.tag_check=tag_check_match?tag_check_match[1]:"";if((raw_token.text.startsWith("{{#>")||raw_token.text.startsWith("{{~#>"))&&this.tag_check[0]===">"){if(this.tag_check===">"&&raw_token.next!==null){this.tag_check=raw_token.next.text.split(" ")[0]}else{this.tag_check=raw_token.text.split(">")[1]}}}this.tag_check=this.tag_check.toLowerCase();if(raw_token.type===TOKEN.COMMENT){this.tag_complete=true}this.is_start_tag=this.tag_check.charAt(0)!=="/";this.tag_name=!this.is_start_tag?this.tag_check.substr(1):this.tag_check;this.is_end_tag=!this.is_start_tag||raw_token.closed&&raw_token.closed.text==="/>";var handlebar_starts=2;if(this.tag_start_char==="{"&&this.text.length>=3){if(this.text.charAt(2)==="~"){handlebar_starts=3}}this.is_end_tag=this.is_end_tag||this.tag_start_char==="{"&&(this.text.length<3||/[^#\^]/.test(this.text.charAt(handlebar_starts)))}};Beautifier.prototype._get_tag_open_token=function(raw_token){var parser_token=new TagOpenParserToken(this._tag_stack.get_parser_token(),raw_token);parser_token.alignment_size=this._options.wrap_attributes_indent_size;parser_token.is_end_tag=parser_token.is_end_tag||in_array(parser_token.tag_check,this._options.void_elements);parser_token.is_empty_element=parser_token.tag_complete||parser_token.is_start_tag&&parser_token.is_end_tag;parser_token.is_unformatted=!parser_token.tag_complete&&in_array(parser_token.tag_check,this._options.unformatted);parser_token.is_content_unformatted=!parser_token.is_empty_element&&in_array(parser_token.tag_check,this._options.content_unformatted);parser_token.is_inline_element=in_array(parser_token.tag_name,this._options.inline)||parser_token.tag_name.includes("-")||parser_token.tag_start_char==="{";return parser_token};Beautifier.prototype._set_tag_position=function(printer,raw_token,parser_token,last_tag_token,last_token){if(!parser_token.is_empty_element){if(parser_token.is_end_tag){parser_token.start_tag_token=this._tag_stack.try_pop(parser_token.tag_name)}else{if(this._do_optional_end_element(parser_token)){if(!parser_token.is_inline_element){printer.print_newline(false)}}this._tag_stack.record_tag(parser_token);if((parser_token.tag_name==="script"||parser_token.tag_name==="style")&&!(parser_token.is_unformatted||parser_token.is_content_unformatted)){parser_token.custom_beautifier_name=get_custom_beautifier_name(parser_token.tag_check,raw_token)}}}if(in_array(parser_token.tag_check,this._options.extra_liners)){printer.print_newline(false);if(!printer._output.just_added_blankline()){printer.print_newline(true)}}if(parser_token.is_empty_element){if(parser_token.tag_start_char==="{"&&parser_token.tag_check==="else"){this._tag_stack.indent_to_tag(["if","unless","each"]);parser_token.indent_content=true;var foundIfOnCurrentLine=printer.current_line_has_match(/{{#if/);if(!foundIfOnCurrentLine){printer.print_newline(false)}}if(parser_token.tag_name==="!--"&&last_token.type===TOKEN.TAG_CLOSE&&last_tag_token.is_end_tag&&parser_token.text.indexOf("\n")===-1){}else{if(!(parser_token.is_inline_element||parser_token.is_unformatted)){printer.print_newline(false)}this._calcluate_parent_multiline(printer,parser_token)}}else if(parser_token.is_end_tag){var do_end_expand=false;do_end_expand=parser_token.start_tag_token&&parser_token.start_tag_token.multiline_content;do_end_expand=do_end_expand||!parser_token.is_inline_element&&!(last_tag_token.is_inline_element||last_tag_token.is_unformatted)&&!(last_token.type===TOKEN.TAG_CLOSE&&parser_token.start_tag_token===last_tag_token)&&last_token.type!=="TK_CONTENT";if(parser_token.is_content_unformatted||parser_token.is_unformatted){do_end_expand=false}if(do_end_expand){printer.print_newline(false)}}else{parser_token.indent_content=!parser_token.custom_beautifier_name;if(parser_token.tag_start_char==="<"){if(parser_token.tag_name==="html"){parser_token.indent_content=this._options.indent_inner_html}else if(parser_token.tag_name==="head"){parser_token.indent_content=this._options.indent_head_inner_html}else if(parser_token.tag_name==="body"){parser_token.indent_content=this._options.indent_body_inner_html}}if(!(parser_token.is_inline_element||parser_token.is_unformatted)&&(last_token.type!=="TK_CONTENT"||parser_token.is_content_unformatted)){printer.print_newline(false)}this._calcluate_parent_multiline(printer,parser_token)}};Beautifier.prototype._calcluate_parent_multiline=function(printer,parser_token){if(parser_token.parent&&printer._output.just_added_newline()&&!((parser_token.is_inline_element||parser_token.is_unformatted)&&parser_token.parent.is_inline_element)){parser_token.parent.multiline_content=true}};var p_closers=["address","article","aside","blockquote","details","div","dl","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hr","main","menu","nav","ol","p","pre","section","table","ul"];var p_parent_excludes=["a","audio","del","ins","map","noscript","video"];Beautifier.prototype._do_optional_end_element=function(parser_token){var result=null;if(parser_token.is_empty_element||!parser_token.is_start_tag||!parser_token.parent){return}if(parser_token.tag_name==="body"){result=result||this._tag_stack.try_pop("head")}else if(parser_token.tag_name==="li"){result=result||this._tag_stack.try_pop("li",["ol","ul","menu"])}else if(parser_token.tag_name==="dd"||parser_token.tag_name==="dt"){result=result||this._tag_stack.try_pop("dt",["dl"]);result=result||this._tag_stack.try_pop("dd",["dl"])}else if(parser_token.parent.tag_name==="p"&&p_closers.indexOf(parser_token.tag_name)!==-1){var p_parent=parser_token.parent.parent;if(!p_parent||p_parent_excludes.indexOf(p_parent.tag_name)===-1){result=result||this._tag_stack.try_pop("p")}}else if(parser_token.tag_name==="rp"||parser_token.tag_name==="rt"){result=result||this._tag_stack.try_pop("rt",["ruby","rtc"]);result=result||this._tag_stack.try_pop("rp",["ruby","rtc"])}else if(parser_token.tag_name==="optgroup"){result=result||this._tag_stack.try_pop("optgroup",["select"])}else if(parser_token.tag_name==="option"){result=result||this._tag_stack.try_pop("option",["select","datalist","optgroup"])}else if(parser_token.tag_name==="colgroup"){result=result||this._tag_stack.try_pop("caption",["table"])}else if(parser_token.tag_name==="thead"){result=result||this._tag_stack.try_pop("caption",["table"]);result=result||this._tag_stack.try_pop("colgroup",["table"])}else if(parser_token.tag_name==="tbody"||parser_token.tag_name==="tfoot"){result=result||this._tag_stack.try_pop("caption",["table"]);result=result||this._tag_stack.try_pop("colgroup",["table"]);result=result||this._tag_stack.try_pop("thead",["table"]);result=result||this._tag_stack.try_pop("tbody",["table"])}else if(parser_token.tag_name==="tr"){result=result||this._tag_stack.try_pop("caption",["table"]);result=result||this._tag_stack.try_pop("colgroup",["table"]);result=result||this._tag_stack.try_pop("tr",["table","thead","tbody","tfoot"])}else if(parser_token.tag_name==="th"||parser_token.tag_name==="td"){result=result||this._tag_stack.try_pop("td",["table","thead","tbody","tfoot","tr"]);result=result||this._tag_stack.try_pop("th",["table","thead","tbody","tfoot","tr"])}parser_token.parent=this._tag_stack.get_parser_token();return result};module.exports.Beautifier=Beautifier},{"../core/output":107,"../html/options":119,"../html/tokenizer":120}],118:[function(require,module,exports){"use strict";var Beautifier=require("./beautifier").Beautifier,Options=require("./options").Options;function style_html(html_source,options,js_beautify,css_beautify){var beautifier=new Beautifier(html_source,options,js_beautify,css_beautify);return beautifier.beautify()}module.exports=style_html;module.exports.defaultOptions=function(){return new Options}},{"./beautifier":117,"./options":119}],119:[function(require,module,exports){"use strict";var BaseOptions=require("../core/options").Options;function Options(options){BaseOptions.call(this,options,"html");if(this.templating.length===1&&this.templating[0]==="auto"){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",true);this.indent_head_inner_html=this._get_boolean("indent_head_inner_html",true);this.indent_handlebars=this._get_boolean("indent_handlebars",true);this.wrap_attributes=this._get_selection("wrap_attributes",["auto","force","force-aligned","force-expand-multiline","aligned-multiple","preserve","preserve-aligned"]);this.wrap_attributes_min_attrs=this._get_number("wrap_attributes_min_attrs",2);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"])}Options.prototype=new BaseOptions;module.exports.Options=Options},{"../core/options":106}],120:[function(require,module,exports){"use strict";var BaseTokenizer=require("../core/tokenizer").Tokenizer;var BASETOKEN=require("../core/tokenizer").TOKEN;var Directives=require("../core/directives").Directives;var TemplatablePattern=require("../core/templatablepattern").TemplatablePattern;var Pattern=require("../core/pattern").Pattern;var TOKEN={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:BASETOKEN.START,RAW:BASETOKEN.RAW,EOF:BASETOKEN.EOF};var directives_core=new Directives(/<\!--/,/-->/);var Tokenizer=function(input_string,options){BaseTokenizer.call(this,input_string,options);this._current_tag_name="";var templatable_reader=new TemplatablePattern(this._input).read_options(this._options);var pattern_reader=new Pattern(this._input);this.__patterns={word:templatable_reader.until(/[\n\r\t <]/),single_quote:templatable_reader.until_after(/'/),double_quote:templatable_reader.until_after(/"/),attribute:templatable_reader.until(/[\n\r\t =>]|\/>/),element_name:templatable_reader.until(/[\n\r\t >\/]/),handlebars_comment:pattern_reader.starting_with(/{{!--/).until_after(/--}}/),handlebars:pattern_reader.starting_with(/{{/).until_after(/}}/),handlebars_open:pattern_reader.until(/[\n\r\t }]/),handlebars_raw_close:pattern_reader.until(/}}/),comment:pattern_reader.starting_with(//),cdata:pattern_reader.starting_with(//),conditional_comment:pattern_reader.starting_with(//),processing:pattern_reader.starting_with(/<\?/).until_after(/\?>/)};if(this._options.indent_handlebars){this.__patterns.word=this.__patterns.word.exclude("handlebars")}this._unformatted_content_delimiter=null;if(this._options.unformatted_content_delimiter){var literal_regexp=this._input.get_literal_regexp(this._options.unformatted_content_delimiter);this.__patterns.unformatted_content_delimiter=pattern_reader.matching(literal_regexp).until_after(literal_regexp)}};Tokenizer.prototype=new BaseTokenizer;Tokenizer.prototype._is_comment=function(current_token){return false};Tokenizer.prototype._is_opening=function(current_token){return current_token.type===TOKEN.TAG_OPEN};Tokenizer.prototype._is_closing=function(current_token,open_token){return current_token.type===TOKEN.TAG_CLOSE&&(open_token&&((current_token.text===">"||current_token.text==="/>")&&open_token.text[0]==="<"||current_token.text==="}}"&&open_token.text[0]==="{"&&open_token.text[1]==="{"))};Tokenizer.prototype._reset=function(){this._current_tag_name=""};Tokenizer.prototype._get_next_token=function(previous_token,open_token){var token=null;this._readWhitespace();var c=this._input.peek();if(c===null){return this._create_token(TOKEN.EOF,"")}token=token||this._read_open_handlebars(c,open_token);token=token||this._read_attribute(c,previous_token,open_token);token=token||this._read_close(c,open_token);token=token||this._read_raw_content(c,previous_token,open_token);token=token||this._read_content_word(c);token=token||this._read_comment_or_cdata(c);token=token||this._read_processing(c);token=token||this._read_open(c,open_token);token=token||this._create_token(TOKEN.UNKNOWN,this._input.next());return token};Tokenizer.prototype._read_comment_or_cdata=function(c){var token=null;var resulting_string=null;var directives=null;if(c==="<"){var peek1=this._input.peek(1);if(peek1==="!"){resulting_string=this.__patterns.comment.read();if(resulting_string){directives=directives_core.get_directives(resulting_string);if(directives&&directives.ignore==="start"){resulting_string+=directives_core.readIgnored(this._input)}}else{resulting_string=this.__patterns.cdata.read()}}if(resulting_string){token=this._create_token(TOKEN.COMMENT,resulting_string);token.directives=directives}}return token};Tokenizer.prototype._read_processing=function(c){var token=null;var resulting_string=null;var directives=null;if(c==="<"){var peek1=this._input.peek(1);if(peek1==="!"||peek1==="?"){resulting_string=this.__patterns.conditional_comment.read();resulting_string=resulting_string||this.__patterns.processing.read()}if(resulting_string){token=this._create_token(TOKEN.COMMENT,resulting_string);token.directives=directives}}return token};Tokenizer.prototype._read_open=function(c,open_token){var resulting_string=null;var token=null;if(!open_token){if(c==="<"){resulting_string=this._input.next();if(this._input.peek()==="/"){resulting_string+=this._input.next()}resulting_string+=this.__patterns.element_name.read();token=this._create_token(TOKEN.TAG_OPEN,resulting_string)}}return token};Tokenizer.prototype._read_open_handlebars=function(c,open_token){var resulting_string=null;var token=null;if(!open_token){if(this._options.indent_handlebars&&c==="{"&&this._input.peek(1)==="{"){if(this._input.peek(2)==="!"){resulting_string=this.__patterns.handlebars_comment.read();resulting_string=resulting_string||this.__patterns.handlebars.read();token=this._create_token(TOKEN.COMMENT,resulting_string)}else{resulting_string=this.__patterns.handlebars_open.read();token=this._create_token(TOKEN.TAG_OPEN,resulting_string)}}}return token};Tokenizer.prototype._read_close=function(c,open_token){var resulting_string=null;var token=null;if(open_token){if(open_token.text[0]==="<"&&(c===">"||c==="/"&&this._input.peek(1)===">")){resulting_string=this._input.next();if(c==="/"){resulting_string+=this._input.next()}token=this._create_token(TOKEN.TAG_CLOSE,resulting_string)}else if(open_token.text[0]==="{"&&c==="}"&&this._input.peek(1)==="}"){this._input.next();this._input.next();token=this._create_token(TOKEN.TAG_CLOSE,"}}")}}return token};Tokenizer.prototype._read_attribute=function(c,previous_token,open_token){var token=null;var resulting_string="";if(open_token&&open_token.text[0]==="<"){if(c==="="){token=this._create_token(TOKEN.EQUALS,this._input.next())}else if(c==='"'||c==="'"){var content=this._input.next();if(c==='"'){content+=this.__patterns.double_quote.read()}else{content+=this.__patterns.single_quote.read()}token=this._create_token(TOKEN.VALUE,content)}else{resulting_string=this.__patterns.attribute.read();if(resulting_string){if(previous_token.type===TOKEN.EQUALS){token=this._create_token(TOKEN.VALUE,resulting_string)}else{token=this._create_token(TOKEN.ATTRIBUTE,resulting_string)}}}}return token};Tokenizer.prototype._is_content_unformatted=function(tag_name){return this._options.void_elements.indexOf(tag_name)===-1&&(this._options.content_unformatted.indexOf(tag_name)!==-1||this._options.unformatted.indexOf(tag_name)!==-1)};Tokenizer.prototype._read_raw_content=function(c,previous_token,open_token){var resulting_string="";if(open_token&&open_token.text[0]==="{"){resulting_string=this.__patterns.handlebars_raw_close.read()}else if(previous_token.type===TOKEN.TAG_CLOSE&&previous_token.opened.text[0]==="<"&&previous_token.text[0]!=="/"){var tag_name=previous_token.opened.text.substr(1).toLowerCase();if(tag_name==="script"||tag_name==="style"){var token=this._read_comment_or_cdata(c);if(token){token.type=TOKEN.TEXT;return token}resulting_string=this._input.readUntil(new RegExp("","ig"))}else if(this._is_content_unformatted(tag_name)){resulting_string=this._input.readUntil(new RegExp("","ig"))}}if(resulting_string){return this._create_token(TOKEN.TEXT,resulting_string)}return null};Tokenizer.prototype._read_content_word=function(c){var resulting_string="";if(this._options.unformatted_content_delimiter){if(c===this._options.unformatted_content_delimiter[0]){resulting_string=this.__patterns.unformatted_content_delimiter.read()}}if(!resulting_string){resulting_string=this.__patterns.word.read()}if(resulting_string){return this._create_token(TOKEN.TEXT,resulting_string)}};module.exports.Tokenizer=Tokenizer;module.exports.TOKEN=TOKEN},{"../core/directives":104,"../core/pattern":108,"../core/templatablepattern":109,"../core/tokenizer":111}],121:[function(require,module,exports){"use strict";var js_beautify=require("./javascript/index");var css_beautify=require("./css/index");var html_beautify=require("./html/index");function style_html(html_source,options,js,css){js=js||js_beautify;css=css||css_beautify;return html_beautify(html_source,options,js,css)}style_html.defaultOptions=html_beautify.defaultOptions;module.exports.js=js_beautify;module.exports.css=css_beautify;module.exports.html=style_html},{"./css/index":115,"./html/index":118,"./javascript/index":124}],122:[function(require,module,exports){"use strict";var baseASCIIidentifierStartChars="\\x23\\x24\\x40\\x41-\\x5a\\x5f\\x61-\\x7a";var baseASCIIidentifierChars="\\x24\\x30-\\x39\\x41-\\x5a\\x5f\\x61-\\x7a";var nonASCIIidentifierStartChars="\\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";var nonASCIIidentifierChars="\\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";var identifierStart="(?:\\\\u[0-9a-fA-F]{4}|["+baseASCIIidentifierStartChars+nonASCIIidentifierStartChars+"])";var identifierChars="(?:\\\\u[0-9a-fA-F]{4}|["+baseASCIIidentifierChars+nonASCIIidentifierStartChars+nonASCIIidentifierChars+"])*";exports.identifier=new RegExp(identifierStart+identifierChars,"g");exports.identifierStart=new RegExp(identifierStart);exports.identifierMatch=new RegExp("(?:\\\\u[0-9a-fA-F]{4}|["+baseASCIIidentifierChars+nonASCIIidentifierStartChars+nonASCIIidentifierChars+"])+");var nonASCIIwhitespace=/[\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff]/;exports.newline=/[\n\r\u2028\u2029]/;exports.lineBreak=new RegExp("\r\n|"+exports.newline.source);exports.allLineBreaks=new RegExp(exports.lineBreak.source,"g")},{}],123:[function(require,module,exports){"use strict";var Output=require("../core/output").Output;var Token=require("../core/token").Token;var acorn=require("./acorn");var Options=require("./options").Options;var Tokenizer=require("./tokenizer").Tokenizer;var line_starters=require("./tokenizer").line_starters;var positionable_operators=require("./tokenizer").positionable_operators;var TOKEN=require("./tokenizer").TOKEN;function in_array(what,arr){return arr.indexOf(what)!==-1}function ltrim(s){return s.replace(/^\s+/g,"")}function generateMapFromStrings(list){var result={};for(var x=0;xnext_indent_level){next_indent_level=flags_base.line_indent_level}}var next_flags={mode:mode,parent:flags_base,last_token:flags_base?flags_base.last_token:new Token(TOKEN.START_BLOCK,""),last_word:flags_base?flags_base.last_word:"",declaration_statement:false,declaration_assignment:false,multiline_frame:false,inline_frame:false,if_block:false,else_block:false,class_start_block:false,do_block:false,do_while:false,import_block:false,in_case_statement:false,in_case:false,case_body:false,case_block:false,indentation_level:next_indent_level,alignment:0,line_indent_level:flags_base?flags_base.line_indent_level:next_indent_level,start_line_index:this._output.get_line_number(),ternary_depth:0};return next_flags};Beautifier.prototype._reset=function(source_text){var baseIndentString=source_text.match(/^[\t ]*/)[0];this._last_last_text="";this._output=new Output(this._options,baseIndentString);this._output.raw=this._options.test_output_raw;this._flag_store=[];this.set_mode(MODE.BlockStatement);var tokenizer=new Tokenizer(source_text,this._options);this._tokens=tokenizer.tokenize();return source_text};Beautifier.prototype.beautify=function(){if(this._options.disabled){return this._source_text}var sweet_code;var source_text=this._reset(this._source_text);var eol=this._options.eol;if(this._options.eol==="auto"){eol="\n";if(source_text&&acorn.lineBreak.test(source_text||"")){eol=source_text.match(acorn.lineBreak)[0]}}var current_token=this._tokens.next();while(current_token){this.handle_token(current_token);this._last_last_text=this._flags.last_token.text;this._flags.last_token=current_token;current_token=this._tokens.next()}sweet_code=this._output.get_code(eol);return sweet_code};Beautifier.prototype.handle_token=function(current_token,preserve_statement_flags){if(current_token.type===TOKEN.START_EXPR){this.handle_start_expr(current_token)}else if(current_token.type===TOKEN.END_EXPR){this.handle_end_expr(current_token)}else if(current_token.type===TOKEN.START_BLOCK){this.handle_start_block(current_token)}else if(current_token.type===TOKEN.END_BLOCK){this.handle_end_block(current_token)}else if(current_token.type===TOKEN.WORD){this.handle_word(current_token)}else if(current_token.type===TOKEN.RESERVED){this.handle_word(current_token)}else if(current_token.type===TOKEN.SEMICOLON){this.handle_semicolon(current_token)}else if(current_token.type===TOKEN.STRING){this.handle_string(current_token)}else if(current_token.type===TOKEN.EQUALS){this.handle_equals(current_token)}else if(current_token.type===TOKEN.OPERATOR){this.handle_operator(current_token)}else if(current_token.type===TOKEN.COMMA){this.handle_comma(current_token)}else if(current_token.type===TOKEN.BLOCK_COMMENT){this.handle_block_comment(current_token,preserve_statement_flags)}else if(current_token.type===TOKEN.COMMENT){this.handle_comment(current_token,preserve_statement_flags)}else if(current_token.type===TOKEN.DOT){this.handle_dot(current_token)}else if(current_token.type===TOKEN.EOF){this.handle_eof(current_token)}else if(current_token.type===TOKEN.UNKNOWN){this.handle_unknown(current_token,preserve_statement_flags)}else{this.handle_unknown(current_token,preserve_statement_flags)}};Beautifier.prototype.handle_whitespace_and_comments=function(current_token,preserve_statement_flags){var newlines=current_token.newlines;var keep_whitespace=this._options.keep_array_indentation&&is_array(this._flags.mode);if(current_token.comments_before){var comment_token=current_token.comments_before.next();while(comment_token){this.handle_whitespace_and_comments(comment_token,preserve_statement_flags);this.handle_token(comment_token,preserve_statement_flags);comment_token=current_token.comments_before.next()}}if(keep_whitespace){for(var i=0;i0,preserve_statement_flags)}}else{if(this._options.max_preserve_newlines&&newlines>this._options.max_preserve_newlines){newlines=this._options.max_preserve_newlines}if(this._options.preserve_newlines){if(newlines>1){this.print_newline(false,preserve_statement_flags);for(var j=1;j0&&(!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)}};Beautifier.prototype.set_mode=function(mode){if(this._flags){this._flag_store.push(this._flags);this._previous_flags=this._flags}else{this._previous_flags=this.create_flags(null,mode)}this._flags=this.create_flags(this._previous_flags,mode);this._output.set_indent(this._flags.indentation_level,this._flags.alignment)};Beautifier.prototype.restore_mode=function(){if(this._flag_store.length>0){this._previous_flags=this._flags;this._flags=this._flag_store.pop();if(this._previous_flags.mode===MODE.Statement){remove_redundant_indentation(this._output,this._previous_flags)}this._output.set_indent(this._flags.indentation_level,this._flags.alignment)}};Beautifier.prototype.start_of_object_property=function(){return this._flags.parent.mode===MODE.ObjectLiteral&&this._flags.mode===MODE.Statement&&(this._flags.last_token.text===":"&&this._flags.ternary_depth===0||reserved_array(this._flags.last_token,["get","set"]))};Beautifier.prototype.start_of_statement=function(current_token){var start=false;start=start||reserved_array(this._flags.last_token,["var","let","const"])&¤t_token.type===TOKEN.WORD;start=start||reserved_word(this._flags.last_token,"do");start=start||!(this._flags.parent.mode===MODE.ObjectLiteral&&this._flags.mode===MODE.Statement)&&reserved_array(this._flags.last_token,newline_restricted_tokens)&&!current_token.newlines;start=start||reserved_word(this._flags.last_token,"else")&&!(reserved_word(current_token,"if")&&!current_token.comments_before);start=start||this._flags.last_token.type===TOKEN.END_EXPR&&(this._previous_flags.mode===MODE.ForInitializer||this._previous_flags.mode===MODE.Conditional);start=start||this._flags.last_token.type===TOKEN.WORD&&this._flags.mode===MODE.BlockStatement&&!this._flags.in_case&&!(current_token.text==="--"||current_token.text==="++")&&this._last_last_text!=="function"&¤t_token.type!==TOKEN.WORD&¤t_token.type!==TOKEN.RESERVED;start=start||this._flags.mode===MODE.ObjectLiteral&&(this._flags.last_token.text===":"&&this._flags.ternary_depth===0||reserved_array(this._flags.last_token,["get","set"]));if(start){this.set_mode(MODE.Statement);this.indent();this.handle_whitespace_and_comments(current_token,true);if(!this.start_of_object_property()){this.allow_wrap_or_preserved_newline(current_token,reserved_array(current_token,["do","for","if","while"]))}return true}return false};Beautifier.prototype.handle_start_expr=function(current_token){if(!this.start_of_statement(current_token)){this.handle_whitespace_and_comments(current_token)}var next_mode=MODE.Expression;if(current_token.text==="["){if(this._flags.last_token.type===TOKEN.WORD||this._flags.last_token.text===")"){if(reserved_array(this._flags.last_token,line_starters)){this._output.space_before_token=true}this.print_token(current_token);this.set_mode(next_mode);this.indent();if(this._options.space_in_paren){this._output.space_before_token=true}return}next_mode=MODE.ArrayLiteral;if(is_array(this._flags.mode)){if(this._flags.last_token.text==="["||this._flags.last_token.text===","&&(this._last_last_text==="]"||this._last_last_text==="}")){if(!this._options.keep_array_indentation){this.print_newline()}}}if(!in_array(this._flags.last_token.type,[TOKEN.START_EXPR,TOKEN.END_EXPR,TOKEN.WORD,TOKEN.OPERATOR,TOKEN.DOT])){this._output.space_before_token=true}}else{if(this._flags.last_token.type===TOKEN.RESERVED){if(this._flags.last_token.text==="for"){this._output.space_before_token=this._options.space_before_conditional;next_mode=MODE.ForInitializer}else if(in_array(this._flags.last_token.text,["if","while","switch"])){this._output.space_before_token=this._options.space_before_conditional;next_mode=MODE.Conditional}else if(in_array(this._flags.last_word,["await","async"])){this._output.space_before_token=true}else if(this._flags.last_token.text==="import"&¤t_token.whitespace_before===""){this._output.space_before_token=false}else if(in_array(this._flags.last_token.text,line_starters)||this._flags.last_token.text==="catch"){this._output.space_before_token=true}}else if(this._flags.last_token.type===TOKEN.EQUALS||this._flags.last_token.type===TOKEN.OPERATOR){if(!this.start_of_object_property()){this.allow_wrap_or_preserved_newline(current_token)}}else if(this._flags.last_token.type===TOKEN.WORD){this._output.space_before_token=false;var peek_back_two=this._tokens.peek(-3);if(this._options.space_after_named_function&&peek_back_two){var peek_back_three=this._tokens.peek(-4);if(reserved_array(peek_back_two,["async","function"])||peek_back_two.text==="*"&&reserved_array(peek_back_three,["async","function"])){this._output.space_before_token=true}else if(this._flags.mode===MODE.ObjectLiteral){if(peek_back_two.text==="{"||peek_back_two.text===","||peek_back_two.text==="*"&&(peek_back_three.text==="{"||peek_back_three.text===",")){this._output.space_before_token=true}}else if(this._flags.parent&&this._flags.parent.class_start_block){this._output.space_before_token=true}}}else{this.allow_wrap_or_preserved_newline(current_token)}if(this._flags.last_token.type===TOKEN.RESERVED&&(this._flags.last_word==="function"||this._flags.last_word==="typeof")||this._flags.last_token.text==="*"&&(in_array(this._last_last_text,["function","yield"])||this._flags.mode===MODE.ObjectLiteral&&in_array(this._last_last_text,["{",","]))){this._output.space_before_token=this._options.space_after_anon_function}}if(this._flags.last_token.text===";"||this._flags.last_token.type===TOKEN.START_BLOCK){this.print_newline()}else if(this._flags.last_token.type===TOKEN.END_EXPR||this._flags.last_token.type===TOKEN.START_EXPR||this._flags.last_token.type===TOKEN.END_BLOCK||this._flags.last_token.text==="."||this._flags.last_token.type===TOKEN.COMMA){this.allow_wrap_or_preserved_newline(current_token,current_token.newlines)}this.print_token(current_token);this.set_mode(next_mode);if(this._options.space_in_paren){this._output.space_before_token=true}this.indent()};Beautifier.prototype.handle_end_expr=function(current_token){while(this._flags.mode===MODE.Statement){this.restore_mode()}this.handle_whitespace_and_comments(current_token);if(this._flags.multiline_frame){this.allow_wrap_or_preserved_newline(current_token,current_token.text==="]"&&is_array(this._flags.mode)&&!this._options.keep_array_indentation)}if(this._options.space_in_paren){if(this._flags.last_token.type===TOKEN.START_EXPR&&!this._options.space_in_empty_paren){this._output.trim();this._output.space_before_token=false}else{this._output.space_before_token=true}}this.deindent();this.print_token(current_token);this.restore_mode();remove_redundant_indentation(this._output,this._previous_flags);if(this._flags.do_while&&this._previous_flags.mode===MODE.Conditional){this._previous_flags.mode=MODE.Expression;this._flags.do_block=false;this._flags.do_while=false}};Beautifier.prototype.handle_start_block=function(current_token){this.handle_whitespace_and_comments(current_token);var next_token=this._tokens.peek();var second_token=this._tokens.peek(1);if(this._flags.last_word==="switch"&&this._flags.last_token.type===TOKEN.END_EXPR){this.set_mode(MODE.BlockStatement);this._flags.in_case_statement=true}else if(this._flags.case_body){this.set_mode(MODE.BlockStatement)}else if(second_token&&(in_array(second_token.text,[":",","])&&in_array(next_token.type,[TOKEN.STRING,TOKEN.WORD,TOKEN.RESERVED])||in_array(next_token.text,["get","set","..."])&&in_array(second_token.type,[TOKEN.WORD,TOKEN.RESERVED]))){if(in_array(this._last_last_text,["class","interface"])&&!in_array(second_token.text,[":",","])){this.set_mode(MODE.BlockStatement)}else{this.set_mode(MODE.ObjectLiteral)}}else if(this._flags.last_token.type===TOKEN.OPERATOR&&this._flags.last_token.text==="=>"){this.set_mode(MODE.BlockStatement)}else if(in_array(this._flags.last_token.type,[TOKEN.EQUALS,TOKEN.START_EXPR,TOKEN.COMMA,TOKEN.OPERATOR])||reserved_array(this._flags.last_token,["return","throw","import","default"])){this.set_mode(MODE.ObjectLiteral)}else{this.set_mode(MODE.BlockStatement)}if(this._flags.last_token){if(reserved_array(this._flags.last_token.previous,["class","extends"])){this._flags.class_start_block=true}}var empty_braces=!next_token.comments_before&&next_token.text==="}";var empty_anonymous_function=empty_braces&&this._flags.last_word==="function"&&this._flags.last_token.type===TOKEN.END_EXPR;if(this._options.brace_preserve_inline){var index=0;var check_token=null;this._flags.inline_frame=true;do{index+=1;check_token=this._tokens.peek(index-1);if(check_token.newlines){this._flags.inline_frame=false;break}}while(check_token.type!==TOKEN.EOF&&!(check_token.type===TOKEN.END_BLOCK&&check_token.opened===current_token))}if((this._options.brace_style==="expand"||this._options.brace_style==="none"&¤t_token.newlines)&&!this._flags.inline_frame){if(this._flags.last_token.type!==TOKEN.OPERATOR&&(empty_anonymous_function||this._flags.last_token.type===TOKEN.EQUALS||reserved_array(this._flags.last_token,special_words)&&this._flags.last_token.text!=="else")){this._output.space_before_token=true}else{this.print_newline(false,true)}}else{if(is_array(this._previous_flags.mode)&&(this._flags.last_token.type===TOKEN.START_EXPR||this._flags.last_token.type===TOKEN.COMMA)){if(this._flags.last_token.type===TOKEN.COMMA||this._options.space_in_paren){this._output.space_before_token=true}if(this._flags.last_token.type===TOKEN.COMMA||this._flags.last_token.type===TOKEN.START_EXPR&&this._flags.inline_frame){this.allow_wrap_or_preserved_newline(current_token);this._previous_flags.multiline_frame=this._previous_flags.multiline_frame||this._flags.multiline_frame;this._flags.multiline_frame=false}}if(this._flags.last_token.type!==TOKEN.OPERATOR&&this._flags.last_token.type!==TOKEN.START_EXPR){if(in_array(this._flags.last_token.type,[TOKEN.START_BLOCK,TOKEN.SEMICOLON])&&!this._flags.inline_frame){this.print_newline()}else{this._output.space_before_token=true}}}this.print_token(current_token);this.indent();if(!empty_braces&&!(this._options.brace_preserve_inline&&this._flags.inline_frame)){this.print_newline()}};Beautifier.prototype.handle_end_block=function(current_token){this.handle_whitespace_and_comments(current_token);while(this._flags.mode===MODE.Statement){this.restore_mode()}var empty_braces=this._flags.last_token.type===TOKEN.START_BLOCK;if(this._flags.inline_frame&&!empty_braces){this._output.space_before_token=true}else if(this._options.brace_style==="expand"){if(!empty_braces){this.print_newline()}}else{if(!empty_braces){if(is_array(this._flags.mode)&&this._options.keep_array_indentation){this._options.keep_array_indentation=false;this.print_newline();this._options.keep_array_indentation=true}else{this.print_newline()}}}this.restore_mode();this.print_token(current_token)};Beautifier.prototype.handle_word=function(current_token){if(current_token.type===TOKEN.RESERVED){if(in_array(current_token.text,["set","get"])&&this._flags.mode!==MODE.ObjectLiteral){current_token.type=TOKEN.WORD}else if(current_token.text==="import"&&in_array(this._tokens.peek().text,["(","."])){current_token.type=TOKEN.WORD}else if(in_array(current_token.text,["as","from"])&&!this._flags.import_block){current_token.type=TOKEN.WORD}else if(this._flags.mode===MODE.ObjectLiteral){var next_token=this._tokens.peek();if(next_token.text===":"){current_token.type=TOKEN.WORD}}}if(this.start_of_statement(current_token)){if(reserved_array(this._flags.last_token,["var","let","const"])&¤t_token.type===TOKEN.WORD){this._flags.declaration_statement=true}}else if(current_token.newlines&&!is_expression(this._flags.mode)&&(this._flags.last_token.type!==TOKEN.OPERATOR||(this._flags.last_token.text==="--"||this._flags.last_token.text==="++"))&&this._flags.last_token.type!==TOKEN.EQUALS&&(this._options.preserve_newlines||!reserved_array(this._flags.last_token,["var","let","const","set","get"]))){this.handle_whitespace_and_comments(current_token);this.print_newline()}else{this.handle_whitespace_and_comments(current_token)}if(this._flags.do_block&&!this._flags.do_while){if(reserved_word(current_token,"while")){this._output.space_before_token=true;this.print_token(current_token);this._output.space_before_token=true;this._flags.do_while=true;return}else{this.print_newline();this._flags.do_block=false}}if(this._flags.if_block){if(!this._flags.else_block&&reserved_word(current_token,"else")){this._flags.else_block=true}else{while(this._flags.mode===MODE.Statement){this.restore_mode()}this._flags.if_block=false;this._flags.else_block=false}}if(this._flags.in_case_statement&&reserved_array(current_token,["case","default"])){this.print_newline();if(!this._flags.case_block&&(this._flags.case_body||this._options.jslint_happy)){this.deindent()}this._flags.case_body=false;this.print_token(current_token);this._flags.in_case=true;return}if(this._flags.last_token.type===TOKEN.COMMA||this._flags.last_token.type===TOKEN.START_EXPR||this._flags.last_token.type===TOKEN.EQUALS||this._flags.last_token.type===TOKEN.OPERATOR){if(!this.start_of_object_property()){this.allow_wrap_or_preserved_newline(current_token)}}if(reserved_word(current_token,"function")){if(in_array(this._flags.last_token.text,["}",";"])||this._output.just_added_newline()&&!(in_array(this._flags.last_token.text,["(","[","{",":","=",","])||this._flags.last_token.type===TOKEN.OPERATOR)){if(!this._output.just_added_blankline()&&!current_token.comments_before){this.print_newline();this.print_newline(true)}}if(this._flags.last_token.type===TOKEN.RESERVED||this._flags.last_token.type===TOKEN.WORD){if(reserved_array(this._flags.last_token,["get","set","new","export"])||reserved_array(this._flags.last_token,newline_restricted_tokens)){this._output.space_before_token=true}else if(reserved_word(this._flags.last_token,"default")&&this._last_last_text==="export"){this._output.space_before_token=true}else if(this._flags.last_token.text==="declare"){this._output.space_before_token=true}else{this.print_newline()}}else if(this._flags.last_token.type===TOKEN.OPERATOR||this._flags.last_token.text==="="){this._output.space_before_token=true}else if(!this._flags.multiline_frame&&(is_expression(this._flags.mode)||is_array(this._flags.mode))){}else{this.print_newline()}this.print_token(current_token);this._flags.last_word=current_token.text;return}var prefix="NONE";if(this._flags.last_token.type===TOKEN.END_BLOCK){if(this._previous_flags.inline_frame){prefix="SPACE"}else if(!reserved_array(current_token,["else","catch","finally","from"])){prefix="NEWLINE"}else{if(this._options.brace_style==="expand"||this._options.brace_style==="end-expand"||this._options.brace_style==="none"&¤t_token.newlines){prefix="NEWLINE"}else{prefix="SPACE";this._output.space_before_token=true}}}else if(this._flags.last_token.type===TOKEN.SEMICOLON&&this._flags.mode===MODE.BlockStatement){prefix="NEWLINE"}else if(this._flags.last_token.type===TOKEN.SEMICOLON&&is_expression(this._flags.mode)){prefix="SPACE"}else if(this._flags.last_token.type===TOKEN.STRING){prefix="NEWLINE"}else if(this._flags.last_token.type===TOKEN.RESERVED||this._flags.last_token.type===TOKEN.WORD||this._flags.last_token.text==="*"&&(in_array(this._last_last_text,["function","yield"])||this._flags.mode===MODE.ObjectLiteral&&in_array(this._last_last_text,["{",","]))){prefix="SPACE"}else if(this._flags.last_token.type===TOKEN.START_BLOCK){if(this._flags.inline_frame){prefix="SPACE"}else{prefix="NEWLINE"}}else if(this._flags.last_token.type===TOKEN.END_EXPR){this._output.space_before_token=true;prefix="NEWLINE"}if(reserved_array(current_token,line_starters)&&this._flags.last_token.text!==")"){if(this._flags.inline_frame||this._flags.last_token.text==="else"||this._flags.last_token.text==="export"){prefix="SPACE"}else{prefix="NEWLINE"}}if(reserved_array(current_token,["else","catch","finally"])){if((!(this._flags.last_token.type===TOKEN.END_BLOCK&&this._previous_flags.mode===MODE.BlockStatement)||this._options.brace_style==="expand"||this._options.brace_style==="end-expand"||this._options.brace_style==="none"&¤t_token.newlines)&&!this._flags.inline_frame){this.print_newline()}else{this._output.trim(true);var line=this._output.current_line;if(line.last()!=="}"){this.print_newline()}this._output.space_before_token=true}}else if(prefix==="NEWLINE"){if(reserved_array(this._flags.last_token,special_words)){this._output.space_before_token=true}else if(this._flags.last_token.text==="declare"&&reserved_array(current_token,["var","let","const"])){this._output.space_before_token=true}else if(this._flags.last_token.type!==TOKEN.END_EXPR){if((this._flags.last_token.type!==TOKEN.START_EXPR||!reserved_array(current_token,["var","let","const"]))&&this._flags.last_token.text!==":"){if(reserved_word(current_token,"if")&&reserved_word(current_token.previous,"else")){this._output.space_before_token=true}else{this.print_newline()}}}else if(reserved_array(current_token,line_starters)&&this._flags.last_token.text!==")"){this.print_newline()}}else if(this._flags.multiline_frame&&is_array(this._flags.mode)&&this._flags.last_token.text===","&&this._last_last_text==="}"){this.print_newline()}else if(prefix==="SPACE"){this._output.space_before_token=true}if(current_token.previous&&(current_token.previous.type===TOKEN.WORD||current_token.previous.type===TOKEN.RESERVED)){this._output.space_before_token=true}this.print_token(current_token);this._flags.last_word=current_token.text;if(current_token.type===TOKEN.RESERVED){if(current_token.text==="do"){this._flags.do_block=true}else if(current_token.text==="if"){this._flags.if_block=true}else if(current_token.text==="import"){this._flags.import_block=true}else if(this._flags.import_block&&reserved_word(current_token,"from")){this._flags.import_block=false}}};Beautifier.prototype.handle_semicolon=function(current_token){if(this.start_of_statement(current_token)){this._output.space_before_token=false}else{this.handle_whitespace_and_comments(current_token)}var next_token=this._tokens.peek();while(this._flags.mode===MODE.Statement&&!(this._flags.if_block&&reserved_word(next_token,"else"))&&!this._flags.do_block){this.restore_mode()}if(this._flags.import_block){this._flags.import_block=false}this.print_token(current_token)};Beautifier.prototype.handle_string=function(current_token){if(current_token.text.startsWith("`")&¤t_token.newlines===0&¤t_token.whitespace_before===""&&(current_token.previous.text===")"||this._flags.last_token.type===TOKEN.WORD)){}else if(this.start_of_statement(current_token)){this._output.space_before_token=true}else{this.handle_whitespace_and_comments(current_token);if(this._flags.last_token.type===TOKEN.RESERVED||this._flags.last_token.type===TOKEN.WORD||this._flags.inline_frame){this._output.space_before_token=true}else if(this._flags.last_token.type===TOKEN.COMMA||this._flags.last_token.type===TOKEN.START_EXPR||this._flags.last_token.type===TOKEN.EQUALS||this._flags.last_token.type===TOKEN.OPERATOR){if(!this.start_of_object_property()){this.allow_wrap_or_preserved_newline(current_token)}}else if(current_token.text.startsWith("`")&&this._flags.last_token.type===TOKEN.END_EXPR&&(current_token.previous.text==="]"||current_token.previous.text===")")&¤t_token.newlines===0){this._output.space_before_token=true}else{this.print_newline()}}this.print_token(current_token)};Beautifier.prototype.handle_equals=function(current_token){if(this.start_of_statement(current_token)){}else{this.handle_whitespace_and_comments(current_token)}if(this._flags.declaration_statement){this._flags.declaration_assignment=true}this._output.space_before_token=true;this.print_token(current_token);this._output.space_before_token=true};Beautifier.prototype.handle_comma=function(current_token){this.handle_whitespace_and_comments(current_token,true);this.print_token(current_token);this._output.space_before_token=true;if(this._flags.declaration_statement){if(is_expression(this._flags.parent.mode)){this._flags.declaration_assignment=false}if(this._flags.declaration_assignment){this._flags.declaration_assignment=false;this.print_newline(false,true)}else if(this._options.comma_first){this.allow_wrap_or_preserved_newline(current_token)}}else if(this._flags.mode===MODE.ObjectLiteral||this._flags.mode===MODE.Statement&&this._flags.parent.mode===MODE.ObjectLiteral){if(this._flags.mode===MODE.Statement){this.restore_mode()}if(!this._flags.inline_frame){this.print_newline()}}else if(this._options.comma_first){this.allow_wrap_or_preserved_newline(current_token)}};Beautifier.prototype.handle_operator=function(current_token){var isGeneratorAsterisk=current_token.text==="*"&&(reserved_array(this._flags.last_token,["function","yield"])||in_array(this._flags.last_token.type,[TOKEN.START_BLOCK,TOKEN.COMMA,TOKEN.END_BLOCK,TOKEN.SEMICOLON]));var isUnary=in_array(current_token.text,["-","+"])&&(in_array(this._flags.last_token.type,[TOKEN.START_BLOCK,TOKEN.START_EXPR,TOKEN.EQUALS,TOKEN.OPERATOR])||in_array(this._flags.last_token.text,line_starters)||this._flags.last_token.text===",");if(this.start_of_statement(current_token)){}else{var preserve_statement_flags=!isGeneratorAsterisk;this.handle_whitespace_and_comments(current_token,preserve_statement_flags)}if(current_token.text==="*"&&this._flags.last_token.type===TOKEN.DOT){this.print_token(current_token);return}if(current_token.text==="::"){this.print_token(current_token);return}if(this._flags.last_token.type===TOKEN.OPERATOR&&in_array(this._options.operator_position,OPERATOR_POSITION_BEFORE_OR_PRESERVE)){this.allow_wrap_or_preserved_newline(current_token)}if(current_token.text===":"&&this._flags.in_case){this.print_token(current_token);this._flags.in_case=false;this._flags.case_body=true;if(this._tokens.peek().type!==TOKEN.START_BLOCK){this.indent();this.print_newline();this._flags.case_block=false}else{this._flags.case_block=true;this._output.space_before_token=true}return}var space_before=true;var space_after=true;var in_ternary=false;if(current_token.text===":"){if(this._flags.ternary_depth===0){space_before=false}else{this._flags.ternary_depth-=1;in_ternary=true}}else if(current_token.text==="?"){this._flags.ternary_depth+=1}if(!isUnary&&!isGeneratorAsterisk&&this._options.preserve_newlines&&in_array(current_token.text,positionable_operators)){var isColon=current_token.text===":";var isTernaryColon=isColon&&in_ternary;var isOtherColon=isColon&&!in_ternary;switch(this._options.operator_position){case OPERATOR_POSITION.before_newline:this._output.space_before_token=!isOtherColon;this.print_token(current_token);if(!isColon||isTernaryColon){this.allow_wrap_or_preserved_newline(current_token)}this._output.space_before_token=true;return;case OPERATOR_POSITION.after_newline:this._output.space_before_token=true;if(!isColon||isTernaryColon){if(this._tokens.peek().newlines){this.print_newline(false,true)}else{this.allow_wrap_or_preserved_newline(current_token)}}else{this._output.space_before_token=false}this.print_token(current_token);this._output.space_before_token=true;return;case OPERATOR_POSITION.preserve_newline:if(!isOtherColon){this.allow_wrap_or_preserved_newline(current_token)}space_before=!(this._output.just_added_newline()||isOtherColon);this._output.space_before_token=space_before;this.print_token(current_token);this._output.space_before_token=true;return}}if(isGeneratorAsterisk){this.allow_wrap_or_preserved_newline(current_token);space_before=false;var next_token=this._tokens.peek();space_after=next_token&&in_array(next_token.type,[TOKEN.WORD,TOKEN.RESERVED])}else if(current_token.text==="..."){this.allow_wrap_or_preserved_newline(current_token);space_before=this._flags.last_token.type===TOKEN.START_BLOCK;space_after=false}else if(in_array(current_token.text,["--","++","!","~"])||isUnary){if(this._flags.last_token.type===TOKEN.COMMA||this._flags.last_token.type===TOKEN.START_EXPR){this.allow_wrap_or_preserved_newline(current_token)}space_before=false;space_after=false;if(current_token.newlines&&(current_token.text==="--"||current_token.text==="++"||current_token.text==="~")){var new_line_needed=reserved_array(this._flags.last_token,special_words)&¤t_token.newlines;if(new_line_needed&&(this._previous_flags.if_block||this._previous_flags.else_block)){this.restore_mode()}this.print_newline(new_line_needed,true)}if(this._flags.last_token.text===";"&&is_expression(this._flags.mode)){space_before=true}if(this._flags.last_token.type===TOKEN.RESERVED){space_before=true}else if(this._flags.last_token.type===TOKEN.END_EXPR){space_before=!(this._flags.last_token.text==="]"&&(current_token.text==="--"||current_token.text==="++"))}else if(this._flags.last_token.type===TOKEN.OPERATOR){space_before=in_array(current_token.text,["--","-","++","+"])&&in_array(this._flags.last_token.text,["--","-","++","+"]);if(in_array(current_token.text,["+","-"])&&in_array(this._flags.last_token.text,["--","++"])){space_after=true}}if((this._flags.mode===MODE.BlockStatement&&!this._flags.inline_frame||this._flags.mode===MODE.Statement)&&(this._flags.last_token.text==="{"||this._flags.last_token.text===";")){this.print_newline()}}this._output.space_before_token=this._output.space_before_token||space_before;this.print_token(current_token);this._output.space_before_token=space_after};Beautifier.prototype.handle_block_comment=function(current_token,preserve_statement_flags){if(this._output.raw){this._output.add_raw_token(current_token);if(current_token.directives&¤t_token.directives.preserve==="end"){this._output.raw=this._options.test_output_raw}return}if(current_token.directives){this.print_newline(false,preserve_statement_flags);this.print_token(current_token);if(current_token.directives.preserve==="start"){this._output.raw=true}this.print_newline(false,true);return}if(!acorn.newline.test(current_token.text)&&!current_token.newlines){this._output.space_before_token=true;this.print_token(current_token);this._output.space_before_token=true;return}else{this.print_block_commment(current_token,preserve_statement_flags)}};Beautifier.prototype.print_block_commment=function(current_token,preserve_statement_flags){var lines=split_linebreaks(current_token.text);var j;var javadoc=false;var starless=false;var lastIndent=current_token.whitespace_before;var lastIndentLength=lastIndent.length;this.print_newline(false,preserve_statement_flags);this.print_token_line_indentation(current_token);this._output.add_token(lines[0]);this.print_newline(false,preserve_statement_flags);if(lines.length>1){lines=lines.slice(1);javadoc=all_lines_start_with(lines,"*");starless=each_line_matches_indent(lines,lastIndent);if(javadoc){this._flags.alignment=1}for(j=0;j>> === !== &&= ??= ||= "+"<< && >= ** != == <= >> || ?? |> "+"< / - + > : & % ? ^ | *").split(" ");var punct=">>>= "+"... >>= <<= === >>> !== **= &&= ??= ||= "+"=> ^= :: /= << <= == && -= >= >> != -- += ** || ?? ++ %= &= *= |= |> "+"= ! ? > < : / ^ - + * & % ~ |";punct=punct.replace(/[-[\]{}()*+?.,\\^$|#]/g,"\\$&");punct="\\?\\.(?!\\d) "+punct;punct=punct.replace(/ /g,"|");var punct_pattern=new RegExp(punct);var line_starters="continue,try,throw,return,var,let,const,if,switch,case,default,for,while,break,function,import,export".split(",");var reserved_words=line_starters.concat(["do","in","of","else","get","set","new","catch","finally","typeof","yield","async","await","from","as","class","extends"]);var reserved_word_pattern=new RegExp("^(?:"+reserved_words.join("|")+")$");var in_html_comment;var Tokenizer=function(input_string,options){BaseTokenizer.call(this,input_string,options);this._patterns.whitespace=this._patterns.whitespace.matching(/\u00A0\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff/.source,/\u2028\u2029/.source);var pattern_reader=new Pattern(this._input);var templatable=new TemplatablePattern(this._input).read_options(this._options);this.__patterns={template:templatable,identifier:templatable.starting_with(acorn.identifier).matching(acorn.identifierMatch),number:pattern_reader.matching(number_pattern),punct:pattern_reader.matching(punct_pattern),comment:pattern_reader.starting_with(/\/\//).until(/[\n\r\u2028\u2029]/),block_comment:pattern_reader.starting_with(/\/\*/).until_after(/\*\//),html_comment_start:pattern_reader.matching(//),include:pattern_reader.starting_with(/#include/).until_after(acorn.lineBreak),shebang:pattern_reader.starting_with(/#!/).until_after(acorn.lineBreak),xml:pattern_reader.matching(/[\s\S]*?<(\/?)([-a-zA-Z:0-9_.]+|{[^}]+?}|!\[CDATA\[[^\]]*?\]\]|)(\s*{[^}]+?}|\s+[-a-zA-Z:0-9_.]+|\s+[-a-zA-Z:0-9_.]+\s*=\s*('[^']*'|"[^"]*"|{([^{}]|{[^}]+?})+?}))*\s*(\/?)\s*>/),single_quote:templatable.until(/['\\\n\r\u2028\u2029]/),double_quote:templatable.until(/["\\\n\r\u2028\u2029]/),template_text:templatable.until(/[`\\$]/),template_expression:templatable.until(/[`}\\]/)}};Tokenizer.prototype=new BaseTokenizer;Tokenizer.prototype._is_comment=function(current_token){return current_token.type===TOKEN.COMMENT||current_token.type===TOKEN.BLOCK_COMMENT||current_token.type===TOKEN.UNKNOWN};Tokenizer.prototype._is_opening=function(current_token){return current_token.type===TOKEN.START_BLOCK||current_token.type===TOKEN.START_EXPR};Tokenizer.prototype._is_closing=function(current_token,open_token){return(current_token.type===TOKEN.END_BLOCK||current_token.type===TOKEN.END_EXPR)&&(open_token&&(current_token.text==="]"&&open_token.text==="["||current_token.text===")"&&open_token.text==="("||current_token.text==="}"&&open_token.text==="{"))};Tokenizer.prototype._reset=function(){in_html_comment=false};Tokenizer.prototype._get_next_token=function(previous_token,open_token){var token=null;this._readWhitespace();var c=this._input.peek();if(c===null){return this._create_token(TOKEN.EOF,"")}token=token||this._read_non_javascript(c);token=token||this._read_string(c);token=token||this._read_pair(c,this._input.peek(1));token=token||this._read_word(previous_token);token=token||this._read_singles(c);token=token||this._read_comment(c);token=token||this._read_regexp(c,previous_token);token=token||this._read_xml(c,previous_token);token=token||this._read_punctuation();token=token||this._create_token(TOKEN.UNKNOWN,this._input.next());return token};Tokenizer.prototype._read_word=function(previous_token){var resulting_string;resulting_string=this.__patterns.identifier.read();if(resulting_string!==""){resulting_string=resulting_string.replace(acorn.allLineBreaks,"\n");if(!(previous_token.type===TOKEN.DOT||previous_token.type===TOKEN.RESERVED&&(previous_token.text==="set"||previous_token.text==="get"))&&reserved_word_pattern.test(resulting_string)){if((resulting_string==="in"||resulting_string==="of")&&(previous_token.type===TOKEN.WORD||previous_token.type===TOKEN.STRING)){return this._create_token(TOKEN.OPERATOR,resulting_string)}return this._create_token(TOKEN.RESERVED,resulting_string)}return this._create_token(TOKEN.WORD,resulting_string)}resulting_string=this.__patterns.number.read();if(resulting_string!==""){return this._create_token(TOKEN.WORD,resulting_string)}};Tokenizer.prototype._read_singles=function(c){var token=null;if(c==="("||c==="["){token=this._create_token(TOKEN.START_EXPR,c)}else if(c===")"||c==="]"){token=this._create_token(TOKEN.END_EXPR,c)}else if(c==="{"){token=this._create_token(TOKEN.START_BLOCK,c)}else if(c==="}"){token=this._create_token(TOKEN.END_BLOCK,c)}else if(c===";"){token=this._create_token(TOKEN.SEMICOLON,c)}else if(c==="."&&dot_pattern.test(this._input.peek(1))){token=this._create_token(TOKEN.DOT,c)}else if(c===","){token=this._create_token(TOKEN.COMMA,c)}if(token){this._input.next()}return token};Tokenizer.prototype._read_pair=function(c,d){var token=null;if(c==="#"&&d==="{"){token=this._create_token(TOKEN.START_BLOCK,c+d)}if(token){this._input.next();this._input.next()}return token};Tokenizer.prototype._read_punctuation=function(){var resulting_string=this.__patterns.punct.read();if(resulting_string!==""){if(resulting_string==="="){return this._create_token(TOKEN.EQUALS,resulting_string)}else if(resulting_string==="?."){return this._create_token(TOKEN.DOT,resulting_string)}else{return this._create_token(TOKEN.OPERATOR,resulting_string)}}};Tokenizer.prototype._read_non_javascript=function(c){var resulting_string="";if(c==="#"){if(this._is_first_token()){resulting_string=this.__patterns.shebang.read();if(resulting_string){return this._create_token(TOKEN.UNKNOWN,resulting_string.trim()+"\n")}}resulting_string=this.__patterns.include.read();if(resulting_string){return this._create_token(TOKEN.UNKNOWN,resulting_string.trim()+"\n")}c=this._input.next();var sharp="#";if(this._input.hasNext()&&this._input.testChar(digit)){do{c=this._input.next();sharp+=c}while(this._input.hasNext()&&c!=="#"&&c!=="=");if(c==="#"){}else if(this._input.peek()==="["&&this._input.peek(1)==="]"){sharp+="[]";this._input.next();this._input.next()}else if(this._input.peek()==="{"&&this._input.peek(1)==="}"){sharp+="{}";this._input.next();this._input.next()}return this._create_token(TOKEN.WORD,sharp)}this._input.back()}else if(c==="<"&&this._is_first_token()){resulting_string=this.__patterns.html_comment_start.read();if(resulting_string){while(this._input.hasNext()&&!this._input.testChar(acorn.newline)){resulting_string+=this._input.next()}in_html_comment=true;return this._create_token(TOKEN.COMMENT,resulting_string)}}else if(in_html_comment&&c==="-"){resulting_string=this.__patterns.html_comment_end.read();if(resulting_string){in_html_comment=false;return this._create_token(TOKEN.COMMENT,resulting_string)}}return null};Tokenizer.prototype._read_comment=function(c){var token=null;if(c==="/"){var comment="";if(this._input.peek(1)==="*"){comment=this.__patterns.block_comment.read();var directives=directives_core.get_directives(comment);if(directives&&directives.ignore==="start"){comment+=directives_core.readIgnored(this._input)}comment=comment.replace(acorn.allLineBreaks,"\n");token=this._create_token(TOKEN.BLOCK_COMMENT,comment);token.directives=directives}else if(this._input.peek(1)==="/"){comment=this.__patterns.comment.read();token=this._create_token(TOKEN.COMMENT,comment)}}return token};Tokenizer.prototype._read_string=function(c){if(c==="`"||c==="'"||c==='"'){var resulting_string=this._input.next();this.has_char_escapes=false;if(c==="`"){resulting_string+=this._read_string_recursive("`",true,"${")}else{resulting_string+=this._read_string_recursive(c)}if(this.has_char_escapes&&this._options.unescape_strings){resulting_string=unescape_string(resulting_string)}if(this._input.peek()===c){resulting_string+=this._input.next()}resulting_string=resulting_string.replace(acorn.allLineBreaks,"\n");return this._create_token(TOKEN.STRING,resulting_string)}return null};Tokenizer.prototype._allow_regexp_or_xml=function(previous_token){return previous_token.type===TOKEN.RESERVED&&in_array(previous_token.text,["return","case","throw","else","do","typeof","yield"])||previous_token.type===TOKEN.END_EXPR&&previous_token.text===")"&&previous_token.opened.previous.type===TOKEN.RESERVED&&in_array(previous_token.opened.previous.text,["if","while","for"])||in_array(previous_token.type,[TOKEN.COMMENT,TOKEN.START_EXPR,TOKEN.START_BLOCK,TOKEN.START,TOKEN.END_BLOCK,TOKEN.OPERATOR,TOKEN.EQUALS,TOKEN.EOF,TOKEN.SEMICOLON,TOKEN.COMMA])};Tokenizer.prototype._read_regexp=function(c,previous_token){if(c==="/"&&this._allow_regexp_or_xml(previous_token)){var resulting_string=this._input.next();var esc=false;var in_char_class=false;while(this._input.hasNext()&&((esc||in_char_class||this._input.peek()!==c)&&!this._input.testChar(acorn.newline))){resulting_string+=this._input.peek();if(!esc){esc=this._input.peek()==="\\";if(this._input.peek()==="["){in_char_class=true}else if(this._input.peek()==="]"){in_char_class=false}}else{esc=false}this._input.next()}if(this._input.peek()===c){resulting_string+=this._input.next();resulting_string+=this._input.read(acorn.identifier)}return this._create_token(TOKEN.STRING,resulting_string)}return null};Tokenizer.prototype._read_xml=function(c,previous_token){if(this._options.e4x&&c==="<"&&this._allow_regexp_or_xml(previous_token)){var xmlStr="";var match=this.__patterns.xml.read_match();if(match){var rootTag=match[2].replace(/^{\s+/,"{").replace(/\s+}$/,"}");var isCurlyRoot=rootTag.indexOf("{")===0;var depth=0;while(match){var isEndTag=!!match[1];var tagName=match[2];var isSingletonTag=!!match[match.length-1]||tagName.slice(0,8)==="![CDATA[";if(!isSingletonTag&&(tagName===rootTag||isCurlyRoot&&tagName.replace(/^{\s+/,"{").replace(/\s+}$/,"}"))){if(isEndTag){--depth}else{++depth}}xmlStr+=match[0];if(depth<=0){break}match=this.__patterns.xml.read_match()}if(!match){xmlStr+=this._input.match(/[\s\S]*/g)[0]}xmlStr=xmlStr.replace(acorn.allLineBreaks,"\n");return this._create_token(TOKEN.STRING,xmlStr)}}return null};function unescape_string(s){var out="",escaped=0;var input_scan=new InputScanner(s);var matched=null;while(input_scan.hasNext()){matched=input_scan.match(/([\s]|[^\\]|\\\\)+/g);if(matched){out+=matched[0]}if(input_scan.peek()==="\\"){input_scan.next();if(input_scan.peek()==="x"){matched=input_scan.match(/x([0-9A-Fa-f]{2})/g)}else if(input_scan.peek()==="u"){matched=input_scan.match(/u([0-9A-Fa-f]{4})/g)}else{out+="\\";if(input_scan.hasNext()){out+=input_scan.next()}continue}if(!matched){return s}escaped=parseInt(matched[1],16);if(escaped>126&&escaped<=255&&matched[0].indexOf("x")===0){return s}else if(escaped>=0&&escaped<32){out+="\\"+matched[0];continue}else if(escaped===34||escaped===39||escaped===92){out+="\\"+String.fromCharCode(escaped)}else{out+=String.fromCharCode(escaped)}}}return out}Tokenizer.prototype._read_string_recursive=function(delimiter,allow_unescaped_newlines,start_sub){var current_char;var pattern;if(delimiter==="'"){pattern=this.__patterns.single_quote}else if(delimiter==='"'){pattern=this.__patterns.double_quote}else if(delimiter==="`"){pattern=this.__patterns.template_text}else if(delimiter==="}"){pattern=this.__patterns.template_expression}var resulting_string=pattern.read();var next="";while(this._input.hasNext()){next=this._input.next();if(next===delimiter||!allow_unescaped_newlines&&acorn.newline.test(next)){this._input.back();break}else if(next==="\\"&&this._input.hasNext()){current_char=this._input.peek();if(current_char==="x"||current_char==="u"){this.has_char_escapes=true}else if(current_char==="\r"&&this._input.peek(1)==="\n"){this._input.next()}next+=this._input.next()}else if(start_sub){if(start_sub==="${"&&next==="$"&&this._input.peek()==="{"){next+=this._input.next()}if(start_sub===next){if(delimiter==="`"){next+=this._read_string_recursive("}",allow_unescaped_newlines,"`")}else{next+=this._read_string_recursive("`",allow_unescaped_newlines,"${")}if(this._input.hasNext()){next+=this._input.next()}}}next+=pattern.read();resulting_string+=next}return resulting_string};module.exports.Tokenizer=Tokenizer;module.exports.TOKEN=TOKEN;module.exports.positionable_operators=positionable_operators.slice();module.exports.line_starters=line_starters.slice()},{"../core/directives":104,"../core/inputscanner":105,"../core/pattern":108,"../core/templatablepattern":109,"../core/tokenizer":111,"./acorn":122}],127:[function(require,module,exports){assert.notEqual=notEqual;assert.notOk=notOk;assert.equal=equal;assert.ok=assert;module.exports=assert;function equal(a,b,m){assert(a==b,m)}function notEqual(a,b,m){assert(a!=b,m)}function notOk(t,m){assert(!t,m)}function assert(t,m){if(!t)throw new Error(m||"AssertionError")}},{}],128:[function(require,module,exports){var splice=require("remove-array-items");var nanotiming=require("nanotiming");var assert=require("assert");module.exports=Nanobus;function Nanobus(name){if(!(this instanceof Nanobus))return new Nanobus(name);this._name=name||"nanobus";this._starListeners=[];this._listeners={}}Nanobus.prototype.emit=function(eventName){assert.ok(typeof eventName==="string"||typeof eventName==="symbol","nanobus.emit: eventName should be type string or symbol");var data=[];for(var i=1,len=arguments.length;i0){this._emit(this._listeners[eventName],data)}if(this._starListeners.length>0){this._emit(this._starListeners,eventName,data,emitTiming.uuid)}emitTiming();return this};Nanobus.prototype.on=Nanobus.prototype.addListener=function(eventName,listener){assert.ok(typeof eventName==="string"||typeof eventName==="symbol","nanobus.on: eventName should be type string or symbol");assert.equal(typeof listener,"function","nanobus.on: listener should be type function");if(eventName==="*"){this._starListeners.push(listener)}else{if(!this._listeners[eventName])this._listeners[eventName]=[];this._listeners[eventName].push(listener)}return this};Nanobus.prototype.prependListener=function(eventName,listener){assert.ok(typeof eventName==="string"||typeof eventName==="symbol","nanobus.prependListener: eventName should be type string or symbol");assert.equal(typeof listener,"function","nanobus.prependListener: listener should be type function");if(eventName==="*"){this._starListeners.unshift(listener)}else{if(!this._listeners[eventName])this._listeners[eventName]=[];this._listeners[eventName].unshift(listener)}return this};Nanobus.prototype.once=function(eventName,listener){assert.ok(typeof eventName==="string"||typeof eventName==="symbol","nanobus.once: eventName should be type string or symbol");assert.equal(typeof listener,"function","nanobus.once: listener should be type function");var self=this;this.on(eventName,once);function once(){listener.apply(self,arguments);self.removeListener(eventName,once)}return this};Nanobus.prototype.prependOnceListener=function(eventName,listener){assert.ok(typeof eventName==="string"||typeof eventName==="symbol","nanobus.prependOnceListener: eventName should be type string or symbol");assert.equal(typeof listener,"function","nanobus.prependOnceListener: listener should be type function");var self=this;this.prependListener(eventName,once);function once(){listener.apply(self,arguments);self.removeListener(eventName,once)}return this};Nanobus.prototype.removeListener=function(eventName,listener){assert.ok(typeof eventName==="string"||typeof eventName==="symbol","nanobus.removeListener: eventName should be type string or symbol");assert.equal(typeof listener,"function","nanobus.removeListener: listener should be type function");if(eventName==="*"){this._starListeners=this._starListeners.slice();return remove(this._starListeners,listener)}else{if(typeof this._listeners[eventName]!=="undefined"){this._listeners[eventName]=this._listeners[eventName].slice()}return remove(this._listeners[eventName],listener)}function remove(arr,listener){if(!arr)return;var index=arr.indexOf(listener);if(index!==-1){splice(arr,index,1);return true}}};Nanobus.prototype.removeAllListeners=function(eventName){if(eventName){if(eventName==="*"){this._starListeners=[]}else{this._listeners[eventName]=[]}}else{this._starListeners=[];this._listeners={}}return this};Nanobus.prototype.listeners=function(eventName){var listeners=eventName!=="*"?this._listeners[eventName]:this._starListeners;var ret=[];if(listeners){var ilength=listeners.length;for(var i=0;i=length||removeCount===0){return}removeCount=startIdx+removeCount>length?length-startIdx:removeCount;var len=length-removeCount;for(i=startIdx;ithis.maxAge){this.remove(key);return false}return true};LRU.prototype.get=function(key){if(typeof key!=="string")key=""+key;if(!this.cache.hasOwnProperty(key))return;var element=this.cache[key];if(!this._checkAge(key,element))return;if(this.head!==key){if(key===this.tail){this.tail=element.next;this.cache[this.tail].prev=null}else{this.cache[element.prev].next=element.next}this.cache[element.next].prev=element.prev;this.cache[this.head].next=key;element.prev=this.head;element.next=null;this.head=key}return element.value};LRU.prototype.evict=function(){if(!this.tail)return;this.remove(this.tail)}},{}],143:[function(require,module,exports){var assert=require("nanoassert");var morph=require("./lib/morph");var TEXT_NODE=3;module.exports=nanomorph;function nanomorph(oldTree,newTree,options){assert.equal(typeof oldTree,"object","nanomorph: oldTree should be an object");assert.equal(typeof newTree,"object","nanomorph: newTree should be an object");if(options&&options.childrenOnly){updateChildren(newTree,oldTree);return oldTree}assert.notEqual(newTree.nodeType,11,"nanomorph: newTree should have one root node (which is not a DocumentFragment)");return walk(newTree,oldTree)}function walk(newNode,oldNode){if(!oldNode){return newNode}else if(!newNode){return null}else if(newNode.isSameNode&&newNode.isSameNode(oldNode)){return oldNode}else if(newNode.tagName!==oldNode.tagName||getComponentId(newNode)!==getComponentId(oldNode)){return newNode}else{morph(newNode,oldNode);updateChildren(newNode,oldNode);return oldNode}}function getComponentId(node){return node.dataset?node.dataset.nanomorphComponentId:undefined}function updateChildren(newNode,oldNode){var oldChild,newChild,morphed,oldMatch;var offset=0;for(var i=0;;i++){oldChild=oldNode.childNodes[i];newChild=newNode.childNodes[i-offset];if(!oldChild&&!newChild){break}else if(!newChild){oldNode.removeChild(oldChild);i--}else if(!oldChild){oldNode.appendChild(newChild);offset++}else if(same(newChild,oldChild)){morphed=walk(newChild,oldChild);if(morphed!==oldChild){oldNode.replaceChild(morphed,oldChild);offset++}}else{oldMatch=null;for(var j=i;j=0;--i){attr=newAttrs[i];attrName=attr.name;attrNamespaceURI=attr.namespaceURI;attrValue=attr.value;if(attrNamespaceURI){attrName=attr.localName||attrName;fromValue=oldNode.getAttributeNS(attrNamespaceURI,attrName);if(fromValue!==attrValue){oldNode.setAttributeNS(attrNamespaceURI,attrName,attrValue)}}else{if(!oldNode.hasAttribute(attrName)){oldNode.setAttribute(attrName,attrValue)}else{fromValue=oldNode.getAttribute(attrName);if(fromValue!==attrValue){if(attrValue==="null"||attrValue==="undefined"){oldNode.removeAttribute(attrName)}else{oldNode.setAttribute(attrName,attrValue)}}}}}for(var j=oldAttrs.length-1;j>=0;--j){attr=oldAttrs[j];if(attr.specified!==false){attrName=attr.name;attrNamespaceURI=attr.namespaceURI;if(attrNamespaceURI){attrName=attr.localName||attrName;if(!newNode.hasAttributeNS(attrNamespaceURI,attrName)){oldNode.removeAttributeNS(attrNamespaceURI,attrName)}}else{if(!newNode.hasAttributeNS(null,attrName)){oldNode.removeAttribute(attrName)}}}}}function copyEvents(newNode,oldNode){for(var i=0;i0){cb=self.queue.shift();cb(idleDeadline)}self.scheduled=false;if(self.queue.length)self.schedule()}))};NanoScheduler.prototype.setTimeout=function(cb){setTimeout(cb,0,{timeRemaining:function(){return 1}})};module.exports=createScheduler},{assert:127}],150:[function(require,module,exports){var scheduler=require("nanoscheduler")();var assert=require("assert");var perf;nanotiming.disabled=true;try{perf=window.performance;nanotiming.disabled=window.localStorage.DISABLE_NANOTIMING==="true"||!perf.mark}catch(e){}module.exports=nanotiming;function nanotiming(name){assert.equal(typeof name,"string","nanotiming: name should be type string");if(nanotiming.disabled)return noop;var uuid=(perf.now()*1e4).toFixed()%Number.MAX_SAFE_INTEGER;var startName="start-"+uuid+"-"+name;perf.mark(startName);function end(cb){var endName="end-"+uuid+"-"+name;perf.mark(endName);scheduler.push((function(){var err=null;try{var measureName=name+" ["+uuid+"]";perf.measure(measureName,startName,endName);perf.clearMarks(startName);perf.clearMarks(endName)}catch(e){err=e}if(cb)cb(err,name)}))}end.uuid=uuid;return end}function noop(cb){if(cb){scheduler.push((function(){cb(new Error("nanotiming: performance API unavailable"))}))}}},{assert:127,nanoscheduler:149}],151:[function(require,module,exports){ /* object-assign (c) Sindre Sorhus @license MIT */ "use strict";var getOwnPropertySymbols=Object.getOwnPropertySymbols;var hasOwnProperty=Object.prototype.hasOwnProperty;var propIsEnumerable=Object.prototype.propertyIsEnumerable;function toObject(val){if(val===null||val===undefined){throw new TypeError("Object.assign cannot be called with null or undefined")}return Object(val)}function shouldUseNative(){try{if(!Object.assign){return false}var test1=new String("abc");test1[5]="de";if(Object.getOwnPropertyNames(test1)[0]==="5"){return false}var test2={};for(var i=0;i<10;i++){test2["_"+String.fromCharCode(i)]=i}var order2=Object.getOwnPropertyNames(test2).map((function(n){return test2[n]}));if(order2.join("")!=="0123456789"){return false}var test3={};"abcdefghijklmnopqrst".split("").forEach((function(letter){test3[letter]=letter}));if(Object.keys(Object.assign({},test3)).join("")!=="abcdefghijklmnopqrst"){return false}return true}catch(err){return false}}module.exports=shouldUseNative()?Object.assign:function(target,source){var from;var to=toObject(target);var symbols;for(var s=1;s2?arr.slice(2):arr;arr[0]=arr[0].replace(/^ {4}at /,"");return"\n"+arr.join("\n")}},{assert:22}],153:[function(require,module,exports){var hasMap=typeof Map==="function"&&Map.prototype;var mapSizeDescriptor=Object.getOwnPropertyDescriptor&&hasMap?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null;var mapSize=hasMap&&mapSizeDescriptor&&typeof mapSizeDescriptor.get==="function"?mapSizeDescriptor.get:null;var mapForEach=hasMap&&Map.prototype.forEach;var hasSet=typeof Set==="function"&&Set.prototype;var setSizeDescriptor=Object.getOwnPropertyDescriptor&&hasSet?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null;var setSize=hasSet&&setSizeDescriptor&&typeof setSizeDescriptor.get==="function"?setSizeDescriptor.get:null;var setForEach=hasSet&&Set.prototype.forEach;var hasWeakMap=typeof WeakMap==="function"&&WeakMap.prototype;var weakMapHas=hasWeakMap?WeakMap.prototype.has:null;var hasWeakSet=typeof WeakSet==="function"&&WeakSet.prototype;var weakSetHas=hasWeakSet?WeakSet.prototype.has:null;var hasWeakRef=typeof WeakRef==="function"&&WeakRef.prototype;var weakRefDeref=hasWeakRef?WeakRef.prototype.deref:null;var booleanValueOf=Boolean.prototype.valueOf;var objectToString=Object.prototype.toString;var functionToString=Function.prototype.toString;var $match=String.prototype.match;var $slice=String.prototype.slice;var $replace=String.prototype.replace;var $toUpperCase=String.prototype.toUpperCase;var $toLowerCase=String.prototype.toLowerCase;var $test=RegExp.prototype.test;var $concat=Array.prototype.concat;var $join=Array.prototype.join;var $arrSlice=Array.prototype.slice;var $floor=Math.floor;var bigIntValueOf=typeof BigInt==="function"?BigInt.prototype.valueOf:null;var gOPS=Object.getOwnPropertySymbols;var symToString=typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"?Symbol.prototype.toString:null;var hasShammedSymbols=typeof Symbol==="function"&&typeof Symbol.iterator==="object";var toStringTag=typeof Symbol==="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===hasShammedSymbols?"object":"symbol")?Symbol.toStringTag:null;var isEnumerable=Object.prototype.propertyIsEnumerable;var gPO=(typeof Reflect==="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(O){return O.__proto__}:null);function addNumericSeparator(num,str){if(num===Infinity||num===-Infinity||num!==num||num&&num>-1e3&&num<1e3||$test.call(/e/,str)){return str}var sepRegex=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof num==="number"){var int=num<0?-$floor(-num):$floor(num);if(int!==num){var intStr=String(int);var dec=$slice.call(str,intStr.length+1);return $replace.call(intStr,sepRegex,"$&_")+"."+$replace.call($replace.call(dec,/([0-9]{3})/g,"$&_"),/_$/,"")}}return $replace.call(str,sepRegex,"$&_")}var utilInspect=require("./util.inspect");var inspectCustom=utilInspect.custom;var inspectSymbol=isSymbol(inspectCustom)?inspectCustom:null;module.exports=function inspect_(obj,options,depth,seen){var opts=options||{};if(has(opts,"quoteStyle")&&(opts.quoteStyle!=="single"&&opts.quoteStyle!=="double")){throw new TypeError('option "quoteStyle" must be "single" or "double"')}if(has(opts,"maxStringLength")&&(typeof opts.maxStringLength==="number"?opts.maxStringLength<0&&opts.maxStringLength!==Infinity:opts.maxStringLength!==null)){throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`')}var customInspect=has(opts,"customInspect")?opts.customInspect:true;if(typeof customInspect!=="boolean"&&customInspect!=="symbol"){throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`")}if(has(opts,"indent")&&opts.indent!==null&&opts.indent!=="\t"&&!(parseInt(opts.indent,10)===opts.indent&&opts.indent>0)){throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`')}if(has(opts,"numericSeparator")&&typeof opts.numericSeparator!=="boolean"){throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`')}var numericSeparator=opts.numericSeparator;if(typeof obj==="undefined"){return"undefined"}if(obj===null){return"null"}if(typeof obj==="boolean"){return obj?"true":"false"}if(typeof obj==="string"){return inspectString(obj,opts)}if(typeof obj==="number"){if(obj===0){return Infinity/obj>0?"0":"-0"}var str=String(obj);return numericSeparator?addNumericSeparator(obj,str):str}if(typeof obj==="bigint"){var bigIntStr=String(obj)+"n";return numericSeparator?addNumericSeparator(obj,bigIntStr):bigIntStr}var maxDepth=typeof opts.depth==="undefined"?5:opts.depth;if(typeof depth==="undefined"){depth=0}if(depth>=maxDepth&&maxDepth>0&&typeof obj==="object"){return isArray(obj)?"[Array]":"[Object]"}var indent=getIndent(opts,depth);if(typeof seen==="undefined"){seen=[]}else if(indexOf(seen,obj)>=0){return"[Circular]"}function inspect(value,from,noIndent){if(from){seen=$arrSlice.call(seen);seen.push(from)}if(noIndent){var newOpts={depth:opts.depth};if(has(opts,"quoteStyle")){newOpts.quoteStyle=opts.quoteStyle}return inspect_(value,newOpts,depth+1,seen)}return inspect_(value,opts,depth+1,seen)}if(typeof obj==="function"&&!isRegExp(obj)){var name=nameOf(obj);var keys=arrObjKeys(obj,inspect);return"[Function"+(name?": "+name:" (anonymous)")+"]"+(keys.length>0?" { "+$join.call(keys,", ")+" }":"")}if(isSymbol(obj)){var symString=hasShammedSymbols?$replace.call(String(obj),/^(Symbol\(.*\))_[^)]*$/,"$1"):symToString.call(obj);return typeof obj==="object"&&!hasShammedSymbols?markBoxed(symString):symString}if(isElement(obj)){var s="<"+$toLowerCase.call(String(obj.nodeName));var attrs=obj.attributes||[];for(var i=0;i";return s}if(isArray(obj)){if(obj.length===0){return"[]"}var xs=arrObjKeys(obj,inspect);if(indent&&!singleLineValues(xs)){return"["+indentedJoin(xs,indent)+"]"}return"[ "+$join.call(xs,", ")+" ]"}if(isError(obj)){var parts=arrObjKeys(obj,inspect);if(!("cause"in Error.prototype)&&"cause"in obj&&!isEnumerable.call(obj,"cause")){return"{ ["+String(obj)+"] "+$join.call($concat.call("[cause]: "+inspect(obj.cause),parts),", ")+" }"}if(parts.length===0){return"["+String(obj)+"]"}return"{ ["+String(obj)+"] "+$join.call(parts,", ")+" }"}if(typeof obj==="object"&&customInspect){if(inspectSymbol&&typeof obj[inspectSymbol]==="function"&&utilInspect){return utilInspect(obj,{depth:maxDepth-depth})}else if(customInspect!=="symbol"&&typeof obj.inspect==="function"){return obj.inspect()}}if(isMap(obj)){var mapParts=[];if(mapForEach){mapForEach.call(obj,(function(value,key){mapParts.push(inspect(key,obj,true)+" => "+inspect(value,obj))}))}return collectionOf("Map",mapSize.call(obj),mapParts,indent)}if(isSet(obj)){var setParts=[];if(setForEach){setForEach.call(obj,(function(value){setParts.push(inspect(value,obj))}))}return collectionOf("Set",setSize.call(obj),setParts,indent)}if(isWeakMap(obj)){return weakCollectionOf("WeakMap")}if(isWeakSet(obj)){return weakCollectionOf("WeakSet")}if(isWeakRef(obj)){return weakCollectionOf("WeakRef")}if(isNumber(obj)){return markBoxed(inspect(Number(obj)))}if(isBigInt(obj)){return markBoxed(inspect(bigIntValueOf.call(obj)))}if(isBoolean(obj)){return markBoxed(booleanValueOf.call(obj))}if(isString(obj)){return markBoxed(inspect(String(obj)))}if(!isDate(obj)&&!isRegExp(obj)){var ys=arrObjKeys(obj,inspect);var isPlainObject=gPO?gPO(obj)===Object.prototype:obj instanceof Object||obj.constructor===Object;var protoTag=obj instanceof Object?"":"null prototype";var stringTag=!isPlainObject&&toStringTag&&Object(obj)===obj&&toStringTag in obj?$slice.call(toStr(obj),8,-1):protoTag?"Object":"";var constructorTag=isPlainObject||typeof obj.constructor!=="function"?"":obj.constructor.name?obj.constructor.name+" ":"";var tag=constructorTag+(stringTag||protoTag?"["+$join.call($concat.call([],stringTag||[],protoTag||[]),": ")+"] ":"");if(ys.length===0){return tag+"{}"}if(indent){return tag+"{"+indentedJoin(ys,indent)+"}"}return tag+"{ "+$join.call(ys,", ")+" }"}return String(obj)};function wrapQuotes(s,defaultStyle,opts){var quoteChar=(opts.quoteStyle||defaultStyle)==="double"?'"':"'";return quoteChar+s+quoteChar}function quote(s){return $replace.call(String(s),/"/g,""")}function isArray(obj){return toStr(obj)==="[object Array]"&&(!toStringTag||!(typeof obj==="object"&&toStringTag in obj))}function isDate(obj){return toStr(obj)==="[object Date]"&&(!toStringTag||!(typeof obj==="object"&&toStringTag in obj))}function isRegExp(obj){return toStr(obj)==="[object RegExp]"&&(!toStringTag||!(typeof obj==="object"&&toStringTag in obj))}function isError(obj){return toStr(obj)==="[object Error]"&&(!toStringTag||!(typeof obj==="object"&&toStringTag in obj))}function isString(obj){return toStr(obj)==="[object String]"&&(!toStringTag||!(typeof obj==="object"&&toStringTag in obj))}function isNumber(obj){return toStr(obj)==="[object Number]"&&(!toStringTag||!(typeof obj==="object"&&toStringTag in obj))}function isBoolean(obj){return toStr(obj)==="[object Boolean]"&&(!toStringTag||!(typeof obj==="object"&&toStringTag in obj))}function isSymbol(obj){if(hasShammedSymbols){return obj&&typeof obj==="object"&&obj instanceof Symbol}if(typeof obj==="symbol"){return true}if(!obj||typeof obj!=="object"||!symToString){return false}try{symToString.call(obj);return true}catch(e){}return false}function isBigInt(obj){if(!obj||typeof obj!=="object"||!bigIntValueOf){return false}try{bigIntValueOf.call(obj);return true}catch(e){}return false}var hasOwn=Object.prototype.hasOwnProperty||function(key){return key in this};function has(obj,key){return hasOwn.call(obj,key)}function toStr(obj){return objectToString.call(obj)}function nameOf(f){if(f.name){return f.name}var m=$match.call(functionToString.call(f),/^function\s*([\w$]+)/);if(m){return m[1]}return null}function indexOf(xs,x){if(xs.indexOf){return xs.indexOf(x)}for(var i=0,l=xs.length;iopts.maxStringLength){var remaining=str.length-opts.maxStringLength;var trailer="... "+remaining+" more character"+(remaining>1?"s":"");return inspectString($slice.call(str,0,opts.maxStringLength),opts)+trailer}var s=$replace.call($replace.call(str,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,lowbyte);return wrapQuotes(s,"single",opts)}function lowbyte(c){var n=c.charCodeAt(0);var x={8:"b",9:"t",10:"n",12:"f",13:"r"}[n];if(x){return"\\"+x}return"\\x"+(n<16?"0":"")+$toUpperCase.call(n.toString(16))}function markBoxed(str){return"Object("+str+")"}function weakCollectionOf(type){return type+" { ? }"}function collectionOf(type,size,entries,indent){var joinedEntries=indent?indentedJoin(entries,indent):$join.call(entries,", ");return type+" ("+size+") {"+joinedEntries+"}"}function singleLineValues(xs){for(var i=0;i=0){return false}}return true}function getIndent(opts,depth){var baseIndent;if(opts.indent==="\t"){baseIndent="\t"}else if(typeof opts.indent==="number"&&opts.indent>0){baseIndent=$join.call(Array(opts.indent+1)," ")}else{return null}return{base:baseIndent,prev:$join.call(Array(depth+1),baseIndent)}}function indentedJoin(xs,indent){if(xs.length===0){return""}var lineJoiner="\n"+indent.prev+indent.base;return lineJoiner+$join.call(xs,","+lineJoiner)+"\n"+indent.prev}function arrObjKeys(obj,inspect){var isArr=isArray(obj);var xs=[];if(isArr){xs.length=obj.length;for(var i=0;i0){eachMutation(nodes[i].childNodes,fn)}}}},{"global/document":87,"global/window":88}],155:[function(require,module,exports){var scheduler=require("nanoscheduler")();var assert=require("assert");var entryTypes=["frame","measure","navigation","resource","longtask"];module.exports=onPerformance;function onPerformance(cb){assert.equal(typeof cb,"function","on-performance: cb should be type function");var PerformanceObserver=typeof window!=="undefined"&&window.PerformanceObserver;if(!PerformanceObserver)return;if(window._onperformance){window._onperformance.push(cb);return stop}window._onperformance=[cb];var observer=new PerformanceObserver(parseEntries);setTimeout((function(){parseEntries(window.performance);observer.observe({entryTypes:entryTypes})}),0);return stop;function stop(){window._onperformance.splice(window._onperformance.indexOf(cb),1)}function parseEntries(list){list.getEntries().forEach((function(entry){scheduler.push((function(){clear(entry);window._onperformance.forEach((function(cb){cb(entry)}))}))}))}function clear(entry){var type=entry.entryType;if(type==="measure")window.performance.clearMeasures(entry.name);else if(type==="resource")window.performance.clearResourceTimings()}}},{assert:127,nanoscheduler:149}],156:[function(require,module,exports){exports.encode=function(obj){var str="";for(var i in obj){if(obj.hasOwnProperty(i)){if(str.length)str+="&";str+=encodeURIComponent(i)+"="+encodeURIComponent(obj[i])}}return str};exports.decode=function(qs){var qry={};var pairs=qs.split("&");for(var i=0,l=pairs.length;i=2?pluck(path)(object):pluck(path)}function pluck(path){path=typeof path==="string"?String(path).trim().split("."):path;if(path.length<2){path=path[0];return pluckSingle}else{var l=path.length;return pluckPath}function pluckSingle(object){return object[path]}function pluckPath(object){for(var i=0;i=10||num%1===0){return(neg?"-":"")+num.toFixed(0)+" "+unit}else{return(neg?"-":"")+num.toFixed(1)+" "+unit}}},{}],160:[function(require,module,exports){var process=module.exports={};var cachedSetTimeout;var cachedClearTimeout;function defaultSetTimout(){throw new Error("setTimeout has not been defined")}function defaultClearTimeout(){throw new Error("clearTimeout has not been defined")}(function(){try{if(typeof setTimeout==="function"){cachedSetTimeout=setTimeout}else{cachedSetTimeout=defaultSetTimout}}catch(e){cachedSetTimeout=defaultSetTimout}try{if(typeof clearTimeout==="function"){cachedClearTimeout=clearTimeout}else{cachedClearTimeout=defaultClearTimeout}}catch(e){cachedClearTimeout=defaultClearTimeout}})();function runTimeout(fun){if(cachedSetTimeout===setTimeout){return setTimeout(fun,0)}if((cachedSetTimeout===defaultSetTimout||!cachedSetTimeout)&&setTimeout){cachedSetTimeout=setTimeout;return setTimeout(fun,0)}try{return cachedSetTimeout(fun,0)}catch(e){try{return cachedSetTimeout.call(null,fun,0)}catch(e){return cachedSetTimeout.call(this,fun,0)}}}function runClearTimeout(marker){if(cachedClearTimeout===clearTimeout){return clearTimeout(marker)}if((cachedClearTimeout===defaultClearTimeout||!cachedClearTimeout)&&clearTimeout){cachedClearTimeout=clearTimeout;return clearTimeout(marker)}try{return cachedClearTimeout(marker)}catch(e){try{return cachedClearTimeout.call(null,marker)}catch(e){return cachedClearTimeout.call(this,marker)}}}var queue=[];var draining=false;var currentQueue;var queueIndex=-1;function cleanUpNextTick(){if(!draining||!currentQueue){return}draining=false;if(currentQueue.length){queue=currentQueue.concat(queue)}else{queueIndex=-1}if(queue.length){drainQueue()}}function drainQueue(){if(draining){return}var timeout=runTimeout(cleanUpNextTick);draining=true;var len=queue.length;while(len){currentQueue=queue;queue=[];while(++queueIndex1){for(var i=1;i-1){return val.split(",")}return val};var isoSentinel="utf8=%26%2310003%3B";var charsetSentinel="utf8=%E2%9C%93";var parseValues=function parseQueryStringValues(str,options){var obj={__proto__:null};var cleanStr=options.ignoreQueryPrefix?str.replace(/^\?/,""):str;var limit=options.parameterLimit===Infinity?undefined:options.parameterLimit;var parts=cleanStr.split(options.delimiter,limit);var skipIndex=-1;var i;var charset=options.charset;if(options.charsetSentinel){for(i=0;i-1){val=isArray(val)?[val]:val}if(has.call(obj,key)){obj[key]=utils.combine(obj[key],val)}else{obj[key]=val}}return obj};var parseObject=function(chain,val,options,valuesParsed){var leaf=valuesParsed?val:parseArrayValue(val,options);for(var i=chain.length-1;i>=0;--i){var obj;var root=chain[i];if(root==="[]"&&options.parseArrays){obj=[].concat(leaf)}else{obj=options.plainObjects?Object.create(null):{};var cleanRoot=root.charAt(0)==="["&&root.charAt(root.length-1)==="]"?root.slice(1,-1):root;var index=parseInt(cleanRoot,10);if(!options.parseArrays&&cleanRoot===""){obj={0:leaf}}else if(!isNaN(index)&&root!==cleanRoot&&String(index)===cleanRoot&&index>=0&&(options.parseArrays&&index<=options.arrayLimit)){obj=[];obj[index]=leaf}else if(cleanRoot!=="__proto__"){obj[cleanRoot]=leaf}}leaf=obj}return leaf};var parseKeys=function parseQueryStringKeys(givenKey,val,options,valuesParsed){if(!givenKey){return}var key=options.allowDots?givenKey.replace(/\.([^.[]+)/g,"[$1]"):givenKey;var brackets=/(\[[^[\]]*])/;var child=/(\[[^[\]]*])/g;var segment=options.depth>0&&brackets.exec(key);var parent=segment?key.slice(0,segment.index):key;var keys=[];if(parent){if(!options.plainObjects&&has.call(Object.prototype,parent)){if(!options.allowPrototypes){return}}keys.push(parent)}var i=0;while(options.depth>0&&(segment=child.exec(key))!==null&&i0?obj.join(",")||null:void undefined}]}else if(isArray(filter)){objKeys=filter}else{var keys=Object.keys(obj);objKeys=sort?keys.sort(sort):keys}var adjustedPrefix=commaRoundTrip&&isArray(obj)&&obj.length===1?prefix+"[]":prefix;for(var j=0;j0?prefix+joined:""}},{"./formats":161,"./utils":165,"side-channel":180}],165:[function(require,module,exports){"use strict";var formats=require("./formats");var has=Object.prototype.hasOwnProperty;var isArray=Array.isArray;var hexTable=function(){var array=[];for(var i=0;i<256;++i){array.push("%"+((i<16?"0":"")+i.toString(16)).toUpperCase())}return array}();var compactQueue=function compactQueue(queue){while(queue.length>1){var item=queue.pop();var obj=item.obj[item.prop];if(isArray(obj)){var compacted=[];for(var j=0;j=48&&c<=57||c>=65&&c<=90||c>=97&&c<=122||format===formats.RFC1738&&(c===40||c===41)){out+=string.charAt(i);continue}if(c<128){out=out+hexTable[c];continue}if(c<2048){out=out+(hexTable[192|c>>6]+hexTable[128|c&63]);continue}if(c<55296||c>=57344){out=out+(hexTable[224|c>>12]+hexTable[128|c>>6&63]+hexTable[128|c&63]);continue}i+=1;c=65536+((c&1023)<<10|string.charCodeAt(i)&1023);out+=hexTable[240|c>>18]+hexTable[128|c>>12&63]+hexTable[128|c>>6&63]+hexTable[128|c&63]}return out};var compact=function compact(value){var queue=[{obj:{o:value},prop:"o"}];var refs=[];for(var i=0;i */ let promise;module.exports=typeof queueMicrotask==="function"?queueMicrotask.bind(typeof window!=="undefined"?window:global):cb=>(promise||(promise=Promise.resolve())).then(cb).catch((err=>setTimeout((()=>{throw err}),0)))}).call(this)}).call(this,typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{}],167:[function(require,module,exports){(function(process,global){(function(){"use strict";var MAX_BYTES=65536;var MAX_UINT32=4294967295;function oldBrowser(){throw new Error("Secure random number generation is not supported by this browser.\nUse Chrome, Firefox or Internet Explorer 11")}var Buffer=require("safe-buffer").Buffer;var crypto=global.crypto||global.msCrypto;if(crypto&&crypto.getRandomValues){module.exports=randomBytes}else{module.exports=oldBrowser}function randomBytes(size,cb){if(size>MAX_UINT32)throw new RangeError("requested too many random bytes");var bytes=Buffer.allocUnsafe(size);if(size>0){if(size>MAX_BYTES){for(var generated=0;generated=length||removeCount<=0||startIdx<0){return}removeCount=startIdx+removeCount>length?length-startIdx:removeCount;var len=length-removeCount;for(i=startIdx;i */ var buffer=require("buffer");var Buffer=buffer.Buffer;function copyProps(src,dst){for(var key in src){dst[key]=src[key]}}if(Buffer.from&&Buffer.alloc&&Buffer.allocUnsafe&&Buffer.allocUnsafeSlow){module.exports=buffer}else{copyProps(buffer,exports);exports.Buffer=SafeBuffer}function SafeBuffer(arg,encodingOrOffset,length){return Buffer(arg,encodingOrOffset,length)}SafeBuffer.prototype=Object.create(Buffer.prototype);copyProps(Buffer,SafeBuffer);SafeBuffer.from=function(arg,encodingOrOffset,length){if(typeof arg==="number"){throw new TypeError("Argument must not be a number")}return Buffer(arg,encodingOrOffset,length)};SafeBuffer.alloc=function(size,fill,encoding){if(typeof size!=="number"){throw new TypeError("Argument must be a number")}var buf=Buffer(size);if(fill!==undefined){if(typeof encoding==="string"){buf.fill(fill,encoding)}else{buf.fill(fill)}}else{buf.fill(0)}return buf};SafeBuffer.allocUnsafe=function(size){if(typeof size!=="number"){throw new TypeError("Argument must be a number")}return Buffer(size)};SafeBuffer.allocUnsafeSlow=function(size){if(typeof size!=="number"){throw new TypeError("Argument must be a number")}return buffer.SlowBuffer(size)}},{buffer:35}],170:[function(require,module,exports){module.exports=scrollToAnchor;function scrollToAnchor(anchor,options){if(anchor){try{var el=document.querySelector(anchor);if(el)el.scrollIntoView(options)}catch(e){}}}},{}],171:[function(require,module,exports){"use strict";module.exports=require("./lib/index")},{"./lib/index":175}],172:[function(require,module,exports){"use strict";var randomFromSeed=require("./random/random-from-seed");var ORIGINAL="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_-";var alphabet;var previousSeed;var shuffled;function reset(){shuffled=false}function setCharacters(_alphabet_){if(!_alphabet_){if(alphabet!==ORIGINAL){alphabet=ORIGINAL;reset()}return}if(_alphabet_===alphabet){return}if(_alphabet_.length!==ORIGINAL.length){throw new Error("Custom alphabet for shortid must be "+ORIGINAL.length+" unique characters. You submitted "+_alphabet_.length+" characters: "+_alphabet_)}var unique=_alphabet_.split("").filter((function(item,ind,arr){return ind!==arr.lastIndexOf(item)}));if(unique.length){throw new Error("Custom alphabet for shortid must be "+ORIGINAL.length+" unique characters. These characters were not unique: "+unique.join(", "))}alphabet=_alphabet_;reset()}function characters(_alphabet_){setCharacters(_alphabet_);return alphabet}function setSeed(seed){randomFromSeed.seed(seed);if(previousSeed!==seed){reset();previousSeed=seed}}function shuffle(){if(!alphabet){setCharacters(ORIGINAL)}var sourceArray=alphabet.split("");var targetArray=[];var r=randomFromSeed.nextValue();var characterIndex;while(sourceArray.length>0){r=randomFromSeed.nextValue();characterIndex=Math.floor(r*sourceArray.length);targetArray.push(sourceArray.splice(characterIndex,1)[0])}return targetArray.join("")}function getShuffled(){if(shuffled){return shuffled}shuffled=shuffle();return shuffled}function lookup(index){var alphabetShuffled=getShuffled();return alphabetShuffled[index]}function get(){return alphabet||ORIGINAL}module.exports={get:get,characters:characters,seed:setSeed,lookup:lookup,shuffled:getShuffled}},{"./random/random-from-seed":178}],173:[function(require,module,exports){"use strict";var generate=require("./generate");var alphabet=require("./alphabet");var REDUCE_TIME=1567752802062;var version=7;var counter;var previousSeconds;function build(clusterWorkerId){var str="";var seconds=Math.floor((Date.now()-REDUCE_TIME)*.001);if(seconds===previousSeconds){counter++}else{counter=0;previousSeconds=seconds}str=str+generate(version);str=str+generate(clusterWorkerId);if(counter>0){str=str+generate(counter)}str=str+generate(seconds);return str}module.exports=build},{"./alphabet":172,"./generate":174}],174:[function(require,module,exports){"use strict";var alphabet=require("./alphabet");var random=require("./random/random-byte");var format=require("nanoid/format");function generate(number){var loopCounter=0;var done;var str="";while(!done){str=str+format(random,alphabet.get(),1);done=number */ const debug=require("debug")("simple-peer");const getBrowserRTC=require("get-browser-rtc");const randombytes=require("randombytes");const stream=require("readable-stream");const queueMicrotask=require("queue-microtask");const errCode=require("err-code");const{Buffer:Buffer}=require("buffer");const MAX_BUFFERED_AMOUNT=64*1024;const ICECOMPLETE_TIMEOUT=5*1e3;const CHANNEL_CLOSING_TIMEOUT=5*1e3;function filterTrickle(sdp){return sdp.replace(/a=ice-options:trickle\s\n/g,"")}function warn(message){console.warn(message)}class Peer extends stream.Duplex{constructor(opts){opts=Object.assign({allowHalfOpen:false},opts);super(opts);this._id=randombytes(4).toString("hex").slice(0,7);this._debug("new peer %o",opts);this.channelName=opts.initiator?opts.channelName||randombytes(20).toString("hex"):null;this.initiator=opts.initiator||false;this.channelConfig=opts.channelConfig||Peer.channelConfig;this.channelNegotiated=this.channelConfig.negotiated;this.config=Object.assign({},Peer.config,opts.config);this.offerOptions=opts.offerOptions||{};this.answerOptions=opts.answerOptions||{};this.sdpTransform=opts.sdpTransform||(sdp=>sdp);this.streams=opts.streams||(opts.stream?[opts.stream]:[]);this.trickle=opts.trickle!==undefined?opts.trickle:true;this.allowHalfTrickle=opts.allowHalfTrickle!==undefined?opts.allowHalfTrickle:false;this.iceCompleteTimeout=opts.iceCompleteTimeout||ICECOMPLETE_TIMEOUT;this.destroyed=false;this.destroying=false;this._connected=false;this.remoteAddress=undefined;this.remoteFamily=undefined;this.remotePort=undefined;this.localAddress=undefined;this.localFamily=undefined;this.localPort=undefined;this._wrtc=opts.wrtc&&typeof opts.wrtc==="object"?opts.wrtc:getBrowserRTC();if(!this._wrtc){if(typeof window==="undefined"){throw errCode(new Error("No WebRTC support: Specify `opts.wrtc` option in this environment"),"ERR_WEBRTC_SUPPORT")}else{throw errCode(new Error("No WebRTC support: Not a supported browser"),"ERR_WEBRTC_SUPPORT")}}this._pcReady=false;this._channelReady=false;this._iceComplete=false;this._iceCompleteTimer=null;this._channel=null;this._pendingCandidates=[];this._isNegotiating=false;this._firstNegotiation=true;this._batchedNegotiation=false;this._queuedNegotiation=false;this._sendersAwaitingStable=[];this._senderMap=new Map;this._closingInterval=null;this._remoteTracks=[];this._remoteStreams=[];this._chunk=null;this._cb=null;this._interval=null;try{this._pc=new this._wrtc.RTCPeerConnection(this.config)}catch(err){this.destroy(errCode(err,"ERR_PC_CONSTRUCTOR"));return}this._isReactNativeWebrtc=typeof this._pc._peerConnectionId==="number";this._pc.oniceconnectionstatechange=()=>{this._onIceStateChange()};this._pc.onicegatheringstatechange=()=>{this._onIceStateChange()};this._pc.onconnectionstatechange=()=>{this._onConnectionStateChange()};this._pc.onsignalingstatechange=()=>{this._onSignalingStateChange()};this._pc.onicecandidate=event=>{this._onIceCandidate(event)};if(typeof this._pc.peerIdentity==="object"){this._pc.peerIdentity.catch((err=>{this.destroy(errCode(err,"ERR_PC_PEER_IDENTITY"))}))}if(this.initiator||this.channelNegotiated){this._setupData({channel:this._pc.createDataChannel(this.channelName,this.channelConfig)})}else{this._pc.ondatachannel=event=>{this._setupData(event)}}if(this.streams){this.streams.forEach((stream=>{this.addStream(stream)}))}this._pc.ontrack=event=>{this._onTrack(event)};this._debug("initial negotiation");this._needsNegotiation();this._onFinishBound=()=>{this._onFinish()};this.once("finish",this._onFinishBound)}get bufferSize(){return this._channel&&this._channel.bufferedAmount||0}get connected(){return this._connected&&this._channel.readyState==="open"}address(){return{port:this.localPort,family:this.localFamily,address:this.localAddress}}signal(data){if(this.destroying)return;if(this.destroyed)throw errCode(new Error("cannot signal after peer is destroyed"),"ERR_DESTROYED");if(typeof data==="string"){try{data=JSON.parse(data)}catch(err){data={}}}this._debug("signal()");if(data.renegotiate&&this.initiator){this._debug("got request to renegotiate");this._needsNegotiation()}if(data.transceiverRequest&&this.initiator){this._debug("got request for transceiver");this.addTransceiver(data.transceiverRequest.kind,data.transceiverRequest.init)}if(data.candidate){if(this._pc.remoteDescription&&this._pc.remoteDescription.type){this._addIceCandidate(data.candidate)}else{this._pendingCandidates.push(data.candidate)}}if(data.sdp){this._pc.setRemoteDescription(new this._wrtc.RTCSessionDescription(data)).then((()=>{if(this.destroyed)return;this._pendingCandidates.forEach((candidate=>{this._addIceCandidate(candidate)}));this._pendingCandidates=[];if(this._pc.remoteDescription.type==="offer")this._createAnswer()})).catch((err=>{this.destroy(errCode(err,"ERR_SET_REMOTE_DESCRIPTION"))}))}if(!data.sdp&&!data.candidate&&!data.renegotiate&&!data.transceiverRequest){this.destroy(errCode(new Error("signal() called with invalid signal data"),"ERR_SIGNALING"))}}_addIceCandidate(candidate){const iceCandidateObj=new this._wrtc.RTCIceCandidate(candidate);this._pc.addIceCandidate(iceCandidateObj).catch((err=>{if(!iceCandidateObj.address||iceCandidateObj.address.endsWith(".local")){warn("Ignoring unsupported ICE candidate.")}else{this.destroy(errCode(err,"ERR_ADD_ICE_CANDIDATE"))}}))}send(chunk){if(this.destroying)return;if(this.destroyed)throw errCode(new Error("cannot send after peer is destroyed"),"ERR_DESTROYED");this._channel.send(chunk)}addTransceiver(kind,init){if(this.destroying)return;if(this.destroyed)throw errCode(new Error("cannot addTransceiver after peer is destroyed"),"ERR_DESTROYED");this._debug("addTransceiver()");if(this.initiator){try{this._pc.addTransceiver(kind,init);this._needsNegotiation()}catch(err){this.destroy(errCode(err,"ERR_ADD_TRANSCEIVER"))}}else{this.emit("signal",{type:"transceiverRequest",transceiverRequest:{kind:kind,init:init}})}}addStream(stream){if(this.destroying)return;if(this.destroyed)throw errCode(new Error("cannot addStream after peer is destroyed"),"ERR_DESTROYED");this._debug("addStream()");stream.getTracks().forEach((track=>{this.addTrack(track,stream)}))}addTrack(track,stream){if(this.destroying)return;if(this.destroyed)throw errCode(new Error("cannot addTrack after peer is destroyed"),"ERR_DESTROYED");this._debug("addTrack()");const submap=this._senderMap.get(track)||new Map;let sender=submap.get(stream);if(!sender){sender=this._pc.addTrack(track,stream);submap.set(stream,sender);this._senderMap.set(track,submap);this._needsNegotiation()}else if(sender.removed){throw errCode(new Error("Track has been removed. You should enable/disable tracks that you want to re-add."),"ERR_SENDER_REMOVED")}else{throw errCode(new Error("Track has already been added to that stream."),"ERR_SENDER_ALREADY_ADDED")}}replaceTrack(oldTrack,newTrack,stream){if(this.destroying)return;if(this.destroyed)throw errCode(new Error("cannot replaceTrack after peer is destroyed"),"ERR_DESTROYED");this._debug("replaceTrack()");const submap=this._senderMap.get(oldTrack);const sender=submap?submap.get(stream):null;if(!sender){throw errCode(new Error("Cannot replace track that was never added."),"ERR_TRACK_NOT_ADDED")}if(newTrack)this._senderMap.set(newTrack,submap);if(sender.replaceTrack!=null){sender.replaceTrack(newTrack)}else{this.destroy(errCode(new Error("replaceTrack is not supported in this browser"),"ERR_UNSUPPORTED_REPLACETRACK"))}}removeTrack(track,stream){if(this.destroying)return;if(this.destroyed)throw errCode(new Error("cannot removeTrack after peer is destroyed"),"ERR_DESTROYED");this._debug("removeSender()");const submap=this._senderMap.get(track);const sender=submap?submap.get(stream):null;if(!sender){throw errCode(new Error("Cannot remove track that was never added."),"ERR_TRACK_NOT_ADDED")}try{sender.removed=true;this._pc.removeTrack(sender)}catch(err){if(err.name==="NS_ERROR_UNEXPECTED"){this._sendersAwaitingStable.push(sender)}else{this.destroy(errCode(err,"ERR_REMOVE_TRACK"))}}this._needsNegotiation()}removeStream(stream){if(this.destroying)return;if(this.destroyed)throw errCode(new Error("cannot removeStream after peer is destroyed"),"ERR_DESTROYED");this._debug("removeSenders()");stream.getTracks().forEach((track=>{this.removeTrack(track,stream)}))}_needsNegotiation(){this._debug("_needsNegotiation");if(this._batchedNegotiation)return;this._batchedNegotiation=true;queueMicrotask((()=>{this._batchedNegotiation=false;if(this.initiator||!this._firstNegotiation){this._debug("starting batched negotiation");this.negotiate()}else{this._debug("non-initiator initial negotiation request discarded")}this._firstNegotiation=false}))}negotiate(){if(this.destroying)return;if(this.destroyed)throw errCode(new Error("cannot negotiate after peer is destroyed"),"ERR_DESTROYED");if(this.initiator){if(this._isNegotiating){this._queuedNegotiation=true;this._debug("already negotiating, queueing")}else{this._debug("start negotiation");setTimeout((()=>{this._createOffer()}),0)}}else{if(this._isNegotiating){this._queuedNegotiation=true;this._debug("already negotiating, queueing")}else{this._debug("requesting negotiation from initiator");this.emit("signal",{type:"renegotiate",renegotiate:true})}}this._isNegotiating=true}destroy(err){this._destroy(err,(()=>{}))}_destroy(err,cb){if(this.destroyed||this.destroying)return;this.destroying=true;this._debug("destroying (error: %s)",err&&(err.message||err));queueMicrotask((()=>{this.destroyed=true;this.destroying=false;this._debug("destroy (error: %s)",err&&(err.message||err));this.readable=this.writable=false;if(!this._readableState.ended)this.push(null);if(!this._writableState.finished)this.end();this._connected=false;this._pcReady=false;this._channelReady=false;this._remoteTracks=null;this._remoteStreams=null;this._senderMap=null;clearInterval(this._closingInterval);this._closingInterval=null;clearInterval(this._interval);this._interval=null;this._chunk=null;this._cb=null;if(this._onFinishBound)this.removeListener("finish",this._onFinishBound);this._onFinishBound=null;if(this._channel){try{this._channel.close()}catch(err){}this._channel.onmessage=null;this._channel.onopen=null;this._channel.onclose=null;this._channel.onerror=null}if(this._pc){try{this._pc.close()}catch(err){}this._pc.oniceconnectionstatechange=null;this._pc.onicegatheringstatechange=null;this._pc.onsignalingstatechange=null;this._pc.onicecandidate=null;this._pc.ontrack=null;this._pc.ondatachannel=null}this._pc=null;this._channel=null;if(err)this.emit("error",err);this.emit("close");cb()}))}_setupData(event){if(!event.channel){return this.destroy(errCode(new Error("Data channel event is missing `channel` property"),"ERR_DATA_CHANNEL"))}this._channel=event.channel;this._channel.binaryType="arraybuffer";if(typeof this._channel.bufferedAmountLowThreshold==="number"){this._channel.bufferedAmountLowThreshold=MAX_BUFFERED_AMOUNT}this.channelName=this._channel.label;this._channel.onmessage=event=>{this._onChannelMessage(event)};this._channel.onbufferedamountlow=()=>{this._onChannelBufferedAmountLow()};this._channel.onopen=()=>{this._onChannelOpen()};this._channel.onclose=()=>{this._onChannelClose()};this._channel.onerror=event=>{const err=event.error instanceof Error?event.error:new Error(`Datachannel error: ${event.message} ${event.filename}:${event.lineno}:${event.colno}`);this.destroy(errCode(err,"ERR_DATA_CHANNEL"))};let isClosing=false;this._closingInterval=setInterval((()=>{if(this._channel&&this._channel.readyState==="closing"){if(isClosing)this._onChannelClose();isClosing=true}else{isClosing=false}}),CHANNEL_CLOSING_TIMEOUT)}_read(){}_write(chunk,encoding,cb){if(this.destroyed)return cb(errCode(new Error("cannot write after peer is destroyed"),"ERR_DATA_CHANNEL"));if(this._connected){try{this.send(chunk)}catch(err){return this.destroy(errCode(err,"ERR_DATA_CHANNEL"))}if(this._channel.bufferedAmount>MAX_BUFFERED_AMOUNT){this._debug("start backpressure: bufferedAmount %d",this._channel.bufferedAmount);this._cb=cb}else{cb(null)}}else{this._debug("write before connect");this._chunk=chunk;this._cb=cb}}_onFinish(){if(this.destroyed)return;const destroySoon=()=>{setTimeout((()=>this.destroy()),1e3)};if(this._connected){destroySoon()}else{this.once("connect",destroySoon)}}_startIceCompleteTimeout(){if(this.destroyed)return;if(this._iceCompleteTimer)return;this._debug("started iceComplete timeout");this._iceCompleteTimer=setTimeout((()=>{if(!this._iceComplete){this._iceComplete=true;this._debug("iceComplete timeout completed");this.emit("iceTimeout");this.emit("_iceComplete")}}),this.iceCompleteTimeout)}_createOffer(){if(this.destroyed)return;this._pc.createOffer(this.offerOptions).then((offer=>{if(this.destroyed)return;if(!this.trickle&&!this.allowHalfTrickle)offer.sdp=filterTrickle(offer.sdp);offer.sdp=this.sdpTransform(offer.sdp);const sendOffer=()=>{if(this.destroyed)return;const signal=this._pc.localDescription||offer;this._debug("signal");this.emit("signal",{type:signal.type,sdp:signal.sdp})};const onSuccess=()=>{this._debug("createOffer success");if(this.destroyed)return;if(this.trickle||this._iceComplete)sendOffer();else this.once("_iceComplete",sendOffer)};const onError=err=>{this.destroy(errCode(err,"ERR_SET_LOCAL_DESCRIPTION"))};this._pc.setLocalDescription(offer).then(onSuccess).catch(onError)})).catch((err=>{this.destroy(errCode(err,"ERR_CREATE_OFFER"))}))}_requestMissingTransceivers(){if(this._pc.getTransceivers){this._pc.getTransceivers().forEach((transceiver=>{if(!transceiver.mid&&transceiver.sender.track&&!transceiver.requested){transceiver.requested=true;this.addTransceiver(transceiver.sender.track.kind)}}))}}_createAnswer(){if(this.destroyed)return;this._pc.createAnswer(this.answerOptions).then((answer=>{if(this.destroyed)return;if(!this.trickle&&!this.allowHalfTrickle)answer.sdp=filterTrickle(answer.sdp);answer.sdp=this.sdpTransform(answer.sdp);const sendAnswer=()=>{if(this.destroyed)return;const signal=this._pc.localDescription||answer;this._debug("signal");this.emit("signal",{type:signal.type,sdp:signal.sdp});if(!this.initiator)this._requestMissingTransceivers()};const onSuccess=()=>{if(this.destroyed)return;if(this.trickle||this._iceComplete)sendAnswer();else this.once("_iceComplete",sendAnswer)};const onError=err=>{this.destroy(errCode(err,"ERR_SET_LOCAL_DESCRIPTION"))};this._pc.setLocalDescription(answer).then(onSuccess).catch(onError)})).catch((err=>{this.destroy(errCode(err,"ERR_CREATE_ANSWER"))}))}_onConnectionStateChange(){if(this.destroyed)return;if(this._pc.connectionState==="failed"){this.destroy(errCode(new Error("Connection failed."),"ERR_CONNECTION_FAILURE"))}}_onIceStateChange(){if(this.destroyed)return;const iceConnectionState=this._pc.iceConnectionState;const iceGatheringState=this._pc.iceGatheringState;this._debug("iceStateChange (connection: %s) (gathering: %s)",iceConnectionState,iceGatheringState);this.emit("iceStateChange",iceConnectionState,iceGatheringState);if(iceConnectionState==="connected"||iceConnectionState==="completed"){this._pcReady=true;this._maybeReady()}if(iceConnectionState==="failed"){this.destroy(errCode(new Error("Ice connection failed."),"ERR_ICE_CONNECTION_FAILURE"))}if(iceConnectionState==="closed"){this.destroy(errCode(new Error("Ice connection closed."),"ERR_ICE_CONNECTION_CLOSED"))}}getStats(cb){const flattenValues=report=>{if(Object.prototype.toString.call(report.values)==="[object Array]"){report.values.forEach((value=>{Object.assign(report,value)}))}return report};if(this._pc.getStats.length===0||this._isReactNativeWebrtc){this._pc.getStats().then((res=>{const reports=[];res.forEach((report=>{reports.push(flattenValues(report))}));cb(null,reports)}),(err=>cb(err)))}else if(this._pc.getStats.length>0){this._pc.getStats((res=>{if(this.destroyed)return;const reports=[];res.result().forEach((result=>{const report={};result.names().forEach((name=>{report[name]=result.stat(name)}));report.id=result.id;report.type=result.type;report.timestamp=result.timestamp;reports.push(flattenValues(report))}));cb(null,reports)}),(err=>cb(err)))}else{cb(null,[])}}_maybeReady(){this._debug("maybeReady pc %s channel %s",this._pcReady,this._channelReady);if(this._connected||this._connecting||!this._pcReady||!this._channelReady)return;this._connecting=true;const findCandidatePair=()=>{if(this.destroyed)return;this.getStats(((err,items)=>{if(this.destroyed)return;if(err)items=[];const remoteCandidates={};const localCandidates={};const candidatePairs={};let foundSelectedCandidatePair=false;items.forEach((item=>{if(item.type==="remotecandidate"||item.type==="remote-candidate"){remoteCandidates[item.id]=item}if(item.type==="localcandidate"||item.type==="local-candidate"){localCandidates[item.id]=item}if(item.type==="candidatepair"||item.type==="candidate-pair"){candidatePairs[item.id]=item}}));const setSelectedCandidatePair=selectedCandidatePair=>{foundSelectedCandidatePair=true;let local=localCandidates[selectedCandidatePair.localCandidateId];if(local&&(local.ip||local.address)){this.localAddress=local.ip||local.address;this.localPort=Number(local.port)}else if(local&&local.ipAddress){this.localAddress=local.ipAddress;this.localPort=Number(local.portNumber)}else if(typeof selectedCandidatePair.googLocalAddress==="string"){local=selectedCandidatePair.googLocalAddress.split(":");this.localAddress=local[0];this.localPort=Number(local[1])}if(this.localAddress){this.localFamily=this.localAddress.includes(":")?"IPv6":"IPv4"}let remote=remoteCandidates[selectedCandidatePair.remoteCandidateId];if(remote&&(remote.ip||remote.address)){this.remoteAddress=remote.ip||remote.address;this.remotePort=Number(remote.port)}else if(remote&&remote.ipAddress){this.remoteAddress=remote.ipAddress;this.remotePort=Number(remote.portNumber)}else if(typeof selectedCandidatePair.googRemoteAddress==="string"){remote=selectedCandidatePair.googRemoteAddress.split(":");this.remoteAddress=remote[0];this.remotePort=Number(remote[1])}if(this.remoteAddress){this.remoteFamily=this.remoteAddress.includes(":")?"IPv6":"IPv4"}this._debug("connect local: %s:%s remote: %s:%s",this.localAddress,this.localPort,this.remoteAddress,this.remotePort)};items.forEach((item=>{if(item.type==="transport"&&item.selectedCandidatePairId){setSelectedCandidatePair(candidatePairs[item.selectedCandidatePairId])}if(item.type==="googCandidatePair"&&item.googActiveConnection==="true"||(item.type==="candidatepair"||item.type==="candidate-pair")&&item.selected){setSelectedCandidatePair(item)}}));if(!foundSelectedCandidatePair&&(!Object.keys(candidatePairs).length||Object.keys(localCandidates).length)){setTimeout(findCandidatePair,100);return}else{this._connecting=false;this._connected=true}if(this._chunk){try{this.send(this._chunk)}catch(err){return this.destroy(errCode(err,"ERR_DATA_CHANNEL"))}this._chunk=null;this._debug('sent chunk from "write before connect"');const cb=this._cb;this._cb=null;cb(null)}if(typeof this._channel.bufferedAmountLowThreshold!=="number"){this._interval=setInterval((()=>this._onInterval()),150);if(this._interval.unref)this._interval.unref()}this._debug("connect");this.emit("connect")}))};findCandidatePair()}_onInterval(){if(!this._cb||!this._channel||this._channel.bufferedAmount>MAX_BUFFERED_AMOUNT){return}this._onChannelBufferedAmountLow()}_onSignalingStateChange(){if(this.destroyed)return;if(this._pc.signalingState==="stable"){this._isNegotiating=false;this._debug("flushing sender queue",this._sendersAwaitingStable);this._sendersAwaitingStable.forEach((sender=>{this._pc.removeTrack(sender);this._queuedNegotiation=true}));this._sendersAwaitingStable=[];if(this._queuedNegotiation){this._debug("flushing negotiation queue");this._queuedNegotiation=false;this._needsNegotiation()}else{this._debug("negotiated");this.emit("negotiated")}}this._debug("signalingStateChange %s",this._pc.signalingState);this.emit("signalingStateChange",this._pc.signalingState)}_onIceCandidate(event){if(this.destroyed)return;if(event.candidate&&this.trickle){this.emit("signal",{type:"candidate",candidate:{candidate:event.candidate.candidate,sdpMLineIndex:event.candidate.sdpMLineIndex,sdpMid:event.candidate.sdpMid}})}else if(!event.candidate&&!this._iceComplete){this._iceComplete=true;this.emit("_iceComplete")}if(event.candidate){this._startIceCompleteTimeout()}}_onChannelMessage(event){if(this.destroyed)return;let data=event.data;if(data instanceof ArrayBuffer)data=Buffer.from(data);this.push(data)}_onChannelBufferedAmountLow(){if(this.destroyed||!this._cb)return;this._debug("ending backpressure: bufferedAmount %d",this._channel.bufferedAmount);const cb=this._cb;this._cb=null;cb(null)}_onChannelOpen(){if(this._connected||this.destroyed)return;this._debug("on channel open");this._channelReady=true;this._maybeReady()}_onChannelClose(){if(this.destroyed)return;this._debug("on channel close");this.destroy()}_onTrack(event){if(this.destroyed)return;event.streams.forEach((eventStream=>{this._debug("on track");this.emit("track",event.track,eventStream);this._remoteTracks.push({track:event.track,stream:eventStream});if(this._remoteStreams.some((remoteStream=>remoteStream.id===eventStream.id)))return;this._remoteStreams.push(eventStream);queueMicrotask((()=>{this._debug("on stream");this.emit("stream",eventStream)}))}))}_debug(){const args=[].slice.call(arguments);args[0]="["+this._id+"] "+args[0];debug.apply(null,args)}}Peer.WEBRTC_SUPPORT=!!getBrowserRTC();Peer.config={iceServers:[{urls:["stun:stun.l.google.com:19302","stun:global.stun.twilio.com:3478"]}],sdpSemantics:"unified-plan"};Peer.channelConfig={};module.exports=Peer},{buffer:35,debug:182,"err-code":80,"get-browser-rtc":85,"queue-microtask":166,randombytes:167,"readable-stream":199}],182:[function(require,module,exports){(function(process){(function(){exports.formatArgs=formatArgs;exports.save=save;exports.load=load;exports.useColors=useColors;exports.storage=localstorage();exports.destroy=(()=>{let warned=false;return()=>{if(!warned){warned=true;console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}}})();exports.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function useColors(){if(typeof window!=="undefined"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs)){return true}if(typeof navigator!=="undefined"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)){return false}return typeof document!=="undefined"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window!=="undefined"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator!=="undefined"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||typeof navigator!=="undefined"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function formatArgs(args){args[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+args[0]+(this.useColors?"%c ":" ")+"+"+module.exports.humanize(this.diff);if(!this.useColors){return}const c="color: "+this.color;args.splice(1,0,c,"color: inherit");let index=0;let lastC=0;args[0].replace(/%[a-zA-Z%]/g,(match=>{if(match==="%%"){return}index++;if(match==="%c"){lastC=index}}));args.splice(lastC,0,c)}exports.log=console.debug||console.log||(()=>{});function save(namespaces){try{if(namespaces){exports.storage.setItem("debug",namespaces)}else{exports.storage.removeItem("debug")}}catch(error){}}function load(){let r;try{r=exports.storage.getItem("debug")}catch(error){}if(!r&&typeof process!=="undefined"&&"env"in process){r=process.env.DEBUG}return r}function localstorage(){try{return localStorage}catch(error){}}module.exports=require("./common")(exports);const{formatters:formatters}=module.exports;formatters.j=function(v){try{return JSON.stringify(v)}catch(error){return"[UnexpectedJSONParseError]: "+error.message}}}).call(this)}).call(this,require("_process"))},{"./common":183,_process:160}],183:[function(require,module,exports){function setup(env){createDebug.debug=createDebug;createDebug.default=createDebug;createDebug.coerce=coerce;createDebug.disable=disable;createDebug.enable=enable;createDebug.enabled=enabled;createDebug.humanize=require("ms");createDebug.destroy=destroy;Object.keys(env).forEach((key=>{createDebug[key]=env[key]}));createDebug.names=[];createDebug.skips=[];createDebug.formatters={};function selectColor(namespace){let hash=0;for(let i=0;i{if(match==="%%"){return"%"}index++;const formatter=createDebug.formatters[format];if(typeof formatter==="function"){const val=args[index];match=formatter.call(self,val);args.splice(index,1);index--}return match}));createDebug.formatArgs.call(self,args);const logFn=self.log||createDebug.log;logFn.apply(self,args)}debug.namespace=namespace;debug.useColors=createDebug.useColors();debug.color=createDebug.selectColor(namespace);debug.extend=extend;debug.destroy=createDebug.destroy;Object.defineProperty(debug,"enabled",{enumerable:true,configurable:false,get:()=>{if(enableOverride!==null){return enableOverride}if(namespacesCache!==createDebug.namespaces){namespacesCache=createDebug.namespaces;enabledCache=createDebug.enabled(namespace)}return enabledCache},set:v=>{enableOverride=v}});if(typeof createDebug.init==="function"){createDebug.init(debug)}return debug}function extend(namespace,delimiter){const newDebug=createDebug(this.namespace+(typeof delimiter==="undefined"?":":delimiter)+namespace);newDebug.log=this.log;return newDebug}function enable(namespaces){createDebug.save(namespaces);createDebug.namespaces=namespaces;createDebug.names=[];createDebug.skips=[];let i;const split=(typeof namespaces==="string"?namespaces:"").split(/[\s,]+/);const len=split.length;for(i=0;i"-"+namespace))].join(",");createDebug.enable("");return namespaces}function enabled(name){if(name[name.length-1]==="*"){return true}let i;let len;for(i=0,len=createDebug.skips.length;i0){return parse(val)}else if(type==="number"&&isFinite(val)){return options.long?fmtLong(val):fmtShort(val)}throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(val))};function parse(str){str=String(str);if(str.length>100){return}var match=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(str);if(!match){return}var n=parseFloat(match[1]);var type=(match[2]||"ms").toLowerCase();switch(type){case"years":case"year":case"yrs":case"yr":case"y":return n*y;case"weeks":case"week":case"w":return n*w;case"days":case"day":case"d":return n*d;case"hours":case"hour":case"hrs":case"hr":case"h":return n*h;case"minutes":case"minute":case"mins":case"min":case"m":return n*m;case"seconds":case"second":case"secs":case"sec":case"s":return n*s;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return n;default:return undefined}}function fmtShort(ms){var msAbs=Math.abs(ms);if(msAbs>=d){return Math.round(ms/d)+"d"}if(msAbs>=h){return Math.round(ms/h)+"h"}if(msAbs>=m){return Math.round(ms/m)+"m"}if(msAbs>=s){return Math.round(ms/s)+"s"}return ms+"ms"}function fmtLong(ms){var msAbs=Math.abs(ms);if(msAbs>=d){return plural(ms,msAbs,d,"day")}if(msAbs>=h){return plural(ms,msAbs,h,"hour")}if(msAbs>=m){return plural(ms,msAbs,m,"minute")}if(msAbs>=s){return plural(ms,msAbs,s,"second")}return ms+" ms"}function plural(ms,msAbs,n,name){var isPlural=msAbs>=n*1.5;return Math.round(ms/n)+" "+name+(isPlural?"s":"")}},{}],185:[function(require,module,exports){"use strict";function _inheritsLoose(subClass,superClass){subClass.prototype=Object.create(superClass.prototype);subClass.prototype.constructor=subClass;subClass.__proto__=superClass}var codes={};function createErrorType(code,message,Base){if(!Base){Base=Error}function getMessage(arg1,arg2,arg3){if(typeof message==="string"){return message}else{return message(arg1,arg2,arg3)}}var NodeError=function(_Base){_inheritsLoose(NodeError,_Base);function NodeError(arg1,arg2,arg3){return _Base.call(this,getMessage(arg1,arg2,arg3))||this}return NodeError}(Base);NodeError.prototype.name=Base.name;NodeError.prototype.code=code;codes[code]=NodeError}function oneOf(expected,thing){if(Array.isArray(expected)){var len=expected.length;expected=expected.map((function(i){return String(i)}));if(len>2){return"one of ".concat(thing," ").concat(expected.slice(0,len-1).join(", "),", or ")+expected[len-1]}else if(len===2){return"one of ".concat(thing," ").concat(expected[0]," or ").concat(expected[1])}else{return"of ".concat(thing," ").concat(expected[0])}}else{return"of ".concat(thing," ").concat(String(expected))}}function startsWith(str,search,pos){return str.substr(!pos||pos<0?0:+pos,search.length)===search}function endsWith(str,search,this_len){if(this_len===undefined||this_len>str.length){this_len=str.length}return str.substring(this_len-search.length,this_len)===search}function includes(str,search,start){if(typeof start!=="number"){start=0}if(start+search.length>str.length){return false}else{return str.indexOf(search,start)!==-1}}createErrorType("ERR_INVALID_OPT_VALUE",(function(name,value){return'The value "'+value+'" is invalid for option "'+name+'"'}),TypeError);createErrorType("ERR_INVALID_ARG_TYPE",(function(name,expected,actual){var determiner;if(typeof expected==="string"&&startsWith(expected,"not ")){determiner="must not be";expected=expected.replace(/^not /,"")}else{determiner="must be"}var msg;if(endsWith(name," argument")){msg="The ".concat(name," ").concat(determiner," ").concat(oneOf(expected,"type"))}else{var type=includes(name,".")?"property":"argument";msg='The "'.concat(name,'" ').concat(type," ").concat(determiner," ").concat(oneOf(expected,"type"))}msg+=". Received type ".concat(typeof actual);return msg}),TypeError);createErrorType("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF");createErrorType("ERR_METHOD_NOT_IMPLEMENTED",(function(name){return"The "+name+" method is not implemented"}));createErrorType("ERR_STREAM_PREMATURE_CLOSE","Premature close");createErrorType("ERR_STREAM_DESTROYED",(function(name){return"Cannot call "+name+" after a stream was destroyed"}));createErrorType("ERR_MULTIPLE_CALLBACK","Callback called multiple times");createErrorType("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable");createErrorType("ERR_STREAM_WRITE_AFTER_END","write after end");createErrorType("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError);createErrorType("ERR_UNKNOWN_ENCODING",(function(arg){return"Unknown encoding: "+arg}),TypeError);createErrorType("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event");module.exports.codes=codes},{}],186:[function(require,module,exports){(function(process){(function(){"use strict";var objectKeys=Object.keys||function(obj){var keys=[];for(var key in obj)keys.push(key);return keys};module.exports=Duplex;var Readable=require("./_stream_readable");var Writable=require("./_stream_writable");require("inherits")(Duplex,Readable);{var keys=objectKeys(Writable.prototype);for(var v=0;v0){if(typeof chunk!=="string"&&!state.objectMode&&Object.getPrototypeOf(chunk)!==Buffer.prototype){chunk=_uint8ArrayToBuffer(chunk)}if(addToFront){if(state.endEmitted)errorOrDestroy(stream,new ERR_STREAM_UNSHIFT_AFTER_END_EVENT);else addChunk(stream,state,chunk,true)}else if(state.ended){errorOrDestroy(stream,new ERR_STREAM_PUSH_AFTER_EOF)}else if(state.destroyed){return false}else{state.reading=false;if(state.decoder&&!encoding){chunk=state.decoder.write(chunk);if(state.objectMode||chunk.length!==0)addChunk(stream,state,chunk,false);else maybeReadMore(stream,state)}else{addChunk(stream,state,chunk,false)}}}else if(!addToFront){state.reading=false;maybeReadMore(stream,state)}}return!state.ended&&(state.length=MAX_HWM){n=MAX_HWM}else{n--;n|=n>>>1;n|=n>>>2;n|=n>>>4;n|=n>>>8;n|=n>>>16;n++}return n}function howMuchToRead(n,state){if(n<=0||state.length===0&&state.ended)return 0;if(state.objectMode)return 1;if(n!==n){if(state.flowing&&state.length)return state.buffer.head.data.length;else return state.length}if(n>state.highWaterMark)state.highWaterMark=computeNewHighWaterMark(n);if(n<=state.length)return n;if(!state.ended){state.needReadable=true;return 0}return state.length}Readable.prototype.read=function(n){debug("read",n);n=parseInt(n,10);var state=this._readableState;var nOrig=n;if(n!==0)state.emittedReadable=false;if(n===0&&state.needReadable&&((state.highWaterMark!==0?state.length>=state.highWaterMark:state.length>0)||state.ended)){debug("read: emitReadable",state.length,state.ended);if(state.length===0&&state.ended)endReadable(this);else emitReadable(this);return null}n=howMuchToRead(n,state);if(n===0&&state.ended){if(state.length===0)endReadable(this);return null}var doRead=state.needReadable;debug("need readable",doRead);if(state.length===0||state.length-n0)ret=fromList(n,state);else ret=null;if(ret===null){state.needReadable=state.length<=state.highWaterMark;n=0}else{state.length-=n;state.awaitDrain=0}if(state.length===0){if(!state.ended)state.needReadable=true;if(nOrig!==n&&state.ended)endReadable(this)}if(ret!==null)this.emit("data",ret);return ret};function onEofChunk(stream,state){debug("onEofChunk");if(state.ended)return;if(state.decoder){var chunk=state.decoder.end();if(chunk&&chunk.length){state.buffer.push(chunk);state.length+=state.objectMode?1:chunk.length}}state.ended=true;if(state.sync){emitReadable(stream)}else{state.needReadable=false;if(!state.emittedReadable){state.emittedReadable=true;emitReadable_(stream)}}}function emitReadable(stream){var state=stream._readableState;debug("emitReadable",state.needReadable,state.emittedReadable);state.needReadable=false;if(!state.emittedReadable){debug("emitReadable",state.flowing);state.emittedReadable=true;process.nextTick(emitReadable_,stream)}}function emitReadable_(stream){var state=stream._readableState;debug("emitReadable_",state.destroyed,state.length,state.ended);if(!state.destroyed&&(state.length||state.ended)){stream.emit("readable");state.emittedReadable=false}state.needReadable=!state.flowing&&!state.ended&&state.length<=state.highWaterMark;flow(stream)}function maybeReadMore(stream,state){if(!state.readingMore){state.readingMore=true;process.nextTick(maybeReadMore_,stream,state)}}function maybeReadMore_(stream,state){while(!state.reading&&!state.ended&&(state.length1&&indexOf(state.pipes,dest)!==-1)&&!cleanedUp){debug("false write response, pause",state.awaitDrain);state.awaitDrain++}src.pause()}}function onerror(er){debug("onerror",er);unpipe();dest.removeListener("error",onerror);if(EElistenerCount(dest,"error")===0)errorOrDestroy(dest,er)}prependListener(dest,"error",onerror);function onclose(){dest.removeListener("finish",onfinish);unpipe()}dest.once("close",onclose);function onfinish(){debug("onfinish");dest.removeListener("close",onclose);unpipe()}dest.once("finish",onfinish);function unpipe(){debug("unpipe");src.unpipe(dest)}dest.emit("pipe",src);if(!state.flowing){debug("pipe resume");src.resume()}return dest};function pipeOnDrain(src){return function pipeOnDrainFunctionResult(){var state=src._readableState;debug("pipeOnDrain",state.awaitDrain);if(state.awaitDrain)state.awaitDrain--;if(state.awaitDrain===0&&EElistenerCount(src,"data")){state.flowing=true;flow(src)}}}Readable.prototype.unpipe=function(dest){var state=this._readableState;var unpipeInfo={hasUnpiped:false};if(state.pipesCount===0)return this;if(state.pipesCount===1){if(dest&&dest!==state.pipes)return this;if(!dest)dest=state.pipes;state.pipes=null;state.pipesCount=0;state.flowing=false;if(dest)dest.emit("unpipe",this,unpipeInfo);return this}if(!dest){var dests=state.pipes;var len=state.pipesCount;state.pipes=null;state.pipesCount=0;state.flowing=false;for(var i=0;i0;if(state.flowing!==false)this.resume()}else if(ev==="readable"){if(!state.endEmitted&&!state.readableListening){state.readableListening=state.needReadable=true;state.flowing=false;state.emittedReadable=false;debug("on readable",state.length,state.reading);if(state.length){emitReadable(this)}else if(!state.reading){process.nextTick(nReadingNextTick,this)}}}return res};Readable.prototype.addListener=Readable.prototype.on;Readable.prototype.removeListener=function(ev,fn){var res=Stream.prototype.removeListener.call(this,ev,fn);if(ev==="readable"){process.nextTick(updateReadableListening,this)}return res};Readable.prototype.removeAllListeners=function(ev){var res=Stream.prototype.removeAllListeners.apply(this,arguments);if(ev==="readable"||ev===undefined){process.nextTick(updateReadableListening,this)}return res};function updateReadableListening(self){var state=self._readableState;state.readableListening=self.listenerCount("readable")>0;if(state.resumeScheduled&&!state.paused){state.flowing=true}else if(self.listenerCount("data")>0){self.resume()}}function nReadingNextTick(self){debug("readable nexttick read 0");self.read(0)}Readable.prototype.resume=function(){var state=this._readableState;if(!state.flowing){debug("resume");state.flowing=!state.readableListening;resume(this,state)}state.paused=false;return this};function resume(stream,state){if(!state.resumeScheduled){state.resumeScheduled=true;process.nextTick(resume_,stream,state)}}function resume_(stream,state){debug("resume",state.reading);if(!state.reading){stream.read(0)}state.resumeScheduled=false;stream.emit("resume");flow(stream);if(state.flowing&&!state.reading)stream.read(0)}Readable.prototype.pause=function(){debug("call pause flowing=%j",this._readableState.flowing);if(this._readableState.flowing!==false){debug("pause");this._readableState.flowing=false;this.emit("pause")}this._readableState.paused=true;return this};function flow(stream){var state=stream._readableState;debug("flow",state.flowing);while(state.flowing&&stream.read()!==null);}Readable.prototype.wrap=function(stream){var _this=this;var state=this._readableState;var paused=false;stream.on("end",(function(){debug("wrapped end");if(state.decoder&&!state.ended){var chunk=state.decoder.end();if(chunk&&chunk.length)_this.push(chunk)}_this.push(null)}));stream.on("data",(function(chunk){debug("wrapped data");if(state.decoder)chunk=state.decoder.write(chunk);if(state.objectMode&&(chunk===null||chunk===undefined))return;else if(!state.objectMode&&(!chunk||!chunk.length))return;var ret=_this.push(chunk);if(!ret){paused=true;stream.pause()}}));for(var i in stream){if(this[i]===undefined&&typeof stream[i]==="function"){this[i]=function methodWrap(method){return function methodWrapReturnFunction(){return stream[method].apply(stream,arguments)}}(i)}}for(var n=0;n=state.length){if(state.decoder)ret=state.buffer.join("");else if(state.buffer.length===1)ret=state.buffer.first();else ret=state.buffer.concat(state.length);state.buffer.clear()}else{ret=state.buffer.consume(n,state.decoder)}return ret}function endReadable(stream){var state=stream._readableState;debug("endReadable",state.endEmitted);if(!state.endEmitted){state.ended=true;process.nextTick(endReadableNT,state,stream)}}function endReadableNT(state,stream){debug("endReadableNT",state.endEmitted,state.length);if(!state.endEmitted&&state.length===0){state.endEmitted=true;stream.readable=false;stream.emit("end");if(state.autoDestroy){var wState=stream._writableState;if(!wState||wState.autoDestroy&&wState.finished){stream.destroy()}}}}if(typeof Symbol==="function"){Readable.from=function(iterable,opts){if(from===undefined){from=require("./internal/streams/from")}return from(Readable,iterable,opts)}}function indexOf(xs,x){for(var i=0,l=xs.length;i-1))throw new ERR_UNKNOWN_ENCODING(encoding);this._writableState.defaultEncoding=encoding;return this};Object.defineProperty(Writable.prototype,"writableBuffer",{enumerable:false,get:function get(){return this._writableState&&this._writableState.getBuffer()}});function decodeChunk(state,chunk,encoding){if(!state.objectMode&&state.decodeStrings!==false&&typeof chunk==="string"){chunk=Buffer.from(chunk,encoding)}return chunk}Object.defineProperty(Writable.prototype,"writableHighWaterMark",{enumerable:false,get:function get(){return this._writableState.highWaterMark}});function writeOrBuffer(stream,state,isBuf,chunk,encoding,cb){if(!isBuf){var newChunk=decodeChunk(state,chunk,encoding);if(chunk!==newChunk){isBuf=true;encoding="buffer";chunk=newChunk}}var len=state.objectMode?1:chunk.length;state.length+=len;var ret=state.length0)this.tail.next=entry;else this.head=entry;this.tail=entry;++this.length}},{key:"unshift",value:function unshift(v){var entry={data:v,next:this.head};if(this.length===0)this.tail=entry;this.head=entry;++this.length}},{key:"shift",value:function shift(){if(this.length===0)return;var ret=this.head.data;if(this.length===1)this.head=this.tail=null;else this.head=this.head.next;--this.length;return ret}},{key:"clear",value:function clear(){this.head=this.tail=null;this.length=0}},{key:"join",value:function join(s){if(this.length===0)return"";var p=this.head;var ret=""+p.data;while(p=p.next)ret+=s+p.data;return ret}},{key:"concat",value:function concat(n){if(this.length===0)return Buffer.alloc(0);var ret=Buffer.allocUnsafe(n>>>0);var p=this.head;var i=0;while(p){copyBuffer(p.data,ret,i);i+=p.data.length;p=p.next}return ret}},{key:"consume",value:function consume(n,hasStrings){var ret;if(nstr.length?str.length:n;if(nb===str.length)ret+=str;else ret+=str.slice(0,n);n-=nb;if(n===0){if(nb===str.length){++c;if(p.next)this.head=p.next;else this.head=this.tail=null}else{this.head=p;p.data=str.slice(nb)}break}++c}this.length-=c;return ret}},{key:"_getBuffer",value:function _getBuffer(n){var ret=Buffer.allocUnsafe(n);var p=this.head;var c=1;p.data.copy(ret);n-=p.data.length;while(p=p.next){var buf=p.data;var nb=n>buf.length?buf.length:n;buf.copy(ret,ret.length-n,0,nb);n-=nb;if(n===0){if(nb===buf.length){++c;if(p.next)this.head=p.next;else this.head=this.tail=null}else{this.head=p;p.data=buf.slice(nb)}break}++c}this.length-=c;return ret}},{key:custom,value:function value(_,options){return inspect(this,_objectSpread(_objectSpread({},options),{},{depth:0,customInspect:false}))}}]);return BufferList}()},{buffer:35,util:34}],193:[function(require,module,exports){(function(process){(function(){"use strict";function destroy(err,cb){var _this=this;var readableDestroyed=this._readableState&&this._readableState.destroyed;var writableDestroyed=this._writableState&&this._writableState.destroyed;if(readableDestroyed||writableDestroyed){if(cb){cb(err)}else if(err){if(!this._writableState){process.nextTick(emitErrorNT,this,err)}else if(!this._writableState.errorEmitted){this._writableState.errorEmitted=true;process.nextTick(emitErrorNT,this,err)}}return this}if(this._readableState){this._readableState.destroyed=true}if(this._writableState){this._writableState.destroyed=true}this._destroy(err||null,(function(err){if(!cb&&err){if(!_this._writableState){process.nextTick(emitErrorAndCloseNT,_this,err)}else if(!_this._writableState.errorEmitted){_this._writableState.errorEmitted=true;process.nextTick(emitErrorAndCloseNT,_this,err)}else{process.nextTick(emitCloseNT,_this)}}else if(cb){process.nextTick(emitCloseNT,_this);cb(err)}else{process.nextTick(emitCloseNT,_this)}}));return this}function emitErrorAndCloseNT(self,err){emitErrorNT(self,err);emitCloseNT(self)}function emitCloseNT(self){if(self._writableState&&!self._writableState.emitClose)return;if(self._readableState&&!self._readableState.emitClose)return;self.emit("close")}function undestroy(){if(this._readableState){this._readableState.destroyed=false;this._readableState.reading=false;this._readableState.ended=false;this._readableState.endEmitted=false}if(this._writableState){this._writableState.destroyed=false;this._writableState.ended=false;this._writableState.ending=false;this._writableState.finalCalled=false;this._writableState.prefinished=false;this._writableState.finished=false;this._writableState.errorEmitted=false}}function emitErrorNT(self,err){self.emit("error",err)}function errorOrDestroy(stream,err){var rState=stream._readableState;var wState=stream._writableState;if(rState&&rState.autoDestroy||wState&&wState.autoDestroy)stream.destroy(err);else stream.emit("error",err)}module.exports={destroy:destroy,undestroy:undestroy,errorOrDestroy:errorOrDestroy}}).call(this)}).call(this,require("_process"))},{_process:160}],194:[function(require,module,exports){"use strict";var ERR_STREAM_PREMATURE_CLOSE=require("../../../errors").codes.ERR_STREAM_PREMATURE_CLOSE;function once(callback){var called=false;return function(){if(called)return;called=true;for(var _len=arguments.length,args=new Array(_len),_key=0;_key<_len;_key++){args[_key]=arguments[_key]}callback.apply(this,args)}}function noop(){}function isRequest(stream){return stream.setHeader&&typeof stream.abort==="function"}function eos(stream,opts,callback){if(typeof opts==="function")return eos(stream,null,opts);if(!opts)opts={};callback=once(callback||noop);var readable=opts.readable||opts.readable!==false&&stream.readable;var writable=opts.writable||opts.writable!==false&&stream.writable;var onlegacyfinish=function onlegacyfinish(){if(!stream.writable)onfinish()};var writableEnded=stream._writableState&&stream._writableState.finished;var onfinish=function onfinish(){writable=false;writableEnded=true;if(!readable)callback.call(stream)};var readableEnded=stream._readableState&&stream._readableState.endEmitted;var onend=function onend(){readable=false;readableEnded=true;if(!writable)callback.call(stream)};var onerror=function onerror(err){callback.call(stream,err)};var onclose=function onclose(){var err;if(readable&&!readableEnded){if(!stream._readableState||!stream._readableState.ended)err=new ERR_STREAM_PREMATURE_CLOSE;return callback.call(stream,err)}if(writable&&!writableEnded){if(!stream._writableState||!stream._writableState.ended)err=new ERR_STREAM_PREMATURE_CLOSE;return callback.call(stream,err)}};var onrequest=function onrequest(){stream.req.on("finish",onfinish)};if(isRequest(stream)){stream.on("complete",onfinish);stream.on("abort",onclose);if(stream.req)onrequest();else stream.on("request",onrequest)}else if(writable&&!stream._writableState){stream.on("end",onlegacyfinish);stream.on("close",onlegacyfinish)}stream.on("end",onend);stream.on("finish",onfinish);if(opts.error!==false)stream.on("error",onerror);stream.on("close",onclose);return function(){stream.removeListener("complete",onfinish);stream.removeListener("abort",onclose);stream.removeListener("request",onrequest);if(stream.req)stream.req.removeListener("finish",onfinish);stream.removeListener("end",onlegacyfinish);stream.removeListener("close",onlegacyfinish);stream.removeListener("finish",onfinish);stream.removeListener("end",onend);stream.removeListener("error",onerror);stream.removeListener("close",onclose)}}module.exports=eos},{"../../../errors":185}],195:[function(require,module,exports){module.exports=function(){throw new Error("Readable.from is not available in the browser")}},{}],196:[function(require,module,exports){"use strict";var eos;function once(callback){var called=false;return function(){if(called)return;called=true;callback.apply(void 0,arguments)}}var _require$codes=require("../../../errors").codes,ERR_MISSING_ARGS=_require$codes.ERR_MISSING_ARGS,ERR_STREAM_DESTROYED=_require$codes.ERR_STREAM_DESTROYED;function noop(err){if(err)throw err}function isRequest(stream){return stream.setHeader&&typeof stream.abort==="function"}function destroyer(stream,reading,writing,callback){callback=once(callback);var closed=false;stream.on("close",(function(){closed=true}));if(eos===undefined)eos=require("./end-of-stream");eos(stream,{readable:reading,writable:writing},(function(err){if(err)return callback(err);closed=true;callback()}));var destroyed=false;return function(err){if(closed)return;if(destroyed)return;destroyed=true;if(isRequest(stream))return stream.abort();if(typeof stream.destroy==="function")return stream.destroy();callback(err||new ERR_STREAM_DESTROYED("pipe"))}}function call(fn){fn()}function pipe(from,to){return from.pipe(to)}function popCallback(streams){if(!streams.length)return noop;if(typeof streams[streams.length-1]!=="function")return noop;return streams.pop()}function pipeline(){for(var _len=arguments.length,streams=new Array(_len),_key=0;_key<_len;_key++){streams[_key]=arguments[_key]}var callback=popCallback(streams);if(Array.isArray(streams[0]))streams=streams[0];if(streams.length<2){throw new ERR_MISSING_ARGS("streams")}var error;var destroys=streams.map((function(stream,i){var reading=i0;return destroyer(stream,reading,writing,(function(err){if(!error)error=err;if(err)destroys.forEach(call);if(reading)return;destroys.forEach(call);callback(error)}))}));return streams.reduce(pipe)}module.exports=pipeline},{"../../../errors":185,"./end-of-stream":194}],197:[function(require,module,exports){"use strict";var ERR_INVALID_OPT_VALUE=require("../../../errors").codes.ERR_INVALID_OPT_VALUE;function highWaterMarkFrom(options,isDuplex,duplexKey){return options.highWaterMark!=null?options.highWaterMark:isDuplex?options[duplexKey]:null}function getHighWaterMark(state,options,duplexKey,isDuplex){var hwm=highWaterMarkFrom(options,isDuplex,duplexKey);if(hwm!=null){if(!(isFinite(hwm)&&Math.floor(hwm)===hwm)||hwm<0){var name=isDuplex?duplexKey:"highWaterMark";throw new ERR_INVALID_OPT_VALUE(name,hwm)}return Math.floor(hwm)}return state.objectMode?16:16*1024}module.exports={getHighWaterMark:getHighWaterMark}},{"../../../errors":185}],198:[function(require,module,exports){module.exports=require("events").EventEmitter},{events:81}],199:[function(require,module,exports){exports=module.exports=require("./lib/_stream_readable.js");exports.Stream=exports;exports.Readable=exports;exports.Writable=require("./lib/_stream_writable.js");exports.Duplex=require("./lib/_stream_duplex.js");exports.Transform=require("./lib/_stream_transform.js");exports.PassThrough=require("./lib/_stream_passthrough.js");exports.finished=require("./lib/internal/streams/end-of-stream.js");exports.pipeline=require("./lib/internal/streams/pipeline.js")},{"./lib/_stream_duplex.js":186,"./lib/_stream_passthrough.js":187,"./lib/_stream_readable.js":188,"./lib/_stream_transform.js":189,"./lib/_stream_writable.js":190,"./lib/internal/streams/end-of-stream.js":194,"./lib/internal/streams/pipeline.js":196}],200:[function(require,module,exports){var url=require("./url");var parser=require("socket.io-parser");var Manager=require("./manager");var debug=require("debug")("socket.io-client");module.exports=exports=lookup;var cache=exports.managers={};function lookup(uri,opts){if(typeof uri==="object"){opts=uri;uri=undefined}opts=opts||{};var parsed=url(uri);var source=parsed.source;var id=parsed.id;var path=parsed.path;var sameNamespace=cache[id]&&path in cache[id].nsps;var newConnection=opts.forceNew||opts["force new connection"]||false===opts.multiplex||sameNamespace;var io;if(newConnection){debug("ignoring socket cache for %s",source);io=Manager(source,opts)}else{if(!cache[id]){debug("new io instance for %s",source);cache[id]=Manager(source,opts)}io=cache[id]}if(parsed.query&&!opts.query){opts.query=parsed.query}return io.socket(parsed.path,opts)}exports.protocol=parser.protocol;exports.connect=lookup;exports.Manager=require("./manager");exports.Socket=require("./socket")},{"./manager":201,"./socket":203,"./url":204,debug:205,"socket.io-parser":209}],201:[function(require,module,exports){var eio=require("engine.io-client");var Socket=require("./socket");var Emitter=require("component-emitter");var parser=require("socket.io-parser");var on=require("./on");var bind=require("component-bind");var debug=require("debug")("socket.io-client:manager");var indexOf=require("indexof");var Backoff=require("backo2");var has=Object.prototype.hasOwnProperty;module.exports=Manager;function Manager(uri,opts){if(!(this instanceof Manager))return new Manager(uri,opts);if(uri&&"object"===typeof uri){opts=uri;uri=undefined}opts=opts||{};opts.path=opts.path||"/socket.io";this.nsps={};this.subs=[];this.opts=opts;this.reconnection(opts.reconnection!==false);this.reconnectionAttempts(opts.reconnectionAttempts||Infinity);this.reconnectionDelay(opts.reconnectionDelay||1e3);this.reconnectionDelayMax(opts.reconnectionDelayMax||5e3);this.randomizationFactor(opts.randomizationFactor||.5);this.backoff=new Backoff({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()});this.timeout(null==opts.timeout?2e4:opts.timeout);this.readyState="closed";this.uri=uri;this.connecting=[];this.lastPing=null;this.encoding=false;this.packetBuffer=[];var _parser=opts.parser||parser;this.encoder=new _parser.Encoder;this.decoder=new _parser.Decoder;this.autoConnect=opts.autoConnect!==false;if(this.autoConnect)this.open()}Manager.prototype.emitAll=function(){this.emit.apply(this,arguments);for(var nsp in this.nsps){if(has.call(this.nsps,nsp)){this.nsps[nsp].emit.apply(this.nsps[nsp],arguments)}}};Manager.prototype.updateSocketIds=function(){for(var nsp in this.nsps){if(has.call(this.nsps,nsp)){this.nsps[nsp].id=this.generateId(nsp)}}};Manager.prototype.generateId=function(nsp){return(nsp==="/"?"":nsp+"#")+this.engine.id};Emitter(Manager.prototype);Manager.prototype.reconnection=function(v){if(!arguments.length)return this._reconnection;this._reconnection=!!v;return this};Manager.prototype.reconnectionAttempts=function(v){if(!arguments.length)return this._reconnectionAttempts;this._reconnectionAttempts=v;return this};Manager.prototype.reconnectionDelay=function(v){if(!arguments.length)return this._reconnectionDelay;this._reconnectionDelay=v;this.backoff&&this.backoff.setMin(v);return this};Manager.prototype.randomizationFactor=function(v){if(!arguments.length)return this._randomizationFactor;this._randomizationFactor=v;this.backoff&&this.backoff.setJitter(v);return this};Manager.prototype.reconnectionDelayMax=function(v){if(!arguments.length)return this._reconnectionDelayMax;this._reconnectionDelayMax=v;this.backoff&&this.backoff.setMax(v);return this};Manager.prototype.timeout=function(v){if(!arguments.length)return this._timeout;this._timeout=v;return this};Manager.prototype.maybeReconnectOnOpen=function(){if(!this.reconnecting&&this._reconnection&&this.backoff.attempts===0){this.reconnect()}};Manager.prototype.open=Manager.prototype.connect=function(fn,opts){debug("readyState %s",this.readyState);if(~this.readyState.indexOf("open"))return this;debug("opening %s",this.uri);this.engine=eio(this.uri,this.opts);var socket=this.engine;var self=this;this.readyState="opening";this.skipReconnect=false;var openSub=on(socket,"open",(function(){self.onopen();fn&&fn()}));var errorSub=on(socket,"error",(function(data){debug("connect_error");self.cleanup();self.readyState="closed";self.emitAll("connect_error",data);if(fn){var err=new Error("Connection error");err.data=data;fn(err)}else{self.maybeReconnectOnOpen()}}));if(false!==this._timeout){var timeout=this._timeout;debug("connect attempt will timeout after %d",timeout);if(timeout===0){openSub.destroy()}var timer=setTimeout((function(){debug("connect attempt timed out after %d",timeout);openSub.destroy();socket.close();socket.emit("error","timeout");self.emitAll("connect_timeout",timeout)}),timeout);this.subs.push({destroy:function(){clearTimeout(timer)}})}this.subs.push(openSub);this.subs.push(errorSub);return this};Manager.prototype.onopen=function(){debug("open");this.cleanup();this.readyState="open";this.emit("open");var socket=this.engine;this.subs.push(on(socket,"data",bind(this,"ondata")));this.subs.push(on(socket,"ping",bind(this,"onping")));this.subs.push(on(socket,"pong",bind(this,"onpong")));this.subs.push(on(socket,"error",bind(this,"onerror")));this.subs.push(on(socket,"close",bind(this,"onclose")));this.subs.push(on(this.decoder,"decoded",bind(this,"ondecoded")))};Manager.prototype.onping=function(){this.lastPing=new Date;this.emitAll("ping")};Manager.prototype.onpong=function(){this.emitAll("pong",new Date-this.lastPing)};Manager.prototype.ondata=function(data){this.decoder.add(data)};Manager.prototype.ondecoded=function(packet){this.emit("packet",packet)};Manager.prototype.onerror=function(err){debug("error",err);this.emitAll("error",err)};Manager.prototype.socket=function(nsp,opts){var socket=this.nsps[nsp];if(!socket){socket=new Socket(this,nsp,opts);this.nsps[nsp]=socket;var self=this;socket.on("connecting",onConnecting);socket.on("connect",(function(){socket.id=self.generateId(nsp)}));if(this.autoConnect){onConnecting()}}function onConnecting(){if(!~indexOf(self.connecting,socket)){self.connecting.push(socket)}}return socket};Manager.prototype.destroy=function(socket){var index=indexOf(this.connecting,socket);if(~index)this.connecting.splice(index,1);if(this.connecting.length)return;this.close()};Manager.prototype.packet=function(packet){debug("writing packet %j",packet);var self=this;if(packet.query&&packet.type===0)packet.nsp+="?"+packet.query;if(!self.encoding){self.encoding=true;this.encoder.encode(packet,(function(encodedPackets){for(var i=0;i0&&!this.encoding){var pack=this.packetBuffer.shift();this.packet(pack)}};Manager.prototype.cleanup=function(){debug("cleanup");var subsLength=this.subs.length;for(var i=0;i=this._reconnectionAttempts){debug("reconnect failed");this.backoff.reset();this.emitAll("reconnect_failed");this.reconnecting=false}else{var delay=this.backoff.duration();debug("will wait %dms before reconnect attempt",delay);this.reconnecting=true;var timer=setTimeout((function(){if(self.skipReconnect)return;debug("attempting reconnect");self.emitAll("reconnect_attempt",self.backoff.attempts);self.emitAll("reconnecting",self.backoff.attempts);if(self.skipReconnect)return;self.open((function(err){if(err){debug("reconnect attempt error");self.reconnecting=false;self.reconnect();self.emitAll("reconnect_error",err.data)}else{debug("reconnect success");self.onreconnect()}}))}),delay);this.subs.push({destroy:function(){clearTimeout(timer)}})}};Manager.prototype.onreconnect=function(){var attempt=this.backoff.attempts;this.reconnecting=false;this.backoff.reset();this.updateSocketIds();this.emitAll("reconnect",attempt)}},{"./on":202,"./socket":203,backo2:30,"component-bind":60,"component-emitter":61,debug:205,"engine.io-client":65,indexof:101,"socket.io-parser":209}],202:[function(require,module,exports){module.exports=on;function on(obj,ev,fn){obj.on(ev,fn);return{destroy:function(){obj.removeListener(ev,fn)}}}},{}],203:[function(require,module,exports){var parser=require("socket.io-parser");var Emitter=require("component-emitter");var toArray=require("to-array");var on=require("./on");var bind=require("component-bind");var debug=require("debug")("socket.io-client:socket");var parseqs=require("parseqs");var hasBin=require("has-binary2");module.exports=exports=Socket;var events={connect:1,connect_error:1,connect_timeout:1,connecting:1,disconnect:1,error:1,reconnect:1,reconnect_attempt:1,reconnect_failed:1,reconnect_error:1,reconnecting:1,ping:1,pong:1};var emit=Emitter.prototype.emit;function Socket(io,nsp,opts){this.io=io;this.nsp=nsp;this.json=this;this.ids=0;this.acks={};this.receiveBuffer=[];this.sendBuffer=[];this.connected=false;this.disconnected=true;this.flags={};if(opts&&opts.query){this.query=opts.query}if(this.io.autoConnect)this.open()}Emitter(Socket.prototype);Socket.prototype.subEvents=function(){if(this.subs)return;var io=this.io;this.subs=[on(io,"open",bind(this,"onopen")),on(io,"packet",bind(this,"onpacket")),on(io,"close",bind(this,"onclose"))]};Socket.prototype.open=Socket.prototype.connect=function(){if(this.connected)return this;this.subEvents();if(!this.io.reconnecting)this.io.open();if("open"===this.io.readyState)this.onopen();this.emit("connecting");return this};Socket.prototype.send=function(){var args=toArray(arguments);args.unshift("message");this.emit.apply(this,args);return this};Socket.prototype.emit=function(ev){if(events.hasOwnProperty(ev)){emit.apply(this,arguments);return this}var args=toArray(arguments);var packet={type:(this.flags.binary!==undefined?this.flags.binary:hasBin(args))?parser.BINARY_EVENT:parser.EVENT,data:args};packet.options={};packet.options.compress=!this.flags||false!==this.flags.compress;if("function"===typeof args[args.length-1]){debug("emitting packet with ack id %d",this.ids);this.acks[this.ids]=args.pop();packet.id=this.ids++}if(this.connected){this.packet(packet)}else{this.sendBuffer.push(packet)}this.flags={};return this};Socket.prototype.packet=function(packet){packet.nsp=this.nsp;this.io.packet(packet)};Socket.prototype.onopen=function(){debug("transport is open - connecting");if("/"!==this.nsp){if(this.query){var query=typeof this.query==="object"?parseqs.encode(this.query):this.query;debug("sending connect packet with query %s",query);this.packet({type:parser.CONNECT,query:query})}else{this.packet({type:parser.CONNECT})}}};Socket.prototype.onclose=function(reason){debug("close (%s)",reason);this.connected=false;this.disconnected=true;delete this.id;this.emit("disconnect",reason)};Socket.prototype.onpacket=function(packet){var sameNamespace=packet.nsp===this.nsp;var rootNamespaceError=packet.type===parser.ERROR&&packet.nsp==="/";if(!sameNamespace&&!rootNamespaceError)return;switch(packet.type){case parser.CONNECT:this.onconnect();break;case parser.EVENT:this.onevent(packet);break;case parser.BINARY_EVENT:this.onevent(packet);break;case parser.ACK:this.onack(packet);break;case parser.BINARY_ACK:this.onack(packet);break;case parser.DISCONNECT:this.ondisconnect();break;case parser.ERROR:this.emit("error",packet.data);break}};Socket.prototype.onevent=function(packet){var args=packet.data||[];debug("emitting event %j",args);if(null!=packet.id){debug("attaching ack callback to event");args.push(this.ack(packet.id))}if(this.connected){emit.apply(this,args)}else{this.receiveBuffer.push(args)}};Socket.prototype.ack=function(id){var self=this;var sent=false;return function(){if(sent)return;sent=true;var args=toArray(arguments);debug("sending ack %j",args);self.packet({type:hasBin(args)?parser.BINARY_ACK:parser.ACK,id:id,data:args})}};Socket.prototype.onack=function(packet){var ack=this.acks[packet.id];if("function"===typeof ack){debug("calling ack %s with %j",packet.id,packet.data);ack.apply(this,packet.data);delete this.acks[packet.id]}else{debug("bad ack %s",packet.id)}};Socket.prototype.onconnect=function(){this.connected=true;this.disconnected=false;this.emitBuffered();this.emit("connect")};Socket.prototype.emitBuffered=function(){var i;for(i=0;i=31||typeof navigator!=="undefined"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}exports.formatters.j=function(v){try{return JSON.stringify(v)}catch(err){return"[UnexpectedJSONParseError]: "+err.message}};function formatArgs(args){var useColors=this.useColors;args[0]=(useColors?"%c":"")+this.namespace+(useColors?" %c":" ")+args[0]+(useColors?"%c ":" ")+"+"+exports.humanize(this.diff);if(!useColors)return;var c="color: "+this.color;args.splice(1,0,c,"color: inherit");var index=0;var lastC=0;args[0].replace(/%[a-zA-Z%]/g,(function(match){if("%%"===match)return;index++;if("%c"===match){lastC=index}}));args.splice(lastC,0,c)}function log(){return"object"===typeof console&&console.log&&Function.prototype.apply.call(console.log,console,arguments)}function save(namespaces){try{if(null==namespaces){exports.storage.removeItem("debug")}else{exports.storage.debug=namespaces}}catch(e){}}function load(){var r;try{r=exports.storage.debug}catch(e){}if(!r&&typeof process!=="undefined"&&"env"in process){r=process.env.DEBUG}return r}exports.enable(load());function localstorage(){try{return window.localStorage}catch(e){}}}).call(this)}).call(this,require("_process"))},{"./debug":206,_process:160}],206:[function(require,module,exports){arguments[4][75][0].apply(exports,arguments)},{dup:75,ms:207}],207:[function(require,module,exports){arguments[4][76][0].apply(exports,arguments)},{dup:76}],208:[function(require,module,exports){var isArray=require("isarray");var isBuf=require("./is-buffer");var toString=Object.prototype.toString;var withNativeBlob=typeof Blob==="function"||typeof Blob!=="undefined"&&toString.call(Blob)==="[object BlobConstructor]";var withNativeFile=typeof File==="function"||typeof File!=="undefined"&&toString.call(File)==="[object FileConstructor]";exports.deconstructPacket=function(packet){var buffers=[];var packetData=packet.data;var pack=packet;pack.data=_deconstructPacket(packetData,buffers);pack.attachments=buffers.length;return{packet:pack,buffers:buffers}};function _deconstructPacket(data,buffers){if(!data)return data;if(isBuf(data)){var placeholder={_placeholder:true,num:buffers.length};buffers.push(data);return placeholder}else if(isArray(data)){var newData=new Array(data.length);for(var i=0;i=0&&data.num=31||typeof navigator!=="undefined"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}exports.formatters.j=function(v){try{return JSON.stringify(v)}catch(err){return"[UnexpectedJSONParseError]: "+err.message}};function formatArgs(args){var useColors=this.useColors;args[0]=(useColors?"%c":"")+this.namespace+(useColors?" %c":" ")+args[0]+(useColors?"%c ":" ")+"+"+exports.humanize(this.diff);if(!useColors)return;var c="color: "+this.color;args.splice(1,0,c,"color: inherit");var index=0;var lastC=0;args[0].replace(/%[a-zA-Z%]/g,(function(match){if("%%"===match)return;index++;if("%c"===match){lastC=index}}));args.splice(lastC,0,c)}function log(){return"object"===typeof console&&console.log&&Function.prototype.apply.call(console.log,console,arguments)}function save(namespaces){try{if(null==namespaces){exports.storage.removeItem("debug")}else{exports.storage.debug=namespaces}}catch(e){}}function load(){var r;try{r=exports.storage.debug}catch(e){}if(!r&&typeof process!=="undefined"&&"env"in process){r=process.env.DEBUG}return r}exports.enable(load());function localstorage(){try{return window.localStorage}catch(e){}}}).call(this)}).call(this,require("_process"))},{"./debug":212,_process:160}],212:[function(require,module,exports){arguments[4][75][0].apply(exports,arguments)},{dup:75,ms:214}],213:[function(require,module,exports){arguments[4][90][0].apply(exports,arguments)},{dup:90}],214:[function(require,module,exports){arguments[4][76][0].apply(exports,arguments)},{dup:76}],215:[function(require,module,exports){var fastSafeStringify=require("fast-safe-stringify");var copy=require("clipboard-copy");function tryStringify(obj){try{return JSON.stringify(obj)}catch(e){}}function stateCopy(obj){var str=tryStringify(obj)||fastSafeStringify(obj);copy(str)}module.exports=stateCopy},{"clipboard-copy":52,"fast-safe-stringify":82}],216:[function(require,module,exports){"use strict";var Buffer=require("safe-buffer").Buffer;var isEncoding=Buffer.isEncoding||function(encoding){encoding=""+encoding;switch(encoding&&encoding.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return true;default:return false}};function _normalizeEncoding(enc){if(!enc)return"utf8";var retried;while(true){switch(enc){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return enc;default:if(retried)return;enc=(""+enc).toLowerCase();retried=true}}}function normalizeEncoding(enc){var nenc=_normalizeEncoding(enc);if(typeof nenc!=="string"&&(Buffer.isEncoding===isEncoding||!isEncoding(enc)))throw new Error("Unknown encoding: "+enc);return nenc||enc}exports.StringDecoder=StringDecoder;function StringDecoder(encoding){this.encoding=normalizeEncoding(encoding);var nb;switch(this.encoding){case"utf16le":this.text=utf16Text;this.end=utf16End;nb=4;break;case"utf8":this.fillLast=utf8FillLast;nb=4;break;case"base64":this.text=base64Text;this.end=base64End;nb=3;break;default:this.write=simpleWrite;this.end=simpleEnd;return}this.lastNeed=0;this.lastTotal=0;this.lastChar=Buffer.allocUnsafe(nb)}StringDecoder.prototype.write=function(buf){if(buf.length===0)return"";var r;var i;if(this.lastNeed){r=this.fillLast(buf);if(r===undefined)return"";i=this.lastNeed;this.lastNeed=0}else{i=0}if(i>5===6)return 2;else if(byte>>4===14)return 3;else if(byte>>3===30)return 4;return byte>>6===2?-1:-2}function utf8CheckIncomplete(self,buf,i){var j=buf.length-1;if(j=0){if(nb>0)self.lastNeed=nb-1;return nb}if(--j=0){if(nb>0)self.lastNeed=nb-2;return nb}if(--j=0){if(nb>0){if(nb===2)nb=0;else self.lastNeed=nb-3}return nb}return 0}function utf8CheckExtraBytes(self,buf,p){if((buf[0]&192)!==128){self.lastNeed=0;return"�"}if(self.lastNeed>1&&buf.length>1){if((buf[1]&192)!==128){self.lastNeed=1;return"�"}if(self.lastNeed>2&&buf.length>2){if((buf[2]&192)!==128){self.lastNeed=2;return"�"}}}}function utf8FillLast(buf){var p=this.lastTotal-this.lastNeed;var r=utf8CheckExtraBytes(this,buf,p);if(r!==undefined)return r;if(this.lastNeed<=buf.length){buf.copy(this.lastChar,p,0,this.lastNeed);return this.lastChar.toString(this.encoding,0,this.lastTotal)}buf.copy(this.lastChar,p,0,buf.length);this.lastNeed-=buf.length}function utf8Text(buf,i){var total=utf8CheckIncomplete(this,buf,i);if(!this.lastNeed)return buf.toString("utf8",i);this.lastTotal=total;var end=buf.length-(total-this.lastNeed);buf.copy(this.lastChar,0,end);return buf.toString("utf8",i,end)}function utf8End(buf){var r=buf&&buf.length?this.write(buf):"";if(this.lastNeed)return r+"�";return r}function utf16Text(buf,i){if((buf.length-i)%2===0){var r=buf.toString("utf16le",i);if(r){var c=r.charCodeAt(r.length-1);if(c>=55296&&c<=56319){this.lastNeed=2;this.lastTotal=4;this.lastChar[0]=buf[buf.length-2];this.lastChar[1]=buf[buf.length-1];return r.slice(0,-1)}}return r}this.lastNeed=1;this.lastTotal=2;this.lastChar[0]=buf[buf.length-1];return buf.toString("utf16le",i,buf.length-1)}function utf16End(buf){var r=buf&&buf.length?this.write(buf):"";if(this.lastNeed){var end=this.lastTotal-this.lastNeed;return r+this.lastChar.toString("utf16le",0,end)}return r}function base64Text(buf,i){var n=(buf.length-i)%3;if(n===0)return buf.toString("base64",i);this.lastNeed=3-n;this.lastTotal=3;if(n===1){this.lastChar[0]=buf[buf.length-1]}else{this.lastChar[0]=buf[buf.length-2];this.lastChar[1]=buf[buf.length-1]}return buf.toString("base64",i,buf.length-n)}function base64End(buf){var r=buf&&buf.length?this.write(buf):"";if(this.lastNeed)return r+this.lastChar.toString("base64",0,3-this.lastNeed);return r}function simpleWrite(buf){return buf.toString(this.encoding)}function simpleEnd(buf){return buf&&buf.length?this.write(buf):""}},{"safe-buffer":169}],217:[function(require,module,exports){"use strict";function _toConsumableArray(arr){return _arrayWithoutHoles(arr)||_iterableToArray(arr)||_unsupportedIterableToArray(arr)||_nonIterableSpread()}function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _iterableToArray(iter){if(typeof Symbol!=="undefined"&&iter[Symbol.iterator]!=null||iter["@@iterator"]!=null)return Array.from(iter)}function _arrayWithoutHoles(arr){if(Array.isArray(arr))return _arrayLikeToArray(arr)}function _createForOfIteratorHelper(o,allowArrayLike){var it=typeof Symbol!=="undefined"&&o[Symbol.iterator]||o["@@iterator"];if(!it){if(Array.isArray(o)||(it=_unsupportedIterableToArray(o))||allowArrayLike&&o&&typeof o.length==="number"){if(it)o=it;var i=0;var F=function F(){};return{s:F,n:function n(){if(i>=o.length)return{done:true};return{done:false,value:o[i++]}},e:function e(_e){throw _e},f:F}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var normalCompletion=true,didErr=false,err;return{s:function s(){it=it.call(o)},n:function n(){var step=it.next();normalCompletion=step.done;return step},e:function e(_e2){didErr=true;err=_e2},f:function f(){try{if(!normalCompletion&&it.return!=null)it.return()}finally{if(didErr)throw err}}}}function _unsupportedIterableToArray(o,minLen){if(!o)return;if(typeof o==="string")return _arrayLikeToArray(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);if(n==="Object"&&o.constructor)n=o.constructor.name;if(n==="Map"||n==="Set")return Array.from(o);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return _arrayLikeToArray(o,minLen)}function _arrayLikeToArray(arr,len){if(len==null||len>arr.length)len=arr.length;for(var i=0,arr2=new Array(len);i=o.length)return{done:true};return{done:false,value:o[i++]}},e:function e(_e){throw _e},f:F}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var normalCompletion=true,didErr=false,err;return{s:function s(){it=it.call(o)},n:function n(){var step=it.next();normalCompletion=step.done;return step},e:function e(_e2){didErr=true;err=_e2},f:function f(){try{if(!normalCompletion&&it.return!=null)it.return()}finally{if(didErr)throw err}}}}function _unsupportedIterableToArray(o,minLen){if(!o)return;if(typeof o==="string")return _arrayLikeToArray(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);if(n==="Object"&&o.constructor)n=o.constructor.name;if(n==="Map"||n==="Set")return Array.from(o);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return _arrayLikeToArray(o,minLen)}function _arrayLikeToArray(arr,len){if(len==null||len>arr.length)len=arr.length;for(var i=0,arr2=new Array(len);i0||string_ instanceof Object)?parse(string_):null};Response.prototype.toError=function(){var req=this.req;var method=req.method;var url=req.url;var message="cannot ".concat(method," ").concat(url," (").concat(this.status,")");var error=new Error(message);error.status=this.status;error.method=method;error.url=url;return error};request.Response=Response;function Request(method,url){var self=this;this._query=this._query||[];this.method=method;this.url=url;this.header={};this._header={};this.on("end",(function(){var error=null;var res=null;try{res=new Response(self)}catch(err){error=new Error("Parser is unable to parse the response");error.parse=true;error.original=err;if(self.xhr){error.rawResponse=typeof self.xhr.responseType==="undefined"?self.xhr.responseText:self.xhr.response;error.status=self.xhr.status?self.xhr.status:null;error.statusCode=error.status}else{error.rawResponse=null;error.status=null}return self.callback(error)}self.emit("response",res);var new_error;try{if(!self._isResponseOK(res)){new_error=new Error(res.statusText||res.text||"Unsuccessful HTTP response")}}catch(err){new_error=err}if(new_error){new_error.original=error;new_error.response=res;new_error.status=res.status;self.callback(new_error,res)}else{self.callback(null,res)}}))}Emitter(Request.prototype);mixin(Request.prototype,RequestBase.prototype);Request.prototype.type=function(type){this.set("Content-Type",request.types[type]||type);return this};Request.prototype.accept=function(type){this.set("Accept",request.types[type]||type);return this};Request.prototype.auth=function(user,pass,options){if(arguments.length===1)pass="";if(_typeof(pass)==="object"&&pass!==null){options=pass;pass=""}if(!options){options={type:typeof btoa==="function"?"basic":"auto"}}var encoder=options.encoder?options.encoder:function(string){if(typeof btoa==="function"){return btoa(string)}throw new Error("Cannot use basic auth, btoa is not a function")};return this._auth(user,pass,options,encoder)};Request.prototype.query=function(value){if(typeof value!=="string")value=serialize(value);if(value)this._query.push(value);return this};Request.prototype.attach=function(field,file,options){if(file){if(this._data){throw new Error("superagent can't mix .send() and .attach()")}this._getFormData().append(field,file,options||file.name)}return this};Request.prototype._getFormData=function(){if(!this._formData){this._formData=new root.FormData}return this._formData};Request.prototype.callback=function(error,res){if(this._shouldRetry(error,res)){return this._retry()}var fn=this._callback;this.clearTimeout();if(error){if(this._maxRetries)error.retries=this._retries-1;this.emit("error",error)}fn(error,res)};Request.prototype.crossDomainError=function(){var error=new Error("Request has been terminated\nPossible causes: the network is offline, Origin is not allowed by Access-Control-Allow-Origin, the page is being unloaded, etc.");error.crossDomain=true;error.status=this.status;error.method=this.method;error.url=this.url;this.callback(error)};Request.prototype.agent=function(){console.warn("This is not supported in browser version of superagent");return this};Request.prototype.ca=Request.prototype.agent;Request.prototype.buffer=Request.prototype.ca;Request.prototype.write=function(){throw new Error("Streaming is not supported in browser version of superagent")};Request.prototype.pipe=Request.prototype.write;Request.prototype._isHost=function(object){return object&&_typeof(object)==="object"&&!Array.isArray(object)&&Object.prototype.toString.call(object)!=="[object Object]"};Request.prototype.end=function(fn){if(this._endCalled){console.warn("Warning: .end() was called twice. This is not supported in superagent")}this._endCalled=true;this._callback=fn||noop;this._finalizeQueryString();this._end()};Request.prototype._setUploadTimeout=function(){var self=this;if(this._uploadTimeout&&!this._uploadTimeoutTimer){this._uploadTimeoutTimer=setTimeout((function(){self._timeoutError("Upload timeout of ",self._uploadTimeout,"ETIMEDOUT")}),this._uploadTimeout)}};Request.prototype._end=function(){if(this._aborted)return this.callback(new Error("The request has been aborted even before .end() was called"));var self=this;this.xhr=request.getXHR();var xhr=this.xhr;var data=this._formData||this._data;this._setTimeouts();xhr.addEventListener("readystatechange",(function(){var readyState=xhr.readyState;if(readyState>=2&&self._responseTimeoutTimer){clearTimeout(self._responseTimeoutTimer)}if(readyState!==4){return}var status;try{status=xhr.status}catch(_unused5){status=0}if(!status){if(self.timedout||self._aborted)return;return self.crossDomainError()}self.emit("end")}));var handleProgress=function handleProgress(direction,e){if(e.total>0){e.percent=e.loaded/e.total*100;if(e.percent===100){clearTimeout(self._uploadTimeoutTimer)}}e.direction=direction;self.emit("progress",e)};if(this.hasListeners("progress")){try{xhr.addEventListener("progress",handleProgress.bind(null,"download"));if(xhr.upload){xhr.upload.addEventListener("progress",handleProgress.bind(null,"upload"))}}catch(_unused6){}}if(xhr.upload){this._setUploadTimeout()}try{if(this.username&&this.password){xhr.open(this.method,this.url,true,this.username,this.password)}else{xhr.open(this.method,this.url,true)}}catch(err){return this.callback(err)}if(this._withCredentials)xhr.withCredentials=true;if(!this._formData&&this.method!=="GET"&&this.method!=="HEAD"&&typeof data!=="string"&&!this._isHost(data)){var contentType=this._header["content-type"];var _serialize=this._serializer||request.serialize[contentType?contentType.split(";")[0]:""];if(!_serialize&&isJSON(contentType)){_serialize=request.serialize["application/json"]}if(_serialize)data=_serialize(data)}for(var field in this.header){if(this.header[field]===null)continue;if(hasOwn(this.header,field))xhr.setRequestHeader(field,this.header[field])}if(this._responseType){xhr.responseType=this._responseType}this.emit("request",this);xhr.send(typeof data==="undefined"?null:data)};request.agent=function(){return new Agent};var _loop=function _loop(){var method=_arr[_i];Agent.prototype[method.toLowerCase()]=function(url,fn){var request_=new request.Request(method,url);this._setDefaults(request_);if(fn){request_.end(fn)}return request_}};for(var _i=0,_arr=["GET","POST","OPTIONS","PATCH","PUT","DELETE"];_i<_arr.length;_i++){_loop()}Agent.prototype.del=Agent.prototype.delete;request.get=function(url,data,fn){var request_=request("GET",url);if(typeof data==="function"){fn=data;data=null}if(data)request_.query(data);if(fn)request_.end(fn);return request_};request.head=function(url,data,fn){var request_=request("HEAD",url);if(typeof data==="function"){fn=data;data=null}if(data)request_.query(data);if(fn)request_.end(fn);return request_};request.options=function(url,data,fn){var request_=request("OPTIONS",url);if(typeof data==="function"){fn=data;data=null}if(data)request_.send(data);if(fn)request_.end(fn);return request_};function del(url,data,fn){var request_=request("DELETE",url);if(typeof data==="function"){fn=data;data=null}if(data)request_.send(data);if(fn)request_.end(fn);return request_}request.del=del;request.delete=del;request.patch=function(url,data,fn){var request_=request("PATCH",url);if(typeof data==="function"){fn=data;data=null}if(data)request_.send(data);if(fn)request_.end(fn);return request_};request.post=function(url,data,fn){var request_=request("POST",url);if(typeof data==="function"){fn=data;data=null}if(data)request_.send(data);if(fn)request_.end(fn);return request_};request.put=function(url,data,fn){var request_=request("PUT",url);if(typeof data==="function"){fn=data;data=null}if(data)request_.send(data);if(fn)request_.end(fn);return request_}},{"./agent-base":217,"./request-base":219,"./response-base":220,"./utils":221,"component-emitter":61,"fast-safe-stringify":82,qs:162}],219:[function(require,module,exports){(function(process){(function(){"use strict";function _typeof(obj){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(obj){return typeof obj}:function(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj},_typeof(obj)}var semver=require("semver");var _require=require("./utils"),isObject=_require.isObject,hasOwn=_require.hasOwn;module.exports=RequestBase;function RequestBase(){}RequestBase.prototype.clearTimeout=function(){clearTimeout(this._timer);clearTimeout(this._responseTimeoutTimer);clearTimeout(this._uploadTimeoutTimer);delete this._timer;delete this._responseTimeoutTimer;delete this._uploadTimeoutTimer;return this};RequestBase.prototype.parse=function(fn){this._parser=fn;return this};RequestBase.prototype.responseType=function(value){this._responseType=value;return this};RequestBase.prototype.serialize=function(fn){this._serializer=fn;return this};RequestBase.prototype.timeout=function(options){if(!options||_typeof(options)!=="object"){this._timeout=options;this._responseTimeout=0;this._uploadTimeout=0;return this}for(var option in options){if(hasOwn(options,option)){switch(option){case"deadline":this._timeout=options.deadline;break;case"response":this._responseTimeout=options.response;break;case"upload":this._uploadTimeout=options.upload;break;default:console.warn("Unknown timeout option",option)}}}return this};RequestBase.prototype.retry=function(count,fn){if(arguments.length===0||count===true)count=1;if(count<=0)count=0;this._maxRetries=count;this._retries=0;this._retryCallback=fn;return this};var ERROR_CODES=new Set(["ETIMEDOUT","ECONNRESET","EADDRINUSE","ECONNREFUSED","EPIPE","ENOTFOUND","ENETUNREACH","EAI_AGAIN"]);var STATUS_CODES=new Set([408,413,429,500,502,503,504,521,522,524]);RequestBase.prototype._shouldRetry=function(error,res){if(!this._maxRetries||this._retries++>=this._maxRetries){return false}if(this._retryCallback){try{var override=this._retryCallback(error,res);if(override===true)return true;if(override===false)return false}catch(err){console.error(err)}}if(res&&res.status&&STATUS_CODES.has(res.status))return true;if(error){if(error.code&&ERROR_CODES.has(error.code))return true;if(error.timeout&&error.code==="ECONNABORTED")return true;if(error.crossDomain)return true}return false};RequestBase.prototype._retry=function(){this.clearTimeout();if(this.req){this.req=null;this.req=this.request()}this._aborted=false;this.timedout=false;this.timedoutError=null;return this._end()};RequestBase.prototype.then=function(resolve,reject){var _this=this;if(!this._fullfilledPromise){var self=this;if(this._endCalled){console.warn("Warning: superagent request was sent twice, because both .end() and .then() were called. Never call .end() if you use promises")}this._fullfilledPromise=new Promise((function(resolve,reject){self.on("abort",(function(){if(_this._maxRetries&&_this._maxRetries>_this._retries){return}if(_this.timedout&&_this.timedoutError){reject(_this.timedoutError);return}var error=new Error("Aborted");error.code="ABORTED";error.status=_this.status;error.method=_this.method;error.url=_this.url;reject(error)}));self.end((function(error,res){if(error)reject(error);else resolve(res)}))}))}return this._fullfilledPromise.then(resolve,reject)};RequestBase.prototype.catch=function(callback){return this.then(undefined,callback)};RequestBase.prototype.use=function(fn){fn(this);return this};RequestBase.prototype.ok=function(callback){if(typeof callback!=="function")throw new Error("Callback required");this._okCallback=callback;return this};RequestBase.prototype._isResponseOK=function(res){if(!res){return false}if(this._okCallback){return this._okCallback(res)}return res.status>=200&&res.status<300};RequestBase.prototype.get=function(field){return this._header[field.toLowerCase()]};RequestBase.prototype.getHeader=RequestBase.prototype.get;RequestBase.prototype.set=function(field,value){if(isObject(field)){for(var key in field){if(hasOwn(field,key))this.set(key,field[key])}return this}this._header[field.toLowerCase()]=value;this.header[field]=value;return this};RequestBase.prototype.unset=function(field){delete this._header[field.toLowerCase()];delete this.header[field];return this};RequestBase.prototype.field=function(name,value,options){if(name===null||undefined===name){throw new Error(".field(name, val) name can not be empty")}if(this._data){throw new Error(".field() can't be used if .send() is used. Please use only .send() or only .field() & .attach()")}if(isObject(name)){for(var key in name){if(hasOwn(name,key))this.field(key,name[key])}return this}if(Array.isArray(value)){for(var i in value){if(hasOwn(value,i))this.field(name,value[i])}return this}if(value===null||undefined===value){throw new Error(".field(name, val) val can not be empty")}if(typeof value==="boolean"){value=String(value)}if(options)this._getFormData().append(name,value,options);else this._getFormData().append(name,value);return this};RequestBase.prototype.abort=function(){if(this._aborted){return this}this._aborted=true;if(this.xhr)this.xhr.abort();if(this.req){if(semver.gte(process.version,"v13.0.0")&&semver.lt(process.version,"v14.0.0")){throw new Error("Superagent does not work in v13 properly with abort() due to Node.js core changes")}else if(semver.gte(process.version,"v14.0.0")){this.req.destroyed=true}this.req.abort()}this.clearTimeout();this.emit("abort");return this};RequestBase.prototype._auth=function(user,pass,options,base64Encoder){switch(options.type){case"basic":this.set("Authorization","Basic ".concat(base64Encoder("".concat(user,":").concat(pass))));break;case"auto":this.username=user;this.password=pass;break;case"bearer":this.set("Authorization","Bearer ".concat(user));break;default:break}return this};RequestBase.prototype.withCredentials=function(on){if(on===undefined)on=true;this._withCredentials=on;return this};RequestBase.prototype.redirects=function(n){this._maxRedirects=n;return this};RequestBase.prototype.maxResponseSize=function(n){if(typeof n!=="number"){throw new TypeError("Invalid argument")}this._maxResponseSize=n;return this};RequestBase.prototype.toJSON=function(){return{method:this.method,url:this.url,data:this._data,headers:this._header}};RequestBase.prototype.send=function(data){var isObject_=isObject(data);var type=this._header["content-type"];if(this._formData){throw new Error(".send() can't be used if .attach() or .field() is used. Please use only .send() or only .field() & .attach()")}if(isObject_&&!this._data){if(Array.isArray(data)){this._data=[]}else if(!this._isHost(data)){this._data={}}}else if(data&&this._data&&this._isHost(this._data)){throw new Error("Can't merge these send calls")}if(isObject_&&isObject(this._data)){for(var key in data){if(hasOwn(data,key))this._data[key]=data[key]}}else if(typeof data==="string"){if(!type)this.type("form");type=this._header["content-type"];if(type)type=type.toLowerCase().trim();if(type==="application/x-www-form-urlencoded"){this._data=this._data?"".concat(this._data,"&").concat(data):data}else{this._data=(this._data||"")+data}}else{this._data=data}if(!isObject_||this._isHost(data)){return this}if(!type)this.type("json");return this};RequestBase.prototype.sortQuery=function(sort){this._sort=typeof sort==="undefined"?true:sort;return this};RequestBase.prototype._finalizeQueryString=function(){var query=this._query.join("&");if(query){this.url+=(this.url.includes("?")?"&":"?")+query}this._query.length=0;if(this._sort){var index=this.url.indexOf("?");if(index>=0){var queryArray=this.url.slice(index+1).split("&");if(typeof this._sort==="function"){queryArray.sort(this._sort)}else{queryArray.sort()}this.url=this.url.slice(0,index)+"?"+queryArray.join("&")}}};RequestBase.prototype._appendQueryString=function(){console.warn("Unsupported")};RequestBase.prototype._timeoutError=function(reason,timeout,errno){if(this._aborted){return}var error=new Error("".concat(reason+timeout,"ms exceeded"));error.timeout=timeout;error.code="ECONNABORTED";error.errno=errno;this.timedout=true;this.timedoutError=error;this.abort();this.callback(error)};RequestBase.prototype._setTimeouts=function(){var self=this;if(this._timeout&&!this._timer){this._timer=setTimeout((function(){self._timeoutError("Timeout of ",self._timeout,"ETIME")}),this._timeout)}if(this._responseTimeout&&!this._responseTimeoutTimer){this._responseTimeoutTimer=setTimeout((function(){self._timeoutError("Response timeout of ",self._responseTimeout,"ETIMEDOUT")}),this._responseTimeout)}}}).call(this)}).call(this,require("_process"))},{"./utils":221,_process:160,semver:34}],220:[function(require,module,exports){"use strict";var utils=require("./utils");module.exports=ResponseBase;function ResponseBase(){}ResponseBase.prototype.get=function(field){return this.header[field.toLowerCase()]};ResponseBase.prototype._setHeaderProperties=function(header){var ct=header["content-type"]||"";this.type=utils.type(ct);var parameters=utils.params(ct);for(var key in parameters){if(Object.prototype.hasOwnProperty.call(parameters,key))this[key]=parameters[key]}this.links={};try{if(header.link){this.links=utils.parseLinks(header.link)}}catch(_unused){}};ResponseBase.prototype._setStatusProperties=function(status){var type=Math.trunc(status/100);this.statusCode=status;this.status=this.statusCode;this.statusType=type;this.info=type===1;this.ok=type===2;this.redirect=type===3;this.clientError=type===4;this.serverError=type===5;this.error=type===4||type===5?this.toError():false;this.created=status===201;this.accepted=status===202;this.noContent=status===204;this.badRequest=status===400;this.unauthorized=status===401;this.notAcceptable=status===406;this.forbidden=status===403;this.notFound=status===404;this.unprocessableEntity=status===422}},{"./utils":221}],221:[function(require,module,exports){"use strict";function _typeof(obj){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(obj){return typeof obj}:function(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj},_typeof(obj)}function _createForOfIteratorHelper(o,allowArrayLike){var it=typeof Symbol!=="undefined"&&o[Symbol.iterator]||o["@@iterator"];if(!it){if(Array.isArray(o)||(it=_unsupportedIterableToArray(o))||allowArrayLike&&o&&typeof o.length==="number"){if(it)o=it;var i=0;var F=function F(){};return{s:F,n:function n(){if(i>=o.length)return{done:true};return{done:false,value:o[i++]}},e:function e(_e){throw _e},f:F}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var normalCompletion=true,didErr=false,err;return{s:function s(){it=it.call(o)},n:function n(){var step=it.next();normalCompletion=step.done;return step},e:function e(_e2){didErr=true;err=_e2},f:function f(){try{if(!normalCompletion&&it.return!=null)it.return()}finally{if(didErr)throw err}}}}function _unsupportedIterableToArray(o,minLen){if(!o)return;if(typeof o==="string")return _arrayLikeToArray(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);if(n==="Object"&&o.constructor)n=o.constructor.name;if(n==="Map"||n==="Set")return Array.from(o);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return _arrayLikeToArray(o,minLen)}function _arrayLikeToArray(arr,len){if(len==null||len>arr.length)len=arr.length;for(var i=0,arr2=new Array(len);i0);return encoded}function decode(str){var decoded=0;for(i=0;i{p.setup=()=>{p.createCanvas(width,height,p[mode])};p.draw=()=>{}}),"hydra-ui");this.width=width;this.height=height;this.mode=mode;this.canvas.style.position="absolute";this.canvas.style.top="0px";this.canvas.style.left="0px";this.canvas.style.zIndex=-1}show(){this.canvas.style.visibility="visible"}hide(){this.canvas.style.visibility="hidden"}clear(){this.drawingContext.clearRect(0,0,this.canvas.width,this.canvas.height)}}module.exports=P5},{}],229:[function(require,module,exports){var PatchBay=require("./rtc-patch-bay.js");var inherits=require("inherits");var PBLive=function(){this.session={};this.nickFromId={};this.idFromNick={};this.loadFromStorage()};inherits(PBLive,PatchBay);PBLive.prototype.init=function(stream,opts){this.settings={server:opts.server||"https://patch-bay.glitch.me/",room:opts.room||"patch-bay",stream:stream};this.makeGlobal=opts.makeGlobal||true;this.setPageTitle=opts.setTitle||true;if(this.session.id)this.settings.id=this.session.id;PatchBay.call(this,this.settings);if(this.makeGlobal)window.pb=this;this.on("ready",(()=>{if(!this.nick){if(this.session.nick){this.setName(this.session.nick)}else{this.session.id=this.id;this.setName(this.session.id)}}}));this.on("broadcast",this._processBroadcast.bind(this));this.on("new peer",this.handleNewPeer.bind(this));window.onbeforeunload=()=>{this.session.id=window.pb.id;this.session.nick=this.nick;sessionStorage.setItem("pb",JSON.stringify(this.session))};var self=this;this.on("stream",(function(id,stream){console.log("got stream!",id,stream);const video=document.createElement("video");if("srcObject"in video){video.srcObject=stream}else{video.src=window.URL.createObjectURL(stream)}video.addEventListener("loadedmetadata",(()=>{video.play();self.video=video;self.emit("got video",self.nickFromId[id],video)}))}))};PBLive.prototype.loadFromStorage=function(){if(sessionStorage.getItem("pb")!==null){this.session=JSON.parse(sessionStorage.getItem("pb"))}};PBLive.prototype.initSource=function(nick,callback){this.initConnectionFromId(this.idFromNick[nick],callback)};PBLive.prototype.handleNewPeer=function(peer){this.nickFromId[peer]=peer;this.idFromNick[peer]=peer;if(this.nick){this.broadcast({type:"update-nick",id:this.id,nick:this.nick})}};PBLive.prototype.list=function(){var l=Object.keys(this.idFromNick);console.log(l);return Object.keys(this.idFromNick)};PBLive.prototype.setName=function(nick){this.broadcast({type:"update-nick",id:this.id,nick:nick,previous:this.nick});this.nick=nick;if(this.setPageTitle)document.title=nick};PBLive.prototype._processBroadcast=function(data){if(data.type==="update-nick"){if(data.previous!==data.nick){delete this.idFromNick[this.nickFromId[data.id]];this.nickFromId[data.id]=data.nick;this.idFromNick[data.nick]=data.id;if(data.previous){}else{}}}};module.exports=PBLive},{"./rtc-patch-bay.js":230,inherits:102}],230:[function(require,module,exports){var io=require("socket.io-client");var SimplePeer=require("simple-peer");var extend=Object.assign;var events=require("events").EventEmitter;var inherits=require("inherits");const shortid=require("shortid");var PatchBay=function(options){this.signaller=io(options.server);this.id=options.id||shortid.generate();this.stream=options.stream||null;this._peerOptions=options.peerOptions||{};this._room=options.room;this.settings["shareMediaWhenRequested"]=true;this.settings["shareMediaWhenInitiating"]=false;this.settings["requestMediaWhenInitiating"]=true;this.settings["autoconnect"]=false;this.peers={};this.rtcPeers={};this.signaller.on("ready",this._readyForSignalling.bind(this));this.signaller.on("message",this._handleMessage.bind(this));this.signaller.on("broadcast",this._receivedBroadcast.bind(this));this.signaller.emit("join",this._room,{uuid:this.id});this.signaller.on("new peer",this._newPeer.bind(this))};inherits(PatchBay,events);PatchBay.prototype.sendToAll=function(data){Object.keys(this.rtcPeers).forEach((function(id){this.rtcPeers[id].send(data)}),this)};PatchBay.prototype.sendToPeer=function(peerId,data){if(peerId in this.rtcPeers){this.rtcPeers[peerId].send(data)}};PatchBay.prototype.reinitAll=function(){Object.keys(this.rtcPeers).forEach(function(id){this.reinitPeer(id)}.bind(this))};PatchBay.prototype.initRtcPeer=function(id,opts){this.emit("new peer",{id:id});var newOptions=opts;if(this.iceServers){opts["config"]={iceServers:this.iceServers}}if(opts.initiator===true){if(this.stream!=null){if(this.settings.shareMediaWhenInitiating===true){newOptions.stream=this.stream}}if(this.settings.requestMediaWhenInitiating===true){newOptions.offerConstraints={offerToReceiveVideo:true,offerToReceiveAudio:true}}}else{if(this.settings.shareMediaWhenRequested===true){if(this.stream!=null){newOptions.stream=this.stream}}}var options=extend(this._peerOptions,newOptions);this.rtcPeers[id]=new SimplePeer(options);this._attachPeerEvents(this.rtcPeers[id],id)};PatchBay.prototype.reinitRtcConnection=function(id,opts){this.rtcPeers[id]._destroy(null,function(e){this.initRtcPeer(id,{stream:this.stream,initiator:true})}.bind(this))};PatchBay.prototype._newPeer=function(peer){this.peers[peer]={rtcPeer:null};this.emit("new peer",peer)};PatchBay.prototype._readyForSignalling=function({peers:peers,servers:servers}){peers.forEach((peer=>{this._newPeer(peer)}));if(servers){this.iceServers=servers}this.emit("ready")};PatchBay.prototype.initConnectionFromId=function(id,callback){if(id in this.rtcPeers){console.log("Already connected to..",id,this.rtcPeers);if(this.rtcPeers[id].initiator===false){this.reinitRtcConnection(id)}else{}}else{this.initRtcPeer(id,{initiator:true})}};PatchBay.prototype._handleMessage=function(data){if(data.type==="signal"){this._handleSignal(data)}else{this.emit("message",data)}};PatchBay.prototype._handleSignal=function(data){if(!this.rtcPeers[data.id]){this.initRtcPeer(data.id,{initiator:false})}this.rtcPeers[data.id].signal(data.message)};PatchBay.prototype._receivedBroadcast=function(data){this.emit("broadcast",data)};PatchBay.prototype.broadcast=function(data){this.signaller.emit("broadcast",data)};PatchBay.prototype._attachPeerEvents=function(p,_id){p.on("signal",function(id,signal){this.signaller.emit("message",{id:id,message:signal,type:"signal"})}.bind(this,_id));p.on("stream",function(id,stream){this.rtcPeers[id].stream=stream;this.emit("stream",id,stream)}.bind(this,_id));p.on("connect",function(id){this.emit("connect",id)}.bind(this,_id));p.on("data",function(id,data){this.emit("data",{id:id,data:JSON.parse(data)})}.bind(this,_id));p.on("close",function(id){delete this.rtcPeers[id];this.emit("close",id)}.bind(this,_id));p.on("error",(function(e){console.warn("simple peer error",e)}))};PatchBay.prototype._destroy=function(){Object.values(this.rtcPeers).forEach((function(peer){peer.destroy()}));this.signaller.close()};module.exports=PatchBay},{events:81,inherits:102,shortid:171,"simple-peer":181,"socket.io-client":200}],231:[function(require,module,exports){module.exports=[{sketch_id:"example_0",code:"JTJGJTJGRmxvciUyMGRlJTIwRnVlZ28lMEElMEFzaGFwZSgyMDAlMkMwLjUlMkMxLjUpJTBBLnNjYWxlKDAuNSUyQzAuNSklMEEuY29sb3IoJTVCMC41JTJDMiU1RC5zbW9vdGgoMSklMkMwLjMlMkMwKSUwQS5yZXBlYXQoMiUyQzIpJTBBLm1vZHVsYXRlU2NhbGUob3NjKDMlMkMwLjUpJTJDLTAuNiklMEEuYWRkKG8wJTJDMC41KSUwQS5zY2FsZSgwLjkpJTBBLm91dCgp"},{sketch_id:"example_3",code:"JTJGJTJGJTIwYnklMjBPbGl2aWElMjBKYWNrJTBBJTBBb3NjKDIwJTJDJTIwMC4wMyUyQyUyMDEuNykua2FsZWlkKCkubXVsdChvc2MoMjAlMkMlMjAwLjAwMSUyQyUyMDApLnJvdGF0ZSgxLjU4KSkuYmxlbmQobzAlMkMlMjAwLjk0KS5tb2R1bGF0ZVNjYWxlKG9zYygxMCUyQyUyMDApJTJDLTAuMDMpLnNjYWxlKDAuOCUyQyUyMCgpJTIwJTNEJTNFJTIwKDEuMDUlMjAlMkIlMjAwLjElMjAqJTIwTWF0aC5zaW4oMC4wNSp0aW1lKSkpLm91dChvMCk="},{sketch_id:"example_4",code:"JTJGJTJGJTIwYnklMjBOZWxzb24lMjBWZXJhJTBBJTJGJTJGJTIwdHdpdHRlciUzQSUyMCU0MG5lbF9zb25vbG9naWElMEElMEFvc2MoOCUyQy0wLjUlMkMlMjAxKS5jb2xvcigtMS41JTJDJTIwLTEuNSUyQyUyMC0xLjUpLmJsZW5kKG8wKS5yb3RhdGUoLTAuNSUyQyUyMC0wLjUpLm1vZHVsYXRlKHNoYXBlKDQpLnJvdGF0ZSgwLjUlMkMlMjAwLjUpLnNjYWxlKDIpLnJlcGVhdFgoMiUyQyUyMDIpLm1vZHVsYXRlKG8wJTJDJTIwKCklMjAlM0QlM0UlMjBtb3VzZS54JTIwKiUyMDAuMDAwNSkucmVwZWF0WSgyJTJDJTIwMikpLm91dChvMCklMEElMEElMEElMEElMEElMEE="},{sketch_id:"example_6",code:"JTJGJTJGJTIwYnklMjBEJUMzJUE5Ym9yYSUyMEZhbGxlaXJvcyUyMEdvbnphbGVzJTBBJTJGJTJGJTIwaHR0cHMlM0ElMkYlMkZ3d3cuZ29uemFsZXNkZWJvcmEuY29tJTJGJTBBJTBBb3NjKDUpLmFkZChub2lzZSg1JTJDJTIwMikpLmNvbG9yKDAlMkMlMjAwJTJDJTIwMykuY29sb3JhbWEoMC40KS5vdXQoKSUwQSUwQSUwQSUwQQ=="},{sketch_id:"example_8",code:"JTJGJTJGJTIwYnklMjBSb2RyaWdvJTIwVmVsYXNjbyUwQSUyRiUyRiUyMGh0dHBzJTNBJTJGJTJGeWVjdG8uZ2l0aHViLmlvJTJGJTBBJTBBb3NjKDEwNyUyQyUyMDAlMkMlMjAwLjcpLmNvbG9yKDElMkMlMjAwJTJDJTIwMSkucm90YXRlKDAlMkMlMjAtMC4wOCkubW9kdWxhdGVSb3RhdGUobzElMkMlMjAwLjQpLm91dChvMCklMEFvc2MoMzMpLnJvdGF0ZSgyJTJDJTIwMC44KS5tb2R1bGF0ZVJvdGF0ZShvMCUyQyUyMCgpJTIwJTNEJTNFJTIwKGEuZmZ0JTVCMCU1RCoyKSkub3V0KG8xKSUwQQ=="},{sketch_id:"example_9",code:"JTJGJTJGJTIwYnklMjBSb2RyaWdvJTIwVmVsYXNjbyUwQSUyRiUyRiUyMGh0dHBzJTNBJTJGJTJGeWVjdG8uZ2l0aHViLmlvJTJGJTBBJTBBb3NjKDE4JTJDJTIwMC4xJTJDJTIwMCkuY29sb3IoMiUyQyUyMDAuMSUyQyUyMDIpJTBBLm11bHQob3NjKDIwJTJDJTIwMC4wMSUyQyUyMDApKS5yZXBlYXQoMiUyQyUyMDIwKS5yb3RhdGUoMC41KS5tb2R1bGF0ZShvMSklMEEuc2NhbGUoMSUyQyUyMCgpJTIwJTNEJTNFJTIwJTIwKGEuZmZ0JTVCMCU1RCowLjklMjAlMkIlMjAyKSkuZGlmZihvMSkub3V0KG8wKSUwQW9zYygyMCUyQyUyMDAuMiUyQyUyMDApLmNvbG9yKDIlMkMlMjAwLjclMkMlMjAwLjEpLm11bHQob3NjKDQwKSkubW9kdWxhdGVSb3RhdGUobzAlMkMlMjAwLjIpJTBBLnJvdGF0ZSgwLjIpLm91dChvMSk="},{sketch_id:"example_10",code:"JTJGJTJGJTIwYnklMjBaYWNoJTIwS3JhbGwlMEElMkYlMkYlMjBodHRwJTNBJTJGJTJGemFjaGtyYWxsLm9ubGluZSUyRiUwQSUwQW9zYyglMjAyMTUlMkMlMjAwLjElMkMlMjAyJTIwKSUwQS5tb2R1bGF0ZSglMEElMjAlMjBvc2MoJTIwMiUyQyUyMC0wLjMlMkMlMjAxMDAlMjApJTBBJTIwJTIwLnJvdGF0ZSgxNSklMEEpJTBBLm11bHQoJTBBJTIwJTIwb3NjKCUyMDIxNSUyQyUyMC0wLjElMkMlMjAyKSUwQSUyMCUyMC5waXhlbGF0ZSglMjA1MCUyQyUyMDUwJTIwKSUwQSklMEEuY29sb3IoJTIwMC45JTJDJTIwMC4wJTJDJTIwMC45JTIwKSUwQS5tb2R1bGF0ZSglMEElMjAlMjBvc2MoJTIwNiUyQyUyMC0wLjElMjApJTBBJTIwJTIwLnJvdGF0ZSglMjA5JTIwKSUwQSklMEEuYWRkKCUwQSUyMCUyMG9zYyglMjAxMCUyQyUyMC0wLjklMkMlMjA5MDAlMjApJTBBJTIwJTIwLmNvbG9yKDElMkMwJTJDMSklMEEpJTBBLm11bHQoJTBBJTIwJTIwc2hhcGUoOTAwJTJDJTIwMC4yJTJDJTIwMSklMEElMjAlMjAubHVtYSgpJTBBJTIwJTIwLnJlcGVhdFgoMiklMEElMjAlMjAucmVwZWF0WSgyKSUwQSUyMCUyMC5jb2xvcmFtYSgxMCklMEEpJTBBLm1vZHVsYXRlKCUwQSUyMCUyMG9zYyglMjA5JTJDJTIwLTAuMyUyQyUyMDkwMCUyMCklMEElMjAlMjAucm90YXRlKCUyMDYlMjApJTBBKSUwQS5hZGQoJTBBJTIwJTIwb3NjKDQlMkMlMjAxJTJDJTIwOTApJTBBJTIwJTIwLmNvbG9yKDAuMiUyQzAlMkMxKSUwQSklMEEub3V0KCklMEE="},{sketch_id:"example_11",code:"JTJGJTJGJTIwYnklMjBaYWNoJTIwS3JhbGwlMEElMkYlMkYlMjBodHRwJTNBJTJGJTJGemFjaGtyYWxsLm9ubGluZSUyRiUwQSUwQW9zYygxMCUyQyUyMDAuOSUyQyUyMDMwMCklMEEuY29sb3IoMC45JTJDJTIwMC43JTJDJTIwMC44KSUwQS5kaWZmKCUwQSUyMCUyMG9zYyg0NSUyQyUyMDAuMyUyQyUyMDEwMCklMEElMjAlMjAuY29sb3IoMC45JTJDJTIwMC45JTJDJTIwMC45KSUwQSUyMCUyMC5yb3RhdGUoMC4xOCklMEElMjAlMjAucGl4ZWxhdGUoMTIpJTBBJTIwJTIwLmthbGVpZCgpJTBBKSUwQS5zY3JvbGxYKDEwKSUwQS5jb2xvcmFtYSgpJTBBLmx1bWEoKSUwQS5yZXBlYXRYKDQpJTBBLnJlcGVhdFkoNCklMEEubW9kdWxhdGUoJTBBJTIwJTIwb3NjKDElMkMlMjAtMC45JTJDJTIwMzAwKSUwQSklMEEuc2NhbGUoMiklMEEub3V0KCklMEE="},{sketch_id:"example_13",code:"JTJGJTJGJTIwYWNpZCUyMGJ1cyUyMHNlYXQlMEElMkYlMkYlMjBieSUyMFdpbGwlMjBIdW1waHJleXMlMEElMkYlMkYlMjBodHRwcyUzQSUyRiUyRmdpdGh1Yi5jb20lMkZUaGVXaXNweSUwQSUwQW9zYygxMDUpLmNvbG9yKDAuNSUyQzAuMSUyQzAuOCkucm90YXRlKDAuMTElMkMlMjAwLjEpLm1vZHVsYXRlKG9zYygxMCkucm90YXRlKDAuMykuYWRkKG8wJTJDJTIwMC4xKSkuYWRkKG9zYygyMCUyQzAuMDElMkMxKS5jb2xvcigwJTJDMC44JTJDMSkpLm91dChvMCklMEFvc2MoNTAlMkMwLjA1JTJDJTIwMC43KS5jb2xvcigxJTJDMC43JTJDMC41KS5kaWZmKG8wKS5tb2R1bGF0ZShvMSUyQzAuMDUpLm91dChvMSklMEFyZW5kZXIobzEp"},{sketch_id:"example_14",code:"JTJGJTJGJTIwYnklMjBPbGl2aWElMjBKYWNrJTBBJTJGJTJGJTIwJTQwX29qYWNrXyUwQSUwQW9zYygyMCUyQyUyMDAuMDElMkMlMjAxLjEpJTBBJTA5LmthbGVpZCg1KSUwQSUwOS5jb2xvcigyLjgzJTJDMC45MSUyQzAuMzkpJTBBJTA5LnJvdGF0ZSgwJTJDJTIwMC4xKSUwQSUwOS5tb2R1bGF0ZShvMCUyQyUyMCgpJTIwJTNEJTNFJTIwbW91c2UueCUyMColMjAwLjAwMDMpJTBBJTA5LnNjYWxlKDEuMDEpJTBBJTIwJTIwJTA5Lm91dChvMCk="},{sketch_id:"example_15",code:"JTJGJTJGJTIwYnklMjBPbGl2aWElMjBKYWNrJTBBJTJGJTJGJTIwaHR0cHMlM0ElMkYlMkZvamFjay5naXRodWIuaW8lMEElMEFvc2MoMTAwJTJDJTIwMC4wMSUyQyUyMDEuNCklMEElMDkucm90YXRlKDAlMkMlMjAwLjEpJTBBJTA5Lm11bHQob3NjKDEwJTJDJTIwMC4xKS5tb2R1bGF0ZShvc2MoMTApLnJvdGF0ZSgwJTJDJTIwLTAuMSklMkMlMjAxKSklMEElMDkuY29sb3IoMi44MyUyQzAuOTElMkMwLjM5KSUwQSUyMCUyMC5vdXQobzAp"},{sketch_id:"example_16",code:"JTJGJTJGJTIwYnklMjBPbGl2aWElMjBKYWNrJTBBJTJGJTJGJTIwaHR0cHMlM0ElMkYlMkZvamFjay5naXRodWIuaW8lMEElMEFvc2MoNCUyQyUyMDAuMSUyQyUyMDAuOCkuY29sb3IoMS4wNCUyQzAlMkMlMjAtMS4xKS5yb3RhdGUoMC4zMCUyQyUyMDAuMSkucGl4ZWxhdGUoMiUyQyUyMDIwKS5tb2R1bGF0ZShub2lzZSgyLjUpJTJDJTIwKCklMjAlM0QlM0UlMjAxLjUlMjAqJTIwTWF0aC5zaW4oMC4wOCUyMColMjB0aW1lKSkub3V0KG8wKQ=="},{sketch_id:"example_17",code:"JTJGJTJGJTIwbW9pcmUlMEElMkYlMkYlMjBieSUyME9saXZpYSUyMEphY2slMEElMkYlMkYlMjB0d2l0dGVyJTNBJTIwJTQwX29qYWNrXyUwQSUwQXBhdHRlcm4lMjAlM0QlMjAoKSUyMCUzRCUzRSUyMG9zYygyMDAlMkMlMjAwKS5rYWxlaWQoMjAwKS5zY2FsZSgxJTJDJTIwMC40KSUwQSUyRiUyRiUwQXBhdHRlcm4oKSUwQSUyMCUyMC5zY3JvbGxYKDAuMSUyQyUyMDAuMDEpJTBBJTIwJTIwLm11bHQocGF0dGVybigpKSUwQSUyMCUyMC5vdXQoKQ=="},{sketch_id:"example_18",code:"JTJGJTJGJTIwYnklMjBPbGl2aWElMjBKYWNrJTBBJTJGJTJGJTIwaHR0cHMlM0ElMkYlMkZvamFjay5naXRodWIuaW8lMEElMEFvc2MoNiUyQyUyMDAlMkMlMjAwLjgpJTBBJTIwJTIwLmNvbG9yKDEuMTQlMkMlMjAwLjYlMkMuODApJTBBJTIwJTIwLnJvdGF0ZSgwLjkyJTJDJTIwMC4zKSUwQSUyMCUyMC5waXhlbGF0ZSgyMCUyQyUyMDEwKSUwQSUyMCUyMC5tdWx0KG9zYyg0MCUyQyUyMDAuMDMpLnRocmVzaCgwLjQpLnJvdGF0ZSgwJTJDJTIwLTAuMDIpKSUwQSUyMCUyMC5tb2R1bGF0ZVJvdGF0ZShvc2MoMjAlMkMlMjAwKS50aHJlc2goMC4zJTJDJTIwMC42KSUyQyUyMCgpJTIwJTNEJTNFJTIwMC4xJTIwJTJCJTIwbW91c2UueCUyMColMjAwLjAwMiklMEElMjAlMjAub3V0KG8wKQ=="},{sketch_id:"rangga_0",code:"JTJGJTJGJTIwRHJlYW15JTIwRGlhbW9uZCUwQSUyRiUyRiUyMGJ5JTIwUmFuZ2dhJTIwUHVybmFtYSUyMEFqaSUwQSUyRiUyRiUyMGh0dHBzJTNBJTJGJTJGcmFuZ2dhcHVybmFtYWFqaTEud2l4c2l0ZS5jb20lMkZwb3J0Zm9saW8lMEElMEFvc2MoNyUyQy0wLjEyNSkubW9kdWxhdGUodm9yb25vaSgxKSkuZGlmZih2b3Jvbm9pKDEpLm11bHQoZ3JhZGllbnQoLTEpLmx1bWEoMC4xMjUpKSklMEElMjAlMjAubHVtYSgwLjEyNSklMEElMjAlMjAuYWRkKHNoYXBlKDclMkMlMjAwLjUpJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwLm11bHQodm9yb25vaSgxMCUyQzIpLmJsZW5kKG8wKS5kaWZmKGdyYWRpZW50KDEpKS5tb2R1bGF0ZSh2b3Jvbm9pKCkpKSklMEElMjAlMjAuc2Nyb2xsWSgtMC4xKSUwQSUyMCUyMC5zY3JvbGxYKDAuMTI1KSUwQSUyMCUyMC5ibGVuZChvMCklMEElMjAlMjAuYmxlbmQobzApJTBBJTIwJTIwLm91dCgpJTBB"},{sketch_id:"rangga_1",code:"JTJGJTJGJTIwVGFnJTIwJTI2JTIwU3dlZXAlMEElMkYlMkYlMjBieSUyMFJhbmdnYSUyMFB1cm5hbWElMjBBamklMEElMkYlMkYlMjBodHRwcyUzQSUyRiUyRnJhbmdnYXB1cm5hbWFhamkxLndpeHNpdGUuY29tJTJGcG9ydGZvbGlvJTBBJTBBb3NjKDUlMkMwLjEyNSkuY29sb3JhbWEoMSklMEElMjAlMjAubHVtYSgwLjEyNSkuYWRkKHNoYXBlKDElMkMwLjUpLmx1bWEoMikuZGlmZihncmFkaWVudCgxKSkpJTBBJTIwJTIwLmRpZmYob3NjKC0xJTJDLTAuMjUpKS5ibGVuZChvMCkuY29sb3IoMCUyQzIuNSUyQzEuNzUpJTBBJTIwJTIwLm91dCgp"},{sketch_id:"rangga_2",code:"JTJGJTJGJTIwTW9ub2Nocm9tZSUyME1lbW9hciUwQSUyRiUyRiUyMGJ5JTIwUmFuZ2dhJTIwUHVybmFtYSUyMEFqaSUwQSUyRiUyRiUyMGh0dHBzJTNBJTJGJTJGcmFuZ2dhcHVybmFtYWFqaTEud2l4c2l0ZS5jb20lMkZwb3J0Zm9saW8lMEElMEF2b3Jvbm9pKDUwJTJDMSklMEElMjAlMjAubHVtYSgwLjUpLmFkZChzaGFwZSgxJTJDMSkubHVtYSgxKSklMEElMjAlMjAubW9kdWxhdGUob3NjKC0xMDAwJTJDLTEpJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwLm1vZHVsYXRlKG9zYygpLmx1bWEoKSkpJTBBJTIwJTIwLmJsZW5kKG8wKSUwQSUyMCUyMC5ibGVuZChvMCklMEElMjAlMjAuYmxlbmQobzApJTBBJTIwJTIwLmJsZW5kKG8wKSUwQSUyMCUyMC5vdXQoKQ=="},{sketch_id:"rangga_3",code:"JTJGJTJGJTIwR2FsYXh5JTIwVHJpcCUwQSUyRiUyRiUyMGJ5JTIwUmFuZ2dhJTIwUHVybmFtYSUyMEFqaSUwQSUyRiUyRiUyMGh0dHBzJTNBJTJGJTJGcmFuZ2dhcHVybmFtYWFqaTEud2l4c2l0ZS5jb20lMkZwb3J0Zm9saW8lMEElMEFzaGFwZSgxJTJDMSklMEElMjAlMjAubXVsdCh2b3Jvbm9pKDEwMDAlMkMyKSUwQSUyMCUyMC5ibGVuZChvMCkubHVtYSgpKSUwQSUyMCUyMC5hZGQoc2hhcGUoMyUyQzAuMTI1KSUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMC5yb3RhdGUoMSUyQzEpLm11bHQodm9yb25vaSgxMDAwJTJDMSkubHVtYSgpKSUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMC5yb3RhdGUoMS41KSkuc2Nyb2xsWCglNUIwLjElMkMtMC4wNjI1JTJDMC4wMDUlMkMwLjAwMDAxJTVEJTJDMCklMEElMjAlMjAuc2Nyb2xsWSglNUIwLjElMkMtMC4wNjI1JTJDMC4wMDUlMkMwLjAwMDAxJTVEJTJDMCklMEElMjAlMjAub3V0KCk="},{sketch_id:"rangga_4",code:"JTJGJTJGJTIwU3VtZXQlMEElMkYlMkYlMjBieSUyMFJhbmdnYSUyMFB1cm5hbWElMjBBamklMEElMkYlMkYlMjBodHRwcyUzQSUyRiUyRnJhbmdnYXB1cm5hbWFhamkxLndpeHNpdGUuY29tJTJGcG9ydGZvbGlvJTBBJTBBb3NjKDAuNSUyQzEuMjUpLm11bHQoc2hhcGUoMSUyQzAuMDkpLnJvdGF0ZSgxLjUpKSUwQSUyMCUyMC5kaWZmKGdyYWRpZW50KCkpJTBBJTIwJTIwLmFkZChzaGFwZSgyJTJDMikuYmxlbmQoZ3JhZGllbnQoMSkpKSUwQSUyMCUyMC5tb2R1bGF0ZShub2lzZSgpJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwLm1vZHVsYXRlKG5vaXNlKCkuc2Nyb2xsWSgxJTJDMC4wNjI1KSkpJTBBJTIwJTIwLmJsZW5kKG8wKSUwQSUyMCUyMC5jb2xvcigxJTJDLTAuNSUyQy0wLjc1KSUwQSUyMCUyMC5vdXQoKQ=="},{sketch_id:"marianne_0",code:"JTJGJTJGcG9ydCUwQSUyRiUyRmJ5JTIwTWFyaWFubmUlMjBUZWl4aWRvJTBBJTJGJTJGaHR0cHMlM0ElMkYlMkZtYXJpYW5uZXRlaXhpZG8uZ2l0aHViLmlvJTJGJTBBJTBBb3NjKDUlMkMlMjAwLjklMkMlMjAwLjAwMSklMEElMjAlMjAlMjAlMjAua2FsZWlkKCU1QjMlMkM0JTJDNSUyQzclMkM4JTJDOSUyQzEwJTVELmZhc3QoMC4xKSklMEElMjAlMjAlMjAlMjAuY29sb3IoMC41JTJDJTIwMC4zKSUwQSUyMCUyMCUyMCUyMC5jb2xvcmFtYSgwLjQpJTBBJTIwJTIwJTIwJTIwLnJvdGF0ZSgwLjAwOSUyQygpJTNEJTNFTWF0aC5zaW4odGltZSkqJTIwLTAuMDAxJTIwKSUwQSUyMCUyMCUyMCUyMC5tb2R1bGF0ZVJvdGF0ZShvMCUyQygpJTNEJTNFTWF0aC5zaW4odGltZSklMjAqJTIwMC4wMDMpJTBBJTIwJTIwJTIwJTIwLm1vZHVsYXRlKG8wJTJDJTIwMC45KSUwQSUyMCUyMCUyMCUyMC5zY2FsZSgwLjkpJTBBJTIwJTIwJTIwJTIwLm91dChvMCklMEElMEE="},{sketch_id:"marianne_1",code:"JTJGJTJGUGl4ZWxzY2FwZSUwQSUyRiUyRk1hcmlhbm5lJTIwVGVpeGlkbyUwQSUyRiUyRmh0dHBzJTNBJTJGJTJGZ2l0aHViLmNvbSUyRk1hcmlhbm5lVGVpeGlkbyUwQSUwQXNyYyhvMCklMEElMjAuc2F0dXJhdGUoMS4wMSklMEElMjAuc2NhbGUoLjk5OSklMEElMjAuY29sb3IoMS4wMSUyQzEuMDElMkMxLjAxKSUwQSUyMC5odWUoLjAxKSUwQSUyMC5tb2R1bGF0ZUh1ZShzcmMobzEpLmh1ZSguMykucG9zdGVyaXplKC0xKS5jb250cmFzdCguNyklMkMyKSUwQSUyMCUyMC5sYXllcihzcmMobzEpJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwLmx1bWEoKSUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMC5tdWx0KGdyYWRpZW50KDEpJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwLnNhdHVyYXRlKC45KSkpJTBBJTIwJTIwLm91dChvMCklMEElMEFub2lzZSgxJTJDJTIwLjIpJTBBJTIwJTIwLnJvdGF0ZSgyJTJDLjUpJTBBJTIwJTIwLmxheWVyKHNyYyhvMCklMEElMjAlMjAuc2Nyb2xsWCguMikpJTBBJTIwJTIwLm91dChvMSklMEElMEFyZW5kZXIobzAp"},{sketch_id:"naoto_0",code:"JTJGJTJGJTIwJTQwbmFvdG9faGllZGElMEFvc2MoMjAlMkMlMjAwLjElMkMlMjAwKS5jb2xvcigwJTJDJTIwMSUyQyUyMDIpLnJvdGF0ZSgxLjU3JTJGMikub3V0KG8xKSUwQW9zYygzMCUyQyUyMDAuMDElMkMlMjAwKS5jb2xvcigyJTJDJTIwMC43JTJDJTIwMSkubW9kdWxhdGUobzElMkMlMjAwKS5hZGQobzElMkMxKS5tb2R1bGF0ZVBpeGVsYXRlKG8xJTJDMSUyQzEwKS5vdXQobzAp"},{sketch_id:"naoto_1",code:"JTJGJTJGJTIwJTQwbmFvdG9faGllZGElMEFzb2xpZCgwLjIlMkMwLjYlMkMwLjkpLmxheWVyKG9zYygzMS40JTJDMCkudGhyZXNoKDAuNykubHVtYSgpLm1vZHVsYXRlKG9zYyg0JTJDMSkucm90YXRlKDEpJTJDMC4wNSkuY29sb3IoMCUyQzAlMkMwKSkubGF5ZXIob3NjKDMxLjQlMkMwKS50aHJlc2goMC43KS5sdW1hKCkubW9kdWxhdGUob3NjKDQlMkMxKS5yb3RhdGUoMSklMkMwLjEpKS5vdXQoKQ=="},{sketch_id:"ritchse_0",code:"JTJGJTJGcmFuZG9tJTIwdHJ5cG9waG9iaWElMjAtJTIwY2hhbmdlcyUyMGV2ZXJ5dGltZSUyMHlvdSUyMGxvYWQlMjBpdCElMEElMkYlMkZieSUyMFJpdGNoc2UlMEElMkYlMkZpbnN0YWdyYW0uY29tJTJGcml0Y2hzZSUwQSUyMCUwQWZ1bmN0aW9uJTIwcihtaW4lM0QwJTJDbWF4JTNEMSklMjAlN0IlMjByZXR1cm4lMjBNYXRoLnJhbmRvbSgpKihtYXgtbWluKSUyQm1pbiUzQiUyMCU3RCUwQSUyMCUwQXNvbGlkKDElMkMxJTJDMSklMEElMjAlMjAlMDkuZGlmZihzaGFwZSglNUI0JTJDNCUyQzQlMkMyNCU1RC5zbW9vdGgoKS5mYXN0KC41KSUyQ3IoMC42JTJDMC45MyklMkMuMDkpLnJlcGVhdCgyMCUyQzEwKSklMEElMDkubW9kdWxhdGVTY2FsZShvc2MoOCkucm90YXRlKHIoLS41JTJDLjUpKSUyQy41MiklMEElMDkuYWRkKCUwQSUyMCUyMCUwOSUwOXNyYyhvMCkuc2NhbGUoMC45NjUpLnJvdGF0ZSguMDEyKihNYXRoLnJvdW5kKHIoLTIlMkMxKSkpKSUwQSUyMCUyMCUwOSUwOS5jb2xvcihyKCklMkNyKCklMkNyKCkpJTBBJTIwJTIwJTIwJTIwJTA5Lm1vZHVsYXRlUm90YXRlKG8wJTJDcigwJTJDMC41KSklMEElMjAlMjAlMDklMDkuYnJpZ2h0bmVzcyguMTUpJTBBJTIwJTIwJTA5JTA5JTJDLjcpJTBBJTA5Lm91dCgp"},{sketch_id:"ritchse_1",code:"JTJGJTJGY29ycnVwdGVkJTIwc2NyZWVuc2F2ZXIlMEElMkYlMkZieSUyMFJpdGNoc2UlMEElMkYlMkZpbnN0YWdyYW0uY29tJTJGcml0Y2hzZSUwQSUyMCUwQXZvcm9ub2koMzUwJTJDMC4xNSklMEElMjAlMjAlMDkubW9kdWxhdGVTY2FsZShvc2MoOCkucm90YXRlKE1hdGguc2luKHRpbWUpKSUyQy41KSUwQSUyMCUyMCUwOS50aHJlc2goLjgpJTBBJTA5Lm1vZHVsYXRlUm90YXRlKG9zYyg3KSUyQy40KSUwQSUwOS50aHJlc2goLjcpJTBBJTIwJTIwJTA5LmRpZmYoc3JjKG8wKS5zY2FsZSgxLjgpKSUwQSUwOS5tb2R1bGF0ZVNjYWxlKG9zYygyKS5tb2R1bGF0ZVJvdGF0ZShvMCUyQy43NCkpJTBBJTA5LmRpZmYoc3JjKG8wKS5yb3RhdGUoJTVCLS4wMTIlMkMuMDElMkMtLjAwMiUyQzAlNUQpLnNjcm9sbFkoMCUyQyU1Qi0xJTJGMTk5ODAwJTJDMCU1RC5mYXN0KDAuNykpKSUwQSUwOS5icmlnaHRuZXNzKCU1Qi0uMDIlMkMtLjE3JTVELnNtb290aCgpLmZhc3QoLjUpKSUwQSUwOS5vdXQoKQ=="},{sketch_id:"ritchse_2",code:"JTJGJTJGdHJvcGljYWwlMjBqdWljZSUwQSUyRiUyRmJ5JTIwUml0Y2hzZSUwQSUyRiUyRmluc3RhZ3JhbS5jb20lMkZyaXRjaHNlJTBBJTIwJTBBdm9yb25vaSgyJTJDMC4zJTJDMC4yKS5zaGlmdCgwLjUpJTBBLm1vZHVsYXRlUGl4ZWxhdGUodm9yb25vaSg0JTJDMC4yKSUyQzMyJTJDMiklMEEuc2NhbGUoKCklM0QlM0UxJTJCKE1hdGguc2luKHRpbWUqMi41KSowLjA1KSklMEEuZGlmZih2b3Jvbm9pKDMpLnNoaWZ0KDAuNikpJTBBLmRpZmYob3NjKDIlMkMwLjE1JTJDMS4xKS5yb3RhdGUoKSklMEEuYnJpZ2h0bmVzcygwLjEpLmNvbnRyYXN0KDEuMikuc2F0dXJhdGUoMS4yKSUwQSUwOS5vdXQoKSUwQXNwZWVkJTIwJTNEJTIwMC44"},{sketch_id:"ritchse_3",code:"JTJGJTJGdHJ5aW5nJTIwdG8lMjBnZXQlMjBjbG9zZXIlMEElMkYlMkZieSUyMFJpdGNoc2UlMEElMkYlMkZpbnN0YWdyYW0uY29tJTJGcml0Y2hzZSUwQSUyMCUwQW9zYyg2MCUyQy0wLjAxNSUyQzAuMykuZGlmZihvc2MoNjAlMkMwLjA4KS5yb3RhdGUoTWF0aC5QSSUyRjIpKSUwQSUwOS5tb2R1bGF0ZVNjYWxlKG5vaXNlKDMuNSUyQzAuMjUpLm1vZHVsYXRlU2NhbGUob3NjKDE1KS5yb3RhdGUoKCklM0QlM0VNYXRoLnNpbih0aW1lJTJGMikpKSUyQzAuNiklMEElMDkuY29sb3IoMSUyQzAuNSUyQzAuNCkuY29udHJhc3QoMS40KSUwQSUwOS5hZGQoc3JjKG8wKS5tb2R1bGF0ZShvMCUyQy4wNCklMkMuNiklMEElMDkuaW52ZXJ0KCkuYnJpZ2h0bmVzcygwLjEpLmNvbnRyYXN0KDEuMiklMEElMDkubW9kdWxhdGVTY2FsZShvc2MoMiklMkMtMC4yKSUwQSUyMCUyMC5vdXQoKQ=="},{sketch_id:"ritchse_4",code:"JTJGJTJGJTIwZGlzaW50ZWdyYXRpb24lMEElMkYlMkYlMjBieSUyMFJpdGNoc2UlMEElMkYlMkYlMjBpbnN0YWdyYW0uY29tJTJGcml0Y2hzZSUwQSUyMCUwQW9zYyg1JTJDLjEpLm1vZHVsYXRlKG5vaXNlKDYpJTJDLjIyKS5kaWZmKG8wKSUwQSUyMCUyMCUwOS5tb2R1bGF0ZVNjcm9sbFkob3NjKDIpLm1vZHVsYXRlKG9zYygpLnJvdGF0ZSgpJTJDLjExKSklMEElMDkuc2NhbGUoLjcyKS5jb2xvcigwLjk5JTJDMS4wMTQlMkMxKSUwQSUyMCUyMCUwOS5vdXQoKQ== "},{sketch_id:"flor_0",code:"JTJGJTJGRmxvciUyMGRlJTIwRnVlZ28lMEElMkYlMkZodHRwcyUzQSUyRiUyRmZsb3JkZWZ1ZWdvLmdpdGh1Yi5pbyUyRiUwQW9zYygzMCUyQzAuMDElMkMxKSUwQS5tdWx0KG9zYygyMCUyQy0wLjElMkMxKS5tb2R1bGF0ZShub2lzZSgzJTJDMSkpLnJvdGF0ZSgwLjcpKSUwQS5wb3N0ZXJpemUoJTVCMyUyQzEwJTJDMiU1RC5mYXN0KDAuNSkuc21vb3RoKDEpKSUwQS5tb2R1bGF0ZVJvdGF0ZShvMCUyQygpJTNEJTNFbW91c2UueCowLjAwMyklMEEub3V0KCk= "},{sketch_id:"mahalia_0",code:"JTJGJTJGJTIwTWFoYWxpYSUyMEgtUiUwQSUyRiUyRiUyMElHJTNBJTIwJTQwbW1faHJfJTBBJTBBc2hhcGUoMjAlMkMwLjElMkMwLjAxKSUwQSUyMCUyMC5zY2FsZSgoKSUyMCUzRCUzRSUyME1hdGguc2luKHRpbWUpKjMpJTBBJTIwJTIwLnJlcGVhdCgoKSUyMCUzRCUzRSUyME1hdGguc2luKHRpbWUpKjEwKSUwQSUyMCUyMC5tb2R1bGF0ZVJvdGF0ZShvMCklMEElMjAlMjAuc2NhbGUoKCklMjAlM0QlM0UlMjBNYXRoLnNpbih0aW1lKSoyKSUwQSUyMCUyMC5tb2R1bGF0ZShub2lzZSgyJTJDMCkpJTBBJTIwJTIwLnJvdGF0ZSgwLjElMkMlMjAwLjkpJTBBLm91dChvMCklMEElMEFzcmMobzApJTBBLm1vZHVsYXRlKG9zYyg1MDAlMkMwJTJDMCkpJTBBLm91dChvMSklMEElMEFzcmMobzEpJTBBLm1vZHVsYXRlS2FsZWlkKHZvcm9ub2koKCklMjAlM0QlM0UlMjBNYXRoLnNpbih0aW1lKSozJTJDMC4xJTJDMC4wMSklMkMoKSUyMCUzRCUzRSUyME1hdGguc2luKHRpbWUpKjMpJTBBLnNjYWxlKCgpJTIwJTNEJTNFJTIwTWF0aC5zaW4odGltZSkqMyklMEEub3V0KG8yKSUwQSUwQXJlbmRlcihvMik="},{sketch_id:"mahalia_1",code:"JTJGJTJGJTIwTWFoYWxpYSUyMEgtUiUwQSUyRiUyRiUyMElHJTNBJTIwJTQwbW1faHJfJTBBJTBBc2hhcGUoKCklMjAlM0QlM0UlMjBNYXRoLnNpbih0aW1lKSUyQjEqMiklMEEucm90YXRlKCgpJTIwJTNEJTNFJTIwTWF0aC5QSSUyMColMjBtb3VzZS54JTIwJTJGMTgwKSUwQS5yZXBlYXRYKDMpJTBBLnJlcGVhdFkoKCklM0QlM0VNYXRoLnNpbih0aW1lKSo1KSUwQS5zY2FsZSgoKSUyMCUzRCUzRSUyME1hdGguUEklMkY0KSUwQS5ibGVuZChzcmMobzApLmNvbG9yKDElMkMwJTJDMCkpJTBBLm1vZHVsYXRlKG9zYygyMCUyQyUyMDAlMkMuNCkpJTBBLmthbGVpZCgyKSUwQSUyMC5vdXQobzApJTBBJTBBcmVuZGVyKG8wKQ=="},{sketch_id:"mahalia_2",code:"JTJGJTJGJTIwVmVsdmV0JTIwUG9vbCUwQSUyRiUyRiUyMGJ5JTIwTWFoYWxpYSUyMEgtUiUwQSUyRiUyRiUyMElHJTNBJTIwbW1faHJfJTBBJTBBJTBBbm9pc2UoKSUwQS5jb2xvcigoKSUyMCUzRCUzRSUyMGEuZmZ0JTVCMiU1RCoyJTJDMCUyQy42KSUwQS5tb2R1bGF0ZShub2lzZSgoKSUyMCUzRCUzRSUyMGEuZmZ0JTVCMCU1RCoxMCkpJTBBLnNjYWxlKCgpJTNEJTNFJTIwYS5mZnQlNUIyJTVEKjUpJTBBLmxheWVyKCUwQSUyMCUyMHNyYyhvMCklMEElMjAlMjAubWFzayhvc2MoMTApLm1vZHVsYXRlUm90YXRlKG9zYygpJTJDOTAlMkMwKSklMEElMjAlMjAuc2NhbGUoKCklMjAlM0QlM0UlMjBhLmZmdCU1QjAlNUQqMiklMEElMjAlMjAubHVtYSgwLjIlMkMwLjMpJTBBKSUwQS5ibGVuZChvMCklMEEub3V0KG8wKSUwQSUwQW9zYygpJTBBLm1vZHVsYXRlKG5vaXNlKCgpJTIwJTNEJTNFJTIwYS5mZnQlNUIxJTVEJTJCNSkpJTBBLmNvbG9yKDElMkMwJTJDMCklMEEub3V0KG8xKSUwQSUwQXNyYyhvMCklMEEubW9kdWxhdGUobzEpJTBBLmxheWVyKCUwQSUyMCUyMHNyYyhvMSklMEElMjAlMjAubWFzayhvMSklMEElMjAlMjAuc2F0dXJhdGUoNyklMEEpJTBBLm1vZHVsYXRlUm90YXRlKG8xKSUwQS5yb3RhdGUoKCU3QnRpbWUlN0QpJTIwJTNEJTNFJTIwdGltZSUyNTM2MCowLjA1KSUwQS5vdXQobzIpJTBBJTBBcmVuZGVyKG8yKQ=="},{sketch_id:"mahalia_3",code:"JTJGJTJGJTIwYnklMjBNYWhhbGlhJTIwSC1SJTBBJTJGJTJGJTIwSUclM0ElMjBtbV9ocl8lMEElMEFzaGFwZSgoKSUzRCUzRU1hdGguc2luKHRpbWUpJTJCMSozJTJDJTIwLjUlMkMuMDEpJTBBLnJlcGVhdCg1JTJDMyUyQyUyMCgpJTNEJTNFYS5mZnQlNUIwJTVEKjIlMkMlMjAoKSUzRCUzRWEuZmZ0JTVCMSU1RCoyKSUwQS5zY3JvbGxZKC41JTJDMC4xKSUwQS5sYXllciglMEElMjAlMjBzcmMobzEpJTBBJTIwJTIwLm1hc2sobzApJTBBJTIwJTIwLmx1bWEoLjAxJTJDJTIwLjEpJTBBJTIwJTIwLmludmVydCguMiklMEEpJTBBLm1vZHVsYXRlKG8xJTJDLjAyKSUwQS5vdXQobzApJTBBJTBBb3NjKDQwJTJDJTIwMC4wOSUyQyUyMDAuOSklMEEuY29sb3IoLjklMkMwJTJDNSklMEEubW9kdWxhdGUob3NjKDEwKS5yb3RhdGUoMSUyQyUyMDAuNSkpJTBBLnJvdGF0ZSgxJTJDJTIwMC4yKSUwQS5vdXQobzEpJTBBJTBBcmVuZGVyKG8wKSUwQSUwQQ=="},{sketch_id:"mahalia_4",code:"JTJGJTJGJTIwQ2VsbHVsYXIlMjAlMjYlMjBCbG9idWxhciUwQSUyRiUyRiUyMGJ5JTIwTWFoYWxpYSUyMEgtUiUwQSUyRiUyRiUyMElHJTNBJTIwbW1faHJfJTBBJTBBc3BlZWQlMjAlM0QlMjAwLjMlMEElMEFzaGFwZSgyMCUyQzAuMiUyQzAuMyklMEEuY29sb3IoMC41JTJDMC44JTJDNTApJTBBJTIwJTIwLnNjYWxlKCgpJTIwJTNEJTNFJTIwTWF0aC5zaW4odGltZSklMkIxKjIpJTBBJTIwJTIwLnJlcGVhdCgoKSUyMCUzRCUzRSUyME1hdGguc2luKHRpbWUpKjEwKSUwQSUyMCUyMC5tb2R1bGF0ZVJvdGF0ZShvMCklMEElMjAlMjAuc2NhbGUoKCklMjAlM0QlM0UlMjBNYXRoLnNpbih0aW1lKSUyQjElMjAqMS41KSUwQSUyMCUyMC5tb2R1bGF0ZShub2lzZSgyJTJDMikpJTBBJTIwJTIwLnJvdGF0ZSgxJTJDJTIwLjIpJTBBJTIwJTIwJTJGJTJGJTIwLmludmVydCgyLjQpJTBBLm91dChvMCklMEE="},{sketch_id:"andromeda_0",code:"JTJGJTJGJTIwMy4wJTBBJTJGJTJGJTIwYnklMjAlQ0UlOTRORFIwTTNEJUNFJTk0JTBBJTJGJTJGJTIwaHR0cHMlM0ElMkYlMkZ3d3cuaW5zdGFncmFtLmNvbSUyRmFuZHJvbTNfZGElMkYlMEElMEElMEFub2lzZSgzJTJDMC4zJTJDMykudGhyZXNoKDAuMyUyQzAuMDMpLmRpZmYobzMlMkMwLjMpLm91dChvMSklMEFncmFkaWVudCglNUIwLjMlMkMwLjMlMkMzJTVEKS5kaWZmKG8wKS5ibGVuZChvMSkub3V0KG8zKSUwQXZvcm9ub2koMzMlMkMzJTJDMzApLnJvdGF0ZSgzJTJDMC4zJTJDMCkubW9kdWxhdGVTY2FsZShvMiUyQzAuMykuY29sb3IoLTMlMkMzJTJDMCkuYnJpZ2h0bmVzcygzKS5vdXQobzApJTBBc2hhcGUoMzAlMkMwLjMlMkMxKS5pbnZlcnQoKCU3QnRpbWUlN0QpJTNEJTNFTWF0aC5zaW4odGltZSkqMykub3V0KG8yKSUwQSUwQXJlbmRlcihvMyklMEE="},{sketch_id:"andromeda_1",code:"JTJGJTJGJTIwMy4zJTBBJTJGJTJGJTIwYnklMjAlQ0UlOTRORFIwTTNEJUNFJTk0JTBBJTJGJTJGJTIwaHR0cHMlM0ElMkYlMkZ3d3cuaW5zdGFncmFtLmNvbSUyRmFuZHJvbTNfZGElMkYlMEElMEFvc2MoKS5tb2R1bGF0ZVJvdGF0ZShvMCUyQzAuMykub3V0KCklMEFvc2MoMzMlMkMwLjMlMkMwLjMpLmRpZmYobzMlMkMzKS5vdXQobzEpJTBBb3NjKDMlMkMwLjMlMkMzMykubW9kdWxhdGVLYWxlaWQobzMlMkMzKS5kaWZmKG8wKS5vdXQobzIpJTBBc3JjKG8wJTJDMykubXVsdChvMSUyQzMpLmthbGVpZCgzKS5vdXQobzMpJTBBcmVuZGVyKG8yKQ=="},{sketch_id:"asdrubal_0",code:"JTJGJTJGQXNkciVDMyVCQWJhbCUyMEdvbWV6JTBBJTBBbm9pc2UoMyUyQzAuMSUyQzcpJTBBLnJvdGF0ZSgxJTJDLTElMkMtMikubWFzayhzaGFwZSgyMCkpJTBBLmNvbG9yYW1hKDAuNSklMEEubW9kdWxhdGVTY2FsZShvMCklMEEubW9kdWxhdGVTY2FsZShvMCUyQzElMkMpJTBBLmJsZW5kKG8wKSUwQS5ibGVuZChvMCklMEEuYmxlbmQobzApJTBBLmJsZW5kKG8wKSUwQS5vdXQobzApJTBB"},{sketch_id:"flor_1",code:"JTJGJTJGSHlkcmElMjBHbGl0Y2h5JTIwU2xpdCUyMFNjYW4lMEElMkYlMkZGbG9yJTIwZGUlMjBGdWVnbyUwQSUyRiUyRmh0dHBzJTNBJTJGJTJGZmxvcmRlZnVlZ28uZ2l0aHViLmlvJTJGJTIwJTBBczAuaW5pdENhbSgpJTBBc3JjKHMwKS5zYXR1cmF0ZSgyKS5jb250cmFzdCgxLjMpLmxheWVyKHNyYyhvMCkubWFzayhzaGFwZSg0JTJDMikuc2NhbGUoMC41JTJDMC43KS5zY3JvbGxYKDAuMjUpKS5zY3JvbGxYKDAuMDAxKSkubW9kdWxhdGUobzAlMkMwLjAwMSkub3V0KG8wKSUwQSUwQQ=="},{sketch_id:"flor_2",code:"JTJGJTJGR2xpdGNoJTIwUml2ZXIlMEElMkYlMkZGbG9yJTIwZGUlMjBGdWVnbyUwQSUyRiUyRmh0dHBzJTNBJTJGJTJGZmxvcmRlZnVlZ28uZ2l0aHViLmlvJTJGJTBBdm9yb25vaSg4JTJDMSklMEEubXVsdChvc2MoMTAlMkMwLjElMkMoKSUzRCUzRU1hdGguc2luKHRpbWUpKjMpLnNhdHVyYXRlKDMpLmthbGVpZCgyMDApKSUwQS5tb2R1bGF0ZShvMCUyQzAuNSklMEEuYWRkKG8wJTJDMC44KSUwQS5zY3JvbGxZKC0wLjAxKSUwQS5zY2FsZSgwLjk5KSUwQS5tb2R1bGF0ZSh2b3Jvbm9pKDglMkMxKSUyQzAuMDA4KSUwQS5sdW1hKDAuMyklMEEub3V0KCklMEElMEElMEFzcGVlZCUyMCUzRCUyMDAuMSUwQSUwQSUwQSUwQQ=="},{sketch_id:"nesso_0",code:"JTBBJTJGJTJGY2xvdWRzJTIwb2YlMjBwYXNzYWdlJTBBJTJGJTJGYnklMjBOZXNzbyUwQSUyRiUyRnd3dy5uZXNzby54eXolMEElMEFzaGFwZSglNUI0JTJDNSUyQzYlNUQuZmFzdCgwLjEpLnNtb290aCgxKSUyQzAuMDAwMDAxJTJDJTVCMC4yJTJDMC43JTVELnNtb290aCgxKSklMEEuY29sb3IoMC4yJTJDMC40JTJDMC4zKSUwQS5zY3JvbGxYKCgpJTNEJTNFTWF0aC5zaW4odGltZSowLjI3KSklMEEuYWRkKCUwQSUyMCUyMHNoYXBlKCU1QjQlMkM1JTJDNiU1RC5mYXN0KDAuMSkuc21vb3RoKDEpJTJDMC4wMDAwMDElMkMlNUIwLjIlMkMwLjclMkMwLjUlMkMwLjMlNUQuc21vb3RoKDEpKSUwQSUyMCUyMC5jb2xvcigwLjYlMkMwLjIlMkMwLjUpJTBBJTIwJTIwLnNjcm9sbFkoMC4zNSklMEElMjAlMjAuc2Nyb2xsWCgoKSUzRCUzRU1hdGguc2luKHRpbWUqMC4zMykpKSUwQS5hZGQoJTBBJTIwJTIwc2hhcGUoJTVCNCUyQzUlMkM2JTVELmZhc3QoMC4xKS5zbW9vdGgoMSklMkMwLjAwMDAwMSUyQyU1QjAuMiUyQzAuNyUyQzAuMyU1RC5zbW9vdGgoMSkpJTBBJTIwJTIwLmNvbG9yKDAuMiUyQzAuNCUyQzAuNiklMEElMjAlMjAuc2Nyb2xsWSgtMC4zNSklMEElMjAlMjAuc2Nyb2xsWCgoKSUzRCUzRU1hdGguc2luKHRpbWUqMC40MSkqLTEpKSUwQS5hZGQoJTBBJTIwJTIwJTIwJTIwJTIwJTIwc3JjKG8wKS5zaGlmdCgwLjAwMSUyQzAuMDElMkMwLjAwMSklMEElMjAlMjAlMjAlMjAlMjAlMjAuc2Nyb2xsWCglNUIwLjA1JTJDLTAuMDUlNUQuZmFzdCgwLjEpLnNtb290aCgxKSklMEElMjAlMjAlMjAlMjAlMjAlMjAuc2NhbGUoJTVCMS4wNSUyQzAuOSU1RC5mYXN0KDAuMykuc21vb3RoKDEpJTJDJTVCMS4wNSUyQzAuOSUyQzElNUQuZmFzdCgwLjI5KS5zbW9vdGgoMSkpJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTJDMC44NSklMEEubW9kdWxhdGUodm9yb25vaSgxMCUyQzIlMkMyKSklMEEub3V0KCk="},{sketch_id:"malitzin_0",code:"JTJGJTJGQ05EU0QlMEElMkYlMkZodHRwJTNBJTJGJTJGbWFsaXR6aW5jb3J0ZXMubmV0JTJGJTBBJTJGJTJGJTIwc2FuZCUyMHNwaXJhbHMlMEElMEFvc2MoMyUyQyUyMDAuMDElMkMlMjAwLjQpJTBBLmNvbG9yKDEuMiUyQzEuMiUyQzEuMyklMEEuc2F0dXJhdGUoMC40KSUwQS5tb2R1bGF0ZVJlcGVhdChvc2MoMiklMkMxJTJDJTIwMiUyQyUyMDQlMkMlMjAzKSUwQS5tb2R1bGF0ZUthbGVpZChvc2MoMTIlMkMwLjA1JTJDMCklMkMxKSUwQS5sdW1hJTIwKDAuNCklMEEucm90YXRlKDQlMkMlMjAwLjElMkMwKSUwQS5tb2R1bGF0ZShvMCUyQyUyMCgpJTIwJTNEJTNFJTIwbW91c2UueSUyMCowLjAwMDIlMjApJTBBLnNjYWxlKDEpLmRpZmYobzEpJTBBLm91dChvMCk="},{sketch_id:"malitzin_1",code:"JTJGJTJGQ05EU0QlMEElMkYlMkZodHRwJTNBJTJGJTJGbWFsaXR6aW5jb3J0ZXMubmV0JTJGJTBBJTJGJTJGYW1lYmElMEElMEFvc2MoMTUlMkMlMjAwLjAxJTJDJTIwMC4xKS5tdWx0KG9zYygxJTJDJTIwLTAuMSkubW9kdWxhdGUob3NjKDIpLnJvdGF0ZSg0JTJDMSklMkMlMjAyMCkpJTBBLmNvbG9yKDAlMkMyLjQlMkM1KSUwQS5zYXR1cmF0ZSgwLjQpJTBBLmx1bWEoMSUyQzAuMSUyQyUyMCg2JTJDJTIwKCklM0QlM0UlMjAxJTIwJTJCJTIwYS5mZnQlNUIzJTVEKSklMEEuc2NhbGUoMC43JTJDJTIwKCklM0QlM0UlMjAwLjclMjAlMkIlMjBhLmZmdCU1QjMlNUQpJTBBLmRpZmYobzApJTJGJTJGJTIwbzAlMEEub3V0KG8wKSUyRiUyRiUyMG8x"},{sketch_id:"malitzin_2",code:"JTJGJTJGQ05EU0QlMEElMkYlMkZodHRwJTNBJTJGJTJGbWFsaXR6aW5jb3J0ZXMubmV0JTJGJTBBJTJGJTJGY3JhenklMjBzcXVhcmVzJTBBJTBBc2hhcGUoNCUyQyUyMCgwLjAxJTJDJTIwKCklM0QlM0UlMjAwLjIlMjAlMkIlMjBhLmZmdCU1QjIlNUQpJTJDMSklMEEubXVsdChvc2MoMSUyQyUyMDEpLm1vZHVsYXRlKG9zYyg1KS5yb3RhdGUoMS40JTJDMSklMkMzKSklMEEuY29sb3IoMSUyQzIlMkM0KSUwQS5zYXR1cmF0ZSgwLjIpJTBBLmx1bWEoMS4yJTJDMC4wNSUyQyUyMCg1JTJDJTIwKCklM0QlM0UlMjAyJTIwJTJCJTIwYS5mZnQlNUIzJTVEKSklMEEuc2NhbGUoMC42JTJDJTIwKCklM0QlM0UlMjAwLjklMjAlMkIlMjBhLmZmdCU1QjMlNUQpJTBBLmRpZmYobzApJTJGJTJGJTIwbzAlMEEub3V0KG8wKSUyRiUyRiUyMG8x"},{sketch_id:"khoparzi_0",code:"JTJGJTJGJTIwSGFwcHklMjBNYW5kYWxhJTBBJTJGJTJGJTIwQnklMjBBYmhpbmF5JTIwS2hvcGFyemklMEElMkYlMkYlMjB0d2l0dGVyJTJGZ2l0aHViJTJGaW5zdGFncmFtJTNBJTIwJTQwa2hvcGFyemklMEF2b3Jvbm9pKDUlMkMtMC4xJTJDNSklMEEuYWRkKG9zYygxJTJDMCUyQzEpKS5rYWxlaWQoMjEpJTBBLnNjYWxlKDElMkMxJTJDMikuY29sb3JhbWEoKS5vdXQobzEpJTBBc3JjKG8xKS5tdWx0KHNyYyhzMCkubW9kdWxhdGVSb3RhdGUobzElMkMxMDApJTJDJTIwLTAuNSklMEElMjAlMjAub3V0KG8wKSUwQSUwQQ=="},{sketch_id:"khoparzi_1",code:"JTJGJTJGJTIwUGVycGV0dWFsJTIwZWxldmF0b3IlMjBidXR0b25zJTBBJTJGJTJGJTIwQnklMjBLaG9wYXJ6aSUwQSUyRiUyRiUyMGh0dHAlM0ElMkYlMkZraG9wYXJ6aS5jb20lMEElMEFzaGFwZSgzKS5hZGQob3NjKDElMkMwLjUlMkMxKSUyQyUyMDEpJTBBJTA5LmFkZChvMSUyQyUyMCgpJTIwJTNEJTNFJTIwKE1hdGguc2luKHRpbWUlMkY0KSUyMColMjAwLjclMjAlMkIlMjAwLjEpKSUwQSUwOSUyRiUyRi5yZXBlYXQoNSklMEElMjAlMjAlMDkuc2NhbGUoKCklM0QlM0VNYXRoLnNpbih0aW1lJTIwJTJGJTIwMTYpKS5yb3RhdGUoMCUyQyUyMC0wLjEpJTBBJTA5Lm91dChvMSklMEElMEFzcmMobzEpJTBBJTIwJTIwLnJvdGF0ZSgwJTJDMC4xKSUwQSUyMCUyMC5vdXQoKQ=="},{sketch_id:"khoparzi_2",code:"JTJGJTJGJTIwUmVhbGx5JTIwTG92ZSUwQSUyRiUyRiUyMGJ5JTIwQWJoaW5heSUyMEtob3BhcnppJTBBJTJGJTJGJTIwaHR0cCUzQSUyRiUyRmtob3BhcnppLmNvbSUwQW9zYygxMDAlMkMtMC4wMTI0NSUyQzEpLnBpeGVsYXRlKDUwKS5rYWxlaWQoKCklM0QlM0UoTWF0aC5zaW4odGltZSUyRjgpKjklMkIzKSkucm90YXRlKDAlMkMwLjEyNSklMEEubW9kdWxhdGVSb3RhdGUoc2hhcGUoMykuc2NhbGUoKCklM0QlM0UoTWF0aC5jb3ModGltZSkqMikpLnJvdGF0ZSgwJTJDLTAuMjUpKS5kaWZmKHNyYyhvMCkuYnJpZ2h0bmVzcygwLjMpKSUwQSUyMCUyMC5vdXQoKQ=="},{sketch_id:"khoparzi_3",code:"JTJGJTJGJTIwQXFhdXRpYyUyMGJsdWJzJTBBJTJGJTJGJTIwQnklMjBLaG9wYXJ6aSUwQSUyRiUyRiUyMGh0dHBzJTNBJTJGJTJGa2hvcGFyemkuY29tJTBBJTBBZ3JhZGllbnQoMC4yNSklMEEuYWRkKG5vaXNlKCklMkMlMjAoKSUzRCUzRU1hdGguY29zKHRpbWUpKSUwQS5tb2R1bGF0ZVJvdGF0ZShzcmMobzApLnJvdGF0ZSgwJTJDJTIwLTAuNTIpJTJDJTIwMC4yKS5tdWx0KHNoYXBlKDM2MCklMkMlMjAwLjgpJTBBLnJlcGVhdCgxMCUyQzUpLm11bHQoc2hhcGUoMzYwKS5zY2FsZSgoKSUzRCUzRU1hdGguc2luKHRpbWUpKSUyQyUyMDAuOCkucm90YXRlKDAlMkMlMjAwLjIpJTBBLmRpZmYoc3JjKG8wKS5yb3RhdGUoMCUyQyUyMC0wLjIpJTJDJTIwMC4yKSUwQS5vdXQoKQ=="},{sketch_id:"celeste_0",code:"JTBBJTIwJTJGJTJGJTIwUHVlcnRhcyUyMElJJTBBJTJGJTJGJTIwcG9yJTIwQ2VsZXN0ZSUyMEJldGFuY3VyJTBBJTJGJTJGJTIwaHR0cHMlM0ElMkYlMkZnaXRodWIuY29tJTJGZXNzdGViYW4lMEElMEFvc2MoMTMlMkMwJTJDMSklMEElMjAlMjAua2FsZWlkKCklMEElMjAlMjAubWFzayhzaGFwZSg0JTJDMC4zJTJDMSkpJTBBJTIwJTIwLm1vZHVsYXRlUm90YXRlKHNoYXBlKDQlMkMwLjElMkMxKSklMEElMjAlMjAubW9kdWxhdGVSb3RhdGUoc2hhcGUoNCUyQzAuMSUyQzAuOSkpJTBBJTIwJTIwLm1vZHVsYXRlUm90YXRlKHNoYXBlKDQlMkMwLjElMkMwLjgpKSUwQSUyMCUyMC5zY2FsZSgwLjMpJTBBJTIwJTIwLmFkZChzaGFwZSg0JTJDMC4yJTJDMSkuY29sb3IoMC4zJTJDMSUyQzElMkMwLjUpKSUwQSUyMCUyMC5yb3RhdGUoKCklM0QlM0V0aW1lKSUwQSUyMCUyMC5vdXQoKQ=="},{sketch_id:"celeste_1",code:"JTJGJTJGJTIwUHVlcnRhcyUyMElJSSUwQSUyRiUyRiUyMHBvciUyMENlbGVzdGUlMjBCZXRhbmN1ciUwQSUyRiUyRiUyMGh0dHBzJTNBJTJGJTJGZ2l0aHViLmNvbSUyRmVzc3RlYmFuJTBBJTIwJTBBb3NjKDQwJTJDMC4yJTJDMSklMEElMjAlMjAubW9kdWxhdGVTY2FsZShvc2MoNDAlMkMwJTJDMSkua2FsZWlkKDgpKSUwQSUyMCUyMC5yZXBlYXQoMiUyQzQpJTBBJTIwJTIwLm1vZHVsYXRlKG8wJTJDMC4wNSklMEElMjAlMjAubW9kdWxhdGVLYWxlaWQoc2hhcGUoNCUyQzAuMSUyQzEpKSUwQSUyMCUyMC5vdXQobzAp"},{sketch_id:"celeste_2",code:"JTBBJTIwJTJGJTJGJTIwUHVlcnRhcyUwQSUyRiUyRiUyMHBvciUyMENlbGVzdGUlMjBCZXRhbmN1ciUwQSUyRiUyRiUyMGh0dHBzJTNBJTJGJTJGZ2l0aHViLmNvbSUyRmVzc3RlYmFuJTBBJTBBb3NjKDEzJTJDMCUyQzEpJTBBJTIwJTIwLm1vZHVsYXRlKG9zYygyMSUyQzAuMjUlMkMwKSklMEElMjAlMjAubW9kdWxhdGVTY2FsZShvc2MoMzQpKSUwQSUyMCUyMC5tb2R1bGF0ZUthbGVpZChvc2MoNTUpJTJDMC4xJTJDMSklMEElMjAlMjAub3V0KCk="},{sketch_id:"alexandre_0",code:"JTJGJTJGJTIwJTIydGhlLXdhbGwlMjIlMEElMkYlMkYlMjBBbGV4YW5kcmUlMjBSYW5nZWwlMEElMkYlMkYlMjB3d3cuYWxleGFuZHJlcmFuZ2VsLmFydC5iciUyRmh5ZHJhLmh0bWwlMEElMEFzcGVlZCUzRC4wMjIyJTBBb3NjKDQ4JTJDLS4xJTJDMCkudGhyZXNoKCU1Qi4zJTJDLjclNUQuZmFzdCguNzUpJTJDMCkuY29sb3IoMCUyQzAlMkMxKSUwQSUwQS5hZGQoJTBBJTIwJTIwJTIwJTIwb3NjKDI4JTJDLjElMkMwKS50aHJlc2goJTVCLjMlMkMuNyU1RC5mYXN0KC43NSklMkMwKS5yb3RhdGUoMy4xNCUyRjQpJTBBJTIwJTIwJTIwJTIwLmNvbG9yKDElMkMwJTJDMCklMEElMjAlMjAlMjAlMjAubW9kdWxhdGVTY2FsZSglMjBvc2MoNjQlMkMtLjAxJTJDMCkudGhyZXNoKCU1Qi4zJTJDLjclNUQuZmFzdCguNzUpJTJDMCklMjApJTBBKSUwQS5kaWZmKCUwQSUyMCUyMCUyMCUyMG9zYygyOCUyQy4xJTJDMCkudGhyZXNoKCU1Qi4zJTJDLjclNUQuZmFzdCguNSklMkMwKS5yb3RhdGUoMy4xNCUyRjIpJTBBJTIwJTIwJTIwJTIwLmNvbG9yKDElMkMwJTJDMSklMEElMjAlMjAlMjAlMjAubW9kdWxhdGVTY2FsZSglMjBvc2MoNjQlMkMtLjAxNSUyQzApLnRocmVzaCglNUIuMyUyQy43JTVELmZhc3QoLjUpJTJDMCklMjApJTBBKSUwQS5tb2R1bGF0ZVJvdGF0ZSglMjBvc2MoNTQlMkMtLjAwNSUyQzApLnRocmVzaCglNUIuMyUyQy43JTVELmZhc3QoLjI1KSUyQzApJTIwKSUwQS5tb2R1bGF0ZVNjYWxlKCUyMG9zYyg0NCUyQy0uMDIwJTJDMCkudGhyZXNoKCU1Qi4zJTJDLjclNUQuZmFzdCguMjUpJTJDMCklMjApJTBBLmNvbG9yYW1hKCUyMCgpJTNEJTNFTWF0aC5zaW4odGltZSUyRjI3KSouMDEyMjIlMkI5Ljg5KSUwQS5zY2FsZSgyLjEyMiklMEElMEEub3V0KCk="},{sketch_id:"alexandre_1",code:"JTBBJTIwJTJGJTJGJTIwJTIyZXllJTIwb2YlMjB0aGUlMjBiZWhvbGRlciUyMiUwQSUyRiUyRiUyMEFsZXhhbmRyZSUyMFJhbmdlbCUwQSUyRiUyRiUyMHd3dy5hbGV4YW5kcmVyYW5nZWwuYXJ0LmJyJTJGaHlkcmEuaHRtbCUwQSUwQW5vaXNlKDYlMkMuMDUpJTBBLm11bHQoJTIwb3NjKDklMkMwJTJDJTIwKCklM0QlM0VNYXRoLnNpbih0aW1lJTJGMS41KSUyQjIlMjApJTIwKSUwQS5tdWx0KCUwQSUyMCUyMCUyMCUyMG5vaXNlKDklMkMuMDMpLmJyaWdodG5lc3MoMS4yKS5jb250cmFzdCgyKSUwQSUyMCUyMCUyMCUyMC5tdWx0KCUyMG9zYyg5JTJDMCUyQyUyMCgpJTNEJTNFTWF0aC5zaW4odGltZSUyRjMpJTJCMTMlMjApJTIwKSUwQSklMEEuZGlmZiglMEElMjAlMjAlMjAlMjBub2lzZSgxNSUyQy4wNCkuYnJpZ2h0bmVzcyguMikuY29udHJhc3QoMS4zKSUwQSUyMCUyMCUyMCUyMC5tdWx0KCUyMG9zYyg5JTJDMCUyQyUyMCgpJTNEJTNFTWF0aC5zaW4odGltZSUyRjUpJTJCMTMlMjApJTIwKSUwQSUyMCUyMCUyMCUyMC5yb3RhdGUoJTIwKCklM0QlM0V0aW1lJTJGMzMlMjApJTBBKSUwQS5zY2FsZSglMjAoKSUzRCUzRU1hdGguc2luKHRpbWUlMkY2LjIpKi4xMiUyQi4xNSUyMCklMEEubW9kdWxhdGVTY2FsZSglMEElMjAlMjAlMjAlMjBvc2MoMyUyQzAlMkMwKS5tdWx0KCUyMG9zYygzJTJDMCUyQzApLnJvdGF0ZSgzLjE0JTJGMiklMjApJTBBJTIwJTIwJTIwJTIwLnJvdGF0ZSglMjAoKSUzRCUzRXRpbWUlMkYyNSUyMCkuc2NhbGUoLjM5KS5zY2FsZSgxJTJDLjYlMkMxKS5pbnZlcnQoKSUwQSUyMCUyMCUyMCUyMCUyQyUyMCgpJTNEJTNFTWF0aC5zaW4odGltZSUyRjUuMykqMS41JTJCMyUyMCUyMCklMEEucm90YXRlKCUyMCgpJTNEJTNFdGltZSUyRjIyJTIwKSUwQS5tdWx0KCUyMHNoYXBlKDEwMCUyQy45JTJDLjAxKS5zY2FsZSgxJTJDLjYlMkMxKSUyMCklMEEub3V0KCk="},{sketch_id:"alexandre_2",code:"JTJGJTJGJTIwJTIyZWdnJTIwb2YlMjB0aGUlMjBwaG9lbml4JTIyJTBBJTJGJTJGJTIwQWxleGFuZHJlJTIwUmFuZ2VsJTBBJTJGJTJGJTIwd3d3LmFsZXhhbmRyZXJhbmdlbC5hcnQuYnIlMkZoeWRyYS5odG1sJTBBJTBBc3BlZWQlM0QxLjIlMEFzaGFwZSg5OSUyQy4xNSUyQy41KS5jb2xvcigwJTJDMSUyQzIpJTBBJTBBLmRpZmYoJTIwc2hhcGUoMjQwJTJDLjUlMkMwKS5zY3JvbGxYKC4wNSkucm90YXRlKCUyMCgpJTNEJTNFdGltZSUyRjEwJTIwKS5jb2xvcigxJTJDMCUyQy43NSklMjApJTBBLmRpZmYoJTIwc2hhcGUoOTklMkMuNCUyQy4wMDIpLnNjcm9sbFgoLjEwKS5yb3RhdGUoJTIwKCklM0QlM0V0aW1lJTJGMjAlMjApLmNvbG9yKDElMkMwJTJDLjc1KSUyMCklMEEuZGlmZiglMjBzaGFwZSg5OSUyQy4zJTJDLjAwMikuc2Nyb2xsWCguMTUpLnJvdGF0ZSglMjAoKSUzRCUzRXRpbWUlMkYzMCUyMCkuY29sb3IoMSUyQzAlMkMuNzUpJTIwKSUwQS5kaWZmKCUyMHNoYXBlKDk5JTJDLjIlMkMuMDAyKS5zY3JvbGxYKC4yMCkucm90YXRlKCUyMCgpJTNEJTNFdGltZSUyRjQwJTIwKS5jb2xvcigxJTJDMCUyQy43NSklMjApJTBBLmRpZmYoJTIwc2hhcGUoOTklMkMuMSUyQy4wMDIpLnNjcm9sbFgoLjI1KS5yb3RhdGUoJTIwKCklM0QlM0V0aW1lJTJGNTAlMjApLmNvbG9yKDElMkMwJTJDLjc1KSUyMCklMEElMEEubW9kdWxhdGVTY2FsZSglMEElMjAlMjBzaGFwZSgyNDAlMkMuNSUyQzApLnNjcm9sbFgoLjA1KS5yb3RhdGUoJTIwKCklM0QlM0V0aW1lJTJGMTAlMjApJTBBJTIwJTIwJTJDJTIwKCklM0QlM0UoTWF0aC5zaW4odGltZSUyRjMpKi4yKSUyQi4yJTIwKSUwQSUwQS5zY2FsZSgxLjYlMkMuNiUyQzEpJTBBLm91dCgp"},{sketch_id:"afalfl_0",code:"JTJGJTJGZmlsZXQlMjBtaWdub24lMEElMkYlMkYlMjBBRkFMRkwlMEElMkYlMkYlMjBpbnN0YWdyYW0lMkZhX2ZfYWxmbCUyMCUwQSUwQW9zYygxMDAlMkMtMC4wMDE4JTJDMC4xNykuZGlmZihvc2MoMjAlMkMwLjAwMDA4KS5yb3RhdGUoTWF0aC5QSSUyRjAuMDAwMDMpKSUwQS5tb2R1bGF0ZVNjYWxlKG5vaXNlKDEuNSUyQzAuMTgpLm1vZHVsYXRlU2NhbGUob3NjKDEzKS5yb3RhdGUoKCklM0QlM0VNYXRoLnNpbih0aW1lJTJGMjIpKSklMkMzKSUwQS5jb2xvcigxMSUyQzAuNSUyQzAuNCUyQyUyMDAuOSUyQyUyMDAuMiUyQyUyMDAuMDExJTJDJTIwNSUyQyUyMDIyJTJDJTIwJTIwMC41JTJDJTIwLTEpLmNvbnRyYXN0KDEuNCklMEEuYWRkKHNyYyhvMCkubW9kdWxhdGUobzAlMkMuMDQpJTJDLjYlMkMlMjAuOSklMEElMjAlMjAlMkYlMkYucGl4ZWxhdGUoMC40JTJDJTIwMC4yJTJDJTIwMC4xKSUwQS5pbnZlcnQoKS5icmlnaHRuZXNzKDAuMDAwMyUyQyUyMDIpLmNvbnRyYXN0KCUyMDAuNSUyQyUyMDIlMkMlMjAwLjElMkMlMjAyKS5jb2xvcig0JTJDJTIwLTIlMkMlMjAwLjEpJTBBLm1vZHVsYXRlU2NhbGUob3NjKDIpJTJDLTAuMiUyQyUyMDIlMkMlMjAxJTJDJTIwMC4zKSUwQSUyMC5wb3N0ZXJpemUoMjAwKSUyMC5yb3RhdGUoMSUyQyUyMDAuMiUyQyUyMDAuMDElMkMlMjAwLjAwMSklMEElMjAuY29sb3IoMjIlMkMlMjAtMiUyQyUyMDAuNSUyQyUyMDAuNSUyQyUyMDAuMDAwMSUyQyUyMCUyMDAuMSUyQyUyMDAuMiUyQyUyMDgpLmNvbnRyYXN0KDAuMTglMkMlMjAwLjMlMkMlMjAwLjElMkMlMjAwLjIlMkMlMjAwLjAzJTJDJTIwMSklMjAuJTIwYnJpZ2h0bmVzcygwLjAwMDElMkMlMjAtMSUyQyUyMDEwKSUwQSUwOS5vdXQoKQ=="},{sketch_id:"eerie_ear_0",code:"JTJGJTJGJTIwZWVfMiUyMC4lMjBNVUxUSVZFUlNFJTIwLiUyMHRpbWUlMjBhbmQlMjBmZWVkYmFjayUwQSUyRiUyRiUyMGVfZSUyMCUyRiUyRiUyMCU0MGVlcmllX2VhciUwQXBhdCUyMCUzRCUyMCgpJTNEJTNFJTBBc29saWQoKSUwQS5sYXllcihzb2xpZCgpLmRpZmYoJTBBJTIwJTIwb3NjKCh0aW1lJTJGMTYpJTIwKiUyMDElMkMlMjAodGltZSUyRjEwMDApJTIwKiUyMDAuMiUyMCUyMCklMEElMjAlMjAlMjAlMjAubXVsdChvc2MoKHRpbWUlMkY4KSUyMColMjAxJTJDJTIwKHRpbWUlMkYxMDA2KSUyMColMjAwLjIlMjAlMjApLnJvdGF0ZSgxLjU3KSklMEElMjAlMjAlMjAlMjAubW9kdWxhdGUoKHNoYXBlKDEwNiUyQzElMkMwLjA1KSkpJTBBJTIwJTIwJTIwJTIwLm11bHQoc2hhcGUoMTA2JTJDMSUyQzAuMDUpKSUwQSUyMCUyMCkpJTBBJTIwJTIwLm1vZHVsYXRlU2NhbGUob3NjKDIlMkMwLjEyNSklMkMwLjEyNSklMEElMkYlMkYlMEFzb2xpZCgpJTBBLmxheWVyKHNvbGlkKDElMkMxJTJDMSklMEElMjAlMjAubXVsdChwYXQoKSUwQSUyMCUyMC5kaWZmKHNyYyhvMCkuc2NhbGUoMC4yKS5tdWx0KHNvbGlkKCklMkMlNUIwLjclMkMwLjYlMkMwLjQlMkMwLjYlNUQpLmthbGVpZCgxLjAxKS5zYXR1cmF0ZSgwLjMpKSUwQSklMEEubGF5ZXIoc29saWQoMSUyQzElMkMxKSUwQSUyMCUyMCUyMCUyMC5tYXNrKCUwQSUyMCUyMCUyMCUyMCUyMCUyMG5vaXNlKDIlMkMwLjA1KSUwQSUyMCUyMCUyMCUyMCUyMCUyMC5pbnZlcnQoKS5jb2xvcmFtYSgyKS5wb3N0ZXJpemUoOCUyQzQpLmx1bWEoMC4yNSkudGhyZXNoKDAuNSklMEElMjAlMjAlMjAlMjAlMjAlMjAubW9kdWxhdGVSb3RhdGUob3NjKDElMkMwLjUpKSUwQSUyMCUyMCUyMCUyMCklMEElMjAlMjAlMjAlMjAubXVsdChncmFkaWVudCgwLjUpLmthbGVpZCgxKS5jb2xvcmFtYSgyKS5zYXR1cmF0ZSgxLjEpLmNvbnRyYXN0KDEuNikubXVsdChzb2xpZCgpJTJDMC40NSkpJTBBJTIwJTIwKSklMEElMjAlMjAub3V0KCklMEElMkYlMkYlMEFzcGVlZCUzRCUyMDAuNSUwQQ=="},{sketch_id:"eerie_ear_1",code:"JTJGJTJGJTIwZWVfMyUyMCUyRiUyRkxJTkVTJTBBJTJGJTJGJTIwZV9lJTIwJTJGJTJGJTIwJTQwZWVyaWVfZWFyJTBBJTJGJTJGJTBBJTJGJTJGYmFzZWQlMjBvbiUwQSUyRiUyRiU0MG5hb3RvX2hpZWRhJTBBJTJGJTJGaHR0cHMlM0ElMkYlMkZuYW90b2hpZWRhLmNvbSUyRmJsb2clMkZoeWRyYS1ib29rJTJGJTBBJTJGJTJGJTBBbiUyMCUzRCUyMDglMEFhJTIwJTNEJTIwKCklMjAlM0QlM0UlMjBzaGFwZSg0JTJDMC4yNSUyQzAuMDA5KS5yb3RhdGUoKCklM0QlM0V0aW1lJTJGLTQwKS5yZXBlYXQobiUyQ24pJTBBYSgpLmFkZChhKCkuc2Nyb2xsWCgwLjUlMkZuKS5zY3JvbGxZKDAuNSUyRm4pJTJDMSkubW9kdWxhdGUobzElMkMwLjEpLm1vZHVsYXRlKHNyYyhvMSkuY29sb3IoMTAlMkMxMCkuYWRkKHNvbGlkKC0xNCUyQy0xNCkpLnJvdGF0ZSgoKSUzRCUzRXRpbWUlMkY0MCklMkMwLjAwNSkuYWRkKHNyYyhvMSkuc2Nyb2xsWSgwLjAxMiUyQzAuMDIpJTJDMC41KS5vdXQobzEpJTBBc3JjKG8xKS5jb2xvcmFtYSgxLjIpLnBvc3Rlcml6ZSg0KS5zYXR1cmF0ZSgwLjcpLmNvbnRyYXN0KDYpLm11bHQoc29saWQoKSUyQzAuMTUpLm91dChvMCklMEElMEElMEE="},{sketch_id:"eerie_ear_2",code:"JTJGJTJGZWVfNSUyMC4lMjBGVUdJVElWRSUyMEdFT01FVFJZJTIwVkhTJTIwLiUyMGF1ZGlvcmVhY3RpdmUlMjBzaGFwZXMlMjBhbmQlMjBncmFkaWVudHMlMEElMkYlMkYlMjBlX2UlMjAlMkYlMkYlMjAlNDBlZXJpZV9lYXIlMEElMkYlMkYlMEFzJTNEJTIwKCklM0QlM0UlMEElMjAlMjBzaGFwZSg0KSUwQS5zY3JvbGxYKCU1Qi0wLjUlMkMtMC4yJTJDMC4zJTJDLTAuMSUyQy0wLjElNUQuc21vb3RoKDAuMSkuZmFzdCgwLjMpKSUwQS5zY3JvbGxZKCU1QjAuMjUlMkMtMC4yJTJDMC4zJTJDLTAuMSUyQzAuMiU1RC5zbW9vdGgoMC45KS5mYXN0KDAuMTUpKSUwQSUyRiUyRiUwQXNvbGlkKCklMEEuYWRkKGdyYWRpZW50KDMlMkMwLjA1KS5yb3RhdGUoMC4wNSUyQy0wLjIpLnBvc3Rlcml6ZSgyKS5jb250cmFzdCgwLjYpJTJDJTVCMSUyQzAlMkMxJTJDMC41JTJDMCUyQzAuNiU1RC5zbW9vdGgoMC45KSklMEEuYWRkKHMoKSklMEEubXVsdChzKCkuc2NhbGUoMC44KS5zY3JvbGxYKDAuMDEpLnNjcm9sbFkoLTAuMDEpLnJvdGF0ZSgwLjIlMkMwLjA2KS5hZGQoZ3JhZGllbnQoMykuY29udHJhc3QoMC42KSUyQyU1QjElMkMwJTJDMSUyQzAuNSU1RC5zbW9vdGgoMC45KSUyQzAuNSkubXVsdChzcmMobzApLnNjYWxlKDAuOTgpJTJDKCklM0QlM0VhLmZmdCU1QjAlNUQqOSklMEElMjAlMjAlMjAlMjAlMjApJTBBLmRpZmYocygpLm1vZHVsYXRlKHNoYXBlKDUwMCkpLnNjYWxlKCU1QjEuNyUyQzEuMiU1RC5zbW9vdGgoMC45KS5mYXN0KDAuMDUpKSklMEEuYWRkKGdyYWRpZW50KDIpLmludmVydCgpJTJDKCklM0QlM0VhLmZmdCU1QjIlNUQpJTBBLm11bHQoZ3JhZGllbnQoKCklM0QlM0VhLmZmdCU1QjMlNUQqOCkpJTBBLmJsZW5kKHNyYygobzApJTJDKCklM0QlM0VhLmZmdCU1QjElNUQqNDApKSUwQS5hZGQodm9yb25vaSgoKSUzRCUzRWEuZmZ0JTVCMSU1RCUyQygpJTNEJTNFYS5mZnQlNUIzJTVEJTJDKCklM0QlM0VhLmZmdCU1QjAlNUQpLnRocmVzaCgwLjcpLnBvc3Rlcml6ZSgyJTJDNCkubHVtYSgwLjkpLnNjcm9sbFkoMSUyQygpJTNEJTNFYS5mZnQlNUIwJTVEJTJGMzApLmNvbG9yYW1hKDMpLnRocmVzaCgoKSUzRCUzRWEuZmZ0JTVCMSU1RCkuc2NhbGUoKCklM0QlM0VhLmZmdCU1QjMlNUQqMiklMkMoKSUzRCUzRWEuZmZ0JTVCMCU1RCUyRjIpJTBBJTIwJTIwLm91dCgpJTBBJTJGJTJGJTBBc3BlZWQlM0QlMjAxJTBBJTBBYS5zZXRTbW9vdGgoMC45Nik="},{sketch_id:"eerie_ear_3",code:"JTJGJTJGJTIwZWVfMSUyMC4lMjBFWUUlMjBJTiUyMFRIRSUyMFNLWSUwQSUyRiUyRmV4YW1wbGUlMjBvZiUyMG1hc2slMjBhbmQlMjBmdW5jdGlvbiUyMG1vZHVsYXRpb24lMEElMkYlMkYlMjBlX2UlMjAlMkYlMkYlMjAlNDBlZXJpZV9lYXIlMEFub2lzZSgxOCklMEElMjAlMjAuY29sb3JhbWEoMSklMEElMjAlMjAucG9zdGVyaXplKDIpJTBBJTIwJTIwLmthbGVpZCg1MCklMEElMjAlMjAubWFzayglMEElMjAlMjAlMjAlMjBzaGFwZSgyNSUyQyUyMDAuMjUpLm1vZHVsYXRlU2NhbGUoJTBBJTIwJTIwJTIwJTIwJTIwJTIwbm9pc2UoNDAwLjUlMkMlMjAwLjUpJTBBJTIwJTIwJTIwJTIwKSUwQSUyMCUyMCklMEElMjAlMjAubWFzayhzaGFwZSg0MDAlMkMlMjAxJTJDJTIwMi4xMjUpKSUwQSUyMCUyMC5tb2R1bGF0ZVNjYWxlKG9zYyg2JTJDJTIwMC4xMjUlMkMlMjAwLjA1KS5rYWxlaWQoNTApKSUwQSUyMCUyMC5tdWx0KG9zYygyMCUyQyUyMDAuMDUlMkMlMjAyLjQpLmthbGVpZCg1MCklMkMlMjAwLjI1KSUwQSUyMCUyMC5zY2FsZSgxLjc1JTJDJTIwMC42NSUyQyUyMDAuNSklMEElMjAlMjAubW9kdWxhdGUobm9pc2UoMC41KSklMEElMjAlMjAuc2F0dXJhdGUoNiklMEElMjAlMjAucG9zdGVyaXplKDQlMkMlMjAwLjIpJTBBJTIwJTIwLnNjYWxlKDEuNSklMEElMjAlMjAub3V0KCklM0IlMEE="}]},{}],232:[function(require,module,exports){const request=require("superagent");const examples=require("./examples.json");const sketches=[];const license=`// licensed with CC BY-NC-SA 4.0 https://creativecommons.org/licenses/by-nc-sa/4.0/`;class Gallery{constructor(callback,state,emitter){this.sketches=[];this.examples=[];this.current=null;this.code=null;this.exampleIndex=null;this.state=state;this.emitter=emitter;this.serverURL=this.state.serverURL===null?"":this.state.serverURL;this.examples=examples;this.setSketchFromURL(callback);window.addEventListener("popstate",(event=>{this.setSketchFromURL(callback)}));this.setRandomSketch=this.setRandomSketch.bind(this)}clear(){this.current=null;this.code=null;let newurl=window.location.protocol+"//"+window.location.host+window.location.pathname;window.history.pushState({path:newurl},"",newurl);this.url=newurl}setSketchFromURL(callback){hush();render(o0);let searchParams=new URLSearchParams(window.location.search);this.searchParams=searchParams;let base64Code=searchParams.get("code");let sketch_id=searchParams.get("sketch_id");let showCode=searchParams.get("showCode");let code="";this.foundSketch=false;if(sketch_id){var sketch=this.getExampleById(sketch_id);if(sketch){this.setSketch(sketch);callback(this.code,false)}else{request.get(`${this.state.serverURL}/sketchById`).query({sketch_id:sketch_id}).end(((err,res)=>{if(err){console.log("err getting sketches",err);this.setSketchFromCode(base64Code,callback)}else{this.sketches=JSON.parse(res.text);if(this.sketches.length>0){this.setSketch(this.sketches[0]);this.foundSketch=true;callback(this.code,this.foundSketch)}else{this.setSketchFromCode(base64Code,callback)}}}))}}else{this.setSketchFromCode(base64Code,callback)}if(showCode==="false"){this.emitter.emit("hideAll");this.emitter.emit("hide info")}}setSketchFromCode(base64Code,callback){if(base64Code){this.code=this.decodeBase64(base64Code);this.foundSketch=true}else{this.setRandomSketch()}callback(this.code,this.foundSketch)}saveImage(){}setToURL(params){this.searchParams.delete("sketch_id");this.searchParams.delete("code");let url_params;if(params.sketch_id){url_params=`sketch_id=${params.sketch_id}`;this.searchParams.append("sketch_id",params.sketch_id)}else{url_params=`sketch_id=${params.sketch_id}&code=${params.code}`;this.searchParams.append("sketch_id",params.sketch_id);this.searchParams.append("code",params.code)}let newurl=window.location.protocol+"//"+window.location.host+window.location.pathname+"?"+this.searchParams.toString();window.history.replaceState({path:newurl},"",newurl);this.url=newurl}encodeBase64(text){return btoa(encodeURIComponent(text))}decodeBase64(base64Code){return decodeURIComponent(atob(base64Code))}setSketch(sketch){let code=this.decodeBase64(sketch.code);if(code.indexOf(license)<0)code=`${license}\n${code}\n`;this.code=code;this.current=sketch;this.setToURL(sketch)}setRandomSketch(){if(this.examples.length>0){let index;index=Math.floor(Math.random()*this.examples.length);while(index===this.exampleIndex){index=Math.floor(Math.random()*this.examples.length)}this.exampleIndex=index;this.setSketch(this.examples[index])}else{var startString="osc("+2+Math.floor(Math.pow(10,Math.random()*2))+")";startString+=".color("+Math.random().toFixed(2)+","+Math.random().toFixed(2)+","+Math.random().toFixed(2)+")";startString+=".rotate("+Math.random().toFixed(2)+")";startString+=".out(o0)";this.code=startString}}shareSketch(code,hydra,name){this.saveSketch(code,(()=>{console.log("URL is",this.url,"sketch is",this.current);hydra.getScreenImage((img=>{request.post(`${this.state.serverURL}/image`).attach("previewImage",img).query({url:this.url,sketch_id:this.current.sketch_id,name:name}).end(((err,res)=>{if(err){console.log("error postingimage",err)}else{console.log("image response",res.text)}}))}))}))}saveSketch(code,callback){let self=this;let base64=this.encodeBase64(code);let query={code:base64,parent:this.current?this.current.sketch_id:null};console.log("saving in gallery",query);request.post(`${this.state.serverURL}/sketch`).query(query).end(((err,res)=>{if(err){console.log("error posting sketch",err);if(callback)callback(err)}else{console.log("response",res.text);self.setSketch({sketch_id:res.text,code:base64});if(callback)callback(null)}}))}saveLocally(code){let base64=this.encodeBase64(code);this.searchParams.delete("sketch_id");this.searchParams.delete("code");this.searchParams.append("code",base64);var url_params=this.searchParams.toString();let newurl=window.location.protocol+"//"+window.location.host+window.location.pathname+"?"+url_params;window.history.pushState({path:newurl},"",newurl);this.url=newurl}getExampleById(id){var sketches=this.examples.filter((sketch=>sketch.sketch_id===id));if(sketches.length<=0)sketches=this.sketches.filter((sketch=>sketch.sketch_id===id));return sketches[0]}}module.exports=Gallery},{"./examples.json":231,superagent:218}],233:[function(require,module,exports){const i18next=require("i18next");const i18nextBrowserLanguageDetector=require("i18next-browser-languagedetector");const languageResources=require("./text-elements.js");const availableLanguages=["ja","es","ar","id","pt-br","ch","ko","fr","de"];const languagePath=lang=>`https://raw.githubusercontent.com/hydra-synth/l10n/main/${lang}/editor.json`;i18next.use(i18nextBrowserLanguageDetector).init({debug:true,fallbackLng:"en",partialBundledLanguages:true,resources:languageResources});module.exports=function store(state,emitter){const languages={};let searchParams=new URLSearchParams(window.location.search);let lang=searchParams.get("l10n-lang");let path=searchParams.get("l10n-url");availableLanguages.forEach((lang=>{loadLanguageFromURL(lang,languagePath(lang))}));if(lang!==null&&path!==null){loadLanguageFromURL(lang,path)}updateAvailableLanguages();emitter.on("set language",(lang=>{i18next.changeLanguage(lang,((err,t)=>{state.translation.selectedLanguage=lang;emitter.emit("render")}))}));function updateAvailableLanguages(){Object.keys(languageResources).forEach((key=>{const k=key.split("-")[0];languages[k]=i18next.getFixedT(k)("language-name")}));state.translation={t:i18next.t,languages:languages,selectedLanguage:i18next.language}}function loadLanguageFromURL(lang="es",path){const css="color: purple; background: orange; font-size: 14px;padding:10px";console.log(`%cloading translation for ${lang} from ${path}`,css);fetch(path).then((res=>{if(!res.ok){return res.text().then((text=>{throw new Error(text)}))}else{return res.json()}})).then((json=>{window.i18n=i18next;console.log("adding language",lang,json);const k=lang.split("-")[0];i18next.addResourceBundle(k,"translation",json);const languages={};updateAvailableLanguages();emitter.emit("render")}))}}},{"./text-elements.js":235,i18next:99,"i18next-browser-languagedetector":98}],234:[function(require,module,exports){const Gallery=require("./gallery.js");const repl=require("../views/editor/repl.js");module.exports=function store(state,emitter){state.showInfo=true;state.showUI=true;const SERVER_URL="https://api.hydrasynth.xyz";state.serverURL=SERVER_URL!==undefined?SERVER_URL:null;let sketches;emitter.on("DOMContentLoaded",(function(){const editor=state.editor.editor;sketches=new Gallery(((code,sketchFromURL)=>{editor.setValue(code);repl.eval(code);if(sketchFromURL){state.showInfo=false}else{state.showInfo=true}emitter.emit("render")}),state,emitter)}));emitter.on("screencap",(()=>{screencap();const editor=state.editor.editor;const text=editor.getValue();const data=new Blob([text],{type:"text/plain"});const a=document.createElement("a");a.style.display="none";let d=new Date;a.download=`hydra-${d.getFullYear()}-${d.getMonth()+1}-${d.getDate()}-${d.getHours()}.${d.getMinutes()}.${d.getSeconds()}.js`;a.href=URL.createObjectURL(data);a.click();setTimeout((()=>{window.URL.revokeObjectURL(a.href)}),300)}));emitter.on("editor:randomize",(function(evt){const editor=state.editor.editor;if(evt.shiftKey){editor.mutator.doUndo()}else{editor.mutator.mutate({reroll:false,changeTransform:evt.metaKey});editor.formatCode();sketches.saveLocally(editor.getValue())}}));function clearAll(){const editor=state.editor.editor;hush();speed=1;sketches.clear();editor.clear()}emitter.on("editor:clearAll",(function(){clearAll()}));emitter.on("editor:evalAll",(function(){const editor=state.editor.editor;const code=editor.getValue();repl.eval(code,((string,err)=>{editor.flashCode();if(!err)sketches.saveLocally(code)}))}));emitter.on("editor:evalLine",(line=>{repl.eval(line)}));emitter.on("editor:evalBlock",(block=>{repl.eval(block)}));emitter.on("gallery:saveToURL",(function(){let editor=state.editor.editor;const editorText=editor.getValue();sketches.saveLocally(editorText)}));emitter.on("gallery:shareSketch",(function(){let editor=state.editor.editor;const editorText=editor.getValue();repl.eval(editor.getValue(),((code,error)=>{if(!error){showConfirmation((name=>{sketches.shareSketch(editorText,state.hydra.hydra,name)}),(()=>{}))}else{console.warn(error)}}))}));emitter.on("gallery:showExample",(()=>{const editor=state.editor.editor;clearAll();sketches.setRandomSketch();editor.setValue(sketches.code);repl.eval(editor.getValue())}));emitter.on("show confirmation",(function(count){}));emitter.on("clear all",(function(count){}));emitter.on("hideAll",(function(){state.showUI=!state.showUI;emitter.emit("render")}));emitter.on("toggle info",(function(count){state.showInfo=!state.showInfo;emitter.emit("render")}));emitter.on("hude info",(function(count){state.showInfo=false;emitter.emit("render")}));emitter.on("mutate sketch",(function(){}))};function showConfirmation(successCallback,terminateCallback){var c=prompt(`\n\nHYDRA SKETCH GALLERY\n///////////////////////////////////////\n\n🎨 Click 'OK' to add your sketch and screenshot to the gallery of hydra sketches at https://botsin.space/@hydra. \n\n‼️ Make sure you are ready to share - there is no undo button!\n\n💖 Thank you for sharing! You are also warmly invited to join the the live coding server on the fediverse at https://social.toplap.org/.\n`,"your name, mastodon handle, and/or a short description");if(c!==null){successCallback(c)}else{terminateCallback()}}},{"../views/editor/repl.js":244,"./gallery.js":232}],235:[function(require,module,exports){module.exports={en:{translation:{"language-name":"english",toolbar:{run:"Run all code (ctrl+shift+enter)",upload:"upload to gallery",clear:"clear all",shuffle:"show random sketch",random:"make random change","show-info":"show info window","hide-info":"hide info window"},info:{title:"hydra",subtitle:"live coding video synth",description:"Hydra is live code-able video synth and coding environment that runs directly in the browser. It is free and open-source and made for beginners and experts alike.","get-started-title":"To get started:","get-started-list":["Close this window","Change some numbers","Type Ctrl + Shift + Enter"],"description-detailed":"Hydra is written in JavaScript and compiles to WebGL under the hood. The syntax is inspired by analog modular synthesis, in which chaining or patching a set of transformations together generates a visual result.",uses:"Hydra can be used:","uses-list":["to mix and add effects to camera feeds, screenshares, live streams, and videos","to create generative and audio-reactive visuals, and share them online with others","in combination with other javascript libraries such as P5.js, Tone.js, THREE.js, or gibber","to add interactive video effects to a website","to experiment with and learn about video feedback, fractals, and pixel operations","to stream video between browsers and live-jam with others online"],author:"Created by olivia.","more-info":"For more information and instructions, see: the interactive documentation, a list of hydra functions, the community database of projects and tutorials, a gallery of user-generated sketches, and the source code on github,","more-info-forums":"There is also an active Discord server and facebook group for hydra users+contributors.",support:"If you enjoy using Hydra, please consider supporting continued development <3 ."}}}}},{}],236:[function(require,module,exports){const html=require("choo/html");const Component=require("choo/component");const HydraEditor=require("./editor/editor.js");const log=require("./editor/log.js");module.exports=class Editor extends Component{constructor(id,state,emit){super(id);this.local=state.components[id]={};state.editor=this;this.emit=emit}load(element){log.init(this.logElement);this.editor=new HydraEditor(this.textEl);this.editor.on("*",((e,args)=>{this.emit(e,args)}));this.innerText=document.getElementsByClassName("CodeMirror")[0]}hide(){this.innerText.style.opacity=0}show(){this.innerText.style.opacity=1;this.innerText.style.pointerEvents="all"}update(state){if(state.showInfo===true||state.showUI===false){this.hide()}else{this.show()}return false}createElement({width:width=window.innerWidth,height:height=window.innerHeight}={}){this.textEl=html` `;this.logElement=html`
`;return html`
${this.textEl}
${this.logElement}
`}}},{"./editor/editor.js":238,"./editor/log.js":240,"choo/component":48,"choo/html":49}],237:[function(require,module,exports){const html=require("choo/html");const Component=require("choo/component");const P5=require("./../lib/p5-wrapper.js");const PatchBay=require("./../lib/patch-bay/pb-live.js");let pb;module.exports=class HydraCanvas extends Component{constructor(id,state,emit){super(id);this.local=state.components[id]={};state.hydra=this;this.state=state;this.emit=emit}load(element){let isIOS=(/iPad|iPhone|iPod/.test(navigator.platform)||navigator.platform==="MacIntel"&&navigator.maxTouchPoints>1)&&!window.MSStream;let precisionValue=isIOS?"highp":"mediump";const hydraOptions={detectAudio:true,canvas:element.querySelector("canvas"),precision:precisionValue};if(this.state.serverURL===null){console.log("LOCAL ONLY, WILL NOT INIT webRTC and gallery");this.hydra=new Hydra(hydraOptions)}else{this.pb=new PatchBay;hydraOptions.pb=this.pb;this.hydra=new Hydra(hydraOptions);this.pb.init(this.hydra.captureStream,{server:this.state.serverURL,room:"iclc"});window.pb=this.pb}window.hydraSynth=this.hydra;window.P5=P5;this.emit("hydra loaded")}update(center){return false}createElement({width:width=window.innerWidth,height:height=window.innerHeight}={}){return html`
`}}},{"./../lib/p5-wrapper.js":228,"./../lib/patch-bay/pb-live.js":229,"choo/component":48,"choo/html":49}],238:[function(require,module,exports){var CodeMirror=require("codemirror-minified/lib/codemirror");require("codemirror-minified/mode/javascript/javascript");require("codemirror-minified/addon/hint/javascript-hint");require("codemirror-minified/addon/hint/show-hint");require("codemirror-minified/addon/selection/mark-selection");require("codemirror-minified/addon/comment/comment");const EventEmitter=require("nanobus");const keymaps=require("./keymaps.js");const Mutator=require("./randomizer/Mutator.js");const beautify_js=require("js-beautify").js_beautify;var isShowing=true;module.exports=class Editor extends EventEmitter{constructor(parent){super();console.log("*** Editor class created");var self=this;this.mutator=new Mutator(this);const extraKeys={};Object.entries(keymaps).forEach((([key,e])=>extraKeys[key]=()=>{if(e=="editor:evalBlock"){this.emit(e,this.getCurrentBlock().text)}else if(e=="editor:evalLine"){this.emit(e,this.getLine())}else if(e=="editor:toggleComment"){this.cm.toggleComment();this.emit(e,this)}else if(e==="editor:formatCode"){this.formatCode()}else{this.emit(e,this)}}));const opts={theme:"tomorrow-night-eighties",value:"hello",mode:{name:"javascript",globalVars:true},lineWrapping:true,styleSelectedText:true,extraKeys:extraKeys};this.cm=CodeMirror.fromTextArea(parent,opts);window.cm=this.cm;this.cm.refresh()}clear(){this.cm.setValue('\n \n // Type some code on a new line (such as "osc().out()"), and press CTRL+shift+enter')}setValue(val){this.cm.setValue(val)}getValue(){return this.cm.getValue()}formatCode(){const formatted=beautify_js(this.cm.getValue(),{indent_size:2,break_chained_methods:true,indent_with_tabs:true});this.cm.setValue(formatted)}toggle(){if(this.isShowing){this.hide()}else{this.show()}}getLine(){var c=this.cm.getCursor();var s=this.cm.getLine(c.line);this.flashCode({line:c.line,ch:0},{line:c.line+1,ch:0});return s}flashCode(start,end){if(!start)start={line:this.cm.firstLine(),ch:0};if(!end)end={line:this.cm.lastLine()+1,ch:0};var marker=this.cm.markText(start,end,{className:"styled-background"});setTimeout((()=>marker.clear()),300)}getCurrentBlock(){var editor=this.cm;var pos=editor.getCursor();var startline=pos.line;var endline=pos.line;while(startline>0&&editor.getLine(startline)!==""){startline--}while(endline{logElement=el},log:(msg,className="")=>{console.log("logging",msg,className);if(logElement)logElement.innerHTML=` >> ${msg} `},hide:()=>{if(logElement)logElement.style.display="none"},show:()=>{if(logElement)logElement.style.display="block"},toggle:()=>{if(logElement.style.display=="none"){logElement.style.display="block"}else{logElement.style.display="none"}}}},{}],241:[function(require,module,exports){const{Parser:Parser}=require("acorn");const{generate:generate}=require("astring");const{defaultTraveler:defaultTraveler,attachComments:attachComments,makeTraveler:makeTraveler}=require("astravel");const{UndoStack:UndoStack}=require("./UndoStack.js");const repl=require("./../repl.js");const glslTransforms=require("./glslTransforms.js");class Mutator{constructor(editor){this.editor=editor;this.undoStack=new UndoStack;this.initialVector=[];this.funcTab={};this.transMap={};this.scanFuncs();this.dumpDict()}dumpList(){let gslTab=glslTransforms;gslTab.forEach((v=>{var argList="";v.inputs.forEach((a=>{if(argList!="")argList+=", ";let argL=a.name+": "+a.type+" {"+a.default+"}";argList=argList+argL}))}))}scanFuncs(){let gslTab=glslTransforms;gslTab.forEach((f=>{this.transMap[f.name]=f;if(this.funcTab[f.type]===undefined){this.funcTab[f.type]=[]}this.funcTab[f.type].push(f)}))}dumpDict(){for(let tn in this.funcTab){this.funcTab[tn].forEach((f=>{var argList="";f.inputs.forEach((a=>{if(argList!="")argList+=", ";let argL=a.name+": "+a.type+" {"+a.default+"}";argList=argList+argL}))}))}}mutate(options){let text=this.editor.cm.getValue();this.undoStack.push({text:text,lastLitX:this.lastLitX});let needToRun=true;let tryCounter=5;while(needToRun&&tryCounter-- >=0){var comments=[];let ast=Parser.parse(text,{locations:true,onComment:comments});this.transform(ast,options);attachComments(ast,comments);let regen=generate(ast,{comments:true});this.editor.cm.setValue(regen);try{repl.eval(regen,((code,error)=>{if(error){console.log("Eval error: "+regen)}needToRun=error}))}catch(err){console.log("Exception caught: "+err);needToRun=err}}}doUndo(){if(this.undoStack.atTop()){let text=this.editor.cm.getValue();this.undoStack.push({text:text,lastLitX:this.lastLitX})}if(this.undoStack.canUndo()){let{text:text,lastLitX:lastLitX}=this.undoStack.undo();this.setText(text);this.lastLitX=lastLitX}}doRedo(){if(this.undoStack.canRedo()){let{text:text,lastLitX:lastLitX}=this.undoStack.redo();this.setText(text);this.lastLitX=lastLitX}}setText(text){this.editor.cm.setValue(text);repl.eval(text,((code,error)=>{}))}transform(ast,options){let traveler=makeTraveler({go:function(node,state){if(node.type==="Literal"){state.literalTab.push(node)}else if(node.type==="MemberExpression"){if(node.property&&node.property.type==="Literal"){return}}else if(node.type==="CallExpression"){if(node.callee&&node.callee.property&&node.callee.property.name&&node.callee.property.name!=="out"){state.functionTab.push(node)}}this.super.go.call(this,node,state)}});let state={};state.literalTab=[];state.functionTab=[];traveler.go(ast,state);this.litCount=state.literalTab.length;this.funCount=state.functionTab.length;if(this.litCount!==this.initialVector.length){let nextVect=[];for(let i=0;i0}canRedo(){if(this.stack.length===0||this.index===-1)return false;return this.index=0){while(this.indexthis.limit){this.stack.shift()}this.stack.push(item)}undo(){if(this.stack.length===0)return undefined;if(this.index===-1){this.index=this.stack.length-1}if(this.index>0)this.index--;let v=this.stack[this.index];return v}redo(){if(this.stack.length===0||this.index===-1)return undefined;let nextX=this.index+1;if(nextX>=this.stack.length)return undefined;this.index=nextX;return this.stack[this.index]}}module.exports={UndoStack:UndoStack}},{}],243:[function(require,module,exports){module.exports=[{name:"noise",type:"src",inputs:[{type:"float",name:"scale",default:10},{type:"float",name:"offset",default:.1}],glsl:` return vec4(vec3(_noise(vec3(_st*scale, offset*time))), 1.0);`},{name:"voronoi",type:"src",inputs:[{type:"float",name:"scale",default:5},{type:"float",name:"speed",default:.3},{type:"float",name:"blending",default:.3}],glsl:` vec3 color = vec3(.0);\n // Scale\n _st *= scale;\n // Tile the space\n vec2 i_st = floor(_st);\n vec2 f_st = fract(_st);\n float m_dist = 10.; // minimun distance\n vec2 m_point; // minimum point\n for (int j=-1; j<=1; j++ ) {\n for (int i=-1; i<=1; i++ ) {\n vec2 neighbor = vec2(float(i),float(j));\n vec2 p = i_st + neighbor;\n vec2 point = fract(sin(vec2(dot(p,vec2(127.1,311.7)),dot(p,vec2(269.5,183.3))))*43758.5453);\n point = 0.5 + 0.5*sin(time*speed + 6.2831*point);\n vec2 diff = neighbor + point - f_st;\n float dist = length(diff);\n if( dist < m_dist ) {\n m_dist = dist;\n m_point = point;\n }\n }\n }\n // Assign a color using the closest point position\n color += dot(m_point,vec2(.3,.6));\n color *= 1.0 - blending*m_dist;\n return vec4(color, 1.0);`},{name:"osc",type:"src",inputs:[{type:"float",name:"frequency",default:60},{type:"float",name:"sync",default:.1},{type:"float",name:"offset",default:0}],glsl:` vec2 st = _st;\n float r = sin((st.x-offset/frequency+time*sync)*frequency)*0.5 + 0.5;\n float g = sin((st.x+time*sync)*frequency)*0.5 + 0.5;\n float b = sin((st.x+offset/frequency+time*sync)*frequency)*0.5 + 0.5;\n return vec4(r, g, b, 1.0);`},{name:"shape",type:"src",inputs:[{type:"float",name:"sides",default:3},{type:"float",name:"radius",default:.3},{type:"float",name:"smoothing",default:.01}],glsl:` vec2 st = _st * 2. - 1.;\n // Angle and radius from the current pixel\n float a = atan(st.x,st.y)+3.1416;\n float r = (2.*3.1416)/sides;\n float d = cos(floor(.5+a/r)*r-a)*length(st);\n return vec4(vec3(1.0-smoothstep(radius,radius + smoothing + 0.0000001,d)), 1.0);`},{name:"gradient",type:"src",inputs:[{type:"float",name:"speed",default:0}],glsl:` return vec4(_st, sin(time*speed), 1.0);`},{name:"src",type:"src",inputs:[{type:"sampler2D",name:"tex",default:NaN}],glsl:` // vec2 uv = gl_FragCoord.xy/vec2(1280., 720.);\n return texture2D(tex, fract(_st));`},{name:"solid",type:"src",inputs:[{type:"float",name:"r",default:0},{type:"float",name:"g",default:0},{type:"float",name:"b",default:0},{type:"float",name:"a",default:1}],glsl:` return vec4(r, g, b, a);`},{name:"rotate",type:"coord",inputs:[{type:"float",name:"angle",default:10},{type:"float",name:"speed",default:0}],glsl:` vec2 xy = _st - vec2(0.5);\n float ang = angle + speed *time;\n xy = mat2(cos(ang),-sin(ang), sin(ang),cos(ang))*xy;\n xy += 0.5;\n return xy;`},{name:"scale",type:"coord",inputs:[{type:"float",name:"amount",default:1.5},{type:"float",name:"xMult",default:1},{type:"float",name:"yMult",default:1},{type:"float",name:"offsetX",default:.5},{type:"float",name:"offsetY",default:.5}],glsl:` vec2 xy = _st - vec2(offsetX, offsetY);\n xy*=(1.0/vec2(amount*xMult, amount*yMult));\n xy+=vec2(offsetX, offsetY);\n return xy;\n `},{name:"pixelate",type:"coord",inputs:[{type:"float",name:"pixelX",default:20},{type:"float",name:"pixelY",default:20}],glsl:` vec2 xy = vec2(pixelX, pixelY);\n return (floor(_st * xy) + 0.5)/xy;`},{name:"posterize",type:"color",inputs:[{type:"float",name:"bins",default:3},{type:"float",name:"gamma",default:.6}],glsl:` vec4 c2 = pow(_c0, vec4(gamma));\n c2 *= vec4(bins);\n c2 = floor(c2);\n c2/= vec4(bins);\n c2 = pow(c2, vec4(1.0/gamma));\n return vec4(c2.xyz, _c0.a);`},{name:"shift",type:"color",inputs:[{type:"float",name:"r",default:.5},{type:"float",name:"g",default:0},{type:"float",name:"b",default:0},{type:"float",name:"a",default:0}],glsl:` vec4 c2 = vec4(_c0);\n c2.r = fract(c2.r + r);\n c2.g = fract(c2.g + g);\n c2.b = fract(c2.b + b);\n c2.a = fract(c2.a + a);\n return vec4(c2.rgba);`},{name:"repeat",type:"coord",inputs:[{type:"float",name:"repeatX",default:3},{type:"float",name:"repeatY",default:3},{type:"float",name:"offsetX",default:0},{type:"float",name:"offsetY",default:0}],glsl:` vec2 st = _st * vec2(repeatX, repeatY);\n st.x += step(1., mod(st.y,2.0)) * offsetX;\n st.y += step(1., mod(st.x,2.0)) * offsetY;\n return fract(st);`},{name:"modulateRepeat",type:"combineCoord",inputs:[{type:"float",name:"repeatX",default:3},{type:"float",name:"repeatY",default:3},{type:"float",name:"offsetX",default:.5},{type:"float",name:"offsetY",default:.5}],glsl:` vec2 st = _st * vec2(repeatX, repeatY);\n st.x += step(1., mod(st.y,2.0)) + _c0.r * offsetX;\n st.y += step(1., mod(st.x,2.0)) + _c0.g * offsetY;\n return fract(st);`},{name:"repeatX",type:"coord",inputs:[{type:"float",name:"reps",default:3},{type:"float",name:"offset",default:0}],glsl:` vec2 st = _st * vec2(reps, 1.0);\n // float f = mod(_st.y,2.0);\n st.y += step(1., mod(st.x,2.0))* offset;\n return fract(st);`},{name:"modulateRepeatX",type:"combineCoord",inputs:[{type:"float",name:"reps",default:3},{type:"float",name:"offset",default:.5}],glsl:` vec2 st = _st * vec2(reps, 1.0);\n // float f = mod(_st.y,2.0);\n st.y += step(1., mod(st.x,2.0)) + _c0.r * offset;\n return fract(st);`},{name:"repeatY",type:"coord",inputs:[{type:"float",name:"reps",default:3},{type:"float",name:"offset",default:0}],glsl:` vec2 st = _st * vec2(1.0, reps);\n // float f = mod(_st.y,2.0);\n st.x += step(1., mod(st.y,2.0))* offset;\n return fract(st);`},{name:"modulateRepeatY",type:"combineCoord",inputs:[{type:"float",name:"reps",default:3},{type:"float",name:"offset",default:.5}],glsl:` vec2 st = _st * vec2(reps, 1.0);\n // float f = mod(_st.y,2.0);\n st.x += step(1., mod(st.y,2.0)) + _c0.r * offset;\n return fract(st);`},{name:"kaleid",type:"coord",inputs:[{type:"float",name:"nSides",default:4}],glsl:` vec2 st = _st;\n st -= 0.5;\n float r = length(st);\n float a = atan(st.y, st.x);\n float pi = 2.*3.1416;\n a = mod(a,pi/nSides);\n a = abs(a-pi/nSides/2.);\n return r*vec2(cos(a), sin(a));`},{name:"modulateKaleid",type:"combineCoord",inputs:[{type:"float",name:"nSides",default:4}],glsl:` vec2 st = _st - 0.5;\n float r = length(st);\n float a = atan(st.y, st.x);\n float pi = 2.*3.1416;\n a = mod(a,pi/nSides);\n a = abs(a-pi/nSides/2.);\n return (_c0.r+r)*vec2(cos(a), sin(a));`},{name:"scroll",type:"coord",inputs:[{type:"float",name:"scrollX",default:.5},{type:"float",name:"scrollY",default:.5},{type:"float",name:"speedX",default:0},{type:"float",name:"speedY",default:0}],glsl:`\n _st.x += scrollX + time*speedX;\n _st.y += scrollY + time*speedY;\n return fract(_st);`},{name:"scrollX",type:"coord",inputs:[{type:"float",name:"scrollX",default:.5},{type:"float",name:"speed",default:0}],glsl:` _st.x += scrollX + time*speed;\n return fract(_st);`},{name:"modulateScrollX",type:"combineCoord",inputs:[{type:"float",name:"scrollX",default:.5},{type:"float",name:"speed",default:0}],glsl:` _st.x += _c0.r*scrollX + time*speed;\n return fract(_st);`},{name:"scrollY",type:"coord",inputs:[{type:"float",name:"scrollY",default:.5},{type:"float",name:"speed",default:0}],glsl:` _st.y += scrollY + time*speed;\n return fract(_st);`},{name:"modulateScrollY",type:"combineCoord",inputs:[{type:"float",name:"scrollY",default:.5},{type:"float",name:"speed",default:0}],glsl:` _st.y += _c0.r*scrollY + time*speed;\n return fract(_st);`},{name:"add",type:"combine",inputs:[{type:"float",name:"amount",default:1}],glsl:` return (_c0+_c1)*amount + _c0*(1.0-amount);`},{name:"sub",type:"combine",inputs:[{type:"float",name:"amount",default:1}],glsl:` return (_c0-_c1)*amount + _c0*(1.0-amount);`},{name:"layer",type:"combine",inputs:[],glsl:` return vec4(mix(_c0.rgb, _c1.rgb, _c1.a), clamp(_c0.a + _c1.a, 0.0, 1.0));`},{name:"blend",type:"combine",inputs:[{type:"float",name:"amount",default:.5}],glsl:` return _c0*(1.0-amount)+_c1*amount;`},{name:"mult",type:"combine",inputs:[{type:"float",name:"amount",default:1}],glsl:` return _c0*(1.0-amount)+(_c0*_c1)*amount;`},{name:"diff",type:"combine",inputs:[],glsl:` return vec4(abs(_c0.rgb-_c1.rgb), max(_c0.a, _c1.a));`},{name:"modulate",type:"combineCoord",inputs:[{type:"float",name:"amount",default:.1}],glsl:` // return fract(st+(_c0.xy-0.5)*amount);\n return _st + _c0.xy*amount;`},{name:"modulateScale",type:"combineCoord",inputs:[{type:"float",name:"multiple",default:1},{type:"float",name:"offset",default:1}],glsl:` vec2 xy = _st - vec2(0.5);\n xy*=(1.0/vec2(offset + multiple*_c0.r, offset + multiple*_c0.g));\n xy+=vec2(0.5);\n return xy;`},{name:"modulatePixelate",type:"combineCoord",inputs:[{type:"float",name:"multiple",default:10},{type:"float",name:"offset",default:3}],glsl:` vec2 xy = vec2(offset + _c0.x*multiple, offset + _c0.y*multiple);\n return (floor(_st * xy) + 0.5)/xy;`},{name:"modulateRotate",type:"combineCoord",inputs:[{type:"float",name:"multiple",default:1},{type:"float",name:"offset",default:0}],glsl:` vec2 xy = _st - vec2(0.5);\n float angle = offset + _c0.x * multiple;\n xy = mat2(cos(angle),-sin(angle), sin(angle),cos(angle))*xy;\n xy += 0.5;\n return xy;`},{name:"modulateHue",type:"combineCoord",inputs:[{type:"float",name:"amount",default:1}],glsl:` return _st + (vec2(_c0.g - _c0.r, _c0.b - _c0.g) * amount * 1.0/resolution);`},{name:"invert",type:"color",inputs:[{type:"float",name:"amount",default:1}],glsl:` return vec4((1.0-_c0.rgb)*amount + _c0.rgb*(1.0-amount), _c0.a);`},{name:"contrast",type:"color",inputs:[{type:"float",name:"amount",default:1.6}],glsl:` vec4 c = (_c0-vec4(0.5))*vec4(amount) + vec4(0.5);\n return vec4(c.rgb, _c0.a);`},{name:"brightness",type:"color",inputs:[{type:"float",name:"amount",default:.4}],glsl:` return vec4(_c0.rgb + vec3(amount), _c0.a);`},{name:"mask",type:"combine",inputs:[],glsl:` float a = _luminance(_c1.rgb);\n return vec4(_c0.rgb*a, a*_c0.a);`},{name:"luma",type:"color",inputs:[{type:"float",name:"threshold",default:.5},{type:"float",name:"tolerance",default:.1}],glsl:` float a = smoothstep(threshold-(tolerance+0.0000001), threshold+(tolerance+0.0000001), _luminance(_c0.rgb));\n return vec4(_c0.rgb*a, a);`},{name:"thresh",type:"color",inputs:[{type:"float",name:"threshold",default:.5},{type:"float",name:"tolerance",default:.04}],glsl:` return vec4(vec3(smoothstep(threshold-(tolerance+0.0000001), threshold+(tolerance+0.0000001), _luminance(_c0.rgb))), _c0.a);`},{name:"color",type:"color",inputs:[{type:"float",name:"r",default:1},{type:"float",name:"g",default:1},{type:"float",name:"b",default:1},{type:"float",name:"a",default:1}],glsl:` vec4 c = vec4(r, g, b, a);\n vec4 pos = step(0.0, c); // detect whether negative\n // if > 0, return r * _c0\n // if < 0 return (1.0-r) * _c0\n return vec4(mix((1.0-_c0)*abs(c), c*_c0, pos));`},{name:"saturate",type:"color",inputs:[{type:"float",name:"amount",default:2}],glsl:` const vec3 W = vec3(0.2125, 0.7154, 0.0721);\n vec3 intensity = vec3(dot(_c0.rgb, W));\n return vec4(mix(intensity, _c0.rgb, amount), _c0.a);`},{name:"hue",type:"color",inputs:[{type:"float",name:"hue",default:.4}],glsl:` vec3 c = _rgbToHsv(_c0.rgb);\n c.r += hue;\n // c.r = fract(c.r);\n return vec4(_hsvToRgb(c), _c0.a);`},{name:"colorama",type:"color",inputs:[{type:"float",name:"amount",default:.005}],glsl:` vec3 c = _rgbToHsv(_c0.rgb);\n c += vec3(amount);\n c = _hsvToRgb(c);\n c = fract(c);\n return vec4(c, _c0.a);`},{name:"prev",type:"src",inputs:[],glsl:` return texture2D(prevBuffer, fract(_st));`},{name:"sum",type:"color",inputs:[{type:"vec4",name:"scale",default:1}],glsl:` vec4 v = _c0 * s;\n return v.r + v.g + v.b + v.a;\n }\n float sum(vec2 _st, vec4 s) { // vec4 is not a typo, because argument type is not overloaded\n vec2 v = _st.xy * s.xy;\n return v.x + v.y;`},{name:"r",type:"color",inputs:[{type:"float",name:"scale",default:1},{type:"float",name:"offset",default:0}],glsl:` return vec4(_c0.r * scale + offset);`},{name:"g",type:"color",inputs:[{type:"float",name:"scale",default:1},{type:"float",name:"offset",default:0}],glsl:` return vec4(_c0.g * scale + offset);`},{name:"b",type:"color",inputs:[{type:"float",name:"scale",default:1},{type:"float",name:"offset",default:0}],glsl:` return vec4(_c0.b * scale + offset);`},{name:"a",type:"color",inputs:[{type:"float",name:"scale",default:1},{type:"float",name:"offset",default:0}],glsl:` return vec4(_c0.a * scale + offset);`}]},{}],244:[function(require,module,exports){const log=require("./log.js").log;module.exports={eval:(arg,callback)=>{var self=this;var jsString=`(async() => {\n ${arg}\n})().catch(${err=>log(err.message,"log-error")})`;var isError=false;try{eval(jsString);log("")}catch(e){isError=true;console.log("logging",e);log(e.message,"log-error")}if(callback)callback(jsString,isError)}}},{"./log.js":240}],245:[function(require,module,exports){const html=require("choo/html");const raw=require("choo/html/raw");const toolbar=require("./toolbar.js");const link=url=>`href=${url} target=_blank`;module.exports=function mainView(state,emit){const{t:t,languages:languages}=state.translation;const textDirection=state.translation.selectedLanguage==="ar"&&state.showInfo===true?"rtl":"ltr";const langArray=Object.entries(languages);return html`
`}},{"./toolbar.js":247,"choo/html":49,"choo/html/raw":50}],246:[function(require,module,exports){const html=require("choo/html");const info=require("./info.js");const Hydra=require("./Hydra.js");const Editor=require("./EditorComponent.js");module.exports=function mainView(state,emit){return html`
${state.cache(Hydra,"hydra-canvas").render(state,emit)}
${info(state,emit)} ${state.cache(Editor,"editor").render(state,emit)} `}},{"./EditorComponent.js":236,"./Hydra.js":237,"./info.js":245,"choo/html":49}],247:[function(require,module,exports){const html=require("choo/html");module.exports=function toolbar(state,emit){const hidden=state.showInfo?"hidden":"";const{t:t}=state.translation;const dispatch=eventName=>e=>emit(eventName,e);const icon=(id,className,title,event)=>html` `;const toggleInfo=state.showInfo?icon("close","fa-times",t("toolbar.hide-info"),"toggle info"):icon("close","fa-question-circle",t("toolbar.show-info"),"toggle info");return html`
${icon("run",`fa-play-circle ${hidden}`,t("toolbar.run"),"editor:evalAll")} ${icon("clear",`fa fa-trash ${hidden}`,t("toolbar.clear"),"editor:clearAll")} ${icon("shuffle",`fa-random`,t("toolbar.shuffle"),"gallery:showExample")} ${icon("mutator",`fa-dice ${hidden}`,t("toolbar.random"),"editor:randomize")} ${state.serverURL===null?"":icon("share",`fa-upload ${hidden}`,t("toolbar.upload"),"gallery:shareSketch")} ${toggleInfo}
`}},{"choo/html":49}]},{},[1]);