@cap.core/ql 2.0.4 → 2.1.0

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.
package/cql/parser.min.js CHANGED
@@ -1 +1 @@
1
- import*as fluent from"../lib/xl/fluent.js";import{SELECT}from"../lib/ql/select.js";import{INSERT}from"../lib/ql/insert.js";import{UPSERT}from"../lib/ql/insert.js";import{UPDATE}from"../lib/ql/update.js";import{DELETE}from"../lib/ql/delete.js";import{CALL}from"../lib/ql/call-action.js";class peg$SyntaxError extends SyntaxError{constructor(t,e,r,n){super(t),this.expected=e,this.found=r,this.location=n,this.name="SyntaxError"}format(t){let e="Error: "+this.message;if(this.location){let r=null;const n=t.find(t=>t.source===this.location.source);n&&(r=n.text.split(/\r\n|\n|\r/g));const o=this.location.start,s=this.location.source&&"function"==typeof this.location.source.offset?this.location.source.offset(o):o,u=this.location.source+":"+s.line+":"+s.column;if(r){const t=this.location.end,n="".padEnd(s.line.toString().length," "),l=r[o.line-1],i=(o.line===t.line?t.column:l.length+1)-o.column||1;e+="\n --\x3e "+u+"\n"+n+" |\n"+s.line+" | "+l+"\n"+n+" | "+"".padEnd(o.column-1," ")+"".padEnd(i,"^")}else e+="\n at "+u}return e}static buildMessage(t,e){function r(t){return t.codePointAt(0).toString(16).toUpperCase()}const n=Object.prototype.hasOwnProperty.call(RegExp.prototype,"unicode")?new RegExp("[\\p{C}\\p{Mn}\\p{Mc}]","gu"):null;function o(t){return n?t.replace(n,t=>"\\u{"+r(t)+"}"):t}function s(t){return o(t.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,t=>"\\x0"+r(t)).replace(/[\x10-\x1F\x7F-\x9F]/g,t=>"\\x"+r(t)))}function u(t){return o(t.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,t=>"\\x0"+r(t)).replace(/[\x10-\x1F\x7F-\x9F]/g,t=>"\\x"+r(t)))}const l={literal:t=>'"'+s(t.text)+'"',class(t){const e=t.parts.map(t=>Array.isArray(t)?u(t[0])+"-"+u(t[1]):u(t));return"["+(t.inverted?"^":"")+e.join("")+"]"+(t.unicode?"u":"")},any:()=>"any character",end:()=>"end of input",other:t=>t.description};function i(t){return l[t.type](t)}return"Expected "+function(t){const e=t.map(i);if(e.sort(),e.length>0){let t=1;for(let r=1;r<e.length;r++)e[r-1]!==e[r]&&(e[t]=e[r],t++);e.length=t}switch(e.length){case 1:return e[0];case 2:return e[0]+" or "+e[1];default:return e.slice(0,-1).join(", ")+", or "+e[e.length-1]}}(t)+" but "+function(t){return t?'"'+s(t)+'"':"end of input"}(e)+" found."}}function peg$parse(t,e){const r={},n=(e=void 0!==e?e:{}).grammarSource,o={CQL:_r,subject:Zr,columns:Fr,values:Jr,ref:Wr,val:Yr,expr:qr,set:Ur,with:Pr,where:jr,groupBy:Or,orderBy:Nr};let s=_r;const u="select",l="stream",i="localized",a="distinct",c="one",f="from",h="where",p="group by",C="having",d="order by",g="limit",w="offset",b="as",L="*",A="[",m="]",E="asc",x="desc",v="insert",y="upsert",S="into",_="entries",T="columns",$="rows",R="values",F="update",I="entity",j="with",O="set",N="=",P="{",U=":",D="}",z="delete",B="call",M="action",Z="function",q="#",H="?",W="and",Y="or",k="in",G="between",Q="like",V="exists",J="contains",K="case",X="when",tt="then",et="else",rt="end",nt="is",ot="not",st="null",ut="empty",lt="-",it=".",at="e",ct="'",ft="''",ht="true",pt="false",Ct="(",dt=")",gt=",",wt=/^[A-Za-z_$]/,bt=/^[A-Za-z0-9_$]/,Lt=/^[!=><+\-*\/%&|\^~]/,At=/^[0-9]/,mt=/^[^']/,Et=/^[A-Za-z_$0-9]/,xt=/^[ \t\n\r]/,vt=Ar("SELECT",!0),yt=Ar("STREAM",!0),St=Ar("LOCALIZED",!0),_t=Ar("DISTINCT",!0),Tt=Ar("ONE",!0),$t=Ar("FROM",!0),Rt={type:"any"},Ft=Ar("WHERE",!0),It=Ar("GROUP BY",!0),jt=Ar("HAVING",!0),Ot=Ar("ORDER BY",!0),Nt=Ar("LIMIT",!0),Pt=Ar("OFFSET",!0),Ut=Ar("as",!0),Dt=Ar("*",!1),zt=Ar("[",!1),Bt=Ar("]",!1),Mt=Ar("asc",!0),Zt=Ar("desc",!0),qt=Ar("INSERT",!0),Ht=Ar("UPSERT",!0),Wt=Ar("INTO",!0),Yt=Ar("ENTRIES",!0),kt=Ar("COLUMNS",!0),Gt=Ar("ROWS",!0),Qt=Ar("VALUES",!0),Vt=Ar("UPDATE",!0),Jt=Ar("ENTITY",!0),Kt=Ar("WITH",!0),Xt=Ar("SET",!0),te=Ar("=",!1),ee=Ar("{",!1),re=Ar(":",!1),ne=Ar("}",!1),oe=Ar("DELETE",!0),se=Ar("CALL",!0),ue=Ar("ACTION",!0),le=Ar("FUNCTION",!0),ie=Er("a name"),ae=Ar("AS",!0),ce=mr([["A","Z"],["a","z"],"_","$"],!1,!1,!1),fe=mr([["A","Z"],["a","z"],["0","9"],"_","$"],!1,!1,!1),he=Er("an element ref"),pe=Er("an entity ref"),Ce=Er("a reference"),de=Er("a value"),ge=Er("a list"),we=Er("a function"),be=Er("a symbol"),Le=Ar("#",!1),Ae=Er("a parameter"),me=Ar("?",!1),Ee=Er("an operator"),xe=mr(["!","=",">","<","+","-","*","/","%","&","|","^","~"],!1,!1,!1),ve=Ar("and",!0),ye=Ar("or",!0),Se=Ar("in",!0),_e=Ar("between",!0),Te=Ar("like",!0),$e=Ar("exists",!0),Re=Ar("contains",!0),Fe=Ar("case",!0),Ie=Ar("when",!0),je=Ar("then",!0),Oe=Ar("else",!0),Ne=Ar("end",!0),Pe=Ar("is",!0),Ue=Ar("not",!0),De=Ar("null",!0),ze=Ar("empty",!0),Be=Er("a literal"),Me=Ar("-",!1),Ze=mr([["0","9"]],!1,!1,!1),qe=Ar(".",!1),He=Ar("e",!1),We=Ar("'",!1),Ye=mr(["'"],!0,!1,!1),ke=Ar("''",!1),Ge=Ar("null",!1),Qe=Ar("true",!1),Ve=Ar("false",!1),Je=Ar("(",!1),Ke=Ar(")",!1),Xe=mr([["A","Z"],["a","z"],"_","$",["0","9"]],!1,!1,!1),tr=Er("a comma"),er=Ar(",",!1),rr=Er(""),nr=mr([" ","\t","\n","\r"],!1,!1,!1);function or(e){return fn?.length&&(e.params=fn),hn?.length&&(e.args=hn),e.source=t.substring(Cr,pr),e}function sr(t,e){t.as=e}function ur(t,e,r){e?t.inline=r:t.expand=r}function lr(t,e){t.as=e}function ir(t,e){t.sort=e.toLowerCase()}function ar(t,e,r){t[e]=r}function cr(t,e,r){t[e]="val"in r?r.val:r}function fr(t,e){return e?{id:t,...e}:t}function hr(){return"'"}let pr=0|e.peg$currPos,Cr=pr;const dr=[{line:1,column:1}];let gr,wr=pr,br=e.peg$maxFailExpected||[],Lr=0|e.peg$silentFails;if(e.startRule){if(!(e.startRule in o))throw new Error("Can't start parsing from rule \""+e.startRule+'".');s=o[e.startRule]}function Ar(t,e){return{type:"literal",text:t,ignoreCase:e}}function mr(t,e,r,n){return{type:"class",parts:t,inverted:e,ignoreCase:r,unicode:n}}function Er(t){return{type:"other",description:t}}function xr(e){let r,n=dr[e];if(n)return n;if(e>=dr.length)r=dr.length-1;else for(r=e;!dr[--r];);for(n=dr[r],n={line:n.line,column:n.column};r<e;)10===t.charCodeAt(r)?(n.line++,n.column=1):n.column++,r++;return dr[e]=n,n}function vr(t,e,r){const o=xr(t),s=xr(e),u={source:n,start:{offset:t,line:o.line,column:o.column},end:{offset:e,line:s.line,column:s.column}};return r&&n&&"function"==typeof n.offset&&(u.start=n.offset(u.start),u.end=n.offset(u.end)),u}function yr(t){pr<wr||(pr>wr&&(wr=pr,br=[]),br.push(t))}function Sr(t,e,r){return new peg$SyntaxError(peg$SyntaxError.buildMessage(t,e),t,e,r)}function _r(){let e,n;return e=pr,n=Tr(),n===r&&(n=function(){let e,n,o,s,u,l,i,a,c,h,p,C,d,g;e=pr,n=pr,o=t.substr(pr,6),o.toLowerCase()===v?pr+=6:(o=r,0===Lr&&yr(qt));o!==r?(s=cn(),s!==r?(Cr=n,n=new INSERT):(pr=n,n=r)):(pr=n,n=r);n===r&&(n=pr,o=t.substr(pr,6),o.toLowerCase()===y?pr+=6:(o=r,0===Lr&&yr(Ht)),o!==r?(s=cn(),s!==r?(Cr=n,n=new UPSERT):(pr=n,n=r)):(pr=n,n=r));if(n!==r)if(o=pr,s=tn(),s!==r&&(Cr=o,w=s,s=void(n._.entries=Array.isArray(w)?w:[w])),o=s,o===r&&(o=null),s=pr,u=pr,l=t.substr(pr,4),l.toLowerCase()===S?pr+=4:(l=r,0===Lr&&yr(Wt)),l!==r?(i=cn(),i!==r?(l=[l,i],u=l):(pr=u,u=r)):(pr=u,u=r),u!==r?(l=Zr(),l!==r?(Cr=s,s=function(t,e){t._.into=e}(n,l)):(pr=s,s=r)):(pr=s,s=r),s!==r){if(u=pr,l=t.substr(pr,4),l.toLowerCase()===f?pr+=4:(l=r,0===Lr&&yr($t)),l!==r?(i=cn(),i!==r?(a=tn(),a!==r?(Cr=u,u=function(t,e){t._.from=e}(n,a)):(pr=u,u=r)):(pr=u,u=r)):(pr=u,u=r),u===r&&(u=pr,l=Tr(),l!==r&&(Cr=u,l=function(t,e){t._.from=e}(n,l)),u=l),u===r){if(u=pr,l=pr,i=pr,a=t.substr(pr,7),a.toLowerCase()===_?pr+=7:(a=r,0===Lr&&yr(Yt)),a!==r?(c=cn(),c!==r?(a=[a,c],i=a):(pr=i,i=r)):(pr=i,i=r),i===r&&(i=null),a=pr,c=tn(),c===r){for(c=pr,h=[],p=Dr();p!==r;)h.push(p),p=pr,C=un(),C!==r?(C=Dr(),C===r?(pr=p,p=r):p=C):p=C;h.length<1?(pr=c,c=r):c=h}if(c!==r&&(Cr=a,c=function(t,e){t._tail(e)}(n,c)),a=c,a!==r?(i=[i,a],l=i):(pr=l,l=r),l===r&&(l=null),i=pr,a=pr,c=t.substr(pr,7),c.toLowerCase()===T?pr+=7:(c=r,0===Lr&&yr(kt)),c!==r?(h=cn(),h!==r?(c=[c,h],a=c):(pr=a,a=r)):(pr=a,a=r),a===r&&(a=null),c=tn(),c===r)if(c=pr,h=nn(),h!==r){for(p=pr,C=[],d=Mr();d!==r;)C.push(d),d=pr,g=un(),g!==r?(g=Mr(),g===r?(pr=d,d=r):d=g):d=g;C.length<1?(pr=p,p=r):p=C,p!==r?(C=on(),C!==r?c=p:(pr=c,c=r)):(pr=c,c=r)}else pr=c,c=r;c!==r?(Cr=i,i=function(t,e){t._.columns=e}(n,c)):(pr=i,i=r),i===r&&(i=null),a=pr,c=pr,h=t.substr(pr,4),h.toLowerCase()===$?pr+=4:(h=r,0===Lr&&yr(Gt)),h!==r?(p=cn(),p!==r?(h=[h,p],c=h):(pr=c,c=r)):(pr=c,c=r),c===r&&(c=null),h=tn(),h!==r?(Cr=a,a=function(t,e){t._.rows=e}(n,h)):(pr=a,a=r),a===r&&(a=null),c=pr,h=pr,p=t.substr(pr,6),p.toLowerCase()===R?pr+=6:(p=r,0===Lr&&yr(Qt)),p!==r?(C=cn(),C!==r?(p=[p,C],h=p):(pr=h,h=r)):(pr=h,h=r),h!==r?(p=kr(),p!==r?(Cr=c,c=function(t,e){t._.values=e.list}(n,p)):(pr=c,c=r)):(pr=c,c=r),c===r&&(c=null),l=[l,i,a,c],u=l}u!==r?e=n:(pr=e,e=r)}else pr=e,e=r;else pr=e,e=r;var w;return e}(),n===r&&(n=function(){let e,n,o,s,u,l,i,a,c;e=pr,n=pr,o=t.substr(pr,6),o.toLowerCase()===F?pr+=6:(o=r,0===Lr&&yr(Vt));o!==r?(s=cn(),s!==r?(Cr=n,n=new UPDATE):(pr=n,n=r)):(pr=n,n=r);n!==r?(o=pr,s=pr,u=t.substr(pr,6),u.toLowerCase()===I?pr+=6:(u=r,0===Lr&&yr(Jt)),u!==r?(l=cn(),l!==r?(u=[u,l],s=u):(pr=s,s=r)):(pr=s,s=r),s===r&&(s=null),u=Zr(),u!==r?(Cr=o,f=u,o=void(n._.entity=f)):(pr=o,o=r),o!==r?(s=pr,u=pr,l=t.substr(pr,4),l.toLowerCase()===j?pr+=4:(l=r,0===Lr&&yr(Kt)),l!==r?(i=cn(),i!==r?(l=[l,i],u=l):(pr=u,u=r)):(pr=u,u=r),u!==r?(l=Pr(),l!==r?(Cr=s,s=function(t,e){t._.data=e}(n,l)):(pr=s,s=r)):(pr=s,s=r),s===r&&(s=null),u=pr,l=pr,i=t.substr(pr,3),i.toLowerCase()===O?pr+=3:(i=r,0===Lr&&yr(Xt)),i!==r?(a=cn(),a!==r?(i=[i,a],l=i):(pr=l,l=r)):(pr=l,l=r),l!==r?(i=Ur(),i!==r?(Cr=u,u=function(t,e){t._.with=e}(n,i)):(pr=u,u=r)):(pr=u,u=r),u===r&&(u=null),l=pr,i=pr,a=t.substr(pr,5),a.toLowerCase()===h?pr+=5:(a=r,0===Lr&&yr(Ft)),a!==r?(c=cn(),c!==r?(a=[a,c],i=a):(pr=i,i=r)):(pr=i,i=r),i!==r?(a=jr(),a!==r?(c=an(),Cr=l,l=function(t,e){t._.where=e}(n,a)):(pr=l,l=r)):(pr=l,l=r),l===r&&(l=null),e=n):(pr=e,e=r)):(pr=e,e=r);var f;return e}(),n===r&&(n=function(){let e,n,o,s,u,l,i;e=pr,n=pr,o=t.substr(pr,6),o.toLowerCase()===z?pr+=6:(o=r,0===Lr&&yr(oe));o!==r?(s=cn(),s!==r?(Cr=n,n=new DELETE):(pr=n,n=r)):(pr=n,n=r);n!==r?(o=pr,s=pr,u=t.substr(pr,4),u.toLowerCase()===f?pr+=4:(u=r,0===Lr&&yr($t)),u!==r?(l=cn(),l!==r?(u=[u,l],s=u):(pr=s,s=r)):(pr=s,s=r),s===r&&(s=null),u=Zr(),u!==r?(l=an(),Cr=o,a=u,o=void(n._.from=a)):(pr=o,o=r),o!==r?(s=pr,u=pr,l=t.substr(pr,5),l.toLowerCase()===h?pr+=5:(l=r,0===Lr&&yr(Ft)),l!==r?(i=cn(),i!==r?(l=[l,i],u=l):(pr=u,u=r)):(pr=u,u=r),u!==r?(l=jr(),l!==r?(i=an(),Cr=s,s=function(t,e){t._.where=e}(n,l)):(pr=s,s=r)):(pr=s,s=r),s===r&&(s=null),e=n):(pr=e,e=r)):(pr=e,e=r);var a;return e}(),n===r&&(n=function(){let e,n,o,s,u,l,i;e=pr,n=pr,o=t.substr(pr,4),o.toLowerCase()===B?pr+=4:(o=r,0===Lr&&yr(se));o!==r?(s=cn(),s!==r?(Cr=n,n=new CALL):(pr=n,n=r)):(pr=n,n=r);n!==r?(o=pr,s=pr,u=t.substr(pr,6),u.toLowerCase()===M?pr+=6:(u=r,0===Lr&&yr(ue)),u===r&&(u=t.substr(pr,8),u.toLowerCase()===Z?pr+=8:(u=r,0===Lr&&yr(le))),u!==r?(l=cn(),l!==r?(u=[u,l],s=u):(pr=s,s=r)):(pr=s,s=r),s===r&&(s=null),u=Br(),u!==r?(l=an(),Cr=o,a=u,o=void(n._.action=a)):(pr=o,o=r),o!==r?(s=pr,u=pr,l=t.substr(pr,4),l.toLowerCase()===j?pr+=4:(l=r,0===Lr&&yr(Kt)),l!==r?(i=cn(),i!==r?(l=[l,i],u=l):(pr=u,u=r)):(pr=u,u=r),u===r&&(u=null),l=Dr(),l!==r?(i=an(),Cr=s,s=function(t,e){Object.assign(t._,{with:e})}(n,l)):(pr=s,s=r),s!==r?e=n:(pr=e,e=r)):(pr=e,e=r)):(pr=e,e=r);var a;return e}())))),n!==r&&(Cr=e,n=or(n)),e=n,e}function Tr(){let e,n,o,s,h,p,C,d,g,w,b,L;return e=pr,n=pr,o=t.substr(pr,6),o.toLowerCase()===u?pr+=6:(o=r,0===Lr&&yr(vt)),o!==r?(s=cn(),s!==r?(Cr=n,n=new SELECT):(pr=n,n=r)):(pr=n,n=r),n===r&&(n=pr,o=t.substr(pr,6),o.toLowerCase()===l?pr+=6:(o=r,0===Lr&&yr(yt)),o!==r?(s=cn(),s!==r?(Cr=n,n=function(){let t=new SELECT;return t._.stream=!0,t}()):(pr=n,n=r)):(pr=n,n=r)),n!==r?(o=pr,s=t.substr(pr,9),s.toLowerCase()===i?pr+=9:(s=r,0===Lr&&yr(St)),s!==r?(h=cn(),h!==r?(Cr=o,o=void(n._.localized=!0)):(pr=o,o=r)):(pr=o,o=r),o===r&&(o=null),s=pr,h=t.substr(pr,8),h.toLowerCase()===a?pr+=8:(h=r,0===Lr&&yr(_t)),h!==r?(p=cn(),p!==r?(Cr=s,s=function(t){t._.distinct=!0}(n)):(pr=s,s=r)):(pr=s,s=r),s===r&&(s=null),h=pr,p=t.substr(pr,6),p.toLowerCase()===l?pr+=6:(p=r,0===Lr&&yr(yt)),p!==r?(C=cn(),C!==r?(Cr=h,h=function(t){t._.stream=!0}(n)):(pr=h,h=r)):(pr=h,h=r),h===r&&(h=null),p=pr,C=t.substr(pr,3),C.toLowerCase()===c?pr+=3:(C=r,0===Lr&&yr(Tt)),C!==r?(d=cn(),d!==r?(Cr=p,p=function(t){t._.one=!0}(n)):(pr=p,p=r)):(pr=p,p=r),p===r&&(p=null),C=pr,d=Fr(),d!==r?(g=an(),Cr=C,C=function(t,e){t._.columns=e}(n,d)):(pr=C,C=r),C===r&&(C=null),d=pr,g=pr,w=t.substr(pr,4),w.toLowerCase()===f?pr+=4:(w=r,0===Lr&&yr($t)),w!==r?(b=cn(),b!==r?(w=[w,b],g=w):(pr=g,g=r)):(pr=g,g=r),g!==r?(w=Zr(),w===r&&(w=Xr()),w!==r?(Cr=d,d=function(t,e){t._.from=e}(n,w)):(pr=d,d=r)):(pr=d,d=r),d===r&&(d=null),g=pr,w=en(),w!==r?(b=Fr(),b!==r?(L=rn(),L!==r?(Cr=g,g=function(t,e){t._.columns=e}(n,b)):(pr=g,g=r)):(pr=g,g=r)):(pr=g,g=r),g===r&&(g=null),w=pr,b=$r(),b!==r&&(Cr=w,b=function(t,e){Object.assign(t._,e)}(n,b)),w=b,w===r&&(w=null),e=n):(pr=e,e=r),e}function $r(){let e,n,o,s,u,l,i,a,c,f,b,L;var A;return e=pr,n=pr,o=pr,Lr++,t.length>pr?(s=t.charAt(pr),pr++):(s=r,0===Lr&&yr(Rt)),Lr--,s!==r?(pr=o,o=void 0):o=r,o!==r&&(Cr=n,o={}),n=o,n!==r?(o=pr,s=pr,u=t.substr(pr,5),u.toLowerCase()===h?pr+=5:(u=r,0===Lr&&yr(Ft)),u!==r?(l=cn(),l!==r?(u=[u,l],s=u):(pr=s,s=r)):(pr=s,s=r),s!==r?(u=jr(),u!==r?(l=an(),Cr=o,A=u,o=void(n.where=A)):(pr=o,o=r)):(pr=o,o=r),o===r&&(o=null),s=pr,u=pr,l=t.substr(pr,8),l.toLowerCase()===p?pr+=8:(l=r,0===Lr&&yr(It)),l!==r?(i=cn(),i!==r?(a=Or(),a!==r?(c=an(),Cr=u,u=function(t,e){t.groupBy=e}(n,a)):(pr=u,u=r)):(pr=u,u=r)):(pr=u,u=r),u!==r?(l=pr,i=t.substr(pr,6),i.toLowerCase()===C?pr+=6:(i=r,0===Lr&&yr(jt)),i!==r?(a=cn(),a!==r?(c=jr(),c!==r?(f=an(),Cr=l,l=function(t,e){t.having=e}(n,c)):(pr=l,l=r)):(pr=l,l=r)):(pr=l,l=r),l===r&&(l=null),u=[u,l],s=u):(pr=s,s=r),s===r&&(s=null),u=pr,l=pr,i=t.substr(pr,8),i.toLowerCase()===d?pr+=8:(i=r,0===Lr&&yr(Ot)),i!==r?(a=cn(),a!==r?(i=[i,a],l=i):(pr=l,l=r)):(pr=l,l=r),l!==r?(i=Nr(),i!==r?(a=an(),Cr=u,u=function(t,e){t.orderBy=e}(n,i)):(pr=u,u=r)):(pr=u,u=r),u===r&&(u=null),l=pr,i=pr,a=t.substr(pr,5),a.toLowerCase()===g?pr+=5:(a=r,0===Lr&&yr(Nt)),a!==r?(c=cn(),c!==r?(f=Wr(),f===r&&(f=Yr()),f!==r?(b=an(),Cr=i,i=function(t,e){t.limit={rows:e}}(n,f)):(pr=i,i=r)):(pr=i,i=r)):(pr=i,i=r),i!==r?(a=pr,c=t.substr(pr,6),c.toLowerCase()===w?pr+=6:(c=r,0===Lr&&yr(Pt)),c!==r?(f=cn(),f!==r?(b=Wr(),b===r&&(b=Yr()),b!==r?(L=an(),Cr=a,a=function(t,e){t.limit.offset=e}(n,b)):(pr=a,a=r)):(pr=a,a=r)):(pr=a,a=r),a===r&&(a=null),i=[i,a],l=i):(pr=l,l=r),l===r&&(l=null),e=n):(pr=e,e=r),e}function Rr(){let e,n,o,s,u;return e=pr,n=pr,o=an(),n=t.substring(n,pr),o=t.substr(pr,2),o.toLowerCase()===b?pr+=2:(o=r,0===Lr&&yr(Ut)),o!==r?(s=cn(),s!==r?(u=Br(),u!==r?e=u:(pr=e,e=r)):(pr=e,e=r)):(pr=e,e=r),e}function Fr(){let e,n,o,s,u,l,i,a,c,f,h;for(e=pr,n=[],42===t.charCodeAt(pr)?(o=L,pr++):(o=r,0===Lr&&yr(Dt)),o===r&&(o=pr,s=Wr(),s!==r?(u=pr,l=Rr(),l!==r&&(Cr=u,l=sr(s,l)),u=l,u===r&&(u=null),l=ln(),l===r&&(l=null),i=pr,a=en(),a!==r?(c=Fr(),c!==r?(f=rn(),f!==r?(Cr=i,i=ur(s,l,c)):(pr=i,i=r)):(pr=i,i=r)):(pr=i,i=r),i!==r?o=s:(pr=o,o=r)):(pr=o,o=r),o===r&&(o=pr,s=qr(),s!==r?(u=pr,l=Rr(),l!==r&&(Cr=u,l=lr(s,l)),u=l,u===r&&(u=null),o=s):(pr=o,o=r)));o!==r;)n.push(o),o=pr,s=un(),s!==r?(42===t.charCodeAt(pr)?(s=L,pr++):(s=r,0===Lr&&yr(Dt)),s===r&&(s=pr,u=Wr(),u!==r?(l=pr,i=Rr(),i!==r&&(Cr=l,i=sr(u,i)),l=i,l===r&&(l=null),i=ln(),i===r&&(i=null),a=pr,c=en(),c!==r?(f=Fr(),f!==r?(h=rn(),h!==r?(Cr=a,a=ur(u,i,f)):(pr=a,a=r)):(pr=a,a=r)):(pr=a,a=r),a!==r?s=u:(pr=s,s=r)):(pr=s,s=r),s===r&&(s=pr,u=qr(),u!==r?(l=pr,i=Rr(),i!==r&&(Cr=l,i=lr(u,i)),l=i,l===r&&(l=null),s=u):(pr=s,s=r))),s===r?(pr=o,o=r):o=s):o=s;return n.length<1?(pr=e,e=r):e=n,e}function Ir(){let e,n,o,s,u,l,i,a;return e=pr,n=an(),91===t.charCodeAt(pr)?(o=A,pr++):(o=r,0===Lr&&yr(zt)),o!==r?(s=an(),u=function(){let t,e,n,o,s;t=pr,e=tn(),e!==r&&(Cr=t,u=e,e={where:fluent.where(u)});var u;if(t=e,t===r){for(t=pr,e=pr,n=[],o=Yr();o!==r;)n.push(o),o=pr,s=un(),s!==r?(s=Yr(),s===r?(pr=o,o=r):o=s):o=s;n.length<1?(pr=e,e=r):e=n,e!==r&&(Cr=t,e={where:e}),t=e,t===r&&(t=pr,e=Hr(),e!==r&&(Cr=t,e={where:e.xpr}),t=e,t===r&&(t=$r()))}return t}(),u!==r?(l=an(),93===t.charCodeAt(pr)?(i=m,pr++):(i=r,0===Lr&&yr(Bt)),i!==r?(a=an(),e=u):(pr=e,e=r)):(pr=e,e=r)):(pr=e,e=r),e}function jr(){let t,e;var n;return t=pr,e=tn(),e!==r&&(Cr=t,n=e,e=fluent.where(n)),t=e,t===r&&(t=pr,e=Hr(),e!==r&&(Cr=t,e=e.xpr),t=e),t}function Or(){let t,e,n,o,s;for(t=pr,e=pr,n=[],o=Wr();o!==r;)n.push(o),o=pr,s=un(),s!==r?(s=Wr(),s===r?(pr=o,o=r):o=s):o=s;return n.length<1?(pr=e,e=r):e=n,e!==r?t=e:(pr=t,t=r),t}function Nr(){let e,n,o,s,u,l,i,a,c;for(e=pr,n=pr,o=[],s=pr,u=Wr(),u!==r?(l=pr,i=cn(),i!==r?(a=t.substr(pr,3),a.toLowerCase()===E?pr+=3:(a=r,0===Lr&&yr(Mt)),a===r&&(a=t.substr(pr,4),a.toLowerCase()===x?pr+=4:(a=r,0===Lr&&yr(Zt))),a!==r?(Cr=l,l=ir(u,a)):(pr=l,l=r)):(pr=l,l=r),l===r&&(l=null),s=u):(pr=s,s=r);s!==r;)o.push(s),s=pr,u=un(),u!==r?(u=pr,l=Wr(),l!==r?(i=pr,a=cn(),a!==r?(c=t.substr(pr,3),c.toLowerCase()===E?pr+=3:(c=r,0===Lr&&yr(Mt)),c===r&&(c=t.substr(pr,4),c.toLowerCase()===x?pr+=4:(c=r,0===Lr&&yr(Zt))),c!==r?(Cr=i,i=ir(l,c)):(pr=i,i=r)):(pr=i,i=r),i===r&&(i=null),u=l):(pr=u,u=r),u===r?(pr=s,s=r):s=u):s=u;return o.length<1?(pr=n,n=r):n=o,n!==r?e=n:(pr=e,e=r),e}function Pr(){let t;return t=tn(),t===r&&(t=Dr()),t}function Ur(){let e,n,o,s,u,l,i,a,c,f,h;for(e=pr,n=pr,o="",Cr=n,o={},n=o,o=pr,s=[],u=pr,l=Mr(),l!==r?(i=an(),61===t.charCodeAt(pr)?(a=N,pr++):(a=r,0===Lr&&yr(te)),a!==r?(c=an(),f=Vr(),f===r&&(f=qr()),f!==r?(Cr=u,u=ar(n,l,f)):(pr=u,u=r)):(pr=u,u=r)):(pr=u,u=r);u!==r;)s.push(u),u=pr,l=un(),l!==r?(l=pr,i=Mr(),i!==r?(a=an(),61===t.charCodeAt(pr)?(c=N,pr++):(c=r,0===Lr&&yr(te)),c!==r?(f=an(),h=Vr(),h===r&&(h=qr()),h!==r?(Cr=l,l=ar(n,i,h)):(pr=l,l=r)):(pr=l,l=r)):(pr=l,l=r),l===r?(pr=u,u=r):u=l):u=l;return s.length<1?(pr=o,o=r):o=s,o!==r?(s=an(),e=n):(pr=e,e=r),e}function Dr(){let e,n,o,s,u,l,i,a,c,f,h;if(e=pr,n=pr,o=an(),123===t.charCodeAt(pr)?(s=P,pr++):(s=r,0===Lr&&yr(ee)),s!==r?(u=an(),Cr=n,n={}):(pr=n,n=r),n!==r){for(o=pr,s=[],u=pr,l=Mr(),l!==r?(i=an(),58===t.charCodeAt(pr)?(a=U,pr++):(a=r,0===Lr&&yr(re)),a!==r?(c=an(),f=Yr(),f===r&&(f=Dr(),f===r&&(f=zr())),f!==r?(Cr=u,u=cr(n,l,f)):(pr=u,u=r)):(pr=u,u=r)):(pr=u,u=r);u!==r;)s.push(u),u=pr,l=un(),l!==r?(l=pr,i=Mr(),i!==r?(a=an(),58===t.charCodeAt(pr)?(c=U,pr++):(c=r,0===Lr&&yr(re)),c!==r?(f=an(),h=Yr(),h===r&&(h=Dr(),h===r&&(h=zr())),h!==r?(Cr=l,l=cr(n,i,h)):(pr=l,l=r)):(pr=l,l=r)):(pr=l,l=r),l===r?(pr=u,u=r):u=l):u=l;s.length<1?(pr=o,o=r):o=s,o!==r?(s=an(),125===t.charCodeAt(pr)?(u=D,pr++):(u=r,0===Lr&&yr(ne)),u!==r?(l=an(),e=n):(pr=e,e=r)):(pr=e,e=r)}else pr=e,e=r;return e}function zr(){let e,n,o,s,u,l,i,a;if(e=pr,n=an(),91===t.charCodeAt(pr)?(o=A,pr++):(o=r,0===Lr&&yr(zt)),o!==r){for(s=an(),u=pr,l=[],i=Dr();i!==r;)l.push(i),i=pr,a=un(),a!==r?(a=Dr(),a===r?(pr=i,i=r):i=a):i=a;l.length<1?(pr=u,u=r):u=l,u!==r?(l=an(),93===t.charCodeAt(pr)?(i=m,pr++):(i=r,0===Lr&&yr(Bt)),i!==r?(a=an(),e=u):(pr=e,e=r)):(pr=e,e=r)}else pr=e,e=r;return e}function Br(){let e,n,o,s,u,l,i;if(Lr++,e=pr,n=pr,Lr++,o=t.substr(pr,4),o.toLowerCase()===f?pr+=4:(o=r,0===Lr&&yr($t)),o===r&&(o=t.substr(pr,8),o.toLowerCase()===p?pr+=8:(o=r,0===Lr&&yr(It)),o===r&&(o=t.substr(pr,8),o.toLowerCase()===d?pr+=8:(o=r,0===Lr&&yr(Ot)),o===r&&(o=t.substr(pr,5),o.toLowerCase()===g?pr+=5:(o=r,0===Lr&&yr(Nt)),o===r&&(o=t.substr(pr,6),o.toLowerCase()===w?pr+=6:(o=r,0===Lr&&yr(Pt)),o===r&&(o=t.substr(pr,2),o.toLowerCase()===b?pr+=2:(o=r,0===Lr&&yr(ae))))))),Lr--,o===r?n=void 0:(pr=n,n=r),n!==r){if(o=pr,s=pr,u=t.charAt(pr),wt.test(u)?pr++:(u=r,0===Lr&&yr(ce)),u!==r){for(l=[],i=t.charAt(pr),bt.test(i)?pr++:(i=r,0===Lr&&yr(fe));i!==r;)l.push(i),i=t.charAt(pr),bt.test(i)?pr++:(i=r,0===Lr&&yr(fe));u=[u,l],s=u}else pr=s,s=r;o=s!==r?t.substring(o,pr):s,o!==r?e=o:(pr=e,e=r)}else pr=e,e=r;return Lr--,e===r&&(n=r,0===Lr&&yr(ie)),e}function Mr(){let e,n,o,s,u,l;for(Lr++,e=pr,n=pr,o=pr,s=[],u=Br();u!==r;)s.push(u),u=pr,l=ln(),l!==r?(l=Br(),l===r?(pr=u,u=r):u=l):u=l;return s.length<1?(pr=o,o=r):o=s,n=o!==r?t.substring(n,pr):o,n!==r?e=n:(pr=e,e=r),Lr--,e===r&&(n=r,0===Lr&&yr(he)),e}function Zr(){let e,n,o,s,u,l,i;var a;if(Lr++,e=pr,n=tn(),n!==r&&(Cr=e,a=n,n=fluent.subject(a)),e=n,e===r){for(e=pr,n=pr,o=[],s=pr,u=Br(),u!==r?(l=ln(),l!==r?(u=[u,l],s=u):(pr=s,s=r)):(pr=s,s=r);s!==r;)o.push(s),s=pr,u=Br(),u!==r?(l=ln(),l!==r?(u=[u,l],s=u):(pr=s,s=r)):(pr=s,s=r);n=t.substring(n,pr),o=pr,s=Br(),s!==r?(u=an(),58===t.charCodeAt(pr)?(l=U,pr++):(l=r,0===Lr&&yr(re)),l!==r?(i=an(),o=s):(pr=o,o=r)):(pr=o,o=r),o===r&&(o=null),s=Wr(),s!==r?(u=an(),Cr=e,e=function(t,e,r){if(e)return{ref:[t+e,...r.ref]};if(t){let[e]=r.ref;e.id?e.id=t+e.id:r.ref[0]=t+e}return r}(n,o,s)):(pr=e,e=r)}return Lr--,e===r&&(n=r,0===Lr&&yr(pe)),e}function qr(){let t,e;var n;return t=pr,e=Hr(),e!==r&&(Cr=t,e=(n=e).xpr.length>1?n:n.xpr[0]),t=e,t}function Hr(){let t,e,n,o,s,u;if(t=pr,e=[],n=Xr(),n===r&&(n=kr(),n===r&&(n=Qr(),n===r&&(n=Yr(),n===r&&(n=Kr(),n===r&&(n=Gr(),n===r&&(n=Wr(),n===r&&(n=pr,o=nn(),o!==r?(s=qr(),s!==r?(u=on(),u!==r?n=s:(pr=n,n=r)):(pr=n,n=r)):(pr=n,n=r)))))))),n!==r)for(;n!==r;)e.push(n),n=Xr(),n===r&&(n=kr(),n===r&&(n=Qr(),n===r&&(n=Yr(),n===r&&(n=Kr(),n===r&&(n=Gr(),n===r&&(n=Wr(),n===r&&(n=pr,o=nn(),o!==r?(s=qr(),s!==r?(u=on(),u!==r?n=s:(pr=n,n=r)):(pr=n,n=r)):(pr=n,n=r))))))));else e=r;return e!==r&&(Cr=t,e={xpr:e}),t=e,t}function Wr(){let t,e,n,o,s,u,l;for(Lr++,t=pr,e=pr,n=[],o=pr,s=Br(),s!==r?(u=Ir(),u===r&&(u=null),Cr=o,o=fr(s,u)):(pr=o,o=r);o!==r;)n.push(o),o=pr,s=ln(),s!==r?(s=pr,u=Br(),u!==r?(l=Ir(),l===r&&(l=null),Cr=s,s=fr(u,l)):(pr=s,s=r),s===r?(pr=o,o=r):o=s):o=s;return n.length<1?(pr=e,e=r):e=n,e!==r&&(Cr=t,e={ref:e}),t=e,Lr--,t===r&&(e=r,0===Lr&&yr(Ce)),t}function Yr(){let e,n;return Lr++,e=Vr(),e===r&&(e=pr,n=function(){let e,n;Lr++,e=function(){let e,n,o,s,u,l;e=pr,39===t.charCodeAt(pr)?(n=ct,pr++):(n=r,0===Lr&&yr(We));if(n!==r){for(o=pr,s=[],u=t.charAt(pr),mt.test(u)?pr++:(u=r,0===Lr&&yr(Ye)),u===r&&(u=pr,t.substr(pr,2)===ft?(l=ft,pr+=2):(l=r,0===Lr&&yr(ke)),l!==r&&(Cr=u,l="'"),u=l);u!==r;)s.push(u),u=t.charAt(pr),mt.test(u)?pr++:(u=r,0===Lr&&yr(Ye)),u===r&&(u=pr,t.substr(pr,2)===ft?(l=ft,pr+=2):(l=r,0===Lr&&yr(ke)),l!==r&&(Cr=u,l=hr()),u=l);o=t.substring(o,pr),39===t.charCodeAt(pr)?(s=ct,pr++):(s=r,0===Lr&&yr(We)),s!==r?e=o:(pr=e,e=r)}else pr=e,e=r;return e}(),e===r&&(e=function(){let e,n,o,s,u,l,i,a,c,f;e=pr,n=pr,o=pr,45===t.charCodeAt(pr)?(s=lt,pr++):(s=r,0===Lr&&yr(Me));s===r&&(s=null);u=[],l=t.charAt(pr),At.test(l)?pr++:(l=r,0===Lr&&yr(Ze));if(l!==r)for(;l!==r;)u.push(l),l=t.charAt(pr),At.test(l)?pr++:(l=r,0===Lr&&yr(Ze));else u=r;if(u!==r){if(l=pr,46===t.charCodeAt(pr)?(i=it,pr++):(i=r,0===Lr&&yr(qe)),i!==r){if(a=[],c=t.charAt(pr),At.test(c)?pr++:(c=r,0===Lr&&yr(Ze)),c!==r)for(;c!==r;)a.push(c),c=t.charAt(pr),At.test(c)?pr++:(c=r,0===Lr&&yr(Ze));else a=r;a!==r?(i=[i,a],l=i):(pr=l,l=r)}else pr=l,l=r;if(l===r&&(l=null),i=pr,101===t.charCodeAt(pr)?(a=at,pr++):(a=r,0===Lr&&yr(He)),a!==r){if(c=[],f=t.charAt(pr),At.test(f)?pr++:(f=r,0===Lr&&yr(Ze)),f!==r)for(;f!==r;)c.push(f),f=t.charAt(pr),At.test(f)?pr++:(f=r,0===Lr&&yr(Ze));else c=r;c!==r?(a=[a,c],i=a):(pr=i,i=r)}else pr=i,i=r;i===r&&(i=null),s=[s,u,l,i],o=s}else pr=o,o=r;n=o!==r?t.substring(n,pr):o;n!==r&&(Cr=e,n=Number(n));return e=n,e}(),e===r&&(e=function(){let e,n,o,s;e=pr,t.substr(pr,4)===ht?(n=ht,pr+=4):(n=r,0===Lr&&yr(Qe));n!==r?(o=pr,Lr++,s=sn(),Lr--,s===r?o=void 0:(pr=o,o=r),o!==r?(Cr=e,e=!0):(pr=e,e=r)):(pr=e,e=r);return e}(),e===r&&(e=function(){let e,n,o,s;e=pr,t.substr(pr,5)===pt?(n=pt,pr+=5):(n=r,0===Lr&&yr(Ve));n!==r?(o=pr,Lr++,s=sn(),Lr--,s===r?o=void 0:(pr=o,o=r),o!==r?(Cr=e,e=!1):(pr=e,e=r)):(pr=e,e=r);return e}(),e===r&&(e=function(){let e,n,o,s;e=pr,t.substr(pr,4)===st?(n=st,pr+=4):(n=r,0===Lr&&yr(Ge));n!==r?(o=pr,Lr++,s=sn(),Lr--,s===r?o=void 0:(pr=o,o=r),o!==r?(Cr=e,e=null):(pr=e,e=r)):(pr=e,e=r);return e}()))));Lr--,e===r&&(n=r,0===Lr&&yr(Be));return e}(),n!==r&&(Cr=e,n={val:n}),e=n),Lr--,e===r&&(n=r,0===Lr&&yr(de)),e}function kr(){let t,e,n,o;return Lr++,t=Vr(),t===r&&(t=pr,e=nn(),e!==r?(n=pr,o=Jr(),o!==r&&(Cr=n,o={list:o}),n=o,n!==r?(o=on(),o!==r?t=n:(pr=t,t=r)):(pr=t,t=r)):(pr=t,t=r)),Lr--,t===r&&(e=r,0===Lr&&yr(ge)),t}function Gr(){let e,n,o,s,u,l,i;if(Lr++,e=pr,n=Br(),n!==r)if(o=nn(),o!==r){for(s=pr,u=[],42===t.charCodeAt(pr)?(l=L,pr++):(l=r,0===Lr&&yr(Dt)),l===r&&(l=qr());l!==r;)u.push(l),l=pr,i=un(),i!==r?(42===t.charCodeAt(pr)?(i=L,pr++):(i=r,0===Lr&&yr(Dt)),i===r&&(i=qr()),i===r?(pr=l,l=r):l=i):l=i;u.length<1?(pr=s,s=r):s=u,s!==r?(u=on(),u!==r?(Cr=e,e={func:n,args:s}):(pr=e,e=r)):(pr=e,e=r)}else pr=e,e=r;else pr=e,e=r;return Lr--,e===r&&(n=r,0===Lr&&yr(we)),e}function Qr(){let e,n,o;return Lr++,e=pr,35===t.charCodeAt(pr)?(n=q,pr++):(n=r,0===Lr&&yr(Le)),n!==r?(o=Br(),o!==r?(Cr=e,e={"#":o}):(pr=e,e=r)):(pr=e,e=r),Lr--,e===r&&(n=r,0===Lr&&yr(be)),e}function Vr(){let e,n,o,s;return Lr++,e=pr,n=an(),63===t.charCodeAt(pr)?(o=H,pr++):(o=r,0===Lr&&yr(me)),o!==r?(s=an(),Cr=e,e=Cn()):(pr=e,e=r),Lr--,e===r&&(n=r,0===Lr&&yr(Ae)),e}function Jr(){let t,e,n,o;for(Lr++,t=pr,e=[],n=Qr(),n===r&&(n=Yr(),n===r&&(n=Wr(),n===r&&(n=Gr())));n!==r;)e.push(n),n=pr,o=un(),o!==r?(o=Qr(),o===r&&(o=Yr(),o===r&&(o=Wr(),o===r&&(o=Gr()))),o===r?(pr=n,n=r):n=o):n=o;return e.length<2?(pr=t,t=r):t=e,Lr--,t===r&&(e=r,0===Lr&&yr(de)),t}function Kr(){let e,n,o,s,u;if(Lr++,e=pr,n=an(),o=function(){let e,n,o,s,u,l,i,a;e=pr,n=t.substr(pr,3),n.toLowerCase()===W?pr+=3:(n=r,0===Lr&&yr(ve));n===r&&(n=t.substr(pr,2),n.toLowerCase()===Y?pr+=2:(n=r,0===Lr&&yr(ye)),n===r&&(n=t.substr(pr,2),n.toLowerCase()===k?pr+=2:(n=r,0===Lr&&yr(Se)),n===r&&(n=t.substr(pr,7),n.toLowerCase()===G?pr+=7:(n=r,0===Lr&&yr(_e)),n===r&&(n=t.substr(pr,4),n.toLowerCase()===Q?pr+=4:(n=r,0===Lr&&yr(Te)),n===r&&(n=t.substr(pr,6),n.toLowerCase()===V?pr+=6:(n=r,0===Lr&&yr($e)),n===r&&(n=t.substr(pr,8),n.toLowerCase()===J?pr+=8:(n=r,0===Lr&&yr(Re))))))));n!==r?(o=pr,Lr++,s=sn(),Lr--,s===r?o=void 0:(pr=o,o=r),o!==r?e=n:(pr=e,e=r)):(pr=e,e=r);if(e===r&&(e=pr,n=t.substr(pr,4),n.toLowerCase()===K?pr+=4:(n=r,0===Lr&&yr(Fe)),n===r&&(n=t.substr(pr,4),n.toLowerCase()===X?pr+=4:(n=r,0===Lr&&yr(Ie)),n===r&&(n=t.substr(pr,4),n.toLowerCase()===tt?pr+=4:(n=r,0===Lr&&yr(je)),n===r&&(n=t.substr(pr,4),n.toLowerCase()===et?pr+=4:(n=r,0===Lr&&yr(Oe)),n===r&&(n=t.substr(pr,3),n.toLowerCase()===rt?pr+=3:(n=r,0===Lr&&yr(Ne)))))),n!==r?(o=pr,Lr++,s=sn(),Lr--,s===r?o=void 0:(pr=o,o=r),o!==r?e=n:(pr=e,e=r)):(pr=e,e=r),e===r)){for(e=pr,n=pr,o=[],s=pr,u=t.substr(pr,2),u.toLowerCase()===nt?pr+=2:(u=r,0===Lr&&yr(Pe)),u===r&&(u=t.substr(pr,3),u.toLowerCase()===ot?pr+=3:(u=r,0===Lr&&yr(Ue)),u===r&&(u=t.substr(pr,4),u.toLowerCase()===st?pr+=4:(u=r,0===Lr&&yr(De)),u===r&&(u=t.substr(pr,5),u.toLowerCase()===ut?pr+=5:(u=r,0===Lr&&yr(ze))))),u!==r?(l=pr,Lr++,i=sn(),Lr--,i===r?l=void 0:(pr=l,l=r),l!==r?(u=[u,l],s=u):(pr=s,s=r)):(pr=s,s=r);s!==r;)o.push(s),s=pr,u=an(),u=pr,l=t.substr(pr,2),l.toLowerCase()===nt?pr+=2:(l=r,0===Lr&&yr(Pe)),l===r&&(l=t.substr(pr,3),l.toLowerCase()===ot?pr+=3:(l=r,0===Lr&&yr(Ue)),l===r&&(l=t.substr(pr,4),l.toLowerCase()===st?pr+=4:(l=r,0===Lr&&yr(De)),l===r&&(l=t.substr(pr,5),l.toLowerCase()===ut?pr+=5:(l=r,0===Lr&&yr(ze))))),l!==r?(i=pr,Lr++,a=sn(),Lr--,a===r?i=void 0:(pr=i,i=r),i!==r?(l=[l,i],u=l):(pr=u,u=r)):(pr=u,u=r),u===r?(pr=s,s=r):s=u;o.length<1?(pr=n,n=r):n=o,e=n!==r?t.substring(e,pr):n}return e}(),o===r){if(o=pr,s=[],u=t.charAt(pr),Lt.test(u)?pr++:(u=r,0===Lr&&yr(xe)),u!==r)for(;u!==r;)s.push(u),u=t.charAt(pr),Lt.test(u)?pr++:(u=r,0===Lr&&yr(xe));else s=r;o=s!==r?t.substring(o,pr):s}return o!==r?(s=an(),e=o):(pr=e,e=r),Lr--,e===r&&(n=r,0===Lr&&yr(Ee)),e}function Xr(){let t,e,n,o;return t=pr,e=nn(),e!==r?(n=Tr(),n!==r?(o=on(),o!==r?t=n:(pr=t,t=r)):(pr=t,t=r)):(pr=t,t=r),t}function tn(){let e,n,o,s;return e=pr,n=an(),63===t.charCodeAt(pr)?(o=H,pr++):(o=r,0===Lr&&yr(me)),o!==r?(s=an(),Cr=e,e=hn.shift()):(pr=e,e=r),e}function en(){let e,n,o,s;return e=pr,n=an(),123===t.charCodeAt(pr)?(o=P,pr++):(o=r,0===Lr&&yr(ee)),o!==r?(s=an(),n=[n,o,s],e=n):(pr=e,e=r),e}function rn(){let e,n,o,s;return e=pr,n=an(),125===t.charCodeAt(pr)?(o=D,pr++):(o=r,0===Lr&&yr(ne)),o!==r?(s=an(),n=[n,o,s],e=n):(pr=e,e=r),e}function nn(){let e,n,o,s;return e=pr,n=an(),40===t.charCodeAt(pr)?(o=Ct,pr++):(o=r,0===Lr&&yr(Je)),o!==r?(s=an(),n=[n,o,s],e=n):(pr=e,e=r),e}function on(){let e,n,o,s;return e=pr,n=an(),41===t.charCodeAt(pr)?(o=dt,pr++):(o=r,0===Lr&&yr(Ke)),o!==r?(s=an(),n=[n,o,s],e=n):(pr=e,e=r),e}function sn(){let e;return e=t.charAt(pr),Et.test(e)?pr++:(e=r,0===Lr&&yr(Xe)),e}function un(){let e,n,o,s;return Lr++,e=pr,n=an(),44===t.charCodeAt(pr)?(o=gt,pr++):(o=r,0===Lr&&yr(er)),o!==r?(s=an(),e=o):(pr=e,e=r),Lr--,e===r&&(n=r,0===Lr&&yr(tr)),e}function ln(){let e,n,o,s;return Lr++,e=pr,n=an(),46===t.charCodeAt(pr)?(o=it,pr++):(o=r,0===Lr&&yr(qe)),o!==r?(s=an(),Cr=e,e="."):(pr=e,e=r),Lr--,e===r&&(n=r,0===Lr&&yr(rr)),e}function an(){let e,n,o;for(Lr++,e=pr,n=[],o=t.charAt(pr),xt.test(o)?pr++:(o=r,0===Lr&&yr(nr));o!==r;)n.push(o),o=t.charAt(pr),xt.test(o)?pr++:(o=r,0===Lr&&yr(nr));return e=t.substring(e,pr),Lr--,e}function cn(){let e,n,o;if(Lr++,e=pr,n=[],o=t.charAt(pr),xt.test(o)?pr++:(o=r,0===Lr&&yr(nr)),o!==r)for(;o!==r;)n.push(o),o=t.charAt(pr),xt.test(o)?pr++:(o=r,0===Lr&&yr(nr));else n=r;return e=n!==r?t.substring(e,pr):n,Lr--,e===r&&(n=r,0===Lr&&yr(rr)),e}const fn=[],hn=e.args;let pn=0;const Cn=!hn?.length||!e.startRule&&peg$parse.late_binding?()=>fn[pn++]=dn:()=>fn[pn]=fluent.expr(hn[pn++]),dn={ref:["?"],param:!0};gr=s();const gn=gr!==r&&pr===t.length;function wn(){throw gr!==r&&pr<t.length&&yr({type:"end"}),Sr(br,wr<t.length?function(e=pr){const r=t.codePointAt(e);return void 0===r?"":String.fromCodePoint(r)}(wr):null,wr<t.length?vr(wr,wr+1):vr(wr,wr))}return e.peg$library?{peg$result:gr,peg$currPos:pr,peg$FAILED:r,peg$maxFailExpected:br,peg$maxFailPos:wr,peg$success:gn,peg$throw:gn?void 0:wn}:gn?gr:void wn()}const peg$allowedStartRules=["CQL","subject","columns","values","ref","val","expr","set","with","where","groupBy","orderBy"];export{peg$allowedStartRules as StartRules,peg$SyntaxError as SyntaxError,peg$parse as parse};
1
+ import*as fluent from"../lib/xl/fluent.js";import{SELECT}from"../lib/ql/select.js";import{INSERT}from"../lib/ql/insert.js";import{UPSERT}from"../lib/ql/insert.js";import{UPDATE}from"../lib/ql/update.js";import{DELETE}from"../lib/ql/delete.js";import{CALL}from"../lib/ql/call-action.js";class peg$SyntaxError extends SyntaxError{constructor(t,e,r,n){super(t),this.expected=e,this.found=r,this.location=n,this.name="SyntaxError"}format(t){let e="Error: "+this.message;if(this.location){let r=null;const n=t.find(t=>t.source===this.location.source);n&&(r=n.text.split(/\r\n|\n|\r/g));const o=this.location.start,s=this.location.source&&"function"==typeof this.location.source.offset?this.location.source.offset(o):o,u=this.location.source+":"+s.line+":"+s.column;if(r){const t=this.location.end,n="".padEnd(s.line.toString().length," "),l=r[o.line-1],i=(o.line===t.line?t.column:l.length+1)-o.column||1;e+="\n --\x3e "+u+"\n"+n+" |\n"+s.line+" | "+l+"\n"+n+" | "+"".padEnd(o.column-1," ")+"".padEnd(i,"^")}else e+="\n at "+u}return e}static buildMessage(t,e){function r(t){return t.codePointAt(0).toString(16).toUpperCase()}const n=Object.prototype.hasOwnProperty.call(RegExp.prototype,"unicode")?new RegExp("[\\p{C}\\p{Mn}\\p{Mc}]","gu"):null;function o(t){return n?t.replace(n,t=>"\\u{"+r(t)+"}"):t}function s(t){return o(t.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,t=>"\\x0"+r(t)).replace(/[\x10-\x1F\x7F-\x9F]/g,t=>"\\x"+r(t)))}function u(t){return o(t.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,t=>"\\x0"+r(t)).replace(/[\x10-\x1F\x7F-\x9F]/g,t=>"\\x"+r(t)))}const l={literal:t=>'"'+s(t.text)+'"',class(t){const e=t.parts.map(t=>Array.isArray(t)?u(t[0])+"-"+u(t[1]):u(t));return"["+(t.inverted?"^":"")+e.join("")+"]"+(t.unicode?"u":"")},any:()=>"any character",end:()=>"end of input",other:t=>t.description};function i(t){return l[t.type](t)}return"Expected "+function(t){const e=t.map(i);if(e.sort(),e.length>0){let t=1;for(let r=1;r<e.length;r++)e[r-1]!==e[r]&&(e[t]=e[r],t++);e.length=t}switch(e.length){case 1:return e[0];case 2:return e[0]+" or "+e[1];default:return e.slice(0,-1).join(", ")+", or "+e[e.length-1]}}(t)+" but "+function(t){return t?'"'+s(t)+'"':"end of input"}(e)+" found."}}function peg$parse(t,e){const r={},n=(e=void 0!==e?e:{}).grammarSource,o={CQL:Or,subject:Qr,columns:Dr,values:on,ref:Kr,val:Xr,expr:Vr,set:Hr,with:qr,where:Br,groupBy:Mr,orderBy:Zr};let s=Or;const u="select",l="stream",i="localized",a="distinct",c="one",f="from",h="where",p="group by",d="having",C="order by",g="limit",b="offset",w="as",L="*",A="[",m="]",E="asc",x="desc",v="insert",y="upsert",S="into",_="entries",T="columns",$="rows",R="values",F="update",I="entity",j="with",O="set",N="=",P="{",U=":",D="}",z="delete",B="call",M="action",Z="function",q="#",H="?",W="and",Y="or",k="in",G="between",Q="like",V="exists",J="contains",K="case",X="when",tt="then",et="else",rt="end",nt="is",ot="not",st="null",ut="empty",lt="-",it=".",at="e",ct="'",ft="''",ht="true",pt="false",dt="$user",Ct="(",gt=")",bt=",",wt=/^[A-Za-z_$]/,Lt=/^[A-Za-z0-9_$]/,At=/^[!=><+\-*\/%&|\^~]/,mt=/^[0-9]/,Et=/^[^']/,xt=/^[A-Za-z_$0-9]/,vt=/^[ \t\n\r]/,yt=_r("SELECT",!0),St=_r("STREAM",!0),_t=_r("LOCALIZED",!0),Tt=_r("DISTINCT",!0),$t=_r("ONE",!0),Rt=_r("FROM",!0),Ft={type:"any"},It=_r("WHERE",!0),jt=_r("GROUP BY",!0),Ot=_r("HAVING",!0),Nt=_r("ORDER BY",!0),Pt=_r("LIMIT",!0),Ut=_r("OFFSET",!0),Dt=_r("as",!0),zt=_r("*",!1),Bt=_r("[",!1),Mt=_r("]",!1),Zt=_r("asc",!0),qt=_r("desc",!0),Ht=_r("INSERT",!0),Wt=_r("UPSERT",!0),Yt=_r("INTO",!0),kt=_r("ENTRIES",!0),Gt=_r("COLUMNS",!0),Qt=_r("ROWS",!0),Vt=_r("VALUES",!0),Jt=_r("UPDATE",!0),Kt=_r("ENTITY",!0),Xt=_r("WITH",!0),te=_r("SET",!0),ee=_r("=",!1),re=_r("{",!1),ne=_r(":",!1),oe=_r("}",!1),se=_r("DELETE",!0),ue=_r("CALL",!0),le=_r("ACTION",!0),ie=_r("FUNCTION",!0),ae=_r("from",!0),ce=_r("where",!0),fe=_r("group by",!0),he=_r("order by",!0),pe=_r("limit",!0),de=_r("offset",!0),Ce=$r("a name"),ge=_r("AS",!0),be=Tr([["A","Z"],["a","z"],"_","$"],!1,!1,!1),we=Tr([["A","Z"],["a","z"],["0","9"],"_","$"],!1,!1,!1),Le=$r("an element ref"),Ae=$r("an entity ref"),me=$r("a reference"),Ee=$r("a value"),xe=$r("a list"),ve=$r("a function"),ye=$r("a symbol"),Se=_r("#",!1),_e=$r("a parameter"),Te=_r("?",!1),$e=$r("an operator"),Re=Tr(["!","=",">","<","+","-","*","/","%","&","|","^","~"],!1,!1,!1),Fe=_r("and",!0),Ie=_r("or",!0),je=_r("in",!0),Oe=_r("between",!0),Ne=_r("like",!0),Pe=_r("exists",!0),Ue=_r("contains",!0),De=_r("case",!0),ze=_r("when",!0),Be=_r("then",!0),Me=_r("else",!0),Ze=_r("end",!0),qe=_r("is",!0),He=_r("not",!0),We=_r("null",!0),Ye=_r("empty",!0),ke=$r("a literal"),Ge=_r("-",!1),Qe=Tr([["0","9"]],!1,!1,!1),Ve=_r(".",!1),Je=_r("e",!1),Ke=_r("'",!1),Xe=Tr(["'"],!0,!1,!1),tr=_r("''",!1),er=_r("null",!1),rr=_r("true",!1),nr=_r("false",!1),or=_r("$user",!1),sr=_r("(",!1),ur=_r(")",!1),lr=Tr([["A","Z"],["a","z"],"_","$",["0","9"]],!1,!1,!1),ir=$r("a comma"),ar=_r(",",!1),cr=$r(""),fr=Tr([" ","\t","\n","\r"],!1,!1,!1);function hr(t,e){t.as=e}function pr(t,e,r){e?t.inline=r:t.expand=r}function dr(t,e){t.as=e}function Cr(t,e){t.sort=e.toLowerCase()}function gr(t,e,r){t[e]=r}function br(t,e,r){t[e]="val"in r?r.val:r}function wr(t,e){return e?{id:t,...e}:t}let Lr=0|e.peg$currPos,Ar=Lr;const mr=[{line:1,column:1}];let Er,xr=Lr,vr=e.peg$maxFailExpected||[],yr=0|e.peg$silentFails;if(e.startRule){if(!(e.startRule in o))throw new Error("Can't start parsing from rule \""+e.startRule+'".');s=o[e.startRule]}function Sr(){return t.substring(Ar,Lr)}function _r(t,e){return{type:"literal",text:t,ignoreCase:e}}function Tr(t,e,r,n){return{type:"class",parts:t,inverted:e,ignoreCase:r,unicode:n}}function $r(t){return{type:"other",description:t}}function Rr(e){let r,n=mr[e];if(n)return n;if(e>=mr.length)r=mr.length-1;else for(r=e;!mr[--r];);for(n=mr[r],n={line:n.line,column:n.column};r<e;)10===t.charCodeAt(r)?(n.line++,n.column=1):n.column++,r++;return mr[e]=n,n}function Fr(t,e,r){const o=Rr(t),s=Rr(e),u={source:n,start:{offset:t,line:o.line,column:o.column},end:{offset:e,line:s.line,column:s.column}};return r&&n&&"function"==typeof n.offset&&(u.start=n.offset(u.start),u.end=n.offset(u.end)),u}function Ir(t){Lr<xr||(Lr>xr&&(xr=Lr,vr=[]),vr.push(t))}function jr(t,e,r){return new peg$SyntaxError(peg$SyntaxError.buildMessage(t,e),t,e,r)}function Or(){let e,n;var o;return e=Lr,n=Nr(),n===r&&(n=function(){let e,n,o,s,u,l,i,a,c,h,p,d,C,g;e=Lr,n=Lr,o=t.substr(Lr,6),o.toLowerCase()===v?Lr+=6:(o=r,0===yr&&Ir(Ht));o!==r?(s=bn(),s!==r?(Ar=n,n=new INSERT):(Lr=n,n=r)):(Lr=n,n=r);n===r&&(n=Lr,o=t.substr(Lr,6),o.toLowerCase()===y?Lr+=6:(o=r,0===yr&&Ir(Wt)),o!==r?(s=bn(),s!==r?(Ar=n,n=new UPSERT):(Lr=n,n=r)):(Lr=n,n=r));if(n!==r)if(o=Lr,s=ln(),s!==r&&(Ar=o,b=s,s=void(n._.entries=Array.isArray(b)?b:[b])),o=s,o===r&&(o=null),s=Lr,u=Lr,l=t.substr(Lr,4),l.toLowerCase()===S?Lr+=4:(l=r,0===yr&&Ir(Yt)),l!==r?(i=bn(),i!==r?(l=[l,i],u=l):(Lr=u,u=r)):(Lr=u,u=r),u!==r?(l=Qr(),l!==r?(Ar=s,s=function(t,e){t._.into=e}(n,l)):(Lr=s,s=r)):(Lr=s,s=r),s!==r){if(u=Lr,l=t.substr(Lr,4),l.toLowerCase()===f?Lr+=4:(l=r,0===yr&&Ir(Rt)),l!==r?(i=bn(),i!==r?(a=ln(),a!==r?(Ar=u,u=function(t,e){t._.from=e}(n,a)):(Lr=u,u=r)):(Lr=u,u=r)):(Lr=u,u=r),u===r&&(u=Lr,l=Nr(),l!==r&&(Ar=u,l=function(t,e){t._.from=e}(n,l)),u=l),u===r){if(u=Lr,l=Lr,i=Lr,a=t.substr(Lr,7),a.toLowerCase()===_?Lr+=7:(a=r,0===yr&&Ir(kt)),a!==r?(c=bn(),c!==r?(a=[a,c],i=a):(Lr=i,i=r)):(Lr=i,i=r),i===r&&(i=null),a=Lr,c=ln(),c===r){for(c=Lr,h=[],p=Wr();p!==r;)h.push(p),p=Lr,d=dn(),d!==r?(d=Wr(),d===r?(Lr=p,p=r):p=d):p=d;h.length<1?(Lr=c,c=r):c=h}if(c!==r&&(Ar=a,c=function(t,e){t._tail(e)}(n,c)),a=c,a!==r?(i=[i,a],l=i):(Lr=l,l=r),l===r&&(l=null),i=Lr,a=Lr,c=t.substr(Lr,7),c.toLowerCase()===T?Lr+=7:(c=r,0===yr&&Ir(Gt)),c!==r?(h=bn(),h!==r?(c=[c,h],a=c):(Lr=a,a=r)):(Lr=a,a=r),a===r&&(a=null),c=ln(),c===r)if(c=Lr,h=fn(),h!==r){for(p=Lr,d=[],C=Gr();C!==r;)d.push(C),C=Lr,g=dn(),g!==r?(g=Gr(),g===r?(Lr=C,C=r):C=g):C=g;d.length<1?(Lr=p,p=r):p=d,p!==r?(d=hn(),d!==r?c=p:(Lr=c,c=r)):(Lr=c,c=r)}else Lr=c,c=r;c!==r?(Ar=i,i=function(t,e){t._.columns=e}(n,c)):(Lr=i,i=r),i===r&&(i=null),a=Lr,c=Lr,h=t.substr(Lr,4),h.toLowerCase()===$?Lr+=4:(h=r,0===yr&&Ir(Qt)),h!==r?(p=bn(),p!==r?(h=[h,p],c=h):(Lr=c,c=r)):(Lr=c,c=r),c===r&&(c=null),h=ln(),h!==r?(Ar=a,a=function(t,e){t._.rows=e}(n,h)):(Lr=a,a=r),a===r&&(a=null),c=Lr,h=Lr,p=t.substr(Lr,6),p.toLowerCase()===R?Lr+=6:(p=r,0===yr&&Ir(Vt)),p!==r?(d=bn(),d!==r?(p=[p,d],h=p):(Lr=h,h=r)):(Lr=h,h=r),h!==r?(p=tn(),p!==r?(Ar=c,c=function(t,e){t._.values=e.list}(n,p)):(Lr=c,c=r)):(Lr=c,c=r),c===r&&(c=null),l=[l,i,a,c],u=l}u!==r?e=n:(Lr=e,e=r)}else Lr=e,e=r;else Lr=e,e=r;var b;return e}(),n===r&&(n=function(){let e,n,o,s,u,l,i,a,c;e=Lr,n=Lr,o=t.substr(Lr,6),o.toLowerCase()===F?Lr+=6:(o=r,0===yr&&Ir(Jt));o!==r?(s=bn(),s!==r?(Ar=n,n=new UPDATE):(Lr=n,n=r)):(Lr=n,n=r);n!==r?(o=Lr,s=Lr,u=t.substr(Lr,6),u.toLowerCase()===I?Lr+=6:(u=r,0===yr&&Ir(Kt)),u!==r?(l=bn(),l!==r?(u=[u,l],s=u):(Lr=s,s=r)):(Lr=s,s=r),s===r&&(s=null),u=Qr(),u!==r?(Ar=o,f=u,o=void(n._.entity=f)):(Lr=o,o=r),o!==r?(s=Lr,u=Lr,l=t.substr(Lr,4),l.toLowerCase()===j?Lr+=4:(l=r,0===yr&&Ir(Xt)),l!==r?(i=bn(),i!==r?(l=[l,i],u=l):(Lr=u,u=r)):(Lr=u,u=r),u!==r?(l=qr(),l!==r?(Ar=s,s=function(t,e){t._.data=e}(n,l)):(Lr=s,s=r)):(Lr=s,s=r),s===r&&(s=null),u=Lr,l=Lr,i=t.substr(Lr,3),i.toLowerCase()===O?Lr+=3:(i=r,0===yr&&Ir(te)),i!==r?(a=bn(),a!==r?(i=[i,a],l=i):(Lr=l,l=r)):(Lr=l,l=r),l!==r?(i=Hr(),i!==r?(Ar=u,u=function(t,e){t._.with=e}(n,i)):(Lr=u,u=r)):(Lr=u,u=r),u===r&&(u=null),l=Lr,i=Lr,a=t.substr(Lr,5),a.toLowerCase()===h?Lr+=5:(a=r,0===yr&&Ir(It)),a!==r?(c=bn(),c!==r?(a=[a,c],i=a):(Lr=i,i=r)):(Lr=i,i=r),i!==r?(a=Br(),a!==r?(c=gn(),Ar=l,l=function(t,e){t._.where=e}(n,a)):(Lr=l,l=r)):(Lr=l,l=r),l===r&&(l=null),e=n):(Lr=e,e=r)):(Lr=e,e=r);var f;return e}(),n===r&&(n=function(){let e,n,o,s,u,l,i;e=Lr,n=Lr,o=t.substr(Lr,6),o.toLowerCase()===z?Lr+=6:(o=r,0===yr&&Ir(se));o!==r?(s=bn(),s!==r?(Ar=n,n=new DELETE):(Lr=n,n=r)):(Lr=n,n=r);n!==r?(o=Lr,s=Lr,u=t.substr(Lr,4),u.toLowerCase()===f?Lr+=4:(u=r,0===yr&&Ir(Rt)),u!==r?(l=bn(),l!==r?(u=[u,l],s=u):(Lr=s,s=r)):(Lr=s,s=r),s===r&&(s=null),u=Qr(),u!==r?(l=gn(),Ar=o,a=u,o=void(n._.from=a)):(Lr=o,o=r),o!==r?(s=Lr,u=Lr,l=t.substr(Lr,5),l.toLowerCase()===h?Lr+=5:(l=r,0===yr&&Ir(It)),l!==r?(i=bn(),i!==r?(l=[l,i],u=l):(Lr=u,u=r)):(Lr=u,u=r),u!==r?(l=Br(),l!==r?(i=gn(),Ar=s,s=function(t,e){t._.where=e}(n,l)):(Lr=s,s=r)):(Lr=s,s=r),s===r&&(s=null),e=n):(Lr=e,e=r)):(Lr=e,e=r);var a;return e}(),n===r&&(n=function(){let e,n,o,s,u,l,i;e=Lr,n=Lr,o=t.substr(Lr,4),o.toLowerCase()===B?Lr+=4:(o=r,0===yr&&Ir(ue));o!==r?(s=bn(),s!==r?(Ar=n,n=new CALL):(Lr=n,n=r)):(Lr=n,n=r);n!==r?(o=Lr,s=Lr,u=t.substr(Lr,6),u.toLowerCase()===M?Lr+=6:(u=r,0===yr&&Ir(le)),u===r&&(u=t.substr(Lr,8),u.toLowerCase()===Z?Lr+=8:(u=r,0===yr&&Ir(ie))),u!==r?(l=bn(),l!==r?(u=[u,l],s=u):(Lr=s,s=r)):(Lr=s,s=r),s===r&&(s=null),u=kr(),u!==r?(l=gn(),Ar=o,a=u,o=void(n._.action=a)):(Lr=o,o=r),o!==r?(s=Lr,u=Lr,l=t.substr(Lr,4),l.toLowerCase()===j?Lr+=4:(l=r,0===yr&&Ir(Xt)),l!==r?(i=bn(),i!==r?(l=[l,i],u=l):(Lr=u,u=r)):(Lr=u,u=r),u===r&&(u=null),l=Wr(),l!==r?(i=gn(),Ar=s,s=function(t,e){Object.assign(t._,{with:e})}(n,l)):(Lr=s,s=r),s!==r?e=n:(Lr=e,e=r)):(Lr=e,e=r)):(Lr=e,e=r);var a;return e}())))),n!==r&&(Ar=e,o=n,wn?.length&&(o.params=wn),Ln?.length&&(o.args=Ln),o.source=Sr(),n=o),e=n,e}function Nr(){let e,n,o,s,h,p,d,C,g,b,w,L;return e=Lr,n=Lr,o=t.substr(Lr,6),o.toLowerCase()===u?Lr+=6:(o=r,0===yr&&Ir(yt)),o!==r?(s=bn(),s!==r?(Ar=n,n=new SELECT):(Lr=n,n=r)):(Lr=n,n=r),n===r&&(n=Lr,o=t.substr(Lr,6),o.toLowerCase()===l?Lr+=6:(o=r,0===yr&&Ir(St)),o!==r?(s=bn(),s!==r?(Ar=n,n=function(){let t=new SELECT;return t._.stream=!0,t}()):(Lr=n,n=r)):(Lr=n,n=r)),n!==r?(o=Lr,s=t.substr(Lr,9),s.toLowerCase()===i?Lr+=9:(s=r,0===yr&&Ir(_t)),s!==r?(h=bn(),h!==r?(Ar=o,o=void(n._.localized=!0)):(Lr=o,o=r)):(Lr=o,o=r),o===r&&(o=null),s=Lr,h=t.substr(Lr,8),h.toLowerCase()===a?Lr+=8:(h=r,0===yr&&Ir(Tt)),h!==r?(p=bn(),p!==r?(Ar=s,s=function(t){t._.distinct=!0}(n)):(Lr=s,s=r)):(Lr=s,s=r),s===r&&(s=null),h=Lr,p=t.substr(Lr,6),p.toLowerCase()===l?Lr+=6:(p=r,0===yr&&Ir(St)),p!==r?(d=bn(),d!==r?(Ar=h,h=function(t){t._.stream=!0}(n)):(Lr=h,h=r)):(Lr=h,h=r),h===r&&(h=null),p=Lr,d=t.substr(Lr,3),d.toLowerCase()===c?Lr+=3:(d=r,0===yr&&Ir($t)),d!==r?(C=bn(),C!==r?(Ar=p,p=function(t){t._.one=!0}(n)):(Lr=p,p=r)):(Lr=p,p=r),p===r&&(p=null),d=Lr,C=Dr(),C!==r?(g=gn(),Ar=d,d=function(t,e){t._.columns=e}(n,C)):(Lr=d,d=r),d===r&&(d=null),C=Lr,g=Lr,b=t.substr(Lr,4),b.toLowerCase()===f?Lr+=4:(b=r,0===yr&&Ir(Rt)),b!==r?(w=bn(),w!==r?(b=[b,w],g=b):(Lr=g,g=r)):(Lr=g,g=r),g!==r?(b=Qr(),b===r&&(b=un()),b!==r?(Ar=C,C=function(t,e){t._.from=e}(n,b)):(Lr=C,C=r)):(Lr=C,C=r),C===r&&(C=null),g=Lr,b=an(),b!==r?(w=Dr(),w!==r?(L=cn(),L!==r?(Ar=g,g=function(t,e){t._.columns=e}(n,w)):(Lr=g,g=r)):(Lr=g,g=r)):(Lr=g,g=r),g===r&&(g=null),b=Lr,w=Pr(),w!==r&&(Ar=b,w=function(t,e){Object.assign(t._,e)}(n,w)),b=w,b===r&&(b=null),e=n):(Lr=e,e=r),e}function Pr(){let e,n,o,s,u,l,i,a,c,f,w,L;var A;return e=Lr,n=Lr,o=Lr,yr++,t.length>Lr?(s=t.charAt(Lr),Lr++):(s=r,0===yr&&Ir(Ft)),yr--,s!==r?(Lr=o,o=void 0):o=r,o!==r&&(Ar=n,o={}),n=o,n!==r?(o=Lr,s=Lr,u=t.substr(Lr,5),u.toLowerCase()===h?Lr+=5:(u=r,0===yr&&Ir(It)),u!==r?(l=bn(),l!==r?(u=[u,l],s=u):(Lr=s,s=r)):(Lr=s,s=r),s!==r?(u=Br(),u!==r?(l=gn(),Ar=o,A=u,o=void(n.where=A)):(Lr=o,o=r)):(Lr=o,o=r),o===r&&(o=null),s=Lr,u=Lr,l=t.substr(Lr,8),l.toLowerCase()===p?Lr+=8:(l=r,0===yr&&Ir(jt)),l!==r?(i=bn(),i!==r?(a=Mr(),a!==r?(c=gn(),Ar=u,u=function(t,e){t.groupBy=e}(n,a)):(Lr=u,u=r)):(Lr=u,u=r)):(Lr=u,u=r),u!==r?(l=Lr,i=t.substr(Lr,6),i.toLowerCase()===d?Lr+=6:(i=r,0===yr&&Ir(Ot)),i!==r?(a=bn(),a!==r?(c=Br(),c!==r?(f=gn(),Ar=l,l=function(t,e){t.having=e}(n,c)):(Lr=l,l=r)):(Lr=l,l=r)):(Lr=l,l=r),l===r&&(l=null),u=[u,l],s=u):(Lr=s,s=r),s===r&&(s=null),u=Lr,l=Lr,i=t.substr(Lr,8),i.toLowerCase()===C?Lr+=8:(i=r,0===yr&&Ir(Nt)),i!==r?(a=bn(),a!==r?(i=[i,a],l=i):(Lr=l,l=r)):(Lr=l,l=r),l!==r?(i=Zr(),i!==r?(a=gn(),Ar=u,u=function(t,e){t.orderBy=e}(n,i)):(Lr=u,u=r)):(Lr=u,u=r),u===r&&(u=null),l=Lr,i=Lr,a=t.substr(Lr,5),a.toLowerCase()===g?Lr+=5:(a=r,0===yr&&Ir(Pt)),a!==r?(c=bn(),c!==r?(f=Kr(),f===r&&(f=Xr()),f!==r?(w=gn(),Ar=i,i=function(t,e){t.limit={rows:e}}(n,f)):(Lr=i,i=r)):(Lr=i,i=r)):(Lr=i,i=r),i!==r?(a=Lr,c=t.substr(Lr,6),c.toLowerCase()===b?Lr+=6:(c=r,0===yr&&Ir(Ut)),c!==r?(f=bn(),f!==r?(w=Kr(),w===r&&(w=Xr()),w!==r?(L=gn(),Ar=a,a=function(t,e){t.limit.offset=e}(n,w)):(Lr=a,a=r)):(Lr=a,a=r)):(Lr=a,a=r),a===r&&(a=null),i=[i,a],l=i):(Lr=l,l=r),l===r&&(l=null),e=n):(Lr=e,e=r),e}function Ur(){let e,n,o,s,u;return e=Lr,n=Lr,o=gn(),n=t.substring(n,Lr),o=t.substr(Lr,2),o.toLowerCase()===w?Lr+=2:(o=r,0===yr&&Ir(Dt)),o!==r?(s=bn(),s!==r?(u=kr(),u!==r?e=u:(Lr=e,e=r)):(Lr=e,e=r)):(Lr=e,e=r),e}function Dr(){let e,n,o,s,u,l,i,a,c,f,h;for(e=Lr,n=[],42===t.charCodeAt(Lr)?(o=L,Lr++):(o=r,0===yr&&Ir(zt)),o===r&&(o=Lr,s=Kr(),s!==r?(u=Lr,l=Ur(),l!==r&&(Ar=u,l=hr(s,l)),u=l,u===r&&(u=null),l=Cn(),l===r&&(l=null),i=Lr,a=an(),a!==r?(c=Dr(),c!==r?(f=cn(),f!==r?(Ar=i,i=pr(s,l,c)):(Lr=i,i=r)):(Lr=i,i=r)):(Lr=i,i=r),i!==r?o=s:(Lr=o,o=r)):(Lr=o,o=r),o===r&&(o=Lr,s=Vr(),s!==r?(u=Lr,l=Ur(),l!==r&&(Ar=u,l=dr(s,l)),u=l,u===r&&(u=null),o=s):(Lr=o,o=r)));o!==r;)n.push(o),o=Lr,s=dn(),s!==r?(42===t.charCodeAt(Lr)?(s=L,Lr++):(s=r,0===yr&&Ir(zt)),s===r&&(s=Lr,u=Kr(),u!==r?(l=Lr,i=Ur(),i!==r&&(Ar=l,i=hr(u,i)),l=i,l===r&&(l=null),i=Cn(),i===r&&(i=null),a=Lr,c=an(),c!==r?(f=Dr(),f!==r?(h=cn(),h!==r?(Ar=a,a=pr(u,i,f)):(Lr=a,a=r)):(Lr=a,a=r)):(Lr=a,a=r),a!==r?s=u:(Lr=s,s=r)):(Lr=s,s=r),s===r&&(s=Lr,u=Vr(),u!==r?(l=Lr,i=Ur(),i!==r&&(Ar=l,i=dr(u,i)),l=i,l===r&&(l=null),s=u):(Lr=s,s=r))),s===r?(Lr=o,o=r):o=s):o=s;return n.length<1?(Lr=e,e=r):e=n,e}function zr(){let e,n,o,s,u,l,i,a;return e=Lr,n=gn(),91===t.charCodeAt(Lr)?(o=A,Lr++):(o=r,0===yr&&Ir(Bt)),o!==r?(s=gn(),u=function(){let t,e,n,o,s;t=Lr,e=ln(),e!==r&&(Ar=t,u=e,e={where:fluent.where(u)});var u;if(t=e,t===r){for(t=Lr,e=Lr,n=[],o=Xr();o!==r;)n.push(o),o=Lr,s=dn(),s!==r?(s=Xr(),s===r?(Lr=o,o=r):o=s):o=s;n.length<1?(Lr=e,e=r):e=n,e!==r&&(Ar=t,e={where:e}),t=e,t===r&&(t=Lr,e=Jr(),e!==r&&(Ar=t,e={where:e.xpr}),t=e,t===r&&(t=Pr()))}return t}(),u!==r?(l=gn(),93===t.charCodeAt(Lr)?(i=m,Lr++):(i=r,0===yr&&Ir(Mt)),i!==r?(a=gn(),e=u):(Lr=e,e=r)):(Lr=e,e=r)):(Lr=e,e=r),e}function Br(){let t,e;var n;return t=Lr,e=ln(),e!==r&&(Ar=t,n=e,e=fluent.where(n)),t=e,t===r&&(t=Lr,e=Jr(),e!==r&&(Ar=t,e=e.xpr),t=e),t}function Mr(){let t,e,n,o,s;for(t=Lr,e=Lr,n=[],o=Kr();o!==r;)n.push(o),o=Lr,s=dn(),s!==r?(s=Kr(),s===r?(Lr=o,o=r):o=s):o=s;return n.length<1?(Lr=e,e=r):e=n,e!==r?t=e:(Lr=t,t=r),t}function Zr(){let e,n,o,s,u,l,i,a,c;for(e=Lr,n=Lr,o=[],s=Lr,u=Kr(),u!==r?(l=Lr,i=bn(),i!==r?(a=t.substr(Lr,3),a.toLowerCase()===E?Lr+=3:(a=r,0===yr&&Ir(Zt)),a===r&&(a=t.substr(Lr,4),a.toLowerCase()===x?Lr+=4:(a=r,0===yr&&Ir(qt))),a!==r?(Ar=l,l=Cr(u,a)):(Lr=l,l=r)):(Lr=l,l=r),l===r&&(l=null),s=u):(Lr=s,s=r);s!==r;)o.push(s),s=Lr,u=dn(),u!==r?(u=Lr,l=Kr(),l!==r?(i=Lr,a=bn(),a!==r?(c=t.substr(Lr,3),c.toLowerCase()===E?Lr+=3:(c=r,0===yr&&Ir(Zt)),c===r&&(c=t.substr(Lr,4),c.toLowerCase()===x?Lr+=4:(c=r,0===yr&&Ir(qt))),c!==r?(Ar=i,i=Cr(l,c)):(Lr=i,i=r)):(Lr=i,i=r),i===r&&(i=null),u=l):(Lr=u,u=r),u===r?(Lr=s,s=r):s=u):s=u;return o.length<1?(Lr=n,n=r):n=o,n!==r?e=n:(Lr=e,e=r),e}function qr(){let t;return t=ln(),t===r&&(t=Wr()),t}function Hr(){let e,n,o,s,u,l,i,a,c,f,h;for(e=Lr,n=Lr,o="",Ar=n,o={},n=o,o=Lr,s=[],u=Lr,l=Gr(),l!==r?(i=gn(),61===t.charCodeAt(Lr)?(a=N,Lr++):(a=r,0===yr&&Ir(ee)),a!==r?(c=gn(),f=nn(),f===r&&(f=Vr()),f!==r?(Ar=u,u=gr(n,l,f)):(Lr=u,u=r)):(Lr=u,u=r)):(Lr=u,u=r);u!==r;)s.push(u),u=Lr,l=dn(),l!==r?(l=Lr,i=Gr(),i!==r?(a=gn(),61===t.charCodeAt(Lr)?(c=N,Lr++):(c=r,0===yr&&Ir(ee)),c!==r?(f=gn(),h=nn(),h===r&&(h=Vr()),h!==r?(Ar=l,l=gr(n,i,h)):(Lr=l,l=r)):(Lr=l,l=r)):(Lr=l,l=r),l===r?(Lr=u,u=r):u=l):u=l;return s.length<1?(Lr=o,o=r):o=s,o!==r?(s=gn(),e=n):(Lr=e,e=r),e}function Wr(){let e,n,o,s,u,l,i,a,c,f,h;if(e=Lr,n=Lr,o=gn(),123===t.charCodeAt(Lr)?(s=P,Lr++):(s=r,0===yr&&Ir(re)),s!==r?(u=gn(),Ar=n,n={}):(Lr=n,n=r),n!==r){for(o=Lr,s=[],u=Lr,l=Gr(),l!==r?(i=gn(),58===t.charCodeAt(Lr)?(a=U,Lr++):(a=r,0===yr&&Ir(ne)),a!==r?(c=gn(),f=Xr(),f===r&&(f=Wr(),f===r&&(f=Yr())),f!==r?(Ar=u,u=br(n,l,f)):(Lr=u,u=r)):(Lr=u,u=r)):(Lr=u,u=r);u!==r;)s.push(u),u=Lr,l=dn(),l!==r?(l=Lr,i=Gr(),i!==r?(a=gn(),58===t.charCodeAt(Lr)?(c=U,Lr++):(c=r,0===yr&&Ir(ne)),c!==r?(f=gn(),h=Xr(),h===r&&(h=Wr(),h===r&&(h=Yr())),h!==r?(Ar=l,l=br(n,i,h)):(Lr=l,l=r)):(Lr=l,l=r)):(Lr=l,l=r),l===r?(Lr=u,u=r):u=l):u=l;s.length<1?(Lr=o,o=r):o=s,o!==r?(s=gn(),125===t.charCodeAt(Lr)?(u=D,Lr++):(u=r,0===yr&&Ir(oe)),u!==r?(l=gn(),e=n):(Lr=e,e=r)):(Lr=e,e=r)}else Lr=e,e=r;return e}function Yr(){let e,n,o,s,u,l,i,a;if(e=Lr,n=gn(),91===t.charCodeAt(Lr)?(o=A,Lr++):(o=r,0===yr&&Ir(Bt)),o!==r){for(s=gn(),u=Lr,l=[],i=Wr();i!==r;)l.push(i),i=Lr,a=dn(),a!==r?(a=Wr(),a===r?(Lr=i,i=r):i=a):i=a;l.length<1?(Lr=u,u=r):u=l,u!==r?(l=gn(),93===t.charCodeAt(Lr)?(i=m,Lr++):(i=r,0===yr&&Ir(Mt)),i!==r?(a=gn(),e=u):(Lr=e,e=r)):(Lr=e,e=r)}else Lr=e,e=r;return e}function kr(){let e,n,o,s,u,l,i,a;if(yr++,e=Lr,n=Lr,yr++,o=t.substr(Lr,2),o.toLowerCase()===w?Lr+=2:(o=r,0===yr&&Ir(ge)),yr--,o===r?n=void 0:(Lr=n,n=r),n!==r)if(o=Lr,yr++,s=function(){let e;return e=t.substr(Lr,4),e.toLowerCase()===f?Lr+=4:(e=r,0===yr&&Ir(ae)),e===r&&(e=t.substr(Lr,5),e.toLowerCase()===h?Lr+=5:(e=r,0===yr&&Ir(ce)),e===r&&(e=t.substr(Lr,8),e.toLowerCase()===p?Lr+=8:(e=r,0===yr&&Ir(fe)),e===r&&(e=t.substr(Lr,8),e.toLowerCase()===C?Lr+=8:(e=r,0===yr&&Ir(he)),e===r&&(e=t.substr(Lr,5),e.toLowerCase()===g?Lr+=5:(e=r,0===yr&&Ir(pe)),e===r&&(e=t.substr(Lr,6),e.toLowerCase()===b?Lr+=6:(e=r,0===yr&&Ir(de))))))),e}(),yr--,s===r?o=void 0:(Lr=o,o=r),o!==r){if(s=Lr,u=Lr,l=t.charAt(Lr),wt.test(l)?Lr++:(l=r,0===yr&&Ir(be)),l!==r){for(i=[],a=t.charAt(Lr),Lt.test(a)?Lr++:(a=r,0===yr&&Ir(we));a!==r;)i.push(a),a=t.charAt(Lr),Lt.test(a)?Lr++:(a=r,0===yr&&Ir(we));l=[l,i],u=l}else Lr=u,u=r;s=u!==r?t.substring(s,Lr):u,s!==r?e=s:(Lr=e,e=r)}else Lr=e,e=r;else Lr=e,e=r;return yr--,e===r&&(n=r,0===yr&&Ir(Ce)),e}function Gr(){let e,n,o,s,u,l;for(yr++,e=Lr,n=Lr,o=Lr,s=[],u=kr();u!==r;)s.push(u),u=Lr,l=Cn(),l!==r?(l=kr(),l===r?(Lr=u,u=r):u=l):u=l;return s.length<1?(Lr=o,o=r):o=s,n=o!==r?t.substring(n,Lr):o,n!==r?e=n:(Lr=e,e=r),yr--,e===r&&(n=r,0===yr&&Ir(Le)),e}function Qr(){let e,n,o,s,u,l,i;var a;if(yr++,e=Lr,n=ln(),n!==r&&(Ar=e,a=n,n=fluent.subject(a)),e=n,e===r){for(e=Lr,n=Lr,o=[],s=Lr,u=kr(),u!==r?(l=Cn(),l!==r?(u=[u,l],s=u):(Lr=s,s=r)):(Lr=s,s=r);s!==r;)o.push(s),s=Lr,u=kr(),u!==r?(l=Cn(),l!==r?(u=[u,l],s=u):(Lr=s,s=r)):(Lr=s,s=r);n=t.substring(n,Lr),o=Lr,s=kr(),s!==r?(u=gn(),58===t.charCodeAt(Lr)?(l=U,Lr++):(l=r,0===yr&&Ir(ne)),l!==r?(i=gn(),o=s):(Lr=o,o=r)):(Lr=o,o=r),o===r&&(o=null),s=Kr(),s!==r?(u=gn(),Ar=e,e=function(t,e,r){if(e)return{ref:[t+e,...r.ref]};if(t){let[e]=r.ref;e.id?e.id=t+e.id:r.ref[0]=t+e}return r}(n,o,s)):(Lr=e,e=r)}return yr--,e===r&&(n=r,0===yr&&Ir(Ae)),e}function Vr(){let t,e;var n;return t=Lr,e=Jr(),e!==r&&(Ar=t,e=(n=e).xpr.length>1?n:n.xpr[0]),t=e,t}function Jr(){let t,e,n,o,s,u;if(t=Lr,e=[],n=un(),n===r&&(n=tn(),n===r&&(n=rn(),n===r&&(n=Xr(),n===r&&(n=sn(),n===r&&(n=en(),n===r&&(n=Kr(),n===r&&(n=Lr,o=fn(),o!==r?(s=Vr(),s!==r?(u=hn(),u!==r?n=s:(Lr=n,n=r)):(Lr=n,n=r)):(Lr=n,n=r)))))))),n!==r)for(;n!==r;)e.push(n),n=un(),n===r&&(n=tn(),n===r&&(n=rn(),n===r&&(n=Xr(),n===r&&(n=sn(),n===r&&(n=en(),n===r&&(n=Kr(),n===r&&(n=Lr,o=fn(),o!==r?(s=Vr(),s!==r?(u=hn(),u!==r?n=s:(Lr=n,n=r)):(Lr=n,n=r)):(Lr=n,n=r))))))));else e=r;return e!==r&&(Ar=t,e={xpr:e.flat()}),t=e,t}function Kr(){let e,n,o,s,u,l,i;if(yr++,e=function(){let e,n,o,s,u;e=Lr,t.substr(Lr,5)===dt?(n=dt,Lr+=5):(n=r,0===yr&&Ir(or));n!==r?(o=Lr,yr++,s=pn(),yr--,s===r?o=void 0:(Lr=o,o=r),o!==r?(s=Lr,yr++,u=Cn(),yr--,u===r?s=void 0:(Lr=s,s=r),s!==r?(Ar=e,e={ref:["$user","id"]}):(Lr=e,e=r)):(Lr=e,e=r)):(Lr=e,e=r);return e}(),e===r){for(e=Lr,n=Lr,o=[],s=Lr,u=kr(),u!==r?(l=zr(),l===r&&(l=null),Ar=s,s=wr(u,l)):(Lr=s,s=r);s!==r;)o.push(s),s=Lr,u=Cn(),u!==r?(u=Lr,l=kr(),l!==r?(i=zr(),i===r&&(i=null),Ar=u,u=wr(l,i)):(Lr=u,u=r),u===r?(Lr=s,s=r):s=u):s=u;o.length<1?(Lr=n,n=r):n=o,n!==r&&(Ar=e,n={ref:n}),e=n}return yr--,e===r&&(n=r,0===yr&&Ir(me)),e}function Xr(){let e,n;return yr++,e=nn(),e===r&&(e=Lr,n=function(){let e,n;yr++,e=function(){let e,n,o,s,u,l;e=Lr,39===t.charCodeAt(Lr)?(n=ct,Lr++):(n=r,0===yr&&Ir(Ke));if(n!==r){for(o=Lr,s=Lr,u=[],l=t.charAt(Lr),Et.test(l)?Lr++:(l=r,0===yr&&Ir(Xe)),l===r&&(t.substr(Lr,2)===ft?(l=ft,Lr+=2):(l=r,0===yr&&Ir(tr)));l!==r;)u.push(l),l=t.charAt(Lr),Et.test(l)?Lr++:(l=r,0===yr&&Ir(Xe)),l===r&&(t.substr(Lr,2)===ft?(l=ft,Lr+=2):(l=r,0===yr&&Ir(tr)));s=t.substring(s,Lr),Ar=o,s=Sr().replace(/''/g,"'"),o=s,39===t.charCodeAt(Lr)?(s=ct,Lr++):(s=r,0===yr&&Ir(Ke)),s!==r?e=o:(Lr=e,e=r)}else Lr=e,e=r;return e}(),e===r&&(e=function(){let e,n,o,s,u,l,i,a,c,f;e=Lr,n=Lr,o=Lr,45===t.charCodeAt(Lr)?(s=lt,Lr++):(s=r,0===yr&&Ir(Ge));s===r&&(s=null);u=[],l=t.charAt(Lr),mt.test(l)?Lr++:(l=r,0===yr&&Ir(Qe));if(l!==r)for(;l!==r;)u.push(l),l=t.charAt(Lr),mt.test(l)?Lr++:(l=r,0===yr&&Ir(Qe));else u=r;if(u!==r){if(l=Lr,46===t.charCodeAt(Lr)?(i=it,Lr++):(i=r,0===yr&&Ir(Ve)),i!==r){if(a=[],c=t.charAt(Lr),mt.test(c)?Lr++:(c=r,0===yr&&Ir(Qe)),c!==r)for(;c!==r;)a.push(c),c=t.charAt(Lr),mt.test(c)?Lr++:(c=r,0===yr&&Ir(Qe));else a=r;a!==r?(i=[i,a],l=i):(Lr=l,l=r)}else Lr=l,l=r;if(l===r&&(l=null),i=Lr,101===t.charCodeAt(Lr)?(a=at,Lr++):(a=r,0===yr&&Ir(Je)),a!==r){if(c=[],f=t.charAt(Lr),mt.test(f)?Lr++:(f=r,0===yr&&Ir(Qe)),f!==r)for(;f!==r;)c.push(f),f=t.charAt(Lr),mt.test(f)?Lr++:(f=r,0===yr&&Ir(Qe));else c=r;c!==r?(a=[a,c],i=a):(Lr=i,i=r)}else Lr=i,i=r;i===r&&(i=null),s=[s,u,l,i],o=s}else Lr=o,o=r;n=o!==r?t.substring(n,Lr):o;n!==r&&(Ar=e,n=Number(n));return e=n,e}(),e===r&&(e=function(){let e,n,o,s;e=Lr,t.substr(Lr,4)===ht?(n=ht,Lr+=4):(n=r,0===yr&&Ir(rr));n!==r?(o=Lr,yr++,s=pn(),yr--,s===r?o=void 0:(Lr=o,o=r),o!==r?(Ar=e,e=!0):(Lr=e,e=r)):(Lr=e,e=r);return e}(),e===r&&(e=function(){let e,n,o,s;e=Lr,t.substr(Lr,5)===pt?(n=pt,Lr+=5):(n=r,0===yr&&Ir(nr));n!==r?(o=Lr,yr++,s=pn(),yr--,s===r?o=void 0:(Lr=o,o=r),o!==r?(Ar=e,e=!1):(Lr=e,e=r)):(Lr=e,e=r);return e}(),e===r&&(e=function(){let e,n,o,s;e=Lr,t.substr(Lr,4)===st?(n=st,Lr+=4):(n=r,0===yr&&Ir(er));n!==r?(o=Lr,yr++,s=pn(),yr--,s===r?o=void 0:(Lr=o,o=r),o!==r?(Ar=e,e=null):(Lr=e,e=r)):(Lr=e,e=r);return e}()))));yr--,e===r&&(n=r,0===yr&&Ir(ke));return e}(),n!==r&&(Ar=e,n={val:n}),e=n),yr--,e===r&&(n=r,0===yr&&Ir(Ee)),e}function tn(){let t,e,n,o;return yr++,t=nn(),t===r&&(t=Lr,e=fn(),e!==r?(n=Lr,o=on(),o!==r&&(Ar=n,o={list:o}),n=o,n!==r?(o=hn(),o!==r?t=n:(Lr=t,t=r)):(Lr=t,t=r)):(Lr=t,t=r)),yr--,t===r&&(e=r,0===yr&&Ir(xe)),t}function en(){let e,n,o,s,u,l,i;if(yr++,e=Lr,n=kr(),n!==r)if(o=fn(),o!==r){for(s=Lr,u=[],42===t.charCodeAt(Lr)?(l=L,Lr++):(l=r,0===yr&&Ir(zt)),l===r&&(l=Vr());l!==r;)u.push(l),l=Lr,i=dn(),i!==r?(42===t.charCodeAt(Lr)?(i=L,Lr++):(i=r,0===yr&&Ir(zt)),i===r&&(i=Vr()),i===r?(Lr=l,l=r):l=i):l=i;u.length<1?(Lr=s,s=r):s=u,s!==r?(u=hn(),u!==r?(Ar=e,e={func:n,args:s}):(Lr=e,e=r)):(Lr=e,e=r)}else Lr=e,e=r;else Lr=e,e=r;return yr--,e===r&&(n=r,0===yr&&Ir(ve)),e}function rn(){let e,n,o;return yr++,e=Lr,35===t.charCodeAt(Lr)?(n=q,Lr++):(n=r,0===yr&&Ir(Se)),n!==r?(o=kr(),o!==r?(Ar=e,e={"#":o}):(Lr=e,e=r)):(Lr=e,e=r),yr--,e===r&&(n=r,0===yr&&Ir(ye)),e}function nn(){let e,n,o,s;return yr++,e=Lr,n=gn(),63===t.charCodeAt(Lr)?(o=H,Lr++):(o=r,0===yr&&Ir(Te)),o!==r?(s=gn(),Ar=e,e=mn()):(Lr=e,e=r),yr--,e===r&&(n=r,0===yr&&Ir(_e)),e}function on(){let t,e,n,o;for(yr++,t=Lr,e=[],n=rn(),n===r&&(n=Xr(),n===r&&(n=Kr(),n===r&&(n=en())));n!==r;)e.push(n),n=Lr,o=dn(),o!==r?(o=rn(),o===r&&(o=Xr(),o===r&&(o=Kr(),o===r&&(o=en()))),o===r?(Lr=n,n=r):n=o):n=o;return e.length<2?(Lr=t,t=r):t=e,yr--,t===r&&(e=r,0===yr&&Ir(Ee)),t}function sn(){let e,n,o,s,u;if(yr++,e=Lr,n=gn(),o=function(){let e,n,o,s,u,l,i;e=Lr,n=t.substr(Lr,3),n.toLowerCase()===W?Lr+=3:(n=r,0===yr&&Ir(Fe));n===r&&(n=t.substr(Lr,2),n.toLowerCase()===Y?Lr+=2:(n=r,0===yr&&Ir(Ie)),n===r&&(n=t.substr(Lr,2),n.toLowerCase()===k?Lr+=2:(n=r,0===yr&&Ir(je)),n===r&&(n=t.substr(Lr,7),n.toLowerCase()===G?Lr+=7:(n=r,0===yr&&Ir(Oe)),n===r&&(n=t.substr(Lr,4),n.toLowerCase()===Q?Lr+=4:(n=r,0===yr&&Ir(Ne)),n===r&&(n=t.substr(Lr,6),n.toLowerCase()===V?Lr+=6:(n=r,0===yr&&Ir(Pe)),n===r&&(n=Lr,o=t.substr(Lr,8),o.toLowerCase()===J?Lr+=8:(o=r,0===yr&&Ir(Ue)),o!==r?(s=Lr,yr++,u=fn(),yr--,u===r?s=void 0:(Lr=s,s=r),s!==r?n=o:(Lr=n,n=r)):(Lr=n,n=r)))))));n!==r?(o=Lr,yr++,s=pn(),yr--,s===r?o=void 0:(Lr=o,o=r),o!==r?e=n:(Lr=e,e=r)):(Lr=e,e=r);if(e===r&&(e=Lr,n=t.substr(Lr,4),n.toLowerCase()===K?Lr+=4:(n=r,0===yr&&Ir(De)),n===r&&(n=t.substr(Lr,4),n.toLowerCase()===X?Lr+=4:(n=r,0===yr&&Ir(ze)),n===r&&(n=t.substr(Lr,4),n.toLowerCase()===tt?Lr+=4:(n=r,0===yr&&Ir(Be)),n===r&&(n=t.substr(Lr,4),n.toLowerCase()===et?Lr+=4:(n=r,0===yr&&Ir(Me)),n===r&&(n=t.substr(Lr,3),n.toLowerCase()===rt?Lr+=3:(n=r,0===yr&&Ir(Ze)))))),n!==r?(o=Lr,yr++,s=pn(),yr--,s===r?o=void 0:(Lr=o,o=r),o!==r?e=n:(Lr=e,e=r)):(Lr=e,e=r),e===r)){for(e=Lr,n=[],o=Lr,s=t.substr(Lr,2),s.toLowerCase()===nt?Lr+=2:(s=r,0===yr&&Ir(qe)),s===r&&(s=t.substr(Lr,3),s.toLowerCase()===ot?Lr+=3:(s=r,0===yr&&Ir(He)),s===r&&(s=t.substr(Lr,4),s.toLowerCase()===st?Lr+=4:(s=r,0===yr&&Ir(We)),s===r&&(s=t.substr(Lr,5),s.toLowerCase()===ut?Lr+=5:(s=r,0===yr&&Ir(Ye))))),s!==r?(u=Lr,yr++,l=pn(),yr--,l===r?u=void 0:(Lr=u,u=r),u!==r?o=s:(Lr=o,o=r)):(Lr=o,o=r);o!==r;)n.push(o),o=Lr,s=gn(),s=Lr,u=t.substr(Lr,2),u.toLowerCase()===nt?Lr+=2:(u=r,0===yr&&Ir(qe)),u===r&&(u=t.substr(Lr,3),u.toLowerCase()===ot?Lr+=3:(u=r,0===yr&&Ir(He)),u===r&&(u=t.substr(Lr,4),u.toLowerCase()===st?Lr+=4:(u=r,0===yr&&Ir(We)),u===r&&(u=t.substr(Lr,5),u.toLowerCase()===ut?Lr+=5:(u=r,0===yr&&Ir(Ye))))),u!==r?(l=Lr,yr++,i=pn(),yr--,i===r?l=void 0:(Lr=l,l=r),l!==r?s=u:(Lr=s,s=r)):(Lr=s,s=r),s===r?(Lr=o,o=r):o=s;n.length<1?(Lr=e,e=r):e=n}return e}(),o===r){if(o=Lr,s=[],u=t.charAt(Lr),At.test(u)?Lr++:(u=r,0===yr&&Ir(Re)),u!==r)for(;u!==r;)s.push(u),u=t.charAt(Lr),At.test(u)?Lr++:(u=r,0===yr&&Ir(Re));else s=r;o=s!==r?t.substring(o,Lr):s}return o!==r?(s=gn(),e=o):(Lr=e,e=r),yr--,e===r&&(n=r,0===yr&&Ir($e)),e}function un(){let t,e,n,o;return t=Lr,e=fn(),e!==r?(n=Nr(),n!==r?(o=hn(),o!==r?t=n:(Lr=t,t=r)):(Lr=t,t=r)):(Lr=t,t=r),t}function ln(){let e,n,o,s;return e=Lr,n=gn(),63===t.charCodeAt(Lr)?(o=H,Lr++):(o=r,0===yr&&Ir(Te)),o!==r?(s=gn(),Ar=e,e=Ln.shift()):(Lr=e,e=r),e}function an(){let e,n,o,s;return e=Lr,n=gn(),123===t.charCodeAt(Lr)?(o=P,Lr++):(o=r,0===yr&&Ir(re)),o!==r?(s=gn(),n=[n,o,s],e=n):(Lr=e,e=r),e}function cn(){let e,n,o,s;return e=Lr,n=gn(),125===t.charCodeAt(Lr)?(o=D,Lr++):(o=r,0===yr&&Ir(oe)),o!==r?(s=gn(),n=[n,o,s],e=n):(Lr=e,e=r),e}function fn(){let e,n,o,s;return e=Lr,n=gn(),40===t.charCodeAt(Lr)?(o=Ct,Lr++):(o=r,0===yr&&Ir(sr)),o!==r?(s=gn(),n=[n,o,s],e=n):(Lr=e,e=r),e}function hn(){let e,n,o,s;return e=Lr,n=gn(),41===t.charCodeAt(Lr)?(o=gt,Lr++):(o=r,0===yr&&Ir(ur)),o!==r?(s=gn(),n=[n,o,s],e=n):(Lr=e,e=r),e}function pn(){let e;return e=t.charAt(Lr),xt.test(e)?Lr++:(e=r,0===yr&&Ir(lr)),e}function dn(){let e,n,o,s;return yr++,e=Lr,n=gn(),44===t.charCodeAt(Lr)?(o=bt,Lr++):(o=r,0===yr&&Ir(ar)),o!==r?(s=gn(),e=o):(Lr=e,e=r),yr--,e===r&&(n=r,0===yr&&Ir(ir)),e}function Cn(){let e,n,o,s;return yr++,e=Lr,n=gn(),46===t.charCodeAt(Lr)?(o=it,Lr++):(o=r,0===yr&&Ir(Ve)),o!==r?(s=gn(),Ar=e,e="."):(Lr=e,e=r),yr--,e===r&&(n=r,0===yr&&Ir(cr)),e}function gn(){let e,n,o;for(yr++,e=Lr,n=[],o=t.charAt(Lr),vt.test(o)?Lr++:(o=r,0===yr&&Ir(fr));o!==r;)n.push(o),o=t.charAt(Lr),vt.test(o)?Lr++:(o=r,0===yr&&Ir(fr));return e=t.substring(e,Lr),yr--,e}function bn(){let e,n,o;if(yr++,e=Lr,n=[],o=t.charAt(Lr),vt.test(o)?Lr++:(o=r,0===yr&&Ir(fr)),o!==r)for(;o!==r;)n.push(o),o=t.charAt(Lr),vt.test(o)?Lr++:(o=r,0===yr&&Ir(fr));else n=r;return e=n!==r?t.substring(e,Lr):n,yr--,e===r&&(n=r,0===yr&&Ir(cr)),e}const wn=[],Ln=e.args;let An=0;const mn=!Ln?.length||!e.startRule&&peg$parse.late_binding?()=>wn[An++]=En:()=>wn[An]=fluent.expr(Ln[An++]),En={ref:["?"],param:!0};Er=s();const xn=Er!==r&&Lr===t.length;function vn(){throw Er!==r&&Lr<t.length&&Ir({type:"end"}),jr(vr,xr<t.length?function(e=Lr){const r=t.codePointAt(e);return void 0===r?"":String.fromCodePoint(r)}(xr):null,xr<t.length?Fr(xr,xr+1):Fr(xr,xr))}return e.peg$library?{peg$result:Er,peg$currPos:Lr,peg$FAILED:r,peg$maxFailExpected:vr,peg$maxFailPos:xr,peg$success:xn,peg$throw:xn?void 0:vn}:xn?Er:void vn()}const peg$allowedStartRules=["CQL","subject","columns","values","ref","val","expr","set","with","where","groupBy","orderBy"];export{peg$allowedStartRules as StartRules,peg$SyntaxError as SyntaxError,peg$parse as parse};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cap.core/ql",
3
- "version": "2.0.4",
3
+ "version": "2.1.0",
4
4
  "description": "Minimalistic implementation of cds.ql, carved out from CAP.",
5
5
  "repository": "https://github.com/cap-js/ql.git",
6
6
  "author": "daniel.hutzel@sap.com",