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

jora

Package Overview
Dependencies
Maintainers
1
Versions
26
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jora - npm Package Compare versions

Comparing version 1.0.0-alpha.12 to 1.0.0-alpha.13

src/lang/compile-buildin.js

14

CHANGELOG.md

@@ -0,4 +1,16 @@

## 1.0.0-alpha.13 (January 6, 2020)
- Added pipeline operator, i.e. `foo | bar | ...`
- Added `fromEntries()` method
- Allowed parent's scope variables overlapping, i.e. `$a;.($a; ...)` doesn't throw with an error now
- Added support for a function as `debug` option value, i.e. `query('...', { debug: (name, value) => /* ... */ })`
- Disallowed whitespace between `$` and identifier, previously `$foo` can be used as `$ foo`, now it throws with a parse error
- Reworked build setup:
- Added baking of `src/parser.js` before publishing, i.e. replace a runtime parser compilation with a pre-compiled version
- Moved `jison` to dev dependencies, and package has no dependencies anymore (dev only)
- Removed `dist/parser.js` & `dist/version.json` from package
## 1.0.0-alpha.12 (December 18, 2019)
- Included build prerequsite files (`dist/parser.js` & `dist/version.json`) in package
- Included build prerequisite files (`dist/parser.js` & `dist/version.json`) in package

@@ -5,0 +17,0 @@ ## 1.0.0-alpha.11 (December 17, 2019)

2

dist/jora.min.js

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

!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e=e||self).jora=t()}(this,(function(){"use strict";var e={version:"1.0.0-alpha.12"},t=Object.freeze({__proto__:null,version:"1.0.0-alpha.12",default:e});const r=Object.prototype.toString;var n={addToSet:function(e,t){return void 0!==t&&(Array.isArray(t)?t.forEach(t=>e.add(t)):e.add(t)),e},getPropertyValue:function(e,t){return e&&hasOwnProperty.call(e,t)?e[t]:void 0},isPlainObject:function(e){return e&&"object"==typeof e&&e.constructor===Object},isRegExp:function(e){return"[object RegExp]"===r.call(e)},isArrayLike:function(e){return e&&hasOwnProperty.call(e,"length")}};const{addToSet:s,getPropertyValue:a,isPlainObject:i,isRegExp:o,isArrayLike:c}=n;var u=Object.freeze({bool:function(e){if(Array.isArray(e))return e.length>0;if(i(e)){for(const t in e)if(hasOwnProperty.call(e,t))return!0;return!1}return Boolean(e)},and:function(e,t){return this.bool(e)?t:e},or:function(e,t){return this.bool(e)?e:t},add:function(e,t){return Array.isArray(e)||Array.isArray(t)?[...new Set([].concat(e,t))]:e+t},sub:function(e,t){if(Array.isArray(e)){const r=new Set(e);return Array.isArray(t)?t.forEach(e=>r.delete(e)):r.delete(t),[...r]}return e-t},mul:function(e,t){return e*t},div:function(e,t){return e/t},mod:function(e,t){return e%t},eq:function(e,t){return e===t},ne:function(e,t){return e!==t},lt:function(e,t){return e<t},lte:function(e,t){return e<=t},gt:function(e,t){return e>t},gte:function(e,t){return e>=t},in:function(e,t){return i(t)?hasOwnProperty.call(t,e):!(!t||"function"!=typeof t.indexOf)&&-1!==t.indexOf(e)},cmp:function(e,t){return e>t?1:e<t?-1:0},match:function(e,t){return"function"==typeof t?this.filter(e,t):o(t)?this.filter(e,t.test.bind(t)):null==t},map:function(e,t){const r="function"==typeof t?t:e=>a(e,t);return Array.isArray(e)?[...e.reduce((e,t)=>s(e,r(t)),new Set)]:void 0!==e?r(e):e},slice:function(e,t=0,r=e&&e.length,n=1){if(!c(e))return[];if(t=parseInt(t,10)||0,r=parseInt(r,10)||e.length,1!==(n=parseInt(n,10)||1)){const s=[];t=t<0?Math.max(0,e.length+t):Math.min(e.length,t),r=r<0?Math.max(0,e.length+r):Math.min(e.length,r);for(let a=n>0?t:r-1;a>=t&&a<r;a+=n)s.push(e[a]);return s}return"string"==typeof e?e.slice(t,r):Array.prototype.slice.call(e,t,r)},recursive:function(e,t){const r=new Set;return s(r,this.map(e,t)),r.forEach(e=>s(r,this.map(e,t))),[...r]},filter:function(e,t){return Array.isArray(e)?e.filter(e=>this.bool(t(e))):this.bool(t(e))?e:void 0}});const{addToSet:h,isPlainObject:l}=n;function p(){}function y(e){return e}function g(e){return{matched:e.slice(),start:e.index,end:e.index+e[0].length,input:e.input,groups:e.groups||null}}var f=Object.freeze({bool:u.bool,filter:u.filter,map:u.map,keys:function(e){return Object.keys(e||{})},values:function(e){const t=new Set;for(const r in e)hasOwnProperty.call(e,r)&&h(t,e[r]);return[...t]},entries:function(e){const t=[];for(const r in e)hasOwnProperty.call(e,r)&&t.push({key:r,value:e[r]});return t},pick:function(e,t){if(e){if("function"!=typeof t)return Array.isArray(e)?e[t||0]:e[t];if(Array.isArray(e))return e.find(e=>t(e));for(const r in e)if(hasOwnProperty.call(e,r)&&t(e[r]))return{key:r,value:e[r]}}},mapToArray:function(e,t="key",r){const n=[];for(const s in e)hasOwnProperty.call(e,s)&&n.push(r?{[t]:s,[r]:e[s]}:Object.assign({[t]:s},e[s]));return n},size:function(e){return l(e)?Object.keys(e).length:e&&e.length||0},sort:function(e,t){let r;return Array.isArray(e)?("function"==typeof t&&(r=2===t.length?t:(e,r)=>{if(e=t(e),r=t(r),Array.isArray(e)&&Array.isArray(r)){if(e.length!==r.length)return e.length<r.length?-1:1;for(let t=0;t<e.length;t++){if(e[t]<r[t])return-1;if(e[t]>r[t])return 1}return 0}return e<r?-1:e>r}),e.slice().sort(r)):e},reverse:function(e){return Array.isArray(e)?e.slice().reverse():e},slice:function(e,t,r){return u.slice(e,t,r)},group:function(e,t,r){"function"!=typeof t&&(t=p),"function"!=typeof r&&(r=y),Array.isArray(e)||(e=[e]);const n=new Map,s=[];return e.forEach(e=>{let s=t(e);Array.isArray(s)||(s=[s]),s.forEach(t=>{n.has(t)?n.get(t).add(r(e)):n.set(t,new Set([r(e)]))})}),n.forEach((e,t)=>s.push({key:t,value:[...e]})),s},split:function(e,t){return String(e).split(t)},join:function(e,t){return Array.isArray(e)?e.join(t):String(e)},match:function(e,t,r){const n=String(e);if(r){const e=[];let r,s=new RegExp(t,t.flags+"g");for(;r=s.exec(n);)e.push(g(r));return e}const s=String(e).match(t);return s&&g(s)}});var b=function(e){function t(e,t){Object.entries(t).forEach(([t,r])=>e[t]=r(e[t]))}function r(e,t){return t>=0&&t<e.length&&/[a-zA-Z_$0-9]/.test(e[t])}function n(e,t){const r=e.charCodeAt(t);return 9===r||10===r||13===r||32===r}function s(e,t,r){for(;t<r;t++)if(!n(e,t))return!1;return!0}function a(e,t,r,n,s){const a=[];for(let r=0;r<n.length;r++){const[s,i]=n[r];if(s>t)break;s<e||(s===e?a.push(e,e):a.push(e,s),e=i)}return e===r.length&&s||a.push(e,t),a}Object.assign(e.lexer,{toStringLiteral:e=>JSON.parse("'"===e[0]?e.replace(/\\?"/g,'\\"').replace(/\\([^"uU])/g,"$1").replace(/^\'|\'$/g,'"'):e),toRegExp:e=>new RegExp(e.substr(1,e.lastIndexOf("/")-1),e.substr(e.lastIndexOf("/")+1))}),t(e.lexer,{setInput:e=>(function(t,i){const o=[],c=[];return i.commentRanges=c,i.suggestRanges=o,i.buildResult=e=>({ast:e,commentRanges:c,get suggestRanges(){return function(e,t,i){const o=[],c=i.length&&i[i.length-1][1]===e.length&&!/[\r\n]$/.test(e);for(let u=0;u<t.length;u++){let[h,l,p,y,g]=t[u];if(null===h)h=l.range[0],l=l.range[0];else if(null===l)l=h.range[1],h=h.range[1];else if(h.range[0]>l.range[0]){const e=h;h=l.range[1],l=e.range[0]}else h=h.range[0],l=l.range[1];if(s(e,h,l)){for(;h>=0&&n(e,h-1);)h--;for(;l<e.length&&n(e,l);)l++;if(r(e,h-1)){if(h===l)continue;h++}if(r(e,l)){if(h===l)continue;l--}}Array.isArray(p)||(p=[p]);const f=a(h,l,e,i,c);for(let e=0;e<f.length;e+=2)p.forEach(t=>o.push([f[e],f[e+1],t,y,g||null]))}return o}(t,o,c)}}),this.fnOpened=0,this.fnOpenedStack=[],this.prevToken=null,this.prevYylloc={first_line:1,last_line:1,first_column:0,last_column:0,range:[0,0]},e.call(this,t,i)})});const i=new e.Parser;i.lexer=Object.assign({},e.lexer);const o=["AND","OR","IN","NOTIN","HAS","HASNO"],c=[...o,"NOT","ASC","DESC"],u=["+","-","*","/","%","=","!=","~=",">=","<=","<",">"],h=[null,":",";",",",".","..",...u,...o,"NOT"],l=new Set([",","?",":",";","EOF","]",")","}",...u,...o,"ASC","DESC"]),p=new Map(h.map(e=>[e,l]));return p.set("{",new Set([","])),p.set("[",new Set([","])),p.set("(",new Set([","])),t(i.lexer,{lex:e=>(function t(){this.lex=e;const r=this._input,n=this.lex(this);if(this.lex=t,p.has(this.prevToken)&&p.get(this.prevToken).has(n)){const e={first_line:this.prevYylloc.last_line,last_line:this.yylloc.first_line,first_column:this.prevYylloc.last_column,last_column:this.yylloc.first_column,range:[this.prevYylloc.range[1],this.yylloc.range[0]]};if(this.unput(this.yytext),this.pushState("preventPrimitive"),this.done=!1,this.yytext="_",this.yylloc=this.prevYylloc=e,r!==this._input&&c.includes(n)){const t=r.length-this._input.length-1;switch(r[t]){case" ":case"\t":e.last_column--,e.range[1]--;break;case"\n":{const n=r.lastIndexOf("\n",t-1);e.last_line--,e.last_column=-1===n?e.last_column-1:t-n,e.range[1]--;break}}}return this.prevToken="SYMBOL"}if(this.prevYylloc=this.yylloc,c.includes(n))switch(this._input[0]){case" ":case"\t":this.prevYylloc=Object.assign({},this.prevYylloc,{last_column:this.prevYylloc.last_column+1,range:[this.prevYylloc.range[0],this.prevYylloc.range[1]+1]});break;case"\n":this.prevYylloc=Object.assign({},this.prevYylloc,{last_line:this.prevYylloc.last_line+1,last_column:0,range:[this.prevYylloc.range[0],this.prevYylloc.range[1]+1]})}return this.prevToken=n})}),e.strict=e,e.tolerant=i,e}(function(){var e=function(e,t,r,n){for(r=r||{},n=e.length;n--;r[e[n]]=t);return r},t=[2,4],r=[1,12],n=[1,22],s=[1,23],a=[1,24],i=[1,42],o=[1,15],c=[1,16],u=[1,17],h=[1,18],l=[1,25],p=[1,26],y=[1,27],g=[1,28],f=[1,29],b=[1,32],d=[1,34],k=[1,35],m=[1,36],v=[1,37],_=[1,38],$=[1,39],O=[1,41],S=[1,19],A=[1,20],C=[5,55,57,72],E=[1,53],R=[1,52],x=[1,46],N=[1,47],w=[1,48],P=[1,49],I=[1,50],j=[1,51],T=[1,54],q=[1,55],F=[1,56],M=[1,57],L=[1,58],U=[1,59],D=[1,60],B=[1,61],Y=[1,62],G=[1,63],z=[1,64],J=[5,10,19,20,21,39,40,41,42,43,46,47,48,49,50,53,55,56,57,59,60,61,62,63,65,71,72,73],H=[5,11,13,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,55,57,64,66,72],X=[1,65],Z=[1,66],V=[1,67],K=[1,68],Q=[1,69],W=[1,70],ee=[1,71],te=[1,72],re=[5,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,53,55,57,59,60,61,62,63,72,76,77],ne=[2,48],se=[5,11,13,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,53,55,57,59,60,61,62,63,64,66,72,76,77],ae=[1,77],ie=[1,87],oe=[1,100],ce=[1,101],ue=[1,102],he=[1,103],le=[2,49],pe=[5,11,13,55,57,64,66,72],ye=[5,11,13,26,27,38,55,57,64,66,72],ge=[5,11,13,20,21,22,23,24,25,26,27,31,32,33,34,35,36,37,38,55,57,64,66,72],fe=[55,64],be=[13,55],de=[64,66],ke=[5,11,13,22,23,24,25,26,27,38,55,57,64,66,72],me=[5,11,13,22,23,24,25,26,27,31,32,37,38,55,57,64,66,72],ve=[5,11,13,22,23,24,25,26,27,31,32,33,34,35,36,37,38,55,57,64,66,72],_e=[1,171],$e=[57,64],Oe={trace:function(){},yy:{},symbols_:{error:2,root:3,block:4,EOF:5,nonEmptyBlock:6,definitions:7,e:8,def:9,$:10,";":11,ident:12,":":13,query:14,keyword:15,function:16,sortingFunction:17,op:18,NOT:19,"-":20,"+":21,IN:22,HAS:23,NOTIN:24,HASNO:25,AND:26,OR:27,"*":28,"/":29,"%":30,"=":31,"!=":32,"<":33,"<=":34,">":35,">=":36,"~=":37,"?":38,SYMBOL:39,TRUE:40,FALSE:41,NULL:42,UNDEFINED:43,queryRoot:44,relativePath:45,"@":46,"#":47,STRING:48,NUMBER:49,REGEXP:50,object:51,array:52,"[":53,sliceNotation:54,"]":55,"(":56,")":57,arguments:58,".":59,".(":60,".[":61,"..":62,"..(":63,",":64,"{":65,"}":66,properties:67,property:68,"...":69,arrayItems:70,FUNCTION_START:71,FUNCTION_END:72,FUNCTION:73,sortingCompareList:74,sortingCompare:75,ASC:76,DESC:77,sliceNotationComponent:78,$accept:0,$end:1},terminals_:{2:"error",5:"EOF",10:"$",11:";",13:":",19:"NOT",20:"-",21:"+",22:"IN",23:"HAS",24:"NOTIN",25:"HASNO",26:"AND",27:"OR",28:"*",29:"/",30:"%",31:"=",32:"!=",33:"<",34:"<=",35:">",36:">=",37:"~=",38:"?",39:"SYMBOL",40:"TRUE",41:"FALSE",42:"NULL",43:"UNDEFINED",46:"@",47:"#",48:"STRING",49:"NUMBER",50:"REGEXP",53:"[",55:"]",56:"(",57:")",59:".",60:".(",61:".[",62:"..",63:"..(",64:",",65:"{",66:"}",69:"...",71:"FUNCTION_START",72:"FUNCTION_END",73:"FUNCTION",76:"ASC",77:"DESC"},productions_:[0,[3,2],[4,1],[4,1],[4,0],[6,2],[6,1],[7,1],[7,2],[9,2],[9,3],[9,5],[8,1],[8,1],[8,1],[8,1],[8,1],[18,2],[18,2],[18,2],[18,3],[18,3],[18,3],[18,3],[18,3],[18,3],[18,3],[18,3],[18,3],[18,3],[18,3],[18,3],[18,3],[18,3],[18,3],[18,3],[18,3],[18,3],[18,5],[12,1],[15,1],[15,1],[15,1],[15,1],[14,1],[14,1],[44,1],[44,1],[44,1],[44,2],[44,1],[44,1],[44,1],[44,1],[44,1],[44,3],[44,1],[44,3],[44,4],[44,3],[44,4],[44,2],[44,4],[44,5],[44,3],[44,3],[44,2],[44,4],[44,5],[44,3],[45,4],[45,4],[45,3],[45,5],[45,6],[45,4],[45,4],[45,3],[45,5],[45,6],[45,4],[58,1],[58,3],[51,2],[51,3],[67,1],[67,3],[68,1],[68,1],[68,2],[68,3],[68,3],[68,5],[68,1],[68,2],[52,2],[52,3],[70,1],[70,3],[16,3],[16,2],[17,1],[74,1],[74,3],[75,2],[75,2],[54,1],[54,2],[54,2],[54,3],[78,1],[78,2]],performAction:function(e,t,r,n,s,a,i){var o=a.length-1;switch(s){case 1:return n.buildResult(a[o-1]);case 2:case 12:case 13:case 14:case 15:case 16:case 44:case 45:case 53:case 54:break;case 3:this.$={type:"Block",definitions:a[o],body:{type:"Current"},range:this._$.range};break;case 4:this.$={type:"Block",definitions:[],body:{type:"Current"},range:this._$.range},n.suggestRanges.push([this._$,null,["var","path"],"current",this.$]);break;case 5:this.$={type:"Block",definitions:a[o-1],body:a[o],range:this._$.range};break;case 6:this.$={type:"Block",definitions:[],body:a[o],range:this._$.range};break;case 7:case 81:case 85:case 97:case 102:this.$=[a[o]];break;case 8:a[o-1].push(a[o]);break;case 9:this.$={type:"Definition",name:null,value:{type:"Current"},range:this._$.range},n.suggestRanges.push([i[o-1],i[o-1],"path","current",this.$]);break;case 10:this.$={type:"Definition",name:a[o-1],value:{type:"GetProperty",value:{type:"Current"},property:a[o-1]},range:this._$.range},n.suggestRanges.push([i[o-1],i[o-1],"path","current",this.$]);break;case 11:this.$={type:"Definition",name:a[o-3],value:a[o-1],range:this._$.range};break;case 17:this.$={type:"Unary",operator:"not",argument:a[o],range:this._$.range};break;case 18:this.$={type:"Unary",operator:"-",argument:a[o],range:this._$.range};break;case 19:this.$={type:"Unary",operator:"+",argument:a[o],range:this._$.range};break;case 20:this.$={type:"Binary",operator:a[o-1],left:a[o-2],right:a[o],range:this._$.range},n.suggestRanges.push([i[o-2],i[o-2],"in-value",a[o]]);break;case 21:this.$={type:"Binary",operator:a[o-1],left:a[o-2],right:a[o],range:this._$.range},n.suggestRanges.push([i[o],i[o],"in-value",a[o-2]]);break;case 22:case 23:case 24:case 25:case 26:case 27:case 28:case 29:case 30:case 33:case 34:case 35:case 36:case 37:this.$={type:"Binary",operator:a[o-1],left:a[o-2],right:a[o],range:this._$.range};break;case 31:case 32:this.$={type:"Binary",operator:a[o-1],left:a[o-2],right:a[o],range:this._$.range},n.suggestRanges.push([i[o],i[o],"value",a[o-2]]);break;case 38:this.$={type:"Conditional",test:a[o-4],consequent:a[o-2],alternate:a[o],range:this._$.range};break;case 39:this.$={type:"Identifier",name:a[o],range:this._$.range};break;case 40:this.$={type:"Literal",value:!0,range:this._$.range};break;case 41:this.$={type:"Literal",value:!1,range:this._$.range};break;case 42:this.$={type:"Literal",value:null,range:this._$.range};break;case 43:this.$={type:"Literal",value:void 0,range:this._$.range};break;case 46:this.$={type:"Data",range:this._$.range};break;case 47:this.$={type:"Context",range:this._$.range};break;case 48:this.$={type:"Current",range:this._$.range},n.suggestRanges.push([i[o],i[o],"var","current",this.$]);break;case 49:this.$={type:"Reference",name:a[o],range:this._$.range},n.suggestRanges.push([i[o-1],i[o],"var","current",this.$]);break;case 50:case 51:case 52:this.$={type:"Literal",value:a[o],range:this._$.range};break;case 55:this.$={type:"SliceNotation",value:{type:"Current"},arguments:a[o-1],range:this._$.range};break;case 56:this.$={type:"GetProperty",value:{type:"Current"},property:a[o],range:this._$.range},n.suggestRanges.push([i[o],i[o],"var","current",this.$],[i[o],i[o],"path","current",this.$]);break;case 57:this.$={type:"MethodCall",value:{type:"Current"},method:a[o-2],arguments:[],range:this._$.range},n.suggestRanges.push([i[o],i[o-1],["var","path"],"current",this.$]);break;case 58:this.$={type:"MethodCall",value:{type:"Current"},method:a[o-3],arguments:a[o-1],range:this._$.range},n.suggestRanges.push();break;case 59:this.$={type:"Parentheses",body:a[o-1],range:this._$.range};break;case 60:this.$={type:"Parentheses",body:{type:"Block",definitions:a[o-2],body:a[o-1]},range:this._$.range};break;case 61:this.$={type:"GetProperty",value:{type:"Current"},property:a[o],range:this._$.range},n.suggestRanges.push([null,this._$,["var","path"],"current",this.$],[i[o],i[o],"path","current",this.$]);break;case 62:this.$={type:"MethodCall",value:{type:"Current"},method:a[o-2],arguments:[],range:this._$.range},n.suggestRanges.push([null,this._$,["var","path"],"current",this.$],[i[o-2],i[o-2],"path","current",this.$],[i[o],i[o-1],["var","path"],"current",this.$]);break;case 63:this.$={type:"MethodCall",value:{type:"Current"},method:a[o-3],arguments:a[o-1],range:this._$.range},n.suggestRanges.push([null,this._$,["var","path"],"current",this.$],[i[o-3],i[o-3],"path","current",this.$]);break;case 64:this.$={type:"Map",value:{type:"Current"},query:a[o-1],range:this._$.range},n.suggestRanges.push([null,this._$,["var","path"],"current",this.$]);break;case 65:this.$={type:"Filter",value:{type:"Current"},query:a[o-1],range:this._$.range},n.suggestRanges.push([null,this._$,["var","path"],"current",this.$]);break;case 66:this.$={type:"Recursive",value:{type:"Current"},query:{type:"GetProperty",value:{type:"Current"},property:a[o]},range:this._$.range},n.suggestRanges.push([null,this._$,["var","path"],"current",this.$],[i[o],i[o],"path","current",this.$]);break;case 67:this.$={type:"Recursive",value:{type:"Current"},query:{type:"MethodCall",value:{type:"Current"},method:a[o-2],arguments:[]},range:this._$.range},n.suggestRanges.push([null,this._$,["var","path"],"current",this.$],[i[o-2],i[o-2],"path","current",this.$],[i[o],i[o-1],["var","path"],"current",this.$]);break;case 68:this.$={type:"Recursive",value:{type:"Current"},query:{type:"MethodCall",value:{type:"Current"},method:a[o-3],arguments:a[o-1]},range:this._$.range},n.suggestRanges.push([null,this._$,["var","path"],"current",this.$],[i[o-3],i[o-3],"path","current",this.$]);break;case 69:this.$={type:"Recursive",value:{type:"Current"},query:a[o-1],range:this._$.range},n.suggestRanges.push([null,this._$,["var","path"],"current",this.$]);break;case 70:this.$={type:"GetProperty",value:a[o-3],property:a[o-1],range:this._$.range};break;case 71:this.$={type:"SliceNotation",value:a[o-3],arguments:a[o-1],range:this._$.range};break;case 72:this.$={type:"GetProperty",value:a[o-2],property:a[o],range:this._$.range},n.suggestRanges.push([i[o],i[o],"path",a[o-2]]);break;case 73:this.$={type:"MethodCall",value:a[o-4],method:a[o-2],arguments:[],range:this._$.range},n.suggestRanges.push([i[o-2],i[o-2],"path",a[o-4]],[i[o],i[o-1],["var","path"],"current",this.$]);break;case 74:this.$={type:"MethodCall",value:a[o-5],method:a[o-3],arguments:a[o-1],range:this._$.range},n.suggestRanges.push([i[o-3],i[o-3],"path",a[o-5]]);break;case 75:this.$={type:"Map",value:a[o-3],query:a[o-1],range:this._$.range};break;case 76:this.$={type:"Filter",value:a[o-3],query:a[o-1],range:this._$.range};break;case 77:this.$={type:"Recursive",value:a[o-2],query:{type:"GetProperty",value:{type:"Current"},property:a[o]},range:this._$.range},n.suggestRanges.push([i[o],i[o],"path",a[o-2]]);break;case 78:this.$={type:"Recursive",value:a[o-4],query:{type:"MethodCall",value:{type:"Current"},method:a[o-2],arguments:[]},range:this._$.range},n.suggestRanges.push([i[o-2],i[o-2],"path",a[o-4]],[i[o],i[o-1],["var","path"],"current",this.$]);break;case 79:this.$={type:"Recursive",value:a[o-5],query:{type:"MethodCall",value:{type:"Current"},method:a[o-3],arguments:a[o-1]},range:this._$.range},n.suggestRanges.push([i[o-3],i[o-3],"path",a[o-5]]);break;case 80:this.$={type:"Recursive",value:a[o-3],query:a[o-1],range:this._$.range};break;case 82:case 86:case 98:case 103:a[o-2].push(a[o]);break;case 83:this.$={type:"Object",properties:[],range:this._$.range},n.suggestRanges.push([i[o],i[o-1],["var","path"],"current",this.$]);break;case 84:this.$={type:"Object",properties:a[o-1],range:this._$.range};break;case 87:this.$={type:"Property",key:a[o],value:{type:"GetProperty",value:{type:"Current"},property:a[o]},range:this._$.range},n.suggestRanges.push([i[o],i[o],"var","current",this.$],[i[o],i[o],"path","current",this.$]);break;case 88:this.$={type:"Property",key:null,value:{type:"Current"},range:this._$.range},n.suggestRanges.push([i[o],i[o],"var","current",this.$]);break;case 89:this.$={type:"Property",key:a[o],value:{type:"Reference",name:a[o]},range:this._$.range},n.suggestRanges.push([i[o-1],i[o],"var","current",this.$]);break;case 90:this.$={type:"Property",key:a[o-2],value:a[o],range:this._$.range};break;case 91:this.$={type:"Property",key:{type:"Literal",value:a[o-2]},value:a[o],range:this._$.range};break;case 92:this.$={type:"Property",key:a[o-3],value:a[o],range:this._$.range};break;case 93:this.$={type:"Spread",query:{type:"Current"},range:this._$.range},n.suggestRanges.push([i[o],null,["var","path"],"current",this.$]);break;case 94:this.$={type:"Spread",query:a[o],range:this._$.range};break;case 95:this.$={type:"Array",elements:[],range:this._$.range},n.suggestRanges.push([i[o],i[o-1],["var","path"],"current",this.$]);break;case 96:this.$={type:"Array",elements:a[o-1],range:this._$.range};break;case 99:this.$={type:"Function",arguments:[],body:a[o-1],range:this._$.range};break;case 100:this.$={type:"Function",arguments:[],body:a[o],range:this._$.range};break;case 101:this.$={type:"SortingFunction",compares:a[o],range:this._$.range};break;case 104:this.$={type:"Compare",query:a[o-1],reverse:!1,range:this._$.range};break;case 105:this.$={type:"Compare",query:a[o-1],reverse:!0,range:this._$.range};break;case 106:this.$=[null,a[o]];break;case 107:this.$=[null,a[o-1],a[o]];break;case 108:this.$=[a[o-1],a[o]];break;case 109:this.$=[a[o-2],a[o-1],a[o]];break;case 110:this.$=null;break;case 111:this.$=a[o]}},table:[{3:1,4:2,5:t,6:3,7:4,8:5,9:6,10:r,12:33,14:7,15:8,16:9,17:10,18:11,19:n,20:s,21:a,39:i,40:o,41:c,42:u,43:h,44:13,45:14,46:l,47:p,48:y,49:g,50:f,51:30,52:31,53:b,56:d,59:k,60:m,61:v,62:_,63:$,65:O,71:S,73:A,74:21,75:40},{1:[3]},{5:[1,43]},e(C,[2,2]),e(C,[2,3],{14:7,15:8,16:9,17:10,18:11,44:13,45:14,74:21,51:30,52:31,12:33,75:40,8:44,9:45,10:r,19:n,20:s,21:a,39:i,40:o,41:c,42:u,43:h,46:l,47:p,48:y,49:g,50:f,53:b,56:d,59:k,60:m,61:v,62:_,63:$,65:O,71:S,73:A}),e(C,[2,6],{20:E,21:R,22:x,23:N,24:w,25:P,26:I,27:j,28:T,29:q,30:F,31:M,32:L,33:U,34:D,35:B,36:Y,37:G,38:z}),e(J,[2,7]),e(H,[2,12],{53:X,59:Z,60:V,61:K,62:Q,63:W,76:ee,77:te}),e(H,[2,13]),e(H,[2,14]),e(H,[2,15]),e(H,[2,16]),e(re,ne,{12:74,11:[1,73],39:i}),e(se,[2,44]),e(se,[2,45]),e(H,[2,40]),e(H,[2,41]),e(H,[2,42]),e(H,[2,43]),{4:75,6:3,7:4,8:5,9:6,10:r,12:33,14:7,15:8,16:9,17:10,18:11,19:n,20:s,21:a,39:i,40:o,41:c,42:u,43:h,44:13,45:14,46:l,47:p,48:y,49:g,50:f,51:30,52:31,53:b,56:d,59:k,60:m,61:v,62:_,63:$,65:O,71:S,72:t,73:A,74:21,75:40},{8:76,10:ae,12:33,14:7,15:8,16:9,17:10,18:11,19:n,20:s,21:a,39:i,40:o,41:c,42:u,43:h,44:13,45:14,46:l,47:p,48:y,49:g,50:f,51:30,52:31,53:b,56:d,59:k,60:m,61:v,62:_,63:$,65:O,71:S,73:A,74:21,75:40},e([5,11,13,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,55,57,66,72],[2,101],{64:[1,78]}),{8:79,10:ae,12:33,14:7,15:8,16:9,17:10,18:11,19:n,20:s,21:a,39:i,40:o,41:c,42:u,43:h,44:13,45:14,46:l,47:p,48:y,49:g,50:f,51:30,52:31,53:b,56:d,59:k,60:m,61:v,62:_,63:$,65:O,71:S,73:A,74:21,75:40},{8:80,10:ae,12:33,14:7,15:8,16:9,17:10,18:11,19:n,20:s,21:a,39:i,40:o,41:c,42:u,43:h,44:13,45:14,46:l,47:p,48:y,49:g,50:f,51:30,52:31,53:b,56:d,59:k,60:m,61:v,62:_,63:$,65:O,71:S,73:A,74:21,75:40},{8:81,10:ae,12:33,14:7,15:8,16:9,17:10,18:11,19:n,20:s,21:a,39:i,40:o,41:c,42:u,43:h,44:13,45:14,46:l,47:p,48:y,49:g,50:f,51:30,52:31,53:b,56:d,59:k,60:m,61:v,62:_,63:$,65:O,71:S,73:A,74:21,75:40},e(se,[2,46]),e(se,[2,47]),e(se,[2,50]),e(se,[2,51]),e(se,[2,52]),e(se,[2,53]),e(se,[2,54]),{8:86,10:ae,12:33,13:ie,14:7,15:8,16:9,17:10,18:11,19:n,20:s,21:a,39:i,40:o,41:c,42:u,43:h,44:13,45:14,46:l,47:p,48:y,49:g,50:f,51:30,52:31,53:b,54:82,55:[1,83],56:d,59:k,60:m,61:v,62:_,63:$,65:O,70:84,71:S,73:A,74:21,75:40,78:85},e(se,[2,56],{56:[1,88]}),{7:90,8:89,9:6,10:r,12:33,14:7,15:8,16:9,17:10,18:11,19:n,20:s,21:a,39:i,40:o,41:c,42:u,43:h,44:13,45:14,46:l,47:p,48:y,49:g,50:f,51:30,52:31,53:b,56:d,59:k,60:m,61:v,62:_,63:$,65:O,71:S,73:A,74:21,75:40},{12:91,39:i},{4:92,6:3,7:4,8:5,9:6,10:r,12:33,14:7,15:8,16:9,17:10,18:11,19:n,20:s,21:a,39:i,40:o,41:c,42:u,43:h,44:13,45:14,46:l,47:p,48:y,49:g,50:f,51:30,52:31,53:b,56:d,57:t,59:k,60:m,61:v,62:_,63:$,65:O,71:S,73:A,74:21,75:40},{4:93,6:3,7:4,8:5,9:6,10:r,12:33,14:7,15:8,16:9,17:10,18:11,19:n,20:s,21:a,39:i,40:o,41:c,42:u,43:h,44:13,45:14,46:l,47:p,48:y,49:g,50:f,51:30,52:31,53:b,55:t,56:d,59:k,60:m,61:v,62:_,63:$,65:O,71:S,73:A,74:21,75:40},{12:94,39:i},{4:95,6:3,7:4,8:5,9:6,10:r,12:33,14:7,15:8,16:9,17:10,18:11,19:n,20:s,21:a,39:i,40:o,41:c,42:u,43:h,44:13,45:14,46:l,47:p,48:y,49:g,50:f,51:30,52:31,53:b,56:d,57:t,59:k,60:m,61:v,62:_,63:$,65:O,71:S,73:A,74:21,75:40},e(H,[2,102]),{10:oe,12:99,39:i,48:ce,53:ue,66:[1,96],67:97,68:98,69:he},e([5,11,13,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,53,55,56,57,59,60,61,62,63,64,66,72,76,77],[2,39]),{1:[2,1]},e(C,[2,5],{20:E,21:R,22:x,23:N,24:w,25:P,26:I,27:j,28:T,29:q,30:F,31:M,32:L,33:U,34:D,35:B,36:Y,37:G,38:z}),e(J,[2,8]),{8:104,10:ae,12:33,14:7,15:8,16:9,17:10,18:11,19:n,20:s,21:a,39:i,40:o,41:c,42:u,43:h,44:13,45:14,46:l,47:p,48:y,49:g,50:f,51:30,52:31,53:b,56:d,59:k,60:m,61:v,62:_,63:$,65:O,71:S,73:A,74:21,75:40},{8:105,10:ae,12:33,14:7,15:8,16:9,17:10,18:11,19:n,20:s,21:a,39:i,40:o,41:c,42:u,43:h,44:13,45:14,46:l,47:p,48:y,49:g,50:f,51:30,52:31,53:b,56:d,59:k,60:m,61:v,62:_,63:$,65:O,71:S,73:A,74:21,75:40},{8:106,10:ae,12:33,14:7,15:8,16:9,17:10,18:11,19:n,20:s,21:a,39:i,40:o,41:c,42:u,43:h,44:13,45:14,46:l,47:p,48:y,49:g,50:f,51:30,52:31,53:b,56:d,59:k,60:m,61:v,62:_,63:$,65:O,71:S,73:A,74:21,75:40},{8:107,10:ae,12:33,14:7,15:8,16:9,17:10,18:11,19:n,20:s,21:a,39:i,40:o,41:c,42:u,43:h,44:13,45:14,46:l,47:p,48:y,49:g,50:f,51:30,52:31,53:b,56:d,59:k,60:m,61:v,62:_,63:$,65:O,71:S,73:A,74:21,75:40},{8:108,10:ae,12:33,14:7,15:8,16:9,17:10,18:11,19:n,20:s,21:a,39:i,40:o,41:c,42:u,43:h,44:13,45:14,46:l,47:p,48:y,49:g,50:f,51:30,52:31,53:b,56:d,59:k,60:m,61:v,62:_,63:$,65:O,71:S,73:A,74:21,75:40},{8:109,10:ae,12:33,14:7,15:8,16:9,17:10,18:11,19:n,20:s,21:a,39:i,40:o,41:c,42:u,43:h,44:13,45:14,46:l,47:p,48:y,49:g,50:f,51:30,52:31,53:b,56:d,59:k,60:m,61:v,62:_,63:$,65:O,71:S,73:A,74:21,75:40},{8:110,10:ae,12:33,14:7,15:8,16:9,17:10,18:11,19:n,20:s,21:a,39:i,40:o,41:c,42:u,43:h,44:13,45:14,46:l,47:p,48:y,49:g,50:f,51:30,52:31,53:b,56:d,59:k,60:m,61:v,62:_,63:$,65:O,71:S,73:A,74:21,75:40},{8:111,10:ae,12:33,14:7,15:8,16:9,17:10,18:11,19:n,20:s,21:a,39:i,40:o,41:c,42:u,43:h,44:13,45:14,46:l,47:p,48:y,49:g,50:f,51:30,52:31,53:b,56:d,59:k,60:m,61:v,62:_,63:$,65:O,71:S,73:A,74:21,75:40},{8:112,10:ae,12:33,14:7,15:8,16:9,17:10,18:11,19:n,20:s,21:a,39:i,40:o,41:c,42:u,43:h,44:13,45:14,46:l,47:p,48:y,49:g,50:f,51:30,52:31,53:b,56:d,59:k,60:m,61:v,62:_,63:$,65:O,71:S,73:A,74:21,75:40},{8:113,10:ae,12:33,14:7,15:8,16:9,17:10,18:11,19:n,20:s,21:a,39:i,40:o,41:c,42:u,43:h,44:13,45:14,46:l,47:p,48:y,49:g,50:f,51:30,52:31,53:b,56:d,59:k,60:m,61:v,62:_,63:$,65:O,71:S,73:A,74:21,75:40},{8:114,10:ae,12:33,14:7,15:8,16:9,17:10,18:11,19:n,20:s,21:a,39:i,40:o,41:c,42:u,43:h,44:13,45:14,46:l,47:p,48:y,49:g,50:f,51:30,52:31,53:b,56:d,59:k,60:m,61:v,62:_,63:$,65:O,71:S,73:A,74:21,75:40},{8:115,10:ae,12:33,14:7,15:8,16:9,17:10,18:11,19:n,20:s,21:a,39:i,40:o,41:c,42:u,43:h,44:13,45:14,46:l,47:p,48:y,49:g,50:f,51:30,52:31,53:b,56:d,59:k,60:m,61:v,62:_,63:$,65:O,71:S,73:A,74:21,75:40},{8:116,10:ae,12:33,14:7,15:8,16:9,17:10,18:11,19:n,20:s,21:a,39:i,40:o,41:c,42:u,43:h,44:13,45:14,46:l,47:p,48:y,49:g,50:f,51:30,52:31,53:b,56:d,59:k,60:m,61:v,62:_,63:$,65:O,71:S,73:A,74:21,75:40},{8:117,10:ae,12:33,14:7,15:8,16:9,17:10,18:11,19:n,20:s,21:a,39:i,40:o,41:c,42:u,43:h,44:13,45:14,46:l,47:p,48:y,49:g,50:f,51:30,52:31,53:b,56:d,59:k,60:m,61:v,62:_,63:$,65:O,71:S,73:A,74:21,75:40},{8:118,10:ae,12:33,14:7,15:8,16:9,17:10,18:11,19:n,20:s,21:a,39:i,40:o,41:c,42:u,43:h,44:13,45:14,46:l,47:p,48:y,49:g,50:f,51:30,52:31,53:b,56:d,59:k,60:m,61:v,62:_,63:$,65:O,71:S,73:A,74:21,75:40},{8:119,10:ae,12:33,14:7,15:8,16:9,17:10,18:11,19:n,20:s,21:a,39:i,40:o,41:c,42:u,43:h,44:13,45:14,46:l,47:p,48:y,49:g,50:f,51:30,52:31,53:b,56:d,59:k,60:m,61:v,62:_,63:$,65:O,71:S,73:A,74:21,75:40},{8:120,10:ae,12:33,14:7,15:8,16:9,17:10,18:11,19:n,20:s,21:a,39:i,40:o,41:c,42:u,43:h,44:13,45:14,46:l,47:p,48:y,49:g,50:f,51:30,52:31,53:b,56:d,59:k,60:m,61:v,62:_,63:$,65:O,71:S,73:A,74:21,75:40},{8:121,10:ae,12:33,14:7,15:8,16:9,17:10,18:11,19:n,20:s,21:a,39:i,40:o,41:c,42:u,43:h,44:13,45:14,46:l,47:p,48:y,49:g,50:f,51:30,52:31,53:b,56:d,59:k,60:m,61:v,62:_,63:$,65:O,71:S,73:A,74:21,75:40},{8:122,10:ae,12:33,14:7,15:8,16:9,17:10,18:11,19:n,20:s,21:a,39:i,40:o,41:c,42:u,43:h,44:13,45:14,46:l,47:p,48:y,49:g,50:f,51:30,52:31,53:b,56:d,59:k,60:m,61:v,62:_,63:$,65:O,71:S,73:A,74:21,75:40},{8:123,10:ae,12:33,13:ie,14:7,15:8,16:9,17:10,18:11,19:n,20:s,21:a,39:i,40:o,41:c,42:u,43:h,44:13,45:14,46:l,47:p,48:y,49:g,50:f,51:30,52:31,53:b,54:124,56:d,59:k,60:m,61:v,62:_,63:$,65:O,71:S,73:A,74:21,75:40,78:85},{12:125,39:i},{4:126,6:3,7:4,8:5,9:6,10:r,12:33,14:7,15:8,16:9,17:10,18:11,19:n,20:s,21:a,39:i,40:o,41:c,42:u,43:h,44:13,45:14,46:l,47:p,48:y,49:g,50:f,51:30,52:31,53:b,56:d,57:t,59:k,60:m,61:v,62:_,63:$,65:O,71:S,73:A,74:21,75:40},{4:127,6:3,7:4,8:5,9:6,10:r,12:33,14:7,15:8,16:9,17:10,18:11,19:n,20:s,21:a,39:i,40:o,41:c,42:u,43:h,44:13,45:14,46:l,47:p,48:y,49:g,50:f,51:30,52:31,53:b,55:t,56:d,59:k,60:m,61:v,62:_,63:$,65:O,71:S,73:A,74:21,75:40},{12:128,39:i},{4:129,6:3,7:4,8:5,9:6,10:r,12:33,14:7,15:8,16:9,17:10,18:11,19:n,20:s,21:a,39:i,40:o,41:c,42:u,43:h,44:13,45:14,46:l,47:p,48:y,49:g,50:f,51:30,52:31,53:b,56:d,57:t,59:k,60:m,61:v,62:_,63:$,65:O,71:S,73:A,74:21,75:40},e(H,[2,104]),e(H,[2,105]),e(J,[2,9]),e(re,le,{11:[1,130],13:[1,131]}),{72:[1,132]},e(pe,[2,100],{20:E,21:R,22:x,23:N,24:w,25:P,26:I,27:j,28:T,29:q,30:F,31:M,32:L,33:U,34:D,35:B,36:Y,37:G,38:z}),e(se,ne,{12:133,39:i}),{10:ae,12:33,14:135,39:i,44:13,45:14,46:l,47:p,48:y,49:g,50:f,51:30,52:31,53:b,56:d,59:k,60:m,61:v,62:_,63:$,65:O,75:134},e(ye,[2,17],{20:E,21:R,22:x,23:N,24:w,25:P,28:T,29:q,30:F,31:M,32:L,33:U,34:D,35:B,36:Y,37:G}),e(ge,[2,18],{28:T,29:q,30:F}),e(ge,[2,19],{28:T,29:q,30:F}),{55:[1,136]},e(se,[2,95]),{55:[1,137],64:[1,138]},{13:ie,55:[2,106],78:139},e(fe,[2,97],{78:140,13:ie,20:E,21:R,22:x,23:N,24:w,25:P,26:I,27:j,28:T,29:q,30:F,31:M,32:L,33:U,34:D,35:B,36:Y,37:G,38:z}),e(be,[2,110],{14:7,15:8,16:9,17:10,18:11,44:13,45:14,74:21,51:30,52:31,12:33,75:40,8:141,10:ae,19:n,20:s,21:a,39:i,40:o,41:c,42:u,43:h,46:l,47:p,48:y,49:g,50:f,53:b,56:d,59:k,60:m,61:v,62:_,63:$,65:O,71:S,73:A}),{8:144,10:ae,12:33,14:7,15:8,16:9,17:10,18:11,19:n,20:s,21:a,39:i,40:o,41:c,42:u,43:h,44:13,45:14,46:l,47:p,48:y,49:g,50:f,51:30,52:31,53:b,56:d,57:[1,142],58:143,59:k,60:m,61:v,62:_,63:$,65:O,71:S,73:A,74:21,75:40},{20:E,21:R,22:x,23:N,24:w,25:P,26:I,27:j,28:T,29:q,30:F,31:M,32:L,33:U,34:D,35:B,36:Y,37:G,38:z,57:[1,145]},{8:146,9:45,10:r,12:33,14:7,15:8,16:9,17:10,18:11,19:n,20:s,21:a,39:i,40:o,41:c,42:u,43:h,44:13,45:14,46:l,47:p,48:y,49:g,50:f,51:30,52:31,53:b,56:d,59:k,60:m,61:v,62:_,63:$,65:O,71:S,73:A,74:21,75:40},e(se,[2,61],{56:[1,147]}),{57:[1,148]},{55:[1,149]},e(se,[2,66],{56:[1,150]}),{57:[1,151]},e(se,[2,83]),{64:[1,153],66:[1,152]},e(de,[2,85]),e(de,[2,87],{13:[1,154]}),e(de,[2,88],{12:155,39:i}),{13:[1,156]},{8:157,10:ae,12:33,14:7,15:8,16:9,17:10,18:11,19:n,20:s,21:a,39:i,40:o,41:c,42:u,43:h,44:13,45:14,46:l,47:p,48:y,49:g,50:f,51:30,52:31,53:b,56:d,59:k,60:m,61:v,62:_,63:$,65:O,71:S,73:A,74:21,75:40},e(de,[2,93],{44:13,45:14,51:30,52:31,12:33,14:158,10:ae,39:i,46:l,47:p,48:y,49:g,50:f,53:b,56:d,59:k,60:m,61:v,62:_,63:$,65:O}),e(ke,[2,20],{20:E,21:R,28:T,29:q,30:F,31:M,32:L,33:U,34:D,35:B,36:Y,37:G}),e(ke,[2,21],{20:E,21:R,28:T,29:q,30:F,31:M,32:L,33:U,34:D,35:B,36:Y,37:G}),e(ke,[2,22],{20:E,21:R,28:T,29:q,30:F,31:M,32:L,33:U,34:D,35:B,36:Y,37:G}),e(ke,[2,23],{20:E,21:R,28:T,29:q,30:F,31:M,32:L,33:U,34:D,35:B,36:Y,37:G}),e(ye,[2,24],{20:E,21:R,22:x,23:N,24:w,25:P,28:T,29:q,30:F,31:M,32:L,33:U,34:D,35:B,36:Y,37:G}),e([5,11,13,27,38,55,57,64,66,72],[2,25],{20:E,21:R,22:x,23:N,24:w,25:P,26:I,28:T,29:q,30:F,31:M,32:L,33:U,34:D,35:B,36:Y,37:G}),e(ge,[2,26],{28:T,29:q,30:F}),e(ge,[2,27],{28:T,29:q,30:F}),e(H,[2,28]),e(H,[2,29]),e(H,[2,30]),e(me,[2,31],{20:E,21:R,28:T,29:q,30:F,33:U,34:D,35:B,36:Y}),e(me,[2,32],{20:E,21:R,28:T,29:q,30:F,33:U,34:D,35:B,36:Y}),e(ve,[2,33],{20:E,21:R,28:T,29:q,30:F}),e(ve,[2,34],{20:E,21:R,28:T,29:q,30:F}),e(ve,[2,35],{20:E,21:R,28:T,29:q,30:F}),e(ve,[2,36],{20:E,21:R,28:T,29:q,30:F}),e(me,[2,37],{20:E,21:R,28:T,29:q,30:F,33:U,34:D,35:B,36:Y}),{13:[1,159],20:E,21:R,22:x,23:N,24:w,25:P,26:I,27:j,28:T,29:q,30:F,31:M,32:L,33:U,34:D,35:B,36:Y,37:G,38:z},{13:ie,20:E,21:R,22:x,23:N,24:w,25:P,26:I,27:j,28:T,29:q,30:F,31:M,32:L,33:U,34:D,35:B,36:Y,37:G,38:z,55:[1,160],78:140},{55:[1,161]},e(se,[2,72],{56:[1,162]}),{57:[1,163]},{55:[1,164]},e(se,[2,77],{56:[1,165]}),{57:[1,166]},e(J,[2,10]),{8:167,10:ae,12:33,14:7,15:8,16:9,17:10,18:11,19:n,20:s,21:a,39:i,40:o,41:c,42:u,43:h,44:13,45:14,46:l,47:p,48:y,49:g,50:f,51:30,52:31,53:b,56:d,59:k,60:m,61:v,62:_,63:$,65:O,71:S,73:A,74:21,75:40},e(H,[2,99]),e(se,le),e(H,[2,103]),{53:X,59:Z,60:V,61:K,62:Q,63:W,76:ee,77:te},e(se,[2,55]),e(se,[2,96]),{8:168,10:ae,12:33,14:7,15:8,16:9,17:10,18:11,19:n,20:s,21:a,39:i,40:o,41:c,42:u,43:h,44:13,45:14,46:l,47:p,48:y,49:g,50:f,51:30,52:31,53:b,56:d,59:k,60:m,61:v,62:_,63:$,65:O,71:S,73:A,74:21,75:40},{55:[2,107]},{13:ie,55:[2,108],78:169},e(be,[2,111],{20:E,21:R,22:x,23:N,24:w,25:P,26:I,27:j,28:T,29:q,30:F,31:M,32:L,33:U,34:D,35:B,36:Y,37:G,38:z}),e(se,[2,57]),{57:[1,170],64:_e},e($e,[2,81],{20:E,21:R,22:x,23:N,24:w,25:P,26:I,27:j,28:T,29:q,30:F,31:M,32:L,33:U,34:D,35:B,36:Y,37:G,38:z}),e(se,[2,59]),{20:E,21:R,22:x,23:N,24:w,25:P,26:I,27:j,28:T,29:q,30:F,31:M,32:L,33:U,34:D,35:B,36:Y,37:G,38:z,57:[1,172]},{8:144,10:ae,12:33,14:7,15:8,16:9,17:10,18:11,19:n,20:s,21:a,39:i,40:o,41:c,42:u,43:h,44:13,45:14,46:l,47:p,48:y,49:g,50:f,51:30,52:31,53:b,56:d,57:[1,173],58:174,59:k,60:m,61:v,62:_,63:$,65:O,71:S,73:A,74:21,75:40},e(se,[2,64]),e(se,[2,65]),{8:144,10:ae,12:33,14:7,15:8,16:9,17:10,18:11,19:n,20:s,21:a,39:i,40:o,41:c,42:u,43:h,44:13,45:14,46:l,47:p,48:y,49:g,50:f,51:30,52:31,53:b,56:d,57:[1,175],58:176,59:k,60:m,61:v,62:_,63:$,65:O,71:S,73:A,74:21,75:40},e(se,[2,69]),e(se,[2,84]),{10:oe,12:99,39:i,48:ce,53:ue,68:177,69:he},{8:178,10:ae,12:33,14:7,15:8,16:9,17:10,18:11,19:n,20:s,21:a,39:i,40:o,41:c,42:u,43:h,44:13,45:14,46:l,47:p,48:y,49:g,50:f,51:30,52:31,53:b,56:d,59:k,60:m,61:v,62:_,63:$,65:O,71:S,73:A,74:21,75:40},e(de,[2,89]),{8:179,10:ae,12:33,14:7,15:8,16:9,17:10,18:11,19:n,20:s,21:a,39:i,40:o,41:c,42:u,43:h,44:13,45:14,46:l,47:p,48:y,49:g,50:f,51:30,52:31,53:b,56:d,59:k,60:m,61:v,62:_,63:$,65:O,71:S,73:A,74:21,75:40},{20:E,21:R,22:x,23:N,24:w,25:P,26:I,27:j,28:T,29:q,30:F,31:M,32:L,33:U,34:D,35:B,36:Y,37:G,38:z,55:[1,180]},e(de,[2,94],{53:X,59:Z,60:V,61:K,62:Q,63:W}),{8:181,10:ae,12:33,14:7,15:8,16:9,17:10,18:11,19:n,20:s,21:a,39:i,40:o,41:c,42:u,43:h,44:13,45:14,46:l,47:p,48:y,49:g,50:f,51:30,52:31,53:b,56:d,59:k,60:m,61:v,62:_,63:$,65:O,71:S,73:A,74:21,75:40},e(se,[2,70]),e(se,[2,71]),{8:144,10:ae,12:33,14:7,15:8,16:9,17:10,18:11,19:n,20:s,21:a,39:i,40:o,41:c,42:u,43:h,44:13,45:14,46:l,47:p,48:y,49:g,50:f,51:30,52:31,53:b,56:d,57:[1,182],58:183,59:k,60:m,61:v,62:_,63:$,65:O,71:S,73:A,74:21,75:40},e(se,[2,75]),e(se,[2,76]),{8:144,10:ae,12:33,14:7,15:8,16:9,17:10,18:11,19:n,20:s,21:a,39:i,40:o,41:c,42:u,43:h,44:13,45:14,46:l,47:p,48:y,49:g,50:f,51:30,52:31,53:b,56:d,57:[1,184],58:185,59:k,60:m,61:v,62:_,63:$,65:O,71:S,73:A,74:21,75:40},e(se,[2,80]),{11:[1,186],20:E,21:R,22:x,23:N,24:w,25:P,26:I,27:j,28:T,29:q,30:F,31:M,32:L,33:U,34:D,35:B,36:Y,37:G,38:z},e(fe,[2,98],{20:E,21:R,22:x,23:N,24:w,25:P,26:I,27:j,28:T,29:q,30:F,31:M,32:L,33:U,34:D,35:B,36:Y,37:G,38:z}),{55:[2,109]},e(se,[2,58]),{8:187,10:ae,12:33,14:7,15:8,16:9,17:10,18:11,19:n,20:s,21:a,39:i,40:o,41:c,42:u,43:h,44:13,45:14,46:l,47:p,48:y,49:g,50:f,51:30,52:31,53:b,56:d,59:k,60:m,61:v,62:_,63:$,65:O,71:S,73:A,74:21,75:40},e(se,[2,60]),e(se,[2,62]),{57:[1,188],64:_e},e(se,[2,67]),{57:[1,189],64:_e},e(de,[2,86]),e(de,[2,90],{20:E,21:R,22:x,23:N,24:w,25:P,26:I,27:j,28:T,29:q,30:F,31:M,32:L,33:U,34:D,35:B,36:Y,37:G,38:z}),e(de,[2,91],{20:E,21:R,22:x,23:N,24:w,25:P,26:I,27:j,28:T,29:q,30:F,31:M,32:L,33:U,34:D,35:B,36:Y,37:G,38:z}),{13:[1,190]},e(pe,[2,38],{20:E,21:R,22:x,23:N,24:w,25:P,26:I,27:j,28:T,29:q,30:F,31:M,32:L,33:U,34:D,35:B,36:Y,37:G,38:z}),e(se,[2,73]),{57:[1,191],64:_e},e(se,[2,78]),{57:[1,192],64:_e},e(J,[2,11]),e($e,[2,82],{20:E,21:R,22:x,23:N,24:w,25:P,26:I,27:j,28:T,29:q,30:F,31:M,32:L,33:U,34:D,35:B,36:Y,37:G,38:z}),e(se,[2,63]),e(se,[2,68]),{8:193,10:ae,12:33,14:7,15:8,16:9,17:10,18:11,19:n,20:s,21:a,39:i,40:o,41:c,42:u,43:h,44:13,45:14,46:l,47:p,48:y,49:g,50:f,51:30,52:31,53:b,56:d,59:k,60:m,61:v,62:_,63:$,65:O,71:S,73:A,74:21,75:40},e(se,[2,74]),e(se,[2,79]),e(de,[2,92],{20:E,21:R,22:x,23:N,24:w,25:P,26:I,27:j,28:T,29:q,30:F,31:M,32:L,33:U,34:D,35:B,36:Y,37:G,38:z})],defaultActions:{43:[2,1],139:[2,107],169:[2,109]},parseError:function(e,t){if(!t.recoverable){var r=new Error(e);throw r.hash=t,r}this.trace(e)},parse:function(e){var t=this,r=[0],n=[null],s=[],a=this.table,i="",o=0,c=0,u=2,h=1,l=s.slice.call(arguments,1),p=Object.create(this.lexer),y={yy:{}};for(var g in this.yy)Object.prototype.hasOwnProperty.call(this.yy,g)&&(y.yy[g]=this.yy[g]);p.setInput(e,y.yy),y.yy.lexer=p,y.yy.parser=this,void 0===p.yylloc&&(p.yylloc={});var f=p.yylloc;s.push(f);var b=p.options&&p.options.ranges;"function"==typeof y.yy.parseError?this.parseError=y.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;for(var d,k,m,v,_,$,O,S,A,C=function(){var e;return"number"!=typeof(e=p.lex()||h)&&(e=t.symbols_[e]||e),e},E={};;){if(m=r[r.length-1],this.defaultActions[m]?v=this.defaultActions[m]:(null==d&&(d=C()),v=a[m]&&a[m][d]),void 0===v||!v.length||!v[0]){var R="";for($ in A=[],a[m])this.terminals_[$]&&$>u&&A.push("'"+this.terminals_[$]+"'");R=p.showPosition?"Parse error on line "+(o+1)+":\n"+p.showPosition()+"\nExpecting "+A.join(", ")+", got '"+(this.terminals_[d]||d)+"'":"Parse error on line "+(o+1)+": Unexpected "+(d==h?"end of input":"'"+(this.terminals_[d]||d)+"'"),this.parseError(R,{text:p.match,token:this.terminals_[d]||d,line:p.yylineno,loc:f,expected:A})}if(v[0]instanceof Array&&v.length>1)throw new Error("Parse Error: multiple actions possible at state: "+m+", token: "+d);switch(v[0]){case 1:r.push(d),n.push(p.yytext),s.push(p.yylloc),r.push(v[1]),d=null,k?(d=k,k=null):(c=p.yyleng,i=p.yytext,o=p.yylineno,f=p.yylloc);break;case 2:if(O=this.productions_[v[1]][1],E.$=n[n.length-O],E._$={first_line:s[s.length-(O||1)].first_line,last_line:s[s.length-1].last_line,first_column:s[s.length-(O||1)].first_column,last_column:s[s.length-1].last_column},b&&(E._$.range=[s[s.length-(O||1)].range[0],s[s.length-1].range[1]]),void 0!==(_=this.performAction.apply(E,[i,c,o,y.yy,v[1],n,s].concat(l))))return _;O&&(r=r.slice(0,-1*O*2),n=n.slice(0,-1*O),s=s.slice(0,-1*O)),r.push(this.productions_[v[1]][0]),n.push(E.$),s.push(E._$),S=a[r[r.length-2]][r[r.length-1]],r.push(S);break;case 3:return!0}}return!0}},Se={EOF:1,parseError:function(e,t){if(!this.yy.parser)throw new Error(e);this.yy.parser.parseError(e,t)},setInput:function(e,t){return this.yy=t||this.yy||{},this._input=e,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var e=this._input[0];return this.yytext+=e,this.yyleng++,this.offset++,this.match+=e,this.matched+=e,e.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),e},unput:function(e){var t=e.length,r=e.split(/(?:\r\n?|\n)/g);this._input=e+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-t),this.offset-=t;var n=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),r.length-1&&(this.yylineno-=r.length-1);var s=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:r?(r.length===n.length?this.yylloc.first_column:0)+n[n.length-r.length].length-r[0].length:this.yylloc.first_column-t},this.options.ranges&&(this.yylloc.range=[s[0],s[0]+this.yyleng-t]),this.yyleng=this.yytext.length,this},more:function(){return this._more=!0,this},reject:function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},less:function(e){this.unput(this.match.slice(e))},pastInput:function(){var e=this.matched.substr(0,this.matched.length-this.match.length);return(e.length>20?"...":"")+e.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var e=this.match;return e.length<20&&(e+=this._input.substr(0,20-e.length)),(e.substr(0,20)+(e.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var e=this.pastInput(),t=new Array(e.length+1).join("-");return e+this.upcomingInput()+"\n"+t+"^"},test_match:function(e,t){var r,n,s;if(this.options.backtrack_lexer&&(s={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(s.yylloc.range=this.yylloc.range.slice(0))),(n=e[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=n.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:n?n[n.length-1].length-n[n.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+e[0].length},this.yytext+=e[0],this.match+=e[0],this.matches=e,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(e[0].length),this.matched+=e[0],r=this.performAction.call(this,this.yy,this,t,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),r)return r;if(this._backtrack){for(var a in s)this[a]=s[a];return!1}return!1},next:function(){if(this.done)return this.EOF;var e,t,r,n;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var s=this._currentRules(),a=0;a<s.length;a++)if((r=this._input.match(this.rules[s[a]]))&&(!t||r[0].length>t[0].length)){if(t=r,n=a,this.options.backtrack_lexer){if(!1!==(e=this.test_match(r,s[a])))return e;if(this._backtrack){t=!1;continue}return!1}if(!this.options.flex)break}return t?!1!==(e=this.test_match(t,s[n]))&&e:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var e=this.next();return e||this.lex()},begin:function(e){this.conditionStack.push(e)},popState:function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},_currentRules:function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},topState:function(e){return(e=this.conditionStack.length-1-Math.abs(e||0))>=0?this.conditionStack[e]:"INITIAL"},pushState:function(e){this.begin(e)},stateStackSize:function(){return this.conditionStack.length},options:{ranges:!0},performAction:function(e,t,r,n){switch(r){case 0:e.commentRanges.push(t.yylloc.range);break;case 1:break;case 2:return this.popState(),"/";case 3:return this.popState(),"<";case 4:this.done=!1,this.popState();break;case 5:return this.fnOpenedStack.push(this.fnOpened),this.fnOpened=0,"(";case 6:return this.fnOpened=this.fnOpenedStack.pop()||0,this._input&&this.begin("preventPrimitive"),")";case 7:return this.fnOpenedStack.push(this.fnOpened),this.fnOpened=0,"[";case 8:return this.fnOpened=this.fnOpenedStack.pop()||0,this._input&&this.begin("preventPrimitive"),"]";case 9:return this.fnOpenedStack.push(this.fnOpened),this.fnOpened=0,"{";case 10:return this.fnOpened=this.fnOpenedStack.pop()||0,this._input&&this.begin("preventPrimitive"),"}";case 11:return"TRUE";case 12:return"FALSE";case 13:return"NULL";case 14:return"UNDEFINED";case 15:return"AND";case 16:return"OR";case 17:return"HASNO";case 18:return"HAS";case 19:return"IN";case 20:return"NOTIN";case 21:return"NOT";case 22:return"ASC";case 23:return"DESC";case 24:return this._input&&this.begin("preventPrimitive"),"@";case 25:return this._input&&this.begin("preventPrimitive"),"#";case 26:return this._input&&this.begin("preventPrimitive"),"$";case 27:return this._input&&this.begin("preventPrimitive"),t.yytext=Number(t.yytext),"NUMBER";case 28:case 29:return this._input&&this.begin("preventPrimitive"),t.yytext=this.toStringLiteral(t.yytext),"STRING";case 30:return this._input&&this.begin("preventPrimitive"),"SYMBOL";case 31:return this._input&&this.begin("preventPrimitive"),t.yytext=this.toRegExp(t.yytext),"REGEXP";case 32:return"FUNCTION";case 33:return this.fnOpened++,"FUNCTION_START";case 34:return"=";case 35:return"!=";case 36:return"~=";case 37:return">=";case 38:return"<=";case 39:return"<";case 40:return this.fnOpened?(this.fnOpened--,"FUNCTION_END"):">";case 41:return this.fnOpenedStack.push(this.fnOpened),this.fnOpened=0,"..(";case 42:return this.fnOpenedStack.push(this.fnOpened),this.fnOpened=0,".(";case 43:return this.fnOpenedStack.push(this.fnOpened),this.fnOpened=0,".[";case 44:return"...";case 45:return this._input&&this.begin("preventPrimitive"),"..";case 46:return this._input&&this.begin("preventPrimitive"),".";case 47:return"?";case 48:return",";case 49:return":";case 50:return";";case 51:return"-";case 52:return"+";case 53:return"*";case 54:return"/";case 55:return"%";case 56:return"EOF"}},rules:[/^(?:(\/\/.*?(\r|\n|$)))/,/^(?:(\s+))/,/^(?:\/)/,/^(?:<(?!=))/,/^(?:)/,/^(?:\()/,/^(?:\))/,/^(?:\[)/,/^(?:\])/,/^(?:\{)/,/^(?:\})/,/^(?:true(\b))/,/^(?:false(\b))/,/^(?:null(\b))/,/^(?:undefined(\b))/,/^(?:and(\b))/,/^(?:or(\b))/,/^(?:has(\s+)no(\b))/,/^(?:has(\b))/,/^(?:in(\b))/,/^(?:not(\s+)in(\b))/,/^(?:not?(\b))/,/^(?:asc(\b))/,/^(?:desc(\b))/,/^(?:@)/,/^(?:#)/,/^(?:\$)/,/^(?:\d+(?:\.\d+)?([eE][-+]?\d+)?(\b))/,/^(?:"(?:\\.|[^"])*")/,/^(?:'(?:\\.|[^'])*')/,/^(?:[a-zA-Z_][a-zA-Z_$0-9]*)/,/^(?:(\/(?:\\.|[^/])+\/i?))/,/^(?:=>)/,/^(?:<(?!=))/,/^(?:=)/,/^(?:!=)/,/^(?:~=)/,/^(?:>=)/,/^(?:<=)/,/^(?:<)/,/^(?:>)/,/^(?:\.\.\()/,/^(?:\.\()/,/^(?:\.\[)/,/^(?:\.\.\.)/,/^(?:\.\.)/,/^(?:\.)/,/^(?:\?)/,/^(?:,)/,/^(?::)/,/^(?:;)/,/^(?:\-)/,/^(?:\+)/,/^(?:\*)/,/^(?:\/)/,/^(?:\%)/,/^(?:$)/],conditions:{preventPrimitive:{rules:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56],inclusive:!0},INITIAL:{rules:[0,1,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56],inclusive:!0}}};function Ae(){this.yy={}}return Oe.lexer=Se,Ae.prototype=Oe,Oe.Parser=Ae,new Ae}());function d(e,t){return"GetProperty"===e.type&&("Current"===e.value.type&&("Identifier"===e.property.type&&e.property.name===t))}var k=function(e){function t(e){switch(e.type){case"Data":n("@");break;case"Context":n("#");break;case"Current":n("$");break;case"Literal":n("string"==typeof e.value?JSON.stringify(e.value):String(e.value));break;case"Identifier":n(e.name);break;case"Unary":n(e.operator),"-"!==e.operator&&"+"!==e.operator&&n(" "),t(e.argument);break;case"Binary":t(e.left),/^[a-z]/i.test(e.operator)?(n(" "),n(e.operator),n(" ")):n(e.operator),t(e.right);break;case"Conditional":t(e.test),n("?"),t(e.consequent),n(":"),t(e.alternate);break;case"Object":n("{"),a(e.properties,","),n("}");break;case"Property":if(!e.key||(r=e.key,i=e.value,"Identifier"===r.type&&"Reference"===i.type&&"Identifier"===i.name.type&&r.name===i.name.name)){t(e.value);break}"Literal"===e.key.type||"Identifier"===e.key.type?t(e.key):(n("["),t(e.key),n("]")),"Identifier"===e.key.type&&d(e.value,e.key.name)||(n(":"),t(e.value));break;case"Spread":n("..."),s(e.query);break;case"Array":n("["),a(e.elements,","),n("]");break;case"Function":n("<"),t(e.body),n(">");break;case"Compare":t(e.query),n(e.reverse?" desc":" asc");break;case"SortingFunction":a(e.compares,",");break;case"MethodCall":s(e.value)&&n("."),t(e.method),n("("),a(e.arguments,","),n(")");break;case"Definition":e.name?(n("$"),t(e.name),"Identifier"===e.name.type&&d(e.value,e.name.name)||(n(":"),t(e.value))):t(e.value),n(";");break;case"Parentheses":n("("),t(e.body),n(")");break;case"Block":e.definitions.forEach(t),t(e.body);break;case"Reference":n("$"),t(e.name);break;case"Map":s(e.value),n(".("),t(e.query),n(")");break;case"Filter":s(e.value),n(".["),t(e.query),n("]");break;case"Recursive":s(e.value),n("..("),t(e.query),n(")");break;case"GetProperty":"Identifier"===e.property.type?(s(e.value)&&n("."),t(e.property)):(t(e.value),n("["),t(e.property),n("]"));break;case"SliceNotation":{const[r,a,i]=e.arguments;s(e.value),n("["),r&&t(r),n(":"),a&&t(a),i&&(n(":"),t(i)),n("]");break}default:throw new Error("Unknown node type `"+e.type+"`")}var r,i}const r=[],n=e=>r.push(e),s=e=>{if("Current"!==e.type)return t(e),!0},a=(e,r)=>{e.forEach((e,s)=>{s>0&&n(r),t(e)})};return t(e),r.join("")};const m={"-":"-","+":"+",no:"!",not:"!"},v={in:"in","not in":"in",has:"-","has no":"-",and:"and",or:"or","+":"add","-":"sub","*":"mul","/":"div","%":"mod","=":"eq","!=":"ne","<":"lt","<=":"lte",">":"gt",">=":"gte","~=":"match"};var _=function(e,t=[],r=!1){function n(e,t,r){let n;return"var"===r?n=JSON.stringify(c):(e||(e="v"+f++),n=e),"[]"!==n&&b.push([n,JSON.stringify([t[0],t[1]]),JSON.stringify(r)].join(",")),e}function s(e){return e.reduce((e,t)=>n(e,t,t[2])||e,void 0)}function a(e,t){const r=c,n=h.length;if((c=c.slice()).firstCurrent=null,c.captureCurrent=[],e(),c.captureCurrent.length){const e=s(c.captureCurrent);if(e){const r="stat("+e+",current)";c.firstCurrent?h[c.firstCurrent]=r:h[n]=t(h[n],r)}}c=r}function i(e){const t=r&&g.has(e);if(t){const t=s(g.get(e));t&&l("stat("+t+","),g.delete()}switch(r&&y.has(e)&&c.captureCurrent.push(...y.get(e).filter(e=>{if("var"!==e[2])return!0;n(null,e,e[2])})),e.type){case"Data":l("data");break;case"Context":l("context");break;case"Current":null!==c.firstCurrent||c.captureCurrent.disabled||(c.firstCurrent=h.length),l("current");break;case"Literal":l("string"==typeof e.value?JSON.stringify(e.value):String(e.value));break;case"Identifier":l(e.name);break;case"Unary":if(e.operator in m==!1)throw new Error("Unknown operator `"+e.operator+"`");"not"===e.operator||"no"===e.operator?(l("!f.bool("),i(e.argument),l(")")):(l(m[e.operator]),i(e.argument));break;case"Binary":if(e.operator in v==!1)throw new Error("Unknown operator `"+e.operator+"`");switch("not in"!==e.operator&&"has no"!==e.operator||l("!"),e.operator){case"has":case"has no":l("f.in("),i(e.right),l(","),i(e.left),l(")");break;case"or":u=!0,l("f.bool(tmp="),i(e.left),l(")?tmp:"),c.captureCurrent.disabled=!0,i(e.right),c.captureCurrent.disabled=!1;break;case"and":u=!0,l("f.bool(tmp="),i(e.left),l(")?"),c.captureCurrent.disabled=!0,i(e.right),c.captureCurrent.disabled=!1,l(":tmp");break;default:l("f."),l(v[e.operator]),l("("),i(e.left),l(","),i(e.right),l(")")}break;case"Conditional":l("f.bool("),i(e.test),c.captureCurrent.disabled=!0,l(")?"),i(e.consequent),l(":"),i(e.alternate),c.captureCurrent.disabled=!1;break;case"Object":l("{"),p(e.properties,","),l("}");break;case"Property":if(!e.key)break;"Literal"===e.key.type||"Identifier"===e.key.type?i(e.key):(l("["),i(e.key),l("]")),l(":"),i(e.value);break;case"Spread":l("..."),i(e.query);break;case"Array":l("["),p(e.elements,","),l("]");break;case"Function":a(()=>{l("current=>("),i(e.body),l(")")},(e,t)=>e+t+",");break;case"Compare":e.reverse&&l("-"),a(()=>{l("f.cmp((_q=current=>("),i(e.query),l("))(a),_q(b))")},(e,t)=>e+t+",");break;case"SortingFunction":l("(a, b)=>{let _q;return "),p(e.compares,"||"),l("||0}");break;case"MethodCall":l("m."),i(e.method),l("("),i(e.value),e.arguments.length&&(l(","),p(e.arguments,",")),l(")");break;case"Definition":if(!e.name)break;if(c.includes(e.name.name))throw new Error(`Identifier '$${e.name.name}' has already been declared`);if(o.includes(e.name.name))throw new Error(`Identifier '$${e.name.name}' is reserved for future use`);l("const $"),i(e.name),l("="),i(e.value),l(";"),c.push(e.name.name);break;case"Parentheses":l("("),i(e.body),l(")");break;case"Block":e.definitions.length?a(()=>{l("(()=>{"),p(e.definitions),l("return "),i(e.body),l("})()")},(e,t)=>e+t+";"):"Object"===e.body.type?(l("("),i(e.body),l(")")):i(e.body);break;case"Reference":c.includes(e.name.name)?(l("$"),i(e.name)):(l("typeof $"),i(e.name),l('!=="undefined"?$'),i(e.name),l(":undefined"));break;case"Map":l("f.map("),i(e.value),a(()=>{l(",current=>"),i(e.query)},(e,t)=>(l(")"),e+"("+t+",")),l(")");break;case"Filter":l("f.filter("),i(e.value),a(()=>{l(",current=>"),i(e.query)},(e,t)=>(l(")"),e+"("+t+",")),l(")");break;case"Recursive":l("f.recursive("),i(e.value),a(()=>{l(",current=>"),i(e.query)},(e,t)=>(l(")"),e+"("+t+",")),l(")");break;case"GetProperty":l("f.map("),i(e.value),l(","),"Identifier"===e.property.type?l(JSON.stringify(e.property.name)):i(e.property),l(")");break;case"SliceNotation":l("f.slice("),i(e.value),e.arguments.slice(0,3).forEach(e=>{l(","),e?i(e):l("undefined")}),l(")")}t&&l(")")}const o=["data","context","ctx","array","idx","index"];let c=[],u=!1;const h=["const current=data;","return "],l=e=>h.push(e),p=(e,t)=>{e.forEach((e,r)=>{r>0&&l(t),i(e)})},y=t.reduce((e,t)=>("current"===t[3]&&(e.has(t[4])?e.get(t[4]).push(t):e.set(t[4],[t])),e),new Map),g=t.reduce((e,t)=>(t[3]&&"current"!==t[3]&&(e.has(t[3])?e.get(t[3]).push(t):e.set(t[3],[t])),e),new Map);let f=0;const b=[];return a(()=>i(e),(e,t)=>(l(")"),e+"("+t+",")),u&&h.unshift("let tmp;"),r&&(f>0&&(h.unshift("const "+Array.from(Array(f),(e,t)=>"v"+t+"=new Set()")+";\n"),h.unshift("const stat=(values,v)=>(values.add(v),v);\n")),l("\n,["+b.map(e=>"["+e+"]")+"]")),new Function("f","m","data","context",h.join(""))};var $,O=($=t)&&$.default||$;const{version:S}=O,{strict:A,tolerant:C}=b,{addToSet:E,isPlainObject:R}=n,x=new Map,N=new Map,w=new Map,P=new Map,I={path:"property",key:"property",value:"value","in-value":"value",var:"variable"};function j(e,t,r,n){const s=[];for(let a=0;a<r.length;a++){const[i,o,c]=r[a];for(let r=0;r<o.length;r+=2){let a=o[r],u=o[r+1];if(t>=a&&t<=u&&(n||i.size||i.length)){let r=e.substring(a,u);/\S/.test(r)||(r="",a=u=t),s.push({context:c,current:r,from:a,to:u,values:i})}}}return s}return Object.assign((function(e,t){t=t||{};const r=Boolean(t.debug),n=Boolean(t.stat),s=Boolean(t.tolerant),a=t.methods?Object.assign({},f,t.methods):f,i=n?s?P:N:s?w:x;let o;return e=String(e),i.has(e)?o=i.get(e):(o=function(e,t,r,n){n&&(console.log("\n== compile query ======"),console.log("[Source]"),console.log(e),console.log());const s=(r?C:A).parse(e);if(n){const t=e=>JSON.stringify(e).slice(1,-1);console.log("[AST]"),console.dir(s.ast,{depth:null}),console.log(),console.log("[Restored source]"),console.log(k(s.ast)),console.log(),console.log("[Suggest ranges]"),s.suggestRanges.sort((e,t)=>e[0]-t[0]).forEach(r=>{console.log(t(e));const n=t(e.slice(0,r[0])).length,s=t(e.substring(r[0],r[1])).length;console.log(" ".repeat(n)+(s?"~".repeat(s):"\\")+" "+r[0]+":"+r[1]+" ["+r[2]+"] from "+r[3])}),console.log()}const a=t?_(s.ast,s.suggestRanges,t):_(s.ast);return n&&(console.log("[Function]"),console.log(a.toString()),console.log()),a}(e,n,s,r),i.set(e,o)),n?function(t,r){const n=o(u,a,t,r);return{stat(t,r){const s=j(e,t,n,r);return s.forEach(e=>{e.values=[...e.values]}),s.length?s:null},suggestion(t,r){const s=[];return j(e,t,n,r).forEach(e=>{const{context:t,current:r,from:n,to:a,values:i}=e;s.push(...function(e,t){const r=new Set,n=e=>{switch(typeof e){case"string":r.add(JSON.stringify(e));break;case"number":r.add(String(e))}};switch(e){case"":case"path":t.forEach(e=>{Array.isArray(e)?e.forEach(e=>{R(e)&&E(r,Object.keys(e))}):R(e)&&E(r,Object.keys(e))});break;case"key":t.forEach(e=>{R(e)&&E(r,Object.keys(e))});break;case"value":t.forEach(e=>{Array.isArray(e)?e.forEach(n):n(e)});break;case"in-value":t.forEach(e=>{Array.isArray(e)?e.forEach(n):R(e)?Object.keys(e).forEach(n):n(e)});break;case"var":t.forEach(e=>{r.add("$"+e)})}return[...r]}(t,i).map(e=>({current:r,type:I[t],value:e,from:n,to:a})))}),s.length?s:null}}}:function e(t,r){return o(u,a,t,r,e)}}),{version:S,buildin:u,methods:f,syntax:{parse:(e,t)=>(t?C:A).parse(e),compile:_,stringify:k}})}));
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e=e||self).jora=t()}(this,(function(){"use strict";var e={version:"1.0.0-alpha.13"},t=Object.freeze({__proto__:null,version:"1.0.0-alpha.13",default:e}),r=function(){var e=function(e,t,r,n){for(r=r||{},n=e.length;n--;r[e[n]]=t);return r},t=[2,5],r=[1,13],n=[1,34],s=[1,18],a=[1,7],i=[1,8],o=[1,10],c=[1,11],u=[1,12],h=[1,19],l=[1,20],p=[1,21],y=[1,22],g=[1,25],f=[1,27],d=[1,28],b=[1,29],m=[1,30],k=[1,31],v=[1,32],_=[1,33],$=[5,18,52,54],O=[1,38],S=[1,46],A=[1,45],R=[1,39],x=[1,40],C=[1,41],w=[1,42],E=[1,43],P=[1,44],N=[1,47],I=[1,48],T=[1,49],j=[1,50],q=[1,51],M=[1,52],L=[1,53],F=[1,54],B=[1,55],Y=[1,56],D=[1,57],U=[5,9,14,15,17,18,19,22,23,24,44,45,46,47,50,52,53,54,56,57,58,59,60,62],G=[5,10,12,18,21,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,52,54,61,63],z=[1,58],J=[1,59],H=[1,60],Z=[1,61],V=[1,62],Q=[1,63],K=[1,64],W=[1,67],X=[2,45],ee=[2,46],te=[5,10,12,18,21,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,50,52,54,56,57,58,59,60,61,63,69],re=[1,81],ne=[1,94],se=[1,96],ae=[1,97],ie=[1,98],oe=[5,10,12,18,21,52,54,61,63],ce=[5,10,12,18,21,29,30,41,52,54,61,63],ue=[5,10,12,18,21,23,24,25,26,27,28,29,30,34,35,36,37,38,39,40,41,52,54,61,63],he=[52,61],le=[12,52],pe=[61,63],ye=[5,10,12,18,21,25,26,27,28,29,30,41,52,54,61,63],ge=[5,10,12,18,21,25,26,27,28,29,30,34,35,40,41,52,54,61,63],fe=[5,10,12,18,21,25,26,27,28,29,30,34,35,36,37,38,39,40,41,52,54,61,63],de=[1,166],be=[54,61],me={trace:function(){},yy:{},symbols_:{error:2,root:3,block:4,EOF:5,definitions:6,e:7,def:8,$:9,";":10,$ident:11,":":12,ident:13,SYMBOL:14,$SYMBOL:15,query:16,FUNCTION_START:17,FUNCTION_END:18,FUNCTION:19,sortingCompareList:20,"|":21,NOT:22,"-":23,"+":24,IN:25,HAS:26,NOTIN:27,HASNO:28,AND:29,OR:30,"*":31,"/":32,"%":33,"=":34,"!=":35,"<":36,"<=":37,">":38,">=":39,"~=":40,"?":41,queryRoot:42,relativePath:43,"@":44,"#":45,STRING:46,LITERAL:47,object:48,array:49,"[":50,sliceNotation:51,"]":52,"(":53,")":54,arguments:55,".":56,".(":57,".[":58,"..":59,"..(":60,",":61,"{":62,"}":63,properties:64,property:65,"...":66,arrayItems:67,sortingCompare:68,ORDER:69,sliceNotationComponent:70,$accept:0,$end:1},terminals_:{2:"error",5:"EOF",9:"$",10:";",12:":",14:"SYMBOL",15:"$SYMBOL",17:"FUNCTION_START",18:"FUNCTION_END",19:"FUNCTION",21:"|",22:"NOT",23:"-",24:"+",25:"IN",26:"HAS",27:"NOTIN",28:"HASNO",29:"AND",30:"OR",31:"*",32:"/",33:"%",34:"=",35:"!=",36:"<",37:"<=",38:">",39:">=",40:"~=",41:"?",44:"@",45:"#",46:"STRING",47:"LITERAL",50:"[",52:"]",53:"(",54:")",56:".",57:".(",58:".[",59:"..",60:"..(",61:",",62:"{",63:"}",66:"...",69:"ORDER"},productions_:[0,[3,2],[4,2],[4,1],[4,1],[4,0],[6,1],[6,2],[8,2],[8,2],[8,4],[13,1],[11,1],[7,1],[7,3],[7,2],[7,1],[7,3],[7,4],[7,2],[7,2],[7,2],[7,3],[7,3],[7,3],[7,3],[7,3],[7,3],[7,3],[7,3],[7,3],[7,3],[7,3],[7,3],[7,3],[7,3],[7,3],[7,3],[7,3],[7,3],[7,5],[16,1],[16,1],[42,1],[42,1],[42,1],[42,1],[42,1],[42,1],[42,1],[42,1],[42,3],[42,1],[42,3],[42,4],[42,3],[42,4],[42,2],[42,4],[42,5],[42,3],[42,3],[42,2],[42,4],[42,5],[42,3],[43,4],[43,4],[43,3],[43,5],[43,6],[43,4],[43,4],[43,3],[43,5],[43,6],[43,4],[55,1],[55,3],[48,2],[48,3],[64,1],[64,3],[65,1],[65,1],[65,1],[65,3],[65,3],[65,5],[65,1],[65,2],[67,1],[67,3],[49,2],[49,3],[20,1],[20,3],[68,2],[51,1],[51,2],[51,2],[51,3],[70,1],[70,2]],performAction:function(e,t,r,n,s,a,i){var o=a.length-1;switch(s){case 1:return n.buildResult(a[o-1]);case 2:this.$={type:"Block",definitions:a[o-1],body:a[o],range:this._$.range};break;case 3:this.$={type:"Block",definitions:a[o],body:{type:"Current"},range:this._$.range};break;case 4:this.$={type:"Block",definitions:[],body:a[o],range:this._$.range};break;case 5:this.$={type:"Block",definitions:[],body:{type:"Current"},range:this._$.range},n.suggestRanges.push([this._$,null,["var","path"],"current",this.$]);break;case 6:case 77:case 81:case 91:case 95:this.$=[a[o]];break;case 7:a[o-1].push(a[o]);break;case 8:this.$={type:"Definition",name:null,value:{type:"Current"},range:this._$.range},n.suggestRanges.push([i[o-1],i[o-1],"path","current",this.$]);break;case 9:this.$={type:"Definition",name:a[o-1],value:{type:"GetProperty",value:{type:"Current"},property:a[o-1]},range:this._$.range},n.suggestRanges.push([i[o-1],i[o-1],"path","current",this.$]);break;case 10:this.$={type:"Definition",name:a[o-3],value:a[o-1],range:this._$.range};break;case 11:case 12:this.$={type:"Identifier",name:a[o],range:this._$.range};break;case 13:case 41:case 42:case 49:case 50:break;case 14:this.$={type:"Function",arguments:[],body:a[o-1],range:this._$.range};break;case 15:this.$={type:"Function",arguments:[],body:a[o],range:this._$.range};break;case 16:this.$={type:"SortingFunction",compares:a[o],range:this._$.range};break;case 17:this.$={type:"Pipeline",left:a[o-2],right:a[o],range:this._$.range};break;case 18:this.$={type:"Pipeline",left:a[o-3],right:{type:"Block",definitions:a[o-1],body:a[o]},range:this._$.range};break;case 19:case 20:case 21:this.$={type:"Unary",operator:a[o-1],argument:a[o],range:this._$.range};break;case 22:this.$={type:"Binary",operator:a[o-1],left:a[o-2],right:a[o],range:this._$.range},n.suggestRanges.push([i[o-2],i[o-2],"in-value",a[o]]);break;case 23:this.$={type:"Binary",operator:a[o-1],left:a[o-2],right:a[o],range:this._$.range},n.suggestRanges.push([i[o],i[o],"in-value",a[o-2]]);break;case 24:case 25:case 26:case 27:case 28:case 29:case 30:case 31:case 32:case 35:case 36:case 37:case 38:case 39:this.$={type:"Binary",operator:a[o-1],left:a[o-2],right:a[o],range:this._$.range};break;case 33:case 34:this.$={type:"Binary",operator:a[o-1],left:a[o-2],right:a[o],range:this._$.range},n.suggestRanges.push([i[o],i[o],"value",a[o-2]]);break;case 40:this.$={type:"Conditional",test:a[o-4],consequent:a[o-2],alternate:a[o],range:this._$.range};break;case 43:this.$={type:"Data",range:this._$.range};break;case 44:this.$={type:"Context",range:this._$.range};break;case 45:this.$={type:"Current",range:this._$.range},n.suggestRanges.push([i[o],i[o],"var","current",this.$]);break;case 46:this.$={type:"Reference",name:a[o],range:this._$.range},n.suggestRanges.push([i[o],i[o],"var","current",this.$]);break;case 47:case 48:this.$={type:"Literal",value:a[o],range:this._$.range};break;case 51:this.$={type:"SliceNotation",value:{type:"Current"},arguments:a[o-1],range:this._$.range};break;case 52:this.$={type:"GetProperty",value:{type:"Current"},property:a[o],range:this._$.range},n.suggestRanges.push([i[o],i[o],"var","current",this.$],[i[o],i[o],"path","current",this.$]);break;case 53:this.$={type:"MethodCall",value:{type:"Current"},method:a[o-2],arguments:[],range:this._$.range},n.suggestRanges.push([i[o],i[o-1],["var","path"],"current",this.$]);break;case 54:this.$={type:"MethodCall",value:{type:"Current"},method:a[o-3],arguments:a[o-1],range:this._$.range},n.suggestRanges.push();break;case 55:this.$={type:"Parentheses",body:a[o-1],range:this._$.range};break;case 56:this.$={type:"Parentheses",body:{type:"Block",definitions:a[o-2],body:a[o-1]},range:this._$.range};break;case 57:this.$={type:"GetProperty",value:{type:"Current"},property:a[o],range:this._$.range},n.suggestRanges.push([null,this._$,["var","path"],"current",this.$],[i[o],i[o],"path","current",this.$]);break;case 58:this.$={type:"MethodCall",value:{type:"Current"},method:a[o-2],arguments:[],range:this._$.range},n.suggestRanges.push([null,this._$,["var","path"],"current",this.$],[i[o-2],i[o-2],"path","current",this.$],[i[o],i[o-1],["var","path"],"current",this.$]);break;case 59:this.$={type:"MethodCall",value:{type:"Current"},method:a[o-3],arguments:a[o-1],range:this._$.range},n.suggestRanges.push([null,this._$,["var","path"],"current",this.$],[i[o-3],i[o-3],"path","current",this.$]);break;case 60:this.$={type:"Map",value:{type:"Current"},query:a[o-1],range:this._$.range},n.suggestRanges.push([null,this._$,["var","path"],"current",this.$]);break;case 61:this.$={type:"Filter",value:{type:"Current"},query:a[o-1],range:this._$.range},n.suggestRanges.push([null,this._$,["var","path"],"current",this.$]);break;case 62:this.$={type:"Recursive",value:{type:"Current"},query:{type:"GetProperty",value:{type:"Current"},property:a[o]},range:this._$.range},n.suggestRanges.push([null,this._$,["var","path"],"current",this.$],[i[o],i[o],"path","current",this.$]);break;case 63:this.$={type:"Recursive",value:{type:"Current"},query:{type:"MethodCall",value:{type:"Current"},method:a[o-2],arguments:[]},range:this._$.range},n.suggestRanges.push([null,this._$,["var","path"],"current",this.$],[i[o-2],i[o-2],"path","current",this.$],[i[o],i[o-1],["var","path"],"current",this.$]);break;case 64:this.$={type:"Recursive",value:{type:"Current"},query:{type:"MethodCall",value:{type:"Current"},method:a[o-3],arguments:a[o-1]},range:this._$.range},n.suggestRanges.push([null,this._$,["var","path"],"current",this.$],[i[o-3],i[o-3],"path","current",this.$]);break;case 65:this.$={type:"Recursive",value:{type:"Current"},query:a[o-1],range:this._$.range},n.suggestRanges.push([null,this._$,["var","path"],"current",this.$]);break;case 66:this.$={type:"GetProperty",value:a[o-3],property:a[o-1],range:this._$.range};break;case 67:this.$={type:"SliceNotation",value:a[o-3],arguments:a[o-1],range:this._$.range};break;case 68:this.$={type:"GetProperty",value:a[o-2],property:a[o],range:this._$.range},n.suggestRanges.push([i[o],i[o],"path",a[o-2]]);break;case 69:this.$={type:"MethodCall",value:a[o-4],method:a[o-2],arguments:[],range:this._$.range},n.suggestRanges.push([i[o-2],i[o-2],"path",a[o-4]],[i[o],i[o-1],["var","path"],"current",this.$]);break;case 70:this.$={type:"MethodCall",value:a[o-5],method:a[o-3],arguments:a[o-1],range:this._$.range},n.suggestRanges.push([i[o-3],i[o-3],"path",a[o-5]]);break;case 71:this.$={type:"Map",value:a[o-3],query:a[o-1],range:this._$.range};break;case 72:this.$={type:"Filter",value:a[o-3],query:a[o-1],range:this._$.range};break;case 73:this.$={type:"Recursive",value:a[o-2],query:{type:"GetProperty",value:{type:"Current"},property:a[o]},range:this._$.range},n.suggestRanges.push([i[o],i[o],"path",a[o-2]]);break;case 74:this.$={type:"Recursive",value:a[o-4],query:{type:"MethodCall",value:{type:"Current"},method:a[o-2],arguments:[]},range:this._$.range},n.suggestRanges.push([i[o-2],i[o-2],"path",a[o-4]],[i[o],i[o-1],["var","path"],"current",this.$]);break;case 75:this.$={type:"Recursive",value:a[o-5],query:{type:"MethodCall",value:{type:"Current"},method:a[o-3],arguments:a[o-1]},range:this._$.range},n.suggestRanges.push([i[o-3],i[o-3],"path",a[o-5]]);break;case 76:this.$={type:"Recursive",value:a[o-3],query:a[o-1],range:this._$.range};break;case 78:case 82:case 92:case 96:a[o-2].push(a[o]);break;case 79:this.$={type:"Object",properties:[],range:this._$.range},n.suggestRanges.push([i[o],i[o-1],["var","path"],"current",this.$]);break;case 80:this.$={type:"Object",properties:a[o-1],range:this._$.range};break;case 83:this.$={type:"Property",key:a[o],value:{type:"GetProperty",value:{type:"Current"},property:a[o]},range:this._$.range},n.suggestRanges.push([i[o],i[o],"var","current",this.$],[i[o],i[o],"path","current",this.$]);break;case 84:this.$={type:"Property",key:null,value:{type:"Current"},range:this._$.range},n.suggestRanges.push([i[o],i[o],"var","current",this.$]);break;case 85:this.$={type:"Property",key:a[o],value:{type:"Reference",name:a[o]},range:this._$.range},n.suggestRanges.push([i[o],i[o],"var","current",this.$]);break;case 86:this.$={type:"Property",key:a[o-2],value:a[o],range:this._$.range};break;case 87:this.$={type:"Property",key:{type:"Literal",value:a[o-2]},value:a[o],range:this._$.range};break;case 88:this.$={type:"Property",key:a[o-3],value:a[o],range:this._$.range};break;case 89:this.$={type:"Spread",query:{type:"Current"},range:this._$.range},n.suggestRanges.push([i[o],null,["var","path"],"current",this.$]);break;case 90:this.$={type:"Spread",query:a[o],range:this._$.range};break;case 93:this.$={type:"Array",elements:[],range:this._$.range},n.suggestRanges.push([i[o],i[o-1],["var","path"],"current",this.$]);break;case 94:this.$={type:"Array",elements:a[o-1],range:this._$.range};break;case 97:this.$={type:"Compare",query:a[o-1],order:a[o],range:this._$.range};break;case 98:this.$=[null,a[o]];break;case 99:this.$=[null,a[o-1],a[o]];break;case 100:this.$=[a[o-1],a[o]];break;case 101:this.$=[a[o-2],a[o-1],a[o]];break;case 102:this.$=null;break;case 103:this.$=a[o]}},table:[{3:1,4:2,5:t,6:3,7:4,8:5,9:r,11:14,13:26,14:n,15:s,16:6,17:a,19:i,20:9,22:o,23:c,24:u,42:15,43:16,44:h,45:l,46:p,47:y,48:23,49:24,50:g,53:f,56:d,57:b,58:m,59:k,60:v,62:_,68:17},{1:[3]},{5:[1,35]},e($,[2,3],{16:6,20:9,11:14,42:15,43:16,68:17,48:23,49:24,13:26,7:36,8:37,9:r,14:n,15:s,17:a,19:i,22:o,23:c,24:u,44:h,45:l,46:p,47:y,50:g,53:f,56:d,57:b,58:m,59:k,60:v,62:_}),e($,[2,4],{21:O,23:S,24:A,25:R,26:x,27:C,28:w,29:E,30:P,31:N,32:I,33:T,34:j,35:q,36:M,37:L,38:F,39:B,40:Y,41:D}),e(U,[2,6]),e(G,[2,13],{50:z,56:J,57:H,58:Z,59:V,60:Q,69:K}),{4:65,6:3,7:4,8:5,9:r,11:14,13:26,14:n,15:s,16:6,17:a,18:t,19:i,20:9,22:o,23:c,24:u,42:15,43:16,44:h,45:l,46:p,47:y,48:23,49:24,50:g,53:f,56:d,57:b,58:m,59:k,60:v,62:_,68:17},{7:66,9:W,11:68,13:26,14:n,15:s,16:6,17:a,19:i,20:9,22:o,23:c,24:u,42:15,43:16,44:h,45:l,46:p,47:y,48:23,49:24,50:g,53:f,56:d,57:b,58:m,59:k,60:v,62:_,68:17},e([5,10,12,18,21,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,52,54,63],[2,16],{61:[1,69]}),{7:70,9:W,11:68,13:26,14:n,15:s,16:6,17:a,19:i,20:9,22:o,23:c,24:u,42:15,43:16,44:h,45:l,46:p,47:y,48:23,49:24,50:g,53:f,56:d,57:b,58:m,59:k,60:v,62:_,68:17},{7:71,9:W,11:68,13:26,14:n,15:s,16:6,17:a,19:i,20:9,22:o,23:c,24:u,42:15,43:16,44:h,45:l,46:p,47:y,48:23,49:24,50:g,53:f,56:d,57:b,58:m,59:k,60:v,62:_,68:17},{7:72,9:W,11:68,13:26,14:n,15:s,16:6,17:a,19:i,20:9,22:o,23:c,24:u,42:15,43:16,44:h,45:l,46:p,47:y,48:23,49:24,50:g,53:f,56:d,57:b,58:m,59:k,60:v,62:_,68:17},e([5,12,18,21,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,50,52,54,56,57,58,59,60,61,63,69],X,{10:[1,73]}),e([5,18,21,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,50,52,54,56,57,58,59,60,61,63,69],ee,{10:[1,74],12:[1,75]}),e(te,[2,41]),e(te,[2,42]),e(G,[2,95]),e(te,[2,12]),e(te,[2,43]),e(te,[2,44]),e(te,[2,47]),e(te,[2,48]),e(te,[2,49]),e(te,[2,50]),{7:80,9:W,11:68,12:re,13:26,14:n,15:s,16:6,17:a,19:i,20:9,22:o,23:c,24:u,42:15,43:16,44:h,45:l,46:p,47:y,48:23,49:24,50:g,51:76,52:[1,77],53:f,56:d,57:b,58:m,59:k,60:v,62:_,67:78,68:17,70:79},e(te,[2,52],{53:[1,82]}),{6:84,7:83,8:5,9:r,11:14,13:26,14:n,15:s,16:6,17:a,19:i,20:9,22:o,23:c,24:u,42:15,43:16,44:h,45:l,46:p,47:y,48:23,49:24,50:g,53:f,56:d,57:b,58:m,59:k,60:v,62:_,68:17},{13:85,14:n},{4:86,6:3,7:4,8:5,9:r,11:14,13:26,14:n,15:s,16:6,17:a,19:i,20:9,22:o,23:c,24:u,42:15,43:16,44:h,45:l,46:p,47:y,48:23,49:24,50:g,53:f,54:t,56:d,57:b,58:m,59:k,60:v,62:_,68:17},{4:87,6:3,7:4,8:5,9:r,11:14,13:26,14:n,15:s,16:6,17:a,19:i,20:9,22:o,23:c,24:u,42:15,43:16,44:h,45:l,46:p,47:y,48:23,49:24,50:g,52:t,53:f,56:d,57:b,58:m,59:k,60:v,62:_,68:17},{13:88,14:n},{4:89,6:3,7:4,8:5,9:r,11:14,13:26,14:n,15:s,16:6,17:a,19:i,20:9,22:o,23:c,24:u,42:15,43:16,44:h,45:l,46:p,47:y,48:23,49:24,50:g,53:f,54:t,56:d,57:b,58:m,59:k,60:v,62:_,68:17},{9:ne,11:95,13:93,14:n,15:s,46:se,50:ae,63:[1,90],64:91,65:92,66:ie},e([5,10,12,18,21,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,50,52,53,54,56,57,58,59,60,61,63,69],[2,11]),{1:[2,1]},e($,[2,2],{21:O,23:S,24:A,25:R,26:x,27:C,28:w,29:E,30:P,31:N,32:I,33:T,34:j,35:q,36:M,37:L,38:F,39:B,40:Y,41:D}),e(U,[2,7]),{6:100,7:99,8:5,9:r,11:14,13:26,14:n,15:s,16:6,17:a,19:i,20:9,22:o,23:c,24:u,42:15,43:16,44:h,45:l,46:p,47:y,48:23,49:24,50:g,53:f,56:d,57:b,58:m,59:k,60:v,62:_,68:17},{7:101,9:W,11:68,13:26,14:n,15:s,16:6,17:a,19:i,20:9,22:o,23:c,24:u,42:15,43:16,44:h,45:l,46:p,47:y,48:23,49:24,50:g,53:f,56:d,57:b,58:m,59:k,60:v,62:_,68:17},{7:102,9:W,11:68,13:26,14:n,15:s,16:6,17:a,19:i,20:9,22:o,23:c,24:u,42:15,43:16,44:h,45:l,46:p,47:y,48:23,49:24,50:g,53:f,56:d,57:b,58:m,59:k,60:v,62:_,68:17},{7:103,9:W,11:68,13:26,14:n,15:s,16:6,17:a,19:i,20:9,22:o,23:c,24:u,42:15,43:16,44:h,45:l,46:p,47:y,48:23,49:24,50:g,53:f,56:d,57:b,58:m,59:k,60:v,62:_,68:17},{7:104,9:W,11:68,13:26,14:n,15:s,16:6,17:a,19:i,20:9,22:o,23:c,24:u,42:15,43:16,44:h,45:l,46:p,47:y,48:23,49:24,50:g,53:f,56:d,57:b,58:m,59:k,60:v,62:_,68:17},{7:105,9:W,11:68,13:26,14:n,15:s,16:6,17:a,19:i,20:9,22:o,23:c,24:u,42:15,43:16,44:h,45:l,46:p,47:y,48:23,49:24,50:g,53:f,56:d,57:b,58:m,59:k,60:v,62:_,68:17},{7:106,9:W,11:68,13:26,14:n,15:s,16:6,17:a,19:i,20:9,22:o,23:c,24:u,42:15,43:16,44:h,45:l,46:p,47:y,48:23,49:24,50:g,53:f,56:d,57:b,58:m,59:k,60:v,62:_,68:17},{7:107,9:W,11:68,13:26,14:n,15:s,16:6,17:a,19:i,20:9,22:o,23:c,24:u,42:15,43:16,44:h,45:l,46:p,47:y,48:23,49:24,50:g,53:f,56:d,57:b,58:m,59:k,60:v,62:_,68:17},{7:108,9:W,11:68,13:26,14:n,15:s,16:6,17:a,19:i,20:9,22:o,23:c,24:u,42:15,43:16,44:h,45:l,46:p,47:y,48:23,49:24,50:g,53:f,56:d,57:b,58:m,59:k,60:v,62:_,68:17},{7:109,9:W,11:68,13:26,14:n,15:s,16:6,17:a,19:i,20:9,22:o,23:c,24:u,42:15,43:16,44:h,45:l,46:p,47:y,48:23,49:24,50:g,53:f,56:d,57:b,58:m,59:k,60:v,62:_,68:17},{7:110,9:W,11:68,13:26,14:n,15:s,16:6,17:a,19:i,20:9,22:o,23:c,24:u,42:15,43:16,44:h,45:l,46:p,47:y,48:23,49:24,50:g,53:f,56:d,57:b,58:m,59:k,60:v,62:_,68:17},{7:111,9:W,11:68,13:26,14:n,15:s,16:6,17:a,19:i,20:9,22:o,23:c,24:u,42:15,43:16,44:h,45:l,46:p,47:y,48:23,49:24,50:g,53:f,56:d,57:b,58:m,59:k,60:v,62:_,68:17},{7:112,9:W,11:68,13:26,14:n,15:s,16:6,17:a,19:i,20:9,22:o,23:c,24:u,42:15,43:16,44:h,45:l,46:p,47:y,48:23,49:24,50:g,53:f,56:d,57:b,58:m,59:k,60:v,62:_,68:17},{7:113,9:W,11:68,13:26,14:n,15:s,16:6,17:a,19:i,20:9,22:o,23:c,24:u,42:15,43:16,44:h,45:l,46:p,47:y,48:23,49:24,50:g,53:f,56:d,57:b,58:m,59:k,60:v,62:_,68:17},{7:114,9:W,11:68,13:26,14:n,15:s,16:6,17:a,19:i,20:9,22:o,23:c,24:u,42:15,43:16,44:h,45:l,46:p,47:y,48:23,49:24,50:g,53:f,56:d,57:b,58:m,59:k,60:v,62:_,68:17},{7:115,9:W,11:68,13:26,14:n,15:s,16:6,17:a,19:i,20:9,22:o,23:c,24:u,42:15,43:16,44:h,45:l,46:p,47:y,48:23,49:24,50:g,53:f,56:d,57:b,58:m,59:k,60:v,62:_,68:17},{7:116,9:W,11:68,13:26,14:n,15:s,16:6,17:a,19:i,20:9,22:o,23:c,24:u,42:15,43:16,44:h,45:l,46:p,47:y,48:23,49:24,50:g,53:f,56:d,57:b,58:m,59:k,60:v,62:_,68:17},{7:117,9:W,11:68,13:26,14:n,15:s,16:6,17:a,19:i,20:9,22:o,23:c,24:u,42:15,43:16,44:h,45:l,46:p,47:y,48:23,49:24,50:g,53:f,56:d,57:b,58:m,59:k,60:v,62:_,68:17},{7:118,9:W,11:68,13:26,14:n,15:s,16:6,17:a,19:i,20:9,22:o,23:c,24:u,42:15,43:16,44:h,45:l,46:p,47:y,48:23,49:24,50:g,53:f,56:d,57:b,58:m,59:k,60:v,62:_,68:17},{7:119,9:W,11:68,13:26,14:n,15:s,16:6,17:a,19:i,20:9,22:o,23:c,24:u,42:15,43:16,44:h,45:l,46:p,47:y,48:23,49:24,50:g,53:f,56:d,57:b,58:m,59:k,60:v,62:_,68:17},{7:120,9:W,11:68,12:re,13:26,14:n,15:s,16:6,17:a,19:i,20:9,22:o,23:c,24:u,42:15,43:16,44:h,45:l,46:p,47:y,48:23,49:24,50:g,51:121,53:f,56:d,57:b,58:m,59:k,60:v,62:_,68:17,70:79},{13:122,14:n},{4:123,6:3,7:4,8:5,9:r,11:14,13:26,14:n,15:s,16:6,17:a,19:i,20:9,22:o,23:c,24:u,42:15,43:16,44:h,45:l,46:p,47:y,48:23,49:24,50:g,53:f,54:t,56:d,57:b,58:m,59:k,60:v,62:_,68:17},{4:124,6:3,7:4,8:5,9:r,11:14,13:26,14:n,15:s,16:6,17:a,19:i,20:9,22:o,23:c,24:u,42:15,43:16,44:h,45:l,46:p,47:y,48:23,49:24,50:g,52:t,53:f,56:d,57:b,58:m,59:k,60:v,62:_,68:17},{13:125,14:n},{4:126,6:3,7:4,8:5,9:r,11:14,13:26,14:n,15:s,16:6,17:a,19:i,20:9,22:o,23:c,24:u,42:15,43:16,44:h,45:l,46:p,47:y,48:23,49:24,50:g,53:f,54:t,56:d,57:b,58:m,59:k,60:v,62:_,68:17},e(G,[2,97]),{18:[1,127]},e(oe,[2,15],{23:S,24:A,25:R,26:x,27:C,28:w,29:E,30:P,31:N,32:I,33:T,34:j,35:q,36:M,37:L,38:F,39:B,40:Y,41:D}),e(te,X),e(te,ee),{9:W,11:68,13:26,14:n,15:s,16:129,42:15,43:16,44:h,45:l,46:p,47:y,48:23,49:24,50:g,53:f,56:d,57:b,58:m,59:k,60:v,62:_,68:128},e(ce,[2,19],{23:S,24:A,25:R,26:x,27:C,28:w,31:N,32:I,33:T,34:j,35:q,36:M,37:L,38:F,39:B,40:Y}),e(ue,[2,20],{31:N,32:I,33:T}),e(ue,[2,21],{31:N,32:I,33:T}),e(U,[2,8]),e(U,[2,9]),{7:130,9:W,11:68,13:26,14:n,15:s,16:6,17:a,19:i,20:9,22:o,23:c,24:u,42:15,43:16,44:h,45:l,46:p,47:y,48:23,49:24,50:g,53:f,56:d,57:b,58:m,59:k,60:v,62:_,68:17},{52:[1,131]},e(te,[2,93]),{52:[1,132],61:[1,133]},{12:re,52:[2,98],70:134},e(he,[2,91],{70:135,12:re,21:O,23:S,24:A,25:R,26:x,27:C,28:w,29:E,30:P,31:N,32:I,33:T,34:j,35:q,36:M,37:L,38:F,39:B,40:Y,41:D}),e(le,[2,102],{16:6,20:9,42:15,43:16,68:17,48:23,49:24,13:26,11:68,7:136,9:W,14:n,15:s,17:a,19:i,22:o,23:c,24:u,44:h,45:l,46:p,47:y,50:g,53:f,56:d,57:b,58:m,59:k,60:v,62:_}),{7:139,9:W,11:68,13:26,14:n,15:s,16:6,17:a,19:i,20:9,22:o,23:c,24:u,42:15,43:16,44:h,45:l,46:p,47:y,48:23,49:24,50:g,53:f,54:[1,137],55:138,56:d,57:b,58:m,59:k,60:v,62:_,68:17},{21:O,23:S,24:A,25:R,26:x,27:C,28:w,29:E,30:P,31:N,32:I,33:T,34:j,35:q,36:M,37:L,38:F,39:B,40:Y,41:D,54:[1,140]},{7:141,8:37,9:r,11:14,13:26,14:n,15:s,16:6,17:a,19:i,20:9,22:o,23:c,24:u,42:15,43:16,44:h,45:l,46:p,47:y,48:23,49:24,50:g,53:f,56:d,57:b,58:m,59:k,60:v,62:_,68:17},e(te,[2,57],{53:[1,142]}),{54:[1,143]},{52:[1,144]},e(te,[2,62],{53:[1,145]}),{54:[1,146]},e(te,[2,79]),{61:[1,148],63:[1,147]},e(pe,[2,81]),e(pe,[2,83],{12:[1,149]}),e(pe,[2,84]),e(pe,[2,85]),{12:[1,150]},{7:151,9:W,11:68,13:26,14:n,15:s,16:6,17:a,19:i,20:9,22:o,23:c,24:u,42:15,43:16,44:h,45:l,46:p,47:y,48:23,49:24,50:g,53:f,56:d,57:b,58:m,59:k,60:v,62:_,68:17},e(pe,[2,89],{42:15,43:16,48:23,49:24,13:26,11:68,16:152,9:W,14:n,15:s,44:h,45:l,46:p,47:y,50:g,53:f,56:d,57:b,58:m,59:k,60:v,62:_}),e(oe,[2,17],{23:S,24:A,25:R,26:x,27:C,28:w,29:E,30:P,31:N,32:I,33:T,34:j,35:q,36:M,37:L,38:F,39:B,40:Y,41:D}),{7:153,8:37,9:r,11:14,13:26,14:n,15:s,16:6,17:a,19:i,20:9,22:o,23:c,24:u,42:15,43:16,44:h,45:l,46:p,47:y,48:23,49:24,50:g,53:f,56:d,57:b,58:m,59:k,60:v,62:_,68:17},e(ye,[2,22],{23:S,24:A,31:N,32:I,33:T,34:j,35:q,36:M,37:L,38:F,39:B,40:Y}),e(ye,[2,23],{23:S,24:A,31:N,32:I,33:T,34:j,35:q,36:M,37:L,38:F,39:B,40:Y}),e(ye,[2,24],{23:S,24:A,31:N,32:I,33:T,34:j,35:q,36:M,37:L,38:F,39:B,40:Y}),e(ye,[2,25],{23:S,24:A,31:N,32:I,33:T,34:j,35:q,36:M,37:L,38:F,39:B,40:Y}),e(ce,[2,26],{23:S,24:A,25:R,26:x,27:C,28:w,31:N,32:I,33:T,34:j,35:q,36:M,37:L,38:F,39:B,40:Y}),e([5,10,12,18,21,30,41,52,54,61,63],[2,27],{23:S,24:A,25:R,26:x,27:C,28:w,29:E,31:N,32:I,33:T,34:j,35:q,36:M,37:L,38:F,39:B,40:Y}),e(ue,[2,28],{31:N,32:I,33:T}),e(ue,[2,29],{31:N,32:I,33:T}),e(G,[2,30]),e(G,[2,31]),e(G,[2,32]),e(ge,[2,33],{23:S,24:A,31:N,32:I,33:T,36:M,37:L,38:F,39:B}),e(ge,[2,34],{23:S,24:A,31:N,32:I,33:T,36:M,37:L,38:F,39:B}),e(fe,[2,35],{23:S,24:A,31:N,32:I,33:T}),e(fe,[2,36],{23:S,24:A,31:N,32:I,33:T}),e(fe,[2,37],{23:S,24:A,31:N,32:I,33:T}),e(fe,[2,38],{23:S,24:A,31:N,32:I,33:T}),e(ge,[2,39],{23:S,24:A,31:N,32:I,33:T,36:M,37:L,38:F,39:B}),{12:[1,154],21:O,23:S,24:A,25:R,26:x,27:C,28:w,29:E,30:P,31:N,32:I,33:T,34:j,35:q,36:M,37:L,38:F,39:B,40:Y,41:D},{12:re,21:O,23:S,24:A,25:R,26:x,27:C,28:w,29:E,30:P,31:N,32:I,33:T,34:j,35:q,36:M,37:L,38:F,39:B,40:Y,41:D,52:[1,155],70:135},{52:[1,156]},e(te,[2,68],{53:[1,157]}),{54:[1,158]},{52:[1,159]},e(te,[2,73],{53:[1,160]}),{54:[1,161]},e(G,[2,14]),e(G,[2,96]),{50:z,56:J,57:H,58:Z,59:V,60:Q,69:K},{10:[1,162],21:O,23:S,24:A,25:R,26:x,27:C,28:w,29:E,30:P,31:N,32:I,33:T,34:j,35:q,36:M,37:L,38:F,39:B,40:Y,41:D},e(te,[2,51]),e(te,[2,94]),{7:163,9:W,11:68,13:26,14:n,15:s,16:6,17:a,19:i,20:9,22:o,23:c,24:u,42:15,43:16,44:h,45:l,46:p,47:y,48:23,49:24,50:g,53:f,56:d,57:b,58:m,59:k,60:v,62:_,68:17},{52:[2,99]},{12:re,52:[2,100],70:164},e(le,[2,103],{21:O,23:S,24:A,25:R,26:x,27:C,28:w,29:E,30:P,31:N,32:I,33:T,34:j,35:q,36:M,37:L,38:F,39:B,40:Y,41:D}),e(te,[2,53]),{54:[1,165],61:de},e(be,[2,77],{21:O,23:S,24:A,25:R,26:x,27:C,28:w,29:E,30:P,31:N,32:I,33:T,34:j,35:q,36:M,37:L,38:F,39:B,40:Y,41:D}),e(te,[2,55]),{21:O,23:S,24:A,25:R,26:x,27:C,28:w,29:E,30:P,31:N,32:I,33:T,34:j,35:q,36:M,37:L,38:F,39:B,40:Y,41:D,54:[1,167]},{7:139,9:W,11:68,13:26,14:n,15:s,16:6,17:a,19:i,20:9,22:o,23:c,24:u,42:15,43:16,44:h,45:l,46:p,47:y,48:23,49:24,50:g,53:f,54:[1,168],55:169,56:d,57:b,58:m,59:k,60:v,62:_,68:17},e(te,[2,60]),e(te,[2,61]),{7:139,9:W,11:68,13:26,14:n,15:s,16:6,17:a,19:i,20:9,22:o,23:c,24:u,42:15,43:16,44:h,45:l,46:p,47:y,48:23,49:24,50:g,53:f,54:[1,170],55:171,56:d,57:b,58:m,59:k,60:v,62:_,68:17},e(te,[2,65]),e(te,[2,80]),{9:ne,11:95,13:93,14:n,15:s,46:se,50:ae,65:172,66:ie},{7:173,9:W,11:68,13:26,14:n,15:s,16:6,17:a,19:i,20:9,22:o,23:c,24:u,42:15,43:16,44:h,45:l,46:p,47:y,48:23,49:24,50:g,53:f,56:d,57:b,58:m,59:k,60:v,62:_,68:17},{7:174,9:W,11:68,13:26,14:n,15:s,16:6,17:a,19:i,20:9,22:o,23:c,24:u,42:15,43:16,44:h,45:l,46:p,47:y,48:23,49:24,50:g,53:f,56:d,57:b,58:m,59:k,60:v,62:_,68:17},{21:O,23:S,24:A,25:R,26:x,27:C,28:w,29:E,30:P,31:N,32:I,33:T,34:j,35:q,36:M,37:L,38:F,39:B,40:Y,41:D,52:[1,175]},e(pe,[2,90],{50:z,56:J,57:H,58:Z,59:V,60:Q}),e(oe,[2,18],{23:S,24:A,25:R,26:x,27:C,28:w,29:E,30:P,31:N,32:I,33:T,34:j,35:q,36:M,37:L,38:F,39:B,40:Y,41:D}),{7:176,9:W,11:68,13:26,14:n,15:s,16:6,17:a,19:i,20:9,22:o,23:c,24:u,42:15,43:16,44:h,45:l,46:p,47:y,48:23,49:24,50:g,53:f,56:d,57:b,58:m,59:k,60:v,62:_,68:17},e(te,[2,66]),e(te,[2,67]),{7:139,9:W,11:68,13:26,14:n,15:s,16:6,17:a,19:i,20:9,22:o,23:c,24:u,42:15,43:16,44:h,45:l,46:p,47:y,48:23,49:24,50:g,53:f,54:[1,177],55:178,56:d,57:b,58:m,59:k,60:v,62:_,68:17},e(te,[2,71]),e(te,[2,72]),{7:139,9:W,11:68,13:26,14:n,15:s,16:6,17:a,19:i,20:9,22:o,23:c,24:u,42:15,43:16,44:h,45:l,46:p,47:y,48:23,49:24,50:g,53:f,54:[1,179],55:180,56:d,57:b,58:m,59:k,60:v,62:_,68:17},e(te,[2,76]),e(U,[2,10]),e(he,[2,92],{21:O,23:S,24:A,25:R,26:x,27:C,28:w,29:E,30:P,31:N,32:I,33:T,34:j,35:q,36:M,37:L,38:F,39:B,40:Y,41:D}),{52:[2,101]},e(te,[2,54]),{7:181,9:W,11:68,13:26,14:n,15:s,16:6,17:a,19:i,20:9,22:o,23:c,24:u,42:15,43:16,44:h,45:l,46:p,47:y,48:23,49:24,50:g,53:f,56:d,57:b,58:m,59:k,60:v,62:_,68:17},e(te,[2,56]),e(te,[2,58]),{54:[1,182],61:de},e(te,[2,63]),{54:[1,183],61:de},e(pe,[2,82]),e(pe,[2,86],{21:O,23:S,24:A,25:R,26:x,27:C,28:w,29:E,30:P,31:N,32:I,33:T,34:j,35:q,36:M,37:L,38:F,39:B,40:Y,41:D}),e(pe,[2,87],{21:O,23:S,24:A,25:R,26:x,27:C,28:w,29:E,30:P,31:N,32:I,33:T,34:j,35:q,36:M,37:L,38:F,39:B,40:Y,41:D}),{12:[1,184]},e(oe,[2,40],{23:S,24:A,25:R,26:x,27:C,28:w,29:E,30:P,31:N,32:I,33:T,34:j,35:q,36:M,37:L,38:F,39:B,40:Y,41:D}),e(te,[2,69]),{54:[1,185],61:de},e(te,[2,74]),{54:[1,186],61:de},e(be,[2,78],{21:O,23:S,24:A,25:R,26:x,27:C,28:w,29:E,30:P,31:N,32:I,33:T,34:j,35:q,36:M,37:L,38:F,39:B,40:Y,41:D}),e(te,[2,59]),e(te,[2,64]),{7:187,9:W,11:68,13:26,14:n,15:s,16:6,17:a,19:i,20:9,22:o,23:c,24:u,42:15,43:16,44:h,45:l,46:p,47:y,48:23,49:24,50:g,53:f,56:d,57:b,58:m,59:k,60:v,62:_,68:17},e(te,[2,70]),e(te,[2,75]),e(pe,[2,88],{21:O,23:S,24:A,25:R,26:x,27:C,28:w,29:E,30:P,31:N,32:I,33:T,34:j,35:q,36:M,37:L,38:F,39:B,40:Y,41:D})],defaultActions:{35:[2,1],134:[2,99],164:[2,101]},parseError:function(e,t){if(!t.recoverable){var r=new Error(e);throw r.hash=t,r}this.trace(e)},parse:function(e){var t=this,r=[0],n=[null],s=[],a=this.table,i="",o=0,c=0,u=2,h=1,l=s.slice.call(arguments,1),p=Object.create(this.lexer),y={yy:{}};for(var g in this.yy)Object.prototype.hasOwnProperty.call(this.yy,g)&&(y.yy[g]=this.yy[g]);p.setInput(e,y.yy),y.yy.lexer=p,y.yy.parser=this,void 0===p.yylloc&&(p.yylloc={});var f=p.yylloc;s.push(f);var d=p.options&&p.options.ranges;"function"==typeof y.yy.parseError?this.parseError=y.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;for(var b,m,k,v,_,$,O,S,A,R=function(){var e;return"number"!=typeof(e=p.lex()||h)&&(e=t.symbols_[e]||e),e},x={};;){if(k=r[r.length-1],this.defaultActions[k]?v=this.defaultActions[k]:(null==b&&(b=R()),v=a[k]&&a[k][b]),void 0===v||!v.length||!v[0]){var C="";for($ in A=[],a[k])this.terminals_[$]&&$>u&&A.push("'"+this.terminals_[$]+"'");C=p.showPosition?"Parse error on line "+(o+1)+":\n"+p.showPosition()+"\nExpecting "+A.join(", ")+", got '"+(this.terminals_[b]||b)+"'":"Parse error on line "+(o+1)+": Unexpected "+(b==h?"end of input":"'"+(this.terminals_[b]||b)+"'"),this.parseError(C,{text:p.match,token:this.terminals_[b]||b,line:p.yylineno,loc:f,expected:A})}if(v[0]instanceof Array&&v.length>1)throw new Error("Parse Error: multiple actions possible at state: "+k+", token: "+b);switch(v[0]){case 1:r.push(b),n.push(p.yytext),s.push(p.yylloc),r.push(v[1]),b=null,m?(b=m,m=null):(c=p.yyleng,i=p.yytext,o=p.yylineno,f=p.yylloc);break;case 2:if(O=this.productions_[v[1]][1],x.$=n[n.length-O],x._$={first_line:s[s.length-(O||1)].first_line,last_line:s[s.length-1].last_line,first_column:s[s.length-(O||1)].first_column,last_column:s[s.length-1].last_column},d&&(x._$.range=[s[s.length-(O||1)].range[0],s[s.length-1].range[1]]),void 0!==(_=this.performAction.apply(x,[i,c,o,y.yy,v[1],n,s].concat(l))))return _;O&&(r=r.slice(0,-1*O*2),n=n.slice(0,-1*O),s=s.slice(0,-1*O)),r.push(this.productions_[v[1]][0]),n.push(x.$),s.push(x._$),S=a[r[r.length-2]][r[r.length-1]],r.push(S);break;case 3:return!0}}return!0}},ke={EOF:1,parseError:function(e,t){if(!this.yy.parser)throw new Error(e);this.yy.parser.parseError(e,t)},setInput:function(e,t){return this.yy=t||this.yy||{},this._input=e,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var e=this._input[0];return this.yytext+=e,this.yyleng++,this.offset++,this.match+=e,this.matched+=e,e.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),e},unput:function(e){var t=e.length,r=e.split(/(?:\r\n?|\n)/g);this._input=e+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-t),this.offset-=t;var n=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),r.length-1&&(this.yylineno-=r.length-1);var s=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:r?(r.length===n.length?this.yylloc.first_column:0)+n[n.length-r.length].length-r[0].length:this.yylloc.first_column-t},this.options.ranges&&(this.yylloc.range=[s[0],s[0]+this.yyleng-t]),this.yyleng=this.yytext.length,this},more:function(){return this._more=!0,this},reject:function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},less:function(e){this.unput(this.match.slice(e))},pastInput:function(){var e=this.matched.substr(0,this.matched.length-this.match.length);return(e.length>20?"...":"")+e.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var e=this.match;return e.length<20&&(e+=this._input.substr(0,20-e.length)),(e.substr(0,20)+(e.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var e=this.pastInput(),t=new Array(e.length+1).join("-");return e+this.upcomingInput()+"\n"+t+"^"},test_match:function(e,t){var r,n,s;if(this.options.backtrack_lexer&&(s={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(s.yylloc.range=this.yylloc.range.slice(0))),(n=e[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=n.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:n?n[n.length-1].length-n[n.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+e[0].length},this.yytext+=e[0],this.match+=e[0],this.matches=e,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(e[0].length),this.matched+=e[0],r=this.performAction.call(this,this.yy,this,t,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),r)return r;if(this._backtrack){for(var a in s)this[a]=s[a];return!1}return!1},next:function(){if(this.done)return this.EOF;var e,t,r,n;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var s=this._currentRules(),a=0;a<s.length;a++)if((r=this._input.match(this.rules[s[a]]))&&(!t||r[0].length>t[0].length)){if(t=r,n=a,this.options.backtrack_lexer){if(!1!==(e=this.test_match(r,s[a])))return e;if(this._backtrack){t=!1;continue}return!1}if(!this.options.flex)break}return t?!1!==(e=this.test_match(t,s[n]))&&e:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var e=this.next();return e||this.lex()},begin:function(e){this.conditionStack.push(e)},popState:function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},_currentRules:function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},topState:function(e){return(e=this.conditionStack.length-1-Math.abs(e||0))>=0?this.conditionStack[e]:"INITIAL"},pushState:function(e){this.begin(e)},stateStackSize:function(){return this.conditionStack.length},options:{ranges:!0},performAction:function(e,t,r,n){switch(r){case 0:e.commentRanges.push(t.yylloc.range);break;case 1:break;case 2:return this.popState(),"/";case 3:return this.popState(),"<";case 4:this.done=!1,this.popState();break;case 5:return this.fnOpenedStack.push(this.fnOpened),this.fnOpened=0,"(";case 6:return this.fnOpened=this.fnOpenedStack.pop()||0,this._input&&this.begin("preventPrimitive"),")";case 7:return this.fnOpenedStack.push(this.fnOpened),this.fnOpened=0,"[";case 8:return this.fnOpened=this.fnOpenedStack.pop()||0,this._input&&this.begin("preventPrimitive"),"]";case 9:return this.fnOpenedStack.push(this.fnOpened),this.fnOpened=0,"{";case 10:return this.fnOpened=this.fnOpenedStack.pop()||0,this._input&&this.begin("preventPrimitive"),"}";case 11:return t.yytext=this.toLiteral(t.yytext),"LITERAL";case 12:return"AND";case 13:return"OR";case 14:return"HASNO";case 15:return"HAS";case 16:return"IN";case 17:return"NOTIN";case 18:return"NOT";case 19:return"ORDER";case 20:return this._input&&this.begin("preventPrimitive"),t.yytext=Number(t.yytext),"LITERAL";case 21:case 22:return this._input&&this.begin("preventPrimitive"),t.yytext=this.toStringLiteral(t.yytext),"STRING";case 23:return this._input&&this.begin("preventPrimitive"),t.yytext=this.toRegExp(t.yytext),"LITERAL";case 24:return this._input&&this.begin("preventPrimitive"),"SYMBOL";case 25:return this._input&&this.begin("preventPrimitive"),t.yytext=t.yytext.slice(1),"$SYMBOL";case 26:return this._input&&this.begin("preventPrimitive"),"@";case 27:return this._input&&this.begin("preventPrimitive"),"#";case 28:return this._input&&this.begin("preventPrimitive"),"$";case 29:return"FUNCTION";case 30:return this.fnOpened++,"FUNCTION_START";case 31:return"=";case 32:return"!=";case 33:return"~=";case 34:return">=";case 35:return"<=";case 36:return"<";case 37:return this.fnOpened?(this.fnOpened--,"FUNCTION_END"):">";case 38:return this.fnOpenedStack.push(this.fnOpened),this.fnOpened=0,"..(";case 39:return this.fnOpenedStack.push(this.fnOpened),this.fnOpened=0,".(";case 40:return this.fnOpenedStack.push(this.fnOpened),this.fnOpened=0,".[";case 41:return"...";case 42:return this._input&&this.begin("preventPrimitive"),"..";case 43:return this._input&&this.begin("preventPrimitive"),".";case 44:return"?";case 45:return",";case 46:return":";case 47:return";";case 48:return"-";case 49:return"+";case 50:return"*";case 51:return"/";case 52:return"%";case 53:return"|";case 54:return"EOF"}},rules:[/^(?:(\/\/.*?(\r|\n|$)))/,/^(?:(\s+))/,/^(?:\/)/,/^(?:<(?!=))/,/^(?:)/,/^(?:\()/,/^(?:\))/,/^(?:\[)/,/^(?:\])/,/^(?:\{)/,/^(?:\})/,/^(?:(true|false|null|undefined)(\b))/,/^(?:and(\b))/,/^(?:or(\b))/,/^(?:has(\s+)no(\b))/,/^(?:has(\b))/,/^(?:in(\b))/,/^(?:not(\s+)in(\b))/,/^(?:not?(\b))/,/^(?:(asc|desc)(\b))/,/^(?:\d+(?:\.\d+)?([eE][-+]?\d+)?(\b))/,/^(?:"(?:\\.|[^"])*")/,/^(?:'(?:\\.|[^'])*')/,/^(?:(\/(?:\\.|[^/])+\/i?))/,/^(?:([a-zA-Z_][a-zA-Z_$0-9]*))/,/^(?:\$([a-zA-Z_][a-zA-Z_$0-9]*))/,/^(?:@)/,/^(?:#)/,/^(?:\$)/,/^(?:=>)/,/^(?:<(?!=))/,/^(?:=)/,/^(?:!=)/,/^(?:~=)/,/^(?:>=)/,/^(?:<=)/,/^(?:<)/,/^(?:>)/,/^(?:\.\.\()/,/^(?:\.\()/,/^(?:\.\[)/,/^(?:\.\.\.)/,/^(?:\.\.)/,/^(?:\.)/,/^(?:\?)/,/^(?:,)/,/^(?::)/,/^(?:;)/,/^(?:\-)/,/^(?:\+)/,/^(?:\*)/,/^(?:\/)/,/^(?:\%)/,/^(?:\|)/,/^(?:$)/],conditions:{preventPrimitive:{rules:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54],inclusive:!0},INITIAL:{rules:[0,1,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54],inclusive:!0}}};function ve(){this.yy={}}return me.lexer=ke,ve.prototype=me,me.Parser=ve,function e(t){function r(e,t){Object.entries(t).forEach(([t,r])=>e[t]=r(e[t]))}function n(e,t){return t>=0&&t<e.length&&/[a-zA-Z_$0-9]/.test(e[t])}function s(e,t){const r=e.charCodeAt(t);return 9===r||10===r||13===r||32===r}function a(e,t,r){for(;t<r;t++)if(!s(e,t))return!1;return!0}function i(e,t,r,n,s){const a=[];for(let r=0;r<n.length;r++){const[s,i]=n[r];if(s>t)break;s<e||(s===e?a.push(e,e):a.push(e,s),e=i)}return e===r.length&&s||a.push(e,t),a}Object.assign(t.lexer,{toLiteral:e=>"null"===e?null:"false"!==e&&("true"===e||void 0),toStringLiteral:e=>JSON.parse("'"===e[0]?e.replace(/\\?"/g,'\\"').replace(/\\([^"uU])/g,"$1").replace(/^\'|\'$/g,'"'):e),toRegExp:e=>new RegExp(e.substr(1,e.lastIndexOf("/")-1),e.substr(e.lastIndexOf("/")+1))}),r(t.lexer,{setInput:e=>(function(t,r){const o=[],c=[];return r.commentRanges=c,r.suggestRanges=o,r.buildResult=e=>({ast:e,commentRanges:c,get suggestRanges(){return function(e,t,r){const o=[],c=r.length&&r[r.length-1][1]===e.length&&!/[\r\n]$/.test(e);for(let u=0;u<t.length;u++){let[h,l,p,y,g]=t[u];if(null===h)h=l.range[0],l=l.range[0];else if(null===l)l=h.range[1],h=h.range[1];else if(h.range[0]>l.range[0]){const e=h;h=l.range[1],l=e.range[0]}else h=h.range[0],l=l.range[1];if(a(e,h,l)){for(;h>=0&&s(e,h-1);)h--;for(;l<e.length&&s(e,l);)l++;if(n(e,h-1)){if(h===l)continue;h++}if(n(e,l)){if(h===l)continue;l--}}Array.isArray(p)||(p=[p]);const f=i(h,l,e,r,c);for(let e=0;e<f.length;e+=2)p.forEach(t=>o.push([f[e],f[e+1],t,y,g||null]))}return o}(t,o,c)}}),this.fnOpened=0,this.fnOpenedStack=[],this.prevToken=null,this.prevYylloc={first_line:1,last_line:1,first_column:0,last_column:0,range:[0,0]},e.call(this,t,r)})});const o=new t.Parser;o.lexer={...t.lexer};const c=["AND","OR","IN","NOTIN","HAS","HASNO"],u=[...c,"NOT","ORDER"],h=["+","-","*","/","%","=","!=","~=",">=","<=","<",">"],l=[null,":",";",",",".","..",...h,...c,"NOT"],p=new Set([",","?",":",";","EOF","]",")","}",...h,...c,"ORDER"]),y=new Map(l.map(e=>[e,p]));return y.set("{",new Set([","])),y.set("[",new Set([","])),y.set("(",new Set([","])),r(o.lexer,{lex:e=>(function t(){this.lex=e;const r=this._input,n=this.lex(this);if(this.lex=t,y.has(this.prevToken)&&y.get(this.prevToken).has(n)){const e={first_line:this.prevYylloc.last_line,last_line:this.yylloc.first_line,first_column:this.prevYylloc.last_column,last_column:this.yylloc.first_column,range:[this.prevYylloc.range[1],this.yylloc.range[0]]};if(this.unput(this.yytext),this.pushState("preventPrimitive"),this.done=!1,this.yytext="_",this.yylloc=this.prevYylloc=e,r!==this._input&&u.includes(n)){const t=r.length-this._input.length-1;switch(r[t]){case" ":case"\t":e.last_column--,e.range[1]--;break;case"\n":{const n=r.lastIndexOf("\n",t-1);e.last_line--,e.last_column=-1===n?e.last_column-1:t-n,e.range[1]--;break}}}return this.prevToken="SYMBOL"}if(this.prevYylloc=this.yylloc,u.includes(n))switch(this._input[0]){case" ":case"\t":this.prevYylloc={...this.prevYylloc,last_column:this.prevYylloc.last_column+1,range:[this.prevYylloc.range[0],this.prevYylloc.range[1]+1]};break;case"\n":this.prevYylloc={...this.prevYylloc,last_line:this.prevYylloc.last_line+1,last_column:0,range:[this.prevYylloc.range[0],this.prevYylloc.range[1]+1]}}return this.prevToken=n})}),Object.assign((function(e,r){return r?o.parse(e):t.parse(e)}),{generateModule:()=>t.generateModule({moduleName:"module.exports"}).replace("new Parser","("+e+")(new Parser)")})}(new ve)}();function n(e){return"GetProperty"===e.type&&("Current"===e.value.type&&"Identifier"===e.property.type)}function s(e,t){return!!n(e)&&e.property.name===t}var a=function(e){function t(e){switch(e.type){case"Data":a("@");break;case"Context":a("#");break;case"Current":a("$");break;case"Literal":a("string"==typeof e.value?JSON.stringify(e.value):String(e.value));break;case"Identifier":a(e.name);break;case"Unary":a(e.operator),"-"!==e.operator&&"+"!==e.operator&&a(" "),t(e.argument);break;case"Binary":t(e.left),/^[a-z]/i.test(e.operator)?(a(" "),a(e.operator),a(" ")):a(e.operator),t(e.right);break;case"Conditional":t(e.test),a("?"),t(e.consequent),a(":"),t(e.alternate);break;case"Object":a("{"),o(e.properties,","),a("}");break;case"Property":if(!e.key||(r=e.value,"Identifier"===(c=e.key).type&&"Reference"===r.type&&"Identifier"===r.name.type&&c.name===r.name.name)){t(e.value);break}"Literal"===e.key.type||"Identifier"===e.key.type?t(e.key):(a("["),t(e.key),a("]")),"Identifier"===e.key.type&&s(e.value,e.key.name)||(a(":"),t(e.value));break;case"Spread":a("..."),i(e.query);break;case"Array":a("["),o(e.elements,","),a("]");break;case"Function":a("<"),t(e.body),a(">");break;case"Compare":t(e.query),a(" "),a(e.order);break;case"SortingFunction":o(e.compares,",");break;case"MethodCall":i(e.value)&&a("."),t(e.method),a("("),o(e.arguments,","),a(")");break;case"Definition":e.name?(a("$"),t(e.name),"Identifier"===e.name.type&&s(e.value,e.name.name)||(a(":"),t(e.value))):t(e.value),a(";");break;case"Parentheses":a("("),t(e.body),a(")");break;case"Block":e.definitions.forEach(t),t(e.body);break;case"Reference":a("$"),t(e.name);break;case"Map":i(e.value),a(".("),t(e.query),a(")");break;case"Filter":i(e.value),a(".["),t(e.query),a("]");break;case"Recursive":i(e.value),a(".."),n(e.query)||function(e){return"MethodCall"===e.type&&"Current"===e.value.type}(e.query)?t(e.query):(a("("),t(e.query),a(")"));break;case"GetProperty":"Identifier"===e.property.type?(i(e.value)&&a("."),t(e.property)):(t(e.value),a("["),t(e.property),a("]"));break;case"SliceNotation":{const[r,n,s]=e.arguments;i(e.value),a("["),r&&t(r),a(":"),n&&t(n),s&&(a(":"),t(s)),a("]");break}case"Pipeline":t(e.left),a("|"),t(e.right);break;default:throw new Error("Unknown node type `"+e.type+"`")}var r,c}const r=[],a=e=>r.push(e),i=e=>{if("Current"!==e.type)return t(e),!0},o=(e,r)=>{e.forEach((e,n)=>{n>0&&a(r),t(e)})};return t(e),r.join("")};const i={"-":"-","+":"+",no:"!",not:"!"},o={in:"in","not in":"in",has:"-","has no":"-",and:"and",or:"or","+":"add","-":"sub","*":"mul","/":"div","%":"mod","=":"eq","!=":"ne","<":"lt","<=":"lte",">":"gt",">=":"gte","~=":"match"};var c=function(e,t=[],r=!1){function n(e,t,r){let n;return"var"===r?n=JSON.stringify(h):(e||(e="v"+b++),n=e),"[]"!==n&&m.push([n,JSON.stringify([t[0],t[1]]),JSON.stringify(r)].join(",")),e}function s(e){return e.reduce((e,t)=>n(e,t,t[2])||e,void 0)}function a(e,t){const r=h,n=p.length;if(h=h.slice(),h.own=[],h.firstCurrent=null,h.captureCurrent=[],e(),h.captureCurrent.length){const e=s(h.captureCurrent);if(e){const r="stat("+e+",current)";h.firstCurrent?p[h.firstCurrent]=r:p[n]=t(p[n],r)}}h=r}function c(e){const t=r&&d.has(e);if(t){const t=s(d.get(e));t&&y("stat("+t+","),d.delete()}switch(r&&f.has(e)&&h.captureCurrent.push(...f.get(e).filter(e=>{if("var"!==e[2])return!0;n(null,e,e[2])})),e.type){case"Data":y("data");break;case"Context":y("context");break;case"Current":null!==h.firstCurrent||h.captureCurrent.disabled||(h.firstCurrent=p.length),y("current");break;case"Literal":y("string"==typeof e.value?JSON.stringify(e.value):String(e.value));break;case"Identifier":y(e.name);break;case"Unary":if(e.operator in i==!1)throw new Error("Unknown operator `"+e.operator+"`");"not"===e.operator||"no"===e.operator?(y("!f.bool("),c(e.argument),y(")")):(y(i[e.operator]),c(e.argument));break;case"Binary":if(e.operator in o==!1)throw new Error("Unknown operator `"+e.operator+"`");switch("not in"!==e.operator&&"has no"!==e.operator||y("!"),e.operator){case"has":case"has no":y("f.in("),c(e.right),y(","),c(e.left),y(")");break;case"or":l=!0,y("f.bool(tmp="),c(e.left),y(")?tmp:"),h.captureCurrent.disabled=!0,c(e.right),h.captureCurrent.disabled=!1;break;case"and":l=!0,y("f.bool(tmp="),c(e.left),y(")?"),h.captureCurrent.disabled=!0,c(e.right),h.captureCurrent.disabled=!1,y(":tmp");break;default:y("f."),y(o[e.operator]),y("("),c(e.left),y(","),c(e.right),y(")")}break;case"Conditional":y("f.bool("),c(e.test),h.captureCurrent.disabled=!0,y(")?"),c(e.consequent),y(":"),c(e.alternate),h.captureCurrent.disabled=!1;break;case"Object":y("{"),g(e.properties,","),y("}");break;case"Property":if(!e.key)break;"Literal"===e.key.type||"Identifier"===e.key.type?c(e.key):(y("["),c(e.key),y("]")),y(":"),c(e.value);break;case"Spread":y("..."),c(e.query);break;case"Array":y("["),g(e.elements,","),y("]");break;case"Function":a(()=>{y("current=>("),c(e.body),y(")")},(e,t)=>e+t+",");break;case"Compare":"desc"===e.order&&y("-"),a(()=>{y("f.cmp((_q=current=>("),c(e.query),y("))(a),_q(b))")},(e,t)=>e+t+",");break;case"SortingFunction":y("(a, b)=>{let _q;return "),g(e.compares,"||"),y("||0}");break;case"MethodCall":y("m."),c(e.method),y("("),c(e.value),e.arguments.length&&(y(","),g(e.arguments,",")),y(")");break;case"Definition":if(!e.name)break;if(h.own.includes(e.name.name))throw new Error(`Identifier '$${e.name.name}' has already been declared`);if(u.includes(e.name.name))throw new Error(`Identifier '$${e.name.name}' is reserved for future use`);y("const $"),c(e.name),y("="),c(e.value),y(";"),h.push(e.name.name),h.own.push(e.name.name);break;case"Parentheses":y("("),c(e.body),y(")");break;case"Block":e.definitions.length?a(()=>{y("(()=>{"),g(e.definitions),y("return "),c(e.body),y("})()")},(e,t)=>e+t+";"):"Object"===e.body.type?(y("("),c(e.body),y(")")):c(e.body);break;case"Reference":h.includes(e.name.name)?(y("$"),c(e.name)):(y("typeof $"),c(e.name),y('!=="undefined"?$'),c(e.name),y(":undefined"));break;case"Map":y("f.map("),c(e.value),a(()=>{y(",current=>"),c(e.query)},(e,t)=>(y(")"),e+"("+t+",")),y(")");break;case"Filter":y("f.filter("),c(e.value),a(()=>{y(",current=>"),c(e.query)},(e,t)=>(y(")"),e+"("+t+",")),y(")");break;case"Recursive":y("f.recursive("),c(e.value),a(()=>{y(",current=>"),c(e.query)},(e,t)=>(y(")"),e+"("+t+",")),y(")");break;case"GetProperty":y("f.map("),c(e.value),y(","),"Identifier"===e.property.type?y(JSON.stringify(e.property.name)):c(e.property),y(")");break;case"SliceNotation":y("f.slice("),c(e.value),e.arguments.slice(0,3).forEach(e=>{y(","),e?c(e):y("undefined")}),y(")");break;case"Pipeline":y("(current=>("),c(e.right),y("))("),c(e.left),y(")")}t&&y(")")}const u=["data","context","ctx","array","idx","index"];let h=[],l=!1;const p=["const current=data;","return "],y=e=>p.push(e),g=(e,t)=>{e.forEach((e,r)=>{r>0&&y(t),c(e)})},f=t.reduce((e,t)=>("current"===t[3]&&(e.has(t[4])?e.get(t[4]).push(t):e.set(t[4],[t])),e),new Map),d=t.reduce((e,t)=>(t[3]&&"current"!==t[3]&&(e.has(t[3])?e.get(t[3]).push(t):e.set(t[3],[t])),e),new Map);let b=0;const m=[];a(()=>c(e),(e,t)=>(y(")"),e+"("+t+",")),l&&p.unshift("let tmp;"),r&&(b>0&&(p.unshift("const "+Array.from(Array(b),(e,t)=>"v"+t+"=new Set()")+";\n"),p.unshift("const stat=(values,v)=>(values.add(v),v);\n")),y("\n,["+m.map(e=>"["+e+"]")+"]"));try{return new Function("f","m","data","context",p.join(""))}catch(e){throw console.error("Query compile error:",p.join("")),e}};const u=Object.prototype.toString;var h={addToSet:function(e,t){return void 0!==t&&(Array.isArray(t)?t.forEach(t=>e.add(t)):e.add(t)),e},getPropertyValue:function(e,t){return e&&hasOwnProperty.call(e,t)?e[t]:void 0},isPlainObject:function(e){return e&&"object"==typeof e&&e.constructor===Object},isRegExp:function(e){return"[object RegExp]"===u.call(e)},isArrayLike:function(e){return e&&hasOwnProperty.call(e,"length")}};const{addToSet:l,getPropertyValue:p,isPlainObject:y,isRegExp:g,isArrayLike:f}=h;var d=Object.freeze({bool:function(e){if(Array.isArray(e))return e.length>0;if(y(e)){for(const t in e)if(hasOwnProperty.call(e,t))return!0;return!1}return Boolean(e)},add:function(e,t){return Array.isArray(e)||Array.isArray(t)?[...new Set([].concat(e,t))]:e+t},sub:function(e,t){if(Array.isArray(e)){const r=new Set(e);return Array.isArray(t)?t.forEach(e=>r.delete(e)):r.delete(t),[...r]}return e-t},mul:function(e,t){return e*t},div:function(e,t){return e/t},mod:function(e,t){return e%t},eq:function(e,t){return e===t},ne:function(e,t){return e!==t},lt:function(e,t){return e<t},lte:function(e,t){return e<=t},gt:function(e,t){return e>t},gte:function(e,t){return e>=t},in:function(e,t){return y(t)?hasOwnProperty.call(t,e):!(!t||"function"!=typeof t.indexOf)&&-1!==t.indexOf(e)},cmp:function(e,t){return e>t?1:e<t?-1:0},match:function(e,t){return"function"==typeof t?this.filter(e,t):g(t)?this.filter(e,t.test.bind(t)):null==t},map:function(e,t){const r="function"==typeof t?t:e=>p(e,t);return Array.isArray(e)?[...e.reduce((e,t)=>l(e,r(t)),new Set)]:void 0!==e?r(e):e},slice:function(e,t=0,r=e&&e.length,n=1){if(!f(e))return[];if(t=parseInt(t,10)||0,r=parseInt(r,10)||e.length,1!==(n=parseInt(n,10)||1)){const s=[];t=t<0?Math.max(0,e.length+t):Math.min(e.length,t),r=r<0?Math.max(0,e.length+r):Math.min(e.length,r);for(let a=n>0?t:r-1;a>=t&&a<r;a+=n)s.push(e[a]);return s}return"string"==typeof e?e.slice(t,r):Array.prototype.slice.call(e,t,r)},recursive:function(e,t){const r=new Set;return l(r,this.map(e,t)),r.forEach(e=>l(r,this.map(e,t))),[...r]},filter:function(e,t){return Array.isArray(e)?e.filter(e=>this.bool(t(e))):this.bool(t(e))?e:void 0}});const{addToSet:b,isPlainObject:m}=h;function k(){}function v(e){return e}function _(e){return{matched:e.slice(),start:e.index,end:e.index+e[0].length,input:e.input,groups:e.groups||null}}var $=Object.freeze({bool:d.bool,filter:d.filter,map:d.map,keys:function(e){return Object.keys(e||{})},values:function(e){const t=new Set;for(const r in e)hasOwnProperty.call(e,r)&&b(t,e[r]);return[...t]},entries:function(e){const t=[];for(const r in e)hasOwnProperty.call(e,r)&&t.push({key:r,value:e[r]});return t},fromEntries:function(e){const t={};return Array.isArray(e)&&e.forEach(e=>{e&&(t[e.key]=e.value)}),t},pick:function(e,t){if(e){if("function"!=typeof t)return Array.isArray(e)?e[t||0]:e[t];if(Array.isArray(e))return e.find(e=>t(e));for(const r in e)if(hasOwnProperty.call(e,r)&&t(e[r]))return{key:r,value:e[r]}}},mapToArray:function(e,t="key",r){const n=[];for(const s in e)hasOwnProperty.call(e,s)&&n.push(r?{[t]:s,[r]:e[s]}:{[t]:s,...e[s]});return n},size:function(e){return m(e)?Object.keys(e).length:e&&e.length||0},sort:function(e,t){let r;return Array.isArray(e)?("function"==typeof t&&(r=2===t.length?t:(e,r)=>{if(e=t(e),r=t(r),Array.isArray(e)&&Array.isArray(r)){if(e.length!==r.length)return e.length<r.length?-1:1;for(let t=0;t<e.length;t++){if(e[t]<r[t])return-1;if(e[t]>r[t])return 1}return 0}return e<r?-1:e>r}),e.slice().sort(r)):e},reverse:function(e){return Array.isArray(e)?e.slice().reverse():e},slice:function(e,t,r){return d.slice(e,t,r)},group:function(e,t,r){"function"!=typeof t&&(t=k),"function"!=typeof r&&(r=v),Array.isArray(e)||(e=[e]);const n=new Map,s=[];return e.forEach(e=>{let s=t(e);Array.isArray(s)||(s=[s]),s.forEach(t=>{n.has(t)?n.get(t).add(r(e)):n.set(t,new Set([r(e)]))})}),n.forEach((e,t)=>s.push({key:t,value:[...e]})),s},split:function(e,t){return String(e).split(t)},join:function(e,t){return Array.isArray(e)?e.join(t):String(e)},match:function(e,t,r){const n=String(e);if(r){const e=[];let r,s=new RegExp(t,t.flags+"g");for(;r=s.exec(n);)e.push(_(r));return e}const s=String(e).match(t);return s&&_(s)}});const{addToSet:O,isPlainObject:S}=h,A={path:"property",value:"value","in-value":"value",var:"variable"};function R(e,t,r,n){const s=[];for(let a=0;a<r.length;a++){const[i,o,c]=r[a];for(let r=0;r<o.length;r+=2){let a=o[r],u=o[r+1];if(t>=a&&t<=u&&(n||i.size||i.length)){let r=e.substring(a,u);/\S/.test(r)||(r="",a=u=t),s.push({context:c,current:r,from:a,to:u,values:i})}}}return s}var x=(e,t)=>({stat(r,n){const s=R(e,r,t,n);return s.forEach(e=>{e.values=[...e.values]}),s.length?s:null},suggestion(r,n){const s=R(e,r,t,n),a=[];return s.forEach(e=>{const{context:t,current:r,from:n,to:s,values:i}=e;a.push(...function(e,t){const r=new Set,n=e=>{switch(typeof e){case"string":r.add(JSON.stringify(e));break;case"number":r.add(String(e))}};switch(e){case"":case"path":t.forEach(e=>{Array.isArray(e)?e.forEach(e=>{S(e)&&O(r,Object.keys(e))}):S(e)&&O(r,Object.keys(e))});break;case"value":t.forEach(e=>{Array.isArray(e)?e.forEach(n):n(e)});break;case"in-value":t.forEach(e=>{Array.isArray(e)?e.forEach(n):S(e)?Object.keys(e).forEach(n):n(e)});break;case"var":t.forEach(e=>{r.add("$"+e)})}return[...r]}(t,i).map(e=>({current:r,type:A[t],value:e,from:n,to:s})))}),a.length?a:null}});var C,w=(C=t)&&C.default||C;const{version:E}=w,P=new Map,N=new Map,I=new Map,T=new Map;function j(e,t){console.log(`[${e}]`),"string"==typeof t?console.log(t):void 0!==t&&console.dir(t,{depth:null}),console.log()}return Object.assign((function(e,t){t=t||{};const n=Boolean(t.stat),s=Boolean(t.tolerant),i=t.methods?{...$,...t.methods}:$,o=n?s?T:N:s?I:P;let u;return e=String(e),o.has(e)?u=o.get(e):(u=function(e,t,n,s){(s="function"==typeof s?s:!!Boolean(s)&&j)&&(s("========================="),s("Compile query from source",e));const i=r(e,n);if(s){const t=e=>JSON.stringify(e).slice(1,-1);s("AST",i.ast),s("Restored source",a(i.ast)),s("Suggest ranges",i.suggestRanges.sort((e,t)=>e[0]-t[0]).map(r=>{const n=t(e.slice(0,r[0])).length,s=t(e.substring(r[0],r[1])).length;return t(e)+"\n"+(" ".repeat(n)+(s?"~".repeat(s):"\\"))+" "+r[0]+":"+r[1]+" ["+r[2]+"] from "+r[3]}).join("\n"))}const o=t?c(i.ast,i.suggestRanges,t):c(i.ast);return s&&s("Function",o.toString()),o}(e,n,s,t.debug),o.set(e,u)),n?(t,r)=>x(e,u(d,i,t,r)):(e,t)=>u(d,i,e,t)}),{version:E,buildin:d,methods:$,syntax:{parse:r,stringify:a,compile:c}})}));
{
"name": "jora",
"version": "1.0.0-alpha.12",
"version": "1.0.0-alpha.13",
"description": "JavaScript object query engine",

@@ -19,23 +19,24 @@ "author": "Roman Dvornov <rdvornov@gmail.com> (https://github.com/lahmatiy)",

"jsdelivr": "dist/jora.min.js",
"browser": {
"./src/parser.js": "./dist/parser.js",
"./package.json": "./dist/version.json"
},
"scripts": {
"lint": "eslint src test",
"lint-and-test": "npm run lint && npm test",
"test": "mocha --reporter progress",
"build": "npm run build:prerequisites && rollup --config && terser dist/jora.js --compress --mangle -o dist/jora.min.js",
"build:prerequisites": "node scripts/build",
"prepublishOnly": "npm run build",
"test": "mocha --reporter ${REPORTER:-progress}",
"test:all": "npm run test:src && npm run test:dist",
"test:src": "npm test",
"test:dist": "MODE=dist npm test && MODE=dist-min npm test",
"build": "rollup --config",
"build-and-test": "npm run build && npm run test:dist",
"parser:bake": "node -e \"require('./src/lang/parse').bake()\"",
"parser:rollback": "git checkout -- src/lang/parse.js",
"prepublishOnly": "npm run build && npm run parser:bake",
"postpublish": "npm run parser:rollback",
"coverage": "nyc npm test",
"travis": "nyc npm run lint-and-test && npm run coveralls",
"travis": "nyc npm run lint-and-test && npm run build-and-test && npm run parser:bake && npm test && npm run coveralls",
"coveralls": "nyc report --reporter=text-lcov | coveralls"
},
"dependencies": {
"jison": "^0.4.18"
},
"dependencies": {},
"devDependencies": {
"coveralls": "^3.0.7",
"eslint": "^6.5.1",
"jison": "^0.4.18",
"mocha": "^5.2.0",

@@ -47,3 +48,3 @@ "nyc": "^14.1.0",

"rollup-plugin-node-resolve": "^5.2.0",
"terser": "^4.3.8"
"rollup-plugin-terser": "^5.1.3"
},

@@ -55,4 +56,5 @@ "engines": {

"dist",
"src"
"src",
"!src/lang/parse-raw.js"
]
}

@@ -6,2 +6,5 @@ # Jora

[![Coverage Status](https://coveralls.io/repos/github/discoveryjs/jora/badge.svg?branch=master)](https://coveralls.io/github/discoveryjs/jora?branch=master)
![Minified size](https://badgen.net/bundlephobia/min/jora)
![Minified + gzip size](https://badgen.net/bundlephobia/minzip/jora)
[![Twitter](https://badgen.net/badge/follow/@js_discovery?icon=twitter)](https://twitter.com/js_discovery)

@@ -18,5 +21,4 @@ JavaScript object query engine

- Stat collecting mode (powers suggestions)
- Tolerant parsing mode (useful to provide suggestions on a query editing in an editor)
- Extensible DSL by providing a additional method list on query build
ntl
- Tolerant parsing mode (useful to provide suggestions for query in an editor)
- Extensible DSL on query build by custom method list

@@ -40,6 +42,8 @@ Related projects:

- [ ] Prettifier
- [ ] Move jison to dev dependencies
- [x] Move jison to dev dependencies
- [ ] Debugging (step by step evaluation)
- [ ] Prediction a shape of data suitable for a query (touching pathes)
- [ ] Input data shape prediction suitable for a query (based on touching paths)
> More ideas and thoughts: [Jora todo gist](https://gist.github.com/lahmatiy/d5af7a987e9548e80eae5f46e6edc931), [Jora ToDo on Discovery.js projects state overview](https://docs.google.com/document/d/1z89UAY6Z8CP6VHX11-0yc1irD7WhAOM4F8X9RR1h1QQ/edit#heading=h.cm1jq2rux492)
Table of content:

@@ -72,2 +76,18 @@

In node.js
```js
const jora = require('jora');
```
For a browser unminified (`dist/jora.js`) and minified (`dist/jora.min.js`) builds are available:
```html
<script src="node_modules/jora/dist/jora.js"></script>
<script src="node_modules/jora/dist/jora.min.js"></script>
<!-- or use one of CDN -->
<script src="https://unpkg.com/jora/dist/jora.js"></script>
<script src="https://cdn.jsdelivr.net/npm/jora/dist/jora.js"></script>
```
## API

@@ -79,3 +99,3 @@

// create a query
const query = jora('foo.bar') ;
const query = jora('foo.bar');
// or with custom methods

@@ -103,6 +123,6 @@ const queryWithCustomMethods = jora('foo.myMethod()', {

Type: `Boolean`
Type: `Boolean` or `function(name, value)`
Default: `false`
Enables debug output.
Enables debug output. When set a function, this function will recieve a section name and its value.

@@ -201,3 +221,3 @@ - tolerant

Following keywords can be used as in JavaScript:
Following keywords can be used with the same meaning as in JavaScript:

@@ -211,9 +231,24 @@ - `true`

Jora | Description
--- | ---
x + y | Add<br>In case one of the operands is an array it produces new array with elements from `x` and `y` excluding duplicates
x - y | Subtract<br>In case one of the operands is an array with elements from `x` excluding elements from `y`
x * y | Multiply
x / y | Divide
x % y | Modulo
<table>
<tr>
<th>Jora
<th>Description
</tr>
<tr>
<td nowrap valign="top">x + y
<td>Add<br>In case one of the operands is an array it produces new array with elements from `x` and `y` excluding duplicates
</tr><tr>
<td nowrap valign="top">x - y
<td>Subtract<br>In case one of the operands is an array with elements from `x` excluding elements from `y`
</tr><tr>
<td nowrap>x * y
<td>Multiply
</tr><tr>
<td nowrap>x / y
<td>Divide
</tr><tr>
<td nowrap>x % y
<td>Modulo
</tr>
</table>

@@ -246,3 +281,3 @@ ### Comparisons

Some constructions suppose to use a block, which may consists of a definition list (should comes first) and an expression. Both are optional. When an expression is empty, a current value (i.e. `$`) returns.
Some constructions suppose to use a block, which may consists of a variable definition list (should comes first) and an expression. Both are optional. When an expression is empty, a current value (i.e. `$`) returns.

@@ -252,4 +287,4 @@ The syntax of definition (white spaces between any part are optional):

```
$ SYMBOL ;
$ SYMBOL : expression ;
$ident ;
$ident : expression ;
```

@@ -260,8 +295,8 @@

```
$foo:123; // Define `$foo`
$bar; // The same as `$bar:$.bar;` or `$a:bar;`
$foo:123; // Define `$foo` variable
$bar; // The same as `$bar:$.bar;` or `$a: bar;`
$baz: $foo + $bar; // Definitions may be used in following expressions
```
In terms of JavaScript, a block creates a new scope. Variables can't be redefined or change a value in the same or nested scopes, otherwise it cause to error.
In terms of JavaScript, a block creates a new scope. Once a variable is defined, its value never change. Variables can be redefined in nested scopes, but can't be duplicated in the same scope - it causes to error.

@@ -282,5 +317,5 @@ ### Special references

--- | ---
SYMBOL | The same as `$.SYMBOL`
.SYMBOL | Child member operator (example: `foo.bar.baz`, `#.foo['use any symbols for name']`)
..SYMBOL<br> ..( block ) | Recursive descendant operator (example: `..deps`, `..(deps + dependants)`)
ident | The same as `$.ident`
.ident | Child member operator (example: `foo.bar.baz`, `#.foo['use any symbols for name']`)
..ident<br> ..( block ) | Recursive descendant operator (example: `..deps`, `..(deps + dependants)`)
.[ block ] | Filter a current data. Equivalent to a `.filter(<block>)`

@@ -290,3 +325,4 @@ .( block ) | Map a current data. Equivalent to a `.map(<block>)`

path[e] | Array-like notation to access properties. It works like in JS for everything with exception for arrays, where it equivalents to `array.map(e => e[key])`. Use `pick()` method to get an element by index in array.
[from:to]<br>[from:to:step] | [Slice notation](https://github.com/tc39/proposal-slice-notation/blob/master/README.md). Examples: `$str: '<foo>'; str[1:-1]` (`'foo'`) or `$ar:[1,2,3,4,5,6]; $ar[-3::-1]` (`[6,5,4]`)
[from:to]<br>[from:to:step] | [Slice notation](https://github.com/tc39/proposal-slice-notation/blob/master/README.md). Examples: `$str: '<foo>'; str[1:-1]` (result is `'foo'`) or `$ar:[1,2,3,4,5,6]; $ar[-3::-1]` (result is `[6,5,4]`)
e \| [definitions] e \| ... | Pipeline operator. It's useful to make a query value as current value. Approximately this effect can be obtained using variables: `$ar: [1,2,3]; { size: $ar.size(), top2: $ar[0:2] }`. However, with pipeline operator it's a bit simplier and clear: `[1,2,3] | { size: size(), top2: [0:2] }`

@@ -300,3 +336,4 @@ ### Build-in methods

values() | The same as `Object.values()` in JS
entries() | The same as `Object.entries()` in JS
entries() | Similar to `Object.entries()` in JS with a difference: `{ key, value }` objects is using for entries instead of array tuples
fromEntries() | Similar to `Object.fromEntries()` in JS with difference: `{ key, value }` objects are expecting as entries instead of array tuples
mapToArray("key"[, "value"]) | Converts an object to an array, and store object key as "key"

@@ -313,3 +350,3 @@ pick("key")<br>pick(fn) | Get a value by a key, an index or a function. Useful for arrays, e.g. since `array[5]` applies `[5]` for each element in an array (equivalent to `array.map(e => e[5])`), `array.pick(5)` should be used instead.

slice(from, to) | The same as `Array#slice()` or `String#slice()` in JS
match(pattern, matchAll) | The same as `String#match()`. Since regexp'es in jora doesn't support for `g` flag, use `matchAll` argument to get all matches, i.e. `'abcabc'.match(/ab/, true)` (jora) instead of `'abcabc'.match(/ab/g)` (JS)
match(pattern, matchAll) | Similar to `String#match()`. Since regexp'es in jora doesn't support for `g` flag, use `matchAll` argument to get all matches, i.e. `'abcabc'.match(/ab/, true)` (jora) instead of `'abcabc'.match(/ab/g)` (JS)

@@ -316,0 +353,0 @@ ## License

const { version } = require('../package.json');
const buildin = require('./buildin');
const parse = require('./lang/parse');
const stringify = require('./lang/stringify');
const compile = require('./lang/compile');
const buildin = require('./lang/compile-buildin');
const methods = require('./methods');
const {
strict: strictParser,
tolerant: tolerantParser
} = require('./parser');
const stringify = require('./stringify');
const compile = require('./compile');
const { addToSet, isPlainObject } = require('./utils');
const createStatApi = require('./stat');

@@ -16,142 +13,35 @@ const cacheStrict = new Map();

const cacheTollerantStat = new Map();
const contextToType = {
'path': 'property',
'key': 'property',
'value': 'value',
'in-value': 'value',
'var': 'variable'
};
function valuesToSuggestions(context, values) {
const suggestions = new Set();
const addValue = value => {
switch (typeof value) {
case 'string':
suggestions.add(JSON.stringify(value));
break;
case 'number':
suggestions.add(String(value));
break;
}
};
switch (context) {
case '':
case 'path':
values.forEach(value => {
if (Array.isArray(value)) {
value.forEach(item => {
if (isPlainObject(item)) {
addToSet(suggestions, Object.keys(item));
}
});
} else if (isPlainObject(value)) {
addToSet(suggestions, Object.keys(value));
}
});
break;
case 'key':
values.forEach(value => {
if (isPlainObject(value)) {
addToSet(suggestions, Object.keys(value));
}
});
break;
case 'value':
values.forEach(value => {
if (Array.isArray(value)) {
value.forEach(addValue);
} else {
addValue(value);
}
});
break;
case 'in-value':
values.forEach(value => {
if (Array.isArray(value)) {
value.forEach(addValue);
} else if (isPlainObject(value)) {
Object.keys(value).forEach(addValue);
} else {
addValue(value);
}
});
break;
case 'var':
values.forEach(value => {
suggestions.add('$' + value);
});
break;
function defaultDebugHandler(sectionName, value) {
console.log(`[${sectionName}]`);
if (typeof value === 'string') {
console.log(value);
} else if (value !== undefined) {
console.dir(value, { depth: null });
}
return [...suggestions];
console.log();
}
function findSourcePosPoints(source, pos, points, includeEmpty) {
const result = [];
function compileFunction(source, statMode, tolerantMode, debug) {
debug = typeof debug === 'function' ? debug : Boolean(debug) ? defaultDebugHandler : false;
for (let i = 0; i < points.length; i++) {
const [values, ranges, context] = points[i];
for (let j = 0; j < ranges.length; j += 2) {
let from = ranges[j];
let to = ranges[j + 1];
if (pos >= from && pos <= to && (includeEmpty || values.size || values.length)) {
let current = source.substring(from, to);
if (!/\S/.test(current)) {
current = '';
from = to = pos;
}
result.push({
context,
current,
from,
to,
values
});
}
}
}
return result;
}
function compileFunction(source, statMode, tolerantMode, debug) {
if (debug) {
console.log('\n== compile query ======');
console.log('[Source]');
console.log(source);
console.log();
debug('=========================');
debug('Compile query from source', source);
}
const parser = tolerantMode ? tolerantParser : strictParser;
const parseResult = parser.parse(source);
const parseResult = parse(source, tolerantMode);
if (debug) {
const esc = s => JSON.stringify(s).slice(1, -1);
console.log('[AST]');
console.dir(parseResult.ast, { depth: null });
console.log();
console.log('[Restored source]');
console.log(stringify(parseResult.ast));
console.log();
console.log('[Suggest ranges]');
// console.dir(parseResult.suggestRanges, { depth: null });
parseResult.suggestRanges.sort((a, b) => a[0] - b[0]).forEach(r => {
console.log(esc(source));
debug('AST', parseResult.ast);
debug('Restored source', stringify(parseResult.ast));
debug('Suggest ranges', parseResult.suggestRanges.sort((a, b) => a[0] - b[0]).map(r => {
const pre = esc(source.slice(0, r[0])).length;
const long = esc(source.substring(r[0], r[1])).length;
console.log(' '.repeat(pre) + (!long ? '\\' : '~'.repeat(long)) + ' ' + r[0] + ':' + r[1] + ' [' + r[2] + '] from ' + r[3]);
});
console.log();
return (
esc(source) + '\n' +
(' '.repeat(pre) + (!long ? '\\' : '~'.repeat(long)) + ' ' + r[0] + ':' + r[1] + ' [' + r[2] + '] from ' + r[3])
);
}).join('\n'));
}

@@ -164,5 +54,3 @@

if (debug) {
console.log('[Function]');
console.log(fn.toString());
console.log();
debug('Function', fn.toString());
}

@@ -176,6 +64,5 @@

const debug = Boolean(options.debug);
const statMode = Boolean(options.stat);
const tolerantMode = Boolean(options.tolerant);
const localMethods = options.methods ? Object.assign({}, methods, options.methods) : methods;
const localMethods = options.methods ? { ...methods, ...options.methods } : methods;
const cache = statMode

@@ -191,48 +78,9 @@ ? (tolerantMode ? cacheTollerantStat : cacheStrictStat)

} else {
fn = compileFunction(source, statMode, tolerantMode, debug);
fn = compileFunction(source, statMode, tolerantMode, options.debug);
cache.set(source, fn);
}
if (statMode) {
return function(data, context) {
const points = fn(buildin, localMethods, data, context);
return {
stat(pos, includeEmpty) {
const ranges = findSourcePosPoints(source, pos, points, includeEmpty);
ranges.forEach(range => {
range.values = [...range.values];
});
return ranges.length ? ranges : null;
},
suggestion(pos, includeEmpty) {
const suggestions = [];
findSourcePosPoints(source, pos, points, includeEmpty).forEach(entry => {
const { context, current, from, to, values } = entry;
// console.log({current, variants:[...suggestions.get(range)], suggestions })
suggestions.push(
...valuesToSuggestions(context, values)
.map(value => ({
current,
type: contextToType[context],
value,
from,
to
}))
);
});
return suggestions.length ? suggestions : null;
}
};
};
}
return function query(data, context) {
return fn(buildin, localMethods, data, context, query);
};
return statMode
? (data, context) => createStatApi(source, fn(buildin, localMethods, data, context))
: (data, context) => fn(buildin, localMethods, data, context);
};

@@ -245,9 +93,6 @@

syntax: {
parse(source, tolerantMode) {
const parser = tolerantMode ? tolerantParser : strictParser;
return parser.parse(source);
},
compile,
stringify
parse,
stringify,
compile
}
});

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

const buildin = require('./buildin');
const buildin = require('./lang/compile-buildin');
const {

@@ -52,2 +52,15 @@ addToSet,

},
fromEntries: function(current) {
const result = {};
if (Array.isArray(current)) {
current.forEach(entry => {
if (entry) {
result[entry.key] = entry.value;
}
});
}
return result;
},
pick: function(current, ref) {

@@ -84,3 +97,3 @@ if (!current) {

? { [keyProperty]: key, [valueProperty]: current[key] }
: Object.assign({ [keyProperty]: key }, current[key])
: { [keyProperty]: key, ...current[key] }
);

@@ -87,0 +100,0 @@ }

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