Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

sql-formatter-plus

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

sql-formatter-plus - npm Package Compare versions

Comparing version 1.3.3 to 1.3.4

2

dist/sql-formatter.min.js

@@ -1,1 +0,1 @@

!function(e){var E={};function t(r){if(E[r])return E[r].exports;var n=E[r]={i:r,l:!1,exports:{}};return e[r].call(n.exports,n,n.exports,t),n.l=!0,n.exports}t.m=e,t.c=E,t.d=function(e,E,r){t.o(e,E)||Object.defineProperty(e,E,{enumerable:!0,get:r})},t.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},t.t=function(e,E){if(1&E&&(e=t(e)),8&E)return e;if(4&E&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(t.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&E&&"string"!=typeof e)for(var n in e)t.d(r,n,function(E){return e[E]}.bind(null,n));return r},t.n=function(e){var E=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(E,"a",E),E},t.o=function(e,E){return Object.prototype.hasOwnProperty.call(e,E)},t.p="",t(t.s=64)}([function(e,E,t){var r=t(10),n="object"==typeof self&&self&&self.Object===Object&&self,T=r||n||Function("return this")();e.exports=T},function(e,E,t){var r=t(8),n=t(33),T=t(34),R="[object Null]",N="[object Undefined]",A=r?r.toStringTag:void 0;e.exports=function(e){return null==e?void 0===e?N:R:A&&A in Object(e)?n(e):T(e)}},function(e,E){e.exports=function(e){return null!=e&&"object"==typeof e}},function(e,E,t){var r=t(56),n=t(59);e.exports=function(e,E){var t=n(e,E);return r(t)?t:void 0}},function(e,E,t){var r=t(22),n=/[\\^$.*+?()[\]{}|]/g,T=RegExp(n.source);e.exports=function(e){return(e=r(e))&&T.test(e)?e.replace(n,"\\$&"):e}},function(e,E,t){var r=t(9),n=t(11);e.exports=function(e){return null!=e&&n(e.length)&&!r(e)}},function(e,E){e.exports=function(e){var E=typeof e;return null!=e&&("object"==E||"function"==E)}},function(e,E){var t=Array.isArray;e.exports=t},function(e,E,t){var r=t(0).Symbol;e.exports=r},function(e,E,t){var r=t(1),n=t(6),T="[object AsyncFunction]",R="[object Function]",N="[object GeneratorFunction]",A="[object Proxy]";e.exports=function(e){if(!n(e))return!1;var E=r(e);return E==R||E==N||E==T||E==A}},function(e,E,t){(function(E){var t="object"==typeof E&&E&&E.Object===Object&&E;e.exports=t}).call(this,t(32))},function(e,E){var t=9007199254740991;e.exports=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=t}},function(e,E,t){var r=t(36);e.exports=function(e){var E=r(e),t=E%1;return E==E?t?E-t:E:0}},function(e,E,t){var r=t(1),n=t(2),T="[object Symbol]";e.exports=function(e){return"symbol"==typeof e||n(e)&&r(e)==T}},function(e,E){e.exports=function(e,E){for(var t=-1,r=null==e?0:e.length,n=Array(r);++t<r;)n[t]=E(e[t],t,e);return n}},function(e,E,t){var r=t(43),n=t(2),T=Object.prototype,R=T.hasOwnProperty,N=T.propertyIsEnumerable,A=r(function(){return arguments}())?r:function(e){return n(e)&&R.call(e,"callee")&&!N.call(e,"callee")};e.exports=A},function(e,E,t){(function(e){var r=t(0),n=t(44),T=E&&!E.nodeType&&E,R=T&&"object"==typeof e&&e&&!e.nodeType&&e,N=R&&R.exports===T?r.Buffer:void 0,A=(N?N.isBuffer:void 0)||n;e.exports=A}).call(this,t(17)(e))},function(e,E){e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children||(e.children=[]),Object.defineProperty(e,"loaded",{enumerable:!0,get:function(){return e.l}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return e.i}}),e.webpackPolyfill=1),e}},function(e,E){var t=9007199254740991,r=/^(?:0|[1-9]\d*)$/;e.exports=function(e,E){var n=typeof e;return!!(E=null==E?t:E)&&("number"==n||"symbol"!=n&&r.test(e))&&e>-1&&e%1==0&&e<E}},function(e,E,t){var r=t(45),n=t(46),T=t(47),R=T&&T.isTypedArray,N=R?n(R):r;e.exports=N},function(e,E,t){var r=t(21),n=t(48),T=Object.prototype.hasOwnProperty;e.exports=function(e){if(!r(e))return n(e);var E=[];for(var t in Object(e))T.call(e,t)&&"constructor"!=t&&E.push(t);return E}},function(e,E){var t=Object.prototype;e.exports=function(e){var E=e&&e.constructor;return e===("function"==typeof E&&E.prototype||t)}},function(e,E,t){var r=t(53);e.exports=function(e){return null==e?"":r(e)}},function(e,E){var t=Function.prototype.toString;e.exports=function(e){if(null!=e){try{return t.call(e)}catch(e){}try{return e+""}catch(e){}}return""}},function(e,E,t){var r=t(28),n=t(5),T=t(35),R=t(12),N=t(38),A=Math.max;e.exports=function(e,E,t,o){e=n(e)?e:N(e),t=t&&!o?R(t):0;var I=e.length;return t<0&&(t=A(I+t,0)),T(e)?t<=I&&e.indexOf(E,t)>-1:!!I&&r(e,E,t)>-1}},function(e,E,t){var r=t(50),n=t(51),T=t(12),R=t(22);e.exports=function(e,E,t){return E=(t?n(e,E,t):void 0===E)?1:T(E),r(R(e),E)}},function(e,E){e.exports=function(e){var E=null==e?0:e.length;return E?e[E-1]:void 0}},function(e,E,t){var r=t(20),n=t(54),T=t(15),R=t(7),N=t(5),A=t(16),o=t(21),I=t(19),O="[object Map]",S="[object Set]",i=Object.prototype.hasOwnProperty;e.exports=function(e){if(null==e)return!0;if(N(e)&&(R(e)||"string"==typeof e||"function"==typeof e.splice||A(e)||I(e)||T(e)))return!e.length;var E=n(e);if(E==O||E==S)return!e.size;if(o(e))return!r(e).length;for(var t in e)if(i.call(e,t))return!1;return!0}},function(e,E,t){var r=t(29),n=t(30),T=t(31);e.exports=function(e,E,t){return E==E?T(e,E,t):r(e,n,t)}},function(e,E){e.exports=function(e,E,t,r){for(var n=e.length,T=t+(r?1:-1);r?T--:++T<n;)if(E(e[T],T,e))return T;return-1}},function(e,E){e.exports=function(e){return e!=e}},function(e,E){e.exports=function(e,E,t){for(var r=t-1,n=e.length;++r<n;)if(e[r]===E)return r;return-1}},function(e,E){var t;t=function(){return this}();try{t=t||new Function("return this")()}catch(e){"object"==typeof window&&(t=window)}e.exports=t},function(e,E,t){var r=t(8),n=Object.prototype,T=n.hasOwnProperty,R=n.toString,N=r?r.toStringTag:void 0;e.exports=function(e){var E=T.call(e,N),t=e[N];try{e[N]=void 0;var r=!0}catch(e){}var n=R.call(e);return r&&(E?e[N]=t:delete e[N]),n}},function(e,E){var t=Object.prototype.toString;e.exports=function(e){return t.call(e)}},function(e,E,t){var r=t(1),n=t(7),T=t(2),R="[object String]";e.exports=function(e){return"string"==typeof e||!n(e)&&T(e)&&r(e)==R}},function(e,E,t){var r=t(37),n=1/0,T=17976931348623157e292;e.exports=function(e){return e?(e=r(e))===n||e===-n?(e<0?-1:1)*T:e==e?e:0:0===e?e:0}},function(e,E,t){var r=t(6),n=t(13),T=NaN,R=/^\s+|\s+$/g,N=/^[-+]0x[0-9a-f]+$/i,A=/^0b[01]+$/i,o=/^0o[0-7]+$/i,I=parseInt;e.exports=function(e){if("number"==typeof e)return e;if(n(e))return T;if(r(e)){var E="function"==typeof e.valueOf?e.valueOf():e;e=r(E)?E+"":E}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(R,"");var t=A.test(e);return t||o.test(e)?I(e.slice(2),t?2:8):N.test(e)?T:+e}},function(e,E,t){var r=t(39),n=t(40);e.exports=function(e){return null==e?[]:r(e,n(e))}},function(e,E,t){var r=t(14);e.exports=function(e,E){return r(E,(function(E){return e[E]}))}},function(e,E,t){var r=t(41),n=t(20),T=t(5);e.exports=function(e){return T(e)?r(e):n(e)}},function(e,E,t){var r=t(42),n=t(15),T=t(7),R=t(16),N=t(18),A=t(19),o=Object.prototype.hasOwnProperty;e.exports=function(e,E){var t=T(e),I=!t&&n(e),O=!t&&!I&&R(e),S=!t&&!I&&!O&&A(e),i=t||I||O||S,L=i?r(e.length,String):[],s=L.length;for(var C in e)!E&&!o.call(e,C)||i&&("length"==C||O&&("offset"==C||"parent"==C)||S&&("buffer"==C||"byteLength"==C||"byteOffset"==C)||N(C,s))||L.push(C);return L}},function(e,E){e.exports=function(e,E){for(var t=-1,r=Array(e);++t<e;)r[t]=E(t);return r}},function(e,E,t){var r=t(1),n=t(2),T="[object Arguments]";e.exports=function(e){return n(e)&&r(e)==T}},function(e,E){e.exports=function(){return!1}},function(e,E,t){var r=t(1),n=t(11),T=t(2),R={};R["[object Float32Array]"]=R["[object Float64Array]"]=R["[object Int8Array]"]=R["[object Int16Array]"]=R["[object Int32Array]"]=R["[object Uint8Array]"]=R["[object Uint8ClampedArray]"]=R["[object Uint16Array]"]=R["[object Uint32Array]"]=!0,R["[object Arguments]"]=R["[object Array]"]=R["[object ArrayBuffer]"]=R["[object Boolean]"]=R["[object DataView]"]=R["[object Date]"]=R["[object Error]"]=R["[object Function]"]=R["[object Map]"]=R["[object Number]"]=R["[object Object]"]=R["[object RegExp]"]=R["[object Set]"]=R["[object String]"]=R["[object WeakMap]"]=!1,e.exports=function(e){return T(e)&&n(e.length)&&!!R[r(e)]}},function(e,E){e.exports=function(e){return function(E){return e(E)}}},function(e,E,t){(function(e){var r=t(10),n=E&&!E.nodeType&&E,T=n&&"object"==typeof e&&e&&!e.nodeType&&e,R=T&&T.exports===n&&r.process,N=function(){try{var e=T&&T.require&&T.require("util").types;return e||R&&R.binding&&R.binding("util")}catch(e){}}();e.exports=N}).call(this,t(17)(e))},function(e,E,t){var r=t(49)(Object.keys,Object);e.exports=r},function(e,E){e.exports=function(e,E){return function(t){return e(E(t))}}},function(e,E){var t=9007199254740991,r=Math.floor;e.exports=function(e,E){var n="";if(!e||E<1||E>t)return n;do{E%2&&(n+=e),(E=r(E/2))&&(e+=e)}while(E);return n}},function(e,E,t){var r=t(52),n=t(5),T=t(18),R=t(6);e.exports=function(e,E,t){if(!R(t))return!1;var N=typeof E;return!!("number"==N?n(t)&&T(E,t.length):"string"==N&&E in t)&&r(t[E],e)}},function(e,E){e.exports=function(e,E){return e===E||e!=e&&E!=E}},function(e,E,t){var r=t(8),n=t(14),T=t(7),R=t(13),N=1/0,A=r?r.prototype:void 0,o=A?A.toString:void 0;e.exports=function e(E){if("string"==typeof E)return E;if(T(E))return n(E,e)+"";if(R(E))return o?o.call(E):"";var t=E+"";return"0"==t&&1/E==-N?"-0":t}},function(e,E,t){var r=t(55),n=t(60),T=t(61),R=t(62),N=t(63),A=t(1),o=t(23),I=o(r),O=o(n),S=o(T),i=o(R),L=o(N),s=A;(r&&"[object DataView]"!=s(new r(new ArrayBuffer(1)))||n&&"[object Map]"!=s(new n)||T&&"[object Promise]"!=s(T.resolve())||R&&"[object Set]"!=s(new R)||N&&"[object WeakMap]"!=s(new N))&&(s=function(e){var E=A(e),t="[object Object]"==E?e.constructor:void 0,r=t?o(t):"";if(r)switch(r){case I:return"[object DataView]";case O:return"[object Map]";case S:return"[object Promise]";case i:return"[object Set]";case L:return"[object WeakMap]"}return E}),e.exports=s},function(e,E,t){var r=t(3)(t(0),"DataView");e.exports=r},function(e,E,t){var r=t(9),n=t(57),T=t(6),R=t(23),N=/^\[object .+?Constructor\]$/,A=Function.prototype,o=Object.prototype,I=A.toString,O=o.hasOwnProperty,S=RegExp("^"+I.call(O).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");e.exports=function(e){return!(!T(e)||n(e))&&(r(e)?S:N).test(R(e))}},function(e,E,t){var r,n=t(58),T=(r=/[^.]+$/.exec(n&&n.keys&&n.keys.IE_PROTO||""))?"Symbol(src)_1."+r:"";e.exports=function(e){return!!T&&T in e}},function(e,E,t){var r=t(0)["__core-js_shared__"];e.exports=r},function(e,E){e.exports=function(e,E){return null==e?void 0:e[E]}},function(e,E,t){var r=t(3)(t(0),"Map");e.exports=r},function(e,E,t){var r=t(3)(t(0),"Promise");e.exports=r},function(e,E,t){var r=t(3)(t(0),"Set");e.exports=r},function(e,E,t){var r=t(3)(t(0),"WeakMap");e.exports=r},function(e,E,t){"use strict";t.r(E);var r=t(24),n=t.n(r),T={WHITESPACE:"whitespace",WORD:"word",STRING:"string",RESERVED:"reserved",RESERVED_TOP_LEVEL:"reserved-top-level",RESERVED_NEWLINE:"reserved-newline",OPERATOR:"operator",OPEN_PAREN:"open-paren",CLOSE_PAREN:"close-paren",LINE_COMMENT:"line-comment",BLOCK_COMMENT:"block-comment",NUMBER:"number",PLACEHOLDER:"placeholder"},R=t(25),N=t.n(R),A=t(26),o=t.n(A);const I="top-level",O="block-level";class S{constructor(e){this.indent=e||" ",this.indentTypes=[]}getIndent(){return N()(this.indent,this.indentTypes.length)}increaseTopLevel(){this.indentTypes.push(I)}increaseBlockLevel(){this.indentTypes.push(O)}decreaseTopLevel(){o()(this.indentTypes)===I&&this.indentTypes.pop()}resetIndentation(){this.indentTypes=[]}decreaseBlockLevel(){for(;this.indentTypes.length>0;){if(this.indentTypes.pop()!==I)break}}}const i=50;class L{constructor(){this.level=0}beginIfPossible(e,E){0===this.level&&this.isInlineBlock(e,E)?this.level=1:this.level>0?this.level++:this.level=0}end(){this.level--}isActive(){return this.level>0}isInlineBlock(e,E){let t=0,r=0;for(let n=E;n<e.length;n++){const E=e[n];if((t+=E.value.length)>i)return!1;if(E.type===T.OPEN_PAREN)r++;else if(E.type===T.CLOSE_PAREN&&0===--r)return!0;if(this.isForbiddenToken(E))return!1}return!1}isForbiddenToken({type:e,value:E}){return e===T.RESERVED_TOP_LEVEL||e===T.RESERVED_NEWLINE||e===T.COMMENT||e===T.BLOCK_COMMENT||";"===E}}class s{constructor(e){this.params=e,this.index=0}get({key:e,value:E}){return this.params?e?this.params[e]:this.params[this.index++]:E}}const C=e=>e.replace(/[ \t]+$/u,"");class a{constructor(e,E){this.cfg=e||{},this.indentation=new S(this.cfg.indent),this.inlineBlock=new L,this.params=new s(this.cfg.params),this.tokenizer=E,this.previousReservedWord={},this.tokens=[],this.index=0}format(e){return this.tokens=this.tokenizer.tokenize(e),this.getFormattedQueryFromTokens().trim()}getFormattedQueryFromTokens(){let e="";return this.tokens.forEach((E,t)=>{this.index=t,E.type===T.WHITESPACE||(E.type===T.LINE_COMMENT?e=this.formatLineComment(E,e):E.type===T.BLOCK_COMMENT?e=this.formatBlockComment(E,e):E.type===T.RESERVED_TOP_LEVEL?(e=this.formatTopLevelReservedWord(E,e),this.previousReservedWord=E):E.type===T.RESERVED_NEWLINE?(e=this.formatNewlineReservedWord(E,e),this.previousReservedWord=E):E.type===T.RESERVED?(e=this.formatWithSpaces(E,e),this.previousReservedWord=E):e=E.type===T.OPEN_PAREN?this.formatOpeningParentheses(E,e):E.type===T.CLOSE_PAREN?this.formatClosingParentheses(E,e):E.type===T.PLACEHOLDER?this.formatPlaceholder(E,e):","===E.value?this.formatComma(E,e):":"===E.value?this.formatWithSpaceAfter(E,e):"."===E.value?this.formatWithoutSpaces(E,e):";"===E.value?this.formatQuerySeparator(E,e):this.formatWithSpaces(E,e))}),e}formatLineComment(e,E){return this.addNewline(E+e.value)}formatBlockComment(e,E){return this.addNewline(this.addNewline(E)+this.indentComment(e.value))}indentComment(e){return e.replace(/\n[ \t]*/gu,"\n"+this.indentation.getIndent()+" ")}formatTopLevelReservedWord(e,E){return this.indentation.decreaseTopLevel(),E=this.addNewline(E),this.indentation.increaseTopLevel(),E+=this.equalizeWhitespace(this.formatReservedWord(e.value)),this.addNewline(E)}formatNewlineReservedWord(e,E){return this.addNewline(E)+this.equalizeWhitespace(this.formatReservedWord(e.value))+" "}equalizeWhitespace(e){return e.replace(/\s+/gu," ")}formatOpeningParentheses(e,E){const t=[T.WHITESPACE,T.OPEN_PAREN,T.LINE_COMMENT];return n()(t,this.previousToken().type)||(E=C(E)),E+=e.value,this.inlineBlock.beginIfPossible(this.tokens,this.index),this.inlineBlock.isActive()||(this.indentation.increaseBlockLevel(),E=this.addNewline(E)),E}formatClosingParentheses(e,E){return this.inlineBlock.isActive()?(this.inlineBlock.end(),this.formatWithSpaceAfter(e,E)):(this.indentation.decreaseBlockLevel(),this.formatWithSpaces(e,this.addNewline(E)))}formatPlaceholder(e,E){return E+this.params.get(e)+" "}formatComma(e,E){return E=C(E)+e.value+" ",this.inlineBlock.isActive()?E:/^LIMIT$/iu.test(this.previousReservedWord.value)?E:this.addNewline(E)}formatWithSpaceAfter(e,E){return C(E)+e.value+" "}formatWithoutSpaces(e,E){return C(E)+e.value}formatWithSpaces(e,E){return E+("reserved"===e.type?this.formatReservedWord(e.value):e.value)+" "}formatReservedWord(e){return this.cfg.uppercase?e.toUpperCase():e}formatQuerySeparator(e,E){return this.indentation.resetIndentation(),C(E)+e.value+"\n".repeat(this.cfg.linesBetweenQueries||1)}addNewline(e){return(e=C(e)).endsWith("\n")||(e+="\n"),e+this.indentation.getIndent()}previousToken(e=1){return this.tokens[this.index-e]||{}}}var c=t(27),u=t.n(c),P=t(4),l=t.n(P);class D{constructor(e){this.WHITESPACE_REGEX=/^(\s+)/u,this.NUMBER_REGEX=/^((-\s*)?[0-9]+(\.[0-9]+)?|0x[0-9a-fA-F]+|0b[01]+)\b/u,this.OPERATOR_REGEX=/^(!=|<>|==|<=|>=|!<|!>|\|\||::|->>|->|~~\*|~~|!~~\*|!~~|~\*|!~\*|!~|.)/u,this.BLOCK_COMMENT_REGEX=/^(\/\*[^]*?(?:\*\/|$))/u,this.LINE_COMMENT_REGEX=this.createLineCommentRegex(e.lineCommentTypes),this.RESERVED_TOP_LEVEL_REGEX=this.createReservedWordRegex(e.reservedTopLevelWords),this.RESERVED_NEWLINE_REGEX=this.createReservedWordRegex(e.reservedNewlineWords),this.RESERVED_PLAIN_REGEX=this.createReservedWordRegex(e.reservedWords),this.WORD_REGEX=this.createWordRegex(e.specialWordChars),this.STRING_REGEX=this.createStringRegex(e.stringTypes),this.OPEN_PAREN_REGEX=this.createParenRegex(e.openParens),this.CLOSE_PAREN_REGEX=this.createParenRegex(e.closeParens),this.INDEXED_PLACEHOLDER_REGEX=this.createPlaceholderRegex(e.indexedPlaceholderTypes,"[0-9]*"),this.IDENT_NAMED_PLACEHOLDER_REGEX=this.createPlaceholderRegex(e.namedPlaceholderTypes,"[a-zA-Z0-9._$]+"),this.STRING_NAMED_PLACEHOLDER_REGEX=this.createPlaceholderRegex(e.namedPlaceholderTypes,this.createStringPattern(e.stringTypes))}createLineCommentRegex(e){return new RegExp(`^((?:${e.map(e=>l()(e)).join("|")}).*?(?:\r\n|\r|\n|$))`,"u")}createReservedWordRegex(e){const E=e.join("|").replace(/ /gu,"\\s+");return new RegExp(`^(${E})\\b`,"iu")}createWordRegex(e=[]){return new RegExp(`^([\\p{Alphabetic}\\p{Mark}\\p{Decimal_Number}\\p{Connector_Punctuation}\\p{Join_Control}${e.join("")}]+)`,"u")}createStringRegex(e){return new RegExp("^("+this.createStringPattern(e)+")","u")}createStringPattern(e){const E={"``":"((`[^`]*($|`))+)","[]":"((\\[[^\\]]*($|\\]))(\\][^\\]]*($|\\]))*)",'""':'(("[^"\\\\]*(?:\\\\.[^"\\\\]*)*("|$))+)',"''":"(('[^'\\\\]*(?:\\\\.[^'\\\\]*)*('|$))+)","N''":"((N'[^N'\\\\]*(?:\\\\.[^N'\\\\]*)*('|$))+)"};return e.map(e=>E[e]).join("|")}createParenRegex(e){return new RegExp("^("+e.map(e=>this.escapeParen(e)).join("|")+")","iu")}escapeParen(e){return 1===e.length?l()(e):"\\b"+e+"\\b"}createPlaceholderRegex(e,E){if(u()(e))return!1;const t=e.map(l.a).join("|");return new RegExp(`^((?:${t})(?:${E}))`,"u")}tokenize(e){if(!e)return[];const E=[];let t;for(;e.length;)t=this.getNextToken(e,t),e=e.substring(t.value.length),E.push(t);return E}getNextToken(e,E){return this.getWhitespaceToken(e)||this.getCommentToken(e)||this.getStringToken(e)||this.getOpenParenToken(e)||this.getCloseParenToken(e)||this.getPlaceholderToken(e)||this.getNumberToken(e)||this.getReservedWordToken(e,E)||this.getWordToken(e)||this.getOperatorToken(e)}getWhitespaceToken(e){return this.getTokenOnFirstMatch({input:e,type:T.WHITESPACE,regex:this.WHITESPACE_REGEX})}getCommentToken(e){return this.getLineCommentToken(e)||this.getBlockCommentToken(e)}getLineCommentToken(e){return this.getTokenOnFirstMatch({input:e,type:T.LINE_COMMENT,regex:this.LINE_COMMENT_REGEX})}getBlockCommentToken(e){return this.getTokenOnFirstMatch({input:e,type:T.BLOCK_COMMENT,regex:this.BLOCK_COMMENT_REGEX})}getStringToken(e){return this.getTokenOnFirstMatch({input:e,type:T.STRING,regex:this.STRING_REGEX})}getOpenParenToken(e){return this.getTokenOnFirstMatch({input:e,type:T.OPEN_PAREN,regex:this.OPEN_PAREN_REGEX})}getCloseParenToken(e){return this.getTokenOnFirstMatch({input:e,type:T.CLOSE_PAREN,regex:this.CLOSE_PAREN_REGEX})}getPlaceholderToken(e){return this.getIdentNamedPlaceholderToken(e)||this.getStringNamedPlaceholderToken(e)||this.getIndexedPlaceholderToken(e)}getIdentNamedPlaceholderToken(e){return this.getPlaceholderTokenWithKey({input:e,regex:this.IDENT_NAMED_PLACEHOLDER_REGEX,parseKey:e=>e.slice(1)})}getStringNamedPlaceholderToken(e){return this.getPlaceholderTokenWithKey({input:e,regex:this.STRING_NAMED_PLACEHOLDER_REGEX,parseKey:e=>this.getEscapedPlaceholderKey({key:e.slice(2,-1),quoteChar:e.slice(-1)})})}getIndexedPlaceholderToken(e){return this.getPlaceholderTokenWithKey({input:e,regex:this.INDEXED_PLACEHOLDER_REGEX,parseKey:e=>e.slice(1)})}getPlaceholderTokenWithKey({input:e,regex:E,parseKey:t}){const r=this.getTokenOnFirstMatch({input:e,regex:E,type:T.PLACEHOLDER});return r&&(r.key=t(r.value)),r}getEscapedPlaceholderKey({key:e,quoteChar:E}){return e.replace(new RegExp(l()("\\"+E),"gu"),E)}getNumberToken(e){return this.getTokenOnFirstMatch({input:e,type:T.NUMBER,regex:this.NUMBER_REGEX})}getOperatorToken(e){return this.getTokenOnFirstMatch({input:e,type:T.OPERATOR,regex:this.OPERATOR_REGEX})}getReservedWordToken(e,E){if(!E||!E.value||"."!==E.value)return this.getTopLevelReservedToken(e)||this.getNewlineReservedToken(e)||this.getPlainReservedToken(e)}getTopLevelReservedToken(e){return this.getTokenOnFirstMatch({input:e,type:T.RESERVED_TOP_LEVEL,regex:this.RESERVED_TOP_LEVEL_REGEX})}getNewlineReservedToken(e){return this.getTokenOnFirstMatch({input:e,type:T.RESERVED_NEWLINE,regex:this.RESERVED_NEWLINE_REGEX})}getPlainReservedToken(e){return this.getTokenOnFirstMatch({input:e,type:T.RESERVED,regex:this.RESERVED_PLAIN_REGEX})}getWordToken(e){return this.getTokenOnFirstMatch({input:e,type:T.WORD,regex:this.WORD_REGEX})}getTokenOnFirstMatch({input:e,type:E,regex:t}){const r=e.match(t);if(r)return{type:E,value:r[1]}}}const U=["ABS","ACTIVATE","ALIAS","ALL","ALLOCATE","ALLOW","ALTER","ANY","ARE","ARRAY","AS","ASC","ASENSITIVE","ASSOCIATE","ASUTIME","ASYMMETRIC","AT","ATOMIC","ATTRIBUTES","AUDIT","AUTHORIZATION","AUX","AUXILIARY","AVG","BEFORE","BEGIN","BETWEEN","BIGINT","BINARY","BLOB","BOOLEAN","BOTH","BUFFERPOOL","BY","CACHE","CALL","CALLED","CAPTURE","CARDINALITY","CASCADED","CASE","CAST","CCSID","CEIL","CEILING","CHAR","CHARACTER","CHARACTER_LENGTH","CHAR_LENGTH","CHECK","CLOB","CLONE","CLOSE","CLUSTER","COALESCE","COLLATE","COLLECT","COLLECTION","COLLID","COLUMN","COMMENT","COMMIT","CONCAT","CONDITION","CONNECT","CONNECTION","CONSTRAINT","CONTAINS","CONTINUE","CONVERT","CORR","CORRESPONDING","COUNT","COUNT_BIG","COVAR_POP","COVAR_SAMP","CREATE","CROSS","CUBE","CUME_DIST","CURRENT","CURRENT_DATE","CURRENT_DEFAULT_TRANSFORM_GROUP","CURRENT_LC_CTYPE","CURRENT_PATH","CURRENT_ROLE","CURRENT_SCHEMA","CURRENT_SERVER","CURRENT_TIME","CURRENT_TIMESTAMP","CURRENT_TIMEZONE","CURRENT_TRANSFORM_GROUP_FOR_TYPE","CURRENT_USER","CURSOR","CYCLE","DATA","DATABASE","DATAPARTITIONNAME","DATAPARTITIONNUM","DATE","DAY","DAYS","DB2GENERAL","DB2GENRL","DB2SQL","DBINFO","DBPARTITIONNAME","DBPARTITIONNUM","DEALLOCATE","DEC","DECIMAL","DECLARE","DEFAULT","DEFAULTS","DEFINITION","DELETE","DENSERANK","DENSE_RANK","DEREF","DESCRIBE","DESCRIPTOR","DETERMINISTIC","DIAGNOSTICS","DISABLE","DISALLOW","DISCONNECT","DISTINCT","DO","DOCUMENT","DOUBLE","DROP","DSSIZE","DYNAMIC","EACH","EDITPROC","ELEMENT","ELSE","ELSEIF","ENABLE","ENCODING","ENCRYPTION","END","END-EXEC","ENDING","ERASE","ESCAPE","EVERY","EXCEPTION","EXCLUDING","EXCLUSIVE","EXEC","EXECUTE","EXISTS","EXIT","EXP","EXPLAIN","EXTENDED","EXTERNAL","EXTRACT","FALSE","FENCED","FETCH","FIELDPROC","FILE","FILTER","FINAL","FIRST","FLOAT","FLOOR","FOR","FOREIGN","FREE","FULL","FUNCTION","FUSION","GENERAL","GENERATED","GET","GLOBAL","GOTO","GRANT","GRAPHIC","GROUP","GROUPING","HANDLER","HASH","HASHED_VALUE","HINT","HOLD","HOUR","HOURS","IDENTITY","IF","IMMEDIATE","IN","INCLUDING","INCLUSIVE","INCREMENT","INDEX","INDICATOR","INDICATORS","INF","INFINITY","INHERIT","INNER","INOUT","INSENSITIVE","INSERT","INT","INTEGER","INTEGRITY","INTERSECTION","INTERVAL","INTO","IS","ISOBID","ISOLATION","ITERATE","JAR","JAVA","KEEP","KEY","LABEL","LANGUAGE","LARGE","LATERAL","LC_CTYPE","LEADING","LEAVE","LEFT","LIKE","LINKTYPE","LN","LOCAL","LOCALDATE","LOCALE","LOCALTIME","LOCALTIMESTAMP","LOCATOR","LOCATORS","LOCK","LOCKMAX","LOCKSIZE","LONG","LOOP","LOWER","MAINTAINED","MATCH","MATERIALIZED","MAX","MAXVALUE","MEMBER","MERGE","METHOD","MICROSECOND","MICROSECONDS","MIN","MINUTE","MINUTES","MINVALUE","MOD","MODE","MODIFIES","MODULE","MONTH","MONTHS","MULTISET","NAN","NATIONAL","NATURAL","NCHAR","NCLOB","NEW","NEW_TABLE","NEXTVAL","NO","NOCACHE","NOCYCLE","NODENAME","NODENUMBER","NOMAXVALUE","NOMINVALUE","NONE","NOORDER","NORMALIZE","NORMALIZED","NOT","NULL","NULLIF","NULLS","NUMERIC","NUMPARTS","OBID","OCTET_LENGTH","OF","OFFSET","OLD","OLD_TABLE","ON","ONLY","OPEN","OPTIMIZATION","OPTIMIZE","OPTION","ORDER","OUT","OUTER","OVER","OVERLAPS","OVERLAY","OVERRIDING","PACKAGE","PADDED","PAGESIZE","PARAMETER","PART","PARTITION","PARTITIONED","PARTITIONING","PARTITIONS","PASSWORD","PATH","PERCENTILE_CONT","PERCENTILE_DISC","PERCENT_RANK","PIECESIZE","PLAN","POSITION","POWER","PRECISION","PREPARE","PREVVAL","PRIMARY","PRIQTY","PRIVILEGES","PROCEDURE","PROGRAM","PSID","PUBLIC","QUERY","QUERYNO","RANGE","RANK","READ","READS","REAL","RECOVERY","RECURSIVE","REF","REFERENCES","REFERENCING","REFRESH","REGR_AVGX","REGR_AVGY","REGR_COUNT","REGR_INTERCEPT","REGR_R2","REGR_SLOPE","REGR_SXX","REGR_SXY","REGR_SYY","RELEASE","RENAME","REPEAT","RESET","RESIGNAL","RESTART","RESTRICT","RESULT","RESULT_SET_LOCATOR","RETURN","RETURNS","REVOKE","RIGHT","ROLE","ROLLBACK","ROLLUP","ROUND_CEILING","ROUND_DOWN","ROUND_FLOOR","ROUND_HALF_DOWN","ROUND_HALF_EVEN","ROUND_HALF_UP","ROUND_UP","ROUTINE","ROW","ROWNUMBER","ROWS","ROWSET","ROW_NUMBER","RRN","RUN","SAVEPOINT","SCHEMA","SCOPE","SCRATCHPAD","SCROLL","SEARCH","SECOND","SECONDS","SECQTY","SECURITY","SENSITIVE","SEQUENCE","SESSION","SESSION_USER","SIGNAL","SIMILAR","SIMPLE","SMALLINT","SNAN","SOME","SOURCE","SPECIFIC","SPECIFICTYPE","SQL","SQLEXCEPTION","SQLID","SQLSTATE","SQLWARNING","SQRT","STACKED","STANDARD","START","STARTING","STATEMENT","STATIC","STATMENT","STAY","STDDEV_POP","STDDEV_SAMP","STOGROUP","STORES","STYLE","SUBMULTISET","SUBSTRING","SUM","SUMMARY","SYMMETRIC","SYNONYM","SYSFUN","SYSIBM","SYSPROC","SYSTEM","SYSTEM_USER","TABLE","TABLESAMPLE","TABLESPACE","THEN","TIME","TIMESTAMP","TIMEZONE_HOUR","TIMEZONE_MINUTE","TO","TRAILING","TRANSACTION","TRANSLATE","TRANSLATION","TREAT","TRIGGER","TRIM","TRUE","TRUNCATE","TYPE","UESCAPE","UNDO","UNIQUE","UNKNOWN","UNNEST","UNTIL","UPPER","USAGE","USER","USING","VALIDPROC","VALUE","VARCHAR","VARIABLE","VARIANT","VARYING","VAR_POP","VAR_SAMP","VCAT","VERSION","VIEW","VOLATILE","VOLUMES","WHEN","WHENEVER","WHILE","WIDTH_BUCKET","WINDOW","WITH","WITHIN","WITHOUT","WLM","WRITE","XMLELEMENT","XMLEXISTS","XMLNAMESPACES","YEAR","YEARS"],p=["ADD","AFTER","ALTER COLUMN","ALTER TABLE","DELETE FROM","EXCEPT","FETCH FIRST","FROM","GROUP BY","GO","HAVING","INSERT INTO","INTERSECT","LIMIT","ORDER BY","SELECT","SET CURRENT SCHEMA","SET SCHEMA","SET","UNION ALL","UPDATE","VALUES","WHERE"],M=["AND","CROSS JOIN","INNER JOIN","JOIN","LEFT JOIN","LEFT OUTER JOIN","OR","OUTER JOIN","RIGHT JOIN","RIGHT OUTER JOIN"];let h;class f{constructor(e){this.cfg=e}format(e){return h||(h=new D({reservedWords:U,reservedTopLevelWords:p,reservedNewlineWords:M,stringTypes:['""',"''","``","[]"],openParens:["("],closeParens:[")"],indexedPlaceholderTypes:["?"],namedPlaceholderTypes:[":"],lineCommentTypes:["--"],specialWordChars:["#","@"]})),new a(this.cfg,h).format(e)}}const d=["ALL","ALTER","ANALYZE","AND","ANY","ARRAY","AS","ASC","BEGIN","BETWEEN","BINARY","BOOLEAN","BREAK","BUCKET","BUILD","BY","CALL","CASE","CAST","CLUSTER","COLLATE","COLLECTION","COMMIT","CONNECT","CONTINUE","CORRELATE","COVER","CREATE","DATABASE","DATASET","DATASTORE","DECLARE","DECREMENT","DELETE","DERIVED","DESC","DESCRIBE","DISTINCT","DO","DROP","EACH","ELEMENT","ELSE","END","EVERY","EXCEPT","EXCLUDE","EXECUTE","EXISTS","EXPLAIN","FALSE","FETCH","FIRST","FLATTEN","FOR","FORCE","FROM","FUNCTION","GRANT","GROUP","GSI","HAVING","IF","IGNORE","ILIKE","IN","INCLUDE","INCREMENT","INDEX","INFER","INLINE","INNER","INSERT","INTERSECT","INTO","IS","JOIN","KEY","KEYS","KEYSPACE","KNOWN","LAST","LEFT","LET","LETTING","LIKE","LIMIT","LSM","MAP","MAPPING","MATCHED","MATERIALIZED","MERGE","MINUS","MISSING","NAMESPACE","NEST","NOT","NULL","NUMBER","OBJECT","OFFSET","ON","OPTION","OR","ORDER","OUTER","OVER","PARSE","PARTITION","PASSWORD","PATH","POOL","PREPARE","PRIMARY","PRIVATE","PRIVILEGE","PROCEDURE","PUBLIC","RAW","REALM","REDUCE","RENAME","RETURN","RETURNING","REVOKE","RIGHT","ROLE","ROLLBACK","SATISFIES","SCHEMA","SELECT","SELF","SEMI","SET","SHOW","SOME","START","STATISTICS","STRING","SYSTEM","THEN","TO","TRANSACTION","TRIGGER","TRUE","TRUNCATE","UNDER","UNION","UNIQUE","UNKNOWN","UNNEST","UNSET","UPDATE","UPSERT","USE","USER","USING","VALIDATE","VALUE","VALUED","VALUES","VIA","VIEW","WHEN","WHERE","WHILE","WITH","WITHIN","WORK","XOR"],_=["DELETE FROM","EXCEPT ALL","EXCEPT","EXPLAIN DELETE FROM","EXPLAIN UPDATE","EXPLAIN UPSERT","FROM","GROUP BY","HAVING","INFER","INSERT INTO","INTERSECT ALL","INTERSECT","LET","LIMIT","MERGE","NEST","ORDER BY","PREPARE","SELECT","SET CURRENT SCHEMA","SET SCHEMA","SET","UNION ALL","UNION","UNNEST","UPDATE","UPSERT","USE KEYS","VALUES","WHERE"],G=["AND","INNER JOIN","JOIN","LEFT JOIN","LEFT OUTER JOIN","OR","OUTER JOIN","RIGHT JOIN","RIGHT OUTER JOIN","XOR"];let v;class g{constructor(e){this.cfg=e}format(e){return v||(v=new D({reservedWords:d,reservedTopLevelWords:_,reservedNewlineWords:G,stringTypes:['""',"''","``"],openParens:["(","[","{"],closeParens:[")","]","}"],namedPlaceholderTypes:["$"],lineCommentTypes:["#","--"]})),new a(this.cfg,v).format(e)}}const F=["A","ACCESSIBLE","AGENT","AGGREGATE","ALL","ALTER","ANY","ARRAY","AS","ASC","AT","ATTRIBUTE","AUTHID","AVG","BETWEEN","BFILE_BASE","BINARY_INTEGER","BINARY","BLOB_BASE","BLOCK","BODY","BOOLEAN","BOTH","BOUND","BULK","BY","BYTE","C","CALL","CALLING","CASCADE","CASE","CHAR_BASE","CHAR","CHARACTER","CHARSET","CHARSETFORM","CHARSETID","CHECK","CLOB_BASE","CLONE","CLOSE","CLUSTER","CLUSTERS","COALESCE","COLAUTH","COLLECT","COLUMNS","COMMENT","COMMIT","COMMITTED","COMPILED","COMPRESS","CONNECT","CONSTANT","CONSTRUCTOR","CONTEXT","CONTINUE","CONVERT","COUNT","CRASH","CREATE","CREDENTIAL","CURRENT","CURRVAL","CURSOR","CUSTOMDATUM","DANGLING","DATA","DATE_BASE","DATE","DAY","DECIMAL","DEFAULT","DEFINE","DELETE","DESC","DETERMINISTIC","DIRECTORY","DISTINCT","DO","DOUBLE","DROP","DURATION","ELEMENT","ELSIF","EMPTY","ESCAPE","EXCEPTIONS","EXCLUSIVE","EXECUTE","EXISTS","EXIT","EXTENDS","EXTERNAL","EXTRACT","FALSE","FETCH","FINAL","FIRST","FIXED","FLOAT","FOR","FORALL","FORCE","FROM","FUNCTION","GENERAL","GOTO","GRANT","GROUP","HASH","HEAP","HIDDEN","HOUR","IDENTIFIED","IF","IMMEDIATE","IN","INCLUDING","INDEX","INDEXES","INDICATOR","INDICES","INFINITE","INSTANTIABLE","INT","INTEGER","INTERFACE","INTERVAL","INTO","INVALIDATE","IS","ISOLATION","JAVA","LANGUAGE","LARGE","LEADING","LENGTH","LEVEL","LIBRARY","LIKE","LIKE2","LIKE4","LIKEC","LIMITED","LOCAL","LOCK","LONG","MAP","MAX","MAXLEN","MEMBER","MERGE","MIN","MINUS","MINUTE","MLSLABEL","MOD","MODE","MONTH","MULTISET","NAME","NAN","NATIONAL","NATIVE","NATURAL","NATURALN","NCHAR","NEW","NEXTVAL","NOCOMPRESS","NOCOPY","NOT","NOWAIT","NULL","NULLIF","NUMBER_BASE","NUMBER","OBJECT","OCICOLL","OCIDATE","OCIDATETIME","OCIDURATION","OCIINTERVAL","OCILOBLOCATOR","OCINUMBER","OCIRAW","OCIREF","OCIREFCURSOR","OCIROWID","OCISTRING","OCITYPE","OF","OLD","ON","ONLY","OPAQUE","OPEN","OPERATOR","OPTION","ORACLE","ORADATA","ORDER","ORGANIZATION","ORLANY","ORLVARY","OTHERS","OUT","OVERLAPS","OVERRIDING","PACKAGE","PARALLEL_ENABLE","PARAMETER","PARAMETERS","PARENT","PARTITION","PASCAL","PCTFREE","PIPE","PIPELINED","PLS_INTEGER","PLUGGABLE","POSITIVE","POSITIVEN","PRAGMA","PRECISION","PRIOR","PRIVATE","PROCEDURE","PUBLIC","RAISE","RANGE","RAW","READ","REAL","RECORD","REF","REFERENCE","RELEASE","RELIES_ON","REM","REMAINDER","RENAME","RESOURCE","RESULT_CACHE","RESULT","RETURN","RETURNING","REVERSE","REVOKE","ROLLBACK","ROW","ROWID","ROWNUM","ROWTYPE","SAMPLE","SAVE","SAVEPOINT","SB1","SB2","SB4","SECOND","SEGMENT","SELF","SEPARATE","SEQUENCE","SERIALIZABLE","SHARE","SHORT","SIZE_T","SIZE","SMALLINT","SOME","SPACE","SPARSE","SQL","SQLCODE","SQLDATA","SQLERRM","SQLNAME","SQLSTATE","STANDARD","START","STATIC","STDDEV","STORED","STRING","STRUCT","STYLE","SUBMULTISET","SUBPARTITION","SUBSTITUTABLE","SUBTYPE","SUCCESSFUL","SUM","SYNONYM","SYSDATE","TABAUTH","TABLE","TDO","THE","THEN","TIME","TIMESTAMP","TIMEZONE_ABBR","TIMEZONE_HOUR","TIMEZONE_MINUTE","TIMEZONE_REGION","TO","TRAILING","TRANSACTION","TRANSACTIONAL","TRIGGER","TRUE","TRUSTED","TYPE","UB1","UB2","UB4","UID","UNDER","UNIQUE","UNPLUG","UNSIGNED","UNTRUSTED","USE","USER","USING","VALIDATE","VALIST","VALUE","VARCHAR","VARCHAR2","VARIABLE","VARIANCE","VARRAY","VARYING","VIEW","VIEWS","VOID","WHENEVER","WHILE","WITH","WORK","WRAPPED","WRITE","YEAR","ZONE"],B=["ADD","ALTER COLUMN","ALTER TABLE","BEGIN","CONNECT BY","DECLARE","DELETE FROM","DELETE","END","EXCEPT","EXCEPTION","FETCH FIRST","FROM","GROUP BY","HAVING","INSERT INTO","INSERT","INTERSECT","LIMIT","LOOP","MODIFY","ORDER BY","SELECT","SET CURRENT SCHEMA","SET SCHEMA","SET","START WITH","UNION ALL","UNION","UPDATE","VALUES","WHERE"],H=["AND","CROSS APPLY","CROSS JOIN","ELSE","END","INNER JOIN","JOIN","LEFT JOIN","LEFT OUTER JOIN","OR","OUTER APPLY","OUTER JOIN","RIGHT JOIN","RIGHT OUTER JOIN","WHEN","XOR"];let y;class W{constructor(e){this.cfg=e}format(e){return y||(y=new D({reservedWords:F,reservedTopLevelWords:B,reservedNewlineWords:H,stringTypes:['""',"N''","''","``"],openParens:["(","CASE"],closeParens:[")","END"],indexedPlaceholderTypes:["?"],namedPlaceholderTypes:[":"],lineCommentTypes:["--"],specialWordChars:["_","$","#",".","@"]})),new a(this.cfg,y).format(e)}}const m=["ACCESSIBLE","ACTION","AGAINST","AGGREGATE","ALGORITHM","ALL","ALTER","ANALYSE","ANALYZE","AS","ASC","AUTOCOMMIT","AUTO_INCREMENT","BACKUP","BEGIN","BETWEEN","BINLOG","BOTH","CASCADE","CASE","CHANGE","CHANGED","CHARACTER SET","CHARSET","CHECK","CHECKSUM","COLLATE","COLLATION","COLUMN","COLUMNS","COMMENT","COMMIT","COMMITTED","COMPRESSED","CONCURRENT","CONSTRAINT","CONTAINS","CONVERT","CREATE","CROSS","CURRENT_TIMESTAMP","DATABASE","DATABASES","DAY","DAY_HOUR","DAY_MINUTE","DAY_SECOND","DEFAULT","DEFINER","DELAYED","DELETE","DESC","DESCRIBE","DETERMINISTIC","DISTINCT","DISTINCTROW","DIV","DO","DROP","DUMPFILE","DUPLICATE","DYNAMIC","ELSE","ENCLOSED","END","ENGINE","ENGINES","ENGINE_TYPE","ESCAPE","ESCAPED","EVENTS","EXEC","EXECUTE","EXISTS","EXPLAIN","EXTENDED","FAST","FETCH","FIELDS","FILE","FIRST","FIXED","FLUSH","FOR","FORCE","FOREIGN","FULL","FULLTEXT","FUNCTION","GLOBAL","GRANT","GRANTS","GROUP_CONCAT","HEAP","HIGH_PRIORITY","HOSTS","HOUR","HOUR_MINUTE","HOUR_SECOND","IDENTIFIED","IF","IFNULL","IGNORE","IN","INDEX","INDEXES","INFILE","INSERT","INSERT_ID","INSERT_METHOD","INTERVAL","INTO","INVOKER","IS","ISOLATION","KEY","KEYS","KILL","LAST_INSERT_ID","LEADING","LEVEL","LIKE","LINEAR","LINES","LOAD","LOCAL","LOCK","LOCKS","LOGS","LOW_PRIORITY","MARIA","MASTER","MASTER_CONNECT_RETRY","MASTER_HOST","MASTER_LOG_FILE","MATCH","MAX_CONNECTIONS_PER_HOUR","MAX_QUERIES_PER_HOUR","MAX_ROWS","MAX_UPDATES_PER_HOUR","MAX_USER_CONNECTIONS","MEDIUM","MERGE","MINUTE","MINUTE_SECOND","MIN_ROWS","MODE","MODIFY","MONTH","MRG_MYISAM","MYISAM","NAMES","NATURAL","NOT","NOW()","NULL","OFFSET","ON DELETE","ON UPDATE","ON","ONLY","OPEN","OPTIMIZE","OPTION","OPTIONALLY","OUTFILE","PACK_KEYS","PAGE","PARTIAL","PARTITION","PARTITIONS","PASSWORD","PRIMARY","PRIVILEGES","PROCEDURE","PROCESS","PROCESSLIST","PURGE","QUICK","RAID0","RAID_CHUNKS","RAID_CHUNKSIZE","RAID_TYPE","RANGE","READ","READ_ONLY","READ_WRITE","REFERENCES","REGEXP","RELOAD","RENAME","REPAIR","REPEATABLE","REPLACE","REPLICATION","RESET","RESTORE","RESTRICT","RETURN","RETURNS","REVOKE","RLIKE","ROLLBACK","ROW","ROWS","ROW_FORMAT","SECOND","SECURITY","SEPARATOR","SERIALIZABLE","SESSION","SHARE","SHOW","SHUTDOWN","SLAVE","SONAME","SOUNDS","SQL","SQL_AUTO_IS_NULL","SQL_BIG_RESULT","SQL_BIG_SELECTS","SQL_BIG_TABLES","SQL_BUFFER_RESULT","SQL_CACHE","SQL_CALC_FOUND_ROWS","SQL_LOG_BIN","SQL_LOG_OFF","SQL_LOG_UPDATE","SQL_LOW_PRIORITY_UPDATES","SQL_MAX_JOIN_SIZE","SQL_NO_CACHE","SQL_QUOTE_SHOW_CREATE","SQL_SAFE_UPDATES","SQL_SELECT_LIMIT","SQL_SLAVE_SKIP_COUNTER","SQL_SMALL_RESULT","SQL_WARNINGS","START","STARTING","STATUS","STOP","STORAGE","STRAIGHT_JOIN","STRING","STRIPED","SUPER","TABLE","TABLES","TEMPORARY","TERMINATED","THEN","TO","TRAILING","TRANSACTIONAL","TRUE","TRUNCATE","TYPE","TYPES","UNCOMMITTED","UNIQUE","UNLOCK","UNSIGNED","USAGE","USE","USING","VARIABLES","VIEW","WHEN","WITH","WORK","WRITE","YEAR_MONTH"],V=["ADD","AFTER","ALTER COLUMN","ALTER TABLE","DELETE FROM","EXCEPT","FETCH FIRST","FROM","GROUP BY","GO","HAVING","INSERT INTO","INSERT","INTERSECT","LIMIT","MODIFY","ORDER BY","SELECT","SET CURRENT SCHEMA","SET SCHEMA","SET","UNION ALL","UNION","UPDATE","VALUES","WHERE"],x=["AND","CROSS APPLY","CROSS JOIN","ELSE","INNER JOIN","JOIN","LEFT JOIN","LEFT OUTER JOIN","OR","OUTER APPLY","OUTER JOIN","RIGHT JOIN","RIGHT OUTER JOIN","WHEN","XOR"];let Y;class b{constructor(e){this.cfg=e}format(e){return Y||(Y=new D({reservedWords:m,reservedTopLevelWords:V,reservedNewlineWords:x,stringTypes:['""',"N''","''","``","[]"],openParens:["(","CASE"],closeParens:[")","END"],indexedPlaceholderTypes:["?"],namedPlaceholderTypes:["@",":"],lineCommentTypes:["#","--"]})),new a(this.cfg,Y).format(e)}}t.d(E,"format",(function(){return X}));const X=(e,E={})=>{switch(E.language){case"db2":return new f(E).format(e);case"n1ql":return new g(E).format(e);case"pl/sql":return new W(E).format(e);case"sql":case void 0:return new b(E).format(e);default:throw Error(`Unsupported SQL dialect: ${E.language}`)}};E.default={format:X}}]);
!function(e,E){"object"==typeof exports&&"object"==typeof module?module.exports=E():"function"==typeof define&&define.amd?define([],E):"object"==typeof exports?exports.sqlFormatter=E():e.sqlFormatter=E()}(window,(function(){return function(e){var E={};function t(r){if(E[r])return E[r].exports;var n=E[r]={i:r,l:!1,exports:{}};return e[r].call(n.exports,n,n.exports,t),n.l=!0,n.exports}return t.m=e,t.c=E,t.d=function(e,E,r){t.o(e,E)||Object.defineProperty(e,E,{enumerable:!0,get:r})},t.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},t.t=function(e,E){if(1&E&&(e=t(e)),8&E)return e;if(4&E&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(t.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&E&&"string"!=typeof e)for(var n in e)t.d(r,n,function(E){return e[E]}.bind(null,n));return r},t.n=function(e){var E=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(E,"a",E),E},t.o=function(e,E){return Object.prototype.hasOwnProperty.call(e,E)},t.p="",t(t.s=64)}([function(e,E,t){var r=t(10),n="object"==typeof self&&self&&self.Object===Object&&self,T=r||n||Function("return this")();e.exports=T},function(e,E,t){var r=t(8),n=t(33),T=t(34),R="[object Null]",N="[object Undefined]",A=r?r.toStringTag:void 0;e.exports=function(e){return null==e?void 0===e?N:R:A&&A in Object(e)?n(e):T(e)}},function(e,E){e.exports=function(e){return null!=e&&"object"==typeof e}},function(e,E,t){var r=t(56),n=t(59);e.exports=function(e,E){var t=n(e,E);return r(t)?t:void 0}},function(e,E,t){var r=t(22),n=/[\\^$.*+?()[\]{}|]/g,T=RegExp(n.source);e.exports=function(e){return(e=r(e))&&T.test(e)?e.replace(n,"\\$&"):e}},function(e,E,t){var r=t(9),n=t(11);e.exports=function(e){return null!=e&&n(e.length)&&!r(e)}},function(e,E){e.exports=function(e){var E=typeof e;return null!=e&&("object"==E||"function"==E)}},function(e,E){var t=Array.isArray;e.exports=t},function(e,E,t){var r=t(0).Symbol;e.exports=r},function(e,E,t){var r=t(1),n=t(6),T="[object AsyncFunction]",R="[object Function]",N="[object GeneratorFunction]",A="[object Proxy]";e.exports=function(e){if(!n(e))return!1;var E=r(e);return E==R||E==N||E==T||E==A}},function(e,E,t){(function(E){var t="object"==typeof E&&E&&E.Object===Object&&E;e.exports=t}).call(this,t(32))},function(e,E){var t=9007199254740991;e.exports=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=t}},function(e,E,t){var r=t(36);e.exports=function(e){var E=r(e),t=E%1;return E==E?t?E-t:E:0}},function(e,E,t){var r=t(1),n=t(2),T="[object Symbol]";e.exports=function(e){return"symbol"==typeof e||n(e)&&r(e)==T}},function(e,E){e.exports=function(e,E){for(var t=-1,r=null==e?0:e.length,n=Array(r);++t<r;)n[t]=E(e[t],t,e);return n}},function(e,E,t){var r=t(43),n=t(2),T=Object.prototype,R=T.hasOwnProperty,N=T.propertyIsEnumerable,A=r(function(){return arguments}())?r:function(e){return n(e)&&R.call(e,"callee")&&!N.call(e,"callee")};e.exports=A},function(e,E,t){(function(e){var r=t(0),n=t(44),T=E&&!E.nodeType&&E,R=T&&"object"==typeof e&&e&&!e.nodeType&&e,N=R&&R.exports===T?r.Buffer:void 0,A=(N?N.isBuffer:void 0)||n;e.exports=A}).call(this,t(17)(e))},function(e,E){e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children||(e.children=[]),Object.defineProperty(e,"loaded",{enumerable:!0,get:function(){return e.l}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return e.i}}),e.webpackPolyfill=1),e}},function(e,E){var t=9007199254740991,r=/^(?:0|[1-9]\d*)$/;e.exports=function(e,E){var n=typeof e;return!!(E=null==E?t:E)&&("number"==n||"symbol"!=n&&r.test(e))&&e>-1&&e%1==0&&e<E}},function(e,E,t){var r=t(45),n=t(46),T=t(47),R=T&&T.isTypedArray,N=R?n(R):r;e.exports=N},function(e,E,t){var r=t(21),n=t(48),T=Object.prototype.hasOwnProperty;e.exports=function(e){if(!r(e))return n(e);var E=[];for(var t in Object(e))T.call(e,t)&&"constructor"!=t&&E.push(t);return E}},function(e,E){var t=Object.prototype;e.exports=function(e){var E=e&&e.constructor;return e===("function"==typeof E&&E.prototype||t)}},function(e,E,t){var r=t(53);e.exports=function(e){return null==e?"":r(e)}},function(e,E){var t=Function.prototype.toString;e.exports=function(e){if(null!=e){try{return t.call(e)}catch(e){}try{return e+""}catch(e){}}return""}},function(e,E,t){var r=t(28),n=t(5),T=t(35),R=t(12),N=t(38),A=Math.max;e.exports=function(e,E,t,o){e=n(e)?e:N(e),t=t&&!o?R(t):0;var I=e.length;return t<0&&(t=A(I+t,0)),T(e)?t<=I&&e.indexOf(E,t)>-1:!!I&&r(e,E,t)>-1}},function(e,E,t){var r=t(50),n=t(51),T=t(12),R=t(22);e.exports=function(e,E,t){return E=(t?n(e,E,t):void 0===E)?1:T(E),r(R(e),E)}},function(e,E){e.exports=function(e){var E=null==e?0:e.length;return E?e[E-1]:void 0}},function(e,E,t){var r=t(20),n=t(54),T=t(15),R=t(7),N=t(5),A=t(16),o=t(21),I=t(19),O="[object Map]",i="[object Set]",S=Object.prototype.hasOwnProperty;e.exports=function(e){if(null==e)return!0;if(N(e)&&(R(e)||"string"==typeof e||"function"==typeof e.splice||A(e)||I(e)||T(e)))return!e.length;var E=n(e);if(E==O||E==i)return!e.size;if(o(e))return!r(e).length;for(var t in e)if(S.call(e,t))return!1;return!0}},function(e,E,t){var r=t(29),n=t(30),T=t(31);e.exports=function(e,E,t){return E==E?T(e,E,t):r(e,n,t)}},function(e,E){e.exports=function(e,E,t,r){for(var n=e.length,T=t+(r?1:-1);r?T--:++T<n;)if(E(e[T],T,e))return T;return-1}},function(e,E){e.exports=function(e){return e!=e}},function(e,E){e.exports=function(e,E,t){for(var r=t-1,n=e.length;++r<n;)if(e[r]===E)return r;return-1}},function(e,E){var t;t=function(){return this}();try{t=t||new Function("return this")()}catch(e){"object"==typeof window&&(t=window)}e.exports=t},function(e,E,t){var r=t(8),n=Object.prototype,T=n.hasOwnProperty,R=n.toString,N=r?r.toStringTag:void 0;e.exports=function(e){var E=T.call(e,N),t=e[N];try{e[N]=void 0;var r=!0}catch(e){}var n=R.call(e);return r&&(E?e[N]=t:delete e[N]),n}},function(e,E){var t=Object.prototype.toString;e.exports=function(e){return t.call(e)}},function(e,E,t){var r=t(1),n=t(7),T=t(2),R="[object String]";e.exports=function(e){return"string"==typeof e||!n(e)&&T(e)&&r(e)==R}},function(e,E,t){var r=t(37),n=1/0,T=17976931348623157e292;e.exports=function(e){return e?(e=r(e))===n||e===-n?(e<0?-1:1)*T:e==e?e:0:0===e?e:0}},function(e,E,t){var r=t(6),n=t(13),T=NaN,R=/^\s+|\s+$/g,N=/^[-+]0x[0-9a-f]+$/i,A=/^0b[01]+$/i,o=/^0o[0-7]+$/i,I=parseInt;e.exports=function(e){if("number"==typeof e)return e;if(n(e))return T;if(r(e)){var E="function"==typeof e.valueOf?e.valueOf():e;e=r(E)?E+"":E}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(R,"");var t=A.test(e);return t||o.test(e)?I(e.slice(2),t?2:8):N.test(e)?T:+e}},function(e,E,t){var r=t(39),n=t(40);e.exports=function(e){return null==e?[]:r(e,n(e))}},function(e,E,t){var r=t(14);e.exports=function(e,E){return r(E,(function(E){return e[E]}))}},function(e,E,t){var r=t(41),n=t(20),T=t(5);e.exports=function(e){return T(e)?r(e):n(e)}},function(e,E,t){var r=t(42),n=t(15),T=t(7),R=t(16),N=t(18),A=t(19),o=Object.prototype.hasOwnProperty;e.exports=function(e,E){var t=T(e),I=!t&&n(e),O=!t&&!I&&R(e),i=!t&&!I&&!O&&A(e),S=t||I||O||i,L=S?r(e.length,String):[],s=L.length;for(var C in e)!E&&!o.call(e,C)||S&&("length"==C||O&&("offset"==C||"parent"==C)||i&&("buffer"==C||"byteLength"==C||"byteOffset"==C)||N(C,s))||L.push(C);return L}},function(e,E){e.exports=function(e,E){for(var t=-1,r=Array(e);++t<e;)r[t]=E(t);return r}},function(e,E,t){var r=t(1),n=t(2),T="[object Arguments]";e.exports=function(e){return n(e)&&r(e)==T}},function(e,E){e.exports=function(){return!1}},function(e,E,t){var r=t(1),n=t(11),T=t(2),R={};R["[object Float32Array]"]=R["[object Float64Array]"]=R["[object Int8Array]"]=R["[object Int16Array]"]=R["[object Int32Array]"]=R["[object Uint8Array]"]=R["[object Uint8ClampedArray]"]=R["[object Uint16Array]"]=R["[object Uint32Array]"]=!0,R["[object Arguments]"]=R["[object Array]"]=R["[object ArrayBuffer]"]=R["[object Boolean]"]=R["[object DataView]"]=R["[object Date]"]=R["[object Error]"]=R["[object Function]"]=R["[object Map]"]=R["[object Number]"]=R["[object Object]"]=R["[object RegExp]"]=R["[object Set]"]=R["[object String]"]=R["[object WeakMap]"]=!1,e.exports=function(e){return T(e)&&n(e.length)&&!!R[r(e)]}},function(e,E){e.exports=function(e){return function(E){return e(E)}}},function(e,E,t){(function(e){var r=t(10),n=E&&!E.nodeType&&E,T=n&&"object"==typeof e&&e&&!e.nodeType&&e,R=T&&T.exports===n&&r.process,N=function(){try{var e=T&&T.require&&T.require("util").types;return e||R&&R.binding&&R.binding("util")}catch(e){}}();e.exports=N}).call(this,t(17)(e))},function(e,E,t){var r=t(49)(Object.keys,Object);e.exports=r},function(e,E){e.exports=function(e,E){return function(t){return e(E(t))}}},function(e,E){var t=9007199254740991,r=Math.floor;e.exports=function(e,E){var n="";if(!e||E<1||E>t)return n;do{E%2&&(n+=e),(E=r(E/2))&&(e+=e)}while(E);return n}},function(e,E,t){var r=t(52),n=t(5),T=t(18),R=t(6);e.exports=function(e,E,t){if(!R(t))return!1;var N=typeof E;return!!("number"==N?n(t)&&T(E,t.length):"string"==N&&E in t)&&r(t[E],e)}},function(e,E){e.exports=function(e,E){return e===E||e!=e&&E!=E}},function(e,E,t){var r=t(8),n=t(14),T=t(7),R=t(13),N=1/0,A=r?r.prototype:void 0,o=A?A.toString:void 0;e.exports=function e(E){if("string"==typeof E)return E;if(T(E))return n(E,e)+"";if(R(E))return o?o.call(E):"";var t=E+"";return"0"==t&&1/E==-N?"-0":t}},function(e,E,t){var r=t(55),n=t(60),T=t(61),R=t(62),N=t(63),A=t(1),o=t(23),I=o(r),O=o(n),i=o(T),S=o(R),L=o(N),s=A;(r&&"[object DataView]"!=s(new r(new ArrayBuffer(1)))||n&&"[object Map]"!=s(new n)||T&&"[object Promise]"!=s(T.resolve())||R&&"[object Set]"!=s(new R)||N&&"[object WeakMap]"!=s(new N))&&(s=function(e){var E=A(e),t="[object Object]"==E?e.constructor:void 0,r=t?o(t):"";if(r)switch(r){case I:return"[object DataView]";case O:return"[object Map]";case i:return"[object Promise]";case S:return"[object Set]";case L:return"[object WeakMap]"}return E}),e.exports=s},function(e,E,t){var r=t(3)(t(0),"DataView");e.exports=r},function(e,E,t){var r=t(9),n=t(57),T=t(6),R=t(23),N=/^\[object .+?Constructor\]$/,A=Function.prototype,o=Object.prototype,I=A.toString,O=o.hasOwnProperty,i=RegExp("^"+I.call(O).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");e.exports=function(e){return!(!T(e)||n(e))&&(r(e)?i:N).test(R(e))}},function(e,E,t){var r,n=t(58),T=(r=/[^.]+$/.exec(n&&n.keys&&n.keys.IE_PROTO||""))?"Symbol(src)_1."+r:"";e.exports=function(e){return!!T&&T in e}},function(e,E,t){var r=t(0)["__core-js_shared__"];e.exports=r},function(e,E){e.exports=function(e,E){return null==e?void 0:e[E]}},function(e,E,t){var r=t(3)(t(0),"Map");e.exports=r},function(e,E,t){var r=t(3)(t(0),"Promise");e.exports=r},function(e,E,t){var r=t(3)(t(0),"Set");e.exports=r},function(e,E,t){var r=t(3)(t(0),"WeakMap");e.exports=r},function(e,E,t){"use strict";t.r(E);var r=t(24),n=t.n(r),T={WHITESPACE:"whitespace",WORD:"word",STRING:"string",RESERVED:"reserved",RESERVED_TOP_LEVEL:"reserved-top-level",RESERVED_NEWLINE:"reserved-newline",OPERATOR:"operator",OPEN_PAREN:"open-paren",CLOSE_PAREN:"close-paren",LINE_COMMENT:"line-comment",BLOCK_COMMENT:"block-comment",NUMBER:"number",PLACEHOLDER:"placeholder"},R=t(25),N=t.n(R),A=t(26),o=t.n(A);const I="top-level",O="block-level";class i{constructor(e){this.indent=e||" ",this.indentTypes=[]}getIndent(){return N()(this.indent,this.indentTypes.length)}increaseTopLevel(){this.indentTypes.push(I)}increaseBlockLevel(){this.indentTypes.push(O)}decreaseTopLevel(){o()(this.indentTypes)===I&&this.indentTypes.pop()}decreaseBlockLevel(){for(;this.indentTypes.length>0;){if(this.indentTypes.pop()!==I)break}}resetIndentation(){this.indentTypes=[]}}const S=50;class L{constructor(){this.level=0}beginIfPossible(e,E){0===this.level&&this.isInlineBlock(e,E)?this.level=1:this.level>0?this.level++:this.level=0}end(){this.level--}isActive(){return this.level>0}isInlineBlock(e,E){let t=0,r=0;for(let n=E;n<e.length;n++){const E=e[n];if((t+=E.value.length)>S)return!1;if(E.type===T.OPEN_PAREN)r++;else if(E.type===T.CLOSE_PAREN&&0===--r)return!0;if(this.isForbiddenToken(E))return!1}return!1}isForbiddenToken({type:e,value:E}){return e===T.RESERVED_TOP_LEVEL||e===T.RESERVED_NEWLINE||e===T.COMMENT||e===T.BLOCK_COMMENT||";"===E}}class s{constructor(e){this.params=e,this.index=0}get({key:e,value:E}){return this.params?e?this.params[e]:this.params[this.index++]:E}}const C=e=>e.replace(/[ \t]+$/u,"");class a{constructor(e,E){this.cfg=e||{},this.indentation=new i(this.cfg.indent),this.inlineBlock=new L,this.params=new s(this.cfg.params),this.tokenizer=E,this.previousReservedWord={},this.tokens=[],this.index=0}format(e){return this.tokens=this.tokenizer.tokenize(e),this.getFormattedQueryFromTokens().trim()}getFormattedQueryFromTokens(){let e="";return this.tokens.forEach((E,t)=>{this.index=t,E.type===T.WHITESPACE||(E.type===T.LINE_COMMENT?e=this.formatLineComment(E,e):E.type===T.BLOCK_COMMENT?e=this.formatBlockComment(E,e):E.type===T.RESERVED_TOP_LEVEL?(e=this.formatTopLevelReservedWord(E,e),this.previousReservedWord=E):E.type===T.RESERVED_NEWLINE?(e=this.formatNewlineReservedWord(E,e),this.previousReservedWord=E):E.type===T.RESERVED?(e=this.formatWithSpaces(E,e),this.previousReservedWord=E):e=E.type===T.OPEN_PAREN?this.formatOpeningParentheses(E,e):E.type===T.CLOSE_PAREN?this.formatClosingParentheses(E,e):E.type===T.PLACEHOLDER?this.formatPlaceholder(E,e):","===E.value?this.formatComma(E,e):":"===E.value?this.formatWithSpaceAfter(E,e):"."===E.value?this.formatWithoutSpaces(E,e):";"===E.value?this.formatQuerySeparator(E,e):this.formatWithSpaces(E,e))}),e}formatLineComment(e,E){return this.addNewline(E+e.value)}formatBlockComment(e,E){return this.addNewline(this.addNewline(E)+this.indentComment(e.value))}indentComment(e){return e.replace(/\n[ \t]*/gu,"\n"+this.indentation.getIndent()+" ")}formatTopLevelReservedWord(e,E){return this.indentation.decreaseTopLevel(),E=this.addNewline(E),this.indentation.increaseTopLevel(),E+=this.equalizeWhitespace(this.formatReservedWord(e.value)),this.addNewline(E)}formatNewlineReservedWord(e,E){return this.addNewline(E)+this.equalizeWhitespace(this.formatReservedWord(e.value))+" "}equalizeWhitespace(e){return e.replace(/\s+/gu," ")}formatOpeningParentheses(e,E){const t=[T.WHITESPACE,T.OPEN_PAREN,T.LINE_COMMENT];return n()(t,this.previousToken().type)||(E=C(E)),E+=e.value,this.inlineBlock.beginIfPossible(this.tokens,this.index),this.inlineBlock.isActive()||(this.indentation.increaseBlockLevel(),E=this.addNewline(E)),E}formatClosingParentheses(e,E){return this.inlineBlock.isActive()?(this.inlineBlock.end(),this.formatWithSpaceAfter(e,E)):(this.indentation.decreaseBlockLevel(),this.formatWithSpaces(e,this.addNewline(E)))}formatPlaceholder(e,E){return E+this.params.get(e)+" "}formatComma(e,E){return E=C(E)+e.value+" ",this.inlineBlock.isActive()?E:/^LIMIT$/iu.test(this.previousReservedWord.value)?E:this.addNewline(E)}formatWithSpaceAfter(e,E){return C(E)+e.value+" "}formatWithoutSpaces(e,E){return C(E)+e.value}formatWithSpaces(e,E){return E+("reserved"===e.type?this.formatReservedWord(e.value):e.value)+" "}formatReservedWord(e){return this.cfg.uppercase?e.toUpperCase():e}formatQuerySeparator(e,E){return this.indentation.resetIndentation(),C(E)+e.value+"\n".repeat(this.cfg.linesBetweenQueries||1)}addNewline(e){return(e=C(e)).endsWith("\n")||(e+="\n"),e+this.indentation.getIndent()}previousToken(e=1){return this.tokens[this.index-e]||{}}}var c=t(27),u=t.n(c),P=t(4),l=t.n(P);class D{constructor(e){this.WHITESPACE_REGEX=/^(\s+)/u,this.NUMBER_REGEX=/^((-\s*)?[0-9]+(\.[0-9]+)?|0x[0-9a-fA-F]+|0b[01]+)\b/u,this.OPERATOR_REGEX=/^(!=|<>|==|<=|>=|!<|!>|\|\||::|->>|->|~~\*|~~|!~~\*|!~~|~\*|!~\*|!~|.)/u,this.BLOCK_COMMENT_REGEX=/^(\/\*[^]*?(?:\*\/|$))/u,this.LINE_COMMENT_REGEX=this.createLineCommentRegex(e.lineCommentTypes),this.RESERVED_TOP_LEVEL_REGEX=this.createReservedWordRegex(e.reservedTopLevelWords),this.RESERVED_NEWLINE_REGEX=this.createReservedWordRegex(e.reservedNewlineWords),this.RESERVED_PLAIN_REGEX=this.createReservedWordRegex(e.reservedWords),this.WORD_REGEX=this.createWordRegex(e.specialWordChars),this.STRING_REGEX=this.createStringRegex(e.stringTypes),this.OPEN_PAREN_REGEX=this.createParenRegex(e.openParens),this.CLOSE_PAREN_REGEX=this.createParenRegex(e.closeParens),this.INDEXED_PLACEHOLDER_REGEX=this.createPlaceholderRegex(e.indexedPlaceholderTypes,"[0-9]*"),this.IDENT_NAMED_PLACEHOLDER_REGEX=this.createPlaceholderRegex(e.namedPlaceholderTypes,"[a-zA-Z0-9._$]+"),this.STRING_NAMED_PLACEHOLDER_REGEX=this.createPlaceholderRegex(e.namedPlaceholderTypes,this.createStringPattern(e.stringTypes))}createLineCommentRegex(e){return new RegExp(`^((?:${e.map(e=>l()(e)).join("|")}).*?(?:\r\n|\r|\n|$))`,"u")}createReservedWordRegex(e){const E=e.join("|").replace(/ /gu,"\\s+");return new RegExp(`^(${E})\\b`,"iu")}createWordRegex(e=[]){return new RegExp(`^([\\p{Alphabetic}\\p{Mark}\\p{Decimal_Number}\\p{Connector_Punctuation}\\p{Join_Control}${e.join("")}]+)`,"u")}createStringRegex(e){return new RegExp("^("+this.createStringPattern(e)+")","u")}createStringPattern(e){const E={"``":"((`[^`]*($|`))+)","[]":"((\\[[^\\]]*($|\\]))(\\][^\\]]*($|\\]))*)",'""':'(("[^"\\\\]*(?:\\\\.[^"\\\\]*)*("|$))+)',"''":"(('[^'\\\\]*(?:\\\\.[^'\\\\]*)*('|$))+)","N''":"((N'[^N'\\\\]*(?:\\\\.[^N'\\\\]*)*('|$))+)"};return e.map(e=>E[e]).join("|")}createParenRegex(e){return new RegExp("^("+e.map(e=>this.escapeParen(e)).join("|")+")","iu")}escapeParen(e){return 1===e.length?l()(e):"\\b"+e+"\\b"}createPlaceholderRegex(e,E){if(u()(e))return!1;const t=e.map(l.a).join("|");return new RegExp(`^((?:${t})(?:${E}))`,"u")}tokenize(e){if(!e)return[];const E=[];let t;for(;e.length;)t=this.getNextToken(e,t),e=e.substring(t.value.length),E.push(t);return E}getNextToken(e,E){return this.getWhitespaceToken(e)||this.getCommentToken(e)||this.getStringToken(e)||this.getOpenParenToken(e)||this.getCloseParenToken(e)||this.getPlaceholderToken(e)||this.getNumberToken(e)||this.getReservedWordToken(e,E)||this.getWordToken(e)||this.getOperatorToken(e)}getWhitespaceToken(e){return this.getTokenOnFirstMatch({input:e,type:T.WHITESPACE,regex:this.WHITESPACE_REGEX})}getCommentToken(e){return this.getLineCommentToken(e)||this.getBlockCommentToken(e)}getLineCommentToken(e){return this.getTokenOnFirstMatch({input:e,type:T.LINE_COMMENT,regex:this.LINE_COMMENT_REGEX})}getBlockCommentToken(e){return this.getTokenOnFirstMatch({input:e,type:T.BLOCK_COMMENT,regex:this.BLOCK_COMMENT_REGEX})}getStringToken(e){return this.getTokenOnFirstMatch({input:e,type:T.STRING,regex:this.STRING_REGEX})}getOpenParenToken(e){return this.getTokenOnFirstMatch({input:e,type:T.OPEN_PAREN,regex:this.OPEN_PAREN_REGEX})}getCloseParenToken(e){return this.getTokenOnFirstMatch({input:e,type:T.CLOSE_PAREN,regex:this.CLOSE_PAREN_REGEX})}getPlaceholderToken(e){return this.getIdentNamedPlaceholderToken(e)||this.getStringNamedPlaceholderToken(e)||this.getIndexedPlaceholderToken(e)}getIdentNamedPlaceholderToken(e){return this.getPlaceholderTokenWithKey({input:e,regex:this.IDENT_NAMED_PLACEHOLDER_REGEX,parseKey:e=>e.slice(1)})}getStringNamedPlaceholderToken(e){return this.getPlaceholderTokenWithKey({input:e,regex:this.STRING_NAMED_PLACEHOLDER_REGEX,parseKey:e=>this.getEscapedPlaceholderKey({key:e.slice(2,-1),quoteChar:e.slice(-1)})})}getIndexedPlaceholderToken(e){return this.getPlaceholderTokenWithKey({input:e,regex:this.INDEXED_PLACEHOLDER_REGEX,parseKey:e=>e.slice(1)})}getPlaceholderTokenWithKey({input:e,regex:E,parseKey:t}){const r=this.getTokenOnFirstMatch({input:e,regex:E,type:T.PLACEHOLDER});return r&&(r.key=t(r.value)),r}getEscapedPlaceholderKey({key:e,quoteChar:E}){return e.replace(new RegExp(l()("\\"+E),"gu"),E)}getNumberToken(e){return this.getTokenOnFirstMatch({input:e,type:T.NUMBER,regex:this.NUMBER_REGEX})}getOperatorToken(e){return this.getTokenOnFirstMatch({input:e,type:T.OPERATOR,regex:this.OPERATOR_REGEX})}getReservedWordToken(e,E){if(!E||!E.value||"."!==E.value)return this.getTopLevelReservedToken(e)||this.getNewlineReservedToken(e)||this.getPlainReservedToken(e)}getTopLevelReservedToken(e){return this.getTokenOnFirstMatch({input:e,type:T.RESERVED_TOP_LEVEL,regex:this.RESERVED_TOP_LEVEL_REGEX})}getNewlineReservedToken(e){return this.getTokenOnFirstMatch({input:e,type:T.RESERVED_NEWLINE,regex:this.RESERVED_NEWLINE_REGEX})}getPlainReservedToken(e){return this.getTokenOnFirstMatch({input:e,type:T.RESERVED,regex:this.RESERVED_PLAIN_REGEX})}getWordToken(e){return this.getTokenOnFirstMatch({input:e,type:T.WORD,regex:this.WORD_REGEX})}getTokenOnFirstMatch({input:e,type:E,regex:t}){const r=e.match(t);if(r)return{type:E,value:r[1]}}}const U=["ABS","ACTIVATE","ALIAS","ALL","ALLOCATE","ALLOW","ALTER","ANY","ARE","ARRAY","AS","ASC","ASENSITIVE","ASSOCIATE","ASUTIME","ASYMMETRIC","AT","ATOMIC","ATTRIBUTES","AUDIT","AUTHORIZATION","AUX","AUXILIARY","AVG","BEFORE","BEGIN","BETWEEN","BIGINT","BINARY","BLOB","BOOLEAN","BOTH","BUFFERPOOL","BY","CACHE","CALL","CALLED","CAPTURE","CARDINALITY","CASCADED","CASE","CAST","CCSID","CEIL","CEILING","CHAR","CHARACTER","CHARACTER_LENGTH","CHAR_LENGTH","CHECK","CLOB","CLONE","CLOSE","CLUSTER","COALESCE","COLLATE","COLLECT","COLLECTION","COLLID","COLUMN","COMMENT","COMMIT","CONCAT","CONDITION","CONNECT","CONNECTION","CONSTRAINT","CONTAINS","CONTINUE","CONVERT","CORR","CORRESPONDING","COUNT","COUNT_BIG","COVAR_POP","COVAR_SAMP","CREATE","CROSS","CUBE","CUME_DIST","CURRENT","CURRENT_DATE","CURRENT_DEFAULT_TRANSFORM_GROUP","CURRENT_LC_CTYPE","CURRENT_PATH","CURRENT_ROLE","CURRENT_SCHEMA","CURRENT_SERVER","CURRENT_TIME","CURRENT_TIMESTAMP","CURRENT_TIMEZONE","CURRENT_TRANSFORM_GROUP_FOR_TYPE","CURRENT_USER","CURSOR","CYCLE","DATA","DATABASE","DATAPARTITIONNAME","DATAPARTITIONNUM","DATE","DAY","DAYS","DB2GENERAL","DB2GENRL","DB2SQL","DBINFO","DBPARTITIONNAME","DBPARTITIONNUM","DEALLOCATE","DEC","DECIMAL","DECLARE","DEFAULT","DEFAULTS","DEFINITION","DELETE","DENSERANK","DENSE_RANK","DEREF","DESCRIBE","DESCRIPTOR","DETERMINISTIC","DIAGNOSTICS","DISABLE","DISALLOW","DISCONNECT","DISTINCT","DO","DOCUMENT","DOUBLE","DROP","DSSIZE","DYNAMIC","EACH","EDITPROC","ELEMENT","ELSE","ELSEIF","ENABLE","ENCODING","ENCRYPTION","END","END-EXEC","ENDING","ERASE","ESCAPE","EVERY","EXCEPTION","EXCLUDING","EXCLUSIVE","EXEC","EXECUTE","EXISTS","EXIT","EXP","EXPLAIN","EXTENDED","EXTERNAL","EXTRACT","FALSE","FENCED","FETCH","FIELDPROC","FILE","FILTER","FINAL","FIRST","FLOAT","FLOOR","FOR","FOREIGN","FREE","FULL","FUNCTION","FUSION","GENERAL","GENERATED","GET","GLOBAL","GOTO","GRANT","GRAPHIC","GROUP","GROUPING","HANDLER","HASH","HASHED_VALUE","HINT","HOLD","HOUR","HOURS","IDENTITY","IF","IMMEDIATE","IN","INCLUDING","INCLUSIVE","INCREMENT","INDEX","INDICATOR","INDICATORS","INF","INFINITY","INHERIT","INNER","INOUT","INSENSITIVE","INSERT","INT","INTEGER","INTEGRITY","INTERSECTION","INTERVAL","INTO","IS","ISOBID","ISOLATION","ITERATE","JAR","JAVA","KEEP","KEY","LABEL","LANGUAGE","LARGE","LATERAL","LC_CTYPE","LEADING","LEAVE","LEFT","LIKE","LINKTYPE","LN","LOCAL","LOCALDATE","LOCALE","LOCALTIME","LOCALTIMESTAMP","LOCATOR","LOCATORS","LOCK","LOCKMAX","LOCKSIZE","LONG","LOOP","LOWER","MAINTAINED","MATCH","MATERIALIZED","MAX","MAXVALUE","MEMBER","MERGE","METHOD","MICROSECOND","MICROSECONDS","MIN","MINUTE","MINUTES","MINVALUE","MOD","MODE","MODIFIES","MODULE","MONTH","MONTHS","MULTISET","NAN","NATIONAL","NATURAL","NCHAR","NCLOB","NEW","NEW_TABLE","NEXTVAL","NO","NOCACHE","NOCYCLE","NODENAME","NODENUMBER","NOMAXVALUE","NOMINVALUE","NONE","NOORDER","NORMALIZE","NORMALIZED","NOT","NULL","NULLIF","NULLS","NUMERIC","NUMPARTS","OBID","OCTET_LENGTH","OF","OFFSET","OLD","OLD_TABLE","ON","ONLY","OPEN","OPTIMIZATION","OPTIMIZE","OPTION","ORDER","OUT","OUTER","OVER","OVERLAPS","OVERLAY","OVERRIDING","PACKAGE","PADDED","PAGESIZE","PARAMETER","PART","PARTITION","PARTITIONED","PARTITIONING","PARTITIONS","PASSWORD","PATH","PERCENTILE_CONT","PERCENTILE_DISC","PERCENT_RANK","PIECESIZE","PLAN","POSITION","POWER","PRECISION","PREPARE","PREVVAL","PRIMARY","PRIQTY","PRIVILEGES","PROCEDURE","PROGRAM","PSID","PUBLIC","QUERY","QUERYNO","RANGE","RANK","READ","READS","REAL","RECOVERY","RECURSIVE","REF","REFERENCES","REFERENCING","REFRESH","REGR_AVGX","REGR_AVGY","REGR_COUNT","REGR_INTERCEPT","REGR_R2","REGR_SLOPE","REGR_SXX","REGR_SXY","REGR_SYY","RELEASE","RENAME","REPEAT","RESET","RESIGNAL","RESTART","RESTRICT","RESULT","RESULT_SET_LOCATOR","RETURN","RETURNS","REVOKE","RIGHT","ROLE","ROLLBACK","ROLLUP","ROUND_CEILING","ROUND_DOWN","ROUND_FLOOR","ROUND_HALF_DOWN","ROUND_HALF_EVEN","ROUND_HALF_UP","ROUND_UP","ROUTINE","ROW","ROWNUMBER","ROWS","ROWSET","ROW_NUMBER","RRN","RUN","SAVEPOINT","SCHEMA","SCOPE","SCRATCHPAD","SCROLL","SEARCH","SECOND","SECONDS","SECQTY","SECURITY","SENSITIVE","SEQUENCE","SESSION","SESSION_USER","SIGNAL","SIMILAR","SIMPLE","SMALLINT","SNAN","SOME","SOURCE","SPECIFIC","SPECIFICTYPE","SQL","SQLEXCEPTION","SQLID","SQLSTATE","SQLWARNING","SQRT","STACKED","STANDARD","START","STARTING","STATEMENT","STATIC","STATMENT","STAY","STDDEV_POP","STDDEV_SAMP","STOGROUP","STORES","STYLE","SUBMULTISET","SUBSTRING","SUM","SUMMARY","SYMMETRIC","SYNONYM","SYSFUN","SYSIBM","SYSPROC","SYSTEM","SYSTEM_USER","TABLE","TABLESAMPLE","TABLESPACE","THEN","TIME","TIMESTAMP","TIMEZONE_HOUR","TIMEZONE_MINUTE","TO","TRAILING","TRANSACTION","TRANSLATE","TRANSLATION","TREAT","TRIGGER","TRIM","TRUE","TRUNCATE","TYPE","UESCAPE","UNDO","UNIQUE","UNKNOWN","UNNEST","UNTIL","UPPER","USAGE","USER","USING","VALIDPROC","VALUE","VARCHAR","VARIABLE","VARIANT","VARYING","VAR_POP","VAR_SAMP","VCAT","VERSION","VIEW","VOLATILE","VOLUMES","WHEN","WHENEVER","WHILE","WIDTH_BUCKET","WINDOW","WITH","WITHIN","WITHOUT","WLM","WRITE","XMLELEMENT","XMLEXISTS","XMLNAMESPACES","YEAR","YEARS"],p=["ADD","AFTER","ALTER COLUMN","ALTER TABLE","DELETE FROM","EXCEPT","FETCH FIRST","FROM","GROUP BY","GO","HAVING","INSERT INTO","INTERSECT","LIMIT","ORDER BY","SELECT","SET CURRENT SCHEMA","SET SCHEMA","SET","UNION ALL","UPDATE","VALUES","WHERE"],M=["AND","CROSS JOIN","INNER JOIN","JOIN","LEFT JOIN","LEFT OUTER JOIN","OR","OUTER JOIN","RIGHT JOIN","RIGHT OUTER JOIN"];let f;class h{constructor(e){this.cfg=e}format(e){return f||(f=new D({reservedWords:U,reservedTopLevelWords:p,reservedNewlineWords:M,stringTypes:['""',"''","``","[]"],openParens:["("],closeParens:[")"],indexedPlaceholderTypes:["?"],namedPlaceholderTypes:[":"],lineCommentTypes:["--"],specialWordChars:["#","@"]})),new a(this.cfg,f).format(e)}}const d=["ALL","ALTER","ANALYZE","AND","ANY","ARRAY","AS","ASC","BEGIN","BETWEEN","BINARY","BOOLEAN","BREAK","BUCKET","BUILD","BY","CALL","CASE","CAST","CLUSTER","COLLATE","COLLECTION","COMMIT","CONNECT","CONTINUE","CORRELATE","COVER","CREATE","DATABASE","DATASET","DATASTORE","DECLARE","DECREMENT","DELETE","DERIVED","DESC","DESCRIBE","DISTINCT","DO","DROP","EACH","ELEMENT","ELSE","END","EVERY","EXCEPT","EXCLUDE","EXECUTE","EXISTS","EXPLAIN","FALSE","FETCH","FIRST","FLATTEN","FOR","FORCE","FROM","FUNCTION","GRANT","GROUP","GSI","HAVING","IF","IGNORE","ILIKE","IN","INCLUDE","INCREMENT","INDEX","INFER","INLINE","INNER","INSERT","INTERSECT","INTO","IS","JOIN","KEY","KEYS","KEYSPACE","KNOWN","LAST","LEFT","LET","LETTING","LIKE","LIMIT","LSM","MAP","MAPPING","MATCHED","MATERIALIZED","MERGE","MINUS","MISSING","NAMESPACE","NEST","NOT","NULL","NUMBER","OBJECT","OFFSET","ON","OPTION","OR","ORDER","OUTER","OVER","PARSE","PARTITION","PASSWORD","PATH","POOL","PREPARE","PRIMARY","PRIVATE","PRIVILEGE","PROCEDURE","PUBLIC","RAW","REALM","REDUCE","RENAME","RETURN","RETURNING","REVOKE","RIGHT","ROLE","ROLLBACK","SATISFIES","SCHEMA","SELECT","SELF","SEMI","SET","SHOW","SOME","START","STATISTICS","STRING","SYSTEM","THEN","TO","TRANSACTION","TRIGGER","TRUE","TRUNCATE","UNDER","UNION","UNIQUE","UNKNOWN","UNNEST","UNSET","UPDATE","UPSERT","USE","USER","USING","VALIDATE","VALUE","VALUED","VALUES","VIA","VIEW","WHEN","WHERE","WHILE","WITH","WITHIN","WORK","XOR"],_=["DELETE FROM","EXCEPT ALL","EXCEPT","EXPLAIN DELETE FROM","EXPLAIN UPDATE","EXPLAIN UPSERT","FROM","GROUP BY","HAVING","INFER","INSERT INTO","INTERSECT ALL","INTERSECT","LET","LIMIT","MERGE","NEST","ORDER BY","PREPARE","SELECT","SET CURRENT SCHEMA","SET SCHEMA","SET","UNION ALL","UNION","UNNEST","UPDATE","UPSERT","USE KEYS","VALUES","WHERE"],G=["AND","INNER JOIN","JOIN","LEFT JOIN","LEFT OUTER JOIN","OR","OUTER JOIN","RIGHT JOIN","RIGHT OUTER JOIN","XOR"];let v;class g{constructor(e){this.cfg=e}format(e){return v||(v=new D({reservedWords:d,reservedTopLevelWords:_,reservedNewlineWords:G,stringTypes:['""',"''","``"],openParens:["(","[","{"],closeParens:[")","]","}"],namedPlaceholderTypes:["$"],lineCommentTypes:["#","--"]})),new a(this.cfg,v).format(e)}}const F=["A","ACCESSIBLE","AGENT","AGGREGATE","ALL","ALTER","ANY","ARRAY","AS","ASC","AT","ATTRIBUTE","AUTHID","AVG","BETWEEN","BFILE_BASE","BINARY_INTEGER","BINARY","BLOB_BASE","BLOCK","BODY","BOOLEAN","BOTH","BOUND","BULK","BY","BYTE","C","CALL","CALLING","CASCADE","CASE","CHAR_BASE","CHAR","CHARACTER","CHARSET","CHARSETFORM","CHARSETID","CHECK","CLOB_BASE","CLONE","CLOSE","CLUSTER","CLUSTERS","COALESCE","COLAUTH","COLLECT","COLUMNS","COMMENT","COMMIT","COMMITTED","COMPILED","COMPRESS","CONNECT","CONSTANT","CONSTRUCTOR","CONTEXT","CONTINUE","CONVERT","COUNT","CRASH","CREATE","CREDENTIAL","CURRENT","CURRVAL","CURSOR","CUSTOMDATUM","DANGLING","DATA","DATE_BASE","DATE","DAY","DECIMAL","DEFAULT","DEFINE","DELETE","DESC","DETERMINISTIC","DIRECTORY","DISTINCT","DO","DOUBLE","DROP","DURATION","ELEMENT","ELSIF","EMPTY","ESCAPE","EXCEPTIONS","EXCLUSIVE","EXECUTE","EXISTS","EXIT","EXTENDS","EXTERNAL","EXTRACT","FALSE","FETCH","FINAL","FIRST","FIXED","FLOAT","FOR","FORALL","FORCE","FROM","FUNCTION","GENERAL","GOTO","GRANT","GROUP","HASH","HEAP","HIDDEN","HOUR","IDENTIFIED","IF","IMMEDIATE","IN","INCLUDING","INDEX","INDEXES","INDICATOR","INDICES","INFINITE","INSTANTIABLE","INT","INTEGER","INTERFACE","INTERVAL","INTO","INVALIDATE","IS","ISOLATION","JAVA","LANGUAGE","LARGE","LEADING","LENGTH","LEVEL","LIBRARY","LIKE","LIKE2","LIKE4","LIKEC","LIMITED","LOCAL","LOCK","LONG","MAP","MAX","MAXLEN","MEMBER","MERGE","MIN","MINUS","MINUTE","MLSLABEL","MOD","MODE","MONTH","MULTISET","NAME","NAN","NATIONAL","NATIVE","NATURAL","NATURALN","NCHAR","NEW","NEXTVAL","NOCOMPRESS","NOCOPY","NOT","NOWAIT","NULL","NULLIF","NUMBER_BASE","NUMBER","OBJECT","OCICOLL","OCIDATE","OCIDATETIME","OCIDURATION","OCIINTERVAL","OCILOBLOCATOR","OCINUMBER","OCIRAW","OCIREF","OCIREFCURSOR","OCIROWID","OCISTRING","OCITYPE","OF","OLD","ON","ONLY","OPAQUE","OPEN","OPERATOR","OPTION","ORACLE","ORADATA","ORDER","ORGANIZATION","ORLANY","ORLVARY","OTHERS","OUT","OVERLAPS","OVERRIDING","PACKAGE","PARALLEL_ENABLE","PARAMETER","PARAMETERS","PARENT","PARTITION","PASCAL","PCTFREE","PIPE","PIPELINED","PLS_INTEGER","PLUGGABLE","POSITIVE","POSITIVEN","PRAGMA","PRECISION","PRIOR","PRIVATE","PROCEDURE","PUBLIC","RAISE","RANGE","RAW","READ","REAL","RECORD","REF","REFERENCE","RELEASE","RELIES_ON","REM","REMAINDER","RENAME","RESOURCE","RESULT_CACHE","RESULT","RETURN","RETURNING","REVERSE","REVOKE","ROLLBACK","ROW","ROWID","ROWNUM","ROWTYPE","SAMPLE","SAVE","SAVEPOINT","SB1","SB2","SB4","SECOND","SEGMENT","SELF","SEPARATE","SEQUENCE","SERIALIZABLE","SHARE","SHORT","SIZE_T","SIZE","SMALLINT","SOME","SPACE","SPARSE","SQL","SQLCODE","SQLDATA","SQLERRM","SQLNAME","SQLSTATE","STANDARD","START","STATIC","STDDEV","STORED","STRING","STRUCT","STYLE","SUBMULTISET","SUBPARTITION","SUBSTITUTABLE","SUBTYPE","SUCCESSFUL","SUM","SYNONYM","SYSDATE","TABAUTH","TABLE","TDO","THE","THEN","TIME","TIMESTAMP","TIMEZONE_ABBR","TIMEZONE_HOUR","TIMEZONE_MINUTE","TIMEZONE_REGION","TO","TRAILING","TRANSACTION","TRANSACTIONAL","TRIGGER","TRUE","TRUSTED","TYPE","UB1","UB2","UB4","UID","UNDER","UNIQUE","UNPLUG","UNSIGNED","UNTRUSTED","USE","USER","USING","VALIDATE","VALIST","VALUE","VARCHAR","VARCHAR2","VARIABLE","VARIANCE","VARRAY","VARYING","VIEW","VIEWS","VOID","WHENEVER","WHILE","WITH","WORK","WRAPPED","WRITE","YEAR","ZONE"],B=["ADD","ALTER COLUMN","ALTER TABLE","BEGIN","CONNECT BY","DECLARE","DELETE FROM","DELETE","END","EXCEPT","EXCEPTION","FETCH FIRST","FROM","GROUP BY","HAVING","INSERT INTO","INSERT","INTERSECT","LIMIT","LOOP","MODIFY","ORDER BY","SELECT","SET CURRENT SCHEMA","SET SCHEMA","SET","START WITH","UNION ALL","UNION","UPDATE","VALUES","WHERE"],H=["AND","CROSS APPLY","CROSS JOIN","ELSE","END","INNER JOIN","JOIN","LEFT JOIN","LEFT OUTER JOIN","OR","OUTER APPLY","OUTER JOIN","RIGHT JOIN","RIGHT OUTER JOIN","WHEN","XOR"];let y;class W{constructor(e){this.cfg=e}format(e){return y||(y=new D({reservedWords:F,reservedTopLevelWords:B,reservedNewlineWords:H,stringTypes:['""',"N''","''","``"],openParens:["(","CASE"],closeParens:[")","END"],indexedPlaceholderTypes:["?"],namedPlaceholderTypes:[":"],lineCommentTypes:["--"],specialWordChars:["_","$","#",".","@"]})),new a(this.cfg,y).format(e)}}const m=["ACCESSIBLE","ACTION","AGAINST","AGGREGATE","ALGORITHM","ALL","ALTER","ANALYSE","ANALYZE","AS","ASC","AUTOCOMMIT","AUTO_INCREMENT","BACKUP","BEGIN","BETWEEN","BINLOG","BOTH","CASCADE","CASE","CHANGE","CHANGED","CHARACTER SET","CHARSET","CHECK","CHECKSUM","COLLATE","COLLATION","COLUMN","COLUMNS","COMMENT","COMMIT","COMMITTED","COMPRESSED","CONCURRENT","CONSTRAINT","CONTAINS","CONVERT","CREATE","CROSS","CURRENT_TIMESTAMP","DATABASE","DATABASES","DAY","DAY_HOUR","DAY_MINUTE","DAY_SECOND","DEFAULT","DEFINER","DELAYED","DELETE","DESC","DESCRIBE","DETERMINISTIC","DISTINCT","DISTINCTROW","DIV","DO","DROP","DUMPFILE","DUPLICATE","DYNAMIC","ELSE","ENCLOSED","END","ENGINE","ENGINES","ENGINE_TYPE","ESCAPE","ESCAPED","EVENTS","EXEC","EXECUTE","EXISTS","EXPLAIN","EXTENDED","FAST","FETCH","FIELDS","FILE","FIRST","FIXED","FLUSH","FOR","FORCE","FOREIGN","FULL","FULLTEXT","FUNCTION","GLOBAL","GRANT","GRANTS","GROUP_CONCAT","HEAP","HIGH_PRIORITY","HOSTS","HOUR","HOUR_MINUTE","HOUR_SECOND","IDENTIFIED","IF","IFNULL","IGNORE","IN","INDEX","INDEXES","INFILE","INSERT","INSERT_ID","INSERT_METHOD","INTERVAL","INTO","INVOKER","IS","ISOLATION","KEY","KEYS","KILL","LAST_INSERT_ID","LEADING","LEVEL","LIKE","LINEAR","LINES","LOAD","LOCAL","LOCK","LOCKS","LOGS","LOW_PRIORITY","MARIA","MASTER","MASTER_CONNECT_RETRY","MASTER_HOST","MASTER_LOG_FILE","MATCH","MAX_CONNECTIONS_PER_HOUR","MAX_QUERIES_PER_HOUR","MAX_ROWS","MAX_UPDATES_PER_HOUR","MAX_USER_CONNECTIONS","MEDIUM","MERGE","MINUTE","MINUTE_SECOND","MIN_ROWS","MODE","MODIFY","MONTH","MRG_MYISAM","MYISAM","NAMES","NATURAL","NOT","NOW()","NULL","OFFSET","ON DELETE","ON UPDATE","ON","ONLY","OPEN","OPTIMIZE","OPTION","OPTIONALLY","OUTFILE","PACK_KEYS","PAGE","PARTIAL","PARTITION","PARTITIONS","PASSWORD","PRIMARY","PRIVILEGES","PROCEDURE","PROCESS","PROCESSLIST","PURGE","QUICK","RAID0","RAID_CHUNKS","RAID_CHUNKSIZE","RAID_TYPE","RANGE","READ","READ_ONLY","READ_WRITE","REFERENCES","REGEXP","RELOAD","RENAME","REPAIR","REPEATABLE","REPLACE","REPLICATION","RESET","RESTORE","RESTRICT","RETURN","RETURNS","REVOKE","RLIKE","ROLLBACK","ROW","ROWS","ROW_FORMAT","SECOND","SECURITY","SEPARATOR","SERIALIZABLE","SESSION","SHARE","SHOW","SHUTDOWN","SLAVE","SONAME","SOUNDS","SQL","SQL_AUTO_IS_NULL","SQL_BIG_RESULT","SQL_BIG_SELECTS","SQL_BIG_TABLES","SQL_BUFFER_RESULT","SQL_CACHE","SQL_CALC_FOUND_ROWS","SQL_LOG_BIN","SQL_LOG_OFF","SQL_LOG_UPDATE","SQL_LOW_PRIORITY_UPDATES","SQL_MAX_JOIN_SIZE","SQL_NO_CACHE","SQL_QUOTE_SHOW_CREATE","SQL_SAFE_UPDATES","SQL_SELECT_LIMIT","SQL_SLAVE_SKIP_COUNTER","SQL_SMALL_RESULT","SQL_WARNINGS","START","STARTING","STATUS","STOP","STORAGE","STRAIGHT_JOIN","STRING","STRIPED","SUPER","TABLE","TABLES","TEMPORARY","TERMINATED","THEN","TO","TRAILING","TRANSACTIONAL","TRUE","TRUNCATE","TYPE","TYPES","UNCOMMITTED","UNIQUE","UNLOCK","UNSIGNED","USAGE","USE","USING","VARIABLES","VIEW","WHEN","WITH","WORK","WRITE","YEAR_MONTH"],V=["ADD","AFTER","ALTER COLUMN","ALTER TABLE","DELETE FROM","EXCEPT","FETCH FIRST","FROM","GROUP BY","GO","HAVING","INSERT INTO","INSERT","INTERSECT","LIMIT","MODIFY","ORDER BY","SELECT","SET CURRENT SCHEMA","SET SCHEMA","SET","UNION ALL","UNION","UPDATE","VALUES","WHERE"],x=["AND","CROSS APPLY","CROSS JOIN","ELSE","INNER JOIN","JOIN","LEFT JOIN","LEFT OUTER JOIN","OR","OUTER APPLY","OUTER JOIN","RIGHT JOIN","RIGHT OUTER JOIN","WHEN","XOR"];let Y;class b{constructor(e){this.cfg=e}format(e){return Y||(Y=new D({reservedWords:m,reservedTopLevelWords:V,reservedNewlineWords:x,stringTypes:['""',"N''","''","``","[]"],openParens:["(","CASE"],closeParens:[")","END"],indexedPlaceholderTypes:["?"],namedPlaceholderTypes:["@",":"],lineCommentTypes:["#","--"]})),new a(this.cfg,Y).format(e)}}t.d(E,"format",(function(){return X}));const X=(e,E={})=>{switch(E.language){case"db2":return new h(E).format(e);case"n1ql":return new g(E).format(e);case"pl/sql":return new W(E).format(e);case"sql":case void 0:return new b(E).format(e);default:throw Error(`Unsupported SQL dialect: ${E.language}`)}};E.default={format:X}}])}));

@@ -84,7 +84,2 @@ "use strict";

}
}, {
key: "resetIndentation",
value: function resetIndentation() {
this.indentTypes = [];
}
/**

@@ -107,2 +102,7 @@ * Decreases indentation by one block-level indent.

}
}, {
key: "resetIndentation",
value: function resetIndentation() {
this.indentTypes = [];
}
}]);

@@ -109,0 +109,0 @@

{
"name": "sql-formatter-plus",
"version": "1.3.3",
"version": "1.3.4",
"description": "Formats whitespace in a SQL query to make it more readable",

@@ -5,0 +5,0 @@ "license": "MIT",

@@ -56,6 +56,2 @@ import repeat from 'lodash/repeat';

resetIndentation() {
this.indentTypes = [];
}
/**

@@ -74,2 +70,6 @@ * Decreases indentation by one block-level indent.

}
resetIndentation() {
this.indentTypes = [];
}
}

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc