Socket
Socket
Sign inDemoInstall

jsonata

Package Overview
Dependencies
Maintainers
1
Versions
51
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jsonata - npm Package Compare versions

Comparing version 1.5.1 to 1.5.2

6

CHANGELOG.md

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

#### 1.5.2 Maintenance Release
- Enforce consistent syntax error when attempting to use unquoted numeric property names (issue #147)
- Invalid token on LHS of binding operator is now a syntax error rather than dynamic (runtime) error (issue #148)
- Fix corruption of predicated function calls within lambda functions (PR 149)
#### 1.5.1 Maintenance Release

@@ -2,0 +8,0 @@

2

jsonata.min.js

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

var jsonata=function(){"use strict";function e(e){for(var t=1,r=[],n={},i=n;t<e.length;){var a=e.charAt(t);if(":"===a)break;var o=function(){r.push(n),i=n,n={}},s=function(e,t,r,n){for(var i=1,o=t;o<e.length;)if(o++,(a=e.charAt(o))===n){if(0==--i)break}else a===r&&i++;return o};switch(a){case"s":case"n":case"b":case"l":case"o":n.regex="["+a+"m]",n.type=a,o();break;case"a":n.regex="[asnblfom]",n.type=a,n.array=!0,o();break;case"f":n.regex="f",n.type=a,o();break;case"j":n.regex="[asnblom]",n.type=a,o();break;case"x":n.regex="[asnblfom]",n.type=a,o();break;case"-":i.context=!0,i.contextRegex=new RegExp(i.regex),i.regex+="?";break;case"?":case"+":i.regex+=a;break;case"(":var u=s(e,t,"(",")"),c=e.substring(t+1,u);if(-1!==c.indexOf("<"))throw{code:"S0402",stack:(new Error).stack,value:c,offset:t};n.regex="["+c+"m]",n.type="("+c+")",t=u,o();break;case"<":if("a"!==i.type&&"f"!==i.type)throw{code:"S0401",stack:(new Error).stack,value:i.type,offset:t};var f=s(e,t,"<",">");i.subtype=e.substring(t+1,f),t=f}t++}var l="^"+r.map(function(e){return"("+e.regex+")"}).join("")+"$",p=new RegExp(l),d=function(e){var t;if(I(e))t="f";else switch(typeof e){case"string":t="s";break;case"number":t="n";break;case"boolean":t="b";break;case"object":t=null===e?"l":Array.isArray(e)?"a":"o";break;case"undefined":default:t="m"}return t},h=function(e,t){for(var n="^",i=0,a=0;a<r.length;a++){n+=r[a].regex;var o=t.match(n);if(null===o)throw{code:"T0410",stack:(new Error).stack,value:e[i],index:i+1};i=o[0].length}throw{code:"T0410",stack:(new Error).stack,value:e[i],index:i+1}};return{definition:e,validate:function(e,t){var n="";e.forEach(function(e){n+=d(e)});var i=p.exec(n);if(i){var a=[],o=0;return r.forEach(function(r,n){var s=e[o],u=i[n+1];if(""===u)if(r.context&&r.contextRegex){var c=d(t);if(!r.contextRegex.test(c))throw{code:"T0411",stack:(new Error).stack,value:t,index:o+1};a.push(t)}else a.push(s),o++;else u.split("").forEach(function(t){if("a"===r.type){if("m"===t)s=void 0;else{s=e[o];var n=!0;if(void 0!==r.subtype)if("a"!==t&&u!==r.subtype)n=!1;else if("a"===t&&s.length>0){var i=d(s[0]);n=i===r.subtype.charAt(0)&&0===s.filter(function(e){return d(e)!==i}).length}if(!n)throw{code:"T0412",stack:(new Error).stack,value:s,index:o+1,type:r.subtype};"a"!==t&&(s=[s])}a.push(s),o++}else a.push(s),o++})}),a}h(e,n)}}}function t(e){var t=!1;if("number"==typeof e&&(t=!isNaN(e))&&!isFinite(e))throw{code:"D1001",value:e,stack:(new Error).stack};return t}function r(e){var t=!1;return Array.isArray(e)&&(t=0===e.filter(function(e){return"string"!=typeof e}).length),t}function n(e){var r=!1;return Array.isArray(e)&&(r=0===e.filter(function(e){return!t(e)}).length),r}function*i(e,t,r){var n,i=r.lookup("__evaluate_entry");switch(i&&i(e,t,r),e.type){case"path":n=yield*s(e,t,r);break;case"binary":n=yield*l(e,t,r);break;case"unary":n=yield*p(e,t,r);break;case"name":n=d(e,t,r);break;case"literal":n=h(e);break;case"wildcard":n=v(e,t);break;case"descendant":n=y(e,t);break;case"condition":n=yield*T(e,t,r);break;case"block":n=yield*D(e,t,r);break;case"bind":n=yield*O(e,t,r);break;case"regex":n=j(e);break;case"function":n=yield*C(e,t,r);break;case"variable":n=P(e,t,r);break;case"lambda":n=U(e,t,r);break;case"partial":n=yield*R(e,t,r);break;case"apply":n=yield*F(e,t,r);break;case"sort":n=yield*_(e,t,r);break;case"transform":n=M(e,t,r)}!r.lookup("__jsonata_async")||void 0!==n&&null!==n&&"function"==typeof n.then||(n=Promise.resolve(n)),r.lookup("__jsonata_async")&&"function"==typeof n.then&&e.nextFunction&&"function"==typeof n[e.nextFunction]||(n=yield n),e.hasOwnProperty("predicate")&&(n=yield*c(e.predicate,n,r)),e.hasOwnProperty("group")&&(n=yield*E(e.group,n,r));var a=r.lookup("__evaluate_exit");return a&&a(e,t,r,n),n&&n.sequence&&(n=n.value()),n}function a(){var e=o([]);return 1===arguments.length&&e.push(arguments[0]),e}function o(e){return Object.defineProperty(e,"sequence",{enumerable:!1,configurable:!1,get:function(){return!0}}),Object.defineProperty(e,"keepSingleton",{enumerable:!1,configurable:!1,writable:!0,value:!1}),Object.defineProperty(e,"value",{enumerable:!1,configurable:!1,get:function(){return function(){switch(this.length){case 0:return;case 1:return this.keepSingleton?this:this[0];default:return this}}}}),e}function*s(e,t,r){var n;n="variable"===e.steps[0].type?a(t):Array.isArray(t)?t:a(t);for(var o,s=0;s<e.steps.length;s++){var c=e.steps[s];if(void 0===(o=0===s&&c.consarray?yield*i(c,n,r):yield*u(c,n,r,s===e.steps.length-1))||0===o.length)break;n=o}return e.keepSingletonArray&&(o.keepSingleton=!0),o}function*u(e,t,r,n){for(var o=a(),s=0;s<t.length;s++){var u=yield*i(e,t[s],r);void 0!==u&&o.push(u)}var c=a();return n&&1===o.length&&Array.isArray(o[0])&&!o[0].sequence?c=o[0]:o.forEach(function(e){!Array.isArray(e)||e.cons||e.keepSingleton?c.push(e):Array.prototype.push.apply(c,e)}),c}function*c(e,r,n){for(var i=r,o=a(),s=0;s<e.length;s++){var u=e[s];if(Array.isArray(i)||(i=a(i)),o=a(),"literal"===u.type&&t(u.value)){var c=u.value;Number.isInteger(c)||(c=Math.floor(c)),c<0&&(c=i.length+c),o=i[c]}else o=yield*f(u,i,n);i=o}return o}function*f(e,r,o){for(var s=a(),u=0;u<r.length;u++){var c=r[u],f=yield*i(e,c,o);t(f)&&(f=[f]),n(f)?f.forEach(function(e){Number.isInteger(e)||(e=Math.floor(e)),e<0&&(e=r.length+e),e===u&&s.push(c)}):X(f)&&s.push(c)}return s}function*l(e,t,r){var n,a=yield*i(e.lhs,t,r),o=yield*i(e.rhs,t,r),s=e.value;try{switch(s){case"+":case"-":case"*":case"/":case"%":n=m(a,o,s);break;case"=":case"!=":case"<":case"<=":case">":case">=":n=k(a,o,s);break;case"&":n=A(a,o);break;case"and":case"or":n=w(a,o,s);break;case"..":n=S(a,o);break;case"in":n=x(a,o)}}catch(t){throw t.position=e.position,t.token=s,t}return n}function*p(e,r,n){var a;switch(e.value){case"-":if(void 0===(a=yield*i(e.expression,r,n)))a=void 0;else{if(!t(a))throw{code:"D1002",stack:(new Error).stack,position:e.position,token:e.value,value:a};a=-a}break;case"[":a=[];for(var o=0;o<e.expressions.length;o++){var s=e.expressions[o],u=yield*i(s,r,n);void 0!==u&&("["===s.value?a.push(u):a=ee(a,u))}e.consarray&&Object.defineProperty(a,"cons",{enumerable:!1,configurable:!1,value:!0});break;case"{":a=yield*E(e,r,n)}return a}function d(e,t,r){var n;if(Array.isArray(t)){n=a();for(var i=0;i<t.length;i++){var o=d(e,t[i],r);void 0!==o&&n.push(o)}}else null!==t&&"object"==typeof t&&(n=t[e.value]);return n}function h(e){return e.value}function v(e,t){var r=a();return null!==t&&"object"==typeof t&&Object.keys(t).forEach(function(e){var n=t[e];Array.isArray(n)?(n=g(n),r=ee(r,n)):r.push(n)}),r}function g(e,t){return void 0===t&&(t=[]),Array.isArray(e)?e.forEach(function(e){g(e,t)}):t.push(e),t}function y(e,t){var r,n=a();return void 0!==t&&(b(t,n),r=1===n.length?n[0]:n),r}function b(e,t){Array.isArray(e)||t.push(e),Array.isArray(e)?e.forEach(function(e){b(e,t)}):null!==e&&"object"==typeof e&&Object.keys(e).forEach(function(r){b(e[r],t)})}function m(e,r,n){var i;if(void 0===e||void 0===r)return i;if(!t(e))throw{code:"T2001",stack:(new Error).stack,value:e};if(!t(r))throw{code:"T2002",stack:(new Error).stack,value:r};switch(n){case"+":i=e+r;break;case"-":i=e-r;break;case"*":i=e*r;break;case"/":i=e/r;break;case"%":i=e%r}return i}function k(e,t,r){var n,i=typeof e,a=typeof t;if("undefined"===i||"undefined"===a)return!1;var o=function(){if("string"!==i&&"number"!==i||"string"!==a&&"number"!==a)throw{code:"T2010",stack:(new Error).stack,value:"string"!==i&&"number"!==i?e:t};if(i!==a)throw{code:"T2009",stack:(new Error).stack,value:e,value2:t}};switch(r){case"=":n=e===t;break;case"!=":n=e!==t;break;case"<":o(),n=e<t;break;case"<=":o(),n=e<=t;break;case">":o(),n=e>t;break;case">=":o(),n=e>=t}return n}function x(e,t){var r=!1;if(void 0===e||void 0===t)return!1;Array.isArray(t)||(t=[t]);for(var n=0;n<t.length;n++)if(t[n]===e){r=!0;break}return r}function w(e,t,r){var n;switch(r){case"and":n=X(e)&&X(t);break;case"or":n=X(e)||X(t)}return n}function A(e,t){var r="",n="";return void 0!==e&&(r=V(e)),void 0!==t&&(n=V(t)),r.concat(n)}function*E(e,t,r){var n={},o={};Array.isArray(t)||(t=a(t));for(var s=0;s<t.length;s++)for(var u=t[s],c=0;c<e.lhs.length;c++){var f=e.lhs[c],l=yield*i(f[0],u,r);if("string"!=typeof l)throw{code:"T1003",stack:(new Error).stack,position:e.position,value:l};var p={data:u,expr:f[1]};o.hasOwnProperty(l)?o[l].data=ee(o[l].data,u):o[l]=p}for(l in o){var d=yield*i((p=o[l]).expr,p.data,r);void 0!==d&&(n[l]=d)}return n}function S(e,t){var r;if(void 0===e||void 0===t)return r;if(e>t)return r;if(!Number.isInteger(e))throw{code:"T2003",stack:(new Error).stack,value:e};if(!Number.isInteger(t))throw{code:"T2004",stack:(new Error).stack,value:t};r=new Array(t-e+1);for(var n=e,i=0;n<=t;n++,i++)r[i]=n;return o(r)}function*O(e,t,r){var n=yield*i(e.rhs,t,r);if("variable"!==e.lhs.type)throw{code:"D2005",stack:(new Error).stack,position:e.position,token:e.value,value:"path"===e.lhs.type?e.lhs.steps[0].value:e.lhs.value};return r.bind(e.lhs.value,n),n}function*T(e,t,r){var n;return X(yield*i(e.condition,t,r))?n=yield*i(e.then,t,r):void 0!==e.else&&(n=yield*i(e.else,t,r)),n}function*D(e,t,r){for(var n,a=ne(r),o=0;o<e.expressions.length;o++)n=yield*i(e.expressions[o],t,a);return n}function j(e){e.value.lastIndex=0;var t=function(r){var n,i=e.value,a=i.exec(r);if(null!==a){if(n={match:a[0],start:a.index,end:a.index+a[0].length,groups:[]},a.length>1)for(var o=1;o<a.length;o++)n.groups.push(a[o]);n.next=function(){if(!(i.lastIndex>=r.length)){var n=t(r);if(n&&""===n.match&&i.lastIndex===e.value.lastIndex)throw{code:"D1004",stack:(new Error).stack,position:e.position,value:e.value.source};return n}}}return n};return t}function P(e,t,r){return""===e.value?t:r.lookup(e.value)}function*_(e,t,r){return re(yield*i(e.lhs,t,r),function(t,n){for(var i=0,a=0;0===i&&a<e.rhs.length;a++){var o=e.rhs[a],s=N(o.expression,t,r),u=N(o.expression,n,r),c=typeof s,f=typeof u;if("undefined"!==c)if("undefined"!==f){if("string"!==c&&"number"!==c||"string"!==f&&"number"!==f)throw{code:"T2008",stack:(new Error).stack,position:e.position,value:"string"!==c&&"number"!==c?s:u};if(c!==f)throw{code:"T2007",stack:(new Error).stack,position:e.position,value:s,value2:u};s!==u&&(i=s<u?-1:1,!0===o.descending&&(i=-i))}else i=-1;else i="undefined"===f?0:1}return 1===i})}function M(e,t,n){return H(function*(t){if(void 0!==t){var a=n.lookup("clone");if(!I(a))throw{code:"T2013",stack:(new Error).stack,position:e.position};var o=yield*G(a,[t],n),s=yield*i(e.pattern,o,n);if(void 0!==s){Array.isArray(s)||(s=[s]);for(var u=0;u<s.length;u++){var c=s[u],f=yield*i(e.update,c,n),l=typeof f;if("undefined"!==l){if("object"!==l||null===f)throw{code:"T2011",stack:(new Error).stack,position:e.update.position,value:f};for(var p in f)c[p]=f[p]}if(void 0!==e.delete){var d=yield*i(e.delete,c,n);if(void 0!==d){var h=d;if(Array.isArray(d)||(d=[d]),!r(d))throw{code:"T2012",stack:(new Error).stack,position:e.delete.position,value:h};for(var v=0;v<d.length;v++)delete c[d[v]]}}}}return o}},"<(oa):o>")}function N(e,t,r){for(var n=i(e,t,r),a=n.next();!a.done;)a=n.next(a.value);return a.value}function*F(e,t,r){var n;if("function"===e.rhs.type)e.rhs.arguments.unshift(e.lhs),n=yield*C(e.rhs,t,r),e.rhs.arguments.shift();else{var a=yield*i(e.lhs,t,r),o=yield*i(e.rhs,t,r);if(!I(o))throw{code:"T2006",stack:(new Error).stack,position:e.position,value:o};n=I(a)?yield*G(le,[a,o],r):yield*G(o,[a],r)}return n}function I(e){return e&&(!0===e._jsonata_function||!0===e._jsonata_lambda)||"function"==typeof e}function $(e){return e&&!0===e._jsonata_lambda}function z(e){return"object"==typeof e&&null!==e&&Symbol.iterator in e&&"function"==typeof e[Symbol.iterator]&&"next"in e&&"function"==typeof e.next}function*C(e,t,r){var n,a=yield*i(e.procedure,t,r);if(void 0===a&&"path"===e.procedure.type&&r.lookup(e.procedure.steps[0].value))throw{code:"T1005",stack:(new Error).stack,position:e.position,token:e.procedure.steps[0].value};for(var o=[],s=0;s<e.arguments.length;s++)o.push(yield*i(e.arguments[s],t,r));try{n=yield*G(a,o,t)}catch(t){throw t.position=e.position,t.token="path"===e.procedure.type?e.procedure.steps[0].value:e.procedure.value,t}return n}function*G(e,t,r){var n;for(n=yield*q(e,t,r);$(n)&&!0===n.thunk;){for(var a=yield*i(n.body.procedure,n.input,n.environment),o=[],s=0;s<n.body.arguments.length;s++)o.push(yield*i(n.body.arguments[s],n.input,n.environment));n=yield*q(a,o,r)}return n}function*q(e,t,r){var n,i=t;if(e&&(i=J(e.signature,t,r)),$(e))n=yield*B(e,i);else if(e&&!0===e._jsonata_function)z(n=e.implementation.apply(r,i))&&(n=yield*n);else{if("function"!=typeof e)throw{code:"T1006",stack:(new Error).stack};z(n=e.apply(r,i))&&(n=yield*n)}return n}function U(e,t,r){var n={_jsonata_lambda:!0,input:t,environment:r,arguments:e.arguments,signature:e.signature,body:e.body};return!0===e.thunk&&(n.thunk=!0),n}function*R(e,t,r){for(var n,a=[],o=0;o<e.arguments.length;o++){var s=e.arguments[o];"operator"===s.type&&"?"===s.value?a.push(s):a.push(yield*i(s,t,r))}var u=yield*i(e.procedure,t,r);if(void 0===u&&"path"===e.procedure.type&&r.lookup(e.procedure.steps[0].value))throw{code:"T1007",stack:(new Error).stack,position:e.position,token:e.procedure.steps[0].value};if($(u))n=L(u,a);else if(u&&!0===u._jsonata_function)n=K(u.implementation,a);else{if("function"!=typeof u)throw{code:"T1008",stack:(new Error).stack,position:e.position,token:"path"===e.procedure.type?e.procedure.steps[0].value:e.procedure.value};n=K(u,a)}return n}function J(e,t,r){return void 0===e?t:e.validate(t,r)}function*B(e,t){var r=ne(e.environment);return e.arguments.forEach(function(e,n){r.bind(e.value,t[n])}),"function"==typeof e.body?yield*Q(e.body,r):yield*i(e.body,e.input,r)}function L(e,t){var r=ne(e.environment),n=[];return e.arguments.forEach(function(e,i){var a=t[i];a&&"operator"===a.type&&"?"===a.value?n.push(e):r.bind(e.value,a)}),{_jsonata_lambda:!0,input:e.input,environment:r,arguments:n,body:e.body}}function K(e,t){var r=Z(e),n="function("+(r=r.map(function(e){return"$"+e.trim()})).join(", ")+"){ _ }",i=ce(n);return i.body=e,L(i,t)}function*Q(e,t){var r=Z(e).map(function(e){return t.lookup(e.trim())}),n=e.apply(null,r);return z(n)&&(n=yield*n),n}function Z(e){var t=e.toString();return/\(([^)]*)\)/.exec(t)[1].split(",")}function H(t,r){var n={_jsonata_function:!0,implementation:t};return void 0!==r&&(n.signature=e(r)),n}function V(e){if(void 0!==e){var r;if("string"==typeof e)r=e;else if(I(e))r="";else{if("number"==typeof e&&!isFinite(e))throw{code:"D3001",value:e,stack:(new Error).stack};r=JSON.stringify(e,function(e,r){return void 0!==r&&null!==r&&r.toPrecision&&t(r)?Number(r.toPrecision(13)):r&&I(r)?"":r})}return r}}function W(e,t){var r;if(void 0!==e){if(t){var n=e.toString().split("e");e=+(n[0]+"e"+(n[1]?+n[1]+t:t))}var i=(r=Math.round(e))-e;return.5===Math.abs(i)&&1===Math.abs(r%2)&&(r-=1),t&&(r=+((n=r.toString().split("e"))[0]+"e"+(n[1]?+n[1]-t:-t))),Object.is(r,-0)&&(r=0),r}}function X(e){if(void 0!==e){var r=!1;return Array.isArray(e)?1===e.length?r=X(e[0]):e.length>1&&(r=e.filter(function(e){return X(e)}).length>0):"string"==typeof e?e.length>0&&(r=!0):t(e)?0!==e&&(r=!0):null!==e&&"object"==typeof e?Object.keys(e).length>0&&($(e)||e._jsonata_function||(r=!0)):"boolean"==typeof e&&!0===e&&(r=!0),r}}function Y(e){var t=a();if(Array.isArray(e)){var r={};e.forEach(function(e){var t=Y(e);Array.isArray(t)&&t.forEach(function(e){r[e]=!0})}),t=Y(r)}else null===e||"object"!=typeof e||$(e)?t=void 0:0===(t=Object.keys(e)).length&&(t=void 0);return t}function ee(e,t){return void 0===e?t:void 0===t?e:(Array.isArray(e)||(e=a(e)),Array.isArray(t)||(t=[t]),e.concat(t))}function te(e){var t=a();if(Array.isArray(e))e.forEach(function(e){t=ee(t,te(e))});else if(null===e||"object"!=typeof e||$(e))t=e;else for(var r in e){var n={};n[r]=e[r],t.push(n)}return t}function re(e,t){if(void 0!==e){if(e.length<=1)return e;var i;if(void 0===t){if(!n(e)&&!r(e))throw{stack:(new Error).stack,code:"D3070",index:1};i=function(e,t){return e>t}}else i="function"==typeof t?t:function(e,r){for(var n=G(t,[e,r],null),i=n.next();!i.done;)i=n.next(i.value);return i.value};var a=function(e,t){var r=function(e,t,n){0===t.length?Array.prototype.push.apply(e,n):0===n.length?Array.prototype.push.apply(e,t):i(t[0],n[0])?(e.push(n[0]),r(e,t,n.slice(1))):(e.push(t[0]),r(e,t.slice(1),n))},n=[];return r(n,e,t),n},o=function(e){if(e.length<=1)return e;var t=Math.floor(e.length/2),r=e.slice(0,t),n=e.slice(t);return r=o(r),n=o(n),a(r,n)};return o(e)}}function ne(e){var t={};return{bind:function(e,r){t[e]=r},lookup:function(r){var n;return t.hasOwnProperty(r)?n=t[r]:e&&(n=e.lookup(r)),n}}}function ie(e){var t="Unknown error";void 0!==e.message&&(t=e.message);var r=de[e.code];return void 0!==r&&(t=(t=r.replace(/\{\{\{([^}]+)}}}/g,function(){return e[arguments[1]]})).replace(/\{\{([^}]+)}}/g,function(){return JSON.stringify(e[arguments[1]])})),t}function ae(e,t){var r,n;try{r=ce(e,t&&t.recover),n=r.errors,delete r.errors}catch(e){throw e.message=ie(e),e}var a=ne(fe),o=new Date;return a.bind("now",H(function(){return o.toJSON()},"<:s>")),a.bind("millis",H(function(){return o.getTime()},"<:n>")),{evaluate:function(e,t,s){if(void 0!==n){var u={code:"S0500",position:0};throw u.message=ie(u),u}if(void 0!==t){var c;c=ne(a);for(var f in t)c.bind(f,t[f])}else c=a;c.bind("$",e),o=new Date;var l,p;if("function"==typeof s){c.bind("__jsonata_async",!0);var d=function(e){(l=p.next(e)).done?s(null,l.value):l.value.then(d).catch(function(e){e.message=ie(e),s(e,null)})};p=i(r,e,c),(l=p.next()).value.then(d)}else try{for(p=i(r,e,c),l=p.next();!l.done;)l=p.next(l.value);return l.value}catch(u){throw u.message=ie(u),u}},assign:function(e,t){a.bind(e,t)},registerFunction:function(e,t,r){var n=H(t,r);a.bind(e,n)},ast:function(){return r},errors:function(){return n}}}var oe={".":75,"[":80,"]":0,"{":70,"}":0,"(":80,")":0,",":0,"@":75,"#":70,";":80,":":80,"?":20,"+":50,"-":50,"*":60,"/":60,"%":60,"|":20,"=":40,"<":40,">":40,"^":40,"**":60,"..":20,":=":10,"!=":40,"<=":40,">=":40,"~>":40,and:30,or:25,in:40,"&":50,"!":0,"~":0},se={'"':'"',"\\":"\\","/":"/",b:"\b",f:"\f",n:"\n",r:"\r",t:"\t"},ue=function(e){var t=0,r=e.length,n=function(e,r){return{type:e,value:r,position:t}},i=function(){for(var n,i,a=t,o=0;t<r;){var s=e.charAt(t);if("/"===s&&"\\"!==e.charAt(t-1)&&0===o){if(""===(n=e.substring(a,t)))throw{code:"S0301",stack:(new Error).stack,position:t};for(t++,s=e.charAt(t),a=t;"i"===s||"m"===s;)t++,s=e.charAt(t);return i=e.substring(a,t)+"g",new RegExp(n,i)}"("!==s&&"["!==s&&"{"!==s||"\\"===e.charAt(t-1)||o++,")"!==s&&"]"!==s&&"}"!==s||"\\"===e.charAt(t-1)||o--,t++}throw{code:"S0302",stack:(new Error).stack,position:t}};return function(a){if(t>=r)return null;for(var o=e.charAt(t);t<r&&" \t\n\r\v".indexOf(o)>-1;)t++,o=e.charAt(t);if(!0!==a&&"/"===o)return t++,n("regex",i());if("."===o&&"."===e.charAt(t+1))return t+=2,n("operator","..");if(":"===o&&"="===e.charAt(t+1))return t+=2,n("operator",":=");if("!"===o&&"="===e.charAt(t+1))return t+=2,n("operator","!=");if(">"===o&&"="===e.charAt(t+1))return t+=2,n("operator",">=");if("<"===o&&"="===e.charAt(t+1))return t+=2,n("operator","<=");if("*"===o&&"*"===e.charAt(t+1))return t+=2,n("operator","**");if("~"===o&&">"===e.charAt(t+1))return t+=2,n("operator","~>");if(oe.hasOwnProperty(o))return t++,n("operator",o);if('"'===o||"'"===o){var s=o;t++;for(var u="";t<r;){if("\\"===(o=e.charAt(t)))if(t++,o=e.charAt(t),se.hasOwnProperty(o))u+=se[o];else{if("u"!==o)throw{code:"S0103",stack:(new Error).stack,position:t,token:o};var c=e.substr(t+1,4);if(!/^[0-9a-fA-F]+$/.test(c))throw{code:"S0104",stack:(new Error).stack,position:t};var f=parseInt(c,16);u+=String.fromCharCode(f),t+=4}else{if(o===s)return t++,n("string",u);u+=o}t++}throw{code:"S0101",stack:(new Error).stack,position:t}}var l=/^-?(0|([1-9][0-9]*))(\.[0-9]+)?([Ee][-+]?[0-9]+)?/.exec(e.substring(t));if(null!==l){var p=parseFloat(l[0]);if(!isNaN(p)&&isFinite(p))return t+=l[0].length,n("number",p);throw{code:"S0102",stack:(new Error).stack,position:t,token:l[0]}}var d;if("`"===o){t++;var h=e.indexOf("`",t);if(-1!==h)return d=e.substring(t,h),t=h+1,n("name",d);throw t=r,{code:"S0105",stack:(new Error).stack,position:t}}for(var v,g=t;;)if(v=e.charAt(g),g===r||" \t\n\r\v".indexOf(v)>-1||oe.hasOwnProperty(v)){if("$"===e.charAt(t))return d=e.substring(t+1,g),t=g,n("variable",d);switch(d=e.substring(t,g),t=g,d){case"or":case"in":case"and":return n("operator",d);case"true":return n("value",!0);case"false":return n("value",!1);case"null":return n("value",null);default:return t===r&&""===d?null:n("name",d)}}else g++}},ce=function(r,n){var i,a,o={},s=[],u=function(){var e=[];"(end)"!==i.id&&e.push({type:i.type,value:i.value,position:i.position});for(var t=a();null!==t;)e.push(t),t=a();return e},c={nud:function(){var e={code:"S0211",token:this.value,position:this.position};if(n)return e.remaining=u(),e.type="error",s.push(e),e;throw e.stack=(new Error).stack,e}},f=function(e,t){var r=o[e];return t=t||0,r?t>=r.lbp&&(r.lbp=t):((r=Object.create(c)).id=r.value=e,r.lbp=t,o[e]=r),r},l=function(e){if(n){e.remaining=u(),s.push(e);var t=o["(error)"];return i=Object.create(t),i.error=e,i.type="(error)",i}throw e.stack=(new Error).stack,e},p=function(e,t){if(e&&i.id!==e){var n,s={code:n="(end)"===i.id?"S0203":"S0202",position:i.position,token:i.value,value:e};return l(s)}var u=a(t);if(null===u)return i=o["(end)"],i.position=r.length,i;var c,f=u.value,p=u.type;switch(p){case"name":case"variable":c=o["(name)"];break;case"operator":if(!(c=o[f]))return l({code:"S0204",stack:(new Error).stack,position:u.position,token:f});break;case"string":case"number":case"value":p="literal",c=o["(literal)"];break;case"regex":p="regex",c=o["(regex)"];break;default:return l({code:"S0205",stack:(new Error).stack,position:u.position,token:f})}return i=Object.create(c),i.value=f,i.type=p,i.position=u.position,i},d=function(e){var t,r=i;for(p(null,!0),t=r.nud();e<i.lbp;)r=i,p(),t=r.led(t);return t},h=function(e){f(e,0).nud=function(){return this}},v=function(e,t,r){var n=t||oe[e],i=f(e,n);return i.led=r||function(e){return this.lhs=e,this.rhs=d(n),this.type="binary",this},i},g=function(e,t,r){var n=t||oe[e],i=f(e,n);return i.led=r||function(e){return this.lhs=e,this.rhs=d(n-1),this.type="binary",this},i},y=function(e,t){var r=f(e);return r.nud=t||function(){return this.expression=d(70),this.type="unary",this},r};h("(end)"),h("(name)"),h("(literal)"),h("(regex)"),f(":"),f(";"),f(","),f(")"),f("]"),f("}"),f(".."),v("."),v("+"),v("-"),v("*"),v("/"),v("%"),v("="),v("<"),v(">"),v("!="),v("<="),v(">="),v("&"),v("and"),v("or"),v("in"),h("and"),h("or"),h("in"),g(":="),y("-"),v("~>"),g("(error)",10,function(e){return this.lhs=e,this.error=i.error,this.remaining=u(),this.type="error",this}),y("*",function(){return this.type="wildcard",this}),y("**",function(){return this.type="descendant",this}),v("(",oe["("],function(t){if(this.procedure=t,this.type="function",this.arguments=[],")"!==i.id)for(;"operator"===i.type&&"?"===i.id?(this.type="partial",this.arguments.push(i),p("?")):this.arguments.push(d(0)),","===i.id;)p(",");if(p(")",!0),"name"===t.type&&("function"===t.value||"λ"===t.value)){if(this.arguments.forEach(function(e,t){if("variable"!==e.type)return l({code:"S0208",stack:(new Error).stack,position:e.position,token:e.value,value:t+1})}),this.type="lambda","<"===i.id){for(var r=i.position,n=1,a="<";n>0&&"{"!==i.id&&"(end)"!==i.id;){var o=p();">"===o.id?n--:"<"===o.id&&n++,a+=o.value}p(">");try{this.signature=e(a)}catch(e){return e.position=r+e.offset,l(e)}}p("{"),this.body=d(0),p("}")}return this}),y("(",function(){for(var e=[];")"!==i.id&&(e.push(d(0)),";"===i.id);)p(";");return p(")",!0),this.type="block",this.expressions=e,this}),y("[",function(){var e=[];if("]"!==i.id)for(;;){var t=d(0);if(".."===i.id){var r={type:"binary",value:"..",position:i.position,lhs:t};p(".."),r.rhs=d(0),t=r}if(e.push(t),","!==i.id)break;p(",")}return p("]",!0),this.expressions=e,this.type="unary",this}),v("[",oe["["],function(e){if("]"===i.id){for(var t=e;t&&"binary"===t.type&&"["===t.value;)t=t.lhs;return t.keepArray=!0,p("]"),e}return this.lhs=e,this.rhs=d(oe["]"]),this.type="binary",p("]",!0),this}),v("^",oe["^"],function(e){p("(");for(var t=[];;){var r={descending:!1};if("<"===i.id?p("<"):">"===i.id&&(r.descending=!0,p(">")),r.expression=d(0),t.push(r),","!==i.id)break;p(",")}return p(")"),this.lhs=e,this.rhs=t,this.type="binary",this});var b=function(e){var t=[];if("}"!==i.id)for(;;){var r=d(0);p(":");var n=d(0);if(t.push([r,n]),","!==i.id)break;p(",")}return p("}",!0),void 0===e?(this.lhs=t,this.type="unary"):(this.lhs=e,this.rhs=t,this.type="binary"),this};y("{",b),v("{",oe["{"],b),v("?",oe["?"],function(e){return this.type="condition",this.condition=e,this.then=d(0),":"===i.id&&(p(":"),this.else=d(0)),this}),y("|",function(){return this.type="transform",this.pattern=d(0),p("|"),this.update=d(0),","===i.id&&(p(","),this.delete=d(0)),p("|"),this});var m=function(e){var t;if("function"===e.type){var r={type:"lambda",thunk:!0,arguments:[],position:e.position};r.body=e,t=r}else if("condition"===e.type)e.then=m(e.then),void 0!==e.else&&(e.else=m(e.else)),t=e;else if("block"===e.type){var n=e.expressions.length;n>0&&(e.expressions[n-1]=m(e.expressions[n-1])),t=e}else t=e;return t},k=function(e){var r;switch(e.type){case"binary":switch(e.value){case".":var i=k(e.lhs);r={type:"path",steps:[]},"path"===i.type?Array.prototype.push.apply(r.steps,i.steps):r.steps=[i];var a=k(e.rhs);"function"===a.type&&"path"===a.procedure.type&&1===a.procedure.steps.length&&"name"===a.procedure.steps[0].type&&"function"===r.steps[r.steps.length-1].type&&(r.steps[r.steps.length-1].nextFunction=a.procedure.steps[0].value),"path"!==a.type&&(a={type:"path",steps:[a]}),Array.prototype.push.apply(r.steps,a.steps),r.steps.filter(function(e){return"literal"===e.type}).forEach(function(e){e.type="name"}),r.steps.filter(function(e){return!0===e.keepArray}).length>0&&(r.keepSingletonArray=!0);var o=r.steps[0];"unary"===o.type&&"["===o.value&&(o.consarray=!0);var u=r.steps[r.steps.length-1];"unary"===u.type&&"["===u.value&&(u.consarray=!0);break;case"[":var c=r=k(e.lhs);if("path"===r.type&&(c=r.steps[r.steps.length-1]),void 0!==c.group)throw{code:"S0209",stack:(new Error).stack,position:e.position};void 0===c.predicate&&(c.predicate=[]),c.predicate.push(k(e.rhs));break;case"{":if(void 0!==(r=k(e.lhs)).group)throw{code:"S0210",stack:(new Error).stack,position:e.position};r.group={lhs:e.rhs.map(function(e){return[k(e[0]),k(e[1])]}),position:e.position};break;case"^":(r={type:"sort",value:e.value,position:e.position}).lhs=k(e.lhs),r.rhs=e.rhs.map(function(e){return{descending:e.descending,expression:k(e.expression)}});break;case":=":(r={type:"bind",value:e.value,position:e.position}).lhs=k(e.lhs),r.rhs=k(e.rhs);break;case"~>":(r={type:"apply",value:e.value,position:e.position}).lhs=k(e.lhs),r.rhs=k(e.rhs);break;default:(r={type:e.type,value:e.value,position:e.position}).lhs=k(e.lhs),r.rhs=k(e.rhs)}break;case"unary":r={type:e.type,value:e.value,position:e.position},"["===e.value?r.expressions=e.expressions.map(function(e){return k(e)}):"{"===e.value?r.lhs=e.lhs.map(function(e){return[k(e[0]),k(e[1])]}):(r.expression=k(e.expression),"-"===e.value&&"literal"===r.expression.type&&t(r.expression.value)&&((r=r.expression).value=-r.value));break;case"function":case"partial":(r={type:e.type,name:e.name,value:e.value,position:e.position}).arguments=e.arguments.map(function(e){return k(e)}),r.procedure=k(e.procedure);break;case"lambda":r={type:e.type,arguments:e.arguments,signature:e.signature,position:e.position};var f=k(e.body);r.body=m(f);break;case"condition":(r={type:e.type,position:e.position}).condition=k(e.condition),r.then=k(e.then),void 0!==e.else&&(r.else=k(e.else));break;case"transform":(r={type:e.type,position:e.position}).pattern=k(e.pattern),r.update=k(e.update),void 0!==e.delete&&(r.delete=k(e.delete));break;case"block":(r={type:e.type,position:e.position}).expressions=e.expressions.map(function(e){return k(e)});break;case"name":r={type:"path",steps:[e]},e.keepArray&&(r.keepSingletonArray=!0);break;case"literal":case"wildcard":case"descendant":case"variable":case"regex":r=e;break;case"operator":if("and"===e.value||"or"===e.value||"in"===e.value)e.type="name",r=k(e);else{if("?"!==e.value)throw{code:"S0201",stack:(new Error).stack,position:e.position,token:e.value};r=e}break;case"error":r=e,e.lhs&&(r=k(e.lhs));break;default:var l="S0206";"(end)"===e.id&&(l="S0207");var p={code:l,position:e.position,token:e.value};if(n)return s.push(p),{type:"error",error:p};throw p.stack=(new Error).stack,p}return r};a=ue(r),p();var x=d(0);if("(end)"!==i.id){var w={code:"S0201",position:i.position,token:i.value};l(w)}return x=k(x),s.length>0&&(x.errors=s),x},fe=ne(null);Number.isInteger=Number.isInteger||function(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e};var le=N(ce("function($f, $g) { function($x){ $g($f($x)) } }"),null,fe),pe=new RegExp("^\\d{4}(-[01]\\d)*(-[0-3]\\d)*(T[0-2]\\d:[0-5]\\d:[0-5]\\d)*(\\.\\d+)?([+-][0-2]\\d:?[0-5]\\d|Z)?$");fe.bind("sum",H(function(e){if(void 0!==e){var t=0;return e.forEach(function(e){t+=e}),t}},"<a<n>:n>")),fe.bind("count",H(function(e){return void 0===e?0:e.length},"<a:n>")),fe.bind("max",H(function(e){if(void 0!==e&&0!==e.length)return Math.max.apply(Math,e)},"<a<n>:n>")),fe.bind("min",H(function(e){if(void 0!==e&&0!==e.length)return Math.min.apply(Math,e)},"<a<n>:n>")),fe.bind("average",H(function(e){if(void 0!==e&&0!==e.length){var t=0;return e.forEach(function(e){t+=e}),t/e.length}},"<a<n>:n>")),fe.bind("string",H(V,"<x-:s>")),fe.bind("substring",H(function(e,t,r){if(void 0!==e)return e.substr(t,r)},"<s-nn?:s>")),fe.bind("substringBefore",H(function(e,t){if(void 0!==e){var r=e.indexOf(t);return r>-1?e.substr(0,r):e}},"<s-s:s>")),fe.bind("substringAfter",H(function(e,t){if(void 0!==e){var r=e.indexOf(t);return r>-1?e.substr(r+t.length):e}},"<s-s:s>")),fe.bind("lowercase",H(function(e){if(void 0!==e)return e.toLowerCase()},"<s-:s>")),fe.bind("uppercase",H(function(e){if(void 0!==e)return e.toUpperCase()},"<s-:s>")),fe.bind("length",H(function(e){if(void 0!==e)return e.length},"<s-:n>")),fe.bind("trim",H(function(e){if(void 0!==e){var t=e.replace(/[ \t\n\r]+/gm," ");return" "===t.charAt(0)&&(t=t.substring(1))," "===t.charAt(t.length-1)&&(t=t.substring(0,t.length-1)),t}},"<s-:s>")),fe.bind("pad",H(function(e,t,r){if(void 0!==e){void 0!==r&&0!==r.length||(r=" ");var n,i=Math.abs(t)-e.length;if(i>0){var a=new Array(i+1).join(r);r.length>1&&(a=a.substring(0,i)),n=t>0?e+a:a+e}else n=e;return n}},"<s-ns?:s>")),fe.bind("match",H(function(e,t,r){if(void 0!==e){if(r<0)throw{stack:(new Error).stack,value:r,code:"D3040",index:3};var n=a();if(void 0===r||r>0){var i=0,o=t(e);if(void 0!==o)for(;void 0!==o&&(void 0===r||i<r);)n.push({match:o.match,index:o.start,groups:o.groups}),o=o.next(),i++}return n}},"<s-f<s:o>n?:a<o>>")),fe.bind("contains",H(function(e,t){if(void 0!==e)return"string"==typeof t?-1!==e.indexOf(t):void 0!==t(e)},"<s-(sf):b>")),fe.bind("replace",H(function*(e,t,r,n){if(void 0!==e){if(""===t)throw{code:"D3010",stack:(new Error).stack,value:t,index:2};if(n<0)throw{code:"D3011",stack:(new Error).stack,value:n,index:4};var i;i="string"==typeof r?function(e){for(var t="",n=0,i=r.indexOf("$",n);-1!==i&&n<r.length;){t+=r.substring(n,i),n=i+1;var a=r.charAt(n);if("$"===a)t+="$",n++;else if("0"===a)t+=e.match,n++;else{var o;if(o=0===e.groups.length?1:Math.floor(Math.log(e.groups.length)*Math.LOG10E)+1,i=parseInt(r.substring(n,n+o),10),o>1&&i>e.groups.length&&(i=parseInt(r.substring(n,n+o-1),10)),isNaN(i))t+="$";else{if(e.groups.length>0){var s=e.groups[i-1];void 0!==s&&(t+=s)}n+=i.toString().length}}i=r.indexOf("$",n)}return t+=r.substring(n)}:r;var a="",o=0;if(void 0===n||n>0){var s=0;if("string"==typeof t){for(var u=e.indexOf(t,o);-1!==u&&(void 0===n||s<n);)a+=e.substring(o,u),a+=r,o=u+t.length,s++,u=e.indexOf(t,o);a+=e.substring(o)}else{var c=t(e);if(void 0!==c){for(;void 0!==c&&(void 0===n||s<n);){a+=e.substring(o,c.start);var f=yield*G(i,[c],null);if("string"!=typeof f)throw{code:"D3012",stack:(new Error).stack,value:f};a+=f,o=c.start+c.match.length,s++,c=c.next()}a+=e.substring(o)}else a=e}}else a=e;return a}},"<s-(sf)(sf)n?:s>")),fe.bind("split",H(function(e,t,r){if(void 0!==e){if(r<0)throw{code:"D3020",stack:(new Error).stack,value:r,index:3};var n=[];if(void 0===r||r>0)if("string"==typeof t)n=e.split(t,r);else{var i=0,a=t(e);if(void 0!==a){for(var o=0;void 0!==a&&(void 0===r||i<r);)n.push(e.substring(o,a.start)),o=a.end,a=a.next(),i++;(void 0===r||i<r)&&n.push(e.substring(o))}else n.push(e)}return n}},"<s-(sf)n?:a<s>>")),fe.bind("join",H(function(e,t){if(void 0!==e)return void 0===t&&(t=""),e.join(t)},"<a<s>s?:s>")),fe.bind("formatNumber",H(function(e,t,r){var n={"decimal-separator":".","grouping-separator":",","exponent-separator":"e",infinity:"Infinity","minus-sign":"-",NaN:"NaN",percent:"%","per-mille":"‰","zero-digit":"0",digit:"#","pattern-separator":";"};void 0!==r&&Object.keys(r).forEach(function(e){n[e]=r[e]});for(var i=[],a=n["zero-digit"].charCodeAt(0),o=a;o<a+10;o++)i.push(String.fromCharCode(o));var s=i.concat([n["decimal-separator"],n["exponent-separator"],n["grouping-separator"],n.digit,n["pattern-separator"]]),u=t.split(n["pattern-separator"]);if(u.length>2)throw{code:"D3080",stack:(new Error).stack};var c=u.map(function(e){var t,r,i,a,o=function(){for(var t,r=0;r<e.length;r++)if(t=e.charAt(r),-1!==s.indexOf(t)&&t!==n["exponent-separator"])return e.substring(0,r)}(),u=function(){for(var t,r=e.length-1;r>=0;r--)if(t=e.charAt(r),-1!==s.indexOf(t)&&t!==n["exponent-separator"])return e.substring(r+1)}(),c=e.substring(o.length,e.length-u.length),f=e.indexOf(n["exponent-separator"],o.length);-1===f||f>e.length-u.length?(t=c,r=void 0):(t=c.substring(0,f),r=c.substring(f+1));var l=t.indexOf(n["decimal-separator"]);return-1===l?(i=t,a=u):(i=t.substring(0,l),a=t.substring(l+1)),{prefix:o,suffix:u,activePart:c,mantissaPart:t,exponentPart:r,integerPart:i,fractionalPart:a,subpicture:e}});c.forEach(function(e){var t,r,a=e.subpicture,o=a.indexOf(n["decimal-separator"]);o!==a.lastIndexOf(n["decimal-separator"])&&(t="D3081"),a.indexOf(n.percent)!==a.lastIndexOf(n.percent)&&(t="D3082"),a.indexOf(n["per-mille"])!==a.lastIndexOf(n["per-mille"])&&(t="D3083"),-1!==a.indexOf(n.percent)&&-1!==a.indexOf(n["per-mille"])&&(t="D3084");var u=!1;for(r=0;r<e.mantissaPart.length;r++){var c=e.mantissaPart.charAt(r);if(-1!==i.indexOf(c)||c===n.digit){u=!0;break}}u||(t="D3085"),-1!==e.activePart.split("").map(function(e){return-1===s.indexOf(e)?"p":"a"}).join("").indexOf("p")&&(t="D3086"),-1!==o?a.charAt(o-1)!==n["grouping-separator"]&&a.charAt(o+1)!==n["grouping-separator"]||(t="D3087"):e.integerPart.charAt(e.integerPart.length-1)===n["grouping-separator"]&&(t="D3088"),-1!==a.indexOf(n["grouping-separator"]+n["grouping-separator"])&&(t="D3089");var f=e.integerPart.indexOf(n.digit);-1!==f&&e.integerPart.substring(0,f).split("").filter(function(e){return i.indexOf(e)>-1}).length>0&&(t="D3090"),-1!==(f=e.fractionalPart.lastIndexOf(n.digit))&&e.fractionalPart.substring(f).split("").filter(function(e){return i.indexOf(e)>-1}).length>0&&(t="D3091");var l="string"==typeof e.exponentPart;if(l&&e.exponentPart.length>0&&(-1!==a.indexOf(n.percent)||-1!==a.indexOf(n["per-mille"]))&&(t="D3092"),l&&(0===e.exponentPart.length||e.exponentPart.split("").filter(function(e){return-1===i.indexOf(e)}).length>0)&&(t="D3093"),t)throw{code:t,stack:(new Error).stack}});var f=c.map(function(e){var t=function(t,r){for(var a=[],o=t.indexOf(n["grouping-separator"]);-1!==o;){var s=(r?t.substring(0,o):t.substring(o)).split("").filter(function(e){return-1!==i.indexOf(e)||e===n.digit}).length;a.push(s),o=e.integerPart.indexOf(n["grouping-separator"],o+1)}return a},r=t(e.integerPart),a=function(e){if(0===e.length)return 0;for(var t=function(e,r){return 0===r?e:t(r,e%r)},r=e.reduce(t),n=1;n<=e.length;n++)if(-1===e.indexOf(n*r))return 0;return r}(r),o=t(e.fractionalPart,!0),s=e.integerPart.split("").filter(function(e){return-1!==i.indexOf(e)}).length,u=s,c=e.fractionalPart.split(""),f=c.filter(function(e){return-1!==i.indexOf(e)}).length,l=c.filter(function(e){return-1!==i.indexOf(e)||e===n.digit}).length,p="string"==typeof e.exponentPart;0===s&&0===l&&(p?(f=1,l=1):s=1),p&&0===s&&-1!==e.integerPart.indexOf(n.digit)&&(s=1),0===s&&0===f&&(f=1);var d=0;return p&&(d=e.exponentPart.split("").filter(function(e){return-1!==i.indexOf(e)}).length),{integerPartGroupingPositions:r,regularGrouping:a,minimumIntegerPartSize:s,scalingFactor:u,prefix:e.prefix,fractionalPartGroupingPositions:o,minimumFactionalPartSize:f,maximumFactionalPartSize:l,minimumExponentSize:d,suffix:e.suffix,picture:e.subpicture}});1===f.length&&(f.push(JSON.parse(JSON.stringify(f[0]))),f[1].prefix=n["minus-sign"]+f[1].prefix);var l,p;p=-1!==(l=e>=0?f[0]:f[1]).picture.indexOf(n.percent)?100*e:-1!==l.picture.indexOf(n["per-mille"])?1e3*e:e;var d,h;if(0===l.minimumExponentSize)d=p;else{var v=Math.pow(10,l.scalingFactor),g=Math.pow(10,l.scalingFactor-1);for(d=p,h=0;d<g;)d*=10,h-=1;for(;d>v;)d/=10,h+=1}var y=function(e,t){var r=Math.abs(e).toFixed(t);return"0"!==n["zero-digit"]&&(r=r.split("").map(function(e){return e>="0"&&e<="9"?i[e.charCodeAt(0)-48]:e}).join("")),r},b=y(W(d,l.maximumFactionalPartSize),l.maximumFactionalPartSize),m=b.indexOf(".");for(-1===m?b+=n["decimal-separator"]:b=b.replace(".",n["decimal-separator"]);b.charAt(0)===n["zero-digit"];)b=b.substring(1);for(;b.charAt(b.length-1)===n["zero-digit"];)b=b.substring(0,b.length-1);m=b.indexOf(n["decimal-separator"]);var k=l.minimumIntegerPartSize-m,x=l.minimumFactionalPartSize-(b.length-m-1);if(b=(k>0?new Array(k+1).join("0"):"")+b,b+=x>0?new Array(x+1).join("0"):"",m=b.indexOf(n["decimal-separator"]),l.regularGrouping>0)for(var w=Math.floor((m-1)/l.regularGrouping),A=1;A<=w;A++)b=[b.slice(0,m-A*l.regularGrouping),n["grouping-separator"],b.slice(m-A*l.regularGrouping)].join("");else l.integerPartGroupingPositions.forEach(function(e){b=[b.slice(0,m-e),n["grouping-separator"],b.slice(m-e)].join(""),m++});if(m=b.indexOf(n["decimal-separator"]),l.fractionalPartGroupingPositions.forEach(function(e){b=[b.slice(0,e+m+1),n["grouping-separator"],b.slice(e+m+1)].join("")}),m=b.indexOf(n["decimal-separator"]),-1!==l.picture.indexOf(n["decimal-separator"])&&m!==b.length-1||(b=b.substring(0,b.length-1)),void 0!==h){var E=y(h,0);(k=l.minimumExponentSize-E.length)>0&&(E=new Array(k+1).join("0")+E),b=b+n["exponent-separator"]+(h<0?n["minus-sign"]:"")+E}return b=l.prefix+b+l.suffix},"<n-so?:s>")),fe.bind("formatBase",H(function(e,t){if(void 0!==e){if(e=W(e),(t=void 0===t?10:W(t))<2||t>36)throw{code:"D3100",stack:(new Error).stack,value:t};return e.toString(t)}},"<n-n?:s>")),fe.bind("number",H(function(e){var t;if(void 0!==e){if("number"==typeof e)t=e;else{if("string"!=typeof e||!/^-?(0|([1-9][0-9]*))(\.[0-9]+)?([Ee][-+]?[0-9]+)?$/.test(e)||isNaN(parseFloat(e))||!isFinite(e))throw{code:"D3030",value:e,stack:(new Error).stack,index:1};t=parseFloat(e)}return t}},"<(ns)-:n>")),fe.bind("floor",H(function(e){if(void 0!==e)return Math.floor(e)},"<n-:n>")),fe.bind("ceil",H(function(e){if(void 0!==e)return Math.ceil(e)},"<n-:n>")),fe.bind("round",H(W,"<n-n?:n>")),fe.bind("abs",H(function(e){if(void 0!==e)return Math.abs(e)},"<n-:n>")),fe.bind("sqrt",H(function(e){if(void 0!==e){if(e<0)throw{stack:(new Error).stack,code:"D3060",index:1,value:e};return Math.sqrt(e)}},"<n-:n>")),fe.bind("power",H(function(e,t){var r;if(void 0!==e){if(r=Math.pow(e,t),!isFinite(r))throw{stack:(new Error).stack,code:"D3061",index:1,value:e,exp:t};return r}},"<n-n:n>")),fe.bind("random",H(function(){return Math.random()},"<:n>")),fe.bind("boolean",H(X,"<x-:b>")),fe.bind("not",H(function(e){return!X(e)},"<x-:b>")),fe.bind("map",H(function*(e,t){if(void 0!==e){for(var r=a(),n=0;n<e.length;n++){var i=[e[n]],o="function"==typeof t?t.length:!0===t._jsonata_function?t.implementation.length:t.arguments.length;o>=2&&i.push(n),o>=3&&i.push(e);var s=yield*G(t,i,null);void 0!==s&&r.push(s)}return r}},"<af>")),fe.bind("zip",H(function(){for(var e=[],t=Array.prototype.slice.call(arguments),r=Math.min.apply(Math,t.map(function(e){return Array.isArray(e)?e.length:0})),n=0;n<r;n++){var i=t.map(e=>e[n]);e.push(i)}return e},"<a+>")),fe.bind("filter",H(function*(e,t){if(void 0!==e){for(var r=a(),n=0;n<e.length;n++){var i=e[n];X(function(e,r,n){for(var i=G(t,[e,r,n],null),a=i.next();!a.done;)a=i.next(a.value);return a.value}(i,n,e))&&r.push(i)}return r}},"<af>")),fe.bind("reduce",H(function*(e,t,r){if(void 0!==e){var n;if(2!==t.length&&(!0!==t._jsonata_function||2!==t.implementation.length)&&2!==t.arguments.length)throw{stack:(new Error).stack,code:"D3050",index:1};var i;for(void 0===r&&e.length>0?(n=e[0],i=1):(n=r,i=0);i<e.length;)n=yield*G(t,[n,e[i]],null),i++;return n}},"<afj?:j>")),fe.bind("sift",H(function(e,t){var r={};for(var n in e){var i=e[n];X(function(e,r,n){for(var i=G(t,[e,r,n],null),a=i.next();!a.done;)a=i.next(a.value);return a.value}(i,n,e))&&(r[n]=i)}return 0===Object.keys(r).length&&(r=void 0),r},"<o-f?:o>")),fe.bind("keys",H(Y,"<x-:a<s>>")),fe.bind("lookup",H(function(e,t){return d({value:t},e)},"<x-s:x>")),fe.bind("append",H(ee,"<xx:a>")),fe.bind("exists",H(function(e){return void 0!==e},"<x:b>")),fe.bind("spread",H(te,"<x-:a<o>>")),fe.bind("merge",H(function(e){if(void 0!==e){var t={};return e.forEach(function(e){for(var r in e)t[r]=e[r]}),t}},"<a<o>:o>")),fe.bind("reverse",H(function(e){if(void 0!==e){if(e.length<=1)return e;for(var t=e.length,r=new Array(t),n=0;n<t;n++)r[t-n-1]=e[n];return r}},"<a:a>")),fe.bind("each",H(function*(e,t){var r=a();for(var n in e){var i=[e[n],n];r.push(yield*G(t,i,null))}return r},"<o-f:a>")),fe.bind("sort",H(re,"<af?:a>")),fe.bind("shuffle",H(function(e){if(void 0!==e){if(e.length<=1)return e;for(var t=new Array(e.length),r=0;r<e.length;r++){var n=Math.floor(Math.random()*(r+1));r!==n&&(t[r]=t[n]),t[n]=e[r]}return t}},"<a:a>")),fe.bind("base64encode",H(function(e){if(void 0!==e)return("undefined"!=typeof window?window.btoa:function(e){return new global.Buffer(e,"binary").toString("base64")})(e)},"<s-:s>")),fe.bind("base64decode",H(function(e){if(void 0!==e)return("undefined"!=typeof window?window.atob:function(e){return new global.Buffer(e,"base64").toString("binary")})(e)},"<s-:s>")),fe.bind("toMillis",H(function(e){if(void 0!==e){if(!pe.test(e))throw{stack:(new Error).stack,code:"D3110",value:e};return Date.parse(e)}},"<s-:n>")),fe.bind("fromMillis",H(function(e){if(void 0!==e)return new Date(e).toISOString()},"<n-:s>")),fe.bind("clone",H(function(e){if(void 0!==e)return JSON.parse(V(e))},"<(oa)-:o>"));var de={S0101:"String literal must be terminated by a matching quote",S0102:"Number out of range: {{token}}",S0103:"Unsupported escape sequence: \\{{token}}",S0104:"The escape sequence \\u must be followed by 4 hex digits",S0105:"Quoted property name must be terminated with a backquote (`)",S0201:"Syntax error: {{token}}",S0202:"Expected {{value}}, got {{token}}",S0203:"Expected {{value}} before end of expression",S0204:"Unknown operator: {{token}}",S0205:"Unexpected token: {{token}}",S0206:"Unknown expression type: {{token}}",S0207:"Unexpected end of expression",S0208:"Parameter {{value}} of function definition must be a variable name (start with $)",S0209:"A predicate cannot follow a grouping expression in a step",S0210:"Each step can only have one grouping expression",S0211:"The symbol {{token}} cannot be used as a unary operator",S0301:"Empty regular expressions are not allowed",S0302:"No terminating / in regular expression",S0402:"Choice groups containing parameterized types are not supported",S0401:"Type parameters can only be applied to functions and arrays",S0500:"Attempted to evaluate an expression containing syntax error(s)",T0410:"Argument {{index}} of function {{token}} does not match function signature",T0411:"Context value is not a compatible type with argument {{index}} of function {{token}}",T0412:"Argument {{index}} of function {{token}} must be an array of {{type}}",D1001:"Number out of range: {{value}}",D1002:"Cannot negate a non-numeric value: {{value}}",T1003:"Key in object structure must evaluate to a string; got: {{value}}",D1004:"Regular expression matches zero length string",T1005:"Attempted to invoke a non-function. Did you mean ${{{token}}}?",T1006:"Attempted to invoke a non-function",T1007:"Attempted to partially apply a non-function. Did you mean ${{{token}}}?",T1008:"Attempted to partially apply a non-function",T2001:"The left side of the {{token}} operator must evaluate to a number",T2002:"The right side of the {{token}} operator must evaluate to a number",T2003:"The left side of the range operator (..) must evaluate to an integer",T2004:"The right side of the range operator (..) must evaluate to an integer",D2005:"The left side of := must be a variable name (start with $)",T2006:"The right side of the function application operator ~> must be a function",T2007:"Type mismatch when comparing values {{value}} and {{value2}} in order-by clause",T2008:"The expressions within an order-by clause must evaluate to numeric or string values",T2009:"The values {{value}} and {{value2}} either side of operator {{token}} must be of the same data type",T2010:"The expressions either side of operator {{token}} must evaluate to numeric or string values",T2011:"The insert/update clause of the transform expression must evaluate to an object: {{value}}",T2012:"The delete clause of the transform expression must evaluate to a string or array of strings: {{value}}",T2013:"The transform expression clones the input object using the $clone() function. This has been overridden in the current scope by a non-function.",D3001:"Attempting to invoke string function on Infinity or NaN",D3010:"Second argument of replace function cannot be an empty string",D3011:"Fourth argument of replace function must evaluate to a positive number",D3012:"Attempted to replace a matched string with a non-string value",D3020:"Third argument of split function must evaluate to a positive number",D3030:"Unable to cast value to a number: {{value}}",D3040:"Third argument of match function must evaluate to a positive number",D3050:"First argument of reduce function must be a function with two arguments",D3060:"The sqrt function cannot be applied to a negative number: {{value}}",D3061:"The power function has resulted in a value that cannot be represented as a JSON number: base={{value}}, exponent={{exp}}",D3070:"The single argument form of the sort function can only be applied to an array of strings or an array of numbers. Use the second argument to specify a comparison function",D3080:"The picture string must only contain a maximum of two sub-pictures",D3081:"The sub-picture must not contain more than one instance of the 'decimal-separator' character",D3082:"The sub-picture must not contain more than one instance of the 'percent' character",D3083:"The sub-picture must not contain more than one instance of the 'per-mille' character",D3084:"The sub-picture must not contain both a 'percent' and a 'per-mille' character",D3085:"The mantissa part of a sub-picture must contain at least one character that is either an 'optional digit character' or a member of the 'decimal digit family'",D3086:"The sub-picture must not contain a passive character that is preceded by an active character and that is followed by another active character",D3087:"The sub-picture must not contain a 'grouping-separator' character that appears adjacent to a 'decimal-separator' character",D3088:"The sub-picture must not contain a 'grouping-separator' at the end of the integer part",D3089:"The sub-picture must not contain two adjacent instances of the 'grouping-separator' character",D3090:"The integer part of the sub-picture must not contain a member of the 'decimal digit family' that is followed by an instance of the 'optional digit character'",D3091:"The fractional part of the sub-picture must not contain an instance of the 'optional digit character' that is followed by a member of the 'decimal digit family'",D3092:"A sub-picture that contains a 'percent' or 'per-mille' character must not contain a character treated as an 'exponent-separator'",D3093:"The exponent part of the sub-picture must comprise only of one or more characters that are members of the 'decimal digit family'",D3100:"The radix of the formatBase function must be between 2 and 36. It was given {{value}}",D3110:"The argument of the toMillis function must be an ISO 8601 formatted timestamp. Given {{value}}"};return ae.parser=ce,ae}();"undefined"!=typeof module&&(module.exports=jsonata);
var jsonata=function(){"use strict";var e={".":75,"[":80,"]":0,"{":70,"}":0,"(":80,")":0,",":0,"@":75,"#":70,";":80,":":80,"?":20,"+":50,"-":50,"*":60,"/":60,"%":60,"|":20,"=":40,"<":40,">":40,"^":40,"**":60,"..":20,":=":10,"!=":40,"<=":40,">=":40,"~>":40,and:30,or:25,in:40,"&":50,"!":0,"~":0},t={'"':'"',"\\":"\\","/":"/",b:"\b",f:"\f",n:"\n",r:"\r",t:"\t"},r=function(r){var n=0,i=r.length,a=function(e,t){return{type:e,value:t,position:n}};return function(o){if(n>=i)return null;for(var s=r.charAt(n);n<i&&" \t\n\r\v".indexOf(s)>-1;)n++,s=r.charAt(n);if(!0!==o&&"/"===s)return n++,a("regex",function(){for(var e,t,a=n,o=0;n<i;){var s=r.charAt(n);if("/"===s&&"\\"!==r.charAt(n-1)&&0===o){if(""===(e=r.substring(a,n)))throw{code:"S0301",stack:(new Error).stack,position:n};for(n++,s=r.charAt(n),a=n;"i"===s||"m"===s;)n++,s=r.charAt(n);return t=r.substring(a,n)+"g",new RegExp(e,t)}"("!==s&&"["!==s&&"{"!==s||"\\"===r.charAt(n-1)||o++,")"!==s&&"]"!==s&&"}"!==s||"\\"===r.charAt(n-1)||o--,n++}throw{code:"S0302",stack:(new Error).stack,position:n}}());if("."===s&&"."===r.charAt(n+1))return n+=2,a("operator","..");if(":"===s&&"="===r.charAt(n+1))return n+=2,a("operator",":=");if("!"===s&&"="===r.charAt(n+1))return n+=2,a("operator","!=");if(">"===s&&"="===r.charAt(n+1))return n+=2,a("operator",">=");if("<"===s&&"="===r.charAt(n+1))return n+=2,a("operator","<=");if("*"===s&&"*"===r.charAt(n+1))return n+=2,a("operator","**");if("~"===s&&">"===r.charAt(n+1))return n+=2,a("operator","~>");if(e.hasOwnProperty(s))return n++,a("operator",s);if('"'===s||"'"===s){var u=s;n++;for(var c="";n<i;){if("\\"===(s=r.charAt(n)))if(n++,s=r.charAt(n),t.hasOwnProperty(s))c+=t[s];else{if("u"!==s)throw{code:"S0103",stack:(new Error).stack,position:n,token:s};var f=r.substr(n+1,4);if(!/^[0-9a-fA-F]+$/.test(f))throw{code:"S0104",stack:(new Error).stack,position:n};var l=parseInt(f,16);c+=String.fromCharCode(l),n+=4}else{if(s===u)return n++,a("string",c);c+=s}n++}throw{code:"S0101",stack:(new Error).stack,position:n}}var p,d=/^-?(0|([1-9][0-9]*))(\.[0-9]+)?([Ee][-+]?[0-9]+)?/.exec(r.substring(n));if(null!==d){var h=parseFloat(d[0]);if(!isNaN(h)&&isFinite(h))return n+=d[0].length,a("number",h);throw{code:"S0102",stack:(new Error).stack,position:n,token:d[0]}}if("`"===s){n++;var v=r.indexOf("`",n);if(-1!==v)return p=r.substring(n,v),n=v+1,a("name",p);throw n=i,{code:"S0105",stack:(new Error).stack,position:n}}for(var g,y=n;;)if(g=r.charAt(y),y===i||" \t\n\r\v".indexOf(g)>-1||e.hasOwnProperty(g)){if("$"===r.charAt(n))return p=r.substring(n+1,y),n=y,a("variable",p);switch(p=r.substring(n,y),n=y,p){case"or":case"in":case"and":return a("operator",p);case"true":return a("value",!0);case"false":return a("value",!1);case"null":return a("value",null);default:return n===i&&""===p?null:a("name",p)}}else y++}};function n(e){for(var t=1,r=[],n={},i=n;t<e.length;){var a=e.charAt(t);if(":"===a)break;var o=function(){r.push(n),i=n,n={}},s=function(e,t,r,n){for(var i=1,o=t;o<e.length;)if(o++,(a=e.charAt(o))===n){if(0===--i)break}else a===r&&i++;return o};switch(a){case"s":case"n":case"b":case"l":case"o":n.regex="["+a+"m]",n.type=a,o();break;case"a":n.regex="[asnblfom]",n.type=a,n.array=!0,o();break;case"f":n.regex="f",n.type=a,o();break;case"j":n.regex="[asnblom]",n.type=a,o();break;case"x":n.regex="[asnblfom]",n.type=a,o();break;case"-":i.context=!0,i.contextRegex=new RegExp(i.regex),i.regex+="?";break;case"?":case"+":i.regex+=a;break;case"(":var u=s(e,t,"(",")"),c=e.substring(t+1,u);if(-1!==c.indexOf("<"))throw{code:"S0402",stack:(new Error).stack,value:c,offset:t};n.regex="["+c+"m]",n.type="("+c+")",t=u,o();break;case"<":if("a"!==i.type&&"f"!==i.type)throw{code:"S0401",stack:(new Error).stack,value:i.type,offset:t};var f=s(e,t,"<",">");i.subtype=e.substring(t+1,f),t=f}t++}var l="^"+r.map(function(e){return"("+e.regex+")"}).join("")+"$",p=new RegExp(l),d=function(e){var t;if(b(e))t="f";else switch(typeof e){case"string":t="s";break;case"number":t="n";break;case"boolean":t="b";break;case"object":t=null===e?"l":Array.isArray(e)?"a":"o";break;case"undefined":default:t="m"}return t};return{definition:e,validate:function(e,t){var n="";e.forEach(function(e){n+=d(e)});var i=p.exec(n);if(i){var a=[],o=0;return r.forEach(function(r,n){var s=e[o],u=i[n+1];if(""===u)if(r.context&&r.contextRegex){var c=d(t);if(!r.contextRegex.test(c))throw{code:"T0411",stack:(new Error).stack,value:t,index:o+1};a.push(t)}else a.push(s),o++;else u.split("").forEach(function(t){if("a"===r.type){if("m"===t)s=void 0;else{s=e[o];var n=!0;if(void 0!==r.subtype)if("a"!==t&&u!==r.subtype)n=!1;else if("a"===t&&s.length>0){var i=d(s[0]);if(i!==r.subtype.charAt(0))n=!1;else n=0===s.filter(function(e){return d(e)!==i}).length}if(!n)throw{code:"T0412",stack:(new Error).stack,value:s,index:o+1,type:r.subtype};"a"!==t&&(s=[s])}a.push(s),o++}else a.push(s),o++})}),a}!function(e,t){for(var n="^",i=0,a=0;a<r.length;a++){n+=r[a].regex;var o=t.match(n);if(null===o)throw{code:"T0410",stack:(new Error).stack,value:e[i],index:i+1};i=o[0].length}throw{code:"T0410",stack:(new Error).stack,value:e[i],index:i+1}}(e,n)}}}var i=function(t,i){var a,o,s={},u=[],c=function(){var e=[];"(end)"!==a.id&&e.push({type:a.type,value:a.value,position:a.position});for(var t=o();null!==t;)e.push(t),t=o();return e},f={nud:function(){var e={code:"S0211",token:this.value,position:this.position};if(i)return e.remaining=c(),e.type="error",u.push(e),e;throw e.stack=(new Error).stack,e}},l=function(e,t){var r=s[e];return t=t||0,r?t>=r.lbp&&(r.lbp=t):((r=Object.create(f)).id=r.value=e,r.lbp=t,s[e]=r),r},p=function(e){if(i){e.remaining=c(),u.push(e);var t=s["(error)"];return(a=Object.create(t)).error=e,a.type="(error)",a}throw e.stack=(new Error).stack,e},d=function(e,r){if(e&&a.id!==e){var n={code:"(end)"===a.id?"S0203":"S0202",position:a.position,token:a.value,value:e};return p(n)}var i=o(r);if(null===i)return(a=s["(end)"]).position=t.length,a;var u,c=i.value,f=i.type;switch(f){case"name":case"variable":u=s["(name)"];break;case"operator":if(!(u=s[c]))return p({code:"S0204",stack:(new Error).stack,position:i.position,token:c});break;case"string":case"number":case"value":u=s["(literal)"];break;case"regex":f="regex",u=s["(regex)"];break;default:return p({code:"S0205",stack:(new Error).stack,position:i.position,token:c})}return(a=Object.create(u)).value=c,a.type=f,a.position=i.position,a},h=function(e){var t,r=a;for(d(null,!0),t=r.nud();e<a.lbp;)r=a,d(),t=r.led(t);return t},v=function(e){l(e,0).nud=function(){return this}},g=function(t,r,n){var i=r||e[t],a=l(t,i);return a.led=n||function(e){return this.lhs=e,this.rhs=h(i),this.type="binary",this},a},y=function(e,t,r){var n=l(e,t);return n.led=r,n},b=function(e,t){var r=l(e);return r.nud=t||function(){return this.expression=h(70),this.type="unary",this},r};v("(end)"),v("(name)"),v("(literal)"),v("(regex)"),l(":"),l(";"),l(","),l(")"),l("]"),l("}"),l(".."),g("."),g("+"),g("-"),g("*"),g("/"),g("%"),g("="),g("<"),g(">"),g("!="),g("<="),g(">="),g("&"),g("and"),g("or"),g("in"),v("and"),v("or"),v("in"),b("-"),g("~>"),y("(error)",10,function(e){return this.lhs=e,this.error=a.error,this.remaining=c(),this.type="error",this}),b("*",function(){return this.type="wildcard",this}),b("**",function(){return this.type="descendant",this}),g("(",e["("],function(e){if(this.procedure=e,this.type="function",this.arguments=[],")"!==a.id)for(;"operator"===a.type&&"?"===a.id?(this.type="partial",this.arguments.push(a),d("?")):this.arguments.push(h(0)),","===a.id;)d(",");if(d(")",!0),"name"===e.type&&("function"===e.value||"λ"===e.value)){if(this.arguments.forEach(function(e,t){if("variable"!==e.type)return p({code:"S0208",stack:(new Error).stack,position:e.position,token:e.value,value:t+1})}),this.type="lambda","<"===a.id){for(var t=a.position,r=1,i="<";r>0&&"{"!==a.id&&"(end)"!==a.id;){var o=d();">"===o.id?r--:"<"===o.id&&r++,i+=o.value}d(">");try{this.signature=n(i)}catch(e){return e.position=t+e.offset,p(e)}}d("{"),this.body=h(0),d("}")}return this}),b("(",function(){for(var e=[];")"!==a.id&&(e.push(h(0)),";"===a.id);)d(";");return d(")",!0),this.type="block",this.expressions=e,this}),b("[",function(){var e=[];if("]"!==a.id)for(;;){var t=h(0);if(".."===a.id){var r={type:"binary",value:"..",position:a.position,lhs:t};d(".."),r.rhs=h(0),t=r}if(e.push(t),","!==a.id)break;d(",")}return d("]",!0),this.expressions=e,this.type="unary",this}),g("[",e["["],function(t){if("]"===a.id){for(var r=t;r&&"binary"===r.type&&"["===r.value;)r=r.lhs;return r.keepArray=!0,d("]"),t}return this.lhs=t,this.rhs=h(e["]"]),this.type="binary",d("]",!0),this}),g("^",e["^"],function(e){d("(");for(var t=[];;){var r={descending:!1};if("<"===a.id?d("<"):">"===a.id&&(r.descending=!0,d(">")),r.expression=h(0),t.push(r),","!==a.id)break;d(",")}return d(")"),this.lhs=e,this.rhs=t,this.type="binary",this});var m=function(e){var t=[];if("}"!==a.id)for(;;){var r=h(0);d(":");var n=h(0);if(t.push([r,n]),","!==a.id)break;d(",")}return d("}",!0),void 0===e?(this.lhs=t,this.type="unary"):(this.lhs=e,this.rhs=t,this.type="binary"),this};b("{",m),g("{",e["{"],m),y(":=",e[":="],function(t){return"variable"!==t.type?p({code:"S0212",stack:(new Error).stack,position:t.position,token:t.value}):(this.lhs=t,this.rhs=h(e[":="]-1),this.type="binary",this)}),g("?",e["?"],function(e){return this.type="condition",this.condition=e,this.then=h(0),":"===a.id&&(d(":"),this.else=h(0)),this}),b("|",function(){return this.type="transform",this.pattern=h(0),d("|"),this.update=h(0),","===a.id&&(d(","),this.delete=h(0)),d("|"),this});var k=function(e){var t;if("function"!==e.type||e.predicate)if("condition"===e.type)e.then=k(e.then),void 0!==e.else&&(e.else=k(e.else)),t=e;else if("block"===e.type){var r=e.expressions.length;r>0&&(e.expressions[r-1]=k(e.expressions[r-1])),t=e}else t=e;else{var n={type:"lambda",thunk:!0,arguments:[],position:e.position};n.body=e,t=n}return t},x=function(e){var t;switch(e.type){case"binary":switch(e.value){case".":var r=x(e.lhs);t={type:"path",steps:[]},"path"===r.type?Array.prototype.push.apply(t.steps,r.steps):t.steps=[r];var n=x(e.rhs);"function"===n.type&&"path"===n.procedure.type&&1===n.procedure.steps.length&&"name"===n.procedure.steps[0].type&&"function"===t.steps[t.steps.length-1].type&&(t.steps[t.steps.length-1].nextFunction=n.procedure.steps[0].value),"path"!==n.type&&(n={type:"path",steps:[n]}),Array.prototype.push.apply(t.steps,n.steps),t.steps.filter(function(e){if("number"===e.type||"value"===e.type)throw{code:"S0213",stack:(new Error).stack,position:e.position,value:e.value};return"string"===e.type}).forEach(function(e){e.type="name"}),t.steps.filter(function(e){return!0===e.keepArray}).length>0&&(t.keepSingletonArray=!0);var a=t.steps[0];"unary"===a.type&&"["===a.value&&(a.consarray=!0);var o=t.steps[t.steps.length-1];"unary"===o.type&&"["===o.value&&(o.consarray=!0);break;case"[":var s=t=x(e.lhs);if("path"===t.type&&(s=t.steps[t.steps.length-1]),void 0!==s.group)throw{code:"S0209",stack:(new Error).stack,position:e.position};void 0===s.predicate&&(s.predicate=[]),s.predicate.push(x(e.rhs));break;case"{":if(void 0!==(t=x(e.lhs)).group)throw{code:"S0210",stack:(new Error).stack,position:e.position};t.group={lhs:e.rhs.map(function(e){return[x(e[0]),x(e[1])]}),position:e.position};break;case"^":(t={type:"sort",value:e.value,position:e.position}).lhs=x(e.lhs),t.rhs=e.rhs.map(function(e){return{descending:e.descending,expression:x(e.expression)}});break;case":=":(t={type:"bind",value:e.value,position:e.position}).lhs=x(e.lhs),t.rhs=x(e.rhs);break;case"~>":(t={type:"apply",value:e.value,position:e.position}).lhs=x(e.lhs),t.rhs=x(e.rhs);break;default:(t={type:e.type,value:e.value,position:e.position}).lhs=x(e.lhs),t.rhs=x(e.rhs)}break;case"unary":t={type:e.type,value:e.value,position:e.position},"["===e.value?t.expressions=e.expressions.map(function(e){return x(e)}):"{"===e.value?t.lhs=e.lhs.map(function(e){return[x(e[0]),x(e[1])]}):(t.expression=x(e.expression),"-"===e.value&&"number"===t.expression.type&&((t=t.expression).value=-t.value));break;case"function":case"partial":(t={type:e.type,name:e.name,value:e.value,position:e.position}).arguments=e.arguments.map(function(e){return x(e)}),t.procedure=x(e.procedure);break;case"lambda":t={type:e.type,arguments:e.arguments,signature:e.signature,position:e.position};var c=x(e.body);t.body=k(c);break;case"condition":(t={type:e.type,position:e.position}).condition=x(e.condition),t.then=x(e.then),void 0!==e.else&&(t.else=x(e.else));break;case"transform":(t={type:e.type,position:e.position}).pattern=x(e.pattern),t.update=x(e.update),void 0!==e.delete&&(t.delete=x(e.delete));break;case"block":(t={type:e.type,position:e.position}).expressions=e.expressions.map(function(e){return x(e)});break;case"name":t={type:"path",steps:[e]},e.keepArray&&(t.keepSingletonArray=!0);break;case"string":case"number":case"value":case"wildcard":case"descendant":case"variable":case"regex":t=e;break;case"operator":if("and"===e.value||"or"===e.value||"in"===e.value)e.type="name",t=x(e);else{if("?"!==e.value)throw{code:"S0201",stack:(new Error).stack,position:e.position,token:e.value};t=e}break;case"error":t=e,e.lhs&&(t=x(e.lhs));break;default:var f="S0206";"(end)"===e.id&&(f="S0207");var l={code:f,position:e.position,token:e.value};if(i)return u.push(l),{type:"error",error:l};throw l.stack=(new Error).stack,l}return t};o=r(t),d();var w=h(0);if("(end)"!==a.id){var A={code:"S0201",position:a.position,token:a.value};p(A)}return w=x(w),u.length>0&&(w.errors=u),w},a=F(null);function o(e){var t=!1;if("number"==typeof e&&(t=!isNaN(e))&&!isFinite(e))throw{code:"D1001",value:e,stack:(new Error).stack};return t}function s(e){var t=!1;return Array.isArray(e)&&(t=0===e.filter(function(e){return"string"!=typeof e}).length),t}function u(e){var t=!1;return Array.isArray(e)&&(t=0===e.filter(function(e){return!o(e)}).length),t}function*c(e,t,r){var n,i=r.lookup("__evaluate_entry");switch(i&&i(e,t,r),e.type){case"path":n=yield*function*(e,t,r){var n,i;n="variable"===e.steps[0].type?f(t):Array.isArray(t)?t:f(t);for(var a=0;a<e.steps.length;a++){var o=e.steps[a];if(void 0===(i=0===a&&o.consarray?yield*c(o,n,r):yield*p(o,n,r,a===e.steps.length-1))||0===i.length)break;n=i}e.keepSingletonArray&&(i.keepSingleton=!0);return i}(e,t,r);break;case"binary":n=yield*function*(e,t,r){var n,i=yield*c(e.lhs,t,r),a=yield*c(e.rhs,t,r),s=e.value;try{switch(s){case"+":case"-":case"*":case"/":case"%":n=function(e,t,r){var n;if(void 0===e||void 0===t)return n;if(!o(e))throw{code:"T2001",stack:(new Error).stack,value:e};if(!o(t))throw{code:"T2002",stack:(new Error).stack,value:t};switch(r){case"+":n=e+t;break;case"-":n=e-t;break;case"*":n=e*t;break;case"/":n=e/t;break;case"%":n=e%t}return n}(i,a,s);break;case"=":case"!=":case"<":case"<=":case">":case">=":n=function(e,t,r){var n,i=typeof e,a=typeof t;if("undefined"===i||"undefined"===a)return!1;var o=function(){if("string"!==i&&"number"!==i||"string"!==a&&"number"!==a)throw{code:"T2010",stack:(new Error).stack,value:"string"!==i&&"number"!==i?e:t};if(i!==a)throw{code:"T2009",stack:(new Error).stack,value:e,value2:t}};switch(r){case"=":n=e===t;break;case"!=":n=e!==t;break;case"<":o(),n=e<t;break;case"<=":o(),n=e<=t;break;case">":o(),n=e>t;break;case">=":o(),n=e>=t}return n}(i,a,s);break;case"&":n=function(e,t){var r="",n="";void 0!==e&&(r=D(e));void 0!==t&&(n=D(t));return r.concat(n)}(i,a);break;case"and":case"or":n=function(e,t,r){var n;switch(r){case"and":n=P(e)&&P(t);break;case"or":n=P(e)||P(t)}return n}(i,a,s);break;case"..":n=function(e,t){var r;if(void 0===e||void 0===t)return r;if(e>t)return r;if(!Number.isInteger(e))throw{code:"T2003",stack:(new Error).stack,value:e};if(!Number.isInteger(t))throw{code:"T2004",stack:(new Error).stack,value:t};r=new Array(t-e+1);for(var n=e,i=0;n<=t;n++,i++)r[i]=n;return l(r)}(i,a);break;case"in":n=function(e,t){var r=!1;if(void 0===e||void 0===t)return!1;Array.isArray(t)||(t=[t]);for(var n=0;n<t.length;n++)if(t[n]===e){r=!0;break}return r}(i,a)}}catch(t){throw t.position=e.position,t.token=s,t}return n}(e,t,r);break;case"unary":n=yield*function*(e,t,r){var n;switch(e.value){case"-":if(void 0===(n=yield*c(e.expression,t,r)))n=void 0;else{if(!o(n))throw{code:"D1002",stack:(new Error).stack,position:e.position,token:e.value,value:n};n=-n}break;case"[":n=[];for(var i=0;i<e.expressions.length;i++){var a=e.expressions[i],s=yield*c(a,t,r);void 0!==s&&("["===a.value?n.push(s):n=_(n,s))}e.consarray&&Object.defineProperty(n,"cons",{enumerable:!1,configurable:!1,value:!0});break;case"{":n=yield*v(e,t,r)}return n}(e,t,r);break;case"name":n=h(e,t,r);break;case"string":case"number":case"value":n=function(e){return e.value}(e);break;case"wildcard":n=function(e,t){var r=f();null!==t&&"object"==typeof t&&Object.keys(t).forEach(function(e){var n=t[e];Array.isArray(n)?(n=function e(t,r){void 0===r&&(r=[]);Array.isArray(t)?t.forEach(function(t){e(t,r)}):r.push(t);return r}(n),r=_(r,n)):r.push(n)});return r}(0,t);break;case"descendant":n=function(e,t){var r,n=f();void 0!==t&&(!function e(t,r){Array.isArray(t)||r.push(t);Array.isArray(t)?t.forEach(function(t){e(t,r)}):null!==t&&"object"==typeof t&&Object.keys(t).forEach(function(n){e(t[n],r)})}(t,n),r=1===n.length?n[0]:n);return r}(0,t);break;case"condition":n=yield*function*(e,t,r){var n;P(yield*c(e.condition,t,r))?n=yield*c(e.then,t,r):void 0!==e.else&&(n=yield*c(e.else,t,r));return n}(e,t,r);break;case"block":n=yield*function*(e,t,r){for(var n,i=F(r),a=0;a<e.expressions.length;a++)n=yield*c(e.expressions[a],t,i);return n}(e,t,r);break;case"bind":n=yield*function*(e,t,r){var n=yield*c(e.rhs,t,r);return r.bind(e.lhs.value,n),n}(e,t,r);break;case"regex":n=function(e){e.value.lastIndex=0;var t=function(r){var n,i=e.value,a=i.exec(r);if(null!==a){if(n={match:a[0],start:a.index,end:a.index+a[0].length,groups:[]},a.length>1)for(var o=1;o<a.length;o++)n.groups.push(a[o]);n.next=function(){if(!(i.lastIndex>=r.length)){var n=t(r);if(n&&""===n.match&&i.lastIndex===e.value.lastIndex)throw{code:"D1004",stack:(new Error).stack,position:e.position,value:e.value.source};return n}}}return n};return t}(e);break;case"function":n=yield*x(e,t,r);break;case"variable":n=function(e,t,r){var n;n=""===e.value?t:r.lookup(e.value);return n}(e,t,r);break;case"lambda":n=function(e,t,r){var n={_jsonata_lambda:!0,input:t,environment:r,arguments:e.arguments,signature:e.signature,body:e.body};!0===e.thunk&&(n.thunk=!0);return n}(e,t,r);break;case"partial":n=yield*function*(e,t,r){for(var n,i=[],a=0;a<e.arguments.length;a++){var o=e.arguments[a];"operator"===o.type&&"?"===o.value?i.push(o):i.push(yield*c(o,t,r))}var s=yield*c(e.procedure,t,r);if(void 0===s&&"path"===e.procedure.type&&r.lookup(e.procedure.steps[0].value))throw{code:"T1007",stack:(new Error).stack,position:e.position,token:e.procedure.steps[0].value};if(m(s))n=E(s,i);else if(s&&!0===s._jsonata_function)n=S(s.implementation,i);else{if("function"!=typeof s)throw{code:"T1008",stack:(new Error).stack,position:e.position,token:"path"===e.procedure.type?e.procedure.steps[0].value:e.procedure.value};n=S(s,i)}return n}(e,t,r);break;case"apply":n=yield*function*(e,t,r){var n;if("function"===e.rhs.type)e.rhs.arguments.unshift(e.lhs),n=yield*x(e.rhs,t,r),e.rhs.arguments.shift();else{var i=yield*c(e.lhs,t,r),a=yield*c(e.rhs,t,r);if(!b(a))throw{code:"T2006",stack:(new Error).stack,position:e.position,value:a};n=b(i)?yield*w(y,[i,a],r):yield*w(a,[i],r)}return n}(e,t,r);break;case"sort":n=yield*function*(e,t,r){var n=yield*c(e.lhs,t,r);return M(n,function(t,n){for(var i=0,a=0;0===i&&a<e.rhs.length;a++){var o=e.rhs[a],s=g(o.expression,t,r),u=g(o.expression,n,r),c=typeof s,f=typeof u;if("undefined"!==c)if("undefined"!==f){if("string"!==c&&"number"!==c||"string"!==f&&"number"!==f)throw{code:"T2008",stack:(new Error).stack,position:e.position,value:"string"!==c&&"number"!==c?s:u};if(c!==f)throw{code:"T2007",stack:(new Error).stack,position:e.position,value:s,value2:u};s!==u&&(i=s<u?-1:1,!0===o.descending&&(i=-i))}else i=-1;else i="undefined"===f?0:1}return 1===i})}(e,t,r);break;case"transform":n=function(e,t,r){return T(function*(t){if(void 0!==t){var n=r.lookup("clone");if(!b(n))throw{code:"T2013",stack:(new Error).stack,position:e.position};var i=yield*w(n,[t],r),a=yield*c(e.pattern,i,r);if(void 0!==a){Array.isArray(a)||(a=[a]);for(var o=0;o<a.length;o++){var u=a[o],f=yield*c(e.update,u,r),l=typeof f;if("undefined"!==l){if("object"!==l||null===f)throw{code:"T2011",stack:(new Error).stack,position:e.update.position,value:f};for(var p in f)u[p]=f[p]}if(void 0!==e.delete){var d=yield*c(e.delete,u,r);if(void 0!==d){var h=d;if(Array.isArray(d)||(d=[d]),!s(d))throw{code:"T2012",stack:(new Error).stack,position:e.delete.position,value:h};for(var v=0;v<d.length;v++)delete u[d[v]]}}}}return i}},"<(oa):o>")}(e,0,r)}!r.lookup("__jsonata_async")||void 0!==n&&null!==n&&"function"==typeof n.then||(n=Promise.resolve(n)),r.lookup("__jsonata_async")&&"function"==typeof n.then&&e.nextFunction&&"function"==typeof n[e.nextFunction]||(n=yield n),e.hasOwnProperty("predicate")&&(n=yield*function*(e,t,r){for(var n=t,i=f(),a=0;a<e.length;a++){var o=e[a];if(Array.isArray(n)||(n=f(n)),i=f(),"number"===o.type){var s=o.value;Number.isInteger(s)||(s=Math.floor(s)),s<0&&(s=n.length+s),i=n[s]}else i=yield*d(o,n,r);n=i}return i}(e.predicate,n,r)),e.hasOwnProperty("group")&&(n=yield*v(e.group,n,r));var a=r.lookup("__evaluate_exit");return a&&a(e,t,r,n),n&&n.sequence&&(n=n.value()),n}function f(){var e=l([]);return 1===arguments.length&&e.push(arguments[0]),e}function l(e){return Object.defineProperty(e,"sequence",{enumerable:!1,configurable:!1,get:function(){return!0}}),Object.defineProperty(e,"keepSingleton",{enumerable:!1,configurable:!1,writable:!0,value:!1}),Object.defineProperty(e,"value",{enumerable:!1,configurable:!1,get:function(){return function(){switch(this.length){case 0:return;case 1:return this.keepSingleton?this:this[0];default:return this}}}}),e}function*p(e,t,r,n){for(var i=f(),a=0;a<t.length;a++){var o=yield*c(e,t[a],r);void 0!==o&&i.push(o)}var s=f();return n&&1===i.length&&Array.isArray(i[0])&&!i[0].sequence?s=i[0]:i.forEach(function(e){!Array.isArray(e)||e.cons||e.keepSingleton?s.push(e):Array.prototype.push.apply(s,e)}),s}function*d(e,t,r){for(var n=f(),i=0;i<t.length;i++){var a=t[i],s=yield*c(e,a,r);o(s)&&(s=[s]),u(s)?s.forEach(function(e){Number.isInteger(e)||(e=Math.floor(e)),e<0&&(e=t.length+e),e===i&&n.push(a)}):P(s)&&n.push(a)}return n}function h(e,t,r){var n;if(Array.isArray(t)){n=f();for(var i=0;i<t.length;i++){var a=h(e,t[i],r);void 0!==a&&n.push(a)}}else null!==t&&"object"==typeof t&&(n=t[e.value]);return n}function*v(e,t,r){var n={},i={};Array.isArray(t)||(t=f(t));for(var a=0;a<t.length;a++)for(var o=t[a],s=0;s<e.lhs.length;s++){var u=e.lhs[s],l=yield*c(u[0],o,r);if("string"!=typeof l)throw{code:"T1003",stack:(new Error).stack,position:e.position,value:l};var p={data:o,expr:u[1]};i.hasOwnProperty(l)?i[l].data=_(i[l].data,o):i[l]=p}for(l in i){var d=yield*c((p=i[l]).expr,p.data,r);void 0!==d&&(n[l]=d)}return n}function g(e,t,r){for(var n=c(e,t,r),i=n.next();!i.done;)i=n.next(i.value);return i.value}Number.isInteger=Number.isInteger||function(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e};var y=g(i("function($f, $g) { function($x){ $g($f($x)) } }"),null,a);function b(e){return e&&(!0===e._jsonata_function||!0===e._jsonata_lambda)||"function"==typeof e}function m(e){return e&&!0===e._jsonata_lambda}function k(e){return"object"==typeof e&&null!==e&&Symbol.iterator in e&&"function"==typeof e[Symbol.iterator]&&"next"in e&&"function"==typeof e.next}function*x(e,t,r){var n,i=yield*c(e.procedure,t,r);if(void 0===i&&"path"===e.procedure.type&&r.lookup(e.procedure.steps[0].value))throw{code:"T1005",stack:(new Error).stack,position:e.position,token:e.procedure.steps[0].value};for(var a=[],o=0;o<e.arguments.length;o++)a.push(yield*c(e.arguments[o],t,r));try{n=yield*w(i,a,t)}catch(t){throw t.position=e.position,t.token="path"===e.procedure.type?e.procedure.steps[0].value:e.procedure.value,t}return n}function*w(e,t,r){var n;for(n=yield*A(e,t,r);m(n)&&!0===n.thunk;){for(var i=yield*c(n.body.procedure,n.input,n.environment),a=[],o=0;o<n.body.arguments.length;o++)a.push(yield*c(n.body.arguments[o],n.input,n.environment));n=yield*A(i,a,r)}return n}function*A(e,t,r){var n,i=t;if(e&&(i=function(e,t,r){if(void 0===e)return t;return e.validate(t,r)}(e.signature,t,r)),m(e))n=yield*function*(e,t){var r,n=F(e.environment);e.arguments.forEach(function(e,r){n.bind(e.value,t[r])}),r="function"==typeof e.body?yield*function*(e,t){var r=O(e).map(function(e){return t.lookup(e.trim())}),n=e.apply(null,r);k(n)&&(n=yield*n);return n}(e.body,n):yield*c(e.body,e.input,n);return r}(e,i);else if(e&&!0===e._jsonata_function)k(n=e.implementation.apply(r,i))&&(n=yield*n);else{if("function"!=typeof e)throw{code:"T1006",stack:(new Error).stack};k(n=e.apply(r,i))&&(n=yield*n)}return n}function E(e,t){var r=F(e.environment),n=[];return e.arguments.forEach(function(e,i){var a=t[i];a&&"operator"===a.type&&"?"===a.value?n.push(e):r.bind(e.value,a)}),{_jsonata_lambda:!0,input:e.input,environment:r,arguments:n,body:e.body}}function S(e,t){var r=O(e),n="function("+(r=r.map(function(e){return"$"+e.trim()})).join(", ")+"){ _ }",a=i(n);return a.body=e,E(a,t)}function O(e){var t=e.toString();return/\(([^)]*)\)/.exec(t)[1].split(",")}function T(e,t){var r={_jsonata_function:!0,implementation:e};return void 0!==t&&(r.signature=n(t)),r}function D(e){if(void 0!==e){var t;if("string"==typeof e)t=e;else if(b(e))t="";else{if("number"==typeof e&&!isFinite(e))throw{code:"D3001",value:e,stack:(new Error).stack};t=JSON.stringify(e,function(e,t){return void 0!==t&&null!==t&&t.toPrecision&&o(t)?Number(t.toPrecision(13)):t&&b(t)?"":t})}return t}}function j(e,t){var r;if(void 0!==e){if(t){var n=e.toString().split("e");e=+(n[0]+"e"+(n[1]?+n[1]+t:t))}var i=(r=Math.round(e))-e;return.5===Math.abs(i)&&1===Math.abs(r%2)&&(r-=1),t&&(r=+((n=r.toString().split("e"))[0]+"e"+(n[1]?+n[1]-t:-t))),Object.is(r,-0)&&(r=0),r}}function P(e){if(void 0!==e){var t=!1;if(Array.isArray(e)){if(1===e.length)t=P(e[0]);else if(e.length>1){t=e.filter(function(e){return P(e)}).length>0}}else"string"==typeof e?e.length>0&&(t=!0):o(e)?0!==e&&(t=!0):null!==e&&"object"==typeof e?Object.keys(e).length>0&&(m(e)||e._jsonata_function||(t=!0)):"boolean"==typeof e&&!0===e&&(t=!0);return t}}function _(e,t){return void 0===e?t:void 0===t?e:(Array.isArray(e)||(e=f(e)),Array.isArray(t)||(t=[t]),e.concat(t))}function M(e,t){if(void 0!==e){if(e.length<=1)return e;var r;if(void 0===t){if(!u(e)&&!s(e))throw{stack:(new Error).stack,code:"D3070",index:1};r=function(e,t){return e>t}}else r="function"==typeof t?t:function(e,r){for(var n=w(t,[e,r],null),i=n.next();!i.done;)i=n.next(i.value);return i.value};var n=function(e){if(e.length<=1)return e;var t,i,a=Math.floor(e.length/2),o=e.slice(0,a),s=e.slice(a);return o=n(o),s=n(s),(t=function(e,n,i){0===n.length?Array.prototype.push.apply(e,i):0===i.length?Array.prototype.push.apply(e,n):r(n[0],i[0])?(e.push(i[0]),t(e,n,i.slice(1))):(e.push(n[0]),t(e,n.slice(1),i))})(i=[],o,s),i};return n(e)}}var N=new RegExp("^\\d{4}(-[01]\\d)*(-[0-3]\\d)*(T[0-2]\\d:[0-5]\\d:[0-5]\\d)*(\\.\\d+)?([+-][0-2]\\d:?[0-5]\\d|Z)?$");function F(e){var t={};return{bind:function(e,r){t[e]=r},lookup:function(r){var n;return t.hasOwnProperty(r)?n=t[r]:e&&(n=e.lookup(r)),n}}}a.bind("sum",T(function(e){if(void 0!==e){var t=0;return e.forEach(function(e){t+=e}),t}},"<a<n>:n>")),a.bind("count",T(function(e){return void 0===e?0:e.length},"<a:n>")),a.bind("max",T(function(e){if(void 0!==e&&0!==e.length)return Math.max.apply(Math,e)},"<a<n>:n>")),a.bind("min",T(function(e){if(void 0!==e&&0!==e.length)return Math.min.apply(Math,e)},"<a<n>:n>")),a.bind("average",T(function(e){if(void 0!==e&&0!==e.length){var t=0;return e.forEach(function(e){t+=e}),t/e.length}},"<a<n>:n>")),a.bind("string",T(D,"<x-:s>")),a.bind("substring",T(function(e,t,r){if(void 0!==e)return e.substr(t,r)},"<s-nn?:s>")),a.bind("substringBefore",T(function(e,t){if(void 0!==e){var r=e.indexOf(t);return r>-1?e.substr(0,r):e}},"<s-s:s>")),a.bind("substringAfter",T(function(e,t){if(void 0!==e){var r=e.indexOf(t);return r>-1?e.substr(r+t.length):e}},"<s-s:s>")),a.bind("lowercase",T(function(e){if(void 0!==e)return e.toLowerCase()},"<s-:s>")),a.bind("uppercase",T(function(e){if(void 0!==e)return e.toUpperCase()},"<s-:s>")),a.bind("length",T(function(e){if(void 0!==e)return e.length},"<s-:n>")),a.bind("trim",T(function(e){if(void 0!==e){var t=e.replace(/[ \t\n\r]+/gm," ");return" "===t.charAt(0)&&(t=t.substring(1))," "===t.charAt(t.length-1)&&(t=t.substring(0,t.length-1)),t}},"<s-:s>")),a.bind("pad",T(function(e,t,r){if(void 0!==e){var n;void 0!==r&&0!==r.length||(r=" ");var i=Math.abs(t)-e.length;if(i>0){var a=new Array(i+1).join(r);r.length>1&&(a=a.substring(0,i)),n=t>0?e+a:a+e}else n=e;return n}},"<s-ns?:s>")),a.bind("match",T(function(e,t,r){if(void 0!==e){if(r<0)throw{stack:(new Error).stack,value:r,code:"D3040",index:3};var n=f();if(void 0===r||r>0){var i=0,a=t(e);if(void 0!==a)for(;void 0!==a&&(void 0===r||i<r);)n.push({match:a.match,index:a.start,groups:a.groups}),a=a.next(),i++}return n}},"<s-f<s:o>n?:a<o>>")),a.bind("contains",T(function(e,t){if(void 0!==e){return"string"==typeof t?-1!==e.indexOf(t):void 0!==t(e)}},"<s-(sf):b>")),a.bind("replace",T(function*(e,t,r,n){if(void 0!==e){if(""===t)throw{code:"D3010",stack:(new Error).stack,value:t,index:2};if(n<0)throw{code:"D3011",stack:(new Error).stack,value:n,index:4};var i;i="string"==typeof r?function(e){for(var t="",n=0,i=r.indexOf("$",n);-1!==i&&n<r.length;){t+=r.substring(n,i),n=i+1;var a=r.charAt(n);if("$"===a)t+="$",n++;else if("0"===a)t+=e.match,n++;else{var o;if(o=0===e.groups.length?1:Math.floor(Math.log(e.groups.length)*Math.LOG10E)+1,i=parseInt(r.substring(n,n+o),10),o>1&&i>e.groups.length&&(i=parseInt(r.substring(n,n+o-1),10)),isNaN(i))t+="$";else{if(e.groups.length>0){var s=e.groups[i-1];void 0!==s&&(t+=s)}n+=i.toString().length}}i=r.indexOf("$",n)}return t+=r.substring(n)}:r;var a="",o=0;if(void 0===n||n>0){var s=0;if("string"==typeof t){for(var u=e.indexOf(t,o);-1!==u&&(void 0===n||s<n);)a+=e.substring(o,u),a+=r,o=u+t.length,s++,u=e.indexOf(t,o);a+=e.substring(o)}else{var c=t(e);if(void 0!==c){for(;void 0!==c&&(void 0===n||s<n);){a+=e.substring(o,c.start);var f=yield*w(i,[c],null);if("string"!=typeof f)throw{code:"D3012",stack:(new Error).stack,value:f};a+=f,o=c.start+c.match.length,s++,c=c.next()}a+=e.substring(o)}else a=e}}else a=e;return a}},"<s-(sf)(sf)n?:s>")),a.bind("split",T(function(e,t,r){if(void 0!==e){if(r<0)throw{code:"D3020",stack:(new Error).stack,value:r,index:3};var n=[];if(void 0===r||r>0)if("string"==typeof t)n=e.split(t,r);else{var i=0,a=t(e);if(void 0!==a){for(var o=0;void 0!==a&&(void 0===r||i<r);)n.push(e.substring(o,a.start)),o=a.end,a=a.next(),i++;(void 0===r||i<r)&&n.push(e.substring(o))}else n.push(e)}return n}},"<s-(sf)n?:a<s>>")),a.bind("join",T(function(e,t){if(void 0!==e)return void 0===t&&(t=""),e.join(t)},"<a<s>s?:s>")),a.bind("formatNumber",T(function(e,t,r){var n={"decimal-separator":".","grouping-separator":",","exponent-separator":"e",infinity:"Infinity","minus-sign":"-",NaN:"NaN",percent:"%","per-mille":"‰","zero-digit":"0",digit:"#","pattern-separator":";"};void 0!==r&&Object.keys(r).forEach(function(e){n[e]=r[e]});for(var i=[],a=n["zero-digit"].charCodeAt(0),o=a;o<a+10;o++)i.push(String.fromCharCode(o));var s=i.concat([n["decimal-separator"],n["exponent-separator"],n["grouping-separator"],n.digit,n["pattern-separator"]]),u=t.split(n["pattern-separator"]);if(u.length>2)throw{code:"D3080",stack:(new Error).stack};var c=u.map(function(e){var t,r,i,a,o=function(){for(var t,r=0;r<e.length;r++)if(t=e.charAt(r),-1!==s.indexOf(t)&&t!==n["exponent-separator"])return e.substring(0,r)}(),u=function(){for(var t,r=e.length-1;r>=0;r--)if(t=e.charAt(r),-1!==s.indexOf(t)&&t!==n["exponent-separator"])return e.substring(r+1)}(),c=e.substring(o.length,e.length-u.length),f=e.indexOf(n["exponent-separator"],o.length);-1===f||f>e.length-u.length?(t=c,r=void 0):(t=c.substring(0,f),r=c.substring(f+1));var l=t.indexOf(n["decimal-separator"]);return-1===l?(i=t,a=u):(i=t.substring(0,l),a=t.substring(l+1)),{prefix:o,suffix:u,activePart:c,mantissaPart:t,exponentPart:r,integerPart:i,fractionalPart:a,subpicture:e}});c.forEach(function(e){var t,r,a=e.subpicture,o=a.indexOf(n["decimal-separator"]);o!==a.lastIndexOf(n["decimal-separator"])&&(t="D3081"),a.indexOf(n.percent)!==a.lastIndexOf(n.percent)&&(t="D3082"),a.indexOf(n["per-mille"])!==a.lastIndexOf(n["per-mille"])&&(t="D3083"),-1!==a.indexOf(n.percent)&&-1!==a.indexOf(n["per-mille"])&&(t="D3084");var u=!1;for(r=0;r<e.mantissaPart.length;r++){var c=e.mantissaPart.charAt(r);if(-1!==i.indexOf(c)||c===n.digit){u=!0;break}}u||(t="D3085"),-1!==e.activePart.split("").map(function(e){return-1===s.indexOf(e)?"p":"a"}).join("").indexOf("p")&&(t="D3086"),-1!==o?a.charAt(o-1)!==n["grouping-separator"]&&a.charAt(o+1)!==n["grouping-separator"]||(t="D3087"):e.integerPart.charAt(e.integerPart.length-1)===n["grouping-separator"]&&(t="D3088"),-1!==a.indexOf(n["grouping-separator"]+n["grouping-separator"])&&(t="D3089");var f=e.integerPart.indexOf(n.digit);-1!==f&&e.integerPart.substring(0,f).split("").filter(function(e){return i.indexOf(e)>-1}).length>0&&(t="D3090"),-1!==(f=e.fractionalPart.lastIndexOf(n.digit))&&e.fractionalPart.substring(f).split("").filter(function(e){return i.indexOf(e)>-1}).length>0&&(t="D3091");var l="string"==typeof e.exponentPart;if(l&&e.exponentPart.length>0&&(-1!==a.indexOf(n.percent)||-1!==a.indexOf(n["per-mille"]))&&(t="D3092"),l&&(0===e.exponentPart.length||e.exponentPart.split("").filter(function(e){return-1===i.indexOf(e)}).length>0)&&(t="D3093"),t)throw{code:t,stack:(new Error).stack}});var f,l,p,d,h=c.map(function(e){var t=function(t,r){for(var a=[],o=t.indexOf(n["grouping-separator"]);-1!==o;){var s=(r?t.substring(0,o):t.substring(o)).split("").filter(function(e){return-1!==i.indexOf(e)||e===n.digit}).length;a.push(s),o=e.integerPart.indexOf(n["grouping-separator"],o+1)}return a},r=t(e.integerPart),a=function(e){if(0===e.length)return 0;for(var t=function(e,r){return 0===r?e:t(r,e%r)},r=e.reduce(t),n=1;n<=e.length;n++)if(-1===e.indexOf(n*r))return 0;return r}(r),o=t(e.fractionalPart,!0),s=e.integerPart.split("").filter(function(e){return-1!==i.indexOf(e)}).length,u=s,c=e.fractionalPart.split(""),f=c.filter(function(e){return-1!==i.indexOf(e)}).length,l=c.filter(function(e){return-1!==i.indexOf(e)||e===n.digit}).length,p="string"==typeof e.exponentPart;0===s&&0===l&&(p?(f=1,l=1):s=1),p&&0===s&&-1!==e.integerPart.indexOf(n.digit)&&(s=1),0===s&&0===f&&(f=1);var d=0;return p&&(d=e.exponentPart.split("").filter(function(e){return-1!==i.indexOf(e)}).length),{integerPartGroupingPositions:r,regularGrouping:a,minimumIntegerPartSize:s,scalingFactor:u,prefix:e.prefix,fractionalPartGroupingPositions:o,minimumFactionalPartSize:f,maximumFactionalPartSize:l,minimumExponentSize:d,suffix:e.suffix,picture:e.subpicture}});if(1===h.length&&(h.push(JSON.parse(JSON.stringify(h[0]))),h[1].prefix=n["minus-sign"]+h[1].prefix),l=-1!==(f=e>=0?h[0]:h[1]).picture.indexOf(n.percent)?100*e:-1!==f.picture.indexOf(n["per-mille"])?1e3*e:e,0===f.minimumExponentSize)p=l;else{var v=Math.pow(10,f.scalingFactor),g=Math.pow(10,f.scalingFactor-1);for(p=l,d=0;p<g;)p*=10,d-=1;for(;p>v;)p/=10,d+=1}var y=function(e,t){var r=Math.abs(e).toFixed(t);return"0"!==n["zero-digit"]&&(r=r.split("").map(function(e){return e>="0"&&e<="9"?i[e.charCodeAt(0)-48]:e}).join("")),r},b=y(j(p,f.maximumFactionalPartSize),f.maximumFactionalPartSize),m=b.indexOf(".");for(-1===m?b+=n["decimal-separator"]:b=b.replace(".",n["decimal-separator"]);b.charAt(0)===n["zero-digit"];)b=b.substring(1);for(;b.charAt(b.length-1)===n["zero-digit"];)b=b.substring(0,b.length-1);m=b.indexOf(n["decimal-separator"]);var k=f.minimumIntegerPartSize-m,x=f.minimumFactionalPartSize-(b.length-m-1);if(b=(k>0?new Array(k+1).join("0"):"")+b,b+=x>0?new Array(x+1).join("0"):"",m=b.indexOf(n["decimal-separator"]),f.regularGrouping>0)for(var w=Math.floor((m-1)/f.regularGrouping),A=1;A<=w;A++)b=[b.slice(0,m-A*f.regularGrouping),n["grouping-separator"],b.slice(m-A*f.regularGrouping)].join("");else f.integerPartGroupingPositions.forEach(function(e){b=[b.slice(0,m-e),n["grouping-separator"],b.slice(m-e)].join(""),m++});if(m=b.indexOf(n["decimal-separator"]),f.fractionalPartGroupingPositions.forEach(function(e){b=[b.slice(0,e+m+1),n["grouping-separator"],b.slice(e+m+1)].join("")}),m=b.indexOf(n["decimal-separator"]),-1!==f.picture.indexOf(n["decimal-separator"])&&m!==b.length-1||(b=b.substring(0,b.length-1)),void 0!==d){var E=y(d,0);(k=f.minimumExponentSize-E.length)>0&&(E=new Array(k+1).join("0")+E),b=b+n["exponent-separator"]+(d<0?n["minus-sign"]:"")+E}return b=f.prefix+b+f.suffix},"<n-so?:s>")),a.bind("formatBase",T(function(e,t){if(void 0!==e){if(e=j(e),(t=void 0===t?10:j(t))<2||t>36)throw{code:"D3100",stack:(new Error).stack,value:t};return e.toString(t)}},"<n-n?:s>")),a.bind("number",T(function(e){var t;if(void 0!==e){if("number"==typeof e)t=e;else{if("string"!=typeof e||!/^-?(0|([1-9][0-9]*))(\.[0-9]+)?([Ee][-+]?[0-9]+)?$/.test(e)||isNaN(parseFloat(e))||!isFinite(e))throw{code:"D3030",value:e,stack:(new Error).stack,index:1};t=parseFloat(e)}return t}},"<(ns)-:n>")),a.bind("floor",T(function(e){if(void 0!==e)return Math.floor(e)},"<n-:n>")),a.bind("ceil",T(function(e){if(void 0!==e)return Math.ceil(e)},"<n-:n>")),a.bind("round",T(j,"<n-n?:n>")),a.bind("abs",T(function(e){if(void 0!==e)return Math.abs(e)},"<n-:n>")),a.bind("sqrt",T(function(e){if(void 0!==e){if(e<0)throw{stack:(new Error).stack,code:"D3060",index:1,value:e};return Math.sqrt(e)}},"<n-:n>")),a.bind("power",T(function(e,t){var r;if(void 0!==e){if(r=Math.pow(e,t),!isFinite(r))throw{stack:(new Error).stack,code:"D3061",index:1,value:e,exp:t};return r}},"<n-n:n>")),a.bind("random",T(function(){return Math.random()},"<:n>")),a.bind("boolean",T(P,"<x-:b>")),a.bind("not",T(function(e){return!P(e)},"<x-:b>")),a.bind("map",T(function*(e,t){if(void 0!==e){for(var r=f(),n=0;n<e.length;n++){var i=[e[n]],a="function"==typeof t?t.length:!0===t._jsonata_function?t.implementation.length:t.arguments.length;a>=2&&i.push(n),a>=3&&i.push(e);var o=yield*w(t,i,null);void 0!==o&&r.push(o)}return r}},"<af>")),a.bind("zip",T(function(){for(var e=[],t=Array.prototype.slice.call(arguments),r=Math.min.apply(Math,t.map(function(e){return Array.isArray(e)?e.length:0})),n=0;n<r;n++){var i=t.map(e=>e[n]);e.push(i)}return e},"<a+>")),a.bind("filter",T(function*(e,t){if(void 0!==e){for(var r=f(),n=function(e,r,n){for(var i=w(t,[e,r,n],null),a=i.next();!a.done;)a=i.next(a.value);return a.value},i=0;i<e.length;i++){var a=e[i];P(n(a,i,e))&&r.push(a)}return r}},"<af>")),a.bind("reduce",T(function*(e,t,r){if(void 0!==e){var n,i;if(2!==t.length&&(!0!==t._jsonata_function||2!==t.implementation.length)&&2!==t.arguments.length)throw{stack:(new Error).stack,code:"D3050",index:1};for(void 0===r&&e.length>0?(n=e[0],i=1):(n=r,i=0);i<e.length;)n=yield*w(t,[n,e[i]],null),i++;return n}},"<afj?:j>")),a.bind("sift",T(function(e,t){var r={},n=function(e,r,n){for(var i=w(t,[e,r,n],null),a=i.next();!a.done;)a=i.next(a.value);return a.value};for(var i in e){var a=e[i];P(n(a,i,e))&&(r[i]=a)}return 0===Object.keys(r).length&&(r=void 0),r},"<o-f?:o>")),a.bind("keys",T(function e(t){var r=f();if(Array.isArray(t)){var n={};t.forEach(function(t){var r=e(t);Array.isArray(r)&&r.forEach(function(e){n[e]=!0})}),r=e(n)}else null===t||"object"!=typeof t||m(t)?r=void 0:0===(r=Object.keys(t)).length&&(r=void 0);return r},"<x-:a<s>>")),a.bind("lookup",T(function(e,t){return h({value:t},e)},"<x-s:x>")),a.bind("append",T(_,"<xx:a>")),a.bind("exists",T(function(e){return void 0!==e},"<x:b>")),a.bind("spread",T(function e(t){var r=f();if(Array.isArray(t))t.forEach(function(t){r=_(r,e(t))});else if(null===t||"object"!=typeof t||m(t))r=t;else for(var n in t){var i={};i[n]=t[n],r.push(i)}return r},"<x-:a<o>>")),a.bind("merge",T(function(e){if(void 0!==e){var t={};return e.forEach(function(e){for(var r in e)t[r]=e[r]}),t}},"<a<o>:o>")),a.bind("reverse",T(function(e){if(void 0!==e){if(e.length<=1)return e;for(var t=e.length,r=new Array(t),n=0;n<t;n++)r[t-n-1]=e[n];return r}},"<a:a>")),a.bind("each",T(function*(e,t){var r=f();for(var n in e){var i=[e[n],n];r.push(yield*w(t,i,null))}return r},"<o-f:a>")),a.bind("sort",T(M,"<af?:a>")),a.bind("shuffle",T(function(e){if(void 0!==e){if(e.length<=1)return e;for(var t=new Array(e.length),r=0;r<e.length;r++){var n=Math.floor(Math.random()*(r+1));r!==n&&(t[r]=t[n]),t[n]=e[r]}return t}},"<a:a>")),a.bind("base64encode",T(function(e){if(void 0!==e)return("undefined"!=typeof window?window.btoa:function(e){return new global.Buffer(e,"binary").toString("base64")})(e)},"<s-:s>")),a.bind("base64decode",T(function(e){if(void 0!==e)return("undefined"!=typeof window?window.atob:function(e){return new global.Buffer(e,"base64").toString("binary")})(e)},"<s-:s>")),a.bind("toMillis",T(function(e){if(void 0!==e){if(!N.test(e))throw{stack:(new Error).stack,code:"D3110",value:e};return Date.parse(e)}},"<s-:n>")),a.bind("fromMillis",T(function(e){if(void 0!==e)return new Date(e).toISOString()},"<n-:s>")),a.bind("clone",T(function(e){if(void 0!==e)return JSON.parse(D(e))},"<(oa)-:o>"));var I={S0101:"String literal must be terminated by a matching quote",S0102:"Number out of range: {{token}}",S0103:"Unsupported escape sequence: \\{{token}}",S0104:"The escape sequence \\u must be followed by 4 hex digits",S0105:"Quoted property name must be terminated with a backquote (`)",S0201:"Syntax error: {{token}}",S0202:"Expected {{value}}, got {{token}}",S0203:"Expected {{value}} before end of expression",S0204:"Unknown operator: {{token}}",S0205:"Unexpected token: {{token}}",S0206:"Unknown expression type: {{token}}",S0207:"Unexpected end of expression",S0208:"Parameter {{value}} of function definition must be a variable name (start with $)",S0209:"A predicate cannot follow a grouping expression in a step",S0210:"Each step can only have one grouping expression",S0211:"The symbol {{token}} cannot be used as a unary operator",S0212:"The left side of := must be a variable name (start with $)",S0213:"The literal value {{value}} cannot be used as a step within a path expression",S0301:"Empty regular expressions are not allowed",S0302:"No terminating / in regular expression",S0402:"Choice groups containing parameterized types are not supported",S0401:"Type parameters can only be applied to functions and arrays",S0500:"Attempted to evaluate an expression containing syntax error(s)",T0410:"Argument {{index}} of function {{token}} does not match function signature",T0411:"Context value is not a compatible type with argument {{index}} of function {{token}}",T0412:"Argument {{index}} of function {{token}} must be an array of {{type}}",D1001:"Number out of range: {{value}}",D1002:"Cannot negate a non-numeric value: {{value}}",T1003:"Key in object structure must evaluate to a string; got: {{value}}",D1004:"Regular expression matches zero length string",T1005:"Attempted to invoke a non-function. Did you mean ${{{token}}}?",T1006:"Attempted to invoke a non-function",T1007:"Attempted to partially apply a non-function. Did you mean ${{{token}}}?",T1008:"Attempted to partially apply a non-function",T2001:"The left side of the {{token}} operator must evaluate to a number",T2002:"The right side of the {{token}} operator must evaluate to a number",T2003:"The left side of the range operator (..) must evaluate to an integer",T2004:"The right side of the range operator (..) must evaluate to an integer",D2005:"The left side of := must be a variable name (start with $)",T2006:"The right side of the function application operator ~> must be a function",T2007:"Type mismatch when comparing values {{value}} and {{value2}} in order-by clause",T2008:"The expressions within an order-by clause must evaluate to numeric or string values",T2009:"The values {{value}} and {{value2}} either side of operator {{token}} must be of the same data type",T2010:"The expressions either side of operator {{token}} must evaluate to numeric or string values",T2011:"The insert/update clause of the transform expression must evaluate to an object: {{value}}",T2012:"The delete clause of the transform expression must evaluate to a string or array of strings: {{value}}",T2013:"The transform expression clones the input object using the $clone() function. This has been overridden in the current scope by a non-function.",D3001:"Attempting to invoke string function on Infinity or NaN",D3010:"Second argument of replace function cannot be an empty string",D3011:"Fourth argument of replace function must evaluate to a positive number",D3012:"Attempted to replace a matched string with a non-string value",D3020:"Third argument of split function must evaluate to a positive number",D3030:"Unable to cast value to a number: {{value}}",D3040:"Third argument of match function must evaluate to a positive number",D3050:"First argument of reduce function must be a function with two arguments",D3060:"The sqrt function cannot be applied to a negative number: {{value}}",D3061:"The power function has resulted in a value that cannot be represented as a JSON number: base={{value}}, exponent={{exp}}",D3070:"The single argument form of the sort function can only be applied to an array of strings or an array of numbers. Use the second argument to specify a comparison function",D3080:"The picture string must only contain a maximum of two sub-pictures",D3081:"The sub-picture must not contain more than one instance of the 'decimal-separator' character",D3082:"The sub-picture must not contain more than one instance of the 'percent' character",D3083:"The sub-picture must not contain more than one instance of the 'per-mille' character",D3084:"The sub-picture must not contain both a 'percent' and a 'per-mille' character",D3085:"The mantissa part of a sub-picture must contain at least one character that is either an 'optional digit character' or a member of the 'decimal digit family'",D3086:"The sub-picture must not contain a passive character that is preceded by an active character and that is followed by another active character",D3087:"The sub-picture must not contain a 'grouping-separator' character that appears adjacent to a 'decimal-separator' character",D3088:"The sub-picture must not contain a 'grouping-separator' at the end of the integer part",D3089:"The sub-picture must not contain two adjacent instances of the 'grouping-separator' character",D3090:"The integer part of the sub-picture must not contain a member of the 'decimal digit family' that is followed by an instance of the 'optional digit character'",D3091:"The fractional part of the sub-picture must not contain an instance of the 'optional digit character' that is followed by a member of the 'decimal digit family'",D3092:"A sub-picture that contains a 'percent' or 'per-mille' character must not contain a character treated as an 'exponent-separator'",D3093:"The exponent part of the sub-picture must comprise only of one or more characters that are members of the 'decimal digit family'",D3100:"The radix of the formatBase function must be between 2 and 36. It was given {{value}}",D3110:"The argument of the toMillis function must be an ISO 8601 formatted timestamp. Given {{value}}"};function $(e){var t="Unknown error";void 0!==e.message&&(t=e.message);var r=I[e.code];return void 0!==r&&(t=(t=r.replace(/\{\{\{([^}]+)}}}/g,function(){return e[arguments[1]]})).replace(/\{\{([^}]+)}}/g,function(){return JSON.stringify(e[arguments[1]])})),t}function z(e,t){var r,n;try{r=i(e,t&&t.recover),n=r.errors,delete r.errors}catch(e){throw e.message=$(e),e}var o=F(a),s=new Date;return o.bind("now",T(function(){return s.toJSON()},"<:s>")),o.bind("millis",T(function(){return s.getTime()},"<:n>")),{evaluate:function(e,t,i){if(void 0!==n){var a={code:"S0500",position:0};throw a.message=$(a),a}var u,f,l;if(void 0!==t)for(var p in u=F(o),t)u.bind(p,t[p]);else u=o;if(u.bind("$",e),s=new Date,"function"==typeof i){u.bind("__jsonata_async",!0);var d=function(e){(f=l.next(e)).done?i(null,f.value):f.value.then(d).catch(function(e){e.message=$(e),i(e,null)})};l=c(r,e,u),(f=l.next()).value.then(d)}else try{for(l=c(r,e,u),f=l.next();!f.done;)f=l.next(f.value);return f.value}catch(a){throw a.message=$(a),a}},assign:function(e,t){o.bind(e,t)},registerFunction:function(e,t,r){var n=T(t,r);o.bind(e,n)},ast:function(){return r},errors:function(){return n}}}return z.parser=i,z}();"undefined"!=typeof module&&(module.exports=jsonata);
{
"name": "jsonata",
"version": "1.5.1",
"version": "1.5.2",
"description": "JSON query and transformation language",

@@ -5,0 +5,0 @@ "module": "jsonata.js",

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

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

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