@nocobase/plugin-collection-fdw 2.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (155) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +99 -0
  3. package/client.d.ts +2 -0
  4. package/client.js +1 -0
  5. package/dist/client/07d37b2045cf49ac.js +10 -0
  6. package/dist/client/19796e1ee00c3777.js +10 -0
  7. package/dist/client/545679e3c044a8fb.js +10 -0
  8. package/dist/client/components/CreateDatabaseServerAction.d.ts +10 -0
  9. package/dist/client/components/DatabaseServerSelect.d.ts +20 -0
  10. package/dist/client/components/EditDatabaseServerAction.d.ts +10 -0
  11. package/dist/client/components/PreviewFields.d.ts +10 -0
  12. package/dist/client/components/PreviewTable.d.ts +10 -0
  13. package/dist/client/components/RemoteTableSelect.d.ts +10 -0
  14. package/dist/client/components/SyncFieldsAction.d.ts +11 -0
  15. package/dist/client/components/UnSupportFields.d.ts +12 -0
  16. package/dist/client/components/schema.d.ts +19 -0
  17. package/dist/client/dccc3127ba4bb534.js +10 -0
  18. package/dist/client/ff008086e5ac8e5e.js +10 -0
  19. package/dist/client/hooks.d.ts +20 -0
  20. package/dist/client/index.d.ts +13 -0
  21. package/dist/client/index.js +10 -0
  22. package/dist/externalVersion.js +24 -0
  23. package/dist/index.d.ts +9 -0
  24. package/dist/index.js +42 -0
  25. package/dist/locale/de-DE.json +17 -0
  26. package/dist/locale/en-US.json +17 -0
  27. package/dist/locale/es-ES.json +17 -0
  28. package/dist/locale/fr-FR.json +17 -0
  29. package/dist/locale/hu-HU.json +17 -0
  30. package/dist/locale/id-ID.json +17 -0
  31. package/dist/locale/index.d.ts +10 -0
  32. package/dist/locale/index.js +42 -0
  33. package/dist/locale/it-IT.json +17 -0
  34. package/dist/locale/ja-JP.json +17 -0
  35. package/dist/locale/ko-KR.json +17 -0
  36. package/dist/locale/nl-NL.json +17 -0
  37. package/dist/locale/pt-BR.json +17 -0
  38. package/dist/locale/ru-RU.json +18 -0
  39. package/dist/locale/tr-TR.json +17 -0
  40. package/dist/locale/uk-UA.json +17 -0
  41. package/dist/locale/vi-VN.json +17 -0
  42. package/dist/locale/zh-CN.json +17 -0
  43. package/dist/locale/zh-TW.json +17 -0
  44. package/dist/node_modules/node-sql-parser/LICENSE +201 -0
  45. package/dist/node_modules/node-sql-parser/ast/postgresql.ts +1834 -0
  46. package/dist/node_modules/node-sql-parser/build/bigquery.d.ts +1 -0
  47. package/dist/node_modules/node-sql-parser/build/bigquery.js +2 -0
  48. package/dist/node_modules/node-sql-parser/build/db2.d.ts +1 -0
  49. package/dist/node_modules/node-sql-parser/build/db2.js +2 -0
  50. package/dist/node_modules/node-sql-parser/build/flinksql.d.ts +1 -0
  51. package/dist/node_modules/node-sql-parser/build/flinksql.js +2 -0
  52. package/dist/node_modules/node-sql-parser/build/hive.d.ts +1 -0
  53. package/dist/node_modules/node-sql-parser/build/hive.js +2 -0
  54. package/dist/node_modules/node-sql-parser/build/mariadb.d.ts +1 -0
  55. package/dist/node_modules/node-sql-parser/build/mariadb.js +2 -0
  56. package/dist/node_modules/node-sql-parser/build/mysql.d.ts +1 -0
  57. package/dist/node_modules/node-sql-parser/build/mysql.js +2 -0
  58. package/dist/node_modules/node-sql-parser/build/noql.d.ts +1 -0
  59. package/dist/node_modules/node-sql-parser/build/noql.js +2 -0
  60. package/dist/node_modules/node-sql-parser/build/postgresql.d.ts +1 -0
  61. package/dist/node_modules/node-sql-parser/build/postgresql.js +2 -0
  62. package/dist/node_modules/node-sql-parser/build/snowflake.d.ts +1 -0
  63. package/dist/node_modules/node-sql-parser/build/snowflake.js +2 -0
  64. package/dist/node_modules/node-sql-parser/build/sqlite.d.ts +1 -0
  65. package/dist/node_modules/node-sql-parser/build/sqlite.js +2 -0
  66. package/dist/node_modules/node-sql-parser/build/transactsql.d.ts +1 -0
  67. package/dist/node_modules/node-sql-parser/build/transactsql.js +2 -0
  68. package/dist/node_modules/node-sql-parser/index.d.ts +1 -0
  69. package/dist/node_modules/node-sql-parser/index.js +1 -0
  70. package/dist/node_modules/node-sql-parser/lib/aggregation.js +39 -0
  71. package/dist/node_modules/node-sql-parser/lib/alter.js +174 -0
  72. package/dist/node_modules/node-sql-parser/lib/analyze.js +40 -0
  73. package/dist/node_modules/node-sql-parser/lib/array-struct.js +60 -0
  74. package/dist/node_modules/node-sql-parser/lib/assign.js +33 -0
  75. package/dist/node_modules/node-sql-parser/lib/binary.js +46 -0
  76. package/dist/node_modules/node-sql-parser/lib/case.js +39 -0
  77. package/dist/node_modules/node-sql-parser/lib/column.js +221 -0
  78. package/dist/node_modules/node-sql-parser/lib/command.js +299 -0
  79. package/dist/node_modules/node-sql-parser/lib/constrain.js +45 -0
  80. package/dist/node_modules/node-sql-parser/lib/create.js +439 -0
  81. package/dist/node_modules/node-sql-parser/lib/delete.js +42 -0
  82. package/dist/node_modules/node-sql-parser/lib/exec.js +37 -0
  83. package/dist/node_modules/node-sql-parser/lib/expr.js +123 -0
  84. package/dist/node_modules/node-sql-parser/lib/func.js +152 -0
  85. package/dist/node_modules/node-sql-parser/lib/index-definition.js +106 -0
  86. package/dist/node_modules/node-sql-parser/lib/insert.js +111 -0
  87. package/dist/node_modules/node-sql-parser/lib/interval.js +28 -0
  88. package/dist/node_modules/node-sql-parser/lib/json.js +28 -0
  89. package/dist/node_modules/node-sql-parser/lib/limit.js +45 -0
  90. package/dist/node_modules/node-sql-parser/lib/over.js +39 -0
  91. package/dist/node_modules/node-sql-parser/lib/parser.all.js +33 -0
  92. package/dist/node_modules/node-sql-parser/lib/parser.js +82 -0
  93. package/dist/node_modules/node-sql-parser/lib/parser.single.js +23 -0
  94. package/dist/node_modules/node-sql-parser/lib/proc.js +39 -0
  95. package/dist/node_modules/node-sql-parser/lib/select.js +132 -0
  96. package/dist/node_modules/node-sql-parser/lib/show.js +88 -0
  97. package/dist/node_modules/node-sql-parser/lib/sql.js +43 -0
  98. package/dist/node_modules/node-sql-parser/lib/tables.js +211 -0
  99. package/dist/node_modules/node-sql-parser/lib/transaction.js +26 -0
  100. package/dist/node_modules/node-sql-parser/lib/union.js +81 -0
  101. package/dist/node_modules/node-sql-parser/lib/update.js +59 -0
  102. package/dist/node_modules/node-sql-parser/lib/util.js +444 -0
  103. package/dist/node_modules/node-sql-parser/lib/window.js +85 -0
  104. package/dist/node_modules/node-sql-parser/lib/with.js +37 -0
  105. package/dist/node_modules/node-sql-parser/package.json +1 -0
  106. package/dist/node_modules/node-sql-parser/types.d.ts +227 -0
  107. package/dist/node_modules/node-sql-parser/umd/bigquery.umd.d.ts +1 -0
  108. package/dist/node_modules/node-sql-parser/umd/bigquery.umd.js +2 -0
  109. package/dist/node_modules/node-sql-parser/umd/db2.umd.d.ts +1 -0
  110. package/dist/node_modules/node-sql-parser/umd/db2.umd.js +2 -0
  111. package/dist/node_modules/node-sql-parser/umd/flinksql.umd.d.ts +1 -0
  112. package/dist/node_modules/node-sql-parser/umd/flinksql.umd.js +2 -0
  113. package/dist/node_modules/node-sql-parser/umd/hive.umd.d.ts +1 -0
  114. package/dist/node_modules/node-sql-parser/umd/hive.umd.js +2 -0
  115. package/dist/node_modules/node-sql-parser/umd/index.umd.d.ts +1 -0
  116. package/dist/node_modules/node-sql-parser/umd/index.umd.js +2 -0
  117. package/dist/node_modules/node-sql-parser/umd/mariadb.umd.d.ts +1 -0
  118. package/dist/node_modules/node-sql-parser/umd/mariadb.umd.js +2 -0
  119. package/dist/node_modules/node-sql-parser/umd/mysql.umd.d.ts +1 -0
  120. package/dist/node_modules/node-sql-parser/umd/mysql.umd.js +2 -0
  121. package/dist/node_modules/node-sql-parser/umd/noql.umd.d.ts +1 -0
  122. package/dist/node_modules/node-sql-parser/umd/noql.umd.js +2 -0
  123. package/dist/node_modules/node-sql-parser/umd/postgresql.umd.d.ts +1 -0
  124. package/dist/node_modules/node-sql-parser/umd/postgresql.umd.js +2 -0
  125. package/dist/node_modules/node-sql-parser/umd/snowflake.umd.d.ts +1 -0
  126. package/dist/node_modules/node-sql-parser/umd/snowflake.umd.js +2 -0
  127. package/dist/node_modules/node-sql-parser/umd/sqlite.umd.d.ts +1 -0
  128. package/dist/node_modules/node-sql-parser/umd/sqlite.umd.js +2 -0
  129. package/dist/node_modules/node-sql-parser/umd/transactsql.umd.d.ts +1 -0
  130. package/dist/node_modules/node-sql-parser/umd/transactsql.umd.js +2 -0
  131. package/dist/server/bridges/mariadb-to-mariadb.d.ts +3 -0
  132. package/dist/server/bridges/mariadb-to-mariadb.js +38 -0
  133. package/dist/server/bridges/mysql-to-mysql.d.ts +13 -0
  134. package/dist/server/bridges/mysql-to-mysql.js +117 -0
  135. package/dist/server/bridges/mysql-to-pg.d.ts +8 -0
  136. package/dist/server/bridges/mysql-to-pg.js +9 -0
  137. package/dist/server/bridges/pg-to-pg.d.ts +21 -0
  138. package/dist/server/bridges/pg-to-pg.js +137 -0
  139. package/dist/server/bridges/remote-local-bridge.d.ts +57 -0
  140. package/dist/server/bridges/remote-local-bridge.js +73 -0
  141. package/dist/server/collections/database-server-collection.d.ts +10 -0
  142. package/dist/server/collections/database-server-collection.js +54 -0
  143. package/dist/server/foreign-data-collection.d.ts +22 -0
  144. package/dist/server/foreign-data-collection.js +118 -0
  145. package/dist/server/index.d.ts +9 -0
  146. package/dist/server/index.js +42 -0
  147. package/dist/server/models/database-server.d.ts +29 -0
  148. package/dist/server/models/database-server.js +226 -0
  149. package/dist/server/plugin.d.ts +14 -0
  150. package/dist/server/plugin.js +111 -0
  151. package/dist/server/resourcers/tables.d.ts +17 -0
  152. package/dist/server/resourcers/tables.js +181 -0
  153. package/package.json +43 -0
  154. package/server.d.ts +2 -0
  155. package/server.js +1 -0
@@ -0,0 +1 @@
1
+ export * from '../types';
@@ -0,0 +1,2 @@
1
+ !function(r,t){for(var e in t)r[e]=t[e]}(exports,function(r){var t={};function e(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return r[n].call(o.exports,o,o.exports,e),o.l=!0,o.exports}return e.m=r,e.c=t,e.d=function(r,t,n){e.o(r,t)||Object.defineProperty(r,t,{enumerable:!0,get:n})},e.r=function(r){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(r,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(r,"__esModule",{value:!0})},e.t=function(r,t){if(1&t&&(r=e(r)),8&t)return r;if(4&t&&"object"==typeof r&&r&&r.__esModule)return r;var n=Object.create(null);if(e.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:r}),2&t&&"string"!=typeof r)for(var o in r)e.d(n,o,function(t){return r[t]}.bind(null,o));return n},e.n=function(r){var t=r&&r.__esModule?function(){return r.default}:function(){return r};return e.d(t,"a",t),t},e.o=function(r,t){return Object.prototype.hasOwnProperty.call(r,t)},e.p="",e(e.s=1)}([function(r,t,e){"use strict";var n=e(2);function o(r,t,e,n){this.message=r,this.expected=t,this.found=e,this.location=n,this.name="SyntaxError","function"==typeof Error.captureStackTrace&&Error.captureStackTrace(this,o)}!function(r,t){function e(){this.constructor=r}e.prototype=t.prototype,r.prototype=new e}(o,Error),o.buildMessage=function(r,t){var e={literal:function(r){return'"'+o(r.text)+'"'},class:function(r){var t,e="";for(t=0;t<r.parts.length;t++)e+=r.parts[t]instanceof Array?u(r.parts[t][0])+"-"+u(r.parts[t][1]):u(r.parts[t]);return"["+(r.inverted?"^":"")+e+"]"},any:function(r){return"any character"},end:function(r){return"end of input"},other:function(r){return r.description}};function n(r){return r.charCodeAt(0).toString(16).toUpperCase()}function o(r){return r.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,(function(r){return"\\x0"+n(r)})).replace(/[\x10-\x1F\x7F-\x9F]/g,(function(r){return"\\x"+n(r)}))}function u(r){return r.replace(/\\/g,"\\\\").replace(/\]/g,"\\]").replace(/\^/g,"\\^").replace(/-/g,"\\-").replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,(function(r){return"\\x0"+n(r)})).replace(/[\x10-\x1F\x7F-\x9F]/g,(function(r){return"\\x"+n(r)}))}return"Expected "+function(r){var t,n,o,u=new Array(r.length);for(t=0;t<r.length;t++)u[t]=(o=r[t],e[o.type](o));if(u.sort(),u.length>0){for(t=1,n=1;t<u.length;t++)u[t-1]!==u[t]&&(u[n]=u[t],n++);u.length=n}switch(u.length){case 1:return u[0];case 2:return u[0]+" or "+u[1];default:return u.slice(0,-1).join(", ")+", or "+u[u.length-1]}}(r)+" but "+function(r){return r?'"'+o(r)+'"':"end of input"}(t)+" found."},r.exports={SyntaxError:o,parse:function(r,t){t=void 0!==t?t:{};var e,u={},a={start:bu},s=bu,i=function(r,t){return ec(r,t,1)},c=su("IF",!0),l=su("TRIGGER",!0),f=su("BEFORE",!0),p=su("AFTER",!0),b=su("INSTEAD OF",!0),v=su("ON",!0),d=su("OF",!0),y=function(r,t){return ec(r,t)},h=su("BEGIN",!0),m=su("END",!0),w=su("FOR",!0),L=su("EACH",!0),C=su("ROW",!0),A=su("STATEMENT",!0),E=(su("CASCADED",!0),su("LOCAL",!0)),g=su("CHECK",!0),T=(su("OPTION",!1),function(r,t){return ec(r,t)}),S=su("AUTO_INCREMENT",!0),_=su("AUTOINCREMENT",!0),j=su("UNIQUE",!0),x=su("KEY",!0),I=su("PRIMARY",!0),k=su("COLUMN_FORMAT",!0),N=su("FIXED",!0),R=su("DYNAMIC",!0),O=su("DEFAULT",!0),U=su("STORAGE",!0),M=su("DISK",!0),D=su("MEMORY",!0),P=su("ALGORITHM",!0),$=su("INSTANT",!0),F=su("INPLACE",!0),H=su("COPY",!0),B=su("LOCK",!0),G=su("NONE",!0),q=su("SHARED",!0),W=su("EXCLUSIVE",!0),Y=su("NOT",!0),V=su("REPLICATION",!0),X=su("FOREIGN KEY",!0),Q=su("MATCH FULL",!0),K=su("MATCH PARTIAL",!0),z=su("MATCH SIMPLE",!0),Z=su("RESTRICT",!0),J=su("CASCADE",!0),rr=su("SET NULL",!0),tr=su("NO ACTION",!0),er=su("SET DEFAULT",!0),nr=su("CHARACTER",!0),or=su("SET",!0),ur=su("CHARSET",!0),ar=su("COLLATE",!0),sr=su("AVG_ROW_LENGTH",!0),ir=su("KEY_BLOCK_SIZE",!0),cr=su("MAX_ROWS",!0),lr=su("MIN_ROWS",!0),fr=su("STATS_SAMPLE_PAGES",!0),pr=su("CONNECTION",!0),br=su("COMPRESSION",!0),vr=su("'",!1),dr=su("ZLIB",!0),yr=su("LZ4",!0),hr=su("ENGINE",!0),mr=su("READ",!0),wr=su("LOW_PRIORITY",!0),Lr=su("WRITE",!0),Cr=function(r,t){return ec(r,t)},Ar=su("BINARY",!0),Er=su("MASTER",!0),gr=su("LOGS",!0),Tr=su("BINLOG",!0),Sr=su("EVENTS",!0),_r=su("COLLATION",!0),jr=su("GRANTS",!0),xr=su("(",!1),Ir=su(")",!1),kr=su("BTREE",!0),Nr=su("HASH",!0),Rr=su("WITH",!0),Or=su("PARSER",!0),Ur=su("VISIBLE",!0),Mr=su("INVISIBLE",!0),Dr=function(r,t){return t.unshift(r),t.forEach(r=>{const{table:t,as:e}=r;cc[t]=t,e&&(cc[e]=t),function(r){const t=uc(r);r.clear(),t.forEach(t=>r.add(t))}(ic)}),t},Pr=su("=",!1),$r=su("DUPLICATE",!0),Fr=function(r,t){return nc(r,t)},Hr=su("!",!1),Br=function(r){return r[0]+" "+r[2]},Gr=su(">=",!1),qr=su(">",!1),Wr=su("<=",!1),Yr=su("<>",!1),Vr=su("<",!1),Xr=su("!=",!1),Qr=su("glob",!0),Kr=su("+",!1),zr=su("-",!1),Zr=su("*",!1),Jr=su("/",!1),rt=su("%",!1),tt=su("||",!1),et=su("?",!1),nt=function(r){return!0===Zi[r.toUpperCase()]},ot=su('"',!1),ut=/^[^"]/,at=iu(['"'],!0,!1),st=function(r){return r.join("")},it=/^[^']/,ct=iu(["'"],!0,!1),lt=su("`",!1),ft=/^[^`]/,pt=iu(["`"],!0,!1),bt=function(r,t){return r+t.join("")},vt=/^[A-Za-z_]/,dt=iu([["A","Z"],["a","z"],"_"],!1,!1),yt=/^[A-Za-z0-9_]/,ht=iu([["A","Z"],["a","z"],["0","9"],"_"],!1,!1),mt=/^[A-Za-z0-9_:]/,wt=iu([["A","Z"],["a","z"],["0","9"],"_",":"],!1,!1),Lt=su(":",!1),Ct=su("_binary",!0),At=su("X",!0),Et=/^[0-9A-Fa-f]/,gt=iu([["0","9"],["A","F"],["a","f"]],!1,!1),Tt=su("b",!0),St=su("0x",!1),_t=function(r,t){return{type:r.toLowerCase(),value:t[1].join("")}},jt=/^[^"\\\0-\x1F\x7F]/,xt=iu(['"',"\\",["\0",""],""],!0,!1),It=/^[^'\\]/,kt=iu(["'","\\"],!0,!1),Nt=su("\\'",!1),Rt=su('\\"',!1),Ot=su("\\\\",!1),Ut=su("\\/",!1),Mt=su("\\b",!1),Dt=su("\\f",!1),Pt=su("\\n",!1),$t=su("\\r",!1),Ft=su("\\t",!1),Ht=su("\\u",!1),Bt=su("\\",!1),Gt=su("''",!1),qt=su('""',!1),Wt=su("``",!1),Yt=/^[\n\r]/,Vt=iu(["\n","\r"],!1,!1),Xt=su(".",!1),Qt=/^[0-9]/,Kt=iu([["0","9"]],!1,!1),zt=/^[0-9a-fA-F]/,Zt=iu([["0","9"],["a","f"],["A","F"]],!1,!1),Jt=/^[eE]/,re=iu(["e","E"],!1,!1),te=/^[+\-]/,ee=iu(["+","-"],!1,!1),ne=su("ANALYZE",!0),oe=su("ATTACH",!0),ue=su("NULL",!0),ae=su("NOT NULL",!0),se=su("TRUE",!0),ie=su("TO",!0),ce=su("FALSE",!0),le=su("SHOW",!0),fe=su("DROP",!0),pe=su("USE",!0),be=su("ALTER",!0),ve=su("SELECT",!0),de=su("UPDATE",!0),ye=su("CREATE",!0),he=su("TEMPORARY",!0),me=su("TEMP",!0),we=su("DELETE",!0),Le=su("INSERT",!0),Ce=su("RECURSIVE",!1),Ae=su("REPLACE",!0),Ee=su("RENAME",!0),ge=su("IGNORE",!0),Te=(su("EXPLAIN",!0),su("PARTITION",!0)),Se=su("INTO",!0),_e=su("FROM",!0),je=su("UNLOCK",!0),xe=su("AS",!0),Ie=su("TABLE",!0),ke=su("TABLES",!0),Ne=su("DATABASE",!0),Re=su("SCHEME",!0),Oe=su("LEFT",!0),Ue=su("INNER",!0),Me=su("JOIN",!0),De=su("OUTER",!0),Pe=su("OVER",!0),$e=su("UNION",!0),Fe=su("VALUES",!0),He=su("USING",!0),Be=su("WHERE",!0),Ge=su("GROUP",!0),qe=su("BY",!0),We=su("ORDER",!0),Ye=su("HAVING",!0),Ve=su("LIMIT",!0),Xe=su("OFFSET",!0),Qe=su("ASC",!0),Ke=su("DESC",!0),ze=su("DESCRIBE",!0),Ze=su("ALL",!0),Je=su("DISTINCT",!0),rn=su("BETWEEN",!0),tn=su("IN",!0),en=su("IS",!0),nn=su("LIKE",!0),on=su("RLIKE",!0),un=su("REGEXP",!0),an=su("EXISTS",!0),sn=su("AND",!0),cn=su("OR",!0),ln=su("COUNT",!0),fn=su("MAX",!0),pn=su("MIN",!0),bn=su("SUM",!0),vn=su("AVG",!0),dn=su("CALL",!0),yn=su("CASE",!0),hn=su("WHEN",!0),mn=su("THEN",!0),wn=su("ELSE",!0),Ln=su("CAST",!0),Cn=su("BIT",!0),An=su("CHAR",!0),En=su("VARCHAR",!0),gn=su("NUMERIC",!0),Tn=su("DECIMAL",!0),Sn=su("SIGNED",!0),_n=su("UNSIGNED",!0),jn=su("INT",!0),xn=su("ZEROFILL",!0),In=su("INTEGER",!0),kn=su("JSON",!0),Nn=su("SMALLINT",!0),Rn=su("TINYINT",!0),On=su("TINYTEXT",!0),Un=su("TEXT",!0),Mn=su("MEDIUMTEXT",!0),Dn=su("LONGTEXT",!0),Pn=su("BIGINT",!0),$n=su("ENUM",!0),Fn=su("FLOAT",!0),Hn=su("DOUBLE",!0),Bn=su("REAL",!0),Gn=su("DATE",!0),qn=su("DATETIME",!0),Wn=su("TIME",!0),Yn=su("TIMESTAMP",!0),Vn=su("TRUNCATE",!0),Xn=su("USER",!0),Qn=su("CURRENT_DATE",!0),Kn=(su("ADDDATE",!0),su("INTERVAL",!0)),zn=su("YEAR",!0),Zn=su("MONTH",!0),Jn=su("DAY",!0),ro=su("HOUR",!0),to=su("MINUTE",!0),eo=su("SECOND",!0),no=su("CURRENT_TIME",!0),oo=su("CURRENT_TIMESTAMP",!0),uo=su("CURRENT_USER",!0),ao=su("SESSION_USER",!0),so=su("SYSTEM_USER",!0),io=su("GLOBAL",!0),co=su("SESSION",!0),lo=su("PERSIST",!0),fo=su("PERSIST_ONLY",!0),po=su("VIEW",!0),bo=su("@",!1),vo=su("@@",!1),yo=su("$",!1),ho=su("return",!0),mo=su(":=",!1),wo=su("DUAL",!0),Lo=su("ADD",!0),Co=su("COLUMN",!0),Ao=su("INDEX",!0),Eo=su("FULLTEXT",!0),go=su("SPATIAL",!0),To=su("COMMENT",!0),So=su("CONSTRAINT",!0),_o=su("REFERENCES",!0),jo=su("SQL_CALC_FOUND_ROWS",!0),xo=su("SQL_CACHE",!0),Io=su("SQL_NO_CACHE",!0),ko=su("SQL_SMALL_RESULT",!0),No=su("SQL_BIG_RESULT",!0),Ro=su("SQL_BUFFER_RESULT",!0),Oo=su(",",!1),Uo=su("[",!1),Mo=su("]",!1),Do=su(";",!1),Po=su("->",!1),$o=su("->>",!1),Fo=su("&&",!1),Ho=su("/*",!1),Bo=su("*/",!1),Go=su("--",!1),qo=su("#",!1),Wo={type:"any"},Yo=/^[ \t\n\r]/,Vo=iu([" ","\t","\n","\r"],!1,!1),Xo=su("blob",!0),Qo=su("tinyblob",!0),Ko=su("mediumblob",!0),zo=su("longblob",!0),Zo=su("boolean",!0),Jo=function(r){return{dataType:r}},ru=/^[0-6]/,tu=iu([["0","6"]],!1,!1),eu=0,nu=[{line:1,column:1}],ou=0,uu=[],au=0;if("startRule"in t){if(!(t.startRule in a))throw new Error("Can't start parsing from rule \""+t.startRule+'".');s=a[t.startRule]}function su(r,t){return{type:"literal",text:r,ignoreCase:t}}function iu(r,t,e){return{type:"class",parts:r,inverted:t,ignoreCase:e}}function cu(t){var e,n=nu[t];if(n)return n;for(e=t-1;!nu[e];)e--;for(n={line:(n=nu[e]).line,column:n.column};e<t;)10===r.charCodeAt(e)?(n.line++,n.column=1):n.column++,e++;return nu[t]=n,n}function lu(r,t){var e=cu(r),n=cu(t);return{start:{offset:r,line:e.line,column:e.column},end:{offset:t,line:n.line,column:n.column}}}function fu(r){eu<ou||(eu>ou&&(ou=eu,uu=[]),uu.push(r))}function pu(r,t,e){return new o(o.buildMessage(r,t),r,t,e)}function bu(){var r,t;return r=eu,Ni()!==u&&(t=yu())!==u?(r,r=t):(eu=r,r=u),r}function vu(){var t;return(t=function(){var t,e,n;t=eu,(e=function(){var t,e,n,o;t=eu,"analyze"===r.substr(eu,7).toLowerCase()?(e=r.substr(eu,7),eu+=7):(e=u,0===au&&fu(ne));e!==u?(n=eu,au++,o=qa(),au--,o===u?n=void 0:(eu=n,n=u),n!==u?(t,t=e="ANALYZE"):(eu=t,t=u)):(eu=t,t=u);return t}())!==u&&Ni()!==u&&(n=Ju())!==u&&Ni()!==u?(t,o=e,a=n,sc.add(`${o}::${a.db}::${a.table}`),e={tableList:Array.from(sc),columnList:uc(ic),ast:{type:o.toLowerCase(),table:a}},t=e):(eu=t,t=u);var o,a;return t}())===u&&(t=function(){var t,e,n,o,a,s;t=eu,(e=function(){var t,e,n,o;t=eu,"attach"===r.substr(eu,6).toLowerCase()?(e=r.substr(eu,6),eu+=6):(e=u,0===au&&fu(oe));e!==u?(n=eu,au++,o=qa(),au--,o===u?n=void 0:(eu=n,n=u),n!==u?(t,t=e="ATTACH"):(eu=t,t=u)):(eu=t,t=u);return t}())!==u&&Ni()!==u&&(n=Is())!==u&&Ni()!==u&&(o=Ca())!==u&&Ni()!==u&&(a=_s())!==u&&Ni()!==u&&(s=Pa())!==u&&Ni()!==u?(t,i=e,c=n,l=o,f=a,p=s,e={tableList:Array.from(sc),columnList:uc(ic),ast:{type:i.toLowerCase(),database:c,expr:l,as:f&&f[0].toLowerCase(),schema:p}},t=e):(eu=t,t=u);var i,c,l,f,p;return t}())===u&&(t=function(){var r,t,e,n,o,a;r=eu,(t=vs())!==u&&Ni()!==u&&(e=js())!==u&&Ni()!==u&&(n=Qu())!==u?(r,s=t,c=e,(l=n)&&l.forEach(r=>sc.add(`${s}::${r.db}::${r.table}`)),t={tableList:Array.from(sc),columnList:uc(ic),ast:{type:s.toLowerCase(),keyword:c.toLowerCase(),name:l}},r=t):(eu=r,r=u);var s,c,l;r===u&&(r=eu,(t=vs())!==u&&Ni()!==u&&(e=Li())!==u&&Ni()!==u&&(n=Ma())!==u&&Ni()!==u&&ks()!==u&&Ni()!==u&&(o=Ju())!==u&&Ni()!==u?((a=function(){var r,t,e,n,o,a;r=eu,(t=Su())===u&&(t=_u());if(t!==u){for(e=[],n=eu,(o=Ni())!==u?((a=Su())===u&&(a=_u()),a!==u?n=o=[o,a]:(eu=n,n=u)):(eu=n,n=u);n!==u;)e.push(n),n=eu,(o=Ni())!==u?((a=Su())===u&&(a=_u()),a!==u?n=o=[o,a]:(eu=n,n=u)):(eu=n,n=u);e!==u?(r,t=i(t,e),r=t):(eu=r,r=u)}else eu=r,r=u;return r}())===u&&(a=null),a!==u&&Ni()!==u?(r,t=function(r,t,e,n,o){return{tableList:Array.from(sc),columnList:uc(ic),ast:{type:r.toLowerCase(),keyword:t.toLowerCase(),name:e,table:n,options:o}}}(t,e,n,o,a),r=t):(eu=r,r=u)):(eu=r,r=u));return r}())===u&&(t=function(){var t;(t=function(){var r,t,e,n,o,a,s,i,c,l;r=eu,(t=ys())!==u&&Ni()!==u?((e=hs())===u&&(e=null),e!==u&&Ni()!==u&&js()!==u&&Ni()!==u?((n=wu())===u&&(n=null),n!==u&&Ni()!==u&&(o=Ju())!==u&&Ni()!==u?((a=function(){var r,t,e,n,o,a,s,i,c;if(r=eu,(t=Si())!==u)if(Ni()!==u)if((e=Cu())!==u){for(n=[],o=eu,(a=Ni())!==u&&(s=gi())!==u&&(i=Ni())!==u&&(c=Cu())!==u?o=a=[a,s,i,c]:(eu=o,o=u);o!==u;)n.push(o),o=eu,(a=Ni())!==u&&(s=gi())!==u&&(i=Ni())!==u&&(c=Cu())!==u?o=a=[a,s,i,c]:(eu=o,o=u);n!==u&&(o=Ni())!==u&&(a=_i())!==u?(r,t=T(e,n),r=t):(eu=r,r=u)}else eu=r,r=u;else eu=r,r=u;else eu=r,r=u;return r}())===u&&(a=null),a!==u&&Ni()!==u?((s=function(){var r,t,e,n,o,a,s,i;if(r=eu,(t=Ru())!==u){for(e=[],n=eu,(o=Ni())!==u?((a=gi())===u&&(a=null),a!==u&&(s=Ni())!==u&&(i=Ru())!==u?n=o=[o,a,s,i]:(eu=n,n=u)):(eu=n,n=u);n!==u;)e.push(n),n=eu,(o=Ni())!==u?((a=gi())===u&&(a=null),a!==u&&(s=Ni())!==u&&(i=Ru())!==u?n=o=[o,a,s,i]:(eu=n,n=u)):(eu=n,n=u);e!==u?(r,t=y(t,e),r=t):(eu=r,r=u)}else eu=r,r=u;return r}())===u&&(s=null),s!==u&&Ni()!==u?((i=Es())===u&&(i=Cs()),i===u&&(i=null),i!==u&&Ni()!==u?((c=_s())===u&&(c=null),c!==u&&Ni()!==u?((l=mu())===u&&(l=null),l!==u?(r,f=t,p=e,b=n,d=a,h=s,m=i,w=c,L=l,(v=o)&&sc.add(`create::${v.db}::${v.table}`),t={tableList:Array.from(sc),columnList:uc(ic),ast:{type:f[0].toLowerCase(),keyword:"table",temporary:p&&p[0].toLowerCase(),if_not_exists:b,table:[v],ignore_replace:m&&m[0].toLowerCase(),as:w&&w[0].toLowerCase(),query_expr:L&&L.ast,create_definitions:d,table_options:h}},r=t):(eu=r,r=u)):(eu=r,r=u)):(eu=r,r=u)):(eu=r,r=u)):(eu=r,r=u)):(eu=r,r=u)):(eu=r,r=u)):(eu=r,r=u);var f,p,b,v,d,h,m,w,L;r===u&&(r=eu,(t=ys())!==u&&Ni()!==u?((e=hs())===u&&(e=null),e!==u&&Ni()!==u&&js()!==u&&Ni()!==u?((n=wu())===u&&(n=null),n!==u&&Ni()!==u&&(o=Ju())!==u&&Ni()!==u&&(a=function r(){var t,e;(t=function(){var r,t,e;r=eu,(t=Gs())!==u&&Ni()!==u&&(e=Qu())!==u?(r,t=function(r){return{type:"like",table:r}}(e),r=t):(eu=r,r=u);return r}())===u&&(t=eu,Si()!==u&&Ni()!==u&&(e=r())!==u&&Ni()!==u&&_i()!==u?(t,(n=e).parentheses=!0,t=n):(eu=t,t=u));var n;return t}())!==u?(r,t=function(r,t,e,n,o){return n&&sc.add(`create::${n.db}::${n.table}`),{tableList:Array.from(sc),columnList:uc(ic),ast:{type:r[0].toLowerCase(),keyword:"table",temporary:t&&t[0].toLowerCase(),if_not_exists:e,table:[n],like:o}}}(t,e,n,o,a),r=t):(eu=r,r=u)):(eu=r,r=u)):(eu=r,r=u));return r}())===u&&(t=function(){var t,e,n,o,a,s;t=eu,(e=ys())!==u&&Ni()!==u?((n=Is())===u&&(n=function(){var t,e,n,o;t=eu,"scheme"===r.substr(eu,6).toLowerCase()?(e=r.substr(eu,6),eu+=6):(e=u,0===au&&fu(Re));e!==u?(n=eu,au++,o=qa(),au--,o===u?n=void 0:(eu=n,n=u),n!==u?(t,t=e="SCHEME"):(eu=t,t=u)):(eu=t,t=u);return t}()),n!==u&&Ni()!==u?((o=wu())===u&&(o=null),o!==u&&Ni()!==u&&(a=Ga())!==u&&Ni()!==u?((s=function(){var r,t,e,n,o,a;if(r=eu,(t=Nu())!==u){for(e=[],n=eu,(o=Ni())!==u&&(a=Nu())!==u?n=o=[o,a]:(eu=n,n=u);n!==u;)e.push(n),n=eu,(o=Ni())!==u&&(a=Nu())!==u?n=o=[o,a]:(eu=n,n=u);e!==u?(r,t=i(t,e),r=t):(eu=r,r=u)}else eu=r,r=u;return r}())===u&&(s=null),s!==u?(t,c=e,l=o,f=a,p=s,e={tableList:Array.from(sc),columnList:uc(ic),ast:{type:c[0].toLowerCase(),keyword:"database",if_not_exists:l,database:f,create_definitions:p}},t=e):(eu=t,t=u)):(eu=t,t=u)):(eu=t,t=u)):(eu=t,t=u);var c,l,f,p;return t}())===u&&(t=function(){var t,e,n,o,a,s,i,c,d,E,g,T,S;t=eu,(e=ys())!==u&&Ni()!==u?((n=hs())===u&&(n=ms()),n===u&&(n=null),n!==u&&Ni()!==u?("trigger"===r.substr(eu,7).toLowerCase()?(o=r.substr(eu,7),eu+=7):(o=u,0===au&&fu(l)),o!==u&&Ni()!==u?((a=wu())===u&&(a=null),a!==u&&Ni()!==u&&(s=Ju())!==u&&Ni()!==u?("before"===r.substr(eu,6).toLowerCase()?(i=r.substr(eu,6),eu+=6):(i=u,0===au&&fu(f)),i===u&&("after"===r.substr(eu,5).toLowerCase()?(i=r.substr(eu,5),eu+=5):(i=u,0===au&&fu(p)),i===u&&("instead of"===r.substr(eu,10).toLowerCase()?(i=r.substr(eu,10),eu+=10):(i=u,0===au&&fu(b)))),i===u&&(i=null),i!==u&&Ni()!==u&&(c=function(){var r,t,e,n,o,a,s,i;if(r=eu,(t=Lu())!==u){for(e=[],n=eu,(o=Ni())!==u&&(a=Vs())!==u&&(s=Ni())!==u&&(i=Lu())!==u?n=o=[o,a,s,i]:(eu=n,n=u);n!==u;)e.push(n),n=eu,(o=Ni())!==u&&(a=Vs())!==u&&(s=Ni())!==u&&(i=Lu())!==u?n=o=[o,a,s,i]:(eu=n,n=u);e!==u?(r,t=y(t,e),r=t):(eu=r,r=u)}else eu=r,r=u;return r}())!==u&&Ni()!==u?("on"===r.substr(eu,2).toLowerCase()?(d=r.substr(eu,2),eu+=2):(d=u,0===au&&fu(v)),d!==u&&Ni()!==u&&(E=Ju())!==u&&Ni()!==u?((g=function(){var t,e,n,o;t=eu,"for"===r.substr(eu,3).toLowerCase()?(e=r.substr(eu,3),eu+=3):(e=u,0===au&&fu(w));e!==u&&Ni()!==u?("each"===r.substr(eu,4).toLowerCase()?(n=r.substr(eu,4),eu+=4):(n=u,0===au&&fu(L)),n===u&&(n=null),n!==u&&Ni()!==u?("row"===r.substr(eu,3).toLowerCase()?(o=r.substr(eu,3),eu+=3):(o=u,0===au&&fu(C)),o===u&&("statement"===r.substr(eu,9).toLowerCase()?(o=r.substr(eu,9),eu+=9):(o=u,0===au&&fu(A))),o!==u?(t,a=e,i=o,e={keyword:(s=n)?`${a.toLowerCase()} ${s.toLowerCase()}`:a.toLowerCase(),args:i.toLowerCase()},t=e):(eu=t,t=u)):(eu=t,t=u)):(eu=t,t=u);var a,s,i;return t}())===u&&(g=null),g!==u&&Ni()!==u?((T=function(){var r,t;r=eu,Qs()!==u&&Ni()!==u&&(t=Ca())!==u?(r,r={type:"when",cond:t}):(eu=r,r=u);return r}())===u&&(T=null),T!==u&&Ni()!==u&&(S=function(){var t,e,n,o;t=eu,"begin"===r.substr(eu,5).toLowerCase()?(e=r.substr(eu,5),eu+=5):(e=u,0===au&&fu(h));e!==u&&Ni()!==u&&(n=yu())!==u&&Ni()!==u?("end"===r.substr(eu,3).toLowerCase()?(o=r.substr(eu,3),eu+=3):(o=u,0===au&&fu(m)),o!==u?(t,t=e={type:"multiple",prefix:e,expr:n,suffix:o}):(eu=t,t=u)):(eu=t,t=u);return t}())!==u?(t,j=o,x=a,I=s,k=i,N=c,R=E,O=g,U=T,M=S,e={type:"create",temporary:(_=n)&&_[0].toLowerCase(),time:k&&k.toLowerCase(),events:N,trigger:I,table:R,for_each:O,if_not_exists:x,when:U,execute:M,keyword:j&&j.toLowerCase()},t=e):(eu=t,t=u)):(eu=t,t=u)):(eu=t,t=u)):(eu=t,t=u)):(eu=t,t=u)):(eu=t,t=u)):(eu=t,t=u)):(eu=t,t=u);var _,j,x,I,k,N,R,O,U,M;return t}())===u&&(t=function(){var t,e,n,o,a,s,i,c,l,f,p;t=eu,(e=ys())!==u&&Ni()!==u?((n=ms())===u&&(n=hs()),n===u&&(n=null),n!==u&&Ni()!==u&&function(){var t,e,n,o;t=eu,"view"===r.substr(eu,4).toLowerCase()?(e=r.substr(eu,4),eu+=4):(e=u,0===au&&fu(po));e!==u?(n=eu,au++,o=qa(),au--,o===u?n=void 0:(eu=n,n=u),n!==u?(t,t=e="VIEW"):(eu=t,t=u)):(eu=t,t=u);return t}()!==u&&Ni()!==u?((o=wu())===u&&(o=null),o!==u&&Ni()!==u&&(a=Ju())!==u&&Ni()!==u?(s=eu,(i=Si())!==u&&(c=Ni())!==u&&(l=Da())!==u&&(f=Ni())!==u&&(p=_i())!==u?s=i=[i,c,l,f,p]:(eu=s,s=u),s===u&&(s=null),s!==u&&(i=Ni())!==u&&(c=_s())!==u&&(l=Ni())!==u&&(f=$u())!==u?(t,b=e,v=n,d=o,h=s,m=f,(y=a).view=y.table,delete y.table,e={tableList:Array.from(sc),columnList:uc(ic),ast:{type:b[0].toLowerCase(),keyword:"view",if_not_exists:d,temporary:v&&v[0].toLowerCase(),columns:h&&h[2],select:m,view:y}},t=e):(eu=t,t=u)):(eu=t,t=u)):(eu=t,t=u)):(eu=t,t=u);var b,v,d,y,h,m;return t}());return t}())===u&&(t=function(){var t,e,n,o;t=eu,(e=function(){var t,e,n,o;t=eu,"truncate"===r.substr(eu,8).toLowerCase()?(e=r.substr(eu,8),eu+=8):(e=u,0===au&&fu(Vn));e!==u?(n=eu,au++,o=qa(),au--,o===u?n=void 0:(eu=n,n=u),n!==u?(t,t=e="TRUNCATE"):(eu=t,t=u)):(eu=t,t=u);return t}())!==u&&Ni()!==u?((n=js())===u&&(n=null),n!==u&&Ni()!==u&&(o=Qu())!==u?(t,a=e,s=n,(i=o)&&i.forEach(r=>sc.add(`${a}::${r.db}::${r.table}`)),e={tableList:Array.from(sc),columnList:uc(ic),ast:{type:a.toLowerCase(),keyword:s&&s.toLowerCase()||"table",name:i}},t=e):(eu=t,t=u)):(eu=t,t=u);var a,s,i;return t}())===u&&(t=function(){var r,t,e;r=eu,(t=As())!==u&&Ni()!==u&&js()!==u&&Ni()!==u&&(e=function(){var r,t,e,n,o,a,s,i;if(r=eu,(t=Wu())!==u){for(e=[],n=eu,(o=Ni())!==u&&(a=gi())!==u&&(s=Ni())!==u&&(i=Wu())!==u?n=o=[o,a,s,i]:(eu=n,n=u);n!==u;)e.push(n),n=eu,(o=Ni())!==u&&(a=gi())!==u&&(s=Ni())!==u&&(i=Wu())!==u?n=o=[o,a,s,i]:(eu=n,n=u);e!==u?(r,t=T(t,e),r=t):(eu=r,r=u)}else eu=r,r=u;return r}())!==u?(r,(n=e).forEach(r=>r.forEach(r=>r.table&&sc.add(`rename::${r.db}::${r.table}`))),t={tableList:Array.from(sc),columnList:uc(ic),ast:{type:"rename",table:n}},r=t):(eu=r,r=u);var n;return r}())===u&&(t=function(){var t,e,n;t=eu,(e=function(){var t,e,n,o;t=eu,"call"===r.substr(eu,4).toLowerCase()?(e=r.substr(eu,4),eu+=4):(e=u,0===au&&fu(dn));e!==u?(n=eu,au++,o=qa(),au--,o===u?n=void 0:(eu=n,n=u),n!==u?(t,t=e="CALL"):(eu=t,t=u)):(eu=t,t=u);return t}())!==u&&Ni()!==u&&(n=Yi())!==u?(t,o=n,e={tableList:Array.from(sc),columnList:uc(ic),ast:{type:"call",expr:o}},t=e):(eu=t,t=u);var o;return t}())===u&&(t=function(){var t,e,n;t=eu,(e=function(){var t,e,n,o;t=eu,"use"===r.substr(eu,3).toLowerCase()?(e=r.substr(eu,3),eu+=3):(e=u,0===au&&fu(pe));e!==u?(n=eu,au++,o=qa(),au--,o===u?n=void 0:(eu=n,n=u),n!==u?t=e=[e,n]:(eu=t,t=u)):(eu=t,t=u);return t}())!==u&&Ni()!==u&&(n=Pa())!==u?(t,o=n,sc.add(`use::${o}::null`),e={tableList:Array.from(sc),columnList:uc(ic),ast:{type:"use",db:o}},t=e):(eu=t,t=u);var o;return t}())===u&&(t=function(){var t,e,n,o;t=eu,(e=function(){var t,e,n,o;t=eu,"alter"===r.substr(eu,5).toLowerCase()?(e=r.substr(eu,5),eu+=5):(e=u,0===au&&fu(be));e!==u?(n=eu,au++,o=qa(),au--,o===u?n=void 0:(eu=n,n=u),n!==u?t=e=[e,n]:(eu=t,t=u)):(eu=t,t=u);return t}())!==u&&Ni()!==u&&js()!==u&&Ni()!==u&&(n=Qu())!==u&&Ni()!==u&&(o=function(){var r,t,e,n,o,a,s,i;if(r=eu,(t=Tu())!==u){for(e=[],n=eu,(o=Ni())!==u&&(a=gi())!==u&&(s=Ni())!==u&&(i=Tu())!==u?n=o=[o,a,s,i]:(eu=n,n=u);n!==u;)e.push(n),n=eu,(o=Ni())!==u&&(a=gi())!==u&&(s=Ni())!==u&&(i=Tu())!==u?n=o=[o,a,s,i]:(eu=n,n=u);e!==u?(r,t=T(t,e),r=t):(eu=r,r=u)}else eu=r,r=u;return r}())!==u?(t,s=o,(a=n)&&a.length>0&&a.forEach(r=>sc.add(`alter::${r.db}::${r.table}`)),e={tableList:Array.from(sc),columnList:uc(ic),ast:{type:"alter",table:a,expr:s}},t=e):(eu=t,t=u);var a,s;return t}())===u&&(t=function(){var t,e,n,o;t=eu,(e=Ss())!==u&&Ni()!==u?((n=function(){var t,e,n,o;t=eu,"global"===r.substr(eu,6).toLowerCase()?(e=r.substr(eu,6),eu+=6):(e=u,0===au&&fu(io));e!==u?(n=eu,au++,o=qa(),au--,o===u?n=void 0:(eu=n,n=u),n!==u?(t,t=e="GLOBAL"):(eu=t,t=u)):(eu=t,t=u);return t}())===u&&(n=function(){var t,e,n,o;t=eu,"session"===r.substr(eu,7).toLowerCase()?(e=r.substr(eu,7),eu+=7):(e=u,0===au&&fu(co));e!==u?(n=eu,au++,o=qa(),au--,o===u?n=void 0:(eu=n,n=u),n!==u?(t,t=e="SESSION"):(eu=t,t=u)):(eu=t,t=u);return t}())===u&&(n=function(){var t,e,n,o;t=eu,"local"===r.substr(eu,5).toLowerCase()?(e=r.substr(eu,5),eu+=5):(e=u,0===au&&fu(E));e!==u?(n=eu,au++,o=qa(),au--,o===u?n=void 0:(eu=n,n=u),n!==u?(t,t=e="LOCAL"):(eu=t,t=u)):(eu=t,t=u);return t}())===u&&(n=function(){var t,e,n,o;t=eu,"persist"===r.substr(eu,7).toLowerCase()?(e=r.substr(eu,7),eu+=7):(e=u,0===au&&fu(lo));e!==u?(n=eu,au++,o=qa(),au--,o===u?n=void 0:(eu=n,n=u),n!==u?(t,t=e="PERSIST"):(eu=t,t=u)):(eu=t,t=u);return t}())===u&&(n=function(){var t,e,n,o;t=eu,"persist_only"===r.substr(eu,12).toLowerCase()?(e=r.substr(eu,12),eu+=12):(e=u,0===au&&fu(fo));e!==u?(n=eu,au++,o=qa(),au--,o===u?n=void 0:(eu=n,n=u),n!==u?(t,t=e="PERSIST_ONLY"):(eu=t,t=u)):(eu=t,t=u);return t}()),n===u&&(n=null),n!==u&&Ni()!==u&&(o=Fi())!==u?(t,a=n,(s=o).keyword=a,e={tableList:Array.from(sc),columnList:uc(ic),ast:{type:"set",expr:s}},t=e):(eu=t,t=u)):(eu=t,t=u);var a,s;return t}())===u&&(t=function(){var t,e,n;t=eu,(e=function(){var t,e,n,o;t=eu,"lock"===r.substr(eu,4).toLowerCase()?(e=r.substr(eu,4),eu+=4):(e=u,0===au&&fu(B));e!==u?(n=eu,au++,o=qa(),au--,o===u?n=void 0:(eu=n,n=u),n!==u?t=e=[e,n]:(eu=t,t=u)):(eu=t,t=u);return t}())!==u&&Ni()!==u&&xs()!==u&&Ni()!==u&&(n=function(){var r,t,e,n,o,a,s,i;if(r=eu,(t=Ou())!==u){for(e=[],n=eu,(o=Ni())!==u&&(a=gi())!==u&&(s=Ni())!==u&&(i=Ou())!==u?n=o=[o,a,s,i]:(eu=n,n=u);n!==u;)e.push(n),n=eu,(o=Ni())!==u&&(a=gi())!==u&&(s=Ni())!==u&&(i=Ou())!==u?n=o=[o,a,s,i]:(eu=n,n=u);e!==u?(r,t=Cr(t,e),r=t):(eu=r,r=u)}else eu=r,r=u;return r}())!==u?(t,o=n,e={tableList:Array.from(sc),columnList:uc(ic),ast:{type:"lock",keyword:"tables",tables:o}},t=e):(eu=t,t=u);var o;return t}())===u&&(t=function(){var t,e;t=eu,(e=function(){var t,e,n,o;t=eu,"unlock"===r.substr(eu,6).toLowerCase()?(e=r.substr(eu,6),eu+=6):(e=u,0===au&&fu(je));e!==u?(n=eu,au++,o=qa(),au--,o===u?n=void 0:(eu=n,n=u),n!==u?t=e=[e,n]:(eu=t,t=u)):(eu=t,t=u);return t}())!==u&&Ni()!==u&&xs()!==u?(t,e={tableList:Array.from(sc),columnList:uc(ic),ast:{type:"unlock",keyword:"tables"}},t=e):(eu=t,t=u);return t}())===u&&(t=function(){var t,e,n,o,a,s,i,c,l;t=eu,(e=bs())!==u&&Ni()!==u?("binary"===r.substr(eu,6).toLowerCase()?(n=r.substr(eu,6),eu+=6):(n=u,0===au&&fu(Ar)),n===u&&("master"===r.substr(eu,6).toLowerCase()?(n=r.substr(eu,6),eu+=6):(n=u,0===au&&fu(Er))),n!==u&&(o=Ni())!==u?("logs"===r.substr(eu,4).toLowerCase()?(a=r.substr(eu,4),eu+=4):(a=u,0===au&&fu(gr)),a!==u?(t,f=n,e={tableList:Array.from(sc),columnList:uc(ic),ast:{type:"show",suffix:"logs",keyword:f.toLowerCase()}},t=e):(eu=t,t=u)):(eu=t,t=u)):(eu=t,t=u);var f;t===u&&(t=eu,(e=bs())!==u&&Ni()!==u?("binlog"===r.substr(eu,6).toLowerCase()?(n=r.substr(eu,6),eu+=6):(n=u,0===au&&fu(Tr)),n!==u&&(o=Ni())!==u?("events"===r.substr(eu,6).toLowerCase()?(a=r.substr(eu,6),eu+=6):(a=u,0===au&&fu(Sr)),a!==u&&(s=Ni())!==u?((i=Ia())===u&&(i=null),i!==u&&Ni()!==u?((c=qu())===u&&(c=null),c!==u&&Ni()!==u?((l=sa())===u&&(l=null),l!==u?(t,p=i,b=c,v=l,e={tableList:Array.from(sc),columnList:uc(ic),ast:{type:"show",suffix:"events",keyword:"binlog",in:p,from:b,limit:v}},t=e):(eu=t,t=u)):(eu=t,t=u)):(eu=t,t=u)):(eu=t,t=u)):(eu=t,t=u)):(eu=t,t=u),t===u&&(t=eu,(e=bs())!==u&&Ni()!==u?(n=eu,"character"===r.substr(eu,9).toLowerCase()?(o=r.substr(eu,9),eu+=9):(o=u,0===au&&fu(nr)),o!==u&&(a=Ni())!==u?("set"===r.substr(eu,3).toLowerCase()?(s=r.substr(eu,3),eu+=3):(s=u,0===au&&fu(or)),s!==u?n=o=[o,a,s]:(eu=n,n=u)):(eu=n,n=u),n===u&&("collation"===r.substr(eu,9).toLowerCase()?(n=r.substr(eu,9),eu+=9):(n=u,0===au&&fu(_r))),n!==u&&(o=Ni())!==u?((a=xa())===u&&(a=ea()),a===u&&(a=null),a!==u?(t,e=function(r,t){let e=Array.isArray(r)&&r||[r];return{tableList:Array.from(sc),columnList:uc(ic),ast:{type:"show",suffix:e[2]&&e[2].toLowerCase(),keyword:e[0].toLowerCase(),expr:t}}}(n,a),t=e):(eu=t,t=u)):(eu=t,t=u)):(eu=t,t=u),t===u&&(t=function(){var t,e,n,o;t=eu,(e=bs())!==u&&Ni()!==u?("grants"===r.substr(eu,6).toLowerCase()?(n=r.substr(eu,6),eu+=6):(n=u,0===au&&fu(jr)),n!==u&&Ni()!==u?((o=function(){var t,e,n,o,a,s,i;t=eu,"for"===r.substr(eu,3).toLowerCase()?(e=r.substr(eu,3),eu+=3):(e=u,0===au&&fu(w));e!==u&&Ni()!==u&&(n=Pa())!==u&&Ni()!==u?(o=eu,(a=yi())!==u&&(s=Ni())!==u&&(i=Pa())!==u?o=a=[a,s,i]:(eu=o,o=u),o===u&&(o=null),o!==u&&(a=Ni())!==u?((s=function(){var r,t;r=eu,Os()!==u&&Ni()!==u&&(t=function(){var r,t,e,n,o,a,s,i;if(r=eu,(t=Pa())!==u){for(e=[],n=eu,(o=Ni())!==u&&(a=gi())!==u&&(s=Ni())!==u&&(i=Pa())!==u?n=o=[o,a,s,i]:(eu=n,n=u);n!==u;)e.push(n),n=eu,(o=Ni())!==u&&(a=gi())!==u&&(s=Ni())!==u&&(i=Pa())!==u?n=o=[o,a,s,i]:(eu=n,n=u);e!==u?(r,t=Cr(t,e),r=t):(eu=r,r=u)}else eu=r,r=u;return r}())!==u?(r,r=t):(eu=r,r=u);return r}())===u&&(s=null),s!==u?(t,l=s,e={user:n,host:(c=o)&&c[2],role_list:l},t=e):(eu=t,t=u)):(eu=t,t=u)):(eu=t,t=u);var c,l;return t}())===u&&(o=null),o!==u?(t,a=o,e={tableList:Array.from(sc),columnList:uc(ic),ast:{type:"show",keyword:"grants",for:a}},t=e):(eu=t,t=u)):(eu=t,t=u)):(eu=t,t=u);var a;return t}())));var p,b,v;return t}())===u&&(t=function(){var t,e,n;t=eu,(e=Ds())===u&&(e=function(){var t,e,n,o;t=eu,"describe"===r.substr(eu,8).toLowerCase()?(e=r.substr(eu,8),eu+=8):(e=u,0===au&&fu(ze));e!==u?(n=eu,au++,o=qa(),au--,o===u?n=void 0:(eu=n,n=u),n!==u?(t,t=e="DESCRIBE"):(eu=t,t=u)):(eu=t,t=u);return t}());e!==u&&Ni()!==u&&(n=Pa())!==u?(t,o=n,e={tableList:Array.from(sc),columnList:uc(ic),ast:{type:"desc",table:o}},t=e):(eu=t,t=u);var o;return t}()),t}function du(){var r;return(r=mu())===u&&(r=function(){var r,t,e,n,o,a,s;r=eu,(t=ds())!==u&&Ni()!==u&&(e=Qu())!==u&&Ni()!==u&&Ss()!==u&&Ni()!==u&&(n=ia())!==u&&Ni()!==u?((o=ea())===u&&(o=null),o!==u&&Ni()!==u?((a=oa())===u&&(a=null),a!==u&&Ni()!==u?((s=sa())===u&&(s=null),s!==u?(r,t=function(r,t,e,n,o){const u={};return r&&r.forEach(r=>{const{db:t,as:e,table:n,join:o}=r,a=o?"select":"update";t&&(u[n]=t),n&&sc.add(`${a}::${t}::${n}`)}),t&&t.forEach(r=>{if(r.table){const t=oc(r.table);sc.add(`update::${u[t]||null}::${t}`)}ic.add(`update::${r.table}::${r.column}`)}),{tableList:Array.from(sc),columnList:uc(ic),ast:{type:"update",table:r,set:t,where:e,orderby:n,limit:o}}}(e,n,o,a,s),r=t):(eu=r,r=u)):(eu=r,r=u)):(eu=r,r=u)):(eu=r,r=u);return r}())===u&&(r=function(){var r,t,e,n,o,a,s,i;r=eu,(t=ba())!==u&&Ni()!==u?((e=Ts())===u&&(e=null),e!==u&&Ni()!==u&&(n=Ju())!==u&&Ni()!==u?((o=fa())===u&&(o=null),o!==u&&Ni()!==u&&Si()!==u&&Ni()!==u&&(a=Da())!==u&&Ni()!==u&&_i()!==u&&Ni()!==u&&(s=la())!==u&&Ni()!==u?((i=pa())===u&&(i=null),i!==u?(r,t=function(r,t,e,n,o,u){if(t&&(sc.add(`insert::${t.db}::${t.table}`),t.as=null),n){let r=t&&t.table||null;Array.isArray(o)&&o.forEach((r,t)=>{if(r.value.length!=n.length)throw new Error("Error: column count doesn't match value count at row "+(t+1))}),n.forEach(t=>ic.add(`insert::${r}::${t}`))}return{tableList:Array.from(sc),columnList:uc(ic),ast:{type:r,table:[t],columns:n,values:o,partition:e,on_duplicate_update:u}}}(t,n,o,a,s,i),r=t):(eu=r,r=u)):(eu=r,r=u)):(eu=r,r=u)):(eu=r,r=u);return r}())===u&&(r=function(){var r,t,e,n,o,a,s,i;r=eu,(t=ba())!==u&&Ni()!==u?((e=Es())===u&&(e=null),e!==u&&Ni()!==u?((n=Ts())===u&&(n=null),n!==u&&Ni()!==u&&(o=Ju())!==u&&Ni()!==u?((a=fa())===u&&(a=null),a!==u&&Ni()!==u&&(s=la())!==u&&Ni()!==u?((i=pa())===u&&(i=null),i!==u?(r,t=function(r,t,e,n,o,u,a){n&&(sc.add(`insert::${n.db}::${n.table}`),ic.add(`insert::${n.table}::(.*)`),n.as=null);const s=[t,e].filter(r=>r).map(r=>r[0]&&r[0].toLowerCase()).join(" ");return{tableList:Array.from(sc),columnList:uc(ic),ast:{type:r,table:[n],columns:null,values:u,partition:o,prefix:s,on_duplicate_update:a}}}(t,e,n,o,a,s,i),r=t):(eu=r,r=u)):(eu=r,r=u)):(eu=r,r=u)):(eu=r,r=u)):(eu=r,r=u);return r}())===u&&(r=function(){var r,t,e,n,o,a;r=eu,(t=ba())!==u&&Ni()!==u&&Ts()!==u&&Ni()!==u&&(e=Ju())!==u&&Ni()!==u?((n=fa())===u&&(n=null),n!==u&&Ni()!==u&&Ss()!==u&&Ni()!==u&&(o=ia())!==u&&Ni()!==u?((a=pa())===u&&(a=null),a!==u?(r,s=t,c=n,l=o,f=a,(i=e)&&(sc.add(`insert::${i.db}::${i.table}`),ic.add(`insert::${i.table}::(.*)`),i.as=null),t={tableList:Array.from(sc),columnList:uc(ic),ast:{type:s,table:[i],columns:null,partition:c,set:l,on_duplicate_update:f}},r=t):(eu=r,r=u)):(eu=r,r=u)):(eu=r,r=u);var s,i,c,l,f;return r}())===u&&(r=function(){var r,t,e,n,o,a,s;r=eu,(t=ws())!==u&&Ni()!==u?((e=Qu())===u&&(e=null),e!==u&&Ni()!==u&&(n=qu())!==u&&Ni()!==u?((o=ea())===u&&(o=null),o!==u&&Ni()!==u?((a=oa())===u&&(a=null),a!==u&&Ni()!==u?((s=sa())===u&&(s=null),s!==u?(r,t=function(r,t,e,n,o){if(t&&t.forEach(r=>{const{db:t,as:e,table:n,join:o}=r,u=o?"select":"delete";n&&sc.add(`${u}::${t}::${n}`),o||ic.add(`delete::${n}::(.*)`)}),null===r&&1===t.length){const e=t[0];r=[{db:e.db,table:e.table,as:e.as,addition:!0}]}return{tableList:Array.from(sc),columnList:uc(ic),ast:{type:"delete",table:r,from:t,where:e,orderby:n,limit:o}}}(e,n,o,a,s),r=t):(eu=r,r=u)):(eu=r,r=u)):(eu=r,r=u)):(eu=r,r=u)):(eu=r,r=u);return r}())===u&&(r=vu())===u&&(r=function(){var r,t;r=[],t=$i();for(;t!==u;)r.push(t),t=$i();return r}()),r}function yu(){var r,t,e,n,o,a,s,i;if(r=eu,(t=du())!==u){for(e=[],n=eu,(o=Ni())!==u&&(a=ji())!==u&&(s=Ni())!==u&&(i=du())!==u?n=o=[o,a,s,i]:(eu=n,n=u);n!==u;)e.push(n),n=eu,(o=Ni())!==u&&(a=ji())!==u&&(s=Ni())!==u&&(i=du())!==u?n=o=[o,a,s,i]:(eu=n,n=u);e!==u?(r,r=t=function(r,t){const e=r&&r.ast||r,n=t&&t.length&&t[0].length>=4?[e]:e;t||(t=[]);for(let r=0;r<t.length;r++)t[r][3]&&0!==t[r][3].length&&n.push(t[r][3]&&t[r][3].ast||t[r][3]);return{tableList:Array.from(sc),columnList:uc(ic),ast:n}}(t,e)):(eu=r,r=u)}else eu=r,r=u;return r}function hu(){var t,e,n;return t=eu,function(){var t,e,n,o;t=eu,"union"===r.substr(eu,5).toLowerCase()?(e=r.substr(eu,5),eu+=5):(e=u,0===au&&fu($e));e!==u?(n=eu,au++,o=qa(),au--,o===u?n=void 0:(eu=n,n=u),n!==u?t=e=[e,n]:(eu=t,t=u)):(eu=t,t=u);return t}()!==u&&Ni()!==u?((e=Ps())===u&&(e=$s()),e===u&&(e=null),e!==u?(t,t=(n=e)?"union "+n.toLowerCase():"union"):(eu=t,t=u)):(eu=t,t=u),t}function mu(){var r,t,e,n,o,a,s,i;if(r=eu,(t=Uu())!==u){for(e=[],n=eu,(o=Ni())!==u&&(a=hu())!==u&&(s=Ni())!==u&&(i=Uu())!==u?n=o=[o,a,s,i]:(eu=n,n=u);n!==u;)e.push(n),n=eu,(o=Ni())!==u&&(a=hu())!==u&&(s=Ni())!==u&&(i=Uu())!==u?n=o=[o,a,s,i]:(eu=n,n=u);e!==u&&(n=Ni())!==u?((o=oa())===u&&(o=null),o!==u&&(a=Ni())!==u?((s=sa())===u&&(s=null),s!==u?(r,r=t=function(r,t,e,n){let o=r;for(let r=0;r<t.length;r++)o._next=t[r][3],o.set_op=t[r][1],o=o._next;return e&&(r._orderby=e),n&&(r._limit=n),{tableList:Array.from(sc),columnList:uc(ic),ast:r}}(t,e,o,s)):(eu=r,r=u)):(eu=r,r=u)):(eu=r,r=u)}else eu=r,r=u;return r}function wu(){var t,e;return t=eu,"if"===r.substr(eu,2).toLowerCase()?(e=r.substr(eu,2),eu+=2):(e=u,0===au&&fu(c)),e!==u&&Ni()!==u&&Ws()!==u&&Ni()!==u&&qs()!==u?(t,t=e="IF NOT EXISTS"):(eu=t,t=u),t}function Lu(){var t,e,n,o,a,s;return t=eu,(e=Ls())===u&&(e=ws()),e!==u&&(t,e={keyword:e[0].toLowerCase()}),(t=e)===u&&(t=eu,(e=ds())!==u&&Ni()!==u?(n=eu,"of"===r.substr(eu,2).toLowerCase()?(o=r.substr(eu,2),eu+=2):(o=u,0===au&&fu(d)),o!==u&&(a=Ni())!==u&&(s=na())!==u?n=o=[o,a,s]:(eu=n,n=u),n===u&&(n=null),n!==u?(t,t=e=function(r,t){return{keyword:r[0].toLowerCase(),args:t&&{keyword:t[0],columns:t[2]}||null}}(e,n)):(eu=t,t=u)):(eu=t,t=u)),t}function Cu(){var t;return(t=function(){var t;(t=function(){var t,e,n,o,a,s,i,c;t=eu,(e=ju())===u&&(e=null);e!==u&&Ni()!==u?(n=eu,"primary"===r.substr(eu,7).toLowerCase()?(o=r.substr(eu,7),eu+=7):(o=u,0===au&&fu(I)),o!==u&&(a=Ni())!==u?("key"===r.substr(eu,3).toLowerCase()?(s=r.substr(eu,3),eu+=3):(s=u,0===au&&fu(x)),s!==u?n=o=[o,a,s]:(eu=n,n=u)):(eu=n,n=u),n!==u&&(o=Ni())!==u?((a=Yu())===u&&(a=null),a!==u&&(s=Ni())!==u&&(i=Pu())!==u&&Ni()!==u?((c=Vu())===u&&(c=null),c!==u?(t,f=n,p=a,b=i,v=c,e={constraint:(l=e)&&l.constraint,definition:b,constraint_type:`${f[0].toLowerCase()} ${f[2].toLowerCase()}`,keyword:l&&l.keyword,index_type:p,resource:"constraint",index_options:v},t=e):(eu=t,t=u)):(eu=t,t=u)):(eu=t,t=u)):(eu=t,t=u);var l,f,p,b,v;return t}())===u&&(t=function(){var t,e,n,o,a,s,i,c;t=eu,(e=ju())===u&&(e=null);e!==u&&Ni()!==u&&(n=function(){var t,e,n,o;t=eu,"unique"===r.substr(eu,6).toLowerCase()?(e=r.substr(eu,6),eu+=6):(e=u,0===au&&fu(j));e!==u?(n=eu,au++,o=qa(),au--,o===u?n=void 0:(eu=n,n=u),n!==u?(t,t=e="UNIQUE"):(eu=t,t=u)):(eu=t,t=u);return t}())!==u&&Ni()!==u?((o=Li())===u&&(o=Ci()),o===u&&(o=null),o!==u&&Ni()!==u?((a=Ha())===u&&(a=null),a!==u&&Ni()!==u?((s=Yu())===u&&(s=null),s!==u&&Ni()!==u&&(i=Pu())!==u&&Ni()!==u?((c=Vu())===u&&(c=null),c!==u?(t,f=n,p=o,b=a,v=s,d=i,y=c,e={constraint:(l=e)&&l.constraint,definition:d,constraint_type:p&&`${f.toLowerCase()} ${p.toLowerCase()}`||f.toLowerCase(),keyword:l&&l.keyword,index_type:v,index:b,resource:"constraint",index_options:y},t=e):(eu=t,t=u)):(eu=t,t=u)):(eu=t,t=u)):(eu=t,t=u)):(eu=t,t=u);var l,f,p,b,v,d,y;return t}())===u&&(t=function(){var t,e,n,o,a,s;t=eu,(e=ju())===u&&(e=null);e!==u&&Ni()!==u?("foreign key"===r.substr(eu,11).toLowerCase()?(n=r.substr(eu,11),eu+=11):(n=u,0===au&&fu(X)),n!==u&&Ni()!==u?((o=Ha())===u&&(o=null),o!==u&&Ni()!==u&&(a=Pu())!==u&&Ni()!==u?((s=xu())===u&&(s=null),s!==u?(t,c=n,l=o,f=a,p=s,e={constraint:(i=e)&&i.constraint,definition:f,constraint_type:c,keyword:i&&i.keyword,index:l,resource:"constraint",reference_definition:p},t=e):(eu=t,t=u)):(eu=t,t=u)):(eu=t,t=u)):(eu=t,t=u);var i,c,l,f,p;return t}())===u&&(t=function(){var t,e,n,o,a,s,i,c,l,f;t=eu,(e=ju())===u&&(e=null);e!==u&&Ni()!==u?("check"===r.substr(eu,5).toLowerCase()?(n=r.substr(eu,5),eu+=5):(n=u,0===au&&fu(g)),n!==u&&Ni()!==u?(o=eu,"not"===r.substr(eu,3).toLowerCase()?(a=r.substr(eu,3),eu+=3):(a=u,0===au&&fu(Y)),a!==u&&(s=Ni())!==u?("for"===r.substr(eu,3).toLowerCase()?(i=r.substr(eu,3),eu+=3):(i=u,0===au&&fu(w)),i!==u&&(c=Ni())!==u?("replication"===r.substr(eu,11).toLowerCase()?(l=r.substr(eu,11),eu+=11):(l=u,0===au&&fu(V)),l!==u&&(f=Ni())!==u?o=a=[a,s,i,c,l,f]:(eu=o,o=u)):(eu=o,o=u)):(eu=o,o=u),o===u&&(o=null),o!==u&&(a=Si())!==u&&(s=Ni())!==u&&(i=Ca())!==u&&(c=Ni())!==u&&(l=_i())!==u?(t,p=e,b=o,v=i,e={constraint_type:n.toLowerCase(),keyword:p&&p.keyword,constraint:p&&p.constraint,index_type:b&&{keyword:"not for replication"},definition:[v],resource:"constraint"},t=e):(eu=t,t=u)):(eu=t,t=u)):(eu=t,t=u);var p,b,v;return t}());return t}())===u&&(t=Eu())===u&&(t=function(){var r,t,e,n,o,a;r=eu,(t=Li())===u&&(t=Ci());t!==u&&Ni()!==u?((e=Ha())===u&&(e=null),e!==u&&Ni()!==u?((n=Yu())===u&&(n=null),n!==u&&Ni()!==u&&(o=Pu())!==u&&Ni()!==u?((a=Vu())===u&&(a=null),a!==u&&Ni()!==u?(r,s=n,i=a,t={index:e,definition:o,keyword:t.toLowerCase(),index_type:s,resource:"index",index_options:i},r=t):(eu=r,r=u)):(eu=r,r=u)):(eu=r,r=u)):(eu=r,r=u);var s,i;return r}())===u&&(t=function(){var t,e,n,o,a,s;t=eu,(e=function(){var t,e,n,o;t=eu,"fulltext"===r.substr(eu,8).toLowerCase()?(e=r.substr(eu,8),eu+=8):(e=u,0===au&&fu(Eo));e!==u?(n=eu,au++,o=qa(),au--,o===u?n=void 0:(eu=n,n=u),n!==u?(t,t=e="FULLTEXT"):(eu=t,t=u)):(eu=t,t=u);return t}())===u&&(e=function(){var t,e,n,o;t=eu,"spatial"===r.substr(eu,7).toLowerCase()?(e=r.substr(eu,7),eu+=7):(e=u,0===au&&fu(go));e!==u?(n=eu,au++,o=qa(),au--,o===u?n=void 0:(eu=n,n=u),n!==u?(t,t=e="SPATIAL"):(eu=t,t=u)):(eu=t,t=u);return t}());e!==u&&Ni()!==u?((n=Li())===u&&(n=Ci()),n===u&&(n=null),n!==u&&Ni()!==u?((o=Ha())===u&&(o=null),o!==u&&Ni()!==u&&(a=Pu())!==u&&Ni()!==u?((s=Vu())===u&&(s=null),s!==u&&Ni()!==u?(t,i=e,l=s,e={index:o,definition:a,keyword:(c=n)&&`${i.toLowerCase()} ${c.toLowerCase()}`||i.toLowerCase(),index_options:l,resource:"index"},t=e):(eu=t,t=u)):(eu=t,t=u)):(eu=t,t=u)):(eu=t,t=u);var i,c,l;return t}()),t}function Au(){var t,e,n,o,a;return t=eu,(e=function(){var t,e;t=eu,(e=function(){var t,e,n,o;t=eu,"not null"===r.substr(eu,8).toLowerCase()?(e=r.substr(eu,8),eu+=8):(e=u,0===au&&fu(ae));e!==u?(n=eu,au++,o=qa(),au--,o===u?n=void 0:(eu=n,n=u),n!==u?t=e=[e,n]:(eu=t,t=u)):(eu=t,t=u);return t}())!==u&&(t,e={type:"not null",value:"not null"});return t=e}())===u&&(e=Ja()),e!==u&&(t,(a=e)&&!a.value&&(a.value="null"),e={nullable:a}),(t=e)===u&&(t=eu,(e=function(){var r,t;r=eu,fs()!==u&&Ni()!==u?((t=Za())===u&&(t=Ca()),t!==u?(r,r={type:"default",value:t}):(eu=r,r=u)):(eu=r,r=u);return r}())!==u&&(t,e={default_val:e}),(t=e)===u&&(t=eu,"auto_increment"===r.substr(eu,14).toLowerCase()?(e=r.substr(eu,14),eu+=14):(e=u,0===au&&fu(S)),e===u&&("autoincrement"===r.substr(eu,13).toLowerCase()?(e=r.substr(eu,13),eu+=13):(e=u,0===au&&fu(_))),e!==u&&(t,e={auto_increment:e.toLowerCase()}),(t=e)===u&&(t=eu,"unique"===r.substr(eu,6).toLowerCase()?(e=r.substr(eu,6),eu+=6):(e=u,0===au&&fu(j)),e!==u&&Ni()!==u?("key"===r.substr(eu,3).toLowerCase()?(n=r.substr(eu,3),eu+=3):(n=u,0===au&&fu(x)),n===u&&(n=null),n!==u?(t,t=e=function(r){const t=["unique"];return r&&t.push(r),{unique:t.join(" ").toLowerCase("")}}(n)):(eu=t,t=u)):(eu=t,t=u),t===u&&(t=eu,"primary"===r.substr(eu,7).toLowerCase()?(e=r.substr(eu,7),eu+=7):(e=u,0===au&&fu(I)),e===u&&(e=null),e!==u&&Ni()!==u?("key"===r.substr(eu,3).toLowerCase()?(n=r.substr(eu,3),eu+=3):(n=u,0===au&&fu(x)),n!==u?(t,t=e=function(r){const t=[];return r&&t.push("primary"),t.push("key"),{primary_key:t.join(" ").toLowerCase("")}}(e)):(eu=t,t=u)):(eu=t,t=u),t===u&&(t=eu,(e=Ui())!==u&&(t,e={comment:e}),(t=e)===u&&(t=eu,(e=gu())!==u&&(t,e={collate:e}),(t=e)===u&&(t=eu,(e=function(){var t,e,n;t=eu,"column_format"===r.substr(eu,13).toLowerCase()?(e=r.substr(eu,13),eu+=13):(e=u,0===au&&fu(k));e!==u&&Ni()!==u?("fixed"===r.substr(eu,5).toLowerCase()?(n=r.substr(eu,5),eu+=5):(n=u,0===au&&fu(N)),n===u&&("dynamic"===r.substr(eu,7).toLowerCase()?(n=r.substr(eu,7),eu+=7):(n=u,0===au&&fu(R)),n===u&&("default"===r.substr(eu,7).toLowerCase()?(n=r.substr(eu,7),eu+=7):(n=u,0===au&&fu(O)))),n!==u?(t,e={type:"column_format",value:n.toLowerCase()},t=e):(eu=t,t=u)):(eu=t,t=u);return t}())!==u&&(t,e={column_format:e}),(t=e)===u&&(t=eu,(e=function(){var t,e,n;t=eu,"storage"===r.substr(eu,7).toLowerCase()?(e=r.substr(eu,7),eu+=7):(e=u,0===au&&fu(U));e!==u&&Ni()!==u?("disk"===r.substr(eu,4).toLowerCase()?(n=r.substr(eu,4),eu+=4):(n=u,0===au&&fu(M)),n===u&&("memory"===r.substr(eu,6).toLowerCase()?(n=r.substr(eu,6),eu+=6):(n=u,0===au&&fu(D))),n!==u?(t,e={type:"storage",value:n.toLowerCase()},t=e):(eu=t,t=u)):(eu=t,t=u);return t}())!==u&&(t,e={storage:e}),(t=e)===u&&(t=eu,(e=xu())!==u&&(t,e={reference_definition:e}),(t=e)===u&&(t=eu,(e=ku())!==u&&Ni()!==u?((n=mi())===u&&(n=null),n!==u&&Ni()!==u&&(o=Ga())!==u?(t,t=e=function(r,t,e){return{character_set:{type:r,value:e,symbol:t}}}(e,n,o)):(eu=t,t=u)):(eu=t,t=u))))))))))),t}function Eu(){var r,t,e,n,o,a,s;return r=eu,(t=Ma())!==u&&Ni()!==u?((e=Ki())===u&&(e=null),e!==u&&Ni()!==u?((n=function(){var r,t,e,n,o,a;if(r=eu,(t=Au())!==u)if(Ni()!==u){for(e=[],n=eu,(o=Ni())!==u&&(a=Au())!==u?n=o=[o,a]:(eu=n,n=u);n!==u;)e.push(n),n=eu,(o=Ni())!==u&&(a=Au())!==u?n=o=[o,a]:(eu=n,n=u);e!==u?(r,r=t=function(r,t){let e=r;for(let r=0;r<t.length;r++)e={...e,...t[r][1]};return e}(t,e)):(eu=r,r=u)}else eu=r,r=u;else eu=r,r=u;return r}())===u&&(n=null),n!==u?(r,o=t,a=e,s=n,ic.add(`create::${o.table}::${o.column}`),r=t={column:o,definition:a,resource:"column",...s||{}}):(eu=r,r=u)):(eu=r,r=u)):(eu=r,r=u),r}function gu(){var t,e,n;return t=eu,function(){var t,e,n,o;t=eu,"collate"===r.substr(eu,7).toLowerCase()?(e=r.substr(eu,7),eu+=7):(e=u,0===au&&fu(ar));e!==u?(n=eu,au++,o=qa(),au--,o===u?n=void 0:(eu=n,n=u),n!==u?(t,t=e="COLLATE"):(eu=t,t=u)):(eu=t,t=u);return t}()!==u&&Ni()!==u?((e=mi())===u&&(e=null),e!==u&&Ni()!==u&&(n=Ga())!==u?(t,t={type:"collate",symbol:e,value:n}):(eu=t,t=u)):(eu=t,t=u),t}function Tu(){var t;return(t=function(){var t,e,n,o;t=eu,(e=function(){var t,e,n,o;t=eu,"add"===r.substr(eu,3).toLowerCase()?(e=r.substr(eu,3),eu+=3):(e=u,0===au&&fu(Lo));e!==u?(n=eu,au++,o=qa(),au--,o===u?n=void 0:(eu=n,n=u),n!==u?(t,t=e="ADD"):(eu=t,t=u)):(eu=t,t=u);return t}())!==u&&Ni()!==u?((n=wi())===u&&(n=null),n!==u&&Ni()!==u&&(o=Eu())!==u?(t,a=n,s=o,e={action:"add",...s,keyword:a,resource:"column",type:"alter"},t=e):(eu=t,t=u)):(eu=t,t=u);var a,s;return t}())===u&&(t=function(){var r,t,e;r=eu,vs()!==u&&Ni()!==u?((t=wi())===u&&(t=null),t!==u&&Ni()!==u&&(e=Ma())!==u?(r,r={action:"drop",column:e,keyword:t,resource:"column",type:"alter"}):(eu=r,r=u)):(eu=r,r=u);return r}())===u&&(t=function(){var r,t,e,n;r=eu,(t=As())!==u&&Ni()!==u?((e=ps())===u&&(e=_s()),e===u&&(e=null),e!==u&&Ni()!==u&&(n=Pa())!==u?(r,a=n,t={action:"rename",type:"alter",resource:"table",keyword:(o=e)&&o[0].toLowerCase(),table:a},r=t):(eu=r,r=u)):(eu=r,r=u);var o,a;return r}()),t}function Su(){var t,e,n,o;return t=eu,"algorithm"===r.substr(eu,9).toLowerCase()?(e=r.substr(eu,9),eu+=9):(e=u,0===au&&fu(P)),e!==u&&Ni()!==u?((n=mi())===u&&(n=null),n!==u&&Ni()!==u?("default"===r.substr(eu,7).toLowerCase()?(o=r.substr(eu,7),eu+=7):(o=u,0===au&&fu(O)),o===u&&("instant"===r.substr(eu,7).toLowerCase()?(o=r.substr(eu,7),eu+=7):(o=u,0===au&&fu($)),o===u&&("inplace"===r.substr(eu,7).toLowerCase()?(o=r.substr(eu,7),eu+=7):(o=u,0===au&&fu(F)),o===u&&("copy"===r.substr(eu,4).toLowerCase()?(o=r.substr(eu,4),eu+=4):(o=u,0===au&&fu(H))))),o!==u?(t,t=e={type:"alter",keyword:"algorithm",resource:"algorithm",symbol:n,algorithm:o}):(eu=t,t=u)):(eu=t,t=u)):(eu=t,t=u),t}function _u(){var t,e,n,o;return t=eu,"lock"===r.substr(eu,4).toLowerCase()?(e=r.substr(eu,4),eu+=4):(e=u,0===au&&fu(B)),e!==u&&Ni()!==u?((n=mi())===u&&(n=null),n!==u&&Ni()!==u?("default"===r.substr(eu,7).toLowerCase()?(o=r.substr(eu,7),eu+=7):(o=u,0===au&&fu(O)),o===u&&("none"===r.substr(eu,4).toLowerCase()?(o=r.substr(eu,4),eu+=4):(o=u,0===au&&fu(G)),o===u&&("shared"===r.substr(eu,6).toLowerCase()?(o=r.substr(eu,6),eu+=6):(o=u,0===au&&fu(q)),o===u&&("exclusive"===r.substr(eu,9).toLowerCase()?(o=r.substr(eu,9),eu+=9):(o=u,0===au&&fu(W))))),o!==u?(t,t=e={type:"alter",keyword:"lock",resource:"lock",symbol:n,lock:o}):(eu=t,t=u)):(eu=t,t=u)):(eu=t,t=u),t}function ju(){var t,e,n,o;return t=eu,(e=function(){var t,e,n,o;t=eu,"constraint"===r.substr(eu,10).toLowerCase()?(e=r.substr(eu,10),eu+=10):(e=u,0===au&&fu(So));e!==u?(n=eu,au++,o=qa(),au--,o===u?n=void 0:(eu=n,n=u),n!==u?(t,t=e="CONSTRAINT"):(eu=t,t=u)):(eu=t,t=u);return t}())!==u&&Ni()!==u?((n=Pa())===u&&(n=null),n!==u?(t,o=n,t=e={keyword:e.toLowerCase(),constraint:o}):(eu=t,t=u)):(eu=t,t=u),t}function xu(){var t,e,n,o,a,s,i,c,l,f;return t=eu,(e=function(){var t,e,n,o;t=eu,"references"===r.substr(eu,10).toLowerCase()?(e=r.substr(eu,10),eu+=10):(e=u,0===au&&fu(_o));e!==u?(n=eu,au++,o=qa(),au--,o===u?n=void 0:(eu=n,n=u),n!==u?(t,t=e="REFERENCES"):(eu=t,t=u)):(eu=t,t=u);return t}())!==u&&Ni()!==u&&(n=Qu())!==u&&Ni()!==u&&(o=Pu())!==u&&Ni()!==u?("match full"===r.substr(eu,10).toLowerCase()?(a=r.substr(eu,10),eu+=10):(a=u,0===au&&fu(Q)),a===u&&("match partial"===r.substr(eu,13).toLowerCase()?(a=r.substr(eu,13),eu+=13):(a=u,0===au&&fu(K)),a===u&&("match simple"===r.substr(eu,12).toLowerCase()?(a=r.substr(eu,12),eu+=12):(a=u,0===au&&fu(z)))),a===u&&(a=null),a!==u&&Ni()!==u?((s=Iu())===u&&(s=null),s!==u&&Ni()!==u?((i=Iu())===u&&(i=null),i!==u?(t,c=a,l=s,f=i,t=e={definition:o,table:n,keyword:e.toLowerCase(),match:c&&c.toLowerCase(),on_action:[l,f].filter(r=>r)}):(eu=t,t=u)):(eu=t,t=u)):(eu=t,t=u)):(eu=t,t=u),t===u&&(t=eu,(e=Iu())!==u&&(t,e={on_action:[e]}),t=e),t}function Iu(){var t,e,n,o;return t=eu,ks()!==u&&Ni()!==u?((e=ws())===u&&(e=ds()),e!==u&&Ni()!==u&&(n=function(){var t,e,n;t=eu,(e=di())!==u&&Ni()!==u&&Si()!==u&&Ni()!==u?((n=da())===u&&(n=null),n!==u&&Ni()!==u&&_i()!==u?(t,t=e={type:"function",name:e,args:n}):(eu=t,t=u)):(eu=t,t=u);t===u&&(t=eu,"restrict"===r.substr(eu,8).toLowerCase()?(e=r.substr(eu,8),eu+=8):(e=u,0===au&&fu(Z)),e===u&&("cascade"===r.substr(eu,7).toLowerCase()?(e=r.substr(eu,7),eu+=7):(e=u,0===au&&fu(J)),e===u&&("set null"===r.substr(eu,8).toLowerCase()?(e=r.substr(eu,8),eu+=8):(e=u,0===au&&fu(rr)),e===u&&("no action"===r.substr(eu,9).toLowerCase()?(e=r.substr(eu,9),eu+=9):(e=u,0===au&&fu(tr)),e===u&&("set default"===r.substr(eu,11).toLowerCase()?(e=r.substr(eu,11),eu+=11):(e=u,0===au&&fu(er)),e===u&&(e=di()))))),e!==u&&(t,e={type:"origin",value:e.toLowerCase()}),t=e);return t}())!==u?(t,o=n,t={type:"on "+e[0].toLowerCase(),value:o}):(eu=t,t=u)):(eu=t,t=u),t}function ku(){var t,e,n;return t=eu,"character"===r.substr(eu,9).toLowerCase()?(e=r.substr(eu,9),eu+=9):(e=u,0===au&&fu(nr)),e!==u&&Ni()!==u?("set"===r.substr(eu,3).toLowerCase()?(n=r.substr(eu,3),eu+=3):(n=u,0===au&&fu(or)),n!==u?(t,t=e="CHARACTER SET"):(eu=t,t=u)):(eu=t,t=u),t}function Nu(){var t,e,n,o,a,s,i,c,l;return t=eu,(e=fs())===u&&(e=null),e!==u&&Ni()!==u?((n=ku())===u&&("charset"===r.substr(eu,7).toLowerCase()?(n=r.substr(eu,7),eu+=7):(n=u,0===au&&fu(ur)),n===u&&("collate"===r.substr(eu,7).toLowerCase()?(n=r.substr(eu,7),eu+=7):(n=u,0===au&&fu(ar)))),n!==u&&Ni()!==u?((o=mi())===u&&(o=null),o!==u&&Ni()!==u&&(a=Ga())!==u?(t,i=n,c=o,l=a,t=e={keyword:(s=e)&&`${s[0].toLowerCase()} ${i.toLowerCase()}`||i.toLowerCase(),symbol:c,value:l}):(eu=t,t=u)):(eu=t,t=u)):(eu=t,t=u),t}function Ru(){var t,e,n,o,a,s,i,c,l;return t=eu,"auto_increment"===r.substr(eu,14).toLowerCase()?(e=r.substr(eu,14),eu+=14):(e=u,0===au&&fu(S)),e===u&&("avg_row_length"===r.substr(eu,14).toLowerCase()?(e=r.substr(eu,14),eu+=14):(e=u,0===au&&fu(sr)),e===u&&("key_block_size"===r.substr(eu,14).toLowerCase()?(e=r.substr(eu,14),eu+=14):(e=u,0===au&&fu(ir)),e===u&&("max_rows"===r.substr(eu,8).toLowerCase()?(e=r.substr(eu,8),eu+=8):(e=u,0===au&&fu(cr)),e===u&&("min_rows"===r.substr(eu,8).toLowerCase()?(e=r.substr(eu,8),eu+=8):(e=u,0===au&&fu(lr)),e===u&&("stats_sample_pages"===r.substr(eu,18).toLowerCase()?(e=r.substr(eu,18),eu+=18):(e=u,0===au&&fu(fr))))))),e!==u&&Ni()!==u?((n=mi())===u&&(n=null),n!==u&&Ni()!==u&&(o=os())!==u?(t,c=n,l=o,t=e={keyword:e.toLowerCase(),symbol:c,value:l.value}):(eu=t,t=u)):(eu=t,t=u),t===u&&(t=Nu())===u&&(t=eu,(e=Ai())===u&&("connection"===r.substr(eu,10).toLowerCase()?(e=r.substr(eu,10),eu+=10):(e=u,0===au&&fu(pr))),e!==u&&Ni()!==u?((n=mi())===u&&(n=null),n!==u&&Ni()!==u&&(o=rs())!==u?(t,t=e=function(r,t,e){return{keyword:r.toLowerCase(),symbol:t,value:`'${e.value}'`}}(e,n,o)):(eu=t,t=u)):(eu=t,t=u),t===u&&(t=eu,"compression"===r.substr(eu,11).toLowerCase()?(e=r.substr(eu,11),eu+=11):(e=u,0===au&&fu(br)),e!==u&&Ni()!==u?((n=mi())===u&&(n=null),n!==u&&Ni()!==u?(o=eu,39===r.charCodeAt(eu)?(a="'",eu++):(a=u,0===au&&fu(vr)),a!==u?("zlib"===r.substr(eu,4).toLowerCase()?(s=r.substr(eu,4),eu+=4):(s=u,0===au&&fu(dr)),s===u&&("lz4"===r.substr(eu,3).toLowerCase()?(s=r.substr(eu,3),eu+=3):(s=u,0===au&&fu(yr)),s===u&&("none"===r.substr(eu,4).toLowerCase()?(s=r.substr(eu,4),eu+=4):(s=u,0===au&&fu(G)))),s!==u?(39===r.charCodeAt(eu)?(i="'",eu++):(i=u,0===au&&fu(vr)),i!==u?o=a=[a,s,i]:(eu=o,o=u)):(eu=o,o=u)):(eu=o,o=u),o!==u?(t,t=e=function(r,t,e){return{keyword:r.toLowerCase(),symbol:t,value:e.join("").toUpperCase()}}(e,n,o)):(eu=t,t=u)):(eu=t,t=u)):(eu=t,t=u),t===u&&(t=eu,"engine"===r.substr(eu,6).toLowerCase()?(e=r.substr(eu,6),eu+=6):(e=u,0===au&&fu(hr)),e!==u&&Ni()!==u?((n=mi())===u&&(n=null),n!==u&&Ni()!==u&&(o=Ga())!==u?(t,t=e=function(r,t,e){return{keyword:r.toLowerCase(),symbol:t,value:e.toUpperCase()}}(e,n,o)):(eu=t,t=u)):(eu=t,t=u)))),t}function Ou(){var t,e,n,o,a;return t=eu,(e=zu())!==u&&Ni()!==u&&(n=function(){var t,e,n;return t=eu,"read"===r.substr(eu,4).toLowerCase()?(e=r.substr(eu,4),eu+=4):(e=u,0===au&&fu(mr)),e!==u&&Ni()!==u?("local"===r.substr(eu,5).toLowerCase()?(n=r.substr(eu,5),eu+=5):(n=u,0===au&&fu(E)),n===u&&(n=null),n!==u?(t,t=e={type:"read",suffix:n&&"local"}):(eu=t,t=u)):(eu=t,t=u),t===u&&(t=eu,"low_priority"===r.substr(eu,12).toLowerCase()?(e=r.substr(eu,12),eu+=12):(e=u,0===au&&fu(wr)),e===u&&(e=null),e!==u&&Ni()!==u?("write"===r.substr(eu,5).toLowerCase()?(n=r.substr(eu,5),eu+=5):(n=u,0===au&&fu(Lr)),n!==u?(t,t=e={type:"write",prefix:e&&"low_priority"}):(eu=t,t=u)):(eu=t,t=u)),t}())!==u?(t,o=e,a=n,sc.add(`lock::${o.db}::${o.table}`),t=e={table:o,lock_type:a}):(eu=t,t=u),t}function Uu(){var t,e,n,o,a,s,i;return(t=$u())===u&&(t=eu,e=eu,40===r.charCodeAt(eu)?(n="(",eu++):(n=u,0===au&&fu(xr)),n!==u&&(o=Ni())!==u&&(a=Uu())!==u&&(s=Ni())!==u?(41===r.charCodeAt(eu)?(i=")",eu++):(i=u,0===au&&fu(Ir)),i!==u?e=n=[n,o,a,s,i]:(eu=e,e=u)):(eu=e,e=u),e!==u&&(t,e={...e[2],parentheses_symbol:!0}),t=e),t}function Mu(){var t,e,n,o,a,s,i,c,l;if(t=eu,Us()!==u)if(Ni()!==u)if((e=Du())!==u){for(n=[],o=eu,(a=Ni())!==u&&(s=gi())!==u&&(i=Ni())!==u&&(c=Du())!==u?o=a=[a,s,i,c]:(eu=o,o=u);o!==u;)n.push(o),o=eu,(a=Ni())!==u&&(s=gi())!==u&&(i=Ni())!==u&&(c=Du())!==u?o=a=[a,s,i,c]:(eu=o,o=u);n!==u?(t,t=T(e,n)):(eu=t,t=u)}else eu=t,t=u;else eu=t,t=u;else eu=t,t=u;return t===u&&(t=eu,Ni()!==u&&Us()!==u&&(e=Ni())!==u&&(n=function(){var t,e,n,o;t=eu,"RECURSIVE"===r.substr(eu,9)?(e="RECURSIVE",eu+=9):(e=u,0===au&&fu(Ce));e!==u?(n=eu,au++,o=qa(),au--,o===u?n=void 0:(eu=n,n=u),n!==u?t=e=[e,n]:(eu=t,t=u)):(eu=t,t=u);return t}())!==u&&(o=Ni())!==u&&(a=Du())!==u?(t,(l=a).recursive=!0,t=[l]):(eu=t,t=u)),t}function Du(){var r,t,e,n,o,a,s;return r=eu,(t=rs())===u&&(t=Ga())===u&&(t=Ju()),t!==u&&Ni()!==u?((e=Pu())===u&&(e=null),e!==u&&Ni()!==u&&_s()!==u&&Ni()!==u&&Si()!==u&&Ni()!==u&&(n=mu())!==u&&Ni()!==u&&_i()!==u?(r,a=e,s=n,"string"==typeof(o=t)&&(o={type:"default",value:o}),o.table&&(o={type:"default",value:o.table}),r=t={name:o,stmt:s,columns:a}):(eu=r,r=u)):(eu=r,r=u),r}function Pu(){var r,t;return r=eu,Si()!==u&&Ni()!==u&&(t=function(){var r;(r=na())===u&&(r=function(){var r,t,e,n,o,a,s,i;if(r=eu,(t=Za())!==u){for(e=[],n=eu,(o=Ni())!==u&&(a=gi())!==u&&(s=Ni())!==u&&(i=Za())!==u?n=o=[o,a,s,i]:(eu=n,n=u);n!==u;)e.push(n),n=eu,(o=Ni())!==u&&(a=gi())!==u&&(s=Ni())!==u&&(i=Za())!==u?n=o=[o,a,s,i]:(eu=n,n=u);e!==u?(r,t=T(t,e),r=t):(eu=r,r=u)}else eu=r,r=u;return r}());return r}())!==u&&Ni()!==u&&_i()!==u?(r,r=t):(eu=r,r=u),r}function $u(){var t,e,n,o,a,s,i,c,l,f,p,b,v,d,y,h,m,L,C,A,E,g,T,S,_,j;return t=eu,Ni()!==u?((e=Mu())===u&&(e=null),e!==u&&Ni()!==u&&function(){var t,e,n,o;t=eu,"select"===r.substr(eu,6).toLowerCase()?(e=r.substr(eu,6),eu+=6):(e=u,0===au&&fu(ve));e!==u?(n=eu,au++,o=qa(),au--,o===u?n=void 0:(eu=n,n=u),n!==u?t=e=[e,n]:(eu=t,t=u)):(eu=t,t=u);return t}()!==u&&Ri()!==u?((n=function(){var r,t,e,n,o,a;if(r=eu,(t=Fu())!==u){for(e=[],n=eu,(o=Ni())!==u&&(a=Fu())!==u?n=o=[o,a]:(eu=n,n=u);n!==u;)e.push(n),n=eu,(o=Ni())!==u&&(a=Fu())!==u?n=o=[o,a]:(eu=n,n=u);e!==u?(r,t=function(r,t){const e=[r];for(let r=0,n=t.length;r<n;++r)e.push(t[r][1]);return e}(t,e),r=t):(eu=r,r=u)}else eu=r,r=u;return r}())===u&&(n=null),n!==u&&Ni()!==u?((o=$s())===u&&(o=null),o!==u&&Ni()!==u&&(a=Hu())!==u&&Ni()!==u?((s=qu())===u&&(s=null),s!==u&&Ni()!==u?((i=ea())===u&&(i=null),i!==u&&Ni()!==u?((c=function(){var t,e,n;t=eu,(e=function(){var t,e,n,o;t=eu,"group"===r.substr(eu,5).toLowerCase()?(e=r.substr(eu,5),eu+=5):(e=u,0===au&&fu(Ge));e!==u?(n=eu,au++,o=qa(),au--,o===u?n=void 0:(eu=n,n=u),n!==u?t=e=[e,n]:(eu=t,t=u)):(eu=t,t=u);return t}())!==u&&Ni()!==u&&Ms()!==u&&Ni()!==u&&(n=da())!==u?(t,e=n.value,t=e):(eu=t,t=u);return t}())===u&&(c=null),c!==u&&Ni()!==u?((l=function(){var t,e;t=eu,function(){var t,e,n,o;t=eu,"having"===r.substr(eu,6).toLowerCase()?(e=r.substr(eu,6),eu+=6):(e=u,0===au&&fu(Ye));e!==u?(n=eu,au++,o=qa(),au--,o===u?n=void 0:(eu=n,n=u),n!==u?t=e=[e,n]:(eu=t,t=u)):(eu=t,t=u);return t}()!==u&&Ni()!==u&&(e=Aa())!==u?(t,t=e):(eu=t,t=u);return t}())===u&&(l=null),l!==u&&Ni()!==u?((f=oa())===u&&(f=null),f!==u&&Ni()!==u?((p=sa())===u&&(p=null),p!==u?(b=eu,"for"===r.substr(eu,3).toLowerCase()?(v=r.substr(eu,3),eu+=3):(v=u,0===au&&fu(w)),v!==u&&(d=Ni())!==u&&(y=ds())!==u?b=v=[v,d,y]:(eu=b,b=u),b===u&&(b=null),b!==u?(t,h=e,m=n,L=o,C=a,E=i,g=c,T=l,S=f,_=p,j=b,(A=s)&&A.forEach(r=>r.table&&sc.add(`select::${r.db}::${r.table}`)),t={with:h,type:"select",options:m,distinct:L,columns:C,from:A,where:E,groupby:g,having:T,orderby:S,limit:_,for_update:j&&`${j[0]} ${j[2][0]}`}):(eu=t,t=u)):(eu=t,t=u)):(eu=t,t=u)):(eu=t,t=u)):(eu=t,t=u)):(eu=t,t=u)):(eu=t,t=u)):(eu=t,t=u)):(eu=t,t=u)):(eu=t,t=u)):(eu=t,t=u),t}function Fu(){var t,e;return t=eu,(e=function(){var t;"sql_calc_found_rows"===r.substr(eu,19).toLowerCase()?(t=r.substr(eu,19),eu+=19):(t=u,0===au&&fu(jo));return t}())===u&&((e=function(){var t;"sql_cache"===r.substr(eu,9).toLowerCase()?(t=r.substr(eu,9),eu+=9):(t=u,0===au&&fu(xo));return t}())===u&&(e=function(){var t;"sql_no_cache"===r.substr(eu,12).toLowerCase()?(t=r.substr(eu,12),eu+=12):(t=u,0===au&&fu(Io));return t}()),e===u&&(e=function(){var t;"sql_big_result"===r.substr(eu,14).toLowerCase()?(t=r.substr(eu,14),eu+=14):(t=u,0===au&&fu(No));return t}())===u&&(e=function(){var t;"sql_small_result"===r.substr(eu,16).toLowerCase()?(t=r.substr(eu,16),eu+=16):(t=u,0===au&&fu(ko));return t}())===u&&(e=function(){var t;"sql_buffer_result"===r.substr(eu,17).toLowerCase()?(t=r.substr(eu,17),eu+=17):(t=u,0===au&&fu(Ro));return t}())),e!==u&&(t,e=e),t=e}function Hu(){var r,t,e,n,o,a,s,i;if(r=eu,(t=Ps())===u&&(t=eu,(e=Ti())!==u?(n=eu,au++,o=qa(),au--,o===u?n=void 0:(eu=n,n=u),n!==u?t=e=[e,n]:(eu=t,t=u)):(eu=t,t=u),t===u&&(t=Ti())),t!==u){for(e=[],n=eu,(o=Ni())!==u&&(a=gi())!==u&&(s=Ni())!==u&&(i=Bu())!==u?n=o=[o,a,s,i]:(eu=n,n=u);n!==u;)e.push(n),n=eu,(o=Ni())!==u&&(a=gi())!==u&&(s=Ni())!==u&&(i=Bu())!==u?n=o=[o,a,s,i]:(eu=n,n=u);e!==u?(r,r=t=function(r,t){ic.add("select::null::(.*)");const e={expr:{type:"column_ref",table:null,column:"*"},as:null};return t&&t.length>0?ec(e,t):[e]}(0,e)):(eu=r,r=u)}else eu=r,r=u;if(r===u)if(r=eu,(t=Bu())!==u){for(e=[],n=eu,(o=Ni())!==u&&(a=gi())!==u&&(s=Ni())!==u&&(i=Bu())!==u?n=o=[o,a,s,i]:(eu=n,n=u);n!==u;)e.push(n),n=eu,(o=Ni())!==u&&(a=gi())!==u&&(s=Ni())!==u&&(i=Bu())!==u?n=o=[o,a,s,i]:(eu=n,n=u);e!==u?(r,r=t=T(t,e)):(eu=r,r=u)}else eu=r,r=u;return r}function Bu(){var r,t,e,n,o;return r=eu,t=eu,(e=Pa())!==u&&(n=Ni())!==u&&(o=Ei())!==u?t=e=[e,n,o]:(eu=t,t=u),t===u&&(t=null),t!==u&&(e=Ni())!==u&&(n=Ti())!==u?(r,r=t=function(r){const t=r&&r[0]||null;return ic.add(`select::${t}::(.*)`),{expr:{type:"column_ref",table:t,column:"*"},as:null}}(t)):(eu=r,r=u),r===u&&(r=eu,(t=function(){var r,t,e,n,o,a,s,i;if(r=eu,(t=Ca())!==u){for(e=[],n=eu,(o=Ni())!==u?((a=Ys())===u&&(a=Vs())===u&&(a=ki()),a!==u&&(s=Ni())!==u&&(i=Ca())!==u?n=o=[o,a,s,i]:(eu=n,n=u)):(eu=n,n=u);n!==u;)e.push(n),n=eu,(o=Ni())!==u?((a=Ys())===u&&(a=Vs())===u&&(a=ki()),a!==u&&(s=Ni())!==u&&(i=Ca())!==u?n=o=[o,a,s,i]:(eu=n,n=u)):(eu=n,n=u);e!==u?(r,t=function(r,t){const e=r.ast;if(e&&"select"===e.type&&(!(r.parentheses_symbol||r.parentheses||r.ast.parentheses||r.ast.parentheses_symbol)||1!==e.columns.length||"*"===e.columns[0].expr.column))throw new Error("invalid column clause with select statement");if(!t||0===t.length)return r;const n=t.length;let o=t[n-1][3];for(let e=n-1;e>=0;e--){const n=0===e?r:t[e-1][3];o=rc(t[e][1],n,o)}return o}(t,e),r=t):(eu=r,r=u)}else eu=r,r=u;return r}())!==u&&(e=Ni())!==u?((n=Gu())===u&&(n=null),n!==u?(r,r=t={expr:t,as:n}):(eu=r,r=u)):(eu=r,r=u)),r}function Gu(){var r,t,e;return r=eu,(t=_s())!==u&&Ri()!==u&&(e=function(){var r,t;r=eu,(t=Ga())!==u?(eu,(function(r){if(!0===Zi[r.toUpperCase()])throw new Error("Error: "+JSON.stringify(r)+" is a reserved word, can not as alias clause");return!1}(t)?u:void 0)!==u?(r,r=t=t):(eu=r,r=u)):(eu=r,r=u);r===u&&(r=eu,(t=$a())!==u&&(r,t=t),r=t);return r}())!==u?(r,r=t=e):(eu=r,r=u),r===u&&(r=eu,(t=_s())===u&&(t=null),t!==u&&Ni()!==u&&(e=Pa())!==u?(r,r=t=e):(eu=r,r=u)),r}function qu(){var t,e;return t=eu,function(){var t,e,n,o;t=eu,"from"===r.substr(eu,4).toLowerCase()?(e=r.substr(eu,4),eu+=4):(e=u,0===au&&fu(_e));e!==u?(n=eu,au++,o=qa(),au--,o===u?n=void 0:(eu=n,n=u),n!==u?t=e=[e,n]:(eu=t,t=u)):(eu=t,t=u);return t}()!==u&&Ni()!==u&&(e=Qu())!==u?(t,t=e):(eu=t,t=u),t}function Wu(){var r,t,e;return r=eu,(t=Ju())!==u&&Ni()!==u&&ps()!==u&&Ni()!==u&&(e=Ju())!==u?(r,r=t=[t,e]):(eu=r,r=u),r}function Yu(){var t,e;return t=eu,Os()!==u&&Ni()!==u?("btree"===r.substr(eu,5).toLowerCase()?(e=r.substr(eu,5),eu+=5):(e=u,0===au&&fu(kr)),e===u&&("hash"===r.substr(eu,4).toLowerCase()?(e=r.substr(eu,4),eu+=4):(e=u,0===au&&fu(Nr))),e!==u?(t,t={keyword:"using",type:e.toLowerCase()}):(eu=t,t=u)):(eu=t,t=u),t}function Vu(){var r,t,e,n,o,a;if(r=eu,(t=Xu())!==u){for(e=[],n=eu,(o=Ni())!==u&&(a=Xu())!==u?n=o=[o,a]:(eu=n,n=u);n!==u;)e.push(n),n=eu,(o=Ni())!==u&&(a=Xu())!==u?n=o=[o,a]:(eu=n,n=u);e!==u?(r,r=t=function(r,t){const e=[r];for(let r=0;r<t.length;r++)e.push(t[r][1]);return e}(t,e)):(eu=r,r=u)}else eu=r,r=u;return r}function Xu(){var t,e,n,o,a,s;return t=eu,(e=function(){var t,e,n,o;t=eu,"key_block_size"===r.substr(eu,14).toLowerCase()?(e=r.substr(eu,14),eu+=14):(e=u,0===au&&fu(ir));e!==u?(n=eu,au++,o=qa(),au--,o===u?n=void 0:(eu=n,n=u),n!==u?(t,t=e="KEY_BLOCK_SIZE"):(eu=t,t=u)):(eu=t,t=u);return t}())!==u&&Ni()!==u?((n=mi())===u&&(n=null),n!==u&&Ni()!==u&&(o=os())!==u?(t,a=n,s=o,t=e={type:e.toLowerCase(),symbol:a,expr:s}):(eu=t,t=u)):(eu=t,t=u),t===u&&(t=Yu())===u&&(t=eu,"with"===r.substr(eu,4).toLowerCase()?(e=r.substr(eu,4),eu+=4):(e=u,0===au&&fu(Rr)),e!==u&&Ni()!==u?("parser"===r.substr(eu,6).toLowerCase()?(n=r.substr(eu,6),eu+=6):(n=u,0===au&&fu(Or)),n!==u&&Ni()!==u&&(o=Ga())!==u?(t,t=e={type:"with parser",expr:o}):(eu=t,t=u)):(eu=t,t=u),t===u&&(t=eu,"visible"===r.substr(eu,7).toLowerCase()?(e=r.substr(eu,7),eu+=7):(e=u,0===au&&fu(Ur)),e===u&&("invisible"===r.substr(eu,9).toLowerCase()?(e=r.substr(eu,9),eu+=9):(e=u,0===au&&fu(Mr))),e!==u&&(t,e=function(r){return{type:r.toLowerCase(),expr:r.toLowerCase()}}(e)),(t=e)===u&&(t=Ui()))),t}function Qu(){var r,t,e,n;if(r=eu,(t=zu())!==u){for(e=[],n=Ku();n!==u;)e.push(n),n=Ku();e!==u?(r,r=t=Dr(t,e)):(eu=r,r=u)}else eu=r,r=u;return r}function Ku(){var r,t,e;return r=eu,Ni()!==u&&(t=gi())!==u&&Ni()!==u&&(e=zu())!==u?(r,r=e):(eu=r,r=u),r===u&&(r=eu,Ni()!==u&&(t=function(){var r,t,e,n,o,a,s,i,c,l,f;if(r=eu,(t=Zu())!==u)if(Ni()!==u)if((e=zu())!==u)if(Ni()!==u)if((n=Os())!==u)if(Ni()!==u)if(Si()!==u)if(Ni()!==u)if((o=Ga())!==u){for(a=[],s=eu,(i=Ni())!==u&&(c=gi())!==u&&(l=Ni())!==u&&(f=Ga())!==u?s=i=[i,c,l,f]:(eu=s,s=u);s!==u;)a.push(s),s=eu,(i=Ni())!==u&&(c=gi())!==u&&(l=Ni())!==u&&(f=Ga())!==u?s=i=[i,c,l,f]:(eu=s,s=u);a!==u&&(s=Ni())!==u&&(i=_i())!==u?(r,p=t,v=o,d=a,(b=e).join=p,b.using=ec(v,d),r=t=b):(eu=r,r=u)}else eu=r,r=u;else eu=r,r=u;else eu=r,r=u;else eu=r,r=u;else eu=r,r=u;else eu=r,r=u;else eu=r,r=u;else eu=r,r=u;else eu=r,r=u;var p,b,v,d;r===u&&(r=eu,(t=Zu())!==u&&Ni()!==u&&(e=zu())!==u&&Ni()!==u?((n=ta())===u&&(n=null),n!==u?(r,t=function(r,t,e){return t.join=r,t.on=e,t}(t,e,n),r=t):(eu=r,r=u)):(eu=r,r=u),r===u&&(r=eu,(t=Zu())!==u&&Ni()!==u&&(e=Si())!==u&&Ni()!==u&&(n=mu())!==u&&Ni()!==u&&_i()!==u&&Ni()!==u?((o=Gu())===u&&(o=null),o!==u&&(a=Ni())!==u?((s=ta())===u&&(s=null),s!==u?(r,t=function(r,t,e,n){return t.parentheses=!0,{expr:t,as:e,join:r,on:n}}(t,n,o,s),r=t):(eu=r,r=u)):(eu=r,r=u)):(eu=r,r=u)));return r}())!==u?(r,r=t):(eu=r,r=u)),r}function zu(){var t,e,n,o,a,s;return t=eu,(e=function(){var t;"dual"===r.substr(eu,4).toLowerCase()?(t=r.substr(eu,4),eu+=4):(t=u,0===au&&fu(wo));return t}())!==u&&(t,e={type:"dual"}),(t=e)===u&&(t=eu,(e=Ga())!==u&&Ni()!==u&&(n=Si())!==u&&Ni()!==u&&(o=da())!==u&&Ni()!==u&&(a=_i())!==u&&Ni()!==u?((s=Gu())===u&&(s=null),s!==u?(t,t=e={expr:{type:"function",name:e,args:o},as:s}):(eu=t,t=u)):(eu=t,t=u),t===u&&(t=eu,(e=Ju())!==u&&Ni()!==u?((n=Gu())===u&&(n=null),n!==u?(t,t=e=function(r,t){return"var"===r.type?(r.as=t,r):{db:r.db,table:r.table,as:t}}(e,n)):(eu=t,t=u)):(eu=t,t=u),t===u&&(t=eu,(e=Si())!==u&&Ni()!==u&&(n=mu())!==u&&Ni()!==u&&(o=_i())!==u&&Ni()!==u?((a=Gu())===u&&(a=null),a!==u?(t,t=e=function(r,t){return r.parentheses=!0,{expr:r,as:t}}(n,a)):(eu=t,t=u)):(eu=t,t=u)))),t}function Zu(){var t,e,n,o;return t=eu,(e=function(){var t,e,n,o;t=eu,"left"===r.substr(eu,4).toLowerCase()?(e=r.substr(eu,4),eu+=4):(e=u,0===au&&fu(Oe));e!==u?(n=eu,au++,o=qa(),au--,o===u?n=void 0:(eu=n,n=u),n!==u?t=e=[e,n]:(eu=t,t=u)):(eu=t,t=u);return t}())!==u&&(n=Ni())!==u?((o=function(){var t,e,n,o;t=eu,"outer"===r.substr(eu,5).toLowerCase()?(e=r.substr(eu,5),eu+=5):(e=u,0===au&&fu(De));e!==u?(n=eu,au++,o=qa(),au--,o===u?n=void 0:(eu=n,n=u),n!==u?t=e=[e,n]:(eu=t,t=u)):(eu=t,t=u);return t}())===u&&(o=null),o!==u&&Ni()!==u&&Ns()!==u?(t,t=e="LEFT JOIN"):(eu=t,t=u)):(eu=t,t=u),t===u&&(t=eu,e=eu,(n=function(){var t,e,n,o;t=eu,"inner"===r.substr(eu,5).toLowerCase()?(e=r.substr(eu,5),eu+=5):(e=u,0===au&&fu(Ue));e!==u?(n=eu,au++,o=qa(),au--,o===u?n=void 0:(eu=n,n=u),n!==u?t=e=[e,n]:(eu=t,t=u)):(eu=t,t=u);return t}())!==u&&(o=Ni())!==u?e=n=[n,o]:(eu=e,e=u),e===u&&(e=null),e!==u&&(n=Ns())!==u?(t,t=e="INNER JOIN"):(eu=t,t=u)),t}function Ju(){var r,t,e,n,o,a,s,i;return r=eu,(t=Pa())!==u?(e=eu,(n=Ni())!==u&&(o=Ei())!==u&&(a=Ni())!==u&&(s=Pa())!==u?e=n=[n,o,a,s]:(eu=e,e=u),e===u&&(e=null),e!==u?(r,r=t=function(r,t){const e={db:null,table:r};return null!==t&&(e.db=r,e.table=t[3]),e}(t,e)):(eu=r,r=u)):(eu=r,r=u),r===u&&(r=eu,(t=Xi())!==u&&(r,(i=t).db=null,i.table=i.name,t=i),r=t),r}function ra(){var r,t,e,n,o,a,s,i;if(r=eu,(t=Ca())!==u){for(e=[],n=eu,(o=Ni())!==u?((a=Ys())===u&&(a=Vs()),a!==u&&(s=Ni())!==u&&(i=Ca())!==u?n=o=[o,a,s,i]:(eu=n,n=u)):(eu=n,n=u);n!==u;)e.push(n),n=eu,(o=Ni())!==u?((a=Ys())===u&&(a=Vs()),a!==u&&(s=Ni())!==u&&(i=Ca())!==u?n=o=[o,a,s,i]:(eu=n,n=u)):(eu=n,n=u);e!==u?(r,r=t=function(r,t){const e=t.length;let n=r;for(let r=0;r<e;++r)n=rc(t[r][1],n,t[r][3]);return n}(t,e)):(eu=r,r=u)}else eu=r,r=u;return r}function ta(){var r,t;return r=eu,ks()!==u&&Ni()!==u&&(t=Aa())!==u?(r,r=t):(eu=r,r=u),r}function ea(){var t,e;return t=eu,function(){var t,e,n,o;t=eu,"where"===r.substr(eu,5).toLowerCase()?(e=r.substr(eu,5),eu+=5):(e=u,0===au&&fu(Be));e!==u?(n=eu,au++,o=qa(),au--,o===u?n=void 0:(eu=n,n=u),n!==u?t=e=[e,n]:(eu=t,t=u)):(eu=t,t=u);return t}()!==u&&Ni()!==u&&(e=Aa())!==u?(t,t=e):(eu=t,t=u),t}function na(){var r,t,e,n,o,a,s,i;if(r=eu,(t=Ma())!==u){for(e=[],n=eu,(o=Ni())!==u&&(a=gi())!==u&&(s=Ni())!==u&&(i=Ma())!==u?n=o=[o,a,s,i]:(eu=n,n=u);n!==u;)e.push(n),n=eu,(o=Ni())!==u&&(a=gi())!==u&&(s=Ni())!==u&&(i=Ma())!==u?n=o=[o,a,s,i]:(eu=n,n=u);e!==u?(r,r=t=T(t,e)):(eu=r,r=u)}else eu=r,r=u;return r}function oa(){var t,e;return t=eu,function(){var t,e,n,o;t=eu,"order"===r.substr(eu,5).toLowerCase()?(e=r.substr(eu,5),eu+=5):(e=u,0===au&&fu(We));e!==u?(n=eu,au++,o=qa(),au--,o===u?n=void 0:(eu=n,n=u),n!==u?t=e=[e,n]:(eu=t,t=u)):(eu=t,t=u);return t}()!==u&&Ni()!==u&&Ms()!==u&&Ni()!==u&&(e=function(){var r,t,e,n,o,a,s,i;if(r=eu,(t=ua())!==u){for(e=[],n=eu,(o=Ni())!==u&&(a=gi())!==u&&(s=Ni())!==u&&(i=ua())!==u?n=o=[o,a,s,i]:(eu=n,n=u);n!==u;)e.push(n),n=eu,(o=Ni())!==u&&(a=gi())!==u&&(s=Ni())!==u&&(i=ua())!==u?n=o=[o,a,s,i]:(eu=n,n=u);e!==u?(r,t=T(t,e),r=t):(eu=r,r=u)}else eu=r,r=u;return r}())!==u?(t,t=e):(eu=t,t=u),t}function ua(){var t,e,n;return t=eu,(e=Ca())!==u&&Ni()!==u?((n=Ds())===u&&(n=function(){var t,e,n,o;t=eu,"asc"===r.substr(eu,3).toLowerCase()?(e=r.substr(eu,3),eu+=3):(e=u,0===au&&fu(Qe));e!==u?(n=eu,au++,o=qa(),au--,o===u?n=void 0:(eu=n,n=u),n!==u?(t,t=e="ASC"):(eu=t,t=u)):(eu=t,t=u);return t}()),n===u&&(n=null),n!==u?(t,t=e={expr:e,type:n}):(eu=t,t=u)):(eu=t,t=u),t}function aa(){var r;return(r=os())===u&&(r=Va()),r}function sa(){var t,e,n,o,a,s;return t=eu,function(){var t,e,n,o;t=eu,"limit"===r.substr(eu,5).toLowerCase()?(e=r.substr(eu,5),eu+=5):(e=u,0===au&&fu(Ve));e!==u?(n=eu,au++,o=qa(),au--,o===u?n=void 0:(eu=n,n=u),n!==u?t=e=[e,n]:(eu=t,t=u)):(eu=t,t=u);return t}()!==u&&Ni()!==u&&(e=aa())!==u&&Ni()!==u?(n=eu,(o=gi())===u&&(o=function(){var t,e,n,o;t=eu,"offset"===r.substr(eu,6).toLowerCase()?(e=r.substr(eu,6),eu+=6):(e=u,0===au&&fu(Xe));e!==u?(n=eu,au++,o=qa(),au--,o===u?n=void 0:(eu=n,n=u),n!==u?(t,t=e="OFFSET"):(eu=t,t=u)):(eu=t,t=u);return t}()),o!==u&&(a=Ni())!==u&&(s=aa())!==u?n=o=[o,a,s]:(eu=n,n=u),n===u&&(n=null),n!==u?(t,t=function(r,t){const e=[r];return t&&e.push(t[2]),{seperator:t&&t[0]&&t[0].toLowerCase()||"",value:e}}(e,n)):(eu=t,t=u)):(eu=t,t=u),t}function ia(){var r,t,e,n,o,a,s,i;if(r=eu,(t=ca())!==u){for(e=[],n=eu,(o=Ni())!==u&&(a=gi())!==u&&(s=Ni())!==u&&(i=ca())!==u?n=o=[o,a,s,i]:(eu=n,n=u);n!==u;)e.push(n),n=eu,(o=Ni())!==u&&(a=gi())!==u&&(s=Ni())!==u&&(i=ca())!==u?n=o=[o,a,s,i]:(eu=n,n=u);e!==u?(r,r=t=T(t,e)):(eu=r,r=u)}else eu=r,r=u;return r}function ca(){var t,e,n,o,a,s,i,c,l;return t=eu,e=eu,(n=Pa())!==u&&(o=Ni())!==u&&(a=Ei())!==u?e=n=[n,o,a]:(eu=e,e=u),e===u&&(e=null),e!==u&&(n=Ni())!==u&&(o=Fa())!==u&&(a=Ni())!==u?(61===r.charCodeAt(eu)?(s="=",eu++):(s=u,0===au&&fu(Pr)),s!==u&&Ni()!==u&&(i=ka())!==u?(t,t=e={column:o,value:i,table:(l=e)&&l[0]}):(eu=t,t=u)):(eu=t,t=u),t===u&&(t=eu,e=eu,(n=Pa())!==u&&(o=Ni())!==u&&(a=Ei())!==u?e=n=[n,o,a]:(eu=e,e=u),e===u&&(e=null),e!==u&&(n=Ni())!==u&&(o=Fa())!==u&&(a=Ni())!==u?(61===r.charCodeAt(eu)?(s="=",eu++):(s=u,0===au&&fu(Pr)),s!==u&&Ni()!==u&&(i=Rs())!==u&&Ni()!==u&&Si()!==u&&Ni()!==u&&(c=Ma())!==u&&Ni()!==u&&_i()!==u?(t,t=e=function(r,t,e){return{column:t,value:e,table:r&&r[0],keyword:"values"}}(e,o,c)):(eu=t,t=u)):(eu=t,t=u)),t}function la(){var r;return(r=function(){var r,t;r=eu,Rs()!==u&&Ni()!==u&&(t=function(){var r,t,e,n,o,a,s,i;if(r=eu,(t=va())!==u){for(e=[],n=eu,(o=Ni())!==u&&(a=gi())!==u&&(s=Ni())!==u&&(i=va())!==u?n=o=[o,a,s,i]:(eu=n,n=u);n!==u;)e.push(n),n=eu,(o=Ni())!==u&&(a=gi())!==u&&(s=Ni())!==u&&(i=va())!==u?n=o=[o,a,s,i]:(eu=n,n=u);e!==u?(r,t=T(t,e),r=t):(eu=r,r=u)}else eu=r,r=u;return r}())!==u?(r,r=t):(eu=r,r=u);return r}())===u&&(r=$u()),r}function fa(){var r,t,e,n,o,a,s,i,c;if(r=eu,gs()!==u)if(Ni()!==u)if((t=Si())!==u)if(Ni()!==u)if((e=Ga())!==u){for(n=[],o=eu,(a=Ni())!==u&&(s=gi())!==u&&(i=Ni())!==u&&(c=Ga())!==u?o=a=[a,s,i,c]:(eu=o,o=u);o!==u;)n.push(o),o=eu,(a=Ni())!==u&&(s=gi())!==u&&(i=Ni())!==u&&(c=Ga())!==u?o=a=[a,s,i,c]:(eu=o,o=u);n!==u&&(o=Ni())!==u&&(a=_i())!==u?(r,r=ec(e,n)):(eu=r,r=u)}else eu=r,r=u;else eu=r,r=u;else eu=r,r=u;else eu=r,r=u;else eu=r,r=u;return r===u&&(r=eu,gs()!==u&&Ni()!==u&&(t=va())!==u?(r,r=t):(eu=r,r=u)),r}function pa(){var t,e,n;return t=eu,ks()!==u&&Ni()!==u?("duplicate"===r.substr(eu,9).toLowerCase()?(e=r.substr(eu,9),eu+=9):(e=u,0===au&&fu($r)),e!==u&&Ni()!==u&&Ci()!==u&&Ni()!==u&&ds()!==u&&Ni()!==u&&(n=ia())!==u?(t,t={keyword:"on duplicate key update",set:n}):(eu=t,t=u)):(eu=t,t=u),t}function ba(){var r,t;return r=eu,(t=Ls())!==u&&(r,t="insert"),(r=t)===u&&(r=eu,(t=Cs())!==u&&(r,t="replace"),r=t),r}function va(){var r,t;return r=eu,Si()!==u&&Ni()!==u&&(t=da())!==u&&Ni()!==u&&_i()!==u?(r,r=t):(eu=r,r=u),r}function da(){var r,t,e,n,o,a,s,i;if(r=eu,(t=Ca())!==u){for(e=[],n=eu,(o=Ni())!==u&&(a=gi())!==u&&(s=Ni())!==u&&(i=Ca())!==u?n=o=[o,a,s,i]:(eu=n,n=u);n!==u;)e.push(n),n=eu,(o=Ni())!==u&&(a=gi())!==u&&(s=Ni())!==u&&(i=Ca())!==u?n=o=[o,a,s,i]:(eu=n,n=u);e!==u?(r,r=t=function(r,t){const e={type:"expr_list"};return e.value=ec(r,t),e}(t,e)):(eu=r,r=u)}else eu=r,r=u;return r}function ya(){var t,e,n;return t=eu,function(){var t,e,n,o;t=eu,"interval"===r.substr(eu,8).toLowerCase()?(e=r.substr(eu,8),eu+=8):(e=u,0===au&&fu(Kn));e!==u?(n=eu,au++,o=qa(),au--,o===u?n=void 0:(eu=n,n=u),n!==u?(t,t=e="INTERVAL"):(eu=t,t=u)):(eu=t,t=u);return t}()!==u&&Ni()!==u&&(e=Ca())!==u&&Ni()!==u&&(n=function(){var t;(t=function(){var t,e,n,o;t=eu,"year"===r.substr(eu,4).toLowerCase()?(e=r.substr(eu,4),eu+=4):(e=u,0===au&&fu(zn));e!==u?(n=eu,au++,o=qa(),au--,o===u?n=void 0:(eu=n,n=u),n!==u?(t,t=e="YEAR"):(eu=t,t=u)):(eu=t,t=u);return t}())===u&&(t=function(){var t,e,n,o;t=eu,"month"===r.substr(eu,5).toLowerCase()?(e=r.substr(eu,5),eu+=5):(e=u,0===au&&fu(Zn));e!==u?(n=eu,au++,o=qa(),au--,o===u?n=void 0:(eu=n,n=u),n!==u?(t,t=e="MONTH"):(eu=t,t=u)):(eu=t,t=u);return t}())===u&&(t=function(){var t,e,n,o;t=eu,"day"===r.substr(eu,3).toLowerCase()?(e=r.substr(eu,3),eu+=3):(e=u,0===au&&fu(Jn));e!==u?(n=eu,au++,o=qa(),au--,o===u?n=void 0:(eu=n,n=u),n!==u?(t,t=e="DAY"):(eu=t,t=u)):(eu=t,t=u);return t}())===u&&(t=function(){var t,e,n,o;t=eu,"hour"===r.substr(eu,4).toLowerCase()?(e=r.substr(eu,4),eu+=4):(e=u,0===au&&fu(ro));e!==u?(n=eu,au++,o=qa(),au--,o===u?n=void 0:(eu=n,n=u),n!==u?(t,t=e="HOUR"):(eu=t,t=u)):(eu=t,t=u);return t}())===u&&(t=function(){var t,e,n,o;t=eu,"minute"===r.substr(eu,6).toLowerCase()?(e=r.substr(eu,6),eu+=6):(e=u,0===au&&fu(to));e!==u?(n=eu,au++,o=qa(),au--,o===u?n=void 0:(eu=n,n=u),n!==u?(t,t=e="MINUTE"):(eu=t,t=u)):(eu=t,t=u);return t}())===u&&(t=function(){var t,e,n,o;t=eu,"second"===r.substr(eu,6).toLowerCase()?(e=r.substr(eu,6),eu+=6):(e=u,0===au&&fu(eo));e!==u?(n=eu,au++,o=qa(),au--,o===u?n=void 0:(eu=n,n=u),n!==u?(t,t=e="SECOND"):(eu=t,t=u)):(eu=t,t=u);return t}());return t}())!==u?(t,t={type:"interval",expr:e,unit:n.toLowerCase()}):(eu=t,t=u),t}function ha(){var r,t,e,n,o,a;if(r=eu,(t=ma())!==u)if(Ni()!==u){for(e=[],n=eu,(o=Ni())!==u&&(a=ma())!==u?n=o=[o,a]:(eu=n,n=u);n!==u;)e.push(n),n=eu,(o=Ni())!==u&&(a=ma())!==u?n=o=[o,a]:(eu=n,n=u);e!==u?(r,r=t=i(t,e)):(eu=r,r=u)}else eu=r,r=u;else eu=r,r=u;return r}function ma(){var t,e,n;return t=eu,Qs()!==u&&Ni()!==u&&(e=Aa())!==u&&Ni()!==u&&function(){var t,e,n,o;t=eu,"then"===r.substr(eu,4).toLowerCase()?(e=r.substr(eu,4),eu+=4):(e=u,0===au&&fu(mn));e!==u?(n=eu,au++,o=qa(),au--,o===u?n=void 0:(eu=n,n=u),n!==u?t=e=[e,n]:(eu=t,t=u)):(eu=t,t=u);return t}()!==u&&Ni()!==u&&(n=Ca())!==u?(t,t={type:"when",cond:e,result:n}):(eu=t,t=u),t}function wa(){var t,e;return t=eu,function(){var t,e,n,o;t=eu,"else"===r.substr(eu,4).toLowerCase()?(e=r.substr(eu,4),eu+=4):(e=u,0===au&&fu(wn));e!==u?(n=eu,au++,o=qa(),au--,o===u?n=void 0:(eu=n,n=u),n!==u?t=e=[e,n]:(eu=t,t=u)):(eu=t,t=u);return t}()!==u&&Ni()!==u&&(e=Ca())!==u?(t,t={type:"else",result:e}):(eu=t,t=u),t}function La(){var r;return(r=function(){var r,t,e,n,o,a,s,i;if(r=eu,(t=Ua())!==u){if(e=[],n=eu,(o=Ni())!==u&&(a=ki())!==u&&(s=Ni())!==u&&(i=Ua())!==u?n=o=[o,a,s,i]:(eu=n,n=u),n!==u)for(;n!==u;)e.push(n),n=eu,(o=Ni())!==u&&(a=ki())!==u&&(s=Ni())!==u&&(i=Ua())!==u?n=o=[o,a,s,i]:(eu=n,n=u);else e=u;e!==u&&(n=Ni())!==u?((o=Sa())===u&&(o=null),o!==u?(r,t=function(r,t,e){const n=nc(r,t);return null===e?n:"arithmetic"===e.type?nc(n,e.tail):rc(e.op,n,e.right)}(t,e,o),r=t):(eu=r,r=u)):(eu=r,r=u)}else eu=r,r=u;return r}())===u&&(r=function(){var r,t,e,n,o,a,s,i;if(r=eu,(t=Ea())!==u){for(e=[],n=eu,(o=Ri())!==u&&(a=Vs())!==u&&(s=Ni())!==u&&(i=Ea())!==u?n=o=[o,a,s,i]:(eu=n,n=u);n!==u;)e.push(n),n=eu,(o=Ri())!==u&&(a=Vs())!==u&&(s=Ni())!==u&&(i=Ea())!==u?n=o=[o,a,s,i]:(eu=n,n=u);e!==u?(r,t=Fr(t,e),r=t):(eu=r,r=u)}else eu=r,r=u;return r}())===u&&(r=function(){var r,t,e,n,o,a;if(r=eu,(t=Na())!==u){if(e=[],n=eu,(o=Ni())!==u&&(a=Ua())!==u?n=o=[o,a]:(eu=n,n=u),n!==u)for(;n!==u;)e.push(n),n=eu,(o=Ni())!==u&&(a=Ua())!==u?n=o=[o,a]:(eu=n,n=u);else e=u;e!==u?(r,t=Ji(t,e[0][1]),r=t):(eu=r,r=u)}else eu=r,r=u;return r}()),r}function Ca(){var r;return(r=La())===u&&(r=mu()),r}function Aa(){var r,t,e,n,o,a,s,i;if(r=eu,(t=Ca())!==u){for(e=[],n=eu,(o=Ni())!==u?((a=Ys())===u&&(a=Vs())===u&&(a=gi()),a!==u&&(s=Ni())!==u&&(i=Ca())!==u?n=o=[o,a,s,i]:(eu=n,n=u)):(eu=n,n=u);n!==u;)e.push(n),n=eu,(o=Ni())!==u?((a=Ys())===u&&(a=Vs())===u&&(a=gi()),a!==u&&(s=Ni())!==u&&(i=Ca())!==u?n=o=[o,a,s,i]:(eu=n,n=u)):(eu=n,n=u);e!==u?(r,r=t=function(r,t){const e=t.length;let n=r,o="";for(let r=0;r<e;++r)","===t[r][1]?(o=",",Array.isArray(n)||(n=[n]),n.push(t[r][3])):n=rc(t[r][1],n,t[r][3]);if(","===o){const r={type:"expr_list"};return r.value=n,r}return n}(t,e)):(eu=r,r=u)}else eu=r,r=u;return r}function Ea(){var r,t,e,n,o,a,s,i;if(r=eu,(t=ga())!==u){for(e=[],n=eu,(o=Ri())!==u&&(a=Ys())!==u&&(s=Ni())!==u&&(i=ga())!==u?n=o=[o,a,s,i]:(eu=n,n=u);n!==u;)e.push(n),n=eu,(o=Ri())!==u&&(a=Ys())!==u&&(s=Ni())!==u&&(i=ga())!==u?n=o=[o,a,s,i]:(eu=n,n=u);e!==u?(r,r=t=Fr(t,e)):(eu=r,r=u)}else eu=r,r=u;return r}function ga(){var t,e,n,o,a;return(t=Ta())===u&&(t=function(){var r,t,e;r=eu,(t=function(){var r,t,e,n,o;r=eu,t=eu,(e=Ws())!==u&&(n=Ni())!==u&&(o=qs())!==u?t=e=[e,n,o]:(eu=t,t=u);t!==u&&(r,t=Br(t));(r=t)===u&&(r=qs());return r}())!==u&&Ni()!==u&&Si()!==u&&Ni()!==u&&(e=mu())!==u&&Ni()!==u&&_i()!==u?(r,n=t,(o=e).parentheses=!0,t=Ji(n,o),r=t):(eu=r,r=u);var n,o;return r}())===u&&(t=eu,(e=Ws())===u&&(e=eu,33===r.charCodeAt(eu)?(n="!",eu++):(n=u,0===au&&fu(Hr)),n!==u?(o=eu,au++,61===r.charCodeAt(eu)?(a="=",eu++):(a=u,0===au&&fu(Pr)),au--,a===u?o=void 0:(eu=o,o=u),o!==u?e=n=[n,o]:(eu=e,e=u)):(eu=e,e=u)),e!==u&&(n=Ni())!==u&&(o=ga())!==u?(t,t=e=Ji("NOT",o)):(eu=t,t=u)),t}function Ta(){var r,t,e,n,o;return r=eu,(t=ka())!==u&&Ni()!==u?((e=Sa())===u&&(e=null),e!==u?(r,n=t,r=t=null===(o=e)?n:"arithmetic"===o.type?nc(n,o.tail):rc(o.op,n,o.right)):(eu=r,r=u)):(eu=r,r=u),r===u&&(r=rs())===u&&(r=Ma()),r}function Sa(){var t;return(t=function(){var r,t,e,n,o,a,s;r=eu,t=[],e=eu,(n=Ni())!==u&&(o=_a())!==u&&(a=Ni())!==u&&(s=ka())!==u?e=n=[n,o,a,s]:(eu=e,e=u);if(e!==u)for(;e!==u;)t.push(e),e=eu,(n=Ni())!==u&&(o=_a())!==u&&(a=Ni())!==u&&(s=ka())!==u?e=n=[n,o,a,s]:(eu=e,e=u);else t=u;t!==u&&(r,t={type:"arithmetic",tail:t});return r=t}())===u&&(t=Ia())===u&&(t=function(){var r,t,e,n;r=eu,(t=function(){var r,t,e,n,o;r=eu,t=eu,(e=Ws())!==u&&(n=Ni())!==u&&(o=Fs())!==u?t=e=[e,n,o]:(eu=t,t=u);t!==u&&(r,t=Br(t));(r=t)===u&&(r=Fs());return r}())!==u&&Ni()!==u&&(e=ka())!==u&&Ni()!==u&&Ys()!==u&&Ni()!==u&&(n=ka())!==u?(r,r=t={op:t,right:{type:"expr_list",value:[e,n]}}):(eu=r,r=u);return r}())===u&&(t=function(){var r,t,e,n,o;r=eu,(t=Bs())!==u&&(e=Ni())!==u&&(n=ka())!==u?(r,r=t={op:"IS",right:n}):(eu=r,r=u);r===u&&(r=eu,t=eu,(e=Bs())!==u&&(n=Ni())!==u&&(o=Ws())!==u?t=e=[e,n,o]:(eu=t,t=u),t!==u&&(e=Ni())!==u&&(n=ka())!==u?(r,t=function(r){return{op:"IS NOT",right:r}}(n),r=t):(eu=r,r=u));return r}())===u&&(t=xa())===u&&(t=function(){var t,e,n,o;t=eu,(e=function(){var t,e,n;t=eu,(e=Ws())===u&&(e=null);e!==u&&Ni()!==u?((n=function(){var t,e,n,o;t=eu,"regexp"===r.substr(eu,6).toLowerCase()?(e=r.substr(eu,6),eu+=6):(e=u,0===au&&fu(un));e!==u?(n=eu,au++,o=qa(),au--,o===u?n=void 0:(eu=n,n=u),n!==u?(t,t=e="REGEXP"):(eu=t,t=u)):(eu=t,t=u);return t}())===u&&(n=function(){var t,e,n,o;t=eu,"rlike"===r.substr(eu,5).toLowerCase()?(e=r.substr(eu,5),eu+=5):(e=u,0===au&&fu(on));e!==u?(n=eu,au++,o=qa(),au--,o===u?n=void 0:(eu=n,n=u),n!==u?(t,t=e="RLIKE"):(eu=t,t=u)):(eu=t,t=u);return t}()),n!==u?(t,a=n,t=e=(o=e)?`${o} ${a}`:a):(eu=t,t=u)):(eu=t,t=u);var o,a;return t}())!==u&&Ni()!==u?("binary"===r.substr(eu,6).toLowerCase()?(n=r.substr(eu,6),eu+=6):(n=u,0===au&&fu(Ar)),n===u&&(n=null),n!==u&&Ni()!==u?((o=Ka())===u&&(o=rs())===u&&(o=Ma()),o!==u?(t,a=e,t=e={op:(s=n)?`${a} ${s}`:a,right:o}):(eu=t,t=u)):(eu=t,t=u)):(eu=t,t=u);var a,s;t===u&&(t=eu,"glob"===r.substr(eu,4).toLowerCase()?(e=r.substr(eu,4),eu+=4):(e=u,0===au&&fu(Qr)),e!==u&&Ni()!==u&&(n=rs())!==u?(t,e=function(r){return{op:"GLOB",right:r}}(n),t=e):(eu=t,t=u));return t}()),t}function _a(){var t;return">="===r.substr(eu,2)?(t=">=",eu+=2):(t=u,0===au&&fu(Gr)),t===u&&(62===r.charCodeAt(eu)?(t=">",eu++):(t=u,0===au&&fu(qr)),t===u&&("<="===r.substr(eu,2)?(t="<=",eu+=2):(t=u,0===au&&fu(Wr)),t===u&&("<>"===r.substr(eu,2)?(t="<>",eu+=2):(t=u,0===au&&fu(Yr)),t===u&&(60===r.charCodeAt(eu)?(t="<",eu++):(t=u,0===au&&fu(Vr)),t===u&&(61===r.charCodeAt(eu)?(t="=",eu++):(t=u,0===au&&fu(Pr)),t===u&&("!="===r.substr(eu,2)?(t="!=",eu+=2):(t=u,0===au&&fu(Xr)))))))),t}function ja(){var r,t,e,n,o;return r=eu,t=eu,(e=Ws())!==u&&(n=Ni())!==u&&(o=Hs())!==u?t=e=[e,n,o]:(eu=t,t=u),t!==u&&(r,t=Br(t)),(r=t)===u&&(r=Hs()),r}function xa(){var r,t,e;return r=eu,(t=function(){var r,t,e,n,o;return r=eu,t=eu,(e=Ws())!==u&&(n=Ni())!==u&&(o=Gs())!==u?t=e=[e,n,o]:(eu=t,t=u),t!==u&&(r,t=Br(t)),(r=t)===u&&(r=Gs()),r}())!==u&&Ni()!==u?((e=Za())===u&&(e=Ta()),e!==u?(r,r=t={op:t,right:e}):(eu=r,r=u)):(eu=r,r=u),r}function Ia(){var r,t,e,n;return r=eu,(t=ja())!==u&&Ni()!==u&&(e=Si())!==u&&Ni()!==u&&(n=da())!==u&&Ni()!==u&&_i()!==u?(r,r=t={op:t,right:n}):(eu=r,r=u),r===u&&(r=eu,(t=ja())!==u&&Ni()!==u?((e=Xi())===u&&(e=rs()),e!==u?(r,r=t=function(r,t){return{op:r,right:t}}(t,e)):(eu=r,r=u)):(eu=r,r=u)),r}function ka(){var r,t,e,n,o,a,s,i;if(r=eu,(t=Ra())!==u){for(e=[],n=eu,(o=Ni())!==u&&(a=Na())!==u&&(s=Ni())!==u&&(i=Ra())!==u?n=o=[o,a,s,i]:(eu=n,n=u);n!==u;)e.push(n),n=eu,(o=Ni())!==u&&(a=Na())!==u&&(s=Ni())!==u&&(i=Ra())!==u?n=o=[o,a,s,i]:(eu=n,n=u);e!==u?(r,r=t=Fr(t,e)):(eu=r,r=u)}else eu=r,r=u;return r}function Na(){var t;return 43===r.charCodeAt(eu)?(t="+",eu++):(t=u,0===au&&fu(Kr)),t===u&&(45===r.charCodeAt(eu)?(t="-",eu++):(t=u,0===au&&fu(zr))),t}function Ra(){var r,t,e,n,o,a,s,i;if(r=eu,(t=Ua())!==u){for(e=[],n=eu,(o=Ni())!==u&&(a=Oa())!==u&&(s=Ni())!==u&&(i=Ua())!==u?n=o=[o,a,s,i]:(eu=n,n=u);n!==u;)e.push(n),n=eu,(o=Ni())!==u&&(a=Oa())!==u&&(s=Ni())!==u&&(i=Ua())!==u?n=o=[o,a,s,i]:(eu=n,n=u);e!==u?(r,r=t=nc(t,e)):(eu=r,r=u)}else eu=r,r=u;return r}function Oa(){var t;return 42===r.charCodeAt(eu)?(t="*",eu++):(t=u,0===au&&fu(Zr)),t===u&&(47===r.charCodeAt(eu)?(t="/",eu++):(t=u,0===au&&fu(Jr)),t===u&&(37===r.charCodeAt(eu)?(t="%",eu++):(t=u,0===au&&fu(rt)),t===u&&("||"===r.substr(eu,2)?(t="||",eu+=2):(t=u,0===au&&fu(tt))))),t}function Ua(){var t,e,n,o;return(t=function(){var t,e,n,o,a,s,i;t=eu,(e=zs())!==u&&Ni()!==u&&Si()!==u&&Ni()!==u&&(n=Ca())!==u&&Ni()!==u&&_s()!==u&&Ni()!==u&&(o=Ki())!==u&&Ni()!==u&&(a=_i())!==u?(t,c=n,l=o,e={type:"cast",keyword:e.toLowerCase(),expr:c,symbol:"as",target:l},t=e):(eu=t,t=u);var c,l;t===u&&(t=eu,(e=zs())!==u&&Ni()!==u&&Si()!==u&&Ni()!==u&&(n=Ca())!==u&&Ni()!==u&&_s()!==u&&Ni()!==u&&(o=ti())!==u&&Ni()!==u&&(a=Si())!==u&&Ni()!==u&&(s=us())!==u&&Ni()!==u&&_i()!==u&&Ni()!==u&&(i=_i())!==u?(t,e=function(r,t,e){return{type:"cast",keyword:r.toLowerCase(),expr:t,symbol:"as",target:{dataType:"DECIMAL("+e+")"}}}(e,n,s),t=e):(eu=t,t=u),t===u&&(t=eu,(e=zs())!==u&&Ni()!==u&&Si()!==u&&Ni()!==u&&(n=Ca())!==u&&Ni()!==u&&_s()!==u&&Ni()!==u&&(o=ti())!==u&&Ni()!==u&&(a=Si())!==u&&Ni()!==u&&(s=us())!==u&&Ni()!==u&&gi()!==u&&Ni()!==u&&(i=us())!==u&&Ni()!==u&&_i()!==u&&Ni()!==u&&_i()!==u?(t,e=function(r,t,e,n){return{type:"cast",keyword:r.toLowerCase(),expr:t,symbol:"as",target:{dataType:"DECIMAL("+e+", "+n+")"}}}(e,n,s,i),t=e):(eu=t,t=u),t===u&&(t=eu,(e=zs())!==u&&Ni()!==u&&Si()!==u&&Ni()!==u&&(n=Ca())!==u&&Ni()!==u&&_s()!==u&&Ni()!==u&&(o=function(){var t;(t=function(){var t,e,n,o;t=eu,"signed"===r.substr(eu,6).toLowerCase()?(e=r.substr(eu,6),eu+=6):(e=u,0===au&&fu(Sn));e!==u?(n=eu,au++,o=qa(),au--,o===u?n=void 0:(eu=n,n=u),n!==u?(t,t=e="SIGNED"):(eu=t,t=u)):(eu=t,t=u);return t}())===u&&(t=ei());return t}())!==u&&Ni()!==u?((a=oi())===u&&(a=null),a!==u&&Ni()!==u&&(s=_i())!==u?(t,e=function(r,t,e,n){return{type:"cast",keyword:r.toLowerCase(),expr:t,symbol:"as",target:{dataType:e+(n?" "+n:"")}}}(e,n,o,a),t=e):(eu=t,t=u)):(eu=t,t=u))));return t}())===u&&(t=Za())===u&&(t=function(){var t;(t=function(){var t,e,n,o;t=eu,(e=function(){var t,e,n,o;t=eu,"count"===r.substr(eu,5).toLowerCase()?(e=r.substr(eu,5),eu+=5):(e=u,0===au&&fu(ln));e!==u?(n=eu,au++,o=qa(),au--,o===u?n=void 0:(eu=n,n=u),n!==u?(t,t=e="COUNT"):(eu=t,t=u)):(eu=t,t=u);return t}())!==u&&Ni()!==u&&Si()!==u&&Ni()!==u&&(n=function(){var t,e,n,o,a,s,i,c,l,f;t=eu,(e=function(){var t,e;t=eu,42===r.charCodeAt(eu)?(e="*",eu++):(e=u,0===au&&fu(Zr));e!==u&&(t,e={type:"star",value:"*"});return t=e}())!==u&&(t,e={expr:e});if((t=e)===u){if(t=eu,(e=$s())===u&&(e=null),e!==u)if(Ni()!==u)if((n=Si())!==u)if(Ni()!==u)if((o=Ca())!==u)if(Ni()!==u)if(_i()!==u){for(a=[],s=eu,(i=Ni())!==u?((c=Ys())===u&&(c=Vs()),c!==u&&(l=Ni())!==u&&(f=Ca())!==u?s=i=[i,c,l,f]:(eu=s,s=u)):(eu=s,s=u);s!==u;)a.push(s),s=eu,(i=Ni())!==u?((c=Ys())===u&&(c=Vs()),c!==u&&(l=Ni())!==u&&(f=Ca())!==u?s=i=[i,c,l,f]:(eu=s,s=u)):(eu=s,s=u);a!==u&&(s=Ni())!==u?((i=oa())===u&&(i=null),i!==u?(t,e=function(r,t,e,n){const o=e.length;let u=t;u.parentheses=!0;for(let r=0;r<o;++r)u=rc(e[r][1],u,e[r][3]);return{distinct:r,expr:u,orderby:n}}(e,o,a,i),t=e):(eu=t,t=u)):(eu=t,t=u)}else eu=t,t=u;else eu=t,t=u;else eu=t,t=u;else eu=t,t=u;else eu=t,t=u;else eu=t,t=u;else eu=t,t=u;t===u&&(t=eu,(e=$s())===u&&(e=null),e!==u&&Ni()!==u&&(n=ra())!==u&&Ni()!==u?((o=oa())===u&&(o=null),o!==u?(t,t=e={distinct:e,expr:n,orderby:o}):(eu=t,t=u)):(eu=t,t=u))}return t}())!==u&&Ni()!==u&&_i()!==u&&Ni()!==u?((o=Qa())===u&&(o=null),o!==u?(t,t=e={type:"aggr_func",name:e,args:n,over:o}):(eu=t,t=u)):(eu=t,t=u);return t}())===u&&(t=function(){var t,e,n;t=eu,(e=function(){var t;(t=function(){var t,e,n,o;t=eu,"sum"===r.substr(eu,3).toLowerCase()?(e=r.substr(eu,3),eu+=3):(e=u,0===au&&fu(bn));e!==u?(n=eu,au++,o=qa(),au--,o===u?n=void 0:(eu=n,n=u),n!==u?(t,t=e="SUM"):(eu=t,t=u)):(eu=t,t=u);return t}())===u&&(t=function(){var t,e,n,o;t=eu,"max"===r.substr(eu,3).toLowerCase()?(e=r.substr(eu,3),eu+=3):(e=u,0===au&&fu(fn));e!==u?(n=eu,au++,o=qa(),au--,o===u?n=void 0:(eu=n,n=u),n!==u?(t,t=e="MAX"):(eu=t,t=u)):(eu=t,t=u);return t}())===u&&(t=function(){var t,e,n,o;t=eu,"min"===r.substr(eu,3).toLowerCase()?(e=r.substr(eu,3),eu+=3):(e=u,0===au&&fu(pn));e!==u?(n=eu,au++,o=qa(),au--,o===u?n=void 0:(eu=n,n=u),n!==u?(t,t=e="MIN"):(eu=t,t=u)):(eu=t,t=u);return t}())===u&&(t=function(){var t,e,n,o;t=eu,"avg"===r.substr(eu,3).toLowerCase()?(e=r.substr(eu,3),eu+=3):(e=u,0===au&&fu(vn));e!==u?(n=eu,au++,o=qa(),au--,o===u?n=void 0:(eu=n,n=u),n!==u?(t,t=e="AVG"):(eu=t,t=u)):(eu=t,t=u);return t}());return t}())!==u&&Ni()!==u&&Si()!==u&&Ni()!==u&&(n=ka())!==u&&Ni()!==u&&_i()!==u?(t,t=e={type:"aggr_func",name:e,args:{expr:n}}):(eu=t,t=u);return t}());return t}())===u&&(t=Ka())===u&&(t=function(){var r,t,e,n,o,a,s,i;return r=eu,Xs()!==u&&Ni()!==u&&(t=ha())!==u&&Ni()!==u?((e=wa())===u&&(e=null),e!==u&&Ni()!==u&&(n=Ks())!==u&&Ni()!==u?((o=Xs())===u&&(o=null),o!==u?(r,s=t,(i=e)&&s.push(i),r={type:"case",expr:null,args:s}):(eu=r,r=u)):(eu=r,r=u)):(eu=r,r=u),r===u&&(r=eu,Xs()!==u&&Ni()!==u&&(t=Ca())!==u&&Ni()!==u&&(e=ha())!==u&&Ni()!==u?((n=wa())===u&&(n=null),n!==u&&Ni()!==u&&(o=Ks())!==u&&Ni()!==u?((a=Xs())===u&&(a=null),a!==u?(r,r=function(r,t,e){return e&&t.push(e),{type:"case",expr:r,args:t}}(t,e,n)):(eu=r,r=u)):(eu=r,r=u)):(eu=r,r=u)),r}())===u&&(t=ya())===u&&(t=Ma())===u&&(t=Va())===u&&(t=eu,Si()!==u&&(e=Ni())!==u&&(n=Aa())!==u&&Ni()!==u&&_i()!==u?(t,(o=n).parentheses=!0,t=o):(eu=t,t=u),t===u&&(t=Xi())===u&&(t=eu,Ni()!==u?(63===r.charCodeAt(eu)?(e="?",eu++):(e=u,0===au&&fu(et)),e!==u?(t,t={type:"origin",value:e}):(eu=t,t=u)):(eu=t,t=u))),t}function Ma(){var r,t,e,n,o,a,s,i,c,l,f;if(r=eu,t=eu,(e=Pa())!==u&&(n=Ni())!==u&&(o=Ei())!==u&&(a=Ni())!==u?t=e=[e,n,o,a]:(eu=t,t=u),t===u&&(t=null),t!==u)if((e=Ha())!==u)if((n=Ni())!==u){if(o=[],a=eu,(s=Ii())===u&&(s=xi()),s!==u&&(i=Ni())!==u?((c=rs())===u&&(c=os()),c!==u?a=s=[s,i,c]:(eu=a,a=u)):(eu=a,a=u),a!==u)for(;a!==u;)o.push(a),a=eu,(s=Ii())===u&&(s=xi()),s!==u&&(i=Ni())!==u?((c=rs())===u&&(c=os()),c!==u?a=s=[s,i,c]:(eu=a,a=u)):(eu=a,a=u);else o=u;o!==u&&(a=Ni())!==u?((s=gu())===u&&(s=null),s!==u?(r,r=t=function(r,t,e,n){const o=r&&r[0]||null;return ic.add(`select::${o}::${t}`),{type:"column_ref",table:o,column:t,collate:n,arrows:e.map(r=>r[0]),properties:e.map(r=>r[2])}}(t,e,o,s)):(eu=r,r=u)):(eu=r,r=u)}else eu=r,r=u;else eu=r,r=u;else eu=r,r=u;return r===u&&(r=eu,(t=Pa())!==u&&(e=Ni())!==u&&(n=Ei())!==u&&(o=Ni())!==u&&(a=Fa())!==u?(r,l=t,f=a,ic.add(`select::${l}::${f}`),r=t={type:"column_ref",table:l,column:f}):(eu=r,r=u),r===u&&(r=eu,(t=Fa())!==u&&(r,t=function(r){return ic.add("select::null::"+r),{type:"column_ref",table:null,column:r}}(t)),r=t)),r}function Da(){var r,t,e,n,o,a,s,i;if(r=eu,(t=Ha())!==u){for(e=[],n=eu,(o=Ni())!==u&&(a=gi())!==u&&(s=Ni())!==u&&(i=Ha())!==u?n=o=[o,a,s,i]:(eu=n,n=u);n!==u;)e.push(n),n=eu,(o=Ni())!==u&&(a=gi())!==u&&(s=Ni())!==u&&(i=Ha())!==u?n=o=[o,a,s,i]:(eu=n,n=u);e!==u?(r,r=t=T(t,e)):(eu=r,r=u)}else eu=r,r=u;return r}function Pa(){var r,t;return r=eu,(t=Ga())!==u?(eu,(nt(t)?u:void 0)!==u?(r,r=t=t):(eu=r,r=u)):(eu=r,r=u),r===u&&(r=eu,(t=$a())!==u&&(r,t=t),r=t),r}function $a(){var t;return(t=function(){var t,e,n,o;t=eu,34===r.charCodeAt(eu)?(e='"',eu++):(e=u,0===au&&fu(ot));if(e!==u){if(n=[],ut.test(r.charAt(eu))?(o=r.charAt(eu),eu++):(o=u,0===au&&fu(at)),o!==u)for(;o!==u;)n.push(o),ut.test(r.charAt(eu))?(o=r.charAt(eu),eu++):(o=u,0===au&&fu(at));else n=u;n!==u?(34===r.charCodeAt(eu)?(o='"',eu++):(o=u,0===au&&fu(ot)),o!==u?(t,e=st(n),t=e):(eu=t,t=u)):(eu=t,t=u)}else eu=t,t=u;return t}())===u&&(t=function(){var t,e,n,o;t=eu,39===r.charCodeAt(eu)?(e="'",eu++):(e=u,0===au&&fu(vr));if(e!==u){if(n=[],it.test(r.charAt(eu))?(o=r.charAt(eu),eu++):(o=u,0===au&&fu(ct)),o!==u)for(;o!==u;)n.push(o),it.test(r.charAt(eu))?(o=r.charAt(eu),eu++):(o=u,0===au&&fu(ct));else n=u;n!==u?(39===r.charCodeAt(eu)?(o="'",eu++):(o=u,0===au&&fu(vr)),o!==u?(t,e=st(n),t=e):(eu=t,t=u)):(eu=t,t=u)}else eu=t,t=u;return t}())===u&&(t=function(){var t,e,n,o;t=eu,96===r.charCodeAt(eu)?(e="`",eu++):(e=u,0===au&&fu(lt));if(e!==u){if(n=[],ft.test(r.charAt(eu))?(o=r.charAt(eu),eu++):(o=u,0===au&&fu(pt)),o!==u)for(;o!==u;)n.push(o),ft.test(r.charAt(eu))?(o=r.charAt(eu),eu++):(o=u,0===au&&fu(pt));else n=u;n!==u?(96===r.charCodeAt(eu)?(o="`",eu++):(o=u,0===au&&fu(lt)),o!==u?(t,e=st(n),t=e):(eu=t,t=u)):(eu=t,t=u)}else eu=t,t=u;return t}()),t}function Fa(){var r,t;return r=eu,(t=Ba())!==u&&(r,t=t),(r=t)===u&&(r=$a()),r}function Ha(){var r,t;return r=eu,(t=Ba())!==u?(eu,(nt(t)?u:void 0)!==u?(r,r=t=t):(eu=r,r=u)):(eu=r,r=u),r===u&&(r=$a()),r}function Ba(){var r,t,e,n;if(r=eu,(t=qa())!==u){for(e=[],n=Ya();n!==u;)e.push(n),n=Ya();e!==u?(r,r=t=bt(t,e)):(eu=r,r=u)}else eu=r,r=u;return r}function Ga(){var r,t,e,n;if(r=eu,(t=qa())!==u){for(e=[],n=Wa();n!==u;)e.push(n),n=Wa();e!==u?(r,r=t=bt(t,e)):(eu=r,r=u)}else eu=r,r=u;return r}function qa(){var t;return vt.test(r.charAt(eu))?(t=r.charAt(eu),eu++):(t=u,0===au&&fu(dt)),t}function Wa(){var t;return yt.test(r.charAt(eu))?(t=r.charAt(eu),eu++):(t=u,0===au&&fu(ht)),t}function Ya(){var t;return mt.test(r.charAt(eu))?(t=r.charAt(eu),eu++):(t=u,0===au&&fu(wt)),t}function Va(){var t,e,n,o;return t=eu,e=eu,58===r.charCodeAt(eu)?(n=":",eu++):(n=u,0===au&&fu(Lt)),n!==u&&(o=Ga())!==u?e=n=[n,o]:(eu=e,e=u),e!==u&&(t,e={type:"param",value:e[1]}),t=e}function Xa(){var r,t,e;return r=eu,ks()!==u&&Ni()!==u&&ds()!==u&&Ni()!==u&&(t=di())!==u&&Ni()!==u&&Si()!==u&&Ni()!==u?((e=da())===u&&(e=null),e!==u&&Ni()!==u&&_i()!==u?(r,r={type:"on update",keyword:t,parentheses:!0,expr:e}):(eu=r,r=u)):(eu=r,r=u),r===u&&(r=eu,ks()!==u&&Ni()!==u&&ds()!==u&&Ni()!==u&&(t=di())!==u?(r,r=function(r){return{type:"on update",keyword:r}}(t)):(eu=r,r=u)),r}function Qa(){var t,e,n;return t=eu,function(){var t,e,n,o;t=eu,"over"===r.substr(eu,4).toLowerCase()?(e=r.substr(eu,4),eu+=4):(e=u,0===au&&fu(Pe));e!==u?(n=eu,au++,o=qa(),au--,o===u?n=void 0:(eu=n,n=u),n!==u?t=e=[e,n]:(eu=t,t=u)):(eu=t,t=u);return t}()!==u&&Ni()!==u&&Si()!==u&&Ni()!==u&&gs()!==u&&Ni()!==u&&Ms()!==u&&Ni()!==u&&(e=Hu())!==u&&Ni()!==u?((n=oa())===u&&(n=null),n!==u&&Ni()!==u&&_i()!==u?(t,t={partitionby:e,orderby:n}):(eu=t,t=u)):(eu=t,t=u),t===u&&(t=Xa()),t}function Ka(){var t,e,n,o,a;return t=eu,(e=function(){var t;(t=za())===u&&(t=function(){var t,e,n,o;t=eu,"current_user"===r.substr(eu,12).toLowerCase()?(e=r.substr(eu,12),eu+=12):(e=u,0===au&&fu(uo));e!==u?(n=eu,au++,o=qa(),au--,o===u?n=void 0:(eu=n,n=u),n!==u?(t,t=e="CURRENT_USER"):(eu=t,t=u)):(eu=t,t=u);return t}())===u&&(t=function(){var t,e,n,o;t=eu,"user"===r.substr(eu,4).toLowerCase()?(e=r.substr(eu,4),eu+=4):(e=u,0===au&&fu(Xn));e!==u?(n=eu,au++,o=qa(),au--,o===u?n=void 0:(eu=n,n=u),n!==u?(t,t=e="USER"):(eu=t,t=u)):(eu=t,t=u);return t}())===u&&(t=function(){var t,e,n,o;t=eu,"session_user"===r.substr(eu,12).toLowerCase()?(e=r.substr(eu,12),eu+=12):(e=u,0===au&&fu(ao));e!==u?(n=eu,au++,o=qa(),au--,o===u?n=void 0:(eu=n,n=u),n!==u?(t,t=e="SESSION_USER"):(eu=t,t=u)):(eu=t,t=u);return t}())===u&&(t=function(){var t,e,n,o;t=eu,"system_user"===r.substr(eu,11).toLowerCase()?(e=r.substr(eu,11),eu+=11):(e=u,0===au&&fu(so));e!==u?(n=eu,au++,o=qa(),au--,o===u?n=void 0:(eu=n,n=u),n!==u?(t,t=e="SYSTEM_USER"):(eu=t,t=u)):(eu=t,t=u);return t}());return t}())!==u&&Ni()!==u&&(n=Si())!==u&&Ni()!==u?((o=da())===u&&(o=null),o!==u&&Ni()!==u&&_i()!==u&&Ni()!==u?((a=Qa())===u&&(a=null),a!==u?(t,t=e={type:"function",name:e,args:o||{type:"expr_list",value:[]},over:a}):(eu=t,t=u)):(eu=t,t=u)):(eu=t,t=u),t===u&&(t=eu,(e=za())!==u&&Ni()!==u?((n=Xa())===u&&(n=null),n!==u?(t,t=e={type:"function",name:e,over:n}):(eu=t,t=u)):(eu=t,t=u),t===u&&(t=eu,(e=Wi())!==u&&Ni()!==u&&(n=Si())!==u&&Ni()!==u?((o=Aa())===u&&(o=null),o!==u&&Ni()!==u&&_i()!==u&&Ni()!==u?((a=Qa())===u&&(a=null),a!==u?(t,t=e=function(r,t,e){return t&&"expr_list"!==t.type&&(t={type:"expr_list",value:[t]}),{type:"function",name:r,args:t||{type:"expr_list",value:[]},over:e}}(e,o,a)):(eu=t,t=u)):(eu=t,t=u)):(eu=t,t=u))),t}function za(){var t;return(t=function(){var t,e,n,o;t=eu,"current_date"===r.substr(eu,12).toLowerCase()?(e=r.substr(eu,12),eu+=12):(e=u,0===au&&fu(Qn));e!==u?(n=eu,au++,o=qa(),au--,o===u?n=void 0:(eu=n,n=u),n!==u?(t,t=e="CURRENT_DATE"):(eu=t,t=u)):(eu=t,t=u);return t}())===u&&(t=function(){var t,e,n,o;t=eu,"current_time"===r.substr(eu,12).toLowerCase()?(e=r.substr(eu,12),eu+=12):(e=u,0===au&&fu(no));e!==u?(n=eu,au++,o=qa(),au--,o===u?n=void 0:(eu=n,n=u),n!==u?(t,t=e="CURRENT_TIME"):(eu=t,t=u)):(eu=t,t=u);return t}())===u&&(t=di()),t}function Za(){var t,e,n,o,a,s,i,c,l;return t=eu,"binary"===r.substr(eu,6).toLowerCase()?(e=r.substr(eu,6),eu+=6):(e=u,0===au&&fu(Ar)),e===u&&(e=null),e!==u&&Ni()!==u&&(n=rs())!==u?(o=eu,(a=Ni())!==u&&(s=gu())!==u?o=a=[a,s]:(eu=o,o=u),o===u&&(o=null),o!==u?(t,c=n,l=o,(i=e)&&(c.prefix=i.toLowerCase()),l&&(c.suffix={collate:l[1]}),t=e=c):(eu=t,t=u)):(eu=t,t=u),t===u&&(t=os())===u&&(t=function(){var t,e;t=eu,(e=function(){var t,e,n,o;t=eu,"true"===r.substr(eu,4).toLowerCase()?(e=r.substr(eu,4),eu+=4):(e=u,0===au&&fu(se));e!==u?(n=eu,au++,o=qa(),au--,o===u?n=void 0:(eu=n,n=u),n!==u?t=e=[e,n]:(eu=t,t=u)):(eu=t,t=u);return t}())!==u&&(t,e={type:"bool",value:!0});(t=e)===u&&(t=eu,(e=function(){var t,e,n,o;t=eu,"false"===r.substr(eu,5).toLowerCase()?(e=r.substr(eu,5),eu+=5):(e=u,0===au&&fu(ce));e!==u?(n=eu,au++,o=qa(),au--,o===u?n=void 0:(eu=n,n=u),n!==u?t=e=[e,n]:(eu=t,t=u)):(eu=t,t=u);return t}())!==u&&(t,e={type:"bool",value:!1}),t=e);return t}())===u&&(t=Ja())===u&&(t=function(){var t,e,n,o,a,s;t=eu,(e=bi())===u&&(e=fi())===u&&(e=vi())===u&&(e=pi());if(e!==u)if(Ni()!==u){if(n=eu,39===r.charCodeAt(eu)?(o="'",eu++):(o=u,0===au&&fu(vr)),o!==u){for(a=[],s=es();s!==u;)a.push(s),s=es();a!==u?(39===r.charCodeAt(eu)?(s="'",eu++):(s=u,0===au&&fu(vr)),s!==u?n=o=[o,a,s]:(eu=n,n=u)):(eu=n,n=u)}else eu=n,n=u;n!==u?(t,e=_t(e,n),t=e):(eu=t,t=u)}else eu=t,t=u;else eu=t,t=u;if(t===u)if(t=eu,(e=bi())===u&&(e=fi())===u&&(e=vi())===u&&(e=pi()),e!==u)if(Ni()!==u){if(n=eu,34===r.charCodeAt(eu)?(o='"',eu++):(o=u,0===au&&fu(ot)),o!==u){for(a=[],s=ts();s!==u;)a.push(s),s=ts();a!==u?(34===r.charCodeAt(eu)?(s='"',eu++):(s=u,0===au&&fu(ot)),s!==u?n=o=[o,a,s]:(eu=n,n=u)):(eu=n,n=u)}else eu=n,n=u;n!==u?(t,e=_t(e,n),t=e):(eu=t,t=u)}else eu=t,t=u;else eu=t,t=u;return t}()),t}function Ja(){var t,e;return t=eu,(e=function(){var t,e,n,o;t=eu,"null"===r.substr(eu,4).toLowerCase()?(e=r.substr(eu,4),eu+=4):(e=u,0===au&&fu(ue));e!==u?(n=eu,au++,o=qa(),au--,o===u?n=void 0:(eu=n,n=u),n!==u?t=e=[e,n]:(eu=t,t=u)):(eu=t,t=u);return t}())!==u&&(t,e={type:"null",value:null}),t=e}function rs(){var t,e,n,o,a,s,i,c;if(t=eu,"_binary"===r.substr(eu,7).toLowerCase()?(e=r.substr(eu,7),eu+=7):(e=u,0===au&&fu(Ct)),e===u&&(e=null),e!==u)if((n=Ni())!==u)if("x"===r.substr(eu,1).toLowerCase()?(o=r.charAt(eu),eu++):(o=u,0===au&&fu(At)),o!==u){if(a=eu,39===r.charCodeAt(eu)?(s="'",eu++):(s=u,0===au&&fu(vr)),s!==u){for(i=[],Et.test(r.charAt(eu))?(c=r.charAt(eu),eu++):(c=u,0===au&&fu(gt));c!==u;)i.push(c),Et.test(r.charAt(eu))?(c=r.charAt(eu),eu++):(c=u,0===au&&fu(gt));i!==u?(39===r.charCodeAt(eu)?(c="'",eu++):(c=u,0===au&&fu(vr)),c!==u?a=s=[s,i,c]:(eu=a,a=u)):(eu=a,a=u)}else eu=a,a=u;a!==u?(t,t=e={type:"hex_string",prefix:e,value:a[1].join("")}):(eu=t,t=u)}else eu=t,t=u;else eu=t,t=u;else eu=t,t=u;if(t===u){if(t=eu,"_binary"===r.substr(eu,7).toLowerCase()?(e=r.substr(eu,7),eu+=7):(e=u,0===au&&fu(Ct)),e===u&&(e=null),e!==u)if((n=Ni())!==u)if("b"===r.substr(eu,1).toLowerCase()?(o=r.charAt(eu),eu++):(o=u,0===au&&fu(Tt)),o!==u){if(a=eu,39===r.charCodeAt(eu)?(s="'",eu++):(s=u,0===au&&fu(vr)),s!==u){for(i=[],Et.test(r.charAt(eu))?(c=r.charAt(eu),eu++):(c=u,0===au&&fu(gt));c!==u;)i.push(c),Et.test(r.charAt(eu))?(c=r.charAt(eu),eu++):(c=u,0===au&&fu(gt));i!==u?(39===r.charCodeAt(eu)?(c="'",eu++):(c=u,0===au&&fu(vr)),c!==u?a=s=[s,i,c]:(eu=a,a=u)):(eu=a,a=u)}else eu=a,a=u;a!==u?(t,t=e=function(r,t,e){return{type:"bit_string",prefix:r,value:e[1].join("")}}(e,0,a)):(eu=t,t=u)}else eu=t,t=u;else eu=t,t=u;else eu=t,t=u;if(t===u){if(t=eu,"_binary"===r.substr(eu,7).toLowerCase()?(e=r.substr(eu,7),eu+=7):(e=u,0===au&&fu(Ct)),e===u&&(e=null),e!==u)if((n=Ni())!==u)if("0x"===r.substr(eu,2)?(o="0x",eu+=2):(o=u,0===au&&fu(St)),o!==u){for(a=[],Et.test(r.charAt(eu))?(s=r.charAt(eu),eu++):(s=u,0===au&&fu(gt));s!==u;)a.push(s),Et.test(r.charAt(eu))?(s=r.charAt(eu),eu++):(s=u,0===au&&fu(gt));a!==u?(t,t=e=function(r,t,e){return{type:"full_hex_string",prefix:r,value:e.join("")}}(e,0,a)):(eu=t,t=u)}else eu=t,t=u;else eu=t,t=u;else eu=t,t=u;if(t===u){if(t=eu,e=eu,39===r.charCodeAt(eu)?(n="'",eu++):(n=u,0===au&&fu(vr)),n!==u){for(o=[],a=es();a!==u;)o.push(a),a=es();o!==u?(39===r.charCodeAt(eu)?(a="'",eu++):(a=u,0===au&&fu(vr)),a!==u?e=n=[n,o,a]:(eu=e,e=u)):(eu=e,e=u)}else eu=e,e=u;if(e!==u&&(t,e=function(r){return{type:"single_quote_string",value:r[1].join("")}}(e)),(t=e)===u){if(t=eu,e=eu,34===r.charCodeAt(eu)?(n='"',eu++):(n=u,0===au&&fu(ot)),n!==u){for(o=[],a=ts();a!==u;)o.push(a),a=ts();o!==u?(34===r.charCodeAt(eu)?(a='"',eu++):(a=u,0===au&&fu(ot)),a!==u?e=n=[n,o,a]:(eu=e,e=u)):(eu=e,e=u)}else eu=e,e=u;e!==u&&(t,e=function(r){return{type:"double_quote_string",value:r[1].join("")}}(e)),t=e}}}}return t}function ts(){var t;return jt.test(r.charAt(eu))?(t=r.charAt(eu),eu++):(t=u,0===au&&fu(xt)),t===u&&(t=ns()),t}function es(){var t;return It.test(r.charAt(eu))?(t=r.charAt(eu),eu++):(t=u,0===au&&fu(kt)),t===u&&(t=ns()),t}function ns(){var t,e,n,o,a,s,i,c,l,f;return t=eu,"\\'"===r.substr(eu,2)?(e="\\'",eu+=2):(e=u,0===au&&fu(Nt)),e!==u&&(t,e="\\'"),(t=e)===u&&(t=eu,'\\"'===r.substr(eu,2)?(e='\\"',eu+=2):(e=u,0===au&&fu(Rt)),e!==u&&(t,e='\\"'),(t=e)===u&&(t=eu,"\\\\"===r.substr(eu,2)?(e="\\\\",eu+=2):(e=u,0===au&&fu(Ot)),e!==u&&(t,e="\\\\"),(t=e)===u&&(t=eu,"\\/"===r.substr(eu,2)?(e="\\/",eu+=2):(e=u,0===au&&fu(Ut)),e!==u&&(t,e="\\/"),(t=e)===u&&(t=eu,"\\b"===r.substr(eu,2)?(e="\\b",eu+=2):(e=u,0===au&&fu(Mt)),e!==u&&(t,e="\b"),(t=e)===u&&(t=eu,"\\f"===r.substr(eu,2)?(e="\\f",eu+=2):(e=u,0===au&&fu(Dt)),e!==u&&(t,e="\f"),(t=e)===u&&(t=eu,"\\n"===r.substr(eu,2)?(e="\\n",eu+=2):(e=u,0===au&&fu(Pt)),e!==u&&(t,e="\n"),(t=e)===u&&(t=eu,"\\r"===r.substr(eu,2)?(e="\\r",eu+=2):(e=u,0===au&&fu($t)),e!==u&&(t,e="\r"),(t=e)===u&&(t=eu,"\\t"===r.substr(eu,2)?(e="\\t",eu+=2):(e=u,0===au&&fu(Ft)),e!==u&&(t,e="\t"),(t=e)===u&&(t=eu,"\\u"===r.substr(eu,2)?(e="\\u",eu+=2):(e=u,0===au&&fu(Ht)),e!==u&&(n=ls())!==u&&(o=ls())!==u&&(a=ls())!==u&&(s=ls())!==u?(t,i=n,c=o,l=a,f=s,t=e=String.fromCharCode(parseInt("0x"+i+c+l+f))):(eu=t,t=u),t===u&&(t=eu,92===r.charCodeAt(eu)?(e="\\",eu++):(e=u,0===au&&fu(Bt)),e!==u&&(t,e="\\"),(t=e)===u&&(t=eu,"''"===r.substr(eu,2)?(e="''",eu+=2):(e=u,0===au&&fu(Gt)),e!==u&&(t,e="''"),(t=e)===u&&(t=eu,'""'===r.substr(eu,2)?(e='""',eu+=2):(e=u,0===au&&fu(qt)),e!==u&&(t,e='""'),(t=e)===u&&(t=eu,"``"===r.substr(eu,2)?(e="``",eu+=2):(e=u,0===au&&fu(Wt)),e!==u&&(t,e="``"),t=e))))))))))))),t}function os(){var r,t,e;return r=eu,(t=function(){var r,t,e,n;r=eu,(t=us())!==u&&(e=as())!==u&&(n=ss())!==u?(r,r=t={type:"bigint",value:t+e+n}):(eu=r,r=u);r===u&&(r=eu,(t=us())!==u&&(e=as())!==u?(r,t=function(r,t){const e=r+t;return tc(r)?{type:"bigint",value:e}:parseFloat(e)}(t,e),r=t):(eu=r,r=u),r===u&&(r=eu,(t=us())!==u&&(e=ss())!==u?(r,t=function(r,t){return{type:"bigint",value:r+t}}(t,e),r=t):(eu=r,r=u),r===u&&(r=eu,(t=us())!==u&&(r,t=function(r){return tc(r)?{type:"bigint",value:r}:parseFloat(r)}(t)),r=t)));return r}())!==u&&(r,t=(e=t)&&"bigint"===e.type?e:{type:"number",value:e}),r=t}function us(){var t,e,n;return(t=is())===u&&(t=cs())===u&&(t=eu,45===r.charCodeAt(eu)?(e="-",eu++):(e=u,0===au&&fu(zr)),e===u&&(43===r.charCodeAt(eu)?(e="+",eu++):(e=u,0===au&&fu(Kr))),e!==u&&(n=is())!==u?(t,t=e=e+n):(eu=t,t=u),t===u&&(t=eu,45===r.charCodeAt(eu)?(e="-",eu++):(e=u,0===au&&fu(zr)),e===u&&(43===r.charCodeAt(eu)?(e="+",eu++):(e=u,0===au&&fu(Kr))),e!==u&&(n=cs())!==u?(t,t=e=function(r,t){return r+t}(e,n)):(eu=t,t=u))),t}function as(){var t,e,n,o;return t=eu,46===r.charCodeAt(eu)?(e=".",eu++):(e=u,0===au&&fu(Xt)),e!==u?((n=is())===u&&(n=null),n!==u?(t,t=e=(o=n)?"."+o:""):(eu=t,t=u)):(eu=t,t=u),t}function ss(){var t,e,n;return t=eu,(e=function(){var t,e,n;t=eu,Jt.test(r.charAt(eu))?(e=r.charAt(eu),eu++):(e=u,0===au&&fu(re));e!==u?(te.test(r.charAt(eu))?(n=r.charAt(eu),eu++):(n=u,0===au&&fu(ee)),n===u&&(n=null),n!==u?(t,t=e=e+(null!==(o=n)?o:"")):(eu=t,t=u)):(eu=t,t=u);var o;return t}())!==u&&(n=is())!==u?(t,t=e=e+n):(eu=t,t=u),t}function is(){var r,t,e;if(r=eu,t=[],(e=cs())!==u)for(;e!==u;)t.push(e),e=cs();else t=u;return t!==u&&(r,t=t.join("")),r=t}function cs(){var t;return Qt.test(r.charAt(eu))?(t=r.charAt(eu),eu++):(t=u,0===au&&fu(Kt)),t}function ls(){var t;return zt.test(r.charAt(eu))?(t=r.charAt(eu),eu++):(t=u,0===au&&fu(Zt)),t}function fs(){var t,e,n,o;return t=eu,"default"===r.substr(eu,7).toLowerCase()?(e=r.substr(eu,7),eu+=7):(e=u,0===au&&fu(O)),e!==u?(n=eu,au++,o=qa(),au--,o===u?n=void 0:(eu=n,n=u),n!==u?t=e=[e,n]:(eu=t,t=u)):(eu=t,t=u),t}function ps(){var t,e,n,o;return t=eu,"to"===r.substr(eu,2).toLowerCase()?(e=r.substr(eu,2),eu+=2):(e=u,0===au&&fu(ie)),e!==u?(n=eu,au++,o=qa(),au--,o===u?n=void 0:(eu=n,n=u),n!==u?t=e=[e,n]:(eu=t,t=u)):(eu=t,t=u),t}function bs(){var t,e,n,o;return t=eu,"show"===r.substr(eu,4).toLowerCase()?(e=r.substr(eu,4),eu+=4):(e=u,0===au&&fu(le)),e!==u?(n=eu,au++,o=qa(),au--,o===u?n=void 0:(eu=n,n=u),n!==u?t=e=[e,n]:(eu=t,t=u)):(eu=t,t=u),t}function vs(){var t,e,n,o;return t=eu,"drop"===r.substr(eu,4).toLowerCase()?(e=r.substr(eu,4),eu+=4):(e=u,0===au&&fu(fe)),e!==u?(n=eu,au++,o=qa(),au--,o===u?n=void 0:(eu=n,n=u),n!==u?(t,t=e="DROP"):(eu=t,t=u)):(eu=t,t=u),t}function ds(){var t,e,n,o;return t=eu,"update"===r.substr(eu,6).toLowerCase()?(e=r.substr(eu,6),eu+=6):(e=u,0===au&&fu(de)),e!==u?(n=eu,au++,o=qa(),au--,o===u?n=void 0:(eu=n,n=u),n!==u?t=e=[e,n]:(eu=t,t=u)):(eu=t,t=u),t}function ys(){var t,e,n,o;return t=eu,"create"===r.substr(eu,6).toLowerCase()?(e=r.substr(eu,6),eu+=6):(e=u,0===au&&fu(ye)),e!==u?(n=eu,au++,o=qa(),au--,o===u?n=void 0:(eu=n,n=u),n!==u?t=e=[e,n]:(eu=t,t=u)):(eu=t,t=u),t}function hs(){var t,e,n,o;return t=eu,"temporary"===r.substr(eu,9).toLowerCase()?(e=r.substr(eu,9),eu+=9):(e=u,0===au&&fu(he)),e!==u?(n=eu,au++,o=qa(),au--,o===u?n=void 0:(eu=n,n=u),n!==u?t=e=[e,n]:(eu=t,t=u)):(eu=t,t=u),t}function ms(){var t,e,n,o;return t=eu,"temp"===r.substr(eu,4).toLowerCase()?(e=r.substr(eu,4),eu+=4):(e=u,0===au&&fu(me)),e!==u?(n=eu,au++,o=qa(),au--,o===u?n=void 0:(eu=n,n=u),n!==u?t=e=[e,n]:(eu=t,t=u)):(eu=t,t=u),t}function ws(){var t,e,n,o;return t=eu,"delete"===r.substr(eu,6).toLowerCase()?(e=r.substr(eu,6),eu+=6):(e=u,0===au&&fu(we)),e!==u?(n=eu,au++,o=qa(),au--,o===u?n=void 0:(eu=n,n=u),n!==u?t=e=[e,n]:(eu=t,t=u)):(eu=t,t=u),t}function Ls(){var t,e,n,o;return t=eu,"insert"===r.substr(eu,6).toLowerCase()?(e=r.substr(eu,6),eu+=6):(e=u,0===au&&fu(Le)),e!==u?(n=eu,au++,o=qa(),au--,o===u?n=void 0:(eu=n,n=u),n!==u?t=e=[e,n]:(eu=t,t=u)):(eu=t,t=u),t}function Cs(){var t,e,n,o;return t=eu,"replace"===r.substr(eu,7).toLowerCase()?(e=r.substr(eu,7),eu+=7):(e=u,0===au&&fu(Ae)),e!==u?(n=eu,au++,o=qa(),au--,o===u?n=void 0:(eu=n,n=u),n!==u?t=e=[e,n]:(eu=t,t=u)):(eu=t,t=u),t}function As(){var t,e,n,o;return t=eu,"rename"===r.substr(eu,6).toLowerCase()?(e=r.substr(eu,6),eu+=6):(e=u,0===au&&fu(Ee)),e!==u?(n=eu,au++,o=qa(),au--,o===u?n=void 0:(eu=n,n=u),n!==u?t=e=[e,n]:(eu=t,t=u)):(eu=t,t=u),t}function Es(){var t,e,n,o;return t=eu,"ignore"===r.substr(eu,6).toLowerCase()?(e=r.substr(eu,6),eu+=6):(e=u,0===au&&fu(ge)),e!==u?(n=eu,au++,o=qa(),au--,o===u?n=void 0:(eu=n,n=u),n!==u?t=e=[e,n]:(eu=t,t=u)):(eu=t,t=u),t}function gs(){var t,e,n,o;return t=eu,"partition"===r.substr(eu,9).toLowerCase()?(e=r.substr(eu,9),eu+=9):(e=u,0===au&&fu(Te)),e!==u?(n=eu,au++,o=qa(),au--,o===u?n=void 0:(eu=n,n=u),n!==u?(t,t=e="PARTITION"):(eu=t,t=u)):(eu=t,t=u),t}function Ts(){var t,e,n,o;return t=eu,"into"===r.substr(eu,4).toLowerCase()?(e=r.substr(eu,4),eu+=4):(e=u,0===au&&fu(Se)),e!==u?(n=eu,au++,o=qa(),au--,o===u?n=void 0:(eu=n,n=u),n!==u?t=e=[e,n]:(eu=t,t=u)):(eu=t,t=u),t}function Ss(){var t,e,n,o;return t=eu,"set"===r.substr(eu,3).toLowerCase()?(e=r.substr(eu,3),eu+=3):(e=u,0===au&&fu(or)),e!==u?(n=eu,au++,o=qa(),au--,o===u?n=void 0:(eu=n,n=u),n!==u?(t,t=e="SET"):(eu=t,t=u)):(eu=t,t=u),t}function _s(){var t,e,n,o;return t=eu,"as"===r.substr(eu,2).toLowerCase()?(e=r.substr(eu,2),eu+=2):(e=u,0===au&&fu(xe)),e!==u?(n=eu,au++,o=qa(),au--,o===u?n=void 0:(eu=n,n=u),n!==u?t=e=[e,n]:(eu=t,t=u)):(eu=t,t=u),t}function js(){var t,e,n,o;return t=eu,"table"===r.substr(eu,5).toLowerCase()?(e=r.substr(eu,5),eu+=5):(e=u,0===au&&fu(Ie)),e!==u?(n=eu,au++,o=qa(),au--,o===u?n=void 0:(eu=n,n=u),n!==u?(t,t=e="TABLE"):(eu=t,t=u)):(eu=t,t=u),t}function xs(){var t,e,n,o;return t=eu,"tables"===r.substr(eu,6).toLowerCase()?(e=r.substr(eu,6),eu+=6):(e=u,0===au&&fu(ke)),e!==u?(n=eu,au++,o=qa(),au--,o===u?n=void 0:(eu=n,n=u),n!==u?(t,t=e="TABLES"):(eu=t,t=u)):(eu=t,t=u),t}function Is(){var t,e,n,o;return t=eu,"database"===r.substr(eu,8).toLowerCase()?(e=r.substr(eu,8),eu+=8):(e=u,0===au&&fu(Ne)),e!==u?(n=eu,au++,o=qa(),au--,o===u?n=void 0:(eu=n,n=u),n!==u?(t,t=e="DATABASE"):(eu=t,t=u)):(eu=t,t=u),t}function ks(){var t,e,n,o;return t=eu,"on"===r.substr(eu,2).toLowerCase()?(e=r.substr(eu,2),eu+=2):(e=u,0===au&&fu(v)),e!==u?(n=eu,au++,o=qa(),au--,o===u?n=void 0:(eu=n,n=u),n!==u?t=e=[e,n]:(eu=t,t=u)):(eu=t,t=u),t}function Ns(){var t,e,n,o;return t=eu,"join"===r.substr(eu,4).toLowerCase()?(e=r.substr(eu,4),eu+=4):(e=u,0===au&&fu(Me)),e!==u?(n=eu,au++,o=qa(),au--,o===u?n=void 0:(eu=n,n=u),n!==u?t=e=[e,n]:(eu=t,t=u)):(eu=t,t=u),t}function Rs(){var t,e,n,o;return t=eu,"values"===r.substr(eu,6).toLowerCase()?(e=r.substr(eu,6),eu+=6):(e=u,0===au&&fu(Fe)),e!==u?(n=eu,au++,o=qa(),au--,o===u?n=void 0:(eu=n,n=u),n!==u?t=e=[e,n]:(eu=t,t=u)):(eu=t,t=u),t}function Os(){var t,e,n,o;return t=eu,"using"===r.substr(eu,5).toLowerCase()?(e=r.substr(eu,5),eu+=5):(e=u,0===au&&fu(He)),e!==u?(n=eu,au++,o=qa(),au--,o===u?n=void 0:(eu=n,n=u),n!==u?t=e=[e,n]:(eu=t,t=u)):(eu=t,t=u),t}function Us(){var t,e,n,o;return t=eu,"with"===r.substr(eu,4).toLowerCase()?(e=r.substr(eu,4),eu+=4):(e=u,0===au&&fu(Rr)),e!==u?(n=eu,au++,o=qa(),au--,o===u?n=void 0:(eu=n,n=u),n!==u?t=e=[e,n]:(eu=t,t=u)):(eu=t,t=u),t}function Ms(){var t,e,n,o;return t=eu,"by"===r.substr(eu,2).toLowerCase()?(e=r.substr(eu,2),eu+=2):(e=u,0===au&&fu(qe)),e!==u?(n=eu,au++,o=qa(),au--,o===u?n=void 0:(eu=n,n=u),n!==u?t=e=[e,n]:(eu=t,t=u)):(eu=t,t=u),t}function Ds(){var t,e,n,o;return t=eu,"desc"===r.substr(eu,4).toLowerCase()?(e=r.substr(eu,4),eu+=4):(e=u,0===au&&fu(Ke)),e!==u?(n=eu,au++,o=qa(),au--,o===u?n=void 0:(eu=n,n=u),n!==u?(t,t=e="DESC"):(eu=t,t=u)):(eu=t,t=u),t}function Ps(){var t,e,n,o;return t=eu,"all"===r.substr(eu,3).toLowerCase()?(e=r.substr(eu,3),eu+=3):(e=u,0===au&&fu(Ze)),e!==u?(n=eu,au++,o=qa(),au--,o===u?n=void 0:(eu=n,n=u),n!==u?(t,t=e="ALL"):(eu=t,t=u)):(eu=t,t=u),t}function $s(){var t,e,n,o;return t=eu,"distinct"===r.substr(eu,8).toLowerCase()?(e=r.substr(eu,8),eu+=8):(e=u,0===au&&fu(Je)),e!==u?(n=eu,au++,o=qa(),au--,o===u?n=void 0:(eu=n,n=u),n!==u?(t,t=e="DISTINCT"):(eu=t,t=u)):(eu=t,t=u),t}function Fs(){var t,e,n,o;return t=eu,"between"===r.substr(eu,7).toLowerCase()?(e=r.substr(eu,7),eu+=7):(e=u,0===au&&fu(rn)),e!==u?(n=eu,au++,o=qa(),au--,o===u?n=void 0:(eu=n,n=u),n!==u?(t,t=e="BETWEEN"):(eu=t,t=u)):(eu=t,t=u),t}function Hs(){var t,e,n,o;return t=eu,"in"===r.substr(eu,2).toLowerCase()?(e=r.substr(eu,2),eu+=2):(e=u,0===au&&fu(tn)),e!==u?(n=eu,au++,o=qa(),au--,o===u?n=void 0:(eu=n,n=u),n!==u?(t,t=e="IN"):(eu=t,t=u)):(eu=t,t=u),t}function Bs(){var t,e,n,o;return t=eu,"is"===r.substr(eu,2).toLowerCase()?(e=r.substr(eu,2),eu+=2):(e=u,0===au&&fu(en)),e!==u?(n=eu,au++,o=qa(),au--,o===u?n=void 0:(eu=n,n=u),n!==u?(t,t=e="IS"):(eu=t,t=u)):(eu=t,t=u),t}function Gs(){var t,e,n,o;return t=eu,"like"===r.substr(eu,4).toLowerCase()?(e=r.substr(eu,4),eu+=4):(e=u,0===au&&fu(nn)),e!==u?(n=eu,au++,o=qa(),au--,o===u?n=void 0:(eu=n,n=u),n!==u?(t,t=e="LIKE"):(eu=t,t=u)):(eu=t,t=u),t}function qs(){var t,e,n,o;return t=eu,"exists"===r.substr(eu,6).toLowerCase()?(e=r.substr(eu,6),eu+=6):(e=u,0===au&&fu(an)),e!==u?(n=eu,au++,o=qa(),au--,o===u?n=void 0:(eu=n,n=u),n!==u?(t,t=e="EXISTS"):(eu=t,t=u)):(eu=t,t=u),t}function Ws(){var t,e,n,o;return t=eu,"not"===r.substr(eu,3).toLowerCase()?(e=r.substr(eu,3),eu+=3):(e=u,0===au&&fu(Y)),e!==u?(n=eu,au++,o=qa(),au--,o===u?n=void 0:(eu=n,n=u),n!==u?(t,t=e="NOT"):(eu=t,t=u)):(eu=t,t=u),t}function Ys(){var t,e,n,o;return t=eu,"and"===r.substr(eu,3).toLowerCase()?(e=r.substr(eu,3),eu+=3):(e=u,0===au&&fu(sn)),e!==u?(n=eu,au++,o=qa(),au--,o===u?n=void 0:(eu=n,n=u),n!==u?(t,t=e="AND"):(eu=t,t=u)):(eu=t,t=u),t}function Vs(){var t,e,n,o;return t=eu,"or"===r.substr(eu,2).toLowerCase()?(e=r.substr(eu,2),eu+=2):(e=u,0===au&&fu(cn)),e!==u?(n=eu,au++,o=qa(),au--,o===u?n=void 0:(eu=n,n=u),n!==u?(t,t=e="OR"):(eu=t,t=u)):(eu=t,t=u),t}function Xs(){var t,e,n,o;return t=eu,"case"===r.substr(eu,4).toLowerCase()?(e=r.substr(eu,4),eu+=4):(e=u,0===au&&fu(yn)),e!==u?(n=eu,au++,o=qa(),au--,o===u?n=void 0:(eu=n,n=u),n!==u?t=e=[e,n]:(eu=t,t=u)):(eu=t,t=u),t}function Qs(){var t,e,n,o;return t=eu,"when"===r.substr(eu,4).toLowerCase()?(e=r.substr(eu,4),eu+=4):(e=u,0===au&&fu(hn)),e!==u?(n=eu,au++,o=qa(),au--,o===u?n=void 0:(eu=n,n=u),n!==u?t=e=[e,n]:(eu=t,t=u)):(eu=t,t=u),t}function Ks(){var t,e,n,o;return t=eu,"end"===r.substr(eu,3).toLowerCase()?(e=r.substr(eu,3),eu+=3):(e=u,0===au&&fu(m)),e!==u?(n=eu,au++,o=qa(),au--,o===u?n=void 0:(eu=n,n=u),n!==u?t=e=[e,n]:(eu=t,t=u)):(eu=t,t=u),t}function zs(){var t,e,n,o;return t=eu,"cast"===r.substr(eu,4).toLowerCase()?(e=r.substr(eu,4),eu+=4):(e=u,0===au&&fu(Ln)),e!==u?(n=eu,au++,o=qa(),au--,o===u?n=void 0:(eu=n,n=u),n!==u?(t,t=e="CAST"):(eu=t,t=u)):(eu=t,t=u),t}function Zs(){var t,e,n,o;return t=eu,"char"===r.substr(eu,4).toLowerCase()?(e=r.substr(eu,4),eu+=4):(e=u,0===au&&fu(An)),e!==u?(n=eu,au++,o=qa(),au--,o===u?n=void 0:(eu=n,n=u),n!==u?(t,t=e="CHAR"):(eu=t,t=u)):(eu=t,t=u),t}function Js(){var t,e,n,o;return t=eu,"varchar"===r.substr(eu,7).toLowerCase()?(e=r.substr(eu,7),eu+=7):(e=u,0===au&&fu(En)),e!==u?(n=eu,au++,o=qa(),au--,o===u?n=void 0:(eu=n,n=u),n!==u?(t,t=e="VARCHAR"):(eu=t,t=u)):(eu=t,t=u),t}function ri(){var t,e,n,o;return t=eu,"numeric"===r.substr(eu,7).toLowerCase()?(e=r.substr(eu,7),eu+=7):(e=u,0===au&&fu(gn)),e!==u?(n=eu,au++,o=qa(),au--,o===u?n=void 0:(eu=n,n=u),n!==u?(t,t=e="NUMERIC"):(eu=t,t=u)):(eu=t,t=u),t}function ti(){var t,e,n,o;return t=eu,"decimal"===r.substr(eu,7).toLowerCase()?(e=r.substr(eu,7),eu+=7):(e=u,0===au&&fu(Tn)),e!==u?(n=eu,au++,o=qa(),au--,o===u?n=void 0:(eu=n,n=u),n!==u?(t,t=e="DECIMAL"):(eu=t,t=u)):(eu=t,t=u),t}function ei(){var t,e,n,o;return t=eu,"unsigned"===r.substr(eu,8).toLowerCase()?(e=r.substr(eu,8),eu+=8):(e=u,0===au&&fu(_n)),e!==u?(n=eu,au++,o=qa(),au--,o===u?n=void 0:(eu=n,n=u),n!==u?(t,t=e="UNSIGNED"):(eu=t,t=u)):(eu=t,t=u),t}function ni(){var t,e,n,o;return t=eu,"int"===r.substr(eu,3).toLowerCase()?(e=r.substr(eu,3),eu+=3):(e=u,0===au&&fu(jn)),e!==u?(n=eu,au++,o=qa(),au--,o===u?n=void 0:(eu=n,n=u),n!==u?(t,t=e="INT"):(eu=t,t=u)):(eu=t,t=u),t}function oi(){var t,e,n,o;return t=eu,"integer"===r.substr(eu,7).toLowerCase()?(e=r.substr(eu,7),eu+=7):(e=u,0===au&&fu(In)),e!==u?(n=eu,au++,o=qa(),au--,o===u?n=void 0:(eu=n,n=u),n!==u?(t,t=e="INTEGER"):(eu=t,t=u)):(eu=t,t=u),t}function ui(){var t,e,n,o;return t=eu,"smallint"===r.substr(eu,8).toLowerCase()?(e=r.substr(eu,8),eu+=8):(e=u,0===au&&fu(Nn)),e!==u?(n=eu,au++,o=qa(),au--,o===u?n=void 0:(eu=n,n=u),n!==u?(t,t=e="SMALLINT"):(eu=t,t=u)):(eu=t,t=u),t}function ai(){var t,e,n,o;return t=eu,"tinyint"===r.substr(eu,7).toLowerCase()?(e=r.substr(eu,7),eu+=7):(e=u,0===au&&fu(Rn)),e!==u?(n=eu,au++,o=qa(),au--,o===u?n=void 0:(eu=n,n=u),n!==u?(t,t=e="TINYINT"):(eu=t,t=u)):(eu=t,t=u),t}function si(){var t,e,n,o;return t=eu,"bigint"===r.substr(eu,6).toLowerCase()?(e=r.substr(eu,6),eu+=6):(e=u,0===au&&fu(Pn)),e!==u?(n=eu,au++,o=qa(),au--,o===u?n=void 0:(eu=n,n=u),n!==u?(t,t=e="BIGINT"):(eu=t,t=u)):(eu=t,t=u),t}function ii(){var t,e,n,o;return t=eu,"float"===r.substr(eu,5).toLowerCase()?(e=r.substr(eu,5),eu+=5):(e=u,0===au&&fu(Fn)),e!==u?(n=eu,au++,o=qa(),au--,o===u?n=void 0:(eu=n,n=u),n!==u?(t,t=e="FLOAT"):(eu=t,t=u)):(eu=t,t=u),t}function ci(){var t,e,n,o;return t=eu,"double"===r.substr(eu,6).toLowerCase()?(e=r.substr(eu,6),eu+=6):(e=u,0===au&&fu(Hn)),e!==u?(n=eu,au++,o=qa(),au--,o===u?n=void 0:(eu=n,n=u),n!==u?(t,t=e="DOUBLE"):(eu=t,t=u)):(eu=t,t=u),t}function li(){var t,e,n,o;return t=eu,"real"===r.substr(eu,4).toLowerCase()?(e=r.substr(eu,4),eu+=4):(e=u,0===au&&fu(Bn)),e!==u?(n=eu,au++,o=qa(),au--,o===u?n=void 0:(eu=n,n=u),n!==u?(t,t=e="REAL"):(eu=t,t=u)):(eu=t,t=u),t}function fi(){var t,e,n,o;return t=eu,"date"===r.substr(eu,4).toLowerCase()?(e=r.substr(eu,4),eu+=4):(e=u,0===au&&fu(Gn)),e!==u?(n=eu,au++,o=qa(),au--,o===u?n=void 0:(eu=n,n=u),n!==u?(t,t=e="DATE"):(eu=t,t=u)):(eu=t,t=u),t}function pi(){var t,e,n,o;return t=eu,"datetime"===r.substr(eu,8).toLowerCase()?(e=r.substr(eu,8),eu+=8):(e=u,0===au&&fu(qn)),e!==u?(n=eu,au++,o=qa(),au--,o===u?n=void 0:(eu=n,n=u),n!==u?(t,t=e="DATETIME"):(eu=t,t=u)):(eu=t,t=u),t}function bi(){var t,e,n,o;return t=eu,"time"===r.substr(eu,4).toLowerCase()?(e=r.substr(eu,4),eu+=4):(e=u,0===au&&fu(Wn)),e!==u?(n=eu,au++,o=qa(),au--,o===u?n=void 0:(eu=n,n=u),n!==u?(t,t=e="TIME"):(eu=t,t=u)):(eu=t,t=u),t}function vi(){var t,e,n,o;return t=eu,"timestamp"===r.substr(eu,9).toLowerCase()?(e=r.substr(eu,9),eu+=9):(e=u,0===au&&fu(Yn)),e!==u?(n=eu,au++,o=qa(),au--,o===u?n=void 0:(eu=n,n=u),n!==u?(t,t=e="TIMESTAMP"):(eu=t,t=u)):(eu=t,t=u),t}function di(){var t,e,n,o;return t=eu,"current_timestamp"===r.substr(eu,17).toLowerCase()?(e=r.substr(eu,17),eu+=17):(e=u,0===au&&fu(oo)),e!==u?(n=eu,au++,o=qa(),au--,o===u?n=void 0:(eu=n,n=u),n!==u?(t,t=e="CURRENT_TIMESTAMP"):(eu=t,t=u)):(eu=t,t=u),t}function yi(){var t;return 64===r.charCodeAt(eu)?(t="@",eu++):(t=u,0===au&&fu(bo)),t}function hi(){var t;return(t=function(){var t;return"@@"===r.substr(eu,2)?(t="@@",eu+=2):(t=u,0===au&&fu(vo)),t}())===u&&(t=yi())===u&&(t=function(){var t;return 36===r.charCodeAt(eu)?(t="$",eu++):(t=u,0===au&&fu(yo)),t}()),t}function mi(){var t;return 61===r.charCodeAt(eu)?(t="=",eu++):(t=u,0===au&&fu(Pr)),t}function wi(){var t,e,n,o;return t=eu,"column"===r.substr(eu,6).toLowerCase()?(e=r.substr(eu,6),eu+=6):(e=u,0===au&&fu(Co)),e!==u?(n=eu,au++,o=qa(),au--,o===u?n=void 0:(eu=n,n=u),n!==u?(t,t=e="COLUMN"):(eu=t,t=u)):(eu=t,t=u),t}function Li(){var t,e,n,o;return t=eu,"index"===r.substr(eu,5).toLowerCase()?(e=r.substr(eu,5),eu+=5):(e=u,0===au&&fu(Ao)),e!==u?(n=eu,au++,o=qa(),au--,o===u?n=void 0:(eu=n,n=u),n!==u?(t,t=e="INDEX"):(eu=t,t=u)):(eu=t,t=u),t}function Ci(){var t,e,n,o;return t=eu,"key"===r.substr(eu,3).toLowerCase()?(e=r.substr(eu,3),eu+=3):(e=u,0===au&&fu(x)),e!==u?(n=eu,au++,o=qa(),au--,o===u?n=void 0:(eu=n,n=u),n!==u?(t,t=e="KEY"):(eu=t,t=u)):(eu=t,t=u),t}function Ai(){var t,e,n,o;return t=eu,"comment"===r.substr(eu,7).toLowerCase()?(e=r.substr(eu,7),eu+=7):(e=u,0===au&&fu(To)),e!==u?(n=eu,au++,o=qa(),au--,o===u?n=void 0:(eu=n,n=u),n!==u?(t,t=e="COMMENT"):(eu=t,t=u)):(eu=t,t=u),t}function Ei(){var t;return 46===r.charCodeAt(eu)?(t=".",eu++):(t=u,0===au&&fu(Xt)),t}function gi(){var t;return 44===r.charCodeAt(eu)?(t=",",eu++):(t=u,0===au&&fu(Oo)),t}function Ti(){var t;return 42===r.charCodeAt(eu)?(t="*",eu++):(t=u,0===au&&fu(Zr)),t}function Si(){var t;return 40===r.charCodeAt(eu)?(t="(",eu++):(t=u,0===au&&fu(xr)),t}function _i(){var t;return 41===r.charCodeAt(eu)?(t=")",eu++):(t=u,0===au&&fu(Ir)),t}function ji(){var t;return 59===r.charCodeAt(eu)?(t=";",eu++):(t=u,0===au&&fu(Do)),t}function xi(){var t;return"->"===r.substr(eu,2)?(t="->",eu+=2):(t=u,0===au&&fu(Po)),t}function Ii(){var t;return"->>"===r.substr(eu,3)?(t="->>",eu+=3):(t=u,0===au&&fu($o)),t}function ki(){var t;return(t=function(){var t;return"||"===r.substr(eu,2)?(t="||",eu+=2):(t=u,0===au&&fu(tt)),t}())===u&&(t=function(){var t;return"&&"===r.substr(eu,2)?(t="&&",eu+=2):(t=u,0===au&&fu(Fo)),t}()),t}function Ni(){var r,t;for(r=[],(t=Di())===u&&(t=Oi());t!==u;)r.push(t),(t=Di())===u&&(t=Oi());return r}function Ri(){var r,t;if(r=[],(t=Di())===u&&(t=Oi()),t!==u)for(;t!==u;)r.push(t),(t=Di())===u&&(t=Oi());else r=u;return r}function Oi(){var t;return(t=function(){var t,e,n,o,a,s;t=eu,"/*"===r.substr(eu,2)?(e="/*",eu+=2):(e=u,0===au&&fu(Ho));if(e!==u){for(n=[],o=eu,a=eu,au++,"*/"===r.substr(eu,2)?(s="*/",eu+=2):(s=u,0===au&&fu(Bo)),au--,s===u?a=void 0:(eu=a,a=u),a!==u&&(s=Mi())!==u?o=a=[a,s]:(eu=o,o=u);o!==u;)n.push(o),o=eu,a=eu,au++,"*/"===r.substr(eu,2)?(s="*/",eu+=2):(s=u,0===au&&fu(Bo)),au--,s===u?a=void 0:(eu=a,a=u),a!==u&&(s=Mi())!==u?o=a=[a,s]:(eu=o,o=u);n!==u?("*/"===r.substr(eu,2)?(o="*/",eu+=2):(o=u,0===au&&fu(Bo)),o!==u?t=e=[e,n,o]:(eu=t,t=u)):(eu=t,t=u)}else eu=t,t=u;return t}())===u&&(t=function(){var t,e,n,o,a,s;t=eu,"--"===r.substr(eu,2)?(e="--",eu+=2):(e=u,0===au&&fu(Go));if(e!==u){for(n=[],o=eu,a=eu,au++,s=Pi(),au--,s===u?a=void 0:(eu=a,a=u),a!==u&&(s=Mi())!==u?o=a=[a,s]:(eu=o,o=u);o!==u;)n.push(o),o=eu,a=eu,au++,s=Pi(),au--,s===u?a=void 0:(eu=a,a=u),a!==u&&(s=Mi())!==u?o=a=[a,s]:(eu=o,o=u);n!==u?t=e=[e,n]:(eu=t,t=u)}else eu=t,t=u;return t}())===u&&(t=function(){var t,e,n,o,a,s;t=eu,35===r.charCodeAt(eu)?(e="#",eu++):(e=u,0===au&&fu(qo));if(e!==u){for(n=[],o=eu,a=eu,au++,s=Pi(),au--,s===u?a=void 0:(eu=a,a=u),a!==u&&(s=Mi())!==u?o=a=[a,s]:(eu=o,o=u);o!==u;)n.push(o),o=eu,a=eu,au++,s=Pi(),au--,s===u?a=void 0:(eu=a,a=u),a!==u&&(s=Mi())!==u?o=a=[a,s]:(eu=o,o=u);n!==u?t=e=[e,n]:(eu=t,t=u)}else eu=t,t=u;return t}()),t}function Ui(){var r,t,e,n,o,a,s;return r=eu,(t=Ai())!==u&&Ni()!==u?((e=mi())===u&&(e=null),e!==u&&Ni()!==u&&(n=rs())!==u?(r,a=e,s=n,r=t={type:(o=t).toLowerCase(),keyword:o.toLowerCase(),symbol:a,value:s}):(eu=r,r=u)):(eu=r,r=u),r}function Mi(){var t;return r.length>eu?(t=r.charAt(eu),eu++):(t=u,0===au&&fu(Wo)),t}function Di(){var t;return Yo.test(r.charAt(eu))?(t=r.charAt(eu),eu++):(t=u,0===au&&fu(Vo)),t}function Pi(){var t,e;if((t=function(){var t,e;t=eu,au++,r.length>eu?(e=r.charAt(eu),eu++):(e=u,0===au&&fu(Wo));au--,e===u?t=void 0:(eu=t,t=u);return t}())===u)if(t=[],Yt.test(r.charAt(eu))?(e=r.charAt(eu),eu++):(e=u,0===au&&fu(Vt)),e!==u)for(;e!==u;)t.push(e),Yt.test(r.charAt(eu))?(e=r.charAt(eu),eu++):(e=u,0===au&&fu(Vt));else t=u;return t}function $i(){var t,e;return t=eu,eu,ac=[],(!0?void 0:u)!==u&&Ni()!==u?((e=Fi())===u&&(e=function(){var t,e;t=eu,function(){var t;return"return"===r.substr(eu,6).toLowerCase()?(t=r.substr(eu,6),eu+=6):(t=u,0===au&&fu(ho)),t}()!==u&&Ni()!==u&&(e=Hi())!==u?(t,t={type:"return",expr:e}):(eu=t,t=u);return t}()),e!==u?(t,t={stmt:e,vars:ac}):(eu=t,t=u)):(eu=t,t=u),t}function Fi(){var t,e,n,o;return t=eu,(e=Xi())===u&&(e=Qi()),e!==u&&Ni()!==u?((n=function(){var t;return":="===r.substr(eu,2)?(t=":=",eu+=2):(t=u,0===au&&fu(mo)),t}())===u&&(n=mi()),n!==u&&Ni()!==u&&(o=Hi())!==u?(t,t=e={type:"assign",left:e,symbol:n,right:o}):(eu=t,t=u)):(eu=t,t=u),t}function Hi(){var t;return(t=Uu())===u&&(t=function(){var r,t,e,n,o;r=eu,(t=Xi())!==u&&Ni()!==u&&(e=Zu())!==u&&Ni()!==u&&(n=Xi())!==u&&Ni()!==u&&(o=ta())!==u?(r,r=t={type:"join",ltable:t,rtable:n,op:e,on:o}):(eu=r,r=u);return r}())===u&&(t=Bi())===u&&(t=function(){var t,e;t=eu,function(){var t;return 91===r.charCodeAt(eu)?(t="[",eu++):(t=u,0===au&&fu(Uo)),t}()!==u&&Ni()!==u&&(e=Vi())!==u&&Ni()!==u&&function(){var t;return 93===r.charCodeAt(eu)?(t="]",eu++):(t=u,0===au&&fu(Mo)),t}()!==u?(t,t={type:"array",value:e}):(eu=t,t=u);return t}()),t}function Bi(){var r,t,e,n,o,a,s,i;if(r=eu,(t=Gi())!==u){for(e=[],n=eu,(o=Ni())!==u&&(a=Na())!==u&&(s=Ni())!==u&&(i=Gi())!==u?n=o=[o,a,s,i]:(eu=n,n=u);n!==u;)e.push(n),n=eu,(o=Ni())!==u&&(a=Na())!==u&&(s=Ni())!==u&&(i=Gi())!==u?n=o=[o,a,s,i]:(eu=n,n=u);e!==u?(r,r=t=Fr(t,e)):(eu=r,r=u)}else eu=r,r=u;return r}function Gi(){var r,t,e,n,o,a,s,i;if(r=eu,(t=qi())!==u){for(e=[],n=eu,(o=Ni())!==u&&(a=Oa())!==u&&(s=Ni())!==u&&(i=qi())!==u?n=o=[o,a,s,i]:(eu=n,n=u);n!==u;)e.push(n),n=eu,(o=Ni())!==u&&(a=Oa())!==u&&(s=Ni())!==u&&(i=qi())!==u?n=o=[o,a,s,i]:(eu=n,n=u);e!==u?(r,r=t=Fr(t,e)):(eu=r,r=u)}else eu=r,r=u;return r}function qi(){var r,t,e;return(r=Za())===u&&(r=Xi())===u&&(r=Yi())===u&&(r=Va())===u&&(r=eu,Si()!==u&&Ni()!==u&&(t=Bi())!==u&&Ni()!==u&&_i()!==u?(r,(e=t).parentheses=!0,r=e):(eu=r,r=u)),r}function Wi(){var r,t,e,n,o,a,s;return r=eu,(t=Ga())!==u?(e=eu,(n=Ni())!==u&&(o=Ei())!==u&&(a=Ni())!==u&&(s=Ga())!==u?e=n=[n,o,a,s]:(eu=e,e=u),e===u&&(e=null),e!==u?(r,r=t=function(r,t){let e=r;return null!==t&&(e=`${r}.${t[3]}`),e}(t,e)):(eu=r,r=u)):(eu=r,r=u),r}function Yi(){var r,t,e;return r=eu,(t=Wi())!==u&&Ni()!==u&&Si()!==u&&Ni()!==u?((e=Vi())===u&&(e=null),e!==u&&Ni()!==u&&_i()!==u?(r,r=t={type:"function",name:t,args:{type:"expr_list",value:e}}):(eu=r,r=u)):(eu=r,r=u),r===u&&(r=eu,(t=Wi())!==u&&(r,t=function(r){return{type:"function",name:r,args:null}}(t)),r=t),r}function Vi(){var r,t,e,n,o,a,s,i;if(r=eu,(t=qi())!==u){for(e=[],n=eu,(o=Ni())!==u&&(a=gi())!==u&&(s=Ni())!==u&&(i=qi())!==u?n=o=[o,a,s,i]:(eu=n,n=u);n!==u;)e.push(n),n=eu,(o=Ni())!==u&&(a=gi())!==u&&(s=Ni())!==u&&(i=qi())!==u?n=o=[o,a,s,i]:(eu=n,n=u);e!==u?(r,r=t=T(t,e)):(eu=r,r=u)}else eu=r,r=u;return r}function Xi(){var r,t,e,n,o;return r=eu,(t=hi())!==u&&(e=Qi())!==u?(r,n=t,o=e,r=t={type:"var",...o,prefix:n}):(eu=r,r=u),r}function Qi(){var t,e,n,o,a;return t=eu,(e=Ga())!==u&&(n=function(){var t,e,n,o,a;t=eu,e=[],n=eu,46===r.charCodeAt(eu)?(o=".",eu++):(o=u,0===au&&fu(Xt));o!==u&&(a=Ga())!==u?n=o=[o,a]:(eu=n,n=u);for(;n!==u;)e.push(n),n=eu,46===r.charCodeAt(eu)?(o=".",eu++):(o=u,0===au&&fu(Xt)),o!==u&&(a=Ga())!==u?n=o=[o,a]:(eu=n,n=u);e!==u&&(t,e=function(r){const t=[];for(let e=0;e<r.length;e++)t.push(r[e][1]);return t}(e));return t=e}())!==u?(t,o=e,a=n,ac.push(o),t=e={type:"var",name:o,members:a,prefix:null}):(eu=t,t=u),t===u&&(t=eu,(e=os())!==u&&(t,e={type:"var",name:e.value,members:[],quoted:null,prefix:null}),t=e),t}function Ki(){var t;return(t=function(){var t,e,n,o;t=eu,(e=Zs())===u&&(e=Js());if(e!==u)if(Ni()!==u)if(Si()!==u)if(Ni()!==u){if(n=[],Qt.test(r.charAt(eu))?(o=r.charAt(eu),eu++):(o=u,0===au&&fu(Kt)),o!==u)for(;o!==u;)n.push(o),Qt.test(r.charAt(eu))?(o=r.charAt(eu),eu++):(o=u,0===au&&fu(Kt));else n=u;n!==u&&(o=Ni())!==u&&_i()!==u?(t,e={dataType:e,length:parseInt(n.join(""),10),parentheses:!0},t=e):(eu=t,t=u)}else eu=t,t=u;else eu=t,t=u;else eu=t,t=u;else eu=t,t=u;t===u&&(t=eu,(e=Zs())!==u&&(t,e=Jo(e)),(t=e)===u&&(t=eu,(e=Js())!==u&&(t,e=Jo(e)),t=e));return t}())===u&&(t=function(){var t,e,n,o,a,s,i,c,l,f,p,b;t=eu,(e=ri())===u&&(e=ti())===u&&(e=ni())===u&&(e=oi())===u&&(e=ui())===u&&(e=ai())===u&&(e=si())===u&&(e=ii())===u&&(e=ci())===u&&(e=function(){var t,e,n,o;return t=eu,"bit"===r.substr(eu,3).toLowerCase()?(e=r.substr(eu,3),eu+=3):(e=u,0===au&&fu(Cn)),e!==u?(n=eu,au++,o=qa(),au--,o===u?n=void 0:(eu=n,n=u),n!==u?(t,t=e="BIT"):(eu=t,t=u)):(eu=t,t=u),t}())===u&&(e=li());if(e!==u)if((n=Ni())!==u)if((o=Si())!==u)if((a=Ni())!==u){if(s=[],Qt.test(r.charAt(eu))?(i=r.charAt(eu),eu++):(i=u,0===au&&fu(Kt)),i!==u)for(;i!==u;)s.push(i),Qt.test(r.charAt(eu))?(i=r.charAt(eu),eu++):(i=u,0===au&&fu(Kt));else s=u;if(s!==u)if((i=Ni())!==u){if(c=eu,(l=gi())!==u)if((f=Ni())!==u){if(p=[],Qt.test(r.charAt(eu))?(b=r.charAt(eu),eu++):(b=u,0===au&&fu(Kt)),b!==u)for(;b!==u;)p.push(b),Qt.test(r.charAt(eu))?(b=r.charAt(eu),eu++):(b=u,0===au&&fu(Kt));else p=u;p!==u?c=l=[l,f,p]:(eu=c,c=u)}else eu=c,c=u;else eu=c,c=u;c===u&&(c=null),c!==u&&(l=Ni())!==u&&(f=_i())!==u&&(p=Ni())!==u?((b=zi())===u&&(b=null),b!==u?(t,v=c,d=b,e={dataType:e,length:parseInt(s.join(""),10),scale:v&&parseInt(v[2].join(""),10),parentheses:!0,suffix:d},t=e):(eu=t,t=u)):(eu=t,t=u)}else eu=t,t=u;else eu=t,t=u}else eu=t,t=u;else eu=t,t=u;else eu=t,t=u;else eu=t,t=u;var v,d;if(t===u){if(t=eu,(e=ri())===u&&(e=ti())===u&&(e=ni())===u&&(e=oi())===u&&(e=ui())===u&&(e=ai())===u&&(e=si())===u&&(e=ii())===u&&(e=ci())===u&&(e=li()),e!==u){if(n=[],Qt.test(r.charAt(eu))?(o=r.charAt(eu),eu++):(o=u,0===au&&fu(Kt)),o!==u)for(;o!==u;)n.push(o),Qt.test(r.charAt(eu))?(o=r.charAt(eu),eu++):(o=u,0===au&&fu(Kt));else n=u;n!==u&&(o=Ni())!==u?((a=zi())===u&&(a=null),a!==u?(t,e=function(r,t,e){return{dataType:r,length:parseInt(t.join(""),10),suffix:e}}(e,n,a),t=e):(eu=t,t=u)):(eu=t,t=u)}else eu=t,t=u;t===u&&(t=eu,(e=ri())===u&&(e=ti())===u&&(e=ni())===u&&(e=oi())===u&&(e=ui())===u&&(e=ai())===u&&(e=si())===u&&(e=ii())===u&&(e=ci())===u&&(e=li()),e!==u&&(n=Ni())!==u?((o=zi())===u&&(o=null),o!==u&&(a=Ni())!==u?(t,e=function(r,t){return{dataType:r,suffix:t}}(e,o),t=e):(eu=t,t=u)):(eu=t,t=u))}return t}())===u&&(t=function(){var t,e,n,o;t=eu,(e=fi())===u&&(e=pi())===u&&(e=bi())===u&&(e=vi());e!==u&&Ni()!==u&&Si()!==u&&Ni()!==u?(ru.test(r.charAt(eu))?(n=r.charAt(eu),eu++):(n=u,0===au&&fu(tu)),n!==u&&Ni()!==u&&_i()!==u&&Ni()!==u?((o=zi())===u&&(o=null),o!==u?(t,e={dataType:e,length:parseInt(n,10),parentheses:!0},t=e):(eu=t,t=u)):(eu=t,t=u)):(eu=t,t=u);t===u&&(t=eu,(e=fi())===u&&(e=pi())===u&&(e=bi())===u&&(e=vi()),e!==u&&(t,e=Jo(e)),t=e);return t}())===u&&(t=function(){var t,e;t=eu,(e=function(){var t,e,n,o;return t=eu,"json"===r.substr(eu,4).toLowerCase()?(e=r.substr(eu,4),eu+=4):(e=u,0===au&&fu(kn)),e!==u?(n=eu,au++,o=qa(),au--,o===u?n=void 0:(eu=n,n=u),n!==u?(t,t=e="JSON"):(eu=t,t=u)):(eu=t,t=u),t}())!==u&&(t,e=Jo(e));return t=e}())===u&&(t=function(){var t,e;t=eu,(e=function(){var t,e,n,o;return t=eu,"tinytext"===r.substr(eu,8).toLowerCase()?(e=r.substr(eu,8),eu+=8):(e=u,0===au&&fu(On)),e!==u?(n=eu,au++,o=qa(),au--,o===u?n=void 0:(eu=n,n=u),n!==u?(t,t=e="TINYTEXT"):(eu=t,t=u)):(eu=t,t=u),t}())===u&&(e=function(){var t,e,n,o;return t=eu,"text"===r.substr(eu,4).toLowerCase()?(e=r.substr(eu,4),eu+=4):(e=u,0===au&&fu(Un)),e!==u?(n=eu,au++,o=qa(),au--,o===u?n=void 0:(eu=n,n=u),n!==u?(t,t=e="TEXT"):(eu=t,t=u)):(eu=t,t=u),t}())===u&&(e=function(){var t,e,n,o;return t=eu,"mediumtext"===r.substr(eu,10).toLowerCase()?(e=r.substr(eu,10),eu+=10):(e=u,0===au&&fu(Mn)),e!==u?(n=eu,au++,o=qa(),au--,o===u?n=void 0:(eu=n,n=u),n!==u?(t,t=e="MEDIUMTEXT"):(eu=t,t=u)):(eu=t,t=u),t}())===u&&(e=function(){var t,e,n,o;return t=eu,"longtext"===r.substr(eu,8).toLowerCase()?(e=r.substr(eu,8),eu+=8):(e=u,0===au&&fu(Dn)),e!==u?(n=eu,au++,o=qa(),au--,o===u?n=void 0:(eu=n,n=u),n!==u?(t,t=e="LONGTEXT"):(eu=t,t=u)):(eu=t,t=u),t}());e!==u&&(t,e={dataType:e});return t=e}())===u&&(t=function(){var t,e,n;t=eu,(e=function(){var t,e,n,o;return t=eu,"enum"===r.substr(eu,4).toLowerCase()?(e=r.substr(eu,4),eu+=4):(e=u,0===au&&fu($n)),e!==u?(n=eu,au++,o=qa(),au--,o===u?n=void 0:(eu=n,n=u),n!==u?(t,t=e="ENUM"):(eu=t,t=u)):(eu=t,t=u),t}())!==u&&Ni()!==u&&(n=va())!==u?(t,o=e,(a=n).parentheses=!0,t=e={dataType:o,expr:a}):(eu=t,t=u);var o,a;return t}())===u&&(t=function(){var t,e;t=eu,"boolean"===r.substr(eu,7).toLowerCase()?(e=r.substr(eu,7),eu+=7):(e=u,0===au&&fu(Zo));e!==u&&(t,e={dataType:"BOOLEAN"});return t=e}())===u&&(t=function(){var t,e;t=eu,"blob"===r.substr(eu,4).toLowerCase()?(e=r.substr(eu,4),eu+=4):(e=u,0===au&&fu(Xo));e===u&&("tinyblob"===r.substr(eu,8).toLowerCase()?(e=r.substr(eu,8),eu+=8):(e=u,0===au&&fu(Qo)),e===u&&("mediumblob"===r.substr(eu,10).toLowerCase()?(e=r.substr(eu,10),eu+=10):(e=u,0===au&&fu(Ko)),e===u&&("longblob"===r.substr(eu,8).toLowerCase()?(e=r.substr(eu,8),eu+=8):(e=u,0===au&&fu(zo)))));e!==u&&(t,e={dataType:e.toUpperCase()});return t=e}()),t}function zi(){var t,e,n;return t=eu,(e=ei())===u&&(e=null),e!==u&&Ni()!==u?((n=function(){var t,e,n,o;return t=eu,"zerofill"===r.substr(eu,8).toLowerCase()?(e=r.substr(eu,8),eu+=8):(e=u,0===au&&fu(xn)),e!==u?(n=eu,au++,o=qa(),au--,o===u?n=void 0:(eu=n,n=u),n!==u?(t,t=e="ZEROFILL"):(eu=t,t=u)):(eu=t,t=u),t}())===u&&(n=null),n!==u?(t,t=e=function(r,t){const e=[];return r&&e.push(r),t&&e.push(t),e}(e,n)):(eu=t,t=u)):(eu=t,t=u),t}const Zi={ALTER:!0,ALL:!0,ADD:!0,AND:!0,AS:!0,ASC:!0,BETWEEN:!0,BY:!0,CALL:!0,CASE:!0,CREATE:!0,CONTAINS:!0,CURRENT_DATE:!0,CURRENT_TIME:!0,CURRENT_TIMESTAMP:!0,CURRENT_USER:!0,DELETE:!0,DESC:!0,DISTINCT:!0,DROP:!0,ELSE:!0,END:!0,EXISTS:!0,EXPLAIN:!0,FALSE:!0,FROM:!0,FULL:!0,GROUP:!0,HAVING:!0,IN:!0,INNER:!0,INSERT:!0,INTO:!0,IS:!0,JOIN:!0,KEY:!0,LEFT:!0,LIKE:!0,LIMIT:!0,LOW_PRIORITY:!0,NOT:!0,NULL:!0,ON:!0,OR:!0,ORDER:!0,OUTER:!0,RECURSIVE:!0,RENAME:!0,READ:!0,RIGHT:!0,SELECT:!0,SESSION_USER:!0,SET:!0,SHOW:!0,SYSTEM_USER:!0,TABLE:!0,THEN:!0,TRUE:!0,TRUNCATE:!0,UNION:!0,UPDATE:!0,USING:!0,VALUES:!0,WITH:!0,WHEN:!0,WHERE:!0,WRITE:!0,GLOBAL:!0,SESSION:!0,LOCAL:!0,PERSIST:!0,PERSIST_ONLY:!0};function Ji(r,t){return{type:"unary_expr",operator:r,expr:t}}function rc(r,t,e){return{type:"binary_expr",operator:r,left:t,right:e}}function tc(r){const t=n(Number.MAX_SAFE_INTEGER);return!(n(r)<t)}function ec(r,t,e=3){const n=[r];for(let r=0;r<t.length;r++)delete t[r][e].tableList,delete t[r][e].columnList,n.push(t[r][e]);return n}function nc(r,t){let e=r;for(let r=0;r<t.length;r++)e=rc(t[r][1],e,t[r][3]);return e}function oc(r){const t=cc[r];return t||(r||null)}function uc(r){const t=new Set;for(let e of r.keys()){const r=e.split("::");if(!r){t.add(e);break}r&&r[1]&&(r[1]=oc(r[1])),t.add(r.join("::"))}return Array.from(t)}let ac=[];const sc=new Set,ic=new Set,cc={};if((e=s())!==u&&eu===r.length)return e;throw e!==u&&eu<r.length&&fu({type:"end"}),pu(uu,ou<r.length?r.charAt(ou):null,ou<r.length?lu(ou,ou+1):lu(ou,ou))}}},function(r,t,e){r.exports=e(3)},function(r,t){r.exports=require("big-integer")},function(r,t,e){"use strict";e.r(t),e.d(t,"Parser",(function(){return Lt})),e.d(t,"util",(function(){return n}));var n={};function o(r){return function(r){if(Array.isArray(r))return u(r)}(r)||function(r){if("undefined"!=typeof Symbol&&null!=r[Symbol.iterator]||null!=r["@@iterator"])return Array.from(r)}(r)||function(r,t){if(!r)return;if("string"==typeof r)return u(r,t);var e=Object.prototype.toString.call(r).slice(8,-1);"Object"===e&&r.constructor&&(e=r.constructor.name);if("Map"===e||"Set"===e)return Array.from(r);if("Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return u(r,t)}(r)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function u(r,t){(null==t||t>r.length)&&(t=r.length);for(var e=0,n=new Array(t);e<t;e++)n[e]=r[e];return n}function a(r){if(!r)return[];var t=r.keyword,e=r.type;return[t.toUpperCase(),br(e)]}function s(r){if(r){var t=r.type,e=r.expr,n=r.symbol,u=t.toUpperCase(),s=[];switch(s.push(u),u){case"KEY_BLOCK_SIZE":n&&s.push(n),s.push(dr(e));break;case"BTREE":case"HASH":s.length=0,s.push.apply(s,o(a(r)));break;case"WITH PARSER":s.push(e);break;case"VISIBLE":case"INVISIBLE":break;case"COMMENT":s.shift(),s.push(Lr(r));break;case"DATA_COMPRESSION":s.push(n,br(e.value),hr(e.on));break;default:s.push(n,dr(e))}return s.filter(vr).join(" ")}}function i(r){return r?r.map(s):[]}function c(r){var t=r.constraint_type,e=r.index_type,n=r.index_options,u=void 0===n?[]:n,s=r.definition,c=r.on,l=r.with,f=[];if(f.push.apply(f,o(a(e))),s&&s.length){var p="CHECK"===br(t)?"(".concat(ut(s[0]),")"):"(".concat(s.map((function(r){return ut(r)})).join(", "),")");f.push(p)}return f.push(i(u).join(" ")),l&&f.push("WITH (".concat(i(l).join(", "),")")),c&&f.push("ON [".concat(c,"]")),f}function l(r){return function(r){if(Array.isArray(r))return f(r)}(r)||function(r){if("undefined"!=typeof Symbol&&null!=r[Symbol.iterator]||null!=r["@@iterator"])return Array.from(r)}(r)||function(r,t){if(!r)return;if("string"==typeof r)return f(r,t);var e=Object.prototype.toString.call(r).slice(8,-1);"Object"===e&&r.constructor&&(e=r.constructor.name);if("Map"===e||"Set"===e)return Array.from(r);if("Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return f(r,t)}(r)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function f(r,t){(null==t||t>r.length)&&(t=r.length);for(var e=0,n=new Array(t);e<t;e++)n[e]=r[e];return n}function p(r){if(r){var t=r.constraint,e=r.constraint_type,n=r.enforced,o=r.index,u=r.keyword,a=r.reference_definition,s=[],i=sr().database;s.push(br(u)),s.push(fr(t));var f=br(e);return"sqlite"===i&&"UNIQUE KEY"===f&&(f="UNIQUE"),s.push(f),s.push("sqlite"!==i&&fr(o)),s.push.apply(s,l(c(r))),s.push.apply(s,l(V(a))),s.push(br(n)),s.filter(vr).join(" ")}}function b(r){if("string"==typeof r)return r;var t=r.window_specification;return"(".concat(function(r){var t=r.name,e=r.partitionby,n=r.orderby,o=r.window_frame_clause;return[t,st(e,"partition by"),st(n,"order by"),br(o)].filter(vr).join(" ")}(t),")")}function v(r){var t=r.name,e=r.as_window_specification;return"".concat(t," AS ").concat(b(e))}function d(r){var t=r.args,e=r.name,n=r.consider_nulls,o=void 0===n?"":n,u=t?ut(t).join(", "):"",a=function(r){switch(br(r)){case"NTH_VALUE":case"LEAD":case"LAG":return!1;default:return!0}}(e);return[e,"(",u,!a&&")",o&&" ",o,a&&")"].filter(vr).join("")}function y(r){if(r){var t=r.as_window_specification,e=r.expr,n=r.keyword,o=r.type,u=r.parentheses,a=br(o);if("WINDOW"===a)return"OVER ".concat(b(t));if("ON UPDATE"===a){var s="".concat(br(o)," ").concat(br(n)),i=ut(e)||[];return u&&(s="".concat(s,"(").concat(i.join(", "),")")),s}throw new Error("unknown over type")}}function h(r){var t=r.arrows,e=void 0===t?[]:t,n=r.collate,o=r.target,u=r.expr,a=r.keyword,s=r.symbol,i=r.as,c=r.properties,l=void 0===c?[]:c,f=o.length,p=o.dataType,b=o.parentheses,v=o.quoted,d=o.scale,y=o.suffix,h="";null!=f&&(h=d?"".concat(f,", ").concat(d):f),b&&(h="(".concat(h,")")),y&&y.length&&(h+=" ".concat(y.join(" ")));var m=ut(u),w="::",L="";return"as"===s&&(m="".concat(br(a),"(").concat(m),L=")",w=" ".concat(s.toUpperCase()," ")),L+=e.map((function(r,t){return er(r,dr,l[t])})).join(" "),i&&(L+=" AS ".concat(fr(i))),n&&(L+=" ".concat(pr(n).join(" "))),[m,w,v,p,v,function(r){if(!r||!r.array)return"";switch(r.array){case"one":return"[]";case"two":return"[][]"}}(o),h,L].filter(vr).join("")}function m(r){var t=r.args,e=r.name,n=r.args_parentheses,o=r.parentheses,u=r.over,a=r.collate,s=r.suffix,i=pr(a).join(" "),c=y(u),l=ut(s);if(!t)return[e,c].filter(vr).join(" ");var f=r.separator||", ";"TRIM"===br(e)&&(f=" ");var p=[e];return p.push(!1===n?" ":"("),p.push(ut(t).join(f)),!1!==n&&p.push(")"),p=[p.join(""),l].filter(vr).join(" "),[o?"(".concat(p,")"):p,i,c].filter(vr).join(" ")}function w(r){var t=r.operator||r.op,e=ut(r.right),n=!1;if(Array.isArray(e)){switch(t){case"=":t="IN";break;case"!=":t="NOT IN";break;case"BETWEEN":case"NOT BETWEEN":n=!0,e="".concat(e[0]," AND ").concat(e[1])}n||(e="(".concat(e.join(", "),")"))}var o=r.right.escape||{},u=[ut(r.left),t,e,br(o.type),ut(o.value)].filter(vr).join(" ");return r.parentheses?"(".concat(u,")"):u}function L(r){return function(r){if(Array.isArray(r))return C(r)}(r)||function(r){if("undefined"!=typeof Symbol&&null!=r[Symbol.iterator]||null!=r["@@iterator"])return Array.from(r)}(r)||function(r,t){if(!r)return;if("string"==typeof r)return C(r,t);var e=Object.prototype.toString.call(r).slice(8,-1);"Object"===e&&r.constructor&&(e=r.constructor.name);if("Map"===e||"Set"===e)return Array.from(r);if("Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return C(r,t)}(r)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function C(r,t){(null==t||t>r.length)&&(t=r.length);for(var e=0,n=new Array(t);e<t;e++)n[e]=r[e];return n}function A(r){return r?[br(r.prefix),ut(r.value),br(r.suffix)]:[]}function E(r){return r?r.fetch?(e=(t=r).fetch,n=t.offset,[].concat(L(A(n)),L(A(e))).filter(vr).join(" ")):function(r){var t=r.seperator,e=r.value;return 1===e.length&&"offset"===t?nr("OFFSET",ut(e[0])):nr("LIMIT",e.map(ut).join("".concat("offset"===t?" ":"").concat(br(t)," ")))}(r):"";var t,e,n}function g(r){if(r&&0!==r.length){var t=r[0].recursive?"RECURSIVE ":"",e=r.map((function(r){var t=r.name,e=r.stmt,n=r.columns,o=Array.isArray(n)?"(".concat(n.map(W).join(", "),")"):"";return"".concat("default"===t.type?fr(t.value):dr(t)).concat(o," AS (").concat(ut(e),")")})).join(", ");return"WITH ".concat(t).concat(e)}}function T(r){if(r&&r.position){var t=r.keyword,e=r.expr,n=[],o=br(t);switch(o){case"VAR":n.push(e.map(ot).join(", "));break;default:n.push(o,"string"==typeof e?fr(e):ut(e))}return n.filter(vr).join(" ")}}function S(r){var t=r.as_struct_val,e=r.columns,n=r.distinct,o=r.for,u=r.from,a=r.for_sys_time_as_of,s=void 0===a?{}:a,i=r.locking_read,c=r.groupby,l=r.having,f=r.into,p=void 0===f?{}:f,b=r.limit,v=r.options,d=r.orderby,y=r.parentheses_symbol,h=r.qualify,m=r.top,w=r.window,L=r.with,C=r.where,A=[g(L),"SELECT",br(t)];A.push(cr(m)),Array.isArray(v)&&A.push(v.join(" ")),A.push(function(r){if(r){if("string"==typeof r)return r;var t=r.type,e=r.columns,n=[br(t)];return e&&n.push("(".concat(e.map(W).join(", "),")")),n.filter(vr).join(" ")}}(n),Z(e,u));var S=p.position,_="";S&&(_=er("INTO",T,p)),"column"===S&&A.push(_),A.push(er("FROM",H,u)),"from"===S&&A.push(_);var j=s||{},x=j.keyword,I=j.expr;A.push(er(x,ut,I)),A.push(er("WHERE",ut,C)),A.push(nr("GROUP BY",at(c).join(", "))),A.push(er("HAVING",ut,l)),A.push(er("QUALIFY",ut,h)),A.push(er("WINDOW",ut,w)),A.push(st(d,"order by")),A.push(E(b)),A.push(br(i)),"end"===S&&A.push(_),A.push(function(r){if(r){var t=r.expr,e=r.keyword,n=[br(r.type),br(e)];return t?"".concat(n.join(" "),"(").concat(ut(t),")"):n.join(" ")}}(o));var k=A.filter(vr).join(" ");return y?"(".concat(k,")"):k}function _(r,t){var e="undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(!e){if(Array.isArray(r)||(e=function(r,t){if(!r)return;if("string"==typeof r)return j(r,t);var e=Object.prototype.toString.call(r).slice(8,-1);"Object"===e&&r.constructor&&(e=r.constructor.name);if("Map"===e||"Set"===e)return Array.from(r);if("Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return j(r,t)}(r))||t&&r&&"number"==typeof r.length){e&&(r=e);var n=0,o=function(){};return{s:o,n:function(){return n>=r.length?{done:!0}:{done:!1,value:r[n++]}},e:function(r){throw r},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var u,a=!0,s=!1;return{s:function(){e=e.call(r)},n:function(){var r=e.next();return a=r.done,r},e:function(r){s=!0,u=r},f:function(){try{a||null==e.return||e.return()}finally{if(s)throw u}}}}function j(r,t){(null==t||t>r.length)&&(t=r.length);for(var e=0,n=new Array(t);e<t;e++)n[e]=r[e];return n}function x(r){if(!r||0===r.length)return"";var t,e=[],n=_(r);try{for(n.s();!(t=n.n()).done;){var o=t.value,u=o.table,a=o.column,s=o.value,i=[[u,a].filter(vr).map((function(r){return fr(r)})).join(".")],c="";s&&(c=ut(s),i.push("=",c)),e.push(i.filter(vr).join(" "))}}catch(r){n.e(r)}finally{n.f()}return e.join(", ")}function I(r){if("select"===r.type)return S(r);var t=r.map(ut);return"(".concat(t.join("), ("),")")}function k(r){if(!r)return"";var t=["PARTITION","("];if(Array.isArray(r))t.push(r.map(fr).join(", "));else{var e=r.value;t.push(e.map(ut).join(", "))}return t.push(")"),t.filter(vr).join("")}function N(r){if(!r)return"";switch(r.type){case"column":return"(".concat(r.expr.map(W).join(", "),")")}}function R(r){var t=r.expr,e=r.keyword,n=t.type,o=[br(e)];switch(n){case"origin":o.push(dr(t));break;case"update":o.push("UPDATE",er("SET",x,t.set),er("WHERE",ut,t.where))}return o.filter(vr).join(" ")}function O(r){if(!r)return"";var t=r.action;return[N(r.target),R(t)].filter(vr).join(" ")}function U(r){var t=r.table,e=r.type,n=r.prefix,o=void 0===n?"into":n,u=r.columns,a=r.conflict,s=r.values,i=r.where,c=r.on_duplicate_update,l=r.partition,f=r.returning,p=r.set,b=c||{},v=b.keyword,d=b.set,y=[br(e),br(o),H(t),k(l)];return Array.isArray(u)&&y.push("(".concat(u.map(fr).join(", "),")")),y.push(er(Array.isArray(s)?"VALUES":"",I,s)),y.push(er("ON CONFLICT",O,a)),y.push(er("SET",x,p)),y.push(er("WHERE",ut,i)),y.push(Ar(f)),y.push(er(v,x,d)),y.filter(vr).join(" ")}function M(r){var t=r.expr,e=r.unit;return["INTERVAL",ut(t),br(e)].filter(vr).join(" ")}function D(r){var t=r.type,e=r.as,n=r.expr,o=r.with_offset;return["".concat(br(t),"(").concat(n&&ut(n)||"",")"),er("AS",fr,e),er(br(o&&o.keyword),fr,o&&o.as)].filter(vr).join(" ")}function P(r){if(r)switch(r.type){case"pivot":case"unpivot":return function(r){var t=r.as,e=r.column,n=r.expr,o=r.in_expr,u=r.type,a=[ut(n),"FOR",W(e),w(o)],s=["".concat(br(u),"(").concat(a.join(" "),")")];return t&&s.push("AS",fr(t)),s.join(" ")}(r);default:return""}}function $(r){if(r){var t=r.keyword,e=r.expr,n=r.index,o=r.index_columns,u=r.parentheses,a=r.prefix,s=[];switch(t.toLowerCase()){case"forceseek":s.push(br(t),"(".concat(fr(n)),"(".concat(o.map(ut).filter(vr).join(", "),"))"));break;case"spatial_window_max_cells":s.push(br(t),"=",ut(e));break;case"index":s.push(br(a),br(t),u?"(".concat(e.map(fr).join(", "),")"):"= ".concat(fr(e)));break;default:s.push(ut(e))}return s.filter(vr).join(" ")}}function F(r){if("UNNEST"===br(r.type))return D(r);var t=r.table,e=r.db,n=r.as,o=r.expr,u=r.operator,a=r.prefix,s=r.schema,i=r.server,c=r.tablesample,l=r.table_hint,f=fr(i),p=fr(e),b=fr(s),v=t&&fr(t);if(o)switch(o.type){case"values":var d=o.parentheses,y=o.values,h=o.prefix,m=[d&&"(","",d&&")"],w=I(y);h&&(w=w.split("(").slice(1).map((function(r){return"".concat(br(h),"(").concat(r)})).join("")),m[1]="VALUES ".concat(w),v=m.filter(vr).join("");break;case"tumble":v=function(r){if(!r)return"";var t=r.data,e=r.timecol,n=r.size;return["TABLE(TUMBLE(TABLE",[fr(t.db),fr(t.table)].filter(vr).join("."),"DESCRIPTOR(".concat(W(e),")"),"".concat(M(n),"))")].filter(vr).join(" ")}(o);break;default:v=ut(o)}var L=[f,p,b,v=[br(a),v].filter(vr).join(" ")].filter(vr).join(".");r.parentheses&&(L="(".concat(L,")"));var C=[L];if(c){var A=["TABLESAMPLE",ut(c.expr),dr(c.repeatable)].filter(vr).join(" ");C.push(A)}return C.push(er("AS",fr,n),P(u)),l&&C.push(br(l.keyword),"(".concat(l.expr.map($).filter(vr).join(", "),")")),C.filter(vr).join(" ")}function H(r){if(!r)return"";if(!Array.isArray(r)){var t=r.expr,e=r.parentheses,n=H(t);return e?"(".concat(n,")"):n}var o=r[0],u=[];if("dual"===o.type)return"DUAL";u.push(F(o));for(var a=1;a<r.length;++a){var s=r[a],i=s.on,c=s.using,l=s.join,f=[];f.push(l?" ".concat(br(l)):","),f.push(F(s)),f.push(er("ON",ut,i)),c&&f.push("USING (".concat(c.map(fr).join(", "),")")),u.push(f.filter(vr).join(" "))}return u.filter(vr).join("")}function B(r){var t=r.keyword,e=r.symbol,n=r.value,o=[t.toUpperCase()];e&&o.push(e);var u=n;switch(t){case"partition by":case"default collate":u=ut(n);break;case"options":u="(".concat(n.map((function(r){return[r.keyword,r.symbol,ut(r.value)].join(" ")})).join(", "),")");break;case"cluster by":u=n.map(ut).join(", ")}return o.push(u),o.join(" ")}function G(r){return function(r){if(Array.isArray(r))return q(r)}(r)||function(r){if("undefined"!=typeof Symbol&&null!=r[Symbol.iterator]||null!=r["@@iterator"])return Array.from(r)}(r)||function(r,t){if(!r)return;if("string"==typeof r)return q(r,t);var e=Object.prototype.toString.call(r).slice(8,-1);"Object"===e&&r.constructor&&(e=r.constructor.name);if("Map"===e||"Set"===e)return Array.from(r);if("Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return q(r,t)}(r)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function q(r,t){(null==t||t>r.length)&&(t=r.length);for(var e=0,n=new Array(t);e<t;e++)n[e]=r[e];return n}function W(r){var t=r.array_index,e=r.arrows,n=void 0===e?[]:e,o=r.as,u=r.collate,a=r.column,s=r.db,i=r.isDual,c=r.schema,l=r.table,f=r.parentheses,p=r.properties,b=r.suffix,v=r.order_by,d=r.subFields,y=void 0===d?[]:d,h="*"===a?"*":function(r,t){if("string"==typeof r)return fr(r,t);var e=r.expr,n=r.offset,o=r.suffix,u=n&&n.map((function(r){return["[",r.name,"".concat(r.name?"(":""),dr(r.value),"".concat(r.name?")":""),"]"].filter(vr).join("")})).join("");return[ut(e),u,o].filter(vr).join("")}(a,i),m=[c,s,l].filter(vr).map((function(r){return"".concat(fr(r))})).join(".");m&&(h="".concat(m,".").concat(h)),t&&(h="".concat(h,"[").concat(dr(t.index),"]"),t.property&&(h="".concat(h,".").concat(dr(t.property))));var w=[h=[h].concat(G(y)).join("."),er("AS",ut,o),n.map((function(r,t){return er(r,dr,p[t])})).join(" ")];u&&w.push(pr(u).join(" ")),w.push(br(b)),w.push(br(v));var L=w.filter(vr).join(" ");return f?"(".concat(L,")"):L}function Y(r){var t=r||{},e=t.dataType,n=t.length,o=t.suffix,u=t.scale,a=t.expr,s=e;return null!=n&&(s+="(".concat([n,u].filter((function(r){return null!=r})).join(", "),")")),o&&o.length&&(s+=" ".concat(o.join(" "))),a&&(s+=ut(a)),s}function V(r){var t=[];if(!r)return t;var e=r.definition,n=r.keyword,o=r.match,u=r.table,a=r.on_action;return t.push(br(n)),t.push(H(u)),t.push(e&&"(".concat(e.map((function(r){return ut(r)})).join(", "),")")),t.push(br(o)),a.map((function(r){return t.push(br(r.type),ut(r.value))})),t.filter(vr)}function X(r){var t=r.column,e=r.collate,n=r.nulls,o=r.opclass,u=r.order_by;return[ut("string"==typeof t?{type:"column_ref",table:r.table,column:t}:r),er(e&&e.type,fr,e&&e.value),o,br(u),br(n)].filter(vr).join(" ")}function Q(r){var t=[],e=W(r.column),n=Y(r.definition);t.push(e),t.push(n);var o=function(r){var t=[],e=r.nullable,n=r.character_set,o=r.check,u=r.comment,a=r.collate,s=r.storage,i=r.default_val,c=r.auto_increment,l=r.unique,f=r.primary_key,b=r.column_format,v=r.reference_definition;if(t.push(br(e&&e.value)),i){var d=i.type,y=i.value;t.push(d.toUpperCase(),ut(y))}var h=sr().database;return t.push(p(o)),t.push(gr(c),br(f),br(l),Lr(u)),t.push.apply(t,G(pr(n))),"sqlite"!==h&&t.push.apply(t,G(pr(a))),t.push.apply(t,G(pr(b))),t.push.apply(t,G(pr(s))),t.push.apply(t,G(V(v))),t.filter(vr).join(" ")}(r);t.push(o);var u=function(r){if(r)return[br(r.value),"(".concat(ut(r.expr),")"),br(r.storage_type)].filter(vr).join(" ")}(r.generated);return t.push(u),t.filter(vr).join(" ")}function K(r){return r?["AS",/^(`?)[a-z_][0-9a-z_]*(`?)$/i.test(r)?fr(r):lr(r)].join(" "):""}function z(r,t){var e=r.expr,n=r.type;if("cast"===n)return h(r);t&&(e.isDual=t);var o=ut(e),u=r.expr_list;if(u){var a=[o],s=u.map((function(r){return z(r,t)})).join(", ");return a.push([br(n),n&&"(",s,n&&")"].filter(vr).join("")),a.filter(vr).join(" ")}return e.parentheses&&Reflect.has(e,"array_index")&&(o="(".concat(o,")")),e.array_index&&"column_ref"!==e.type&&(o="".concat(o,"[").concat(dr(e.array_index.index),"]")),[o,K(r.as)].filter(vr).join(" ")}function Z(r,t){if(!r||"*"===r)return r;var e=function(r){var t=Array.isArray(r)&&r[0];return!(!t||"dual"!==t.type)}(t);return r.map((function(r){return z(r,e)})).join(", ")}function J(r){return(J="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(r){return typeof r}:function(r){return r&&"function"==typeof Symbol&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r})(r)}e.r(n),e.d(n,"arrayStructTypeToSQL",(function(){return wr})),e.d(n,"autoIncrementToSQL",(function(){return gr})),e.d(n,"columnOrderListToSQL",(function(){return Tr})),e.d(n,"commonKeywordArgsToSQL",(function(){return Er})),e.d(n,"commonOptionConnector",(function(){return er})),e.d(n,"connector",(function(){return nr})),e.d(n,"commonTypeValue",(function(){return pr})),e.d(n,"commentToSQL",(function(){return Lr})),e.d(n,"createBinaryExpr",(function(){return ur})),e.d(n,"createValueExpr",(function(){return or})),e.d(n,"dataTypeToSQL",(function(){return mr})),e.d(n,"DEFAULT_OPT",(function(){return rr})),e.d(n,"escape",(function(){return ar})),e.d(n,"literalToSQL",(function(){return dr})),e.d(n,"columnIdentifierToSql",(function(){return lr})),e.d(n,"getParserOpt",(function(){return sr})),e.d(n,"identifierToSql",(function(){return fr})),e.d(n,"onPartitionsToSQL",(function(){return hr})),e.d(n,"replaceParams",(function(){return yr})),e.d(n,"returningToSQL",(function(){return Ar})),e.d(n,"hasVal",(function(){return vr})),e.d(n,"setParserOpt",(function(){return ir})),e.d(n,"toUpper",(function(){return br})),e.d(n,"topToSQL",(function(){return cr})),e.d(n,"triggerEventToSQL",(function(){return Cr}));var rr={database:"sqlite",type:"table",parseOptions:{}},tr=rr;function er(r,t,e){if(e)return r?"".concat(r.toUpperCase()," ").concat(t(e)):t(e)}function nr(r,t){if(t)return"".concat(r.toUpperCase()," ").concat(t)}function or(r){var t=J(r);if(Array.isArray(r))return{type:"expr_list",value:r.map(or)};if(null===r)return{type:"null",value:null};switch(t){case"boolean":return{type:"bool",value:r};case"string":return{type:"string",value:r};case"number":return{type:"number",value:r};default:throw new Error('Cannot convert value "'.concat(t,'" to SQL'))}}function ur(r,t,e){var n={operator:r,type:"binary_expr"};return n.left=t.type?t:or(t),"BETWEEN"===r||"NOT BETWEEN"===r?(n.right={type:"expr_list",value:[or(e[0]),or(e[1])]},n):(n.right=e.type?e:or(e),n)}function ar(r){return r}function sr(){return tr}function ir(r){tr=r}function cr(r){if(r){var t=r.value,e=r.percent,n=r.parentheses?"(".concat(t,")"):t,o="TOP ".concat(n);return e?"".concat(o," ").concat(e.toUpperCase()):o}}function lr(r){var t=sr().database;if(r)switch(t&&t.toLowerCase()){case"postgresql":case"db2":case"snowflake":case"noql":return'"'.concat(r,'"');case"transactsql":return"[".concat(r,"]");case"mysql":case"mariadb":case"bigquery":default:return"`".concat(r,"`")}}function fr(r,t){var e=sr().database;if(!0===t)return"'".concat(r,"'");if(r){if("*"===r)return r;switch(e&&e.toLowerCase()){case"mysql":case"mariadb":case"sqlite":return"`".concat(r,"`");case"postgresql":case"snowflake":case"noql":return'"'.concat(r,'"');case"transactsql":return"[".concat(r,"]");case"bigquery":case"db2":return r;default:return"`".concat(r,"`")}}}function pr(r){var t=[];if(!r)return t;var e=r.type,n=r.symbol,o=r.value;return t.push(e.toUpperCase()),n&&t.push(n),t.push(o.toUpperCase()),t}function br(r){if(r)return r.toUpperCase()}function vr(r){return r}function dr(r){if(r){var t=r.prefix,e=r.type,n=r.parentheses,o=r.suffix,u=r.value,a="string"==typeof r?r:u;switch(e){case"backticks_quote_string":a="`".concat(u,"`");break;case"string":a="'".concat(u,"'");break;case"regex_string":a='r"'.concat(u,'"');break;case"hex_string":a="X'".concat(u,"'");break;case"full_hex_string":a="0x".concat(u);break;case"natural_string":a="N'".concat(u,"'");break;case"bit_string":a="b'".concat(u,"'");break;case"double_quote_string":a='"'.concat(u,'"');break;case"single_quote_string":a="'".concat(u,"'");break;case"boolean":case"bool":a=u?"TRUE":"FALSE";break;case"null":a="NULL";break;case"star":a="*";break;case"param":a="".concat(t||":").concat(u),t=null;break;case"origin":a=u.toUpperCase();break;case"date":case"datetime":case"time":case"timestamp":a="".concat(e.toUpperCase()," '").concat(u,"'");break;case"var_string":a="N'".concat(u,"'")}var s=[];return t&&s.push(br(t)),s.push(a),o&&s.push("object"===J(o)&&o.collate?pr(o.collate).join(" "):br(o)),a=s.join(" "),n?"(".concat(a,")"):a}}function yr(r,t){return function r(t,e){return Object.keys(t).filter((function(r){var e=t[r];return Array.isArray(e)||"object"===J(e)&&null!==e})).forEach((function(n){var o=t[n];if("object"!==J(o)||"param"!==o.type)return r(o,e);if(void 0===e[o.value])throw new Error("no value for parameter :".concat(o.value," found"));return t[n]=or(e[o.value]),null})),t}(JSON.parse(JSON.stringify(r)),t)}function hr(r){var t=r.type,e=r.partitions;return[br(t),"(".concat(e.map((function(r){if("range"!==r.type)return dr(r);var t=r.start,e=r.end,n=r.symbol;return"".concat(dr(t)," ").concat(br(n)," ").concat(dr(e))})).join(", "),")")].join(" ")}function mr(r){var t=r.dataType,e=r.length,n=r.parentheses,o=r.scale,u=r.suffix,a="";return null!=e&&(a=o?"".concat(e,", ").concat(o):e),n&&(a="(".concat(a,")")),u&&u.length&&(a+=" ".concat(u.join(" "))),"".concat(t).concat(a)}function wr(r){if(r){var t=r.dataType,e=r.definition,n=r.anglebracket,o=br(t);if("ARRAY"!==o&&"STRUCT"!==o)return o;var u=e&&e.map((function(r){return[r.field_name,wr(r.field_type)].filter(vr).join(" ")})).join(", ");return n?"".concat(o,"<").concat(u,">"):"".concat(o," ").concat(u)}}function Lr(r){if(r){var t=[],e=r.keyword,n=r.symbol,o=r.value;return t.push(e.toUpperCase()),n&&t.push(n),t.push(dr(o)),t.join(" ")}}function Cr(r){return r.map((function(r){var t=r.keyword,e=r.args,n=[br(t)];if(e){var o=e.keyword,u=e.columns;n.push(br(o),u.map(W).join(", "))}return n.join(" ")})).join(" OR ")}function Ar(r){return r?["RETURNING",r.columns.map(z).filter(vr).join(", ")].join(" "):""}function Er(r){return r?[br(r.keyword),br(r.args)]:[]}function gr(r){if(r){if("string"==typeof r){var t=sr().database;switch(t&&t.toLowerCase()){case"sqlite":return"AUTOINCREMENT";default:return"AUTO_INCREMENT"}}var e=r.keyword,n=r.seed,o=r.increment,u=r.parentheses,a=br(e);return u&&(a+="(".concat(dr(n),", ").concat(dr(o),")")),a}}function Tr(r){if(r)return r.map(X).filter(vr).join(", ")}function Sr(r){var t=r.name,e=r.value;return["@".concat(t),"=",ut(e)].filter(vr).join(" ")}function _r(r){var t=r.left,e=r.right,n=r.symbol,o=r.keyword;t.keyword=o;var u=ut(t),a=ut(e);return"".concat(u," ").concat(n," ").concat(a)}function jr(r){var t,e,n,o,u=r.keyword,a=r.suffix,s="";switch(br(u)){case"BINLOG":e=(t=r).in,n=t.from,o=t.limit,s=[er("IN",dr,e&&e.right),er("FROM",H,n),E(o)].filter(vr).join(" ");break;case"CHARACTER":case"COLLATION":s=function(r){var t=r.expr;if(t)return"LIKE"===br(t.op)?er("LIKE",dr,t.right):er("WHERE",ut,t)}(r);break;case"COLUMNS":case"INDEXES":s=er("FROM",H,r.from);break;case"GRANTS":s=function(r){var t=r.for;if(t){var e=t.user,n=t.host,o=t.role_list,u="'".concat(e,"'");return n&&(u+="@'".concat(n,"'")),["FOR",u,o&&"USING",o&&o.map((function(r){return"'".concat(r,"'")})).join(", ")].filter(vr).join(" ")}}(r);break;case"CREATE":s=er("",F,r[a]);break;case"VAR":s=ot(r.var),u=""}return["SHOW",br(u),br(a),s].filter(vr).join(" ")}var xr={alter:function(r){var t=r.keyword;switch(void 0===t?"table":t){case"aggregate":return function(r){var t=r.args,e=r.expr,n=r.keyword,o=r.name,u=r.type,a=t.expr,s=t.orderby;return[br(u),br(n),[[fr(o.schema),fr(o.name)].filter(vr).join("."),"(".concat(a.map(Zr).join(", ")).concat(s?[" ORDER","BY",s.map(Zr).join(", ")].join(" "):"",")")].filter(vr).join(""),zr(e)].filter(vr).join(" ")}(r);case"table":return function(r){var t=r.type,e=r.table,n=r.expr,o=void 0===n?[]:n,u=br(t),a=H(e),s=o.map(ut);return[u,"TABLE",a,s.join(", ")].filter(vr).join(" ")}(r);case"schema":return function(r){var t=r.expr,e=r.keyword,n=r.schema;return[br(r.type),br(e),fr(n),zr(t)].filter(vr).join(" ")}(r);case"domain":case"type":return function(r){var t=r.expr,e=r.keyword,n=r.name;return[br(r.type),br(e),[fr(n.schema),fr(n.name)].filter(vr).join("."),zr(t)].filter(vr).join(" ")}(r);case"function":return function(r){var t=r.args,e=r.expr,n=r.keyword,o=r.name;return[br(r.type),br(n),[[fr(o.schema),fr(o.name)].filter(vr).join("."),t&&"(".concat(t.expr?t.expr.map(Zr).join(", "):"",")")].filter(vr).join(""),zr(e)].filter(vr).join(" ")}(r);case"view":return function(r){var t=r.type,e=r.columns,n=r.attributes,o=r.select,u=r.view,a=r.with,s=br(t),i=F(u),c=[s,"VIEW",i];e&&c.push("(".concat(e.map(W).join(", "),")"));n&&c.push("WITH ".concat(n.map(br).join(", ")));c.push("AS",S(o)),a&&c.push(br(a));return c.filter(vr).join(" ")}(r)}},analyze:function(r){var t=r.type,e=r.table;return[br(t),F(e)].join(" ")},attach:function(r){var t=r.type,e=r.database,n=r.expr,o=r.as,u=r.schema;return[br(t),br(e),ut(n),br(o),fr(u)].filter(vr).join(" ")},create:function(r){var t=r.keyword,e="";switch(t.toLowerCase()){case"aggregate":e=function(r){var t=r.type,e=r.replace,n=r.keyword,o=r.name,u=r.args,a=r.options,s=[br(t),br(e),br(n)],i=[fr(o.schema),o.name].filter(vr).join("."),c="".concat(u.expr.map(Zr).join(", ")).concat(u.orderby?[" ORDER","BY",u.orderby.map(Zr).join(", ")].join(" "):"");return s.push("".concat(i,"(").concat(c,")"),"(".concat(a.map(Kr).join(", "),")")),s.filter(vr).join(" ")}(r);break;case"table":e=function(r){var t=r.type,e=r.keyword,n=r.table,o=r.like,u=r.as,a=r.temporary,s=r.if_not_exists,i=r.create_definitions,c=r.table_options,l=r.ignore_replace,f=r.or_replace,p=r.query_expr,b=[br(t),br(f),br(a),br(e),br(s),H(n)];if(o){var v=o.type,d=H(o.table);return b.push(br(v),d),b.filter(vr).join(" ")}i&&b.push("(".concat(i.map(Vr).join(", "),")"));c&&b.push(c.map(B).join(" "));b.push(br(l),br(u)),p&&b.push(Ir(p));return b.filter(vr).join(" ")}(r);break;case"trigger":e="constraint"===r.resource?function(r){var t=r.constraint,e=r.constraint_kw,n=r.deferrable,o=r.events,u=r.execute,a=r.for_each,s=r.from,i=r.location,c=r.keyword,l=r.or,f=r.type,p=r.table,b=r.when,v=[br(f),br(l),br(e),br(c),fr(t),br(i)],d=Cr(o);v.push(d,"ON",F(p)),s&&v.push("FROM",F(s));v.push.apply(v,qr(Er(n)).concat(qr(Er(a)))),b&&v.push(br(b.type),ut(b.cond));return v.push(br(u.keyword),m(u.expr)),v.filter(vr).join(" ")}(r):function(r){var t=r.definer,e=r.for_each,n=r.keyword,o=r.execute,u=r.type,a=r.table,s=r.if_not_exists,i=r.temporary,c=r.trigger,l=r.events,f=r.order,p=r.time,b=r.when,v=[br(u),br(i),t,br(n),br(s),F(c),br(p),l.map((function(r){var t=[br(r.keyword)],e=r.args;return e&&t.push(br(e.keyword),e.columns.map(W).join(", ")),t.join(" ")})),"ON",F(a),br(e&&e.keyword),br(e&&e.args),f&&"".concat(br(f.keyword)," ").concat(fr(f.trigger)),er("WHEN",ut,b),br(o.prefix)];switch(o.type){case"set":v.push(er("SET",x,o.expr));break;case"multiple":v.push(kr(o.expr.ast))}return v.push(br(o.suffix)),v.filter(vr).join(" ")}(r);break;case"extension":e=function(r){var t=r.extension,e=r.from,n=r.if_not_exists,o=r.keyword,u=r.schema,a=r.type,s=r.with,i=r.version;return[br(a),br(o),br(n),dr(t),br(s),er("SCHEMA",dr,u),er("VERSION",dr,i),er("FROM",dr,e)].filter(vr).join(" ")}(r);break;case"function":e=function(r){var t=r.type,e=r.replace,n=r.keyword,o=r.name,u=r.args,a=r.returns,s=r.options,i=r.last,c=[br(t),br(e),br(n)],l=[fr(o.schema),o.name].filter(vr).join("."),f=u.map(Zr).filter(vr).join(", ");return c.push("".concat(l,"(").concat(f,")"),function(r){var t=r.type,e=r.keyword,n=r.expr;return[br(t),br(e),Array.isArray(n)?"(".concat(n.map(Q).join(", "),")"):Xr(n)].filter(vr).join(" ")}(a),s.map(Qr).join(" "),i),c.filter(vr).join(" ")}(r);break;case"index":e=function(r){var t=r.concurrently,e=r.filestream_on,n=r.keyword,o=r.include,u=r.index_columns,s=r.index_type,c=r.index_using,l=r.index,f=r.on,p=r.index_options,b=r.algorithm_option,v=r.lock_option,d=r.on_kw,y=r.table,h=r.tablespace,m=r.type,w=r.where,L=r.with,C=r.with_before_where,A=L&&"WITH (".concat(i(L).join(", "),")"),E=o&&"".concat(br(o.keyword)," (").concat(o.columns.map((function(r){return fr(r)})).join(", "),")"),g=[br(m),br(s),br(n),br(t),fr(l),br(d),F(y)].concat(qr(a(c)),["(".concat(Tr(u),")"),E,i(p).join(" "),zr(b),zr(v),er("TABLESPACE",dr,h)]);C?g.push(A,er("WHERE",ut,w)):g.push(er("WHERE",ut,w),A);return g.push(er("ON",ut,f),er("FILESTREAM_ON",dr,e)),g.filter(vr).join(" ")}(r);break;case"sequence":e=function(r){var t=r.type,e=r.keyword,n=r.sequence,o=r.temporary,u=r.if_not_exists,a=r.create_definitions,s=[br(t),br(o),br(e),br(u),H(n)];a&&s.push(a.map(Vr).join(" "));return s.filter(vr).join(" ")}(r);break;case"database":e=function(r){var t=r.type,e=r.keyword,n=r.database,o=r.if_not_exists,u=r.create_definitions,a=[br(t),br(e),br(o),lr(n)];u&&a.push(u.map(B).join(" "));return a.filter(vr).join(" ")}(r);break;case"view":e=function(r){var t=r.algorithm,e=r.columns,n=r.definer,o=r.if_not_exists,u=r.keyword,a=r.recursive,s=r.replace,i=r.select,c=r.sql_security,l=r.temporary,f=r.type,p=r.view,b=r.with,v=r.with_options,d=p.db,y=p.view,h=[fr(d),fr(y)].filter(vr).join(".");return[br(f),br(s),br(l),br(a),t&&"ALGORITHM = ".concat(br(t)),n,c&&"SQL SECURITY ".concat(br(c)),br(u),br(o),h,e&&"(".concat(e.map(lr).join(", "),")"),v&&["WITH","(".concat(v.map((function(r){return pr(r).join(" ")})).join(", "),")")].join(" "),"AS",Ir(i),br(b)].filter(vr).join(" ")}(r);break;case"domain":e=function(r){var t=r.as,e=r.domain,n=r.type,o=r.keyword,u=r.target,a=r.create_definitions,s=[br(n),br(o),[fr(e.schema),fr(e.name)].filter(vr).join("."),br(t),mr(u)];if(a&&a.length>0){var i,c=[],l=function(r,t){var e="undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(!e){if(Array.isArray(r)||(e=Wr(r))||t&&r&&"number"==typeof r.length){e&&(r=e);var n=0,o=function(){};return{s:o,n:function(){return n>=r.length?{done:!0}:{done:!1,value:r[n++]}},e:function(r){throw r},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var u,a=!0,s=!1;return{s:function(){e=e.call(r)},n:function(){var r=e.next();return a=r.done,r},e:function(r){s=!0,u=r},f:function(){try{a||null==e.return||e.return()}finally{if(s)throw u}}}}(a);try{for(l.s();!(i=l.n()).done;){var f=i.value,b=f.type;switch(b){case"collate":c.push(pr(f).join(" "));break;case"default":c.push(br(b),ut(f.value));break;case"constraint":c.push(p(f))}}}catch(r){l.e(r)}finally{l.f()}s.push(c.filter(vr).join(" "))}return s.filter(vr).join(" ")}(r);break;case"type":e=function(r){var t=r.as,e=r.create_definitions,n=r.keyword,o=r.name,u=r.resource,a=[br(r.type),br(n),[fr(o.schema),fr(o.name)].filter(vr).join("."),br(t),br(u)];if(e){var s=[];switch(u){case"enum":s.push(ut(e))}a.push(s.filter(vr).join(" "))}return a.filter(vr).join(" ")}(r);break;case"user":e=function(r){var t=r.attribute,e=r.comment,n=r.default_role,o=r.if_not_exists,u=r.keyword,a=r.lock_option,s=r.password_options,i=r.require,c=r.resource_options,l=r.type,f=r.user.map((function(r){var t=r.user,e=r.auth_option,n=[Br(t)];return e&&n.push(br(e.keyword),e.auth_plugin,dr(e.value)),n.filter(vr).join(" ")})).join(", "),p=[br(l),br(u),br(o),f];n&&p.push(br(n.keyword),n.value.map(Br).join(", "));p.push(er(i&&i.keyword,ut,i&&i.value)),c&&p.push(br(c.keyword),c.value.map((function(r){return ut(r)})).join(" "));s&&s.forEach((function(r){return p.push(er(r.keyword,ut,r.value))}));return p.push(dr(a),Lr(e),dr(t)),p.filter(vr).join(" ")}(r);break;default:throw new Error("unknown create resource ".concat(t))}return e},select:S,deallocate:function(r){var t=r.type,e=r.keyword,n=r.expr;return[br(t),br(e),ut(n)].filter(vr).join(" ")},delete:function(r){var t=r.columns,e=r.from,n=r.table,o=r.where,u=r.orderby,a=r.with,s=r.limit,i=[g(a),"DELETE"],c=Z(t,e);return i.push(c),Array.isArray(n)&&(1===n.length&&!0===n[0].addition||i.push(H(n))),i.push(er("FROM",H,e)),i.push(er("WHERE",ut,o)),i.push(st(u,"order by")),i.push(E(s)),i.filter(vr).join(" ")},exec:function(r){var t=r.keyword,e=r.module,n=r.parameters;return[br(t),F(e),(n||[]).map(Sr).filter(vr).join(", ")].filter(vr).join(" ")},execute:function(r){var t=r.type,e=r.name,n=r.args,o=[br(t)],u=[e];n&&u.push("(".concat(ut(n).join(", "),")"));return o.push(u.join("")),o.filter(vr).join(" ")},for:function(r){var t=r.type,e=r.label,n=r.target,o=r.query,u=r.stmts;return[e,br(t),n,"IN",kr([o]),"LOOP",kr(u),"END LOOP",e].filter(vr).join(" ")},update:function(r){var t=r.from,e=r.table,n=r.set,o=r.where,u=r.orderby,a=r.with,s=r.limit,i=r.returning;return[g(a),"UPDATE",H(e),er("SET",x,n),er("FROM",H,t),er("WHERE",ut,o),st(u,"order by"),E(s),Ar(i)].filter(vr).join(" ")},if:function(r){var t=r.boolean_expr,e=r.else_expr,n=r.elseif_expr,o=r.if_expr,u=r.prefix,a=r.go,s=r.semicolons,i=r.suffix,c=[br(r.type),ut(t),dr(u),"".concat(Ur(o.ast||o)).concat(s[0]),br(a)];n&&c.push(n.map((function(r){return[br(r.type),ut(r.boolean_expr),"THEN",Ur(r.then.ast||r.then),r.semicolon].filter(vr).join(" ")})).join(" "));e&&c.push("ELSE","".concat(Ur(e.ast||e)).concat(s[1]));return c.push(dr(i)),c.filter(vr).join(" ")},insert:U,drop:Fr,truncate:Fr,replace:U,declare:function(r){var t=r.type,e=r.declare,n=r.symbol,o=[br(t)],u=e.map((function(r){var t=r.at,e=r.name,n=r.as,o=r.constant,u=r.datatype,a=r.not_null,s=r.prefix,i=r.definition,c=r.keyword,l=[[t,e].filter(vr).join(""),br(n),br(o)];switch(c){case"variable":l.push.apply(l,[Y(u)].concat(Dr(pr(r.collate)),[br(a)])),i&&l.push(br(i.keyword),ut(i.value));break;case"cursor":l.push(br(s));break;case"table":l.push(br(s),"(".concat(i.map(Vr).join(", "),")"))}return l.filter(vr).join(" ")})).join("".concat(n," "));return o.push(u),o.join(" ")},use:function(r){var t=r.type,e=r.db,n=br(t),o=fr(e);return"".concat(n," ").concat(o)},rename:function(r){var t=r.type,e=r.table,n=[],o="".concat(t&&t.toUpperCase()," TABLE");if(e){var u,a=Mr(e);try{for(a.s();!(u=a.n()).done;){var s=u.value.map(F);n.push(s.join(" TO "))}}catch(r){a.e(r)}finally{a.f()}}return"".concat(o," ").concat(n.join(", "))},call:function(r){var t=ut(r.expr);return"".concat("CALL"," ").concat(t)},desc:function(r){var t=r.type,e=r.table,n=br(t);return"".concat(n," ").concat(fr(e))},set:function(r){var t=r.expr,e=ut(t);return"".concat("SET"," ").concat(e)},lock:Hr,unlock:Hr,show:jr,grant:Gr,revoke:Gr,proc:function(r){var t=r.stmt;switch(t.type){case"assign":return _r(t);case"return":return function(r){var t=r.type,e=r.expr;return[br(t),ut(e)].join(" ")}(t)}},raise:function(r){var t=r.type,e=r.level,n=r.raise,o=r.using,u=[br(t),br(e)];n&&u.push([dr(n.keyword),"format"===n.type&&n.expr.length>0&&","].filter(vr).join(""),n.expr.map((function(r){return ut(r)})).join(", "));o&&u.push(br(o.type),br(o.option),o.symbol,o.expr.map((function(r){return ut(r)})).join(", "));return u.filter(vr).join(" ")},transaction:function(r){return ut(r.expr)}};function Ir(r){if(!r)return"";for(var t=xr[r.type],e=r,n=e._parentheses,o=e._orderby,u=e._limit,a=[n&&"(",t(r)];r._next;){var s=xr[r._next.type],i=br(r.set_op);a.push(i,s(r._next)),r=r._next}return a.push(n&&")",st(o,"order by"),E(u)),a.filter(vr).join(" ")}function kr(r){for(var t=[],e=0,n=r.length;e<n;++e){var o=r[e]&&r[e].ast?r[e].ast:r[e],u=Ir(o);e===n-1&&"transaction"===o.type&&(u="".concat(u," ;")),t.push(u)}return t.join(" ; ")}var Nr=["analyze","attach","select","deallocate","delete","exec","update","insert","drop","rename","truncate","call","desc","use","alter","set","create","lock","unlock","declare","show","replace","if","grant","revoke","proc","raise","execute","transaction"];function Rr(r){var t=r&&r.ast?r.ast:r;if(!Nr.includes(t.type))throw new Error("".concat(t.type," statements not supported at the moment"))}function Or(r){return Array.isArray(r)?(r.forEach(Rr),kr(r)):(Rr(r),Ir(r))}function Ur(r){return"go"===r.go?function r(t){if(!t||0===t.length)return"";var e=[Or(t.ast)];return t.go_next&&e.push(t.go.toUpperCase(),r(t.go_next)),e.filter((function(r){return r})).join(" ")}(r):Or(r)}function Mr(r,t){var e="undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(!e){if(Array.isArray(r)||(e=Pr(r))||t&&r&&"number"==typeof r.length){e&&(r=e);var n=0,o=function(){};return{s:o,n:function(){return n>=r.length?{done:!0}:{done:!1,value:r[n++]}},e:function(r){throw r},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var u,a=!0,s=!1;return{s:function(){e=e.call(r)},n:function(){var r=e.next();return a=r.done,r},e:function(r){s=!0,u=r},f:function(){try{a||null==e.return||e.return()}finally{if(s)throw u}}}}function Dr(r){return function(r){if(Array.isArray(r))return $r(r)}(r)||function(r){if("undefined"!=typeof Symbol&&null!=r[Symbol.iterator]||null!=r["@@iterator"])return Array.from(r)}(r)||Pr(r)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Pr(r,t){if(r){if("string"==typeof r)return $r(r,t);var e=Object.prototype.toString.call(r).slice(8,-1);return"Object"===e&&r.constructor&&(e=r.constructor.name),"Map"===e||"Set"===e?Array.from(r):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?$r(r,t):void 0}}function $r(r,t){(null==t||t>r.length)&&(t=r.length);for(var e=0,n=new Array(t);e<t;e++)n[e]=r[e];return n}function Fr(r){var t=r.type,e=r.keyword,n=r.name,o=r.prefix,u=[br(t),br(e),br(o)];switch(e){case"table":u.push(H(n));break;case"trigger":u.push([n[0].schema?"".concat(fr(n[0].schema),"."):"",fr(n[0].trigger)].filter(vr).join(""));break;case"database":case"schema":case"procedure":u.push(fr(n));break;case"view":u.push(H(n),r.options&&r.options.map(ut).filter(vr).join(" "));break;case"index":u.push.apply(u,[W(n)].concat(Dr(r.table?["ON",F(r.table)]:[]),[r.options&&r.options.map(ut).filter(vr).join(" ")]))}return u.filter(vr).join(" ")}function Hr(r){var t=r.type,e=r.keyword,n=r.tables,o=[t.toUpperCase(),br(e)];if("UNLOCK"===t.toUpperCase())return o.join(" ");var u,a=[],s=Mr(n);try{var i=function(){var r=u.value,t=r.table,e=r.lock_type,n=[F(t)];if(e){n.push(["prefix","type","suffix"].map((function(r){return br(e[r])})).filter(vr).join(" "))}a.push(n.join(" "))};for(s.s();!(u=s.n()).done;)i()}catch(r){s.e(r)}finally{s.f()}return o.push.apply(o,[a.join(", ")].concat(Dr(function(r){var t=r.lock_mode,e=r.nowait,n=[];if(t){var o=t.mode;n.push(o.toUpperCase())}return e&&n.push(e.toUpperCase()),n}(r)))),o.filter(vr).join(" ")}function Br(r){var t=r.name,e=r.host,n=[dr(t)];return e&&n.push("@",dr(e)),n.join("")}function Gr(r){var t=r.type,e=r.grant_option_for,n=r.keyword,o=r.objects,u=r.on,a=r.to_from,s=r.user_or_roles,i=r.with,c=[br(t),dr(e)],l=o.map((function(r){var t=r.priv,e=r.columns,n=[ut(t)];return e&&n.push("(".concat(e.map(W).join(", "),")")),n.join(" ")})).join(", ");if(c.push(l),u)switch(c.push("ON"),n){case"priv":c.push(dr(u.object_type),u.priv_level.map((function(r){return[fr(r.prefix),fr(r.name)].filter(vr).join(".")})).join(", "));break;case"proxy":c.push(Br(u))}return c.push(br(a),s.map(Br).join(", ")),c.push(dr(i)),c.filter(vr).join(" ")}function qr(r){return function(r){if(Array.isArray(r))return Yr(r)}(r)||function(r){if("undefined"!=typeof Symbol&&null!=r[Symbol.iterator]||null!=r["@@iterator"])return Array.from(r)}(r)||Wr(r)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Wr(r,t){if(r){if("string"==typeof r)return Yr(r,t);var e=Object.prototype.toString.call(r).slice(8,-1);return"Object"===e&&r.constructor&&(e=r.constructor.name),"Map"===e||"Set"===e?Array.from(r):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?Yr(r,t):void 0}}function Yr(r,t){(null==t||t>r.length)&&(t=r.length);for(var e=0,n=new Array(t);e<t;e++)n[e]=r[e];return n}function Vr(r){if(!r)return[];var t,e,n,u,a=r.resource;switch(a){case"column":return Q(r);case"index":return e=[],n=(t=r).keyword,u=t.index,e.push(br(n)),e.push(u),e.push.apply(e,o(c(t))),e.filter(vr).join(" ");case"constraint":return p(r);case"sequence":return[br(r.prefix),ut(r.value)].filter(vr).join(" ");default:throw new Error("unknown resource = ".concat(a," type"))}}function Xr(r){return r.dataType?mr(r):[fr(r.db),fr(r.schema),fr(r.table)].filter(vr).join(".")}function Qr(r){var t=r.type;switch(t){case"as":return[br(t),r.symbol,Ir(r.declare),br(r.begin),kr(r.expr),br(r.end),r.symbol].filter(vr).join(" ");case"set":return[br(t),r.parameter,br(r.value&&r.value.prefix),r.value&&r.value.expr.map(ut).join(", ")].filter(vr).join(" ");default:return ut(r)}}function Kr(r){var t=r.type,e=r.symbol,n=r.value,o=[br(t),e];switch(br(t)){case"SFUNC":o.push([fr(n.schema),n.name].filter(vr).join("."));break;case"STYPE":case"MSTYPE":o.push(mr(n));break;default:o.push(ut(n))}return o.filter(vr).join(" ")}function zr(r){if(!r)return"";var t=r.action,e=r.create_definitions,n=r.first_after,o=r.if_not_exists,u=r.keyword,a=r.old_column,s=r.prefix,i=r.resource,l=r.symbol,f="",p=[];switch(i){case"column":p=[Q(r)];break;case"index":p=c(r),f=r[i];break;case"table":case"schema":f=fr(r[i]);break;case"aggregate":case"function":case"domain":case"type":f=fr(r[i]);break;case"algorithm":case"lock":case"table-option":f=[l,br(r[i])].filter(vr).join(" ");break;case"constraint":f=fr(r[i]),p=[Vr(e)];break;case"key":f=fr(r[i]);break;default:f=[l,r[i]].filter((function(r){return null!==r})).join(" ")}return[br(t),br(u),br(o),a&&W(a),br(s),f&&f.trim(),p.filter(vr).join(" "),n&&"".concat(br(n.keyword)," ").concat(W(n.column))].filter(vr).join(" ")}function Zr(r){var t=r.default&&[br(r.default.keyword),ut(r.default.value)].join(" ");return[br(r.mode),r.name,mr(r.type),t].filter(vr).join(" ")}function Jr(r){return(Jr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(r){return typeof r}:function(r){return r&&"function"==typeof Symbol&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r})(r)}function rt(r){var t=r.expr_list;switch(br(r.type)){case"STRUCT":return"(".concat(Z(t),")");case"ARRAY":return function(r){var t=r.array_path,e=r.brackets,n=r.expr_list,o=r.parentheses;if(!n)return"[".concat(Z(t),"]");var u=Array.isArray(n)?n.map((function(r){return"(".concat(Z(r),")")})).filter(vr).join(", "):ut(n);return e?"[".concat(u,"]"):o?"(".concat(u,")"):u}(r);default:return""}}function tt(r){var t=r.definition,e=[br(r.keyword)];return t&&"object"===Jr(t)&&(e.length=0,e.push(wr(t))),e.push(rt(r)),e.filter(vr).join("")}function et(r){return(et="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(r){return typeof r}:function(r){return r&&"function"==typeof Symbol&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r})(r)}var nt={alter:zr,aggr_func:function(r){var t=r.args,e=r.filter,n=r.over,o=r.within_group_orderby,u=ut(t.expr),a=r.name,s=y(n);t.distinct&&(u=["DISTINCT",u].join(" ")),t.orderby&&(u="".concat(u," ").concat(st(t.orderby,"order by"))),t.separator&&(u=[u,br(t.separator.keyword),dr(t.separator.value)].filter(vr).join(" "));var i=o?"WITHIN GROUP (".concat(st(o,"order by"),")"):"",c=e?"FILTER (WHERE ".concat(ut(e.where),")"):"";return["".concat(a,"(").concat(u,")"),i,s,c].filter(vr).join(" ")},any_value:function(r){var t=r.args,e=r.type,n=r.over,o=t.expr,u=t.having,a="".concat(br(e),"(").concat(ut(o));return u&&(a="".concat(a," HAVING ").concat(br(u.prefix)," ").concat(ut(u.expr))),[a="".concat(a,")"),y(n)].filter(vr).join(" ")},window_func:function(r){var t=r.over;return[d(r),y(t)].filter(vr).join(" ")},array:tt,assign:_r,binary_expr:w,case:function(r){var t=["CASE"],e=r.args,n=r.expr,o=r.parentheses;n&&t.push(ut(n));for(var u=0,a=e.length;u<a;++u)t.push(e[u].type.toUpperCase()),e[u].cond&&(t.push(ut(e[u].cond)),t.push("THEN")),t.push(ut(e[u].result));return t.push("END"),o?"(".concat(t.join(" "),")"):t.join(" ")},cast:h,column_ref:W,column_definition:Q,datatype:mr,extract:function(r){var t=r.args,e=r.type,n=t.field,o=t.cast_type,u=t.source,a=["".concat(br(e),"(").concat(br(n)),"FROM",br(o),ut(u)];return"".concat(a.filter(vr).join(" "),")")},flatten:function(r){var t=r.args,e=r.type,n=["input","path","outer","recursive","mode"].map((function(r){return function(r){if(!r)return"";var t=r.type,e=r.symbol,n=r.value;return[br(t),e,ut(n)].filter(vr).join(" ")}(t[r])})).filter(vr).join(", ");return"".concat(br(e),"(").concat(n,")")},fulltext_search:function(r){var t=r.against,e=r.as,n=r.columns,o=r.match,u=r.mode;return[[br(o),"(".concat(n.map((function(r){return W(r)})).join(", "),")")].join(" "),[br(t),["(",ut(r.expr),u&&" ".concat(dr(u)),")"].filter(vr).join("")].join(" "),K(e)].filter(vr).join(" ")},function:m,insert:Ir,interval:M,json:function(r){var t=r.keyword,e=r.expr_list;return[br(t),e.map((function(r){return ut(r)})).join(", ")].join(" ")},show:jr,struct:tt,tablefunc:function(r){var t=r.as,e=r.name,n=r.args;return["".concat(e,"(").concat(ut(n).join(", "),")"),"AS",m(t)].join(" ")},tables:H,unnest:D,window:function(r){return r.expr.map(v).join(", ")}};function ot(r){var t=r.prefix,e=void 0===t?"@":t,n=r.name,o=r.members,u=r.keyword,a=r.quoted,s=r.suffix,i=[];u&&i.push(u);var c=o&&o.length>0?"".concat(n,".").concat(o.join(".")):n,l="".concat(e||"").concat(c);return s&&(l+=s),i.push(l),[a,i.join(" "),a].filter(vr).join("")}function ut(r){if(r){var t=r;if(r.ast){var e=t.ast;Reflect.deleteProperty(t,e);for(var n=0,o=Object.keys(e);n<o.length;n++){var u=o[n];t[u]=e[u]}}return nt[t.type]?nt[t.type](t):dr(t)}}function at(r){return r?r.map(ut):[]}function st(r,t){if(!Array.isArray(r))return"";var e=[],n=br(t);switch(n){case"ORDER BY":e=r.map((function(r){return[ut(r.expr),r.type||"ASC",br(r.nulls)].filter(vr).join(" ")}));break;case"PARTITION BY":default:e=r.map((function(r){return ut(r.expr)}))}return nr(n,e.join(", "))}nt.var=ot,nt.expr_list=function(r){var t=at(r.value);return r.parentheses?"(".concat(t.join(", "),")"):t},nt.select=function(r){var t="object"===et(r._next)?Ir(r):S(r);return r.parentheses?"(".concat(t,")"):t},nt.unary_expr=function(r){var t=r.operator,e=r.parentheses,n=r.expr,o="-"===t||"+"===t||"~"===t||"!"===t?"":" ",u="".concat(t).concat(o).concat(ut(n));return e?"(".concat(u,")"):u};var it=e(0);function ct(r){return(ct="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(r){return typeof r}:function(r){return r&&"function"==typeof Symbol&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r})(r)}var lt,ft,pt,bt,vt=(lt={},ft="sqlite",pt=it.parse,bt=function(r,t){if("object"!=ct(r)||!r)return r;var e=r[Symbol.toPrimitive];if(void 0!==e){var n=e.call(r,t||"default");if("object"!=ct(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(r)}(ft,"string"),(ft="symbol"==ct(bt)?bt:String(bt))in lt?Object.defineProperty(lt,ft,{value:pt,enumerable:!0,configurable:!0,writable:!0}):lt[ft]=pt,lt);function dt(r){return(dt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(r){return typeof r}:function(r){return r&&"function"==typeof Symbol&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r})(r)}function yt(r,t){var e="undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(!e){if(Array.isArray(r)||(e=function(r,t){if(!r)return;if("string"==typeof r)return ht(r,t);var e=Object.prototype.toString.call(r).slice(8,-1);"Object"===e&&r.constructor&&(e=r.constructor.name);if("Map"===e||"Set"===e)return Array.from(r);if("Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return ht(r,t)}(r))||t&&r&&"number"==typeof r.length){e&&(r=e);var n=0,o=function(){};return{s:o,n:function(){return n>=r.length?{done:!0}:{done:!1,value:r[n++]}},e:function(r){throw r},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var u,a=!0,s=!1;return{s:function(){e=e.call(r)},n:function(){var r=e.next();return a=r.done,r},e:function(r){s=!0,u=r},f:function(){try{a||null==e.return||e.return()}finally{if(s)throw u}}}}function ht(r,t){(null==t||t>r.length)&&(t=r.length);for(var e=0,n=new Array(t);e<t;e++)n[e]=r[e];return n}function mt(r,t){for(var e=0;e<t.length;e++){var n=t[e];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(r,wt(n.key),n)}}function wt(r){var t=function(r,t){if("object"!=dt(r)||!r)return r;var e=r[Symbol.toPrimitive];if(void 0!==e){var n=e.call(r,t||"default");if("object"!=dt(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(r)}(r,"string");return"symbol"==dt(t)?t:String(t)}var Lt=function(){function r(){!function(r,t){if(!(r instanceof t))throw new TypeError("Cannot call a class as a function")}(this,r)}var t,e,n;return t=r,(e=[{key:"astify",value:function(r){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:rr,e=this.parse(r,t);return e&&e.ast}},{key:"sqlify",value:function(r){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:rr;return ir(t),Ur(r)}},{key:"exprToSQL",value:function(r){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:rr;return ir(t),ut(r)}},{key:"parse",value:function(r){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:rr,e=t.database,n=void 0===e?"sqlite":e;ir(t);var o=n.toLowerCase();if(vt[o])return vt[o](r.trim(),t.parseOptions||rr.parseOptions);throw new Error("".concat(n," is not supported currently"))}},{key:"whiteListCheck",value:function(r,t){var e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:rr;if(t&&0!==t.length){var n=e.type,o=void 0===n?"table":n;if(!this["".concat(o,"List")]||"function"!=typeof this["".concat(o,"List")])throw new Error("".concat(o," is not valid check mode"));var u,a=this["".concat(o,"List")].bind(this),s=a(r,e),i=!0,c="",l=yt(s);try{for(l.s();!(u=l.n()).done;){var f,p=u.value,b=!1,v=yt(t);try{for(v.s();!(f=v.n()).done;){var d=f.value,y=new RegExp(d,"i");if(y.test(p)){b=!0;break}}}catch(r){v.e(r)}finally{v.f()}if(!b){c=p,i=!1;break}}}catch(r){l.e(r)}finally{l.f()}if(!i)throw new Error("authority = '".concat(c,"' is required in ").concat(o," whiteList to execute SQL = '").concat(r,"'"))}}},{key:"tableList",value:function(r,t){var e=this.parse(r,t);return e&&e.tableList}},{key:"columnList",value:function(r,t){var e=this.parse(r,t);return e&&e.columnList}}])&&mt(t.prototype,e),n&&mt(t,n),Object.defineProperty(t,"prototype",{writable:!1}),r}();function Ct(r){return(Ct="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(r){return typeof r}:function(r){return r&&"function"==typeof Symbol&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r})(r)}"object"===("undefined"==typeof self?"undefined":Ct(self))&&self&&(self.NodeSQLParser={Parser:Lt,util:n}),"undefined"==typeof global&&"object"===("undefined"==typeof window?"undefined":Ct(window))&&window&&(window.global=window),"object"===("undefined"==typeof global?"undefined":Ct(global))&&global&&global.window&&(global.window.NodeSQLParser={Parser:Lt,util:n})}]));
2
+ //# sourceMappingURL=sqlite.js.map
@@ -0,0 +1 @@
1
+ export * from '../types';