forked from AlaSQL/alasql
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathalasql.min.js
7 lines (7 loc) · 222 KB
/
alasql.min.js
1
2
3
4
5
6
7
(function(root,factory){if(typeof define==="function"&&define.amd){define([],factory)}else if(typeof exports==="object"){module.exports=factory()}else{root.alasql=factory()}})(this,function(){alasql=function(sql,params,cb,scope){return alasql.exec(sql,params,cb,scope)};alasql.version="0.0.29";var parser=function(){var o=function(k,v,o,l){for(o=o||{},l=k.length;l--;o[k[l]]=v);return o},$V0=[8,9],$V1=[2,9],$V2=[1,118],$V3=[1,119],$V4=[1,28],$V5=[1,85],$V6=[1,90],$V7=[1,92],$V8=[1,91],$V9=[1,108],$Va=[1,103],$Vb=[1,104],$Vc=[1,109],$Vd=[1,110],$Ve=[1,111],$Vf=[1,112],$Vg=[1,113],$Vh=[1,114],$Vi=[1,115],$Vj=[1,116],$Vk=[1,117],$Vl=[1,93],$Vm=[1,94],$Vn=[1,95],$Vo=[1,96],$Vp=[1,101],$Vq=[1,97],$Vr=[1,98],$Vs=[1,99],$Vt=[1,100],$Vu=[1,102],$Vv=[1,89],$Vw=[1,88],$Vx=[1,57],$Vy=[1,62],$Vz=[1,46],$VA=[1,49],$VB=[1,45],$VC=[1,48],$VD=[1,43],$VE=[1,50],$VF=[1,44],$VG=[1,47],$VH=[1,56],$VI=[1,52],$VJ=[1,65],$VK=[1,66],$VL=[1,68],$VM=[1,67],$VN=[1,58],$VO=[1,60],$VP=[1,61],$VQ=[1,105],$VR=[1,107],$VS=[1,120],$VT=[1,54],$VU=[1,55],$VV=[1,53],$VW=[1,63],$VX=[1,64],$VY=[8,9,81,87,109,110,120,121,122,123,129],$VZ=[1,161],$V_=[1,158],$V$=[1,159],$V01=[1,160],$V11=[1,162],$V21=[1,163],$V31=[1,164],$V41=[1,165],$V51=[1,166],$V61=[1,167],$V71=[1,168],$V81=[1,169],$V91=[1,170],$Va1=[1,171],$Vb1=[1,172],$Vc1=[1,173],$Vd1=[1,174],$Ve1=[1,176],$Vf1=[1,177],$Vg1=[1,179],$Vh1=[1,178],$Vi1=[1,180],$Vj1=[1,181],$Vk1=[4,5,86,133,136,147,148,150,153,154,155,156,157,158,159,160,161,163,164,165,166,167,168,169,170,171,172,182,200,291,293,297],$Vl1=[2,62],$Vm1=[1,210],$Vn1=[4,5,8,9,77,81,85,87,88,92,96,97,98,99,100,101,102,103,104,109,110,119,120,121,122,123,126,127,129,133,136,165,175,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,198,199,200,201,202,203],$Vo1=[4,5,65,68,69,75,86,133,136,147,148,150,153,154,155,156,157,158,159,160,161,163,164,165,166,167,168,169,170,171,172,182,200,291,293,297],$Vp1=[2,158],$Vq1=[1,216],$Vr1=[4,5,8,9,77,81,85,87,88,92,96,97,98,99,100,101,102,103,104,109,110,119,120,121,122,123,126,127,129,133,136,165,175,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,198,199,200,201,202,203,214,226,241,244,258,299,301],$Vs1=[2,202],$Vt1=[1,227],$Vu1=[4,5,8,9,77,81,85,87,88,92,96,97,98,99,100,101,102,103,104,109,110,119,120,121,122,123,126,127,129,133,136,165,175,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,198,199,200,201,202,203,299,301],$Vv1=[1,249],$Vw1=[4,5,8,9,68,70,77,81,85,86,87,88,89,92,96,97,98,99,100,101,102,103,104,105,107,109,110,119,120,121,122,123,126,127,129,133,136,165,169,175,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,198,199,200,201,202,203,207,212,214,225,226,227,241,242,244,251,254,255,258,259,262,263,264,265,267,272,278,299,301],$Vx1=[1,257],$Vy1=[1,256],$Vz1=[4,5],$VA1=[2,300],$VB1=[1,264],$VC1=[2,343],$VD1=[1,274],$VE1=[8,9,87,109,110,120,121,122,123,129],$VF1=[2,85],$VG1=[1,296],$VH1=[69,204,205],$VI1=[8,9,85,87,200,214,226,241,244,258],$VJ1=[4,5,8,9,77,81,85,87,88,92,96,97,98,99,100,101,102,103,104,109,110,119,120,121,122,123,126,127,129,133,165,175,177,178,179,180,181,182,186,187,188,189,190,191,192,193,194,195,198,199,200,201,202,203],$VK1=[2,215],$VL1=[1,353],$VM1=[175,177,179],$VN1=[1,357],$VO1=[1,358],$VP1=[85,301],$VQ1=[85,299,301],$VR1=[1,363],$VS1=[85,299],$VT1=[8,9,86,88],$VU1=[8,9,87,110,120,121,122,123,129],$VV1=[1,399],$VW1=[4,5,8,9,77,81,85,87,88,92,96,97,98,99,100,101,102,103,104,109,110,119,120,121,122,123,126,127,129,133,136,165,175,177,178,179,180,181,182,183,184,186,187,188,189,190,191,192,193,194,195,198,199,200,201,202,203],$VX1=[4,5,8,9,77,81,85,87,88,92,96,97,98,99,100,101,102,103,104,109,110,119,120,121,122,123,126,127,129,133,165,175,177,178,179,186,187,188,189,190,191,192,193,194,195,198,199,202,203],$VY1=[4,5,8,9,77,81,85,87,88,92,96,97,98,99,100,101,102,103,104,109,110,119,120,121,122,123,126,127,129,133,165,175,177,178,179,199,202,203],$VZ1=[8,9,77,81,87,109,110,120,121,122,123,129],$V_1=[1,426],$V$1=[8,9,77,81,85,87,109,110,120,121,122,123,129],$V02=[1,433],$V12=[4,5,8,9,77,81,85,87,88,92,96,97,98,99,100,101,102,103,104,105,107,109,110,119,120,121,122,123,126,127,129,133,136,165,175,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,198,199,200,201,202,203,214,226,241,244,258,299,301],$V22=[85,87],$V32=[2,157],$V42=[1,474],$V52=[8,9,87,120,121,122,123,129],$V62=[8,9,85,87,109,110,120,121,122,123,129],$V72=[2,101],$V82=[1,489],$V92=[1,490],$Va2=[1,491],$Vb2=[1,493],$Vc2=[1,492],$Vd2=[1,494],$Ve2=[1,495],$Vf2=[1,496],$Vg2=[1,497],$Vh2=[8,9,85,87,92,96,97,98,99,100,101,102,103,104,109,110,120,121,122,123,129],$Vi2=[8,9,85,109],$Vj2=[2,84],$Vk2=[2,359],$Vl2=[1,546],$Vm2=[1,555],$Vn2=[1,556],$Vo2=[8,9,85],$Vp2=[1,559],$Vq2=[8,9,87,120,121,122,129],$Vr2=[8,9,87,92,96,97,98,99,100,101,102,103,104,109,110,120,121,122,123,129],$Vs2=[1,591],$Vt2=[8,9,87,120,121,122],$Vu2=[1,617],$Vv2=[1,618],$Vw2=[1,619],$Vx2=[8,9,85,87],$Vy2=[1,640],$Vz2=[1,639],$VA2=[1,637],$VB2=[1,635],$VC2=[1,636],$VD2=[1,638],$VE2=[1,648],$VF2=[1,649],$VG2=[1,650],$VH2=[1,651],$VI2=[68,241,242,244,251],$VJ2=[2,311],$VK2=[1,656],$VL2=[8,9,87],$VM2=[1,669],$VN2=[8,9,85,87,119,120,121,122,123,129],$VO2=[8,9,87,92,96,97,98,99,100,101,102,103,104,105,107,109,110,120,121,122,123,129],$VP2=[8,9,214,225,226,227],$VQ2=[8,9,85,87,120,121,122,129];var parser={trace:function trace(){},yy:{},symbols_:{error:2,Literal:3,LITERAL:4,BRALITERAL:5,main:6,Statements:7,EOF:8,SEMICOLON:9,Statement:10,ExplainStatement:11,EXPLAIN:12,QUERY:13,PLAN:14,AlterTable:15,AttachDatabase:16,CreateDatabase:17,CreateIndex:18,CreateTable:19,CreateView:20,Delete:21,DetachDatabase:22,DropDatabase:23,DropIndex:24,DropTable:25,DropView:26,Insert:27,RenameTable:28,Select:29,ShowCreateTable:30,ShowColumns:31,ShowDatabases:32,ShowIndex:33,ShowTables:34,BeginTransaction:35,CommitTransaction:36,RollbackTransaction:37,EndTransaction:38,UseDatabase:39,Update:40,Help:41,ExpressionStatement:42,Source:43,Assert:44,SetVariable:45,Store:46,Restore:47,DeclareCursor:48,OpenCursor:49,FetchCursor:50,CloseCursor:51,WithSelectClause:52,WITH:53,WithTables:54,RECURSIVE:55,SelectClause:56,IntoClause:57,FromClause:58,WhereClause:59,GroupClause:60,OrderClause:61,LimitClause:62,UnionClause:63,SelectModifier:64,DISTINCT:65,TopClause:66,ResultColumns:67,UNIQUE:68,ALL:69,SELECT:70,VALUE:71,ROW:72,COLUMN:73,MATRIX:74,TOP:75,NumValue:76,INTO:77,Table:78,FuncValue:79,ParamValue:80,FROM:81,FromTablesList:82,FromTable:83,JoinTablesList:84,COMMA:85,LPAR:86,RPAR:87,AS:88,DOT:89,JoinTable:90,JoinMode:91,JOIN:92,JoinTableAs:93,OnClause:94,JoinModeMode:95,NATURAL:96,INNER:97,LEFT:98,OUTER:99,RIGHT:100,FULL:101,SEMI:102,ANTI:103,CROSS:104,ON:105,Expression:106,USING:107,ColumnsList:108,WHERE:109,GROUP:110,BY:111,GroupExpressionsList:112,HavingClause:113,GroupExpression:114,GROUPING:115,SETS:116,ROLLUP:117,CUBE:118,HAVING:119,UNION:120,EXCEPT:121,INTERSECT:122,ORDER:123,OrderExpressionsList:124,OrderExpression:125,DIRECTION:126,COLLATE:127,NOCASE:128,LIMIT:129,OffsetClause:130,OFFSET:131,ResultColumn:132,NUMBER:133,StringValue:134,Star:135,STAR:136,Column:137,AggrValue:138,Op:139,LogicValue:140,NullValue:141,ExistsValue:142,CaseValue:143,CastClause:144,Json:145,NewClause:146,NEW:147,CAST:148,ColumnType:149,CONVERT:150,PrimitiveValue:151,Aggregator:152,SUM:153,COUNT:154,MIN:155,MAX:156,AVG:157,FIRST:158,LAST:159,AGGR:160,ARRAY:161,ExprList:162,TRUE:163,FALSE:164,STRING:165,NULL:166,EXISTS:167,DOLLAR:168,COLON:169,QUESTION:170,BRAQUESTION:171,CASE:172,WhensList:173,ElseClause:174,END:175,When:176,WHEN:177,THEN:178,ELSE:179,LIKE:180,PLUS:181,MINUS:182,SLASH:183,PERCENT:184,ARROW:185,GT:186,GE:187,LT:188,LE:189,EQ:190,EQEQ:191,EQEQEQ:192,NE:193,NEEQEQ:194,NEEQEQEQ:195,CondOp:196,AllSome:197,AND:198,OR:199,NOT:200,IN:201,BETWEEN:202,NOT_BETWEEN:203,SOME:204,ANY:205,UPDATE:206,SET:207,SetColumnsList:208,SetColumn:209,DELETE:210,INSERT:211,VALUES:212,ValuesListsList:213,DEFAULT:214,ValuesList:215,Value:216,DateValue:217,CREATE:218,TABLE:219,IfNotExists:220,CreateTableDefClause:221,CreateTableOptionsClause:222,CreateTableOptions:223,CreateTableOption:224,ENGINE:225,AUTO_INCREMENT:226,CHARSET:227,TemporaryClause:228,TEMPORARY:229,TEMP:230,IF:231,ColumnDefsList:232,ConstraintsList:233,Constraint:234,ConstraintName:235,PrimaryKey:236,ForeignKey:237,UniqueKey:238,IndexKey:239,CONSTRAINT:240,PRIMARY:241,KEY:242,ColsList:243,FOREIGN:244,REFERENCES:245,OnForeignKeyClause:246,OnDeleteClause:247,OnUpdateClause:248,NO:249,ACTION:250,INDEX:251,ColumnDef:252,ColumnConstraintsClause:253,ColumnConstraints:254,ENUM:255,ColumnConstraintsList:256,ColumnConstraint:257,IDENTITY:258,DROP:259,IfExists:260,ALTER:261,RENAME:262,TO:263,ADD:264,MODIFY:265,ATTACH:266,DATABASE:267,DETACH:268,AsClause:269,USE:270,SHOW:271,DATABASES:272,TABLES:273,COLUMNS:274,VIEW:275,View:276,DECLARE:277,CURSOR:278,FOR:279,OPEN:280,CLOSE:281,FETCH:282,FetchDirection:283,NEXT:284,PRIOR:285,ABSOLUTE:286,RELATIVE:287,HELP:288,SOURCE:289,ASSERT:290,AT:291,JsonObject:292,ATLBRA:293,JsonArray:294,JsonValue:295,JsonPrimitiveValue:296,LCUR:297,JsonPropertiesList:298,RCUR:299,JsonElementsList:300,RBRA:301,JsonProperty:302,AUTOCOMMIT:303,OnOff:304,OFF:305,COMMIT:306,TRANSACTION:307,ROLLBACK:308,BEGIN:309,STORE:310,RESTORE:311,$accept:0,$end:1},terminals_:{2:"error",4:"LITERAL",5:"BRALITERAL",8:"EOF",9:"SEMICOLON",12:"EXPLAIN",13:"QUERY",14:"PLAN",38:"EndTransaction",53:"WITH",55:"RECURSIVE",65:"DISTINCT",68:"UNIQUE",69:"ALL",70:"SELECT",71:"VALUE",72:"ROW",73:"COLUMN",74:"MATRIX",75:"TOP",77:"INTO",81:"FROM",85:"COMMA",86:"LPAR",87:"RPAR",88:"AS",89:"DOT",92:"JOIN",96:"NATURAL",97:"INNER",98:"LEFT",99:"OUTER",100:"RIGHT",101:"FULL",102:"SEMI",103:"ANTI",104:"CROSS",105:"ON",107:"USING",109:"WHERE",110:"GROUP",111:"BY",115:"GROUPING",116:"SETS",117:"ROLLUP",118:"CUBE",119:"HAVING",120:"UNION",121:"EXCEPT",122:"INTERSECT",123:"ORDER",126:"DIRECTION",127:"COLLATE",128:"NOCASE",129:"LIMIT",131:"OFFSET",133:"NUMBER",136:"STAR",147:"NEW",148:"CAST",150:"CONVERT",153:"SUM",154:"COUNT",155:"MIN",156:"MAX",157:"AVG",158:"FIRST",159:"LAST",160:"AGGR",161:"ARRAY",163:"TRUE",164:"FALSE",165:"STRING",166:"NULL",167:"EXISTS",168:"DOLLAR",169:"COLON",170:"QUESTION",171:"BRAQUESTION",172:"CASE",175:"END",177:"WHEN",178:"THEN",179:"ELSE",180:"LIKE",181:"PLUS",182:"MINUS",183:"SLASH",184:"PERCENT",185:"ARROW",186:"GT",187:"GE",188:"LT",189:"LE",190:"EQ",191:"EQEQ",192:"EQEQEQ",193:"NE",194:"NEEQEQ",195:"NEEQEQEQ",198:"AND",199:"OR",200:"NOT",201:"IN",202:"BETWEEN",203:"NOT_BETWEEN",204:"SOME",205:"ANY",206:"UPDATE",207:"SET",210:"DELETE",211:"INSERT",212:"VALUES",214:"DEFAULT",217:"DateValue",218:"CREATE",219:"TABLE",225:"ENGINE",226:"AUTO_INCREMENT",227:"CHARSET",229:"TEMPORARY",230:"TEMP",231:"IF",240:"CONSTRAINT",241:"PRIMARY",242:"KEY",244:"FOREIGN",245:"REFERENCES",249:"NO",250:"ACTION",251:"INDEX",254:"ColumnConstraints",255:"ENUM",258:"IDENTITY",259:"DROP",261:"ALTER",262:"RENAME",263:"TO",264:"ADD",265:"MODIFY",266:"ATTACH",267:"DATABASE",268:"DETACH",270:"USE",271:"SHOW",272:"DATABASES",273:"TABLES",274:"COLUMNS",275:"VIEW",277:"DECLARE",278:"CURSOR",279:"FOR",280:"OPEN",281:"CLOSE",282:"FETCH",284:"NEXT",285:"PRIOR",286:"ABSOLUTE",287:"RELATIVE",288:"HELP",289:"SOURCE",290:"ASSERT",291:"AT",293:"ATLBRA",297:"LCUR",299:"RCUR",301:"RBRA",303:"AUTOCOMMIT",305:"OFF",306:"COMMIT",307:"TRANSACTION",308:"ROLLBACK",309:"BEGIN",310:"STORE",311:"RESTORE"},productions_:[0,[3,1],[3,1],[6,2],[7,3],[7,1],[7,1],[11,2],[11,4],[10,0],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[52,3],[52,4],[52,1],[54,0],[29,8],[56,4],[56,4],[56,4],[56,3],[64,1],[64,2],[64,2],[64,2],[64,2],[66,2],[66,0],[57,0],[57,2],[57,2],[57,2],[58,2],[58,3],[58,0],[82,1],[82,3],[83,4],[83,5],[83,3],[83,2],[83,3],[83,1],[83,2],[83,3],[83,1],[83,1],[83,2],[83,3],[78,3],[78,1],[84,2],[84,1],[90,4],[93,1],[93,2],[93,3],[93,2],[93,3],[93,4],[93,5],[93,1],[93,2],[93,3],[91,1],[91,2],[95,0],[95,1],[95,1],[95,2],[95,1],[95,2],[95,1],[95,2],[95,1],[95,1],[95,1],[94,2],[94,2],[94,0],[59,0],[59,2],[60,0],[60,4],[112,1],[112,3],[114,5],[114,4],[114,4],[114,1],[113,0],[113,2],[63,0],[63,2],[63,3],[63,2],[63,2],[61,0],[61,3],[124,1],[124,3],[125,1],[125,2],[125,3],[125,4],[62,0],[62,3],[130,0],[130,2],[67,3],[67,1],[132,3],[132,2],[132,3],[132,2],[132,3],[132,2],[132,1],[135,5],[135,3],[135,1],[137,5],[137,3],[137,1],[106,1],[106,1],[106,1],[106,1],[106,1],[106,1],[106,1],[106,1],[106,1],[106,1],[106,1],[106,1],[106,1],[106,1],[106,1],[146,2],[146,2],[144,6],[144,6],[144,8],[151,1],[151,1],[151,1],[151,1],[151,1],[151,1],[138,4],[152,1],[152,1],[152,1],[152,1],[152,1],[152,1],[152,1],[152,1],[152,1],[79,4],[79,3],[162,1],[162,3],[76,1],[140,1],[140,1],[134,1],[141,1],[142,4],[80,2],[80,2],[80,1],[80,1],[143,5],[143,4],[173,2],[173,1],[176,4],[174,2],[174,0],[139,3],[139,3],[139,3],[139,3],[139,3],[139,3],[139,3],[139,3],[139,5],[139,3],[139,3],[139,3],[139,3],[139,3],[139,3],[139,3],[139,3],[139,3],[139,3],[139,3],[139,6],[139,6],[139,3],[139,3],[139,2],[139,2],[139,3],[139,5],[139,6],[139,5],[139,6],[139,3],[139,3],[196,1],[196,1],[196,1],[196,1],[196,1],[196,1],[197,1],[197,1],[197,1],[40,6],[40,4],[208,1],[208,3],[209,3],[21,5],[21,3],[27,5],[27,5],[27,8],[27,4],[27,7],[213,3],[213,1],[213,1],[213,5],[213,3],[213,3],[215,1],[215,3],[216,1],[216,1],[216,1],[216,1],[216,1],[216,1],[108,1],[108,3],[19,8],[19,4],[19,6],[222,0],[222,1],[223,2],[223,1],[224,1],[224,3],[224,3],[224,3],[228,0],[228,1],[228,1],[220,0],[220,3],[221,3],[221,1],[221,2],[233,1],[233,3],[234,2],[234,2],[234,2],[234,2],[235,0],[235,2],[236,5],[237,11],[246,0],[246,2],[247,4],[248,4],[238,1],[239,5],[239,5],[243,1],[243,3],[232,1],[232,3],[252,3],[252,2],[149,6],[149,4],[149,1],[149,4],[253,0],[253,1],[256,2],[256,1],[257,2],[257,7],[257,1],[257,6],[257,2],[257,2],[25,4],[260,0],[260,2],[15,6],[15,6],[15,6],[15,8],[15,6],[28,5],[16,4],[16,7],[16,6],[16,9],[22,3],[17,4],[17,6],[17,9],[269,0],[269,2],[39,3],[39,2],[23,4],[23,5],[18,8],[18,9],[24,3],[32,2],[32,4],[32,3],[32,5],[34,2],[34,4],[34,4],[34,6],[31,4],[31,6],[33,4],[33,6],[30,4],[30,6],[20,5],[20,8],[26,3],[276,1],[276,3],[48,5],[49,2],[51,2],[50,4],[283,1],[283,1],[283,1],[283,1],[283,2],[283,2],[41,2],[41,1],[42,1],[43,2],[44,2],[44,2],[44,4],[145,4],[145,2],[145,2],[145,2],[145,2],[145,1],[145,2],[145,2],[295,1],[295,1],[296,1],[296,1],[296,1],[296,1],[296,1],[296,1],[296,1],[296,3],[292,3],[292,4],[292,2],[294,2],[294,3],[294,1],[298,3],[298,1],[302,3],[302,3],[302,3],[300,3],[300,1],[45,3],[304,1],[304,1],[36,1],[36,2],[37,1],[37,2],[35,1],[35,2],[46,1],[46,2],[47,1],[47,2]],performAction:function anonymous(yytext,yyleng,yylineno,yy,yystate,$$,_$){var $0=$$.length-1;switch(yystate){case 1:if(yy.casesensitive)this.$=$$[$0];else this.$=$$[$0].toLowerCase();break;case 2:this.$=doubleq($$[$0].substr(1,$$[$0].length-2));break;case 3:return new yy.Statements({statements:$$[$0-1]});break;case 4:this.$=$$[$0-2];if($$[$0])$$[$0-2].push($$[$0]);break;case 5:case 6:case 70:case 87:case 119:case 134:case 145:case 197:case 212:case 260:case 271:case 272:case 276:case 284:case 322:case 434:this.$=[$$[$0]];break;case 7:this.$=$$[$0];$$[$0].explain=true;break;case 8:this.$=$$[$0];$$[$0].explain=true;break;case 9:case 62:case 69:case 114:case 115:case 117:case 125:case 127:case 132:case 140:case 142:case 297:case 300:case 315:case 316:case 343:this.$=null;break;case 47:case 48:case 77:case 124:case 152:case 159:case 160:case 161:case 162:case 163:case 164:case 165:case 166:case 167:case 168:case 169:case 170:case 171:case 173:case 179:case 180:case 181:case 182:case 183:case 184:case 214:case 249:case 250:case 251:case 252:case 253:case 254:case 312:case 333:case 335:case 408:case 409:case 410:case 411:case 412:case 413:case 417:case 419:case 420:case 429:this.$=$$[$0];break;case 49:this.$=$$[$0];break;case 51:yy.extend(this.$,$$[$0-7]);yy.extend(this.$,$$[$0-6]);yy.extend(this.$,$$[$0-5]);yy.extend(this.$,$$[$0-4]);yy.extend(this.$,$$[$0-3]);yy.extend(this.$,$$[$0-2]);yy.extend(this.$,$$[$0-1]);yy.extend(this.$,$$[$0]);this.$=$$[$0-7];if(yy.exists)this.$.exists=yy.exists;delete yy.exists;if(yy.queries)this.$.queries=yy.queries;delete yy.queries;break;case 52:this.$=new yy.Select({columns:$$[$0],distinct:true});yy,extend(this.$,$$[$0-3]);yy.extend(this.$,$$[$0-1]);break;case 53:this.$=new yy.Select({columns:$$[$0],distinct:true});yy,extend(this.$,$$[$0-3]);yy.extend(this.$,$$[$0-1]);break;case 54:this.$=new yy.Select({columns:$$[$0],all:true});yy,extend(this.$,$$[$0-3]);yy.extend(this.$,$$[$0-1]);break;case 55:this.$=new yy.Select({columns:$$[$0]});yy,extend(this.$,$$[$0-2]);yy.extend(this.$,$$[$0-1]);break;case 56:this.$=null;break;case 57:this.$={modifier:"VALUE"};break;case 58:this.$={modifier:"ROW"};break;case 59:this.$={modifier:"COLUMN"};break;case 60:this.$={modifier:"MATRIX"};break;case 61:this.$={top:$$[$0]};break;case 63:case 332:this.$=null;break;case 64:case 65:case 66:this.$={into:$$[$0]};break;case 67:this.$={from:$$[$0]};break;case 68:this.$={from:[$$[$0-1]],joins:$$[$0]};break;case 71:case 120:case 261:case 323:this.$=$$[$0-2];$$[$0-2].push($$[$0]);break;case 72:this.$=$$[$0-2];this.$.as=$$[$0];break;case 73:this.$=$$[$0-3];this.$.as=$$[$0];break;case 74:this.$=$$[$0-1];this.$.as="default";break;case 75:this.$=$$[$0-1];$$[$0-1].as=$$[$0];break;case 76:this.$=$$[$0-2];$$[$0-2].as=$$[$0];break;case 78:case 82:this.$=$$[$0-1];$$[$0-1].as=$$[$0];break;case 79:case 83:this.$=$$[$0-2];$$[$0-2].as=$$[$0];break;case 80:case 81:this.$=$$[$0];$$[$0].as="default";break;case 84:this.$=new yy.Table({databaseid:$$[$0-2],tableid:$$[$0]});break;case 85:this.$=new yy.Table({tableid:$$[$0]});break;case 86:this.$=$$[$0-1];$$[$0-1].push($$[$0]);break;case 88:this.$=new yy.Join($$[$0-3]);yy.extend(this.$,$$[$0-1]);yy.extend(this.$,$$[$0]);break;case 89:this.$={table:$$[$0]};break;case 90:this.$={table:$$[$0-1],as:$$[$0]};break;case 91:this.$={table:$$[$0-2],as:$$[$0]};break;case 92:this.$={param:$$[$0-1],as:$$[$0]};break;case 93:this.$={param:$$[$0-2],as:$$[$0]};break;case 94:this.$={select:$$[$0-3],as:$$[$0]};break;case 95:this.$={select:$$[$0-4],as:$$[$0]};break;case 96:this.$={func:$$[$0],as:"default"};break;case 97:this.$={func:$$[$0-1],as:$$[$0]};break;case 98:this.$={func:$$[$0-2],as:$$[$0]};break;case 99:this.$={joinmode:$$[$0]};break;case 100:this.$={joinmode:$$[$0-1],natural:true};break;case 101:case 102:this.$="INNER";break;case 103:case 104:this.$="LEFT";break;case 105:case 106:this.$="RIGHT";break;case 107:case 108:this.$="OUTER";break;case 109:this.$="SEMI";break;case 110:this.$="ANTI";break;case 111:this.$="CROSS";break;case 112:this.$={on:$$[$0]};break;case 113:this.$={using:$$[$0]};break;case 116:this.$={where:new yy.Expression({expression:$$[$0]})};break;case 118:this.$={group:$$[$0-1]};yy.extend(this.$,$$[$0]);break;case 121:this.$=new yy.GroupExpression({type:"GROUPING SETS",group:$$[$0-1]});break;case 122:this.$=new yy.GroupExpression({type:"ROLLUP",group:$$[$0-1]});break;case 123:this.$=new yy.GroupExpression({type:"CUBE",group:$$[$0-1]});break;case 126:this.$={having:$$[$0]};break;case 128:this.$={union:$$[$0]};break;case 129:this.$={unionall:$$[$0]};break;case 130:this.$={except:$$[$0]};break;case 131:this.$={intersect:$$[$0]};break;case 133:this.$={order:$$[$0]};break;case 135:this.$=$$[$0-2];$$[$0-2].push($$[$0]);break;case 136:this.$=new yy.OrderExpression({expression:$$[$0],direction:"ASC"});break;case 137:this.$=new yy.OrderExpression({expression:$$[$0-1],direction:$$[$0].toUpperCase()});break;case 138:this.$=new yy.OrderExpression({expression:$$[$0-2],direction:"ASC",nocase:true});break;case 139:this.$=new yy.OrderExpression({expression:$$[$0-3],direction:$$[$0].toUpperCase(),nocase:true});break;case 141:this.$={limit:$$[$0-1]};yy.extend(this.$,$$[$0]);break;case 143:this.$={offset:$$[$0]};break;case 144:case 306:case 325:case 433:$$[$0-2].push($$[$0]);this.$=$$[$0-2];break;case 146:case 148:case 150:$$[$0-2].as=$$[$0];this.$=$$[$0-2];break;case 147:case 149:case 151:$$[$0-1].as=$$[$0];this.$=$$[$0-1];break;case 153:this.$=new yy.Column({columid:$$[$0],tableid:$$[$0-2],databaseid:$$[$0-4]});break;case 154:this.$=new yy.Column({columnid:$$[$0],tableid:$$[$0-2]});break;case 155:this.$=new yy.Column({columnid:$$[$0]});break;case 156:this.$=new yy.Column({columnid:$$[$0],tableid:$$[$0-2],databaseid:$$[$0-4]});break;case 157:this.$=new yy.Column({columnid:$$[$0],tableid:$$[$0-2]});break;case 158:this.$=new yy.Column({columnid:$$[$0]});break;case 172:this.$=new yy.Json({value:$$[$0]});break;case 174:this.$=new yy.FuncValue({funcid:$$[$0],newid:true});break;case 175:this.$=$$[$0];yy.extend(this.$,{newid:true});break;case 176:this.$=new yy.Cast({expression:$$[$0-3]});yy.extend(this.$,$$[$0-1]);break;case 177:this.$=new yy.Cast({expression:$$[$0-1]});yy.extend(this.$,$$[$0-3]);break;case 178:this.$=new yy.Cast({expression:$$[$0-3],style:$$[$0-1]});yy.extend(this.$,$$[$0-5]);break;case 185:this.$=new yy.AggrValue({aggregatorid:$$[$0-3].toUpperCase(),expression:$$[$0-1]});break;case 186:this.$="SUM";break;case 187:this.$="COUNT";break;case 188:this.$="MIN";break;case 189:this.$="MAX";break;case 190:this.$="AVG";break;case 191:this.$="FIRST";break;case 192:this.$="LAST";break;case 193:this.$="AGGR";break;case 194:this.$="ARRAY";break;case 195:this.$=new yy.FuncValue({funcid:$$[$0-3],args:$$[$0-1]});break;case 196:this.$=new yy.FuncValue({funcid:$$[$0-2]});break;case 198:$$[$0-2].push($$[$0]);this.$=$$[$0-2];break;case 199:this.$=new yy.NumValue({value:+$$[$0]});break;case 200:this.$=new yy.LogicValue({value:true});break;case 201:this.$=new yy.LogicValue({value:false});break;case 202:this.$=new yy.StringValue({value:$$[$0].substr(1,$$[$0].length-2).replace(/(\\\')/g,"'").replace(/(\'\')/g,"'")});break;case 203:this.$=new yy.NullValue({value:null});break;case 204:if(!yy.exists)yy.exists=[];this.$=new yy.ExistsValue({value:$$[$0-1],existsidx:yy.exists.length});yy.exists.push($$[$0-1]);break;case 205:case 206:this.$=new yy.ParamValue({param:$$[$0]});break;case 207:if(typeof yy.question=="undefined")yy.question=0;this.$=new yy.ParamValue({param:yy.question++});break;case 208:if(typeof yy.question=="undefined")yy.question=0;this.$=new yy.ParamValue({param:yy.question++,array:true});break;case 209:this.$=new yy.CaseValue({expression:$$[$0-3],whens:$$[$0-2],elses:$$[$0-1]});break;case 210:this.$=new yy.CaseValue({whens:$$[$0-2],elses:$$[$0-1]});break;case 211:this.$=$$[$0-1];this.$.push($$[$0]);break;case 213:this.$={when:$$[$0-2],then:$$[$0]};break;case 215:case 317:case 318:this.$=null;break;case 216:this.$=new yy.Op({left:$$[$0-2],op:"LIKE",right:$$[$0]});break;case 217:this.$=new yy.Op({left:$$[$0-2],op:"+",right:$$[$0]});break;case 218:this.$=new yy.Op({left:$$[$0-2],op:"-",right:$$[$0]});break;case 219:this.$=new yy.Op({left:$$[$0-2],op:"*",right:$$[$0]});break;case 220:this.$=new yy.Op({left:$$[$0-2],op:"/",right:$$[$0]});break;case 221:this.$=new yy.Op({left:$$[$0-2],op:"%",right:$$[$0]});break;case 222:case 223:case 225:this.$=new yy.Op({left:$$[$0-2],op:"->",right:$$[$0]});break;case 224:this.$=new yy.Op({left:$$[$0-4],op:"->",right:$$[$0-1]});break;case 226:this.$=new yy.Op({left:$$[$0-2],op:">",right:$$[$0]});break;case 227:this.$=new yy.Op({left:$$[$0-2],op:">=",right:$$[$0]});break;case 228:this.$=new yy.Op({left:$$[$0-2],op:"<",right:$$[$0]});break;case 229:this.$=new yy.Op({left:$$[$0-2],op:"<=",right:$$[$0]});break;case 230:this.$=new yy.Op({left:$$[$0-2],op:"=",right:$$[$0]});break;case 231:this.$=new yy.Op({left:$$[$0-2],op:"==",right:$$[$0]});break;case 232:this.$=new yy.Op({left:$$[$0-2],op:"===",right:$$[$0]});break;case 233:this.$=new yy.Op({left:$$[$0-2],op:"!=",right:$$[$0]});break;case 234:this.$=new yy.Op({left:$$[$0-2],op:"!==",right:$$[$0]});break;case 235:this.$=new yy.Op({left:$$[$0-2],op:"!===",right:$$[$0]});break;case 236:if(!yy.queries)yy.queries=[];this.$=new yy.Op({left:$$[$0-5],op:$$[$0-4],allsome:$$[$0-3],right:$$[$0-1],queriesidx:yy.queries.length});yy.queries.push($$[$0-1]);break;case 237:this.$=new yy.Op({left:$$[$0-5],op:$$[$0-4],allsome:$$[$0-3],right:$$[$0-1]});break;case 238:this.$=new yy.Op({left:$$[$0-2],op:"AND",right:$$[$0]});break;case 239:this.$=new yy.Op({left:$$[$0-2],op:"OR",right:$$[$0]});break;case 240:this.$=new yy.UniOp({op:"NOT",right:$$[$0]});break;case 241:this.$=new yy.UniOp({op:"-",right:$$[$0]});break;case 242:this.$=new yy.UniOp({right:$$[$0-1]});break;case 243:if(!yy.queries)yy.queries=[];this.$=new yy.Op({left:$$[$0-4],op:"IN",right:$$[$0-1],queriesidx:yy.queries.length});yy.queries.push($$[$0-1]);break;case 244:if(!yy.queries)yy.queries=[];this.$=new yy.Op({left:$$[$0-5],op:"NOT IN",right:$$[$0-1],queriesidx:yy.queries.length});yy.queries.push($$[$0-1]);break;case 245:this.$=new yy.Op({left:$$[$0-4],op:"IN",right:$$[$0-1]});break;case 246:this.$=new yy.Op({left:$$[$0-5],op:"NOT IN",right:$$[$0-1]});break;case 247:this.$=new yy.Op({left:$$[$0-2],op:"BETWEEN",right:$$[$0]});break;case 248:this.$=new yy.Op({left:$$[$0-2],op:"NOT BETWEEN",right:$$[$0]});break;case 255:this.$="ALL";break;case 256:this.$="SOME";break;case 257:this.$="ANY";break;case 258:this.$=new yy.Update({table:$$[$0-4],columns:$$[$0-2],where:$$[$0]});break;case 259:this.$=new yy.Update({table:$$[$0-2],columns:$$[$0]});break;case 262:this.$=new yy.SetColumn({columnid:$$[$0-2],expression:$$[$0]});break;case 263:this.$=new yy.Delete({table:$$[$0-2],where:$$[$0]});break;case 264:this.$=new yy.Delete({table:$$[$0]});break;case 265:this.$=new yy.Insert({into:$$[$0-2],values:$$[$0]});break;case 266:this.$=new yy.Insert({into:$$[$0-2],"default":true});break;case 267:this.$=new yy.Insert({into:$$[$0-5],columns:$$[$0-3],values:$$[$0]});break;case 268:this.$=new yy.Insert({into:$$[$0-1],select:$$[$0]});break;case 269:this.$=new yy.Insert({into:$$[$0-4],columns:$$[$0-2],select:$$[$0]});break;case 270:this.$=[$$[$0-1]];break;case 273:this.$=$$[$0-4];$$[$0-4].push($$[$0-1]);break;case 274:case 275:case 277:case 285:this.$=$$[$0-2];$$[$0-2].push($$[$0]);break;case 286:this.$=new yy.CreateTable({table:$$[$0-4]});yy.extend(this.$,$$[$0-5]);yy.extend(this.$,$$[$0-2]);break;case 287:this.$=new yy.CreateTable({table:new yy.Table({tableid:$$[$0]})});break;case 288:this.$=new yy.CreateTable({table:new yy.Table({tableid:$$[$0],databaseid:$$[$0-2]})});break;case 298:case 299:this.$={temporary:true};break;case 301:this.$={ifnotexists:true};break;case 302:this.$={columns:$$[$0-2],constraints:$$[$0]};break;case 303:this.$={columns:$$[$0]};break;case 304:this.$={as:$$[$0]};break;case 305:case 324:this.$=[$$[$0]];break;case 307:case 308:case 309:case 310:$$[$0].constraintid=$$[$0-1];this.$=$$[$0];break;case 311:this.$=null;break;case 313:this.$={type:"PRIMARY KEY",columns:$$[$0-1]};break;case 314:this.$={type:"FOREIGN KEY",columns:$$[$0-7],fktableid:$$[$0-4],fkcolumns:$$[$0-2]};break;case 326:this.$=new yy.ColumnDef({columnid:$$[$0-2]});yy.extend(this.$,$$[$0-1]);yy.extend(this.$,$$[$0]);break;case 327:this.$=new yy.ColumnDef({columnid:$$[$0-1]});yy.extend(this.$,$$[$0]);break;case 328:this.$={dbtypeid:$$[$0-5],dbsize:$$[$0-3],dbprecision:$$[$0-1]};break;case 329:this.$={dbtypeid:$$[$0-3],dbsize:$$[$0-1]};break;case 330:this.$={dbtypeid:$$[$0]};break;case 331:this.$={dbtypeid:"ENUM",enumvalues:$$[$0-1]};break;case 334:yy.extend($$[$0-1],$$[$0]);this.$=$$[$0-1];break;case 336:this.$={primarykey:true};break;case 337:this.$={foreignkey:{tableid:$$[$0-3],columnid:$$[$0-1]}};break;case 338:this.$={auto_increment:true};break;case 339:this.$={identity:[$$[$0-3],$$[$0-1]]};break;case 340:this.$={"default":$$[$0]};break;case 341:this.$={notnull:true};break;case 342:this.$=new yy.DropTable({table:$$[$0]});yy.extend(this.$,$$[$0-1]);break;case 344:this.$={ifexists:true};break;case 345:this.$=new yy.AlterTable({table:$$[$0-3],renameto:$$[$0]});break;case 346:this.$=new yy.AlterTable({table:$$[$0-3],addcolumn:$$[$0]});break;case 347:this.$=new yy.AlterTable({table:$$[$0-3],modifycolumn:$$[$0]});break;case 348:this.$=new yy.AlterTable({table:$$[$0-5],renamecolumn:$$[$0-2],to:$$[$0]});break;case 349:this.$=new yy.AlterTable({table:$$[$0-3],dropcolumn:$$[$0]});break;case 350:this.$=new yy.AlterTable({table:$$[$0-2],renameto:$$[$0]});break;case 351:this.$=new yy.AttachDatabase({databaseid:$$[$0],engineid:$$[$0-2].toUpperCase()});break;case 352:this.$=new yy.AttachDatabase({databaseid:$$[$0-3],engineid:$$[$0-5].toUpperCase(),args:$$[$0-1]});break;case 353:this.$=new yy.AttachDatabase({databaseid:$$[$0-2],engineid:$$[$0-4].toUpperCase(),as:$$[$0]});break;case 354:this.$=new yy.AttachDatabase({databaseid:$$[$0-5],engineid:$$[$0-7].toUpperCase(),as:$$[$0],args:$$[$0-3]});break;case 355:this.$=new yy.DetachDatabase({databaseid:$$[$0]});break;case 356:this.$=new yy.CreateDatabase({databaseid:$$[$0]});yy.extend(this.$,$$[$0]);break;case 357:this.$=new yy.CreateDatabase({engineid:$$[$0-4].toUpperCase(),databaseid:$$[$0-1],as:$$[$0]});yy.extend(this.$,$$[$0-2]);break;case 358:this.$=new yy.CreateDatabase({engineid:$$[$0-7].toUpperCase(),databaseid:$$[$0-4],args:$$[$0-2],as:$$[$0]});yy.extend(this.$,$$[$0-5]);break;case 359:this.$=null;break;case 360:case 404:case 422:case 425:this.$=$$[$0-1];break;case 361:case 362:this.$=new yy.UseDatabase({databaseid:$$[$0]});break;case 363:this.$=new yy.DropDatabase({databaseid:$$[$0]});yy.extend(this.$,$$[$0-1]);break;case 364:this.$=new yy.DropDatabase({databaseid:$$[$0],engineid:$$[$0-3].toUpperCase()});yy.extend(this.$,$$[$0-1]);break;case 365:this.$=new yy.CreateIndex({indexid:$$[$0-5],table:$$[$0-3],columns:$$[$0-1]});break;case 366:this.$=new yy.CreateIndex({indexid:$$[$0-5],table:$$[$0-3],columns:$$[$0-1],unique:true});break;case 367:this.$=new yy.DropIndex({indexid:$$[$0]});break;case 368:this.$=new yy.ShowDatabases;break;case 369:this.$=new yy.ShowDatabases({like:$$[$0]});break;case 370:this.$=new yy.ShowDatabases({engineid:$$[$0-1].toUpperCase()});break;case 371:this.$=new yy.ShowDatabases({engineid:$$[$0-3].toUpperCase(),like:$$[$0]});break;case 372:this.$=new yy.ShowTables;break;case 373:this.$=new yy.ShowTables({like:$$[$0]});break;case 374:this.$=new yy.ShowTables({databaseid:$$[$0]});break;case 375:this.$=new yy.ShowTables({like:$$[$0],databaseid:$$[$0-2]});break;case 376:this.$=new yy.ShowColumns({table:$$[$0]});break;case 377:this.$=new yy.ShowColumns({table:$$[$0-2],databaseid:$$[$0]});break;case 378:this.$=new yy.ShowIndex({table:$$[$0]});break;case 379:this.$=new yy.ShowIndex({table:$$[$0-2],databaseid:$$[$0]});break;case 380:this.$=new yy.ShowCreateTable({table:$$[$0]});break;case 381:this.$=new yy.ShowCreateTable({table:$$[$0-2],databaseid:$$[$0]});break;case 382:this.$=new yy.CreateView({view:$$[$0-2],select:$$[$0]});break;case 383:this.$=new yy.CreateView({view:$$[$0-5],columns:$$[$0-3],select:$$[$0-3]});break;case 384:this.$=new yy.DropView({view:$$[$0-1]});break;case 385:this.$=new yy.View({viewid:$$[$0]});break;case 386:this.$=new yy.View({databaseid:$$[$0-2],viewid:$$[$0]});break;case 387:this.$=new yy.DeclareCursor({cursorid:$$[$0-3],select:$$[$0]});break;case 388:this.$=new yy.OpenCursor({cursorid:$$[$0]});break;case 389:this.$=new yy.CloseCursor({cursorid:$$[$0]});break;case 390:this.$=new yy.FetchCursor({cursorid:$$[$0]});yy.extend(this.$,$$[$0-2]);break;case 391:this.$={direction:"NEXT"};break;case 392:this.$={direction:"PRIOR"};break;case 393:this.$={direction:"FIRST"};break;case 394:this.$={direction:"LAST"};break;case 395:this.$={direction:"ABSOLUTE",num:$$[$0]};break;case 396:this.$={direction:"RELATIVE",num:$$[$0]};break;case 397:this.$=new yy.Help({subject:$$[$0].value.toUpperCase()});break;case 398:this.$=new yy.Help;break;case 399:this.$=new yy.ExpressionStatement({expression:$$[$0]});break;case 400:this.$=new yy.Source({url:$$[$0].value});break;case 401:this.$=new yy.Assert({value:$$[$0]});
break;case 402:this.$=new yy.Assert({value:$$[$0].value});break;case 403:this.$=new yy.Assert({value:$$[$0],message:$$[$0-2]});break;case 405:case 416:case 418:this.$=$$[$0].value;break;case 406:case 414:this.$=+$$[$0].value;break;case 407:this.$=!!$$[$0].value;break;case 415:this.$=""+$$[$0].value;break;case 421:this.$=$$[$0-1];break;case 423:case 426:this.$=$$[$0-2];break;case 424:this.$={};break;case 427:this.$=[];break;case 428:yy.extend($$[$0-2],$$[$0]);this.$=$$[$0-2];break;case 430:this.$={};this.$[$$[$0-2].substr(1,$$[$0-2].length-2)]=$$[$0];break;case 431:case 432:this.$={};this.$[$$[$0-2]]=$$[$0];break;case 435:this.$=new yy.SetVariable({autocommit:$$[$0]});break;case 436:this.$=true;break;case 437:this.$=false;break;case 438:case 439:this.$=new yy.Commit;break;case 440:case 441:this.$=new yy.Rollback;break;case 442:case 443:this.$=new yy.Begin;break;case 444:this.$=new yy.Store;break;case 445:this.$=new yy.Store({databaseid:$$[$0]});break;case 446:this.$=new yy.Restore;break;case 447:this.$=new yy.Restore({databaseid:$$[$0]});break}},table:[o($V0,$V1,{6:1,7:2,10:3,11:4,15:5,16:6,17:7,18:8,19:9,20:10,21:11,22:12,23:13,24:14,25:15,26:16,27:17,28:18,29:19,30:20,31:21,32:22,33:23,34:24,35:25,36:26,37:27,39:29,40:30,41:31,42:32,43:33,44:34,45:35,46:36,47:37,48:38,49:39,50:40,51:41,56:51,106:59,64:69,138:70,79:71,139:72,137:73,135:74,76:75,140:76,134:77,141:78,80:79,142:80,143:81,144:82,145:83,146:84,152:86,3:87,292:106,4:$V2,5:$V3,12:[1,42],38:$V4,70:$V5,86:$V6,133:$V7,136:$V8,147:$V9,148:$Va,150:$Vb,153:$Vc,154:$Vd,155:$Ve,156:$Vf,157:$Vg,158:$Vh,159:$Vi,160:$Vj,161:$Vk,163:$Vl,164:$Vm,165:$Vn,166:$Vo,167:$Vp,168:$Vq,169:$Vr,170:$Vs,171:$Vt,172:$Vu,182:$Vv,200:$Vw,206:$Vx,207:$Vy,210:$Vz,211:$VA,218:$VB,259:$VC,261:$VD,262:$VE,266:$VF,268:$VG,270:$VH,271:$VI,277:$VJ,280:$VK,281:$VL,282:$VM,288:$VN,289:$VO,290:$VP,291:$VQ,293:$VR,297:$VS,306:$VT,308:$VU,309:$VV,310:$VW,311:$VX}),{1:[3]},{8:[1,121],9:[1,122]},o($V0,[2,5]),o($V0,[2,6]),o($V0,[2,10]),o($V0,[2,11]),o($V0,[2,12]),o($V0,[2,13]),o($V0,[2,14]),o($V0,[2,15]),o($V0,[2,16]),o($V0,[2,17]),o($V0,[2,18]),o($V0,[2,19]),o($V0,[2,20]),o($V0,[2,21]),o($V0,[2,22]),o($V0,[2,23]),o($V0,[2,24]),o($V0,[2,25]),o($V0,[2,26]),o($V0,[2,27]),o($V0,[2,28]),o($V0,[2,29]),o($V0,[2,30]),o($V0,[2,31]),o($V0,[2,32]),o($V0,[2,33]),o($V0,[2,34]),o($V0,[2,35]),o($V0,[2,36]),o($V0,[2,37]),o($V0,[2,38]),o($V0,[2,39]),o($V0,[2,40]),o($V0,[2,41]),o($V0,[2,42]),o($V0,[2,43]),o($V0,[2,44]),o($V0,[2,45]),o($V0,[2,46]),o($V0,$V1,{15:5,16:6,17:7,18:8,19:9,20:10,21:11,22:12,23:13,24:14,25:15,26:16,27:17,28:18,29:19,30:20,31:21,32:22,33:23,34:24,35:25,36:26,37:27,39:29,40:30,41:31,42:32,43:33,44:34,45:35,46:36,47:37,48:38,49:39,50:40,51:41,56:51,106:59,64:69,138:70,79:71,139:72,137:73,135:74,76:75,140:76,134:77,141:78,80:79,142:80,143:81,144:82,145:83,146:84,152:86,3:87,292:106,10:123,4:$V2,5:$V3,13:[1,124],38:$V4,70:$V5,86:$V6,133:$V7,136:$V8,147:$V9,148:$Va,150:$Vb,153:$Vc,154:$Vd,155:$Ve,156:$Vf,157:$Vg,158:$Vh,159:$Vi,160:$Vj,161:$Vk,163:$Vl,164:$Vm,165:$Vn,166:$Vo,167:$Vp,168:$Vq,169:$Vr,170:$Vs,171:$Vt,172:$Vu,182:$Vv,200:$Vw,206:$Vx,207:$Vy,210:$Vz,211:$VA,218:$VB,259:$VC,261:$VD,262:$VE,266:$VF,268:$VG,270:$VH,271:$VI,277:$VJ,280:$VK,281:$VL,282:$VM,288:$VN,289:$VO,290:$VP,291:$VQ,293:$VR,297:$VS,306:$VT,308:$VU,309:$VV,310:$VW,311:$VX}),{219:[1,125]},{3:126,4:$V2,5:$V3},{3:128,4:$V2,5:$V3,68:[1,130],219:[1,131],251:[1,129],267:[1,127],275:[1,132]},{81:[1,133]},{267:[1,134]},{3:136,4:$V2,5:$V3,219:[1,138],251:[1,137],267:[1,135],275:[1,139]},{77:[1,140]},{219:[1,141]},o($VY,[2,63],{57:142,77:[1,143]}),{3:147,4:$V2,5:$V3,218:[1,144],251:[1,148],272:[1,146],273:[1,149],274:[1,145]},o($V0,[2,442],{307:[1,150]}),o($V0,[2,438],{307:[1,151]}),o($V0,[2,440],{307:[1,152]}),{3:154,4:$V2,5:$V3,267:[1,153]},{3:156,4:$V2,5:$V3,78:155},o($V0,[2,398],{134:157,165:$Vn}),o($V0,[2,399],{196:175,136:$VZ,180:$V_,181:$V$,182:$V01,183:$V11,184:$V21,185:$V31,186:$V41,187:$V51,188:$V61,189:$V71,190:$V81,191:$V91,192:$Va1,193:$Vb1,194:$Vc1,195:$Vd1,198:$Ve1,199:$Vf1,200:$Vg1,201:$Vh1,202:$Vi1,203:$Vj1}),{134:182,165:$Vn},{3:192,4:$V2,5:$V3,76:186,79:191,80:190,133:$V7,134:187,140:188,141:189,145:183,151:184,163:$Vl,164:$Vm,165:[1,185],166:$Vo,168:$Vq,169:$Vr,170:$Vs,171:$Vt,291:$VQ,292:106,293:$VR,297:$VS},{303:[1,193]},o($V0,[2,444],{3:194,4:$V2,5:$V3}),o($V0,[2,446],{3:195,4:$V2,5:$V3}),{3:196,4:$V2,5:$V3},{3:197,4:$V2,5:$V3},{158:[1,201],159:[1,202],283:198,284:[1,199],285:[1,200],286:[1,203],287:[1,204]},{3:205,4:$V2,5:$V3},o($Vk1,$Vl1,{66:209,65:[1,206],68:[1,207],69:[1,208],75:$Vm1}),o($Vn1,[2,159]),o($Vn1,[2,160]),o($Vn1,[2,161]),o($Vn1,[2,162]),o($Vn1,[2,163]),o($Vn1,[2,164]),o($Vn1,[2,165]),o($Vn1,[2,166]),o($Vn1,[2,167]),o($Vn1,[2,168]),o($Vn1,[2,169]),o($Vn1,[2,170]),o($Vn1,[2,171]),o($Vn1,[2,172]),o($Vn1,[2,173]),o($Vo1,[2,56],{71:[1,211],72:[1,212],73:[1,213],74:[1,214]}),{86:[1,215]},o($Vn1,$Vp1,{86:$Vq1,89:[1,217]}),{3:87,4:$V2,5:$V3,76:75,79:71,80:79,86:$V6,106:218,133:$V7,134:77,135:74,136:$V8,137:73,138:70,139:72,140:76,141:78,142:80,143:81,144:82,145:83,146:84,147:$V9,148:$Va,150:$Vb,152:86,153:$Vc,154:$Vd,155:$Ve,156:$Vf,157:$Vg,158:$Vh,159:$Vi,160:$Vj,161:$Vk,163:$Vl,164:$Vm,165:$Vn,166:$Vo,167:$Vp,168:$Vq,169:$Vr,170:$Vs,171:$Vt,172:$Vu,182:$Vv,200:$Vw,291:$VQ,292:106,293:$VR,297:$VS},{3:87,4:$V2,5:$V3,76:75,79:71,80:79,86:$V6,106:219,133:$V7,134:77,135:74,136:$V8,137:73,138:70,139:72,140:76,141:78,142:80,143:81,144:82,145:83,146:84,147:$V9,148:$Va,150:$Vb,152:86,153:$Vc,154:$Vd,155:$Ve,156:$Vf,157:$Vg,158:$Vh,159:$Vi,160:$Vj,161:$Vk,163:$Vl,164:$Vm,165:$Vn,166:$Vo,167:$Vp,168:$Vq,169:$Vr,170:$Vs,171:$Vt,172:$Vu,182:$Vv,200:$Vw,291:$VQ,292:106,293:$VR,297:$VS},{3:87,4:$V2,5:$V3,76:75,79:71,80:79,86:$V6,106:220,133:$V7,134:77,135:74,136:$V8,137:73,138:70,139:72,140:76,141:78,142:80,143:81,144:82,145:83,146:84,147:$V9,148:$Va,150:$Vb,152:86,153:$Vc,154:$Vd,155:$Ve,156:$Vf,157:$Vg,158:$Vh,159:$Vi,160:$Vj,161:$Vk,163:$Vl,164:$Vm,165:$Vn,166:$Vo,167:$Vp,168:$Vq,169:$Vr,170:$Vs,171:$Vt,172:$Vu,182:$Vv,200:$Vw,291:$VQ,292:106,293:$VR,297:$VS},o($Vn1,[2,155]),o([4,5,8,9,77,81,85,86,87,88,92,96,97,98,99,100,101,102,103,104,109,110,119,120,121,122,123,126,127,129,131,133,136,147,148,150,153,154,155,156,157,158,159,160,161,163,164,165,166,167,168,169,170,171,172,175,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,198,199,200,201,202,203,214,225,226,227,241,244,258,291,293,297,299,301],[2,199]),o($Vr1,[2,200]),o($Vr1,[2,201]),o($Vr1,$Vs1),o($Vr1,[2,203]),{3:221,4:$V2,5:$V3},{3:222,4:$V2,5:$V3},o($Vr1,[2,207]),o($Vr1,[2,208]),{86:[1,223]},{3:87,4:$V2,5:$V3,76:75,79:71,80:79,86:$V6,106:224,133:$V7,134:77,135:74,136:$V8,137:73,138:70,139:72,140:76,141:78,142:80,143:81,144:82,145:83,146:84,147:$V9,148:$Va,150:$Vb,152:86,153:$Vc,154:$Vd,155:$Ve,156:$Vf,157:$Vg,158:$Vh,159:$Vi,160:$Vj,161:$Vk,163:$Vl,164:$Vm,165:$Vn,166:$Vo,167:$Vp,168:$Vq,169:$Vr,170:$Vs,171:$Vt,172:$Vu,173:225,176:226,177:$Vt1,182:$Vv,200:$Vw,291:$VQ,292:106,293:$VR,297:$VS},{86:[1,228]},{86:[1,229]},{76:232,80:234,86:[1,230],133:$V7,134:231,140:233,163:$Vl,164:$Vm,165:$Vn,168:$Vq,169:$Vr,170:$Vs,171:$Vt,292:235,297:$VS},o($Vu1,[2,409]),{3:250,4:$V2,5:$V3,76:242,79:248,80:247,86:$Vv1,133:$V7,134:243,137:245,140:244,141:246,145:240,163:$Vl,164:$Vm,165:$Vn,166:$Vo,168:$Vq,169:$Vr,170:$Vs,171:$Vt,291:$VQ,292:106,293:$VR,294:236,295:239,296:241,297:$VS,300:237,301:[1,238]},{3:251,4:$V2,5:$V3,79:252},{86:[2,186]},{86:[2,187]},{86:[2,188]},{86:[2,189]},{86:[2,190]},{86:[2,191]},{86:[2,192]},{86:[2,193]},{86:[2,194]},o($Vw1,[2,1]),o($Vw1,[2,2]),{3:258,4:$V2,5:$V3,133:$Vx1,165:$Vy1,298:253,299:[1,254],302:255},{1:[2,3]},o($V0,$V1,{15:5,16:6,17:7,18:8,19:9,20:10,21:11,22:12,23:13,24:14,25:15,26:16,27:17,28:18,29:19,30:20,31:21,32:22,33:23,34:24,35:25,36:26,37:27,39:29,40:30,41:31,42:32,43:33,44:34,45:35,46:36,47:37,48:38,49:39,50:40,51:41,56:51,106:59,64:69,138:70,79:71,139:72,137:73,135:74,76:75,140:76,134:77,141:78,80:79,142:80,143:81,144:82,145:83,146:84,152:86,3:87,292:106,10:259,4:$V2,5:$V3,38:$V4,70:$V5,86:$V6,133:$V7,136:$V8,147:$V9,148:$Va,150:$Vb,153:$Vc,154:$Vd,155:$Ve,156:$Vf,157:$Vg,158:$Vh,159:$Vi,160:$Vj,161:$Vk,163:$Vl,164:$Vm,165:$Vn,166:$Vo,167:$Vp,168:$Vq,169:$Vr,170:$Vs,171:$Vt,172:$Vu,182:$Vv,200:$Vw,206:$Vx,207:$Vy,210:$Vz,211:$VA,218:$VB,259:$VC,261:$VD,262:$VE,266:$VF,268:$VG,270:$VH,271:$VI,277:$VJ,280:$VK,281:$VL,282:$VM,288:$VN,289:$VO,290:$VP,291:$VQ,293:$VR,297:$VS,306:$VT,308:$VU,309:$VV,310:$VW,311:$VX}),o($V0,[2,7]),{14:[1,260]},{3:156,4:$V2,5:$V3,78:261},{267:[1,262]},o($Vz1,$VA1,{220:263,231:$VB1}),{267:[1,265]},{3:266,4:$V2,5:$V3},{251:[1,267]},o($Vz1,$VA1,{220:268,231:$VB1}),{3:270,4:$V2,5:$V3,276:269},{3:156,4:$V2,5:$V3,78:271},{3:272,4:$V2,5:$V3},o($Vz1,$VC1,{260:273,231:$VD1}),{267:[1,275]},{3:276,4:$V2,5:$V3},o($Vz1,$VC1,{260:277,231:$VD1}),{3:270,4:$V2,5:$V3,276:278},{3:156,4:$V2,5:$V3,78:279},{3:156,4:$V2,5:$V3,78:280},o($VE1,[2,69],{58:281,81:[1,282]}),{3:286,4:$V2,5:$V3,78:283,79:284,80:285,168:$Vq,169:$Vr,170:$Vs,171:$Vt},{219:[1,287]},{81:[1,288]},o($V0,[2,368],{180:[1,289]}),{272:[1,290]},{81:[1,291]},o($V0,[2,372],{81:[1,293],180:[1,292]}),o($V0,[2,443]),o($V0,[2,439]),o($V0,[2,441]),{3:294,4:$V2,5:$V3},o($V0,[2,362]),{207:[1,295]},o([8,9,70,81,86,109,207,212,214,259,262,263,264,265],$VF1,{89:$VG1}),o($V0,[2,397]),{3:87,4:$V2,5:$V3,76:75,79:71,80:79,86:$V6,106:297,133:$V7,134:77,135:74,136:$V8,137:73,138:70,139:72,140:76,141:78,142:80,143:81,144:82,145:83,146:84,147:$V9,148:$Va,150:$Vb,152:86,153:$Vc,154:$Vd,155:$Ve,156:$Vf,157:$Vg,158:$Vh,159:$Vi,160:$Vj,161:$Vk,163:$Vl,164:$Vm,165:$Vn,166:$Vo,167:$Vp,168:$Vq,169:$Vr,170:$Vs,171:$Vt,172:$Vu,182:$Vv,200:$Vw,291:$VQ,292:106,293:$VR,297:$VS},{3:87,4:$V2,5:$V3,76:75,79:71,80:79,86:$V6,106:298,133:$V7,134:77,135:74,136:$V8,137:73,138:70,139:72,140:76,141:78,142:80,143:81,144:82,145:83,146:84,147:$V9,148:$Va,150:$Vb,152:86,153:$Vc,154:$Vd,155:$Ve,156:$Vf,157:$Vg,158:$Vh,159:$Vi,160:$Vj,161:$Vk,163:$Vl,164:$Vm,165:$Vn,166:$Vo,167:$Vp,168:$Vq,169:$Vr,170:$Vs,171:$Vt,172:$Vu,182:$Vv,200:$Vw,291:$VQ,292:106,293:$VR,297:$VS},{3:87,4:$V2,5:$V3,76:75,79:71,80:79,86:$V6,106:299,133:$V7,134:77,135:74,136:$V8,137:73,138:70,139:72,140:76,141:78,142:80,143:81,144:82,145:83,146:84,147:$V9,148:$Va,150:$Vb,152:86,153:$Vc,154:$Vd,155:$Ve,156:$Vf,157:$Vg,158:$Vh,159:$Vi,160:$Vj,161:$Vk,163:$Vl,164:$Vm,165:$Vn,166:$Vo,167:$Vp,168:$Vq,169:$Vr,170:$Vs,171:$Vt,172:$Vu,182:$Vv,200:$Vw,291:$VQ,292:106,293:$VR,297:$VS},{3:87,4:$V2,5:$V3,76:75,79:71,80:79,86:$V6,106:300,133:$V7,134:77,135:74,136:$V8,137:73,138:70,139:72,140:76,141:78,142:80,143:81,144:82,145:83,146:84,147:$V9,148:$Va,150:$Vb,152:86,153:$Vc,154:$Vd,155:$Ve,156:$Vf,157:$Vg,158:$Vh,159:$Vi,160:$Vj,161:$Vk,163:$Vl,164:$Vm,165:$Vn,166:$Vo,167:$Vp,168:$Vq,169:$Vr,170:$Vs,171:$Vt,172:$Vu,182:$Vv,200:$Vw,291:$VQ,292:106,293:$VR,297:$VS},{3:87,4:$V2,5:$V3,76:75,79:71,80:79,86:$V6,106:301,133:$V7,134:77,135:74,136:$V8,137:73,138:70,139:72,140:76,141:78,142:80,143:81,144:82,145:83,146:84,147:$V9,148:$Va,150:$Vb,152:86,153:$Vc,154:$Vd,155:$Ve,156:$Vf,157:$Vg,158:$Vh,159:$Vi,160:$Vj,161:$Vk,163:$Vl,164:$Vm,165:$Vn,166:$Vo,167:$Vp,168:$Vq,169:$Vr,170:$Vs,171:$Vt,172:$Vu,182:$Vv,200:$Vw,291:$VQ,292:106,293:$VR,297:$VS},{3:87,4:$V2,5:$V3,76:75,79:71,80:79,86:$V6,106:302,133:$V7,134:77,135:74,136:$V8,137:73,138:70,139:72,140:76,141:78,142:80,143:81,144:82,145:83,146:84,147:$V9,148:$Va,150:$Vb,152:86,153:$Vc,154:$Vd,155:$Ve,156:$Vf,157:$Vg,158:$Vh,159:$Vi,160:$Vj,161:$Vk,163:$Vl,164:$Vm,165:$Vn,166:$Vo,167:$Vp,168:$Vq,169:$Vr,170:$Vs,171:$Vt,172:$Vu,182:$Vv,200:$Vw,291:$VQ,292:106,293:$VR,297:$VS},{3:303,4:$V2,5:$V3,76:304,79:306,86:[1,305],133:$V7},o($VH1,[2,249],{138:70,79:71,139:72,137:73,135:74,76:75,140:76,134:77,141:78,80:79,142:80,143:81,144:82,145:83,146:84,152:86,3:87,292:106,106:307,4:$V2,5:$V3,86:$V6,133:$V7,136:$V8,147:$V9,148:$Va,150:$Vb,153:$Vc,154:$Vd,155:$Ve,156:$Vf,157:$Vg,158:$Vh,159:$Vi,160:$Vj,161:$Vk,163:$Vl,164:$Vm,165:$Vn,166:$Vo,167:$Vp,168:$Vq,169:$Vr,170:$Vs,171:$Vt,172:$Vu,182:$Vv,200:$Vw,291:$VQ,293:$VR,297:$VS}),o($VH1,[2,250],{138:70,79:71,139:72,137:73,135:74,76:75,140:76,134:77,141:78,80:79,142:80,143:81,144:82,145:83,146:84,152:86,3:87,292:106,106:308,4:$V2,5:$V3,86:$V6,133:$V7,136:$V8,147:$V9,148:$Va,150:$Vb,153:$Vc,154:$Vd,155:$Ve,156:$Vf,157:$Vg,158:$Vh,159:$Vi,160:$Vj,161:$Vk,163:$Vl,164:$Vm,165:$Vn,166:$Vo,167:$Vp,168:$Vq,169:$Vr,170:$Vs,171:$Vt,172:$Vu,182:$Vv,200:$Vw,291:$VQ,293:$VR,297:$VS}),o($VH1,[2,251],{138:70,79:71,139:72,137:73,135:74,76:75,140:76,134:77,141:78,80:79,142:80,143:81,144:82,145:83,146:84,152:86,3:87,292:106,106:309,4:$V2,5:$V3,86:$V6,133:$V7,136:$V8,147:$V9,148:$Va,150:$Vb,153:$Vc,154:$Vd,155:$Ve,156:$Vf,157:$Vg,158:$Vh,159:$Vi,160:$Vj,161:$Vk,163:$Vl,164:$Vm,165:$Vn,166:$Vo,167:$Vp,168:$Vq,169:$Vr,170:$Vs,171:$Vt,172:$Vu,182:$Vv,200:$Vw,291:$VQ,293:$VR,297:$VS}),o($VH1,[2,252],{138:70,79:71,139:72,137:73,135:74,76:75,140:76,134:77,141:78,80:79,142:80,143:81,144:82,145:83,146:84,152:86,3:87,292:106,106:310,4:$V2,5:$V3,86:$V6,133:$V7,136:$V8,147:$V9,148:$Va,150:$Vb,153:$Vc,154:$Vd,155:$Ve,156:$Vf,157:$Vg,158:$Vh,159:$Vi,160:$Vj,161:$Vk,163:$Vl,164:$Vm,165:$Vn,166:$Vo,167:$Vp,168:$Vq,169:$Vr,170:$Vs,171:$Vt,172:$Vu,182:$Vv,200:$Vw,291:$VQ,293:$VR,297:$VS}),o($VH1,[2,253],{138:70,79:71,139:72,137:73,135:74,76:75,140:76,134:77,141:78,80:79,142:80,143:81,144:82,145:83,146:84,152:86,3:87,292:106,106:311,4:$V2,5:$V3,86:$V6,133:$V7,136:$V8,147:$V9,148:$Va,150:$Vb,153:$Vc,154:$Vd,155:$Ve,156:$Vf,157:$Vg,158:$Vh,159:$Vi,160:$Vj,161:$Vk,163:$Vl,164:$Vm,165:$Vn,166:$Vo,167:$Vp,168:$Vq,169:$Vr,170:$Vs,171:$Vt,172:$Vu,182:$Vv,200:$Vw,291:$VQ,293:$VR,297:$VS}),{3:87,4:$V2,5:$V3,76:75,79:71,80:79,86:$V6,106:312,133:$V7,134:77,135:74,136:$V8,137:73,138:70,139:72,140:76,141:78,142:80,143:81,144:82,145:83,146:84,147:$V9,148:$Va,150:$Vb,152:86,153:$Vc,154:$Vd,155:$Ve,156:$Vf,157:$Vg,158:$Vh,159:$Vi,160:$Vj,161:$Vk,163:$Vl,164:$Vm,165:$Vn,166:$Vo,167:$Vp,168:$Vq,169:$Vr,170:$Vs,171:$Vt,172:$Vu,182:$Vv,200:$Vw,291:$VQ,292:106,293:$VR,297:$VS},{3:87,4:$V2,5:$V3,76:75,79:71,80:79,86:$V6,106:313,133:$V7,134:77,135:74,136:$V8,137:73,138:70,139:72,140:76,141:78,142:80,143:81,144:82,145:83,146:84,147:$V9,148:$Va,150:$Vb,152:86,153:$Vc,154:$Vd,155:$Ve,156:$Vf,157:$Vg,158:$Vh,159:$Vi,160:$Vj,161:$Vk,163:$Vl,164:$Vm,165:$Vn,166:$Vo,167:$Vp,168:$Vq,169:$Vr,170:$Vs,171:$Vt,172:$Vu,182:$Vv,200:$Vw,291:$VQ,292:106,293:$VR,297:$VS},o($VH1,[2,254],{138:70,79:71,139:72,137:73,135:74,76:75,140:76,134:77,141:78,80:79,142:80,143:81,144:82,145:83,146:84,152:86,3:87,292:106,106:314,4:$V2,5:$V3,86:$V6,133:$V7,136:$V8,147:$V9,148:$Va,150:$Vb,153:$Vc,154:$Vd,155:$Ve,156:$Vf,157:$Vg,158:$Vh,159:$Vi,160:$Vj,161:$Vk,163:$Vl,164:$Vm,165:$Vn,166:$Vo,167:$Vp,168:$Vq,169:$Vr,170:$Vs,171:$Vt,172:$Vu,182:$Vv,200:$Vw,291:$VQ,293:$VR,297:$VS}),{3:87,4:$V2,5:$V3,76:75,79:71,80:79,86:$V6,106:315,133:$V7,134:77,135:74,136:$V8,137:73,138:70,139:72,140:76,141:78,142:80,143:81,144:82,145:83,146:84,147:$V9,148:$Va,150:$Vb,152:86,153:$Vc,154:$Vd,155:$Ve,156:$Vf,157:$Vg,158:$Vh,159:$Vi,160:$Vj,161:$Vk,163:$Vl,164:$Vm,165:$Vn,166:$Vo,167:$Vp,168:$Vq,169:$Vr,170:$Vs,171:$Vt,172:$Vu,182:$Vv,200:$Vw,291:$VQ,292:106,293:$VR,297:$VS},{3:87,4:$V2,5:$V3,76:75,79:71,80:79,86:$V6,106:316,133:$V7,134:77,135:74,136:$V8,137:73,138:70,139:72,140:76,141:78,142:80,143:81,144:82,145:83,146:84,147:$V9,148:$Va,150:$Vb,152:86,153:$Vc,154:$Vd,155:$Ve,156:$Vf,157:$Vg,158:$Vh,159:$Vi,160:$Vj,161:$Vk,163:$Vl,164:$Vm,165:$Vn,166:$Vo,167:$Vp,168:$Vq,169:$Vr,170:$Vs,171:$Vt,172:$Vu,182:$Vv,200:$Vw,291:$VQ,292:106,293:$VR,297:$VS},{69:[1,318],197:317,204:[1,319],205:[1,320]},{3:87,4:$V2,5:$V3,76:75,79:71,80:79,86:$V6,106:321,133:$V7,134:77,135:74,136:$V8,137:73,138:70,139:72,140:76,141:78,142:80,143:81,144:82,145:83,146:84,147:$V9,148:$Va,150:$Vb,152:86,153:$Vc,154:$Vd,155:$Ve,156:$Vf,157:$Vg,158:$Vh,159:$Vi,160:$Vj,161:$Vk,163:$Vl,164:$Vm,165:$Vn,166:$Vo,167:$Vp,168:$Vq,169:$Vr,170:$Vs,171:$Vt,172:$Vu,182:$Vv,200:$Vw,291:$VQ,292:106,293:$VR,297:$VS},{3:87,4:$V2,5:$V3,76:75,79:71,80:79,86:$V6,106:322,133:$V7,134:77,135:74,136:$V8,137:73,138:70,139:72,140:76,141:78,142:80,143:81,144:82,145:83,146:84,147:$V9,148:$Va,150:$Vb,152:86,153:$Vc,154:$Vd,155:$Ve,156:$Vf,157:$Vg,158:$Vh,159:$Vi,160:$Vj,161:$Vk,163:$Vl,164:$Vm,165:$Vn,166:$Vo,167:$Vp,168:$Vq,169:$Vr,170:$Vs,171:$Vt,172:$Vu,182:$Vv,200:$Vw,291:$VQ,292:106,293:$VR,297:$VS},{86:[1,323]},{201:[1,324]},{3:87,4:$V2,5:$V3,76:75,79:71,80:79,86:$V6,106:325,133:$V7,134:77,135:74,136:$V8,137:73,138:70,139:72,140:76,141:78,142:80,143:81,144:82,145:83,146:84,147:$V9,148:$Va,150:$Vb,152:86,153:$Vc,154:$Vd,155:$Ve,156:$Vf,157:$Vg,158:$Vh,159:$Vi,160:$Vj,161:$Vk,163:$Vl,164:$Vm,165:$Vn,166:$Vo,167:$Vp,168:$Vq,169:$Vr,170:$Vs,171:$Vt,172:$Vu,182:$Vv,200:$Vw,291:$VQ,292:106,293:$VR,297:$VS},{3:87,4:$V2,5:$V3,76:75,79:71,80:79,86:$V6,106:326,133:$V7,134:77,135:74,136:$V8,137:73,138:70,139:72,140:76,141:78,142:80,143:81,144:82,145:83,146:84,147:$V9,148:$Va,150:$Vb,152:86,153:$Vc,154:$Vd,155:$Ve,156:$Vf,157:$Vg,158:$Vh,159:$Vi,160:$Vj,161:$Vk,163:$Vl,164:$Vm,165:$Vn,166:$Vo,167:$Vp,168:$Vq,169:$Vr,170:$Vs,171:$Vt,172:$Vu,182:$Vv,200:$Vw,291:$VQ,292:106,293:$VR,297:$VS},o($V0,[2,400]),o($V0,[2,401]),o($V0,[2,402]),o($V0,$Vs1,{85:[1,327]}),o($VI1,[2,179]),o($VI1,[2,180]),o($VI1,[2,181]),o($VI1,[2,182]),o($VI1,[2,183]),o($VI1,[2,184]),{86:$Vq1},{105:[1,329],304:328,305:[1,330]},o($V0,[2,445]),o($V0,[2,447]),{278:[1,331]},o($V0,[2,388]),{81:[1,332]},{81:[2,391]},{81:[2,392]},{81:[2,393]},{81:[2,394]},{76:333,133:$V7},{76:334,133:$V7},o($V0,[2,389]),o($Vk1,$Vl1,{66:335,75:$Vm1}),o($Vk1,$Vl1,{66:336,75:$Vm1}),o($Vk1,$Vl1,{66:337,75:$Vm1}),{3:87,4:$V2,5:$V3,67:338,76:75,79:71,80:79,86:$V6,106:340,132:339,133:$V7,134:77,135:74,136:$V8,137:73,138:70,139:72,140:76,141:78,142:80,143:81,144:82,145:83,146:84,147:$V9,148:$Va,150:$Vb,152:86,153:$Vc,154:$Vd,155:$Ve,156:$Vf,157:$Vg,158:$Vh,159:$Vi,160:$Vj,161:$Vk,163:$Vl,164:$Vm,165:$Vn,166:$Vo,167:$Vp,168:$Vq,169:$Vr,170:$Vs,171:$Vt,172:$Vu,182:$Vv,200:$Vw,291:$VQ,292:106,293:$VR,297:$VS},{76:341,133:$V7},o($Vo1,[2,57]),o($Vo1,[2,58]),o($Vo1,[2,59]),o($Vo1,[2,60]),{3:87,4:$V2,5:$V3,76:75,79:71,80:79,86:$V6,106:342,133:$V7,134:77,135:74,136:$V8,137:73,138:70,139:72,140:76,141:78,142:80,143:81,144:82,145:83,146:84,147:$V9,148:$Va,150:$Vb,152:86,153:$Vc,154:$Vd,155:$Ve,156:$Vf,157:$Vg,158:$Vh,159:$Vi,160:$Vj,161:$Vk,163:$Vl,164:$Vm,165:$Vn,166:$Vo,167:$Vp,168:$Vq,169:$Vr,170:$Vs,171:$Vt,172:$Vu,182:$Vv,200:$Vw,291:$VQ,292:106,293:$VR,297:$VS},{3:87,4:$V2,5:$V3,76:75,79:71,80:79,86:$V6,87:[1,344],106:345,133:$V7,134:77,135:74,136:$V8,137:73,138:70,139:72,140:76,141:78,142:80,143:81,144:82,145:83,146:84,147:$V9,148:$Va,150:$Vb,152:86,153:$Vc,154:$Vd,155:$Ve,156:$Vf,157:$Vg,158:$Vh,159:$Vi,160:$Vj,161:$Vk,162:343,163:$Vl,164:$Vm,165:$Vn,166:$Vo,167:$Vp,168:$Vq,169:$Vr,170:$Vs,171:$Vt,172:$Vu,182:$Vv,200:$Vw,291:$VQ,292:106,293:$VR,297:$VS},{3:346,4:$V2,5:$V3,136:[1,347]},o([4,5,8,9,77,81,85,87,88,92,96,97,98,99,100,101,102,103,104,109,110,119,120,121,122,123,126,127,129,133,165,175,177,178,179,186,187,188,189,190,191,192,193,194,195,198,199,200,201,202,203],[2,240],{196:175,136:$VZ,180:$V_,181:$V$,182:$V01,183:$V11,184:$V21,185:$V31}),o($VJ1,[2,241],{196:175,136:$VZ,183:$V11,184:$V21,185:$V31}),{87:[1,348],136:$VZ,180:$V_,181:$V$,182:$V01,183:$V11,184:$V21,185:$V31,186:$V41,187:$V51,188:$V61,189:$V71,190:$V81,191:$V91,192:$Va1,193:$Vb1,194:$Vc1,195:$Vd1,196:175,198:$Ve1,199:$Vf1,200:$Vg1,201:$Vh1,202:$Vi1,203:$Vj1},o($Vr1,[2,205]),o($Vr1,[2,206]),{29:349,56:51,64:69,70:$V5},{136:$VZ,173:350,176:226,177:$Vt1,180:$V_,181:$V$,182:$V01,183:$V11,184:$V21,185:$V31,186:$V41,187:$V51,188:$V61,189:$V71,190:$V81,191:$V91,192:$Va1,193:$Vb1,194:$Vc1,195:$Vd1,196:175,198:$Ve1,199:$Vf1,200:$Vg1,201:$Vh1,202:$Vi1,203:$Vj1},{174:351,175:$VK1,176:352,177:$Vt1,179:$VL1},o($VM1,[2,212]),{3:87,4:$V2,5:$V3,76:75,79:71,80:79,86:$V6,106:354,133:$V7,134:77,135:74,136:$V8,137:73,138:70,139:72,140:76,141:78,142:80,143:81,144:82,145:83,146:84,147:$V9,148:$Va,150:$Vb,152:86,153:$Vc,154:$Vd,155:$Ve,156:$Vf,157:$Vg,158:$Vh,159:$Vi,160:$Vj,161:$Vk,163:$Vl,164:$Vm,165:$Vn,166:$Vo,167:$Vp,168:$Vq,169:$Vr,170:$Vs,171:$Vt,172:$Vu,182:$Vv,200:$Vw,291:$VQ,292:106,293:$VR,297:$VS},{3:87,4:$V2,5:$V3,76:75,79:71,80:79,86:$V6,106:355,133:$V7,134:77,135:74,136:$V8,137:73,138:70,139:72,140:76,141:78,142:80,143:81,144:82,145:83,146:84,147:$V9,148:$Va,150:$Vb,152:86,153:$Vc,154:$Vd,155:$Ve,156:$Vf,157:$Vg,158:$Vh,159:$Vi,160:$Vj,161:$Vk,163:$Vl,164:$Vm,165:$Vn,166:$Vo,167:$Vp,168:$Vq,169:$Vr,170:$Vs,171:$Vt,172:$Vu,182:$Vv,200:$Vw,291:$VQ,292:106,293:$VR,297:$VS},{4:$VN1,149:356,255:$VO1},{3:87,4:$V2,5:$V3,76:75,79:71,80:79,86:$V6,106:359,133:$V7,134:77,135:74,136:$V8,137:73,138:70,139:72,140:76,141:78,142:80,143:81,144:82,145:83,146:84,147:$V9,148:$Va,150:$Vb,152:86,153:$Vc,154:$Vd,155:$Ve,156:$Vf,157:$Vg,158:$Vh,159:$Vi,160:$Vj,161:$Vk,163:$Vl,164:$Vm,165:$Vn,166:$Vo,167:$Vp,168:$Vq,169:$Vr,170:$Vs,171:$Vt,172:$Vu,182:$Vv,200:$Vw,291:$VQ,292:106,293:$VR,297:$VS},o($Vu1,[2,405]),o($Vu1,[2,406]),o($Vu1,[2,407]),o($Vu1,[2,408]),o($Vu1,[2,410]),o($Vu1,[2,411]),{85:[1,361],301:[1,360]},o($Vu1,[2,427]),o($VP1,[2,434]),o($VQ1,[2,412]),o($VQ1,[2,413]),o($VQ1,[2,414]),o($VQ1,[2,415]),o($VQ1,[2,416]),o($VQ1,[2,417]),o($VQ1,[2,418]),o($VQ1,[2,419]),o($VQ1,[2,420]),{3:87,4:$V2,5:$V3,76:75,79:71,80:79,86:$V6,106:362,133:$V7,134:77,135:74,136:$V8,137:73,138:70,139:72,140:76,141:78,142:80,143:81,144:82,145:83,146:84,147:$V9,148:$Va,150:$Vb,152:86,153:$Vc,154:$Vd,155:$Ve,156:$Vf,157:$Vg,158:$Vh,159:$Vi,160:$Vj,161:$Vk,163:$Vl,164:$Vm,165:$Vn,166:$Vo,167:$Vp,168:$Vq,169:$Vr,170:$Vs,171:$Vt,172:$Vu,182:$Vv,200:$Vw,291:$VQ,292:106,293:$VR,297:$VS},o($VQ1,$Vp1,{86:$Vq1,89:$VR1}),o($Vn1,[2,174],{86:$Vq1}),o($Vn1,[2,175]),{85:[1,365],299:[1,364]},o($Vu1,[2,424]),o($VS1,[2,429]),{169:[1,366]},{169:[1,367]},{169:[1,368]},o($V0,[2,4]),o($V0,$V1,{15:5,16:6,17:7,18:8,19:9,20:10,21:11,22:12,23:13,24:14,25:15,26:16,27:17,28:18,29:19,30:20,31:21,32:22,33:23,34:24,35:25,36:26,37:27,39:29,40:30,41:31,42:32,43:33,44:34,45:35,46:36,47:37,48:38,49:39,50:40,51:41,56:51,106:59,64:69,138:70,79:71,139:72,137:73,135:74,76:75,140:76,134:77,141:78,80:79,142:80,143:81,144:82,145:83,146:84,152:86,3:87,292:106,10:369,4:$V2,5:$V3,38:$V4,70:$V5,86:$V6,133:$V7,136:$V8,147:$V9,148:$Va,150:$Vb,153:$Vc,154:$Vd,155:$Ve,156:$Vf,157:$Vg,158:$Vh,159:$Vi,160:$Vj,161:$Vk,163:$Vl,164:$Vm,165:$Vn,166:$Vo,167:$Vp,168:$Vq,169:$Vr,170:$Vs,171:$Vt,172:$Vu,182:$Vv,200:$Vw,206:$Vx,207:$Vy,210:$Vz,211:$VA,218:$VB,259:$VC,261:$VD,262:$VE,266:$VF,268:$VG,270:$VH,271:$VI,277:$VJ,280:$VK,281:$VL,282:$VM,288:$VN,289:$VO,290:$VP,291:$VQ,293:$VR,297:$VS,306:$VT,308:$VU,309:$VV,310:$VW,311:$VX}),{259:[1,373],262:[1,370],264:[1,371],265:[1,372]},{3:374,4:$V2,5:$V3},{3:375,4:$V2,5:$V3},{200:[1,376]},o($Vz1,$VA1,{220:377,231:$VB1}),{105:[1,378]},{3:379,4:$V2,5:$V3},{3:381,4:$V2,5:$V3,78:380},{86:[1,383],88:[1,382]},o($VT1,[2,385],{89:[1,384]}),o($V0,[2,264],{109:[1,385]}),o($V0,[2,355]),{3:386,4:$V2,5:$V3},{167:[1,387]},o($Vz1,$VC1,{260:388,231:$VD1}),o($V0,[2,367]),{3:156,4:$V2,5:$V3,78:389},o($V0,[2,384]),{29:393,56:51,64:69,70:$V5,86:[1,392],212:[1,390],214:[1,391]},{263:[1,394]},o($VU1,[2,115],{59:395,109:[1,396]}),{3:286,4:$V2,5:$V3,78:400,79:402,80:401,82:397,83:398,86:$VV1,168:$Vq,169:$Vr,170:$Vs,171:$Vt},o($VY,[2,64]),o($VY,[2,65]),o($VY,[2,66]),o([4,5,8,9,81,85,87,88,92,96,97,98,99,100,101,102,103,104,105,107,109,110,120,121,122,123,129],$VF1,{86:$Vq1,89:$VG1}),{3:156,4:$V2,5:$V3,78:403},{3:156,4:$V2,5:$V3,78:404},{134:405,165:$Vn},o($V0,[2,370],{180:[1,406]}),{3:156,4:$V2,5:$V3,78:407},{134:408,165:$Vn},{3:409,4:$V2,5:$V3},o($V0,[2,361]),{3:413,4:$V2,5:$V3,137:412,208:410,209:411},{3:414,4:$V2,5:$V3},o([4,5,8,9,77,81,85,87,88,92,96,97,98,99,100,101,102,103,104,109,110,119,120,121,122,123,126,127,129,133,165,175,177,178,179,180,186,187,188,189,190,191,192,193,194,195,198,199,200,201,202,203],[2,216],{196:175,136:$VZ,181:$V$,182:$V01,183:$V11,184:$V21,185:$V31}),o($VJ1,[2,217],{196:175,136:$VZ,183:$V11,184:$V21,185:$V31}),o($VJ1,[2,218],{196:175,136:$VZ,183:$V11,184:$V21,185:$V31}),o($VW1,[2,219],{196:175,185:$V31}),o($VW1,[2,220],{196:175,185:$V31}),o($VW1,[2,221],{196:175,185:$V31}),o($Vn1,[2,222],{86:$Vq1}),o($Vn1,[2,223]),{3:87,4:$V2,5:$V3,76:75,79:71,80:79,86:$V6,106:415,133:$V7,134:77,135:74,136:$V8,137:73,138:70,139:72,140:76,141:78,142:80,143:81,144:82,145:83,146:84,147:$V9,148:$Va,150:$Vb,152:86,153:$Vc,154:$Vd,155:$Ve,156:$Vf,157:$Vg,158:$Vh,159:$Vi,160:$Vj,161:$Vk,163:$Vl,164:$Vm,165:$Vn,166:$Vo,167:$Vp,168:$Vq,169:$Vr,170:$Vs,171:$Vt,172:$Vu,182:$Vv,200:$Vw,291:$VQ,292:106,293:$VR,297:$VS},o($Vn1,[2,225]),o($VX1,[2,226],{196:175,136:$VZ,180:$V_,181:$V$,182:$V01,183:$V11,184:$V21,185:$V31,200:$Vg1,201:$Vh1}),o($VX1,[2,227],{196:175,136:$VZ,180:$V_,181:$V$,182:$V01,183:$V11,184:$V21,185:$V31,200:$Vg1,201:$Vh1}),o($VX1,[2,228],{196:175,136:$VZ,180:$V_,181:$V$,182:$V01,183:$V11,184:$V21,185:$V31,200:$Vg1,201:$Vh1}),o($VX1,[2,229],{196:175,136:$VZ,180:$V_,181:$V$,182:$V01,183:$V11,184:$V21,185:$V31,200:$Vg1,201:$Vh1}),o($VX1,[2,230],{196:175,136:$VZ,180:$V_,181:$V$,182:$V01,183:$V11,184:$V21,185:$V31,200:$Vg1,201:$Vh1}),o($VX1,[2,231],{196:175,136:$VZ,180:$V_,181:$V$,182:$V01,183:$V11,184:$V21,185:$V31,200:$Vg1,201:$Vh1}),o($VX1,[2,232],{196:175,136:$VZ,180:$V_,181:$V$,182:$V01,183:$V11,184:$V21,185:$V31,200:$Vg1,201:$Vh1}),o($VX1,[2,233],{196:175,136:$VZ,180:$V_,181:$V$,182:$V01,183:$V11,184:$V21,185:$V31,200:$Vg1,201:$Vh1}),o($VX1,[2,234],{196:175,136:$VZ,180:$V_,181:$V$,182:$V01,183:$V11,184:$V21,185:$V31,200:$Vg1,201:$Vh1}),o($VX1,[2,235],{196:175,136:$VZ,180:$V_,181:$V$,182:$V01,183:$V11,184:$V21,185:$V31,200:$Vg1,201:$Vh1}),{86:[1,416]},{86:[2,255]},{86:[2,256]},{86:[2,257]},o([4,5,8,9,77,81,85,87,88,92,96,97,98,99,100,101,102,103,104,109,110,119,120,121,122,123,126,127,129,133,165,175,177,178,179,198,199,202,203],[2,238],{196:175,136:$VZ,180:$V_,181:$V$,182:$V01,183:$V11,184:$V21,185:$V31,186:$V41,187:$V51,188:$V61,189:$V71,190:$V81,191:$V91,192:$Va1,193:$Vb1,194:$Vc1,195:$Vd1,200:$Vg1,201:$Vh1}),o([4,5,8,9,77,81,85,87,88,92,96,97,98,99,100,101,102,103,104,109,110,119,120,121,122,123,126,127,129,133,165,175,177,178,179,199],[2,239],{196:175,136:$VZ,180:$V_,181:$V$,182:$V01,183:$V11,184:$V21,185:$V31,186:$V41,187:$V51,188:$V61,189:$V71,190:$V81,191:$V91,192:$Va1,193:$Vb1,194:$Vc1,195:$Vd1,198:$Ve1,200:$Vg1,201:$Vh1,202:$Vi1,203:$Vj1}),{3:87,4:$V2,5:$V3,29:417,56:51,64:69,70:$V5,76:75,79:71,80:79,86:$V6,106:345,133:$V7,134:77,135:74,136:$V8,137:73,138:70,139:72,140:76,141:78,142:80,143:81,144:82,145:83,146:84,147:$V9,148:$Va,150:$Vb,152:86,153:$Vc,154:$Vd,155:$Ve,156:$Vf,157:$Vg,158:$Vh,159:$Vi,160:$Vj,161:$Vk,162:418,163:$Vl,164:$Vm,165:$Vn,166:$Vo,167:$Vp,168:$Vq,169:$Vr,170:$Vs,171:$Vt,172:$Vu,182:$Vv,200:$Vw,291:$VQ,292:106,293:$VR,297:$VS},{86:[1,419]},o($VY1,[2,247],{196:175,136:$VZ,180:$V_,181:$V$,182:$V01,183:$V11,184:$V21,185:$V31,186:$V41,187:$V51,188:$V61,189:$V71,190:$V81,191:$V91,192:$Va1,193:$Vb1,194:$Vc1,195:$Vd1,198:$Ve1,200:$Vg1,201:$Vh1}),o($VY1,[2,248],{196:175,136:$VZ,180:$V_,181:$V$,182:$V01,183:$V11,184:$V21,185:$V31,186:$V41,187:$V51,188:$V61,189:$V71,190:$V81,191:$V91,192:$Va1,193:$Vb1,194:$Vc1,195:$Vd1,198:$Ve1,200:$Vg1,201:$Vh1}),{145:420,291:$VQ,292:106,293:$VR,297:$VS},o($V0,[2,435]),o($V0,[2,436]),o($V0,[2,437]),{279:[1,421]},{3:422,4:$V2,5:$V3},{81:[2,395]},{81:[2,396]},{3:87,4:$V2,5:$V3,67:423,76:75,79:71,80:79,86:$V6,106:340,132:339,133:$V7,134:77,135:74,136:$V8,137:73,138:70,139:72,140:76,141:78,142:80,143:81,144:82,145:83,146:84,147:$V9,148:$Va,150:$Vb,152:86,153:$Vc,154:$Vd,155:$Ve,156:$Vf,157:$Vg,158:$Vh,159:$Vi,160:$Vj,161:$Vk,163:$Vl,164:$Vm,165:$Vn,166:$Vo,167:$Vp,168:$Vq,169:$Vr,170:$Vs,171:$Vt,172:$Vu,182:$Vv,200:$Vw,291:$VQ,292:106,293:$VR,297:$VS},{3:87,4:$V2,5:$V3,67:424,76:75,79:71,80:79,86:$V6,106:340,132:339,133:$V7,134:77,135:74,136:$V8,137:73,138:70,139:72,140:76,141:78,142:80,143:81,144:82,145:83,146:84,147:$V9,148:$Va,150:$Vb,152:86,153:$Vc,154:$Vd,155:$Ve,156:$Vf,157:$Vg,158:$Vh,159:$Vi,160:$Vj,161:$Vk,163:$Vl,164:$Vm,165:$Vn,166:$Vo,167:$Vp,168:$Vq,169:$Vr,170:$Vs,171:$Vt,172:$Vu,182:$Vv,200:$Vw,291:$VQ,292:106,293:$VR,297:$VS},{3:87,4:$V2,5:$V3,67:425,76:75,79:71,80:79,86:$V6,106:340,132:339,133:$V7,134:77,135:74,136:$V8,137:73,138:70,139:72,140:76,141:78,142:80,143:81,144:82,145:83,146:84,147:$V9,148:$Va,150:$Vb,152:86,153:$Vc,154:$Vd,155:$Ve,156:$Vf,157:$Vg,158:$Vh,159:$Vi,160:$Vj,161:$Vk,163:$Vl,164:$Vm,165:$Vn,166:$Vo,167:$Vp,168:$Vq,169:$Vr,170:$Vs,171:$Vt,172:$Vu,182:$Vv,200:$Vw,291:$VQ,292:106,293:$VR,297:$VS},o($VZ1,[2,55],{85:$V_1}),o($V$1,[2,145]),o($V$1,[2,152],{196:175,3:428,134:430,4:$V2,5:$V3,88:[1,427],133:[1,429],136:$VZ,165:$Vn,180:$V_,181:$V$,182:$V01,183:$V11,184:$V21,185:$V31,186:$V41,187:$V51,188:$V61,189:$V71,190:$V81,191:$V91,192:$Va1,193:$Vb1,194:$Vc1,195:$Vd1,198:$Ve1,199:$Vf1,200:$Vg1,201:$Vh1,202:$Vi1,203:$Vj1}),o($Vk1,[2,61]),{87:[1,431],136:$VZ,180:$V_,181:$V$,182:$V01,183:$V11,184:$V21,185:$V31,186:$V41,187:$V51,188:$V61,189:$V71,190:$V81,191:$V91,192:$Va1,193:$Vb1,194:$Vc1,195:$Vd1,196:175,198:$Ve1,199:$Vf1,200:$Vg1,201:$Vh1,202:$Vi1,203:$Vj1},{85:$V02,87:[1,432]},o($V12,[2,196]),o($V22,[2,197],{196:175,136:$VZ,180:$V_,181:$V$,182:$V01,183:$V11,184:$V21,185:$V31,186:$V41,187:$V51,188:$V61,189:$V71,190:$V81,191:$V91,192:$Va1,193:$Vb1,194:$Vc1,195:$Vd1,198:$Ve1,199:$Vf1,200:$Vg1,201:$Vh1,202:$Vi1,203:$Vj1}),o($Vn1,$V32,{89:[1,434]}),o($Vn1,[2,154]),o($Vn1,[2,242]),{87:[1,435]},{174:436,175:$VK1,176:352,177:$Vt1,179:$VL1},{175:[1,437]},o($VM1,[2,211]),{3:87,4:$V2,5:$V3,76:75,79:71,80:79,86:$V6,106:438,133:$V7,134:77,135:74,136:$V8,137:73,138:70,139:72,140:76,141:78,142:80,143:81,144:82,145:83,146:84,147:$V9,148:$Va,150:$Vb,152:86,153:$Vc,154:$Vd,155:$Ve,156:$Vf,157:$Vg,158:$Vh,159:$Vi,160:$Vj,161:$Vk,163:$Vl,164:$Vm,165:$Vn,166:$Vo,167:$Vp,168:$Vq,169:$Vr,170:$Vs,171:$Vt,172:$Vu,182:$Vv,200:$Vw,291:$VQ,292:106,293:$VR,297:$VS},{136:$VZ,178:[1,439],180:$V_,181:$V$,182:$V01,183:$V11,184:$V21,185:$V31,186:$V41,187:$V51,188:$V61,189:$V71,190:$V81,191:$V91,192:$Va1,193:$Vb1,194:$Vc1,195:$Vd1,196:175,198:$Ve1,199:$Vf1,200:$Vg1,201:$Vh1,202:$Vi1,203:$Vj1},{88:[1,440],136:$VZ,180:$V_,181:$V$,182:$V01,183:$V11,184:$V21,185:$V31,186:$V41,187:$V51,188:$V61,189:$V71,190:$V81,191:$V91,192:$Va1,193:$Vb1,194:$Vc1,195:$Vd1,196:175,198:$Ve1,199:$Vf1,200:$Vg1,201:$Vh1,202:$Vi1,203:$Vj1},{85:[1,441]},o($VI1,[2,330],{86:[1,442]}),{86:[1,443]},{87:[1,444],136:$VZ,180:$V_,181:$V$,182:$V01,183:$V11,184:$V21,185:$V31,186:$V41,187:$V51,188:$V61,189:$V71,190:$V81,191:$V91,192:$Va1,193:$Vb1,194:$Vc1,195:$Vd1,196:175,198:$Ve1,199:$Vf1,200:$Vg1,201:$Vh1,202:$Vi1,203:$Vj1},o($Vu1,[2,425]),{3:250,4:$V2,5:$V3,76:242,79:248,80:247,86:$Vv1,133:$V7,134:243,137:245,140:244,141:246,145:240,163:$Vl,164:$Vm,165:$Vn,166:$Vo,168:$Vq,169:$Vr,170:$Vs,171:$Vt,291:$VQ,292:106,293:$VR,295:446,296:241,297:$VS,301:[1,445]},{87:[1,447],136:$VZ,180:$V_,181:$V$,182:$V01,183:$V11,184:$V21,185:$V31,186:$V41,187:$V51,188:$V61,189:$V71,190:$V81,191:$V91,192:$Va1,193:$Vb1,194:$Vc1,195:$Vd1,196:175,198:$Ve1,199:$Vf1,200:$Vg1,201:$Vh1,202:$Vi1,203:$Vj1},{3:448,4:$V2,5:$V3},o($Vu1,[2,422]),{3:258,4:$V2,5:$V3,133:$Vx1,165:$Vy1,299:[1,449],302:450},{3:250,4:$V2,5:$V3,76:242,79:248,80:247,86:$Vv1,133:$V7,134:243,137:245,140:244,141:246,145:240,163:$Vl,164:$Vm,165:$Vn,166:$Vo,168:$Vq,169:$Vr,170:$Vs,171:$Vt,291:$VQ,292:106,293:$VR,295:451,296:241,297:$VS},{3:250,4:$V2,5:$V3,76:242,79:248,80:247,86:$Vv1,133:$V7,134:243,137:245,140:244,141:246,145:240,163:$Vl,164:$Vm,165:$Vn,166:$Vo,168:$Vq,169:$Vr,170:$Vs,171:$Vt,291:$VQ,292:106,293:$VR,295:452,296:241,297:$VS},{3:250,4:$V2,5:$V3,76:242,79:248,80:247,86:$Vv1,133:$V7,134:243,137:245,140:244,141:246,145:240,163:$Vl,164:$Vm,165:$Vn,166:$Vo,168:$Vq,169:$Vr,170:$Vs,171:$Vt,291:$VQ,292:106,293:$VR,295:453,296:241,297:$VS},o($V0,[2,8]),{73:[1,455],263:[1,454]},{73:[1,456]},{73:[1,457]},{73:[1,458]},o($V0,[2,351],{86:[1,459],88:[1,460]}),o($V0,[2,356]),{167:[1,461]},{3:462,4:$V2,5:$V3},{3:156,4:$V2,5:$V3,78:463},{105:[1,464]},{86:[1,465]},o($V0,[2,287],{86:$VF1,89:[1,466]}),{29:467,56:51,64:69,70:$V5},{3:469,4:$V2,5:$V3,243:468},{3:470,4:$V2,5:$V3},{3:87,4:$V2,5:$V3,76:75,79:71,80:79,86:$V6,106:471,133:$V7,134:77,135:74,136:$V8,137:73,138:70,139:72,140:76,141:78,142:80,143:81,144:82,145:83,146:84,147:$V9,148:$Va,150:$Vb,152:86,153:$Vc,154:$Vd,155:$Ve,156:$Vf,157:$Vg,158:$Vh,159:$Vi,160:$Vj,161:$Vk,163:$Vl,164:$Vm,165:$Vn,166:$Vo,167:$Vp,168:$Vq,169:$Vr,170:$Vs,171:$Vt,172:$Vu,182:$Vv,200:$Vw,291:$VQ,292:106,293:$VR,297:$VS},o($V0,[2,363]),o($Vz1,[2,344]),{3:472,4:$V2,5:$V3},o($V0,[2,342]),{80:476,86:$V42,145:475,168:$Vq,169:$Vr,170:$Vs,171:$Vt,213:473,291:$VQ,292:106,293:$VR,297:$VS},{212:[1,477]},{3:413,4:$V2,5:$V3,108:478,137:479},o($V0,[2,268]),{3:480,4:$V2,5:$V3},o($V52,[2,117],{60:481,110:[1,482]}),{3:87,4:$V2,5:$V3,76:75,79:71,80:79,86:$V6,106:483,133:$V7,134:77,135:74,136:$V8,137:73,138:70,139:72,140:76,141:78,142:80,143:81,144:82,145:83,146:84,147:$V9,148:$Va,150:$Vb,152:86,153:$Vc,154:$Vd,155:$Ve,156:$Vf,157:$Vg,158:$Vh,159:$Vi,160:$Vj,161:$Vk,163:$Vl,164:$Vm,165:$Vn,166:$Vo,167:$Vp,168:$Vq,169:$Vr,170:$Vs,171:$Vt,172:$Vu,182:$Vv,200:$Vw,291:$VQ,292:106,293:$VR,297:$VS},o($VE1,[2,67],{85:[1,484]}),o($V62,[2,70],{84:485,90:486,91:487,95:488,92:$V72,96:$V82,97:$V92,98:$Va2,99:$Vb2,100:$Vc2,101:$Vd2,102:$Ve2,103:$Vf2,104:$Vg2}),{29:498,56:51,64:69,70:$V5},o($Vh2,[2,77],{3:499,4:$V2,5:$V3,88:[1,500]}),o($Vh2,[2,80],{3:501,4:$V2,5:$V3,88:[1,502]}),o($Vh2,[2,81],{3:503,4:$V2,5:$V3,88:[1,504]}),o($V0,[2,380],{81:[1,505]}),o($V0,[2,376],{81:[1,506]}),o($V0,[2,369]),{134:507,165:$Vn},o($V0,[2,378],{81:[1,508]}),o($V0,[2,373]),o($V0,[2,374],{180:[1,509]}),o($V0,[2,259],{85:[1,511],109:[1,510]}),o($Vi2,[2,260]),{190:[1,512]},o([8,9,85,87,92,96,97,98,99,100,101,102,103,104,109,110,120,121,122,123,129,190],$Vp1,{89:$VR1}),o([4,5,8,9,70,81,85,86,87,88,92,96,97,98,99,100,101,102,103,104,105,107,109,110,120,121,122,123,129,207,212,214,259,262,263,264,265],$Vj2),{87:[1,513],136:$VZ,180:$V_,181:$V$,182:$V01,183:$V11,184:$V21,185:$V31,186:$V41,187:$V51,188:$V61,189:$V71,190:$V81,191:$V91,192:$Va1,193:$Vb1,194:$Vc1,195:$Vd1,196:175,198:$Ve1,199:$Vf1,200:$Vg1,201:$Vh1,202:$Vi1,203:$Vj1},{3:87,4:$V2,5:$V3,29:514,56:51,64:69,70:$V5,76:75,79:71,80:79,86:$V6,106:345,133:$V7,134:77,135:74,136:$V8,137:73,138:70,139:72,140:76,141:78,142:80,143:81,144:82,145:83,146:84,147:$V9,148:$Va,150:$Vb,152:86,153:$Vc,154:$Vd,155:$Ve,156:$Vf,157:$Vg,158:$Vh,159:$Vi,160:$Vj,161:$Vk,162:515,163:$Vl,164:$Vm,165:$Vn,166:$Vo,167:$Vp,168:$Vq,169:$Vr,170:$Vs,171:$Vt,172:$Vu,182:$Vv,200:$Vw,291:$VQ,292:106,293:$VR,297:$VS},{87:[1,516]},{85:$V02,87:[1,517]},{3:87,4:$V2,5:$V3,29:518,56:51,64:69,70:$V5,76:75,79:71,80:79,86:$V6,106:345,133:$V7,134:77,135:74,136:$V8,137:73,138:70,139:72,140:76,141:78,142:80,143:81,144:82,145:83,146:84,147:$V9,148:$Va,150:$Vb,152:86,153:$Vc,154:$Vd,155:$Ve,156:$Vf,157:$Vg,158:$Vh,159:$Vi,160:$Vj,161:$Vk,162:519,163:$Vl,164:$Vm,165:$Vn,166:$Vo,167:$Vp,168:$Vq,169:$Vr,170:$Vs,171:$Vt,172:$Vu,182:$Vv,200:$Vw,291:$VQ,292:106,293:$VR,297:$VS},o($V0,[2,403]),{29:520,56:51,64:69,70:$V5},o($V0,[2,390]),o($VZ1,[2,52],{85:$V_1}),o($VZ1,[2,53],{85:$V_1}),o($VZ1,[2,54],{85:$V_1}),{3:87,4:$V2,5:$V3,76:75,79:71,80:79,86:$V6,106:340,132:521,133:$V7,134:77,135:74,136:$V8,137:73,138:70,139:72,140:76,141:78,142:80,143:81,144:82,145:83,146:84,147:$V9,148:$Va,150:$Vb,152:86,153:$Vc,154:$Vd,155:$Ve,156:$Vf,157:$Vg,158:$Vh,159:$Vi,160:$Vj,161:$Vk,163:$Vl,164:$Vm,165:$Vn,166:$Vo,167:$Vp,168:$Vq,169:$Vr,170:$Vs,171:$Vt,172:$Vu,182:$Vv,200:$Vw,291:$VQ,292:106,293:$VR,297:$VS},{3:522,4:$V2,5:$V3,133:[1,523],134:524,165:$Vn},o($V$1,[2,147]),o($V$1,[2,149]),o($V$1,[2,151]),o($Vn1,[2,185]),o($V12,[2,195]),{3:87,4:$V2,5:$V3,76:75,79:71,80:79,86:$V6,106:525,133:$V7,134:77,135:74,136:$V8,137:73,138:70,139:72,140:76,141:78,142:80,143:81,144:82,145:83,146:84,147:$V9,148:$Va,150:$Vb,152:86,153:$Vc,154:$Vd,155:$Ve,156:$Vf,157:$Vg,158:$Vh,159:$Vi,160:$Vj,161:$Vk,163:$Vl,164:$Vm,165:$Vn,166:$Vo,167:$Vp,168:$Vq,169:$Vr,170:$Vs,171:$Vt,172:$Vu,182:$Vv,200:$Vw,291:$VQ,292:106,293:$VR,297:$VS},{3:526,4:$V2,5:$V3,136:[1,527]},o($Vn1,[2,204]),{175:[1,528]},o($Vn1,[2,210]),{136:$VZ,175:[2,214],180:$V_,181:$V$,182:$V01,183:$V11,184:$V21,185:$V31,186:$V41,187:$V51,188:$V61,189:$V71,190:$V81,191:$V91,192:$Va1,193:$Vb1,194:$Vc1,195:$Vd1,196:175,198:$Ve1,199:$Vf1,200:$Vg1,201:$Vh1,202:$Vi1,203:$Vj1},{3:87,4:$V2,5:$V3,76:75,79:71,80:79,86:$V6,106:529,133:$V7,134:77,135:74,136:$V8,137:73,138:70,139:72,140:76,141:78,142:80,143:81,144:82,145:83,146:84,147:$V9,148:$Va,150:$Vb,152:86,153:$Vc,154:$Vd,155:$Ve,156:$Vf,157:$Vg,158:$Vh,159:$Vi,160:$Vj,161:$Vk,163:$Vl,164:$Vm,165:$Vn,166:$Vo,167:$Vp,168:$Vq,169:$Vr,170:$Vs,171:$Vt,172:$Vu,182:$Vv,200:$Vw,291:$VQ,292:106,293:$VR,297:$VS},{4:$VN1,149:530,255:$VO1},{3:87,4:$V2,5:$V3,76:75,79:71,80:79,86:$V6,106:531,133:$V7,134:77,135:74,136:$V8,137:73,138:70,139:72,140:76,141:78,142:80,143:81,144:82,145:83,146:84,147:$V9,148:$Va,150:$Vb,152:86,153:$Vc,154:$Vd,155:$Ve,156:$Vf,157:$Vg,158:$Vh,159:$Vi,160:$Vj,161:$Vk,163:$Vl,164:$Vm,165:$Vn,166:$Vo,167:$Vp,168:$Vq,169:$Vr,170:$Vs,171:$Vt,172:$Vu,182:$Vv,200:$Vw,291:$VQ,292:106,293:$VR,297:$VS},{133:[1,532]},{3:87,4:$V2,5:$V3,76:75,79:71,80:79,86:$V6,106:534,133:$V7,134:77,135:74,136:$V8,137:73,138:70,139:72,140:76,141:78,142:80,143:81,144:82,145:83,146:84,147:$V9,148:$Va,150:$Vb,152:86,153:$Vc,154:$Vd,155:$Ve,156:$Vf,157:$Vg,158:$Vh,159:$Vi,160:$Vj,161:$Vk,163:$Vl,164:$Vm,165:$Vn,166:$Vo,167:$Vp,168:$Vq,169:$Vr,170:$Vs,171:$Vt,172:$Vu,182:$Vv,200:$Vw,215:533,291:$VQ,292:106,293:$VR,297:$VS},o($Vu1,[2,404]),o($Vu1,[2,426]),o($VP1,[2,433]),o($VQ1,[2,421]),o([8,9,85,87,92,96,97,98,99,100,101,102,103,104,109,110,120,121,122,123,129,190,299,301],$V32,{89:[1,535]}),o($Vu1,[2,423]),o($VS1,[2,428]),o($VS1,[2,430]),o($VS1,[2,431]),o($VS1,[2,432]),{3:536,4:$V2,5:$V3},{3:537,4:$V2,5:$V3},{3:539,4:$V2,5:$V3,252:538},{3:539,4:$V2,5:$V3,252:540},{3:541,4:$V2,5:$V3},{3:87,4:$V2,5:$V3,76:75,79:71,80:79,86:$V6,106:345,133:$V7,134:77,135:74,136:$V8,137:73,138:70,139:72,140:76,141:78,142:80,143:81,144:82,145:83,146:84,147:$V9,148:$Va,150:$Vb,152:86,153:$Vc,154:$Vd,155:$Ve,156:$Vf,157:$Vg,158:$Vh,159:$Vi,160:$Vj,161:$Vk,162:542,163:$Vl,164:$Vm,165:$Vn,166:$Vo,167:$Vp,168:$Vq,169:$Vr,170:$Vs,171:$Vt,172:$Vu,182:$Vv,200:$Vw,291:$VQ,292:106,293:$VR,297:$VS},{3:543,4:$V2,5:$V3},o($Vz1,[2,301]),o($V0,$Vk2,{269:544,86:[1,545],88:$Vl2}),{86:[1,547]},{3:156,4:$V2,5:$V3,78:548},{3:539,4:$V2,5:$V3,88:[1,551],221:549,232:550,252:552},{3:553,4:$V2,5:$V3},o($V0,[2,382]),{85:$Vm2,87:[1,554]},o($V22,[2,322]),o($VT1,[2,386]),o($V0,[2,263],{196:175,136:$VZ,180:$V_,181:$V$,182:$V01,183:$V11,184:$V21,185:$V31,186:$V41,187:$V51,188:$V61,189:$V71,190:$V81,191:$V91,192:$Va1,193:$Vb1,194:$Vc1,195:$Vd1,198:$Ve1,199:$Vf1,200:$Vg1,201:$Vh1,202:$Vi1,203:$Vj1}),o($V0,[2,364]),o($V0,[2,265],{85:$Vn2}),{3:87,4:$V2,5:$V3,76:75,79:71,80:79,86:$V6,106:534,133:$V7,134:77,135:74,136:$V8,137:73,138:70,139:72,140:76,141:78,142:80,143:81,144:82,145:83,146:84,147:$V9,148:$Va,150:$Vb,152:86,153:$Vc,154:$Vd,155:$Ve,156:$Vf,157:$Vg,158:$Vh,159:$Vi,160:$Vj,161:$Vk,163:$Vl,164:$Vm,165:$Vn,166:$Vo,167:$Vp,168:$Vq,169:$Vr,170:$Vs,171:$Vt,172:$Vu,182:$Vv,200:$Vw,215:557,291:$VQ,292:106,293:$VR,297:$VS},o($Vo2,[2,271]),o($Vo2,[2,272]),o($V0,[2,266]),{85:$Vp2,87:[1,558]},o($Vh2,[2,284]),o($V0,[2,350]),o($Vq2,[2,132],{61:560,123:[1,561]}),{111:[1,562]},o($VU1,[2,116],{196:175,136:$VZ,180:$V_,181:$V$,182:$V01,183:$V11,184:$V21,185:$V31,186:$V41,187:$V51,188:$V61,189:$V71,190:$V81,191:$V91,192:$Va1,193:$Vb1,194:$Vc1,195:$Vd1,198:$Ve1,199:$Vf1,200:$Vg1,201:$Vh1,202:$Vi1,203:$Vj1}),{3:286,4:$V2,5:$V3,78:400,79:402,80:401,83:563,86:$VV1,168:$Vq,169:$Vr,170:$Vs,171:$Vt},o($VE1,[2,68],{91:487,95:488,90:564,92:$V72,96:$V82,97:$V92,98:$Va2,99:$Vb2,100:$Vc2,101:$Vd2,102:$Ve2,103:$Vf2,104:$Vg2}),o($Vr2,[2,87]),{92:[1,565]},{92:[2,99]},{92:$V72,95:566,97:$V92,98:$Va2,99:$Vb2,100:$Vc2,101:$Vd2,102:$Ve2,103:$Vf2,104:$Vg2},{92:[2,102]},{92:[2,103],99:[1,567]},{92:[2,105],99:[1,568]},{92:[2,107]},{99:[1,569]},{92:[2,109]},{92:[2,110]},{92:[2,111]},{87:[1,570]},o($Vh2,[2,75]),{3:571,4:$V2,5:$V3},o($Vh2,[2,78]),{3:572,4:$V2,5:$V3},o($Vh2,[2,82]),{3:573,4:$V2,5:$V3},{3:574,4:$V2,5:$V3},{3:575,4:$V2,5:$V3},o($V0,[2,371]),{3:576,4:$V2,5:$V3},{134:577,165:$Vn},{3:87,4:$V2,5:$V3,76:75,79:71,80:79,86:$V6,106:578,133:$V7,134:77,135:74,136:$V8,137:73,138:70,139:72,140:76,141:78,142:80,143:81,144:82,145:83,146:84,147:$V9,148:$Va,150:$Vb,152:86,153:$Vc,154:$Vd,155:$Ve,156:$Vf,157:$Vg,158:$Vh,159:$Vi,160:$Vj,161:$Vk,163:$Vl,164:$Vm,165:$Vn,166:$Vo,167:$Vp,168:$Vq,169:$Vr,170:$Vs,171:$Vt,172:$Vu,182:$Vv,200:$Vw,291:$VQ,292:106,293:$VR,297:$VS},{3:413,4:$V2,5:$V3,137:412,209:579},{3:87,4:$V2,5:$V3,76:75,79:71,80:79,86:$V6,106:580,133:$V7,134:77,135:74,136:$V8,137:73,138:70,139:72,140:76,141:78,142:80,143:81,144:82,145:83,146:84,147:$V9,148:$Va,150:$Vb,152:86,153:$Vc,154:$Vd,155:$Ve,156:$Vf,157:$Vg,158:$Vh,159:$Vi,160:$Vj,161:$Vk,163:$Vl,164:$Vm,165:$Vn,166:$Vo,167:$Vp,168:$Vq,169:$Vr,170:$Vs,171:$Vt,172:$Vu,182:$Vv,200:$Vw,291:$VQ,292:106,293:$VR,297:$VS},o($Vn1,[2,224]),{87:[1,581]},{85:$V02,87:[1,582]},o($Vn1,[2,243]),o($Vn1,[2,245]),{87:[1,583]},{85:$V02,87:[1,584]},o($V0,[2,387]),o($V$1,[2,144]),o($V$1,[2,146]),o($V$1,[2,148]),o($V$1,[2,150]),o($V22,[2,198],{196:175,136:$VZ,180:$V_,181:$V$,182:$V01,183:$V11,184:$V21,185:$V31,186:$V41,187:$V51,188:$V61,189:$V71,190:$V81,191:$V91,192:$Va1,193:$Vb1,194:$Vc1,195:$Vd1,198:$Ve1,199:$Vf1,200:$Vg1,201:$Vh1,202:$Vi1,203:$Vj1}),o($Vu1,[2,156]),o($Vn1,[2,153]),o($Vn1,[2,209]),o($VM1,[2,213],{196:175,136:$VZ,180:$V_,181:$V$,182:$V01,183:$V11,184:$V21,185:$V31,186:$V41,187:$V51,188:$V61,189:$V71,190:$V81,191:$V91,192:$Va1,193:$Vb1,194:$Vc1,195:$Vd1,198:$Ve1,199:$Vf1,200:$Vg1,201:$Vh1,202:$Vi1,203:$Vj1}),{87:[1,585]},{85:[1,587],87:[1,586],136:$VZ,180:$V_,181:$V$,182:$V01,183:$V11,184:$V21,185:$V31,186:$V41,187:$V51,188:$V61,189:$V71,190:$V81,191:$V91,192:$Va1,193:$Vb1,194:$Vc1,195:$Vd1,196:175,198:$Ve1,199:$Vf1,200:$Vg1,201:$Vh1,202:$Vi1,203:$Vj1},{85:[1,588],87:[1,589]},{85:$Vs2,87:[1,590]},o($V22,[2,276],{196:175,136:$VZ,180:$V_,181:$V$,182:$V01,183:$V11,184:$V21,185:$V31,186:$V41,187:$V51,188:$V61,189:$V71,190:$V81,191:$V91,192:$Va1,193:$Vb1,194:$Vc1,195:$Vd1,198:$Ve1,199:$Vf1,200:$Vg1,201:$Vh1,202:$Vi1,203:$Vj1}),{3:526,4:$V2,5:$V3},o($V0,[2,345]),{263:[1,592]},o($V0,[2,346]),{4:$VN1,149:593,254:[1,594],255:$VO1},o($V0,[2,347]),o($V0,[2,349]),{85:$V02,87:[1,595]},o($V0,[2,353]),o($V0,[2,357]),{3:87,4:$V2,5:$V3,76:75,79:71,80:79,86:$V6,106:345,133:$V7,134:77,135:74,136:$V8,137:73,138:70,139:72,140:76,141:78,142:80,143:81,144:82,145:83,146:84,147:$V9,148:$Va,150:$Vb,152:86,153:$Vc,154:$Vd,155:$Ve,156:$Vf,157:$Vg,158:$Vh,159:$Vi,160:$Vj,161:$Vk,162:596,163:$Vl,164:$Vm,165:$Vn,166:$Vo,167:$Vp,168:$Vq,169:$Vr,170:$Vs,171:$Vt,172:$Vu,182:$Vv,200:$Vw,291:$VQ,292:106,293:$VR,297:$VS},{3:597,4:$V2,5:$V3},{3:469,4:$V2,5:$V3,243:598},{86:[1,599]},{87:[1,600]},{85:[1,601],87:[2,303]},{29:602,56:51,64:69,70:$V5},o($V22,[2,324]),o($V0,[2,288],{86:$Vj2}),{88:[1,603]},{3:604,4:$V2,5:$V3},{80:607,86:[1,605],145:606,168:$Vq,169:$Vr,170:$Vs,171:$Vt,291:$VQ,292:106,293:$VR,297:$VS},{85:$Vs2,87:[1,608]},{29:610,56:51,64:69,70:$V5,212:[1,609]},{3:413,4:$V2,5:$V3,137:611},o($Vt2,[2,140],{62:612,129:[1,613]}),{111:[1,614]},{3:87,4:$V2,5:$V3,76:75,79:71,80:79,86:$V6,106:620,112:615,114:616,115:$Vu2,117:$Vv2,118:$Vw2,133:$V7,134:77,135:74,136:$V8,137:73,138:70,139:72,140:76,141:78,142:80,143:81,144:82,145:83,146:84,147:$V9,148:$Va,150:$Vb,152:86,153:$Vc,154:$Vd,155:$Ve,156:$Vf,157:$Vg,158:$Vh,159:$Vi,160:$Vj,161:$Vk,163:$Vl,164:$Vm,165:$Vn,166:$Vo,167:$Vp,168:$Vq,169:$Vr,170:$Vs,171:$Vt,172:$Vu,182:$Vv,200:$Vw,291:$VQ,292:106,293:$VR,297:$VS},o($V62,[2,71]),o($Vr2,[2,86]),{3:286,4:$V2,5:$V3,78:622,79:625,80:623,86:[1,624],93:621,168:$Vq,169:$Vr,170:$Vs,171:$Vt},{92:[2,100]},{92:[2,104]},{92:[2,106]},{92:[2,108]},o($Vh2,[2,74],{3:626,4:$V2,5:$V3,88:[1,627]}),o($Vh2,[2,76]),o($Vh2,[2,79]),o($Vh2,[2,83]),o($V0,[2,381]),o($V0,[2,377]),o($V0,[2,379]),o($V0,[2,375]),o($V0,[2,258],{196:175,136:$VZ,180:$V_,181:$V$,182:$V01,183:$V11,184:$V21,185:$V31,186:$V41,187:$V51,188:$V61,189:$V71,190:$V81,191:$V91,192:$Va1,193:$Vb1,194:$Vc1,195:$Vd1,198:$Ve1,199:$Vf1,200:$Vg1,201:$Vh1,202:$Vi1,203:$Vj1}),o($Vi2,[2,261]),o($Vi2,[2,262],{196:175,136:$VZ,180:$V_,181:$V$,182:$V01,183:$V11,184:$V21,185:$V31,186:$V41,187:$V51,188:$V61,189:$V71,190:$V81,191:$V91,192:$Va1,193:$Vb1,194:$Vc1,195:$Vd1,198:$Ve1,199:$Vf1,200:$Vg1,201:$Vh1,202:$Vi1,203:$Vj1}),o($Vn1,[2,236]),o($Vn1,[2,237]),o($Vn1,[2,244]),o($Vn1,[2,246]),o($Vn1,[2,176]),o($Vn1,[2,177]),{133:[1,628]},{133:[1,629]},o($VI1,[2,329]),o($VI1,[2,331]),{3:87,4:$V2,5:$V3,76:75,79:71,80:79,86:$V6,106:630,133:$V7,134:77,135:74,136:$V8,137:73,138:70,139:72,140:76,141:78,142:80,143:81,144:82,145:83,146:84,147:$V9,148:$Va,150:$Vb,152:86,153:$Vc,154:$Vd,155:$Ve,156:$Vf,157:$Vg,158:$Vh,159:$Vi,160:$Vj,161:$Vk,163:$Vl,164:$Vm,165:$Vn,166:$Vo,167:$Vp,168:$Vq,169:$Vr,170:$Vs,171:$Vt,172:$Vu,182:$Vv,200:$Vw,291:$VQ,292:106,293:$VR,297:$VS},{3:631,4:$V2,5:$V3},o($Vx2,[2,332],{253:632,256:633,257:634,200:$Vy2,214:$Vz2,226:$VA2,241:$VB2,244:$VC2,258:$VD2}),o($Vx2,[2,327]),o($V0,[2,352],{88:[1,641]}),{85:$V02,87:[1,642]},o($V0,[2,360]),{85:$Vm2,87:[1,643]},{3:469,4:$V2,5:$V3,243:644},o($V0,[2,289],{222:645,223:646,224:647,214:$VE2,225:$VF2,226:$VG2,227:$VH2}),o($VI2,$VJ2,{3:539,233:652,252:653,234:654,235:655,4:$V2,5:$V3,240:$VK2}),{87:[2,304]},{29:657,56:51,64:69,70:$V5},o($V22,[2,323]),{3:87,4:$V2,5:$V3,76:75,79:71,80:79,86:$V6,106:534,133:$V7,134:77,135:74,136:$V8,137:73,138:70,139:72,140:76,141:78,142:80,143:81,144:82,145:83,146:84,147:$V9,148:$Va,150:$Vb,152:86,153:$Vc,154:$Vd,155:$Ve,156:$Vf,157:$Vg,158:$Vh,159:$Vi,160:$Vj,161:$Vk,163:$Vl,164:$Vm,165:$Vn,166:$Vo,167:$Vp,168:$Vq,169:$Vr,170:$Vs,171:$Vt,172:$Vu,182:$Vv,200:$Vw,215:658,291:$VQ,292:106,293:$VR,297:$VS},o($Vo2,[2,274]),o($Vo2,[2,275]),o($Vo2,[2,270]),{80:476,86:$V42,145:475,168:$Vq,169:$Vr,170:$Vs,171:$Vt,213:659,291:$VQ,292:106,293:$VR,297:$VS},o($V0,[2,269]),o($Vh2,[2,285]),o($VL2,[2,127],{63:660,120:[1,661],121:[1,662],122:[1,663]}),{76:664,133:$V7},{3:87,4:$V2,5:$V3,76:75,79:71,80:79,86:$V6,106:667,124:665,125:666,133:$V7,134:77,135:74,136:$V8,137:73,138:70,139:72,140:76,141:78,142:80,143:81,144:82,145:83,146:84,147:$V9,148:$Va,150:$Vb,152:86,153:$Vc,154:$Vd,155:$Ve,156:$Vf,157:$Vg,158:$Vh,159:$Vi,160:$Vj,161:$Vk,163:$Vl,164:$Vm,165:$Vn,166:$Vo,167:$Vp,168:$Vq,169:$Vr,170:$Vs,171:$Vt,172:$Vu,182:$Vv,200:$Vw,291:$VQ,292:106,293:$VR,297:$VS},o($V52,[2,125],{113:668,85:$VM2,119:[1,670]}),o($VN2,[2,119]),{116:[1,671]},{86:[1,672]},{86:[1,673]},o($VN2,[2,124],{196:175,136:$VZ,180:$V_,181:$V$,182:$V01,183:$V11,184:$V21,185:$V31,186:$V41,187:$V51,188:$V61,189:$V71,190:$V81,191:$V91,192:$Va1,193:$Vb1,194:$Vc1,195:$Vd1,198:$Ve1,199:$Vf1,200:$Vg1,201:$Vh1,202:$Vi1,203:$Vj1}),o($Vr2,[2,114],{94:674,105:[1,675],107:[1,676]}),o($VO2,[2,89],{3:677,4:$V2,5:$V3,88:[1,678]}),{3:679,4:$V2,5:$V3,88:[1,680]},{29:681,56:51,64:69,70:$V5},o($VO2,[2,96],{3:682,4:$V2,5:$V3,88:[1,683]}),o($Vh2,[2,72]),{3:684,4:$V2,5:$V3},{87:[1,685]},{87:[1,686]},o($V22,[2,277],{196:175,136:$VZ,180:$V_,181:$V$,182:$V01,183:$V11,184:$V21,185:$V31,186:$V41,187:$V51,188:$V61,189:$V71,190:$V81,191:$V91,192:$Va1,193:$Vb1,194:$Vc1,195:$Vd1,198:$Ve1,199:$Vf1,200:$Vg1,201:$Vh1,202:$Vi1,203:$Vj1}),o($V0,[2,348]),o($Vx2,[2,326]),o($Vx2,[2,333],{257:687,200:$Vy2,214:$Vz2,226:$VA2,241:$VB2,244:$VC2,258:$VD2}),o($VI1,[2,335]),{242:[1,688]},{242:[1,689]},o($VI1,[2,338]),{86:[1,690]},{3:192,4:$V2,5:$V3,76:186,79:191,80:190,133:$V7,134:187,140:188,141:189,151:691,163:$Vl,164:$Vm,165:$Vn,166:$Vo,168:$Vq,169:$Vr,170:$Vs,171:$Vt},{166:[1,692]},{3:693,4:$V2,5:$V3},o($V0,$Vk2,{269:694,88:$Vl2}),o($V0,[2,365]),{85:$Vm2,87:[1,695]},o($V0,[2,286]),o($V0,[2,290],{224:696,214:$VE2,225:$VF2,226:$VG2,227:$VH2}),o($VP2,[2,292]),o($VP2,[2,293]),{190:[1,697]},{190:[1,698]},{190:[1,699]},{85:[1,700],87:[2,302]},o($V22,[2,325]),o($V22,[2,305]),{68:[1,707],236:701,237:702,238:703,239:704,241:[1,705],242:[1,709],244:[1,706],251:[1,708]},{3:710,4:$V2,5:$V3},o($V0,[2,383]),{85:$Vs2,87:[1,711]},o($V0,[2,267],{85:$Vn2}),o($VL2,[2,51]),{29:712,56:51,64:69,69:[1,713],70:$V5},{29:714,56:51,64:69,70:$V5},{29:715,56:51,64:69,70:$V5},o($Vt2,[2,142],{130:716,131:[1,717]}),o($Vq2,[2,133],{85:[1,718]}),o($VQ2,[2,134]),o($VQ2,[2,136],{196:175,126:[1,719],127:[1,720],136:$VZ,180:$V_,181:$V$,182:$V01,183:$V11,184:$V21,185:$V31,186:$V41,187:$V51,188:$V61,189:$V71,190:$V81,191:$V91,192:$Va1,193:$Vb1,194:$Vc1,195:$Vd1,198:$Ve1,199:$Vf1,200:$Vg1,201:$Vh1,202:$Vi1,203:$Vj1}),o($V52,[2,118]),{3:87,4:$V2,5:$V3,76:75,79:71,80:79,86:$V6,106:620,114:721,115:$Vu2,117:$Vv2,118:$Vw2,133:$V7,134:77,135:74,136:$V8,137:73,138:70,139:72,140:76,141:78,142:80,143:81,144:82,145:83,146:84,147:$V9,148:$Va,150:$Vb,152:86,153:$Vc,154:$Vd,155:$Ve,156:$Vf,157:$Vg,158:$Vh,159:$Vi,160:$Vj,161:$Vk,163:$Vl,164:$Vm,165:$Vn,166:$Vo,167:$Vp,168:$Vq,169:$Vr,170:$Vs,171:$Vt,172:$Vu,182:$Vv,200:$Vw,291:$VQ,292:106,293:$VR,297:$VS},{3:87,4:$V2,5:$V3,76:75,79:71,80:79,86:$V6,106:722,133:$V7,134:77,135:74,136:$V8,137:73,138:70,139:72,140:76,141:78,142:80,143:81,144:82,145:83,146:84,147:$V9,148:$Va,150:$Vb,152:86,153:$Vc,154:$Vd,155:$Ve,156:$Vf,157:$Vg,158:$Vh,159:$Vi,160:$Vj,161:$Vk,163:$Vl,164:$Vm,165:$Vn,166:$Vo,167:$Vp,168:$Vq,169:$Vr,170:$Vs,171:$Vt,172:$Vu,182:$Vv,200:$Vw,291:$VQ,292:106,293:$VR,297:$VS},{86:[1,723]},{3:87,4:$V2,5:$V3,76:75,79:71,80:79,86:$V6,106:620,112:724,114:616,115:$Vu2,117:$Vv2,118:$Vw2,133:$V7,134:77,135:74,136:$V8,137:73,138:70,139:72,140:76,141:78,142:80,143:81,144:82,145:83,146:84,147:$V9,148:$Va,150:$Vb,152:86,153:$Vc,154:$Vd,155:$Ve,156:$Vf,157:$Vg,158:$Vh,159:$Vi,160:$Vj,161:$Vk,163:$Vl,164:$Vm,165:$Vn,166:$Vo,167:$Vp,168:$Vq,169:$Vr,170:$Vs,171:$Vt,172:$Vu,182:$Vv,200:$Vw,291:$VQ,292:106,293:$VR,297:$VS},{3:87,4:$V2,5:$V3,76:75,79:71,80:79,86:$V6,106:620,112:725,114:616,115:$Vu2,117:$Vv2,118:$Vw2,133:$V7,134:77,135:74,136:$V8,137:73,138:70,139:72,140:76,141:78,142:80,143:81,144:82,145:83,146:84,147:$V9,148:$Va,150:$Vb,152:86,153:$Vc,154:$Vd,155:$Ve,156:$Vf,157:$Vg,158:$Vh,159:$Vi,160:$Vj,161:$Vk,163:$Vl,164:$Vm,165:$Vn,166:$Vo,167:$Vp,168:$Vq,169:$Vr,170:$Vs,171:$Vt,172:$Vu,182:$Vv,200:$Vw,291:$VQ,292:106,293:$VR,297:$VS},o($Vr2,[2,88]),{3:87,4:$V2,5:$V3,76:75,79:71,80:79,86:$V6,106:726,133:$V7,134:77,135:74,136:$V8,137:73,138:70,139:72,140:76,141:78,142:80,143:81,144:82,145:83,146:84,147:$V9,148:$Va,150:$Vb,152:86,153:$Vc,154:$Vd,155:$Ve,156:$Vf,157:$Vg,158:$Vh,159:$Vi,160:$Vj,161:$Vk,163:$Vl,164:$Vm,165:$Vn,166:$Vo,167:$Vp,168:$Vq,169:$Vr,170:$Vs,171:$Vt,172:$Vu,182:$Vv,200:$Vw,291:$VQ,292:106,293:$VR,297:$VS},{3:413,4:$V2,5:$V3,108:727,137:479},o($VO2,[2,90]),{3:728,4:$V2,5:$V3},o($VO2,[2,92]),{3:729,4:$V2,5:$V3},{87:[1,730]},o($VO2,[2,97]),{3:731,4:$V2,5:$V3},o($Vh2,[2,73]),o($Vn1,[2,178]),o($VI1,[2,328]),o($VI1,[2,334]),o($VI1,[2,336]),{245:[1,732]},{76:733,133:$V7},o($VI1,[2,340]),o($VI1,[2,341]),o($V0,[2,354]),o($V0,[2,358]),o($V0,[2,366]),o($VP2,[2,291]),{3:734,4:$V2,5:$V3},{76:735,133:$V7},{3:736,4:$V2,5:$V3},o($VI2,$VJ2,{235:655,234:737,240:$VK2}),o($V22,[2,307]),o($V22,[2,308]),o($V22,[2,309]),o($V22,[2,310]),{242:[1,738]},{242:[1,739]},o($V22,[2,319]),{3:740,4:$V2,5:$V3},{3:741,4:$V2,5:$V3},o($VI2,[2,312]),o($Vo2,[2,273]),o($VL2,[2,128]),{29:742,56:51,64:69,70:$V5},o($VL2,[2,130]),o($VL2,[2,131]),o($Vt2,[2,141]),{76:743,133:$V7},{3:87,4:$V2,5:$V3,76:75,79:71,80:79,86:$V6,106:667,125:744,133:$V7,134:77,135:74,136:$V8,137:73,138:70,139:72,140:76,141:78,142:80,143:81,144:82,145:83,146:84,147:$V9,148:$Va,150:$Vb,152:86,153:$Vc,154:$Vd,155:$Ve,156:$Vf,157:$Vg,158:$Vh,159:$Vi,160:$Vj,161:$Vk,163:$Vl,164:$Vm,165:$Vn,166:$Vo,167:$Vp,168:$Vq,169:$Vr,170:$Vs,171:$Vt,172:$Vu,182:$Vv,200:$Vw,291:$VQ,292:106,293:$VR,297:$VS},o($VQ2,[2,137]),{128:[1,745]},o($VN2,[2,120]),o($V52,[2,126],{196:175,136:$VZ,180:$V_,181:$V$,182:$V01,183:$V11,184:$V21,185:$V31,186:$V41,187:$V51,188:$V61,189:$V71,190:$V81,191:$V91,192:$Va1,193:$Vb1,194:$Vc1,195:$Vd1,198:$Ve1,199:$Vf1,200:$Vg1,201:$Vh1,202:$Vi1,203:$Vj1}),{3:87,4:$V2,5:$V3,76:75,79:71,80:79,86:$V6,106:620,112:746,114:616,115:$Vu2,117:$Vv2,118:$Vw2,133:$V7,134:77,135:74,136:$V8,137:73,138:70,139:72,140:76,141:78,142:80,143:81,144:82,145:83,146:84,147:$V9,148:$Va,150:$Vb,152:86,153:$Vc,154:$Vd,155:$Ve,156:$Vf,157:$Vg,158:$Vh,159:$Vi,160:$Vj,161:$Vk,163:$Vl,164:$Vm,165:$Vn,166:$Vo,167:$Vp,168:$Vq,169:$Vr,170:$Vs,171:$Vt,172:$Vu,182:$Vv,200:$Vw,291:$VQ,292:106,293:$VR,297:$VS},{85:$VM2,87:[1,747]},{85:$VM2,87:[1,748]},o($Vr2,[2,112],{196:175,136:$VZ,180:$V_,181:$V$,182:$V01,183:$V11,184:$V21,185:$V31,186:$V41,187:$V51,188:$V61,189:$V71,190:$V81,191:$V91,192:$Va1,193:$Vb1,194:$Vc1,195:$Vd1,198:$Ve1,199:$Vf1,200:$Vg1,201:$Vh1,202:$Vi1,203:$Vj1}),o($Vr2,[2,113],{85:$Vp2}),o($VO2,[2,91]),o($VO2,[2,93]),{3:749,4:$V2,5:$V3,88:[1,750]},o($VO2,[2,98]),{3:751,4:$V2,5:$V3},{85:[1,752]},o($VP2,[2,294]),o($VP2,[2,295]),o($VP2,[2,296]),o($V22,[2,306]),{86:[1,753]},{86:[1,754]},{86:[1,755]},{86:[1,756]},o($VL2,[2,129]),o($Vt2,[2,143]),o($VQ2,[2,135]),o($VQ2,[2,138],{126:[1,757]}),{85:$VM2,87:[1,758]},o($VN2,[2,122]),o($VN2,[2,123]),o($VO2,[2,94]),{3:759,4:$V2,5:$V3},{86:[1,760]},{76:761,133:$V7},{3:469,4:$V2,5:$V3,243:762},{3:469,4:$V2,5:$V3,243:763},{3:413,4:$V2,5:$V3,108:764,137:479},{3:413,4:$V2,5:$V3,108:765,137:479},o($VQ2,[2,139]),o($VN2,[2,121]),o($VO2,[2,95]),{3:766,4:$V2,5:$V3},{87:[1,767]},{85:$Vm2,87:[1,768]},{85:$Vm2,87:[1,769]},{85:$Vp2,87:[1,770]},{85:$Vp2,87:[1,771]},{87:[1,772]},o($VI1,[2,339]),o($V22,[2,313]),{245:[1,773]},o($V22,[2,320]),o($V22,[2,321]),o($VI1,[2,337]),{3:774,4:$V2,5:$V3},{86:[1,775]},{3:469,4:$V2,5:$V3,243:776},{85:$Vm2,87:[1,777]},o($V22,[2,315],{246:778,247:779,105:[1,780]}),o($V22,[2,314]),{105:[1,782],248:781},{210:[1,783]},o($V22,[2,316]),{206:[1,784]},{249:[1,785]},{249:[1,786]},{250:[1,787]},{250:[1,788]},{105:[2,317]},o($V22,[2,318])],defaultActions:{109:[2,186],110:[2,187],111:[2,188],112:[2,189],113:[2,190],114:[2,191],115:[2,192],116:[2,193],117:[2,194],121:[2,3],199:[2,391],200:[2,392],201:[2,393],202:[2,394],318:[2,255],319:[2,256],320:[2,257],333:[2,395],334:[2,396],488:[2,99],490:[2,102],493:[2,107],495:[2,109],496:[2,110],497:[2,111],566:[2,100],567:[2,104],568:[2,106],569:[2,108],602:[2,304],787:[2,317]},parseError:function parseError(str,hash){if(hash.recoverable){this.trace(str)
}else{throw new Error(str)}},parse:function parse(input){var self=this,stack=[0],tstack=[],vstack=[null],lstack=[],table=this.table,yytext="",yylineno=0,yyleng=0,recovering=0,TERROR=2,EOF=1;var args=lstack.slice.call(arguments,1);var lexer=Object.create(this.lexer);var sharedState={yy:{}};for(var k in this.yy){if(Object.prototype.hasOwnProperty.call(this.yy,k)){sharedState.yy[k]=this.yy[k]}}lexer.setInput(input,sharedState.yy);sharedState.yy.lexer=lexer;sharedState.yy.parser=this;if(typeof lexer.yylloc=="undefined"){lexer.yylloc={}}var yyloc=lexer.yylloc;lstack.push(yyloc);var ranges=lexer.options&&lexer.options.ranges;if(typeof sharedState.yy.parseError==="function"){this.parseError=sharedState.yy.parseError}else{this.parseError=Object.getPrototypeOf(this).parseError}function popStack(n){stack.length=stack.length-2*n;vstack.length=vstack.length-n;lstack.length=lstack.length-n}_token_stack:function lex(){var token;token=lexer.lex()||EOF;if(typeof token!=="number"){token=self.symbols_[token]||token}return token}var symbol,preErrorSymbol,state,action,a,r,yyval={},p,len,newState,expected;while(true){state=stack[stack.length-1];if(this.defaultActions[state]){action=this.defaultActions[state]}else{if(symbol===null||typeof symbol=="undefined"){symbol=lex()}action=table[state]&&table[state][symbol]}if(typeof action==="undefined"||!action.length||!action[0]){var errStr="";expected=[];for(p in table[state]){if(this.terminals_[p]&&p>TERROR){expected.push("'"+this.terminals_[p]+"'")}}if(lexer.showPosition){errStr="Parse error on line "+(yylineno+1)+":\n"+lexer.showPosition()+"\nExpecting "+expected.join(", ")+", got '"+(this.terminals_[symbol]||symbol)+"'"}else{errStr="Parse error on line "+(yylineno+1)+": Unexpected "+(symbol==EOF?"end of input":"'"+(this.terminals_[symbol]||symbol)+"'")}this.parseError(errStr,{text:lexer.match,token:this.terminals_[symbol]||symbol,line:lexer.yylineno,loc:yyloc,expected:expected})}if(action[0]instanceof Array&&action.length>1){throw new Error("Parse Error: multiple actions possible at state: "+state+", token: "+symbol)}switch(action[0]){case 1:stack.push(symbol);vstack.push(lexer.yytext);lstack.push(lexer.yylloc);stack.push(action[1]);symbol=null;if(!preErrorSymbol){yyleng=lexer.yyleng;yytext=lexer.yytext;yylineno=lexer.yylineno;yyloc=lexer.yylloc;if(recovering>0){recovering--}}else{symbol=preErrorSymbol;preErrorSymbol=null}break;case 2:len=this.productions_[action[1]][1];yyval.$=vstack[vstack.length-len];yyval._$={first_line:lstack[lstack.length-(len||1)].first_line,last_line:lstack[lstack.length-1].last_line,first_column:lstack[lstack.length-(len||1)].first_column,last_column:lstack[lstack.length-1].last_column};if(ranges){yyval._$.range=[lstack[lstack.length-(len||1)].range[0],lstack[lstack.length-1].range[1]]}r=this.performAction.apply(yyval,[yytext,yyleng,yylineno,sharedState.yy,action[1],vstack,lstack].concat(args));if(typeof r!=="undefined"){return r}if(len){stack=stack.slice(0,-1*len*2);vstack=vstack.slice(0,-1*len);lstack=lstack.slice(0,-1*len)}stack.push(this.productions_[action[1]][0]);vstack.push(yyval.$);lstack.push(yyval._$);newState=table[stack[stack.length-2]][stack[stack.length-1]];stack.push(newState);break;case 3:return true}}return true}};var lexer=function(){var lexer={EOF:1,parseError:function parseError(str,hash){if(this.yy.parser){this.yy.parser.parseError(str,hash)}else{throw new Error(str)}},setInput:function(input,yy){this.yy=yy||this.yy||{};this._input=input;this._more=this._backtrack=this.done=false;this.yylineno=this.yyleng=0;this.yytext=this.matched=this.match="";this.conditionStack=["INITIAL"];this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0};if(this.options.ranges){this.yylloc.range=[0,0]}this.offset=0;return this},input:function(){var ch=this._input[0];this.yytext+=ch;this.yyleng++;this.offset++;this.match+=ch;this.matched+=ch;var lines=ch.match(/(?:\r\n?|\n).*/g);if(lines){this.yylineno++;this.yylloc.last_line++}else{this.yylloc.last_column++}if(this.options.ranges){this.yylloc.range[1]++}this._input=this._input.slice(1);return ch},unput:function(ch){var len=ch.length;var lines=ch.split(/(?:\r\n?|\n)/g);this._input=ch+this._input;this.yytext=this.yytext.substr(0,this.yytext.length-len);this.offset-=len;var oldLines=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1);this.matched=this.matched.substr(0,this.matched.length-1);if(lines.length-1){this.yylineno-=lines.length-1}var r=this.yylloc.range;this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:lines?(lines.length===oldLines.length?this.yylloc.first_column:0)+oldLines[oldLines.length-lines.length].length-lines[0].length:this.yylloc.first_column-len};if(this.options.ranges){this.yylloc.range=[r[0],r[0]+this.yyleng-len]}this.yyleng=this.yytext.length;return this},more:function(){this._more=true;return this},reject:function(){if(this.options.backtrack_lexer){this._backtrack=true}else{return this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})}return this},less:function(n){this.unput(this.match.slice(n))},pastInput:function(){var past=this.matched.substr(0,this.matched.length-this.match.length);return(past.length>20?"...":"")+past.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var next=this.match;if(next.length<20){next+=this._input.substr(0,20-next.length)}return(next.substr(0,20)+(next.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var pre=this.pastInput();var c=new Array(pre.length+1).join("-");return pre+this.upcomingInput()+"\n"+c+"^"},test_match:function(match,indexed_rule){var token,lines,backup;if(this.options.backtrack_lexer){backup={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done};if(this.options.ranges){backup.yylloc.range=this.yylloc.range.slice(0)}}lines=match[0].match(/(?:\r\n?|\n).*/g);if(lines){this.yylineno+=lines.length}this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:lines?lines[lines.length-1].length-lines[lines.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+match[0].length};this.yytext+=match[0];this.match+=match[0];this.matches=match;this.yyleng=this.yytext.length;if(this.options.ranges){this.yylloc.range=[this.offset,this.offset+=this.yyleng]}this._more=false;this._backtrack=false;this._input=this._input.slice(match[0].length);this.matched+=match[0];token=this.performAction.call(this,this.yy,this,indexed_rule,this.conditionStack[this.conditionStack.length-1]);if(this.done&&this._input){this.done=false}if(token){return token}else if(this._backtrack){for(var k in backup){this[k]=backup[k]}return false}return false},next:function(){if(this.done){return this.EOF}if(!this._input){this.done=true}var token,match,tempMatch,index;if(!this._more){this.yytext="";this.match=""}var rules=this._currentRules();for(var i=0;i<rules.length;i++){tempMatch=this._input.match(this.rules[rules[i]]);if(tempMatch&&(!match||tempMatch[0].length>match[0].length)){match=tempMatch;index=i;if(this.options.backtrack_lexer){token=this.test_match(tempMatch,rules[i]);if(token!==false){return token}else if(this._backtrack){match=false;continue}else{return false}}else if(!this.options.flex){break}}}if(match){token=this.test_match(match,rules[index]);if(token!==false){return token}return false}if(this._input===""){return this.EOF}else{return this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})}},lex:function lex(){var r=this.next();if(r){return r}else{return this.lex()}},begin:function begin(condition){this.conditionStack.push(condition)},popState:function popState(){var n=this.conditionStack.length-1;if(n>0){return this.conditionStack.pop()}else{return this.conditionStack[0]}},_currentRules:function _currentRules(){if(this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]){return this.conditions[this.conditionStack[this.conditionStack.length-1]].rules}else{return this.conditions["INITIAL"].rules}},topState:function topState(n){n=this.conditionStack.length-1-Math.abs(n||0);if(n>=0){return this.conditionStack[n]}else{return"INITIAL"}},pushState:function pushState(condition){this.begin(condition)},stateStackSize:function stateStackSize(){return this.conditionStack.length},options:{"case-insensitive":true},performAction:function anonymous(yy,yy_,$avoiding_name_collisions,YY_START){var YYSTATE=YY_START;switch($avoiding_name_collisions){case 0:return 171;break;case 1:return 293;break;case 2:return 5;break;case 3:return 5;break;case 4:return 165;break;case 5:return 165;break;case 6:return;break;case 7:return;break;case 8:break;case 9:return 199;break;case 10:return 198;break;case 11:return 286;break;case 12:return 250;break;case 13:return 264;break;case 14:return 160;break;case 15:return 69;break;case 16:return 261;break;case 17:return 198;break;case 18:return 103;break;case 19:return 205;break;case 20:return 161;break;case 21:return 88;break;case 22:return 290;break;case 23:return 126;break;case 24:return 266;break;case 25:return 226;break;case 26:return 303;break;case 27:return 157;break;case 28:return 309;break;case 29:return 202;break;case 30:return 203;break;case 31:return 111;break;case 32:return 172;break;case 33:return 148;break;case 34:return 227;break;case 35:return 281;break;case 36:return 127;break;case 37:return"COLUMN";break;case 38:return"COLUMNS";break;case 39:return"COMMIT";break;case 40:return"CONSTRAINT";break;case 41:return"CONVERT";break;case 42:return"COUNT";break;case 43:return 218;break;case 44:return"CROSS";break;case 45:return 118;break;case 46:return"CURSOR";break;case 47:return 267;break;case 48:return 272;break;case 49:return 277;break;case 50:return 214;break;case 51:return 210;break;case 52:return 126;break;case 53:return 268;break;case 54:return 65;break;case 55:return 259;break;case 56:return 175;break;case 57:return 225;break;case 58:return 255;break;case 59:return 179;break;case 60:return 121;break;case 61:return 167;break;case 62:return 12;break;case 63:return 164;break;case 64:return 282;break;case 65:return 158;break;case 66:return 244;break;case 67:return 81;break;case 68:return 110;break;case 69:return 115;break;case 70:return 119;break;case 71:return 288;break;case 72:return 231;break;case 73:return 258;break;case 74:return 201;break;case 75:return 251;break;case 76:return 97;break;case 77:return 211;break;case 78:return 122;break;case 79:return 77;break;case 80:return 92;break;case 81:return 242;break;case 82:return 159;break;case 83:return 98;break;case 84:return 180;break;case 85:return 129;break;case 86:return 289;break;case 87:return 74;break;case 88:return"MAX";break;case 89:return"MIN";break;case 90:return"EXCEPT";break;case 91:return"MODIFY";break;case 92:return 96;break;case 93:return 284;break;case 94:return 147;break;case 95:return 128;break;case 96:return 249;break;case 97:return 200;break;case 98:return 166;break;case 99:return 305;break;case 100:return 105;break;case 101:return 131;break;case 102:return 280;break;case 103:return 199;break;case 104:return 123;break;case 105:return 99;break;case 106:return 14;break;case 107:return 241;break;case 108:return 285;break;case 109:return 13;break;case 110:return 245;break;case 111:return 287;break;case 112:return 262;break;case 113:return 311;break;case 114:return 100;break;case 115:return 308;break;case 116:return 117;break;case 117:return 72;break;case 118:return 267;break;case 119:return 272;break;case 120:return 70;break;case 121:return 102;break;case 122:return 207;break;case 123:return 116;break;case 124:return 271;break;case 125:return 204;break;case 126:return 310;break;case 127:return"SUM";break;case 128:return 219;break;case 129:return 273;break;case 130:return 178;break;case 131:return 263;break;case 132:return 75;break;case 133:return"TRAN";break;case 134:return 307;break;case 135:return 163;break;case 136:return 120;break;case 137:return 68;break;case 138:return 206;break;case 139:return 270;break;case 140:return 107;break;case 141:return 71;break;case 142:return 212;break;case 143:return 275;break;case 144:return 177;break;case 145:return 109;break;case 146:return 133;break;case 147:return 185;break;case 148:return 181;break;case 149:return 182;break;case 150:return 136;break;case 151:return 183;break;case 152:return 184;break;case 153:return 195;break;case 154:return 192;break;case 155:return 194;break;case 156:return 191;break;case 157:return 187;break;case 158:return 186;break;case 159:return 189;break;case 160:return 193;break;case 161:return 188;break;case 162:return 190;break;case 163:return 193;break;case 164:return 86;break;case 165:return 87;break;case 166:return 291;break;case 167:return 297;break;case 168:return 299;break;case 169:return 301;break;case 170:return 89;break;case 171:return 85;break;case 172:return 169;break;case 173:return 9;break;case 174:return 168;break;case 175:return 170;break;case 176:return 4;break;case 177:return 8;break;case 178:return"INVALID";break}},rules:[/^(?:\[\?\])/i,/^(?:@\[)/i,/^(?:\[([^\]])*?\])/i,/^(?:`([^\]])*?`)/i,/^(?:(['](\\.|[^']|\\')*?['])+)/i,/^(?:(["](\\.|[^"]|\\")*?["])+)/i,/^(?:\/\*(.*?)\*\/)/i,/^(?:--(.*?)($|\r\n|\r|\n))/i,/^(?:\s+)/i,/^(?:\|\|)/i,/^(?:&&)/i,/^(?:ABSOLUTE\b)/i,/^(?:ACTION\b)/i,/^(?:ADD\b)/i,/^(?:AGGR\b)/i,/^(?:ALL\b)/i,/^(?:ALTER\b)/i,/^(?:AND\b)/i,/^(?:ANTI\b)/i,/^(?:ANY\b)/i,/^(?:ARRAY\b)/i,/^(?:AS\b)/i,/^(?:ASSERT\b)/i,/^(?:ASC\b)/i,/^(?:ATTACH\b)/i,/^(?:AUTO_INCREMENT\b)/i,/^(?:AUTOCOMMIT\b)/i,/^(?:AVG\b)/i,/^(?:BEGIN\b)/i,/^(?:BETWEEN\b)/i,/^(?:NOT BETWEEN\b)/i,/^(?:BY\b)/i,/^(?:CASE\b)/i,/^(?:CAST\b)/i,/^(?:CHARSET\b)/i,/^(?:CLOSE\b)/i,/^(?:COLLATE\b)/i,/^(?:COLUMN\b)/i,/^(?:COLUMNS\b)/i,/^(?:COMMIT\b)/i,/^(?:CONSTRAINT\b)/i,/^(?:CONVERT\b)/i,/^(?:COUNT\b)/i,/^(?:CREATE\b)/i,/^(?:CROSS\b)/i,/^(?:CUBE\b)/i,/^(?:CURSOR\b)/i,/^(?:DATABASE\b)/i,/^(?:DATABASES\b)/i,/^(?:DECLARE\b)/i,/^(?:DEFAULT\b)/i,/^(?:DELETE\b)/i,/^(?:DESC\b)/i,/^(?:DETACH\b)/i,/^(?:DISTINCT\b)/i,/^(?:DROP\b)/i,/^(?:END\b)/i,/^(?:ENGINE\b)/i,/^(?:ENUM\b)/i,/^(?:ELSE\b)/i,/^(?:EXCEPT\b)/i,/^(?:EXISTS\b)/i,/^(?:EXPLAIN\b)/i,/^(?:FALSE\b)/i,/^(?:FETCH\b)/i,/^(?:FIRST\b)/i,/^(?:FOREIGN\b)/i,/^(?:FROM\b)/i,/^(?:GROUP\b)/i,/^(?:GROUPING\b)/i,/^(?:HAVING\b)/i,/^(?:HELP\b)/i,/^(?:IF\b)/i,/^(?:IDENTITY\b)/i,/^(?:IN\b)/i,/^(?:INDEX\b)/i,/^(?:INNER\b)/i,/^(?:INSERT\b)/i,/^(?:INTERSECT\b)/i,/^(?:INTO\b)/i,/^(?:JOIN\b)/i,/^(?:KEY\b)/i,/^(?:LAST\b)/i,/^(?:LEFT\b)/i,/^(?:LIKE\b)/i,/^(?:LIMIT\b)/i,/^(?:SOURCE\b)/i,/^(?:MATRIX\b)/i,/^(?:MAX\b)/i,/^(?:MIN\b)/i,/^(?:MINUS\b)/i,/^(?:MODIFY\b)/i,/^(?:NATURAL\b)/i,/^(?:NEXT\b)/i,/^(?:NEW\b)/i,/^(?:NOCASE\b)/i,/^(?:NO\b)/i,/^(?:NOT\b)/i,/^(?:NULL\b)/i,/^(?:OFF\b)/i,/^(?:ON\b)/i,/^(?:OFFSET\b)/i,/^(?:OPEN\b)/i,/^(?:OR\b)/i,/^(?:ORDER\b)/i,/^(?:OUTER\b)/i,/^(?:PLAN\b)/i,/^(?:PRIMARY\b)/i,/^(?:PRIOR\b)/i,/^(?:QUERY\b)/i,/^(?:REFERENCES\b)/i,/^(?:RELATIVE\b)/i,/^(?:RENAME\b)/i,/^(?:RESTORE\b)/i,/^(?:RIGHT\b)/i,/^(?:ROLLBACK\b)/i,/^(?:ROLLUP\b)/i,/^(?:ROW\b)/i,/^(?:SCHEMA\b)/i,/^(?:SCHEMAS\b)/i,/^(?:SELECT\b)/i,/^(?:SEMI\b)/i,/^(?:SET\b)/i,/^(?:SETS\b)/i,/^(?:SHOW\b)/i,/^(?:SOME\b)/i,/^(?:STORE\b)/i,/^(?:SUM\b)/i,/^(?:TABLE\b)/i,/^(?:TABLES\b)/i,/^(?:THEN\b)/i,/^(?:TO\b)/i,/^(?:TOP\b)/i,/^(?:TRAN\b)/i,/^(?:TRANSACTION\b)/i,/^(?:TRUE\b)/i,/^(?:UNION\b)/i,/^(?:UNIQUE\b)/i,/^(?:UPDATE\b)/i,/^(?:USE\b)/i,/^(?:USING\b)/i,/^(?:VALUE\b)/i,/^(?:VALUES\b)/i,/^(?:VIEW\b)/i,/^(?:WHEN\b)/i,/^(?:WHERE\b)/i,/^(?:(\d*[.])?\d+)/i,/^(?:->)/i,/^(?:\+)/i,/^(?:-)/i,/^(?:\*)/i,/^(?:\/)/i,/^(?:%)/i,/^(?:!===)/i,/^(?:===)/i,/^(?:!==)/i,/^(?:==)/i,/^(?:>=)/i,/^(?:>)/i,/^(?:<=)/i,/^(?:<>)/i,/^(?:<)/i,/^(?:=)/i,/^(?:!=)/i,/^(?:\()/i,/^(?:\))/i,/^(?:@)/i,/^(?:\{)/i,/^(?:\})/i,/^(?:\])/i,/^(?:\.)/i,/^(?:,)/i,/^(?::)/i,/^(?:;)/i,/^(?:\$)/i,/^(?:\?)/i,/^(?:[a-zA-Z_][a-zA-Z_0-9]*)/i,/^(?:$)/i,/^(?:.)/i],conditions:{INITIAL:{rules:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178],inclusive:true}}};return lexer}();parser.lexer=lexer;function Parser(){this.yy={}}Parser.prototype=parser;parser.Parser=Parser;return new Parser}();if(typeof require!=="undefined"&&typeof exports!=="undefined"){exports.parser=parser;exports.Parser=parser.Parser;exports.parse=function(){return parser.parse.apply(parser,arguments)};exports.main=function commonjsMain(args){if(!args[1]){console.log("Usage: "+args[0]+" FILE");process.exit(1)}var source=require("fs").readFileSync(require("path").normalize(args[1]),"utf8");return exports.parser.parse(source)};if(typeof module!=="undefined"&&require.main===module){exports.main(process.argv.slice(1))}}alasql.prettyflag=false;alasql.pretty=function(sql,flag){var pf=alasql.prettyflag;alasql.prettyflag=!flag;var s=alasql.parse(sql).toString();alasql.prettyflag=pf;return s};function K(s){if(alasql.prettyflag){return'<b style="color:blue">'+s.toUpperCase()+"</b>"}else{return s}}function P(s){if(alasql.prettyflag){return'<span style="color:green">'+s+"</span>"}else{return s}}function L(s){if(alasql.prettyflag){return'<span style="color:red">'+s+"</span>"}else{return s}}function N(s){if(alasql.prettyflag){return'<span style="color:green">'+s+"</span>"}else{return s}}function S(s){if(alasql.prettyflag){return'<span style="color:green">'+s+"</span>"}else{return s}}function NL(){if(alasql.prettyflag){return"<br/>"}else{return"\n"}}function ID(){if(alasql.prettyflag){return" "}else{return" "}}var utils=alasql.utils={};function returnTrue(){return true}function returnUndefined(){}var escapeq=utils.escapeq=function(s){return s.replace(/\'/g,"\\'")};var doubleq=utils.doubleq=function(s){return s.replace(/(\'\')/g,"\\'")};var doubleqq=utils.doubleqq=function(s){return s.replace(/\'/g,"'")};var loadFile=utils.loadFile=function(path,asy,success,error){if(typeof exports=="object"){var fs=require("fs");if(!path){var buff="";process.stdin.setEncoding("utf8");process.stdin.on("readable",function(){var chunk=process.stdin.read();if(chunk!==null){buff+=chunk.toString()}});process.stdin.on("end",function(){success(buff)})}else{var data=fs.readFileSync(path);success(data.toString())}}else{var xhr=new XMLHttpRequest;xhr.onreadystatechange=function(){if(xhr.readyState===XMLHttpRequest.DONE){if(xhr.status===200){if(success)success(xhr.responseText)}else{if(error)error(xhr)}}};xhr.open("GET",path,asy);xhr.send()}};var loadBinaryFile=utils.loadBinaryFile=function(path,asy,success,error){if(typeof exports=="object"){var fs=require("fs");var data=fs.readFileSync(path);var arr=new Array;for(var i=0;i!=data.length;++i)arr[i]=String.fromCharCode(data[i]);success(arr.join(""))}else{var xhr=new XMLHttpRequest;xhr.open("GET",path,asy);xhr.responseType="arraybuffer";xhr.onload=function(){var data=new Uint8Array(xhr.response);var arr=new Array;for(var i=0;i!=data.length;++i)arr[i]=String.fromCharCode(data[i]);success(arr.join(""))};xhr.send()}};var saveFile=utils.saveFile=function(path,data,cb){if(!path){alasql.options.stdout=true;console.log(data)}else{if(typeof exports=="object"){var fs=require("fs");var data=fs.writeFileSync(path,data)}else{var blob=new Blob([data],{type:"text/plain;charset=utf-8"});saveAs(blob,path)}}};var hash=utils.hash=function hash(str){var h=0;if(str.length==0)return h;for(var i=0;i<str.length;i++){h=(h<<5)-h+str.charCodeAt(i);h=h&h}return h};var arrayUnion=utils.arrayUnion=function(a,b){var r=b.slice(0);a.forEach(function(i){if(r.indexOf(i)<0)r.push(i)});return r};var arrayDiff=utils.arrayDiff=function(a,b){return a.filter(function(i){return b.indexOf(i)<0})};var arrayIntersect=utils.arrayIntersept=function(a,b){var r=[];a.forEach(function(ai){var found=false;b.forEach(function(bi){found=found||ai==bi});if(found){r.push(ai)}});return r};var arrayUnionDeep=utils.arrayUnionDeep=function(a,b){var r=b.slice(0);a.forEach(function(ai){var found=false;r.forEach(function(ri){found=found||deepEqual(ai,ri)});if(!found){r.push(ai)}});return r};var arrayExceptDeep=utils.arrayExceptDeep=function(a,b){var r=[];a.forEach(function(ai){var found=false;b.forEach(function(bi){found=found||deepEqual(ai,bi)});if(!found){r.push(ai)}});return r};var arrayIntersectDeep=utils.arrayInterseptDeep=function(a,b){var r=[];a.forEach(function(ai){var found=false;b.forEach(function(bi){found=found||deepEqual(ai,bi,true)});if(found){r.push(ai)}});return r};var cloneDeep=utils.cloneDeep=function cloneDeep(obj){if(obj==null||typeof obj!="object")return obj;var temp=obj.constructor();for(var key in obj){if(obj.hasOwnProperty(key)){temp[key]=cloneDeep(obj[key])}}return temp};var equalDeep=utils.equalDeep=function equalDeep(x,y,deep){if(deep){if(x==y)return true;var p;for(p in y){if(typeof x[p]=="undefined"){return false}}for(p in y){if(y[p]){switch(typeof y[p]){case"object":if(!equalDeep(y[p],x[p])){return false}break;case"function":if(typeof x[p]=="undefined"||p!="equals"&&y[p].toString()!=x[p].toString())return false;break;default:if(y[p]!=x[p]){return false}}}else{if(x[p])return false}}for(p in x){if(typeof y[p]=="undefined"){return false}}return true}return x==y};var deepEqual=utils.deepEqual=function(x,y){if(typeof x=="object"&&x!=null&&(typeof y=="object"&&y!=null)){if(Object.keys(x).length!=Object.keys(y).length)return false;for(var prop in x){if(y.hasOwnProperty(prop)){if(!deepEqual(x[prop],y[prop]))return false}else return false}return true}else if(x!==y)return false;else return true};var extend=utils.extend=function extend(a,b){if(typeof a=="undefined")a={};for(key in b){if(b.hasOwnProperty(key)){a[key]=b[key]}}return a};var flatArray=utils.flatArray=function(a){if(!a||a.length==0)return[];var key=Object.keys(a[0])[0];if(typeof key=="undefined")return[];return a.map(function(ai){return ai[key]})};var arrayOfArrays=utils.arrayOfArrays=function(a){return a.map(function(aa){var ar=[];for(var key in aa)ar.push(aa[key]);return ar})};utils.xlsnc=function(i){var addr=String.fromCharCode(65+i%26);if(i>=26){i=(i/26|0)-1;addr=String.fromCharCode(65+i%26)+addr;if(i>26){i=(i/26|0)-1;addr=String.fromCharCode(65+i%26)+addr}}return addr};utils.xlscn=function(s){var n=s.charCodeAt(0)-65;if(s.length>1){n=n*26+s.charCodeAt(1)-65;if(s.length>2){n=n*26+s.charCodeAt(2)-65}}return n};alasql.parser=parser;alasql.parse=parser.parse.bind(parser);alasql.engines={};alasql.databases={};alasql.databasenum=0;alasql.options={};alasql.options.valueof=false;alasql.options.dropifnotexists=false;alasql.options.datetimeformat="sql";alasql.options.casesensitive=true;alasql.options.logtarget="output";alasql.options.logprompt=true;alasql.autocommit=true;alasql.prompthistory=[];alasql.from={};alasql.into={};alasql.fn={};alasql.busy=0;alasql.MAXSQLCACHESIZE=1e4;alasql.DEFAULTDATABASEID="alasql";alasql.use=function(databaseid){if(!databaseid)databaseid=alasql.DEFAULTDATABASEID;if(alasql.useid==databaseid)return;alasql.useid=databaseid;var db=alasql.databases[alasql.useid];alasql.tables=db.tables;db.resetSqlCache()};alasql.exec=function(sql,params,cb){return alasql.dexec(alasql.useid,sql,params,cb)};alasql.dexec=function(databaseid,sql,params,cb){var db=alasql.databases[databaseid];var hh=hash(sql);var statement=db.sqlCache[hh];if(statement&&db.dbversion==statement.dbversion){return statement(params,cb)}var ast=alasql.parse(sql);if(!ast.statements)return;if(ast.statements.length==0)return 0;else if(ast.statements.length==1){if(ast.statements[0].compile){var statement=ast.statements[0].compile(databaseid);if(!statement)return;statement.sql=sql;statement.dbversion=db.dbversion;if(db.sqlCacheSize>alasql.MAXSQLCACHESIZE){db.resetSqlCache()}db.sqlCacheSize++;db.sqlCache[hh]=statement;var res=alasql.res=statement(params,cb);return res}else{var res=alasql.res=ast.statements[0].execute(databaseid,params,cb);return res}}else{if(cb){alasql.adrun(databaseid,ast,params,cb)}else{return alasql.drun(databaseid,ast,params,cb)}}};alasql.drun=function(databaseid,ast,params,cb){var useid=alasql.useid;if(useid!=databaseid)alasql.use(databaseid);var res=[];for(var i=0,ilen=ast.statements.length;i<ilen;i++){if(ast.statements[i]){if(ast.statements[i].compile){var statement=ast.statements[i].compile(alasql.useid);res.push(alasql.res=statement(params))}else{res.push(alasql.res=ast.statements[i].execute(alasql.useid,params))}}}if(useid!=databaseid)alasql.use(useid);if(cb)cb(res);alasql.res=res;return res};alasql.adrun=function(databaseid,ast,params,cb){var useid=alasql.useid;if(useid!=databaseid)alasql.use(databaseid);var res=[];adrunone();function adrunone(data){if(typeof data!="undefined")res.push(data);var astatement=ast.statements.shift();if(!astatement){if(useid!=databaseid)alasql.use(useid);cb(res)}else{if(astatement.compile){var statement=astatement.compile(alasql.useid);statement(params,adrunone)}else{astatement.execute(alasql.useid,params,adrunone)}}}};alasql.compile=function(sql,kind,databaseid){if(!kind)kind="collection";if(!databaseid)databaseid=alasql.useid;var ast=alasql.parse(sql);if(ast.statements.length==1){var statementfn=ast.statements[0].compile(databaseid);if(kind=="value"){return function(params,cb){var res=statementfn(params);var key=Object.keys(res[0])[0];if(cb)cb(res[0][key]);return res[0][key]}}else if(kind=="single"){return function(params,cb){var res=statementfn(params);if(cb)cb(res[0]);return res[0]}}else if(kind=="row"){return function(params,cb){var res=statementfn(params,cb);var a=[];for(var key in res[0]){a.push(res[0][key])}if(cb)cb(a);return a}}else if(kind=="column"){return function(params,cb){var res=statementfn(params,cb);var ar=[];var key=Object.keys(res)[0];for(var i=0,ilen=res.length;i<ilen;i++){ar.push(res[i][key])}if(cb)cb(ar);return ar}}else if(kind=="array"){return function(params,cb){var res=statementfn(params,cb);res=flatArray(res);if(cb)cb(res);return res}}else if(kind=="matrix"){return function(params,cb){var res=statementfn(params,cb);res=arrayOfArrays(res);if(cb)cb(res);return res}}else if(kind=="collection"){return statementfn}else{return statementfn}}else{throw new Error("Number of statments in SQL is not equal to 1")}};alasql.query=function(sql,params,cb){var res=this.exec(sql,params);if(cb)cb(res);return res};alasql.queryArray=function(sql,params,cb){var res=flatArray(this.exec(sql,params));if(cb)cb(res);return res};alasql.querySingle=function(sql,params,cb){var res=this.exec(sql,params)[0];if(cb)cb(res);return res};alasql.queryRow=function(sql,params,cb){var res=this.querySingle(sql,params);var a=[];for(var key in res){a.push(res[key])}if(cb)cb(a);return a};alasql.queryValue=function(sql,params,cb){var res=this.exec(sql,params)[0];var val=res[Object.keys(res)[0]];if(cb)cb(val);return val};alasql.queryArrayOfArrays=function(sql,params,cb){var res=this.exec(sql,params);var keys=Object.keys(res[0]);var klen=keys.length;var aa=[];for(var i=0,ilen=res.length;i<ilen;i++){var r=res[i];var a=[];for(var k=0;k<klen;k++){a.push(r[keys[k]])}aa.push(a)}if(cb)cb(aa);return aa};alasql.value=alasql.queryValue;alasql.single=alasql.querySingle;alasql.row=alasql.queryRow;alasql.column=alasql.queryArray;alasql.array=alasql.queryArray;alasql.matrix=alasql.queryArrayOfArrays;var Database=alasql.Database=function(databaseid){var self=this;if(self===alasql){if(databaseid){self=alasql.databases[databaseid];if(!self){throw new Error('Database "'+databaseid+'" not found')}}else{self=alasql.databases.alasql}}if(!databaseid){databaseid="db"+alasql.databasenum++}self.databaseid=databaseid;alasql.databases[databaseid]=self;self.tables={};self.views={};self.indices={};self.resetSqlCache();self.dbversion=0;return self};Database.prototype.resetSqlCache=function(){this.sqlCache={};this.sqlCacheSize=0};Database.prototype.exec=function(sql,params,cb){return alasql.dexec(this.databaseid,sql,params,cb)};Database.prototype.aexec=function(sql,params){var self=this;return new Promise(function(resolve,reject){alasql.dexec(this.databaseid,sql,params,resolve)})};Database.prototype.query=Database.prototype.exec;Database.prototype.run=Database.prototype.exec;Database.prototype.queryArray=function(sql,params,cb){return flatArray(this.exec(sql,params,cb))};Database.prototype.queryArrayOfArrays=function(sql,params,cb){return arrayOfArrays(this.exec(sql,params,cb))};Database.prototype.querySingle=function(sql,params,cb){return this.exec(sql,params,cb)[0]};Database.prototype.queryValue=function(sql,params,cb){var res=this.querySingle(sql,params,cb);return res[Object.keys(res)[0]]};Database.prototype.value=Database.prototype.queryValue;Database.prototype.row=Database.prototype.querySingle;Database.prototype.array=Database.prototype.queryArray;Database.prototype.matrix=Database.prototype.queryArrayOfArrays;Database.prototype.compile=function(sql,kind){return alasql.compile(sql,kind,databaseid)};Database.prototype.prepare=Database.prototype.compile;Database.prototype.transaction=function(cb){var tx=new alasql.Transaction(this.databaseid);var res=cb(tx);return res};var Transaction=alasql.Transaction=function(databaseid){this.transactionid=Date.now();this.databaseid=databaseid;this.commited=false;this.dbversion=alasql.databases[databaseid].dbversion;this.bank=JSON.stringify(alasql.databases[databaseid]);return this};Transaction.prototype.commit=function(){this.commited=true;alasql.databases[this.databaseid].dbversion=Date.now();delete this.bank};Transaction.prototype.rollback=function(){if(!this.commited){alasql.databases[this.databaseid]=JSON.parse(this.bank);delete this.bank}else{throw new Error("Transaction already commited")}};Transaction.prototype.exec=Transaction.prototype.executeSQL=function(sql,params,cb){return alasql.dexec(this.databaseid,sql,params,cb)};Transaction.prototype.query=Database.prototype.exec;Transaction.prototype.run=Database.prototype.exec;Transaction.prototype.queryArray=function(sql,params,cb){return flatArray(this.exec(sql,params,cb))};Transaction.prototype.queryArrayOfArrays=function(sql,params,cb){return arrayOfArrays(this.exec(sql,params,cb))};Transaction.prototype.querySingle=function(sql,params,cb){return this.exec(sql,params,cb)[0]};Transaction.prototype.queryValue=function(sql,params,cb){var res=this.querySingle(sql,params,cb);return res[Object.keys(res)[0]]};var Table=alasql.Table=function(params){this.columns=[];this.xcolumns={};this.data=[];this.inddefs={};this.indices={};this.uniqs={};this.uniqdefs={};extend(this,params)};Table.prototype.indexColumns=function(){var self=this;self.xcolumns={};self.columns.forEach(function(col){self.xcolumns[col.columnid]=col})};var View=alasql.View=function(params){this.columns=[];this.xcolumns={};this.query=[];extend(this,params)};var Query=alasql.Query=function(params){this.columns=[];this.xcolumns={};extend(this,params)};var yy=parser.yy={};yy.extend=extend;yy.casesensitive=alasql.options.casesensitive;var Base=yy.Base=function(params){return yy.extend(this,params)};Base.prototype.toString=function(){};Base.prototype.toType=function(){};Base.prototype.toJavaScript=function(){};Base.prototype.compile=returnUndefined;Base.prototype.exec=function(){};
Base.prototype.compile=returnUndefined;Base.prototype.exec=function(){};yy.Statements=function(params){return yy.extend(this,params)};yy.Statements.prototype.toString=function(){return this.statements.map(function(st){return st.toString()}).join(";"+NL())};yy.Statements.prototype.compile=function(db){var statements=this.statements.map(function(st){return st.compile(db)});if(statements.length==1){return statements[0]}else{return function(params,cb){var res=statements.map(function(st){return st(params)});if(cb)cb(res);return res}}};function queryfn(query,oldscope,cb,A,B){var ms;query.sourceslen=query.sources.length;var slen=query.sourceslen;query.A=A;query.B=B;query.cb=cb;if(query.queriesfn){query.sourceslen+=query.queriesfn.length;slen+=query.queriesfn.length;query.queriesdata=[];query.queriesfn.forEach(function(q,idx){queryfn(q.query,null,queryfn2,-idx-1,query)})}var scope;if(!oldscope)scope={};else scope=cloneDeep(oldscope);query.scope=scope;var result;query.sources.forEach(function(source,idx){source.query=query;var rs=source.datafn(query,query.params,queryfn2,idx);if(typeof rs!=undefined){if((query.intofn||query.intoallfn)&&rs instanceof Array)rs=rs.length;result=rs}source.queriesdata=query.queriesdata});if(slen==0)result=queryfn3(query);return result}function queryfn2(data,idx,query){if(idx>=0){var source=query.sources[idx];source.data=data;if(typeof source.data=="function"){source.getfn=source.data;source.dontcache=source.getfn.dontcache;if(source.joinmode=="OUTER"||source.joinmode=="RIGHT"||source.joinmode=="ANTI"){source.dontcache=false}source.data={}}}else{query.queriesdata[-idx-1]=flatArray(data)}query.sourceslen--;if(query.sourceslen>0)return;return queryfn3(query)}function queryfn3(query){var scope=query.scope;preIndex(query);query.data=[];query.xgroups={};query.groups=[];var h=0;doJoin(query,scope,h);if(query.groupfn){if(query.havingfn){query.groups=query.groups.filter(query.havingfn)}query.data=query.groups}doDistinct(query);if(query.unionallfn){query.data=query.data.concat(query.unionallfn(query.params))}else if(query.unionfn){query.data=arrayUnionDeep(query.data,query.unionfn(query.params))}else if(query.exceptfn){query.data=arrayExceptDeep(query.data,query.exceptfn(query.params))}else if(query.intersectfn){query.data=arrayIntersectDeep(query.data,query.intersectfn(query.params))}if(query.orderfn){if(query.explain)var ms=Date.now();query.data=query.data.sort(query.orderfn);if(query.explain){query.explaination.push({explid:query.explid++,description:"QUERY BY",ms:Date.now()-ms})}}doLimit(query);var removeKeys=query.removeKeys;if(typeof angular!="undefined")removeKeys.push("$$hashKey");var jlen=removeKeys.length;if(jlen>0){for(var i=0,ilen=query.data.length;i<ilen;i++){for(var j=0;j<jlen;j++)delete query.data[i][removeKeys[j]]}}if(query.intoallfn){var res=query.intoallfn(query.columns,query.cb,query.A,query.B);return res}else if(query.intofn){for(var i=0,ilen=query.data.length;i<ilen;i++){query.intofn(query.data[i],i)}if(query.cb)query.cb(query.data.length,query.A,query.B);return query.data.length}else{var res=query.data;if(query.cb)res=query.cb(query.data,query.A,query.B);return res}}function doLimit(query){if(query.limit){var offset=0;if(query.offset)offset=(query.offset|0)-1||0;var limit=(query.limit|0)+offset;query.data=query.data.slice(offset,limit)}}function doDistinct(query){if(query.distinct){var uniq={};for(var i=0,ilen=query.data.length;i<ilen;i++){var uix=Object.keys(query.data[i]).map(function(k){return query.data[i][k]}).join("`");uniq[uix]=query.data[i]}query.data=[];for(var key in uniq)query.data.push(uniq[key])}}preIndex=function(query){for(var k=0,klen=query.sources.length;k<klen;k++){var source=query.sources[k];if(k>0&&source.optimization=="ix"&&source.onleftfn&&source.onrightfn){if(query.database.tables[source.tableid]){if(!query.database.tables[source.tableid].indices)query.database.tables[source.tableid].indices={};var ixx=query.database.tables[source.tableid].indices[hash(source.onrightfns+"`"+source.srcwherefns)];if(!query.database.tables[source.tableid].dirty&&ixx){source.ix=ixx}}if(!source.ix){source.ix={};var scope={};var i=0;var ilen=source.data.length;var dataw;while((dataw=source.data[i])||source.getfn&&(dataw=source.getfn(i))||i<ilen){if(source.getfn&&!source.dontcache)source.data[i]=dataw;scope[source.alias||source.tableid]=dataw;if(source.srcwherefn(scope,query.params,alasql)){var addr=source.onrightfn(scope,query.params,alasql);var group=source.ix[addr];if(!group){group=source.ix[addr]=[]}group.push(dataw)}i++}if(query.database.tables[source.tableid]){query.database.tables[source.tableid].indices[hash(source.onrightfns+"`"+source.srcwherefns)]=source.ix}}}else if(source.wxleftfn){if(!alasql.databases[source.databaseid].engineid){var ixx=query.database.tables[source.tableid].indices[hash(source.wxleftfns+"`")]}if(!query.database.tables[source.tableid].dirty&&ixx){source.ix=ixx;source.data=source.ix[source.wxrightfn(null,query.params,alasql)]}else{source.ix={};var scope={};var i=0;var ilen=source.data.length;var dataw;while((dataw=source.data[i])||source.getfn&&(dataw=source.getfn(i))||i<ilen){if(source.getfn&&!source.dontcache)source.data[i]=dataw;scope[source.alias||source.tableid]=source.data[i];var addr=source.wxleftfn(scope,query.params,alasql);var group=source.ix[addr];if(!group){group=source.ix[addr]=[]}group.push(source.data[i]);i++}if(!alasql.databases[source.databaseid].engineid){query.database.tables[source.tableid].indices[hash(source.wxleftfns+"`")]=source.ix}}if(source.srcwherefns){if(source.data){var scope={};source.data=source.data.filter(function(r){scope[source.alias]=r;return source.srcwherefn(scope,query.params,alasql)})}else{source.data=[]}}}else if(source.srcwherefns&&!source.dontcache){if(source.data){var scope={};source.data=source.data.filter(function(r){scope[source.alias]=r;return source.srcwherefn(scope,query.params,alasql)});var scope={};var i=0;var ilen=source.data.length;var dataw;var res=[];while((dataw=source.data[i])||source.getfn&&(dataw=source.getfn(i))||i<ilen){if(source.getfn&&!source.dontcache)source.data[i]=dataw;scope[source.alias]=dataw;if(source.srcwherefn(scope,query.params,alasql))res.push(dataw);i++}source.data=res}else{source.data=[]}}if(query.database.tables[source.tableid]){}else{}}};function doJoin(query,scope,h){if(h>=query.sources.length){if(query.wherefn(scope,query.params,alasql)){var res=query.selectfn(scope,query.params,alasql);if(query.groupfn){query.groupfn(res,query.params,alasql)}else{query.data.push(res)}}}else{var source=query.sources[h];var nextsource=query.sources[h+1];if(true){var tableid=source.alias||source.tableid;var pass=false;var data=source.data;var opt=false;if(!source.getfn||source.getfn&&!source.dontcache){if(source.joinmode!="RIGHT"&&source.joinmode!="OUTER"&&source.joinmode!="ANTI"&&source.optimization=="ix"){data=source.ix[source.onleftfn(scope,query.params,alasql)]||[];opt=true}}var i=0;var ilen=data.length;var dataw;while((dataw=data[i])||!opt&&(source.getfn&&(dataw=source.getfn(i)))||i<ilen){if(!opt&&source.getfn&&!source.dontcache)data[i]=dataw;scope[tableid]=dataw;if(!source.onleftfn||source.onleftfn(scope,query.params,alasql)==source.onrightfn(scope,query.params,alasql)){if(source.onmiddlefn(scope,query.params,alasql)){if(source.joinmode!="SEMI"&&source.joinmode!="ANTI"){doJoin(query,scope,h+1)}if(source.joinmode!="LEFT"&&source.joinmode!="INNER"){dataw._rightjoin=true}pass=true}}i++}if((source.joinmode=="LEFT"||source.joinmode=="OUTER"||source.joinmode=="SEMI")&&!pass){scope[tableid]={};doJoin(query,scope,h+1)}}if(h+1<query.sources.length){if(nextsource.joinmode=="OUTER"||nextsource.joinmode=="RIGHT"||nextsource.joinmode=="ANTI"){scope[source.alias]={};var j=0;var jlen=nextsource.data.length;var dataw;while((dataw=nextsource.data[j])||nextsource.getfn&&(dataw=nextsource.getfn(j))||j<jlen){if(nextsource.getfn&&!nextsource.dontcache)nextsource.data[j]=dataw;if(!dataw._rightjoin){scope[nextsource.alias]=dataw;doJoin(query,scope,h+2)}else{delete dataw._rightjoin}j++}}}scope[tableid]=undefined}}function swapSources(query,h){var source=query.sources[h];var nextsource=query.sources[h+1];var onleftfn=source.onleftfn;var onleftfns=source.onleftfns;var onrightfn=source.onrightfn;var onrightfns=source.onrightfns;var optimization=source.optimization;source.onleftfn=nextsource.onrightfn;source.onleftfns=nextsource.onrightfns;source.onrightfn=nextsource.onleftfn;source.onrightfns=nextsource.onleftfns;source.optimization=nextsource.optimization;nextsource.onleftfn=onleftfn;nextsource.onleftfns=onleftfns;nextsource.onrightfn=onrightfn;nextsource.onrightfns=onrightfns;nextsource.optimization=optimization;query.sources[h]=nextsource;query.sources[h+1]=source}yy.Select=function(params){return yy.extend(this,params)};yy.Select.prototype.toString=function(){var s="";if(this.explain)s+=K("EXPLAIN")+" ";s+=K("SELECT")+" ";if(this.modifier)s+=K(this.modifier)+" ";if(this.top)s+=K("TOP")+" "+N(this.top.value)+" ";s+=this.columns.map(function(col){var s=col.toString();if(typeof col.as!="undefined")s+=" "+K("AS")+" "+L(col.as);return s}).join(", ");if(this.from){s+=NL()+ID()+K("FROM")+" "+this.from.map(function(f){var ss=f.toString();if(f.as)ss+=" "+K("AS")+" "+f.as;return ss}).join(",")}if(this.joins){s+=this.joins.map(function(jn){var ss=NL()+ID();if(jn.joinmode)ss+=K(jn.joinmode)+" ";ss+=K("JOIN")+" ";ss+=jn.table.toString();if(jn.using)ss+=" "+K("USING")+" "+jn.using.toString();if(jn.on)ss+=" "+K("ON")+" "+jn.on.toString();return ss})}if(this.where)s+=NL()+ID()+K("WHERE")+" "+this.where.toString();if(this.group)s+=NL()+ID()+K("GROUP BY")+" "+this.group.toString();if(this.having)s+=NL()+ID()+K("HAVING")+" "+this.having.toString();if(this.order)s+=NL()+ID()+K("ORDER BY")+" "+this.order.toString();if(this.limit)s+=NL()+ID()+K("LIMIT")+" "+this.limit.value;if(this.offset)s+=NL()+ID()+K("OFFSET")+" "+this.offset.value;if(this.union)s+=NL()+K("UNION")+NL()+this.union.toString();if(this.unionall)s+=NL()+K("UNION ALL")+NL()+this.unionall.toString();if(this.except)s+=NL()+K("EXCEPT")+NL()+this.except.toString();if(this.intersect)s+=NL()+K("INTERSECT")+NL()+this.intersect.toString();return s};yy.Select.prototype.compile=function(databaseid){var db=alasql.databases[databaseid];var query=new Query;query.removeKeys=[];query.explain=this.explain;query.explaination=[];query.explid=1;query.modifier=this.modifier;query.database=db;this.compileWhereExists(query);this.compileQueries(query);query.defcols=this.compileDefCols(query,databaseid);query.fromfn=this.compileFrom(query);if(this.joins)this.compileJoins(query);query.selectfns=this.compileSelect1(query);if(this.where)this.compileWhereJoins(query);query.wherefn=this.compileWhere(query);if(this.group)query.groupfn=this.compileGroup(query);if(this.having)query.havingfn=this.compileHaving(query);query.selectfn=this.compileSelect2(query);query.distinct=this.distinct;if(this.order)query.orderfn=this.compileOrder(query);if(this.top){query.limit=this.top.value}else if(this.limit){query.limit=this.limit.value;if(this.offset){query.offset=this.offset.value}}if(this.union){query.unionfn=this.union.compile(databaseid);if(this.union.order){query.orderfn=this.union.compileOrder(query)}else{query.orderfn=null}}else if(this.unionall){query.unionallfn=this.unionall.compile(databaseid);if(this.unionall.order){query.orderfn=this.unionall.compileOrder(query)}else{query.orderfn=null}}else if(this.except){query.exceptfn=this.except.compile(databaseid);if(this.except.order){query.orderfn=this.except.compileOrder(query)}else{query.orderfn=null}}else if(this.intersect){query.intersectfn=this.intersect.compile(databaseid);if(this.intersect.order){query.intersectfn=this.intersect.compileOrder(query)}else{query.orderfn=null}}if(this.into){if(this.into instanceof yy.Table){if(alasql.autocommit&&alasql.databases[this.into.databaseid||databaseid].engineid){query.intoallfns='return alasql.engines["'+alasql.databases[this.into.databaseid||databaseid].engineid+'"]'+'.intoTable("'+(this.into.databaseid||databaseid)+'","'+this.into.tableid+'",this.data, columns, cb);'}else{query.intofns="alasql.databases['"+(this.into.databaseid||databaseid)+"'].tables"+"['"+this.into.tableid+"'].data.push(r);"}}else if(this.into instanceof yy.FuncValue){var qs="alasql.into['"+this.into.funcid.toUpperCase()+"'](";if(this.into.args&&this.into.args.length>0){qs+=this.into.args[0].toJavaScript()+",";if(this.into.args.length>1){qs+=this.into.args[1].toJavaScript()+","}else{qs+="null,"}}else{qs+="null, null,"}query.intoallfns=qs+"this.data,columns,cb)"}else if(this.into instanceof yy.ParamValue){query.intofns="params['"+this.into.param+"'].push(r)"}if(query.intofns){query.intofn=new Function("r,i,params",query.intofns)}if(query.intoallfns){query.intoallfn=new Function("columns,cb",query.intoallfns)}}var statement=function(params,cb,oldscope){query.params=params;var res1=queryfn(query,oldscope,function(res){var res2=modify(query,res);if(cb)cb(res2);return res2});return res1};statement.query=query;return statement};function modify(query,res){if(query.modifier=="VALUE"){var key=Object.keys(res[0])[0];res=res[0][key]}if(query.modifier=="ROW"){var a=[];for(var key in res[0]){a.push(res[0][key])}res=a}if(query.modifier=="COLUMN"){var ar=[];if(res.length>0){var key=Object.keys(res[0])[0];for(var i=0,ilen=res.length;i<ilen;i++){ar.push(res[i][key])}}res=ar}if(query.modifier=="MATRIX"){res=arrayOfArrays(res)}return res}yy.Select.prototype.exec=function(databaseid){throw new Error("Select statement should be precompiled")};yy.ExistsValue=function(params){return yy.extend(this,params)};yy.ExistsValue.prototype.toString=function(){return"EXISTS("+this.value.toString()+")"};yy.ExistsValue.prototype.toType=function(){return"boolean"};yy.ExistsValue.prototype.toJavaScript=function(){return"this.existsfn["+this.existsidx+"](params,null,p).length"};yy.Select.prototype.compileWhereExists=function(query){if(!this.exists)return;query.existsfn=this.exists.map(function(ex){return ex.compile(query.database.databaseid)})};yy.Select.prototype.compileQueries=function(query){if(!this.queries)return;query.queriesfn=this.queries.map(function(q){return q.compile(query.database.databaseid)})};yy.Select.prototype.compileJoins=function(query){var self=this;this.joins.forEach(function(jn){if(jn.joinmode=="CROSS"){if(jn.using||jn.on){throw new Error("CROSS JOIN cannot have USING or ON clauses")}else{jn.joinmode=="INNER"}}var source;var tq;if(jn.table){tq=jn.table;source={alias:jn.as||tq.tableid,databaseid:tq.databaseid||query.database.databaseid,tableid:tq.tableid,joinmode:jn.joinmode,onmiddlefn:returnTrue,srcwherefns:"",srcwherefn:returnTrue};if(!alasql.databases[source.databaseid].tables[source.tableid]){throw new Error("Table '"+source.tableid+"' is not exists in database '"+source.databaseid)+"'"}if(alasql.autocommit&&alasql.databases[source.databaseid].engineid){source.datafn=function(query,params,cb,idx){return alasql.engines[alasql.databases[source.databaseid].engineid].fromTable(source.databaseid,source.tableid,cb,idx,query)}}else{source.datafn=function(query,params,cb,idx){var res=alasql.databases[source.databaseid].tables[source.tableid].data;if(cb)res=cb(res,idx,query);return res}}query.aliases[source.alias]={tableid:tq.tableid,databaseid:tq.databaseid||query.database.databaseid}}else if(jn.select){source={alias:jn.as,joinmode:jn.joinmode,onmiddlefn:returnTrue,srcwherefns:"",srcwherefn:returnTrue};source.subquery=tq.compile(query.database.databaseid);source.datafn=function(query,params,cb,idx){return source.subquery(query.params,null,cb,idx)};query.aliases[source.alias]={type:"subquery"}}else if(jn.param){source={alias:jn.as,joinmode:jn.joinmode,onmiddlefn:returnTrue,srcwherefns:"",srcwherefn:returnTrue};var jnparam=jn.param.param;var ps="var res=alasql.prepareFromData(params['"+jnparam+"']";if(jn.array)ps+=",true";ps+=");if(cb)res=cb(res, idx, query);return res";source.datafn=new Function("query,params,cb,idx",ps);query.aliases[source.alias]={type:"paramvalue"}}else if(jn.funcid){source={alias:jn.as,joinmode:jn.joinmode,onmiddlefn:returnTrue,srcwherefns:"",srcwherefn:returnTrue};var s="var res=alasql.from['"+js.funcid.toUpperCase()+"'](";if(jn.args&&jn.args.length>0){if(jn.args[0]){s+=jn.args[0].toJavaScript()+","}else{s+="null,"}if(jn.args[1]){s+=jn.args[1].toJavaScript()+","}else{s+="null,"}}else{s+="null,null,"}s+="cb,idx,query";s+=");/*if(cb)res=cb(res,idx,query);*/return res";source.datafn=new Function("query, params, cb, idx",s);query.aliases[source.alias]={type:"funcvalue"}}var alias=source.alias;if(jn.natural){if(jn.using||jn.on){throw new Error("NATURAL JOIN cannot have USING or ON clauses")}else{if(query.sources.length>0){var prevSource=query.sources[query.sources.length-1];var prevTable=alasql.databases[prevSource.databaseid].tables[prevSource.tableid];var table=alasql.databases[source.databaseid].tables[source.tableid];if(prevTable&&table){var c1=prevTable.columns.map(function(col){return col.columnid});var c2=table.columns.map(function(col){return col.columnid});jn.using=arrayIntersect(c1,c2).map(function(colid){return{columnid:colid}})}else{throw new Error("In this version of Alasql NATURAL JOIN "+"works for tables with predefined columns only")}}}}if(jn.using){var prevSource=query.sources[query.sources.length-1];source.onleftfns=jn.using.map(function(col){return"p['"+(prevSource.alias||prevSource.tableid)+"']['"+col.columnid+"']"}).join('+"`"+');source.onleftfn=new Function("p,params,alasql","return "+source.onleftfns);source.onrightfns=jn.using.map(function(col){return"p['"+(source.alias||source.tableid)+"']['"+col.columnid+"']"}).join('+"`"+');source.onrightfn=new Function("p,params,alasql","return "+source.onrightfns);source.optimization="ix"}else if(jn.on){if(jn.on instanceof yy.Op&&jn.on.op=="="&&!jn.on.allsome){source.optimization="ix";var lefts="";var rights="";var middles="";var middlef=false;var ls=jn.on.left.toJavaScript("p",query.defaultTableid,query.defcols);var rs=jn.on.right.toJavaScript("p",query.defaultTableid,query.defcols);if(ls.indexOf("p['"+alias+"']")>-1&&!(rs.indexOf("p['"+alias+"']")>-1)){if((ls.match(/p\[\'.*?\'\]/g)||[]).every(function(s){return s=="p['"+alias+"']"})){rights=ls}else{middlef=true}}else if(!(ls.indexOf("p['"+alias+"']")>-1)&&rs.indexOf("p['"+alias+"']")>-1){if((rs.match(/p\[\'.*?\'\]/g)||[]).every(function(s){return s=="p['"+alias+"']"})){lefts=ls}else{middlef=true}}else{middlef=true}if(rs.indexOf("p['"+alias+"']")>-1&&!(ls.indexOf("p['"+alias+"']")>-1)){if((rs.match(/p\[\'.*?\'\]/g)||[]).every(function(s){return s=="p['"+alias+"']"})){rights=rs}else{middlef=true}}else if(!(rs.indexOf("p['"+alias+"']")>-1)&&ls.indexOf("p['"+alias+"']")>-1){if((ls.match(/p\[\'.*?\'\]/g)||[]).every(function(s){return s=="p['"+alias+"']"})){lefts=rs}else{middlef=true}}else{middlef=true}if(middlef){rights="";lefts="";middles=jn.on.toJavaScript("p",query.defaultTableid,query.defcols);source.optimization="no"}source.onleftfns=lefts;source.onrightfns=rights;source.onmiddlefns=middles||"true";source.onleftfn=new Function("p,params,alasql","return "+source.onleftfns);source.onrightfn=new Function("p,params,alasql","return "+source.onrightfns);source.onmiddlefn=new Function("p,params,alasql","return "+source.onmiddlefns)}else{source.optimization="no";source.onmiddlefns=jn.on.toJavaScript("p",query.defaultTableid,query.defcols);source.onmiddlefn=new Function("p,params,alasql","return "+jn.on.toJavaScript("p",query.defaultTableid,query.defcols))}}query.sources.push(source)})};yy.Select.prototype.compileGroup=function(query){var self=this;var allgroup=decartes(this.group);var allgroups=[];allgroup.forEach(function(a){allgroups=arrayUnion(allgroups,a)});query.allgroups=allgroups;allgroups.forEach(function(colid){if(query.selectColumns[colid]){}else{var tmpid="default";if(query.sources.length>0)tmpid=query.sources[0].alias;query.selectfns+="r['"+escapeq(colid)+"']="+new yy.Column({columnid:colid}).toJavaScript("p",tmpid)+";"}});var s="";allgroup.forEach(function(agroup){s+="var g=this.xgroups[";var rg=agroup.map(function(columnid){if(columnid=="")return"1";else return"r['"+columnid+"']"});if(rg.length==0)rg=["''"];s+=rg.join('+"`"+');s+="];if(!g) {this.groups.push((g=this.xgroups[";s+=rg.join('+"`"+');s+="] = {";s+=agroup.map(function(columnid){if(columnid=="")return"";else return"'"+columnid+"':r['"+columnid+"'],"}).join("");var neggroup=arrayDiff(allgroups,agroup);s+=neggroup.map(function(columnid){return"'"+columnid+"':null,"}).join("");var aft="";s+=self.columns.map(function(col){if(col instanceof yy.AggrValue){if(col.aggregatorid=="SUM"||col.aggregatorid=="MIN"||col.aggregatorid=="MAX"||col.aggregatorid=="FIRST"||col.aggregatorid=="LAST"){return"'"+col.as+"':r['"+col.as+"'],"}else if(col.aggregatorid=="ARRAY"){return"'"+col.as+"':[r['"+col.as+"']],"}else if(col.aggregatorid=="COUNT"){return"'"+col.as+"':1,"}else if(col.aggregatorid=="AVG"){query.removeKeys.push("_SUM_"+col.as);query.removeKeys.push("_COUNT_"+col.as);return"'"+col.as+"':r['"+col.as+"'],'_SUM_"+col.as+"':r['"+col.as+"'],'_COUNT_"+col.as+"':1,"}else if(col.aggregatorid=="AGGR"){aft+=",g['"+col.as+"']="+col.expression.toJavaScript("g",-1);return""}return""}else return""}).join("");s+="}"+aft+",g));} else {";s+=self.columns.map(function(col){if(col instanceof yy.AggrValue){if(col.aggregatorid=="SUM"){return"g['"+col.as+"']+=r['"+col.as+"'];"}else if(col.aggregatorid=="COUNT"){return"g['"+col.as+"']++;"}else if(col.aggregatorid=="ARRAY"){return"g['"+col.as+"'].push(r['"+col.as+"']);"}else if(col.aggregatorid=="MIN"){return"g['"+col.as+"']=Math.min(g['"+col.as+"'],r['"+col.as+"']);"}else if(col.aggregatorid=="MAX"){return"g['"+col.as+"']=Math.max(g['"+col.as+"'],r['"+col.as+"']);"}else if(col.aggregatorid=="FIRST"){return""}else if(col.aggregatorid=="LAST"){return"g['"+col.as+"']=r['"+col.as+"'];"}else if(col.aggregatorid=="AVG"){return"g['_SUM_"+col.as+"']+=r['"+col.as+"'];"+"g['_COUNT_"+col.as+"']++;"+"g['"+col.as+"']=g['_SUM_"+col.as+"']/g['_COUNT_"+col.as+"'];"}else if(col.aggregatorid=="AGGR"){return"g['"+col.as+"']="+col.expression.toJavaScript("g",-1)+";"}return""}else return""}).join("");s+="}"});return new Function("r,params",s)};yy.Select.prototype.compileFrom=function(query){var self=this;query.sources=[];query.aliases={};if(!self.from)return;self.from.forEach(function(tq){var alias=tq.as||tq.tableid;if(tq instanceof yy.Table){query.aliases[alias]={tableid:tq.tableid,databaseid:tq.databaseid||query.database.databaseid,type:"table"}}else if(tq instanceof yy.Select){query.aliases[alias]={type:"subquery"}}else if(tq instanceof yy.ParamValue){query.aliases[alias]={type:"paramvalue"}}else if(tq instanceof yy.FuncValue){query.aliases[alias]={type:"paramvalue"}}else{throw new Error("Wrong table at FROM")}var source={alias:alias,databaseid:tq.databaseid||query.database.databaseid,tableid:tq.tableid,joinmode:"INNER",onmiddlefn:returnTrue,srcwherefns:"",srcwherefn:returnTrue};if(tq instanceof yy.Table){if(alasql.autocommit&&alasql.databases[source.databaseid].engineid){source.datafn=function(query,params,cb,idx){return alasql.engines[alasql.databases[source.databaseid].engineid].fromTable(source.databaseid,source.tableid,cb,idx,query)}}else{source.datafn=function(query,params,cb,idx){var res=alasql.databases[source.databaseid].tables[source.tableid].data;if(cb)res=cb(res,idx,query);return res}}}else if(tq instanceof yy.Select){source.subquery=tq.compile(query.database.databaseid);source.datafn=function(query,params,cb,idx){var res;source.subquery(query.params,function(data){if(cb)res=cb(data,idx,query);return data});return res}}else if(tq instanceof yy.ParamValue){var ps="var res = alasql.prepareFromData(params['"+tq.param+"']";if(tq.array)ps+=",true";ps+=");if(cb)res=cb(res,idx,query);return res";source.datafn=new Function("query,params,cb,idx",ps)}else if(tq instanceof yy.FuncValue){var s="var res=alasql.from['"+tq.funcid.toUpperCase()+"'](";if(tq.args&&tq.args.length>0){if(tq.args[0]){s+=tq.args[0].toJavaScript()+","}else{s+="null,"}if(tq.args[1]){s+=tq.args[1].toJavaScript()+","}else{s+="null,"}}else{s+="null,null,"}s+="cb,idx,query";s+=");/*if(cb)res=cb(res,idx,query);*/return res";source.datafn=new Function("query, params, cb, idx",s)}else{throw new Error("Wrong table at FROM")}query.sources.push(source)});query.defaultTableid=query.sources[0].alias};alasql.prepareFromData=function(data,array){var res=data;if(array){res=[];for(var i=0,ilen=data.length;i<ilen;i++){res.push([data[i]])}}else if(typeof data=="string"){res=data.split(/\r?\n/);for(var i=0,ilen=res.length;i<ilen;i++){res[i]=[res[i]]}}else if(typeof data=="object"&&!(data instanceof Array)){res=[];for(var key in data){if(data.hasOwnProperty(key))res.push([key,data[key]])}}return res};function compileSelectStar(query,alias){var s="",sp="",ss=[];if(query.aliases[alias].tableid){var columns=alasql.databases[query.aliases[alias].databaseid].tables[query.aliases[alias].tableid].columns}if(columns&&columns.length>0){columns.forEach(function(tcol){ss.push("'"+tcol.columnid+"':p['"+alias+"']['"+tcol.columnid+"']");query.selectColumns[escapeq(tcol.columnid)]=true;var coldef={columnid:tcol.columnid,dbtypeid:tcol.dbtypeid,dbsize:tcol.dbsize,dbprecision:tcol.dbprecision,dbenum:tcol.dbenum};query.columns.push(coldef);query.xcolumns[coldef.columnid]=coldef})}else{sp+='var w=p["'+alias+'"];for(var k in w){r[k]=w[k]};';query.dirtyColumns=true}return{s:ss.join(","),sp:sp}}yy.Select.prototype.compileSelect1=function(query){var self=this;query.columns=[];query.xcolumns={};query.selectColumns={};query.dirtyColumns=false;var s="var r={";var sp="";var ss=[];this.columns.forEach(function(col){if(col instanceof yy.Column){if(col.columnid=="*"){if(col.tableid){var ret=compileSelectStar(query,col.tableid);if(ret.s)ss=ss.concat(ret.s);sp+=ret.sp}else{for(var alias in query.aliases){var ret=compileSelectStar(query,alias);if(ret.s)ss=ss.concat(ret.s);sp+=ret.sp}}}else{var tbid=col.tableid;var dbid=col.databaseid||query.sources[0].databaseid||query.database.databaseid;if(!tbid)tbid=query.defcols[col.columnid];if(!tbid)tbid=query.defaultTableid;if(col.columnid!=""){ss.push("'"+escapeq(col.as||col.columnid)+"':p['"+tbid+"']['"+col.columnid+"']")}else{ss.push("'"+escapeq(col.as||col.columnid)+"':p['"+tbid+"']")}query.selectColumns[escapeq(col.as||col.columnid)]=true;if(query.aliases[tbid]&&query.aliases[tbid].type=="table"){if(!alasql.databases[dbid].tables[query.aliases[tbid].tableid]){throw new Error("Table '"+tbid+"' does not exists in database")}var columns=alasql.databases[dbid].tables[query.aliases[tbid].tableid].columns;var xcolumns=alasql.databases[dbid].tables[query.aliases[tbid].tableid].xcolumns;if(xcolumns&&columns.length>0){var tcol=xcolumns[col.columnid];var coldef={columnid:col.as||col.columnid,dbtypeid:tcol.dbtypeid,dbsize:tcol.dbsize,dbpecision:tcol.dbprecision,dbenum:tcol.dbenum};query.columns.push(coldef);query.xcolumns[coldef.columnid]=coldef}else{query.dirtyColumns=true}}else{}}}else if(col instanceof yy.AggrValue){if(!self.group){self.group=[""]}if(!col.as)col.as=escapeq(col.toString());if(col.aggregatorid=="SUM"||col.aggregatorid=="MAX"||col.aggregatorid=="MIN"||col.aggregatorid=="FIRST"||col.aggregatorid=="LAST"||col.aggregatorid=="AVG"||col.aggregatorid=="ARRAY"){ss.push("'"+escapeq(col.as)+"':"+col.expression.toJavaScript("p",query.defaultTableid,query.defcols))}else if(col.aggregatorid=="COUNT"){ss.push("'"+escapeq(col.as)+"':1")}query.selectColumns[escapeq(col.expression.toString())]=true}else{ss.push("'"+escapeq(col.as||col.columnid||col.toString())+"':"+col.toJavaScript("p",query.defaultTableid,query.defcols));query.selectColumns[escapeq(col.as||col.columnid||col.toString())]=true}});s+=ss.join(",")+"};"+sp;return s};yy.Select.prototype.compileSelect2=function(query){var s=query.selectfns;return new Function("p,params,alasql",s+"return r")};yy.Select.prototype.compileWhere=function(query){if(this.where){s=this.where.toJavaScript("p",query.defaultTableid,query.defcols);query.wherefns=s;return new Function("p,params,alasql","return "+s)}else return function(){return true}};yy.Select.prototype.compileHaving=function(query){if(this.having){s=this.having.toJavaScript("p",-1);query.havingfns=s;return new Function("p,params,alasql","return "+s)}else return function(){return true}};yy.Select.prototype.compileWhereJoins=function(query){optimizeWhereJoin(query,this.where.expression);query.sources.forEach(function(source){if(source.srcwherefns){source.srcwherefn=new Function("p,params,alasql","return "+source.srcwherefns)}if(source.wxleftfns){source.wxleftfn=new Function("p,params,alasql","return "+source.wxleftfns)}if(source.wxrightfns){source.wxrightfn=new Function("p,params,alasql","return "+source.wxrightfns)}})};function optimizeWhereJoin(query,ast){if(!ast)return false;var s=ast.toJavaScript("p",query.defaultTableid,query.defcols);var fsrc=[];query.sources.forEach(function(source,idx){if(source.tableid){if(s.indexOf("p['"+source.alias+"']")>-1)fsrc.push(source)}});if(fsrc.length==0){return}else if(fsrc.length==1){if(!(s.match(/p\[\'.*?\'\]/g)||[]).every(function(s){return s=="p['"+fsrc[0].alias+"']"})){return}var src=fsrc[0];src.srcwherefns=src.srcwherefns?src.srcwherefns+"&&"+s:s;if(ast instanceof yy.Op&&(ast.op=="="&&!ast.allsome)){if(ast.left instanceof yy.Column){var ls=ast.left.toJavaScript("p",query.defaultTableid,query.defcols);var rs=ast.right.toJavaScript("p",query.defaultTableid,query.defcols);if(rs.indexOf("p['"+fsrc[0].alias+"']")==-1){fsrc[0].wxleftfns=ls;fsrc[0].wxrightfns=rs}}if(ast.right instanceof yy.Column){var ls=ast.left.toJavaScript("p",query.defaultTableid,query.defcols);var rs=ast.right.toJavaScript("p",query.defaultTableid,query.defcols);if(ls.indexOf("p['"+fsrc[0].alias+"']")==-1){fsrc[0].wxleftfns=rs;fsrc[0].wxrightfns=ls}}}ast.reduced=true;return}else{if(ast.op="AND"){optimizeWhereJoin(query,ast.left);optimizeWhereJoin(query,ast.right)}}}yy.Select.prototype.compileOrder=function(query){if(this.order){var s="";var sk="";this.order.forEach(function(ord){var columnid=ord.expression.columnid;var dg="";if(query.xcolumns[columnid]){var dbtypeid=query.xcolumns[columnid].dbtypeid;if(dbtypeid=="DATE"||dbtypeid=="DATETIME")dg=".valueOf()"}else{if(alasql.options.valueof)dg=".valueOf()"}if(ord.nocase)columnid+=".toUpperCase()";s+="if(a['"+columnid+"']"+dg+(ord.direction=="ASC"?">":"<")+"b['"+columnid+"']"+dg+")return 1;";s+="if(a['"+columnid+"']"+dg+"==b['"+columnid+"']"+dg+"){";sk+="}"});s+="return 0;";s+=sk+"return -1";query.orderfns=s;return new Function("a,b",s)}};var rollup=function(a){var rr=[];var mask=0;var glen=a.length;for(var g=0;g<glen+1;g++){var ss=[];for(var i=0;i<glen;i++){if(mask&1<<i)ss.push(a[i])}rr.push(ss);mask=(mask<<1)+1}return rr};var cube=function(a){var rr=[];var glen=a.length;for(var g=0;g<1<<glen;g++){var ss=[];for(var i=0;i<glen;i++){if(g&1<<i)ss=ss.concat(decartes(a[i]))}rr.push(ss)}return rr};var groupingsets=function(a){return a.reduce(function(acc,d){acc=acc.concat(decartes(d));return acc},[])};var cartes=function(a1,a2){var rrr=[];for(var i1=0;i1<a1.length;i1++){for(var i2=0;i2<a2.length;i2++){rrr.push(a1[i1].concat(a2[i2]))}}return rrr};function decartes(gv){if(gv instanceof Array){var res=[[]];for(var t=0;t<gv.length;t++){if(gv[t]instanceof yy.Column){res=res.map(function(r){return r.concat(gv[t].columnid)})}else if(gv[t]instanceof yy.FuncValue){res=res.map(function(r){return r.concat(gv[t].toString())})}else if(gv[t]instanceof yy.GroupExpression){if(gv[t].type=="ROLLUP")res=cartes(res,rollup(gv[t].group));else if(gv[t].type=="CUBE")res=cartes(res,cube(gv[t].group));else if(gv[t].type=="GROUPING SETS")res=cartes(res,groupingsets(gv[t].group))}else{}}return res}else{if(gv instanceof yy.Column){return[gv.columnid]}else if(gv instanceof yy.FuncValue){return[gv.toString()]}}}yy.Select.prototype.compileDefCols=function(query,databaseid){var defcols={};if(this.from){this.from.forEach(function(fr){if(fr instanceof yy.Table){var alias=fr.as||fr.tableid;
var table=alasql.databases[fr.databaseid||databaseid].tables[fr.tableid];if(table.columns){table.columns.forEach(function(col){if(defcols[col.columnid]){defcols[col.columnid]="-"}else{defcols[col.columnid]=alias}})}}else if(fr instanceof yy.Select){}else if(fr instanceof yy.ParamValue){}else if(fr instanceof yy.FuncValue){}else{throw new Error("Unknown type of FROM clause")}})}if(this.joins){this.joins.forEach(function(jn){if(jn.table){var alias=jn.table.tableid;if(jn.as)alias=jn.as;var alias=jn.as||jn.table.tableid;var table=alasql.databases[jn.table.databaseid||databaseid].tables[jn.table.tableid];if(table.columns){table.columns.forEach(function(col){if(defcols[col.columnid]){defcols[col.columnid]="-"}else{defcols[col.columnid]=alias}})}}else if(jn.select){}else if(jn.param){}else if(jn.func){}else{throw new Error("Unknown type of FROM clause")}})}return defcols};yy.Union=function(params){return yy.extend(this,params)};yy.Union.prototype.toString=function(){return K("UNION")};yy.Union.prototype.compile=function(tableid){return null};yy.ExpressionStatement=function(params){return yy.extend(this,params)};yy.ExpressionStatement.prototype.toString=function(){return this.expression.toString()};yy.ExpressionStatement.prototype.execute=function(databaseid,params,cb){if(this.expression){var expr=new Function("params","return "+this.expression.toJavaScript("","",null));var res=expr(params);if(cb)res=cb(res);return res}};yy.Expression=function(params){return yy.extend(this,params)};yy.Expression.prototype.toString=function(){return this.expression.toString()};yy.Expression.prototype.toJavaScript=function(context,tableid,defcols){if(this.expression.reduced)return"true";return this.expression.toJavaScript(context,tableid,defcols)};yy.Expression.prototype.compile=function(context,tableid,defcols){if(this.reduced)return returnTrue();return new Function("p","return "+this.toJavaScript(context,tableid,defcols))};yy.Literal=function(params){return yy.extend(this,params)};yy.Literal.prototype.toString=function(){var s=this.value;if(this.value1)s=this.value1+"."+s;return L(s)};yy.Join=function(params){return yy.extend(this,params)};yy.Join.prototype.toString=function(){var s=NL()+ID();if(this.joinmode)s+=K(this.joinmode)+" ";s+=K("JOIN")+this.table.toString();return s};yy.Table=function(params){return yy.extend(this,params)};yy.Table.prototype.toString=function(){var s=this.tableid;if(this.databaseid)s=this.databaseid+"."+s;return L(s)};yy.View=function(params){return yy.extend(this,params)};yy.View.prototype.toString=function(){var s=this.viewid;if(this.databaseid)s=this.databaseid+"."+s;return L(s)};yy.Op=function(params){return yy.extend(this,params)};yy.Op.prototype.toString=function(){if(this.op=="IN"||this.op=="NOT IN"){return this.left.toString()+" "+P(this.op)+" ("+this.right.toString()+")"}if(this.allsome){return this.left.toString()+" "+P(this.op)+" "+this.allsome+" ("+this.right.toString()+")"}return this.left.toString()+" "+P(this.op)+" "+(this.allsome?this.allsome+" ":"")+this.right.toString()};yy.Op.prototype.toType=function(tableid){if(["-","*","/","%"].indexOf(this.op)>-1)return"number";if(this.op=="+"){if(this.left.toType(tableid)=="string"||this.right.toType(tableid)=="string")return"string";if(this.left.toType(tableid)=="number"||this.right.toType(tableid)=="number")return"number"}if(["AND","OR","NOT","=","==","===","!=","!==","!===",">",">=","<","<=","IN","NOT IN","LIKE"].indexOf(this.op)>-1)return"boolean";if(this.op=="BETWEEN"||this.op=="NOT BETWEEN")return"boolean";if(this.allsome)return"boolean";if(!this.op)return this.left.toType();return"unknown"};yy.Op.prototype.toJavaScript=function(context,tableid,defcols){var op=this.op;if(this.op=="=")op="===";else if(this.op=="<>")op="!=";else if(this.op=="OR")op="||";if(this.op=="->"){if(typeof this.right=="string"){return this.left.toJavaScript(context,tableid,defcols)+'["'+this.right+'"]'}else if(typeof this.right=="number"){return this.left.toJavaScript(context,tableid,defcols)+"["+this.right+"]"}else if(this.right instanceof yy.FuncValue){ss=[];if(!this.right.args||this.right.args.length==0){}else{var ss=this.right.args.map(function(arg){return arg.toJavaScript(context,tableid,defcols)})}return this.left.toJavaScript(context,tableid,defcols)+"['"+this.right.funcid+"']("+ss.join(",")+")"}else{return this.left.toJavaScript(context,tableid,defcols)+"["+this.right.toJavaScript(context,tableid,defcols)+"]"}}if(this.op=="=="){return"alasql.utils.deepEqual("+this.left.toJavaScript(context,tableid,defcols)+","+this.right.toJavaScript(context,tableid,defcols)+")"}if(this.op=="==="){return"(("+this.left.toJavaScript(context,tableid,defcols)+").valueOf()===("+this.right.toJavaScript(context,tableid,defcols)+".valueOf()))"}if(this.op=="!==="){return"!(("+this.left.toJavaScript(context,tableid,defcols)+").valueOf()===("+this.right.toJavaScript(context,tableid,defcols)+".valueOf()))"}if(this.op=="!=="){return"(!alasql.utils.deepEqual("+this.left.toJavaScript(context,tableid,defcols)+","+this.right.toJavaScript(context,tableid,defcols)+"))"}if(this.op=="LIKE"){var s="("+this.left.toJavaScript(context,tableid,defcols)+"+'')"+".match(new RegExp('^'+("+this.right.toJavaScript(context,tableid,defcols)+").replace(/\\%/g,'.*')+'$','g'))";return s}if(this.op=="BETWEEN"){if(this.right instanceof yy.Op&&this.right.op=="AND"){return"(("+this.right.left.toJavaScript(context,tableid,defcols)+"<="+this.left.toJavaScript(context,tableid,defcols)+")&&"+"("+this.left.toJavaScript(context,tableid,defcols)+"<="+this.right.right.toJavaScript(context,tableid,defcols)+"))"}else{throw new Error("Wrong BETWEEM operator without AND part")}}if(this.op=="NOT BETWEEN"){if(this.right instanceof yy.Op&&this.right.op=="AND"){return"!(("+this.right.left.toJavaScript(context,tableid,defcols)+"<="+this.left.toJavaScript(context,tableid,defcols)+")&&"+"("+this.left.toJavaScript(context,tableid,defcols)+"<="+this.right.right.toJavaScript(context,tableid,defcols)+"))"}else{throw new Error("Wrong NOT BETWEEM operator without AND part")}}if(this.op=="IN"){if(this.right instanceof yy.Select){var s="(this.query.queriesdata["+this.queriesidx+"].indexOf(";s+=this.left.toJavaScript(context,tableid,defcols)+")>-1)";return s}else if(this.right instanceof Array){var s="(["+this.right.map(function(a){return a.toJavaScript(context,tableid,defcols)}).join(",")+"].indexOf(";s+=this.left.toJavaScript(context,tableid,defcols)+")>-1)";return s}else{throw new Error("Wrong IN operator without SELECT part")}}if(this.op=="NOT IN"){if(this.right instanceof yy.Select){var s="(this.query.queriesdata["+this.queriesidx+"].indexOf(";s+=this.left.toJavaScript(context,tableid,defcols)+")<0)";return s}else if(this.right instanceof Array){var s="(["+this.right.map(function(a){return a.toJavaScript(context,tableid,defcols)}).join(",")+"].indexOf(";s+=this.left.toJavaScript(context,tableid,defcols)+")<0)";return s}else{throw new Error("Wrong NOT IN operator without SELECT part")}}if(this.allsome=="ALL"){if(this.right instanceof yy.Select){var s="this.query.queriesdata["+this.queriesidx+"].every(function(b){return (";s+=this.left.toJavaScript(context,tableid,defcols)+")"+op+"b})";return s}else if(this.right instanceof Array){var s="["+this.right.map(function(a){return a.toJavaScript(context,tableid,defcols)}).join(",")+"].every(function(b){return (";s+=this.left.toJavaScript(context,tableid,defcols)+")"+op+"b})";return s}else{throw new Error("Wrong NOT IN operator without SELECT part")}}if(this.allsome=="SOME"||this.allsome=="ANY"){if(this.right instanceof yy.Select){var s="this.query.queriesdata["+this.queriesidx+"].some(function(b){return (";s+=this.left.toJavaScript(context,tableid,defcols)+")"+op+"b})";return s}else if(this.right instanceof Array){var s="["+this.right.map(function(a){return a.toJavaScript(context,tableid,defcols)}).join(",")+"].some(function(b){return (";s+=this.left.toJavaScript(context,tableid,defcols)+")"+op+"b})";return s}else{throw new Error("Wrong NOT IN operator without SELECT part")}}if(this.op=="AND"){if(this.left.reduced){if(this.right.reduced){return"true"}else{return this.right.toJavaScript(context,tableid,defcols)}}else if(this.right.reduced){return this.left.toJavaScript(context,tableid,defcols)}op="&&"}return"("+this.left.toJavaScript(context,tableid,defcols)+op+this.right.toJavaScript(context,tableid,defcols)+")"};yy.NumValue=function(params){return yy.extend(this,params)};yy.NumValue.prototype.toString=function(){return N(this.value.toString())};yy.NumValue.prototype.toType=function(){return"number"};yy.NumValue.prototype.toJavaScript=function(){return""+this.value};yy.StringValue=function(params){return yy.extend(this,params)};yy.StringValue.prototype.toString=function(){return"'"+S(this.value.toString())+"'"};yy.StringValue.prototype.toType=function(){return"string"};yy.StringValue.prototype.toJavaScript=function(){return"'"+escapeq(this.value)+"'"};yy.LogicValue=function(params){return yy.extend(this,params)};yy.LogicValue.prototype.toString=function(){return this.value?"TRUE":"FALSE"};yy.LogicValue.prototype.toType=function(){return"boolean"};yy.LogicValue.prototype.toJavaScript=function(){return this.value?"true":"false"};yy.NullValue=function(params){return yy.extend(this,params)};yy.NullValue.prototype.toString=function(){return"NULL"};yy.NullValue.prototype.toJavaScript=function(){return"null"};yy.ParamValue=function(params){return yy.extend(this,params)};yy.ParamValue.prototype.toString=function(){return"$"+this.param};yy.ParamValue.prototype.toJavaScript=function(){if(typeof this.param=="string")return"params['"+this.param+"']";else return"params["+this.param+"]"};yy.UniOp=function(params){return yy.extend(this,params)};yy.UniOp.prototype.toString=function(){if(this.op=="-")return this.op+this.right.toString();if(this.op=="NOT")return this.op+"("+this.right.toString()+")";else if(this.op==null)return"("+this.right.toString()+")"};yy.UniOp.prototype.toType=function(tableid){if(this.op=="-")return"number";if(this.op=="NOT")return"boolean"};yy.UniOp.prototype.toJavaScript=function(context,tableid,defcols){if(this.op=="-")return"-"+this.right.toJavaScript(context,tableid,defcols);if(this.op=="NOT")return"!("+this.right.toJavaScript(context,tableid,defcols)+")";else if(this.op==null)return"("+this.right.toJavaScript(context,tableid,defcols)+")"};yy.Column=function(params){return yy.extend(this,params)};yy.Column.prototype.toString=function(){var s;if(this.columnid==+this.columnid){s="["+this.columnid+"]"}else{s=this.columnid}if(this.tableid){if(+this.columnid==this.columnid){s=this.tableid+s}else{s=this.tableid+"."+s}if(this.databaseid){s=this.databaseid+"."+s}}return s};yy.Column.prototype.toJavaScript=function(context,tableid,defcols){var s="";if(!this.tableid&&tableid==""&&!defcols){if(this.columnid!=""){s=context+"['"+this.columnid+"']"}else{s=context}}else{if(this.tableid){if(this.columnid!=""){s=context+"['"+this.tableid+"']['"+this.columnid+"']"}else{s=context+"['"+this.tableid+"']"}}else if(defcols){var tbid=defcols[this.columnid];if(tbid=="-"){throw new Error('Cannot resolve column "'+this.columnid+'" because it exists in two source tables')}else if(tbid){if(this.columnid!=""){s=context+"['"+tbid+"']['"+this.columnid+"']"}else{s=context+"['"+tbid+"']"}}else{if(this.columnid!=""){s=context+"['"+(this.tableid||tableid)+"']['"+this.columnid+"']"}else{s=context+"['"+(this.tableid||tableid)+"']"}}}else if(tableid==-1){s=context+"['"+this.columnid+"']"}else{if(this.columnid!=""){s=context+"['"+(this.tableid||tableid)+"']['"+this.columnid+"']"}else{s=context+"['"+(this.tableid||tableid)+"']"}}}return s};yy.AggrValue=function(params){return yy.extend(this,params)};yy.AggrValue.prototype.toString=function(){var s=this.aggregatorid+"(";if(this.expression)s+=this.expression.toString();s+=")";return s};yy.AggrValue.prototype.toType=function(){if(["SUM","COUNT","AVG","MIN","MAX","AGGR"].indexOf(this.aggregatorid)>-1)return"number";if(["ARRAY"].indexOf(this.aggregatorid)>-1)return"array";if(["FIRST","LAST"].indexOf(this.aggregatorid)>-1)return this.expression.toType()};yy.AggrValue.prototype.toJavaScript=function(context,tableid,defcols){return""};yy.OrderExpression=function(params){return yy.extend(this,params)};yy.OrderExpression.prototype.toString=function(){var s=this.expression.toString();if(this.order)s+=" "+this.order.toString();return s};yy.GroupExpression=function(params){return yy.extend(this,params)};yy.GroupExpression.prototype.toString=function(){return this.type+"("+this.group.toString()+")"};yy.ColumnDef=function(params){return yy.extend(this,params)};yy.ColumnDef.prototype.toString=function(){var s=this.columnid;if(this.dbtypeid)s+=" "+this.dbtypeid;if(this.dbsize){s+="("+this.dbsize;if(this.dbprecision)s+=","+this.dbprecision;s+=")"}if(this.primarykey)s+=" PRIMARY KEY";if(this.notnull)s+=" NOT NULL";return s};yy.FuncValue=function(params){return yy.extend(this,params)};yy.FuncValue.prototype.toString=function(){var s="";if(alasql.fn[this.funcid])s+=this.funcid;else if(alasql.stdlib[this.funcid.toUpperCase()]||alasql.stdfn[this.funcid.toUpperCase()])s+=this.funcid.toUpperCase();s+="(";if(this.args&&this.args.length>0){s+=this.args.map(function(arg){return arg.toString()}).join(",")}s+=")";if(this.as)s+=" AS "+this.as.toString();return s};yy.FuncValue.prototype.toJavaScript=function(context,tableid,defcols){var s="";var funcid=this.funcid;if(alasql.fn[funcid]){if(this.newid)s+="new ";s+="alasql.fn."+this.funcid+"(";if(this.args&&this.args.length>0){s+=this.args.map(function(arg){return arg.toJavaScript(context,tableid,defcols)}).join(",")}s+=")"}else if(alasql.stdlib[funcid.toUpperCase()]){if(this.args&&this.args.length>0){s+=alasql.stdlib[funcid.toUpperCase()].apply(this,this.args.map(function(arg){return arg.toJavaScript(context,tableid)}))}else{s+=alasql.stdlib[funcid.toUpperCase()]()}}else if(alasql.stdfn[funcid.toUpperCase()]){if(this.newid)s+="new ";s+="alasql.stdfn."+this.funcid.toUpperCase()+"(";if(this.args&&this.args.length>0){s+=this.args.map(function(arg){return arg.toJavaScript(context,tableid,defcols)}).join(",")}s+=")"}return s};var stdlib=alasql.stdlib={};var stdfn=alasql.stdfn={};stdlib.ABS=function(a){return"Math.abs("+a+")"};stdlib.CLONEDEEP=function(a){return"alasql.utils.cloneDeep("+a+")"};stdlib.IIF=function(a,b,c){if(arguments.length==3){return"(("+a+")?("+b+"):("+c+"))"}else{throw new Error("Number of arguments of IFF is not equals to 3")}};stdlib.IFNULL=function(a,b){return"("+a+"||"+b+")"};stdlib.INSTR=function(s,p){return"(("+s+").indexOf("+p+")+1)"};stdlib.LEN=stdlib.LENGTH=function(s){return"("+s+'+"").length'};stdlib.LOWER=stdlib.LCASE=function(s){return"("+s+").toLowerCase()"};stdlib.MAX=function(){return"Math.max("+arguments.join(",")+")"};stdlib.MIN=function(){return"Math.min("+arguments.join(",")+")"};stdlib.MID=function(a,b,c){if(arguments.length==2)return"("+a+").substr("+b+"-1)";else if(arguments.length==3)return"("+a+").substr("+b+"-1,"+c+")"};stdlib.NULLIF=function(a,b){return"("+a+"=="+b+"?null:"+a+")"};stdlib.RANDOM=function(r){if(arguments.length==0){return"Math.random()"}else{return"(Math.random()*("+r+")|0)"}};stdlib.ROUND=function(s,d){if(arguments.length==2){return"Math.round("+s+"*Math.pow(10,"+d+"))/Math.pow(10,"+d+")"}else{return"Math.round("+s+")"}};alasql.stdlib.SQRT=function(s){return"Math.sqrt("+s+")"};stdlib.UPPER=stdlib.UCASE=function(s){return"("+s+").toUpperCase()"};yy.CaseValue=function(params){return yy.extend(this,params)};yy.CaseValue.prototype.toString=function(){var s="CASE ";if(this.expression)s+=this.expression.toString();if(this.whens){s+=this.whens.map(function(w){return" WHEN "+w.when.toString()+" THEN "+w.then.toString()}).join()}s+=" END";return s};yy.CaseValue.prototype.toJavaScript=function(context,tableid,defcols){var s="(function(p,params,alasql){var r;";if(this.expression){s+="v="+this.expression.toJavaScript(context,tableid,defcols)+";";s+=(this.whens||[]).map(function(w){return" if(v=="+w.when.toJavaScript(context,tableid,defcols)+") {r="+w.then.toJavaScript(context,tableid,defcols)+"}"}).join(" else ");if(this.elses)s+=" else {r="+this.elses.toJavaScript(context,tableid,defcols)+"}"}else{s+=(this.whens||[]).map(function(w){return" if("+w.when.toJavaScript(context,tableid,defcols)+") {r="+w.then.toJavaScript(context,tableid,defcols)+"}"}).join(" else ");if(this.elses)s+=" else {r="+this.elses.toJavaScript(context,tableid,defcols)+"}"}s+="return r;})(p,params,alasql)";return s};yy.Json=function(params){return yy.extend(this,params)};yy.Json.prototype.toString=function(){var s="@";s+=JSONtoString(this.value);s+="";return s};var JSONtoString=alasql.utils.JSONtoString=function(obj){var s="";if(typeof obj=="string")s='"'+obj+'"';else if(typeof obj=="number")s=obj;else if(typeof obj=="boolean")s=obj;else if(typeof obj=="object"){if(obj instanceof Array){s+="["+obj.map(function(b){return JSONtoString(b)}).join(",")+"]"}else if(!obj.toJavaScript||obj instanceof yy.Json){s="{";var ss=[];for(var k in obj){var s1="";if(typeof k=="string")s1+='"'+k+'"';else if(typeof k=="number")s1+=k;else if(typeof k=="boolean")s1+=k;else{throw new Error("THis is not ES6... no expressions on left side yet")}s1+=":"+JSONtoString(obj[k]);ss.push(s1)}s+=ss.join(",")+"}"}else if(obj.toString){s=obj.toString()}else{throw new Error("1Can not show JSON object "+JSON.stringify(obj))}}else{throw new Error("2Can not show JSON object "+JSON.stringify(obj))}return s};function JSONtoJavaScript(obj,context,tableid,defcols){var s="";if(typeof obj=="string")s='"'+obj+'"';else if(typeof obj=="number")s="("+obj+")";else if(typeof obj=="boolean")s=obj;else if(typeof obj=="object"){if(obj instanceof Array){s+="["+obj.map(function(b){return JSONtoJavaScript(b,context,tableid,defcols)}).join(",")+"]"}else if(!obj.toJavaScript||obj instanceof yy.Json){s="{";var ss=[];for(var k in obj){var s1="";if(typeof k=="string")s1+='"'+k+'"';else if(typeof k=="number")s1+=k;else if(typeof k=="boolean")s1+=k;else{throw new Error("THis is not ES6... no expressions on left side yet")}s1+=":"+JSONtoJavaScript(obj[k],context,tableid,defcols);ss.push(s1)}s+=ss.join(",")+"}"}else if(obj.toJavaScript){s=obj.toJavaScript(context,tableid,defcols)}else{throw new Error("1Can not parse JSON object "+JSON.stringify(obj))}}else{throw new Error("2Can not parse JSON object "+JSON.stringify(obj))}return s}yy.Json.prototype.toJavaScript=function(context,tableid,defcols){return JSONtoJavaScript(this.value,context,tableid,defcols)};yy.Cast=function(params){return yy.extend(this,params)};yy.Cast.prototype.toString=function(){var s="CAST(";s+=this.expression.toString();s+=" AS ";s+=this.dbtypeid;if(typeof this.dbsize!="undefined"){s+="("+this.dbsize;if(this.dbprecision)s+=","+dbprecision;s+=")"}s+=")";return s};yy.Cast.prototype.toJavaScript=function(context,tableid,defcols){if(this.dbtypeid=="INT"){return"(("+this.expression.toJavaScript(context,tableid,defcols)+")|0)"}if(this.dbtypeid=="STRING"){return'(""+'+this.expression.toJavaScript(context,tableid,defcols)+")"}if(this.dbtypeid=="NUMBER"){return"(+("+this.expression.toJavaScript(context,tableid,defcols)+"))"}if(this.dbtypeid=="DATE"){if(alasql.options.datetimeformat=="javascript"){return"(new Date("+this.expression.toJavaScript(context,tableid,defcols)+"))"}else if(alasql.options.datetimeformat=="sql"){return this.expression.toJavaScript(context,tableid,defcols)}}if(this.dbtypeid=="DATETIME"){if(alasql.options.datetimeformat=="javascript"){return"(new Date("+this.expression.toJavaScript(context,tableid,defcols)+"))"}else if(alasql.options.datetimeformat=="sql"){return this.expression.toJavaScript(context,tableid,defcols)}}else{}throw new Error("There is not such type conversion for "+this.toString())};yy.ColumnDef=function(params){return yy.extend(this,params)};yy.ColumnDef.prototype.toString=function(){var s=this.columnid;if(this.dbtypeid)s+=" "+this.dbtypeid;if(this.dbsize){s+="("+this.dbsize;if(this.dbprecision)s+=","+this.dbprecision;s+=")"}if(this.primarykey)s+=" PRIMARY KEY";if(this.notnull)s+=" NOT NULL";return s};yy.CreateTable=function(params){return yy.extend(this,params)};yy.CreateTable.prototype.toString=function(){var s=K("CREATE");if(this.temporary)s+=" "+K("TEMPORARY");s+=" "+K("TABLE");if(this.ifnotexists)s+=" "+K("IF")+" "+K("NOT")+" "+K("EXISTS");s+=" "+this.table.toString();if(this.as)s+=" "+K("AS")+" "+L(this.as);else{var ss=this.columns.map(function(col){return col.toString()});s+=" ("+NL()+ID()+ss.join(","+NL()+ID())+")"}return s};yy.CreateTable.prototype.execute=function(databaseid,params,cb){var db=alasql.databases[this.table.databaseid||databaseid];var tableid=this.table.tableid;if(!tableid){throw new Error("Table name is not defined")}var columns=this.columns;var constraints=this.constraints||[];if(this.ifnotexists&&db.tables[tableid])return 0;if(db.tables[tableid]){throw new Error("Can not create table '"+tableid+"', because it already exists in the database '"+db.databaseid+"'")}var table=db.tables[tableid]=new alasql.Table;var ss=[];if(this.columns){this.columns.forEach(function(col){var dbtypeid=col.dbtypeid;if(!alasql.fn[dbtypeid])dbtypeid=dbtypeid.toUpperCase();var newcol={columnid:col.columnid,dbtypeid:dbtypeid};if(col.default){ss.push("'"+col.columnid+"':"+col.default.toJavaScript())}table.columns.push(newcol);table.xcolumns[newcol.columnid]=newcol;if(col.primarykey){var pk=table.pk={};pk.columns=[col.columnid];pk.onrightfns="r['"+col.columnid+"']";pk.onrightfn=new Function("r","return "+pk.onrightfns);pk.hh=hash(pk.onrightfns);table.indices[pk.hh]={}}})}table.defaultfns=ss.join(",");constraints.forEach(function(con){if(con.type=="PRIMARY KEY"){if(table.pk){throw new Error("Primary key already exists")}var pk=table.pk={};pk.columns=con.columns;pk.onrightfns=pk.columns.map(function(columnid){return"r['"+columnid+"']"}).join("+'`'+");pk.onrightfn=new Function("r","return "+pk.onrightfns);pk.hh=hash(pk.onrightfns);table.indices[pk.hh]={}}});if(db.engineid){return alasql.engines[db.engineid].createTable(this.table.databaseid||databaseid,tableid,this.ifnotexists,cb)}table.insert=function(r){if(this.pk){var pk=this.pk;var addr=pk.onrightfn(r);if(typeof this.indices[pk.hh][addr]!="undefined"){throw new Error("Cannot insert record, because it already exists in primary key")}else{table.data.push(r);this.indices[pk.hh][addr]=r}}else{table.data.push(r)}};table.delete=function(i){if(this.pk){var r=this.data[i];var pk=this.pk;var addr=pk.onrightfn(r);if(typeof this.indices[pk.hh][addr]=="undefined"){throw new Error("Something wrong with index on table")}else{this.indices[pk.hh][addr]=undefined}}};table.deleteall=function(){this.data.length=0;if(this.pk){this.indices[this.pk.hh]={}}};table.update=function(assignfn,i,params){if(this.pk){var r=this.data[i];var pk=this.pk;var addr=pk.onrightfn(r,params);if(typeof this.indices[pk.hh][addr]=="undefined"){throw new Error("Something wrong with index on table")}else{this.indices[pk.hh][addr]=undefined;assignfn(r);var newaddr=pk.onrightfn(r);if(typeof this.indices[pk.hh][newaddr]!="undefined"){throw new Error("Record already exists")}else{this.indices[pk.hh][newaddr]=r}}}else{assignfn(this.data[i])}};if(cb)cb(1);return 1};stdfn.DATE=function(d){return new Date(d)};stdfn.NOW=function(){var d=new Date;var s=d.getFullYear()+"."+("0"+d.getMonth()).substr(-2)+"."+("0"+d.getDate()).substr(-2);s+=" "+("0"+d.getHours()).substr(-2)+":"+("0"+d.getMinutes()).substr(-2)+"."+("0"+d.getSeconds()).substr(-2);return s};stdfn.SECOND=function(d){d=new Date(d);return d.getSeconds()};stdfn.MINUTE=function(d){d=new Date(d);return d.getMinutes()};stdfn.HOUR=function(d){d=new Date(d);return d.getHours()};stdfn.DAYOFWEEK=stdfn.WEEKDAY=function(d){d=new Date(d);return d.getDay()};stdfn.DAY=stdfn.DAYOFMONTH=function(d){d=new Date(d);return d.getDate()};stdfn.MONTH=function(d){d=new Date(d);return d.getMonth()+1};stdfn.YEAR=function(d){d=new Date(d);return d.getFullYear()};yy.DropTable=function(params){return yy.extend(this,params)};yy.DropTable.prototype.toString=function(){var s=K("DROP")+" "+K("TABLE");if(this.ifexists)s+=" "+K("IF")+" "+K("EXISTS");s+=" "+this.table.toString();return s};yy.DropTable.prototype.execute=function(databaseid,params,cb){var db=alasql.databases[this.table.databaseid||databaseid];var tableid=this.table.tableid;if(db.engineid){return alasql.engines[db.engineid].dropTable(this.table.databaseid||databaseid,tableid,this.ifexists,cb)}if(!this.ifexists||this.ifexists&&db.tables[tableid]){if(!db.tables[tableid]){if(!alasql.options.dropifnotexists){throw new Error("Can not drop table '"+this.table.tableid+"', because it does not exist in the database.")}}else{delete db.tables[tableid];return 1}}return 0};yy.AlterTable=function(params){return yy.extend(this,params)};yy.AlterTable.prototype.toString=function(){var s="ALTER TABLE "+this.table.toString();if(this.renameto)s+=" RENAME TO "+this.renameto;return s};yy.AlterTable.prototype.execute=function(databaseid,params,cb){var db=alasql.databases[databaseid];db.dbversion=Date.now();if(this.renameto){var oldtableid=this.table.tableid;var newtableid=this.renameto;var res=1;if(db.tables[newtableid]){throw new Error("Can not rename a table '"+oldtableid+"' to '"+newtableid+"', because the table with this name already exists")}else if(newtableid==oldtableid){throw new Error("Can not rename a table '"+oldtableid+"' to itself")}else{db.tables[newtableid]=db.tables[oldtableid];delete db.tables[oldtableid];res=1}if(cb)cb(res);return res}else if(this.addcolumn){var db=alasql.databases[this.table.databaseid||databaseid];db.dbversion++;var tableid=this.table.tableid;var table=db.tables[tableid];var columnid=this.addcolumn.columnid;if(table.xcolumns[columnid]){throw new Error('Cannot add column "'+columnid+'", because it already exists in the table "'+tableid+'"')}var col={columnid:columnid,dbtypeid:this.dbtypeid,dbsize:this.dbsize,dbprecision:this.dbprecision,dbenum:this.dbenum,defaultfns:null};var defaultfn=function(){};table.columns.push(col);table.xcolumns[columnid]=col;for(var i=0,ilen=table.data.length;i<ilen;i++){table.data[i][columnid]=defaultfn()}return 1}else if(this.modifycolumn){var db=alasql.databases[this.table.databaseid||databaseid];db.dbversion++;var tableid=this.table.tableid;var table=db.tables[tableid];var columnid=this.modifycolumn.columnid;if(!table.xcolumns[columnid]){throw new Error('Cannot modify column "'+columnid+'", because it was not found in the table "'+tableid+'"')}var col=table.xcolumns[columnid];col.dbtypeid=this.dbtypeid;col.dbsize=this.dbsize;col.dbprecision=this.dbprecision;col.dbenum=this.dbenum;return 1}else if(this.renamecolumn){var db=alasql.databases[this.table.databaseid||databaseid];db.dbversion++;var tableid=this.table.tableid;var table=db.tables[tableid];var columnid=this.renamecolumn;var tocolumnid=this.to;var col;if(!table.xcolumns[columnid]){throw new Error('Column "'+columnid+'" is not found in the table "'+tableid+'"')}if(table.xcolumns[tocolumnid]){throw new Error('Column "'+tocolumnid+'" already exists in the table "'+tableid+'"')}if(columnid!=tocolumnid){for(var j=0;j<table.columns.length;j++){if(table.columns[j].columnid==columnid){table.columns[j].columnid=tocolumnid}}table.xcolumns[tocolumnid]=table.xcolumns[columnid];delete table.xcolumns[columnid];for(var i=0,ilen=table.data.length;i<ilen;i++){table.data[i][tocolumnid]=table.data[i][columnid];delete table.data[i][columnid]}return table.data.length}else return 0}else if(this.dropcolumn){var db=alasql.databases[this.table.databaseid||databaseid];db.dbversion++;var tableid=this.table.tableid;var table=db.tables[tableid];var columnid=this.dropcolumn;var found=false;for(var j=0;j<table.columns.length;j++){if(table.columns[j].columnid==columnid){found=true;table.columns.splice(j,1);break}}if(!found){throw new Error('Cannot drop column "'+columnid+'", because it was not found in the table "'+tableid+'"')}delete table.xcolumns[columnid];for(var i=0,ilen=table.data.length;i<ilen;i++){delete table.data[i][columnid]}return table.data.length}else{throw Error("Unknown ALTER TABLE method")}};yy.CreateIndex=function(params){return yy.extend(this,params)};yy.CreateTable.prototype.toString=function(){var s="CREATE";if(this.unique)s+=" UNIQUE";s+=" INDEX "+this.indexid+" ON "+this.table.toString();s+="("+this.columns.toString()+")";return s};yy.CreateIndex.prototype.execute=function(databaseid){var db=alasql.databases[databaseid];var tableid=this.table.tableid;var table=db.tables[tableid];var indexid=this.indexid;if(this.unique){var rightfns=this.columns.map(function(colid){return"r['"+colid+"']"}).join("+'`'+");table.uniqdefs[indexid]={rightfns:rightfns};var ux=table.uniqs[indexid]={};if(table.data.length>0){for(var i=0,ilen=table.data.length;i<ilen;i++){var addr=rightfns(table.data[i]);if(!ux[addr]){ux[addr]={num:0}}ux[addr].num++}}}else{var rightfns=this.columns.map(function(colid){return"r['"+colid+"']"}).join("+'`'+");var hh=hash(rightfns);table.inddefs[indexid]={rightfns:rightfns,hh:hh};table.indices[hh]={};var ix=table.indices[hh]={};if(table.data.length>0){for(var i=0,ilen=table.data.length;i<ilen;i++){var addr=rightfns(table.data[i]);if(!ix[addr]){ix[addr]=[]}ix[addr].push(table.data[i])}}}};yy.DropIndex=function(params){return yy.extend(this,params)};yy.DropIndex.prototype.toString=function(){return"INDEX TABLE"+this.indexid};yy.DropIndex.prototype.compile=function(db){var indexid=this.indexid;return function(){return 1}};yy.CreateView=function(params){return yy.extend(this,params)};yy.CreateView.prototype.toString=function(){var s="CREATE VIEW";s+=" "+this.view.toString();if(this.columns){var ss=this.columns.map(function(col){return col.toString()});s+=" ("+ss.join(",")+")"}s+=" AS "+this.select.toString();return s};yy.CreateView.prototype.execute=function(databaseid){var db=alasql.databases[this.view.databaseid||databaseid];var v=db.views[this.view.viewid]=new View;return 1};yy.Insert=function(params){return yy.extend(this,params)};yy.Insert.prototype.toString=function(){var s="INSERT INTO "+this.into.toString();if(this.columns)s+="("+this.columns.toString()+")";if(this.values)s+=" VALUES "+this.values.toString();if(this.select)s+=" "+this.select.toString();return s};yy.Insert.prototype.compile=function(databaseid){var self=this;databaseid=self.into.databaseid||databaseid;var db=alasql.databases[databaseid];var tableid=self.into.tableid;var table=db.tables[tableid];var s="";var sw="";var s3="var a,aa=[];";var s33;if(this.values){self.values.forEach(function(values){var ss=[];if(self.columns){self.columns.forEach(function(col,idx){var q="'"+col.columnid+"':";if(table.xcolumns&&table.xcolumns[col.columnid]){if(["INT","FLOAT","NUMBER","MONEY"].indexOf(table.xcolumns[col.columnid].dbtypeid)>=0){q+="+"+values[idx].toJavaScript()}else if(alasql.fn[table.xcolumns[col.columnid].dbtypeid]){q+="(new "+table.xcolumns[col.columnid].dbtypeid+"(";q+=values[idx].toJavaScript();q+="))"}else{q+=values[idx].toJavaScript()}}else{q+=values[idx].toJavaScript()}ss.push(q)})}else{if(values instanceof Array&&table.columns&&table.columns.length>0){table.columns.forEach(function(col,idx){var q="'"+col.columnid+"':";if(["INT","FLOAT","NUMBER","MONEY"].indexOf(col.dbtypeid)>=0){q+="+"+values[idx].toJavaScript()}else if(alasql.fn[col.dbtypeid]){q+="(new "+col.dbtypeid+"(";q+=values[idx].toJavaScript();q+="))"}else{q+=values[idx].toJavaScript()}ss.push(q)})}else{sw=JSONtoJavaScript(values)}}if(db.tables[tableid].defaultfns)ss.unshift(db.tables[tableid].defaultfns);if(sw){s+="a="+sw+";"}else{s+="a={"+ss.join(",")+"};"}if(db.tables[tableid].insert){s+="alasql.databases['"+databaseid+"'].tables['"+tableid+"'].insert(a);"}else{s+="aa.push(a);"}});s33=s3+s;if(db.tables[tableid].insert){}else{s+="alasql.databases['"+databaseid+"'].tables['"+tableid+"'].data="+"alasql.databases['"+databaseid+"'].tables['"+tableid+"'].data.concat(aa);"}s+="return "+self.values.length;var insertfn=new Function("db, params",s3+s)}else if(this.select){selectfn=this.select.compile(databaseid);
if(db.engineid&&alasql.engines[db.engineid].intoTable){var statement=function(params,cb){var aa=selectfn(params);var res=alasql.engines[db.engineid].intoTable(db.databaseid,tableid,aa,null,cb);return res};return statement}else{var insertfn=function(db,params){var res=selectfn(params);db.tables[tableid].data=db.tables[tableid].data.concat(res);return res.length}}}else if(this.default){var insertfns="db.tables['"+tableid+"'].data.push({"+table.defaultfns+"});return 1;";var insertfn=new Function("db,params",insertfns)}else{throw new Error("Wrong INSERT parameters")}if(db.engineid&&alasql.engines[db.engineid].intoTable){var statement=function(params,cb){var aa=new Function("db,params",s33+"return aa;")(db,params);var res=alasql.engines[db.engineid].intoTable(db.databaseid,tableid,aa,null,cb);return res}}else{var statement=function(params,cb){var db=alasql.databases[databaseid];if(alasql.autocommit&&db.engineid){alasql.engines[db.engineid].loadTableData(databaseid,tableid)}var res=insertfn(db,params);if(alasql.autocommit&&db.engineid){alasql.engines[db.engineid].saveTableData(databaseid,tableid)}if(cb)cb(res);return res}}return statement};yy.Insert.prototype.execute=function(databaseid,params,cb){return this.compile(databaseid)(params,cb)};yy.Delete=function(params){return yy.extend(this,params)};yy.Delete.prototype.toString=function(){var s="DELETE FROM "+this.table.toString();if(this.where)s+=" WHERE "+this.where.toString();return s};yy.Delete.prototype.compile=function(databaseid){databaseid=this.table.databaseid||databaseid;var tableid=this.table.tableid;var statement;var db=alasql.databases[databaseid];if(this.where){var wherefn=new Function("r,params","return ("+this.where.toJavaScript("r","")+")");statement=function(params,cb){if(db.engineid&&alasql.engines[db.engineid].deleteFromTable){return alasql.engines[db.engineid].deleteFromTable(databaseid,tableid,wherefn,params,cb)}if(alasql.autocommit&&db.engineid&&db.engineid=="LOCALSTORAGE"){alasql.engines[db.engineid].loadTableData(databaseid,tableid)}var table=db.tables[tableid];var orignum=table.data.length;var newtable=[];for(var i=0,ilen=table.data.length;i<ilen;i++){if(wherefn(table.data[i],params)){if(table.delete){table.delete(i)}else{}}else newtable.push(table.data[i])}table.data=newtable;var res=orignum-table.data.length;if(alasql.autocommit&&db.engineid&&db.engineid=="LOCALSTORAGE"){alasql.engines[db.engineid].saveTableData(databaseid,tableid)}if(cb)cb(res);return res}}else{statement=function(params,cb){if(alasql.autocommit&&db.engineid){alasql.engines[db.engineid].loadTableData(databaseid,tableid)}var table=db.tables[tableid];table.dirty=true;var orignum=db.tables[tableid].data.length;table.deleteall();if(alasql.autocommit&&db.engineid){alasql.engines[db.engineid].saveTableData(databaseid,tableid)}if(cb)cb(orignum);return orignum}}return statement};yy.Delete.prototype.execute=function(databaseid,params,cb){return this.compile(databaseid)(params,cb)};yy.Update=function(params){return yy.extend(this,params)};yy.Update.prototype.toString=function(){var s="UPDATE "+this.table.toString();if(this.columns)s+=" SET "+this.columns.toString();if(this.where)s+=" WHERE "+this.where.toString();return s};yy.SetColumn=function(params){return yy.extend(this,params)};yy.SetColumn.prototype.toString=function(){return this.columnid.toString()+"="+this.expression.toString()};yy.Update.prototype.compile=function(databaseid){databaseid=this.table.databaseid||databaseid;var tableid=this.table.tableid;if(this.where){var wherefn=new Function("r,params","return "+this.where.toJavaScript("r",""))}var s="";this.columns.forEach(function(col){s+="r['"+col.columnid+"']="+col.expression.toJavaScript("r","")+";"});var assignfn=new Function("r,params",s);var statement=function(params,cb){var db=alasql.databases[databaseid];if(db.engineid&&alasql.engines[db.engineid].updateTable){return alasql.engines[db.engineid].updateTable(databaseid,tableid,assignfn,wherefn,params,cb)}if(alasql.autocommit&&db.engineid){alasql.engines[db.engineid].loadTableData(databaseid,tableid)}var table=db.tables[tableid];if(!table){throw new Error("Table '"+tableid+"' not exists")}var numrows=0;for(var i=0,ilen=table.data.length;i<ilen;i++){if(!wherefn||wherefn(table.data[i],params)){if(table.update){table.update(assignfn,i,params)}else{assignfn(table.data[i],params)}numrows++}}if(alasql.autocommit&&db.engineid){alasql.engines[db.engineid].saveTableData(databaseid,tableid)}if(cb)cb(numrows);return numrows};return statement};yy.Update.prototype.execute=function(databaseid,params,cb){return this.compile(databaseid)(params,cb)};yy.CreateDatabase=function(params){return yy.extend(this,params)};yy.CreateDatabase.prototype.toString=function(){var s=K("CREATE");if(this.engineid)s+=" "+L(this.engineid);s+=" "+K("DATABASE");if(this.ifnotexists)s+=" "+K("IF")+" "+K("NOT")+" "+K("EXISTS");s+=" "+L(this.databaseid);if(this.args&&this.args.length>0){s+="("+this.args.map(function(arg){return arg.toString()}).join(", ")+")"}if(this.as)s+=" "+K("AS")+" "+L(this.as);return s};yy.CreateDatabase.prototype.execute=function(databaseid,params,cb){var args;if(this.args&&this.args.length>0){args=this.args.map(function(arg){return new Function("params","return "+arg.toJavaScript())(params)})}if(this.engineid){var res=alasql.engines[this.engineid].createDatabase(this.databaseid,this.args,this.ifnotexists,this.as,cb);return res}else{var dbid=this.databaseid;if(alasql.databases[dbid]){throw new Error("Database '"+dbid+"' already exists")}var a=new alasql.Database(dbid);var res=1;if(cb)return cb(res);return res}};yy.AttachDatabase=function(params){return yy.extend(this,params)};yy.AttachDatabase.prototype.toString=function(){var s=K("ATTACH");if(this.engineid)s+=" "+L(this.engineid);s+=" "+K("DATABASE")+" "+L(this.databaseid);if(args){s+="(";if(args.length>0){s+=args.map(function(arg){return arg.toJavaScript()}).join(", ")}s+=")"}if(this.as)s+=" "+K("AS")+" "+L(this.as);return s};yy.AttachDatabase.prototype.execute=function(databaseid,params,cb){if(!alasql.engines[this.engineid]){throw new Error('Engine "'+this.engineid+'" is not defined.')}var res=alasql.engines[this.engineid].attachDatabase(this.databaseid,this.as,this.args,cb);return res};yy.DetachDatabase=function(params){return yy.extend(this,params)};yy.DetachDatabase.prototype.toString=function(){var s=K("DETACH");s+=" "+K("DATABASE")+" "+L(this.databaseid);return s};yy.DetachDatabase.prototype.execute=function(databaseid,params,cb){if(!alasql.databases[this.databaseid].engineid){throw new Error('Cannot detach database "'+this.engineid+'", because it was not attached.')}var res;var dbid=this.databaseid;if(dbid==alasql.DEFAULTDATABASEID){throw new Error("Drop of default database is prohibited")}if(!alasql.databases[dbid]){if(!this.ifexists){throw new Error("Database '"+dbid+"' does not exist")}else{res=0}}else{delete alasql.databases[dbid];if(dbid==alasql.useid){alasql.use()}res=1}if(cb)cb(res);return res};yy.UseDatabase=function(params){return yy.extend(this,params)};yy.UseDatabase.prototype.toString=function(){return K("USE")+" "+K("DATABASE")+" "+L(this.databaseid)};yy.UseDatabase.prototype.execute=function(databaseid,params,cb){var dbid=this.databaseid;if(!alasql.databases[dbid]){throw new Error("Database '"+dbid+"' does not exist")}alasql.use(dbid);var res=1;if(cb)cb(res);return res};yy.DropDatabase=function(params){return yy.extend(this,params)};yy.DropDatabase.prototype.toString=function(){var s=K("DROP");if(this.ifexists)s+=" "+K("IF")+" "+K("EXISTS");s+=" "+K("DATABASE")+" "+L(this.databaseid);return s};yy.DropDatabase.prototype.execute=function(databaseid,params,cb){if(this.engineid){return alasql.engines[this.engineid].dropDatabase(this.databaseid,this.ifexists,cb)}var res;var dbid=this.databaseid;if(dbid==alasql.DEFAULTDATABASEID){throw new Error("Drop of default database is prohibited")}if(!alasql.databases[dbid]){if(!this.ifexists){throw new Error("Database '"+dbid+"' does not exist")}else{res=0}}else{if(alasql.databases[dbid].engineid){throw new Error("Cannot drop database '"+dbid+"', because it is attached. Detach it.")}delete alasql.databases[dbid];if(dbid==alasql.useid){alasql.use()}res=1}if(cb)cb(res);return res};yy.ShowDatabases=function(params){return yy.extend(this,params)};yy.ShowDatabases.prototype.toString=function(){var s=K("SHOW")+" "+K("DATABASES");if(this.like)s+="LIKE "+this.like.toString();return s};yy.ShowDatabases.prototype.execute=function(databaseid,params,cb){if(this.engineid){return alasql.engines[this.engineid].showDatabases(this.like,cb)}else{var self=this;var res=[];for(dbid in alasql.databases){res.push({databaseid:dbid})}if(self.like&&res&&res.length>0){res=res.filter(function(d){return d.databaseid.match(new RegExp(self.like.value.replace(/\%/g,".*"),"g"))})}if(cb)cb(res);return res}};yy.ShowTables=function(params){return yy.extend(this,params)};yy.ShowTables.prototype.toString=function(){var s=K("SHOW")+" "+K("TABLES");if(this.databaseid)s+=" FROM "+this.databaseid;if(this.like)s+=" "+K("LIKE")+" "+this.like.toString();return s};yy.ShowTables.prototype.execute=function(databaseid,params,cb){var db=alasql.databases[this.databaseid||databaseid];var self=this;var res=[];for(tableid in db.tables){res.push({tableid:tableid})}if(self.like&&res&&res.length>0){res=res.filter(function(d){return d.tableid.match(new RegExp(self.like.value.replace(/\%/g,".*"),"g"))})}if(cb)cb(res);return res};yy.ShowColumns=function(params){return yy.extend(this,params)};yy.ShowColumns.prototype.toString=function(){var s=K("SHOW")+" "+K("COLUMNS");if(this.table.tableid)s+=" "+K("FROM")+" "+this.table.tableid;if(this.databaseid)s+=" "+K("FROM")+" "+this.databaseid;return s};yy.ShowColumns.prototype.execute=function(databaseid){var db=alasql.databases[this.databaseid||databaseid];var table=db.tables[this.table.tableid];var self=this;if(table&&table.columns){var res=table.columns.map(function(col){return{columnid:col.columnid,dbtypeid:col.dbtypeid,dbsize:col.dbsize}});return res}else{return[]}};yy.ShowIndex=function(params){return yy.extend(this,params)};yy.ShowIndex.prototype.toString=function(){var s=K("SHOW")+" "+K("INDEX");if(this.table.tableid)s+=" "+K("FROM")+" "+this.table.tableid;if(this.databaseid)s+=" "+K("FROM")+" "+this.databaseid;return s};yy.ShowIndex.prototype.execute=function(databaseid){var db=alasql.databases[this.databaseid||databaseid];var table=db.tables[this.table.tableid];var self=this;var res=[];if(table&&table.indices){for(var ind in table.indices){res.push({hh:ind,len:Object.keys(table.indices[ind]).length})}}return res};yy.ShowCreateTable=function(params){return yy.extend(this,params)};yy.ShowCreateTable.prototype.toString=function(){var s=K("SHOW")+" "+K("CREATE")+" "+K("TABLE")+" "+L(this.table.tableid);if(this.databaseid)s+=" "+K("FROM")+" "+L(this.databaseid);return s};yy.ShowCreateTable.prototype.execute=function(databaseid){var db=alasql.databases[this.databaseid||databaseid];var table=db.tables[this.table.tableid];var self=this;if(table){var s=K("CREATE")+" "+K("TABLE")+" "+L(this.table.tableid)+" (";var ss=[];if(table.columns){table.columns.forEach(function(col){var a=L(col.columnid)+" "+K(col.dbtypeid);if(col.dbsize)a+="("+N(col.dbsize)+")";if(col.primarykey)a+=" "+K("PRIMARY")+" "+K("KEY");ss.push(a)});s+=ss.join(", ")}s+=")";return s}else{throw new Error('There is no such table "'+this.table.tableid+'"')}};yy.SetVariable=function(params){return yy.extend(this,params)};yy.SetVariable.prototype.toString=function(){var s=K("SET")+" ";if(typeof this.autocommit!="undefined"){s+=K("AUTOCOMMIT")+" "+(this.autocommit?"ON":"OFF")}return s};yy.SetVariable.prototype.execute=function(databaseid,cb){if(typeof this.autocommit!="undefined"){alasql.autocommit=this.autocommit}};alasql.test=function(name,times,fn){if(arguments.length==0){alasql.log(alasql.con.results);return}else if(arguments.length==1){var tm=Date.now();fn();alasql.con.log(Date.now()-tm);return}if(arguments.length==2){fn=times;times=1}var tm=Date.now();for(var i=0;i<times;i++)fn();alasql.con.results[name]=Date.now()-tm};alasql.log=function(sql,params){var olduseid=alasql.useid;var target=alasql.options.logtarget;if(typeof exports=="object"){target="console"}var res;if(typeof sql=="string"){res=alasql(sql,params)}else{res=sql}if(target=="console"||typeof exports=="object"){if(typeof sql=="string"&&alasql.options.logprompt)console.log(olduseid+">",sql);if(res instanceof Array){if(console.table){console.table(res)}else{console.log(JSONtoString(res))}}else{console.log(JSONtoString(res))}}else{var el;if(target=="output"){el=document.getElementsByTagName("output")[0]}else{if(typeof target=="string"){el=document.getElementById(target)}else{el=target}}var s="";if(typeof sql=="string"&&alasql.options.logprompt){s+="<pre><code>"+alasql.pretty(sql)+"</code></pre>"}if(res instanceof Array){if(res.length==0){s+="<p>[ ]</p>"}else if(typeof res[0]!="object"||res[0]instanceof Array){for(var i=0,ilen=res.length;i<ilen;i++){s+="<p>"+loghtml(res[i])+"</p>"}}else{s+=loghtml(res)}}else{s+=loghtml(res)}el.innerHTML+=s}};alasql.clear=function(){var target=alasql.options.logtarget;if(typeof exports=="object"){target="console"}if(target=="console"||typeof exports=="object"){if(console.clear){console.clear()}else{}}else{var el;if(target=="output"){el=document.getElementsByTagName("output")[0]}else{if(typeof target=="string"){el=document.getElementById(target)}else{el=target}}el.innerHTML=""}};alasql.write=function(s){var target=alasql.options.logtarget;if(typeof exports=="object"){target="console"}if(target=="console"||typeof exports=="object"){if(console.log){console.log(s)}else{}}else{var el;if(target=="output"){el=document.getElementsByTagName("output")[0]}else{if(typeof target=="string"){el=document.getElementById(target)}else{el=target}}el.innerHTML+=s}};function loghtml(res){var s="";if(typeof res=="undefined"){s+="undefined"}else if(res instanceof Array){s+="<style>";s+="table {border:1px black solid; border-collapse: collapse; border-spacing: 0px;}";s+="td,th {border:1px black solid; padding-left:5px; padding-right:5px}";s+="th {background-color: #EEE}";s+="</style>";s+="<table>";var cols=[];for(colid in res[0]){cols.push(colid)}s+="<tr><th>#";cols.forEach(function(colid){s+="<th>"+colid});for(var i=0,ilen=res.length;i<ilen;i++){s+="<tr><th>"+(i+1);cols.forEach(function(colid){s+="<td> ";if(+res[i][colid]==+res[i][colid]){s+='<div style="text-align:right">';if(typeof res[i][colid]=="undefined")s+="NULL";else s+=res[i][colid];s+="</div>"}else{if(typeof res[i][colid]=="undefined"){s+="NULL"}else if(typeof res[i][colid]=="string"){s+=res[i][colid]}else s+=JSONtoString(res[i][colid])}})}s+="</table>"}else{s+="<p>"+JSONtoString(res)+"</p>"}return s}function scrollTo(element,to,duration){if(duration<=0)return;var difference=to-element.scrollTop;var perTick=difference/duration*10;setTimeout(function(){if(element.scrollTop==to)return;element.scrollTop=element.scrollTop+perTick;scrollTo(element,to,duration-10)},10)}alasql.prompt=function(el,useidel,firstsql){if(typeof exports=="object"){throw new Error("The functionality of prompt is not realized for Node.js")}var prompti=0;if(typeof el=="string")el=document.getElementById(el);if(typeof useidel=="string")useidel=document.getElementById(useidel);useidel.textContent=alasql.useid;if(firstsql){alasql.prompthistory.push(firstsql);prompti=alasql.prompthistory.length;try{var tm=Date.now();alasql.log(firstsql);alasql.write('<p style="color:blue">'+(Date.now()-tm)+" ms</p>")}catch(err){alasql.write("<p>"+olduseid+"> <b>"+sql+"</b></p>");alasql.write('<p style="color:red">'+err+"<p>")}}var y=el.getBoundingClientRect().top+document.getElementsByTagName("body")[0].scrollTop;scrollTo(document.getElementsByTagName("body")[0],y,500);el.onkeydown=function(event){if(event.which==13){var sql=el.value;var olduseid=alasql.useid;el.value="";alasql.prompthistory.push(sql);prompti=alasql.prompthistory.length;try{var tm=Date.now();alasql.log(sql);alasql.write('<p style="color:blue">'+(Date.now()-tm)+" ms</p>")}catch(err){alasql.write("<p>"+olduseid+"> "+alasql.pretty(sql,false)+"</p>");alasql.write('<p style="color:red">'+err+"<p>")}el.focus();useidel.textContent=alasql.useid;var y=el.getBoundingClientRect().top+document.getElementsByTagName("body")[0].scrollTop;scrollTo(document.getElementsByTagName("body")[0],y,500)}else if(event.which==38){prompti--;if(prompti<0)prompti=0;if(alasql.prompthistory[prompti]){el.value=alasql.prompthistory[prompti];event.preventDefault()}}else if(event.which==40){prompti++;if(prompti>=alasql.prompthistory.length){prompti=alasql.prompthistory.length;el.value=""}else if(alasql.prompthistory[prompti]){el.value=alasql.prompthistory[prompti];event.preventDefault()}}}};yy.Begin=function(params){return yy.extend(this,params)};yy.Begin.prototype.toString=function(){return K("BEGIN")};yy.Begin.prototype.execute=function(databaseid,params,cb){var res=1;if(alasql.databases[alasql.useid].engineid){return alasql.engines[alasql.databases[alasql.useid].engineid].begin(databaseid,cb)}else{}if(cb)cb(res);return res};yy.Commit=function(params){return yy.extend(this,params)};yy.Commit.prototype.toString=function(){return K("COMMIT")};yy.Commit.prototype.execute=function(databaseid,params,cb){var res=1;if(alasql.databases[alasql.useid].engineid){return alasql.engines[alasql.databases[alasql.useid].engineid].commit(databaseid,cb)}else{}if(cb)cb(res);return res};yy.Rollback=function(params){return yy.extend(this,params)};yy.Rollback.prototype.toString=function(){return K("ROLLBACK")};yy.Rollback.prototype.execute=function(databaseid,params,cb){var res=1;if(alasql.databases[alasql.useid].engineid){return alasql.engines[alasql.databases[alasql.useid].engineid].rollback(databaseid,cb)}else{}if(cb)cb(res);return res};alasql.into.JSON=function(filename,opts,data,columns,cb){var s=JSON.stringify(data);alasql.utils.saveFile(filename,s)};alasql.into.TXT=function(filename,opts,data,columns,cb){if(columns.length==0&&data.length>0){columns=Object.keys(data[0]).map(function(columnid){return{columnid:columnid}})}if(typeof filename=="object"){opts=filename;filename=null}var res=data.length;var s="";if(data.length>0){var key=columns[0].columnid;s+=data.map(function(d){return d[key]}).join("\n")}alasql.utils.saveFile(filename,s);if(cb)res=cb(res);return res};alasql.into.TAB=alasql.into.TSV=function(filename,opts,data,columns,cb){var opt={};alasql.utils.extend(opt,opts);opt.separator=" ";return alasql.into.CSV(filename,opt,data,columns,cb)};alasql.into.CSV=function(filename,opts,data,columns,cb){if(columns.length==0&&data.length>0){columns=Object.keys(data[0]).map(function(columnid){return{columnid:columnid}})}if(typeof filename=="object"){opts=filename;filename=null}var opt={};opt.separator=",";opt.quote='"';alasql.utils.extend(opt,opts);var res=data.length;var s="";if(opt.headers){s+=columns.map(function(col){return col.columnid}).join(opt.separator)+"\n"}data.forEach(function(d,idx){s+=columns.map(function(col){var s=d[col.columnid];s=(s+"").replace(new RegExp("\\"+opt.quote,"g"),'""');if((s+"").indexOf(opt.separator)>-1||(s+"").indexOf(opt.quote)>-1)s=opt.quote+s+opt.quote;return s}).join(opt.separator)+"\n"});if(filename){alasql.utils.saveFile(filename,s)}else{console.log(s)}if(cb)res=cb(res);return res};alasql.into.XLSX=function(filename,opts,data,columns,cb){if(columns.length==0&&data.length>0){columns=Object.keys(data[0]).map(function(columnid){return{columnid:columnid}})}if(typeof exports=="object"){var XLSX=require("xlsx")}else{var XLSX=window.XLSX}var opt={sheetid:"Sheet1",headers:true};alasql.utils.extend(opt,opts);var res=data.length;var cells={};var wb={SheetNames:[],Sheets:{}};wb.SheetNames.push(opt.sheetid);wb.Sheets[opt.sheetid]=cells;wb.Sheets[opt.sheetid]["!ref"]="A1:"+alasql.utils.xlsnc(columns.length)+(data.length+2);var i=1;if(opt.headers){columns.forEach(function(col,idx){cells[alasql.utils.xlsnc(idx)+""+i]={v:col.columnid}});i++}for(var j=0;j<data.length;j++){columns.forEach(function(col,idx){cells[alasql.utils.xlsnc(idx)+""+i]={v:data[j][col.columnid]}});i++}if(typeof exports=="object"){XLSX.writeFile(wb,filename)}else{var wopts={bookType:"xlsx",bookSST:false,type:"binary"};var wbout=XLSX.write(wb,wopts);function s2ab(s){var buf=new ArrayBuffer(s.length);var view=new Uint8Array(buf);for(var i=0;i!=s.length;++i)view[i]=s.charCodeAt(i)&255;return buf}saveAs(new Blob([s2ab(wbout)],{type:"application/octet-stream"}),filename)}if(cb)res=cb(res);return res};alasql.from.JSON=function(filename,opts,cb,idx,query){var res;alasql.utils.loadFile(filename,!!cb,function(data){res=JSON.parse(data);if(cb)res=cb(res,idx,query)});return res};alasql.from.TXT=function(filename,opts,cb,idx,query){var res;alasql.utils.loadFile(filename,!!cb,function(data){res=data.split(/\r?\n/);for(var i=0,ilen=res.length;i<ilen;i++){if(res[i]==+res[i])res[i]=+res[i];res[i]=[res[i]]}if(cb)res=cb(res,idx,query)});return res};alasql.from.TAB=alasql.from.TSV=function(filename,opts,cb,idx,query){if(!opts)opts={};opts.separator=" ";return alasql.from.CSV(filename,opts,cb,idx,query)};alasql.from.CSV=function(filename,opts,cb,idx,query){var opt={separator:",",quote:'"'};alasql.utils.extend(opt,opts);var res;alasql.utils.loadFile(filename,!!cb,function(text){var delimiterCode=opt.separator.charCodeAt(0);var quoteCode=opt.quote.charCodeAt(0);var EOL={},EOF={},rows=[],N=text.length,I=0,n=0,t,eol;function token(){if(I>=N)return EOF;if(eol)return eol=false,EOL;var j=I;if(text.charCodeAt(j)===quoteCode){var i=j;while(i++<N){if(text.charCodeAt(i)===quoteCode){if(text.charCodeAt(i+1)!==quoteCode)break;++i}}I=i+2;var c=text.charCodeAt(i+1);if(c===13){eol=true;if(text.charCodeAt(i+2)===10)++I}else if(c===10){eol=true}return text.substring(j+1,i).replace(/""/g,'"')}while(I<N){var c=text.charCodeAt(I++),k=1;if(c===10)eol=true;else if(c===13){eol=true;if(text.charCodeAt(I)===10)++I,++k}else if(c!==delimiterCode)continue;return text.substring(j,I-k)}return text.substring(j)}while((t=token())!==EOF){var a=[];while(t!==EOL&&t!==EOF){a.push(t);t=token()}if(opt.headers){if(n==0){if(typeof opt.headers=="boolean"){hs=a}else if(opt.headers instanceof Array){hs=opt.headers;var r={};hs.forEach(function(h,idx){r[h]=a[idx];if(r[h]==+r[h])r[h]=+r[h]});rows.push(r)}}else{var r={};hs.forEach(function(h,idx){r[h]=a[idx];if(r[h]==+r[h])r[h]=+r[h]});rows.push(r)}n++}else{rows.push(a)}}res=rows;if(opt.headers){if(query&&query.sources&&query.sources[idx]){var columns=query.sources[idx].columns=[];hs.forEach(function(h){columns.push({columnid:h})})}}if(cb)res=cb(res,idx,query)});return res};alasql.from.XLS=function(filename,opts,cb,idx,query){if(typeof exports==="object"){var X=require("xlsjs")}else{var X=window.XLS;if(!X){throw new Error("XLS library is not attached")}}return XLSXLSX(X,filename,opts,cb,idx,query)};alasql.from.XLSX=function(filename,opts,cb,idx,query){if(typeof exports==="object"){var X=require("xlsx")}else{var X=window.XLSX;if(!X){throw new Error("XLSX library is not attached")}}return XLSXLSX(X,filename,opts,cb,idx,query)};function XLSXLSX(X,filename,opts,cb,idx,query){var opt={};if(!opts)opts={};alasql.utils.extend(opt,opts);var res;alasql.utils.loadBinaryFile(filename,!!cb,function(data){var workbook=X.read(data,{type:"binary"});var sheetid;if(typeof opt.sheetid=="undefined"){sheetid=workbook.SheetNames[0]}else{sheetid=opt.sheetid}var range;if(typeof opt.range=="undefined"){range=workbook.Sheets[sheetid]["!ref"]}else{range=opt.range;if(workbook.Sheets[sheetid][range])range=workbook.Sheets[sheetid][range]}var rg=range.split(":");var col0=rg[0].match(/[A-Z]+/)[0];var row0=rg[0].match(/[0-9]+/)[0];var col1=rg[1].match(/[A-Z]+/)[0];var row1=rg[1].match(/[0-9]+/)[0];var hh={};for(var j=alasql.utils.xlscn(col0);j<=alasql.utils.xlscn(col1);j++){var col=alasql.utils.xlsnc(j);if(opt.headers){hh[col]=workbook.Sheets[sheetid][col+""+row0].v}else{hh[col]=col}}var res=[];if(opt.headers)row0++;for(var i=row0;i<=row1;i++){var row={};for(var j=alasql.utils.xlscn(col0);j<=alasql.utils.xlscn(col1);j++){var col=alasql.utils.xlsnc(j);if(workbook.Sheets[sheetid][col+""+i]){row[hh[col]]=workbook.Sheets[sheetid][col+""+i].v}}res.push(row)}if(cb)res=cb(res,idx,query)},function(err){throw err});return res}yy.Help=function(params){return yy.extend(this,params)};yy.Help.prototype.toString=function(){var s=K("HELP");if(this.subject)s+=" "+L(this.subject);return s};helpdocs=[{command:"ALTER TABLE table RENAME TO table"},{command:"ALTER TABLE table ADD COLUMN column coldef"},{command:"ALTER TABLE table MODIFY COLUMN column coldef"},{command:"ALTER TABLE table RENAME COLUMN column TO column"},{command:"ALTER TABLE table DROP column"},{command:"ATTACH engine DATABASE database"},{command:"ASSERT value"},{command:"BEGIN [TRANSACTION]"},{command:"COMMIT [TRANSACTION]"},{command:"CREATE [engine] DATABASE [IF NOT EXISTS] database"},{command:"CREATE TABLE [IF NOT EXISTS] table (column definitions)"},{command:"DELETE FROM table [WHERE expression]"},{command:"DETACH DATABASE database"},{command:"DROP [engine] DATABASE [IF EXISTS] database"},{command:"DROP TABLE [IF EXISTS] table"},{command:"INSERT INTO table VALUES value,..."},{command:"INSERT INTO table DEFAULT VALUES"},{command:"INSERT INTO table SELECT select"},{command:"HELP [subject]"},{command:"ROLLBACK [TRANSACTION]"},{command:"SELECT [modificator] columns [INTO table] [FROM table,...] [[mode] JOIN [ON] [USING]] [WHERE ] [GROUP BY] [HAVING] [ORDER BY] "},{command:"SET option value"},{command:"SHOW [engine] DATABASES"},{command:"SHOW TABLES"},{command:"SHOW CREATE TABLE table"},{command:"UPDATE table SET column1 = expression1, ... [WHERE expression]"},{command:"USE [DATABASE] database"},{command:"expression"},{command:'See also <a href="http://github/agershun/alasq">http://github/agershun/alasq</a> for more information'}];yy.Help.prototype.execute=function(databaseid,params,cb){var ss=[];if(!this.subject){ss=helpdocs}else{ss.push('See also <a href="http://github/agershun/alasq">http://github/agershun/alasq</a> for more information')}if(cb)ss=cb(ss);return ss};yy.Source=function(params){return yy.extend(this,params)};yy.Source.prototype.toString=function(){var s=K("SOURCE");if(this.url)s+=" "+S("'"+this.url+"'");return s};yy.Source.prototype.execute=function(databaseid,params,cb){loadFile(this.url,!!cb,function(data){var res=1;alasql(data);if(cb)res=cb(res);return res},function(err){throw err});return 1};yy.Assert=function(params){return yy.extend(this,params)};yy.Source.prototype.toString=function(){var s=K("ASSERT");if(this.value)s+=" "+JSON.stringify(this.value);return s};yy.Assert.prototype.execute=function(databaseid){if(!deepEqual(alasql.res,this.value)){throw new Error((this.message||"Assert wrong")+": "+JSON.stringify(alasql.res)+" == "+JSON.stringify(this.value))}return 1};var WEBSQL=alasql.engines.WEBSQL=function(){};WEBSQL.createDatabase=function(wdbid,args,dbid,cb){var res=1;var wdb=openDatabase(wdbid,args[0],args[1],args[2]);if(this.dbid){var db=alasql.createDatabase(this.dbid);db.engineid="WEBSQL";db.wdbid=wdbid;sb.wdb=db}if(!wdb){throw new Error('Cannot create WebSQL database "'+databaseid+'"')}if(cb)cb(res);return res};WEBSQL.dropDatabase=function(databaseid){throw new Error("This is impossible to drop WebSQL database.")};WEBSQL.attachDatabase=function(databaseid,dbid,cb){var res=1;if(alasql.databases[dbid]){throw new Error('Unable to attach database as "'+dbid+'" because it already exists')}alasqlopenDatabase(databaseid,args[0],args[1],args[2]);return res};var IDB=alasql.engines.INDEXEDDB=function(){};IDB.showDatabases=function(like,cb){var request=indexedDB.webkitGetDatabaseNames();request.onsuccess=function(event){var dblist=event.target.result;var res=[];if(like){var relike=new RegExp(like.value.replace(/\%/g,".*"),"g")}for(var i=0;i<dblist.length;i++){if(!like||dblist[i].match(relike)){res.push({databaseid:dblist[i]})}}cb(res)}};IDB.createDatabase=function(ixdbid,args,ifnotexists,dbid,cb){var request1=indexedDB.webkitGetDatabaseNames();request1.onsuccess=function(event){var dblist=event.target.result;if(dblist.contains(ixdbid)){if(ifnotexists){cb(0);return}else{throw new Error('IndexedDB: Cannot create new database "'+ixdbid+'" because it already exists')}}var request2=window.indexedDB.open(ixdbid,1);request2.onsuccess=function(event){event.target.result.close();cb(1)}}};IDB.dropDatabase=function(ixdbid,ifexists,cb){var request1=indexedDB.webkitGetDatabaseNames();request1.onsuccess=function(event){var dblist=event.target.result;if(!dblist.contains(ixdbid)){if(ifexists){cb(0);return}else{throw new Error('IndexedDB: Cannot drop new database "'+ixdbid+'" because it does not exist')}}var request2=indexedDB.deleteDatabase(ixdbid);request2.onsuccess=function(event){if(cb)cb(1)}}};IDB.attachDatabase=function(ixdbid,dbid,args,cb){var request1=indexedDB.webkitGetDatabaseNames();request1.onsuccess=function(event){var dblist=event.target.result;if(!dblist.contains(ixdbid)){throw new Error('IndexedDB: Cannot attach database "'+ixdbid+'" because it does not exist')}var request2=indexedDB.open(ixdbid);request2.onsuccess=function(event){var ixdb=event.target.result;var db=new alasql.Database(dbid||ixdbid);db.engineid="INDEXEDDB";db.ixdbid=ixdbid;db.tables=[];var tblist=ixdb.objectStoreNames;for(var i=0;i<tblist.length;i++){db.tables[tblist[i]]={}}event.target.result.close();cb(1)}}};IDB.createTable=function(databaseid,tableid,ifnotexists,cb){var ixdbid=alasql.databases[databaseid].ixdbid;var request1=indexedDB.webkitGetDatabaseNames();request1.onsuccess=function(event){var dblist=event.target.result;if(!dblist.contains(ixdbid)){throw new Error('IndexedDB: Cannot create table in database "'+ixdbid+'" because it does not exist')}var request2=indexedDB.open(ixdbid);request2.onversionchange=function(event){event.target.result.close()};request2.onsuccess=function(event){var version=event.target.result.version;event.target.result.close();var request3=indexedDB.open(ixdbid,version+1);request3.onupgradeneeded=function(event){var ixdb=event.target.result;var store=ixdb.createObjectStore(tableid,{autoIncrement:true})};request3.onsuccess=function(event){event.target.result.close();cb(1)};request3.onerror=function(event){throw event};request3.onblocked=function(event){throw new Error('Cannot create table "'+tableid+'" because database "'+databaseid+'" is blocked')}}}};IDB.dropTable=function(databaseid,tableid,ifexists,cb){var ixdbid=alasql.databases[databaseid].ixdbid;var request1=indexedDB.webkitGetDatabaseNames();request1.onsuccess=function(event){var dblist=event.target.result;if(!dblist.contains(ixdbid)){throw new Error('IndexedDB: Cannot drop table in database "'+ixdbid+'" because it does not exist')}var request2=indexedDB.open(ixdbid);request2.onversionchange=function(event){event.target.result.close()};request2.onsuccess=function(event){var version=event.target.result.version;event.target.result.close();var request3=indexedDB.open(ixdbid,version+1);request3.onupgradeneeded=function(event){var ixdb=event.target.result;if(ixdb.objectStoreNames.contains(tableid)){ixdb.deleteObjectStore(tableid);delete alasql.databases[databaseid].tables[tableid]}else{if(!ifexists){throw new Error('IndexedDB: Cannot drop table "'+tableid+'" because it is not exist')}}};request3.onsuccess=function(event){event.target.result.close();cb(1)};request3.onerror=function(event){throw event};request3.onblocked=function(event){throw new Error('Cannot drop table "'+tableid+'" because database "'+databaseid+'" is blocked')}}}};IDB.intoTable=function(databaseid,tableid,value,columns,cb){var ixdbid=alasql.databases[databaseid].ixdbid;var request1=indexedDB.open(ixdbid);request1.onsuccess=function(event){var ixdb=event.target.result;var tx=ixdb.transaction([tableid],"readwrite");var tb=tx.objectStore(tableid);for(var i=0,ilen=value.length;i<ilen;i++){tb.add(value[i])}tx.oncomplete=function(){ixdb.close();cb(ilen)}}};IDB.fromTable=function(databaseid,tableid,cb,idx,query){var ixdbid=alasql.databases[databaseid].ixdbid;
var request=window.indexedDB.open(ixdbid);request.onsuccess=function(event){var res=[];var ixdb=event.target.result;var tx=ixdb.transaction([tableid]);var store=tx.objectStore(tableid);var cur=store.openCursor();cur.onblocked=function(event){};cur.onerror=function(event){};cur.onsuccess=function(event){var cursor=event.target.result;if(cursor){res.push(cursor.value);cursor.continue()}else{ixdb.close();cb(res,idx,query)}}}};IDB.deleteFromTable=function(databaseid,tableid,wherefn,params,cb){var ixdbid=alasql.databases[databaseid].ixdbid;var request=window.indexedDB.open(ixdbid);request.onsuccess=function(event){var res=[];var ixdb=event.target.result;var tx=ixdb.transaction([tableid],"readwrite");var store=tx.objectStore(tableid);var cur=store.openCursor();var num=0;cur.onblocked=function(event){};cur.onerror=function(event){};cur.onsuccess=function(event){var cursor=event.target.result;if(cursor){if(!wherefn||wherefn(cursor.value,params)){cursor.delete();num++}cursor.continue()}else{ixdb.close();cb(num)}}}};IDB.updateTable=function(databaseid,tableid,assignfn,wherefn,params,cb){var ixdbid=alasql.databases[databaseid].ixdbid;var request=window.indexedDB.open(ixdbid);request.onsuccess=function(event){var res=[];var ixdb=event.target.result;var tx=ixdb.transaction([tableid],"readwrite");var store=tx.objectStore(tableid);var cur=store.openCursor();var num=0;cur.onblocked=function(event){};cur.onerror=function(event){};cur.onsuccess=function(event){var cursor=event.target.result;if(cursor){if(!wherefn||wherefn(cursor.value,params)){var r=cursor.value;assignfn(r,params);cursor.update(r);num++}cursor.continue()}else{ixdb.close();cb(num)}}}};var LS=alasql.engines.LOCALSTORAGE=function(){};LS.get=function(key){var s=localStorage.getItem(key);if(typeof s=="undefined")return;var v=undefined;try{v=JSON.parse(s)}catch(err){throw new Error("Cannot parse JSON "+s)}return v};LS.set=function(key,value){if(typeof value=="undefined")localStorage.removeItem(key);else localStorage.setItem(key,JSON.stringify(value))};LS.createDatabase=function(lsdbid,args,ifnotexists,dbid,cb){var res=1;var ls=LS.get("alasql");if(!(ifnotexists&&ls&&ls.databases&&ls.databases[lsdbid])){if(!ls)ls={databases:{}};if(ls.databases&&ls.databases[lsdbid]){throw new Error('localStorage: Cannot create new database "'+lsdbid+'" because it already exists')}ls.databases[lsdbid]=true;LS.set("alasql",ls);LS.set(lsdbid,{databaseid:lsdbid,tables:{}})}else{res=0}if(cb)cb(res);return res};LS.dropDatabase=function(lsdbid,ifexists,cb){var res=1;var ls=LS.get("alasql");if(!(ifexists&&ls&&ls.databases&&!ls.databases[lsdbid])){if(!ls){if(!ifexists){throw new Error("There are no alasql databases in localStorage")}else{return 0}}if(ls.databases&&!ls.databases[lsdbid]){throw new Error('localStorage: Cannot drop database "'+lsdbid+'" because there is no such database')}delete ls.databases[lsdbid];LS.set("alasql",ls);var db=LS.get(lsdbid);for(var tableid in db.tables){localStorage.removeItem(lsdbid+"."+tableid)}localStorage.removeItem(lsdbid)}else{res=0}if(cb)cb(res);return res};LS.attachDatabase=function(lsdbid,dbid,args,cb){var res=1;if(alasql.databases[dbid]){throw new Error('Unable to attach database as "'+dbid+'" because it already exists')}var db=new alasql.Database(dbid||lsdbid);db.engineid="LOCALSTORAGE";db.lsdbid=lsdbid;db.tables=LS.get(lsdbid).tables;if(!alasql.autocommit){if(db.tables){for(var tbid in db.tables){db.tables[tbid].data=LS.get(db.lsdbid+"."+tbid)}}}if(cb)res=cb(res);return res};LS.showDatabases=function(like,cb){var res=[];var ls=LS.get("alasql");if(like){var relike=new RegExp(like.value.replace(/\%/g,".*"),"g")}if(ls&&ls.databases){for(dbid in ls.databases){res.push({databaseid:dbid})}if(like&&res&&res.length>0){res=res.filter(function(d){return d.databaseid.match(relike)})}}if(cb)cb(res);return res};LS.createTable=function(databaseid,tableid,ifnotexists,cb){var lsdbid=alasql.databases[databaseid].lsdbid;var tb=LS.get(lsdbid+"."+tableid);var res=1;if(tb&&!ifnotexists){throw new Error('Table "'+tableid+'" alsready exists in localStorage database "'+lsdbid+'"')}var lsdb=LS.get(lsdbid);var table=alasql.databases[databaseid].tables[tableid];lsdb.tables[tableid]={columns:table.columns};LS.set(lsdbid,lsdb);LS.set(lsdbid+"."+tableid,[]);if(cb)cb(res);return res};LS.dropTable=function(databaseid,tableid,ifexists,cb){var res=1;var lsdbid=alasql.databases[databaseid].lsdbid;var lsdb=LS.get(lsdbid);if(!ifexists&&!lsdb.tables[tableid]){throw new Error('Cannot drop table "'+tableid+'" in localStorage, because it does not exist')}delete lsdb.tables[tableid];LS.set(lsdbid,lsdb);localStorage.removeItem(lsdbid+"."+tableid);if(cb)cb(res);return res};LS.fromTable=function(databaseid,tableid,cb,idx,query){var lsdbid=alasql.databases[databaseid].lsdbid;var res=LS.get(lsdbid+"."+tableid);if(cb)res=cb(res,idx,query);return res};LS.intoTable=function(databaseid,tableid,value,columns,cb){var lsdbid=alasql.databases[databaseid].lsdbid;var res=value.length;var tb=LS.get(lsdbid+"."+tableid);if(!tb)tb=[];tb=tb.concat(value);LS.set(lsdbid+"."+tableid,tb);if(cb)cb(res);return res};LS.loadTableData=function(databaseid,tableid){var db=alasql.databases[databaseid];var lsdbid=alasql.databases[databaseid].lsdbid;db.tables[tableid].data=LS.get(lsdbid+"."+tableid)};LS.saveTableData=function(databaseid,tableid){var db=alasql.databases[databaseid];var lsdbid=alasql.databases[databaseid].lsdbid;LS.set(lsdbid+"."+tableid,db.tables[tableid].data);db.tables[tableid].data=null};LS.commit=function(databaseid,cb){var db=alasql.databases[databaseid];var lsdbid=alasql.databases[databaseid].lsdbid;lsdb={databaseid:lsdbid,tables:{}};if(db.tables){for(var tbid in db.tables){lsdb.tables[tbid]={columns:db.tables[tbid].columns};LS.set(lsdbid+"."+tbid,db.tables[tbid].data)}}LS.set(lsdbid,lsdb);return 1};LS.begin=LS.commit;LS.rollback=function(databaseid,cb){var db=alasql.databases[databaseid];db.dbversion++;var lsdbid=alasql.databases[databaseid].lsdbid;lsdb=LS.get(lsdbid);if(lsdb.tables){for(var tbid in lsdb.tables){var tb=new alasql.Table({columns:db.tables[tbid].columns});extend(tb,lsdb.tables[tbid]);lsdb.tables[tbid]=tb;if(!alasql.autocommit){lsdb.tables[tbid].data=LS.get(db.lsdbid+"."+tbid)}lsdb.tables[tbid].indexColumns()}}delete alasql.databases[databaseid];alasql.databases[databaseid]=new alasql.Database(databaseid);extend(alasql.databases[databaseid],lsdb);alasql.databases[databaseid].engineid="LOCALSTORAGE"};var SQLITE=alasql.engines.SQLITE=function(){};SQLITE.createDatabase=function(wdbid,args,ifnotexists,dbid,cb){throw new Error("Connot create SQLITE database in memory. Attach it.")};SQLITE.dropDatabase=function(databaseid){throw new Error("This is impossible to drop SQLite database. Detach it.")};SQLITE.attachDatabase=function(sqldbid,dbid,args,cb){var res=1;if(alasql.databases[dbid]){throw new Error('Unable to attach database as "'+dbid+'" because it already exists')}if(args[0]&&args[0]instanceof yy.StringValue){alasql.utils.loadBinaryFile(args[0].value,true,function(data){var db=new alasql.Database(dbid||sqldbid);db.engineid="SQLITE";db.sqldbid=sqldbid;var sqldb=db.sqldb=new SQL.Database(data);db.tables=[];var tables=sqldb.exec("SELECT * FROM sqlite_master WHERE type='table'")[0].values;tables.forEach(function(tbl){db.tables[tbl[1]]={};var columns=db.tables[tbl[1]].columns=[];var ast=alasql.parse(tbl[4]);var coldefs=ast.statements[0].columns;if(coldefs&&coldefs.length>0){coldefs.forEach(function(cd){columns.push(cd)})}});cb(1)},function(err){throw new Error('Cannot open SQLite database file "'+args[0].value+'"')});return res}else{throw new Error("Cannot attach SQLite database without a file")}return res};SQLITE.fromTable=function(databaseid,tableid,cb,idx,query){var data=alasql.databases[databaseid].sqldb.exec("SELECT * FROM "+tableid);var columns=query.sources[idx].columns=[];if(data[0].columns.length>0){data[0].columns.forEach(function(columnid){columns.push({columnid:columnid})})}var res=[];if(data[0].values.length>0){data[0].values.forEach(function(d){var r={};columns.forEach(function(col,idx){r[col.columnid]=d[idx]});res.push(r)})}if(cb)cb(res,idx,query)};SQLITE.intoTable=function(databaseid,tableid,value,columns,cb){var sqldb=alasql.databases[databaseid].sqldb;for(var i=0,ilen=value.length;i<ilen;i++){var s="INSERT INTO "+tableid+" (";var d=value[i];var keys=Object.keys(d);s+=keys.join(",");s+=") VALUES (";s+=keys.map(function(k){v=d[k];if(typeof v=="string")v="'"+v+"'";return v}).join(",");s+=")";sqldb.exec(s)}var res=ilen;if(cb)cb(res);return res};if(typeof exports!="object"){var saveAs=saveAs||typeof navigator!=="undefined"&&navigator.msSaveOrOpenBlob&&navigator.msSaveOrOpenBlob.bind(navigator)||function(view){"use strict";if(typeof navigator!=="undefined"&&/MSIE [1-9]\./.test(navigator.userAgent)){return}var doc=view.document,get_URL=function(){return view.URL||view.webkitURL||view},save_link=doc.createElementNS("http://www.w3.org/1999/xhtml","a"),can_use_save_link="download"in save_link,click=function(node){var event=doc.createEvent("MouseEvents");event.initMouseEvent("click",true,false,view,0,0,0,0,0,false,false,false,false,0,null);node.dispatchEvent(event)},webkit_req_fs=view.webkitRequestFileSystem,req_fs=view.requestFileSystem||webkit_req_fs||view.mozRequestFileSystem,throw_outside=function(ex){(view.setImmediate||view.setTimeout)(function(){throw ex},0)},force_saveable_type="application/octet-stream",fs_min_size=0,arbitrary_revoke_timeout=500,revoke=function(file){var revoker=function(){if(typeof file==="string"){get_URL().revokeObjectURL(file)}else{file.remove()}};if(view.chrome){revoker()}else{setTimeout(revoker,arbitrary_revoke_timeout)}},dispatch=function(filesaver,event_types,event){event_types=[].concat(event_types);var i=event_types.length;while(i--){var listener=filesaver["on"+event_types[i]];if(typeof listener==="function"){try{listener.call(filesaver,event||filesaver)}catch(ex){throw_outside(ex)}}}},FileSaver=function(blob,name){var filesaver=this,type=blob.type,blob_changed=false,object_url,target_view,dispatch_all=function(){dispatch(filesaver,"writestart progress write writeend".split(" "))},fs_error=function(){if(blob_changed||!object_url){object_url=get_URL().createObjectURL(blob)}if(target_view){target_view.location.href=object_url}else{var new_tab=view.open(object_url,"_blank");if(new_tab==undefined&&typeof safari!=="undefined"){view.location.href=object_url}}filesaver.readyState=filesaver.DONE;dispatch_all();revoke(object_url)},abortable=function(func){return function(){if(filesaver.readyState!==filesaver.DONE){return func.apply(this,arguments)}}},create_if_not_found={create:true,exclusive:false},slice;filesaver.readyState=filesaver.INIT;if(!name){name="download"}if(can_use_save_link){object_url=get_URL().createObjectURL(blob);save_link.href=object_url;save_link.download=name;click(save_link);filesaver.readyState=filesaver.DONE;dispatch_all();revoke(object_url);return}if(view.chrome&&type&&type!==force_saveable_type){slice=blob.slice||blob.webkitSlice;blob=slice.call(blob,0,blob.size,force_saveable_type);blob_changed=true}if(webkit_req_fs&&name!=="download"){name+=".download"}if(type===force_saveable_type||webkit_req_fs){target_view=view}if(!req_fs){fs_error();return}fs_min_size+=blob.size;req_fs(view.TEMPORARY,fs_min_size,abortable(function(fs){fs.root.getDirectory("saved",create_if_not_found,abortable(function(dir){var save=function(){dir.getFile(name,create_if_not_found,abortable(function(file){file.createWriter(abortable(function(writer){writer.onwriteend=function(event){target_view.location.href=file.toURL();filesaver.readyState=filesaver.DONE;dispatch(filesaver,"writeend",event);revoke(file)};writer.onerror=function(){var error=writer.error;if(error.code!==error.ABORT_ERR){fs_error()}};"writestart progress write abort".split(" ").forEach(function(event){writer["on"+event]=filesaver["on"+event]});writer.write(blob);filesaver.abort=function(){writer.abort();filesaver.readyState=filesaver.DONE};filesaver.readyState=filesaver.WRITING}),fs_error)}),fs_error)};dir.getFile(name,{create:false},abortable(function(file){file.remove();save()}),abortable(function(ex){if(ex.code===ex.NOT_FOUND_ERR){save()}else{fs_error()}}))}),fs_error)}),fs_error)},FS_proto=FileSaver.prototype,saveAs=function(blob,name){return new FileSaver(blob,name)};FS_proto.abort=function(){var filesaver=this;filesaver.readyState=filesaver.DONE;dispatch(filesaver,"abort")};FS_proto.readyState=FS_proto.INIT=0;FS_proto.WRITING=1;FS_proto.DONE=2;FS_proto.error=FS_proto.onwritestart=FS_proto.onprogress=FS_proto.onwrite=FS_proto.onabort=FS_proto.onerror=FS_proto.onwriteend=null;return saveAs}(typeof self!=="undefined"&&self||typeof window!=="undefined"&&window||this.content);if(typeof module!=="undefined"&&module!==null){module.exports=saveAs}else if(typeof define!=="undefined"&&define!==null&&define.amd!=null){define([],function(){return saveAs})}alasql.utils.saveAs=saveAs}new Database("alasql");alasql.use("alasql");return alasql});