/*!
Copyright (c) 2026 Lenovo SSG BASD. All rights reserved.
@license Proprietary

This software is the confidential and proprietary property of Lenovo SSG BASD.
You shall not disclose such Confidential Information and shall use it only in
accordance with the terms of the license agreement.

--- Build Info ---
Version: 1.1.1
Build Time: 2026/2/26 17:21:00
Build Commit: 81e556ed827e2f043668506dae6fae8dbb9ef395
*/
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../../language/dist/index.js"),t=require("../../../@lezer/highlight/dist/index.js"),n=require("../../../@lezer/lr/dist/index.js"),a=require("../../autocomplete/dist/index.js");function i(e){return e>=65&&e<=90||e>=97&&e<=122||e>=48&&e<=57}function r(e){return e>=48&&e<=57||e>=97&&e<=102||e>=65&&e<=70}function o(e,t,n){for(let a=!1;;){if(e.next<0)return;if(e.next==t&&!a)return void e.advance();a=n&&!a&&92==e.next,e.advance()}}function s(e,t){for(;95==e.next||i(e.next);)null!=t&&(t+=String.fromCharCode(e.next)),e.advance();return t}function l(e,t){for(;48==e.next||49==e.next;)e.advance();t&&e.next==t&&e.advance()}function c(e,t){for(;;){if(46==e.next){if(t)break;t=!0}else if(e.next<48||e.next>57)break;e.advance()}if(69==e.next||101==e.next)for(e.advance(),43!=e.next&&45!=e.next||e.advance();e.next>=48&&e.next<=57;)e.advance()}function d(e){for(;!(e.next<0||10==e.next);)e.advance()}function u(e,t){for(let n=0;n<t.length;n++)if(t.charCodeAt(n)==e)return!0;return!1}const f=" \t\r\n";function p(e,t,n){let a=Object.create(null);a.true=a.false=5,a.null=a.unknown=6;for(let i of e.split(" "))i&&(a[i]=20);for(let i of t.split(" "))i&&(a[i]=21);for(let i of(n||"").split(" "))i&&(a[i]=24);return a}const O={backslashEscapes:!1,hashComments:!1,spaceAfterDashes:!1,slashComments:!1,doubleQuotedStrings:!1,doubleDollarQuotedStrings:!1,unquotedBitLiterals:!1,treatBitsAsBytes:!1,charSetCasts:!1,plsqlQuotingMechanism:!1,operatorChars:"*+-%<>!=&|~^/",specialVar:"?",identifierQuotes:'"',caseInsensitiveIdentifiers:!1,words:p("absolute action add after all allocate alter and any are as asc assertion at authorization before begin between both breadth by call cascade cascaded case cast catalog check close collate collation column commit condition connect connection constraint constraints constructor continue corresponding count create cross cube current current_date current_default_transform_group current_transform_group_for_type current_path current_role current_time current_timestamp current_user cursor cycle data day deallocate declare default deferrable deferred delete depth deref desc describe descriptor deterministic diagnostics disconnect distinct do domain drop dynamic each else elseif end end-exec equals escape except exception exec execute exists exit external fetch first for foreign found from free full function general get global go goto grant group grouping handle having hold hour identity if immediate in indicator initially inner inout input insert intersect into is isolation join key language last lateral leading leave left level like limit local localtime localtimestamp locator loop map match method minute modifies module month names natural nesting new next no none not of old on only open option or order ordinality out outer output overlaps pad parameter partial path prepare preserve primary prior privileges procedure public read reads recursive redo ref references referencing relative release repeat resignal restrict result return returns revoke right role rollback rollup routine row rows savepoint schema scroll search second section select session session_user set sets signal similar size some space specific specifictype sql sqlexception sqlstate sqlwarning start state static system_user table temporary then timezone_hour timezone_minute to trailing transaction translation treat trigger under undo union unique unnest until update usage user using value values view when whenever where while with without work write year zone ","array binary bit boolean char character clob date decimal double float int integer interval large national nchar nclob numeric object precision real smallint time timestamp varchar varying ")};function m(e){return new n.ExternalTokenizer(t=>{var n;let{next:a}=t;if(t.advance(),u(a,f)){for(;u(t.next,f);)t.advance();t.acceptToken(36)}else if(36==a&&e.doubleDollarQuotedStrings){let e=s(t,"");36==t.next&&(t.advance(),function(e,t){e:for(;;){if(e.next<0)return;if(36==e.next){e.advance();for(let n=0;n<t.length;n++){if(e.next!=t.charCodeAt(n))continue e;e.advance()}if(36==e.next)return void e.advance()}else e.advance()}}(t,e),t.acceptToken(3))}else if(39==a||34==a&&e.doubleQuotedStrings)o(t,a,e.backslashEscapes),t.acceptToken(3);else if(35==a&&e.hashComments||47==a&&47==t.next&&e.slashComments)d(t),t.acceptToken(1);else if(45!=a||45!=t.next||e.spaceAfterDashes&&32!=t.peek(1))if(47==a&&42==t.next){t.advance();for(let e=1;;){let n=t.next;if(t.next<0)break;if(t.advance(),42==n&&47==t.next){if(e--,t.advance(),!e)break}else 47==n&&42==t.next&&(e++,t.advance())}t.acceptToken(2)}else if(101!=a&&69!=a||39!=t.next)if(110!=a&&78!=a||39!=t.next||!e.charSetCasts)if(95==a&&e.charSetCasts)for(let r=0;;r++){if(39==t.next&&r>1){t.advance(),o(t,39,e.backslashEscapes),t.acceptToken(3);break}if(!i(t.next))break;t.advance()}else if(e.plsqlQuotingMechanism&&(113==a||81==a)&&39==t.next&&t.peek(1)>0&&!u(t.peek(1),f)){let e=t.peek(1);t.advance(2),function(e,t){let n="[{<(".indexOf(String.fromCharCode(t)),a=n<0?t:"]}>)".charCodeAt(n);for(;;){if(e.next<0)return;if(e.next==a&&39==e.peek(1))return void e.advance(2);e.advance()}}(t,e),t.acceptToken(3)}else if(u(a,e.identifierQuotes)){o(t,91==a?93:a,!1),t.acceptToken(19)}else if(40==a)t.acceptToken(7);else if(41==a)t.acceptToken(8);else if(123==a)t.acceptToken(9);else if(125==a)t.acceptToken(10);else if(91==a)t.acceptToken(11);else if(93==a)t.acceptToken(12);else if(59==a)t.acceptToken(13);else if(e.unquotedBitLiterals&&48==a&&98==t.next)t.advance(),l(t),t.acceptToken(22);else if(98!=a&&66!=a||39!=t.next&&34!=t.next){if(48==a&&(120==t.next||88==t.next)||(120==a||88==a)&&39==t.next){let e=39==t.next;for(t.advance();r(t.next);)t.advance();e&&39==t.next&&t.advance(),t.acceptToken(4)}else if(46==a&&t.next>=48&&t.next<=57)c(t,!0),t.acceptToken(4);else if(46==a)t.acceptToken(14);else if(a>=48&&a<=57)c(t,!1),t.acceptToken(4);else if(u(a,e.operatorChars)){for(;u(t.next,e.operatorChars);)t.advance();t.acceptToken(15)}else if(u(a,e.specialVar))t.next==a&&t.advance(),function(e){if(39==e.next||34==e.next||96==e.next){let t=e.next;e.advance(),o(e,t,!1)}else s(e)}(t),t.acceptToken(17);else if(58==a||44==a)t.acceptToken(16);else if(i(a)){let i=s(t,String.fromCharCode(a));t.acceptToken(46==t.next||46==t.peek(-i.length-1)?18:null!==(n=e.words[i.toLowerCase()])&&void 0!==n?n:18)}}else{const n=t.next;t.advance(),e.treatBitsAsBytes?(o(t,n,e.backslashEscapes),t.acceptToken(23)):(l(t,n),t.acceptToken(22))}else t.advance(),o(t,39,e.backslashEscapes),t.acceptToken(3);else t.advance(),o(t,39,!0),t.acceptToken(3);else d(t),t.acceptToken(1)})}const h=m(O),g=n.LRParser.deserialize({version:14,states:"%vQ]QQOOO#wQRO'#DSO$OQQO'#CwO%eQQO'#CxO%lQQO'#CyO%sQQO'#CzOOQQ'#DS'#DSOOQQ'#C}'#C}O'UQRO'#C{OOQQ'#Cv'#CvOOQQ'#C|'#C|Q]QQOOQOQQOOO'`QQO'#DOO(xQRO,59cO)PQQO,59cO)UQQO'#DSOOQQ,59d,59dO)cQQO,59dOOQQ,59e,59eO)jQQO,59eOOQQ,59f,59fO)qQQO,59fOOQQ-E6{-E6{OOQQ,59b,59bOOQQ-E6z-E6zOOQQ,59j,59jOOQQ-E6|-E6|O+VQRO1G.}O+^QQO,59cOOQQ1G/O1G/OOOQQ1G/P1G/POOQQ1G/Q1G/QP+kQQO'#C}O+rQQO1G.}O)PQQO,59cO,PQQO'#Cw",stateData:",[~OtOSPOSQOS~ORUOSUOTUOUUOVROXSOZTO]XO^QO_UO`UOaPObPOcPOdUOeUOfUOgUOhUO~O^]ORvXSvXTvXUvXVvXXvXZvX]vX_vX`vXavXbvXcvXdvXevXfvXgvXhvX~OsvX~P!jOa_Ob_Oc_O~ORUOSUOTUOUUOVROXSOZTO^tO_UO`UOa`Ob`Oc`OdUOeUOfUOgUOhUO~OWaO~P$ZOYcO~P$ZO[eO~P$ZORUOSUOTUOUUOVROXSOZTO^QO_UO`UOaPObPOcPOdUOeUOfUOgUOhUO~O]hOsoX~P%zOajObjOcjO~O^]ORkaSkaTkaUkaVkaXkaZka]ka_ka`kaakabkackadkaekafkagkahka~Oska~P'kO^]O~OWvXYvX[vX~P!jOWnO~P$ZOYoO~P$ZO[pO~P$ZO^]ORkiSkiTkiUkiVkiXkiZki]ki_ki`kiakibkickidkiekifkigkihki~Oski~P)xOWkaYka[ka~P'kO]hO~P$ZOWkiYki[ki~P)xOasObsOcsO~O",goto:"#hwPPPPPPPPPPPPPPPPPPPPPPPPPPx||||!Y!^!d!xPPP#[TYOZeUORSTWZbdfqT[OZQZORiZSWOZQbRQdSQfTZgWbdfqQ^PWk^lmrQl_Qm`RrseVORSTWZbdfq",nodeNames:"⚠ LineComment BlockComment String Number Bool Null ( ) { } [ ] ; . Operator Punctuation SpecialVar Identifier QuotedIdentifier Keyword Type Bits Bytes Builtin Script Statement CompositeIdentifier Parens Braces Brackets Statement",maxTerm:38,nodeProps:[["isolate",-4,1,2,3,19,""]],skippedNodes:[0,1,2],repeatNodeCount:3,tokenData:"RORO",tokenizers:[0,h],topRules:{Script:[0,25]},tokenPrec:0});function k(e){let t=e.cursor().moveTo(e.from,-1);for(;/Comment/.test(t.name);)t.moveTo(t.from,-1);return t.node}function v(e,t){let n=e.sliceString(t.from,t.to),a=/^([`'"\[])(.*)([`'"\]])$/.exec(n);return a?a[2]:n}function Q(e){return e&&("Identifier"==e.name||"QuotedIdentifier"==e.name)}function x(e,t){if("CompositeIdentifier"==t.name){let n=[];for(let a=t.firstChild;a;a=a.nextSibling)Q(a)&&n.push(v(e,a));return n}return[v(e,t)]}function b(e,t){for(let n=[];;){if(!t||"."!=t.name)return n;let a=k(t);if(!Q(a))return n;n.unshift(v(e,a)),t=k(a)}}function C(t,n){let a=e.syntaxTree(t).resolveInner(n,-1),i=function(e,t){let n;for(let i=t;!n;i=i.parent){if(!i)return null;"Statement"==i.name&&(n=i)}let a=null;for(let i=n.firstChild,r=!1,o=null;i;i=i.nextSibling){let t="Keyword"==i.name?e.sliceString(i.from,i.to).toLowerCase():null,n=null;if(r)if("as"==t&&o&&Q(i.nextSibling))n=v(e,i.nextSibling);else{if(t&&P.has(t))break;o&&Q(i)&&(n=v(e,i))}else r="from"==t;n&&(a||(a=Object.create(null)),a[n]=x(e,o)),o=/Identifier$/.test(i.name)?i:null}return a}(t.doc,a);return"Identifier"==a.name||"QuotedIdentifier"==a.name||"Keyword"==a.name?{from:a.from,quoted:"QuotedIdentifier"==a.name?t.doc.sliceString(a.from,a.from+1):null,parents:b(t.doc,k(a)),aliases:i}:"."==a.name?{from:n,quoted:null,parents:b(t.doc,a),aliases:i}:{from:n,quoted:null,parents:[],empty:!0,aliases:i}}const P=new Set("where group having order union intersect except all distinct limit offset fetch for".split(" "));function y(e,t,n){return n.map(n=>({...n,label:n.label[0]==e?n.label:e+n.label+t,apply:void 0}))}const S=/^\w*$/,T=/^[`'"\[]?\w*[`'"\]]?$/;function w(e){return e.self&&"string"==typeof e.self.label}class U{constructor(e,t){this.idQuote=e,this.idCaseInsensitive=t,this.list=[],this.children=void 0}child(e){let t=this.children||(this.children=Object.create(null)),n=t[e];return n||(e&&!this.list.some(t=>t.label==e)&&this.list.push(X(e,"type",this.idQuote,this.idCaseInsensitive)),t[e]=new U(this.idQuote,this.idCaseInsensitive))}maybeChild(e){return this.children?this.children[e]:null}addCompletion(e){let t=this.list.findIndex(t=>t.label==e.label);t>-1?this.list[t]=e:this.list.push(e)}addCompletions(e){for(let t of e)this.addCompletion("string"==typeof t?X(t,"property",this.idQuote,this.idCaseInsensitive):t)}addNamespace(e){Array.isArray(e)?this.addCompletions(e):w(e)?this.addNamespace(e.children):this.addNamespaceObject(e)}addNamespaceObject(e){for(let t of Object.keys(e)){let n=e[t],a=null,i=t.replace(/\\?\./g,e=>"."==e?"\0":e).split("\0"),r=this;w(n)&&(a=n.self,n=n.children);for(let e=0;e<i.length;e++)a&&e==i.length-1&&r.addCompletion(a),r=r.child(i[e].replace(/\\\./g,"."));r.addNamespace(n)}}}function X(e,t,n,a){return new RegExp("^[a-z_][a-z_\\d]*$",a?"i":"").test(e)?{label:e,type:t}:{label:e,type:t,apply:n+e+_(n)}}function _(e){return"["===e?"]":e}let q=g.configure({props:[e.indentNodeProp.add({Statement:e.continuedIndent()}),e.foldNodeProp.add({Statement:(e,t)=>({from:Math.min(e.from+100,t.doc.lineAt(e.from).to),to:e.to}),BlockComment:e=>({from:e.from+2,to:e.to-2})}),t.styleTags({Keyword:t.tags.keyword,Type:t.tags.typeName,Builtin:t.tags.standard(t.tags.name),Bits:t.tags.number,Bytes:t.tags.string,Bool:t.tags.bool,Null:t.tags.null,Number:t.tags.number,String:t.tags.string,Identifier:t.tags.name,QuotedIdentifier:t.tags.special(t.tags.string),SpecialVar:t.tags.special(t.tags.name),LineComment:t.tags.lineComment,BlockComment:t.tags.blockComment,Operator:t.tags.operator,"Semi Punctuation":t.tags.punctuation,"( )":t.tags.paren,"{ }":t.tags.brace,"[ ]":t.tags.squareBracket})]});class I{constructor(e,t,n){this.dialect=e,this.language=t,this.spec=n}get extension(){return this.language.extension}configureLanguage(e,t){return new I(this.dialect,this.language.configure(e,t),this.spec)}static define(t){let n=function(e,t,n,a){let i={};for(let r in O)i[r]=(e.hasOwnProperty(r)?e:O)[r];return t&&(i.words=p(t,n||"",a)),i}(t,t.keywords,t.types,t.builtin),a=e.LRLanguage.define({name:"sql",parser:q.configure({tokenizers:[{from:h,to:m(n)}]}),languageData:{commentTokens:{line:"--",block:{open:"/*",close:"*/"}},closeBrackets:{brackets:["(","[","{","'",'"',"`"]}}});return new I(n,a,t)}}function R(e,t){return{label:e,type:t,boost:-1}}function j(e,t=!1,n){return function(e,t,n){let i=Object.keys(e).map(a=>{return n(t?a.toUpperCase():a,21==(i=e[a])?"type":20==i?"keyword":"variable");var i});return a.ifNotIn(["QuotedIdentifier","String","LineComment","BlockComment","."],a.completeFromList(i))}(e.dialect.words,t,n||R)}function B(e){return e.schema?function(e,t,n,a,i,r){var o;let s=(null===(o=null==r?void 0:r.spec.identifierQuotes)||void 0===o?void 0:o[0])||'"',l=new U(s,!!(null==r?void 0:r.spec.caseInsensitiveIdentifiers)),c=i?l.child(i):null;return l.addNamespace(e),t&&(c||l).addCompletions(t),n&&l.addCompletions(n),c&&l.addCompletions(c.list),a&&l.addCompletions((c||l).child(a).list),e=>{let{parents:t,from:n,quoted:i,empty:r,aliases:o}=C(e.state,e.pos);if(r&&!e.explicit)return null;o&&1==t.length&&(t=o[t[0]]||t);let s=l;for(let u of t){for(;!s.children||!s.children[u];)if(s==l&&c)s=c;else{if(s!=c||!a)return null;s=s.child(a)}let e=s.maybeChild(u);if(!e)return null;s=e}let d=s.list;if(s==l&&o&&(d=d.concat(Object.keys(o).map(e=>({label:e,type:"constant"})))),i){let t=i[0],a=_(t);return{from:n,to:e.state.sliceDoc(e.pos,e.pos+1)==a?e.pos+1:void 0,options:y(t,a,d),validFor:T}}return{from:n,options:d,validFor:S}}}(e.schema,e.tables,e.schemas,e.defaultTable,e.defaultSchema,e.dialect||z):()=>null}function Z(e){return e.schema?(e.dialect||z).language.data.of({autocomplete:B(e)}):[]}const z=I.define({});exports.SQLDialect=I,exports.StandardSQL=z,exports.keywordCompletionSource=j,exports.schemaCompletionSource=B,exports.sql=function(t={}){let n=t.dialect||z;return new e.LanguageSupport(n.language,[Z(t),n.language.data.of({autocomplete:j(n,t.upperCaseKeywords,t.keywordCompletion)})])};