From f23cd56c8be389c158a1e780dadb957a59c05ba3 Mon Sep 17 00:00:00 2001 From: "William J. Edney" Date: Thu, 7 Mar 2019 06:35:42 -0600 Subject: [PATCH 1/3] Need underscore for browser build --- Gruntfile.js | 1 - jsonpath.js | 1421 ++++++++++++++++++++++++++++++++++++++++++++++- jsonpath.min.js | 5 +- 3 files changed, 1422 insertions(+), 5 deletions(-) diff --git a/Gruntfile.js b/Gruntfile.js index 94e4ef9..685e951 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -30,7 +30,6 @@ module.exports = function (grunt) { 'source-map', 'estraverse', 'escodegen', - 'underscore', 'reflect', 'JSONSelect', './lib/aesprim.js' diff --git a/jsonpath.js b/jsonpath.js index bb8254b..81c0ae2 100644 --- a/jsonpath.js +++ b/jsonpath.js @@ -4861,7 +4861,7 @@ function _parse_nullable_int(val) { module.exports = Handlers; -},{"..":"jsonpath","./aesprim":"./aesprim","./index":5,"./slice":7,"static-eval":15,"underscore":12}],5:[function(require,module,exports){ +},{"..":"jsonpath","./aesprim":"./aesprim","./index":5,"./slice":7,"static-eval":15,"underscore":16}],5:[function(require,module,exports){ var assert = require('assert'); var dict = require('./dict'); var Parser = require('./parser'); @@ -6835,7 +6835,1424 @@ module.exports = function (ast, vars) { return result === FAIL ? undefined : result; }; -},{"escodegen":12}],"jsonpath":[function(require,module,exports){ +},{"escodegen":12}],16:[function(require,module,exports){ +// Underscore.js 1.7.0 +// http://underscorejs.org +// (c) 2009-2014 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors +// Underscore may be freely distributed under the MIT license. + +(function() { + + // Baseline setup + // -------------- + + // Establish the root object, `window` in the browser, or `exports` on the server. + var root = this; + + // Save the previous value of the `_` variable. + var previousUnderscore = root._; + + // Save bytes in the minified (but not gzipped) version: + var ArrayProto = Array.prototype, ObjProto = Object.prototype, FuncProto = Function.prototype; + + // Create quick reference variables for speed access to core prototypes. + var + push = ArrayProto.push, + slice = ArrayProto.slice, + concat = ArrayProto.concat, + toString = ObjProto.toString, + hasOwnProperty = ObjProto.hasOwnProperty; + + // All **ECMAScript 5** native function implementations that we hope to use + // are declared here. + var + nativeIsArray = Array.isArray, + nativeKeys = Object.keys, + nativeBind = FuncProto.bind; + + // Create a safe reference to the Underscore object for use below. + var _ = function(obj) { + if (obj instanceof _) return obj; + if (!(this instanceof _)) return new _(obj); + this._wrapped = obj; + }; + + // Export the Underscore object for **Node.js**, with + // backwards-compatibility for the old `require()` API. If we're in + // the browser, add `_` as a global object. + if (typeof exports !== 'undefined') { + if (typeof module !== 'undefined' && module.exports) { + exports = module.exports = _; + } + exports._ = _; + } else { + root._ = _; + } + + // Current version. + _.VERSION = '1.7.0'; + + // Internal function that returns an efficient (for current engines) version + // of the passed-in callback, to be repeatedly applied in other Underscore + // functions. + var createCallback = function(func, context, argCount) { + if (context === void 0) return func; + switch (argCount == null ? 3 : argCount) { + case 1: return function(value) { + return func.call(context, value); + }; + case 2: return function(value, other) { + return func.call(context, value, other); + }; + case 3: return function(value, index, collection) { + return func.call(context, value, index, collection); + }; + case 4: return function(accumulator, value, index, collection) { + return func.call(context, accumulator, value, index, collection); + }; + } + return function() { + return func.apply(context, arguments); + }; + }; + + // A mostly-internal function to generate callbacks that can be applied + // to each element in a collection, returning the desired result — either + // identity, an arbitrary callback, a property matcher, or a property accessor. + _.iteratee = function(value, context, argCount) { + if (value == null) return _.identity; + if (_.isFunction(value)) return createCallback(value, context, argCount); + if (_.isObject(value)) return _.matches(value); + return _.property(value); + }; + + // Collection Functions + // -------------------- + + // The cornerstone, an `each` implementation, aka `forEach`. + // Handles raw objects in addition to array-likes. Treats all + // sparse array-likes as if they were dense. + _.each = _.forEach = function(obj, iteratee, context) { + if (obj == null) return obj; + iteratee = createCallback(iteratee, context); + var i, length = obj.length; + if (length === +length) { + for (i = 0; i < length; i++) { + iteratee(obj[i], i, obj); + } + } else { + var keys = _.keys(obj); + for (i = 0, length = keys.length; i < length; i++) { + iteratee(obj[keys[i]], keys[i], obj); + } + } + return obj; + }; + + // Return the results of applying the iteratee to each element. + _.map = _.collect = function(obj, iteratee, context) { + if (obj == null) return []; + iteratee = _.iteratee(iteratee, context); + var keys = obj.length !== +obj.length && _.keys(obj), + length = (keys || obj).length, + results = Array(length), + currentKey; + for (var index = 0; index < length; index++) { + currentKey = keys ? keys[index] : index; + results[index] = iteratee(obj[currentKey], currentKey, obj); + } + return results; + }; + + var reduceError = 'Reduce of empty array with no initial value'; + + // **Reduce** builds up a single result from a list of values, aka `inject`, + // or `foldl`. + _.reduce = _.foldl = _.inject = function(obj, iteratee, memo, context) { + if (obj == null) obj = []; + iteratee = createCallback(iteratee, context, 4); + var keys = obj.length !== +obj.length && _.keys(obj), + length = (keys || obj).length, + index = 0, currentKey; + if (arguments.length < 3) { + if (!length) throw new TypeError(reduceError); + memo = obj[keys ? keys[index++] : index++]; + } + for (; index < length; index++) { + currentKey = keys ? keys[index] : index; + memo = iteratee(memo, obj[currentKey], currentKey, obj); + } + return memo; + }; + + // The right-associative version of reduce, also known as `foldr`. + _.reduceRight = _.foldr = function(obj, iteratee, memo, context) { + if (obj == null) obj = []; + iteratee = createCallback(iteratee, context, 4); + var keys = obj.length !== + obj.length && _.keys(obj), + index = (keys || obj).length, + currentKey; + if (arguments.length < 3) { + if (!index) throw new TypeError(reduceError); + memo = obj[keys ? keys[--index] : --index]; + } + while (index--) { + currentKey = keys ? keys[index] : index; + memo = iteratee(memo, obj[currentKey], currentKey, obj); + } + return memo; + }; + + // Return the first value which passes a truth test. Aliased as `detect`. + _.find = _.detect = function(obj, predicate, context) { + var result; + predicate = _.iteratee(predicate, context); + _.some(obj, function(value, index, list) { + if (predicate(value, index, list)) { + result = value; + return true; + } + }); + return result; + }; + + // Return all the elements that pass a truth test. + // Aliased as `select`. + _.filter = _.select = function(obj, predicate, context) { + var results = []; + if (obj == null) return results; + predicate = _.iteratee(predicate, context); + _.each(obj, function(value, index, list) { + if (predicate(value, index, list)) results.push(value); + }); + return results; + }; + + // Return all the elements for which a truth test fails. + _.reject = function(obj, predicate, context) { + return _.filter(obj, _.negate(_.iteratee(predicate)), context); + }; + + // Determine whether all of the elements match a truth test. + // Aliased as `all`. + _.every = _.all = function(obj, predicate, context) { + if (obj == null) return true; + predicate = _.iteratee(predicate, context); + var keys = obj.length !== +obj.length && _.keys(obj), + length = (keys || obj).length, + index, currentKey; + for (index = 0; index < length; index++) { + currentKey = keys ? keys[index] : index; + if (!predicate(obj[currentKey], currentKey, obj)) return false; + } + return true; + }; + + // Determine if at least one element in the object matches a truth test. + // Aliased as `any`. + _.some = _.any = function(obj, predicate, context) { + if (obj == null) return false; + predicate = _.iteratee(predicate, context); + var keys = obj.length !== +obj.length && _.keys(obj), + length = (keys || obj).length, + index, currentKey; + for (index = 0; index < length; index++) { + currentKey = keys ? keys[index] : index; + if (predicate(obj[currentKey], currentKey, obj)) return true; + } + return false; + }; + + // Determine if the array or object contains a given value (using `===`). + // Aliased as `include`. + _.contains = _.include = function(obj, target) { + if (obj == null) return false; + if (obj.length !== +obj.length) obj = _.values(obj); + return _.indexOf(obj, target) >= 0; + }; + + // Invoke a method (with arguments) on every item in a collection. + _.invoke = function(obj, method) { + var args = slice.call(arguments, 2); + var isFunc = _.isFunction(method); + return _.map(obj, function(value) { + return (isFunc ? method : value[method]).apply(value, args); + }); + }; + + // Convenience version of a common use case of `map`: fetching a property. + _.pluck = function(obj, key) { + return _.map(obj, _.property(key)); + }; + + // Convenience version of a common use case of `filter`: selecting only objects + // containing specific `key:value` pairs. + _.where = function(obj, attrs) { + return _.filter(obj, _.matches(attrs)); + }; + + // Convenience version of a common use case of `find`: getting the first object + // containing specific `key:value` pairs. + _.findWhere = function(obj, attrs) { + return _.find(obj, _.matches(attrs)); + }; + + // Return the maximum element (or element-based computation). + _.max = function(obj, iteratee, context) { + var result = -Infinity, lastComputed = -Infinity, + value, computed; + if (iteratee == null && obj != null) { + obj = obj.length === +obj.length ? obj : _.values(obj); + for (var i = 0, length = obj.length; i < length; i++) { + value = obj[i]; + if (value > result) { + result = value; + } + } + } else { + iteratee = _.iteratee(iteratee, context); + _.each(obj, function(value, index, list) { + computed = iteratee(value, index, list); + if (computed > lastComputed || computed === -Infinity && result === -Infinity) { + result = value; + lastComputed = computed; + } + }); + } + return result; + }; + + // Return the minimum element (or element-based computation). + _.min = function(obj, iteratee, context) { + var result = Infinity, lastComputed = Infinity, + value, computed; + if (iteratee == null && obj != null) { + obj = obj.length === +obj.length ? obj : _.values(obj); + for (var i = 0, length = obj.length; i < length; i++) { + value = obj[i]; + if (value < result) { + result = value; + } + } + } else { + iteratee = _.iteratee(iteratee, context); + _.each(obj, function(value, index, list) { + computed = iteratee(value, index, list); + if (computed < lastComputed || computed === Infinity && result === Infinity) { + result = value; + lastComputed = computed; + } + }); + } + return result; + }; + + // Shuffle a collection, using the modern version of the + // [Fisher-Yates shuffle](http://en.wikipedia.org/wiki/Fisher–Yates_shuffle). + _.shuffle = function(obj) { + var set = obj && obj.length === +obj.length ? obj : _.values(obj); + var length = set.length; + var shuffled = Array(length); + for (var index = 0, rand; index < length; index++) { + rand = _.random(0, index); + if (rand !== index) shuffled[index] = shuffled[rand]; + shuffled[rand] = set[index]; + } + return shuffled; + }; + + // Sample **n** random values from a collection. + // If **n** is not specified, returns a single random element. + // The internal `guard` argument allows it to work with `map`. + _.sample = function(obj, n, guard) { + if (n == null || guard) { + if (obj.length !== +obj.length) obj = _.values(obj); + return obj[_.random(obj.length - 1)]; + } + return _.shuffle(obj).slice(0, Math.max(0, n)); + }; + + // Sort the object's values by a criterion produced by an iteratee. + _.sortBy = function(obj, iteratee, context) { + iteratee = _.iteratee(iteratee, context); + return _.pluck(_.map(obj, function(value, index, list) { + return { + value: value, + index: index, + criteria: iteratee(value, index, list) + }; + }).sort(function(left, right) { + var a = left.criteria; + var b = right.criteria; + if (a !== b) { + if (a > b || a === void 0) return 1; + if (a < b || b === void 0) return -1; + } + return left.index - right.index; + }), 'value'); + }; + + // An internal function used for aggregate "group by" operations. + var group = function(behavior) { + return function(obj, iteratee, context) { + var result = {}; + iteratee = _.iteratee(iteratee, context); + _.each(obj, function(value, index) { + var key = iteratee(value, index, obj); + behavior(result, value, key); + }); + return result; + }; + }; + + // Groups the object's values by a criterion. Pass either a string attribute + // to group by, or a function that returns the criterion. + _.groupBy = group(function(result, value, key) { + if (_.has(result, key)) result[key].push(value); else result[key] = [value]; + }); + + // Indexes the object's values by a criterion, similar to `groupBy`, but for + // when you know that your index values will be unique. + _.indexBy = group(function(result, value, key) { + result[key] = value; + }); + + // Counts instances of an object that group by a certain criterion. Pass + // either a string attribute to count by, or a function that returns the + // criterion. + _.countBy = group(function(result, value, key) { + if (_.has(result, key)) result[key]++; else result[key] = 1; + }); + + // Use a comparator function to figure out the smallest index at which + // an object should be inserted so as to maintain order. Uses binary search. + _.sortedIndex = function(array, obj, iteratee, context) { + iteratee = _.iteratee(iteratee, context, 1); + var value = iteratee(obj); + var low = 0, high = array.length; + while (low < high) { + var mid = low + high >>> 1; + if (iteratee(array[mid]) < value) low = mid + 1; else high = mid; + } + return low; + }; + + // Safely create a real, live array from anything iterable. + _.toArray = function(obj) { + if (!obj) return []; + if (_.isArray(obj)) return slice.call(obj); + if (obj.length === +obj.length) return _.map(obj, _.identity); + return _.values(obj); + }; + + // Return the number of elements in an object. + _.size = function(obj) { + if (obj == null) return 0; + return obj.length === +obj.length ? obj.length : _.keys(obj).length; + }; + + // Split a collection into two arrays: one whose elements all satisfy the given + // predicate, and one whose elements all do not satisfy the predicate. + _.partition = function(obj, predicate, context) { + predicate = _.iteratee(predicate, context); + var pass = [], fail = []; + _.each(obj, function(value, key, obj) { + (predicate(value, key, obj) ? pass : fail).push(value); + }); + return [pass, fail]; + }; + + // Array Functions + // --------------- + + // Get the first element of an array. Passing **n** will return the first N + // values in the array. Aliased as `head` and `take`. The **guard** check + // allows it to work with `_.map`. + _.first = _.head = _.take = function(array, n, guard) { + if (array == null) return void 0; + if (n == null || guard) return array[0]; + if (n < 0) return []; + return slice.call(array, 0, n); + }; + + // Returns everything but the last entry of the array. Especially useful on + // the arguments object. Passing **n** will return all the values in + // the array, excluding the last N. The **guard** check allows it to work with + // `_.map`. + _.initial = function(array, n, guard) { + return slice.call(array, 0, Math.max(0, array.length - (n == null || guard ? 1 : n))); + }; + + // Get the last element of an array. Passing **n** will return the last N + // values in the array. The **guard** check allows it to work with `_.map`. + _.last = function(array, n, guard) { + if (array == null) return void 0; + if (n == null || guard) return array[array.length - 1]; + return slice.call(array, Math.max(array.length - n, 0)); + }; + + // Returns everything but the first entry of the array. Aliased as `tail` and `drop`. + // Especially useful on the arguments object. Passing an **n** will return + // the rest N values in the array. The **guard** + // check allows it to work with `_.map`. + _.rest = _.tail = _.drop = function(array, n, guard) { + return slice.call(array, n == null || guard ? 1 : n); + }; + + // Trim out all falsy values from an array. + _.compact = function(array) { + return _.filter(array, _.identity); + }; + + // Internal implementation of a recursive `flatten` function. + var flatten = function(input, shallow, strict, output) { + if (shallow && _.every(input, _.isArray)) { + return concat.apply(output, input); + } + for (var i = 0, length = input.length; i < length; i++) { + var value = input[i]; + if (!_.isArray(value) && !_.isArguments(value)) { + if (!strict) output.push(value); + } else if (shallow) { + push.apply(output, value); + } else { + flatten(value, shallow, strict, output); + } + } + return output; + }; + + // Flatten out an array, either recursively (by default), or just one level. + _.flatten = function(array, shallow) { + return flatten(array, shallow, false, []); + }; + + // Return a version of the array that does not contain the specified value(s). + _.without = function(array) { + return _.difference(array, slice.call(arguments, 1)); + }; + + // Produce a duplicate-free version of the array. If the array has already + // been sorted, you have the option of using a faster algorithm. + // Aliased as `unique`. + _.uniq = _.unique = function(array, isSorted, iteratee, context) { + if (array == null) return []; + if (!_.isBoolean(isSorted)) { + context = iteratee; + iteratee = isSorted; + isSorted = false; + } + if (iteratee != null) iteratee = _.iteratee(iteratee, context); + var result = []; + var seen = []; + for (var i = 0, length = array.length; i < length; i++) { + var value = array[i]; + if (isSorted) { + if (!i || seen !== value) result.push(value); + seen = value; + } else if (iteratee) { + var computed = iteratee(value, i, array); + if (_.indexOf(seen, computed) < 0) { + seen.push(computed); + result.push(value); + } + } else if (_.indexOf(result, value) < 0) { + result.push(value); + } + } + return result; + }; + + // Produce an array that contains the union: each distinct element from all of + // the passed-in arrays. + _.union = function() { + return _.uniq(flatten(arguments, true, true, [])); + }; + + // Produce an array that contains every item shared between all the + // passed-in arrays. + _.intersection = function(array) { + if (array == null) return []; + var result = []; + var argsLength = arguments.length; + for (var i = 0, length = array.length; i < length; i++) { + var item = array[i]; + if (_.contains(result, item)) continue; + for (var j = 1; j < argsLength; j++) { + if (!_.contains(arguments[j], item)) break; + } + if (j === argsLength) result.push(item); + } + return result; + }; + + // Take the difference between one array and a number of other arrays. + // Only the elements present in just the first array will remain. + _.difference = function(array) { + var rest = flatten(slice.call(arguments, 1), true, true, []); + return _.filter(array, function(value){ + return !_.contains(rest, value); + }); + }; + + // Zip together multiple lists into a single array -- elements that share + // an index go together. + _.zip = function(array) { + if (array == null) return []; + var length = _.max(arguments, 'length').length; + var results = Array(length); + for (var i = 0; i < length; i++) { + results[i] = _.pluck(arguments, i); + } + return results; + }; + + // Converts lists into objects. Pass either a single array of `[key, value]` + // pairs, or two parallel arrays of the same length -- one of keys, and one of + // the corresponding values. + _.object = function(list, values) { + if (list == null) return {}; + var result = {}; + for (var i = 0, length = list.length; i < length; i++) { + if (values) { + result[list[i]] = values[i]; + } else { + result[list[i][0]] = list[i][1]; + } + } + return result; + }; + + // Return the position of the first occurrence of an item in an array, + // or -1 if the item is not included in the array. + // If the array is large and already in sort order, pass `true` + // for **isSorted** to use binary search. + _.indexOf = function(array, item, isSorted) { + if (array == null) return -1; + var i = 0, length = array.length; + if (isSorted) { + if (typeof isSorted == 'number') { + i = isSorted < 0 ? Math.max(0, length + isSorted) : isSorted; + } else { + i = _.sortedIndex(array, item); + return array[i] === item ? i : -1; + } + } + for (; i < length; i++) if (array[i] === item) return i; + return -1; + }; + + _.lastIndexOf = function(array, item, from) { + if (array == null) return -1; + var idx = array.length; + if (typeof from == 'number') { + idx = from < 0 ? idx + from + 1 : Math.min(idx, from + 1); + } + while (--idx >= 0) if (array[idx] === item) return idx; + return -1; + }; + + // Generate an integer Array containing an arithmetic progression. A port of + // the native Python `range()` function. See + // [the Python documentation](http://docs.python.org/library/functions.html#range). + _.range = function(start, stop, step) { + if (arguments.length <= 1) { + stop = start || 0; + start = 0; + } + step = step || 1; + + var length = Math.max(Math.ceil((stop - start) / step), 0); + var range = Array(length); + + for (var idx = 0; idx < length; idx++, start += step) { + range[idx] = start; + } + + return range; + }; + + // Function (ahem) Functions + // ------------------ + + // Reusable constructor function for prototype setting. + var Ctor = function(){}; + + // Create a function bound to a given object (assigning `this`, and arguments, + // optionally). Delegates to **ECMAScript 5**'s native `Function.bind` if + // available. + _.bind = function(func, context) { + var args, bound; + if (nativeBind && func.bind === nativeBind) return nativeBind.apply(func, slice.call(arguments, 1)); + if (!_.isFunction(func)) throw new TypeError('Bind must be called on a function'); + args = slice.call(arguments, 2); + bound = function() { + if (!(this instanceof bound)) return func.apply(context, args.concat(slice.call(arguments))); + Ctor.prototype = func.prototype; + var self = new Ctor; + Ctor.prototype = null; + var result = func.apply(self, args.concat(slice.call(arguments))); + if (_.isObject(result)) return result; + return self; + }; + return bound; + }; + + // Partially apply a function by creating a version that has had some of its + // arguments pre-filled, without changing its dynamic `this` context. _ acts + // as a placeholder, allowing any combination of arguments to be pre-filled. + _.partial = function(func) { + var boundArgs = slice.call(arguments, 1); + return function() { + var position = 0; + var args = boundArgs.slice(); + for (var i = 0, length = args.length; i < length; i++) { + if (args[i] === _) args[i] = arguments[position++]; + } + while (position < arguments.length) args.push(arguments[position++]); + return func.apply(this, args); + }; + }; + + // Bind a number of an object's methods to that object. Remaining arguments + // are the method names to be bound. Useful for ensuring that all callbacks + // defined on an object belong to it. + _.bindAll = function(obj) { + var i, length = arguments.length, key; + if (length <= 1) throw new Error('bindAll must be passed function names'); + for (i = 1; i < length; i++) { + key = arguments[i]; + obj[key] = _.bind(obj[key], obj); + } + return obj; + }; + + // Memoize an expensive function by storing its results. + _.memoize = function(func, hasher) { + var memoize = function(key) { + var cache = memoize.cache; + var address = hasher ? hasher.apply(this, arguments) : key; + if (!_.has(cache, address)) cache[address] = func.apply(this, arguments); + return cache[address]; + }; + memoize.cache = {}; + return memoize; + }; + + // Delays a function for the given number of milliseconds, and then calls + // it with the arguments supplied. + _.delay = function(func, wait) { + var args = slice.call(arguments, 2); + return setTimeout(function(){ + return func.apply(null, args); + }, wait); + }; + + // Defers a function, scheduling it to run after the current call stack has + // cleared. + _.defer = function(func) { + return _.delay.apply(_, [func, 1].concat(slice.call(arguments, 1))); + }; + + // Returns a function, that, when invoked, will only be triggered at most once + // during a given window of time. Normally, the throttled function will run + // as much as it can, without ever going more than once per `wait` duration; + // but if you'd like to disable the execution on the leading edge, pass + // `{leading: false}`. To disable execution on the trailing edge, ditto. + _.throttle = function(func, wait, options) { + var context, args, result; + var timeout = null; + var previous = 0; + if (!options) options = {}; + var later = function() { + previous = options.leading === false ? 0 : _.now(); + timeout = null; + result = func.apply(context, args); + if (!timeout) context = args = null; + }; + return function() { + var now = _.now(); + if (!previous && options.leading === false) previous = now; + var remaining = wait - (now - previous); + context = this; + args = arguments; + if (remaining <= 0 || remaining > wait) { + clearTimeout(timeout); + timeout = null; + previous = now; + result = func.apply(context, args); + if (!timeout) context = args = null; + } else if (!timeout && options.trailing !== false) { + timeout = setTimeout(later, remaining); + } + return result; + }; + }; + + // Returns a function, that, as long as it continues to be invoked, will not + // be triggered. The function will be called after it stops being called for + // N milliseconds. If `immediate` is passed, trigger the function on the + // leading edge, instead of the trailing. + _.debounce = function(func, wait, immediate) { + var timeout, args, context, timestamp, result; + + var later = function() { + var last = _.now() - timestamp; + + if (last < wait && last > 0) { + timeout = setTimeout(later, wait - last); + } else { + timeout = null; + if (!immediate) { + result = func.apply(context, args); + if (!timeout) context = args = null; + } + } + }; + + return function() { + context = this; + args = arguments; + timestamp = _.now(); + var callNow = immediate && !timeout; + if (!timeout) timeout = setTimeout(later, wait); + if (callNow) { + result = func.apply(context, args); + context = args = null; + } + + return result; + }; + }; + + // Returns the first function passed as an argument to the second, + // allowing you to adjust arguments, run code before and after, and + // conditionally execute the original function. + _.wrap = function(func, wrapper) { + return _.partial(wrapper, func); + }; + + // Returns a negated version of the passed-in predicate. + _.negate = function(predicate) { + return function() { + return !predicate.apply(this, arguments); + }; + }; + + // Returns a function that is the composition of a list of functions, each + // consuming the return value of the function that follows. + _.compose = function() { + var args = arguments; + var start = args.length - 1; + return function() { + var i = start; + var result = args[start].apply(this, arguments); + while (i--) result = args[i].call(this, result); + return result; + }; + }; + + // Returns a function that will only be executed after being called N times. + _.after = function(times, func) { + return function() { + if (--times < 1) { + return func.apply(this, arguments); + } + }; + }; + + // Returns a function that will only be executed before being called N times. + _.before = function(times, func) { + var memo; + return function() { + if (--times > 0) { + memo = func.apply(this, arguments); + } else { + func = null; + } + return memo; + }; + }; + + // Returns a function that will be executed at most one time, no matter how + // often you call it. Useful for lazy initialization. + _.once = _.partial(_.before, 2); + + // Object Functions + // ---------------- + + // Retrieve the names of an object's properties. + // Delegates to **ECMAScript 5**'s native `Object.keys` + _.keys = function(obj) { + if (!_.isObject(obj)) return []; + if (nativeKeys) return nativeKeys(obj); + var keys = []; + for (var key in obj) if (_.has(obj, key)) keys.push(key); + return keys; + }; + + // Retrieve the values of an object's properties. + _.values = function(obj) { + var keys = _.keys(obj); + var length = keys.length; + var values = Array(length); + for (var i = 0; i < length; i++) { + values[i] = obj[keys[i]]; + } + return values; + }; + + // Convert an object into a list of `[key, value]` pairs. + _.pairs = function(obj) { + var keys = _.keys(obj); + var length = keys.length; + var pairs = Array(length); + for (var i = 0; i < length; i++) { + pairs[i] = [keys[i], obj[keys[i]]]; + } + return pairs; + }; + + // Invert the keys and values of an object. The values must be serializable. + _.invert = function(obj) { + var result = {}; + var keys = _.keys(obj); + for (var i = 0, length = keys.length; i < length; i++) { + result[obj[keys[i]]] = keys[i]; + } + return result; + }; + + // Return a sorted list of the function names available on the object. + // Aliased as `methods` + _.functions = _.methods = function(obj) { + var names = []; + for (var key in obj) { + if (_.isFunction(obj[key])) names.push(key); + } + return names.sort(); + }; + + // Extend a given object with all the properties in passed-in object(s). + _.extend = function(obj) { + if (!_.isObject(obj)) return obj; + var source, prop; + for (var i = 1, length = arguments.length; i < length; i++) { + source = arguments[i]; + for (prop in source) { + if (hasOwnProperty.call(source, prop)) { + obj[prop] = source[prop]; + } + } + } + return obj; + }; + + // Return a copy of the object only containing the whitelisted properties. + _.pick = function(obj, iteratee, context) { + var result = {}, key; + if (obj == null) return result; + if (_.isFunction(iteratee)) { + iteratee = createCallback(iteratee, context); + for (key in obj) { + var value = obj[key]; + if (iteratee(value, key, obj)) result[key] = value; + } + } else { + var keys = concat.apply([], slice.call(arguments, 1)); + obj = new Object(obj); + for (var i = 0, length = keys.length; i < length; i++) { + key = keys[i]; + if (key in obj) result[key] = obj[key]; + } + } + return result; + }; + + // Return a copy of the object without the blacklisted properties. + _.omit = function(obj, iteratee, context) { + if (_.isFunction(iteratee)) { + iteratee = _.negate(iteratee); + } else { + var keys = _.map(concat.apply([], slice.call(arguments, 1)), String); + iteratee = function(value, key) { + return !_.contains(keys, key); + }; + } + return _.pick(obj, iteratee, context); + }; + + // Fill in a given object with default properties. + _.defaults = function(obj) { + if (!_.isObject(obj)) return obj; + for (var i = 1, length = arguments.length; i < length; i++) { + var source = arguments[i]; + for (var prop in source) { + if (obj[prop] === void 0) obj[prop] = source[prop]; + } + } + return obj; + }; + + // Create a (shallow-cloned) duplicate of an object. + _.clone = function(obj) { + if (!_.isObject(obj)) return obj; + return _.isArray(obj) ? obj.slice() : _.extend({}, obj); + }; + + // Invokes interceptor with the obj, and then returns obj. + // The primary purpose of this method is to "tap into" a method chain, in + // order to perform operations on intermediate results within the chain. + _.tap = function(obj, interceptor) { + interceptor(obj); + return obj; + }; + + // Internal recursive comparison function for `isEqual`. + var eq = function(a, b, aStack, bStack) { + // Identical objects are equal. `0 === -0`, but they aren't identical. + // See the [Harmony `egal` proposal](http://wiki.ecmascript.org/doku.php?id=harmony:egal). + if (a === b) return a !== 0 || 1 / a === 1 / b; + // A strict comparison is necessary because `null == undefined`. + if (a == null || b == null) return a === b; + // Unwrap any wrapped objects. + if (a instanceof _) a = a._wrapped; + if (b instanceof _) b = b._wrapped; + // Compare `[[Class]]` names. + var className = toString.call(a); + if (className !== toString.call(b)) return false; + switch (className) { + // Strings, numbers, regular expressions, dates, and booleans are compared by value. + case '[object RegExp]': + // RegExps are coerced to strings for comparison (Note: '' + /a/i === '/a/i') + case '[object String]': + // Primitives and their corresponding object wrappers are equivalent; thus, `"5"` is + // equivalent to `new String("5")`. + return '' + a === '' + b; + case '[object Number]': + // `NaN`s are equivalent, but non-reflexive. + // Object(NaN) is equivalent to NaN + if (+a !== +a) return +b !== +b; + // An `egal` comparison is performed for other numeric values. + return +a === 0 ? 1 / +a === 1 / b : +a === +b; + case '[object Date]': + case '[object Boolean]': + // Coerce dates and booleans to numeric primitive values. Dates are compared by their + // millisecond representations. Note that invalid dates with millisecond representations + // of `NaN` are not equivalent. + return +a === +b; + } + if (typeof a != 'object' || typeof b != 'object') return false; + // Assume equality for cyclic structures. The algorithm for detecting cyclic + // structures is adapted from ES 5.1 section 15.12.3, abstract operation `JO`. + var length = aStack.length; + while (length--) { + // Linear search. Performance is inversely proportional to the number of + // unique nested structures. + if (aStack[length] === a) return bStack[length] === b; + } + // Objects with different constructors are not equivalent, but `Object`s + // from different frames are. + var aCtor = a.constructor, bCtor = b.constructor; + if ( + aCtor !== bCtor && + // Handle Object.create(x) cases + 'constructor' in a && 'constructor' in b && + !(_.isFunction(aCtor) && aCtor instanceof aCtor && + _.isFunction(bCtor) && bCtor instanceof bCtor) + ) { + return false; + } + // Add the first object to the stack of traversed objects. + aStack.push(a); + bStack.push(b); + var size, result; + // Recursively compare objects and arrays. + if (className === '[object Array]') { + // Compare array lengths to determine if a deep comparison is necessary. + size = a.length; + result = size === b.length; + if (result) { + // Deep compare the contents, ignoring non-numeric properties. + while (size--) { + if (!(result = eq(a[size], b[size], aStack, bStack))) break; + } + } + } else { + // Deep compare objects. + var keys = _.keys(a), key; + size = keys.length; + // Ensure that both objects contain the same number of properties before comparing deep equality. + result = _.keys(b).length === size; + if (result) { + while (size--) { + // Deep compare each member + key = keys[size]; + if (!(result = _.has(b, key) && eq(a[key], b[key], aStack, bStack))) break; + } + } + } + // Remove the first object from the stack of traversed objects. + aStack.pop(); + bStack.pop(); + return result; + }; + + // Perform a deep comparison to check if two objects are equal. + _.isEqual = function(a, b) { + return eq(a, b, [], []); + }; + + // Is a given array, string, or object empty? + // An "empty" object has no enumerable own-properties. + _.isEmpty = function(obj) { + if (obj == null) return true; + if (_.isArray(obj) || _.isString(obj) || _.isArguments(obj)) return obj.length === 0; + for (var key in obj) if (_.has(obj, key)) return false; + return true; + }; + + // Is a given value a DOM element? + _.isElement = function(obj) { + return !!(obj && obj.nodeType === 1); + }; + + // Is a given value an array? + // Delegates to ECMA5's native Array.isArray + _.isArray = nativeIsArray || function(obj) { + return toString.call(obj) === '[object Array]'; + }; + + // Is a given variable an object? + _.isObject = function(obj) { + var type = typeof obj; + return type === 'function' || type === 'object' && !!obj; + }; + + // Add some isType methods: isArguments, isFunction, isString, isNumber, isDate, isRegExp. + _.each(['Arguments', 'Function', 'String', 'Number', 'Date', 'RegExp'], function(name) { + _['is' + name] = function(obj) { + return toString.call(obj) === '[object ' + name + ']'; + }; + }); + + // Define a fallback version of the method in browsers (ahem, IE), where + // there isn't any inspectable "Arguments" type. + if (!_.isArguments(arguments)) { + _.isArguments = function(obj) { + return _.has(obj, 'callee'); + }; + } + + // Optimize `isFunction` if appropriate. Work around an IE 11 bug. + if (typeof /./ !== 'function') { + _.isFunction = function(obj) { + return typeof obj == 'function' || false; + }; + } + + // Is a given object a finite number? + _.isFinite = function(obj) { + return isFinite(obj) && !isNaN(parseFloat(obj)); + }; + + // Is the given value `NaN`? (NaN is the only number which does not equal itself). + _.isNaN = function(obj) { + return _.isNumber(obj) && obj !== +obj; + }; + + // Is a given value a boolean? + _.isBoolean = function(obj) { + return obj === true || obj === false || toString.call(obj) === '[object Boolean]'; + }; + + // Is a given value equal to null? + _.isNull = function(obj) { + return obj === null; + }; + + // Is a given variable undefined? + _.isUndefined = function(obj) { + return obj === void 0; + }; + + // Shortcut function for checking if an object has a given property directly + // on itself (in other words, not on a prototype). + _.has = function(obj, key) { + return obj != null && hasOwnProperty.call(obj, key); + }; + + // Utility Functions + // ----------------- + + // Run Underscore.js in *noConflict* mode, returning the `_` variable to its + // previous owner. Returns a reference to the Underscore object. + _.noConflict = function() { + root._ = previousUnderscore; + return this; + }; + + // Keep the identity function around for default iteratees. + _.identity = function(value) { + return value; + }; + + _.constant = function(value) { + return function() { + return value; + }; + }; + + _.noop = function(){}; + + _.property = function(key) { + return function(obj) { + return obj[key]; + }; + }; + + // Returns a predicate for checking whether an object has a given set of `key:value` pairs. + _.matches = function(attrs) { + var pairs = _.pairs(attrs), length = pairs.length; + return function(obj) { + if (obj == null) return !length; + obj = new Object(obj); + for (var i = 0; i < length; i++) { + var pair = pairs[i], key = pair[0]; + if (pair[1] !== obj[key] || !(key in obj)) return false; + } + return true; + }; + }; + + // Run a function **n** times. + _.times = function(n, iteratee, context) { + var accum = Array(Math.max(0, n)); + iteratee = createCallback(iteratee, context, 1); + for (var i = 0; i < n; i++) accum[i] = iteratee(i); + return accum; + }; + + // Return a random integer between min and max (inclusive). + _.random = function(min, max) { + if (max == null) { + max = min; + min = 0; + } + return min + Math.floor(Math.random() * (max - min + 1)); + }; + + // A (possibly faster) way to get the current timestamp as an integer. + _.now = Date.now || function() { + return new Date().getTime(); + }; + + // List of HTML entities for escaping. + var escapeMap = { + '&': '&', + '<': '<', + '>': '>', + '"': '"', + "'": ''', + '`': '`' + }; + var unescapeMap = _.invert(escapeMap); + + // Functions for escaping and unescaping strings to/from HTML interpolation. + var createEscaper = function(map) { + var escaper = function(match) { + return map[match]; + }; + // Regexes for identifying a key that needs to be escaped + var source = '(?:' + _.keys(map).join('|') + ')'; + var testRegexp = RegExp(source); + var replaceRegexp = RegExp(source, 'g'); + return function(string) { + string = string == null ? '' : '' + string; + return testRegexp.test(string) ? string.replace(replaceRegexp, escaper) : string; + }; + }; + _.escape = createEscaper(escapeMap); + _.unescape = createEscaper(unescapeMap); + + // If the value of the named `property` is a function then invoke it with the + // `object` as context; otherwise, return it. + _.result = function(object, property) { + if (object == null) return void 0; + var value = object[property]; + return _.isFunction(value) ? object[property]() : value; + }; + + // Generate a unique integer id (unique within the entire client session). + // Useful for temporary DOM ids. + var idCounter = 0; + _.uniqueId = function(prefix) { + var id = ++idCounter + ''; + return prefix ? prefix + id : id; + }; + + // By default, Underscore uses ERB-style template delimiters, change the + // following template settings to use alternative delimiters. + _.templateSettings = { + evaluate : /<%([\s\S]+?)%>/g, + interpolate : /<%=([\s\S]+?)%>/g, + escape : /<%-([\s\S]+?)%>/g + }; + + // When customizing `templateSettings`, if you don't want to define an + // interpolation, evaluation or escaping regex, we need one that is + // guaranteed not to match. + var noMatch = /(.)^/; + + // Certain characters need to be escaped so that they can be put into a + // string literal. + var escapes = { + "'": "'", + '\\': '\\', + '\r': 'r', + '\n': 'n', + '\u2028': 'u2028', + '\u2029': 'u2029' + }; + + var escaper = /\\|'|\r|\n|\u2028|\u2029/g; + + var escapeChar = function(match) { + return '\\' + escapes[match]; + }; + + // JavaScript micro-templating, similar to John Resig's implementation. + // Underscore templating handles arbitrary delimiters, preserves whitespace, + // and correctly escapes quotes within interpolated code. + // NB: `oldSettings` only exists for backwards compatibility. + _.template = function(text, settings, oldSettings) { + if (!settings && oldSettings) settings = oldSettings; + settings = _.defaults({}, settings, _.templateSettings); + + // Combine delimiters into one regular expression via alternation. + var matcher = RegExp([ + (settings.escape || noMatch).source, + (settings.interpolate || noMatch).source, + (settings.evaluate || noMatch).source + ].join('|') + '|$', 'g'); + + // Compile the template source, escaping string literals appropriately. + var index = 0; + var source = "__p+='"; + text.replace(matcher, function(match, escape, interpolate, evaluate, offset) { + source += text.slice(index, offset).replace(escaper, escapeChar); + index = offset + match.length; + + if (escape) { + source += "'+\n((__t=(" + escape + "))==null?'':_.escape(__t))+\n'"; + } else if (interpolate) { + source += "'+\n((__t=(" + interpolate + "))==null?'':__t)+\n'"; + } else if (evaluate) { + source += "';\n" + evaluate + "\n__p+='"; + } + + // Adobe VMs need the match returned to produce the correct offest. + return match; + }); + source += "';\n"; + + // If a variable is not specified, place data values in local scope. + if (!settings.variable) source = 'with(obj||{}){\n' + source + '}\n'; + + source = "var __t,__p='',__j=Array.prototype.join," + + "print=function(){__p+=__j.call(arguments,'');};\n" + + source + 'return __p;\n'; + + try { + var render = new Function(settings.variable || 'obj', '_', source); + } catch (e) { + e.source = source; + throw e; + } + + var template = function(data) { + return render.call(this, data, _); + }; + + // Provide the compiled source as a convenience for precompilation. + var argument = settings.variable || 'obj'; + template.source = 'function(' + argument + '){\n' + source + '}'; + + return template; + }; + + // Add a "chain" function. Start chaining a wrapped Underscore object. + _.chain = function(obj) { + var instance = _(obj); + instance._chain = true; + return instance; + }; + + // OOP + // --------------- + // If Underscore is called as a function, it returns a wrapped object that + // can be used OO-style. This wrapper holds altered versions of all the + // underscore functions. Wrapped objects may be chained. + + // Helper function to continue chaining intermediate results. + var result = function(obj) { + return this._chain ? _(obj).chain() : obj; + }; + + // Add your own custom functions to the Underscore object. + _.mixin = function(obj) { + _.each(_.functions(obj), function(name) { + var func = _[name] = obj[name]; + _.prototype[name] = function() { + var args = [this._wrapped]; + push.apply(args, arguments); + return result.call(this, func.apply(_, args)); + }; + }); + }; + + // Add all of the Underscore functions to the wrapper object. + _.mixin(_); + + // Add all mutator Array functions to the wrapper. + _.each(['pop', 'push', 'reverse', 'shift', 'sort', 'splice', 'unshift'], function(name) { + var method = ArrayProto[name]; + _.prototype[name] = function() { + var obj = this._wrapped; + method.apply(obj, arguments); + if ((name === 'shift' || name === 'splice') && obj.length === 0) delete obj[0]; + return result.call(this, obj); + }; + }); + + // Add all accessor Array functions to the wrapper. + _.each(['concat', 'join', 'slice'], function(name) { + var method = ArrayProto[name]; + _.prototype[name] = function() { + return result.call(this, method.apply(this._wrapped, arguments)); + }; + }); + + // Extracts the result from a wrapped and chained object. + _.prototype.value = function() { + return this._wrapped; + }; + + // AMD registration happens at the end for compatibility with AMD loaders + // that may not enforce next-turn semantics on modules. Even though general + // practice for AMD registration is to be anonymous, underscore registers + // as a named module because, like jQuery, it is a base library that is + // popular enough to be bundled in a third party lib, but not be part of + // an AMD load request. Those cases could generate an error when an + // anonymous define() is called outside of a loader request. + if (typeof define === 'function' && define.amd) { + define('underscore', [], function() { + return _; + }); + } +}.call(this)); + +},{}],"jsonpath":[function(require,module,exports){ module.exports = require('./lib/index'); },{"./lib/index":5}]},{},["jsonpath"])("jsonpath") diff --git a/jsonpath.min.js b/jsonpath.min.js index 05f00f4..9f237c9 100644 --- a/jsonpath.min.js +++ b/jsonpath.min.js @@ -1,4 +1,5 @@ /*! jsonpath 1.0.1 */ !function(a){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=a();else if("function"==typeof define&&define.amd)define([],a);else{var b;b="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,b.jsonpath=a()}}(function(){var a;return function a(b,c,d){function e(g,h){if(!c[g]){if(!b[g]){var i="function"==typeof require&&require;if(!h&&i)return i(g,!0);if(f)return f(g,!0);var j=new Error("Cannot find module '"+g+"'");throw j.code="MODULE_NOT_FOUND",j}var k=c[g]={exports:{}};b[g][0].call(k.exports,function(a){var c=b[g][1][a];return e(c||a)},k,k.exports,a,b,c,d)}return c[g].exports}for(var f="function"==typeof require&&require,g=0;g=48&&a<=57}function d(a){return"0123456789abcdefABCDEF".indexOf(a)>=0}function e(a){return"01234567".indexOf(a)>=0}function f(a){return 32===a||9===a||11===a||12===a||160===a||a>=5760&&[5760,6158,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279].indexOf(a)>=0}function g(a){return 10===a||13===a||8232===a||8233===a}function h(a){return 64==a||36===a||95===a||a>=65&&a<=90||a>=97&&a<=122||92===a||a>=128&&eb.NonAsciiIdentifierStart.test(String.fromCharCode(a))}function i(a){return 36===a||95===a||a>=65&&a<=90||a>=97&&a<=122||a>=48&&a<=57||92===a||a>=128&&eb.NonAsciiIdentifierPart.test(String.fromCharCode(a))}function j(a){switch(a){case"class":case"enum":case"export":case"extends":case"import":case"super":return!0;default:return!1}}function k(a){switch(a){case"implements":case"interface":case"package":case"private":case"protected":case"public":case"static":case"yield":case"let":return!0;default:return!1}}function l(a){return"eval"===a||"arguments"===a}function m(a){if(hb&&k(a))return!0;switch(a.length){case 2:return"if"===a||"in"===a||"do"===a;case 3:return"var"===a||"for"===a||"new"===a||"try"===a||"let"===a;case 4:return"this"===a||"else"===a||"case"===a||"void"===a||"with"===a||"enum"===a;case 5:return"while"===a||"break"===a||"catch"===a||"throw"===a||"const"===a||"yield"===a||"class"===a||"super"===a;case 6:return"return"===a||"typeof"===a||"delete"===a||"switch"===a||"export"===a||"import"===a;case 7:return"default"===a||"finally"===a||"extends"===a;case 8:return"function"===a||"continue"===a||"debugger"===a;case 10:return"instanceof"===a;default:return!1}}function n(a,c,d,e,f){var g;b("number"==typeof d,"Comment must have valid position"),ob.lastCommentStart>=d||(ob.lastCommentStart=d,g={type:a,value:c},pb.range&&(g.range=[d,e]),pb.loc&&(g.loc=f),pb.comments.push(g),pb.attachComment&&(pb.leadingComments.push(g),pb.trailingComments.push(g)))}function o(a){var b,c,d,e;for(b=ib-a,c={start:{line:jb,column:ib-kb-a}};ib=lb&&O({},db.UnexpectedToken,"ILLEGAL");else if(42===c){if(47===gb.charCodeAt(ib+1))return++ib,++ib,void(pb.comments&&(d=gb.slice(a+2,ib-2),b.end={line:jb,column:ib-kb},n("Block",d,a,ib,b)));++ib}else++ib;O({},db.UnexpectedToken,"ILLEGAL")}function q(){var a,b;for(b=0===ib;ib>>="===(d=gb.substr(ib,4))?(ib+=4,{type:$a.Punctuator,value:d,lineNumber:jb,lineStart:kb,start:e,end:ib}):">>>"===(c=d.substr(0,3))||"<<="===c||">>="===c?(ib+=3,{type:$a.Punctuator,value:c,lineNumber:jb,lineStart:kb,start:e,end:ib}):(b=c.substr(0,2),g===b[1]&&"+-<>&|".indexOf(g)>=0||"=>"===b?(ib+=2,{type:$a.Punctuator,value:b,lineNumber:jb,lineStart:kb,start:e,end:ib}):"<>=!+-*%&|^/".indexOf(g)>=0?(++ib,{type:$a.Punctuator,value:g,lineNumber:jb,lineStart:kb,start:e,end:ib}):void O({},db.UnexpectedToken,"ILLEGAL"))}function w(a){for(var b="";ib=0&&ib0&&(d=pb.tokens[pb.tokens.length-1],d.range[0]===a&&"Punctuator"===d.type&&("/"!==d.value&&"/="!==d.value||pb.tokens.pop())),pb.tokens.push({type:"RegularExpression",value:c.literal,range:[a,ib],loc:b})),c}function F(a){return a.type===$a.Identifier||a.type===$a.Keyword||a.type===$a.BooleanLiteral||a.type===$a.NullLiteral}function G(){var a,b;if(!(a=pb.tokens[pb.tokens.length-1]))return E();if("Punctuator"===a.type){if("]"===a.value)return v();if(")"===a.value)return b=pb.tokens[pb.openParenToken-1],!b||"Keyword"!==b.type||"if"!==b.value&&"while"!==b.value&&"for"!==b.value&&"with"!==b.value?v():E();if("}"===a.value){if(pb.tokens[pb.openCurlyToken-3]&&"Keyword"===pb.tokens[pb.openCurlyToken-3].type){if(!(b=pb.tokens[pb.openCurlyToken-4]))return v()}else{if(!pb.tokens[pb.openCurlyToken-4]||"Keyword"!==pb.tokens[pb.openCurlyToken-4].type)return v();if(!(b=pb.tokens[pb.openCurlyToken-5]))return E()}return ab.indexOf(b.value)>=0?v():E()}return E()}return"Keyword"===a.type?E():v()}function H(){var a;return q(),ib>=lb?{type:$a.EOF,lineNumber:jb,lineStart:kb,start:ib,end:ib}:(a=gb.charCodeAt(ib),h(a)?u():40===a||41===a||59===a?v():39===a||34===a?z():46===a?c(gb.charCodeAt(ib+1))?y():v():c(a)?y():pb.tokenize&&47===a?G():v())}function I(){var a,b,c;return q(),a={start:{line:jb,column:ib-kb}},b=H(),a.end={line:jb,column:ib-kb},b.type!==$a.EOF&&(c=gb.slice(b.start,b.end),pb.tokens.push({type:_a[b.type],value:c,range:[b.start,b.end],loc:a})),b}function J(){var a;return a=nb,ib=a.end,jb=a.lineNumber,kb=a.lineStart,nb=void 0!==pb.tokens?I():H(),ib=a.end,jb=a.lineNumber,kb=a.lineStart,a}function K(){var a,b,c;a=ib,b=jb,c=kb,nb=void 0!==pb.tokens?I():H(),ib=a,jb=b,kb=c}function L(a,b){this.line=a,this.column=b}function M(a,b,c,d){this.start=new L(a,b),this.end=new L(c,d)}function N(){var a,b,c,d;return a=ib,b=jb,c=kb,q(),d=jb!==b,ib=a,jb=b,kb=c,d}function O(a,c){var d,e=Array.prototype.slice.call(arguments,2),f=c.replace(/%(\d)/g,function(a,c){return b(c>="===a||">>>="===a||"&="===a||"^="===a||"|="===a)}function W(){var a;if(59===gb.charCodeAt(ib)||T(";"))return void J();a=jb,q(),jb===a&&(nb.type===$a.EOF||T("}")||Q(nb))}function X(a){return a.type===bb.Identifier||a.type===bb.MemberExpression}function Y(){var a,b=[];for(a=nb,R("[");!T("]");)T(",")?(J(),b.push(null)):(b.push(pa()),T("]")||R(","));return J(),mb.markEnd(mb.createArrayExpression(b),a)}function Z(a,b){var c,d,e;return c=hb,e=nb,d=Qa(),b&&hb&&l(a[0].name)&&P(b,db.StrictParamName),hb=c,mb.markEnd(mb.createFunctionExpression(null,a,[],d),e)}function $(){var a,b;return b=nb,a=J(),a.type===$a.StringLiteral||a.type===$a.NumericLiteral?(hb&&a.octal&&P(a,db.StrictOctalLiteral),mb.markEnd(mb.createLiteral(a),b)):mb.markEnd(mb.createIdentifier(a.value),b)}function _(){var a,b,c,d,e,f;return a=nb,f=nb,a.type===$a.Identifier?(c=$(),"get"!==a.value||T(":")?"set"!==a.value||T(":")?(R(":"),d=pa(),mb.markEnd(mb.createProperty("init",c,d),f)):(b=$(),R("("),a=nb,a.type!==$a.Identifier?(R(")"),P(a,db.UnexpectedToken,a.value),d=Z([])):(e=[ta()],R(")"),d=Z(e,a)),mb.markEnd(mb.createProperty("set",b,d),f)):(b=$(),R("("),R(")"),d=Z([]),mb.markEnd(mb.createProperty("get",b,d),f))):a.type!==$a.EOF&&a.type!==$a.Punctuator?(b=$(),R(":"),d=pa(),mb.markEnd(mb.createProperty("init",b,d),f)):void Q(a)}function aa(){var a,b,c,d,e,f=[],g={},h=String;for(e=nb,R("{");!T("}");)a=_(),b=a.key.type===bb.Identifier?a.key.name:h(a.key.value),d="init"===a.kind?cb.Data:"get"===a.kind?cb.Get:cb.Set,c="$"+b,Object.prototype.hasOwnProperty.call(g,c)?(g[c]===cb.Data?hb&&d===cb.Data?P({},db.StrictDuplicateProperty):d!==cb.Data&&P({},db.AccessorDataProperty):d===cb.Data?P({},db.AccessorDataProperty):g[c]&d&&P({},db.AccessorGetSet),g[c]|=d):g[c]=d,f.push(a),T("}")||R(",");return R("}"),mb.markEnd(mb.createObjectExpression(f),e)}function ba(){var a;return R("("),a=qa(),R(")"),a}function ca(){var a,b,c,d;if(T("("))return ba();if(T("["))return Y();if(T("{"))return aa();if(a=nb.type,d=nb,a===$a.Identifier)c=mb.createIdentifier(J().value);else if(a===$a.StringLiteral||a===$a.NumericLiteral)hb&&nb.octal&&P(nb,db.StrictOctalLiteral),c=mb.createLiteral(J());else if(a===$a.Keyword){if(U("function"))return Ta();U("this")?(J(),c=mb.createThisExpression()):Q(J())}else a===$a.BooleanLiteral?(b=J(),b.value="true"===b.value,c=mb.createLiteral(b)):a===$a.NullLiteral?(b=J(),b.value=null,c=mb.createLiteral(b)):T("/")||T("/=")?(c=void 0!==pb.tokens?mb.createLiteral(E()):mb.createLiteral(D()),K()):Q(J());return mb.markEnd(c,d)}function da(){var a=[];if(R("("),!T(")"))for(;ib":case"<=":case">=":case"instanceof":c=7;break;case"in":c=b?7:0;break;case"<<":case">>":case">>>":c=8;break;case"+":case"-":c=9;break;case"*":case"/":case"%":c=11}return c}function na(){var a,b,c,d,e,f,g,h,i,j;if(a=nb,i=la(),d=nb,0===(e=ma(d,ob.allowIn)))return i;for(d.prec=e,J(),b=[a,nb],g=la(),f=[i,d,g];(e=ma(nb,ob.allowIn))>0;){for(;f.length>2&&e<=f[f.length-2].prec;)g=f.pop(),h=f.pop().value,i=f.pop(),c=mb.createBinaryExpression(h,i,g),b.pop(),a=b[b.length-1],mb.markEnd(c,a),f.push(c);d=J(),d.prec=e,f.push(d),b.push(nb),c=la(),f.push(c)}for(j=f.length-1,c=f[j],b.pop();j>1;)c=mb.createBinaryExpression(f[j-1].value,f[j-2],c),j-=2,a=b.pop(),mb.markEnd(c,a);return c}function oa(){var a,b,c,d,e;return e=nb,a=na(),T("?")&&(J(),b=ob.allowIn,ob.allowIn=!0,c=pa(),ob.allowIn=b,R(":"),d=pa(),a=mb.createConditionalExpression(a,c,d),mb.markEnd(a,e)),a}function pa(){var a,b,c,d,e;return a=nb,e=nb,d=b=oa(),V()&&(X(b)||P({},db.InvalidLHSInAssignment),hb&&b.type===bb.Identifier&&l(b.name)&&P(a,db.StrictLHSAssignment),a=J(),c=pa(),d=mb.markEnd(mb.createAssignmentExpression(a.value,b,c),e)),d}function qa(){var a,b=nb;if(a=pa(),T(",")){for(a=mb.createSequenceExpression([a]);ib0?1:0,kb=0,lb=gb.length,nb=null,ob={allowIn:!0,labelSet:{},inFunctionBody:!1,inIteration:!1,inSwitch:!1,lastCommentStart:-1},pb={},b=b||{},b.tokens=!0,pb.tokens=[],pb.tokenize=!0,pb.openParenToken=-1,pb.openCurlyToken=-1,pb.range="boolean"==typeof b.range&&b.range,pb.loc="boolean"==typeof b.loc&&b.loc,"boolean"==typeof b.comment&&b.comment&&(pb.comments=[]),"boolean"==typeof b.tolerant&&b.tolerant&&(pb.errors=[]);try{if(K(),nb.type===$a.EOF)return pb.tokens;for(J();nb.type!==$a.EOF;)try{J()}catch(e){if(nb,pb.errors){pb.errors.push(e);break}throw e}Xa(),d=pb.tokens,void 0!==pb.comments&&(d.comments=pb.comments),void 0!==pb.errors&&(d.errors=pb.errors)}catch(f){throw f}finally{pb={}}return d}function Za(a,b){var c,d;d=String,"string"==typeof a||a instanceof String||(a=d(a)),mb=fb,gb=a,ib=0,jb=gb.length>0?1:0,kb=0,lb=gb.length,nb=null,ob={allowIn:!0,labelSet:{},inFunctionBody:!1,inIteration:!1,inSwitch:!1,lastCommentStart:-1},pb={},void 0!==b&&(pb.range="boolean"==typeof b.range&&b.range,pb.loc="boolean"==typeof b.loc&&b.loc,pb.attachComment="boolean"==typeof b.attachComment&&b.attachComment,pb.loc&&null!==b.source&&void 0!==b.source&&(pb.source=d(b.source)),"boolean"==typeof b.tokens&&b.tokens&&(pb.tokens=[]),"boolean"==typeof b.comment&&b.comment&&(pb.comments=[]),"boolean"==typeof b.tolerant&&b.tolerant&&(pb.errors=[]),pb.attachComment&&(pb.range=!0,pb.comments=[],pb.bottomRightStack=[],pb.trailingComments=[],pb.leadingComments=[]));try{c=Wa(),void 0!==pb.comments&&(c.comments=pb.comments),void 0!==pb.tokens&&(Xa(),c.tokens=pb.tokens),void 0!==pb.errors&&(c.errors=pb.errors)}catch(e){throw e}finally{pb={}}return c}var $a,_a,ab,bb,cb,db,eb,fb,gb,hb,ib,jb,kb,lb,mb,nb,ob,pb;$a={BooleanLiteral:1,EOF:2,Identifier:3,Keyword:4,NullLiteral:5,NumericLiteral:6,Punctuator:7,StringLiteral:8,RegularExpression:9},_a={},_a[$a.BooleanLiteral]="Boolean",_a[$a.EOF]="",_a[$a.Identifier]="Identifier",_a[$a.Keyword]="Keyword",_a[$a.NullLiteral]="Null",_a[$a.NumericLiteral]="Numeric",_a[$a.Punctuator]="Punctuator",_a[$a.StringLiteral]="String",_a[$a.RegularExpression]="RegularExpression",ab=["(","{","[","in","typeof","instanceof","new","return","case","delete","throw","void","=","+=","-=","*=","/=","%=","<<=",">>=",">>>=","&=","|=","^=",",","+","-","*","/","%","++","--","<<",">>",">>>","&","|","^","!","~","&&","||","?",":","===","==",">=","<=","<",">","!=","!=="],bb={AssignmentExpression:"AssignmentExpression",ArrayExpression:"ArrayExpression",BlockStatement:"BlockStatement",BinaryExpression:"BinaryExpression",BreakStatement:"BreakStatement",CallExpression:"CallExpression",CatchClause:"CatchClause",ConditionalExpression:"ConditionalExpression",ContinueStatement:"ContinueStatement",DoWhileStatement:"DoWhileStatement",DebuggerStatement:"DebuggerStatement",EmptyStatement:"EmptyStatement",ExpressionStatement:"ExpressionStatement",ForStatement:"ForStatement",ForInStatement:"ForInStatement",FunctionDeclaration:"FunctionDeclaration",FunctionExpression:"FunctionExpression",Identifier:"Identifier",IfStatement:"IfStatement",Literal:"Literal",LabeledStatement:"LabeledStatement",LogicalExpression:"LogicalExpression",MemberExpression:"MemberExpression",NewExpression:"NewExpression",ObjectExpression:"ObjectExpression",Program:"Program",Property:"Property",ReturnStatement:"ReturnStatement",SequenceExpression:"SequenceExpression",SwitchStatement:"SwitchStatement",SwitchCase:"SwitchCase",ThisExpression:"ThisExpression",ThrowStatement:"ThrowStatement",TryStatement:"TryStatement",UnaryExpression:"UnaryExpression",UpdateExpression:"UpdateExpression",VariableDeclaration:"VariableDeclaration",VariableDeclarator:"VariableDeclarator",WhileStatement:"WhileStatement",WithStatement:"WithStatement"},cb={Data:1,Get:2,Set:4},db={UnexpectedToken:"Unexpected token %0",UnexpectedNumber:"Unexpected number",UnexpectedString:"Unexpected string",UnexpectedIdentifier:"Unexpected identifier",UnexpectedReserved:"Unexpected reserved word",UnexpectedEOS:"Unexpected end of input",NewlineAfterThrow:"Illegal newline after throw",InvalidRegExp:"Invalid regular expression",UnterminatedRegExp:"Invalid regular expression: missing /",InvalidLHSInAssignment:"Invalid left-hand side in assignment",InvalidLHSInForIn:"Invalid left-hand side in for-in",MultipleDefaultsInSwitch:"More than one default clause in switch statement",NoCatchOrFinally:"Missing catch or finally after try",UnknownLabel:"Undefined label '%0'",Redeclaration:"%0 '%1' has already been declared",IllegalContinue:"Illegal continue statement",IllegalBreak:"Illegal break statement",IllegalReturn:"Illegal return statement",StrictModeWith:"Strict mode code may not include a with statement",StrictCatchVariable:"Catch variable may not be eval or arguments in strict mode",StrictVarName:"Variable name may not be eval or arguments in strict mode",StrictParamName:"Parameter name eval or arguments is not allowed in strict mode",StrictParamDupe:"Strict mode function may not have duplicate parameter names",StrictFunctionName:"Function name may not be eval or arguments in strict mode",StrictOctalLiteral:"Octal literals are not allowed in strict mode.",StrictDelete:"Delete of an unqualified identifier in strict mode.",StrictDuplicateProperty:"Duplicate data property in object literal not allowed in strict mode", -AccessorDataProperty:"Object literal may not have data and accessor property with the same name",AccessorGetSet:"Object literal may not have multiple get/set accessors with the same name",StrictLHSAssignment:"Assignment to eval or arguments is not allowed in strict mode",StrictLHSPostfix:"Postfix increment/decrement may not have eval or arguments operand in strict mode",StrictLHSPrefix:"Prefix increment/decrement may not have eval or arguments operand in strict mode",StrictReservedWord:"Use of future reserved word in strict mode"},eb={NonAsciiIdentifierStart:new RegExp("[ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԧԱ-Ֆՙա-ևא-תװ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࢠࢢ-ࢬऄ-हऽॐक़-ॡॱ-ॷॹ-ॿঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-ళవ-హఽౘౙౠౡಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽೞೠೡೱೲഅ-ഌഎ-ഐഒ-ഺഽൎൠൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄງຈຊຍດ-ທນ-ຟມ-ຣລວສຫອ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏼᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛰᜀ-ᜌᜎ-ᜑᜠ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡷᢀ-ᢨᢪᢰ-ᣵᤀ-ᤜᥐ-ᥭᥰ-ᥴᦀ-ᦫᧁ-ᧇᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭋᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᳩ-ᳬᳮ-ᳱᳵᳶᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-Ⱞⰰ-ⱞⱠ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞⸯ々-〇〡-〩〱-〵〸-〼ぁ-ゖゝ-ゟァ-ヺー-ヿㄅ-ㄭㄱ-ㆎㆠ-ㆺㇰ-ㇿ㐀-䶵一-鿌ꀀ-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚗꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ-ꞎꞐ-ꞓꞠ-Ɦꟸ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꪀ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꯀ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ]"),NonAsciiIdentifierPart:new RegExp("[ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮ̀-ʹͶͷͺ-ͽΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁ҃-҇Ҋ-ԧԱ-Ֆՙա-և֑-ׇֽֿׁׂׅׄא-תװ-ײؐ-ؚؠ-٩ٮ-ۓە-ۜ۟-۪ۨ-ۼۿܐ-݊ݍ-ޱ߀-ߵߺࠀ-࠭ࡀ-࡛ࢠࢢ-ࢬࣤ-ࣾऀ-ॣ०-९ॱ-ॷॹ-ॿঁ-ঃঅ-ঌএঐও-নপ-রলশ-হ়-ৄেৈো-ৎৗড়ঢ়য়-ৣ০-ৱਁ-ਃਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹ਼ਾ-ੂੇੈੋ-੍ੑਖ਼-ੜਫ਼੦-ੵઁ-ઃઅ-ઍએ-ઑઓ-નપ-રલળવ-હ઼-ૅે-ૉો-્ૐૠ-ૣ૦-૯ଁ-ଃଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହ଼-ୄେୈୋ-୍ୖୗଡ଼ଢ଼ୟ-ୣ୦-୯ୱஂஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹா-ூெ-ைொ-்ௐௗ௦-௯ఁ-ఃఅ-ఌఎ-ఐఒ-నప-ళవ-హఽ-ౄె-ైొ-్ౕౖౘౙౠ-ౣ౦-౯ಂಃಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹ಼-ೄೆ-ೈೊ-್ೕೖೞೠ-ೣ೦-೯ೱೲംഃഅ-ഌഎ-ഐഒ-ഺഽ-ൄെ-ൈൊ-ൎൗൠ-ൣ൦-൯ൺ-ൿංඃඅ-ඖක-නඳ-රලව-ෆ්ා-ුූෘ-ෟෲෳก-ฺเ-๎๐-๙ກຂຄງຈຊຍດ-ທນ-ຟມ-ຣລວສຫອ-ູົ-ຽເ-ໄໆ່-ໍ໐-໙ໜ-ໟༀ༘༙༠-༩༹༵༷༾-ཇཉ-ཬཱ-྄྆-ྗྙ-ྼ࿆က-၉ၐ-ႝႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚ፝-፟ᎀ-ᎏᎠ-Ᏼᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛰᜀ-ᜌᜎ-᜔ᜠ-᜴ᝀ-ᝓᝠ-ᝬᝮ-ᝰᝲᝳក-៓ៗៜ៝០-៩᠋-᠍᠐-᠙ᠠ-ᡷᢀ-ᢪᢰ-ᣵᤀ-ᤜᤠ-ᤫᤰ-᤻᥆-ᥭᥰ-ᥴᦀ-ᦫᦰ-ᧉ᧐-᧙ᨀ-ᨛᨠ-ᩞ᩠-᩿᩼-᪉᪐-᪙ᪧᬀ-ᭋ᭐-᭙᭫-᭳ᮀ-᯳ᰀ-᰷᱀-᱉ᱍ-ᱽ᳐-᳔᳒-ᳶᴀ-ᷦ᷼-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼ‌‍‿⁀⁔ⁱⁿₐ-ₜ⃐-⃥⃜⃡-⃰ℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-Ⱞⰰ-ⱞⱠ-ⳤⳫ-ⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯ⵿-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞⷠ-ⷿⸯ々-〇〡-〯〱-〵〸-〼ぁ-ゖ゙゚ゝ-ゟァ-ヺー-ヿㄅ-ㄭㄱ-ㆎㆠ-ㆺㇰ-ㇿ㐀-䶵一-鿌ꀀ-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘫꙀ-꙯ꙴ-꙽ꙿ-ꚗꚟ-꛱ꜗ-ꜟꜢ-ꞈꞋ-ꞎꞐ-ꞓꞠ-Ɦꟸ-ꠧꡀ-ꡳꢀ-꣄꣐-꣙꣠-ꣷꣻ꤀-꤭ꤰ-꥓ꥠ-ꥼꦀ-꧀ꧏ-꧙ꨀ-ꨶꩀ-ꩍ꩐-꩙ꩠ-ꩶꩺꩻꪀ-ꫂꫛ-ꫝꫠ-ꫯꫲ-꫶ꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꯀ-ꯪ꯬꯭꯰-꯹가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻ︀-️︠-︦︳︴﹍-﹏ﹰ-ﹴﹶ-ﻼ0-9A-Z_a-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ]")},fb={name:"SyntaxTree",processComment:function(a){var b,c;if(!(a.type===bb.Program&&a.body.length>0)){for(pb.trailingComments.length>0?pb.trailingComments[0].range[0]>=a.range[1]?(c=pb.trailingComments,pb.trailingComments=[]):pb.trailingComments.length=0:pb.bottomRightStack.length>0&&pb.bottomRightStack[pb.bottomRightStack.length-1].trailingComments&&pb.bottomRightStack[pb.bottomRightStack.length-1].trailingComments[0].range[0]>=a.range[1]&&(c=pb.bottomRightStack[pb.bottomRightStack.length-1].trailingComments,delete pb.bottomRightStack[pb.bottomRightStack.length-1].trailingComments);pb.bottomRightStack.length>0&&pb.bottomRightStack[pb.bottomRightStack.length-1].range[0]>=a.range[0];)b=pb.bottomRightStack.pop();b?b.leadingComments&&b.leadingComments[b.leadingComments.length-1].range[1]<=a.range[0]&&(a.leadingComments=b.leadingComments,delete b.leadingComments):pb.leadingComments.length>0&&pb.leadingComments[pb.leadingComments.length-1].range[1]<=a.range[0]&&(a.leadingComments=pb.leadingComments,pb.leadingComments=[]),c&&(a.trailingComments=c),pb.bottomRightStack.push(a)}},markEnd:function(a,b){return pb.range&&(a.range=[b.start,ib]),pb.loc&&(a.loc=new M(void 0===b.startLineNumber?b.lineNumber:b.startLineNumber,b.start-(void 0===b.startLineStart?b.lineStart:b.startLineStart),jb,ib-kb),this.postProcess(a)),pb.attachComment&&this.processComment(a),a},postProcess:function(a){return pb.source&&(a.loc.source=pb.source),a},createArrayExpression:function(a){return{type:bb.ArrayExpression,elements:a}},createAssignmentExpression:function(a,b,c){return{type:bb.AssignmentExpression,operator:a,left:b,right:c}},createBinaryExpression:function(a,b,c){return{type:"||"===a||"&&"===a?bb.LogicalExpression:bb.BinaryExpression,operator:a,left:b,right:c}},createBlockStatement:function(a){return{type:bb.BlockStatement,body:a}},createBreakStatement:function(a){return{type:bb.BreakStatement,label:a}},createCallExpression:function(a,b){return{type:bb.CallExpression,callee:a,arguments:b}},createCatchClause:function(a,b){return{type:bb.CatchClause,param:a,body:b}},createConditionalExpression:function(a,b,c){return{type:bb.ConditionalExpression,test:a,consequent:b,alternate:c}},createContinueStatement:function(a){return{type:bb.ContinueStatement,label:a}},createDebuggerStatement:function(){return{type:bb.DebuggerStatement}},createDoWhileStatement:function(a,b){return{type:bb.DoWhileStatement,body:a,test:b}},createEmptyStatement:function(){return{type:bb.EmptyStatement}},createExpressionStatement:function(a){return{type:bb.ExpressionStatement,expression:a}},createForStatement:function(a,b,c,d){return{type:bb.ForStatement,init:a,test:b,update:c,body:d}},createForInStatement:function(a,b,c){return{type:bb.ForInStatement,left:a,right:b,body:c,each:!1}},createFunctionDeclaration:function(a,b,c,d){return{type:bb.FunctionDeclaration,id:a,params:b,defaults:c,body:d,rest:null,generator:!1,expression:!1}},createFunctionExpression:function(a,b,c,d){return{type:bb.FunctionExpression,id:a,params:b,defaults:c,body:d,rest:null,generator:!1,expression:!1}},createIdentifier:function(a){return{type:bb.Identifier,name:a}},createIfStatement:function(a,b,c){return{type:bb.IfStatement,test:a,consequent:b,alternate:c}},createLabeledStatement:function(a,b){return{type:bb.LabeledStatement,label:a,body:b}},createLiteral:function(a){return{type:bb.Literal,value:a.value,raw:gb.slice(a.start,a.end)}},createMemberExpression:function(a,b,c){return{type:bb.MemberExpression,computed:"["===a,object:b,property:c}},createNewExpression:function(a,b){return{type:bb.NewExpression,callee:a,arguments:b}},createObjectExpression:function(a){return{type:bb.ObjectExpression,properties:a}},createPostfixExpression:function(a,b){return{type:bb.UpdateExpression,operator:a,argument:b,prefix:!1}},createProgram:function(a){return{type:bb.Program,body:a}},createProperty:function(a,b,c){return{type:bb.Property,key:b,value:c,kind:a}},createReturnStatement:function(a){return{type:bb.ReturnStatement,argument:a}},createSequenceExpression:function(a){return{type:bb.SequenceExpression,expressions:a}},createSwitchCase:function(a,b){return{type:bb.SwitchCase,test:a,consequent:b}},createSwitchStatement:function(a,b){return{type:bb.SwitchStatement,discriminant:a,cases:b}},createThisExpression:function(){return{type:bb.ThisExpression}},createThrowStatement:function(a){return{type:bb.ThrowStatement,argument:a}},createTryStatement:function(a,b,c,d){return{type:bb.TryStatement,block:a,guardedHandlers:b,handlers:c,finalizer:d}},createUnaryExpression:function(a,b){return"++"===a||"--"===a?{type:bb.UpdateExpression,operator:a,argument:b,prefix:!0}:{type:bb.UnaryExpression,operator:a,argument:b,prefix:!0}},createVariableDeclaration:function(a,b){return{type:bb.VariableDeclaration,declarations:a,kind:b}},createVariableDeclarator:function(a,b){return{type:bb.VariableDeclarator,id:a,init:b}},createWhileStatement:function(a,b){return{type:bb.WhileStatement,test:a,body:b}},createWithStatement:function(a,b){return{type:bb.WithStatement,object:a,body:b}}},a.version="1.2.2",a.tokenize=Ya,a.parse=Za,a.Syntax=function(){var a,b={};"function"==typeof Object.create&&(b=Object.create(null));for(a in bb)bb.hasOwnProperty(a)&&(b[a]=bb[a]);return"function"==typeof Object.freeze&&Object.freeze(b),b}()})},{}],1:[function(a,b,c){(function(d){var e=function(){function a(){this.yy={}}var b={trace:function(){},yy:{},symbols_:{error:2,JSON_PATH:3,DOLLAR:4,PATH_COMPONENTS:5,LEADING_CHILD_MEMBER_EXPRESSION:6,PATH_COMPONENT:7,MEMBER_COMPONENT:8,SUBSCRIPT_COMPONENT:9,CHILD_MEMBER_COMPONENT:10,DESCENDANT_MEMBER_COMPONENT:11,DOT:12,MEMBER_EXPRESSION:13,DOT_DOT:14,STAR:15,IDENTIFIER:16,SCRIPT_EXPRESSION:17,INTEGER:18,END:19,CHILD_SUBSCRIPT_COMPONENT:20,DESCENDANT_SUBSCRIPT_COMPONENT:21,"[":22,SUBSCRIPT:23,"]":24,SUBSCRIPT_EXPRESSION:25,SUBSCRIPT_EXPRESSION_LIST:26,SUBSCRIPT_EXPRESSION_LISTABLE:27,",":28,STRING_LITERAL:29,ARRAY_SLICE:30,FILTER_EXPRESSION:31,QQ_STRING:32,Q_STRING:33,$accept:0,$end:1},terminals_:{2:"error",4:"DOLLAR",12:"DOT",14:"DOT_DOT",15:"STAR",16:"IDENTIFIER",17:"SCRIPT_EXPRESSION",18:"INTEGER",19:"END",22:"[",24:"]",28:",",30:"ARRAY_SLICE",31:"FILTER_EXPRESSION",32:"QQ_STRING",33:"Q_STRING"},productions_:[0,[3,1],[3,2],[3,1],[3,2],[5,1],[5,2],[7,1],[7,1],[8,1],[8,1],[10,2],[6,1],[11,2],[13,1],[13,1],[13,1],[13,1],[13,1],[9,1],[9,1],[20,3],[21,4],[23,1],[23,1],[26,1],[26,3],[27,1],[27,1],[27,1],[25,1],[25,1],[25,1],[29,1],[29,1]],performAction:function(a,b,d,e,f,g,h){e.ast||(e.ast=c,c.initialize());var i=g.length-1;switch(f){case 1:return e.ast.set({expression:{type:"root",value:g[i]}}),e.ast.unshift(),e.ast.yield();case 2:return e.ast.set({expression:{type:"root",value:g[i-1]}}),e.ast.unshift(),e.ast.yield();case 3:return e.ast.unshift(),e.ast.yield();case 4:return e.ast.set({operation:"member",scope:"child",expression:{type:"identifier",value:g[i-1]}}),e.ast.unshift(),e.ast.yield();case 5:case 6:break;case 7:e.ast.set({operation:"member"}),e.ast.push();break;case 8:e.ast.set({operation:"subscript"}),e.ast.push();break;case 9:e.ast.set({scope:"child"});break;case 10:e.ast.set({scope:"descendant"});break;case 11:break;case 12:e.ast.set({scope:"child",operation:"member"});break;case 13:break;case 14:e.ast.set({expression:{type:"wildcard",value:g[i]}});break;case 15:e.ast.set({expression:{type:"identifier",value:g[i]}});break;case 16:e.ast.set({expression:{type:"script_expression",value:g[i]}});break;case 17:e.ast.set({expression:{type:"numeric_literal",value:parseInt(g[i])}});break;case 18:break;case 19:e.ast.set({scope:"child"});break;case 20:e.ast.set({scope:"descendant"});break;case 21:case 22:case 23:break;case 24:g[i].length>1?e.ast.set({expression:{type:"union",value:g[i]}}):this.$=g[i];break;case 25:this.$=[g[i]];break;case 26:this.$=g[i-2].concat(g[i]);break;case 27:this.$={expression:{type:"numeric_literal",value:parseInt(g[i])}},e.ast.set(this.$);break;case 28:this.$={expression:{type:"string_literal",value:g[i]}},e.ast.set(this.$);break;case 29:this.$={expression:{type:"slice",value:g[i]}},e.ast.set(this.$);break;case 30:this.$={expression:{type:"wildcard",value:g[i]}},e.ast.set(this.$);break;case 31:this.$={expression:{type:"script_expression",value:g[i]}},e.ast.set(this.$);break;case 32:this.$={expression:{type:"filter_expression",value:g[i]}},e.ast.set(this.$);break;case 33:case 34:this.$=g[i]}},table:[{3:1,4:[1,2],6:3,13:4,15:[1,5],16:[1,6],17:[1,7],18:[1,8],19:[1,9]},{1:[3]},{1:[2,1],5:10,7:11,8:12,9:13,10:14,11:15,12:[1,18],14:[1,19],20:16,21:17,22:[1,20]},{1:[2,3],5:21,7:11,8:12,9:13,10:14,11:15,12:[1,18],14:[1,19],20:16,21:17,22:[1,20]},{1:[2,12],12:[2,12],14:[2,12],22:[2,12]},{1:[2,14],12:[2,14],14:[2,14],22:[2,14]},{1:[2,15],12:[2,15],14:[2,15],22:[2,15]},{1:[2,16],12:[2,16],14:[2,16],22:[2,16]},{1:[2,17],12:[2,17],14:[2,17],22:[2,17]},{1:[2,18],12:[2,18],14:[2,18],22:[2,18]},{1:[2,2],7:22,8:12,9:13,10:14,11:15,12:[1,18],14:[1,19],20:16,21:17,22:[1,20]},{1:[2,5],12:[2,5],14:[2,5],22:[2,5]},{1:[2,7],12:[2,7],14:[2,7],22:[2,7]},{1:[2,8],12:[2,8],14:[2,8],22:[2,8]},{1:[2,9],12:[2,9],14:[2,9],22:[2,9]},{1:[2,10],12:[2,10],14:[2,10],22:[2,10]},{1:[2,19],12:[2,19],14:[2,19],22:[2,19]},{1:[2,20],12:[2,20],14:[2,20],22:[2,20]},{13:23,15:[1,5],16:[1,6],17:[1,7],18:[1,8],19:[1,9]},{13:24,15:[1,5],16:[1,6],17:[1,7],18:[1,8],19:[1,9],22:[1,25]},{15:[1,29],17:[1,30],18:[1,33],23:26,25:27,26:28,27:32,29:34,30:[1,35],31:[1,31],32:[1,36],33:[1,37]},{1:[2,4],7:22,8:12,9:13,10:14,11:15,12:[1,18],14:[1,19],20:16,21:17,22:[1,20]},{1:[2,6],12:[2,6],14:[2,6],22:[2,6]},{1:[2,11],12:[2,11],14:[2,11],22:[2,11]},{1:[2,13],12:[2,13],14:[2,13],22:[2,13]},{15:[1,29],17:[1,30],18:[1,33],23:38,25:27,26:28,27:32,29:34,30:[1,35],31:[1,31],32:[1,36],33:[1,37]},{24:[1,39]},{24:[2,23]},{24:[2,24],28:[1,40]},{24:[2,30]},{24:[2,31]},{24:[2,32]},{24:[2,25],28:[2,25]},{24:[2,27],28:[2,27]},{24:[2,28],28:[2,28]},{24:[2,29],28:[2,29]},{24:[2,33],28:[2,33]},{24:[2,34],28:[2,34]},{24:[1,41]},{1:[2,21],12:[2,21],14:[2,21],22:[2,21]},{18:[1,33],27:42,29:34,30:[1,35],32:[1,36],33:[1,37]},{1:[2,22],12:[2,22],14:[2,22],22:[2,22]},{24:[2,26],28:[2,26]}],defaultActions:{27:[2,23],29:[2,30],30:[2,31],31:[2,32]},parseError:function(a,b){if(!b.recoverable)throw new Error(a);this.trace(a)},parse:function(a){function b(){var a;return a=c.lexer.lex()||m,"number"!=typeof a&&(a=c.symbols_[a]||a),a}var c=this,d=[0],e=[null],f=[],g=this.table,h="",i=0,j=0,k=0,l=2,m=1,n=f.slice.call(arguments,1);this.lexer.setInput(a),this.lexer.yy=this.yy,this.yy.lexer=this.lexer,this.yy.parser=this,void 0===this.lexer.yylloc&&(this.lexer.yylloc={});var o=this.lexer.yylloc;f.push(o);var p=this.lexer.options&&this.lexer.options.ranges;"function"==typeof this.yy.parseError?this.parseError=this.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;for(var q,r,s,t,u,v,w,x,y,z={};;){if(s=d[d.length-1],this.defaultActions[s]?t=this.defaultActions[s]:(null!==q&&void 0!==q||(q=b()),t=g[s]&&g[s][q]),void 0===t||!t.length||!t[0]){var A="";y=[];for(v in g[s])this.terminals_[v]&&v>l&&y.push("'"+this.terminals_[v]+"'");A=this.lexer.showPosition?"Parse error on line "+(i+1)+":\n"+this.lexer.showPosition()+"\nExpecting "+y.join(", ")+", got '"+(this.terminals_[q]||q)+"'":"Parse error on line "+(i+1)+": Unexpected "+(q==m?"end of input":"'"+(this.terminals_[q]||q)+"'"),this.parseError(A,{text:this.lexer.match,token:this.terminals_[q]||q,line:this.lexer.yylineno,loc:o,expected:y})}if(t[0]instanceof Array&&t.length>1)throw new Error("Parse Error: multiple actions possible at state: "+s+", token: "+q);switch(t[0]){case 1:d.push(q),e.push(this.lexer.yytext),f.push(this.lexer.yylloc),d.push(t[1]),q=null,r?(q=r,r=null):(j=this.lexer.yyleng,h=this.lexer.yytext,i=this.lexer.yylineno,o=this.lexer.yylloc,k>0&&k--);break;case 2:if(w=this.productions_[t[1]][1],z.$=e[e.length-w],z._$={first_line:f[f.length-(w||1)].first_line,last_line:f[f.length-1].last_line,first_column:f[f.length-(w||1)].first_column,last_column:f[f.length-1].last_column},p&&(z._$.range=[f[f.length-(w||1)].range[0],f[f.length-1].range[1]]),void 0!==(u=this.performAction.apply(z,[h,j,i,this.yy,t[1],e,f].concat(n))))return u;w&&(d=d.slice(0,-1*w*2),e=e.slice(0,-1*w),f=f.slice(0,-1*w)),d.push(this.productions_[t[1]][0]),e.push(z.$),f.push(z._$),x=g[d[d.length-2]][d[d.length-1]],d.push(x);break;case 3:return!0}}return!0}},c={initialize:function(){this._nodes=[],this._node={},this._stash=[]},set:function(a){for(var b in a)this._node[b]=a[b];return this._node},node:function(a){return arguments.length&&(this._node=a),this._node},push:function(){this._nodes.push(this._node),this._node={}},unshift:function(){this._nodes.unshift(this._node),this._node={}},yield:function(){var a=this._nodes;return this.initialize(),a}},d=function(){return{EOF:1,parseError:function(a,b){if(!this.yy.parser)throw new Error(a);this.yy.parser.parseError(a,b)},setInput:function(a){return this._input=a,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var a=this._input[0];return this.yytext+=a,this.yyleng++,this.offset++,this.match+=a,this.matched+=a,a.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),a},unput:function(a){var b=a.length,c=a.split(/(?:\r\n?|\n)/g);this._input=a+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-b-1),this.offset-=b;var d=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),c.length-1&&(this.yylineno-=c.length-1);var e=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:c?(c.length===d.length?this.yylloc.first_column:0)+d[d.length-c.length].length-c[0].length:this.yylloc.first_column-b},this.options.ranges&&(this.yylloc.range=[e[0],e[0]+this.yyleng-b]),this.yyleng=this.yytext.length,this},more:function(){return this._more=!0,this},reject:function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},less:function(a){this.unput(this.match.slice(a))},pastInput:function(){var a=this.matched.substr(0,this.matched.length-this.match.length);return(a.length>20?"...":"")+a.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var a=this.match;return a.length<20&&(a+=this._input.substr(0,20-a.length)),(a.substr(0,20)+(a.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var a=this.pastInput(),b=new Array(a.length+1).join("-");return a+this.upcomingInput()+"\n"+b+"^"},test_match:function(a,b){var c,d,e;if(this.options.backtrack_lexer&&(e={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(e.yylloc.range=this.yylloc.range.slice(0))),d=a[0].match(/(?:\r\n?|\n).*/g),d&&(this.yylineno+=d.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:d?d[d.length-1].length-d[d.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+a[0].length},this.yytext+=a[0],this.match+=a[0],this.matches=a,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(a[0].length),this.matched+=a[0],c=this.performAction.call(this,this.yy,this,b,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),c)return c;if(this._backtrack){for(var f in e)this[f]=e[f];return!1}return!1},next:function(){if(this.done)return this.EOF;this._input||(this.done=!0);var a,b,c,d;this._more||(this.yytext="",this.match="");for(var e=this._currentRules(),f=0;fb[0].length)){if(b=c,d=f,this.options.backtrack_lexer){if(!1!==(a=this.test_match(c,e[f])))return a;if(this._backtrack){b=!1;continue}return!1}if(!this.options.flex)break}return b?!1!==(a=this.test_match(b,e[d]))&&a:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var a=this.next();return a||this.lex()},begin:function(a){this.conditionStack.push(a)},popState:function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},_currentRules:function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},topState:function(a){return a=this.conditionStack.length-1-Math.abs(a||0),a>=0?this.conditionStack[a]:"INITIAL"},pushState:function(a){this.begin(a)},stateStackSize:function(){return this.conditionStack.length},options:{},performAction:function(a,b,c,d){switch(c){case 0:return 4;case 1:return 14;case 2:return 12;case 3:return 15;case 4:return 16;case 5:return 22;case 6:return 24;case 7:return 28;case 8:return 30;case 9:return 18;case 10:return b.yytext=b.yytext.substr(1,b.yyleng-2),32;case 11:return b.yytext=b.yytext.substr(1,b.yyleng-2),33;case 12:return 17;case 13:return 31}},rules:[/^(?:\$)/,/^(?:\.\.)/,/^(?:\.)/,/^(?:\*)/,/^(?:[a-zA-Z_]+[a-zA-Z0-9_]*)/,/^(?:\[)/,/^(?:\])/,/^(?:,)/,/^(?:((-?(?:0|[1-9][0-9]*)))?\:((-?(?:0|[1-9][0-9]*)))?(\:((-?(?:0|[1-9][0-9]*)))?)?)/,/^(?:(-?(?:0|[1-9][0-9]*)))/,/^(?:"(?:\\["bfnrt\/\\]|\\u[a-fA-F0-9]{4}|[^"\\])*")/,/^(?:'(?:\\['bfnrt\/\\]|\\u[a-fA-F0-9]{4}|[^'\\])*')/,/^(?:\(.+?\)(?=\]))/,/^(?:\?\(.+?\)(?=\]))/],conditions:{INITIAL:{rules:[0,1,2,3,4,5,6,7,8,9,10,11,12,13],inclusive:!0}}}}();return b.lexer=d,a.prototype=b,b.Parser=a,new a}();void 0!==a&&void 0!==c&&(c.parser=e,c.Parser=e.Parser,c.parse=function(){return e.parse.apply(e,arguments)},c.main=function(b){b[1]||(console.log("Usage: "+b[0]+" FILE"),d.exit(1));var e=a("fs").readFileSync(a("path").normalize(b[1]),"utf8");return c.parser.parse(e)},void 0!==b&&a.main===b&&c.main(d.argv.slice(1)))}).call(this,a("_process"))},{_process:14,fs:12,path:13}],2:[function(a,b,c){b.exports={identifier:"[a-zA-Z_]+[a-zA-Z0-9_]*",integer:"-?(?:0|[1-9][0-9]*)",qq_string:'"(?:\\\\["bfnrt/\\\\]|\\\\u[a-fA-F0-9]{4}|[^"\\\\])*"',q_string:"'(?:\\\\['bfnrt/\\\\]|\\\\u[a-fA-F0-9]{4}|[^'\\\\])*'"}},{}],3:[function(a,b,c){var d=a("./dict"),e=a("fs"),f={lex:{macros:{esc:"\\\\",int:d.integer},rules:[["\\$","return 'DOLLAR'"],["\\.\\.","return 'DOT_DOT'"],["\\.","return 'DOT'"],["\\*","return 'STAR'"],[d.identifier,"return 'IDENTIFIER'"],["\\[","return '['"],["\\]","return ']'"],[",","return ','"],["({int})?\\:({int})?(\\:({int})?)?","return 'ARRAY_SLICE'"],["{int}","return 'INTEGER'"],[d.qq_string,"yytext = yytext.substr(1,yyleng-2); return 'QQ_STRING';"],[d.q_string,"yytext = yytext.substr(1,yyleng-2); return 'Q_STRING';"],["\\(.+?\\)(?=\\])","return 'SCRIPT_EXPRESSION'"],["\\?\\(.+?\\)(?=\\])","return 'FILTER_EXPRESSION'"]]},start:"JSON_PATH",bnf:{JSON_PATH:[["DOLLAR",'yy.ast.set({ expression: { type: "root", value: $1 } }); yy.ast.unshift(); return yy.ast.yield()'],["DOLLAR PATH_COMPONENTS",'yy.ast.set({ expression: { type: "root", value: $1 } }); yy.ast.unshift(); return yy.ast.yield()'],["LEADING_CHILD_MEMBER_EXPRESSION","yy.ast.unshift(); return yy.ast.yield()"],["LEADING_CHILD_MEMBER_EXPRESSION PATH_COMPONENTS",'yy.ast.set({ operation: "member", scope: "child", expression: { type: "identifier", value: $1 }}); yy.ast.unshift(); return yy.ast.yield()']],PATH_COMPONENTS:[["PATH_COMPONENT",""],["PATH_COMPONENTS PATH_COMPONENT",""]],PATH_COMPONENT:[["MEMBER_COMPONENT",'yy.ast.set({ operation: "member" }); yy.ast.push()'],["SUBSCRIPT_COMPONENT",'yy.ast.set({ operation: "subscript" }); yy.ast.push() ']],MEMBER_COMPONENT:[["CHILD_MEMBER_COMPONENT",'yy.ast.set({ scope: "child" })'],["DESCENDANT_MEMBER_COMPONENT",'yy.ast.set({ scope: "descendant" })']],CHILD_MEMBER_COMPONENT:[["DOT MEMBER_EXPRESSION",""]],LEADING_CHILD_MEMBER_EXPRESSION:[["MEMBER_EXPRESSION",'yy.ast.set({ scope: "child", operation: "member" })']],DESCENDANT_MEMBER_COMPONENT:[["DOT_DOT MEMBER_EXPRESSION",""]],MEMBER_EXPRESSION:[["STAR",'yy.ast.set({ expression: { type: "wildcard", value: $1 } })'],["IDENTIFIER",'yy.ast.set({ expression: { type: "identifier", value: $1 } })'],["SCRIPT_EXPRESSION",'yy.ast.set({ expression: { type: "script_expression", value: $1 } })'],["INTEGER",'yy.ast.set({ expression: { type: "numeric_literal", value: parseInt($1) } })'],["END",""]],SUBSCRIPT_COMPONENT:[["CHILD_SUBSCRIPT_COMPONENT",'yy.ast.set({ scope: "child" })'],["DESCENDANT_SUBSCRIPT_COMPONENT",'yy.ast.set({ scope: "descendant" })']],CHILD_SUBSCRIPT_COMPONENT:[["[ SUBSCRIPT ]",""]],DESCENDANT_SUBSCRIPT_COMPONENT:[["DOT_DOT [ SUBSCRIPT ]",""]],SUBSCRIPT:[["SUBSCRIPT_EXPRESSION",""],["SUBSCRIPT_EXPRESSION_LIST",'$1.length > 1? yy.ast.set({ expression: { type: "union", value: $1 } }) : $$ = $1']],SUBSCRIPT_EXPRESSION_LIST:[["SUBSCRIPT_EXPRESSION_LISTABLE","$$ = [$1]"],["SUBSCRIPT_EXPRESSION_LIST , SUBSCRIPT_EXPRESSION_LISTABLE","$$ = $1.concat($3)"]],SUBSCRIPT_EXPRESSION_LISTABLE:[["INTEGER",'$$ = { expression: { type: "numeric_literal", value: parseInt($1) } }; yy.ast.set($$)'],["STRING_LITERAL",'$$ = { expression: { type: "string_literal", value: $1 } }; yy.ast.set($$)'],["ARRAY_SLICE",'$$ = { expression: { type: "slice", value: $1 } }; yy.ast.set($$)']],SUBSCRIPT_EXPRESSION:[["STAR",'$$ = { expression: { type: "wildcard", value: $1 } }; yy.ast.set($$)'],["SCRIPT_EXPRESSION",'$$ = { expression: { type: "script_expression", value: $1 } }; yy.ast.set($$)'],["FILTER_EXPRESSION",'$$ = { expression: { type: "filter_expression", value: $1 } }; yy.ast.set($$)']],STRING_LITERAL:[["QQ_STRING","$$ = $1"],["Q_STRING","$$ = $1"]]}};e.readFileSync&&(f.moduleInclude=e.readFileSync(a.resolve("../include/module.js")),f.actionInclude=e.readFileSync(a.resolve("../include/action.js"))),b.exports=f},{"./dict":2,fs:12}],4:[function(a,b,c){function d(b,c,d){var e=a("./index"),f=m.parse(c).body[0].expression,g=j(f,{"@":b.value}),h=d.replace(/\{\{\s*value\s*\}\}/g,g),i=e.nodes(b.value,h);return i.forEach(function(a){a.path=b.path.concat(a.path.slice(1))}),i}function e(a){return Array.isArray(a)}function f(a){return a&&!(a instanceof Array)&&a instanceof Object}function g(a){return function(b,c,d,g){var h=b.value,i=b.path,j=[],k=function(b,h){e(b)?(b.forEach(function(a,b){j.length>=g||d(b,a,c)&&j.push({path:h.concat(b),value:a})}),b.forEach(function(b,c){j.length>=g||a&&k(b,h.concat(c))})):f(b)&&(this.keys(b).forEach(function(a){j.length>=g||d(a,b[a],c)&&j.push({path:h.concat(a),value:b[a]})}),this.keys(b).forEach(function(c){j.length>=g||a&&k(b[c],h.concat(c))}))}.bind(this);return k(h,i),j}}function h(a){return function(b,c,d){return this.descend(c,b.expression.value,a,d)}}function i(a){return function(b,c,d){return this.traverse(c,b.expression.value,a,d)}}function j(){try{return o.apply(this,arguments)}catch(a){}}function k(a){return a=a.filter(function(a){return a}),p(a,function(a){return a.path.map(function(a){return String(a).replace("-","--")}).join("-")})}function l(a){var b=String(a);return b.match(/^-?[0-9]+$/)?parseInt(b):null}var m=a("./aesprim"),n=a("./slice"),o=a("static-eval"),p=a("underscore").uniq,q=function(){return this.initialize.apply(this,arguments)};q.prototype.initialize=function(){this.traverse=g(!0),this.descend=g()},q.prototype.keys=Object.keys,q.prototype.resolve=function(a){var b=[a.operation,a.scope,a.expression.type].join("-"),c=this._fns[b];if(!c)throw new Error("couldn't resolve key: "+b);return c.bind(this)},q.prototype.register=function(a,b){if(!b instanceof Function)throw new Error("handler must be a function");this._fns[a]=b},q.prototype._fns={"member-child-identifier":function(a,b){var c=a.expression.value,d=b.value;if(d instanceof Object&&c in d)return[{value:d[c],path:b.path.concat(c)}]},"member-descendant-identifier":i(function(a,b,c){return a==c}),"subscript-child-numeric_literal":h(function(a,b,c){return a===c}),"member-child-numeric_literal":h(function(a,b,c){return String(a)===String(c)}),"subscript-descendant-numeric_literal":i(function(a,b,c){return a===c}),"member-child-wildcard":h(function(){return!0}),"member-descendant-wildcard":i(function(){return!0}),"subscript-descendant-wildcard":i(function(){return!0}),"subscript-child-wildcard":h(function(){return!0}),"subscript-child-slice":function(a,b){if(e(b.value)){var c=a.expression.value.split(":").map(l),d=b.value.map(function(a,c){return{value:a,path:b.path.concat(c)}});return n.apply(null,[d].concat(c))}},"subscript-child-union":function(a,b){var c=[];return a.expression.value.forEach(function(a){var d={operation:"subscript",scope:"child",expression:a.expression},e=this.resolve(d),f=e(d,b);f&&(c=c.concat(f))},this),k(c)},"subscript-descendant-union":function(b,c,d){var e=a(".."),f=this,g=[];return e.nodes(c,"$..*").slice(1).forEach(function(a){g.length>=d||b.expression.value.forEach(function(b){var c={operation:"subscript",scope:"child",expression:b.expression},d=f.resolve(c),e=d(c,a);g=g.concat(e)})}),k(g)},"subscript-child-filter_expression":function(a,b,c){var d=a.expression.value.slice(2,-1),e=m.parse(d).body[0].expression,f=function(a,b){return j(e,{"@":b})};return this.descend(b,null,f,c)},"subscript-descendant-filter_expression":function(a,b,c){var d=a.expression.value.slice(2,-1),e=m.parse(d).body[0].expression,f=function(a,b){return j(e,{"@":b})};return this.traverse(b,null,f,c)},"subscript-child-script_expression":function(a,b){return d(b,a.expression.value.slice(1,-1),"$[{{value}}]")},"member-child-script_expression":function(a,b){return d(b,a.expression.value.slice(1,-1),"$.{{value}}")},"member-descendant-script_expression":function(a,b){return d(b,a.expression.value.slice(1,-1),"$..value")}},q.prototype._fns["subscript-child-string_literal"]=q.prototype._fns["member-child-identifier"],q.prototype._fns["member-descendant-numeric_literal"]=q.prototype._fns["subscript-descendant-string_literal"]=q.prototype._fns["member-descendant-identifier"],b.exports=q},{"..":"jsonpath","./aesprim":"./aesprim","./index":5,"./slice":7,"static-eval":15,underscore:12}],5:[function(a,b,c){function d(a){return"[object String]"==Object.prototype.toString.call(a)}var e=a("assert"),f=a("./dict"),g=a("./parser"),h=a("./handlers"),i=function(){this.initialize.apply(this,arguments)};i.prototype.initialize=function(){this.parser=new g,this.handlers=new h},i.prototype.parse=function(a){return e.ok(d(a),"we need a path"),this.parser.parse(a)},i.prototype.parent=function(a,b){e.ok(a instanceof Object,"obj needs to be an object"),e.ok(b,"we need a path");var c=this.nodes(a,b)[0];c.path.pop();return this.value(a,c.path)},i.prototype.apply=function(a,b,c){e.ok(a instanceof Object,"obj needs to be an object"),e.ok(b,"we need a path"),e.equal(typeof c,"function","fn needs to be function");var d=this.nodes(a,b).sort(function(a,b){return b.path.length-a.path.length});return d.forEach(function(b){var d=b.path.pop(),e=this.value(a,this.stringify(b.path)),f=b.value=c.call(a,e[d]);e[d]=f},this),d},i.prototype.value=function(a,b,c){if(e.ok(a instanceof Object,"obj needs to be an object"),e.ok(b,"we need a path"),arguments.length>=3){var d=this.nodes(a,b).shift();if(!d)return this._vivify(a,b,c);var f=d.path.slice(-1).shift();this.parent(a,this.stringify(d.path))[f]=c}return this.query(a,this.stringify(b),1).shift()},i.prototype._vivify=function(a,b,c){var d=this;e.ok(a instanceof Object,"obj needs to be an object"),e.ok(b,"we need a path");var f=this.parser.parse(b).map(function(a){return a.expression.value}),g=function(b,c){var e=b.pop(),f=d.value(a,b);f||(g(b.concat(),"string"==typeof e?{}:[]),f=d.value(a,b)),f[e]=c};return g(f,c),this.query(a,b)[0]},i.prototype.query=function(a,b,c){return e.ok(a instanceof Object,"obj needs to be an object"),e.ok(d(b),"we need a path"),this.nodes(a,b,c).map(function(a){return a.value})},i.prototype.paths=function(a,b,c){return e.ok(a instanceof Object,"obj needs to be an object"),e.ok(b,"we need a path"),this.nodes(a,b,c).map(function(a){return a.path})},i.prototype.nodes=function(a,b,c){if(e.ok(a instanceof Object,"obj needs to be an object"),e.ok(b,"we need a path"),0===c)return[];var d=this.parser.parse(b),f=this.handlers,g=[{path:["$"],value:a}],h=[];return d.length&&"root"==d[0].expression.type&&d.shift(),d.length?(d.forEach(function(a,b){if(!(h.length>=c)){var e=f.resolve(a),i=[];g.forEach(function(f){if(!(h.length>=c)){var g=e(a,f,c);b==d.length-1?h=h.concat(g||[]):i=i.concat(g||[])}}),g=i}}),c?h.slice(0,c):h):g}, -i.prototype.stringify=function(a){e.ok(a,"we need a path");var b="$",c={"descendant-member":"..{{value}}","child-member":".{{value}}","descendant-subscript":"..[{{value}}]","child-subscript":"[{{value}}]"};return a=this._normalize(a),a.forEach(function(a){if("root"!=a.expression.type){var d,e=[a.scope,a.operation].join("-"),f=c[e];if(d="string_literal"==a.expression.type?JSON.stringify(a.expression.value):a.expression.value,!f)throw new Error("couldn't find template "+e);b+=f.replace(/{{value}}/,d)}}),b},i.prototype._normalize=function(a){if(e.ok(a,"we need a path"),"string"==typeof a)return this.parser.parse(a);if(Array.isArray(a)&&"string"==typeof a[0]){var b=[{expression:{type:"root",value:"$"}}];return a.forEach(function(a,c){if("$"!=a||0!==c)if("string"==typeof a&&a.match("^"+f.identifier+"$"))b.push({operation:"member",scope:"child",expression:{value:a,type:"identifier"}});else{var d="number"==typeof a?"numeric_literal":"string_literal";b.push({operation:"subscript",scope:"child",expression:{value:a,type:d}})}}),b}if(Array.isArray(a)&&"object"==typeof a[0])return a;throw new Error("couldn't understand path "+a)},i.Handlers=h,i.Parser=g;var j=new i;j.JSONPath=i,b.exports=j},{"./dict":2,"./handlers":4,"./parser":6,assert:8}],6:[function(a,b,c){var d=a("./grammar"),e=a("../generated/parser"),f=function(){var a=new e.Parser,b=a.parseError;return a.yy.parseError=function(){a.yy.ast&&a.yy.ast.initialize(),b.apply(a,arguments)},a};f.grammar=d,b.exports=f},{"../generated/parser":1,"./grammar":3}],7:[function(a,b,c){function d(a){return String(a).match(/^[0-9]+$/)?parseInt(a):Number.isFinite(a)?parseInt(a,10):0}b.exports=function(a,b,c,e){if("string"==typeof b)throw new Error("start cannot be a string");if("string"==typeof c)throw new Error("end cannot be a string");if("string"==typeof e)throw new Error("step cannot be a string");var f=a.length;if(0===e)throw new Error("step cannot be zero");if(e=e?d(e):1,b=b<0?f+b:b,c=c<0?f+c:c,b=d(0===b?0:b||(e>0?0:f-1)),c=d(0===c?0:c||(e>0?f:-1)),b=e>0?Math.max(0,b):Math.min(f,b),c=e>0?Math.min(c,f):Math.max(-1,c),e>0&&c<=b)return[];if(e<0&&b<=c)return[];for(var g=[],h=b;h!=c&&!(e<0&&h<=c||e>0&&h>=c);h+=e)g.push(a[h]);return g}},{}],8:[function(a,b,c){function d(a,b){return n.isUndefined(b)?""+b:n.isNumber(b)&&!isFinite(b)?b.toString():n.isFunction(b)||n.isRegExp(b)?b.toString():b}function e(a,b){return n.isString(a)?a.length=0;f--)if(g[f]!=h[f])return!1;for(f=g.length-1;f>=0;f--)if(e=g[f],!i(a[e],b[e]))return!1;return!0}function l(a,b){return!(!a||!b)&&("[object RegExp]"==Object.prototype.toString.call(b)?b.test(a):a instanceof b||!0===b.call({},a))}function m(a,b,c,d){var e;n.isString(c)&&(d=c,c=null);try{b()}catch(f){e=f}if(d=(c&&c.name?" ("+c.name+").":".")+(d?" "+d:"."),a&&!e&&g(e,c,"Missing expected exception"+d),!a&&l(e,c)&&g(e,c,"Got unwanted exception"+d),a&&e&&c&&!l(e,c)||!a&&e)throw e}var n=a("util/"),o=Array.prototype.slice,p=Object.prototype.hasOwnProperty,q=b.exports=h;q.AssertionError=function(a){this.name="AssertionError",this.actual=a.actual,this.expected=a.expected,this.operator=a.operator,a.message?(this.message=a.message,this.generatedMessage=!1):(this.message=f(this),this.generatedMessage=!0);var b=a.stackStartFunction||g;if(Error.captureStackTrace)Error.captureStackTrace(this,b);else{var c=new Error;if(c.stack){var d=c.stack,e=b.name,h=d.indexOf("\n"+e);if(h>=0){var i=d.indexOf("\n",h+1);d=d.substring(i+1)}this.stack=d}}},n.inherits(q.AssertionError,Error),q.fail=g,q.ok=h,q.equal=function(a,b,c){a!=b&&g(a,b,c,"==",q.equal)},q.notEqual=function(a,b,c){a==b&&g(a,b,c,"!=",q.notEqual)},q.deepEqual=function(a,b,c){i(a,b)||g(a,b,c,"deepEqual",q.deepEqual)},q.notDeepEqual=function(a,b,c){i(a,b)&&g(a,b,c,"notDeepEqual",q.notDeepEqual)},q.strictEqual=function(a,b,c){a!==b&&g(a,b,c,"===",q.strictEqual)},q.notStrictEqual=function(a,b,c){a===b&&g(a,b,c,"!==",q.notStrictEqual)},q.throws=function(a,b,c){m.apply(this,[!0].concat(o.call(arguments)))},q.doesNotThrow=function(a,b){m.apply(this,[!1].concat(o.call(arguments)))},q.ifError=function(a){if(a)throw a};var r=Object.keys||function(a){var b=[];for(var c in a)p.call(a,c)&&b.push(c);return b}},{"util/":11}],9:[function(a,b,c){"function"==typeof Object.create?b.exports=function(a,b){a.super_=b,a.prototype=Object.create(b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}})}:b.exports=function(a,b){a.super_=b;var c=function(){};c.prototype=b.prototype,a.prototype=new c,a.prototype.constructor=a}},{}],10:[function(a,b,c){b.exports=function(a){return a&&"object"==typeof a&&"function"==typeof a.copy&&"function"==typeof a.fill&&"function"==typeof a.readUInt8}},{}],11:[function(a,b,c){(function(b,d){function e(a,b){var d={seen:[],stylize:g};return arguments.length>=3&&(d.depth=arguments[2]),arguments.length>=4&&(d.colors=arguments[3]),p(b)?d.showHidden=b:b&&c._extend(d,b),v(d.showHidden)&&(d.showHidden=!1),v(d.depth)&&(d.depth=2),v(d.colors)&&(d.colors=!1),v(d.customInspect)&&(d.customInspect=!0),d.colors&&(d.stylize=f),i(d,a,d.depth)}function f(a,b){var c=e.styles[b];return c?"["+e.colors[c][0]+"m"+a+"["+e.colors[c][1]+"m":a}function g(a,b){return a}function h(a){var b={};return a.forEach(function(a,c){b[a]=!0}),b}function i(a,b,d){if(a.customInspect&&b&&A(b.inspect)&&b.inspect!==c.inspect&&(!b.constructor||b.constructor.prototype!==b)){var e=b.inspect(d,a);return t(e)||(e=i(a,e,d)),e}var f=j(a,b);if(f)return f;var g=Object.keys(b),p=h(g);if(a.showHidden&&(g=Object.getOwnPropertyNames(b)),z(b)&&(g.indexOf("message")>=0||g.indexOf("description")>=0))return k(b);if(0===g.length){if(A(b)){var q=b.name?": "+b.name:"";return a.stylize("[Function"+q+"]","special")}if(w(b))return a.stylize(RegExp.prototype.toString.call(b),"regexp");if(y(b))return a.stylize(Date.prototype.toString.call(b),"date");if(z(b))return k(b)}var r="",s=!1,u=["{","}"];if(o(b)&&(s=!0,u=["[","]"]),A(b)){r=" [Function"+(b.name?": "+b.name:"")+"]"}if(w(b)&&(r=" "+RegExp.prototype.toString.call(b)),y(b)&&(r=" "+Date.prototype.toUTCString.call(b)),z(b)&&(r=" "+k(b)),0===g.length&&(!s||0==b.length))return u[0]+r+u[1];if(d<0)return w(b)?a.stylize(RegExp.prototype.toString.call(b),"regexp"):a.stylize("[Object]","special");a.seen.push(b);var v;return v=s?l(a,b,d,p,g):g.map(function(c){return m(a,b,d,p,c,s)}),a.seen.pop(),n(v,r,u)}function j(a,b){if(v(b))return a.stylize("undefined","undefined");if(t(b)){var c="'"+JSON.stringify(b).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return a.stylize(c,"string")}return s(b)?a.stylize(""+b,"number"):p(b)?a.stylize(""+b,"boolean"):q(b)?a.stylize("null","null"):void 0}function k(a){return"["+Error.prototype.toString.call(a)+"]"}function l(a,b,c,d,e){for(var f=[],g=0,h=b.length;g-1&&(h=f?h.split("\n").map(function(a){return" "+a}).join("\n").substr(2):"\n"+h.split("\n").map(function(a){return" "+a}).join("\n"))):h=a.stylize("[Circular]","special")),v(g)){if(f&&e.match(/^\d+$/))return h;g=JSON.stringify(""+e),g.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(g=g.substr(1,g.length-2),g=a.stylize(g,"name")):(g=g.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),g=a.stylize(g,"string"))}return g+": "+h}function n(a,b,c){var d=0;return a.reduce(function(a,b){return d++,b.indexOf("\n")>=0&&d++,a+b.replace(/\u001b\[\d\d?m/g,"").length+1},0)>60?c[0]+(""===b?"":b+"\n ")+" "+a.join(",\n ")+" "+c[1]:c[0]+b+" "+a.join(", ")+" "+c[1]}function o(a){return Array.isArray(a)}function p(a){return"boolean"==typeof a}function q(a){return null===a}function r(a){return null==a}function s(a){return"number"==typeof a}function t(a){return"string"==typeof a}function u(a){return"symbol"==typeof a}function v(a){return void 0===a}function w(a){return x(a)&&"[object RegExp]"===C(a)}function x(a){return"object"==typeof a&&null!==a}function y(a){return x(a)&&"[object Date]"===C(a)}function z(a){return x(a)&&("[object Error]"===C(a)||a instanceof Error)}function A(a){return"function"==typeof a}function B(a){return null===a||"boolean"==typeof a||"number"==typeof a||"string"==typeof a||"symbol"==typeof a||void 0===a}function C(a){return Object.prototype.toString.call(a)}function D(a){return a<10?"0"+a.toString(10):a.toString(10)}function E(){var a=new Date,b=[D(a.getHours()),D(a.getMinutes()),D(a.getSeconds())].join(":");return[a.getDate(),J[a.getMonth()],b].join(" ")}function F(a,b){return Object.prototype.hasOwnProperty.call(a,b)}var G=/%[sdj%]/g;c.format=function(a){if(!t(a)){for(var b=[],c=0;c=f)return a;switch(a){case"%s":return String(d[c++]);case"%d":return Number(d[c++]);case"%j":try{return JSON.stringify(d[c++])}catch(b){return"[Circular]"}default:return a}}),h=d[c];c=0;d--){var e=a[d];"."===e?a.splice(d,1):".."===e?(a.splice(d,1),c++):c&&(a.splice(d,1),c--)}if(b)for(;c--;c)a.unshift("..");return a}function d(a){"string"!=typeof a&&(a+="");var b,c=0,d=-1,e=!0;for(b=a.length-1;b>=0;--b)if(47===a.charCodeAt(b)){if(!e){c=b+1;break}}else-1===d&&(e=!1,d=b+1);return-1===d?"":a.slice(c,d)}function e(a,b){if(a.filter)return a.filter(b);for(var c=[],d=0;d=-1&&!d;f--){var g=f>=0?arguments[f]:a.cwd();if("string"!=typeof g)throw new TypeError("Arguments to path.resolve must be strings");g&&(c=g+"/"+c,d="/"===g.charAt(0))}return c=b(e(c.split("/"),function(a){return!!a}),!d).join("/"),(d?"/":"")+c||"."},c.normalize=function(a){var d=c.isAbsolute(a),g="/"===f(a,-1);return a=b(e(a.split("/"),function(a){return!!a}),!d).join("/"),a||d||(a="."),a&&g&&(a+="/"),(d?"/":"")+a},c.isAbsolute=function(a){return"/"===a.charAt(0)},c.join=function(){var a=Array.prototype.slice.call(arguments,0);return c.normalize(e(a,function(a,b){if("string"!=typeof a)throw new TypeError("Arguments to path.join must be strings");return a}).join("/"))},c.relative=function(a,b){function d(a){for(var b=0;b=0&&""===a[c];c--);return b>c?[]:a.slice(b,c-b+1)}a=c.resolve(a).substr(1),b=c.resolve(b).substr(1);for(var e=d(a.split("/")),f=d(b.split("/")),g=Math.min(e.length,f.length),h=g,i=0;i=1;--f)if(47===(b=a.charCodeAt(f))){if(!e){d=f;break}}else e=!1;return-1===d?c?"/":".":c&&1===d?"/":a.slice(0,d)},c.basename=function(a,b){var c=d(a);return b&&c.substr(-1*b.length)===b&&(c=c.substr(0,c.length-b.length)),c},c.extname=function(a){"string"!=typeof a&&(a+="");for(var b=-1,c=0,d=-1,e=!0,f=0,g=a.length-1;g>=0;--g){var h=a.charCodeAt(g);if(47!==h)-1===d&&(e=!1,d=g+1),46===h?-1===b?b=g:1!==f&&(f=1):-1!==b&&(f=-1);else if(!e){c=g+1;break}}return-1===b||-1===d||0===f||1===f&&b===d-1&&b===c+1?"":a.slice(b,d)};var f="b"==="ab".substr(-1)?function(a,b,c){return a.substr(b,c)}:function(a,b,c){return b<0&&(b=a.length+b),a.substr(b,c)}}).call(this,a("_process"))},{_process:14}],14:[function(a,b,c){function d(){throw new Error("setTimeout has not been defined")}function e(){throw new Error("clearTimeout has not been defined")}function f(a){if(l===setTimeout)return setTimeout(a,0);if((l===d||!l)&&setTimeout)return l=setTimeout,setTimeout(a,0);try{return l(a,0)}catch(b){try{return l.call(null,a,0)}catch(b){return l.call(this,a,0)}}}function g(a){if(m===clearTimeout)return clearTimeout(a);if((m===e||!m)&&clearTimeout)return m=clearTimeout,clearTimeout(a);try{return m(a)}catch(b){try{return m.call(null,a)}catch(b){return m.call(this,a)}}}function h(){q&&o&&(q=!1,o.length?p=o.concat(p):r=-1,p.length&&i())}function i(){if(!q){var a=f(h);q=!0;for(var b=p.length;b;){for(o=p,p=[];++r1)for(var c=1;c"===p?j>o:">="===p?j>=o:"|"===p?j|o:"&"===p?j&o:"^"===p?j^o:"&&"===p?j&&o:"||"===p?j||o:c}if("Identifier"===e.type)return{}.hasOwnProperty.call(b,e.name)?b[e.name]:c;if("ThisExpression"===e.type)return{}.hasOwnProperty.call(b,"this")?b.this:c;if("CallExpression"===e.type){var q=a(e.callee);if(q===c)return c;if("function"!=typeof q)return c;var r=e.callee.object?a(e.callee.object):c;r===c&&(r=null);for(var s=[],i=0,j=e.arguments.length;i0)){for(pb.trailingComments.length>0?pb.trailingComments[0].range[0]>=a.range[1]?(c=pb.trailingComments,pb.trailingComments=[]):pb.trailingComments.length=0:pb.bottomRightStack.length>0&&pb.bottomRightStack[pb.bottomRightStack.length-1].trailingComments&&pb.bottomRightStack[pb.bottomRightStack.length-1].trailingComments[0].range[0]>=a.range[1]&&(c=pb.bottomRightStack[pb.bottomRightStack.length-1].trailingComments,delete pb.bottomRightStack[pb.bottomRightStack.length-1].trailingComments);pb.bottomRightStack.length>0&&pb.bottomRightStack[pb.bottomRightStack.length-1].range[0]>=a.range[0];)b=pb.bottomRightStack.pop();b?b.leadingComments&&b.leadingComments[b.leadingComments.length-1].range[1]<=a.range[0]&&(a.leadingComments=b.leadingComments,delete b.leadingComments):pb.leadingComments.length>0&&pb.leadingComments[pb.leadingComments.length-1].range[1]<=a.range[0]&&(a.leadingComments=pb.leadingComments,pb.leadingComments=[]),c&&(a.trailingComments=c),pb.bottomRightStack.push(a)}},markEnd:function(a,b){return pb.range&&(a.range=[b.start,ib]),pb.loc&&(a.loc=new M(void 0===b.startLineNumber?b.lineNumber:b.startLineNumber,b.start-(void 0===b.startLineStart?b.lineStart:b.startLineStart),jb,ib-kb),this.postProcess(a)),pb.attachComment&&this.processComment(a),a},postProcess:function(a){return pb.source&&(a.loc.source=pb.source),a},createArrayExpression:function(a){return{type:bb.ArrayExpression,elements:a}},createAssignmentExpression:function(a,b,c){return{type:bb.AssignmentExpression,operator:a,left:b,right:c}},createBinaryExpression:function(a,b,c){return{type:"||"===a||"&&"===a?bb.LogicalExpression:bb.BinaryExpression,operator:a,left:b,right:c}},createBlockStatement:function(a){return{type:bb.BlockStatement,body:a}},createBreakStatement:function(a){return{type:bb.BreakStatement,label:a}},createCallExpression:function(a,b){return{type:bb.CallExpression,callee:a,arguments:b}},createCatchClause:function(a,b){return{type:bb.CatchClause,param:a,body:b}},createConditionalExpression:function(a,b,c){return{type:bb.ConditionalExpression,test:a,consequent:b,alternate:c}},createContinueStatement:function(a){return{type:bb.ContinueStatement,label:a}},createDebuggerStatement:function(){return{type:bb.DebuggerStatement}},createDoWhileStatement:function(a,b){return{type:bb.DoWhileStatement,body:a,test:b}},createEmptyStatement:function(){return{type:bb.EmptyStatement}},createExpressionStatement:function(a){return{type:bb.ExpressionStatement,expression:a}},createForStatement:function(a,b,c,d){return{type:bb.ForStatement,init:a,test:b,update:c,body:d}},createForInStatement:function(a,b,c){return{type:bb.ForInStatement,left:a,right:b,body:c,each:!1}},createFunctionDeclaration:function(a,b,c,d){return{type:bb.FunctionDeclaration,id:a,params:b,defaults:c,body:d,rest:null,generator:!1,expression:!1}},createFunctionExpression:function(a,b,c,d){return{type:bb.FunctionExpression,id:a,params:b,defaults:c,body:d,rest:null,generator:!1,expression:!1}},createIdentifier:function(a){return{type:bb.Identifier,name:a}},createIfStatement:function(a,b,c){return{type:bb.IfStatement,test:a,consequent:b,alternate:c}},createLabeledStatement:function(a,b){return{type:bb.LabeledStatement,label:a,body:b}},createLiteral:function(a){return{type:bb.Literal,value:a.value,raw:gb.slice(a.start,a.end)}},createMemberExpression:function(a,b,c){return{type:bb.MemberExpression,computed:"["===a,object:b,property:c}},createNewExpression:function(a,b){return{type:bb.NewExpression,callee:a,arguments:b}},createObjectExpression:function(a){return{type:bb.ObjectExpression,properties:a}},createPostfixExpression:function(a,b){return{type:bb.UpdateExpression,operator:a,argument:b,prefix:!1}},createProgram:function(a){return{type:bb.Program,body:a}},createProperty:function(a,b,c){return{type:bb.Property,key:b,value:c,kind:a}},createReturnStatement:function(a){return{type:bb.ReturnStatement,argument:a}},createSequenceExpression:function(a){return{type:bb.SequenceExpression,expressions:a}},createSwitchCase:function(a,b){return{type:bb.SwitchCase,test:a,consequent:b}},createSwitchStatement:function(a,b){return{type:bb.SwitchStatement,discriminant:a,cases:b}},createThisExpression:function(){return{type:bb.ThisExpression}},createThrowStatement:function(a){return{type:bb.ThrowStatement,argument:a}},createTryStatement:function(a,b,c,d){return{type:bb.TryStatement,block:a,guardedHandlers:b,handlers:c,finalizer:d}},createUnaryExpression:function(a,b){return"++"===a||"--"===a?{type:bb.UpdateExpression,operator:a,argument:b,prefix:!0}:{type:bb.UnaryExpression,operator:a,argument:b,prefix:!0}},createVariableDeclaration:function(a,b){return{type:bb.VariableDeclaration,declarations:a,kind:b}},createVariableDeclarator:function(a,b){return{type:bb.VariableDeclarator,id:a,init:b}},createWhileStatement:function(a,b){return{type:bb.WhileStatement,test:a,body:b}},createWithStatement:function(a,b){return{type:bb.WithStatement,object:a,body:b}}},a.version="1.2.2",a.tokenize=Ya,a.parse=Za,a.Syntax=function(){var a,b={};"function"==typeof Object.create&&(b=Object.create(null));for(a in bb)bb.hasOwnProperty(a)&&(b[a]=bb[a]);return"function"==typeof Object.freeze&&Object.freeze(b),b}()})},{}],1:[function(a,b,c){(function(d){var e=function(){function a(){this.yy={}}var b={trace:function(){},yy:{},symbols_:{error:2,JSON_PATH:3,DOLLAR:4,PATH_COMPONENTS:5,LEADING_CHILD_MEMBER_EXPRESSION:6,PATH_COMPONENT:7,MEMBER_COMPONENT:8,SUBSCRIPT_COMPONENT:9,CHILD_MEMBER_COMPONENT:10,DESCENDANT_MEMBER_COMPONENT:11,DOT:12,MEMBER_EXPRESSION:13,DOT_DOT:14,STAR:15,IDENTIFIER:16,SCRIPT_EXPRESSION:17,INTEGER:18,END:19,CHILD_SUBSCRIPT_COMPONENT:20,DESCENDANT_SUBSCRIPT_COMPONENT:21,"[":22,SUBSCRIPT:23,"]":24,SUBSCRIPT_EXPRESSION:25,SUBSCRIPT_EXPRESSION_LIST:26,SUBSCRIPT_EXPRESSION_LISTABLE:27,",":28,STRING_LITERAL:29,ARRAY_SLICE:30,FILTER_EXPRESSION:31,QQ_STRING:32,Q_STRING:33,$accept:0,$end:1},terminals_:{2:"error",4:"DOLLAR",12:"DOT",14:"DOT_DOT",15:"STAR",16:"IDENTIFIER",17:"SCRIPT_EXPRESSION",18:"INTEGER",19:"END",22:"[",24:"]",28:",",30:"ARRAY_SLICE",31:"FILTER_EXPRESSION",32:"QQ_STRING",33:"Q_STRING"},productions_:[0,[3,1],[3,2],[3,1],[3,2],[5,1],[5,2],[7,1],[7,1],[8,1],[8,1],[10,2],[6,1],[11,2],[13,1],[13,1],[13,1],[13,1],[13,1],[9,1],[9,1],[20,3],[21,4],[23,1],[23,1],[26,1],[26,3],[27,1],[27,1],[27,1],[25,1],[25,1],[25,1],[29,1],[29,1]],performAction:function(a,b,d,e,f,g,h){e.ast||(e.ast=c,c.initialize());var i=g.length-1;switch(f){case 1:return e.ast.set({expression:{type:"root",value:g[i]}}),e.ast.unshift(),e.ast.yield();case 2:return e.ast.set({expression:{type:"root",value:g[i-1]}}),e.ast.unshift(),e.ast.yield();case 3:return e.ast.unshift(),e.ast.yield();case 4:return e.ast.set({operation:"member",scope:"child",expression:{type:"identifier",value:g[i-1]}}),e.ast.unshift(),e.ast.yield();case 5:case 6:break;case 7:e.ast.set({operation:"member"}),e.ast.push();break;case 8:e.ast.set({operation:"subscript"}),e.ast.push();break;case 9:e.ast.set({scope:"child"});break;case 10:e.ast.set({scope:"descendant"});break;case 11:break;case 12:e.ast.set({scope:"child",operation:"member"});break;case 13:break;case 14:e.ast.set({expression:{type:"wildcard",value:g[i]}});break;case 15:e.ast.set({expression:{type:"identifier",value:g[i]}});break;case 16:e.ast.set({expression:{type:"script_expression",value:g[i]}});break;case 17:e.ast.set({expression:{type:"numeric_literal",value:parseInt(g[i])}});break;case 18:break;case 19:e.ast.set({scope:"child"});break;case 20:e.ast.set({scope:"descendant"});break;case 21:case 22:case 23:break;case 24:g[i].length>1?e.ast.set({expression:{type:"union",value:g[i]}}):this.$=g[i];break;case 25:this.$=[g[i]];break;case 26:this.$=g[i-2].concat(g[i]);break;case 27:this.$={expression:{type:"numeric_literal",value:parseInt(g[i])}},e.ast.set(this.$);break;case 28:this.$={expression:{type:"string_literal",value:g[i]}},e.ast.set(this.$);break;case 29:this.$={expression:{type:"slice",value:g[i]}},e.ast.set(this.$);break;case 30:this.$={expression:{type:"wildcard",value:g[i]}},e.ast.set(this.$);break;case 31:this.$={expression:{type:"script_expression",value:g[i]}},e.ast.set(this.$);break;case 32:this.$={expression:{type:"filter_expression",value:g[i]}},e.ast.set(this.$);break;case 33:case 34:this.$=g[i]}},table:[{3:1,4:[1,2],6:3,13:4,15:[1,5],16:[1,6],17:[1,7],18:[1,8],19:[1,9]},{1:[3]},{1:[2,1],5:10,7:11,8:12,9:13,10:14,11:15,12:[1,18],14:[1,19],20:16,21:17,22:[1,20]},{1:[2,3],5:21,7:11,8:12,9:13,10:14,11:15,12:[1,18],14:[1,19],20:16,21:17,22:[1,20]},{1:[2,12],12:[2,12],14:[2,12],22:[2,12]},{1:[2,14],12:[2,14],14:[2,14],22:[2,14]},{1:[2,15],12:[2,15],14:[2,15],22:[2,15]},{1:[2,16],12:[2,16],14:[2,16],22:[2,16]},{1:[2,17],12:[2,17],14:[2,17],22:[2,17]},{1:[2,18],12:[2,18],14:[2,18],22:[2,18]},{1:[2,2],7:22,8:12,9:13,10:14,11:15,12:[1,18],14:[1,19],20:16,21:17,22:[1,20]},{1:[2,5],12:[2,5],14:[2,5],22:[2,5]},{1:[2,7],12:[2,7],14:[2,7],22:[2,7]},{1:[2,8],12:[2,8],14:[2,8],22:[2,8]},{1:[2,9],12:[2,9],14:[2,9],22:[2,9]},{1:[2,10],12:[2,10],14:[2,10],22:[2,10]},{1:[2,19],12:[2,19],14:[2,19],22:[2,19]},{1:[2,20],12:[2,20],14:[2,20],22:[2,20]},{13:23,15:[1,5],16:[1,6],17:[1,7],18:[1,8],19:[1,9]},{13:24,15:[1,5],16:[1,6],17:[1,7],18:[1,8],19:[1,9],22:[1,25]},{15:[1,29],17:[1,30],18:[1,33],23:26,25:27,26:28,27:32,29:34,30:[1,35],31:[1,31],32:[1,36],33:[1,37]},{1:[2,4],7:22,8:12,9:13,10:14,11:15,12:[1,18],14:[1,19],20:16,21:17,22:[1,20]},{1:[2,6],12:[2,6],14:[2,6],22:[2,6]},{1:[2,11],12:[2,11],14:[2,11],22:[2,11]},{1:[2,13],12:[2,13],14:[2,13],22:[2,13]},{15:[1,29],17:[1,30],18:[1,33],23:38,25:27,26:28,27:32,29:34,30:[1,35],31:[1,31],32:[1,36],33:[1,37]},{24:[1,39]},{24:[2,23]},{24:[2,24],28:[1,40]},{24:[2,30]},{24:[2,31]},{24:[2,32]},{24:[2,25],28:[2,25]},{24:[2,27],28:[2,27]},{24:[2,28],28:[2,28]},{24:[2,29],28:[2,29]},{24:[2,33],28:[2,33]},{24:[2,34],28:[2,34]},{24:[1,41]},{1:[2,21],12:[2,21],14:[2,21],22:[2,21]},{18:[1,33],27:42,29:34,30:[1,35],32:[1,36],33:[1,37]},{1:[2,22],12:[2,22],14:[2,22],22:[2,22]},{24:[2,26],28:[2,26]}],defaultActions:{27:[2,23],29:[2,30],30:[2,31],31:[2,32]},parseError:function(a,b){if(!b.recoverable)throw new Error(a);this.trace(a)},parse:function(a){function b(){var a;return a=c.lexer.lex()||m,"number"!=typeof a&&(a=c.symbols_[a]||a),a}var c=this,d=[0],e=[null],f=[],g=this.table,h="",i=0,j=0,k=0,l=2,m=1,n=f.slice.call(arguments,1);this.lexer.setInput(a),this.lexer.yy=this.yy,this.yy.lexer=this.lexer,this.yy.parser=this,void 0===this.lexer.yylloc&&(this.lexer.yylloc={});var o=this.lexer.yylloc;f.push(o);var p=this.lexer.options&&this.lexer.options.ranges;"function"==typeof this.yy.parseError?this.parseError=this.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;for(var q,r,s,t,u,v,w,x,y,z={};;){if(s=d[d.length-1],this.defaultActions[s]?t=this.defaultActions[s]:(null!==q&&void 0!==q||(q=b()),t=g[s]&&g[s][q]),void 0===t||!t.length||!t[0]){var A="";y=[];for(v in g[s])this.terminals_[v]&&v>l&&y.push("'"+this.terminals_[v]+"'");A=this.lexer.showPosition?"Parse error on line "+(i+1)+":\n"+this.lexer.showPosition()+"\nExpecting "+y.join(", ")+", got '"+(this.terminals_[q]||q)+"'":"Parse error on line "+(i+1)+": Unexpected "+(q==m?"end of input":"'"+(this.terminals_[q]||q)+"'"),this.parseError(A,{text:this.lexer.match,token:this.terminals_[q]||q,line:this.lexer.yylineno,loc:o,expected:y})}if(t[0]instanceof Array&&t.length>1)throw new Error("Parse Error: multiple actions possible at state: "+s+", token: "+q);switch(t[0]){case 1:d.push(q),e.push(this.lexer.yytext),f.push(this.lexer.yylloc),d.push(t[1]),q=null,r?(q=r,r=null):(j=this.lexer.yyleng,h=this.lexer.yytext,i=this.lexer.yylineno,o=this.lexer.yylloc,k>0&&k--);break;case 2:if(w=this.productions_[t[1]][1],z.$=e[e.length-w],z._$={first_line:f[f.length-(w||1)].first_line,last_line:f[f.length-1].last_line,first_column:f[f.length-(w||1)].first_column,last_column:f[f.length-1].last_column},p&&(z._$.range=[f[f.length-(w||1)].range[0],f[f.length-1].range[1]]),void 0!==(u=this.performAction.apply(z,[h,j,i,this.yy,t[1],e,f].concat(n))))return u;w&&(d=d.slice(0,-1*w*2),e=e.slice(0,-1*w),f=f.slice(0,-1*w)),d.push(this.productions_[t[1]][0]),e.push(z.$),f.push(z._$),x=g[d[d.length-2]][d[d.length-1]],d.push(x);break;case 3:return!0}}return!0}},c={initialize:function(){this._nodes=[],this._node={},this._stash=[]},set:function(a){for(var b in a)this._node[b]=a[b];return this._node},node:function(a){return arguments.length&&(this._node=a),this._node},push:function(){this._nodes.push(this._node),this._node={}},unshift:function(){this._nodes.unshift(this._node),this._node={}},yield:function(){var a=this._nodes;return this.initialize(),a}},d=function(){return{EOF:1,parseError:function(a,b){if(!this.yy.parser)throw new Error(a);this.yy.parser.parseError(a,b)},setInput:function(a){return this._input=a,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var a=this._input[0];return this.yytext+=a,this.yyleng++,this.offset++,this.match+=a,this.matched+=a,a.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),a},unput:function(a){var b=a.length,c=a.split(/(?:\r\n?|\n)/g);this._input=a+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-b-1),this.offset-=b;var d=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),c.length-1&&(this.yylineno-=c.length-1);var e=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:c?(c.length===d.length?this.yylloc.first_column:0)+d[d.length-c.length].length-c[0].length:this.yylloc.first_column-b},this.options.ranges&&(this.yylloc.range=[e[0],e[0]+this.yyleng-b]),this.yyleng=this.yytext.length,this},more:function(){return this._more=!0,this},reject:function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},less:function(a){this.unput(this.match.slice(a))},pastInput:function(){var a=this.matched.substr(0,this.matched.length-this.match.length);return(a.length>20?"...":"")+a.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var a=this.match;return a.length<20&&(a+=this._input.substr(0,20-a.length)),(a.substr(0,20)+(a.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var a=this.pastInput(),b=new Array(a.length+1).join("-");return a+this.upcomingInput()+"\n"+b+"^"},test_match:function(a,b){var c,d,e;if(this.options.backtrack_lexer&&(e={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(e.yylloc.range=this.yylloc.range.slice(0))),d=a[0].match(/(?:\r\n?|\n).*/g),d&&(this.yylineno+=d.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:d?d[d.length-1].length-d[d.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+a[0].length},this.yytext+=a[0],this.match+=a[0],this.matches=a,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(a[0].length),this.matched+=a[0],c=this.performAction.call(this,this.yy,this,b,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),c)return c;if(this._backtrack){for(var f in e)this[f]=e[f];return!1}return!1},next:function(){if(this.done)return this.EOF;this._input||(this.done=!0);var a,b,c,d;this._more||(this.yytext="",this.match="");for(var e=this._currentRules(),f=0;fb[0].length)){if(b=c,d=f,this.options.backtrack_lexer){if(!1!==(a=this.test_match(c,e[f])))return a;if(this._backtrack){b=!1;continue}return!1}if(!this.options.flex)break}return b?!1!==(a=this.test_match(b,e[d]))&&a:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var a=this.next();return a||this.lex()},begin:function(a){this.conditionStack.push(a)},popState:function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},_currentRules:function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},topState:function(a){return a=this.conditionStack.length-1-Math.abs(a||0),a>=0?this.conditionStack[a]:"INITIAL"},pushState:function(a){this.begin(a)},stateStackSize:function(){return this.conditionStack.length},options:{},performAction:function(a,b,c,d){switch(c){case 0:return 4;case 1:return 14;case 2:return 12;case 3:return 15;case 4:return 16;case 5:return 22;case 6:return 24;case 7:return 28;case 8:return 30;case 9:return 18;case 10:return b.yytext=b.yytext.substr(1,b.yyleng-2),32;case 11:return b.yytext=b.yytext.substr(1,b.yyleng-2),33;case 12:return 17;case 13:return 31}},rules:[/^(?:\$)/,/^(?:\.\.)/,/^(?:\.)/,/^(?:\*)/,/^(?:[a-zA-Z_]+[a-zA-Z0-9_]*)/,/^(?:\[)/,/^(?:\])/,/^(?:,)/,/^(?:((-?(?:0|[1-9][0-9]*)))?\:((-?(?:0|[1-9][0-9]*)))?(\:((-?(?:0|[1-9][0-9]*)))?)?)/,/^(?:(-?(?:0|[1-9][0-9]*)))/,/^(?:"(?:\\["bfnrt\/\\]|\\u[a-fA-F0-9]{4}|[^"\\])*")/,/^(?:'(?:\\['bfnrt\/\\]|\\u[a-fA-F0-9]{4}|[^'\\])*')/,/^(?:\(.+?\)(?=\]))/,/^(?:\?\(.+?\)(?=\]))/],conditions:{INITIAL:{rules:[0,1,2,3,4,5,6,7,8,9,10,11,12,13],inclusive:!0}}}}();return b.lexer=d,a.prototype=b,b.Parser=a,new a}();void 0!==a&&void 0!==c&&(c.parser=e,c.Parser=e.Parser,c.parse=function(){return e.parse.apply(e,arguments)},c.main=function(b){b[1]||(console.log("Usage: "+b[0]+" FILE"),d.exit(1));var e=a("fs").readFileSync(a("path").normalize(b[1]),"utf8");return c.parser.parse(e)},void 0!==b&&a.main===b&&c.main(d.argv.slice(1)))}).call(this,a("_process"))},{_process:14,fs:12,path:13}],2:[function(a,b,c){b.exports={identifier:"[a-zA-Z_]+[a-zA-Z0-9_]*",integer:"-?(?:0|[1-9][0-9]*)",qq_string:'"(?:\\\\["bfnrt/\\\\]|\\\\u[a-fA-F0-9]{4}|[^"\\\\])*"',q_string:"'(?:\\\\['bfnrt/\\\\]|\\\\u[a-fA-F0-9]{4}|[^'\\\\])*'"}},{}],3:[function(a,b,c){var d=a("./dict"),e=a("fs"),f={lex:{macros:{esc:"\\\\",int:d.integer},rules:[["\\$","return 'DOLLAR'"],["\\.\\.","return 'DOT_DOT'"],["\\.","return 'DOT'"],["\\*","return 'STAR'"],[d.identifier,"return 'IDENTIFIER'"],["\\[","return '['"],["\\]","return ']'"],[",","return ','"],["({int})?\\:({int})?(\\:({int})?)?","return 'ARRAY_SLICE'"],["{int}","return 'INTEGER'"],[d.qq_string,"yytext = yytext.substr(1,yyleng-2); return 'QQ_STRING';"],[d.q_string,"yytext = yytext.substr(1,yyleng-2); return 'Q_STRING';"],["\\(.+?\\)(?=\\])","return 'SCRIPT_EXPRESSION'"],["\\?\\(.+?\\)(?=\\])","return 'FILTER_EXPRESSION'"]]},start:"JSON_PATH",bnf:{JSON_PATH:[["DOLLAR",'yy.ast.set({ expression: { type: "root", value: $1 } }); yy.ast.unshift(); return yy.ast.yield()'],["DOLLAR PATH_COMPONENTS",'yy.ast.set({ expression: { type: "root", value: $1 } }); yy.ast.unshift(); return yy.ast.yield()'],["LEADING_CHILD_MEMBER_EXPRESSION","yy.ast.unshift(); return yy.ast.yield()"],["LEADING_CHILD_MEMBER_EXPRESSION PATH_COMPONENTS",'yy.ast.set({ operation: "member", scope: "child", expression: { type: "identifier", value: $1 }}); yy.ast.unshift(); return yy.ast.yield()']],PATH_COMPONENTS:[["PATH_COMPONENT",""],["PATH_COMPONENTS PATH_COMPONENT",""]],PATH_COMPONENT:[["MEMBER_COMPONENT",'yy.ast.set({ operation: "member" }); yy.ast.push()'],["SUBSCRIPT_COMPONENT",'yy.ast.set({ operation: "subscript" }); yy.ast.push() ']],MEMBER_COMPONENT:[["CHILD_MEMBER_COMPONENT",'yy.ast.set({ scope: "child" })'],["DESCENDANT_MEMBER_COMPONENT",'yy.ast.set({ scope: "descendant" })']],CHILD_MEMBER_COMPONENT:[["DOT MEMBER_EXPRESSION",""]],LEADING_CHILD_MEMBER_EXPRESSION:[["MEMBER_EXPRESSION",'yy.ast.set({ scope: "child", operation: "member" })']],DESCENDANT_MEMBER_COMPONENT:[["DOT_DOT MEMBER_EXPRESSION",""]],MEMBER_EXPRESSION:[["STAR",'yy.ast.set({ expression: { type: "wildcard", value: $1 } })'],["IDENTIFIER",'yy.ast.set({ expression: { type: "identifier", value: $1 } })'],["SCRIPT_EXPRESSION",'yy.ast.set({ expression: { type: "script_expression", value: $1 } })'],["INTEGER",'yy.ast.set({ expression: { type: "numeric_literal", value: parseInt($1) } })'],["END",""]],SUBSCRIPT_COMPONENT:[["CHILD_SUBSCRIPT_COMPONENT",'yy.ast.set({ scope: "child" })'],["DESCENDANT_SUBSCRIPT_COMPONENT",'yy.ast.set({ scope: "descendant" })']],CHILD_SUBSCRIPT_COMPONENT:[["[ SUBSCRIPT ]",""]],DESCENDANT_SUBSCRIPT_COMPONENT:[["DOT_DOT [ SUBSCRIPT ]",""]],SUBSCRIPT:[["SUBSCRIPT_EXPRESSION",""],["SUBSCRIPT_EXPRESSION_LIST",'$1.length > 1? yy.ast.set({ expression: { type: "union", value: $1 } }) : $$ = $1']],SUBSCRIPT_EXPRESSION_LIST:[["SUBSCRIPT_EXPRESSION_LISTABLE","$$ = [$1]"],["SUBSCRIPT_EXPRESSION_LIST , SUBSCRIPT_EXPRESSION_LISTABLE","$$ = $1.concat($3)"]],SUBSCRIPT_EXPRESSION_LISTABLE:[["INTEGER",'$$ = { expression: { type: "numeric_literal", value: parseInt($1) } }; yy.ast.set($$)'],["STRING_LITERAL",'$$ = { expression: { type: "string_literal", value: $1 } }; yy.ast.set($$)'],["ARRAY_SLICE",'$$ = { expression: { type: "slice", value: $1 } }; yy.ast.set($$)']],SUBSCRIPT_EXPRESSION:[["STAR",'$$ = { expression: { type: "wildcard", value: $1 } }; yy.ast.set($$)'],["SCRIPT_EXPRESSION",'$$ = { expression: { type: "script_expression", value: $1 } }; yy.ast.set($$)'],["FILTER_EXPRESSION",'$$ = { expression: { type: "filter_expression", value: $1 } }; yy.ast.set($$)']],STRING_LITERAL:[["QQ_STRING","$$ = $1"],["Q_STRING","$$ = $1"]]}};e.readFileSync&&(f.moduleInclude=e.readFileSync(a.resolve("../include/module.js")),f.actionInclude=e.readFileSync(a.resolve("../include/action.js"))),b.exports=f},{"./dict":2,fs:12}],4:[function(a,b,c){function d(b,c,d){var e=a("./index"),f=m.parse(c).body[0].expression,g=j(f,{"@":b.value}),h=d.replace(/\{\{\s*value\s*\}\}/g,g),i=e.nodes(b.value,h);return i.forEach(function(a){a.path=b.path.concat(a.path.slice(1))}),i}function e(a){return Array.isArray(a)}function f(a){return a&&!(a instanceof Array)&&a instanceof Object}function g(a){return function(b,c,d,g){var h=b.value,i=b.path,j=[],k=function(b,h){e(b)?(b.forEach(function(a,b){j.length>=g||d(b,a,c)&&j.push({path:h.concat(b),value:a})}),b.forEach(function(b,c){j.length>=g||a&&k(b,h.concat(c))})):f(b)&&(this.keys(b).forEach(function(a){j.length>=g||d(a,b[a],c)&&j.push({path:h.concat(a),value:b[a]})}),this.keys(b).forEach(function(c){j.length>=g||a&&k(b[c],h.concat(c))}))}.bind(this);return k(h,i),j}}function h(a){return function(b,c,d){return this.descend(c,b.expression.value,a,d)}}function i(a){return function(b,c,d){return this.traverse(c,b.expression.value,a,d)}}function j(){try{return o.apply(this,arguments)}catch(a){}}function k(a){return a=a.filter(function(a){return a}),p(a,function(a){return a.path.map(function(a){return String(a).replace("-","--")}).join("-")})}function l(a){var b=String(a);return b.match(/^-?[0-9]+$/)?parseInt(b):null}var m=a("./aesprim"),n=a("./slice"),o=a("static-eval"),p=a("underscore").uniq,q=function(){return this.initialize.apply(this,arguments)};q.prototype.initialize=function(){this.traverse=g(!0),this.descend=g()},q.prototype.keys=Object.keys,q.prototype.resolve=function(a){var b=[a.operation,a.scope,a.expression.type].join("-"),c=this._fns[b];if(!c)throw new Error("couldn't resolve key: "+b);return c.bind(this)},q.prototype.register=function(a,b){if(!b instanceof Function)throw new Error("handler must be a function");this._fns[a]=b},q.prototype._fns={"member-child-identifier":function(a,b){var c=a.expression.value,d=b.value;if(d instanceof Object&&c in d)return[{value:d[c],path:b.path.concat(c)}]},"member-descendant-identifier":i(function(a,b,c){return a==c}),"subscript-child-numeric_literal":h(function(a,b,c){return a===c}),"member-child-numeric_literal":h(function(a,b,c){return String(a)===String(c)}),"subscript-descendant-numeric_literal":i(function(a,b,c){return a===c}),"member-child-wildcard":h(function(){return!0}),"member-descendant-wildcard":i(function(){return!0}),"subscript-descendant-wildcard":i(function(){return!0}),"subscript-child-wildcard":h(function(){return!0}),"subscript-child-slice":function(a,b){if(e(b.value)){var c=a.expression.value.split(":").map(l),d=b.value.map(function(a,c){return{value:a,path:b.path.concat(c)}});return n.apply(null,[d].concat(c))}},"subscript-child-union":function(a,b){var c=[];return a.expression.value.forEach(function(a){var d={operation:"subscript",scope:"child",expression:a.expression},e=this.resolve(d),f=e(d,b);f&&(c=c.concat(f))},this),k(c)},"subscript-descendant-union":function(b,c,d){var e=a(".."),f=this,g=[];return e.nodes(c,"$..*").slice(1).forEach(function(a){g.length>=d||b.expression.value.forEach(function(b){var c={operation:"subscript",scope:"child",expression:b.expression},d=f.resolve(c),e=d(c,a);g=g.concat(e)})}),k(g)},"subscript-child-filter_expression":function(a,b,c){var d=a.expression.value.slice(2,-1),e=m.parse(d).body[0].expression,f=function(a,b){return j(e,{"@":b})};return this.descend(b,null,f,c)},"subscript-descendant-filter_expression":function(a,b,c){var d=a.expression.value.slice(2,-1),e=m.parse(d).body[0].expression,f=function(a,b){return j(e,{"@":b})};return this.traverse(b,null,f,c)},"subscript-child-script_expression":function(a,b){return d(b,a.expression.value.slice(1,-1),"$[{{value}}]")},"member-child-script_expression":function(a,b){return d(b,a.expression.value.slice(1,-1),"$.{{value}}")},"member-descendant-script_expression":function(a,b){return d(b,a.expression.value.slice(1,-1),"$..value")}},q.prototype._fns["subscript-child-string_literal"]=q.prototype._fns["member-child-identifier"],q.prototype._fns["member-descendant-numeric_literal"]=q.prototype._fns["subscript-descendant-string_literal"]=q.prototype._fns["member-descendant-identifier"],b.exports=q},{"..":"jsonpath","./aesprim":"./aesprim","./index":5,"./slice":7,"static-eval":15,underscore:16}],5:[function(a,b,c){function d(a){return"[object String]"==Object.prototype.toString.call(a)}var e=a("assert"),f=a("./dict"),g=a("./parser"),h=a("./handlers"),i=function(){this.initialize.apply(this,arguments)};i.prototype.initialize=function(){this.parser=new g,this.handlers=new h},i.prototype.parse=function(a){return e.ok(d(a),"we need a path"),this.parser.parse(a)},i.prototype.parent=function(a,b){e.ok(a instanceof Object,"obj needs to be an object"),e.ok(b,"we need a path");var c=this.nodes(a,b)[0];c.path.pop();return this.value(a,c.path)},i.prototype.apply=function(a,b,c){e.ok(a instanceof Object,"obj needs to be an object"),e.ok(b,"we need a path"),e.equal(typeof c,"function","fn needs to be function");var d=this.nodes(a,b).sort(function(a,b){return b.path.length-a.path.length});return d.forEach(function(b){var d=b.path.pop(),e=this.value(a,this.stringify(b.path)),f=b.value=c.call(a,e[d]);e[d]=f},this),d},i.prototype.value=function(a,b,c){if(e.ok(a instanceof Object,"obj needs to be an object"),e.ok(b,"we need a path"),arguments.length>=3){var d=this.nodes(a,b).shift();if(!d)return this._vivify(a,b,c);var f=d.path.slice(-1).shift();this.parent(a,this.stringify(d.path))[f]=c}return this.query(a,this.stringify(b),1).shift()},i.prototype._vivify=function(a,b,c){var d=this;e.ok(a instanceof Object,"obj needs to be an object"),e.ok(b,"we need a path");var f=this.parser.parse(b).map(function(a){return a.expression.value}),g=function(b,c){var e=b.pop(),f=d.value(a,b);f||(g(b.concat(),"string"==typeof e?{}:[]),f=d.value(a,b)),f[e]=c};return g(f,c),this.query(a,b)[0]},i.prototype.query=function(a,b,c){return e.ok(a instanceof Object,"obj needs to be an object"),e.ok(d(b),"we need a path"),this.nodes(a,b,c).map(function(a){return a.value})},i.prototype.paths=function(a,b,c){return e.ok(a instanceof Object,"obj needs to be an object"),e.ok(b,"we need a path"),this.nodes(a,b,c).map(function(a){return a.path})},i.prototype.nodes=function(a,b,c){if(e.ok(a instanceof Object,"obj needs to be an object"),e.ok(b,"we need a path"),0===c)return[];var d=this.parser.parse(b),f=this.handlers,g=[{path:["$"],value:a}],h=[];return d.length&&"root"==d[0].expression.type&&d.shift(),d.length?(d.forEach(function(a,b){if(!(h.length>=c)){var e=f.resolve(a),i=[];g.forEach(function(f){if(!(h.length>=c)){var g=e(a,f,c);b==d.length-1?h=h.concat(g||[]):i=i.concat(g||[])}}),g=i}}),c?h.slice(0,c):h):g}, +i.prototype.stringify=function(a){e.ok(a,"we need a path");var b="$",c={"descendant-member":"..{{value}}","child-member":".{{value}}","descendant-subscript":"..[{{value}}]","child-subscript":"[{{value}}]"};return a=this._normalize(a),a.forEach(function(a){if("root"!=a.expression.type){var d,e=[a.scope,a.operation].join("-"),f=c[e];if(d="string_literal"==a.expression.type?JSON.stringify(a.expression.value):a.expression.value,!f)throw new Error("couldn't find template "+e);b+=f.replace(/{{value}}/,d)}}),b},i.prototype._normalize=function(a){if(e.ok(a,"we need a path"),"string"==typeof a)return this.parser.parse(a);if(Array.isArray(a)&&"string"==typeof a[0]){var b=[{expression:{type:"root",value:"$"}}];return a.forEach(function(a,c){if("$"!=a||0!==c)if("string"==typeof a&&a.match("^"+f.identifier+"$"))b.push({operation:"member",scope:"child",expression:{value:a,type:"identifier"}});else{var d="number"==typeof a?"numeric_literal":"string_literal";b.push({operation:"subscript",scope:"child",expression:{value:a,type:d}})}}),b}if(Array.isArray(a)&&"object"==typeof a[0])return a;throw new Error("couldn't understand path "+a)},i.Handlers=h,i.Parser=g;var j=new i;j.JSONPath=i,b.exports=j},{"./dict":2,"./handlers":4,"./parser":6,assert:8}],6:[function(a,b,c){var d=a("./grammar"),e=a("../generated/parser"),f=function(){var a=new e.Parser,b=a.parseError;return a.yy.parseError=function(){a.yy.ast&&a.yy.ast.initialize(),b.apply(a,arguments)},a};f.grammar=d,b.exports=f},{"../generated/parser":1,"./grammar":3}],7:[function(a,b,c){function d(a){return String(a).match(/^[0-9]+$/)?parseInt(a):Number.isFinite(a)?parseInt(a,10):0}b.exports=function(a,b,c,e){if("string"==typeof b)throw new Error("start cannot be a string");if("string"==typeof c)throw new Error("end cannot be a string");if("string"==typeof e)throw new Error("step cannot be a string");var f=a.length;if(0===e)throw new Error("step cannot be zero");if(e=e?d(e):1,b=b<0?f+b:b,c=c<0?f+c:c,b=d(0===b?0:b||(e>0?0:f-1)),c=d(0===c?0:c||(e>0?f:-1)),b=e>0?Math.max(0,b):Math.min(f,b),c=e>0?Math.min(c,f):Math.max(-1,c),e>0&&c<=b)return[];if(e<0&&b<=c)return[];for(var g=[],h=b;h!=c&&!(e<0&&h<=c||e>0&&h>=c);h+=e)g.push(a[h]);return g}},{}],8:[function(a,b,c){function d(a,b){return n.isUndefined(b)?""+b:n.isNumber(b)&&!isFinite(b)?b.toString():n.isFunction(b)||n.isRegExp(b)?b.toString():b}function e(a,b){return n.isString(a)?a.length=0;f--)if(g[f]!=h[f])return!1;for(f=g.length-1;f>=0;f--)if(e=g[f],!i(a[e],b[e]))return!1;return!0}function l(a,b){return!(!a||!b)&&("[object RegExp]"==Object.prototype.toString.call(b)?b.test(a):a instanceof b||!0===b.call({},a))}function m(a,b,c,d){var e;n.isString(c)&&(d=c,c=null);try{b()}catch(f){e=f}if(d=(c&&c.name?" ("+c.name+").":".")+(d?" "+d:"."),a&&!e&&g(e,c,"Missing expected exception"+d),!a&&l(e,c)&&g(e,c,"Got unwanted exception"+d),a&&e&&c&&!l(e,c)||!a&&e)throw e}var n=a("util/"),o=Array.prototype.slice,p=Object.prototype.hasOwnProperty,q=b.exports=h;q.AssertionError=function(a){this.name="AssertionError",this.actual=a.actual,this.expected=a.expected,this.operator=a.operator,a.message?(this.message=a.message,this.generatedMessage=!1):(this.message=f(this),this.generatedMessage=!0);var b=a.stackStartFunction||g;if(Error.captureStackTrace)Error.captureStackTrace(this,b);else{var c=new Error;if(c.stack){var d=c.stack,e=b.name,h=d.indexOf("\n"+e);if(h>=0){var i=d.indexOf("\n",h+1);d=d.substring(i+1)}this.stack=d}}},n.inherits(q.AssertionError,Error),q.fail=g,q.ok=h,q.equal=function(a,b,c){a!=b&&g(a,b,c,"==",q.equal)},q.notEqual=function(a,b,c){a==b&&g(a,b,c,"!=",q.notEqual)},q.deepEqual=function(a,b,c){i(a,b)||g(a,b,c,"deepEqual",q.deepEqual)},q.notDeepEqual=function(a,b,c){i(a,b)&&g(a,b,c,"notDeepEqual",q.notDeepEqual)},q.strictEqual=function(a,b,c){a!==b&&g(a,b,c,"===",q.strictEqual)},q.notStrictEqual=function(a,b,c){a===b&&g(a,b,c,"!==",q.notStrictEqual)},q.throws=function(a,b,c){m.apply(this,[!0].concat(o.call(arguments)))},q.doesNotThrow=function(a,b){m.apply(this,[!1].concat(o.call(arguments)))},q.ifError=function(a){if(a)throw a};var r=Object.keys||function(a){var b=[];for(var c in a)p.call(a,c)&&b.push(c);return b}},{"util/":11}],9:[function(a,b,c){"function"==typeof Object.create?b.exports=function(a,b){a.super_=b,a.prototype=Object.create(b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}})}:b.exports=function(a,b){a.super_=b;var c=function(){};c.prototype=b.prototype,a.prototype=new c,a.prototype.constructor=a}},{}],10:[function(a,b,c){b.exports=function(a){return a&&"object"==typeof a&&"function"==typeof a.copy&&"function"==typeof a.fill&&"function"==typeof a.readUInt8}},{}],11:[function(a,b,c){(function(b,d){function e(a,b){var d={seen:[],stylize:g};return arguments.length>=3&&(d.depth=arguments[2]),arguments.length>=4&&(d.colors=arguments[3]),p(b)?d.showHidden=b:b&&c._extend(d,b),v(d.showHidden)&&(d.showHidden=!1),v(d.depth)&&(d.depth=2),v(d.colors)&&(d.colors=!1),v(d.customInspect)&&(d.customInspect=!0),d.colors&&(d.stylize=f),i(d,a,d.depth)}function f(a,b){var c=e.styles[b];return c?"["+e.colors[c][0]+"m"+a+"["+e.colors[c][1]+"m":a}function g(a,b){return a}function h(a){var b={};return a.forEach(function(a,c){b[a]=!0}),b}function i(a,b,d){if(a.customInspect&&b&&A(b.inspect)&&b.inspect!==c.inspect&&(!b.constructor||b.constructor.prototype!==b)){var e=b.inspect(d,a);return t(e)||(e=i(a,e,d)),e}var f=j(a,b);if(f)return f;var g=Object.keys(b),p=h(g);if(a.showHidden&&(g=Object.getOwnPropertyNames(b)),z(b)&&(g.indexOf("message")>=0||g.indexOf("description")>=0))return k(b);if(0===g.length){if(A(b)){var q=b.name?": "+b.name:"";return a.stylize("[Function"+q+"]","special")}if(w(b))return a.stylize(RegExp.prototype.toString.call(b),"regexp");if(y(b))return a.stylize(Date.prototype.toString.call(b),"date");if(z(b))return k(b)}var r="",s=!1,u=["{","}"];if(o(b)&&(s=!0,u=["[","]"]),A(b)){r=" [Function"+(b.name?": "+b.name:"")+"]"}if(w(b)&&(r=" "+RegExp.prototype.toString.call(b)),y(b)&&(r=" "+Date.prototype.toUTCString.call(b)),z(b)&&(r=" "+k(b)),0===g.length&&(!s||0==b.length))return u[0]+r+u[1];if(d<0)return w(b)?a.stylize(RegExp.prototype.toString.call(b),"regexp"):a.stylize("[Object]","special");a.seen.push(b);var v;return v=s?l(a,b,d,p,g):g.map(function(c){return m(a,b,d,p,c,s)}),a.seen.pop(),n(v,r,u)}function j(a,b){if(v(b))return a.stylize("undefined","undefined");if(t(b)){var c="'"+JSON.stringify(b).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return a.stylize(c,"string")}return s(b)?a.stylize(""+b,"number"):p(b)?a.stylize(""+b,"boolean"):q(b)?a.stylize("null","null"):void 0}function k(a){return"["+Error.prototype.toString.call(a)+"]"}function l(a,b,c,d,e){for(var f=[],g=0,h=b.length;g-1&&(h=f?h.split("\n").map(function(a){return" "+a}).join("\n").substr(2):"\n"+h.split("\n").map(function(a){return" "+a}).join("\n"))):h=a.stylize("[Circular]","special")),v(g)){if(f&&e.match(/^\d+$/))return h;g=JSON.stringify(""+e),g.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(g=g.substr(1,g.length-2),g=a.stylize(g,"name")):(g=g.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),g=a.stylize(g,"string"))}return g+": "+h}function n(a,b,c){var d=0;return a.reduce(function(a,b){return d++,b.indexOf("\n")>=0&&d++,a+b.replace(/\u001b\[\d\d?m/g,"").length+1},0)>60?c[0]+(""===b?"":b+"\n ")+" "+a.join(",\n ")+" "+c[1]:c[0]+b+" "+a.join(", ")+" "+c[1]}function o(a){return Array.isArray(a)}function p(a){return"boolean"==typeof a}function q(a){return null===a}function r(a){return null==a}function s(a){return"number"==typeof a}function t(a){return"string"==typeof a}function u(a){return"symbol"==typeof a}function v(a){return void 0===a}function w(a){return x(a)&&"[object RegExp]"===C(a)}function x(a){return"object"==typeof a&&null!==a}function y(a){return x(a)&&"[object Date]"===C(a)}function z(a){return x(a)&&("[object Error]"===C(a)||a instanceof Error)}function A(a){return"function"==typeof a}function B(a){return null===a||"boolean"==typeof a||"number"==typeof a||"string"==typeof a||"symbol"==typeof a||void 0===a}function C(a){return Object.prototype.toString.call(a)}function D(a){return a<10?"0"+a.toString(10):a.toString(10)}function E(){var a=new Date,b=[D(a.getHours()),D(a.getMinutes()),D(a.getSeconds())].join(":");return[a.getDate(),J[a.getMonth()],b].join(" ")}function F(a,b){return Object.prototype.hasOwnProperty.call(a,b)}var G=/%[sdj%]/g;c.format=function(a){if(!t(a)){for(var b=[],c=0;c=f)return a;switch(a){case"%s":return String(d[c++]);case"%d":return Number(d[c++]);case"%j":try{return JSON.stringify(d[c++])}catch(b){return"[Circular]"}default:return a}}),h=d[c];c=0;d--){var e=a[d];"."===e?a.splice(d,1):".."===e?(a.splice(d,1),c++):c&&(a.splice(d,1),c--)}if(b)for(;c--;c)a.unshift("..");return a}function d(a){"string"!=typeof a&&(a+="");var b,c=0,d=-1,e=!0;for(b=a.length-1;b>=0;--b)if(47===a.charCodeAt(b)){if(!e){c=b+1;break}}else-1===d&&(e=!1,d=b+1);return-1===d?"":a.slice(c,d)}function e(a,b){if(a.filter)return a.filter(b);for(var c=[],d=0;d=-1&&!d;f--){var g=f>=0?arguments[f]:a.cwd();if("string"!=typeof g)throw new TypeError("Arguments to path.resolve must be strings");g&&(c=g+"/"+c,d="/"===g.charAt(0))}return c=b(e(c.split("/"),function(a){return!!a}),!d).join("/"),(d?"/":"")+c||"."},c.normalize=function(a){var d=c.isAbsolute(a),g="/"===f(a,-1);return a=b(e(a.split("/"),function(a){return!!a}),!d).join("/"),a||d||(a="."),a&&g&&(a+="/"),(d?"/":"")+a},c.isAbsolute=function(a){return"/"===a.charAt(0)},c.join=function(){var a=Array.prototype.slice.call(arguments,0);return c.normalize(e(a,function(a,b){if("string"!=typeof a)throw new TypeError("Arguments to path.join must be strings");return a}).join("/"))},c.relative=function(a,b){function d(a){for(var b=0;b=0&&""===a[c];c--);return b>c?[]:a.slice(b,c-b+1)}a=c.resolve(a).substr(1),b=c.resolve(b).substr(1);for(var e=d(a.split("/")),f=d(b.split("/")),g=Math.min(e.length,f.length),h=g,i=0;i=1;--f)if(47===(b=a.charCodeAt(f))){if(!e){d=f;break}}else e=!1;return-1===d?c?"/":".":c&&1===d?"/":a.slice(0,d)},c.basename=function(a,b){var c=d(a);return b&&c.substr(-1*b.length)===b&&(c=c.substr(0,c.length-b.length)),c},c.extname=function(a){"string"!=typeof a&&(a+="");for(var b=-1,c=0,d=-1,e=!0,f=0,g=a.length-1;g>=0;--g){var h=a.charCodeAt(g);if(47!==h)-1===d&&(e=!1,d=g+1),46===h?-1===b?b=g:1!==f&&(f=1):-1!==b&&(f=-1);else if(!e){c=g+1;break}}return-1===b||-1===d||0===f||1===f&&b===d-1&&b===c+1?"":a.slice(b,d)};var f="b"==="ab".substr(-1)?function(a,b,c){return a.substr(b,c)}:function(a,b,c){return b<0&&(b=a.length+b),a.substr(b,c)}}).call(this,a("_process"))},{_process:14}],14:[function(a,b,c){function d(){throw new Error("setTimeout has not been defined")}function e(){throw new Error("clearTimeout has not been defined")}function f(a){if(l===setTimeout)return setTimeout(a,0);if((l===d||!l)&&setTimeout)return l=setTimeout,setTimeout(a,0);try{return l(a,0)}catch(b){try{return l.call(null,a,0)}catch(b){return l.call(this,a,0)}}}function g(a){if(m===clearTimeout)return clearTimeout(a);if((m===e||!m)&&clearTimeout)return m=clearTimeout,clearTimeout(a);try{return m(a)}catch(b){try{return m.call(null,a)}catch(b){return m.call(this,a)}}}function h(){q&&o&&(q=!1,o.length?p=o.concat(p):r=-1,p.length&&i())}function i(){if(!q){var a=f(h);q=!0;for(var b=p.length;b;){for(o=p,p=[];++r1)for(var c=1;c"===p?j>o:">="===p?j>=o:"|"===p?j|o:"&"===p?j&o:"^"===p?j^o:"&&"===p?j&&o:"||"===p?j||o:c}if("Identifier"===e.type)return{}.hasOwnProperty.call(b,e.name)?b[e.name]:c;if("ThisExpression"===e.type)return{}.hasOwnProperty.call(b,"this")?b.this:c;if("CallExpression"===e.type){var q=a(e.callee);if(q===c)return c;if("function"!=typeof q)return c;var r=e.callee.object?a(e.callee.object):c;r===c&&(r=null);for(var s=[],i=0,j=e.arguments.length;i=0)},q.invoke=function(a,b){var c=j.call(arguments,2),d=q.isFunction(b);return q.map(a,function(a){return(d?b:a[b]).apply(a,c)})},q.pluck=function(a,b){return q.map(a,q.property(b))},q.where=function(a,b){return q.filter(a,q.matches(b))},q.findWhere=function(a,b){return q.find(a,q.matches(b))},q.max=function(a,b,c){var d,e,f=-1/0,g=-1/0;if(null==b&&null!=a){a=a.length===+a.length?a:q.values(a);for(var h=0,i=a.length;hf&&(f=d)}else b=q.iteratee(b,c),q.each(a,function(a,c,d){((e=b(a,c,d))>g||e===-1/0&&f===-1/0)&&(f=a,g=e)});return f},q.min=function(a,b,c){var d,e,f=1/0,g=1/0;if(null==b&&null!=a){a=a.length===+a.length?a:q.values(a);for(var h=0,i=a.length;hd||void 0===c)return 1;if(c>>1;c(a[h])=0;)if(a[d]===b)return d;return-1},q.range=function(a,b,c){arguments.length<=1&&(b=a||0,a=0),c=c||1;for(var d=Math.max(Math.ceil((b-a)/c),0),e=Array(d),f=0;fb?(clearTimeout(g),g=null,h=j,f=a.apply(d,e),g||(d=e=null)):g||!1===c.trailing||(g=setTimeout(i,k)),f}},q.debounce=function(a,b,c){var d,e,f,g,h,i=function(){var j=q.now()-g;j0?d=setTimeout(i,b-j):(d=null,c||(h=a.apply(f,e),d||(f=e=null)))};return function(){f=this,e=arguments,g=q.now();var j=c&&!d;return d||(d=setTimeout(i,b)),j&&(h=a.apply(f,e),f=e=null),h}},q.wrap=function(a,b){return q.partial(b,a)},q.negate=function(a){return function(){return!a.apply(this,arguments)}},q.compose=function(){var a=arguments,b=a.length-1;return function(){for(var c=b,d=a[b].apply(this,arguments);c--;)d=a[c].call(this,d);return d}},q.after=function(a,b){return function(){if(--a<1)return b.apply(this,arguments)}},q.before=function(a,b){var c;return function(){return--a>0?c=b.apply(this,arguments):b=null,c}},q.once=q.partial(q.before,2),q.keys=function(a){if(!q.isObject(a))return[];if(o)return o(a);var b=[];for(var c in a)q.has(a,c)&&b.push(c);return b},q.values=function(a){for(var b=q.keys(a),c=b.length,d=Array(c),e=0;e":">",'"':""","'":"'","`":"`"},y=q.invert(x),z=function(a){ +var b=function(b){return a[b]},c="(?:"+q.keys(a).join("|")+")",d=RegExp(c),e=RegExp(c,"g");return function(a){return a=null==a?"":""+a,d.test(a)?a.replace(e,b):a}};q.escape=z(x),q.unescape=z(y),q.result=function(a,b){if(null!=a){var c=a[b];return q.isFunction(c)?a[b]():c}};var A=0;q.uniqueId=function(a){var b=++A+"";return a?a+b:b},q.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var B=/(.)^/,C={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},D=/\\|'|\r|\n|\u2028|\u2029/g,E=function(a){return"\\"+C[a]};q.template=function(a,b,c){!b&&c&&(b=c),b=q.defaults({},b,q.templateSettings);var d=RegExp([(b.escape||B).source,(b.interpolate||B).source,(b.evaluate||B).source].join("|")+"|$","g"),e=0,f="__p+='";a.replace(d,function(b,c,d,g,h){return f+=a.slice(e,h).replace(D,E),e=h+b.length,c?f+="'+\n((__t=("+c+"))==null?'':_.escape(__t))+\n'":d?f+="'+\n((__t=("+d+"))==null?'':__t)+\n'":g&&(f+="';\n"+g+"\n__p+='"),b}),f+="';\n",b.variable||(f="with(obj||{}){\n"+f+"}\n"),f="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+f+"return __p;\n";try{var g=new Function(b.variable||"obj","_",f)}catch(j){throw j.source=f,j}var h=function(a){return g.call(this,a,q)},i=b.variable||"obj";return h.source="function("+i+"){\n"+f+"}",h},q.chain=function(a){var b=q(a);return b._chain=!0,b};var F=function(a){return this._chain?q(a).chain():a};q.mixin=function(a){q.each(q.functions(a),function(b){var c=q[b]=a[b];q.prototype[b]=function(){var a=[this._wrapped];return i.apply(a,arguments),F.call(this,c.apply(q,a))}})},q.mixin(q),q.each(["pop","push","reverse","shift","sort","splice","unshift"],function(a){var b=f[a];q.prototype[a]=function(){var c=this._wrapped;return b.apply(c,arguments),"shift"!==a&&"splice"!==a||0!==c.length||delete c[0],F.call(this,c)}}),q.each(["concat","join","slice"],function(a){var b=f[a];q.prototype[a]=function(){return F.call(this,b.apply(this._wrapped,arguments))}}),q.prototype.value=function(){return this._wrapped},"function"==typeof a&&a.amd&&a("underscore",[],function(){return q})}).call(this)},{}],jsonpath:[function(a,b,c){b.exports=a("./lib/index")},{"./lib/index":5}]},{},["jsonpath"])("jsonpath")}); \ No newline at end of file From 8b09b07366a77e269606137d8f0cde55964f2f5f Mon Sep 17 00:00:00 2001 From: "William J. Edney" Date: Thu, 7 Mar 2019 06:44:53 -0600 Subject: [PATCH 2/3] Bug: push key back on after obtaining value so that full path is available to results --- jsonpath.js | 1 + jsonpath.min.js | 2 +- lib/index.js | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/jsonpath.js b/jsonpath.js index 81c0ae2..8da7221 100644 --- a/jsonpath.js +++ b/jsonpath.js @@ -4907,6 +4907,7 @@ JSONPath.prototype.apply = function(obj, string, fn) { var parent = this.value(obj, this.stringify(node.path)); var val = node.value = fn.call(obj, parent[key]); parent[key] = val; + node.path.push(key); }, this); return nodes; diff --git a/jsonpath.min.js b/jsonpath.min.js index 9f237c9..e584223 100644 --- a/jsonpath.min.js +++ b/jsonpath.min.js @@ -1,5 +1,5 @@ /*! jsonpath 1.0.1 */ !function(a){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=a();else if("function"==typeof define&&define.amd)define([],a);else{var b;b="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,b.jsonpath=a()}}(function(){var a;return function a(b,c,d){function e(g,h){if(!c[g]){if(!b[g]){var i="function"==typeof require&&require;if(!h&&i)return i(g,!0);if(f)return f(g,!0);var j=new Error("Cannot find module '"+g+"'");throw j.code="MODULE_NOT_FOUND",j}var k=c[g]={exports:{}};b[g][0].call(k.exports,function(a){var c=b[g][1][a];return e(c||a)},k,k.exports,a,b,c,d)}return c[g].exports}for(var f="function"==typeof require&&require,g=0;g=48&&a<=57}function d(a){return"0123456789abcdefABCDEF".indexOf(a)>=0}function e(a){return"01234567".indexOf(a)>=0}function f(a){return 32===a||9===a||11===a||12===a||160===a||a>=5760&&[5760,6158,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279].indexOf(a)>=0}function g(a){return 10===a||13===a||8232===a||8233===a}function h(a){return 64==a||36===a||95===a||a>=65&&a<=90||a>=97&&a<=122||92===a||a>=128&&eb.NonAsciiIdentifierStart.test(String.fromCharCode(a))}function i(a){return 36===a||95===a||a>=65&&a<=90||a>=97&&a<=122||a>=48&&a<=57||92===a||a>=128&&eb.NonAsciiIdentifierPart.test(String.fromCharCode(a))}function j(a){switch(a){case"class":case"enum":case"export":case"extends":case"import":case"super":return!0;default:return!1}}function k(a){switch(a){case"implements":case"interface":case"package":case"private":case"protected":case"public":case"static":case"yield":case"let":return!0;default:return!1}}function l(a){return"eval"===a||"arguments"===a}function m(a){if(hb&&k(a))return!0;switch(a.length){case 2:return"if"===a||"in"===a||"do"===a;case 3:return"var"===a||"for"===a||"new"===a||"try"===a||"let"===a;case 4:return"this"===a||"else"===a||"case"===a||"void"===a||"with"===a||"enum"===a;case 5:return"while"===a||"break"===a||"catch"===a||"throw"===a||"const"===a||"yield"===a||"class"===a||"super"===a;case 6:return"return"===a||"typeof"===a||"delete"===a||"switch"===a||"export"===a||"import"===a;case 7:return"default"===a||"finally"===a||"extends"===a;case 8:return"function"===a||"continue"===a||"debugger"===a;case 10:return"instanceof"===a;default:return!1}}function n(a,c,d,e,f){var g;b("number"==typeof d,"Comment must have valid position"),ob.lastCommentStart>=d||(ob.lastCommentStart=d,g={type:a,value:c},pb.range&&(g.range=[d,e]),pb.loc&&(g.loc=f),pb.comments.push(g),pb.attachComment&&(pb.leadingComments.push(g),pb.trailingComments.push(g)))}function o(a){var b,c,d,e;for(b=ib-a,c={start:{line:jb,column:ib-kb-a}};ib=lb&&O({},db.UnexpectedToken,"ILLEGAL");else if(42===c){if(47===gb.charCodeAt(ib+1))return++ib,++ib,void(pb.comments&&(d=gb.slice(a+2,ib-2),b.end={line:jb,column:ib-kb},n("Block",d,a,ib,b)));++ib}else++ib;O({},db.UnexpectedToken,"ILLEGAL")}function q(){var a,b;for(b=0===ib;ib>>="===(d=gb.substr(ib,4))?(ib+=4,{type:$a.Punctuator,value:d,lineNumber:jb,lineStart:kb,start:e,end:ib}):">>>"===(c=d.substr(0,3))||"<<="===c||">>="===c?(ib+=3,{type:$a.Punctuator,value:c,lineNumber:jb,lineStart:kb,start:e,end:ib}):(b=c.substr(0,2),g===b[1]&&"+-<>&|".indexOf(g)>=0||"=>"===b?(ib+=2,{type:$a.Punctuator,value:b,lineNumber:jb,lineStart:kb,start:e,end:ib}):"<>=!+-*%&|^/".indexOf(g)>=0?(++ib,{type:$a.Punctuator,value:g,lineNumber:jb,lineStart:kb,start:e,end:ib}):void O({},db.UnexpectedToken,"ILLEGAL"))}function w(a){for(var b="";ib=0&&ib0&&(d=pb.tokens[pb.tokens.length-1],d.range[0]===a&&"Punctuator"===d.type&&("/"!==d.value&&"/="!==d.value||pb.tokens.pop())),pb.tokens.push({type:"RegularExpression",value:c.literal,range:[a,ib],loc:b})),c}function F(a){return a.type===$a.Identifier||a.type===$a.Keyword||a.type===$a.BooleanLiteral||a.type===$a.NullLiteral}function G(){var a,b;if(!(a=pb.tokens[pb.tokens.length-1]))return E();if("Punctuator"===a.type){if("]"===a.value)return v();if(")"===a.value)return b=pb.tokens[pb.openParenToken-1],!b||"Keyword"!==b.type||"if"!==b.value&&"while"!==b.value&&"for"!==b.value&&"with"!==b.value?v():E();if("}"===a.value){if(pb.tokens[pb.openCurlyToken-3]&&"Keyword"===pb.tokens[pb.openCurlyToken-3].type){if(!(b=pb.tokens[pb.openCurlyToken-4]))return v()}else{if(!pb.tokens[pb.openCurlyToken-4]||"Keyword"!==pb.tokens[pb.openCurlyToken-4].type)return v();if(!(b=pb.tokens[pb.openCurlyToken-5]))return E()}return ab.indexOf(b.value)>=0?v():E()}return E()}return"Keyword"===a.type?E():v()}function H(){var a;return q(),ib>=lb?{type:$a.EOF,lineNumber:jb,lineStart:kb,start:ib,end:ib}:(a=gb.charCodeAt(ib),h(a)?u():40===a||41===a||59===a?v():39===a||34===a?z():46===a?c(gb.charCodeAt(ib+1))?y():v():c(a)?y():pb.tokenize&&47===a?G():v())}function I(){var a,b,c;return q(),a={start:{line:jb,column:ib-kb}},b=H(),a.end={line:jb,column:ib-kb},b.type!==$a.EOF&&(c=gb.slice(b.start,b.end),pb.tokens.push({type:_a[b.type],value:c,range:[b.start,b.end],loc:a})),b}function J(){var a;return a=nb,ib=a.end,jb=a.lineNumber,kb=a.lineStart,nb=void 0!==pb.tokens?I():H(),ib=a.end,jb=a.lineNumber,kb=a.lineStart,a}function K(){var a,b,c;a=ib,b=jb,c=kb,nb=void 0!==pb.tokens?I():H(),ib=a,jb=b,kb=c}function L(a,b){this.line=a,this.column=b}function M(a,b,c,d){this.start=new L(a,b),this.end=new L(c,d)}function N(){var a,b,c,d;return a=ib,b=jb,c=kb,q(),d=jb!==b,ib=a,jb=b,kb=c,d}function O(a,c){var d,e=Array.prototype.slice.call(arguments,2),f=c.replace(/%(\d)/g,function(a,c){return b(c>="===a||">>>="===a||"&="===a||"^="===a||"|="===a)}function W(){var a;if(59===gb.charCodeAt(ib)||T(";"))return void J();a=jb,q(),jb===a&&(nb.type===$a.EOF||T("}")||Q(nb))}function X(a){return a.type===bb.Identifier||a.type===bb.MemberExpression}function Y(){var a,b=[];for(a=nb,R("[");!T("]");)T(",")?(J(),b.push(null)):(b.push(pa()),T("]")||R(","));return J(),mb.markEnd(mb.createArrayExpression(b),a)}function Z(a,b){var c,d,e;return c=hb,e=nb,d=Qa(),b&&hb&&l(a[0].name)&&P(b,db.StrictParamName),hb=c,mb.markEnd(mb.createFunctionExpression(null,a,[],d),e)}function $(){var a,b;return b=nb,a=J(),a.type===$a.StringLiteral||a.type===$a.NumericLiteral?(hb&&a.octal&&P(a,db.StrictOctalLiteral),mb.markEnd(mb.createLiteral(a),b)):mb.markEnd(mb.createIdentifier(a.value),b)}function _(){var a,b,c,d,e,f;return a=nb,f=nb,a.type===$a.Identifier?(c=$(),"get"!==a.value||T(":")?"set"!==a.value||T(":")?(R(":"),d=pa(),mb.markEnd(mb.createProperty("init",c,d),f)):(b=$(),R("("),a=nb,a.type!==$a.Identifier?(R(")"),P(a,db.UnexpectedToken,a.value),d=Z([])):(e=[ta()],R(")"),d=Z(e,a)),mb.markEnd(mb.createProperty("set",b,d),f)):(b=$(),R("("),R(")"),d=Z([]),mb.markEnd(mb.createProperty("get",b,d),f))):a.type!==$a.EOF&&a.type!==$a.Punctuator?(b=$(),R(":"),d=pa(),mb.markEnd(mb.createProperty("init",b,d),f)):void Q(a)}function aa(){var a,b,c,d,e,f=[],g={},h=String;for(e=nb,R("{");!T("}");)a=_(),b=a.key.type===bb.Identifier?a.key.name:h(a.key.value),d="init"===a.kind?cb.Data:"get"===a.kind?cb.Get:cb.Set,c="$"+b,Object.prototype.hasOwnProperty.call(g,c)?(g[c]===cb.Data?hb&&d===cb.Data?P({},db.StrictDuplicateProperty):d!==cb.Data&&P({},db.AccessorDataProperty):d===cb.Data?P({},db.AccessorDataProperty):g[c]&d&&P({},db.AccessorGetSet),g[c]|=d):g[c]=d,f.push(a),T("}")||R(",");return R("}"),mb.markEnd(mb.createObjectExpression(f),e)}function ba(){var a;return R("("),a=qa(),R(")"),a}function ca(){var a,b,c,d;if(T("("))return ba();if(T("["))return Y();if(T("{"))return aa();if(a=nb.type,d=nb,a===$a.Identifier)c=mb.createIdentifier(J().value);else if(a===$a.StringLiteral||a===$a.NumericLiteral)hb&&nb.octal&&P(nb,db.StrictOctalLiteral),c=mb.createLiteral(J());else if(a===$a.Keyword){if(U("function"))return Ta();U("this")?(J(),c=mb.createThisExpression()):Q(J())}else a===$a.BooleanLiteral?(b=J(),b.value="true"===b.value,c=mb.createLiteral(b)):a===$a.NullLiteral?(b=J(),b.value=null,c=mb.createLiteral(b)):T("/")||T("/=")?(c=void 0!==pb.tokens?mb.createLiteral(E()):mb.createLiteral(D()),K()):Q(J());return mb.markEnd(c,d)}function da(){var a=[];if(R("("),!T(")"))for(;ib":case"<=":case">=":case"instanceof":c=7;break;case"in":c=b?7:0;break;case"<<":case">>":case">>>":c=8;break;case"+":case"-":c=9;break;case"*":case"/":case"%":c=11}return c}function na(){var a,b,c,d,e,f,g,h,i,j;if(a=nb,i=la(),d=nb,0===(e=ma(d,ob.allowIn)))return i;for(d.prec=e,J(),b=[a,nb],g=la(),f=[i,d,g];(e=ma(nb,ob.allowIn))>0;){for(;f.length>2&&e<=f[f.length-2].prec;)g=f.pop(),h=f.pop().value,i=f.pop(),c=mb.createBinaryExpression(h,i,g),b.pop(),a=b[b.length-1],mb.markEnd(c,a),f.push(c);d=J(),d.prec=e,f.push(d),b.push(nb),c=la(),f.push(c)}for(j=f.length-1,c=f[j],b.pop();j>1;)c=mb.createBinaryExpression(f[j-1].value,f[j-2],c),j-=2,a=b.pop(),mb.markEnd(c,a);return c}function oa(){var a,b,c,d,e;return e=nb,a=na(),T("?")&&(J(),b=ob.allowIn,ob.allowIn=!0,c=pa(),ob.allowIn=b,R(":"),d=pa(),a=mb.createConditionalExpression(a,c,d),mb.markEnd(a,e)),a}function pa(){var a,b,c,d,e;return a=nb,e=nb,d=b=oa(),V()&&(X(b)||P({},db.InvalidLHSInAssignment),hb&&b.type===bb.Identifier&&l(b.name)&&P(a,db.StrictLHSAssignment),a=J(),c=pa(),d=mb.markEnd(mb.createAssignmentExpression(a.value,b,c),e)),d}function qa(){var a,b=nb;if(a=pa(),T(",")){for(a=mb.createSequenceExpression([a]);ib0?1:0,kb=0,lb=gb.length,nb=null,ob={allowIn:!0,labelSet:{},inFunctionBody:!1,inIteration:!1,inSwitch:!1,lastCommentStart:-1},pb={},b=b||{},b.tokens=!0,pb.tokens=[],pb.tokenize=!0,pb.openParenToken=-1,pb.openCurlyToken=-1,pb.range="boolean"==typeof b.range&&b.range,pb.loc="boolean"==typeof b.loc&&b.loc,"boolean"==typeof b.comment&&b.comment&&(pb.comments=[]),"boolean"==typeof b.tolerant&&b.tolerant&&(pb.errors=[]);try{if(K(),nb.type===$a.EOF)return pb.tokens;for(J();nb.type!==$a.EOF;)try{J()}catch(e){if(nb,pb.errors){pb.errors.push(e);break}throw e}Xa(),d=pb.tokens,void 0!==pb.comments&&(d.comments=pb.comments),void 0!==pb.errors&&(d.errors=pb.errors)}catch(f){throw f}finally{pb={}}return d}function Za(a,b){var c,d;d=String,"string"==typeof a||a instanceof String||(a=d(a)),mb=fb,gb=a,ib=0,jb=gb.length>0?1:0,kb=0,lb=gb.length,nb=null,ob={allowIn:!0,labelSet:{},inFunctionBody:!1,inIteration:!1,inSwitch:!1,lastCommentStart:-1},pb={},void 0!==b&&(pb.range="boolean"==typeof b.range&&b.range,pb.loc="boolean"==typeof b.loc&&b.loc,pb.attachComment="boolean"==typeof b.attachComment&&b.attachComment,pb.loc&&null!==b.source&&void 0!==b.source&&(pb.source=d(b.source)),"boolean"==typeof b.tokens&&b.tokens&&(pb.tokens=[]),"boolean"==typeof b.comment&&b.comment&&(pb.comments=[]),"boolean"==typeof b.tolerant&&b.tolerant&&(pb.errors=[]),pb.attachComment&&(pb.range=!0,pb.comments=[],pb.bottomRightStack=[],pb.trailingComments=[],pb.leadingComments=[]));try{c=Wa(),void 0!==pb.comments&&(c.comments=pb.comments),void 0!==pb.tokens&&(Xa(),c.tokens=pb.tokens),void 0!==pb.errors&&(c.errors=pb.errors)}catch(e){throw e}finally{pb={}}return c}var $a,_a,ab,bb,cb,db,eb,fb,gb,hb,ib,jb,kb,lb,mb,nb,ob,pb;$a={BooleanLiteral:1,EOF:2,Identifier:3,Keyword:4,NullLiteral:5,NumericLiteral:6,Punctuator:7,StringLiteral:8,RegularExpression:9},_a={},_a[$a.BooleanLiteral]="Boolean",_a[$a.EOF]="",_a[$a.Identifier]="Identifier",_a[$a.Keyword]="Keyword",_a[$a.NullLiteral]="Null",_a[$a.NumericLiteral]="Numeric",_a[$a.Punctuator]="Punctuator",_a[$a.StringLiteral]="String",_a[$a.RegularExpression]="RegularExpression",ab=["(","{","[","in","typeof","instanceof","new","return","case","delete","throw","void","=","+=","-=","*=","/=","%=","<<=",">>=",">>>=","&=","|=","^=",",","+","-","*","/","%","++","--","<<",">>",">>>","&","|","^","!","~","&&","||","?",":","===","==",">=","<=","<",">","!=","!=="],bb={AssignmentExpression:"AssignmentExpression",ArrayExpression:"ArrayExpression",BlockStatement:"BlockStatement",BinaryExpression:"BinaryExpression",BreakStatement:"BreakStatement",CallExpression:"CallExpression",CatchClause:"CatchClause",ConditionalExpression:"ConditionalExpression",ContinueStatement:"ContinueStatement",DoWhileStatement:"DoWhileStatement",DebuggerStatement:"DebuggerStatement",EmptyStatement:"EmptyStatement",ExpressionStatement:"ExpressionStatement",ForStatement:"ForStatement",ForInStatement:"ForInStatement",FunctionDeclaration:"FunctionDeclaration",FunctionExpression:"FunctionExpression",Identifier:"Identifier",IfStatement:"IfStatement",Literal:"Literal",LabeledStatement:"LabeledStatement",LogicalExpression:"LogicalExpression",MemberExpression:"MemberExpression",NewExpression:"NewExpression",ObjectExpression:"ObjectExpression",Program:"Program",Property:"Property",ReturnStatement:"ReturnStatement",SequenceExpression:"SequenceExpression",SwitchStatement:"SwitchStatement",SwitchCase:"SwitchCase",ThisExpression:"ThisExpression",ThrowStatement:"ThrowStatement",TryStatement:"TryStatement",UnaryExpression:"UnaryExpression",UpdateExpression:"UpdateExpression",VariableDeclaration:"VariableDeclaration",VariableDeclarator:"VariableDeclarator",WhileStatement:"WhileStatement",WithStatement:"WithStatement"},cb={Data:1,Get:2,Set:4},db={UnexpectedToken:"Unexpected token %0",UnexpectedNumber:"Unexpected number",UnexpectedString:"Unexpected string",UnexpectedIdentifier:"Unexpected identifier",UnexpectedReserved:"Unexpected reserved word",UnexpectedEOS:"Unexpected end of input",NewlineAfterThrow:"Illegal newline after throw",InvalidRegExp:"Invalid regular expression",UnterminatedRegExp:"Invalid regular expression: missing /",InvalidLHSInAssignment:"Invalid left-hand side in assignment",InvalidLHSInForIn:"Invalid left-hand side in for-in",MultipleDefaultsInSwitch:"More than one default clause in switch statement",NoCatchOrFinally:"Missing catch or finally after try",UnknownLabel:"Undefined label '%0'",Redeclaration:"%0 '%1' has already been declared",IllegalContinue:"Illegal continue statement",IllegalBreak:"Illegal break statement",IllegalReturn:"Illegal return statement",StrictModeWith:"Strict mode code may not include a with statement",StrictCatchVariable:"Catch variable may not be eval or arguments in strict mode",StrictVarName:"Variable name may not be eval or arguments in strict mode",StrictParamName:"Parameter name eval or arguments is not allowed in strict mode",StrictParamDupe:"Strict mode function may not have duplicate parameter names",StrictFunctionName:"Function name may not be eval or arguments in strict mode",StrictOctalLiteral:"Octal literals are not allowed in strict mode.",StrictDelete:"Delete of an unqualified identifier in strict mode.",StrictDuplicateProperty:"Duplicate data property in object literal not allowed in strict mode", -AccessorDataProperty:"Object literal may not have data and accessor property with the same name",AccessorGetSet:"Object literal may not have multiple get/set accessors with the same name",StrictLHSAssignment:"Assignment to eval or arguments is not allowed in strict mode",StrictLHSPostfix:"Postfix increment/decrement may not have eval or arguments operand in strict mode",StrictLHSPrefix:"Prefix increment/decrement may not have eval or arguments operand in strict mode",StrictReservedWord:"Use of future reserved word in strict mode"},eb={NonAsciiIdentifierStart:new RegExp("[ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԧԱ-Ֆՙա-ևא-תװ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࢠࢢ-ࢬऄ-हऽॐक़-ॡॱ-ॷॹ-ॿঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-ళవ-హఽౘౙౠౡಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽೞೠೡೱೲഅ-ഌഎ-ഐഒ-ഺഽൎൠൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄງຈຊຍດ-ທນ-ຟມ-ຣລວສຫອ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏼᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛰᜀ-ᜌᜎ-ᜑᜠ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡷᢀ-ᢨᢪᢰ-ᣵᤀ-ᤜᥐ-ᥭᥰ-ᥴᦀ-ᦫᧁ-ᧇᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭋᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᳩ-ᳬᳮ-ᳱᳵᳶᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-Ⱞⰰ-ⱞⱠ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞⸯ々-〇〡-〩〱-〵〸-〼ぁ-ゖゝ-ゟァ-ヺー-ヿㄅ-ㄭㄱ-ㆎㆠ-ㆺㇰ-ㇿ㐀-䶵一-鿌ꀀ-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚗꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ-ꞎꞐ-ꞓꞠ-Ɦꟸ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꪀ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꯀ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ]"),NonAsciiIdentifierPart:new RegExp("[ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮ̀-ʹͶͷͺ-ͽΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁ҃-҇Ҋ-ԧԱ-Ֆՙա-և֑-ׇֽֿׁׂׅׄא-תװ-ײؐ-ؚؠ-٩ٮ-ۓە-ۜ۟-۪ۨ-ۼۿܐ-݊ݍ-ޱ߀-ߵߺࠀ-࠭ࡀ-࡛ࢠࢢ-ࢬࣤ-ࣾऀ-ॣ०-९ॱ-ॷॹ-ॿঁ-ঃঅ-ঌএঐও-নপ-রলশ-হ়-ৄেৈো-ৎৗড়ঢ়য়-ৣ০-ৱਁ-ਃਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹ਼ਾ-ੂੇੈੋ-੍ੑਖ਼-ੜਫ਼੦-ੵઁ-ઃઅ-ઍએ-ઑઓ-નપ-રલળવ-હ઼-ૅે-ૉો-્ૐૠ-ૣ૦-૯ଁ-ଃଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହ଼-ୄେୈୋ-୍ୖୗଡ଼ଢ଼ୟ-ୣ୦-୯ୱஂஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹா-ூெ-ைொ-்ௐௗ௦-௯ఁ-ఃఅ-ఌఎ-ఐఒ-నప-ళవ-హఽ-ౄె-ైొ-్ౕౖౘౙౠ-ౣ౦-౯ಂಃಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹ಼-ೄೆ-ೈೊ-್ೕೖೞೠ-ೣ೦-೯ೱೲംഃഅ-ഌഎ-ഐഒ-ഺഽ-ൄെ-ൈൊ-ൎൗൠ-ൣ൦-൯ൺ-ൿංඃඅ-ඖක-නඳ-රලව-ෆ්ා-ුූෘ-ෟෲෳก-ฺเ-๎๐-๙ກຂຄງຈຊຍດ-ທນ-ຟມ-ຣລວສຫອ-ູົ-ຽເ-ໄໆ່-ໍ໐-໙ໜ-ໟༀ༘༙༠-༩༹༵༷༾-ཇཉ-ཬཱ-྄྆-ྗྙ-ྼ࿆က-၉ၐ-ႝႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚ፝-፟ᎀ-ᎏᎠ-Ᏼᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛰᜀ-ᜌᜎ-᜔ᜠ-᜴ᝀ-ᝓᝠ-ᝬᝮ-ᝰᝲᝳក-៓ៗៜ៝០-៩᠋-᠍᠐-᠙ᠠ-ᡷᢀ-ᢪᢰ-ᣵᤀ-ᤜᤠ-ᤫᤰ-᤻᥆-ᥭᥰ-ᥴᦀ-ᦫᦰ-ᧉ᧐-᧙ᨀ-ᨛᨠ-ᩞ᩠-᩿᩼-᪉᪐-᪙ᪧᬀ-ᭋ᭐-᭙᭫-᭳ᮀ-᯳ᰀ-᰷᱀-᱉ᱍ-ᱽ᳐-᳔᳒-ᳶᴀ-ᷦ᷼-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼ‌‍‿⁀⁔ⁱⁿₐ-ₜ⃐-⃥⃜⃡-⃰ℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-Ⱞⰰ-ⱞⱠ-ⳤⳫ-ⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯ⵿-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞⷠ-ⷿⸯ々-〇〡-〯〱-〵〸-〼ぁ-ゖ゙゚ゝ-ゟァ-ヺー-ヿㄅ-ㄭㄱ-ㆎㆠ-ㆺㇰ-ㇿ㐀-䶵一-鿌ꀀ-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘫꙀ-꙯ꙴ-꙽ꙿ-ꚗꚟ-꛱ꜗ-ꜟꜢ-ꞈꞋ-ꞎꞐ-ꞓꞠ-Ɦꟸ-ꠧꡀ-ꡳꢀ-꣄꣐-꣙꣠-ꣷꣻ꤀-꤭ꤰ-꥓ꥠ-ꥼꦀ-꧀ꧏ-꧙ꨀ-ꨶꩀ-ꩍ꩐-꩙ꩠ-ꩶꩺꩻꪀ-ꫂꫛ-ꫝꫠ-ꫯꫲ-꫶ꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꯀ-ꯪ꯬꯭꯰-꯹가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻ︀-️︠-︦︳︴﹍-﹏ﹰ-ﹴﹶ-ﻼ0-9A-Z_a-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ]")},fb={name:"SyntaxTree",processComment:function(a){var b,c;if(!(a.type===bb.Program&&a.body.length>0)){for(pb.trailingComments.length>0?pb.trailingComments[0].range[0]>=a.range[1]?(c=pb.trailingComments,pb.trailingComments=[]):pb.trailingComments.length=0:pb.bottomRightStack.length>0&&pb.bottomRightStack[pb.bottomRightStack.length-1].trailingComments&&pb.bottomRightStack[pb.bottomRightStack.length-1].trailingComments[0].range[0]>=a.range[1]&&(c=pb.bottomRightStack[pb.bottomRightStack.length-1].trailingComments,delete pb.bottomRightStack[pb.bottomRightStack.length-1].trailingComments);pb.bottomRightStack.length>0&&pb.bottomRightStack[pb.bottomRightStack.length-1].range[0]>=a.range[0];)b=pb.bottomRightStack.pop();b?b.leadingComments&&b.leadingComments[b.leadingComments.length-1].range[1]<=a.range[0]&&(a.leadingComments=b.leadingComments,delete b.leadingComments):pb.leadingComments.length>0&&pb.leadingComments[pb.leadingComments.length-1].range[1]<=a.range[0]&&(a.leadingComments=pb.leadingComments,pb.leadingComments=[]),c&&(a.trailingComments=c),pb.bottomRightStack.push(a)}},markEnd:function(a,b){return pb.range&&(a.range=[b.start,ib]),pb.loc&&(a.loc=new M(void 0===b.startLineNumber?b.lineNumber:b.startLineNumber,b.start-(void 0===b.startLineStart?b.lineStart:b.startLineStart),jb,ib-kb),this.postProcess(a)),pb.attachComment&&this.processComment(a),a},postProcess:function(a){return pb.source&&(a.loc.source=pb.source),a},createArrayExpression:function(a){return{type:bb.ArrayExpression,elements:a}},createAssignmentExpression:function(a,b,c){return{type:bb.AssignmentExpression,operator:a,left:b,right:c}},createBinaryExpression:function(a,b,c){return{type:"||"===a||"&&"===a?bb.LogicalExpression:bb.BinaryExpression,operator:a,left:b,right:c}},createBlockStatement:function(a){return{type:bb.BlockStatement,body:a}},createBreakStatement:function(a){return{type:bb.BreakStatement,label:a}},createCallExpression:function(a,b){return{type:bb.CallExpression,callee:a,arguments:b}},createCatchClause:function(a,b){return{type:bb.CatchClause,param:a,body:b}},createConditionalExpression:function(a,b,c){return{type:bb.ConditionalExpression,test:a,consequent:b,alternate:c}},createContinueStatement:function(a){return{type:bb.ContinueStatement,label:a}},createDebuggerStatement:function(){return{type:bb.DebuggerStatement}},createDoWhileStatement:function(a,b){return{type:bb.DoWhileStatement,body:a,test:b}},createEmptyStatement:function(){return{type:bb.EmptyStatement}},createExpressionStatement:function(a){return{type:bb.ExpressionStatement,expression:a}},createForStatement:function(a,b,c,d){return{type:bb.ForStatement,init:a,test:b,update:c,body:d}},createForInStatement:function(a,b,c){return{type:bb.ForInStatement,left:a,right:b,body:c,each:!1}},createFunctionDeclaration:function(a,b,c,d){return{type:bb.FunctionDeclaration,id:a,params:b,defaults:c,body:d,rest:null,generator:!1,expression:!1}},createFunctionExpression:function(a,b,c,d){return{type:bb.FunctionExpression,id:a,params:b,defaults:c,body:d,rest:null,generator:!1,expression:!1}},createIdentifier:function(a){return{type:bb.Identifier,name:a}},createIfStatement:function(a,b,c){return{type:bb.IfStatement,test:a,consequent:b,alternate:c}},createLabeledStatement:function(a,b){return{type:bb.LabeledStatement,label:a,body:b}},createLiteral:function(a){return{type:bb.Literal,value:a.value,raw:gb.slice(a.start,a.end)}},createMemberExpression:function(a,b,c){return{type:bb.MemberExpression,computed:"["===a,object:b,property:c}},createNewExpression:function(a,b){return{type:bb.NewExpression,callee:a,arguments:b}},createObjectExpression:function(a){return{type:bb.ObjectExpression,properties:a}},createPostfixExpression:function(a,b){return{type:bb.UpdateExpression,operator:a,argument:b,prefix:!1}},createProgram:function(a){return{type:bb.Program,body:a}},createProperty:function(a,b,c){return{type:bb.Property,key:b,value:c,kind:a}},createReturnStatement:function(a){return{type:bb.ReturnStatement,argument:a}},createSequenceExpression:function(a){return{type:bb.SequenceExpression,expressions:a}},createSwitchCase:function(a,b){return{type:bb.SwitchCase,test:a,consequent:b}},createSwitchStatement:function(a,b){return{type:bb.SwitchStatement,discriminant:a,cases:b}},createThisExpression:function(){return{type:bb.ThisExpression}},createThrowStatement:function(a){return{type:bb.ThrowStatement,argument:a}},createTryStatement:function(a,b,c,d){return{type:bb.TryStatement,block:a,guardedHandlers:b,handlers:c,finalizer:d}},createUnaryExpression:function(a,b){return"++"===a||"--"===a?{type:bb.UpdateExpression,operator:a,argument:b,prefix:!0}:{type:bb.UnaryExpression,operator:a,argument:b,prefix:!0}},createVariableDeclaration:function(a,b){return{type:bb.VariableDeclaration,declarations:a,kind:b}},createVariableDeclarator:function(a,b){return{type:bb.VariableDeclarator,id:a,init:b}},createWhileStatement:function(a,b){return{type:bb.WhileStatement,test:a,body:b}},createWithStatement:function(a,b){return{type:bb.WithStatement,object:a,body:b}}},a.version="1.2.2",a.tokenize=Ya,a.parse=Za,a.Syntax=function(){var a,b={};"function"==typeof Object.create&&(b=Object.create(null));for(a in bb)bb.hasOwnProperty(a)&&(b[a]=bb[a]);return"function"==typeof Object.freeze&&Object.freeze(b),b}()})},{}],1:[function(a,b,c){(function(d){var e=function(){function a(){this.yy={}}var b={trace:function(){},yy:{},symbols_:{error:2,JSON_PATH:3,DOLLAR:4,PATH_COMPONENTS:5,LEADING_CHILD_MEMBER_EXPRESSION:6,PATH_COMPONENT:7,MEMBER_COMPONENT:8,SUBSCRIPT_COMPONENT:9,CHILD_MEMBER_COMPONENT:10,DESCENDANT_MEMBER_COMPONENT:11,DOT:12,MEMBER_EXPRESSION:13,DOT_DOT:14,STAR:15,IDENTIFIER:16,SCRIPT_EXPRESSION:17,INTEGER:18,END:19,CHILD_SUBSCRIPT_COMPONENT:20,DESCENDANT_SUBSCRIPT_COMPONENT:21,"[":22,SUBSCRIPT:23,"]":24,SUBSCRIPT_EXPRESSION:25,SUBSCRIPT_EXPRESSION_LIST:26,SUBSCRIPT_EXPRESSION_LISTABLE:27,",":28,STRING_LITERAL:29,ARRAY_SLICE:30,FILTER_EXPRESSION:31,QQ_STRING:32,Q_STRING:33,$accept:0,$end:1},terminals_:{2:"error",4:"DOLLAR",12:"DOT",14:"DOT_DOT",15:"STAR",16:"IDENTIFIER",17:"SCRIPT_EXPRESSION",18:"INTEGER",19:"END",22:"[",24:"]",28:",",30:"ARRAY_SLICE",31:"FILTER_EXPRESSION",32:"QQ_STRING",33:"Q_STRING"},productions_:[0,[3,1],[3,2],[3,1],[3,2],[5,1],[5,2],[7,1],[7,1],[8,1],[8,1],[10,2],[6,1],[11,2],[13,1],[13,1],[13,1],[13,1],[13,1],[9,1],[9,1],[20,3],[21,4],[23,1],[23,1],[26,1],[26,3],[27,1],[27,1],[27,1],[25,1],[25,1],[25,1],[29,1],[29,1]],performAction:function(a,b,d,e,f,g,h){e.ast||(e.ast=c,c.initialize());var i=g.length-1;switch(f){case 1:return e.ast.set({expression:{type:"root",value:g[i]}}),e.ast.unshift(),e.ast.yield();case 2:return e.ast.set({expression:{type:"root",value:g[i-1]}}),e.ast.unshift(),e.ast.yield();case 3:return e.ast.unshift(),e.ast.yield();case 4:return e.ast.set({operation:"member",scope:"child",expression:{type:"identifier",value:g[i-1]}}),e.ast.unshift(),e.ast.yield();case 5:case 6:break;case 7:e.ast.set({operation:"member"}),e.ast.push();break;case 8:e.ast.set({operation:"subscript"}),e.ast.push();break;case 9:e.ast.set({scope:"child"});break;case 10:e.ast.set({scope:"descendant"});break;case 11:break;case 12:e.ast.set({scope:"child",operation:"member"});break;case 13:break;case 14:e.ast.set({expression:{type:"wildcard",value:g[i]}});break;case 15:e.ast.set({expression:{type:"identifier",value:g[i]}});break;case 16:e.ast.set({expression:{type:"script_expression",value:g[i]}});break;case 17:e.ast.set({expression:{type:"numeric_literal",value:parseInt(g[i])}});break;case 18:break;case 19:e.ast.set({scope:"child"});break;case 20:e.ast.set({scope:"descendant"});break;case 21:case 22:case 23:break;case 24:g[i].length>1?e.ast.set({expression:{type:"union",value:g[i]}}):this.$=g[i];break;case 25:this.$=[g[i]];break;case 26:this.$=g[i-2].concat(g[i]);break;case 27:this.$={expression:{type:"numeric_literal",value:parseInt(g[i])}},e.ast.set(this.$);break;case 28:this.$={expression:{type:"string_literal",value:g[i]}},e.ast.set(this.$);break;case 29:this.$={expression:{type:"slice",value:g[i]}},e.ast.set(this.$);break;case 30:this.$={expression:{type:"wildcard",value:g[i]}},e.ast.set(this.$);break;case 31:this.$={expression:{type:"script_expression",value:g[i]}},e.ast.set(this.$);break;case 32:this.$={expression:{type:"filter_expression",value:g[i]}},e.ast.set(this.$);break;case 33:case 34:this.$=g[i]}},table:[{3:1,4:[1,2],6:3,13:4,15:[1,5],16:[1,6],17:[1,7],18:[1,8],19:[1,9]},{1:[3]},{1:[2,1],5:10,7:11,8:12,9:13,10:14,11:15,12:[1,18],14:[1,19],20:16,21:17,22:[1,20]},{1:[2,3],5:21,7:11,8:12,9:13,10:14,11:15,12:[1,18],14:[1,19],20:16,21:17,22:[1,20]},{1:[2,12],12:[2,12],14:[2,12],22:[2,12]},{1:[2,14],12:[2,14],14:[2,14],22:[2,14]},{1:[2,15],12:[2,15],14:[2,15],22:[2,15]},{1:[2,16],12:[2,16],14:[2,16],22:[2,16]},{1:[2,17],12:[2,17],14:[2,17],22:[2,17]},{1:[2,18],12:[2,18],14:[2,18],22:[2,18]},{1:[2,2],7:22,8:12,9:13,10:14,11:15,12:[1,18],14:[1,19],20:16,21:17,22:[1,20]},{1:[2,5],12:[2,5],14:[2,5],22:[2,5]},{1:[2,7],12:[2,7],14:[2,7],22:[2,7]},{1:[2,8],12:[2,8],14:[2,8],22:[2,8]},{1:[2,9],12:[2,9],14:[2,9],22:[2,9]},{1:[2,10],12:[2,10],14:[2,10],22:[2,10]},{1:[2,19],12:[2,19],14:[2,19],22:[2,19]},{1:[2,20],12:[2,20],14:[2,20],22:[2,20]},{13:23,15:[1,5],16:[1,6],17:[1,7],18:[1,8],19:[1,9]},{13:24,15:[1,5],16:[1,6],17:[1,7],18:[1,8],19:[1,9],22:[1,25]},{15:[1,29],17:[1,30],18:[1,33],23:26,25:27,26:28,27:32,29:34,30:[1,35],31:[1,31],32:[1,36],33:[1,37]},{1:[2,4],7:22,8:12,9:13,10:14,11:15,12:[1,18],14:[1,19],20:16,21:17,22:[1,20]},{1:[2,6],12:[2,6],14:[2,6],22:[2,6]},{1:[2,11],12:[2,11],14:[2,11],22:[2,11]},{1:[2,13],12:[2,13],14:[2,13],22:[2,13]},{15:[1,29],17:[1,30],18:[1,33],23:38,25:27,26:28,27:32,29:34,30:[1,35],31:[1,31],32:[1,36],33:[1,37]},{24:[1,39]},{24:[2,23]},{24:[2,24],28:[1,40]},{24:[2,30]},{24:[2,31]},{24:[2,32]},{24:[2,25],28:[2,25]},{24:[2,27],28:[2,27]},{24:[2,28],28:[2,28]},{24:[2,29],28:[2,29]},{24:[2,33],28:[2,33]},{24:[2,34],28:[2,34]},{24:[1,41]},{1:[2,21],12:[2,21],14:[2,21],22:[2,21]},{18:[1,33],27:42,29:34,30:[1,35],32:[1,36],33:[1,37]},{1:[2,22],12:[2,22],14:[2,22],22:[2,22]},{24:[2,26],28:[2,26]}],defaultActions:{27:[2,23],29:[2,30],30:[2,31],31:[2,32]},parseError:function(a,b){if(!b.recoverable)throw new Error(a);this.trace(a)},parse:function(a){function b(){var a;return a=c.lexer.lex()||m,"number"!=typeof a&&(a=c.symbols_[a]||a),a}var c=this,d=[0],e=[null],f=[],g=this.table,h="",i=0,j=0,k=0,l=2,m=1,n=f.slice.call(arguments,1);this.lexer.setInput(a),this.lexer.yy=this.yy,this.yy.lexer=this.lexer,this.yy.parser=this,void 0===this.lexer.yylloc&&(this.lexer.yylloc={});var o=this.lexer.yylloc;f.push(o);var p=this.lexer.options&&this.lexer.options.ranges;"function"==typeof this.yy.parseError?this.parseError=this.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;for(var q,r,s,t,u,v,w,x,y,z={};;){if(s=d[d.length-1],this.defaultActions[s]?t=this.defaultActions[s]:(null!==q&&void 0!==q||(q=b()),t=g[s]&&g[s][q]),void 0===t||!t.length||!t[0]){var A="";y=[];for(v in g[s])this.terminals_[v]&&v>l&&y.push("'"+this.terminals_[v]+"'");A=this.lexer.showPosition?"Parse error on line "+(i+1)+":\n"+this.lexer.showPosition()+"\nExpecting "+y.join(", ")+", got '"+(this.terminals_[q]||q)+"'":"Parse error on line "+(i+1)+": Unexpected "+(q==m?"end of input":"'"+(this.terminals_[q]||q)+"'"),this.parseError(A,{text:this.lexer.match,token:this.terminals_[q]||q,line:this.lexer.yylineno,loc:o,expected:y})}if(t[0]instanceof Array&&t.length>1)throw new Error("Parse Error: multiple actions possible at state: "+s+", token: "+q);switch(t[0]){case 1:d.push(q),e.push(this.lexer.yytext),f.push(this.lexer.yylloc),d.push(t[1]),q=null,r?(q=r,r=null):(j=this.lexer.yyleng,h=this.lexer.yytext,i=this.lexer.yylineno,o=this.lexer.yylloc,k>0&&k--);break;case 2:if(w=this.productions_[t[1]][1],z.$=e[e.length-w],z._$={first_line:f[f.length-(w||1)].first_line,last_line:f[f.length-1].last_line,first_column:f[f.length-(w||1)].first_column,last_column:f[f.length-1].last_column},p&&(z._$.range=[f[f.length-(w||1)].range[0],f[f.length-1].range[1]]),void 0!==(u=this.performAction.apply(z,[h,j,i,this.yy,t[1],e,f].concat(n))))return u;w&&(d=d.slice(0,-1*w*2),e=e.slice(0,-1*w),f=f.slice(0,-1*w)),d.push(this.productions_[t[1]][0]),e.push(z.$),f.push(z._$),x=g[d[d.length-2]][d[d.length-1]],d.push(x);break;case 3:return!0}}return!0}},c={initialize:function(){this._nodes=[],this._node={},this._stash=[]},set:function(a){for(var b in a)this._node[b]=a[b];return this._node},node:function(a){return arguments.length&&(this._node=a),this._node},push:function(){this._nodes.push(this._node),this._node={}},unshift:function(){this._nodes.unshift(this._node),this._node={}},yield:function(){var a=this._nodes;return this.initialize(),a}},d=function(){return{EOF:1,parseError:function(a,b){if(!this.yy.parser)throw new Error(a);this.yy.parser.parseError(a,b)},setInput:function(a){return this._input=a,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var a=this._input[0];return this.yytext+=a,this.yyleng++,this.offset++,this.match+=a,this.matched+=a,a.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),a},unput:function(a){var b=a.length,c=a.split(/(?:\r\n?|\n)/g);this._input=a+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-b-1),this.offset-=b;var d=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),c.length-1&&(this.yylineno-=c.length-1);var e=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:c?(c.length===d.length?this.yylloc.first_column:0)+d[d.length-c.length].length-c[0].length:this.yylloc.first_column-b},this.options.ranges&&(this.yylloc.range=[e[0],e[0]+this.yyleng-b]),this.yyleng=this.yytext.length,this},more:function(){return this._more=!0,this},reject:function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},less:function(a){this.unput(this.match.slice(a))},pastInput:function(){var a=this.matched.substr(0,this.matched.length-this.match.length);return(a.length>20?"...":"")+a.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var a=this.match;return a.length<20&&(a+=this._input.substr(0,20-a.length)),(a.substr(0,20)+(a.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var a=this.pastInput(),b=new Array(a.length+1).join("-");return a+this.upcomingInput()+"\n"+b+"^"},test_match:function(a,b){var c,d,e;if(this.options.backtrack_lexer&&(e={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(e.yylloc.range=this.yylloc.range.slice(0))),d=a[0].match(/(?:\r\n?|\n).*/g),d&&(this.yylineno+=d.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:d?d[d.length-1].length-d[d.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+a[0].length},this.yytext+=a[0],this.match+=a[0],this.matches=a,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(a[0].length),this.matched+=a[0],c=this.performAction.call(this,this.yy,this,b,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),c)return c;if(this._backtrack){for(var f in e)this[f]=e[f];return!1}return!1},next:function(){if(this.done)return this.EOF;this._input||(this.done=!0);var a,b,c,d;this._more||(this.yytext="",this.match="");for(var e=this._currentRules(),f=0;fb[0].length)){if(b=c,d=f,this.options.backtrack_lexer){if(!1!==(a=this.test_match(c,e[f])))return a;if(this._backtrack){b=!1;continue}return!1}if(!this.options.flex)break}return b?!1!==(a=this.test_match(b,e[d]))&&a:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var a=this.next();return a||this.lex()},begin:function(a){this.conditionStack.push(a)},popState:function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},_currentRules:function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},topState:function(a){return a=this.conditionStack.length-1-Math.abs(a||0),a>=0?this.conditionStack[a]:"INITIAL"},pushState:function(a){this.begin(a)},stateStackSize:function(){return this.conditionStack.length},options:{},performAction:function(a,b,c,d){switch(c){case 0:return 4;case 1:return 14;case 2:return 12;case 3:return 15;case 4:return 16;case 5:return 22;case 6:return 24;case 7:return 28;case 8:return 30;case 9:return 18;case 10:return b.yytext=b.yytext.substr(1,b.yyleng-2),32;case 11:return b.yytext=b.yytext.substr(1,b.yyleng-2),33;case 12:return 17;case 13:return 31}},rules:[/^(?:\$)/,/^(?:\.\.)/,/^(?:\.)/,/^(?:\*)/,/^(?:[a-zA-Z_]+[a-zA-Z0-9_]*)/,/^(?:\[)/,/^(?:\])/,/^(?:,)/,/^(?:((-?(?:0|[1-9][0-9]*)))?\:((-?(?:0|[1-9][0-9]*)))?(\:((-?(?:0|[1-9][0-9]*)))?)?)/,/^(?:(-?(?:0|[1-9][0-9]*)))/,/^(?:"(?:\\["bfnrt\/\\]|\\u[a-fA-F0-9]{4}|[^"\\])*")/,/^(?:'(?:\\['bfnrt\/\\]|\\u[a-fA-F0-9]{4}|[^'\\])*')/,/^(?:\(.+?\)(?=\]))/,/^(?:\?\(.+?\)(?=\]))/],conditions:{INITIAL:{rules:[0,1,2,3,4,5,6,7,8,9,10,11,12,13],inclusive:!0}}}}();return b.lexer=d,a.prototype=b,b.Parser=a,new a}();void 0!==a&&void 0!==c&&(c.parser=e,c.Parser=e.Parser,c.parse=function(){return e.parse.apply(e,arguments)},c.main=function(b){b[1]||(console.log("Usage: "+b[0]+" FILE"),d.exit(1));var e=a("fs").readFileSync(a("path").normalize(b[1]),"utf8");return c.parser.parse(e)},void 0!==b&&a.main===b&&c.main(d.argv.slice(1)))}).call(this,a("_process"))},{_process:14,fs:12,path:13}],2:[function(a,b,c){b.exports={identifier:"[a-zA-Z_]+[a-zA-Z0-9_]*",integer:"-?(?:0|[1-9][0-9]*)",qq_string:'"(?:\\\\["bfnrt/\\\\]|\\\\u[a-fA-F0-9]{4}|[^"\\\\])*"',q_string:"'(?:\\\\['bfnrt/\\\\]|\\\\u[a-fA-F0-9]{4}|[^'\\\\])*'"}},{}],3:[function(a,b,c){var d=a("./dict"),e=a("fs"),f={lex:{macros:{esc:"\\\\",int:d.integer},rules:[["\\$","return 'DOLLAR'"],["\\.\\.","return 'DOT_DOT'"],["\\.","return 'DOT'"],["\\*","return 'STAR'"],[d.identifier,"return 'IDENTIFIER'"],["\\[","return '['"],["\\]","return ']'"],[",","return ','"],["({int})?\\:({int})?(\\:({int})?)?","return 'ARRAY_SLICE'"],["{int}","return 'INTEGER'"],[d.qq_string,"yytext = yytext.substr(1,yyleng-2); return 'QQ_STRING';"],[d.q_string,"yytext = yytext.substr(1,yyleng-2); return 'Q_STRING';"],["\\(.+?\\)(?=\\])","return 'SCRIPT_EXPRESSION'"],["\\?\\(.+?\\)(?=\\])","return 'FILTER_EXPRESSION'"]]},start:"JSON_PATH",bnf:{JSON_PATH:[["DOLLAR",'yy.ast.set({ expression: { type: "root", value: $1 } }); yy.ast.unshift(); return yy.ast.yield()'],["DOLLAR PATH_COMPONENTS",'yy.ast.set({ expression: { type: "root", value: $1 } }); yy.ast.unshift(); return yy.ast.yield()'],["LEADING_CHILD_MEMBER_EXPRESSION","yy.ast.unshift(); return yy.ast.yield()"],["LEADING_CHILD_MEMBER_EXPRESSION PATH_COMPONENTS",'yy.ast.set({ operation: "member", scope: "child", expression: { type: "identifier", value: $1 }}); yy.ast.unshift(); return yy.ast.yield()']],PATH_COMPONENTS:[["PATH_COMPONENT",""],["PATH_COMPONENTS PATH_COMPONENT",""]],PATH_COMPONENT:[["MEMBER_COMPONENT",'yy.ast.set({ operation: "member" }); yy.ast.push()'],["SUBSCRIPT_COMPONENT",'yy.ast.set({ operation: "subscript" }); yy.ast.push() ']],MEMBER_COMPONENT:[["CHILD_MEMBER_COMPONENT",'yy.ast.set({ scope: "child" })'],["DESCENDANT_MEMBER_COMPONENT",'yy.ast.set({ scope: "descendant" })']],CHILD_MEMBER_COMPONENT:[["DOT MEMBER_EXPRESSION",""]],LEADING_CHILD_MEMBER_EXPRESSION:[["MEMBER_EXPRESSION",'yy.ast.set({ scope: "child", operation: "member" })']],DESCENDANT_MEMBER_COMPONENT:[["DOT_DOT MEMBER_EXPRESSION",""]],MEMBER_EXPRESSION:[["STAR",'yy.ast.set({ expression: { type: "wildcard", value: $1 } })'],["IDENTIFIER",'yy.ast.set({ expression: { type: "identifier", value: $1 } })'],["SCRIPT_EXPRESSION",'yy.ast.set({ expression: { type: "script_expression", value: $1 } })'],["INTEGER",'yy.ast.set({ expression: { type: "numeric_literal", value: parseInt($1) } })'],["END",""]],SUBSCRIPT_COMPONENT:[["CHILD_SUBSCRIPT_COMPONENT",'yy.ast.set({ scope: "child" })'],["DESCENDANT_SUBSCRIPT_COMPONENT",'yy.ast.set({ scope: "descendant" })']],CHILD_SUBSCRIPT_COMPONENT:[["[ SUBSCRIPT ]",""]],DESCENDANT_SUBSCRIPT_COMPONENT:[["DOT_DOT [ SUBSCRIPT ]",""]],SUBSCRIPT:[["SUBSCRIPT_EXPRESSION",""],["SUBSCRIPT_EXPRESSION_LIST",'$1.length > 1? yy.ast.set({ expression: { type: "union", value: $1 } }) : $$ = $1']],SUBSCRIPT_EXPRESSION_LIST:[["SUBSCRIPT_EXPRESSION_LISTABLE","$$ = [$1]"],["SUBSCRIPT_EXPRESSION_LIST , SUBSCRIPT_EXPRESSION_LISTABLE","$$ = $1.concat($3)"]],SUBSCRIPT_EXPRESSION_LISTABLE:[["INTEGER",'$$ = { expression: { type: "numeric_literal", value: parseInt($1) } }; yy.ast.set($$)'],["STRING_LITERAL",'$$ = { expression: { type: "string_literal", value: $1 } }; yy.ast.set($$)'],["ARRAY_SLICE",'$$ = { expression: { type: "slice", value: $1 } }; yy.ast.set($$)']],SUBSCRIPT_EXPRESSION:[["STAR",'$$ = { expression: { type: "wildcard", value: $1 } }; yy.ast.set($$)'],["SCRIPT_EXPRESSION",'$$ = { expression: { type: "script_expression", value: $1 } }; yy.ast.set($$)'],["FILTER_EXPRESSION",'$$ = { expression: { type: "filter_expression", value: $1 } }; yy.ast.set($$)']],STRING_LITERAL:[["QQ_STRING","$$ = $1"],["Q_STRING","$$ = $1"]]}};e.readFileSync&&(f.moduleInclude=e.readFileSync(a.resolve("../include/module.js")),f.actionInclude=e.readFileSync(a.resolve("../include/action.js"))),b.exports=f},{"./dict":2,fs:12}],4:[function(a,b,c){function d(b,c,d){var e=a("./index"),f=m.parse(c).body[0].expression,g=j(f,{"@":b.value}),h=d.replace(/\{\{\s*value\s*\}\}/g,g),i=e.nodes(b.value,h);return i.forEach(function(a){a.path=b.path.concat(a.path.slice(1))}),i}function e(a){return Array.isArray(a)}function f(a){return a&&!(a instanceof Array)&&a instanceof Object}function g(a){return function(b,c,d,g){var h=b.value,i=b.path,j=[],k=function(b,h){e(b)?(b.forEach(function(a,b){j.length>=g||d(b,a,c)&&j.push({path:h.concat(b),value:a})}),b.forEach(function(b,c){j.length>=g||a&&k(b,h.concat(c))})):f(b)&&(this.keys(b).forEach(function(a){j.length>=g||d(a,b[a],c)&&j.push({path:h.concat(a),value:b[a]})}),this.keys(b).forEach(function(c){j.length>=g||a&&k(b[c],h.concat(c))}))}.bind(this);return k(h,i),j}}function h(a){return function(b,c,d){return this.descend(c,b.expression.value,a,d)}}function i(a){return function(b,c,d){return this.traverse(c,b.expression.value,a,d)}}function j(){try{return o.apply(this,arguments)}catch(a){}}function k(a){return a=a.filter(function(a){return a}),p(a,function(a){return a.path.map(function(a){return String(a).replace("-","--")}).join("-")})}function l(a){var b=String(a);return b.match(/^-?[0-9]+$/)?parseInt(b):null}var m=a("./aesprim"),n=a("./slice"),o=a("static-eval"),p=a("underscore").uniq,q=function(){return this.initialize.apply(this,arguments)};q.prototype.initialize=function(){this.traverse=g(!0),this.descend=g()},q.prototype.keys=Object.keys,q.prototype.resolve=function(a){var b=[a.operation,a.scope,a.expression.type].join("-"),c=this._fns[b];if(!c)throw new Error("couldn't resolve key: "+b);return c.bind(this)},q.prototype.register=function(a,b){if(!b instanceof Function)throw new Error("handler must be a function");this._fns[a]=b},q.prototype._fns={"member-child-identifier":function(a,b){var c=a.expression.value,d=b.value;if(d instanceof Object&&c in d)return[{value:d[c],path:b.path.concat(c)}]},"member-descendant-identifier":i(function(a,b,c){return a==c}),"subscript-child-numeric_literal":h(function(a,b,c){return a===c}),"member-child-numeric_literal":h(function(a,b,c){return String(a)===String(c)}),"subscript-descendant-numeric_literal":i(function(a,b,c){return a===c}),"member-child-wildcard":h(function(){return!0}),"member-descendant-wildcard":i(function(){return!0}),"subscript-descendant-wildcard":i(function(){return!0}),"subscript-child-wildcard":h(function(){return!0}),"subscript-child-slice":function(a,b){if(e(b.value)){var c=a.expression.value.split(":").map(l),d=b.value.map(function(a,c){return{value:a,path:b.path.concat(c)}});return n.apply(null,[d].concat(c))}},"subscript-child-union":function(a,b){var c=[];return a.expression.value.forEach(function(a){var d={operation:"subscript",scope:"child",expression:a.expression},e=this.resolve(d),f=e(d,b);f&&(c=c.concat(f))},this),k(c)},"subscript-descendant-union":function(b,c,d){var e=a(".."),f=this,g=[];return e.nodes(c,"$..*").slice(1).forEach(function(a){g.length>=d||b.expression.value.forEach(function(b){var c={operation:"subscript",scope:"child",expression:b.expression},d=f.resolve(c),e=d(c,a);g=g.concat(e)})}),k(g)},"subscript-child-filter_expression":function(a,b,c){var d=a.expression.value.slice(2,-1),e=m.parse(d).body[0].expression,f=function(a,b){return j(e,{"@":b})};return this.descend(b,null,f,c)},"subscript-descendant-filter_expression":function(a,b,c){var d=a.expression.value.slice(2,-1),e=m.parse(d).body[0].expression,f=function(a,b){return j(e,{"@":b})};return this.traverse(b,null,f,c)},"subscript-child-script_expression":function(a,b){return d(b,a.expression.value.slice(1,-1),"$[{{value}}]")},"member-child-script_expression":function(a,b){return d(b,a.expression.value.slice(1,-1),"$.{{value}}")},"member-descendant-script_expression":function(a,b){return d(b,a.expression.value.slice(1,-1),"$..value")}},q.prototype._fns["subscript-child-string_literal"]=q.prototype._fns["member-child-identifier"],q.prototype._fns["member-descendant-numeric_literal"]=q.prototype._fns["subscript-descendant-string_literal"]=q.prototype._fns["member-descendant-identifier"],b.exports=q},{"..":"jsonpath","./aesprim":"./aesprim","./index":5,"./slice":7,"static-eval":15,underscore:16}],5:[function(a,b,c){function d(a){return"[object String]"==Object.prototype.toString.call(a)}var e=a("assert"),f=a("./dict"),g=a("./parser"),h=a("./handlers"),i=function(){this.initialize.apply(this,arguments)};i.prototype.initialize=function(){this.parser=new g,this.handlers=new h},i.prototype.parse=function(a){return e.ok(d(a),"we need a path"),this.parser.parse(a)},i.prototype.parent=function(a,b){e.ok(a instanceof Object,"obj needs to be an object"),e.ok(b,"we need a path");var c=this.nodes(a,b)[0];c.path.pop();return this.value(a,c.path)},i.prototype.apply=function(a,b,c){e.ok(a instanceof Object,"obj needs to be an object"),e.ok(b,"we need a path"),e.equal(typeof c,"function","fn needs to be function");var d=this.nodes(a,b).sort(function(a,b){return b.path.length-a.path.length});return d.forEach(function(b){var d=b.path.pop(),e=this.value(a,this.stringify(b.path)),f=b.value=c.call(a,e[d]);e[d]=f},this),d},i.prototype.value=function(a,b,c){if(e.ok(a instanceof Object,"obj needs to be an object"),e.ok(b,"we need a path"),arguments.length>=3){var d=this.nodes(a,b).shift();if(!d)return this._vivify(a,b,c);var f=d.path.slice(-1).shift();this.parent(a,this.stringify(d.path))[f]=c}return this.query(a,this.stringify(b),1).shift()},i.prototype._vivify=function(a,b,c){var d=this;e.ok(a instanceof Object,"obj needs to be an object"),e.ok(b,"we need a path");var f=this.parser.parse(b).map(function(a){return a.expression.value}),g=function(b,c){var e=b.pop(),f=d.value(a,b);f||(g(b.concat(),"string"==typeof e?{}:[]),f=d.value(a,b)),f[e]=c};return g(f,c),this.query(a,b)[0]},i.prototype.query=function(a,b,c){return e.ok(a instanceof Object,"obj needs to be an object"),e.ok(d(b),"we need a path"),this.nodes(a,b,c).map(function(a){return a.value})},i.prototype.paths=function(a,b,c){return e.ok(a instanceof Object,"obj needs to be an object"),e.ok(b,"we need a path"),this.nodes(a,b,c).map(function(a){return a.path})},i.prototype.nodes=function(a,b,c){if(e.ok(a instanceof Object,"obj needs to be an object"),e.ok(b,"we need a path"),0===c)return[];var d=this.parser.parse(b),f=this.handlers,g=[{path:["$"],value:a}],h=[];return d.length&&"root"==d[0].expression.type&&d.shift(),d.length?(d.forEach(function(a,b){if(!(h.length>=c)){var e=f.resolve(a),i=[];g.forEach(function(f){if(!(h.length>=c)){var g=e(a,f,c);b==d.length-1?h=h.concat(g||[]):i=i.concat(g||[])}}),g=i}}),c?h.slice(0,c):h):g}, +AccessorDataProperty:"Object literal may not have data and accessor property with the same name",AccessorGetSet:"Object literal may not have multiple get/set accessors with the same name",StrictLHSAssignment:"Assignment to eval or arguments is not allowed in strict mode",StrictLHSPostfix:"Postfix increment/decrement may not have eval or arguments operand in strict mode",StrictLHSPrefix:"Prefix increment/decrement may not have eval or arguments operand in strict mode",StrictReservedWord:"Use of future reserved word in strict mode"},eb={NonAsciiIdentifierStart:new RegExp("[ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԧԱ-Ֆՙա-ևא-תװ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࢠࢢ-ࢬऄ-हऽॐक़-ॡॱ-ॷॹ-ॿঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-ళవ-హఽౘౙౠౡಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽೞೠೡೱೲഅ-ഌഎ-ഐഒ-ഺഽൎൠൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄງຈຊຍດ-ທນ-ຟມ-ຣລວສຫອ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏼᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛰᜀ-ᜌᜎ-ᜑᜠ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡷᢀ-ᢨᢪᢰ-ᣵᤀ-ᤜᥐ-ᥭᥰ-ᥴᦀ-ᦫᧁ-ᧇᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭋᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᳩ-ᳬᳮ-ᳱᳵᳶᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-Ⱞⰰ-ⱞⱠ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞⸯ々-〇〡-〩〱-〵〸-〼ぁ-ゖゝ-ゟァ-ヺー-ヿㄅ-ㄭㄱ-ㆎㆠ-ㆺㇰ-ㇿ㐀-䶵一-鿌ꀀ-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚗꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ-ꞎꞐ-ꞓꞠ-Ɦꟸ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꪀ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꯀ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ]"),NonAsciiIdentifierPart:new RegExp("[ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮ̀-ʹͶͷͺ-ͽΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁ҃-҇Ҋ-ԧԱ-Ֆՙա-և֑-ׇֽֿׁׂׅׄא-תװ-ײؐ-ؚؠ-٩ٮ-ۓە-ۜ۟-۪ۨ-ۼۿܐ-݊ݍ-ޱ߀-ߵߺࠀ-࠭ࡀ-࡛ࢠࢢ-ࢬࣤ-ࣾऀ-ॣ०-९ॱ-ॷॹ-ॿঁ-ঃঅ-ঌএঐও-নপ-রলশ-হ়-ৄেৈো-ৎৗড়ঢ়য়-ৣ০-ৱਁ-ਃਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹ਼ਾ-ੂੇੈੋ-੍ੑਖ਼-ੜਫ਼੦-ੵઁ-ઃઅ-ઍએ-ઑઓ-નપ-રલળવ-હ઼-ૅે-ૉો-્ૐૠ-ૣ૦-૯ଁ-ଃଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହ଼-ୄେୈୋ-୍ୖୗଡ଼ଢ଼ୟ-ୣ୦-୯ୱஂஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹா-ூெ-ைொ-்ௐௗ௦-௯ఁ-ఃఅ-ఌఎ-ఐఒ-నప-ళవ-హఽ-ౄె-ైొ-్ౕౖౘౙౠ-ౣ౦-౯ಂಃಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹ಼-ೄೆ-ೈೊ-್ೕೖೞೠ-ೣ೦-೯ೱೲംഃഅ-ഌഎ-ഐഒ-ഺഽ-ൄെ-ൈൊ-ൎൗൠ-ൣ൦-൯ൺ-ൿංඃඅ-ඖක-නඳ-රලව-ෆ්ා-ුූෘ-ෟෲෳก-ฺเ-๎๐-๙ກຂຄງຈຊຍດ-ທນ-ຟມ-ຣລວສຫອ-ູົ-ຽເ-ໄໆ່-ໍ໐-໙ໜ-ໟༀ༘༙༠-༩༹༵༷༾-ཇཉ-ཬཱ-྄྆-ྗྙ-ྼ࿆က-၉ၐ-ႝႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚ፝-፟ᎀ-ᎏᎠ-Ᏼᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛰᜀ-ᜌᜎ-᜔ᜠ-᜴ᝀ-ᝓᝠ-ᝬᝮ-ᝰᝲᝳក-៓ៗៜ៝០-៩᠋-᠍᠐-᠙ᠠ-ᡷᢀ-ᢪᢰ-ᣵᤀ-ᤜᤠ-ᤫᤰ-᤻᥆-ᥭᥰ-ᥴᦀ-ᦫᦰ-ᧉ᧐-᧙ᨀ-ᨛᨠ-ᩞ᩠-᩿᩼-᪉᪐-᪙ᪧᬀ-ᭋ᭐-᭙᭫-᭳ᮀ-᯳ᰀ-᰷᱀-᱉ᱍ-ᱽ᳐-᳔᳒-ᳶᴀ-ᷦ᷼-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼ‌‍‿⁀⁔ⁱⁿₐ-ₜ⃐-⃥⃜⃡-⃰ℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-Ⱞⰰ-ⱞⱠ-ⳤⳫ-ⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯ⵿-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞⷠ-ⷿⸯ々-〇〡-〯〱-〵〸-〼ぁ-ゖ゙゚ゝ-ゟァ-ヺー-ヿㄅ-ㄭㄱ-ㆎㆠ-ㆺㇰ-ㇿ㐀-䶵一-鿌ꀀ-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘫꙀ-꙯ꙴ-꙽ꙿ-ꚗꚟ-꛱ꜗ-ꜟꜢ-ꞈꞋ-ꞎꞐ-ꞓꞠ-Ɦꟸ-ꠧꡀ-ꡳꢀ-꣄꣐-꣙꣠-ꣷꣻ꤀-꤭ꤰ-꥓ꥠ-ꥼꦀ-꧀ꧏ-꧙ꨀ-ꨶꩀ-ꩍ꩐-꩙ꩠ-ꩶꩺꩻꪀ-ꫂꫛ-ꫝꫠ-ꫯꫲ-꫶ꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꯀ-ꯪ꯬꯭꯰-꯹가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻ︀-️︠-︦︳︴﹍-﹏ﹰ-ﹴﹶ-ﻼ0-9A-Z_a-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ]")},fb={name:"SyntaxTree",processComment:function(a){var b,c;if(!(a.type===bb.Program&&a.body.length>0)){for(pb.trailingComments.length>0?pb.trailingComments[0].range[0]>=a.range[1]?(c=pb.trailingComments,pb.trailingComments=[]):pb.trailingComments.length=0:pb.bottomRightStack.length>0&&pb.bottomRightStack[pb.bottomRightStack.length-1].trailingComments&&pb.bottomRightStack[pb.bottomRightStack.length-1].trailingComments[0].range[0]>=a.range[1]&&(c=pb.bottomRightStack[pb.bottomRightStack.length-1].trailingComments,delete pb.bottomRightStack[pb.bottomRightStack.length-1].trailingComments);pb.bottomRightStack.length>0&&pb.bottomRightStack[pb.bottomRightStack.length-1].range[0]>=a.range[0];)b=pb.bottomRightStack.pop();b?b.leadingComments&&b.leadingComments[b.leadingComments.length-1].range[1]<=a.range[0]&&(a.leadingComments=b.leadingComments,delete b.leadingComments):pb.leadingComments.length>0&&pb.leadingComments[pb.leadingComments.length-1].range[1]<=a.range[0]&&(a.leadingComments=pb.leadingComments,pb.leadingComments=[]),c&&(a.trailingComments=c),pb.bottomRightStack.push(a)}},markEnd:function(a,b){return pb.range&&(a.range=[b.start,ib]),pb.loc&&(a.loc=new M(void 0===b.startLineNumber?b.lineNumber:b.startLineNumber,b.start-(void 0===b.startLineStart?b.lineStart:b.startLineStart),jb,ib-kb),this.postProcess(a)),pb.attachComment&&this.processComment(a),a},postProcess:function(a){return pb.source&&(a.loc.source=pb.source),a},createArrayExpression:function(a){return{type:bb.ArrayExpression,elements:a}},createAssignmentExpression:function(a,b,c){return{type:bb.AssignmentExpression,operator:a,left:b,right:c}},createBinaryExpression:function(a,b,c){return{type:"||"===a||"&&"===a?bb.LogicalExpression:bb.BinaryExpression,operator:a,left:b,right:c}},createBlockStatement:function(a){return{type:bb.BlockStatement,body:a}},createBreakStatement:function(a){return{type:bb.BreakStatement,label:a}},createCallExpression:function(a,b){return{type:bb.CallExpression,callee:a,arguments:b}},createCatchClause:function(a,b){return{type:bb.CatchClause,param:a,body:b}},createConditionalExpression:function(a,b,c){return{type:bb.ConditionalExpression,test:a,consequent:b,alternate:c}},createContinueStatement:function(a){return{type:bb.ContinueStatement,label:a}},createDebuggerStatement:function(){return{type:bb.DebuggerStatement}},createDoWhileStatement:function(a,b){return{type:bb.DoWhileStatement,body:a,test:b}},createEmptyStatement:function(){return{type:bb.EmptyStatement}},createExpressionStatement:function(a){return{type:bb.ExpressionStatement,expression:a}},createForStatement:function(a,b,c,d){return{type:bb.ForStatement,init:a,test:b,update:c,body:d}},createForInStatement:function(a,b,c){return{type:bb.ForInStatement,left:a,right:b,body:c,each:!1}},createFunctionDeclaration:function(a,b,c,d){return{type:bb.FunctionDeclaration,id:a,params:b,defaults:c,body:d,rest:null,generator:!1,expression:!1}},createFunctionExpression:function(a,b,c,d){return{type:bb.FunctionExpression,id:a,params:b,defaults:c,body:d,rest:null,generator:!1,expression:!1}},createIdentifier:function(a){return{type:bb.Identifier,name:a}},createIfStatement:function(a,b,c){return{type:bb.IfStatement,test:a,consequent:b,alternate:c}},createLabeledStatement:function(a,b){return{type:bb.LabeledStatement,label:a,body:b}},createLiteral:function(a){return{type:bb.Literal,value:a.value,raw:gb.slice(a.start,a.end)}},createMemberExpression:function(a,b,c){return{type:bb.MemberExpression,computed:"["===a,object:b,property:c}},createNewExpression:function(a,b){return{type:bb.NewExpression,callee:a,arguments:b}},createObjectExpression:function(a){return{type:bb.ObjectExpression,properties:a}},createPostfixExpression:function(a,b){return{type:bb.UpdateExpression,operator:a,argument:b,prefix:!1}},createProgram:function(a){return{type:bb.Program,body:a}},createProperty:function(a,b,c){return{type:bb.Property,key:b,value:c,kind:a}},createReturnStatement:function(a){return{type:bb.ReturnStatement,argument:a}},createSequenceExpression:function(a){return{type:bb.SequenceExpression,expressions:a}},createSwitchCase:function(a,b){return{type:bb.SwitchCase,test:a,consequent:b}},createSwitchStatement:function(a,b){return{type:bb.SwitchStatement,discriminant:a,cases:b}},createThisExpression:function(){return{type:bb.ThisExpression}},createThrowStatement:function(a){return{type:bb.ThrowStatement,argument:a}},createTryStatement:function(a,b,c,d){return{type:bb.TryStatement,block:a,guardedHandlers:b,handlers:c,finalizer:d}},createUnaryExpression:function(a,b){return"++"===a||"--"===a?{type:bb.UpdateExpression,operator:a,argument:b,prefix:!0}:{type:bb.UnaryExpression,operator:a,argument:b,prefix:!0}},createVariableDeclaration:function(a,b){return{type:bb.VariableDeclaration,declarations:a,kind:b}},createVariableDeclarator:function(a,b){return{type:bb.VariableDeclarator,id:a,init:b}},createWhileStatement:function(a,b){return{type:bb.WhileStatement,test:a,body:b}},createWithStatement:function(a,b){return{type:bb.WithStatement,object:a,body:b}}},a.version="1.2.2",a.tokenize=Ya,a.parse=Za,a.Syntax=function(){var a,b={};"function"==typeof Object.create&&(b=Object.create(null));for(a in bb)bb.hasOwnProperty(a)&&(b[a]=bb[a]);return"function"==typeof Object.freeze&&Object.freeze(b),b}()})},{}],1:[function(a,b,c){(function(d){var e=function(){function a(){this.yy={}}var b={trace:function(){},yy:{},symbols_:{error:2,JSON_PATH:3,DOLLAR:4,PATH_COMPONENTS:5,LEADING_CHILD_MEMBER_EXPRESSION:6,PATH_COMPONENT:7,MEMBER_COMPONENT:8,SUBSCRIPT_COMPONENT:9,CHILD_MEMBER_COMPONENT:10,DESCENDANT_MEMBER_COMPONENT:11,DOT:12,MEMBER_EXPRESSION:13,DOT_DOT:14,STAR:15,IDENTIFIER:16,SCRIPT_EXPRESSION:17,INTEGER:18,END:19,CHILD_SUBSCRIPT_COMPONENT:20,DESCENDANT_SUBSCRIPT_COMPONENT:21,"[":22,SUBSCRIPT:23,"]":24,SUBSCRIPT_EXPRESSION:25,SUBSCRIPT_EXPRESSION_LIST:26,SUBSCRIPT_EXPRESSION_LISTABLE:27,",":28,STRING_LITERAL:29,ARRAY_SLICE:30,FILTER_EXPRESSION:31,QQ_STRING:32,Q_STRING:33,$accept:0,$end:1},terminals_:{2:"error",4:"DOLLAR",12:"DOT",14:"DOT_DOT",15:"STAR",16:"IDENTIFIER",17:"SCRIPT_EXPRESSION",18:"INTEGER",19:"END",22:"[",24:"]",28:",",30:"ARRAY_SLICE",31:"FILTER_EXPRESSION",32:"QQ_STRING",33:"Q_STRING"},productions_:[0,[3,1],[3,2],[3,1],[3,2],[5,1],[5,2],[7,1],[7,1],[8,1],[8,1],[10,2],[6,1],[11,2],[13,1],[13,1],[13,1],[13,1],[13,1],[9,1],[9,1],[20,3],[21,4],[23,1],[23,1],[26,1],[26,3],[27,1],[27,1],[27,1],[25,1],[25,1],[25,1],[29,1],[29,1]],performAction:function(a,b,d,e,f,g,h){e.ast||(e.ast=c,c.initialize());var i=g.length-1;switch(f){case 1:return e.ast.set({expression:{type:"root",value:g[i]}}),e.ast.unshift(),e.ast.yield();case 2:return e.ast.set({expression:{type:"root",value:g[i-1]}}),e.ast.unshift(),e.ast.yield();case 3:return e.ast.unshift(),e.ast.yield();case 4:return e.ast.set({operation:"member",scope:"child",expression:{type:"identifier",value:g[i-1]}}),e.ast.unshift(),e.ast.yield();case 5:case 6:break;case 7:e.ast.set({operation:"member"}),e.ast.push();break;case 8:e.ast.set({operation:"subscript"}),e.ast.push();break;case 9:e.ast.set({scope:"child"});break;case 10:e.ast.set({scope:"descendant"});break;case 11:break;case 12:e.ast.set({scope:"child",operation:"member"});break;case 13:break;case 14:e.ast.set({expression:{type:"wildcard",value:g[i]}});break;case 15:e.ast.set({expression:{type:"identifier",value:g[i]}});break;case 16:e.ast.set({expression:{type:"script_expression",value:g[i]}});break;case 17:e.ast.set({expression:{type:"numeric_literal",value:parseInt(g[i])}});break;case 18:break;case 19:e.ast.set({scope:"child"});break;case 20:e.ast.set({scope:"descendant"});break;case 21:case 22:case 23:break;case 24:g[i].length>1?e.ast.set({expression:{type:"union",value:g[i]}}):this.$=g[i];break;case 25:this.$=[g[i]];break;case 26:this.$=g[i-2].concat(g[i]);break;case 27:this.$={expression:{type:"numeric_literal",value:parseInt(g[i])}},e.ast.set(this.$);break;case 28:this.$={expression:{type:"string_literal",value:g[i]}},e.ast.set(this.$);break;case 29:this.$={expression:{type:"slice",value:g[i]}},e.ast.set(this.$);break;case 30:this.$={expression:{type:"wildcard",value:g[i]}},e.ast.set(this.$);break;case 31:this.$={expression:{type:"script_expression",value:g[i]}},e.ast.set(this.$);break;case 32:this.$={expression:{type:"filter_expression",value:g[i]}},e.ast.set(this.$);break;case 33:case 34:this.$=g[i]}},table:[{3:1,4:[1,2],6:3,13:4,15:[1,5],16:[1,6],17:[1,7],18:[1,8],19:[1,9]},{1:[3]},{1:[2,1],5:10,7:11,8:12,9:13,10:14,11:15,12:[1,18],14:[1,19],20:16,21:17,22:[1,20]},{1:[2,3],5:21,7:11,8:12,9:13,10:14,11:15,12:[1,18],14:[1,19],20:16,21:17,22:[1,20]},{1:[2,12],12:[2,12],14:[2,12],22:[2,12]},{1:[2,14],12:[2,14],14:[2,14],22:[2,14]},{1:[2,15],12:[2,15],14:[2,15],22:[2,15]},{1:[2,16],12:[2,16],14:[2,16],22:[2,16]},{1:[2,17],12:[2,17],14:[2,17],22:[2,17]},{1:[2,18],12:[2,18],14:[2,18],22:[2,18]},{1:[2,2],7:22,8:12,9:13,10:14,11:15,12:[1,18],14:[1,19],20:16,21:17,22:[1,20]},{1:[2,5],12:[2,5],14:[2,5],22:[2,5]},{1:[2,7],12:[2,7],14:[2,7],22:[2,7]},{1:[2,8],12:[2,8],14:[2,8],22:[2,8]},{1:[2,9],12:[2,9],14:[2,9],22:[2,9]},{1:[2,10],12:[2,10],14:[2,10],22:[2,10]},{1:[2,19],12:[2,19],14:[2,19],22:[2,19]},{1:[2,20],12:[2,20],14:[2,20],22:[2,20]},{13:23,15:[1,5],16:[1,6],17:[1,7],18:[1,8],19:[1,9]},{13:24,15:[1,5],16:[1,6],17:[1,7],18:[1,8],19:[1,9],22:[1,25]},{15:[1,29],17:[1,30],18:[1,33],23:26,25:27,26:28,27:32,29:34,30:[1,35],31:[1,31],32:[1,36],33:[1,37]},{1:[2,4],7:22,8:12,9:13,10:14,11:15,12:[1,18],14:[1,19],20:16,21:17,22:[1,20]},{1:[2,6],12:[2,6],14:[2,6],22:[2,6]},{1:[2,11],12:[2,11],14:[2,11],22:[2,11]},{1:[2,13],12:[2,13],14:[2,13],22:[2,13]},{15:[1,29],17:[1,30],18:[1,33],23:38,25:27,26:28,27:32,29:34,30:[1,35],31:[1,31],32:[1,36],33:[1,37]},{24:[1,39]},{24:[2,23]},{24:[2,24],28:[1,40]},{24:[2,30]},{24:[2,31]},{24:[2,32]},{24:[2,25],28:[2,25]},{24:[2,27],28:[2,27]},{24:[2,28],28:[2,28]},{24:[2,29],28:[2,29]},{24:[2,33],28:[2,33]},{24:[2,34],28:[2,34]},{24:[1,41]},{1:[2,21],12:[2,21],14:[2,21],22:[2,21]},{18:[1,33],27:42,29:34,30:[1,35],32:[1,36],33:[1,37]},{1:[2,22],12:[2,22],14:[2,22],22:[2,22]},{24:[2,26],28:[2,26]}],defaultActions:{27:[2,23],29:[2,30],30:[2,31],31:[2,32]},parseError:function(a,b){if(!b.recoverable)throw new Error(a);this.trace(a)},parse:function(a){function b(){var a;return a=c.lexer.lex()||m,"number"!=typeof a&&(a=c.symbols_[a]||a),a}var c=this,d=[0],e=[null],f=[],g=this.table,h="",i=0,j=0,k=0,l=2,m=1,n=f.slice.call(arguments,1);this.lexer.setInput(a),this.lexer.yy=this.yy,this.yy.lexer=this.lexer,this.yy.parser=this,void 0===this.lexer.yylloc&&(this.lexer.yylloc={});var o=this.lexer.yylloc;f.push(o);var p=this.lexer.options&&this.lexer.options.ranges;"function"==typeof this.yy.parseError?this.parseError=this.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;for(var q,r,s,t,u,v,w,x,y,z={};;){if(s=d[d.length-1],this.defaultActions[s]?t=this.defaultActions[s]:(null!==q&&void 0!==q||(q=b()),t=g[s]&&g[s][q]),void 0===t||!t.length||!t[0]){var A="";y=[];for(v in g[s])this.terminals_[v]&&v>l&&y.push("'"+this.terminals_[v]+"'");A=this.lexer.showPosition?"Parse error on line "+(i+1)+":\n"+this.lexer.showPosition()+"\nExpecting "+y.join(", ")+", got '"+(this.terminals_[q]||q)+"'":"Parse error on line "+(i+1)+": Unexpected "+(q==m?"end of input":"'"+(this.terminals_[q]||q)+"'"),this.parseError(A,{text:this.lexer.match,token:this.terminals_[q]||q,line:this.lexer.yylineno,loc:o,expected:y})}if(t[0]instanceof Array&&t.length>1)throw new Error("Parse Error: multiple actions possible at state: "+s+", token: "+q);switch(t[0]){case 1:d.push(q),e.push(this.lexer.yytext),f.push(this.lexer.yylloc),d.push(t[1]),q=null,r?(q=r,r=null):(j=this.lexer.yyleng,h=this.lexer.yytext,i=this.lexer.yylineno,o=this.lexer.yylloc,k>0&&k--);break;case 2:if(w=this.productions_[t[1]][1],z.$=e[e.length-w],z._$={first_line:f[f.length-(w||1)].first_line,last_line:f[f.length-1].last_line,first_column:f[f.length-(w||1)].first_column,last_column:f[f.length-1].last_column},p&&(z._$.range=[f[f.length-(w||1)].range[0],f[f.length-1].range[1]]),void 0!==(u=this.performAction.apply(z,[h,j,i,this.yy,t[1],e,f].concat(n))))return u;w&&(d=d.slice(0,-1*w*2),e=e.slice(0,-1*w),f=f.slice(0,-1*w)),d.push(this.productions_[t[1]][0]),e.push(z.$),f.push(z._$),x=g[d[d.length-2]][d[d.length-1]],d.push(x);break;case 3:return!0}}return!0}},c={initialize:function(){this._nodes=[],this._node={},this._stash=[]},set:function(a){for(var b in a)this._node[b]=a[b];return this._node},node:function(a){return arguments.length&&(this._node=a),this._node},push:function(){this._nodes.push(this._node),this._node={}},unshift:function(){this._nodes.unshift(this._node),this._node={}},yield:function(){var a=this._nodes;return this.initialize(),a}},d=function(){return{EOF:1,parseError:function(a,b){if(!this.yy.parser)throw new Error(a);this.yy.parser.parseError(a,b)},setInput:function(a){return this._input=a,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var a=this._input[0];return this.yytext+=a,this.yyleng++,this.offset++,this.match+=a,this.matched+=a,a.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),a},unput:function(a){var b=a.length,c=a.split(/(?:\r\n?|\n)/g);this._input=a+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-b-1),this.offset-=b;var d=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),c.length-1&&(this.yylineno-=c.length-1);var e=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:c?(c.length===d.length?this.yylloc.first_column:0)+d[d.length-c.length].length-c[0].length:this.yylloc.first_column-b},this.options.ranges&&(this.yylloc.range=[e[0],e[0]+this.yyleng-b]),this.yyleng=this.yytext.length,this},more:function(){return this._more=!0,this},reject:function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},less:function(a){this.unput(this.match.slice(a))},pastInput:function(){var a=this.matched.substr(0,this.matched.length-this.match.length);return(a.length>20?"...":"")+a.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var a=this.match;return a.length<20&&(a+=this._input.substr(0,20-a.length)),(a.substr(0,20)+(a.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var a=this.pastInput(),b=new Array(a.length+1).join("-");return a+this.upcomingInput()+"\n"+b+"^"},test_match:function(a,b){var c,d,e;if(this.options.backtrack_lexer&&(e={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(e.yylloc.range=this.yylloc.range.slice(0))),d=a[0].match(/(?:\r\n?|\n).*/g),d&&(this.yylineno+=d.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:d?d[d.length-1].length-d[d.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+a[0].length},this.yytext+=a[0],this.match+=a[0],this.matches=a,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(a[0].length),this.matched+=a[0],c=this.performAction.call(this,this.yy,this,b,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),c)return c;if(this._backtrack){for(var f in e)this[f]=e[f];return!1}return!1},next:function(){if(this.done)return this.EOF;this._input||(this.done=!0);var a,b,c,d;this._more||(this.yytext="",this.match="");for(var e=this._currentRules(),f=0;fb[0].length)){if(b=c,d=f,this.options.backtrack_lexer){if(!1!==(a=this.test_match(c,e[f])))return a;if(this._backtrack){b=!1;continue}return!1}if(!this.options.flex)break}return b?!1!==(a=this.test_match(b,e[d]))&&a:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var a=this.next();return a||this.lex()},begin:function(a){this.conditionStack.push(a)},popState:function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},_currentRules:function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},topState:function(a){return a=this.conditionStack.length-1-Math.abs(a||0),a>=0?this.conditionStack[a]:"INITIAL"},pushState:function(a){this.begin(a)},stateStackSize:function(){return this.conditionStack.length},options:{},performAction:function(a,b,c,d){switch(c){case 0:return 4;case 1:return 14;case 2:return 12;case 3:return 15;case 4:return 16;case 5:return 22;case 6:return 24;case 7:return 28;case 8:return 30;case 9:return 18;case 10:return b.yytext=b.yytext.substr(1,b.yyleng-2),32;case 11:return b.yytext=b.yytext.substr(1,b.yyleng-2),33;case 12:return 17;case 13:return 31}},rules:[/^(?:\$)/,/^(?:\.\.)/,/^(?:\.)/,/^(?:\*)/,/^(?:[a-zA-Z_]+[a-zA-Z0-9_]*)/,/^(?:\[)/,/^(?:\])/,/^(?:,)/,/^(?:((-?(?:0|[1-9][0-9]*)))?\:((-?(?:0|[1-9][0-9]*)))?(\:((-?(?:0|[1-9][0-9]*)))?)?)/,/^(?:(-?(?:0|[1-9][0-9]*)))/,/^(?:"(?:\\["bfnrt\/\\]|\\u[a-fA-F0-9]{4}|[^"\\])*")/,/^(?:'(?:\\['bfnrt\/\\]|\\u[a-fA-F0-9]{4}|[^'\\])*')/,/^(?:\(.+?\)(?=\]))/,/^(?:\?\(.+?\)(?=\]))/],conditions:{INITIAL:{rules:[0,1,2,3,4,5,6,7,8,9,10,11,12,13],inclusive:!0}}}}();return b.lexer=d,a.prototype=b,b.Parser=a,new a}();void 0!==a&&void 0!==c&&(c.parser=e,c.Parser=e.Parser,c.parse=function(){return e.parse.apply(e,arguments)},c.main=function(b){b[1]||(console.log("Usage: "+b[0]+" FILE"),d.exit(1));var e=a("fs").readFileSync(a("path").normalize(b[1]),"utf8");return c.parser.parse(e)},void 0!==b&&a.main===b&&c.main(d.argv.slice(1)))}).call(this,a("_process"))},{_process:14,fs:12,path:13}],2:[function(a,b,c){b.exports={identifier:"[a-zA-Z_]+[a-zA-Z0-9_]*",integer:"-?(?:0|[1-9][0-9]*)",qq_string:'"(?:\\\\["bfnrt/\\\\]|\\\\u[a-fA-F0-9]{4}|[^"\\\\])*"',q_string:"'(?:\\\\['bfnrt/\\\\]|\\\\u[a-fA-F0-9]{4}|[^'\\\\])*'"}},{}],3:[function(a,b,c){var d=a("./dict"),e=a("fs"),f={lex:{macros:{esc:"\\\\",int:d.integer},rules:[["\\$","return 'DOLLAR'"],["\\.\\.","return 'DOT_DOT'"],["\\.","return 'DOT'"],["\\*","return 'STAR'"],[d.identifier,"return 'IDENTIFIER'"],["\\[","return '['"],["\\]","return ']'"],[",","return ','"],["({int})?\\:({int})?(\\:({int})?)?","return 'ARRAY_SLICE'"],["{int}","return 'INTEGER'"],[d.qq_string,"yytext = yytext.substr(1,yyleng-2); return 'QQ_STRING';"],[d.q_string,"yytext = yytext.substr(1,yyleng-2); return 'Q_STRING';"],["\\(.+?\\)(?=\\])","return 'SCRIPT_EXPRESSION'"],["\\?\\(.+?\\)(?=\\])","return 'FILTER_EXPRESSION'"]]},start:"JSON_PATH",bnf:{JSON_PATH:[["DOLLAR",'yy.ast.set({ expression: { type: "root", value: $1 } }); yy.ast.unshift(); return yy.ast.yield()'],["DOLLAR PATH_COMPONENTS",'yy.ast.set({ expression: { type: "root", value: $1 } }); yy.ast.unshift(); return yy.ast.yield()'],["LEADING_CHILD_MEMBER_EXPRESSION","yy.ast.unshift(); return yy.ast.yield()"],["LEADING_CHILD_MEMBER_EXPRESSION PATH_COMPONENTS",'yy.ast.set({ operation: "member", scope: "child", expression: { type: "identifier", value: $1 }}); yy.ast.unshift(); return yy.ast.yield()']],PATH_COMPONENTS:[["PATH_COMPONENT",""],["PATH_COMPONENTS PATH_COMPONENT",""]],PATH_COMPONENT:[["MEMBER_COMPONENT",'yy.ast.set({ operation: "member" }); yy.ast.push()'],["SUBSCRIPT_COMPONENT",'yy.ast.set({ operation: "subscript" }); yy.ast.push() ']],MEMBER_COMPONENT:[["CHILD_MEMBER_COMPONENT",'yy.ast.set({ scope: "child" })'],["DESCENDANT_MEMBER_COMPONENT",'yy.ast.set({ scope: "descendant" })']],CHILD_MEMBER_COMPONENT:[["DOT MEMBER_EXPRESSION",""]],LEADING_CHILD_MEMBER_EXPRESSION:[["MEMBER_EXPRESSION",'yy.ast.set({ scope: "child", operation: "member" })']],DESCENDANT_MEMBER_COMPONENT:[["DOT_DOT MEMBER_EXPRESSION",""]],MEMBER_EXPRESSION:[["STAR",'yy.ast.set({ expression: { type: "wildcard", value: $1 } })'],["IDENTIFIER",'yy.ast.set({ expression: { type: "identifier", value: $1 } })'],["SCRIPT_EXPRESSION",'yy.ast.set({ expression: { type: "script_expression", value: $1 } })'],["INTEGER",'yy.ast.set({ expression: { type: "numeric_literal", value: parseInt($1) } })'],["END",""]],SUBSCRIPT_COMPONENT:[["CHILD_SUBSCRIPT_COMPONENT",'yy.ast.set({ scope: "child" })'],["DESCENDANT_SUBSCRIPT_COMPONENT",'yy.ast.set({ scope: "descendant" })']],CHILD_SUBSCRIPT_COMPONENT:[["[ SUBSCRIPT ]",""]],DESCENDANT_SUBSCRIPT_COMPONENT:[["DOT_DOT [ SUBSCRIPT ]",""]],SUBSCRIPT:[["SUBSCRIPT_EXPRESSION",""],["SUBSCRIPT_EXPRESSION_LIST",'$1.length > 1? yy.ast.set({ expression: { type: "union", value: $1 } }) : $$ = $1']],SUBSCRIPT_EXPRESSION_LIST:[["SUBSCRIPT_EXPRESSION_LISTABLE","$$ = [$1]"],["SUBSCRIPT_EXPRESSION_LIST , SUBSCRIPT_EXPRESSION_LISTABLE","$$ = $1.concat($3)"]],SUBSCRIPT_EXPRESSION_LISTABLE:[["INTEGER",'$$ = { expression: { type: "numeric_literal", value: parseInt($1) } }; yy.ast.set($$)'],["STRING_LITERAL",'$$ = { expression: { type: "string_literal", value: $1 } }; yy.ast.set($$)'],["ARRAY_SLICE",'$$ = { expression: { type: "slice", value: $1 } }; yy.ast.set($$)']],SUBSCRIPT_EXPRESSION:[["STAR",'$$ = { expression: { type: "wildcard", value: $1 } }; yy.ast.set($$)'],["SCRIPT_EXPRESSION",'$$ = { expression: { type: "script_expression", value: $1 } }; yy.ast.set($$)'],["FILTER_EXPRESSION",'$$ = { expression: { type: "filter_expression", value: $1 } }; yy.ast.set($$)']],STRING_LITERAL:[["QQ_STRING","$$ = $1"],["Q_STRING","$$ = $1"]]}};e.readFileSync&&(f.moduleInclude=e.readFileSync(a.resolve("../include/module.js")),f.actionInclude=e.readFileSync(a.resolve("../include/action.js"))),b.exports=f},{"./dict":2,fs:12}],4:[function(a,b,c){function d(b,c,d){var e=a("./index"),f=m.parse(c).body[0].expression,g=j(f,{"@":b.value}),h=d.replace(/\{\{\s*value\s*\}\}/g,g),i=e.nodes(b.value,h);return i.forEach(function(a){a.path=b.path.concat(a.path.slice(1))}),i}function e(a){return Array.isArray(a)}function f(a){return a&&!(a instanceof Array)&&a instanceof Object}function g(a){return function(b,c,d,g){var h=b.value,i=b.path,j=[],k=function(b,h){e(b)?(b.forEach(function(a,b){j.length>=g||d(b,a,c)&&j.push({path:h.concat(b),value:a})}),b.forEach(function(b,c){j.length>=g||a&&k(b,h.concat(c))})):f(b)&&(this.keys(b).forEach(function(a){j.length>=g||d(a,b[a],c)&&j.push({path:h.concat(a),value:b[a]})}),this.keys(b).forEach(function(c){j.length>=g||a&&k(b[c],h.concat(c))}))}.bind(this);return k(h,i),j}}function h(a){return function(b,c,d){return this.descend(c,b.expression.value,a,d)}}function i(a){return function(b,c,d){return this.traverse(c,b.expression.value,a,d)}}function j(){try{return o.apply(this,arguments)}catch(a){}}function k(a){return a=a.filter(function(a){return a}),p(a,function(a){return a.path.map(function(a){return String(a).replace("-","--")}).join("-")})}function l(a){var b=String(a);return b.match(/^-?[0-9]+$/)?parseInt(b):null}var m=a("./aesprim"),n=a("./slice"),o=a("static-eval"),p=a("underscore").uniq,q=function(){return this.initialize.apply(this,arguments)};q.prototype.initialize=function(){this.traverse=g(!0),this.descend=g()},q.prototype.keys=Object.keys,q.prototype.resolve=function(a){var b=[a.operation,a.scope,a.expression.type].join("-"),c=this._fns[b];if(!c)throw new Error("couldn't resolve key: "+b);return c.bind(this)},q.prototype.register=function(a,b){if(!b instanceof Function)throw new Error("handler must be a function");this._fns[a]=b},q.prototype._fns={"member-child-identifier":function(a,b){var c=a.expression.value,d=b.value;if(d instanceof Object&&c in d)return[{value:d[c],path:b.path.concat(c)}]},"member-descendant-identifier":i(function(a,b,c){return a==c}),"subscript-child-numeric_literal":h(function(a,b,c){return a===c}),"member-child-numeric_literal":h(function(a,b,c){return String(a)===String(c)}),"subscript-descendant-numeric_literal":i(function(a,b,c){return a===c}),"member-child-wildcard":h(function(){return!0}),"member-descendant-wildcard":i(function(){return!0}),"subscript-descendant-wildcard":i(function(){return!0}),"subscript-child-wildcard":h(function(){return!0}),"subscript-child-slice":function(a,b){if(e(b.value)){var c=a.expression.value.split(":").map(l),d=b.value.map(function(a,c){return{value:a,path:b.path.concat(c)}});return n.apply(null,[d].concat(c))}},"subscript-child-union":function(a,b){var c=[];return a.expression.value.forEach(function(a){var d={operation:"subscript",scope:"child",expression:a.expression},e=this.resolve(d),f=e(d,b);f&&(c=c.concat(f))},this),k(c)},"subscript-descendant-union":function(b,c,d){var e=a(".."),f=this,g=[];return e.nodes(c,"$..*").slice(1).forEach(function(a){g.length>=d||b.expression.value.forEach(function(b){var c={operation:"subscript",scope:"child",expression:b.expression},d=f.resolve(c),e=d(c,a);g=g.concat(e)})}),k(g)},"subscript-child-filter_expression":function(a,b,c){var d=a.expression.value.slice(2,-1),e=m.parse(d).body[0].expression,f=function(a,b){return j(e,{"@":b})};return this.descend(b,null,f,c)},"subscript-descendant-filter_expression":function(a,b,c){var d=a.expression.value.slice(2,-1),e=m.parse(d).body[0].expression,f=function(a,b){return j(e,{"@":b})};return this.traverse(b,null,f,c)},"subscript-child-script_expression":function(a,b){return d(b,a.expression.value.slice(1,-1),"$[{{value}}]")},"member-child-script_expression":function(a,b){return d(b,a.expression.value.slice(1,-1),"$.{{value}}")},"member-descendant-script_expression":function(a,b){return d(b,a.expression.value.slice(1,-1),"$..value")}},q.prototype._fns["subscript-child-string_literal"]=q.prototype._fns["member-child-identifier"],q.prototype._fns["member-descendant-numeric_literal"]=q.prototype._fns["subscript-descendant-string_literal"]=q.prototype._fns["member-descendant-identifier"],b.exports=q},{"..":"jsonpath","./aesprim":"./aesprim","./index":5,"./slice":7,"static-eval":15,underscore:16}],5:[function(a,b,c){function d(a){return"[object String]"==Object.prototype.toString.call(a)}var e=a("assert"),f=a("./dict"),g=a("./parser"),h=a("./handlers"),i=function(){this.initialize.apply(this,arguments)};i.prototype.initialize=function(){this.parser=new g,this.handlers=new h},i.prototype.parse=function(a){return e.ok(d(a),"we need a path"),this.parser.parse(a)},i.prototype.parent=function(a,b){e.ok(a instanceof Object,"obj needs to be an object"),e.ok(b,"we need a path");var c=this.nodes(a,b)[0];c.path.pop();return this.value(a,c.path)},i.prototype.apply=function(a,b,c){e.ok(a instanceof Object,"obj needs to be an object"),e.ok(b,"we need a path"),e.equal(typeof c,"function","fn needs to be function");var d=this.nodes(a,b).sort(function(a,b){return b.path.length-a.path.length});return d.forEach(function(b){var d=b.path.pop(),e=this.value(a,this.stringify(b.path)),f=b.value=c.call(a,e[d]);e[d]=f,b.path.push(d)},this),d},i.prototype.value=function(a,b,c){if(e.ok(a instanceof Object,"obj needs to be an object"),e.ok(b,"we need a path"),arguments.length>=3){var d=this.nodes(a,b).shift();if(!d)return this._vivify(a,b,c);var f=d.path.slice(-1).shift();this.parent(a,this.stringify(d.path))[f]=c}return this.query(a,this.stringify(b),1).shift()},i.prototype._vivify=function(a,b,c){var d=this;e.ok(a instanceof Object,"obj needs to be an object"),e.ok(b,"we need a path");var f=this.parser.parse(b).map(function(a){return a.expression.value}),g=function(b,c){var e=b.pop(),f=d.value(a,b);f||(g(b.concat(),"string"==typeof e?{}:[]),f=d.value(a,b)),f[e]=c};return g(f,c),this.query(a,b)[0]},i.prototype.query=function(a,b,c){return e.ok(a instanceof Object,"obj needs to be an object"),e.ok(d(b),"we need a path"),this.nodes(a,b,c).map(function(a){return a.value})},i.prototype.paths=function(a,b,c){return e.ok(a instanceof Object,"obj needs to be an object"),e.ok(b,"we need a path"),this.nodes(a,b,c).map(function(a){return a.path})},i.prototype.nodes=function(a,b,c){if(e.ok(a instanceof Object,"obj needs to be an object"),e.ok(b,"we need a path"),0===c)return[];var d=this.parser.parse(b),f=this.handlers,g=[{path:["$"],value:a}],h=[];return d.length&&"root"==d[0].expression.type&&d.shift(),d.length?(d.forEach(function(a,b){if(!(h.length>=c)){var e=f.resolve(a),i=[];g.forEach(function(f){if(!(h.length>=c)){var g=e(a,f,c);b==d.length-1?h=h.concat(g||[]):i=i.concat(g||[])}}),g=i}}),c?h.slice(0,c):h):g}, i.prototype.stringify=function(a){e.ok(a,"we need a path");var b="$",c={"descendant-member":"..{{value}}","child-member":".{{value}}","descendant-subscript":"..[{{value}}]","child-subscript":"[{{value}}]"};return a=this._normalize(a),a.forEach(function(a){if("root"!=a.expression.type){var d,e=[a.scope,a.operation].join("-"),f=c[e];if(d="string_literal"==a.expression.type?JSON.stringify(a.expression.value):a.expression.value,!f)throw new Error("couldn't find template "+e);b+=f.replace(/{{value}}/,d)}}),b},i.prototype._normalize=function(a){if(e.ok(a,"we need a path"),"string"==typeof a)return this.parser.parse(a);if(Array.isArray(a)&&"string"==typeof a[0]){var b=[{expression:{type:"root",value:"$"}}];return a.forEach(function(a,c){if("$"!=a||0!==c)if("string"==typeof a&&a.match("^"+f.identifier+"$"))b.push({operation:"member",scope:"child",expression:{value:a,type:"identifier"}});else{var d="number"==typeof a?"numeric_literal":"string_literal";b.push({operation:"subscript",scope:"child",expression:{value:a,type:d}})}}),b}if(Array.isArray(a)&&"object"==typeof a[0])return a;throw new Error("couldn't understand path "+a)},i.Handlers=h,i.Parser=g;var j=new i;j.JSONPath=i,b.exports=j},{"./dict":2,"./handlers":4,"./parser":6,assert:8}],6:[function(a,b,c){var d=a("./grammar"),e=a("../generated/parser"),f=function(){var a=new e.Parser,b=a.parseError;return a.yy.parseError=function(){a.yy.ast&&a.yy.ast.initialize(),b.apply(a,arguments)},a};f.grammar=d,b.exports=f},{"../generated/parser":1,"./grammar":3}],7:[function(a,b,c){function d(a){return String(a).match(/^[0-9]+$/)?parseInt(a):Number.isFinite(a)?parseInt(a,10):0}b.exports=function(a,b,c,e){if("string"==typeof b)throw new Error("start cannot be a string");if("string"==typeof c)throw new Error("end cannot be a string");if("string"==typeof e)throw new Error("step cannot be a string");var f=a.length;if(0===e)throw new Error("step cannot be zero");if(e=e?d(e):1,b=b<0?f+b:b,c=c<0?f+c:c,b=d(0===b?0:b||(e>0?0:f-1)),c=d(0===c?0:c||(e>0?f:-1)),b=e>0?Math.max(0,b):Math.min(f,b),c=e>0?Math.min(c,f):Math.max(-1,c),e>0&&c<=b)return[];if(e<0&&b<=c)return[];for(var g=[],h=b;h!=c&&!(e<0&&h<=c||e>0&&h>=c);h+=e)g.push(a[h]);return g}},{}],8:[function(a,b,c){function d(a,b){return n.isUndefined(b)?""+b:n.isNumber(b)&&!isFinite(b)?b.toString():n.isFunction(b)||n.isRegExp(b)?b.toString():b}function e(a,b){return n.isString(a)?a.length=0;f--)if(g[f]!=h[f])return!1;for(f=g.length-1;f>=0;f--)if(e=g[f],!i(a[e],b[e]))return!1;return!0}function l(a,b){return!(!a||!b)&&("[object RegExp]"==Object.prototype.toString.call(b)?b.test(a):a instanceof b||!0===b.call({},a))}function m(a,b,c,d){var e;n.isString(c)&&(d=c,c=null);try{b()}catch(f){e=f}if(d=(c&&c.name?" ("+c.name+").":".")+(d?" "+d:"."),a&&!e&&g(e,c,"Missing expected exception"+d),!a&&l(e,c)&&g(e,c,"Got unwanted exception"+d),a&&e&&c&&!l(e,c)||!a&&e)throw e}var n=a("util/"),o=Array.prototype.slice,p=Object.prototype.hasOwnProperty,q=b.exports=h;q.AssertionError=function(a){this.name="AssertionError",this.actual=a.actual,this.expected=a.expected,this.operator=a.operator,a.message?(this.message=a.message,this.generatedMessage=!1):(this.message=f(this),this.generatedMessage=!0);var b=a.stackStartFunction||g;if(Error.captureStackTrace)Error.captureStackTrace(this,b);else{var c=new Error;if(c.stack){var d=c.stack,e=b.name,h=d.indexOf("\n"+e);if(h>=0){var i=d.indexOf("\n",h+1);d=d.substring(i+1)}this.stack=d}}},n.inherits(q.AssertionError,Error),q.fail=g,q.ok=h,q.equal=function(a,b,c){a!=b&&g(a,b,c,"==",q.equal)},q.notEqual=function(a,b,c){a==b&&g(a,b,c,"!=",q.notEqual)},q.deepEqual=function(a,b,c){i(a,b)||g(a,b,c,"deepEqual",q.deepEqual)},q.notDeepEqual=function(a,b,c){i(a,b)&&g(a,b,c,"notDeepEqual",q.notDeepEqual)},q.strictEqual=function(a,b,c){a!==b&&g(a,b,c,"===",q.strictEqual)},q.notStrictEqual=function(a,b,c){a===b&&g(a,b,c,"!==",q.notStrictEqual)},q.throws=function(a,b,c){m.apply(this,[!0].concat(o.call(arguments)))},q.doesNotThrow=function(a,b){m.apply(this,[!1].concat(o.call(arguments)))},q.ifError=function(a){if(a)throw a};var r=Object.keys||function(a){var b=[];for(var c in a)p.call(a,c)&&b.push(c);return b}},{"util/":11}],9:[function(a,b,c){"function"==typeof Object.create?b.exports=function(a,b){a.super_=b,a.prototype=Object.create(b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}})}:b.exports=function(a,b){a.super_=b;var c=function(){};c.prototype=b.prototype,a.prototype=new c,a.prototype.constructor=a}},{}],10:[function(a,b,c){b.exports=function(a){return a&&"object"==typeof a&&"function"==typeof a.copy&&"function"==typeof a.fill&&"function"==typeof a.readUInt8}},{}],11:[function(a,b,c){(function(b,d){function e(a,b){var d={seen:[],stylize:g};return arguments.length>=3&&(d.depth=arguments[2]),arguments.length>=4&&(d.colors=arguments[3]),p(b)?d.showHidden=b:b&&c._extend(d,b),v(d.showHidden)&&(d.showHidden=!1),v(d.depth)&&(d.depth=2),v(d.colors)&&(d.colors=!1),v(d.customInspect)&&(d.customInspect=!0),d.colors&&(d.stylize=f),i(d,a,d.depth)}function f(a,b){var c=e.styles[b];return c?"["+e.colors[c][0]+"m"+a+"["+e.colors[c][1]+"m":a}function g(a,b){return a}function h(a){var b={};return a.forEach(function(a,c){b[a]=!0}),b}function i(a,b,d){if(a.customInspect&&b&&A(b.inspect)&&b.inspect!==c.inspect&&(!b.constructor||b.constructor.prototype!==b)){var e=b.inspect(d,a);return t(e)||(e=i(a,e,d)),e}var f=j(a,b);if(f)return f;var g=Object.keys(b),p=h(g);if(a.showHidden&&(g=Object.getOwnPropertyNames(b)),z(b)&&(g.indexOf("message")>=0||g.indexOf("description")>=0))return k(b);if(0===g.length){if(A(b)){var q=b.name?": "+b.name:"";return a.stylize("[Function"+q+"]","special")}if(w(b))return a.stylize(RegExp.prototype.toString.call(b),"regexp");if(y(b))return a.stylize(Date.prototype.toString.call(b),"date");if(z(b))return k(b)}var r="",s=!1,u=["{","}"];if(o(b)&&(s=!0,u=["[","]"]),A(b)){r=" [Function"+(b.name?": "+b.name:"")+"]"}if(w(b)&&(r=" "+RegExp.prototype.toString.call(b)),y(b)&&(r=" "+Date.prototype.toUTCString.call(b)),z(b)&&(r=" "+k(b)),0===g.length&&(!s||0==b.length))return u[0]+r+u[1];if(d<0)return w(b)?a.stylize(RegExp.prototype.toString.call(b),"regexp"):a.stylize("[Object]","special");a.seen.push(b);var v;return v=s?l(a,b,d,p,g):g.map(function(c){return m(a,b,d,p,c,s)}),a.seen.pop(),n(v,r,u)}function j(a,b){if(v(b))return a.stylize("undefined","undefined");if(t(b)){var c="'"+JSON.stringify(b).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return a.stylize(c,"string")}return s(b)?a.stylize(""+b,"number"):p(b)?a.stylize(""+b,"boolean"):q(b)?a.stylize("null","null"):void 0}function k(a){return"["+Error.prototype.toString.call(a)+"]"}function l(a,b,c,d,e){for(var f=[],g=0,h=b.length;g-1&&(h=f?h.split("\n").map(function(a){return" "+a}).join("\n").substr(2):"\n"+h.split("\n").map(function(a){return" "+a}).join("\n"))):h=a.stylize("[Circular]","special")),v(g)){if(f&&e.match(/^\d+$/))return h;g=JSON.stringify(""+e),g.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(g=g.substr(1,g.length-2),g=a.stylize(g,"name")):(g=g.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),g=a.stylize(g,"string"))}return g+": "+h}function n(a,b,c){var d=0;return a.reduce(function(a,b){return d++,b.indexOf("\n")>=0&&d++,a+b.replace(/\u001b\[\d\d?m/g,"").length+1},0)>60?c[0]+(""===b?"":b+"\n ")+" "+a.join(",\n ")+" "+c[1]:c[0]+b+" "+a.join(", ")+" "+c[1]}function o(a){return Array.isArray(a)}function p(a){return"boolean"==typeof a}function q(a){return null===a}function r(a){return null==a}function s(a){return"number"==typeof a}function t(a){return"string"==typeof a}function u(a){return"symbol"==typeof a}function v(a){return void 0===a}function w(a){return x(a)&&"[object RegExp]"===C(a)}function x(a){return"object"==typeof a&&null!==a}function y(a){return x(a)&&"[object Date]"===C(a)}function z(a){return x(a)&&("[object Error]"===C(a)||a instanceof Error)}function A(a){return"function"==typeof a}function B(a){return null===a||"boolean"==typeof a||"number"==typeof a||"string"==typeof a||"symbol"==typeof a||void 0===a}function C(a){return Object.prototype.toString.call(a)}function D(a){return a<10?"0"+a.toString(10):a.toString(10)}function E(){var a=new Date,b=[D(a.getHours()),D(a.getMinutes()),D(a.getSeconds())].join(":");return[a.getDate(),J[a.getMonth()],b].join(" ")}function F(a,b){return Object.prototype.hasOwnProperty.call(a,b)}var G=/%[sdj%]/g;c.format=function(a){if(!t(a)){for(var b=[],c=0;c=f)return a;switch(a){case"%s":return String(d[c++]);case"%d":return Number(d[c++]);case"%j":try{return JSON.stringify(d[c++])}catch(b){return"[Circular]"}default:return a}}),h=d[c];c=0;d--){var e=a[d];"."===e?a.splice(d,1):".."===e?(a.splice(d,1),c++):c&&(a.splice(d,1),c--)}if(b)for(;c--;c)a.unshift("..");return a}function d(a){"string"!=typeof a&&(a+="");var b,c=0,d=-1,e=!0;for(b=a.length-1;b>=0;--b)if(47===a.charCodeAt(b)){if(!e){c=b+1;break}}else-1===d&&(e=!1,d=b+1);return-1===d?"":a.slice(c,d)}function e(a,b){if(a.filter)return a.filter(b);for(var c=[],d=0;d=-1&&!d;f--){var g=f>=0?arguments[f]:a.cwd();if("string"!=typeof g)throw new TypeError("Arguments to path.resolve must be strings");g&&(c=g+"/"+c,d="/"===g.charAt(0))}return c=b(e(c.split("/"),function(a){return!!a}),!d).join("/"),(d?"/":"")+c||"."},c.normalize=function(a){var d=c.isAbsolute(a),g="/"===f(a,-1);return a=b(e(a.split("/"),function(a){return!!a}),!d).join("/"),a||d||(a="."),a&&g&&(a+="/"),(d?"/":"")+a},c.isAbsolute=function(a){return"/"===a.charAt(0)},c.join=function(){var a=Array.prototype.slice.call(arguments,0);return c.normalize(e(a,function(a,b){if("string"!=typeof a)throw new TypeError("Arguments to path.join must be strings");return a}).join("/"))},c.relative=function(a,b){function d(a){for(var b=0;b=0&&""===a[c];c--);return b>c?[]:a.slice(b,c-b+1)}a=c.resolve(a).substr(1),b=c.resolve(b).substr(1);for(var e=d(a.split("/")),f=d(b.split("/")),g=Math.min(e.length,f.length),h=g,i=0;i=1;--f)if(47===(b=a.charCodeAt(f))){if(!e){d=f;break}}else e=!1;return-1===d?c?"/":".":c&&1===d?"/":a.slice(0,d)},c.basename=function(a,b){var c=d(a);return b&&c.substr(-1*b.length)===b&&(c=c.substr(0,c.length-b.length)),c},c.extname=function(a){"string"!=typeof a&&(a+="");for(var b=-1,c=0,d=-1,e=!0,f=0,g=a.length-1;g>=0;--g){var h=a.charCodeAt(g);if(47!==h)-1===d&&(e=!1,d=g+1),46===h?-1===b?b=g:1!==f&&(f=1):-1!==b&&(f=-1);else if(!e){c=g+1;break}}return-1===b||-1===d||0===f||1===f&&b===d-1&&b===c+1?"":a.slice(b,d)};var f="b"==="ab".substr(-1)?function(a,b,c){return a.substr(b,c)}:function(a,b,c){return b<0&&(b=a.length+b),a.substr(b,c)}}).call(this,a("_process"))},{_process:14}],14:[function(a,b,c){function d(){throw new Error("setTimeout has not been defined")}function e(){throw new Error("clearTimeout has not been defined")}function f(a){if(l===setTimeout)return setTimeout(a,0);if((l===d||!l)&&setTimeout)return l=setTimeout,setTimeout(a,0);try{return l(a,0)}catch(b){try{return l.call(null,a,0)}catch(b){return l.call(this,a,0)}}}function g(a){if(m===clearTimeout)return clearTimeout(a);if((m===e||!m)&&clearTimeout)return m=clearTimeout,clearTimeout(a);try{return m(a)}catch(b){try{return m.call(null,a)}catch(b){return m.call(this,a)}}}function h(){q&&o&&(q=!1,o.length?p=o.concat(p):r=-1,p.length&&i())}function i(){if(!q){var a=f(h);q=!0;for(var b=p.length;b;){for(o=p,p=[];++r1)for(var c=1;c"===p?j>o:">="===p?j>=o:"|"===p?j|o:"&"===p?j&o:"^"===p?j^o:"&&"===p?j&&o:"||"===p?j||o:c}if("Identifier"===e.type)return{}.hasOwnProperty.call(b,e.name)?b[e.name]:c;if("ThisExpression"===e.type)return{}.hasOwnProperty.call(b,"this")?b.this:c;if("CallExpression"===e.type){var q=a(e.callee);if(q===c)return c;if("function"!=typeof q)return c;var r=e.callee.object?a(e.callee.object):c;r===c&&(r=null);for(var s=[],i=0,j=e.arguments.length;i=0)},q.invoke=function(a,b){var c=j.call(arguments,2),d=q.isFunction(b);return q.map(a,function(a){return(d?b:a[b]).apply(a,c)})},q.pluck=function(a,b){return q.map(a,q.property(b))},q.where=function(a,b){return q.filter(a,q.matches(b))},q.findWhere=function(a,b){return q.find(a,q.matches(b))},q.max=function(a,b,c){var d,e,f=-1/0,g=-1/0;if(null==b&&null!=a){a=a.length===+a.length?a:q.values(a);for(var h=0,i=a.length;hf&&(f=d)}else b=q.iteratee(b,c),q.each(a,function(a,c,d){((e=b(a,c,d))>g||e===-1/0&&f===-1/0)&&(f=a,g=e)});return f},q.min=function(a,b,c){var d,e,f=1/0,g=1/0;if(null==b&&null!=a){a=a.length===+a.length?a:q.values(a);for(var h=0,i=a.length;hd||void 0===c)return 1;if(c>>1;c(a[h])=0;)if(a[d]===b)return d;return-1},q.range=function(a,b,c){arguments.length<=1&&(b=a||0,a=0),c=c||1;for(var d=Math.max(Math.ceil((b-a)/c),0),e=Array(d),f=0;fb?(clearTimeout(g),g=null,h=j,f=a.apply(d,e),g||(d=e=null)):g||!1===c.trailing||(g=setTimeout(i,k)),f}},q.debounce=function(a,b,c){var d,e,f,g,h,i=function(){var j=q.now()-g;j0?d=setTimeout(i,b-j):(d=null,c||(h=a.apply(f,e),d||(f=e=null)))};return function(){f=this,e=arguments,g=q.now();var j=c&&!d;return d||(d=setTimeout(i,b)),j&&(h=a.apply(f,e),f=e=null),h}},q.wrap=function(a,b){return q.partial(b,a)},q.negate=function(a){return function(){return!a.apply(this,arguments)}},q.compose=function(){var a=arguments,b=a.length-1;return function(){for(var c=b,d=a[b].apply(this,arguments);c--;)d=a[c].call(this,d);return d}},q.after=function(a,b){return function(){if(--a<1)return b.apply(this,arguments)}},q.before=function(a,b){var c;return function(){return--a>0?c=b.apply(this,arguments):b=null,c}},q.once=q.partial(q.before,2),q.keys=function(a){if(!q.isObject(a))return[];if(o)return o(a);var b=[];for(var c in a)q.has(a,c)&&b.push(c);return b},q.values=function(a){for(var b=q.keys(a),c=b.length,d=Array(c),e=0;e":">",'"':""","'":"'","`":"`"},y=q.invert(x),z=function(a){ var b=function(b){return a[b]},c="(?:"+q.keys(a).join("|")+")",d=RegExp(c),e=RegExp(c,"g");return function(a){return a=null==a?"":""+a,d.test(a)?a.replace(e,b):a}};q.escape=z(x),q.unescape=z(y),q.result=function(a,b){if(null!=a){var c=a[b];return q.isFunction(c)?a[b]():c}};var A=0;q.uniqueId=function(a){var b=++A+"";return a?a+b:b},q.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var B=/(.)^/,C={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},D=/\\|'|\r|\n|\u2028|\u2029/g,E=function(a){return"\\"+C[a]};q.template=function(a,b,c){!b&&c&&(b=c),b=q.defaults({},b,q.templateSettings);var d=RegExp([(b.escape||B).source,(b.interpolate||B).source,(b.evaluate||B).source].join("|")+"|$","g"),e=0,f="__p+='";a.replace(d,function(b,c,d,g,h){return f+=a.slice(e,h).replace(D,E),e=h+b.length,c?f+="'+\n((__t=("+c+"))==null?'':_.escape(__t))+\n'":d?f+="'+\n((__t=("+d+"))==null?'':__t)+\n'":g&&(f+="';\n"+g+"\n__p+='"),b}),f+="';\n",b.variable||(f="with(obj||{}){\n"+f+"}\n"),f="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+f+"return __p;\n";try{var g=new Function(b.variable||"obj","_",f)}catch(j){throw j.source=f,j}var h=function(a){return g.call(this,a,q)},i=b.variable||"obj";return h.source="function("+i+"){\n"+f+"}",h},q.chain=function(a){var b=q(a);return b._chain=!0,b};var F=function(a){return this._chain?q(a).chain():a};q.mixin=function(a){q.each(q.functions(a),function(b){var c=q[b]=a[b];q.prototype[b]=function(){var a=[this._wrapped];return i.apply(a,arguments),F.call(this,c.apply(q,a))}})},q.mixin(q),q.each(["pop","push","reverse","shift","sort","splice","unshift"],function(a){var b=f[a];q.prototype[a]=function(){var c=this._wrapped;return b.apply(c,arguments),"shift"!==a&&"splice"!==a||0!==c.length||delete c[0],F.call(this,c)}}),q.each(["concat","join","slice"],function(a){var b=f[a];q.prototype[a]=function(){return F.call(this,b.apply(this._wrapped,arguments))}}),q.prototype.value=function(){return this._wrapped},"function"==typeof a&&a.amd&&a("underscore",[],function(){return q})}).call(this)},{}],jsonpath:[function(a,b,c){b.exports=a("./lib/index")},{"./lib/index":5}]},{},["jsonpath"])("jsonpath")}); \ No newline at end of file diff --git a/lib/index.js b/lib/index.js index 8f5a832..92c42a5 100755 --- a/lib/index.js +++ b/lib/index.js @@ -43,6 +43,7 @@ JSONPath.prototype.apply = function(obj, string, fn) { var parent = this.value(obj, this.stringify(node.path)); var val = node.value = fn.call(obj, parent[key]); parent[key] = val; + node.path.push(key); }, this); return nodes; From bb53e3d09e860ab399ed8195c30d5a99feb41b19 Mon Sep 17 00:00:00 2001 From: "William J. Edney" Date: Thu, 7 Mar 2019 09:48:10 -0600 Subject: [PATCH 3/3] =?UTF-8?q?Patched=20to=20add=20=E2=80=98creation?= =?UTF-8?q?=E2=80=99=20capability?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit For most JSONPaths, this flag allows a ‘set’ operation to create JS data structures as it traverses, thereby allowing the system to ‘build out’ structure on the fly. --- jsonpath.js | 86 ++++++++++++++++++++++++++++++++++++++++++++++--- jsonpath.min.js | 6 ++-- lib/handlers.js | 72 +++++++++++++++++++++++++++++++++++++++-- lib/index.js | 14 +++++++- 4 files changed, 167 insertions(+), 11 deletions(-) diff --git a/jsonpath.js b/jsonpath.js index 8da7221..e6c38e5 100644 --- a/jsonpath.js +++ b/jsonpath.js @@ -4636,11 +4636,20 @@ Handlers.prototype.register = function(key, handler) { Handlers.prototype._fns = { + // (wje) - patched 2019-03-07 to add creation capability. 'member-child-identifier': function(component, partial) { var key = component.expression.value; var value = partial.value; if (value instanceof Object && key in value) { return [ { value: value[key], path: partial.path.concat(key) } ] + } else if (this.applyMode && this.buildFn) { + var altered = this.buildFn(partial, value, key); + if (altered) { + value = partial.value; + if (value instanceof Object && key in value) { + return [ { value: value[key], path: partial.path.concat(key) } ] + } + } } }, @@ -4668,11 +4677,28 @@ Handlers.prototype._fns = { 'subscript-child-wildcard': _descend(function() { return true }), + // (wje) - patched 2019-03-07 to add creation capability. 'subscript-child-slice': function(component, partial) { if (is_array(partial.value)) { - var args = component.expression.value.split(':').map(_parse_nullable_int); + var indexes = component.expression.value.split(':'); + var args = indexes.map(_parse_nullable_int); var values = partial.value.map(function(v, i) { return { value: v, path: partial.path.concat(i) } }); - return slice.apply(null, [values].concat(args)); + var results = slice.apply(null, [values].concat(args)); + + // if we're in 'apply mode', that means that were called as part of an + // 'apply' operation. + if (this.applyMode) { + var start = parseInt(indexes[0]); + results.forEach(function(element, index) { + if (element === undefined) { + results[index] = { + value: 'stub', + path: partial.path.concat(start + index) + } + } + }); + } + return results; } }, @@ -4785,24 +4811,49 @@ function is_object(val) { return val && !(val instanceof Array) && val instanceof Object; } +// (wje) - patched 2019-03-07 to add creation capability. function traverser(recurse) { return function(partial, ref, passable, count) { var value = partial.value; var path = partial.path; + var comp = partial.component; + var nextComp = partial.nextComponent; var results = []; var descend = function(value, path) { if (is_array(value)) { + value.forEach(function(element, index) { if (results.length >= count) { return } if (passable(index, element, ref)) { results.push({ path: path.concat(index), value: element }); } }); + + if (this.applyMode && this.buildFn) { + if (results.length === 0) { + var altered = this.buildFn(partial, value, ref); + } else if (nextComp && + nextComp.operation === 'subscript' && + !is_array(results[0].value) && + !is_object(results[0].value)) { + var altered = this.buildFn(partial, value, ref); + } + if (altered) { + value = partial.value; + value.forEach(function(element, index) { + if (results.length >= count) { return } + if (passable(index, element, ref)) { + results.push({ path: path.concat(index), value: element }); + } + }); + } + } + value.forEach(function(element, index) { if (results.length >= count) { return } if (recurse) { @@ -4810,12 +4861,27 @@ function traverser(recurse) { } }); } else if (is_object(value)) { + this.keys(value).forEach(function(k) { if (results.length >= count) { return } if (passable(k, value[k], ref)) { results.push({ path: path.concat(k), value: value[k] }); } - }) + }); + + if (results.length === 0 && this.applyMode && this.buildFn) { + var altered = this.buildFn(partial, this.keys(value), ref); + if (altered) { + value = partial.value; + this.keys(value).forEach(function(k) { + if (results.length >= count) { return } + if (passable(k, value[k], ref)) { + results.push({ path: path.concat(k), value: value[k] }); + } + }); + } + } + this.keys(value).forEach(function(k) { if (results.length >= count) { return } if (recurse) { @@ -4891,17 +4957,24 @@ JSONPath.prototype.parent = function(obj, string) { return this.value(obj, node.path); } -JSONPath.prototype.apply = function(obj, string, fn) { +// (wje) - patched 2019-03-07 to add creation capability. +JSONPath.prototype.apply = function(obj, string, fn, buildFn) { assert.ok(obj instanceof Object, "obj needs to be an object"); assert.ok(string, "we need a path"); assert.equal(typeof fn, "function", "fn needs to be function") + this.handlers.applyMode = true; + this.handlers.buildFn = buildFn; + var nodes = this.nodes(obj, string).sort(function(a, b) { // sort nodes so we apply from the bottom up return b.path.length - a.path.length; }); + this.handlers.buildFn = null; + this.handlers.applyMode = false; + nodes.forEach(function(node) { var key = node.path.pop(); var parent = this.value(obj, this.stringify(node.path)); @@ -4999,6 +5072,11 @@ JSONPath.prototype.nodes = function(obj, string, count) { partials.forEach(function(p) { if (matches.length >= count) return; + + // (wje) - patched 2019-03-07 to add creation capability. + p.component = component; + p.nextComponent = path[index + 1]; + var results = handler(component, p, count); if (index == path.length - 1) { diff --git a/jsonpath.min.js b/jsonpath.min.js index e584223..3b17412 100644 --- a/jsonpath.min.js +++ b/jsonpath.min.js @@ -1,5 +1,5 @@ /*! jsonpath 1.0.1 */ !function(a){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=a();else if("function"==typeof define&&define.amd)define([],a);else{var b;b="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,b.jsonpath=a()}}(function(){var a;return function a(b,c,d){function e(g,h){if(!c[g]){if(!b[g]){var i="function"==typeof require&&require;if(!h&&i)return i(g,!0);if(f)return f(g,!0);var j=new Error("Cannot find module '"+g+"'");throw j.code="MODULE_NOT_FOUND",j}var k=c[g]={exports:{}};b[g][0].call(k.exports,function(a){var c=b[g][1][a];return e(c||a)},k,k.exports,a,b,c,d)}return c[g].exports}for(var f="function"==typeof require&&require,g=0;g=48&&a<=57}function d(a){return"0123456789abcdefABCDEF".indexOf(a)>=0}function e(a){return"01234567".indexOf(a)>=0}function f(a){return 32===a||9===a||11===a||12===a||160===a||a>=5760&&[5760,6158,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279].indexOf(a)>=0}function g(a){return 10===a||13===a||8232===a||8233===a}function h(a){return 64==a||36===a||95===a||a>=65&&a<=90||a>=97&&a<=122||92===a||a>=128&&eb.NonAsciiIdentifierStart.test(String.fromCharCode(a))}function i(a){return 36===a||95===a||a>=65&&a<=90||a>=97&&a<=122||a>=48&&a<=57||92===a||a>=128&&eb.NonAsciiIdentifierPart.test(String.fromCharCode(a))}function j(a){switch(a){case"class":case"enum":case"export":case"extends":case"import":case"super":return!0;default:return!1}}function k(a){switch(a){case"implements":case"interface":case"package":case"private":case"protected":case"public":case"static":case"yield":case"let":return!0;default:return!1}}function l(a){return"eval"===a||"arguments"===a}function m(a){if(hb&&k(a))return!0;switch(a.length){case 2:return"if"===a||"in"===a||"do"===a;case 3:return"var"===a||"for"===a||"new"===a||"try"===a||"let"===a;case 4:return"this"===a||"else"===a||"case"===a||"void"===a||"with"===a||"enum"===a;case 5:return"while"===a||"break"===a||"catch"===a||"throw"===a||"const"===a||"yield"===a||"class"===a||"super"===a;case 6:return"return"===a||"typeof"===a||"delete"===a||"switch"===a||"export"===a||"import"===a;case 7:return"default"===a||"finally"===a||"extends"===a;case 8:return"function"===a||"continue"===a||"debugger"===a;case 10:return"instanceof"===a;default:return!1}}function n(a,c,d,e,f){var g;b("number"==typeof d,"Comment must have valid position"),ob.lastCommentStart>=d||(ob.lastCommentStart=d,g={type:a,value:c},pb.range&&(g.range=[d,e]),pb.loc&&(g.loc=f),pb.comments.push(g),pb.attachComment&&(pb.leadingComments.push(g),pb.trailingComments.push(g)))}function o(a){var b,c,d,e;for(b=ib-a,c={start:{line:jb,column:ib-kb-a}};ib=lb&&O({},db.UnexpectedToken,"ILLEGAL");else if(42===c){if(47===gb.charCodeAt(ib+1))return++ib,++ib,void(pb.comments&&(d=gb.slice(a+2,ib-2),b.end={line:jb,column:ib-kb},n("Block",d,a,ib,b)));++ib}else++ib;O({},db.UnexpectedToken,"ILLEGAL")}function q(){var a,b;for(b=0===ib;ib>>="===(d=gb.substr(ib,4))?(ib+=4,{type:$a.Punctuator,value:d,lineNumber:jb,lineStart:kb,start:e,end:ib}):">>>"===(c=d.substr(0,3))||"<<="===c||">>="===c?(ib+=3,{type:$a.Punctuator,value:c,lineNumber:jb,lineStart:kb,start:e,end:ib}):(b=c.substr(0,2),g===b[1]&&"+-<>&|".indexOf(g)>=0||"=>"===b?(ib+=2,{type:$a.Punctuator,value:b,lineNumber:jb,lineStart:kb,start:e,end:ib}):"<>=!+-*%&|^/".indexOf(g)>=0?(++ib,{type:$a.Punctuator,value:g,lineNumber:jb,lineStart:kb,start:e,end:ib}):void O({},db.UnexpectedToken,"ILLEGAL"))}function w(a){for(var b="";ib=0&&ib0&&(d=pb.tokens[pb.tokens.length-1],d.range[0]===a&&"Punctuator"===d.type&&("/"!==d.value&&"/="!==d.value||pb.tokens.pop())),pb.tokens.push({type:"RegularExpression",value:c.literal,range:[a,ib],loc:b})),c}function F(a){return a.type===$a.Identifier||a.type===$a.Keyword||a.type===$a.BooleanLiteral||a.type===$a.NullLiteral}function G(){var a,b;if(!(a=pb.tokens[pb.tokens.length-1]))return E();if("Punctuator"===a.type){if("]"===a.value)return v();if(")"===a.value)return b=pb.tokens[pb.openParenToken-1],!b||"Keyword"!==b.type||"if"!==b.value&&"while"!==b.value&&"for"!==b.value&&"with"!==b.value?v():E();if("}"===a.value){if(pb.tokens[pb.openCurlyToken-3]&&"Keyword"===pb.tokens[pb.openCurlyToken-3].type){if(!(b=pb.tokens[pb.openCurlyToken-4]))return v()}else{if(!pb.tokens[pb.openCurlyToken-4]||"Keyword"!==pb.tokens[pb.openCurlyToken-4].type)return v();if(!(b=pb.tokens[pb.openCurlyToken-5]))return E()}return ab.indexOf(b.value)>=0?v():E()}return E()}return"Keyword"===a.type?E():v()}function H(){var a;return q(),ib>=lb?{type:$a.EOF,lineNumber:jb,lineStart:kb,start:ib,end:ib}:(a=gb.charCodeAt(ib),h(a)?u():40===a||41===a||59===a?v():39===a||34===a?z():46===a?c(gb.charCodeAt(ib+1))?y():v():c(a)?y():pb.tokenize&&47===a?G():v())}function I(){var a,b,c;return q(),a={start:{line:jb,column:ib-kb}},b=H(),a.end={line:jb,column:ib-kb},b.type!==$a.EOF&&(c=gb.slice(b.start,b.end),pb.tokens.push({type:_a[b.type],value:c,range:[b.start,b.end],loc:a})),b}function J(){var a;return a=nb,ib=a.end,jb=a.lineNumber,kb=a.lineStart,nb=void 0!==pb.tokens?I():H(),ib=a.end,jb=a.lineNumber,kb=a.lineStart,a}function K(){var a,b,c;a=ib,b=jb,c=kb,nb=void 0!==pb.tokens?I():H(),ib=a,jb=b,kb=c}function L(a,b){this.line=a,this.column=b}function M(a,b,c,d){this.start=new L(a,b),this.end=new L(c,d)}function N(){var a,b,c,d;return a=ib,b=jb,c=kb,q(),d=jb!==b,ib=a,jb=b,kb=c,d}function O(a,c){var d,e=Array.prototype.slice.call(arguments,2),f=c.replace(/%(\d)/g,function(a,c){return b(c>="===a||">>>="===a||"&="===a||"^="===a||"|="===a)}function W(){var a;if(59===gb.charCodeAt(ib)||T(";"))return void J();a=jb,q(),jb===a&&(nb.type===$a.EOF||T("}")||Q(nb))}function X(a){return a.type===bb.Identifier||a.type===bb.MemberExpression}function Y(){var a,b=[];for(a=nb,R("[");!T("]");)T(",")?(J(),b.push(null)):(b.push(pa()),T("]")||R(","));return J(),mb.markEnd(mb.createArrayExpression(b),a)}function Z(a,b){var c,d,e;return c=hb,e=nb,d=Qa(),b&&hb&&l(a[0].name)&&P(b,db.StrictParamName),hb=c,mb.markEnd(mb.createFunctionExpression(null,a,[],d),e)}function $(){var a,b;return b=nb,a=J(),a.type===$a.StringLiteral||a.type===$a.NumericLiteral?(hb&&a.octal&&P(a,db.StrictOctalLiteral),mb.markEnd(mb.createLiteral(a),b)):mb.markEnd(mb.createIdentifier(a.value),b)}function _(){var a,b,c,d,e,f;return a=nb,f=nb,a.type===$a.Identifier?(c=$(),"get"!==a.value||T(":")?"set"!==a.value||T(":")?(R(":"),d=pa(),mb.markEnd(mb.createProperty("init",c,d),f)):(b=$(),R("("),a=nb,a.type!==$a.Identifier?(R(")"),P(a,db.UnexpectedToken,a.value),d=Z([])):(e=[ta()],R(")"),d=Z(e,a)),mb.markEnd(mb.createProperty("set",b,d),f)):(b=$(),R("("),R(")"),d=Z([]),mb.markEnd(mb.createProperty("get",b,d),f))):a.type!==$a.EOF&&a.type!==$a.Punctuator?(b=$(),R(":"),d=pa(),mb.markEnd(mb.createProperty("init",b,d),f)):void Q(a)}function aa(){var a,b,c,d,e,f=[],g={},h=String;for(e=nb,R("{");!T("}");)a=_(),b=a.key.type===bb.Identifier?a.key.name:h(a.key.value),d="init"===a.kind?cb.Data:"get"===a.kind?cb.Get:cb.Set,c="$"+b,Object.prototype.hasOwnProperty.call(g,c)?(g[c]===cb.Data?hb&&d===cb.Data?P({},db.StrictDuplicateProperty):d!==cb.Data&&P({},db.AccessorDataProperty):d===cb.Data?P({},db.AccessorDataProperty):g[c]&d&&P({},db.AccessorGetSet),g[c]|=d):g[c]=d,f.push(a),T("}")||R(",");return R("}"),mb.markEnd(mb.createObjectExpression(f),e)}function ba(){var a;return R("("),a=qa(),R(")"),a}function ca(){var a,b,c,d;if(T("("))return ba();if(T("["))return Y();if(T("{"))return aa();if(a=nb.type,d=nb,a===$a.Identifier)c=mb.createIdentifier(J().value);else if(a===$a.StringLiteral||a===$a.NumericLiteral)hb&&nb.octal&&P(nb,db.StrictOctalLiteral),c=mb.createLiteral(J());else if(a===$a.Keyword){if(U("function"))return Ta();U("this")?(J(),c=mb.createThisExpression()):Q(J())}else a===$a.BooleanLiteral?(b=J(),b.value="true"===b.value,c=mb.createLiteral(b)):a===$a.NullLiteral?(b=J(),b.value=null,c=mb.createLiteral(b)):T("/")||T("/=")?(c=void 0!==pb.tokens?mb.createLiteral(E()):mb.createLiteral(D()),K()):Q(J());return mb.markEnd(c,d)}function da(){var a=[];if(R("("),!T(")"))for(;ib":case"<=":case">=":case"instanceof":c=7;break;case"in":c=b?7:0;break;case"<<":case">>":case">>>":c=8;break;case"+":case"-":c=9;break;case"*":case"/":case"%":c=11}return c}function na(){var a,b,c,d,e,f,g,h,i,j;if(a=nb,i=la(),d=nb,0===(e=ma(d,ob.allowIn)))return i;for(d.prec=e,J(),b=[a,nb],g=la(),f=[i,d,g];(e=ma(nb,ob.allowIn))>0;){for(;f.length>2&&e<=f[f.length-2].prec;)g=f.pop(),h=f.pop().value,i=f.pop(),c=mb.createBinaryExpression(h,i,g),b.pop(),a=b[b.length-1],mb.markEnd(c,a),f.push(c);d=J(),d.prec=e,f.push(d),b.push(nb),c=la(),f.push(c)}for(j=f.length-1,c=f[j],b.pop();j>1;)c=mb.createBinaryExpression(f[j-1].value,f[j-2],c),j-=2,a=b.pop(),mb.markEnd(c,a);return c}function oa(){var a,b,c,d,e;return e=nb,a=na(),T("?")&&(J(),b=ob.allowIn,ob.allowIn=!0,c=pa(),ob.allowIn=b,R(":"),d=pa(),a=mb.createConditionalExpression(a,c,d),mb.markEnd(a,e)),a}function pa(){var a,b,c,d,e;return a=nb,e=nb,d=b=oa(),V()&&(X(b)||P({},db.InvalidLHSInAssignment),hb&&b.type===bb.Identifier&&l(b.name)&&P(a,db.StrictLHSAssignment),a=J(),c=pa(),d=mb.markEnd(mb.createAssignmentExpression(a.value,b,c),e)),d}function qa(){var a,b=nb;if(a=pa(),T(",")){for(a=mb.createSequenceExpression([a]);ib0?1:0,kb=0,lb=gb.length,nb=null,ob={allowIn:!0,labelSet:{},inFunctionBody:!1,inIteration:!1,inSwitch:!1,lastCommentStart:-1},pb={},b=b||{},b.tokens=!0,pb.tokens=[],pb.tokenize=!0,pb.openParenToken=-1,pb.openCurlyToken=-1,pb.range="boolean"==typeof b.range&&b.range,pb.loc="boolean"==typeof b.loc&&b.loc,"boolean"==typeof b.comment&&b.comment&&(pb.comments=[]),"boolean"==typeof b.tolerant&&b.tolerant&&(pb.errors=[]);try{if(K(),nb.type===$a.EOF)return pb.tokens;for(J();nb.type!==$a.EOF;)try{J()}catch(e){if(nb,pb.errors){pb.errors.push(e);break}throw e}Xa(),d=pb.tokens,void 0!==pb.comments&&(d.comments=pb.comments),void 0!==pb.errors&&(d.errors=pb.errors)}catch(f){throw f}finally{pb={}}return d}function Za(a,b){var c,d;d=String,"string"==typeof a||a instanceof String||(a=d(a)),mb=fb,gb=a,ib=0,jb=gb.length>0?1:0,kb=0,lb=gb.length,nb=null,ob={allowIn:!0,labelSet:{},inFunctionBody:!1,inIteration:!1,inSwitch:!1,lastCommentStart:-1},pb={},void 0!==b&&(pb.range="boolean"==typeof b.range&&b.range,pb.loc="boolean"==typeof b.loc&&b.loc,pb.attachComment="boolean"==typeof b.attachComment&&b.attachComment,pb.loc&&null!==b.source&&void 0!==b.source&&(pb.source=d(b.source)),"boolean"==typeof b.tokens&&b.tokens&&(pb.tokens=[]),"boolean"==typeof b.comment&&b.comment&&(pb.comments=[]),"boolean"==typeof b.tolerant&&b.tolerant&&(pb.errors=[]),pb.attachComment&&(pb.range=!0,pb.comments=[],pb.bottomRightStack=[],pb.trailingComments=[],pb.leadingComments=[]));try{c=Wa(),void 0!==pb.comments&&(c.comments=pb.comments),void 0!==pb.tokens&&(Xa(),c.tokens=pb.tokens),void 0!==pb.errors&&(c.errors=pb.errors)}catch(e){throw e}finally{pb={}}return c}var $a,_a,ab,bb,cb,db,eb,fb,gb,hb,ib,jb,kb,lb,mb,nb,ob,pb;$a={BooleanLiteral:1,EOF:2,Identifier:3,Keyword:4,NullLiteral:5,NumericLiteral:6,Punctuator:7,StringLiteral:8,RegularExpression:9},_a={},_a[$a.BooleanLiteral]="Boolean",_a[$a.EOF]="",_a[$a.Identifier]="Identifier",_a[$a.Keyword]="Keyword",_a[$a.NullLiteral]="Null",_a[$a.NumericLiteral]="Numeric",_a[$a.Punctuator]="Punctuator",_a[$a.StringLiteral]="String",_a[$a.RegularExpression]="RegularExpression",ab=["(","{","[","in","typeof","instanceof","new","return","case","delete","throw","void","=","+=","-=","*=","/=","%=","<<=",">>=",">>>=","&=","|=","^=",",","+","-","*","/","%","++","--","<<",">>",">>>","&","|","^","!","~","&&","||","?",":","===","==",">=","<=","<",">","!=","!=="],bb={AssignmentExpression:"AssignmentExpression",ArrayExpression:"ArrayExpression",BlockStatement:"BlockStatement",BinaryExpression:"BinaryExpression",BreakStatement:"BreakStatement",CallExpression:"CallExpression",CatchClause:"CatchClause",ConditionalExpression:"ConditionalExpression",ContinueStatement:"ContinueStatement",DoWhileStatement:"DoWhileStatement",DebuggerStatement:"DebuggerStatement",EmptyStatement:"EmptyStatement",ExpressionStatement:"ExpressionStatement",ForStatement:"ForStatement",ForInStatement:"ForInStatement",FunctionDeclaration:"FunctionDeclaration",FunctionExpression:"FunctionExpression",Identifier:"Identifier",IfStatement:"IfStatement",Literal:"Literal",LabeledStatement:"LabeledStatement",LogicalExpression:"LogicalExpression",MemberExpression:"MemberExpression",NewExpression:"NewExpression",ObjectExpression:"ObjectExpression",Program:"Program",Property:"Property",ReturnStatement:"ReturnStatement",SequenceExpression:"SequenceExpression",SwitchStatement:"SwitchStatement",SwitchCase:"SwitchCase",ThisExpression:"ThisExpression",ThrowStatement:"ThrowStatement",TryStatement:"TryStatement",UnaryExpression:"UnaryExpression",UpdateExpression:"UpdateExpression",VariableDeclaration:"VariableDeclaration",VariableDeclarator:"VariableDeclarator",WhileStatement:"WhileStatement",WithStatement:"WithStatement"},cb={Data:1,Get:2,Set:4},db={UnexpectedToken:"Unexpected token %0",UnexpectedNumber:"Unexpected number",UnexpectedString:"Unexpected string",UnexpectedIdentifier:"Unexpected identifier",UnexpectedReserved:"Unexpected reserved word",UnexpectedEOS:"Unexpected end of input",NewlineAfterThrow:"Illegal newline after throw",InvalidRegExp:"Invalid regular expression",UnterminatedRegExp:"Invalid regular expression: missing /",InvalidLHSInAssignment:"Invalid left-hand side in assignment",InvalidLHSInForIn:"Invalid left-hand side in for-in",MultipleDefaultsInSwitch:"More than one default clause in switch statement",NoCatchOrFinally:"Missing catch or finally after try",UnknownLabel:"Undefined label '%0'",Redeclaration:"%0 '%1' has already been declared",IllegalContinue:"Illegal continue statement",IllegalBreak:"Illegal break statement",IllegalReturn:"Illegal return statement",StrictModeWith:"Strict mode code may not include a with statement",StrictCatchVariable:"Catch variable may not be eval or arguments in strict mode",StrictVarName:"Variable name may not be eval or arguments in strict mode",StrictParamName:"Parameter name eval or arguments is not allowed in strict mode",StrictParamDupe:"Strict mode function may not have duplicate parameter names",StrictFunctionName:"Function name may not be eval or arguments in strict mode",StrictOctalLiteral:"Octal literals are not allowed in strict mode.",StrictDelete:"Delete of an unqualified identifier in strict mode.",StrictDuplicateProperty:"Duplicate data property in object literal not allowed in strict mode", -AccessorDataProperty:"Object literal may not have data and accessor property with the same name",AccessorGetSet:"Object literal may not have multiple get/set accessors with the same name",StrictLHSAssignment:"Assignment to eval or arguments is not allowed in strict mode",StrictLHSPostfix:"Postfix increment/decrement may not have eval or arguments operand in strict mode",StrictLHSPrefix:"Prefix increment/decrement may not have eval or arguments operand in strict mode",StrictReservedWord:"Use of future reserved word in strict mode"},eb={NonAsciiIdentifierStart:new RegExp("[ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԧԱ-Ֆՙա-ևא-תװ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࢠࢢ-ࢬऄ-हऽॐक़-ॡॱ-ॷॹ-ॿঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-ళవ-హఽౘౙౠౡಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽೞೠೡೱೲഅ-ഌഎ-ഐഒ-ഺഽൎൠൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄງຈຊຍດ-ທນ-ຟມ-ຣລວສຫອ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏼᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛰᜀ-ᜌᜎ-ᜑᜠ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡷᢀ-ᢨᢪᢰ-ᣵᤀ-ᤜᥐ-ᥭᥰ-ᥴᦀ-ᦫᧁ-ᧇᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭋᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᳩ-ᳬᳮ-ᳱᳵᳶᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-Ⱞⰰ-ⱞⱠ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞⸯ々-〇〡-〩〱-〵〸-〼ぁ-ゖゝ-ゟァ-ヺー-ヿㄅ-ㄭㄱ-ㆎㆠ-ㆺㇰ-ㇿ㐀-䶵一-鿌ꀀ-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚗꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ-ꞎꞐ-ꞓꞠ-Ɦꟸ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꪀ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꯀ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ]"),NonAsciiIdentifierPart:new RegExp("[ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮ̀-ʹͶͷͺ-ͽΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁ҃-҇Ҋ-ԧԱ-Ֆՙա-և֑-ׇֽֿׁׂׅׄא-תװ-ײؐ-ؚؠ-٩ٮ-ۓە-ۜ۟-۪ۨ-ۼۿܐ-݊ݍ-ޱ߀-ߵߺࠀ-࠭ࡀ-࡛ࢠࢢ-ࢬࣤ-ࣾऀ-ॣ०-९ॱ-ॷॹ-ॿঁ-ঃঅ-ঌএঐও-নপ-রলশ-হ়-ৄেৈো-ৎৗড়ঢ়য়-ৣ০-ৱਁ-ਃਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹ਼ਾ-ੂੇੈੋ-੍ੑਖ਼-ੜਫ਼੦-ੵઁ-ઃઅ-ઍએ-ઑઓ-નપ-રલળવ-હ઼-ૅે-ૉો-્ૐૠ-ૣ૦-૯ଁ-ଃଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହ଼-ୄେୈୋ-୍ୖୗଡ଼ଢ଼ୟ-ୣ୦-୯ୱஂஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹா-ூெ-ைொ-்ௐௗ௦-௯ఁ-ఃఅ-ఌఎ-ఐఒ-నప-ళవ-హఽ-ౄె-ైొ-్ౕౖౘౙౠ-ౣ౦-౯ಂಃಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹ಼-ೄೆ-ೈೊ-್ೕೖೞೠ-ೣ೦-೯ೱೲംഃഅ-ഌഎ-ഐഒ-ഺഽ-ൄെ-ൈൊ-ൎൗൠ-ൣ൦-൯ൺ-ൿංඃඅ-ඖක-නඳ-රලව-ෆ්ා-ුූෘ-ෟෲෳก-ฺเ-๎๐-๙ກຂຄງຈຊຍດ-ທນ-ຟມ-ຣລວສຫອ-ູົ-ຽເ-ໄໆ່-ໍ໐-໙ໜ-ໟༀ༘༙༠-༩༹༵༷༾-ཇཉ-ཬཱ-྄྆-ྗྙ-ྼ࿆က-၉ၐ-ႝႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚ፝-፟ᎀ-ᎏᎠ-Ᏼᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛰᜀ-ᜌᜎ-᜔ᜠ-᜴ᝀ-ᝓᝠ-ᝬᝮ-ᝰᝲᝳក-៓ៗៜ៝០-៩᠋-᠍᠐-᠙ᠠ-ᡷᢀ-ᢪᢰ-ᣵᤀ-ᤜᤠ-ᤫᤰ-᤻᥆-ᥭᥰ-ᥴᦀ-ᦫᦰ-ᧉ᧐-᧙ᨀ-ᨛᨠ-ᩞ᩠-᩿᩼-᪉᪐-᪙ᪧᬀ-ᭋ᭐-᭙᭫-᭳ᮀ-᯳ᰀ-᰷᱀-᱉ᱍ-ᱽ᳐-᳔᳒-ᳶᴀ-ᷦ᷼-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼ‌‍‿⁀⁔ⁱⁿₐ-ₜ⃐-⃥⃜⃡-⃰ℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-Ⱞⰰ-ⱞⱠ-ⳤⳫ-ⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯ⵿-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞⷠ-ⷿⸯ々-〇〡-〯〱-〵〸-〼ぁ-ゖ゙゚ゝ-ゟァ-ヺー-ヿㄅ-ㄭㄱ-ㆎㆠ-ㆺㇰ-ㇿ㐀-䶵一-鿌ꀀ-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘫꙀ-꙯ꙴ-꙽ꙿ-ꚗꚟ-꛱ꜗ-ꜟꜢ-ꞈꞋ-ꞎꞐ-ꞓꞠ-Ɦꟸ-ꠧꡀ-ꡳꢀ-꣄꣐-꣙꣠-ꣷꣻ꤀-꤭ꤰ-꥓ꥠ-ꥼꦀ-꧀ꧏ-꧙ꨀ-ꨶꩀ-ꩍ꩐-꩙ꩠ-ꩶꩺꩻꪀ-ꫂꫛ-ꫝꫠ-ꫯꫲ-꫶ꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꯀ-ꯪ꯬꯭꯰-꯹가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻ︀-️︠-︦︳︴﹍-﹏ﹰ-ﹴﹶ-ﻼ0-9A-Z_a-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ]")},fb={name:"SyntaxTree",processComment:function(a){var b,c;if(!(a.type===bb.Program&&a.body.length>0)){for(pb.trailingComments.length>0?pb.trailingComments[0].range[0]>=a.range[1]?(c=pb.trailingComments,pb.trailingComments=[]):pb.trailingComments.length=0:pb.bottomRightStack.length>0&&pb.bottomRightStack[pb.bottomRightStack.length-1].trailingComments&&pb.bottomRightStack[pb.bottomRightStack.length-1].trailingComments[0].range[0]>=a.range[1]&&(c=pb.bottomRightStack[pb.bottomRightStack.length-1].trailingComments,delete pb.bottomRightStack[pb.bottomRightStack.length-1].trailingComments);pb.bottomRightStack.length>0&&pb.bottomRightStack[pb.bottomRightStack.length-1].range[0]>=a.range[0];)b=pb.bottomRightStack.pop();b?b.leadingComments&&b.leadingComments[b.leadingComments.length-1].range[1]<=a.range[0]&&(a.leadingComments=b.leadingComments,delete b.leadingComments):pb.leadingComments.length>0&&pb.leadingComments[pb.leadingComments.length-1].range[1]<=a.range[0]&&(a.leadingComments=pb.leadingComments,pb.leadingComments=[]),c&&(a.trailingComments=c),pb.bottomRightStack.push(a)}},markEnd:function(a,b){return pb.range&&(a.range=[b.start,ib]),pb.loc&&(a.loc=new M(void 0===b.startLineNumber?b.lineNumber:b.startLineNumber,b.start-(void 0===b.startLineStart?b.lineStart:b.startLineStart),jb,ib-kb),this.postProcess(a)),pb.attachComment&&this.processComment(a),a},postProcess:function(a){return pb.source&&(a.loc.source=pb.source),a},createArrayExpression:function(a){return{type:bb.ArrayExpression,elements:a}},createAssignmentExpression:function(a,b,c){return{type:bb.AssignmentExpression,operator:a,left:b,right:c}},createBinaryExpression:function(a,b,c){return{type:"||"===a||"&&"===a?bb.LogicalExpression:bb.BinaryExpression,operator:a,left:b,right:c}},createBlockStatement:function(a){return{type:bb.BlockStatement,body:a}},createBreakStatement:function(a){return{type:bb.BreakStatement,label:a}},createCallExpression:function(a,b){return{type:bb.CallExpression,callee:a,arguments:b}},createCatchClause:function(a,b){return{type:bb.CatchClause,param:a,body:b}},createConditionalExpression:function(a,b,c){return{type:bb.ConditionalExpression,test:a,consequent:b,alternate:c}},createContinueStatement:function(a){return{type:bb.ContinueStatement,label:a}},createDebuggerStatement:function(){return{type:bb.DebuggerStatement}},createDoWhileStatement:function(a,b){return{type:bb.DoWhileStatement,body:a,test:b}},createEmptyStatement:function(){return{type:bb.EmptyStatement}},createExpressionStatement:function(a){return{type:bb.ExpressionStatement,expression:a}},createForStatement:function(a,b,c,d){return{type:bb.ForStatement,init:a,test:b,update:c,body:d}},createForInStatement:function(a,b,c){return{type:bb.ForInStatement,left:a,right:b,body:c,each:!1}},createFunctionDeclaration:function(a,b,c,d){return{type:bb.FunctionDeclaration,id:a,params:b,defaults:c,body:d,rest:null,generator:!1,expression:!1}},createFunctionExpression:function(a,b,c,d){return{type:bb.FunctionExpression,id:a,params:b,defaults:c,body:d,rest:null,generator:!1,expression:!1}},createIdentifier:function(a){return{type:bb.Identifier,name:a}},createIfStatement:function(a,b,c){return{type:bb.IfStatement,test:a,consequent:b,alternate:c}},createLabeledStatement:function(a,b){return{type:bb.LabeledStatement,label:a,body:b}},createLiteral:function(a){return{type:bb.Literal,value:a.value,raw:gb.slice(a.start,a.end)}},createMemberExpression:function(a,b,c){return{type:bb.MemberExpression,computed:"["===a,object:b,property:c}},createNewExpression:function(a,b){return{type:bb.NewExpression,callee:a,arguments:b}},createObjectExpression:function(a){return{type:bb.ObjectExpression,properties:a}},createPostfixExpression:function(a,b){return{type:bb.UpdateExpression,operator:a,argument:b,prefix:!1}},createProgram:function(a){return{type:bb.Program,body:a}},createProperty:function(a,b,c){return{type:bb.Property,key:b,value:c,kind:a}},createReturnStatement:function(a){return{type:bb.ReturnStatement,argument:a}},createSequenceExpression:function(a){return{type:bb.SequenceExpression,expressions:a}},createSwitchCase:function(a,b){return{type:bb.SwitchCase,test:a,consequent:b}},createSwitchStatement:function(a,b){return{type:bb.SwitchStatement,discriminant:a,cases:b}},createThisExpression:function(){return{type:bb.ThisExpression}},createThrowStatement:function(a){return{type:bb.ThrowStatement,argument:a}},createTryStatement:function(a,b,c,d){return{type:bb.TryStatement,block:a,guardedHandlers:b,handlers:c,finalizer:d}},createUnaryExpression:function(a,b){return"++"===a||"--"===a?{type:bb.UpdateExpression,operator:a,argument:b,prefix:!0}:{type:bb.UnaryExpression,operator:a,argument:b,prefix:!0}},createVariableDeclaration:function(a,b){return{type:bb.VariableDeclaration,declarations:a,kind:b}},createVariableDeclarator:function(a,b){return{type:bb.VariableDeclarator,id:a,init:b}},createWhileStatement:function(a,b){return{type:bb.WhileStatement,test:a,body:b}},createWithStatement:function(a,b){return{type:bb.WithStatement,object:a,body:b}}},a.version="1.2.2",a.tokenize=Ya,a.parse=Za,a.Syntax=function(){var a,b={};"function"==typeof Object.create&&(b=Object.create(null));for(a in bb)bb.hasOwnProperty(a)&&(b[a]=bb[a]);return"function"==typeof Object.freeze&&Object.freeze(b),b}()})},{}],1:[function(a,b,c){(function(d){var e=function(){function a(){this.yy={}}var b={trace:function(){},yy:{},symbols_:{error:2,JSON_PATH:3,DOLLAR:4,PATH_COMPONENTS:5,LEADING_CHILD_MEMBER_EXPRESSION:6,PATH_COMPONENT:7,MEMBER_COMPONENT:8,SUBSCRIPT_COMPONENT:9,CHILD_MEMBER_COMPONENT:10,DESCENDANT_MEMBER_COMPONENT:11,DOT:12,MEMBER_EXPRESSION:13,DOT_DOT:14,STAR:15,IDENTIFIER:16,SCRIPT_EXPRESSION:17,INTEGER:18,END:19,CHILD_SUBSCRIPT_COMPONENT:20,DESCENDANT_SUBSCRIPT_COMPONENT:21,"[":22,SUBSCRIPT:23,"]":24,SUBSCRIPT_EXPRESSION:25,SUBSCRIPT_EXPRESSION_LIST:26,SUBSCRIPT_EXPRESSION_LISTABLE:27,",":28,STRING_LITERAL:29,ARRAY_SLICE:30,FILTER_EXPRESSION:31,QQ_STRING:32,Q_STRING:33,$accept:0,$end:1},terminals_:{2:"error",4:"DOLLAR",12:"DOT",14:"DOT_DOT",15:"STAR",16:"IDENTIFIER",17:"SCRIPT_EXPRESSION",18:"INTEGER",19:"END",22:"[",24:"]",28:",",30:"ARRAY_SLICE",31:"FILTER_EXPRESSION",32:"QQ_STRING",33:"Q_STRING"},productions_:[0,[3,1],[3,2],[3,1],[3,2],[5,1],[5,2],[7,1],[7,1],[8,1],[8,1],[10,2],[6,1],[11,2],[13,1],[13,1],[13,1],[13,1],[13,1],[9,1],[9,1],[20,3],[21,4],[23,1],[23,1],[26,1],[26,3],[27,1],[27,1],[27,1],[25,1],[25,1],[25,1],[29,1],[29,1]],performAction:function(a,b,d,e,f,g,h){e.ast||(e.ast=c,c.initialize());var i=g.length-1;switch(f){case 1:return e.ast.set({expression:{type:"root",value:g[i]}}),e.ast.unshift(),e.ast.yield();case 2:return e.ast.set({expression:{type:"root",value:g[i-1]}}),e.ast.unshift(),e.ast.yield();case 3:return e.ast.unshift(),e.ast.yield();case 4:return e.ast.set({operation:"member",scope:"child",expression:{type:"identifier",value:g[i-1]}}),e.ast.unshift(),e.ast.yield();case 5:case 6:break;case 7:e.ast.set({operation:"member"}),e.ast.push();break;case 8:e.ast.set({operation:"subscript"}),e.ast.push();break;case 9:e.ast.set({scope:"child"});break;case 10:e.ast.set({scope:"descendant"});break;case 11:break;case 12:e.ast.set({scope:"child",operation:"member"});break;case 13:break;case 14:e.ast.set({expression:{type:"wildcard",value:g[i]}});break;case 15:e.ast.set({expression:{type:"identifier",value:g[i]}});break;case 16:e.ast.set({expression:{type:"script_expression",value:g[i]}});break;case 17:e.ast.set({expression:{type:"numeric_literal",value:parseInt(g[i])}});break;case 18:break;case 19:e.ast.set({scope:"child"});break;case 20:e.ast.set({scope:"descendant"});break;case 21:case 22:case 23:break;case 24:g[i].length>1?e.ast.set({expression:{type:"union",value:g[i]}}):this.$=g[i];break;case 25:this.$=[g[i]];break;case 26:this.$=g[i-2].concat(g[i]);break;case 27:this.$={expression:{type:"numeric_literal",value:parseInt(g[i])}},e.ast.set(this.$);break;case 28:this.$={expression:{type:"string_literal",value:g[i]}},e.ast.set(this.$);break;case 29:this.$={expression:{type:"slice",value:g[i]}},e.ast.set(this.$);break;case 30:this.$={expression:{type:"wildcard",value:g[i]}},e.ast.set(this.$);break;case 31:this.$={expression:{type:"script_expression",value:g[i]}},e.ast.set(this.$);break;case 32:this.$={expression:{type:"filter_expression",value:g[i]}},e.ast.set(this.$);break;case 33:case 34:this.$=g[i]}},table:[{3:1,4:[1,2],6:3,13:4,15:[1,5],16:[1,6],17:[1,7],18:[1,8],19:[1,9]},{1:[3]},{1:[2,1],5:10,7:11,8:12,9:13,10:14,11:15,12:[1,18],14:[1,19],20:16,21:17,22:[1,20]},{1:[2,3],5:21,7:11,8:12,9:13,10:14,11:15,12:[1,18],14:[1,19],20:16,21:17,22:[1,20]},{1:[2,12],12:[2,12],14:[2,12],22:[2,12]},{1:[2,14],12:[2,14],14:[2,14],22:[2,14]},{1:[2,15],12:[2,15],14:[2,15],22:[2,15]},{1:[2,16],12:[2,16],14:[2,16],22:[2,16]},{1:[2,17],12:[2,17],14:[2,17],22:[2,17]},{1:[2,18],12:[2,18],14:[2,18],22:[2,18]},{1:[2,2],7:22,8:12,9:13,10:14,11:15,12:[1,18],14:[1,19],20:16,21:17,22:[1,20]},{1:[2,5],12:[2,5],14:[2,5],22:[2,5]},{1:[2,7],12:[2,7],14:[2,7],22:[2,7]},{1:[2,8],12:[2,8],14:[2,8],22:[2,8]},{1:[2,9],12:[2,9],14:[2,9],22:[2,9]},{1:[2,10],12:[2,10],14:[2,10],22:[2,10]},{1:[2,19],12:[2,19],14:[2,19],22:[2,19]},{1:[2,20],12:[2,20],14:[2,20],22:[2,20]},{13:23,15:[1,5],16:[1,6],17:[1,7],18:[1,8],19:[1,9]},{13:24,15:[1,5],16:[1,6],17:[1,7],18:[1,8],19:[1,9],22:[1,25]},{15:[1,29],17:[1,30],18:[1,33],23:26,25:27,26:28,27:32,29:34,30:[1,35],31:[1,31],32:[1,36],33:[1,37]},{1:[2,4],7:22,8:12,9:13,10:14,11:15,12:[1,18],14:[1,19],20:16,21:17,22:[1,20]},{1:[2,6],12:[2,6],14:[2,6],22:[2,6]},{1:[2,11],12:[2,11],14:[2,11],22:[2,11]},{1:[2,13],12:[2,13],14:[2,13],22:[2,13]},{15:[1,29],17:[1,30],18:[1,33],23:38,25:27,26:28,27:32,29:34,30:[1,35],31:[1,31],32:[1,36],33:[1,37]},{24:[1,39]},{24:[2,23]},{24:[2,24],28:[1,40]},{24:[2,30]},{24:[2,31]},{24:[2,32]},{24:[2,25],28:[2,25]},{24:[2,27],28:[2,27]},{24:[2,28],28:[2,28]},{24:[2,29],28:[2,29]},{24:[2,33],28:[2,33]},{24:[2,34],28:[2,34]},{24:[1,41]},{1:[2,21],12:[2,21],14:[2,21],22:[2,21]},{18:[1,33],27:42,29:34,30:[1,35],32:[1,36],33:[1,37]},{1:[2,22],12:[2,22],14:[2,22],22:[2,22]},{24:[2,26],28:[2,26]}],defaultActions:{27:[2,23],29:[2,30],30:[2,31],31:[2,32]},parseError:function(a,b){if(!b.recoverable)throw new Error(a);this.trace(a)},parse:function(a){function b(){var a;return a=c.lexer.lex()||m,"number"!=typeof a&&(a=c.symbols_[a]||a),a}var c=this,d=[0],e=[null],f=[],g=this.table,h="",i=0,j=0,k=0,l=2,m=1,n=f.slice.call(arguments,1);this.lexer.setInput(a),this.lexer.yy=this.yy,this.yy.lexer=this.lexer,this.yy.parser=this,void 0===this.lexer.yylloc&&(this.lexer.yylloc={});var o=this.lexer.yylloc;f.push(o);var p=this.lexer.options&&this.lexer.options.ranges;"function"==typeof this.yy.parseError?this.parseError=this.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;for(var q,r,s,t,u,v,w,x,y,z={};;){if(s=d[d.length-1],this.defaultActions[s]?t=this.defaultActions[s]:(null!==q&&void 0!==q||(q=b()),t=g[s]&&g[s][q]),void 0===t||!t.length||!t[0]){var A="";y=[];for(v in g[s])this.terminals_[v]&&v>l&&y.push("'"+this.terminals_[v]+"'");A=this.lexer.showPosition?"Parse error on line "+(i+1)+":\n"+this.lexer.showPosition()+"\nExpecting "+y.join(", ")+", got '"+(this.terminals_[q]||q)+"'":"Parse error on line "+(i+1)+": Unexpected "+(q==m?"end of input":"'"+(this.terminals_[q]||q)+"'"),this.parseError(A,{text:this.lexer.match,token:this.terminals_[q]||q,line:this.lexer.yylineno,loc:o,expected:y})}if(t[0]instanceof Array&&t.length>1)throw new Error("Parse Error: multiple actions possible at state: "+s+", token: "+q);switch(t[0]){case 1:d.push(q),e.push(this.lexer.yytext),f.push(this.lexer.yylloc),d.push(t[1]),q=null,r?(q=r,r=null):(j=this.lexer.yyleng,h=this.lexer.yytext,i=this.lexer.yylineno,o=this.lexer.yylloc,k>0&&k--);break;case 2:if(w=this.productions_[t[1]][1],z.$=e[e.length-w],z._$={first_line:f[f.length-(w||1)].first_line,last_line:f[f.length-1].last_line,first_column:f[f.length-(w||1)].first_column,last_column:f[f.length-1].last_column},p&&(z._$.range=[f[f.length-(w||1)].range[0],f[f.length-1].range[1]]),void 0!==(u=this.performAction.apply(z,[h,j,i,this.yy,t[1],e,f].concat(n))))return u;w&&(d=d.slice(0,-1*w*2),e=e.slice(0,-1*w),f=f.slice(0,-1*w)),d.push(this.productions_[t[1]][0]),e.push(z.$),f.push(z._$),x=g[d[d.length-2]][d[d.length-1]],d.push(x);break;case 3:return!0}}return!0}},c={initialize:function(){this._nodes=[],this._node={},this._stash=[]},set:function(a){for(var b in a)this._node[b]=a[b];return this._node},node:function(a){return arguments.length&&(this._node=a),this._node},push:function(){this._nodes.push(this._node),this._node={}},unshift:function(){this._nodes.unshift(this._node),this._node={}},yield:function(){var a=this._nodes;return this.initialize(),a}},d=function(){return{EOF:1,parseError:function(a,b){if(!this.yy.parser)throw new Error(a);this.yy.parser.parseError(a,b)},setInput:function(a){return this._input=a,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var a=this._input[0];return this.yytext+=a,this.yyleng++,this.offset++,this.match+=a,this.matched+=a,a.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),a},unput:function(a){var b=a.length,c=a.split(/(?:\r\n?|\n)/g);this._input=a+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-b-1),this.offset-=b;var d=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),c.length-1&&(this.yylineno-=c.length-1);var e=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:c?(c.length===d.length?this.yylloc.first_column:0)+d[d.length-c.length].length-c[0].length:this.yylloc.first_column-b},this.options.ranges&&(this.yylloc.range=[e[0],e[0]+this.yyleng-b]),this.yyleng=this.yytext.length,this},more:function(){return this._more=!0,this},reject:function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},less:function(a){this.unput(this.match.slice(a))},pastInput:function(){var a=this.matched.substr(0,this.matched.length-this.match.length);return(a.length>20?"...":"")+a.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var a=this.match;return a.length<20&&(a+=this._input.substr(0,20-a.length)),(a.substr(0,20)+(a.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var a=this.pastInput(),b=new Array(a.length+1).join("-");return a+this.upcomingInput()+"\n"+b+"^"},test_match:function(a,b){var c,d,e;if(this.options.backtrack_lexer&&(e={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(e.yylloc.range=this.yylloc.range.slice(0))),d=a[0].match(/(?:\r\n?|\n).*/g),d&&(this.yylineno+=d.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:d?d[d.length-1].length-d[d.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+a[0].length},this.yytext+=a[0],this.match+=a[0],this.matches=a,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(a[0].length),this.matched+=a[0],c=this.performAction.call(this,this.yy,this,b,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),c)return c;if(this._backtrack){for(var f in e)this[f]=e[f];return!1}return!1},next:function(){if(this.done)return this.EOF;this._input||(this.done=!0);var a,b,c,d;this._more||(this.yytext="",this.match="");for(var e=this._currentRules(),f=0;fb[0].length)){if(b=c,d=f,this.options.backtrack_lexer){if(!1!==(a=this.test_match(c,e[f])))return a;if(this._backtrack){b=!1;continue}return!1}if(!this.options.flex)break}return b?!1!==(a=this.test_match(b,e[d]))&&a:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var a=this.next();return a||this.lex()},begin:function(a){this.conditionStack.push(a)},popState:function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},_currentRules:function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},topState:function(a){return a=this.conditionStack.length-1-Math.abs(a||0),a>=0?this.conditionStack[a]:"INITIAL"},pushState:function(a){this.begin(a)},stateStackSize:function(){return this.conditionStack.length},options:{},performAction:function(a,b,c,d){switch(c){case 0:return 4;case 1:return 14;case 2:return 12;case 3:return 15;case 4:return 16;case 5:return 22;case 6:return 24;case 7:return 28;case 8:return 30;case 9:return 18;case 10:return b.yytext=b.yytext.substr(1,b.yyleng-2),32;case 11:return b.yytext=b.yytext.substr(1,b.yyleng-2),33;case 12:return 17;case 13:return 31}},rules:[/^(?:\$)/,/^(?:\.\.)/,/^(?:\.)/,/^(?:\*)/,/^(?:[a-zA-Z_]+[a-zA-Z0-9_]*)/,/^(?:\[)/,/^(?:\])/,/^(?:,)/,/^(?:((-?(?:0|[1-9][0-9]*)))?\:((-?(?:0|[1-9][0-9]*)))?(\:((-?(?:0|[1-9][0-9]*)))?)?)/,/^(?:(-?(?:0|[1-9][0-9]*)))/,/^(?:"(?:\\["bfnrt\/\\]|\\u[a-fA-F0-9]{4}|[^"\\])*")/,/^(?:'(?:\\['bfnrt\/\\]|\\u[a-fA-F0-9]{4}|[^'\\])*')/,/^(?:\(.+?\)(?=\]))/,/^(?:\?\(.+?\)(?=\]))/],conditions:{INITIAL:{rules:[0,1,2,3,4,5,6,7,8,9,10,11,12,13],inclusive:!0}}}}();return b.lexer=d,a.prototype=b,b.Parser=a,new a}();void 0!==a&&void 0!==c&&(c.parser=e,c.Parser=e.Parser,c.parse=function(){return e.parse.apply(e,arguments)},c.main=function(b){b[1]||(console.log("Usage: "+b[0]+" FILE"),d.exit(1));var e=a("fs").readFileSync(a("path").normalize(b[1]),"utf8");return c.parser.parse(e)},void 0!==b&&a.main===b&&c.main(d.argv.slice(1)))}).call(this,a("_process"))},{_process:14,fs:12,path:13}],2:[function(a,b,c){b.exports={identifier:"[a-zA-Z_]+[a-zA-Z0-9_]*",integer:"-?(?:0|[1-9][0-9]*)",qq_string:'"(?:\\\\["bfnrt/\\\\]|\\\\u[a-fA-F0-9]{4}|[^"\\\\])*"',q_string:"'(?:\\\\['bfnrt/\\\\]|\\\\u[a-fA-F0-9]{4}|[^'\\\\])*'"}},{}],3:[function(a,b,c){var d=a("./dict"),e=a("fs"),f={lex:{macros:{esc:"\\\\",int:d.integer},rules:[["\\$","return 'DOLLAR'"],["\\.\\.","return 'DOT_DOT'"],["\\.","return 'DOT'"],["\\*","return 'STAR'"],[d.identifier,"return 'IDENTIFIER'"],["\\[","return '['"],["\\]","return ']'"],[",","return ','"],["({int})?\\:({int})?(\\:({int})?)?","return 'ARRAY_SLICE'"],["{int}","return 'INTEGER'"],[d.qq_string,"yytext = yytext.substr(1,yyleng-2); return 'QQ_STRING';"],[d.q_string,"yytext = yytext.substr(1,yyleng-2); return 'Q_STRING';"],["\\(.+?\\)(?=\\])","return 'SCRIPT_EXPRESSION'"],["\\?\\(.+?\\)(?=\\])","return 'FILTER_EXPRESSION'"]]},start:"JSON_PATH",bnf:{JSON_PATH:[["DOLLAR",'yy.ast.set({ expression: { type: "root", value: $1 } }); yy.ast.unshift(); return yy.ast.yield()'],["DOLLAR PATH_COMPONENTS",'yy.ast.set({ expression: { type: "root", value: $1 } }); yy.ast.unshift(); return yy.ast.yield()'],["LEADING_CHILD_MEMBER_EXPRESSION","yy.ast.unshift(); return yy.ast.yield()"],["LEADING_CHILD_MEMBER_EXPRESSION PATH_COMPONENTS",'yy.ast.set({ operation: "member", scope: "child", expression: { type: "identifier", value: $1 }}); yy.ast.unshift(); return yy.ast.yield()']],PATH_COMPONENTS:[["PATH_COMPONENT",""],["PATH_COMPONENTS PATH_COMPONENT",""]],PATH_COMPONENT:[["MEMBER_COMPONENT",'yy.ast.set({ operation: "member" }); yy.ast.push()'],["SUBSCRIPT_COMPONENT",'yy.ast.set({ operation: "subscript" }); yy.ast.push() ']],MEMBER_COMPONENT:[["CHILD_MEMBER_COMPONENT",'yy.ast.set({ scope: "child" })'],["DESCENDANT_MEMBER_COMPONENT",'yy.ast.set({ scope: "descendant" })']],CHILD_MEMBER_COMPONENT:[["DOT MEMBER_EXPRESSION",""]],LEADING_CHILD_MEMBER_EXPRESSION:[["MEMBER_EXPRESSION",'yy.ast.set({ scope: "child", operation: "member" })']],DESCENDANT_MEMBER_COMPONENT:[["DOT_DOT MEMBER_EXPRESSION",""]],MEMBER_EXPRESSION:[["STAR",'yy.ast.set({ expression: { type: "wildcard", value: $1 } })'],["IDENTIFIER",'yy.ast.set({ expression: { type: "identifier", value: $1 } })'],["SCRIPT_EXPRESSION",'yy.ast.set({ expression: { type: "script_expression", value: $1 } })'],["INTEGER",'yy.ast.set({ expression: { type: "numeric_literal", value: parseInt($1) } })'],["END",""]],SUBSCRIPT_COMPONENT:[["CHILD_SUBSCRIPT_COMPONENT",'yy.ast.set({ scope: "child" })'],["DESCENDANT_SUBSCRIPT_COMPONENT",'yy.ast.set({ scope: "descendant" })']],CHILD_SUBSCRIPT_COMPONENT:[["[ SUBSCRIPT ]",""]],DESCENDANT_SUBSCRIPT_COMPONENT:[["DOT_DOT [ SUBSCRIPT ]",""]],SUBSCRIPT:[["SUBSCRIPT_EXPRESSION",""],["SUBSCRIPT_EXPRESSION_LIST",'$1.length > 1? yy.ast.set({ expression: { type: "union", value: $1 } }) : $$ = $1']],SUBSCRIPT_EXPRESSION_LIST:[["SUBSCRIPT_EXPRESSION_LISTABLE","$$ = [$1]"],["SUBSCRIPT_EXPRESSION_LIST , SUBSCRIPT_EXPRESSION_LISTABLE","$$ = $1.concat($3)"]],SUBSCRIPT_EXPRESSION_LISTABLE:[["INTEGER",'$$ = { expression: { type: "numeric_literal", value: parseInt($1) } }; yy.ast.set($$)'],["STRING_LITERAL",'$$ = { expression: { type: "string_literal", value: $1 } }; yy.ast.set($$)'],["ARRAY_SLICE",'$$ = { expression: { type: "slice", value: $1 } }; yy.ast.set($$)']],SUBSCRIPT_EXPRESSION:[["STAR",'$$ = { expression: { type: "wildcard", value: $1 } }; yy.ast.set($$)'],["SCRIPT_EXPRESSION",'$$ = { expression: { type: "script_expression", value: $1 } }; yy.ast.set($$)'],["FILTER_EXPRESSION",'$$ = { expression: { type: "filter_expression", value: $1 } }; yy.ast.set($$)']],STRING_LITERAL:[["QQ_STRING","$$ = $1"],["Q_STRING","$$ = $1"]]}};e.readFileSync&&(f.moduleInclude=e.readFileSync(a.resolve("../include/module.js")),f.actionInclude=e.readFileSync(a.resolve("../include/action.js"))),b.exports=f},{"./dict":2,fs:12}],4:[function(a,b,c){function d(b,c,d){var e=a("./index"),f=m.parse(c).body[0].expression,g=j(f,{"@":b.value}),h=d.replace(/\{\{\s*value\s*\}\}/g,g),i=e.nodes(b.value,h);return i.forEach(function(a){a.path=b.path.concat(a.path.slice(1))}),i}function e(a){return Array.isArray(a)}function f(a){return a&&!(a instanceof Array)&&a instanceof Object}function g(a){return function(b,c,d,g){var h=b.value,i=b.path,j=[],k=function(b,h){e(b)?(b.forEach(function(a,b){j.length>=g||d(b,a,c)&&j.push({path:h.concat(b),value:a})}),b.forEach(function(b,c){j.length>=g||a&&k(b,h.concat(c))})):f(b)&&(this.keys(b).forEach(function(a){j.length>=g||d(a,b[a],c)&&j.push({path:h.concat(a),value:b[a]})}),this.keys(b).forEach(function(c){j.length>=g||a&&k(b[c],h.concat(c))}))}.bind(this);return k(h,i),j}}function h(a){return function(b,c,d){return this.descend(c,b.expression.value,a,d)}}function i(a){return function(b,c,d){return this.traverse(c,b.expression.value,a,d)}}function j(){try{return o.apply(this,arguments)}catch(a){}}function k(a){return a=a.filter(function(a){return a}),p(a,function(a){return a.path.map(function(a){return String(a).replace("-","--")}).join("-")})}function l(a){var b=String(a);return b.match(/^-?[0-9]+$/)?parseInt(b):null}var m=a("./aesprim"),n=a("./slice"),o=a("static-eval"),p=a("underscore").uniq,q=function(){return this.initialize.apply(this,arguments)};q.prototype.initialize=function(){this.traverse=g(!0),this.descend=g()},q.prototype.keys=Object.keys,q.prototype.resolve=function(a){var b=[a.operation,a.scope,a.expression.type].join("-"),c=this._fns[b];if(!c)throw new Error("couldn't resolve key: "+b);return c.bind(this)},q.prototype.register=function(a,b){if(!b instanceof Function)throw new Error("handler must be a function");this._fns[a]=b},q.prototype._fns={"member-child-identifier":function(a,b){var c=a.expression.value,d=b.value;if(d instanceof Object&&c in d)return[{value:d[c],path:b.path.concat(c)}]},"member-descendant-identifier":i(function(a,b,c){return a==c}),"subscript-child-numeric_literal":h(function(a,b,c){return a===c}),"member-child-numeric_literal":h(function(a,b,c){return String(a)===String(c)}),"subscript-descendant-numeric_literal":i(function(a,b,c){return a===c}),"member-child-wildcard":h(function(){return!0}),"member-descendant-wildcard":i(function(){return!0}),"subscript-descendant-wildcard":i(function(){return!0}),"subscript-child-wildcard":h(function(){return!0}),"subscript-child-slice":function(a,b){if(e(b.value)){var c=a.expression.value.split(":").map(l),d=b.value.map(function(a,c){return{value:a,path:b.path.concat(c)}});return n.apply(null,[d].concat(c))}},"subscript-child-union":function(a,b){var c=[];return a.expression.value.forEach(function(a){var d={operation:"subscript",scope:"child",expression:a.expression},e=this.resolve(d),f=e(d,b);f&&(c=c.concat(f))},this),k(c)},"subscript-descendant-union":function(b,c,d){var e=a(".."),f=this,g=[];return e.nodes(c,"$..*").slice(1).forEach(function(a){g.length>=d||b.expression.value.forEach(function(b){var c={operation:"subscript",scope:"child",expression:b.expression},d=f.resolve(c),e=d(c,a);g=g.concat(e)})}),k(g)},"subscript-child-filter_expression":function(a,b,c){var d=a.expression.value.slice(2,-1),e=m.parse(d).body[0].expression,f=function(a,b){return j(e,{"@":b})};return this.descend(b,null,f,c)},"subscript-descendant-filter_expression":function(a,b,c){var d=a.expression.value.slice(2,-1),e=m.parse(d).body[0].expression,f=function(a,b){return j(e,{"@":b})};return this.traverse(b,null,f,c)},"subscript-child-script_expression":function(a,b){return d(b,a.expression.value.slice(1,-1),"$[{{value}}]")},"member-child-script_expression":function(a,b){return d(b,a.expression.value.slice(1,-1),"$.{{value}}")},"member-descendant-script_expression":function(a,b){return d(b,a.expression.value.slice(1,-1),"$..value")}},q.prototype._fns["subscript-child-string_literal"]=q.prototype._fns["member-child-identifier"],q.prototype._fns["member-descendant-numeric_literal"]=q.prototype._fns["subscript-descendant-string_literal"]=q.prototype._fns["member-descendant-identifier"],b.exports=q},{"..":"jsonpath","./aesprim":"./aesprim","./index":5,"./slice":7,"static-eval":15,underscore:16}],5:[function(a,b,c){function d(a){return"[object String]"==Object.prototype.toString.call(a)}var e=a("assert"),f=a("./dict"),g=a("./parser"),h=a("./handlers"),i=function(){this.initialize.apply(this,arguments)};i.prototype.initialize=function(){this.parser=new g,this.handlers=new h},i.prototype.parse=function(a){return e.ok(d(a),"we need a path"),this.parser.parse(a)},i.prototype.parent=function(a,b){e.ok(a instanceof Object,"obj needs to be an object"),e.ok(b,"we need a path");var c=this.nodes(a,b)[0];c.path.pop();return this.value(a,c.path)},i.prototype.apply=function(a,b,c){e.ok(a instanceof Object,"obj needs to be an object"),e.ok(b,"we need a path"),e.equal(typeof c,"function","fn needs to be function");var d=this.nodes(a,b).sort(function(a,b){return b.path.length-a.path.length});return d.forEach(function(b){var d=b.path.pop(),e=this.value(a,this.stringify(b.path)),f=b.value=c.call(a,e[d]);e[d]=f,b.path.push(d)},this),d},i.prototype.value=function(a,b,c){if(e.ok(a instanceof Object,"obj needs to be an object"),e.ok(b,"we need a path"),arguments.length>=3){var d=this.nodes(a,b).shift();if(!d)return this._vivify(a,b,c);var f=d.path.slice(-1).shift();this.parent(a,this.stringify(d.path))[f]=c}return this.query(a,this.stringify(b),1).shift()},i.prototype._vivify=function(a,b,c){var d=this;e.ok(a instanceof Object,"obj needs to be an object"),e.ok(b,"we need a path");var f=this.parser.parse(b).map(function(a){return a.expression.value}),g=function(b,c){var e=b.pop(),f=d.value(a,b);f||(g(b.concat(),"string"==typeof e?{}:[]),f=d.value(a,b)),f[e]=c};return g(f,c),this.query(a,b)[0]},i.prototype.query=function(a,b,c){return e.ok(a instanceof Object,"obj needs to be an object"),e.ok(d(b),"we need a path"),this.nodes(a,b,c).map(function(a){return a.value})},i.prototype.paths=function(a,b,c){return e.ok(a instanceof Object,"obj needs to be an object"),e.ok(b,"we need a path"),this.nodes(a,b,c).map(function(a){return a.path})},i.prototype.nodes=function(a,b,c){if(e.ok(a instanceof Object,"obj needs to be an object"),e.ok(b,"we need a path"),0===c)return[];var d=this.parser.parse(b),f=this.handlers,g=[{path:["$"],value:a}],h=[];return d.length&&"root"==d[0].expression.type&&d.shift(),d.length?(d.forEach(function(a,b){if(!(h.length>=c)){var e=f.resolve(a),i=[];g.forEach(function(f){if(!(h.length>=c)){var g=e(a,f,c);b==d.length-1?h=h.concat(g||[]):i=i.concat(g||[])}}),g=i}}),c?h.slice(0,c):h):g}, -i.prototype.stringify=function(a){e.ok(a,"we need a path");var b="$",c={"descendant-member":"..{{value}}","child-member":".{{value}}","descendant-subscript":"..[{{value}}]","child-subscript":"[{{value}}]"};return a=this._normalize(a),a.forEach(function(a){if("root"!=a.expression.type){var d,e=[a.scope,a.operation].join("-"),f=c[e];if(d="string_literal"==a.expression.type?JSON.stringify(a.expression.value):a.expression.value,!f)throw new Error("couldn't find template "+e);b+=f.replace(/{{value}}/,d)}}),b},i.prototype._normalize=function(a){if(e.ok(a,"we need a path"),"string"==typeof a)return this.parser.parse(a);if(Array.isArray(a)&&"string"==typeof a[0]){var b=[{expression:{type:"root",value:"$"}}];return a.forEach(function(a,c){if("$"!=a||0!==c)if("string"==typeof a&&a.match("^"+f.identifier+"$"))b.push({operation:"member",scope:"child",expression:{value:a,type:"identifier"}});else{var d="number"==typeof a?"numeric_literal":"string_literal";b.push({operation:"subscript",scope:"child",expression:{value:a,type:d}})}}),b}if(Array.isArray(a)&&"object"==typeof a[0])return a;throw new Error("couldn't understand path "+a)},i.Handlers=h,i.Parser=g;var j=new i;j.JSONPath=i,b.exports=j},{"./dict":2,"./handlers":4,"./parser":6,assert:8}],6:[function(a,b,c){var d=a("./grammar"),e=a("../generated/parser"),f=function(){var a=new e.Parser,b=a.parseError;return a.yy.parseError=function(){a.yy.ast&&a.yy.ast.initialize(),b.apply(a,arguments)},a};f.grammar=d,b.exports=f},{"../generated/parser":1,"./grammar":3}],7:[function(a,b,c){function d(a){return String(a).match(/^[0-9]+$/)?parseInt(a):Number.isFinite(a)?parseInt(a,10):0}b.exports=function(a,b,c,e){if("string"==typeof b)throw new Error("start cannot be a string");if("string"==typeof c)throw new Error("end cannot be a string");if("string"==typeof e)throw new Error("step cannot be a string");var f=a.length;if(0===e)throw new Error("step cannot be zero");if(e=e?d(e):1,b=b<0?f+b:b,c=c<0?f+c:c,b=d(0===b?0:b||(e>0?0:f-1)),c=d(0===c?0:c||(e>0?f:-1)),b=e>0?Math.max(0,b):Math.min(f,b),c=e>0?Math.min(c,f):Math.max(-1,c),e>0&&c<=b)return[];if(e<0&&b<=c)return[];for(var g=[],h=b;h!=c&&!(e<0&&h<=c||e>0&&h>=c);h+=e)g.push(a[h]);return g}},{}],8:[function(a,b,c){function d(a,b){return n.isUndefined(b)?""+b:n.isNumber(b)&&!isFinite(b)?b.toString():n.isFunction(b)||n.isRegExp(b)?b.toString():b}function e(a,b){return n.isString(a)?a.length=0;f--)if(g[f]!=h[f])return!1;for(f=g.length-1;f>=0;f--)if(e=g[f],!i(a[e],b[e]))return!1;return!0}function l(a,b){return!(!a||!b)&&("[object RegExp]"==Object.prototype.toString.call(b)?b.test(a):a instanceof b||!0===b.call({},a))}function m(a,b,c,d){var e;n.isString(c)&&(d=c,c=null);try{b()}catch(f){e=f}if(d=(c&&c.name?" ("+c.name+").":".")+(d?" "+d:"."),a&&!e&&g(e,c,"Missing expected exception"+d),!a&&l(e,c)&&g(e,c,"Got unwanted exception"+d),a&&e&&c&&!l(e,c)||!a&&e)throw e}var n=a("util/"),o=Array.prototype.slice,p=Object.prototype.hasOwnProperty,q=b.exports=h;q.AssertionError=function(a){this.name="AssertionError",this.actual=a.actual,this.expected=a.expected,this.operator=a.operator,a.message?(this.message=a.message,this.generatedMessage=!1):(this.message=f(this),this.generatedMessage=!0);var b=a.stackStartFunction||g;if(Error.captureStackTrace)Error.captureStackTrace(this,b);else{var c=new Error;if(c.stack){var d=c.stack,e=b.name,h=d.indexOf("\n"+e);if(h>=0){var i=d.indexOf("\n",h+1);d=d.substring(i+1)}this.stack=d}}},n.inherits(q.AssertionError,Error),q.fail=g,q.ok=h,q.equal=function(a,b,c){a!=b&&g(a,b,c,"==",q.equal)},q.notEqual=function(a,b,c){a==b&&g(a,b,c,"!=",q.notEqual)},q.deepEqual=function(a,b,c){i(a,b)||g(a,b,c,"deepEqual",q.deepEqual)},q.notDeepEqual=function(a,b,c){i(a,b)&&g(a,b,c,"notDeepEqual",q.notDeepEqual)},q.strictEqual=function(a,b,c){a!==b&&g(a,b,c,"===",q.strictEqual)},q.notStrictEqual=function(a,b,c){a===b&&g(a,b,c,"!==",q.notStrictEqual)},q.throws=function(a,b,c){m.apply(this,[!0].concat(o.call(arguments)))},q.doesNotThrow=function(a,b){m.apply(this,[!1].concat(o.call(arguments)))},q.ifError=function(a){if(a)throw a};var r=Object.keys||function(a){var b=[];for(var c in a)p.call(a,c)&&b.push(c);return b}},{"util/":11}],9:[function(a,b,c){"function"==typeof Object.create?b.exports=function(a,b){a.super_=b,a.prototype=Object.create(b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}})}:b.exports=function(a,b){a.super_=b;var c=function(){};c.prototype=b.prototype,a.prototype=new c,a.prototype.constructor=a}},{}],10:[function(a,b,c){b.exports=function(a){return a&&"object"==typeof a&&"function"==typeof a.copy&&"function"==typeof a.fill&&"function"==typeof a.readUInt8}},{}],11:[function(a,b,c){(function(b,d){function e(a,b){var d={seen:[],stylize:g};return arguments.length>=3&&(d.depth=arguments[2]),arguments.length>=4&&(d.colors=arguments[3]),p(b)?d.showHidden=b:b&&c._extend(d,b),v(d.showHidden)&&(d.showHidden=!1),v(d.depth)&&(d.depth=2),v(d.colors)&&(d.colors=!1),v(d.customInspect)&&(d.customInspect=!0),d.colors&&(d.stylize=f),i(d,a,d.depth)}function f(a,b){var c=e.styles[b];return c?"["+e.colors[c][0]+"m"+a+"["+e.colors[c][1]+"m":a}function g(a,b){return a}function h(a){var b={};return a.forEach(function(a,c){b[a]=!0}),b}function i(a,b,d){if(a.customInspect&&b&&A(b.inspect)&&b.inspect!==c.inspect&&(!b.constructor||b.constructor.prototype!==b)){var e=b.inspect(d,a);return t(e)||(e=i(a,e,d)),e}var f=j(a,b);if(f)return f;var g=Object.keys(b),p=h(g);if(a.showHidden&&(g=Object.getOwnPropertyNames(b)),z(b)&&(g.indexOf("message")>=0||g.indexOf("description")>=0))return k(b);if(0===g.length){if(A(b)){var q=b.name?": "+b.name:"";return a.stylize("[Function"+q+"]","special")}if(w(b))return a.stylize(RegExp.prototype.toString.call(b),"regexp");if(y(b))return a.stylize(Date.prototype.toString.call(b),"date");if(z(b))return k(b)}var r="",s=!1,u=["{","}"];if(o(b)&&(s=!0,u=["[","]"]),A(b)){r=" [Function"+(b.name?": "+b.name:"")+"]"}if(w(b)&&(r=" "+RegExp.prototype.toString.call(b)),y(b)&&(r=" "+Date.prototype.toUTCString.call(b)),z(b)&&(r=" "+k(b)),0===g.length&&(!s||0==b.length))return u[0]+r+u[1];if(d<0)return w(b)?a.stylize(RegExp.prototype.toString.call(b),"regexp"):a.stylize("[Object]","special");a.seen.push(b);var v;return v=s?l(a,b,d,p,g):g.map(function(c){return m(a,b,d,p,c,s)}),a.seen.pop(),n(v,r,u)}function j(a,b){if(v(b))return a.stylize("undefined","undefined");if(t(b)){var c="'"+JSON.stringify(b).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return a.stylize(c,"string")}return s(b)?a.stylize(""+b,"number"):p(b)?a.stylize(""+b,"boolean"):q(b)?a.stylize("null","null"):void 0}function k(a){return"["+Error.prototype.toString.call(a)+"]"}function l(a,b,c,d,e){for(var f=[],g=0,h=b.length;g-1&&(h=f?h.split("\n").map(function(a){return" "+a}).join("\n").substr(2):"\n"+h.split("\n").map(function(a){return" "+a}).join("\n"))):h=a.stylize("[Circular]","special")),v(g)){if(f&&e.match(/^\d+$/))return h;g=JSON.stringify(""+e),g.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(g=g.substr(1,g.length-2),g=a.stylize(g,"name")):(g=g.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),g=a.stylize(g,"string"))}return g+": "+h}function n(a,b,c){var d=0;return a.reduce(function(a,b){return d++,b.indexOf("\n")>=0&&d++,a+b.replace(/\u001b\[\d\d?m/g,"").length+1},0)>60?c[0]+(""===b?"":b+"\n ")+" "+a.join(",\n ")+" "+c[1]:c[0]+b+" "+a.join(", ")+" "+c[1]}function o(a){return Array.isArray(a)}function p(a){return"boolean"==typeof a}function q(a){return null===a}function r(a){return null==a}function s(a){return"number"==typeof a}function t(a){return"string"==typeof a}function u(a){return"symbol"==typeof a}function v(a){return void 0===a}function w(a){return x(a)&&"[object RegExp]"===C(a)}function x(a){return"object"==typeof a&&null!==a}function y(a){return x(a)&&"[object Date]"===C(a)}function z(a){return x(a)&&("[object Error]"===C(a)||a instanceof Error)}function A(a){return"function"==typeof a}function B(a){return null===a||"boolean"==typeof a||"number"==typeof a||"string"==typeof a||"symbol"==typeof a||void 0===a}function C(a){return Object.prototype.toString.call(a)}function D(a){return a<10?"0"+a.toString(10):a.toString(10)}function E(){var a=new Date,b=[D(a.getHours()),D(a.getMinutes()),D(a.getSeconds())].join(":");return[a.getDate(),J[a.getMonth()],b].join(" ")}function F(a,b){return Object.prototype.hasOwnProperty.call(a,b)}var G=/%[sdj%]/g;c.format=function(a){if(!t(a)){for(var b=[],c=0;c=f)return a;switch(a){case"%s":return String(d[c++]);case"%d":return Number(d[c++]);case"%j":try{return JSON.stringify(d[c++])}catch(b){return"[Circular]"}default:return a}}),h=d[c];c=0;d--){var e=a[d];"."===e?a.splice(d,1):".."===e?(a.splice(d,1),c++):c&&(a.splice(d,1),c--)}if(b)for(;c--;c)a.unshift("..");return a}function d(a){"string"!=typeof a&&(a+="");var b,c=0,d=-1,e=!0;for(b=a.length-1;b>=0;--b)if(47===a.charCodeAt(b)){if(!e){c=b+1;break}}else-1===d&&(e=!1,d=b+1);return-1===d?"":a.slice(c,d)}function e(a,b){if(a.filter)return a.filter(b);for(var c=[],d=0;d=-1&&!d;f--){var g=f>=0?arguments[f]:a.cwd();if("string"!=typeof g)throw new TypeError("Arguments to path.resolve must be strings");g&&(c=g+"/"+c,d="/"===g.charAt(0))}return c=b(e(c.split("/"),function(a){return!!a}),!d).join("/"),(d?"/":"")+c||"."},c.normalize=function(a){var d=c.isAbsolute(a),g="/"===f(a,-1);return a=b(e(a.split("/"),function(a){return!!a}),!d).join("/"),a||d||(a="."),a&&g&&(a+="/"),(d?"/":"")+a},c.isAbsolute=function(a){return"/"===a.charAt(0)},c.join=function(){var a=Array.prototype.slice.call(arguments,0);return c.normalize(e(a,function(a,b){if("string"!=typeof a)throw new TypeError("Arguments to path.join must be strings");return a}).join("/"))},c.relative=function(a,b){function d(a){for(var b=0;b=0&&""===a[c];c--);return b>c?[]:a.slice(b,c-b+1)}a=c.resolve(a).substr(1),b=c.resolve(b).substr(1);for(var e=d(a.split("/")),f=d(b.split("/")),g=Math.min(e.length,f.length),h=g,i=0;i=1;--f)if(47===(b=a.charCodeAt(f))){if(!e){d=f;break}}else e=!1;return-1===d?c?"/":".":c&&1===d?"/":a.slice(0,d)},c.basename=function(a,b){var c=d(a);return b&&c.substr(-1*b.length)===b&&(c=c.substr(0,c.length-b.length)),c},c.extname=function(a){"string"!=typeof a&&(a+="");for(var b=-1,c=0,d=-1,e=!0,f=0,g=a.length-1;g>=0;--g){var h=a.charCodeAt(g);if(47!==h)-1===d&&(e=!1,d=g+1),46===h?-1===b?b=g:1!==f&&(f=1):-1!==b&&(f=-1);else if(!e){c=g+1;break}}return-1===b||-1===d||0===f||1===f&&b===d-1&&b===c+1?"":a.slice(b,d)};var f="b"==="ab".substr(-1)?function(a,b,c){return a.substr(b,c)}:function(a,b,c){return b<0&&(b=a.length+b),a.substr(b,c)}}).call(this,a("_process"))},{_process:14}],14:[function(a,b,c){function d(){throw new Error("setTimeout has not been defined")}function e(){throw new Error("clearTimeout has not been defined")}function f(a){if(l===setTimeout)return setTimeout(a,0);if((l===d||!l)&&setTimeout)return l=setTimeout,setTimeout(a,0);try{return l(a,0)}catch(b){try{return l.call(null,a,0)}catch(b){return l.call(this,a,0)}}}function g(a){if(m===clearTimeout)return clearTimeout(a);if((m===e||!m)&&clearTimeout)return m=clearTimeout,clearTimeout(a);try{return m(a)}catch(b){try{return m.call(null,a)}catch(b){return m.call(this,a)}}}function h(){q&&o&&(q=!1,o.length?p=o.concat(p):r=-1,p.length&&i())}function i(){if(!q){var a=f(h);q=!0;for(var b=p.length;b;){for(o=p,p=[];++r1)for(var c=1;c"===p?j>o:">="===p?j>=o:"|"===p?j|o:"&"===p?j&o:"^"===p?j^o:"&&"===p?j&&o:"||"===p?j||o:c}if("Identifier"===e.type)return{}.hasOwnProperty.call(b,e.name)?b[e.name]:c;if("ThisExpression"===e.type)return{}.hasOwnProperty.call(b,"this")?b.this:c;if("CallExpression"===e.type){var q=a(e.callee);if(q===c)return c;if("function"!=typeof q)return c;var r=e.callee.object?a(e.callee.object):c;r===c&&(r=null);for(var s=[],i=0,j=e.arguments.length;i=0)},q.invoke=function(a,b){var c=j.call(arguments,2),d=q.isFunction(b);return q.map(a,function(a){return(d?b:a[b]).apply(a,c)})},q.pluck=function(a,b){return q.map(a,q.property(b))},q.where=function(a,b){return q.filter(a,q.matches(b))},q.findWhere=function(a,b){return q.find(a,q.matches(b))},q.max=function(a,b,c){var d,e,f=-1/0,g=-1/0;if(null==b&&null!=a){a=a.length===+a.length?a:q.values(a);for(var h=0,i=a.length;hf&&(f=d)}else b=q.iteratee(b,c),q.each(a,function(a,c,d){((e=b(a,c,d))>g||e===-1/0&&f===-1/0)&&(f=a,g=e)});return f},q.min=function(a,b,c){var d,e,f=1/0,g=1/0;if(null==b&&null!=a){a=a.length===+a.length?a:q.values(a);for(var h=0,i=a.length;hd||void 0===c)return 1;if(c>>1;c(a[h])=0;)if(a[d]===b)return d;return-1},q.range=function(a,b,c){arguments.length<=1&&(b=a||0,a=0),c=c||1;for(var d=Math.max(Math.ceil((b-a)/c),0),e=Array(d),f=0;fb?(clearTimeout(g),g=null,h=j,f=a.apply(d,e),g||(d=e=null)):g||!1===c.trailing||(g=setTimeout(i,k)),f}},q.debounce=function(a,b,c){var d,e,f,g,h,i=function(){var j=q.now()-g;j0?d=setTimeout(i,b-j):(d=null,c||(h=a.apply(f,e),d||(f=e=null)))};return function(){f=this,e=arguments,g=q.now();var j=c&&!d;return d||(d=setTimeout(i,b)),j&&(h=a.apply(f,e),f=e=null),h}},q.wrap=function(a,b){return q.partial(b,a)},q.negate=function(a){return function(){return!a.apply(this,arguments)}},q.compose=function(){var a=arguments,b=a.length-1;return function(){for(var c=b,d=a[b].apply(this,arguments);c--;)d=a[c].call(this,d);return d}},q.after=function(a,b){return function(){if(--a<1)return b.apply(this,arguments)}},q.before=function(a,b){var c;return function(){return--a>0?c=b.apply(this,arguments):b=null,c}},q.once=q.partial(q.before,2),q.keys=function(a){if(!q.isObject(a))return[];if(o)return o(a);var b=[];for(var c in a)q.has(a,c)&&b.push(c);return b},q.values=function(a){for(var b=q.keys(a),c=b.length,d=Array(c),e=0;e":">",'"':""","'":"'","`":"`"},y=q.invert(x),z=function(a){ -var b=function(b){return a[b]},c="(?:"+q.keys(a).join("|")+")",d=RegExp(c),e=RegExp(c,"g");return function(a){return a=null==a?"":""+a,d.test(a)?a.replace(e,b):a}};q.escape=z(x),q.unescape=z(y),q.result=function(a,b){if(null!=a){var c=a[b];return q.isFunction(c)?a[b]():c}};var A=0;q.uniqueId=function(a){var b=++A+"";return a?a+b:b},q.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var B=/(.)^/,C={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},D=/\\|'|\r|\n|\u2028|\u2029/g,E=function(a){return"\\"+C[a]};q.template=function(a,b,c){!b&&c&&(b=c),b=q.defaults({},b,q.templateSettings);var d=RegExp([(b.escape||B).source,(b.interpolate||B).source,(b.evaluate||B).source].join("|")+"|$","g"),e=0,f="__p+='";a.replace(d,function(b,c,d,g,h){return f+=a.slice(e,h).replace(D,E),e=h+b.length,c?f+="'+\n((__t=("+c+"))==null?'':_.escape(__t))+\n'":d?f+="'+\n((__t=("+d+"))==null?'':__t)+\n'":g&&(f+="';\n"+g+"\n__p+='"),b}),f+="';\n",b.variable||(f="with(obj||{}){\n"+f+"}\n"),f="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+f+"return __p;\n";try{var g=new Function(b.variable||"obj","_",f)}catch(j){throw j.source=f,j}var h=function(a){return g.call(this,a,q)},i=b.variable||"obj";return h.source="function("+i+"){\n"+f+"}",h},q.chain=function(a){var b=q(a);return b._chain=!0,b};var F=function(a){return this._chain?q(a).chain():a};q.mixin=function(a){q.each(q.functions(a),function(b){var c=q[b]=a[b];q.prototype[b]=function(){var a=[this._wrapped];return i.apply(a,arguments),F.call(this,c.apply(q,a))}})},q.mixin(q),q.each(["pop","push","reverse","shift","sort","splice","unshift"],function(a){var b=f[a];q.prototype[a]=function(){var c=this._wrapped;return b.apply(c,arguments),"shift"!==a&&"splice"!==a||0!==c.length||delete c[0],F.call(this,c)}}),q.each(["concat","join","slice"],function(a){var b=f[a];q.prototype[a]=function(){return F.call(this,b.apply(this._wrapped,arguments))}}),q.prototype.value=function(){return this._wrapped},"function"==typeof a&&a.amd&&a("underscore",[],function(){return q})}).call(this)},{}],jsonpath:[function(a,b,c){b.exports=a("./lib/index")},{"./lib/index":5}]},{},["jsonpath"])("jsonpath")}); \ No newline at end of file +AccessorDataProperty:"Object literal may not have data and accessor property with the same name",AccessorGetSet:"Object literal may not have multiple get/set accessors with the same name",StrictLHSAssignment:"Assignment to eval or arguments is not allowed in strict mode",StrictLHSPostfix:"Postfix increment/decrement may not have eval or arguments operand in strict mode",StrictLHSPrefix:"Prefix increment/decrement may not have eval or arguments operand in strict mode",StrictReservedWord:"Use of future reserved word in strict mode"},eb={NonAsciiIdentifierStart:new RegExp("[ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԧԱ-Ֆՙա-ևא-תװ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࢠࢢ-ࢬऄ-हऽॐक़-ॡॱ-ॷॹ-ॿঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-ళవ-హఽౘౙౠౡಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽೞೠೡೱೲഅ-ഌഎ-ഐഒ-ഺഽൎൠൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄງຈຊຍດ-ທນ-ຟມ-ຣລວສຫອ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏼᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛰᜀ-ᜌᜎ-ᜑᜠ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡷᢀ-ᢨᢪᢰ-ᣵᤀ-ᤜᥐ-ᥭᥰ-ᥴᦀ-ᦫᧁ-ᧇᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭋᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᳩ-ᳬᳮ-ᳱᳵᳶᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-Ⱞⰰ-ⱞⱠ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞⸯ々-〇〡-〩〱-〵〸-〼ぁ-ゖゝ-ゟァ-ヺー-ヿㄅ-ㄭㄱ-ㆎㆠ-ㆺㇰ-ㇿ㐀-䶵一-鿌ꀀ-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚗꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ-ꞎꞐ-ꞓꞠ-Ɦꟸ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꪀ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꯀ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ]"),NonAsciiIdentifierPart:new RegExp("[ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮ̀-ʹͶͷͺ-ͽΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁ҃-҇Ҋ-ԧԱ-Ֆՙա-և֑-ׇֽֿׁׂׅׄא-תװ-ײؐ-ؚؠ-٩ٮ-ۓە-ۜ۟-۪ۨ-ۼۿܐ-݊ݍ-ޱ߀-ߵߺࠀ-࠭ࡀ-࡛ࢠࢢ-ࢬࣤ-ࣾऀ-ॣ०-९ॱ-ॷॹ-ॿঁ-ঃঅ-ঌএঐও-নপ-রলশ-হ়-ৄেৈো-ৎৗড়ঢ়য়-ৣ০-ৱਁ-ਃਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹ਼ਾ-ੂੇੈੋ-੍ੑਖ਼-ੜਫ਼੦-ੵઁ-ઃઅ-ઍએ-ઑઓ-નપ-રલળવ-હ઼-ૅે-ૉો-્ૐૠ-ૣ૦-૯ଁ-ଃଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହ଼-ୄେୈୋ-୍ୖୗଡ଼ଢ଼ୟ-ୣ୦-୯ୱஂஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹா-ூெ-ைொ-்ௐௗ௦-௯ఁ-ఃఅ-ఌఎ-ఐఒ-నప-ళవ-హఽ-ౄె-ైొ-్ౕౖౘౙౠ-ౣ౦-౯ಂಃಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹ಼-ೄೆ-ೈೊ-್ೕೖೞೠ-ೣ೦-೯ೱೲംഃഅ-ഌഎ-ഐഒ-ഺഽ-ൄെ-ൈൊ-ൎൗൠ-ൣ൦-൯ൺ-ൿංඃඅ-ඖක-නඳ-රලව-ෆ්ා-ුූෘ-ෟෲෳก-ฺเ-๎๐-๙ກຂຄງຈຊຍດ-ທນ-ຟມ-ຣລວສຫອ-ູົ-ຽເ-ໄໆ່-ໍ໐-໙ໜ-ໟༀ༘༙༠-༩༹༵༷༾-ཇཉ-ཬཱ-྄྆-ྗྙ-ྼ࿆က-၉ၐ-ႝႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚ፝-፟ᎀ-ᎏᎠ-Ᏼᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛰᜀ-ᜌᜎ-᜔ᜠ-᜴ᝀ-ᝓᝠ-ᝬᝮ-ᝰᝲᝳក-៓ៗៜ៝០-៩᠋-᠍᠐-᠙ᠠ-ᡷᢀ-ᢪᢰ-ᣵᤀ-ᤜᤠ-ᤫᤰ-᤻᥆-ᥭᥰ-ᥴᦀ-ᦫᦰ-ᧉ᧐-᧙ᨀ-ᨛᨠ-ᩞ᩠-᩿᩼-᪉᪐-᪙ᪧᬀ-ᭋ᭐-᭙᭫-᭳ᮀ-᯳ᰀ-᰷᱀-᱉ᱍ-ᱽ᳐-᳔᳒-ᳶᴀ-ᷦ᷼-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼ‌‍‿⁀⁔ⁱⁿₐ-ₜ⃐-⃥⃜⃡-⃰ℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-Ⱞⰰ-ⱞⱠ-ⳤⳫ-ⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯ⵿-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞⷠ-ⷿⸯ々-〇〡-〯〱-〵〸-〼ぁ-ゖ゙゚ゝ-ゟァ-ヺー-ヿㄅ-ㄭㄱ-ㆎㆠ-ㆺㇰ-ㇿ㐀-䶵一-鿌ꀀ-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘫꙀ-꙯ꙴ-꙽ꙿ-ꚗꚟ-꛱ꜗ-ꜟꜢ-ꞈꞋ-ꞎꞐ-ꞓꞠ-Ɦꟸ-ꠧꡀ-ꡳꢀ-꣄꣐-꣙꣠-ꣷꣻ꤀-꤭ꤰ-꥓ꥠ-ꥼꦀ-꧀ꧏ-꧙ꨀ-ꨶꩀ-ꩍ꩐-꩙ꩠ-ꩶꩺꩻꪀ-ꫂꫛ-ꫝꫠ-ꫯꫲ-꫶ꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꯀ-ꯪ꯬꯭꯰-꯹가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻ︀-️︠-︦︳︴﹍-﹏ﹰ-ﹴﹶ-ﻼ0-9A-Z_a-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ]")},fb={name:"SyntaxTree",processComment:function(a){var b,c;if(!(a.type===bb.Program&&a.body.length>0)){for(pb.trailingComments.length>0?pb.trailingComments[0].range[0]>=a.range[1]?(c=pb.trailingComments,pb.trailingComments=[]):pb.trailingComments.length=0:pb.bottomRightStack.length>0&&pb.bottomRightStack[pb.bottomRightStack.length-1].trailingComments&&pb.bottomRightStack[pb.bottomRightStack.length-1].trailingComments[0].range[0]>=a.range[1]&&(c=pb.bottomRightStack[pb.bottomRightStack.length-1].trailingComments,delete pb.bottomRightStack[pb.bottomRightStack.length-1].trailingComments);pb.bottomRightStack.length>0&&pb.bottomRightStack[pb.bottomRightStack.length-1].range[0]>=a.range[0];)b=pb.bottomRightStack.pop();b?b.leadingComments&&b.leadingComments[b.leadingComments.length-1].range[1]<=a.range[0]&&(a.leadingComments=b.leadingComments,delete b.leadingComments):pb.leadingComments.length>0&&pb.leadingComments[pb.leadingComments.length-1].range[1]<=a.range[0]&&(a.leadingComments=pb.leadingComments,pb.leadingComments=[]),c&&(a.trailingComments=c),pb.bottomRightStack.push(a)}},markEnd:function(a,b){return pb.range&&(a.range=[b.start,ib]),pb.loc&&(a.loc=new M(void 0===b.startLineNumber?b.lineNumber:b.startLineNumber,b.start-(void 0===b.startLineStart?b.lineStart:b.startLineStart),jb,ib-kb),this.postProcess(a)),pb.attachComment&&this.processComment(a),a},postProcess:function(a){return pb.source&&(a.loc.source=pb.source),a},createArrayExpression:function(a){return{type:bb.ArrayExpression,elements:a}},createAssignmentExpression:function(a,b,c){return{type:bb.AssignmentExpression,operator:a,left:b,right:c}},createBinaryExpression:function(a,b,c){return{type:"||"===a||"&&"===a?bb.LogicalExpression:bb.BinaryExpression,operator:a,left:b,right:c}},createBlockStatement:function(a){return{type:bb.BlockStatement,body:a}},createBreakStatement:function(a){return{type:bb.BreakStatement,label:a}},createCallExpression:function(a,b){return{type:bb.CallExpression,callee:a,arguments:b}},createCatchClause:function(a,b){return{type:bb.CatchClause,param:a,body:b}},createConditionalExpression:function(a,b,c){return{type:bb.ConditionalExpression,test:a,consequent:b,alternate:c}},createContinueStatement:function(a){return{type:bb.ContinueStatement,label:a}},createDebuggerStatement:function(){return{type:bb.DebuggerStatement}},createDoWhileStatement:function(a,b){return{type:bb.DoWhileStatement,body:a,test:b}},createEmptyStatement:function(){return{type:bb.EmptyStatement}},createExpressionStatement:function(a){return{type:bb.ExpressionStatement,expression:a}},createForStatement:function(a,b,c,d){return{type:bb.ForStatement,init:a,test:b,update:c,body:d}},createForInStatement:function(a,b,c){return{type:bb.ForInStatement,left:a,right:b,body:c,each:!1}},createFunctionDeclaration:function(a,b,c,d){return{type:bb.FunctionDeclaration,id:a,params:b,defaults:c,body:d,rest:null,generator:!1,expression:!1}},createFunctionExpression:function(a,b,c,d){return{type:bb.FunctionExpression,id:a,params:b,defaults:c,body:d,rest:null,generator:!1,expression:!1}},createIdentifier:function(a){return{type:bb.Identifier,name:a}},createIfStatement:function(a,b,c){return{type:bb.IfStatement,test:a,consequent:b,alternate:c}},createLabeledStatement:function(a,b){return{type:bb.LabeledStatement,label:a,body:b}},createLiteral:function(a){return{type:bb.Literal,value:a.value,raw:gb.slice(a.start,a.end)}},createMemberExpression:function(a,b,c){return{type:bb.MemberExpression,computed:"["===a,object:b,property:c}},createNewExpression:function(a,b){return{type:bb.NewExpression,callee:a,arguments:b}},createObjectExpression:function(a){return{type:bb.ObjectExpression,properties:a}},createPostfixExpression:function(a,b){return{type:bb.UpdateExpression,operator:a,argument:b,prefix:!1}},createProgram:function(a){return{type:bb.Program,body:a}},createProperty:function(a,b,c){return{type:bb.Property,key:b,value:c,kind:a}},createReturnStatement:function(a){return{type:bb.ReturnStatement,argument:a}},createSequenceExpression:function(a){return{type:bb.SequenceExpression,expressions:a}},createSwitchCase:function(a,b){return{type:bb.SwitchCase,test:a,consequent:b}},createSwitchStatement:function(a,b){return{type:bb.SwitchStatement,discriminant:a,cases:b}},createThisExpression:function(){return{type:bb.ThisExpression}},createThrowStatement:function(a){return{type:bb.ThrowStatement,argument:a}},createTryStatement:function(a,b,c,d){return{type:bb.TryStatement,block:a,guardedHandlers:b,handlers:c,finalizer:d}},createUnaryExpression:function(a,b){return"++"===a||"--"===a?{type:bb.UpdateExpression,operator:a,argument:b,prefix:!0}:{type:bb.UnaryExpression,operator:a,argument:b,prefix:!0}},createVariableDeclaration:function(a,b){return{type:bb.VariableDeclaration,declarations:a,kind:b}},createVariableDeclarator:function(a,b){return{type:bb.VariableDeclarator,id:a,init:b}},createWhileStatement:function(a,b){return{type:bb.WhileStatement,test:a,body:b}},createWithStatement:function(a,b){return{type:bb.WithStatement,object:a,body:b}}},a.version="1.2.2",a.tokenize=Ya,a.parse=Za,a.Syntax=function(){var a,b={};"function"==typeof Object.create&&(b=Object.create(null));for(a in bb)bb.hasOwnProperty(a)&&(b[a]=bb[a]);return"function"==typeof Object.freeze&&Object.freeze(b),b}()})},{}],1:[function(a,b,c){(function(d){var e=function(){function a(){this.yy={}}var b={trace:function(){},yy:{},symbols_:{error:2,JSON_PATH:3,DOLLAR:4,PATH_COMPONENTS:5,LEADING_CHILD_MEMBER_EXPRESSION:6,PATH_COMPONENT:7,MEMBER_COMPONENT:8,SUBSCRIPT_COMPONENT:9,CHILD_MEMBER_COMPONENT:10,DESCENDANT_MEMBER_COMPONENT:11,DOT:12,MEMBER_EXPRESSION:13,DOT_DOT:14,STAR:15,IDENTIFIER:16,SCRIPT_EXPRESSION:17,INTEGER:18,END:19,CHILD_SUBSCRIPT_COMPONENT:20,DESCENDANT_SUBSCRIPT_COMPONENT:21,"[":22,SUBSCRIPT:23,"]":24,SUBSCRIPT_EXPRESSION:25,SUBSCRIPT_EXPRESSION_LIST:26,SUBSCRIPT_EXPRESSION_LISTABLE:27,",":28,STRING_LITERAL:29,ARRAY_SLICE:30,FILTER_EXPRESSION:31,QQ_STRING:32,Q_STRING:33,$accept:0,$end:1},terminals_:{2:"error",4:"DOLLAR",12:"DOT",14:"DOT_DOT",15:"STAR",16:"IDENTIFIER",17:"SCRIPT_EXPRESSION",18:"INTEGER",19:"END",22:"[",24:"]",28:",",30:"ARRAY_SLICE",31:"FILTER_EXPRESSION",32:"QQ_STRING",33:"Q_STRING"},productions_:[0,[3,1],[3,2],[3,1],[3,2],[5,1],[5,2],[7,1],[7,1],[8,1],[8,1],[10,2],[6,1],[11,2],[13,1],[13,1],[13,1],[13,1],[13,1],[9,1],[9,1],[20,3],[21,4],[23,1],[23,1],[26,1],[26,3],[27,1],[27,1],[27,1],[25,1],[25,1],[25,1],[29,1],[29,1]],performAction:function(a,b,d,e,f,g,h){e.ast||(e.ast=c,c.initialize());var i=g.length-1;switch(f){case 1:return e.ast.set({expression:{type:"root",value:g[i]}}),e.ast.unshift(),e.ast.yield();case 2:return e.ast.set({expression:{type:"root",value:g[i-1]}}),e.ast.unshift(),e.ast.yield();case 3:return e.ast.unshift(),e.ast.yield();case 4:return e.ast.set({operation:"member",scope:"child",expression:{type:"identifier",value:g[i-1]}}),e.ast.unshift(),e.ast.yield();case 5:case 6:break;case 7:e.ast.set({operation:"member"}),e.ast.push();break;case 8:e.ast.set({operation:"subscript"}),e.ast.push();break;case 9:e.ast.set({scope:"child"});break;case 10:e.ast.set({scope:"descendant"});break;case 11:break;case 12:e.ast.set({scope:"child",operation:"member"});break;case 13:break;case 14:e.ast.set({expression:{type:"wildcard",value:g[i]}});break;case 15:e.ast.set({expression:{type:"identifier",value:g[i]}});break;case 16:e.ast.set({expression:{type:"script_expression",value:g[i]}});break;case 17:e.ast.set({expression:{type:"numeric_literal",value:parseInt(g[i])}});break;case 18:break;case 19:e.ast.set({scope:"child"});break;case 20:e.ast.set({scope:"descendant"});break;case 21:case 22:case 23:break;case 24:g[i].length>1?e.ast.set({expression:{type:"union",value:g[i]}}):this.$=g[i];break;case 25:this.$=[g[i]];break;case 26:this.$=g[i-2].concat(g[i]);break;case 27:this.$={expression:{type:"numeric_literal",value:parseInt(g[i])}},e.ast.set(this.$);break;case 28:this.$={expression:{type:"string_literal",value:g[i]}},e.ast.set(this.$);break;case 29:this.$={expression:{type:"slice",value:g[i]}},e.ast.set(this.$);break;case 30:this.$={expression:{type:"wildcard",value:g[i]}},e.ast.set(this.$);break;case 31:this.$={expression:{type:"script_expression",value:g[i]}},e.ast.set(this.$);break;case 32:this.$={expression:{type:"filter_expression",value:g[i]}},e.ast.set(this.$);break;case 33:case 34:this.$=g[i]}},table:[{3:1,4:[1,2],6:3,13:4,15:[1,5],16:[1,6],17:[1,7],18:[1,8],19:[1,9]},{1:[3]},{1:[2,1],5:10,7:11,8:12,9:13,10:14,11:15,12:[1,18],14:[1,19],20:16,21:17,22:[1,20]},{1:[2,3],5:21,7:11,8:12,9:13,10:14,11:15,12:[1,18],14:[1,19],20:16,21:17,22:[1,20]},{1:[2,12],12:[2,12],14:[2,12],22:[2,12]},{1:[2,14],12:[2,14],14:[2,14],22:[2,14]},{1:[2,15],12:[2,15],14:[2,15],22:[2,15]},{1:[2,16],12:[2,16],14:[2,16],22:[2,16]},{1:[2,17],12:[2,17],14:[2,17],22:[2,17]},{1:[2,18],12:[2,18],14:[2,18],22:[2,18]},{1:[2,2],7:22,8:12,9:13,10:14,11:15,12:[1,18],14:[1,19],20:16,21:17,22:[1,20]},{1:[2,5],12:[2,5],14:[2,5],22:[2,5]},{1:[2,7],12:[2,7],14:[2,7],22:[2,7]},{1:[2,8],12:[2,8],14:[2,8],22:[2,8]},{1:[2,9],12:[2,9],14:[2,9],22:[2,9]},{1:[2,10],12:[2,10],14:[2,10],22:[2,10]},{1:[2,19],12:[2,19],14:[2,19],22:[2,19]},{1:[2,20],12:[2,20],14:[2,20],22:[2,20]},{13:23,15:[1,5],16:[1,6],17:[1,7],18:[1,8],19:[1,9]},{13:24,15:[1,5],16:[1,6],17:[1,7],18:[1,8],19:[1,9],22:[1,25]},{15:[1,29],17:[1,30],18:[1,33],23:26,25:27,26:28,27:32,29:34,30:[1,35],31:[1,31],32:[1,36],33:[1,37]},{1:[2,4],7:22,8:12,9:13,10:14,11:15,12:[1,18],14:[1,19],20:16,21:17,22:[1,20]},{1:[2,6],12:[2,6],14:[2,6],22:[2,6]},{1:[2,11],12:[2,11],14:[2,11],22:[2,11]},{1:[2,13],12:[2,13],14:[2,13],22:[2,13]},{15:[1,29],17:[1,30],18:[1,33],23:38,25:27,26:28,27:32,29:34,30:[1,35],31:[1,31],32:[1,36],33:[1,37]},{24:[1,39]},{24:[2,23]},{24:[2,24],28:[1,40]},{24:[2,30]},{24:[2,31]},{24:[2,32]},{24:[2,25],28:[2,25]},{24:[2,27],28:[2,27]},{24:[2,28],28:[2,28]},{24:[2,29],28:[2,29]},{24:[2,33],28:[2,33]},{24:[2,34],28:[2,34]},{24:[1,41]},{1:[2,21],12:[2,21],14:[2,21],22:[2,21]},{18:[1,33],27:42,29:34,30:[1,35],32:[1,36],33:[1,37]},{1:[2,22],12:[2,22],14:[2,22],22:[2,22]},{24:[2,26],28:[2,26]}],defaultActions:{27:[2,23],29:[2,30],30:[2,31],31:[2,32]},parseError:function(a,b){if(!b.recoverable)throw new Error(a);this.trace(a)},parse:function(a){function b(){var a;return a=c.lexer.lex()||m,"number"!=typeof a&&(a=c.symbols_[a]||a),a}var c=this,d=[0],e=[null],f=[],g=this.table,h="",i=0,j=0,k=0,l=2,m=1,n=f.slice.call(arguments,1);this.lexer.setInput(a),this.lexer.yy=this.yy,this.yy.lexer=this.lexer,this.yy.parser=this,void 0===this.lexer.yylloc&&(this.lexer.yylloc={});var o=this.lexer.yylloc;f.push(o);var p=this.lexer.options&&this.lexer.options.ranges;"function"==typeof this.yy.parseError?this.parseError=this.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;for(var q,r,s,t,u,v,w,x,y,z={};;){if(s=d[d.length-1],this.defaultActions[s]?t=this.defaultActions[s]:(null!==q&&void 0!==q||(q=b()),t=g[s]&&g[s][q]),void 0===t||!t.length||!t[0]){var A="";y=[];for(v in g[s])this.terminals_[v]&&v>l&&y.push("'"+this.terminals_[v]+"'");A=this.lexer.showPosition?"Parse error on line "+(i+1)+":\n"+this.lexer.showPosition()+"\nExpecting "+y.join(", ")+", got '"+(this.terminals_[q]||q)+"'":"Parse error on line "+(i+1)+": Unexpected "+(q==m?"end of input":"'"+(this.terminals_[q]||q)+"'"),this.parseError(A,{text:this.lexer.match,token:this.terminals_[q]||q,line:this.lexer.yylineno,loc:o,expected:y})}if(t[0]instanceof Array&&t.length>1)throw new Error("Parse Error: multiple actions possible at state: "+s+", token: "+q);switch(t[0]){case 1:d.push(q),e.push(this.lexer.yytext),f.push(this.lexer.yylloc),d.push(t[1]),q=null,r?(q=r,r=null):(j=this.lexer.yyleng,h=this.lexer.yytext,i=this.lexer.yylineno,o=this.lexer.yylloc,k>0&&k--);break;case 2:if(w=this.productions_[t[1]][1],z.$=e[e.length-w],z._$={first_line:f[f.length-(w||1)].first_line,last_line:f[f.length-1].last_line,first_column:f[f.length-(w||1)].first_column,last_column:f[f.length-1].last_column},p&&(z._$.range=[f[f.length-(w||1)].range[0],f[f.length-1].range[1]]),void 0!==(u=this.performAction.apply(z,[h,j,i,this.yy,t[1],e,f].concat(n))))return u;w&&(d=d.slice(0,-1*w*2),e=e.slice(0,-1*w),f=f.slice(0,-1*w)),d.push(this.productions_[t[1]][0]),e.push(z.$),f.push(z._$),x=g[d[d.length-2]][d[d.length-1]],d.push(x);break;case 3:return!0}}return!0}},c={initialize:function(){this._nodes=[],this._node={},this._stash=[]},set:function(a){for(var b in a)this._node[b]=a[b];return this._node},node:function(a){return arguments.length&&(this._node=a),this._node},push:function(){this._nodes.push(this._node),this._node={}},unshift:function(){this._nodes.unshift(this._node),this._node={}},yield:function(){var a=this._nodes;return this.initialize(),a}},d=function(){return{EOF:1,parseError:function(a,b){if(!this.yy.parser)throw new Error(a);this.yy.parser.parseError(a,b)},setInput:function(a){return this._input=a,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var a=this._input[0];return this.yytext+=a,this.yyleng++,this.offset++,this.match+=a,this.matched+=a,a.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),a},unput:function(a){var b=a.length,c=a.split(/(?:\r\n?|\n)/g);this._input=a+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-b-1),this.offset-=b;var d=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),c.length-1&&(this.yylineno-=c.length-1);var e=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:c?(c.length===d.length?this.yylloc.first_column:0)+d[d.length-c.length].length-c[0].length:this.yylloc.first_column-b},this.options.ranges&&(this.yylloc.range=[e[0],e[0]+this.yyleng-b]),this.yyleng=this.yytext.length,this},more:function(){return this._more=!0,this},reject:function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},less:function(a){this.unput(this.match.slice(a))},pastInput:function(){var a=this.matched.substr(0,this.matched.length-this.match.length);return(a.length>20?"...":"")+a.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var a=this.match;return a.length<20&&(a+=this._input.substr(0,20-a.length)),(a.substr(0,20)+(a.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var a=this.pastInput(),b=new Array(a.length+1).join("-");return a+this.upcomingInput()+"\n"+b+"^"},test_match:function(a,b){var c,d,e;if(this.options.backtrack_lexer&&(e={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(e.yylloc.range=this.yylloc.range.slice(0))),d=a[0].match(/(?:\r\n?|\n).*/g),d&&(this.yylineno+=d.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:d?d[d.length-1].length-d[d.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+a[0].length},this.yytext+=a[0],this.match+=a[0],this.matches=a,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(a[0].length),this.matched+=a[0],c=this.performAction.call(this,this.yy,this,b,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),c)return c;if(this._backtrack){for(var f in e)this[f]=e[f];return!1}return!1},next:function(){if(this.done)return this.EOF;this._input||(this.done=!0);var a,b,c,d;this._more||(this.yytext="",this.match="");for(var e=this._currentRules(),f=0;fb[0].length)){if(b=c,d=f,this.options.backtrack_lexer){if(!1!==(a=this.test_match(c,e[f])))return a;if(this._backtrack){b=!1;continue}return!1}if(!this.options.flex)break}return b?!1!==(a=this.test_match(b,e[d]))&&a:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var a=this.next();return a||this.lex()},begin:function(a){this.conditionStack.push(a)},popState:function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},_currentRules:function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},topState:function(a){return a=this.conditionStack.length-1-Math.abs(a||0),a>=0?this.conditionStack[a]:"INITIAL"},pushState:function(a){this.begin(a)},stateStackSize:function(){return this.conditionStack.length},options:{},performAction:function(a,b,c,d){switch(c){case 0:return 4;case 1:return 14;case 2:return 12;case 3:return 15;case 4:return 16;case 5:return 22;case 6:return 24;case 7:return 28;case 8:return 30;case 9:return 18;case 10:return b.yytext=b.yytext.substr(1,b.yyleng-2),32;case 11:return b.yytext=b.yytext.substr(1,b.yyleng-2),33;case 12:return 17;case 13:return 31}},rules:[/^(?:\$)/,/^(?:\.\.)/,/^(?:\.)/,/^(?:\*)/,/^(?:[a-zA-Z_]+[a-zA-Z0-9_]*)/,/^(?:\[)/,/^(?:\])/,/^(?:,)/,/^(?:((-?(?:0|[1-9][0-9]*)))?\:((-?(?:0|[1-9][0-9]*)))?(\:((-?(?:0|[1-9][0-9]*)))?)?)/,/^(?:(-?(?:0|[1-9][0-9]*)))/,/^(?:"(?:\\["bfnrt\/\\]|\\u[a-fA-F0-9]{4}|[^"\\])*")/,/^(?:'(?:\\['bfnrt\/\\]|\\u[a-fA-F0-9]{4}|[^'\\])*')/,/^(?:\(.+?\)(?=\]))/,/^(?:\?\(.+?\)(?=\]))/],conditions:{INITIAL:{rules:[0,1,2,3,4,5,6,7,8,9,10,11,12,13],inclusive:!0}}}}();return b.lexer=d,a.prototype=b,b.Parser=a,new a}();void 0!==a&&void 0!==c&&(c.parser=e,c.Parser=e.Parser,c.parse=function(){return e.parse.apply(e,arguments)},c.main=function(b){b[1]||(console.log("Usage: "+b[0]+" FILE"),d.exit(1));var e=a("fs").readFileSync(a("path").normalize(b[1]),"utf8");return c.parser.parse(e)},void 0!==b&&a.main===b&&c.main(d.argv.slice(1)))}).call(this,a("_process"))},{_process:14,fs:12,path:13}],2:[function(a,b,c){b.exports={identifier:"[a-zA-Z_]+[a-zA-Z0-9_]*",integer:"-?(?:0|[1-9][0-9]*)",qq_string:'"(?:\\\\["bfnrt/\\\\]|\\\\u[a-fA-F0-9]{4}|[^"\\\\])*"',q_string:"'(?:\\\\['bfnrt/\\\\]|\\\\u[a-fA-F0-9]{4}|[^'\\\\])*'"}},{}],3:[function(a,b,c){var d=a("./dict"),e=a("fs"),f={lex:{macros:{esc:"\\\\",int:d.integer},rules:[["\\$","return 'DOLLAR'"],["\\.\\.","return 'DOT_DOT'"],["\\.","return 'DOT'"],["\\*","return 'STAR'"],[d.identifier,"return 'IDENTIFIER'"],["\\[","return '['"],["\\]","return ']'"],[",","return ','"],["({int})?\\:({int})?(\\:({int})?)?","return 'ARRAY_SLICE'"],["{int}","return 'INTEGER'"],[d.qq_string,"yytext = yytext.substr(1,yyleng-2); return 'QQ_STRING';"],[d.q_string,"yytext = yytext.substr(1,yyleng-2); return 'Q_STRING';"],["\\(.+?\\)(?=\\])","return 'SCRIPT_EXPRESSION'"],["\\?\\(.+?\\)(?=\\])","return 'FILTER_EXPRESSION'"]]},start:"JSON_PATH",bnf:{JSON_PATH:[["DOLLAR",'yy.ast.set({ expression: { type: "root", value: $1 } }); yy.ast.unshift(); return yy.ast.yield()'],["DOLLAR PATH_COMPONENTS",'yy.ast.set({ expression: { type: "root", value: $1 } }); yy.ast.unshift(); return yy.ast.yield()'],["LEADING_CHILD_MEMBER_EXPRESSION","yy.ast.unshift(); return yy.ast.yield()"],["LEADING_CHILD_MEMBER_EXPRESSION PATH_COMPONENTS",'yy.ast.set({ operation: "member", scope: "child", expression: { type: "identifier", value: $1 }}); yy.ast.unshift(); return yy.ast.yield()']],PATH_COMPONENTS:[["PATH_COMPONENT",""],["PATH_COMPONENTS PATH_COMPONENT",""]],PATH_COMPONENT:[["MEMBER_COMPONENT",'yy.ast.set({ operation: "member" }); yy.ast.push()'],["SUBSCRIPT_COMPONENT",'yy.ast.set({ operation: "subscript" }); yy.ast.push() ']],MEMBER_COMPONENT:[["CHILD_MEMBER_COMPONENT",'yy.ast.set({ scope: "child" })'],["DESCENDANT_MEMBER_COMPONENT",'yy.ast.set({ scope: "descendant" })']],CHILD_MEMBER_COMPONENT:[["DOT MEMBER_EXPRESSION",""]],LEADING_CHILD_MEMBER_EXPRESSION:[["MEMBER_EXPRESSION",'yy.ast.set({ scope: "child", operation: "member" })']],DESCENDANT_MEMBER_COMPONENT:[["DOT_DOT MEMBER_EXPRESSION",""]],MEMBER_EXPRESSION:[["STAR",'yy.ast.set({ expression: { type: "wildcard", value: $1 } })'],["IDENTIFIER",'yy.ast.set({ expression: { type: "identifier", value: $1 } })'],["SCRIPT_EXPRESSION",'yy.ast.set({ expression: { type: "script_expression", value: $1 } })'],["INTEGER",'yy.ast.set({ expression: { type: "numeric_literal", value: parseInt($1) } })'],["END",""]],SUBSCRIPT_COMPONENT:[["CHILD_SUBSCRIPT_COMPONENT",'yy.ast.set({ scope: "child" })'],["DESCENDANT_SUBSCRIPT_COMPONENT",'yy.ast.set({ scope: "descendant" })']],CHILD_SUBSCRIPT_COMPONENT:[["[ SUBSCRIPT ]",""]],DESCENDANT_SUBSCRIPT_COMPONENT:[["DOT_DOT [ SUBSCRIPT ]",""]],SUBSCRIPT:[["SUBSCRIPT_EXPRESSION",""],["SUBSCRIPT_EXPRESSION_LIST",'$1.length > 1? yy.ast.set({ expression: { type: "union", value: $1 } }) : $$ = $1']],SUBSCRIPT_EXPRESSION_LIST:[["SUBSCRIPT_EXPRESSION_LISTABLE","$$ = [$1]"],["SUBSCRIPT_EXPRESSION_LIST , SUBSCRIPT_EXPRESSION_LISTABLE","$$ = $1.concat($3)"]],SUBSCRIPT_EXPRESSION_LISTABLE:[["INTEGER",'$$ = { expression: { type: "numeric_literal", value: parseInt($1) } }; yy.ast.set($$)'],["STRING_LITERAL",'$$ = { expression: { type: "string_literal", value: $1 } }; yy.ast.set($$)'],["ARRAY_SLICE",'$$ = { expression: { type: "slice", value: $1 } }; yy.ast.set($$)']],SUBSCRIPT_EXPRESSION:[["STAR",'$$ = { expression: { type: "wildcard", value: $1 } }; yy.ast.set($$)'],["SCRIPT_EXPRESSION",'$$ = { expression: { type: "script_expression", value: $1 } }; yy.ast.set($$)'],["FILTER_EXPRESSION",'$$ = { expression: { type: "filter_expression", value: $1 } }; yy.ast.set($$)']],STRING_LITERAL:[["QQ_STRING","$$ = $1"],["Q_STRING","$$ = $1"]]}};e.readFileSync&&(f.moduleInclude=e.readFileSync(a.resolve("../include/module.js")),f.actionInclude=e.readFileSync(a.resolve("../include/action.js"))),b.exports=f},{"./dict":2,fs:12}],4:[function(a,b,c){function d(b,c,d){var e=a("./index"),f=m.parse(c).body[0].expression,g=j(f,{"@":b.value}),h=d.replace(/\{\{\s*value\s*\}\}/g,g),i=e.nodes(b.value,h);return i.forEach(function(a){a.path=b.path.concat(a.path.slice(1))}),i}function e(a){return Array.isArray(a)}function f(a){return a&&!(a instanceof Array)&&a instanceof Object}function g(a){return function(b,c,d,g){var h=b.value,i=b.path,j=(b.component,b.nextComponent),k=[],l=function(h,i){if(e(h)){if(h.forEach(function(a,b){k.length>=g||d(b,a,c)&&k.push({path:i.concat(b),value:a})}),this.applyMode&&this.buildFn){if(0===k.length)var m=this.buildFn(b,h,c);else if(j&&"subscript"===j.operation&&!e(k[0].value)&&!f(k[0].value))var m=this.buildFn(b,h,c);m&&(h=b.value,h.forEach(function(a,b){k.length>=g||d(b,a,c)&&k.push({path:i.concat(b),value:a})}))}h.forEach(function(b,c){k.length>=g||a&&l(b,i.concat(c))})}else if(f(h)){if(this.keys(h).forEach(function(a){k.length>=g||d(a,h[a],c)&&k.push({path:i.concat(a),value:h[a]})}),0===k.length&&this.applyMode&&this.buildFn){var m=this.buildFn(b,this.keys(h),c);m&&(h=b.value,this.keys(h).forEach(function(a){k.length>=g||d(a,h[a],c)&&k.push({path:i.concat(a),value:h[a]})}))}this.keys(h).forEach(function(b){k.length>=g||a&&l(h[b],i.concat(b))})}}.bind(this);return l(h,i),k}}function h(a){return function(b,c,d){return this.descend(c,b.expression.value,a,d)}}function i(a){return function(b,c,d){return this.traverse(c,b.expression.value,a,d)}}function j(){try{return o.apply(this,arguments)}catch(a){}}function k(a){return a=a.filter(function(a){return a}),p(a,function(a){return a.path.map(function(a){return String(a).replace("-","--")}).join("-")})}function l(a){var b=String(a);return b.match(/^-?[0-9]+$/)?parseInt(b):null}var m=a("./aesprim"),n=a("./slice"),o=a("static-eval"),p=a("underscore").uniq,q=function(){return this.initialize.apply(this,arguments)};q.prototype.initialize=function(){this.traverse=g(!0),this.descend=g()},q.prototype.keys=Object.keys,q.prototype.resolve=function(a){var b=[a.operation,a.scope,a.expression.type].join("-"),c=this._fns[b];if(!c)throw new Error("couldn't resolve key: "+b);return c.bind(this)},q.prototype.register=function(a,b){if(!b instanceof Function)throw new Error("handler must be a function");this._fns[a]=b},q.prototype._fns={"member-child-identifier":function(a,b){var c=a.expression.value,d=b.value;if(d instanceof Object&&c in d)return[{value:d[c],path:b.path.concat(c)}];if(this.applyMode&&this.buildFn){if(this.buildFn(b,d,c)&&(d=b.value)instanceof Object&&c in d)return[{value:d[c],path:b.path.concat(c)}]}},"member-descendant-identifier":i(function(a,b,c){return a==c}),"subscript-child-numeric_literal":h(function(a,b,c){return a===c}),"member-child-numeric_literal":h(function(a,b,c){return String(a)===String(c)}),"subscript-descendant-numeric_literal":i(function(a,b,c){return a===c}),"member-child-wildcard":h(function(){return!0}),"member-descendant-wildcard":i(function(){return!0}),"subscript-descendant-wildcard":i(function(){return!0}),"subscript-child-wildcard":h(function(){return!0}),"subscript-child-slice":function(a,b){if(e(b.value)){var c=a.expression.value.split(":"),d=c.map(l),f=b.value.map(function(a,c){return{value:a,path:b.path.concat(c)}}),g=n.apply(null,[f].concat(d));if(this.applyMode){var h=parseInt(c[0]);g.forEach(function(a,c){void 0===a&&(g[c]={value:"stub",path:b.path.concat(h+c)})})}return g}},"subscript-child-union":function(a,b){var c=[];return a.expression.value.forEach(function(a){var d={operation:"subscript",scope:"child",expression:a.expression},e=this.resolve(d),f=e(d,b);f&&(c=c.concat(f))},this),k(c)},"subscript-descendant-union":function(b,c,d){var e=a(".."),f=this,g=[];return e.nodes(c,"$..*").slice(1).forEach(function(a){g.length>=d||b.expression.value.forEach(function(b){var c={operation:"subscript",scope:"child",expression:b.expression},d=f.resolve(c),e=d(c,a);g=g.concat(e)})}),k(g)},"subscript-child-filter_expression":function(a,b,c){var d=a.expression.value.slice(2,-1),e=m.parse(d).body[0].expression,f=function(a,b){return j(e,{"@":b})};return this.descend(b,null,f,c)},"subscript-descendant-filter_expression":function(a,b,c){var d=a.expression.value.slice(2,-1),e=m.parse(d).body[0].expression,f=function(a,b){return j(e,{"@":b})};return this.traverse(b,null,f,c)},"subscript-child-script_expression":function(a,b){return d(b,a.expression.value.slice(1,-1),"$[{{value}}]")},"member-child-script_expression":function(a,b){return d(b,a.expression.value.slice(1,-1),"$.{{value}}")},"member-descendant-script_expression":function(a,b){return d(b,a.expression.value.slice(1,-1),"$..value")}},q.prototype._fns["subscript-child-string_literal"]=q.prototype._fns["member-child-identifier"],q.prototype._fns["member-descendant-numeric_literal"]=q.prototype._fns["subscript-descendant-string_literal"]=q.prototype._fns["member-descendant-identifier"],b.exports=q},{"..":"jsonpath","./aesprim":"./aesprim","./index":5,"./slice":7,"static-eval":15,underscore:16}],5:[function(a,b,c){function d(a){return"[object String]"==Object.prototype.toString.call(a)}var e=a("assert"),f=a("./dict"),g=a("./parser"),h=a("./handlers"),i=function(){this.initialize.apply(this,arguments)};i.prototype.initialize=function(){this.parser=new g,this.handlers=new h},i.prototype.parse=function(a){return e.ok(d(a),"we need a path"),this.parser.parse(a)},i.prototype.parent=function(a,b){e.ok(a instanceof Object,"obj needs to be an object"),e.ok(b,"we need a path");var c=this.nodes(a,b)[0];c.path.pop();return this.value(a,c.path)},i.prototype.apply=function(a,b,c,d){e.ok(a instanceof Object,"obj needs to be an object"),e.ok(b,"we need a path"),e.equal(typeof c,"function","fn needs to be function"),this.handlers.applyMode=!0,this.handlers.buildFn=d;var f=this.nodes(a,b).sort(function(a,b){return b.path.length-a.path.length});return this.handlers.buildFn=null,this.handlers.applyMode=!1,f.forEach(function(b){var d=b.path.pop(),e=this.value(a,this.stringify(b.path)),f=b.value=c.call(a,e[d]);e[d]=f,b.path.push(d)},this),f},i.prototype.value=function(a,b,c){if(e.ok(a instanceof Object,"obj needs to be an object"),e.ok(b,"we need a path"),arguments.length>=3){var d=this.nodes(a,b).shift();if(!d)return this._vivify(a,b,c);var f=d.path.slice(-1).shift();this.parent(a,this.stringify(d.path))[f]=c}return this.query(a,this.stringify(b),1).shift()},i.prototype._vivify=function(a,b,c){var d=this;e.ok(a instanceof Object,"obj needs to be an object"),e.ok(b,"we need a path");var f=this.parser.parse(b).map(function(a){return a.expression.value}),g=function(b,c){var e=b.pop(),f=d.value(a,b);f||(g(b.concat(),"string"==typeof e?{}:[]), +f=d.value(a,b)),f[e]=c};return g(f,c),this.query(a,b)[0]},i.prototype.query=function(a,b,c){return e.ok(a instanceof Object,"obj needs to be an object"),e.ok(d(b),"we need a path"),this.nodes(a,b,c).map(function(a){return a.value})},i.prototype.paths=function(a,b,c){return e.ok(a instanceof Object,"obj needs to be an object"),e.ok(b,"we need a path"),this.nodes(a,b,c).map(function(a){return a.path})},i.prototype.nodes=function(a,b,c){if(e.ok(a instanceof Object,"obj needs to be an object"),e.ok(b,"we need a path"),0===c)return[];var d=this.parser.parse(b),f=this.handlers,g=[{path:["$"],value:a}],h=[];return d.length&&"root"==d[0].expression.type&&d.shift(),d.length?(d.forEach(function(a,b){if(!(h.length>=c)){var e=f.resolve(a),i=[];g.forEach(function(f){if(!(h.length>=c)){f.component=a,f.nextComponent=d[b+1];var g=e(a,f,c);b==d.length-1?h=h.concat(g||[]):i=i.concat(g||[])}}),g=i}}),c?h.slice(0,c):h):g},i.prototype.stringify=function(a){e.ok(a,"we need a path");var b="$",c={"descendant-member":"..{{value}}","child-member":".{{value}}","descendant-subscript":"..[{{value}}]","child-subscript":"[{{value}}]"};return a=this._normalize(a),a.forEach(function(a){if("root"!=a.expression.type){var d,e=[a.scope,a.operation].join("-"),f=c[e];if(d="string_literal"==a.expression.type?JSON.stringify(a.expression.value):a.expression.value,!f)throw new Error("couldn't find template "+e);b+=f.replace(/{{value}}/,d)}}),b},i.prototype._normalize=function(a){if(e.ok(a,"we need a path"),"string"==typeof a)return this.parser.parse(a);if(Array.isArray(a)&&"string"==typeof a[0]){var b=[{expression:{type:"root",value:"$"}}];return a.forEach(function(a,c){if("$"!=a||0!==c)if("string"==typeof a&&a.match("^"+f.identifier+"$"))b.push({operation:"member",scope:"child",expression:{value:a,type:"identifier"}});else{var d="number"==typeof a?"numeric_literal":"string_literal";b.push({operation:"subscript",scope:"child",expression:{value:a,type:d}})}}),b}if(Array.isArray(a)&&"object"==typeof a[0])return a;throw new Error("couldn't understand path "+a)},i.Handlers=h,i.Parser=g;var j=new i;j.JSONPath=i,b.exports=j},{"./dict":2,"./handlers":4,"./parser":6,assert:8}],6:[function(a,b,c){var d=a("./grammar"),e=a("../generated/parser"),f=function(){var a=new e.Parser,b=a.parseError;return a.yy.parseError=function(){a.yy.ast&&a.yy.ast.initialize(),b.apply(a,arguments)},a};f.grammar=d,b.exports=f},{"../generated/parser":1,"./grammar":3}],7:[function(a,b,c){function d(a){return String(a).match(/^[0-9]+$/)?parseInt(a):Number.isFinite(a)?parseInt(a,10):0}b.exports=function(a,b,c,e){if("string"==typeof b)throw new Error("start cannot be a string");if("string"==typeof c)throw new Error("end cannot be a string");if("string"==typeof e)throw new Error("step cannot be a string");var f=a.length;if(0===e)throw new Error("step cannot be zero");if(e=e?d(e):1,b=b<0?f+b:b,c=c<0?f+c:c,b=d(0===b?0:b||(e>0?0:f-1)),c=d(0===c?0:c||(e>0?f:-1)),b=e>0?Math.max(0,b):Math.min(f,b),c=e>0?Math.min(c,f):Math.max(-1,c),e>0&&c<=b)return[];if(e<0&&b<=c)return[];for(var g=[],h=b;h!=c&&!(e<0&&h<=c||e>0&&h>=c);h+=e)g.push(a[h]);return g}},{}],8:[function(a,b,c){function d(a,b){return n.isUndefined(b)?""+b:n.isNumber(b)&&!isFinite(b)?b.toString():n.isFunction(b)||n.isRegExp(b)?b.toString():b}function e(a,b){return n.isString(a)?a.length=0;f--)if(g[f]!=h[f])return!1;for(f=g.length-1;f>=0;f--)if(e=g[f],!i(a[e],b[e]))return!1;return!0}function l(a,b){return!(!a||!b)&&("[object RegExp]"==Object.prototype.toString.call(b)?b.test(a):a instanceof b||!0===b.call({},a))}function m(a,b,c,d){var e;n.isString(c)&&(d=c,c=null);try{b()}catch(f){e=f}if(d=(c&&c.name?" ("+c.name+").":".")+(d?" "+d:"."),a&&!e&&g(e,c,"Missing expected exception"+d),!a&&l(e,c)&&g(e,c,"Got unwanted exception"+d),a&&e&&c&&!l(e,c)||!a&&e)throw e}var n=a("util/"),o=Array.prototype.slice,p=Object.prototype.hasOwnProperty,q=b.exports=h;q.AssertionError=function(a){this.name="AssertionError",this.actual=a.actual,this.expected=a.expected,this.operator=a.operator,a.message?(this.message=a.message,this.generatedMessage=!1):(this.message=f(this),this.generatedMessage=!0);var b=a.stackStartFunction||g;if(Error.captureStackTrace)Error.captureStackTrace(this,b);else{var c=new Error;if(c.stack){var d=c.stack,e=b.name,h=d.indexOf("\n"+e);if(h>=0){var i=d.indexOf("\n",h+1);d=d.substring(i+1)}this.stack=d}}},n.inherits(q.AssertionError,Error),q.fail=g,q.ok=h,q.equal=function(a,b,c){a!=b&&g(a,b,c,"==",q.equal)},q.notEqual=function(a,b,c){a==b&&g(a,b,c,"!=",q.notEqual)},q.deepEqual=function(a,b,c){i(a,b)||g(a,b,c,"deepEqual",q.deepEqual)},q.notDeepEqual=function(a,b,c){i(a,b)&&g(a,b,c,"notDeepEqual",q.notDeepEqual)},q.strictEqual=function(a,b,c){a!==b&&g(a,b,c,"===",q.strictEqual)},q.notStrictEqual=function(a,b,c){a===b&&g(a,b,c,"!==",q.notStrictEqual)},q.throws=function(a,b,c){m.apply(this,[!0].concat(o.call(arguments)))},q.doesNotThrow=function(a,b){m.apply(this,[!1].concat(o.call(arguments)))},q.ifError=function(a){if(a)throw a};var r=Object.keys||function(a){var b=[];for(var c in a)p.call(a,c)&&b.push(c);return b}},{"util/":11}],9:[function(a,b,c){"function"==typeof Object.create?b.exports=function(a,b){a.super_=b,a.prototype=Object.create(b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}})}:b.exports=function(a,b){a.super_=b;var c=function(){};c.prototype=b.prototype,a.prototype=new c,a.prototype.constructor=a}},{}],10:[function(a,b,c){b.exports=function(a){return a&&"object"==typeof a&&"function"==typeof a.copy&&"function"==typeof a.fill&&"function"==typeof a.readUInt8}},{}],11:[function(a,b,c){(function(b,d){function e(a,b){var d={seen:[],stylize:g};return arguments.length>=3&&(d.depth=arguments[2]),arguments.length>=4&&(d.colors=arguments[3]),p(b)?d.showHidden=b:b&&c._extend(d,b),v(d.showHidden)&&(d.showHidden=!1),v(d.depth)&&(d.depth=2),v(d.colors)&&(d.colors=!1),v(d.customInspect)&&(d.customInspect=!0),d.colors&&(d.stylize=f),i(d,a,d.depth)}function f(a,b){var c=e.styles[b];return c?"["+e.colors[c][0]+"m"+a+"["+e.colors[c][1]+"m":a}function g(a,b){return a}function h(a){var b={};return a.forEach(function(a,c){b[a]=!0}),b}function i(a,b,d){if(a.customInspect&&b&&A(b.inspect)&&b.inspect!==c.inspect&&(!b.constructor||b.constructor.prototype!==b)){var e=b.inspect(d,a);return t(e)||(e=i(a,e,d)),e}var f=j(a,b);if(f)return f;var g=Object.keys(b),p=h(g);if(a.showHidden&&(g=Object.getOwnPropertyNames(b)),z(b)&&(g.indexOf("message")>=0||g.indexOf("description")>=0))return k(b);if(0===g.length){if(A(b)){var q=b.name?": "+b.name:"";return a.stylize("[Function"+q+"]","special")}if(w(b))return a.stylize(RegExp.prototype.toString.call(b),"regexp");if(y(b))return a.stylize(Date.prototype.toString.call(b),"date");if(z(b))return k(b)}var r="",s=!1,u=["{","}"];if(o(b)&&(s=!0,u=["[","]"]),A(b)){r=" [Function"+(b.name?": "+b.name:"")+"]"}if(w(b)&&(r=" "+RegExp.prototype.toString.call(b)),y(b)&&(r=" "+Date.prototype.toUTCString.call(b)),z(b)&&(r=" "+k(b)),0===g.length&&(!s||0==b.length))return u[0]+r+u[1];if(d<0)return w(b)?a.stylize(RegExp.prototype.toString.call(b),"regexp"):a.stylize("[Object]","special");a.seen.push(b);var v;return v=s?l(a,b,d,p,g):g.map(function(c){return m(a,b,d,p,c,s)}),a.seen.pop(),n(v,r,u)}function j(a,b){if(v(b))return a.stylize("undefined","undefined");if(t(b)){var c="'"+JSON.stringify(b).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return a.stylize(c,"string")}return s(b)?a.stylize(""+b,"number"):p(b)?a.stylize(""+b,"boolean"):q(b)?a.stylize("null","null"):void 0}function k(a){return"["+Error.prototype.toString.call(a)+"]"}function l(a,b,c,d,e){for(var f=[],g=0,h=b.length;g-1&&(h=f?h.split("\n").map(function(a){return" "+a}).join("\n").substr(2):"\n"+h.split("\n").map(function(a){return" "+a}).join("\n"))):h=a.stylize("[Circular]","special")),v(g)){if(f&&e.match(/^\d+$/))return h;g=JSON.stringify(""+e),g.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(g=g.substr(1,g.length-2),g=a.stylize(g,"name")):(g=g.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),g=a.stylize(g,"string"))}return g+": "+h}function n(a,b,c){var d=0;return a.reduce(function(a,b){return d++,b.indexOf("\n")>=0&&d++,a+b.replace(/\u001b\[\d\d?m/g,"").length+1},0)>60?c[0]+(""===b?"":b+"\n ")+" "+a.join(",\n ")+" "+c[1]:c[0]+b+" "+a.join(", ")+" "+c[1]}function o(a){return Array.isArray(a)}function p(a){return"boolean"==typeof a}function q(a){return null===a}function r(a){return null==a}function s(a){return"number"==typeof a}function t(a){return"string"==typeof a}function u(a){return"symbol"==typeof a}function v(a){return void 0===a}function w(a){return x(a)&&"[object RegExp]"===C(a)}function x(a){return"object"==typeof a&&null!==a}function y(a){return x(a)&&"[object Date]"===C(a)}function z(a){return x(a)&&("[object Error]"===C(a)||a instanceof Error)}function A(a){return"function"==typeof a}function B(a){return null===a||"boolean"==typeof a||"number"==typeof a||"string"==typeof a||"symbol"==typeof a||void 0===a}function C(a){return Object.prototype.toString.call(a)}function D(a){return a<10?"0"+a.toString(10):a.toString(10)}function E(){var a=new Date,b=[D(a.getHours()),D(a.getMinutes()),D(a.getSeconds())].join(":");return[a.getDate(),J[a.getMonth()],b].join(" ")}function F(a,b){return Object.prototype.hasOwnProperty.call(a,b)}var G=/%[sdj%]/g;c.format=function(a){if(!t(a)){for(var b=[],c=0;c=f)return a;switch(a){case"%s":return String(d[c++]);case"%d":return Number(d[c++]);case"%j":try{return JSON.stringify(d[c++])}catch(b){return"[Circular]"}default:return a}}),h=d[c];c=0;d--){var e=a[d];"."===e?a.splice(d,1):".."===e?(a.splice(d,1),c++):c&&(a.splice(d,1),c--)}if(b)for(;c--;c)a.unshift("..");return a}function d(a){"string"!=typeof a&&(a+="");var b,c=0,d=-1,e=!0;for(b=a.length-1;b>=0;--b)if(47===a.charCodeAt(b)){if(!e){c=b+1;break}}else-1===d&&(e=!1,d=b+1);return-1===d?"":a.slice(c,d)}function e(a,b){if(a.filter)return a.filter(b);for(var c=[],d=0;d=-1&&!d;f--){var g=f>=0?arguments[f]:a.cwd();if("string"!=typeof g)throw new TypeError("Arguments to path.resolve must be strings");g&&(c=g+"/"+c,d="/"===g.charAt(0))}return c=b(e(c.split("/"),function(a){return!!a}),!d).join("/"),(d?"/":"")+c||"."},c.normalize=function(a){var d=c.isAbsolute(a),g="/"===f(a,-1);return a=b(e(a.split("/"),function(a){return!!a}),!d).join("/"),a||d||(a="."),a&&g&&(a+="/"),(d?"/":"")+a},c.isAbsolute=function(a){return"/"===a.charAt(0)},c.join=function(){var a=Array.prototype.slice.call(arguments,0);return c.normalize(e(a,function(a,b){if("string"!=typeof a)throw new TypeError("Arguments to path.join must be strings");return a}).join("/"))},c.relative=function(a,b){function d(a){for(var b=0;b=0&&""===a[c];c--);return b>c?[]:a.slice(b,c-b+1)}a=c.resolve(a).substr(1),b=c.resolve(b).substr(1);for(var e=d(a.split("/")),f=d(b.split("/")),g=Math.min(e.length,f.length),h=g,i=0;i=1;--f)if(47===(b=a.charCodeAt(f))){if(!e){d=f;break}}else e=!1;return-1===d?c?"/":".":c&&1===d?"/":a.slice(0,d)},c.basename=function(a,b){var c=d(a);return b&&c.substr(-1*b.length)===b&&(c=c.substr(0,c.length-b.length)),c},c.extname=function(a){"string"!=typeof a&&(a+="");for(var b=-1,c=0,d=-1,e=!0,f=0,g=a.length-1;g>=0;--g){var h=a.charCodeAt(g);if(47!==h)-1===d&&(e=!1,d=g+1),46===h?-1===b?b=g:1!==f&&(f=1):-1!==b&&(f=-1);else if(!e){c=g+1;break}}return-1===b||-1===d||0===f||1===f&&b===d-1&&b===c+1?"":a.slice(b,d)};var f="b"==="ab".substr(-1)?function(a,b,c){return a.substr(b,c)}:function(a,b,c){return b<0&&(b=a.length+b),a.substr(b,c)}}).call(this,a("_process"))},{_process:14}],14:[function(a,b,c){function d(){throw new Error("setTimeout has not been defined")}function e(){throw new Error("clearTimeout has not been defined")}function f(a){if(l===setTimeout)return setTimeout(a,0);if((l===d||!l)&&setTimeout)return l=setTimeout,setTimeout(a,0);try{return l(a,0)}catch(b){try{return l.call(null,a,0)}catch(b){return l.call(this,a,0)}}}function g(a){if(m===clearTimeout)return clearTimeout(a);if((m===e||!m)&&clearTimeout)return m=clearTimeout,clearTimeout(a);try{return m(a)}catch(b){try{return m.call(null,a)}catch(b){return m.call(this,a)}}}function h(){q&&o&&(q=!1,o.length?p=o.concat(p):r=-1,p.length&&i())}function i(){if(!q){var a=f(h);q=!0;for(var b=p.length;b;){for(o=p,p=[];++r1)for(var c=1;c"===p?j>o:">="===p?j>=o:"|"===p?j|o:"&"===p?j&o:"^"===p?j^o:"&&"===p?j&&o:"||"===p?j||o:c}if("Identifier"===e.type)return{}.hasOwnProperty.call(b,e.name)?b[e.name]:c;if("ThisExpression"===e.type)return{}.hasOwnProperty.call(b,"this")?b.this:c;if("CallExpression"===e.type){var q=a(e.callee);if(q===c)return c;if("function"!=typeof q)return c;var r=e.callee.object?a(e.callee.object):c;r===c&&(r=null);for(var s=[],i=0,j=e.arguments.length;i=0)},q.invoke=function(a,b){var c=j.call(arguments,2),d=q.isFunction(b);return q.map(a,function(a){return(d?b:a[b]).apply(a,c)})},q.pluck=function(a,b){return q.map(a,q.property(b))},q.where=function(a,b){return q.filter(a,q.matches(b))},q.findWhere=function(a,b){return q.find(a,q.matches(b))},q.max=function(a,b,c){var d,e,f=-1/0,g=-1/0;if(null==b&&null!=a){a=a.length===+a.length?a:q.values(a);for(var h=0,i=a.length;hf&&(f=d)}else b=q.iteratee(b,c),q.each(a,function(a,c,d){((e=b(a,c,d))>g||e===-1/0&&f===-1/0)&&(f=a,g=e)});return f},q.min=function(a,b,c){var d,e,f=1/0,g=1/0;if(null==b&&null!=a){a=a.length===+a.length?a:q.values(a);for(var h=0,i=a.length;hd||void 0===c)return 1;if(c>>1;c(a[h])=0;)if(a[d]===b)return d;return-1},q.range=function(a,b,c){arguments.length<=1&&(b=a||0,a=0),c=c||1;for(var d=Math.max(Math.ceil((b-a)/c),0),e=Array(d),f=0;fb?(clearTimeout(g),g=null,h=j,f=a.apply(d,e),g||(d=e=null)):g||!1===c.trailing||(g=setTimeout(i,k)),f}},q.debounce=function(a,b,c){var d,e,f,g,h,i=function(){var j=q.now()-g;j0?d=setTimeout(i,b-j):(d=null,c||(h=a.apply(f,e),d||(f=e=null)))};return function(){f=this,e=arguments,g=q.now();var j=c&&!d;return d||(d=setTimeout(i,b)),j&&(h=a.apply(f,e),f=e=null),h}},q.wrap=function(a,b){return q.partial(b,a)},q.negate=function(a){return function(){return!a.apply(this,arguments)}},q.compose=function(){var a=arguments,b=a.length-1;return function(){for(var c=b,d=a[b].apply(this,arguments);c--;)d=a[c].call(this,d);return d}},q.after=function(a,b){return function(){if(--a<1)return b.apply(this,arguments)}},q.before=function(a,b){var c;return function(){return--a>0?c=b.apply(this,arguments):b=null,c}},q.once=q.partial(q.before,2),q.keys=function(a){if(!q.isObject(a))return[];if(o)return o(a);var b=[];for(var c in a)q.has(a,c)&&b.push(c);return b},q.values=function(a){for(var b=q.keys(a),c=b.length,d=Array(c),e=0;e":">",'"':""","'":"'","`":"`"},y=q.invert(x),z=function(a){var b=function(b){return a[b]},c="(?:"+q.keys(a).join("|")+")",d=RegExp(c),e=RegExp(c,"g");return function(a){return a=null==a?"":""+a,d.test(a)?a.replace(e,b):a}};q.escape=z(x),q.unescape=z(y),q.result=function(a,b){if(null!=a){var c=a[b];return q.isFunction(c)?a[b]():c}};var A=0;q.uniqueId=function(a){var b=++A+"";return a?a+b:b},q.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var B=/(.)^/,C={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},D=/\\|'|\r|\n|\u2028|\u2029/g,E=function(a){return"\\"+C[a]};q.template=function(a,b,c){!b&&c&&(b=c),b=q.defaults({},b,q.templateSettings);var d=RegExp([(b.escape||B).source,(b.interpolate||B).source,(b.evaluate||B).source].join("|")+"|$","g"),e=0,f="__p+='";a.replace(d,function(b,c,d,g,h){return f+=a.slice(e,h).replace(D,E),e=h+b.length,c?f+="'+\n((__t=("+c+"))==null?'':_.escape(__t))+\n'":d?f+="'+\n((__t=("+d+"))==null?'':__t)+\n'":g&&(f+="';\n"+g+"\n__p+='"),b}),f+="';\n",b.variable||(f="with(obj||{}){\n"+f+"}\n"),f="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+f+"return __p;\n";try{var g=new Function(b.variable||"obj","_",f)}catch(j){throw j.source=f,j}var h=function(a){return g.call(this,a,q)},i=b.variable||"obj";return h.source="function("+i+"){\n"+f+"}",h},q.chain=function(a){var b=q(a);return b._chain=!0,b};var F=function(a){return this._chain?q(a).chain():a};q.mixin=function(a){q.each(q.functions(a),function(b){var c=q[b]=a[b];q.prototype[b]=function(){var a=[this._wrapped];return i.apply(a,arguments),F.call(this,c.apply(q,a))}})},q.mixin(q),q.each(["pop","push","reverse","shift","sort","splice","unshift"],function(a){var b=f[a];q.prototype[a]=function(){var c=this._wrapped;return b.apply(c,arguments),"shift"!==a&&"splice"!==a||0!==c.length||delete c[0],F.call(this,c)}}),q.each(["concat","join","slice"],function(a){var b=f[a];q.prototype[a]=function(){return F.call(this,b.apply(this._wrapped,arguments))}}),q.prototype.value=function(){return this._wrapped},"function"==typeof a&&a.amd&&a("underscore",[],function(){return q})}).call(this)},{}],jsonpath:[function(a,b,c){b.exports=a("./lib/index")},{"./lib/index":5}]},{},["jsonpath"])("jsonpath")}); \ No newline at end of file diff --git a/lib/handlers.js b/lib/handlers.js index c00e6b0..53f79a1 100755 --- a/lib/handlers.js +++ b/lib/handlers.js @@ -34,11 +34,20 @@ Handlers.prototype.register = function(key, handler) { Handlers.prototype._fns = { + // (wje) - patched 2019-03-07 to add creation capability. 'member-child-identifier': function(component, partial) { var key = component.expression.value; var value = partial.value; if (value instanceof Object && key in value) { return [ { value: value[key], path: partial.path.concat(key) } ] + } else if (this.applyMode && this.buildFn) { + var altered = this.buildFn(partial, value, key); + if (altered) { + value = partial.value; + if (value instanceof Object && key in value) { + return [ { value: value[key], path: partial.path.concat(key) } ] + } + } } }, @@ -66,11 +75,28 @@ Handlers.prototype._fns = { 'subscript-child-wildcard': _descend(function() { return true }), + // (wje) - patched 2019-03-07 to add creation capability. 'subscript-child-slice': function(component, partial) { if (is_array(partial.value)) { - var args = component.expression.value.split(':').map(_parse_nullable_int); + var indexes = component.expression.value.split(':'); + var args = indexes.map(_parse_nullable_int); var values = partial.value.map(function(v, i) { return { value: v, path: partial.path.concat(i) } }); - return slice.apply(null, [values].concat(args)); + var results = slice.apply(null, [values].concat(args)); + + // if we're in 'apply mode', that means that were called as part of an + // 'apply' operation. + if (this.applyMode) { + var start = parseInt(indexes[0]); + results.forEach(function(element, index) { + if (element === undefined) { + results[index] = { + value: 'stub', + path: partial.path.concat(start + index) + } + } + }); + } + return results; } }, @@ -183,24 +209,49 @@ function is_object(val) { return val && !(val instanceof Array) && val instanceof Object; } +// (wje) - patched 2019-03-07 to add creation capability. function traverser(recurse) { return function(partial, ref, passable, count) { var value = partial.value; var path = partial.path; + var comp = partial.component; + var nextComp = partial.nextComponent; var results = []; var descend = function(value, path) { if (is_array(value)) { + value.forEach(function(element, index) { if (results.length >= count) { return } if (passable(index, element, ref)) { results.push({ path: path.concat(index), value: element }); } }); + + if (this.applyMode && this.buildFn) { + if (results.length === 0) { + var altered = this.buildFn(partial, value, ref); + } else if (nextComp && + nextComp.operation === 'subscript' && + !is_array(results[0].value) && + !is_object(results[0].value)) { + var altered = this.buildFn(partial, value, ref); + } + if (altered) { + value = partial.value; + value.forEach(function(element, index) { + if (results.length >= count) { return } + if (passable(index, element, ref)) { + results.push({ path: path.concat(index), value: element }); + } + }); + } + } + value.forEach(function(element, index) { if (results.length >= count) { return } if (recurse) { @@ -208,12 +259,27 @@ function traverser(recurse) { } }); } else if (is_object(value)) { + this.keys(value).forEach(function(k) { if (results.length >= count) { return } if (passable(k, value[k], ref)) { results.push({ path: path.concat(k), value: value[k] }); } - }) + }); + + if (results.length === 0 && this.applyMode && this.buildFn) { + var altered = this.buildFn(partial, this.keys(value), ref); + if (altered) { + value = partial.value; + this.keys(value).forEach(function(k) { + if (results.length >= count) { return } + if (passable(k, value[k], ref)) { + results.push({ path: path.concat(k), value: value[k] }); + } + }); + } + } + this.keys(value).forEach(function(k) { if (results.length >= count) { return } if (recurse) { diff --git a/lib/index.js b/lib/index.js index 92c42a5..bba24d5 100755 --- a/lib/index.js +++ b/lib/index.js @@ -27,17 +27,24 @@ JSONPath.prototype.parent = function(obj, string) { return this.value(obj, node.path); } -JSONPath.prototype.apply = function(obj, string, fn) { +// (wje) - patched 2019-03-07 to add creation capability. +JSONPath.prototype.apply = function(obj, string, fn, buildFn) { assert.ok(obj instanceof Object, "obj needs to be an object"); assert.ok(string, "we need a path"); assert.equal(typeof fn, "function", "fn needs to be function") + this.handlers.applyMode = true; + this.handlers.buildFn = buildFn; + var nodes = this.nodes(obj, string).sort(function(a, b) { // sort nodes so we apply from the bottom up return b.path.length - a.path.length; }); + this.handlers.buildFn = null; + this.handlers.applyMode = false; + nodes.forEach(function(node) { var key = node.path.pop(); var parent = this.value(obj, this.stringify(node.path)); @@ -135,6 +142,11 @@ JSONPath.prototype.nodes = function(obj, string, count) { partials.forEach(function(p) { if (matches.length >= count) return; + + // (wje) - patched 2019-03-07 to add creation capability. + p.component = component; + p.nextComponent = path[index + 1]; + var results = handler(component, p, count); if (index == path.length - 1) {