上传文件至 体育频道/JS

This commit is contained in:
2025-10-13 06:37:04 +00:00
parent ca0afd18b6
commit b6f92cd3e7
5 changed files with 3994 additions and 0 deletions
+44
View File
@@ -0,0 +1,44 @@
// 道长 drpy仓库 https://gitcode.net/qq_32394351/dr_py
// 道长 drpy安卓本地搭建说明 https://code.gitlink.org.cn/api/v1/repos/hjdhnx/dr_py/blob/master/%E5%AE%89%E5%8D%93%E6%9C%AC%E5%9C%B0%E6%90%AD%E5%BB%BA%E8%AF%B4%E6%98%8E.md
// 道长 drpy写源 模板规则说明 https://gitcode.net/qq_32394351/dr_py#%E6%A8%A1%E6%9D%BF%E8%A7%84%E5%88%99%E8%AF%B4%E6%98%8E
// 道长 drpy写源 套模模版 https://ghproxy.net/https://raw.githubusercontent.com/hjdhnx/dr_py/main/js/%E6%A8%A1%E6%9D%BF.js
// 道长 drpy写源 相关视频教程 https://www.youtube.com/watch?v=AK7cN-fcwm4
// 道长 drpy写源 写源教学视频 https://t.me/fongmi_offical/54080/63553
// 海阔下载 https://haikuo.lanzoui.com/u/GoldRiver
// 影视TV 官方TG Drpy群 https://t.me/fongmi_offical/63689
// 影视TV 官方TG 下载 https://t.me/fongmi_release
var rule = {
title:'JRKAN直播',
host:'http://www.jrkankan.com/?lan=1',
// JRKAN备用域名:www.jrkankan.com / www.jrkan365.com / jrsyyds.com / www.jryyds.com / jrskan.com / jrsbxj.com
// JRKAN网址发布:qiumi1314.com
url:'/fyclass',
searchUrl:'',
searchable:0,
quickSearch:0,
class_name:'全部',
class_url:'/',
//class_url:'?live',
headers:{
'User-Agent':'MOBILE_UA'
},
timeout:5000,
play_parse:true,
lazy:"",
limit:6,
double:false,
推荐:'*',
// 一级:'.loc_match:eq(2) ul;li:gt(1):lt(4)&&Text;img&&src;li:lt(2)&&Text;a:eq(1)&&href',//play.sportsteam333.com
一级:"js:var items=[];pdfh=jsp.pdfh;pdfa=jsp.pdfa;pd=jsp.pd;var html=request(input);var tabs=pdfa(html,'body&&.d-touch');tabs.forEach(function(it){var pz=pdfh(it,'.name:eq(1)&&Text');var ps=pdfh(it,'.name:eq(0)&&Text');var pk=pdfh(it,'.name:eq(2)&&Text');var img=pd(it,'img&&src');var timer=pdfh(it,'.lab_time&&Text');var url=pd(it,'a.me&&href');items.push({desc:timer+'🏆'+ps,title:pz+'🆚'+pk,pic_url:img,url:url})});setResult(items);",
二级:{
"title":".sub_list li:lt(2)&&Text;.sub_list li:eq(0)&&Text",
"img":"img&&src",
"desc":";;;.lab_team_home&&Text;.lab_team_away&&Text",
"content":".sub_list ul&&Text",
"tabs":"js:TABS=['JRKAN直播']",
"lists":"js:LISTS=[];pdfh=jsp.pdfh;pdfa=jsp.pdfa;pd=jsp.pd;let html=request(input);let data=pdfa(html,'.sub_playlist&&a');TABS.forEach(function(tab){let d=data.map(function(it){let name=pdfh(it,'strong&&Text');let url=pd(it,'a&&data-play');return name+'$'+url});LISTS.push(d)});",
},
搜索:'',
}
+504
View File
@@ -0,0 +1,504 @@
(function(global, factory) {
typeof exports === "object" && typeof module !== "undefined" ? factory(exports) : typeof define === "function" && define.amd ? define(["exports"], factory) : (global = typeof globalThis !== "undefined" ? globalThis : global || self, factory(global.jinja = {}))
})(this, function(jinja) {
"use strict";
var STRINGS = /'(\\.|[^'])*'|"(\\.|[^"'"])*"/g;
var IDENTS_AND_NUMS = /([$_a-z][$\w]*)|([+-]?\d+(\.\d+)?)/g;
var NUMBER = /^[+-]?\d+(\.\d+)?$/;
var NON_PRIMITIVES = /\[[@#~](,[@#~])*\]|\[\]|\{([@i]:[@#~])(,[@i]:[@#~])*\}|\{\}/g;
var IDENTIFIERS = /[$_a-z][$\w]*/gi;
var VARIABLES = /i(\.i|\[[@#i]\])*/g;
var ACCESSOR = /(\.i|\[[@#i]\])/g;
var OPERATORS = /(===?|!==?|>=?|<=?|&&|\|\||[+\-\*\/%])/g;
var EOPS = /(^|[^$\w])(and|or|not|is|isnot)([^$\w]|$)/g;
var LEADING_SPACE = /^\s+/;
var TRAILING_SPACE = /\s+$/;
var START_TOKEN = /\{\{\{|\{\{|\{%|\{#/;
var TAGS = {
"{{{": /^('(\\.|[^'])*'|"(\\.|[^"'"])*"|.)+?\}\}\}/,
"{{": /^('(\\.|[^'])*'|"(\\.|[^"'"])*"|.)+?\}\}/,
"{%": /^('(\\.|[^'])*'|"(\\.|[^"'"])*"|.)+?%\}/,
"{#": /^('(\\.|[^'])*'|"(\\.|[^"'"])*"|.)+?#\}/
};
var delimeters = {
"{%": "directive",
"{{": "output",
"{#": "comment"
};
var operators = {
and: "&&",
or: "||",
not: "!",
is: "==",
isnot: "!="
};
var constants = {
true: true,
false: false,
null: null
};
function Parser() {
this.nest = [];
this.compiled = [];
this.childBlocks = 0;
this.parentBlocks = 0;
this.isSilent = false
}
Parser.prototype.push = function(line) {
if (!this.isSilent) {
this.compiled.push(line)
}
};
Parser.prototype.parse = function(src) {
this.tokenize(src);
return this.compiled
};
Parser.prototype.tokenize = function(src) {
var lastEnd = 0,
parser = this,
trimLeading = false;
matchAll(src, START_TOKEN, function(open, index, src) {
var match = src.slice(index + open.length).match(TAGS[open]);
match = match ? match[0] : "";
var simplified = match.replace(STRINGS, "@");
if (!match || ~simplified.indexOf(open)) {
return index + 1
}
var inner = match.slice(0, 0 - open.length);
if (inner.charAt(0) === "-") var wsCollapseLeft = true;
if (inner.slice(-1) === "-") var wsCollapseRight = true;
inner = inner.replace(/^-|-$/g, "").trim();
if (parser.rawMode && open + inner !== "{%endraw") {
return index + 1
}
var text = src.slice(lastEnd, index);
lastEnd = index + open.length + match.length;
if (trimLeading) text = trimLeft(text);
if (wsCollapseLeft) text = trimRight(text);
if (wsCollapseRight) trimLeading = true;
if (open === "{{{") {
open = "{{";
inner += "|safe"
}
parser.textHandler(text);
parser.tokenHandler(open, inner)
});
var text = src.slice(lastEnd);
if (trimLeading) text = trimLeft(text);
this.textHandler(text)
};
Parser.prototype.textHandler = function(text) {
this.push("write(" + JSON.stringify(text) + ");")
};
Parser.prototype.tokenHandler = function(open, inner) {
var type = delimeters[open];
if (type === "directive") {
this.compileTag(inner)
} else if (type === "output") {
var extracted = this.extractEnt(inner, STRINGS, "@");
extracted.src = extracted.src.replace(/\|\|/g, "~").split("|");
extracted.src = extracted.src.map(function(part) {
return part.split("~").join("||")
});
var parts = this.injectEnt(extracted, "@");
if (parts.length > 1) {
var filters = parts.slice(1).map(this.parseFilter.bind(this));
this.push("filter(" + this.parseExpr(parts[0]) + "," + filters.join(",") + ");")
} else {
this.push("filter(" + this.parseExpr(parts[0]) + ");")
}
}
};
Parser.prototype.compileTag = function(str) {
var directive = str.split(" ")[0];
var handler = tagHandlers[directive];
if (!handler) {
throw new Error("Invalid tag: " + str)
}
handler.call(this, str.slice(directive.length).trim())
};
Parser.prototype.parseFilter = function(src) {
src = src.trim();
var match = src.match(/[:(]/);
var i = match ? match.index : -1;
if (i < 0) return JSON.stringify([src]);
var name = src.slice(0, i);
var args = src.charAt(i) === ":" ? src.slice(i + 1) : src.slice(i + 1, -1);
args = this.parseExpr(args, {
terms: true
});
return "[" + JSON.stringify(name) + "," + args + "]"
};
Parser.prototype.extractEnt = function(src, regex, placeholder) {
var subs = [],
isFunc = typeof placeholder == "function";
src = src.replace(regex, function(str) {
var replacement = isFunc ? placeholder(str) : placeholder;
if (replacement) {
subs.push(str);
return replacement
}
return str
});
return {
src: src,
subs: subs
}
};
Parser.prototype.injectEnt = function(extracted, placeholder) {
var src = extracted.src,
subs = extracted.subs,
isArr = Array.isArray(src);
var arr = isArr ? src : [src];
var re = new RegExp("[" + placeholder + "]", "g"),
i = 0;
arr.forEach(function(src, index) {
arr[index] = src.replace(re, function() {
return subs[i++]
})
});
return isArr ? arr : arr[0]
};
Parser.prototype.replaceComplex = function(s) {
var parsed = this.extractEnt(s, /i(\.i|\[[@#i]\])+/g, "v");
parsed.src = parsed.src.replace(NON_PRIMITIVES, "~");
return this.injectEnt(parsed, "v")
};
Parser.prototype.parseExpr = function(src, opts) {
opts = opts || {};
var parsed1 = this.extractEnt(src, STRINGS, "@");
parsed1.src = parsed1.src.replace(EOPS, function(s, before, op, after) {
return op in operators ? before + operators[op] + after : s
});
var parsed2 = this.extractEnt(parsed1.src, IDENTS_AND_NUMS, function(s) {
return s in constants || NUMBER.test(s) ? "#" : null
});
var parsed3 = this.extractEnt(parsed2.src, IDENTIFIERS, "i");
parsed3.src = parsed3.src.replace(/\s+/g, "");
var simplified = parsed3.src;
while (simplified !== (simplified = this.replaceComplex(simplified)));
while (simplified !== (simplified = simplified.replace(/i(\.i|\[[@#i]\])+/, "v")));
simplified = simplified.replace(/[iv]\[v?\]/g, "x");
simplified = simplified.replace(/[@#~v]/g, "i");
simplified = simplified.replace(OPERATORS, "%");
simplified = simplified.replace(/!+[i]/g, "i");
var terms = opts.terms ? simplified.split(",") : [simplified];
terms.forEach(function(term) {
while (term !== (term = term.replace(/\(i(%i)*\)/g, "i")));
if (!term.match(/^i(%i)*/)) {
throw new Error("Invalid expression: " + src + " " + term)
}
});
parsed3.src = parsed3.src.replace(VARIABLES, this.parseVar.bind(this));
parsed2.src = this.injectEnt(parsed3, "i");
parsed1.src = this.injectEnt(parsed2, "#");
return this.injectEnt(parsed1, "@")
};
Parser.prototype.parseVar = function(src) {
var args = Array.prototype.slice.call(arguments);
var str = args.pop(),
index = args.pop();
if (src === "i" && str.charAt(index + 1) === ":") {
return '"i"'
}
var parts = ['"i"'];
src.replace(ACCESSOR, function(part) {
if (part === ".i") {
parts.push('"i"')
} else if (part === "[i]") {
parts.push('get("i")')
} else {
parts.push(part.slice(1, -1))
}
});
return "get(" + parts.join(",") + ")"
};
Parser.prototype.escName = function(str) {
return str.replace(/\W/g, function(s) {
return "$" + s.charCodeAt(0).toString(16)
})
};
Parser.prototype.parseQuoted = function(str) {
if (str.charAt(0) === "'") {
str = str.slice(1, -1).replace(/\\.|"/, function(s) {
if (s === "\\'") return "'";
return s.charAt(0) === "\\" ? s : "\\" + s
});
str = '"' + str + '"'
}
return JSON.parse(str)
};
var tagHandlers = {
if: function(expr) {
this.push("if (" + this.parseExpr(expr) + ") {");
this.nest.unshift("if")
},
else: function() {
if (this.nest[0] === "for") {
this.push("}, function() {")
} else {
this.push("} else {")
}
},
elseif: function(expr) {
this.push("} else if (" + this.parseExpr(expr) + ") {")
},
endif: function() {
this.nest.shift();
this.push("}")
},
for: function(str) {
var i = str.indexOf(" in ");
var name = str.slice(0, i).trim();
var expr = str.slice(i + 4).trim();
this.push("each(" + this.parseExpr(expr) + "," + JSON.stringify(name) + ",function() {");
this.nest.unshift("for")
},
endfor: function() {
this.nest.shift();
this.push("});")
},
raw: function() {
this.rawMode = true
},
endraw: function() {
this.rawMode = false
},
set: function(stmt) {
var i = stmt.indexOf("=");
var name = stmt.slice(0, i).trim();
var expr = stmt.slice(i + 1).trim();
this.push("set(" + JSON.stringify(name) + "," + this.parseExpr(expr) + ");")
},
block: function(name) {
if (this.isParent) {
++this.parentBlocks;
var blockName = "block_" + (this.escName(name) || this.parentBlocks);
this.push("block(typeof " + blockName + ' == "function" ? ' + blockName + " : function() {")
} else if (this.hasParent) {
this.isSilent = false;
++this.childBlocks;
blockName = "block_" + (this.escName(name) || this.childBlocks);
this.push("function " + blockName + "() {")
}
this.nest.unshift("block")
},
endblock: function() {
this.nest.shift();
if (this.isParent) {
this.push("});")
} else if (this.hasParent) {
this.push("}");
this.isSilent = true
}
},
extends: function(name) {
name = this.parseQuoted(name);
var parentSrc = this.readTemplateFile(name);
this.isParent = true;
this.tokenize(parentSrc);
this.isParent = false;
this.hasParent = true;
this.isSilent = true
},
include: function(name) {
name = this.parseQuoted(name);
var incSrc = this.readTemplateFile(name);
this.isInclude = true;
this.tokenize(incSrc);
this.isInclude = false
}
};
tagHandlers.assign = tagHandlers.set;
tagHandlers.elif = tagHandlers.elseif;
var getRuntime = function runtime(data, opts) {
var defaults = {
autoEscape: "toJson"
};
var _toString = Object.prototype.toString;
var _hasOwnProperty = Object.prototype.hasOwnProperty;
var getKeys = Object.keys || function(obj) {
var keys = [];
for (var n in obj)
if (_hasOwnProperty.call(obj, n)) keys.push(n);
return keys
};
var isArray = Array.isArray || function(obj) {
return _toString.call(obj) === "[object Array]"
};
var create = Object.create || function(obj) {
function F() {}
F.prototype = obj;
return new F
};
var toString = function(val) {
if (val == null) return "";
return typeof val.toString == "function" ? val.toString() : _toString.call(val)
};
var extend = function(dest, src) {
var keys = getKeys(src);
for (var i = 0, len = keys.length; i < len; i++) {
var key = keys[i];
dest[key] = src[key]
}
return dest
};
var get = function() {
var val, n = arguments[0],
c = stack.length;
while (c--) {
val = stack[c][n];
if (typeof val != "undefined") break
}
for (var i = 1, len = arguments.length; i < len; i++) {
if (val == null) continue;
n = arguments[i];
val = _hasOwnProperty.call(val, n) ? val[n] : typeof val._get == "function" ? val[n] = val._get(n) : null
}
return val == null ? "" : val
};
var set = function(n, val) {
stack[stack.length - 1][n] = val
};
var push = function(ctx) {
stack.push(ctx || {})
};
var pop = function() {
stack.pop()
};
var write = function(str) {
output.push(str)
};
var filter = function(val) {
for (var i = 1, len = arguments.length; i < len; i++) {
var arr = arguments[i],
name = arr[0],
filter = filters[name];
if (filter) {
arr[0] = val;
val = filter.apply(data, arr)
} else {
throw new Error("Invalid filter: " + name)
}
}
if (opts.autoEscape && name !== opts.autoEscape && name !== "safe") {
val = filters[opts.autoEscape].call(data, val)
}
output.push(val)
};
var each = function(obj, loopvar, fn1, fn2) {
if (obj == null) return;
var arr = isArray(obj) ? obj : getKeys(obj),
len = arr.length;
var ctx = {
loop: {
length: len,
first: arr[0],
last: arr[len - 1]
}
};
push(ctx);
for (var i = 0; i < len; i++) {
extend(ctx.loop, {
index: i + 1,
index0: i
});
fn1(ctx[loopvar] = arr[i])
}
if (len === 0 && fn2) fn2();
pop()
};
var block = function(fn) {
push();
fn();
pop()
};
var render = function() {
return output.join("")
};
data = data || {};
opts = extend(defaults, opts || {});
var filters = extend({
html: function(val) {
return toString(val).split("&").join("&amp;").split("<").join("&lt;").split(">").join("&gt;").split('"').join("&quot;")
},
safe: function(val) {
return val
},
toJson: function(val) {
if (typeof val === "object") {
return JSON.stringify(val)
}
return toString(val)
}
}, opts.filters || {});
var stack = [create(data || {})],
output = [];
return {
get: get,
set: set,
push: push,
pop: pop,
write: write,
filter: filter,
each: each,
block: block,
render: render
}
};
var runtime;
jinja.compile = function(markup, opts) {
opts = opts || {};
var parser = new Parser;
parser.readTemplateFile = this.readTemplateFile;
var code = [];
code.push("function render($) {");
code.push("var get = $.get, set = $.set, push = $.push, pop = $.pop, write = $.write, filter = $.filter, each = $.each, block = $.block;");
code.push.apply(code, parser.parse(markup));
code.push("return $.render();");
code.push("}");
code = code.join("\n");
if (opts.runtime === false) {
var fn = new Function("data", "options", "return (" + code + ")(runtime(data, options))")
} else {
runtime = runtime || (runtime = getRuntime.toString());
fn = new Function("data", "options", "return (" + code + ")((" + runtime + ")(data, options))")
}
return {
render: fn
}
};
jinja.render = function(markup, data, opts) {
var tmpl = jinja.compile(markup);
return tmpl.render(data, opts)
};
jinja.templateFiles = [];
jinja.readTemplateFile = function(name) {
var templateFiles = this.templateFiles || [];
var templateFile = templateFiles[name];
if (templateFile == null) {
throw new Error("Template file not found: " + name)
}
return templateFile
};
function trimLeft(str) {
return str.replace(LEADING_SPACE, "")
}
function trimRight(str) {
return str.replace(TRAILING_SPACE, "")
}
function matchAll(str, reg, fn) {
reg = new RegExp(reg.source, "g" + (reg.ignoreCase ? "i" : "") + (reg.multiline ? "m" : ""));
var match;
while (match = reg.exec(str)) {
var result = fn(match[0], match.index, str);
if (typeof result == "number") {
reg.lastIndex = result
}
}
}
});
File diff suppressed because one or more lines are too long
+1809
View File
@@ -0,0 +1,1809 @@
(function(global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
typeof define === 'function' && define.amd ? define(factory) :
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.JSON5 = factory());
}(this, (function() {
'use strict';
function createCommonjsModule(fn, module) {
return module = {
exports: {}
}, fn(module, module.exports), module.exports;
}
var _global = createCommonjsModule(function(module) {
// https://github.com/zloirock/core-js/issues/86#issuecomment-115759028
var global = module.exports = typeof window != 'undefined' && window.Math == Math ?
window : typeof self != 'undefined' && self.Math == Math ? self
// eslint-disable-next-line no-new-func
:
Function('return this')();
if (typeof __g == 'number') {
__g = global;
} // eslint-disable-line no-undef
});
var _core = createCommonjsModule(function(module) {
var core = module.exports = {
version: '2.6.5'
};
if (typeof __e == 'number') {
__e = core;
} // eslint-disable-line no-undef
});
var _core_1 = _core.version;
var _isObject = function(it) {
return typeof it === 'object' ? it !== null : typeof it === 'function';
};
var _anObject = function(it) {
if (!_isObject(it)) {
throw TypeError(it + ' is not an object!');
}
return it;
};
var _fails = function(exec) {
try {
return !!exec();
} catch (e) {
return true;
}
};
// Thank's IE8 for his funny defineProperty
var _descriptors = !_fails(function() {
return Object.defineProperty({}, 'a', {
get: function() {
return 7;
}
}).a != 7;
});
var document = _global.document;
// typeof document.createElement is 'object' in old IE
var is = _isObject(document) && _isObject(document.createElement);
var _domCreate = function(it) {
return is ? document.createElement(it) : {};
};
var _ie8DomDefine = !_descriptors && !_fails(function() {
return Object.defineProperty(_domCreate('div'), 'a', {
get: function() {
return 7;
}
}).a != 7;
});
// 7.1.1 ToPrimitive(input [, PreferredType])
// instead of the ES6 spec version, we didn't implement @@toPrimitive case
// and the second argument - flag - preferred type is a string
var _toPrimitive = function(it, S) {
if (!_isObject(it)) {
return it;
}
var fn, val;
if (S && typeof(fn = it.toString) == 'function' && !_isObject(val = fn.call(it))) {
return val;
}
if (typeof(fn = it.valueOf) == 'function' && !_isObject(val = fn.call(it))) {
return val;
}
if (!S && typeof(fn = it.toString) == 'function' && !_isObject(val = fn.call(it))) {
return val;
}
throw TypeError("Can't convert object to primitive value");
};
var dP = Object.defineProperty;
var f = _descriptors ? Object.defineProperty : function defineProperty(O, P, Attributes) {
_anObject(O);
P = _toPrimitive(P, true);
_anObject(Attributes);
if (_ie8DomDefine) {
try {
return dP(O, P, Attributes);
} catch (e) {
/* empty */ }
}
if ('get' in Attributes || 'set' in Attributes) {
throw TypeError('Accessors not supported!');
}
if ('value' in Attributes) {
O[P] = Attributes.value;
}
return O;
};
var _objectDp = {
f: f
};
var _propertyDesc = function(bitmap, value) {
return {
enumerable: !(bitmap & 1),
configurable: !(bitmap & 2),
writable: !(bitmap & 4),
value: value
};
};
var _hide = _descriptors ? function(object, key, value) {
return _objectDp.f(object, key, _propertyDesc(1, value));
} : function(object, key, value) {
object[key] = value;
return object;
};
var hasOwnProperty = {}.hasOwnProperty;
var _has = function(it, key) {
return hasOwnProperty.call(it, key);
};
var id = 0;
var px = Math.random();
var _uid = function(key) {
return 'Symbol('.concat(key === undefined ? '' : key, ')_', (++id + px).toString(36));
};
var _library = false;
var _shared = createCommonjsModule(function(module) {
var SHARED = '__core-js_shared__';
var store = _global[SHARED] || (_global[SHARED] = {});
(module.exports = function(key, value) {
return store[key] || (store[key] = value !== undefined ? value : {});
})('versions', []).push({
version: _core.version,
mode: _library ? 'pure' : 'global',
copyright: '© 2019 Denis Pushkarev (zloirock.ru)'
});
});
var _functionToString = _shared('native-function-to-string', Function.toString);
var _redefine = createCommonjsModule(function(module) {
var SRC = _uid('src');
var TO_STRING = 'toString';
var TPL = ('' + _functionToString).split(TO_STRING);
_core.inspectSource = function(it) {
return _functionToString.call(it);
};
(module.exports = function(O, key, val, safe) {
var isFunction = typeof val == 'function';
if (isFunction) {
_has(val, 'name') || _hide(val, 'name', key);
}
if (O[key] === val) {
return;
}
if (isFunction) {
_has(val, SRC) || _hide(val, SRC, O[key] ? '' + O[key] : TPL.join(String(key)));
}
if (O === _global) {
O[key] = val;
} else if (!safe) {
delete O[key];
_hide(O, key, val);
} else if (O[key]) {
O[key] = val;
} else {
_hide(O, key, val);
}
// add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative
})(Function.prototype, TO_STRING, function toString() {
return typeof this == 'function' && this[SRC] || _functionToString.call(this);
});
});
var _aFunction = function(it) {
if (typeof it != 'function') {
throw TypeError(it + ' is not a function!');
}
return it;
};
// optional / simple context binding
var _ctx = function(fn, that, length) {
_aFunction(fn);
if (that === undefined) {
return fn;
}
switch (length) {
case 1:
return function(a) {
return fn.call(that, a);
};
case 2:
return function(a, b) {
return fn.call(that, a, b);
};
case 3:
return function(a, b, c) {
return fn.call(that, a, b, c);
};
}
return function( /* ...args */ ) {
return fn.apply(that, arguments);
};
};
var PROTOTYPE = 'prototype';
var $export = function(type, name, source) {
var IS_FORCED = type & $export.F;
var IS_GLOBAL = type & $export.G;
var IS_STATIC = type & $export.S;
var IS_PROTO = type & $export.P;
var IS_BIND = type & $export.B;
var target = IS_GLOBAL ? _global : IS_STATIC ? _global[name] || (_global[name] = {}) : (_global[name] || {})[PROTOTYPE];
var exports = IS_GLOBAL ? _core : _core[name] || (_core[name] = {});
var expProto = exports[PROTOTYPE] || (exports[PROTOTYPE] = {});
var key, own, out, exp;
if (IS_GLOBAL) {
source = name;
}
for (key in source) {
// contains in native
own = !IS_FORCED && target && target[key] !== undefined;
// export native or passed
out = (own ? target : source)[key];
// bind timers to global for call from export context
exp = IS_BIND && own ? _ctx(out, _global) : IS_PROTO && typeof out == 'function' ? _ctx(Function.call, out) : out;
// extend global
if (target) {
_redefine(target, key, out, type & $export.U);
}
// export
if (exports[key] != out) {
_hide(exports, key, exp);
}
if (IS_PROTO && expProto[key] != out) {
expProto[key] = out;
}
}
};
_global.core = _core;
// type bitmap
$export.F = 1; // forced
$export.G = 2; // global
$export.S = 4; // static
$export.P = 8; // proto
$export.B = 16; // bind
$export.W = 32; // wrap
$export.U = 64; // safe
$export.R = 128; // real proto method for `library`
var _export = $export;
// 7.1.4 ToInteger
var ceil = Math.ceil;
var floor = Math.floor;
var _toInteger = function(it) {
return isNaN(it = +it) ? 0 : (it > 0 ? floor : ceil)(it);
};
// 7.2.1 RequireObjectCoercible(argument)
var _defined = function(it) {
if (it == undefined) {
throw TypeError("Can't call method on " + it);
}
return it;
};
// true -> String#at
// false -> String#codePointAt
var _stringAt = function(TO_STRING) {
return function(that, pos) {
var s = String(_defined(that));
var i = _toInteger(pos);
var l = s.length;
var a, b;
if (i < 0 || i >= l) {
return TO_STRING ? '' : undefined;
}
a = s.charCodeAt(i);
return a < 0xd800 || a > 0xdbff || i + 1 === l || (b = s.charCodeAt(i + 1)) < 0xdc00 || b > 0xdfff ?
TO_STRING ? s.charAt(i) : a :
TO_STRING ? s.slice(i, i + 2) : (a - 0xd800 << 10) + (b - 0xdc00) + 0x10000;
};
};
var $at = _stringAt(false);
_export(_export.P, 'String', {
// 21.1.3.3 String.prototype.codePointAt(pos)
codePointAt: function codePointAt(pos) {
return $at(this, pos);
}
});
var codePointAt = _core.String.codePointAt;
var max = Math.max;
var min = Math.min;
var _toAbsoluteIndex = function(index, length) {
index = _toInteger(index);
return index < 0 ? max(index + length, 0) : min(index, length);
};
var fromCharCode = String.fromCharCode;
var $fromCodePoint = String.fromCodePoint;
// length should be 1, old FF problem
_export(_export.S + _export.F * (!!$fromCodePoint && $fromCodePoint.length != 1), 'String', {
// 21.1.2.2 String.fromCodePoint(...codePoints)
fromCodePoint: function fromCodePoint(x) {
var arguments$1 = arguments;
// eslint-disable-line no-unused-vars
var res = [];
var aLen = arguments.length;
var i = 0;
var code;
while (aLen > i) {
code = +arguments$1[i++];
if (_toAbsoluteIndex(code, 0x10ffff) !== code) {
throw RangeError(code + ' is not a valid code point');
}
res.push(code < 0x10000 ?
fromCharCode(code) :
fromCharCode(((code -= 0x10000) >> 10) + 0xd800, code % 0x400 + 0xdc00)
);
}
return res.join('');
}
});
var fromCodePoint = _core.String.fromCodePoint;
// This is a generated file. Do not edit.
var Space_Separator = /[\u1680\u2000-\u200A\u202F\u205F\u3000]/;
var ID_Start = /[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312E\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEA\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDF00-\uDF19]|\uD806[\uDCA0-\uDCDF\uDCFF\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE83\uDE86-\uDE89\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50\uDF93-\uDF9F\uDFE0\uDFE1]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]/;
var ID_Continue = /[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u08D4-\u08E1\u08E3-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u09FC\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0AF9-\u0AFF\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C66-\u0C6F\u0C80-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D00-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D54-\u0D57\u0D5F-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u135F\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19D9\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1CD0-\u1CD2\u1CD4-\u1CF9\u1D00-\u1DF9\u1DFB-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u2E2F\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099\u309A\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312E\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEA\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA8FD\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDDFD\uDE80-\uDE9C\uDEA0-\uDED0\uDEE0\uDF00-\uDF1F\uDF2D-\uDF4A\uDF50-\uDF7A\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE38-\uDE3A\uDE3F\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE6\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC00-\uDC46\uDC66-\uDC6F\uDC7F-\uDCBA\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD00-\uDD34\uDD36-\uDD3F\uDD50-\uDD73\uDD76\uDD80-\uDDC4\uDDCA-\uDDCC\uDDD0-\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE37\uDE3E\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEEA\uDEF0-\uDEF9\uDF00-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3C-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF50\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC00-\uDC4A\uDC50-\uDC59\uDC80-\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDB5\uDDB8-\uDDC0\uDDD8-\uDDDD\uDE00-\uDE40\uDE44\uDE50-\uDE59\uDE80-\uDEB7\uDEC0-\uDEC9\uDF00-\uDF19\uDF1D-\uDF2B\uDF30-\uDF39]|\uD806[\uDCA0-\uDCE9\uDCFF\uDE00-\uDE3E\uDE47\uDE50-\uDE83\uDE86-\uDE99\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC36\uDC38-\uDC40\uDC50-\uDC59\uDC72-\uDC8F\uDC92-\uDCA7\uDCA9-\uDCB6\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD47\uDD50-\uDD59]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDEF0-\uDEF4\uDF00-\uDF36\uDF40-\uDF43\uDF50-\uDF59\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50-\uDF7E\uDF8F-\uDF9F\uDFE0\uDFE1]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A]|\uD83A[\uDC00-\uDCC4\uDCD0-\uDCD6\uDD00-\uDD4A\uDD50-\uDD59]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uDB40[\uDD00-\uDDEF]/;
var unicode = {
Space_Separator: Space_Separator,
ID_Start: ID_Start,
ID_Continue: ID_Continue
};
var util = {
isSpaceSeparator: function isSpaceSeparator(c) {
return typeof c === 'string' && unicode.Space_Separator.test(c)
},
isIdStartChar: function isIdStartChar(c) {
return typeof c === 'string' && (
(c >= 'a' && c <= 'z') ||
(c >= 'A' && c <= 'Z') ||
(c === '$') || (c === '_') ||
unicode.ID_Start.test(c)
)
},
isIdContinueChar: function isIdContinueChar(c) {
return typeof c === 'string' && (
(c >= 'a' && c <= 'z') ||
(c >= 'A' && c <= 'Z') ||
(c >= '0' && c <= '9') ||
(c === '$') || (c === '_') ||
(c === '\u200C') || (c === '\u200D') ||
unicode.ID_Continue.test(c)
)
},
isDigit: function isDigit(c) {
return typeof c === 'string' && /[0-9]/.test(c)
},
isHexDigit: function isHexDigit(c) {
return typeof c === 'string' && /[0-9A-Fa-f]/.test(c)
},
};
var source;
var parseState;
var stack;
var pos;
var line;
var column;
var token;
var key;
var root;
var parse = function parse(text, reviver) {
source = String(text);
parseState = 'start';
stack = [];
pos = 0;
line = 1;
column = 0;
token = undefined;
key = undefined;
root = undefined;
do {
token = lex();
// This code is unreachable.
// if (!parseStates[parseState]) {
// throw invalidParseState()
// }
parseStates[parseState]();
} while (token.type !== 'eof')
if (typeof reviver === 'function') {
return internalize({
'': root
}, '', reviver)
}
return root
};
function internalize(holder, name, reviver) {
var value = holder[name];
if (value != null && typeof value === 'object') {
if (Array.isArray(value)) {
for (var i = 0; i < value.length; i++) {
var key = String(i);
var replacement = internalize(value, key, reviver);
if (replacement === undefined) {
delete value[key];
} else {
Object.defineProperty(value, key, {
value: replacement,
writable: true,
enumerable: true,
configurable: true,
});
}
}
} else {
for (var key$1 in value) {
var replacement$1 = internalize(value, key$1, reviver);
if (replacement$1 === undefined) {
delete value[key$1];
} else {
Object.defineProperty(value, key$1, {
value: replacement$1,
writable: true,
enumerable: true,
configurable: true,
});
}
}
}
}
return reviver.call(holder, name, value)
}
var lexState;
var buffer;
var doubleQuote;
var sign;
var c;
function lex() {
lexState = 'default';
buffer = '';
doubleQuote = false;
sign = 1;
for (;;) {
c = peek();
// This code is unreachable.
// if (!lexStates[lexState]) {
// throw invalidLexState(lexState)
// }
var token = lexStates[lexState]();
if (token) {
return token
}
}
}
function peek() {
if (source[pos]) {
return String.fromCodePoint(source.codePointAt(pos))
}
}
function read() {
var c = peek();
if (c === '\n') {
line++;
column = 0;
} else if (c) {
column += c.length;
} else {
column++;
}
if (c) {
pos += c.length;
}
return c
}
var lexStates = {
default: function default$1() {
switch (c) {
case '\t':
case '\v':
case '\f':
case ' ':
case '\u00A0':
case '\uFEFF':
case '\n':
case '\r':
case '\u2028':
case '\u2029':
read();
return
case '/':
read();
lexState = 'comment';
return
case undefined:
read();
return newToken('eof')
}
if (util.isSpaceSeparator(c)) {
read();
return
}
// This code is unreachable.
// if (!lexStates[parseState]) {
// throw invalidLexState(parseState)
// }
return lexStates[parseState]()
},
comment: function comment() {
switch (c) {
case '*':
read();
lexState = 'multiLineComment';
return
case '/':
read();
lexState = 'singleLineComment';
return
}
throw invalidChar(read())
},
multiLineComment: function multiLineComment() {
switch (c) {
case '*':
read();
lexState = 'multiLineCommentAsterisk';
return
case undefined:
throw invalidChar(read())
}
read();
},
multiLineCommentAsterisk: function multiLineCommentAsterisk() {
switch (c) {
case '*':
read();
return
case '/':
read();
lexState = 'default';
return
case undefined:
throw invalidChar(read())
}
read();
lexState = 'multiLineComment';
},
singleLineComment: function singleLineComment() {
switch (c) {
case '\n':
case '\r':
case '\u2028':
case '\u2029':
read();
lexState = 'default';
return
case undefined:
read();
return newToken('eof')
}
read();
},
value: function value() {
switch (c) {
case '{':
case '[':
return newToken('punctuator', read())
case 'n':
read();
literal('ull');
return newToken('null', null)
case 't':
read();
literal('rue');
return newToken('boolean', true)
case 'f':
read();
literal('alse');
return newToken('boolean', false)
case '-':
case '+':
if (read() === '-') {
sign = -1;
}
lexState = 'sign';
return
case '.':
buffer = read();
lexState = 'decimalPointLeading';
return
case '0':
buffer = read();
lexState = 'zero';
return
case '1':
case '2':
case '3':
case '4':
case '5':
case '6':
case '7':
case '8':
case '9':
buffer = read();
lexState = 'decimalInteger';
return
case 'I':
read();
literal('nfinity');
return newToken('numeric', Infinity)
case 'N':
read();
literal('aN');
return newToken('numeric', NaN)
case '"':
case "'":
doubleQuote = (read() === '"');
buffer = '';
lexState = 'string';
return
}
throw invalidChar(read())
},
identifierNameStartEscape: function identifierNameStartEscape() {
if (c !== 'u') {
throw invalidChar(read())
}
read();
var u = unicodeEscape();
switch (u) {
case '$':
case '_':
break
default:
if (!util.isIdStartChar(u)) {
throw invalidIdentifier()
}
break
}
buffer += u;
lexState = 'identifierName';
},
identifierName: function identifierName() {
switch (c) {
case '$':
case '_':
case '\u200C':
case '\u200D':
buffer += read();
return
case '\\':
read();
lexState = 'identifierNameEscape';
return
}
if (util.isIdContinueChar(c)) {
buffer += read();
return
}
return newToken('identifier', buffer)
},
identifierNameEscape: function identifierNameEscape() {
if (c !== 'u') {
throw invalidChar(read())
}
read();
var u = unicodeEscape();
switch (u) {
case '$':
case '_':
case '\u200C':
case '\u200D':
break
default:
if (!util.isIdContinueChar(u)) {
throw invalidIdentifier()
}
break
}
buffer += u;
lexState = 'identifierName';
},
sign: function sign$1() {
switch (c) {
case '.':
buffer = read();
lexState = 'decimalPointLeading';
return
case '0':
buffer = read();
lexState = 'zero';
return
case '1':
case '2':
case '3':
case '4':
case '5':
case '6':
case '7':
case '8':
case '9':
buffer = read();
lexState = 'decimalInteger';
return
case 'I':
read();
literal('nfinity');
return newToken('numeric', sign * Infinity)
case 'N':
read();
literal('aN');
return newToken('numeric', NaN)
}
throw invalidChar(read())
},
zero: function zero() {
switch (c) {
case '.':
buffer += read();
lexState = 'decimalPoint';
return
case 'e':
case 'E':
buffer += read();
lexState = 'decimalExponent';
return
case 'x':
case 'X':
buffer += read();
lexState = 'hexadecimal';
return
}
return newToken('numeric', sign * 0)
},
decimalInteger: function decimalInteger() {
switch (c) {
case '.':
buffer += read();
lexState = 'decimalPoint';
return
case 'e':
case 'E':
buffer += read();
lexState = 'decimalExponent';
return
}
if (util.isDigit(c)) {
buffer += read();
return
}
return newToken('numeric', sign * Number(buffer))
},
decimalPointLeading: function decimalPointLeading() {
if (util.isDigit(c)) {
buffer += read();
lexState = 'decimalFraction';
return
}
throw invalidChar(read())
},
decimalPoint: function decimalPoint() {
switch (c) {
case 'e':
case 'E':
buffer += read();
lexState = 'decimalExponent';
return
}
if (util.isDigit(c)) {
buffer += read();
lexState = 'decimalFraction';
return
}
return newToken('numeric', sign * Number(buffer))
},
decimalFraction: function decimalFraction() {
switch (c) {
case 'e':
case 'E':
buffer += read();
lexState = 'decimalExponent';
return
}
if (util.isDigit(c)) {
buffer += read();
return
}
return newToken('numeric', sign * Number(buffer))
},
decimalExponent: function decimalExponent() {
switch (c) {
case '+':
case '-':
buffer += read();
lexState = 'decimalExponentSign';
return
}
if (util.isDigit(c)) {
buffer += read();
lexState = 'decimalExponentInteger';
return
}
throw invalidChar(read())
},
decimalExponentSign: function decimalExponentSign() {
if (util.isDigit(c)) {
buffer += read();
lexState = 'decimalExponentInteger';
return
}
throw invalidChar(read())
},
decimalExponentInteger: function decimalExponentInteger() {
if (util.isDigit(c)) {
buffer += read();
return
}
return newToken('numeric', sign * Number(buffer))
},
hexadecimal: function hexadecimal() {
if (util.isHexDigit(c)) {
buffer += read();
lexState = 'hexadecimalInteger';
return
}
throw invalidChar(read())
},
hexadecimalInteger: function hexadecimalInteger() {
if (util.isHexDigit(c)) {
buffer += read();
return
}
return newToken('numeric', sign * Number(buffer))
},
string: function string() {
switch (c) {
case '\\':
read();
buffer += escape();
return
case '"':
if (doubleQuote) {
read();
return newToken('string', buffer)
}
buffer += read();
return
case "'":
if (!doubleQuote) {
read();
return newToken('string', buffer)
}
buffer += read();
return
case '\n':
case '\r':
throw invalidChar(read())
case '\u2028':
case '\u2029':
separatorChar(c);
break
case undefined:
throw invalidChar(read())
}
buffer += read();
},
start: function start() {
switch (c) {
case '{':
case '[':
return newToken('punctuator', read())
// This code is unreachable since the default lexState handles eof.
// case undefined:
// return newToken('eof')
}
lexState = 'value';
},
beforePropertyName: function beforePropertyName() {
switch (c) {
case '$':
case '_':
buffer = read();
lexState = 'identifierName';
return
case '\\':
read();
lexState = 'identifierNameStartEscape';
return
case '}':
return newToken('punctuator', read())
case '"':
case "'":
doubleQuote = (read() === '"');
lexState = 'string';
return
}
if (util.isIdStartChar(c)) {
buffer += read();
lexState = 'identifierName';
return
}
throw invalidChar(read())
},
afterPropertyName: function afterPropertyName() {
if (c === ':') {
return newToken('punctuator', read())
}
throw invalidChar(read())
},
beforePropertyValue: function beforePropertyValue() {
lexState = 'value';
},
afterPropertyValue: function afterPropertyValue() {
switch (c) {
case ',':
case '}':
return newToken('punctuator', read())
}
throw invalidChar(read())
},
beforeArrayValue: function beforeArrayValue() {
if (c === ']') {
return newToken('punctuator', read())
}
lexState = 'value';
},
afterArrayValue: function afterArrayValue() {
switch (c) {
case ',':
case ']':
return newToken('punctuator', read())
}
throw invalidChar(read())
},
end: function end() {
// This code is unreachable since it's handled by the default lexState.
// if (c === undefined) {
// read()
// return newToken('eof')
// }
throw invalidChar(read())
},
};
function newToken(type, value) {
return {
type: type,
value: value,
line: line,
column: column,
}
}
function literal(s) {
for (var i = 0, list = s; i < list.length; i += 1) {
var c = list[i];
var p = peek();
if (p !== c) {
throw invalidChar(read())
}
read();
}
}
function escape() {
var c = peek();
switch (c) {
case 'b':
read();
return '\b'
case 'f':
read();
return '\f'
case 'n':
read();
return '\n'
case 'r':
read();
return '\r'
case 't':
read();
return '\t'
case 'v':
read();
return '\v'
case '0':
read();
if (util.isDigit(peek())) {
throw invalidChar(read())
}
return '\0'
case 'x':
read();
return hexEscape()
case 'u':
read();
return unicodeEscape()
case '\n':
case '\u2028':
case '\u2029':
read();
return ''
case '\r':
read();
if (peek() === '\n') {
read();
}
return ''
case '1':
case '2':
case '3':
case '4':
case '5':
case '6':
case '7':
case '8':
case '9':
throw invalidChar(read())
case undefined:
throw invalidChar(read())
}
return read()
}
function hexEscape() {
var buffer = '';
var c = peek();
if (!util.isHexDigit(c)) {
throw invalidChar(read())
}
buffer += read();
c = peek();
if (!util.isHexDigit(c)) {
throw invalidChar(read())
}
buffer += read();
return String.fromCodePoint(parseInt(buffer, 16))
}
function unicodeEscape() {
var buffer = '';
var count = 4;
while (count-- > 0) {
var c = peek();
if (!util.isHexDigit(c)) {
throw invalidChar(read())
}
buffer += read();
}
return String.fromCodePoint(parseInt(buffer, 16))
}
var parseStates = {
start: function start() {
if (token.type === 'eof') {
throw invalidEOF()
}
push();
},
beforePropertyName: function beforePropertyName() {
switch (token.type) {
case 'identifier':
case 'string':
key = token.value;
parseState = 'afterPropertyName';
return
case 'punctuator':
// This code is unreachable since it's handled by the lexState.
// if (token.value !== '}') {
// throw invalidToken()
// }
pop();
return
case 'eof':
throw invalidEOF()
}
// This code is unreachable since it's handled by the lexState.
// throw invalidToken()
},
afterPropertyName: function afterPropertyName() {
// This code is unreachable since it's handled by the lexState.
// if (token.type !== 'punctuator' || token.value !== ':') {
// throw invalidToken()
// }
if (token.type === 'eof') {
throw invalidEOF()
}
parseState = 'beforePropertyValue';
},
beforePropertyValue: function beforePropertyValue() {
if (token.type === 'eof') {
throw invalidEOF()
}
push();
},
beforeArrayValue: function beforeArrayValue() {
if (token.type === 'eof') {
throw invalidEOF()
}
if (token.type === 'punctuator' && token.value === ']') {
pop();
return
}
push();
},
afterPropertyValue: function afterPropertyValue() {
// This code is unreachable since it's handled by the lexState.
// if (token.type !== 'punctuator') {
// throw invalidToken()
// }
if (token.type === 'eof') {
throw invalidEOF()
}
switch (token.value) {
case ',':
parseState = 'beforePropertyName';
return
case '}':
pop();
}
// This code is unreachable since it's handled by the lexState.
// throw invalidToken()
},
afterArrayValue: function afterArrayValue() {
// This code is unreachable since it's handled by the lexState.
// if (token.type !== 'punctuator') {
// throw invalidToken()
// }
if (token.type === 'eof') {
throw invalidEOF()
}
switch (token.value) {
case ',':
parseState = 'beforeArrayValue';
return
case ']':
pop();
}
// This code is unreachable since it's handled by the lexState.
// throw invalidToken()
},
end: function end() {
// This code is unreachable since it's handled by the lexState.
// if (token.type !== 'eof') {
// throw invalidToken()
// }
},
};
function push() {
var value;
switch (token.type) {
case 'punctuator':
switch (token.value) {
case '{':
value = {};
break
case '[':
value = [];
break
}
break
case 'null':
case 'boolean':
case 'numeric':
case 'string':
value = token.value;
break
// This code is unreachable.
// default:
// throw invalidToken()
}
if (root === undefined) {
root = value;
} else {
var parent = stack[stack.length - 1];
if (Array.isArray(parent)) {
parent.push(value);
} else {
Object.defineProperty(parent, key, {
value: value,
writable: true,
enumerable: true,
configurable: true,
});
}
}
if (value !== null && typeof value === 'object') {
stack.push(value);
if (Array.isArray(value)) {
parseState = 'beforeArrayValue';
} else {
parseState = 'beforePropertyName';
}
} else {
var current = stack[stack.length - 1];
if (current == null) {
parseState = 'end';
} else if (Array.isArray(current)) {
parseState = 'afterArrayValue';
} else {
parseState = 'afterPropertyValue';
}
}
}
function pop() {
stack.pop();
var current = stack[stack.length - 1];
if (current == null) {
parseState = 'end';
} else if (Array.isArray(current)) {
parseState = 'afterArrayValue';
} else {
parseState = 'afterPropertyValue';
}
}
// This code is unreachable.
// function invalidParseState () {
// return new Error(`JSON5: invalid parse state '${parseState}'`)
// }
// This code is unreachable.
// function invalidLexState (state) {
// return new Error(`JSON5: invalid lex state '${state}'`)
// }
function invalidChar(c) {
if (c === undefined) {
return syntaxError(("JSON5: invalid end of input at " + line + ":" + column))
}
return syntaxError(("JSON5: invalid character '" + (formatChar(c)) + "' at " + line + ":" + column))
}
function invalidEOF() {
return syntaxError(("JSON5: invalid end of input at " + line + ":" + column))
}
// This code is unreachable.
// function invalidToken () {
// if (token.type === 'eof') {
// return syntaxError(`JSON5: invalid end of input at ${line}:${column}`)
// }
// const c = String.fromCodePoint(token.value.codePointAt(0))
// return syntaxError(`JSON5: invalid character '${formatChar(c)}' at ${line}:${column}`)
// }
function invalidIdentifier() {
column -= 5;
return syntaxError(("JSON5: invalid identifier character at " + line + ":" + column))
}
function separatorChar(c) {
console.warn(("JSON5: '" + (formatChar(c)) + "' in strings is not valid ECMAScript; consider escaping"));
}
function formatChar(c) {
var replacements = {
"'": "\\'",
'"': '\\"',
'\\': '\\\\',
'\b': '\\b',
'\f': '\\f',
'\n': '\\n',
'\r': '\\r',
'\t': '\\t',
'\v': '\\v',
'\0': '\\0',
'\u2028': '\\u2028',
'\u2029': '\\u2029',
};
if (replacements[c]) {
return replacements[c]
}
if (c < ' ') {
var hexString = c.charCodeAt(0).toString(16);
return '\\x' + ('00' + hexString).substring(hexString.length)
}
return c
}
function syntaxError(message) {
var err = new SyntaxError(message);
err.lineNumber = line;
err.columnNumber = column;
return err
}
var stringify = function stringify(value, replacer, space) {
var stack = [];
var indent = '';
var propertyList;
var replacerFunc;
var gap = '';
var quote;
if (
replacer != null &&
typeof replacer === 'object' &&
!Array.isArray(replacer)
) {
space = replacer.space;
quote = replacer.quote;
replacer = replacer.replacer;
}
if (typeof replacer === 'function') {
replacerFunc = replacer;
} else if (Array.isArray(replacer)) {
propertyList = [];
for (var i = 0, list = replacer; i < list.length; i += 1) {
var v = list[i];
var item = (void 0);
if (typeof v === 'string') {
item = v;
} else if (
typeof v === 'number' ||
v instanceof String ||
v instanceof Number
) {
item = String(v);
}
if (item !== undefined && propertyList.indexOf(item) < 0) {
propertyList.push(item);
}
}
}
if (space instanceof Number) {
space = Number(space);
} else if (space instanceof String) {
space = String(space);
}
if (typeof space === 'number') {
if (space > 0) {
space = Math.min(10, Math.floor(space));
gap = ' '.substr(0, space);
}
} else if (typeof space === 'string') {
gap = space.substr(0, 10);
}
return serializeProperty('', {
'': value
})
function serializeProperty(key, holder) {
var value = holder[key];
if (value != null) {
if (typeof value.toJSON5 === 'function') {
value = value.toJSON5(key);
} else if (typeof value.toJSON === 'function') {
value = value.toJSON(key);
}
}
if (replacerFunc) {
value = replacerFunc.call(holder, key, value);
}
if (value instanceof Number) {
value = Number(value);
} else if (value instanceof String) {
value = String(value);
} else if (value instanceof Boolean) {
value = value.valueOf();
}
switch (value) {
case null:
return 'null'
case true:
return 'true'
case false:
return 'false'
}
if (typeof value === 'string') {
return quoteString(value, false)
}
if (typeof value === 'number') {
return String(value)
}
if (typeof value === 'object') {
return Array.isArray(value) ? serializeArray(value) : serializeObject(value)
}
return undefined
}
function quoteString(value) {
var quotes = {
"'": 0.1,
'"': 0.2,
};
var replacements = {
"'": "\\'",
'"': '\\"',
'\\': '\\\\',
'\b': '\\b',
'\f': '\\f',
'\n': '\\n',
'\r': '\\r',
'\t': '\\t',
'\v': '\\v',
'\0': '\\0',
'\u2028': '\\u2028',
'\u2029': '\\u2029',
};
var product = '';
for (var i = 0; i < value.length; i++) {
var c = value[i];
switch (c) {
case "'":
case '"':
quotes[c]++;
product += c;
continue
case '\0':
if (util.isDigit(value[i + 1])) {
product += '\\x00';
continue
}
}
if (replacements[c]) {
product += replacements[c];
continue
}
if (c < ' ') {
var hexString = c.charCodeAt(0).toString(16);
product += '\\x' + ('00' + hexString).substring(hexString.length);
continue
}
product += c;
}
var quoteChar = quote || Object.keys(quotes).reduce(function(a, b) {
return (quotes[a] < quotes[b]) ? a : b;
});
product = product.replace(new RegExp(quoteChar, 'g'), replacements[quoteChar]);
return quoteChar + product + quoteChar
}
function serializeObject(value) {
if (stack.indexOf(value) >= 0) {
throw TypeError('Converting circular structure to JSON5')
}
stack.push(value);
var stepback = indent;
indent = indent + gap;
var keys = propertyList || Object.keys(value);
var partial = [];
for (var i = 0, list = keys; i < list.length; i += 1) {
var key = list[i];
var propertyString = serializeProperty(key, value);
if (propertyString !== undefined) {
var member = serializeKey(key) + ':';
if (gap !== '') {
member += ' ';
}
member += propertyString;
partial.push(member);
}
}
var final;
if (partial.length === 0) {
final = '{}';
} else {
var properties;
if (gap === '') {
properties = partial.join(',');
final = '{' + properties + '}';
} else {
var separator = ',\n' + indent;
properties = partial.join(separator);
final = '{\n' + indent + properties + ',\n' + stepback + '}';
}
}
stack.pop();
indent = stepback;
return final
}
function serializeKey(key) {
if (key.length === 0) {
return quoteString(key, true)
}
var firstChar = String.fromCodePoint(key.codePointAt(0));
if (!util.isIdStartChar(firstChar)) {
return quoteString(key, true)
}
for (var i = firstChar.length; i < key.length; i++) {
if (!util.isIdContinueChar(String.fromCodePoint(key.codePointAt(i)))) {
return quoteString(key, true)
}
}
return key
}
function serializeArray(value) {
if (stack.indexOf(value) >= 0) {
throw TypeError('Converting circular structure to JSON5')
}
stack.push(value);
var stepback = indent;
indent = indent + gap;
var partial = [];
for (var i = 0; i < value.length; i++) {
var propertyString = serializeProperty(String(i), value);
partial.push((propertyString !== undefined) ? propertyString : 'null');
}
var final;
if (partial.length === 0) {
final = '[]';
} else {
if (gap === '') {
var properties = partial.join(',');
final = '[' + properties + ']';
} else {
var separator = ',\n' + indent;
var properties$1 = partial.join(separator);
final = '[\n' + indent + properties$1 + ',\n' + stepback + ']';
}
}
stack.pop();
indent = stepback;
return final
}
};
var JSON5 = {
parse: parse,
stringify: stringify,
};
var lib = JSON5;
var es5 = lib;
return es5;
})));
+1277
View File
@@ -0,0 +1,1277 @@
! function(e, t) {
"object" == typeof exports && "undefined" != typeof module ? t(exports) : "function" == typeof define && define.amd ? define(["exports"], t) : t((e = "undefined" != typeof globalThis ? globalThis : e || self).JSONPath = {})
}(this, function(e) {
"use strict";
function n(e, t, r) {
return t = l(t),
function(e, t) {
{
if (t && ("object" == typeof t || "function" == typeof t)) return t;
if (void 0 !== t) throw new TypeError("Derived constructors may only return object or undefined")
}
return function(e) {
if (void 0 !== e) return e;
throw new ReferenceError("this hasn't been initialised - super() hasn't been called")
}(e)
}(e, i() ? Reflect.construct(t, r || [], l(e).constructor) : t.apply(e, r))
}
function o(e, t, r) {
if (i()) return Reflect.construct.apply(null, arguments);
var n = [null];
n.push.apply(n, t);
n = new(e.bind.apply(e, n));
return r && h(n, r.prototype), n
}
function i() {
try {
var e = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}))
} catch (e) {}
return (i = function() {
return !!e
})()
}
function t(t, e) {
var r, n = Object.keys(t);
return Object.getOwnPropertySymbols && (r = Object.getOwnPropertySymbols(t), e && (r = r.filter(function(e) {
return Object.getOwnPropertyDescriptor(t, e).enumerable
})), n.push.apply(n, r)), n
}
function r(n) {
for (var e = 1; e < arguments.length; e++) {
var i = null != arguments[e] ? arguments[e] : {};
e % 2 ? t(Object(i), !0).forEach(function(e) {
var t, r;
t = n, e = i[r = e], (r = a(r)) in t ? Object.defineProperty(t, r, {
value: e,
enumerable: !0,
configurable: !0,
writable: !0
}) : t[r] = e
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(n, Object.getOwnPropertyDescriptors(i)) : t(Object(i)).forEach(function(e) {
Object.defineProperty(n, e, Object.getOwnPropertyDescriptor(i, e))
})
}
return n
}
function a(e) {
e = function(e, t) {
if ("object" != typeof e || !e) return e;
var r = e[Symbol.toPrimitive];
if (void 0 === r) return ("string" === t ? String : Number)(e);
if ("object" != typeof(t = r.call(e, t || "default"))) return t;
throw new TypeError("@@toPrimitive must return a primitive value.")
}(e, "string");
return "symbol" == typeof e ? e : e + ""
}
function C(e) {
return (C = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(e) {
return typeof e
} : function(e) {
return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e
})(e)
}
function s(e, t) {
if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
}
function u(e, t) {
for (var r = 0; r < t.length; r++) {
var n = t[r];
n.enumerable = n.enumerable || !1, n.configurable = !0, "value" in n && (n.writable = !0), Object.defineProperty(e, a(n.key), n)
}
}
function c(e, t, r) {
return t && u(e.prototype, t), r && u(e, r), Object.defineProperty(e, "prototype", {
writable: !1
}), e
}
function l(e) {
return (l = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function(e) {
return e.__proto__ || Object.getPrototypeOf(e)
})(e)
}
function h(e, t) {
return (h = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(e, t) {
return e.__proto__ = t, e
})(e, t)
}
function p(e) {
var r = "function" == typeof Map ? new Map : void 0;
return (p = function(e) {
if (null === e || ! function(t) {
try {
return -1 !== Function.toString.call(t).indexOf("[native code]")
} catch (e) {
return "function" == typeof t
}
}(e)) return e;
if ("function" != typeof e) throw new TypeError("Super expression must either be null or a function");
if (void 0 !== r) {
if (r.has(e)) return r.get(e);
r.set(e, t)
}
function t() {
return o(e, arguments, l(this).constructor)
}
return t.prototype = Object.create(e.prototype, {
constructor: {
value: t,
enumerable: !1,
writable: !0,
configurable: !0
}
}), h(t, e)
})(e)
}
function f(e) {
return function(e) {
if (Array.isArray(e)) return d(e)
}(e) || function(e) {
if ("undefined" != typeof Symbol && null != e[Symbol.iterator] || null != e["@@iterator"]) return Array.from(e)
}(e) || O(e) || function() {
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")
}()
}
function O(e, t) {
if (e) {
if ("string" == typeof e) return d(e, t);
var r = Object.prototype.toString.call(e).slice(8, -1);
return "Object" === r && e.constructor && (r = e.constructor.name), "Map" === r || "Set" === r ? Array.from(e) : "Arguments" === r || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r) ? d(e, t) : void 0
}
}
function d(e, t) {
(null == t || t > e.length) && (t = e.length);
for (var r = 0, n = new Array(t); r < t; r++) n[r] = e[r];
return n
}
var y = function() {
return c(function e() {
s(this, e)
}, [{
key: "add",
value: function(e, t, r) {
if ("string" != typeof e)
for (var n in e) this.add(n, e[n], t);
else(Array.isArray(e) ? e : [e]).forEach(function(e) {
this[e] = this[e] || [], t && this[e][r ? "unshift" : "push"](t)
}, this)
}
}, {
key: "run",
value: function(e, t) {
this[e] = this[e] || [], this[e].forEach(function(e) {
e.call(t && t.context ? t.context : t, t)
})
}
}])
}(),
b = function() {
return c(function e(t) {
s(this, e), this.jsep = t, this.registered = {}
}, [{
key: "register",
value: function() {
for (var t = this, e = arguments.length, r = new Array(e), n = 0; n < e; n++) r[n] = arguments[n];
r.forEach(function(e) {
if ("object" !== C(e) || !e.name || !e.init) throw new Error("Invalid JSEP plugin format");
t.registered[e.name] || (e.init(t.jsep), t.registered[e.name] = e)
})
}
}])
}(),
v = function() {
function l(e) {
s(this, l), this.expr = e, this.index = 0
}
return c(l, [{
key: "char",
get: function() {
return this.expr.charAt(this.index)
}
}, {
key: "code",
get: function() {
return this.expr.charCodeAt(this.index)
}
}, {
key: "throwError",
value: function(e) {
var t = new Error(e + " at character " + this.index);
throw t.index = this.index, t.description = e, t
}
}, {
key: "runHook",
value: function(e, t) {
if (l.hooks[e]) {
var r = {
context: this,
node: t
};
return l.hooks.run(e, r), r.node
}
return t
}
}, {
key: "searchHook",
value: function(e) {
if (l.hooks[e]) {
var t = {
context: this
};
return l.hooks[e].find(function(e) {
return e.call(t.context, t), t.node
}), t.node
}
}
}, {
key: "gobbleSpaces",
value: function() {
for (var e = this.code; e === l.SPACE_CODE || e === l.TAB_CODE || e === l.LF_CODE || e === l.CR_CODE;) e = this.expr.charCodeAt(++this.index);
this.runHook("gobble-spaces")
}
}, {
key: "parse",
value: function() {
this.runHook("before-all");
var e = this.gobbleExpressions(),
e = 1 === e.length ? e[0] : {
type: l.COMPOUND,
body: e
};
return this.runHook("after-all", e)
}
}, {
key: "gobbleExpressions",
value: function(e) {
for (var t, r, n = []; this.index < this.expr.length;)
if ((t = this.code) === l.SEMCOL_CODE || t === l.COMMA_CODE) this.index++;
else if (r = this.gobbleExpression()) n.push(r);
else if (this.index < this.expr.length) {
if (t === e) break;
this.throwError('Unexpected "' + this.char + '"')
}
return n
}
}, {
key: "gobbleExpression",
value: function() {
var e = this.searchHook("gobble-expression") || this.gobbleBinaryExpression();
return this.gobbleSpaces(), this.runHook("after-expression", e)
}
}, {
key: "gobbleBinaryOp",
value: function() {
this.gobbleSpaces();
for (var e = this.expr.substr(this.index, l.max_binop_len), t = e.length; 0 < t;) {
if (l.binary_ops.hasOwnProperty(e) && (!l.isIdentifierStart(this.code) || this.index + e.length < this.expr.length && !l.isIdentifierPart(this.expr.charCodeAt(this.index + e.length)))) return this.index += t, e;
e = e.substr(0, --t)
}
return !1
}
}, {
key: "gobbleBinaryExpression",
value: function() {
var e, t, r, n, i, o, a, s, u, c = this.gobbleToken();
if (!c) return c;
if (!(t = this.gobbleBinaryOp())) return c;
for (i = {
value: t,
prec: l.binaryPrecedence(t),
right_a: l.right_associative.has(t)
}, (o = this.gobbleToken()) || this.throwError("Expected expression after " + t), n = [c, i, o]; t = this.gobbleBinaryOp();) {
if (0 === (r = l.binaryPrecedence(t))) {
this.index -= t.length;
break
}
i = {
value: t,
prec: r,
right_a: l.right_associative.has(t)
}, s = t;
for (; 2 < n.length && (u = n[n.length - 2], i.right_a && u.right_a ? r > u.prec : r <= u.prec);) o = n.pop(), t = n.pop().value, c = n.pop(), e = {
type: l.BINARY_EXP,
operator: t,
left: c,
right: o
}, n.push(e);
(e = this.gobbleToken()) || this.throwError("Expected expression after " + s), n.push(i, e)
}
for (e = n[a = n.length - 1]; 1 < a;) e = {
type: l.BINARY_EXP,
operator: n[a - 1].value,
left: n[a - 2],
right: e
}, a -= 2;
return e
}
}, {
key: "gobbleToken",
value: function() {
var e, t, r, n;
if (this.gobbleSpaces(), n = this.searchHook("gobble-token")) return this.runHook("after-token", n);
if (e = this.code, l.isDecimalDigit(e) || e === l.PERIOD_CODE) return this.gobbleNumericLiteral();
if (e === l.SQUOTE_CODE || e === l.DQUOTE_CODE) n = this.gobbleStringLiteral();
else if (e === l.OBRACK_CODE) n = this.gobbleArray();
else {
for (r = (t = this.expr.substr(this.index, l.max_unop_len)).length; 0 < r;) {
if (l.unary_ops.hasOwnProperty(t) && (!l.isIdentifierStart(this.code) || this.index + t.length < this.expr.length && !l.isIdentifierPart(this.expr.charCodeAt(this.index + t.length)))) {
this.index += r;
var i = this.gobbleToken();
return i || this.throwError("missing unaryOp argument"), this.runHook("after-token", {
type: l.UNARY_EXP,
operator: t,
argument: i,
prefix: !0
})
}
t = t.substr(0, --r)
}
l.isIdentifierStart(e) ? (n = this.gobbleIdentifier(), l.literals.hasOwnProperty(n.name) ? n = {
type: l.LITERAL,
value: l.literals[n.name],
raw: n.name
} : n.name === l.this_str && (n = {
type: l.THIS_EXP
})) : e === l.OPAREN_CODE && (n = this.gobbleGroup())
}
return n ? (n = this.gobbleTokenProperty(n), this.runHook("after-token", n)) : this.runHook("after-token", !1)
}
}, {
key: "gobbleTokenProperty",
value: function(e) {
this.gobbleSpaces();
for (var t = this.code; t === l.PERIOD_CODE || t === l.OBRACK_CODE || t === l.OPAREN_CODE || t === l.QUMARK_CODE;) {
var r = void 0;
if (t === l.QUMARK_CODE) {
if (this.expr.charCodeAt(this.index + 1) !== l.PERIOD_CODE) break;
r = !0, this.index += 2, this.gobbleSpaces(), t = this.code
}
this.index++, t === l.OBRACK_CODE ? (e = {
type: l.MEMBER_EXP,
computed: !0,
object: e,
property: this.gobbleExpression()
}, this.gobbleSpaces(), (t = this.code) !== l.CBRACK_CODE && this.throwError("Unclosed ["), this.index++) : t === l.OPAREN_CODE ? e = {
type: l.CALL_EXP,
arguments: this.gobbleArguments(l.CPAREN_CODE),
callee: e
} : t !== l.PERIOD_CODE && !r || (r && this.index--, this.gobbleSpaces(), e = {
type: l.MEMBER_EXP,
computed: !1,
object: e,
property: this.gobbleIdentifier()
}), r && (e.optional = !0), this.gobbleSpaces(), t = this.code
}
return e
}
}, {
key: "gobbleNumericLiteral",
value: function() {
for (var e, t = ""; l.isDecimalDigit(this.code);) t += this.expr.charAt(this.index++);
if (this.code === l.PERIOD_CODE)
for (t += this.expr.charAt(this.index++); l.isDecimalDigit(this.code);) t += this.expr.charAt(this.index++);
if ("e" === (e = this.char) || "E" === e) {
for (t += this.expr.charAt(this.index++), "+" !== (e = this.char) && "-" !== e || (t += this.expr.charAt(this.index++)); l.isDecimalDigit(this.code);) t += this.expr.charAt(this.index++);
l.isDecimalDigit(this.expr.charCodeAt(this.index - 1)) || this.throwError("Expected exponent (" + t + this.char + ")")
}
return e = this.code, l.isIdentifierStart(e) ? this.throwError("Variable names cannot start with a number (" + t + this.char + ")") : (e === l.PERIOD_CODE || 1 === t.length && t.charCodeAt(0) === l.PERIOD_CODE) && this.throwError("Unexpected period"), {
type: l.LITERAL,
value: parseFloat(t),
raw: t
}
}
}, {
key: "gobbleStringLiteral",
value: function() {
for (var e = "", t = this.index, r = this.expr.charAt(this.index++), n = !1; this.index < this.expr.length;) {
var i = this.expr.charAt(this.index++);
if (i === r) {
n = !0;
break
}
if ("\\" === i) switch (i = this.expr.charAt(this.index++)) {
case "n":
e += "\n";
break;
case "r":
e += "\r";
break;
case "t":
e += "\t";
break;
case "b":
e += "\b";
break;
case "f":
e += "\f";
break;
case "v":
e += "\v";
break;
default:
e += i
} else e += i
}
return n || this.throwError('Unclosed quote after "' + e + '"'), {
type: l.LITERAL,
value: e,
raw: this.expr.substring(t, this.index)
}
}
}, {
key: "gobbleIdentifier",
value: function() {
var e = this.code,
t = this.index;
for (l.isIdentifierStart(e) ? this.index++ : this.throwError("Unexpected " + this.char); this.index < this.expr.length && (e = this.code, l.isIdentifierPart(e));) this.index++;
return {
type: l.IDENTIFIER,
name: this.expr.slice(t, this.index)
}
}
}, {
key: "gobbleArguments",
value: function(e) {
for (var t = [], r = !1, n = 0; this.index < this.expr.length;) {
this.gobbleSpaces();
var i = this.code;
if (i === e) {
r = !0, this.index++, e === l.CPAREN_CODE && n && n >= t.length && this.throwError("Unexpected token " + String.fromCharCode(e));
break
}
if (i === l.COMMA_CODE) {
if (this.index++, ++n !== t.length)
if (e === l.CPAREN_CODE) this.throwError("Unexpected token ,");
else if (e === l.CBRACK_CODE)
for (var o = t.length; o < n; o++) t.push(null)
} else t.length !== n && 0 !== n ? this.throwError("Expected comma") : ((i = this.gobbleExpression()) && i.type !== l.COMPOUND || this.throwError("Expected comma"), t.push(i))
}
return r || this.throwError("Expected " + String.fromCharCode(e)), t
}
}, {
key: "gobbleGroup",
value: function() {
this.index++;
var e = this.gobbleExpressions(l.CPAREN_CODE);
if (this.code === l.CPAREN_CODE) return this.index++, 1 === e.length ? e[0] : !!e.length && {
type: l.SEQUENCE_EXP,
expressions: e
};
this.throwError("Unclosed (")
}
}, {
key: "gobbleArray",
value: function() {
return this.index++, {
type: l.ARRAY_EXP,
elements: this.gobbleArguments(l.CBRACK_CODE)
}
}
}], [{
key: "version",
get: function() {
return "1.3.8"
}
}, {
key: "toString",
value: function() {
return "JavaScript Expression Parser (JSEP) v" + l.version
}
}, {
key: "addUnaryOp",
value: function(e) {
return l.max_unop_len = Math.max(e.length, l.max_unop_len), l.unary_ops[e] = 1, l
}
}, {
key: "addBinaryOp",
value: function(e, t, r) {
return l.max_binop_len = Math.max(e.length, l.max_binop_len), l.binary_ops[e] = t, r ? l.right_associative.add(e) : l.right_associative.delete(e), l
}
}, {
key: "addIdentifierChar",
value: function(e) {
return l.additional_identifier_chars.add(e), l
}
}, {
key: "addLiteral",
value: function(e, t) {
return l.literals[e] = t, l
}
}, {
key: "removeUnaryOp",
value: function(e) {
return delete l.unary_ops[e], e.length === l.max_unop_len && (l.max_unop_len = l.getMaxKeyLen(l.unary_ops)), l
}
}, {
key: "removeAllUnaryOps",
value: function() {
return l.unary_ops = {}, l.max_unop_len = 0, l
}
}, {
key: "removeIdentifierChar",
value: function(e) {
return l.additional_identifier_chars.delete(e), l
}
}, {
key: "removeBinaryOp",
value: function(e) {
return delete l.binary_ops[e], e.length === l.max_binop_len && (l.max_binop_len = l.getMaxKeyLen(l.binary_ops)), l.right_associative.delete(e), l
}
}, {
key: "removeAllBinaryOps",
value: function() {
return l.binary_ops = {}, l.max_binop_len = 0, l
}
}, {
key: "removeLiteral",
value: function(e) {
return delete l.literals[e], l
}
}, {
key: "removeAllLiterals",
value: function() {
return l.literals = {}, l
}
}, {
key: "parse",
value: function(e) {
return new l(e).parse()
}
}, {
key: "getMaxKeyLen",
value: function(e) {
return Math.max.apply(Math, [0].concat(f(Object.keys(e).map(function(e) {
return e.length
}))))
}
}, {
key: "isDecimalDigit",
value: function(e) {
return 48 <= e && e <= 57
}
}, {
key: "binaryPrecedence",
value: function(e) {
return l.binary_ops[e] || 0
}
}, {
key: "isIdentifierStart",
value: function(e) {
return 65 <= e && e <= 90 || 97 <= e && e <= 122 || 128 <= e && !l.binary_ops[String.fromCharCode(e)] || l.additional_identifier_chars.has(String.fromCharCode(e))
}
}, {
key: "isIdentifierPart",
value: function(e) {
return l.isIdentifierStart(e) || l.isDecimalDigit(e)
}
}])
}(),
y = new y;
Object.assign(v, {
hooks: y,
plugins: new b(v),
COMPOUND: "Compound",
SEQUENCE_EXP: "SequenceExpression",
IDENTIFIER: "Identifier",
MEMBER_EXP: "MemberExpression",
LITERAL: "Literal",
THIS_EXP: "ThisExpression",
CALL_EXP: "CallExpression",
UNARY_EXP: "UnaryExpression",
BINARY_EXP: "BinaryExpression",
ARRAY_EXP: "ArrayExpression",
TAB_CODE: 9,
LF_CODE: 10,
CR_CODE: 13,
SPACE_CODE: 32,
PERIOD_CODE: 46,
COMMA_CODE: 44,
SQUOTE_CODE: 39,
DQUOTE_CODE: 34,
OPAREN_CODE: 40,
CPAREN_CODE: 41,
OBRACK_CODE: 91,
CBRACK_CODE: 93,
QUMARK_CODE: 63,
SEMCOL_CODE: 59,
COLON_CODE: 58,
unary_ops: {
"-": 1,
"!": 1,
"~": 1,
"+": 1
},
binary_ops: {
"||": 1,
"&&": 2,
"|": 3,
"^": 4,
"&": 5,
"==": 6,
"!=": 6,
"===": 6,
"!==": 6,
"<": 7,
">": 7,
"<=": 7,
">=": 7,
"<<": 8,
">>": 8,
">>>": 8,
"+": 9,
"-": 9,
"*": 10,
"/": 10,
"%": 10
},
right_associative: new Set,
additional_identifier_chars: new Set(["$", "_"]),
literals: {
true: !0,
false: !1,
null: null
},
this_str: "this"
}), v.max_unop_len = v.getMaxKeyLen(v.unary_ops), v.max_binop_len = v.getMaxKeyLen(v.binary_ops);
var E = function(e) {
return new v(e).parse()
};
Object.getOwnPropertyNames(v).forEach(function(e) {
void 0 === E[e] && "prototype" !== e && (E[e] = v[e])
}), E.Jsep = v;
b = {
name: "ternary",
init: function(o) {
o.hooks.add("after-expression", function(e) {
if (e.node && this.code === o.QUMARK_CODE) {
this.index++;
var t = e.node,
r = this.gobbleExpression();
if (r || this.throwError("Expected expression"), this.gobbleSpaces(), this.code === o.COLON_CODE) {
this.index++;
var n = this.gobbleExpression();
if (n || this.throwError("Expected expression"), e.node = {
type: "ConditionalExpression",
test: t,
consequent: r,
alternate: n
}, t.operator && o.binary_ops[t.operator] <= .9) {
for (var i = t; i.right.operator && o.binary_ops[i.right.operator] <= .9;) i = i.right;
e.node.test = i.right, i.right = e.node, e.node = t
}
} else this.throwError("Expected :")
}
})
}
};
E.plugins.register(b);
var b = {
name: "regex",
init: function(s) {
s.hooks.add("gobble-token", function(e) {
if (47 === this.code) {
for (var t = ++this.index, r = !1; this.index < this.expr.length;) {
if (47 === this.code && !r) {
for (var n = this.expr.slice(t, this.index), i = ""; ++this.index < this.expr.length;) {
var o = this.code;
if (!(97 <= o && o <= 122 || 65 <= o && o <= 90 || 48 <= o && o <= 57)) break;
i += this.char
}
var a = void 0;
try {
a = new RegExp(n, i)
} catch (e) {
this.throwError(e.message)
}
return e.node = {
type: s.LITERAL,
value: a,
raw: this.expr.slice(t - 1, this.index)
}, e.node = this.gobbleTokenProperty(e.node), e.node
}
this.code === s.OBRACK_CODE ? r = !0 : r && this.code === s.CBRACK_CODE && (r = !1), this.index += 92 === this.code ? 2 : 1
}
this.throwError("Unclosed Regex")
}
})
}
},
g = {
name: "assignment",
assignmentOperators: new Set(["=", "*=", "**=", "/=", "%=", "+=", "-=", "<<=", ">>=", ">>>=", "&=", "^=", "|="]),
updateOperators: [43, 45],
assignmentPrecedence: .9,
init: function(t) {
var n = [t.IDENTIFIER, t.MEMBER_EXP];
g.assignmentOperators.forEach(function(e) {
return t.addBinaryOp(e, g.assignmentPrecedence, !0)
}), t.hooks.add("gobble-token", function(e) {
var t = this,
r = this.code;
g.updateOperators.some(function(e) {
return e === r && e === t.expr.charCodeAt(t.index + 1)
}) && (this.index += 2, e.node = {
type: "UpdateExpression",
operator: 43 === r ? "++" : "--",
argument: this.gobbleTokenProperty(this.gobbleIdentifier()),
prefix: !0
}, e.node.argument && n.includes(e.node.argument.type) || this.throwError("Unexpected ".concat(e.node.operator)))
}), t.hooks.add("after-token", function(e) {
var t, r = this;
e.node && (t = this.code, g.updateOperators.some(function(e) {
return e === t && e === r.expr.charCodeAt(r.index + 1)
}) && (n.includes(e.node.type) || this.throwError("Unexpected ".concat(e.node.operator)), this.index += 2, e.node = {
type: "UpdateExpression",
operator: 43 === t ? "++" : "--",
argument: e.node,
prefix: !1
}))
}), t.hooks.add("after-expression", function(e) {
e.node && ! function t(e) {
g.assignmentOperators.has(e.operator) ? (e.type = "AssignmentExpression", t(e.left), t(e.right)) : e.operator || Object.values(e).forEach(function(e) {
e && "object" === C(e) && t(e)
})
}(e.node)
})
}
},
A = Object.prototype.hasOwnProperty;
function w(e, t) {
return (e = e.slice()).push(t), e
}
function k(e, t) {
return (t = t.slice()).unshift(e), t
}
var x = function() {
function r(e) {
var t;
return s(this, r), (t = n(this, r, ['JSONPath should not be called with "new" (it prevents return of (unwrapped) scalar values)'])).avoidNew = !0, t.value = e, t.name = "NewError", t
}
return function(e, t) {
if ("function" != typeof t && null !== t) throw new TypeError("Super expression must either be null or a function");
e.prototype = Object.create(t && t.prototype, {
constructor: {
value: e,
writable: !0,
configurable: !0
}
}), Object.defineProperty(e, "prototype", {
writable: !1
}), t && h(e, t)
}(r, p(Error)), c(r)
}();
function F(e, t, r, n, i) {
if (!(this instanceof F)) try {
return new F(e, t, r, n, i)
} catch (e) {
if (!e.avoidNew) throw e;
return e.value
}
"string" == typeof e && (i = n, n = r, r = t, t = e, e = null);
var o = e && "object" === C(e);
if (e = e || {}, this.json = e.json || r, this.path = e.path || t, this.resultType = e.resultType || "value", this.flatten = e.flatten || !1, this.wrap = !A.call(e, "wrap") || e.wrap, this.sandbox = e.sandbox || {}, this.eval = void 0 === e.eval ? "safe" : e.eval, this.ignoreEvalErrors = void 0 !== e.ignoreEvalErrors && e.ignoreEvalErrors, this.parent = e.parent || null, this.parentProperty = e.parentProperty || null, this.callback = e.callback || n || null, this.otherTypeCallback = e.otherTypeCallback || i || function() {
throw new TypeError("You must supply an otherTypeCallback callback option with the @other() operator.")
}, !1 !== e.autostart) {
var a = {
path: o ? e.path : t
};
o ? "json" in e && (a.json = e.json) : a.json = r;
a = this.evaluate(a);
if (!a || "object" !== C(a)) throw new x(a);
return a
}
}
F.prototype.evaluate = function(e, t, r, n) {
var i = this,
o = this.parent,
a = this.parentProperty,
s = this.flatten,
u = this.wrap;
if (this.currResultType = this.resultType, this.currEval = this.eval, this.currSandbox = this.sandbox, r = r || this.callback, this.currOtherTypeCallback = n || this.otherTypeCallback, t = t || this.json, (e = e || this.path) && "object" === C(e) && !Array.isArray(e)) {
if (!e.path && "" !== e.path) throw new TypeError('You must supply a "path" property when providing an object argument to JSONPath.evaluate().');
if (!A.call(e, "json")) throw new TypeError('You must supply a "json" property when providing an object argument to JSONPath.evaluate().');
t = e.json, s = A.call(e, "flatten") ? e.flatten : s, this.currResultType = A.call(e, "resultType") ? e.resultType : this.currResultType, this.currSandbox = A.call(e, "sandbox") ? e.sandbox : this.currSandbox, u = A.call(e, "wrap") ? e.wrap : u, this.currEval = A.call(e, "eval") ? e.eval : this.currEval, r = A.call(e, "callback") ? e.callback : r, this.currOtherTypeCallback = A.call(e, "otherTypeCallback") ? e.otherTypeCallback : this.currOtherTypeCallback, o = A.call(e, "parent") ? e.parent : o, a = A.call(e, "parentProperty") ? e.parentProperty : a, e = e.path
}
if (o = o || null, a = a || null, Array.isArray(e) && (e = F.toPathString(e)), (e || "" === e) && t) {
e = F.toPathArray(e);
"$" === e[0] && 1 < e.length && e.shift(), this._hasParentSelector = null;
r = this._trace(e, t, ["$"], o, a, r).filter(function(e) {
return e && !e.isParentSelector
});
return r.length ? u || 1 !== r.length || r[0].hasArrExpr ? r.reduce(function(e, t) {
t = i._getPreferredOutput(t);
return s && Array.isArray(t) ? e = e.concat(t) : e.push(t), e
}, []) : this._getPreferredOutput(r[0]) : u ? [] : void 0
}
}, F.prototype._getPreferredOutput = function(e) {
var t = this.currResultType;
switch (t) {
case "all":
var r = Array.isArray(e.path) ? e.path : F.toPathArray(e.path);
return e.pointer = F.toPointer(r), e.path = "string" == typeof e.path ? e.path : F.toPathString(e.path), e;
case "value":
case "parent":
case "parentProperty":
return e[t];
case "path":
return F.toPathString(e[t]);
case "pointer":
return F.toPointer(e.path);
default:
throw new TypeError("Unknown result type")
}
}, F.prototype._handleCallback = function(e, t, r) {
var n;
t && (n = this._getPreferredOutput(e), e.path = "string" == typeof e.path ? e.path : F.toPathString(e.path), t(n, r, e))
}, F.prototype._trace = function(t, n, i, o, a, s, e, r) {
var u = this;
if (!t.length) return v = {
path: i,
value: n,
parent: o,
parentProperty: a,
hasArrExpr: e
}, this._handleCallback(v, s, "value"), v;
var c = t[0],
l = t.slice(1),
h = [];
function p(e) {
Array.isArray(e) ? e.forEach(function(e) {
h.push(e)
}) : h.push(e)
}
if (("string" != typeof c || r) && n && A.call(n, c)) p(this._trace(l, n[c], w(i, c), n, c, s, e));
else if ("*" === c) this._walk(n, function(e) {
p(u._trace(l, n[e], w(i, e), n, e, s, !0, !0))
});
else if (".." === c) p(this._trace(l, n, i, o, a, s, e)), this._walk(n, function(e) {
"object" === C(n[e]) && p(u._trace(t.slice(), n[e], w(i, e), n, e, s, !0))
});
else {
if ("^" === c) return this._hasParentSelector = !0, {
path: i.slice(0, -1),
expr: l,
isParentSelector: !0
};
if ("~" === c) return v = {
path: w(i, c),
value: a,
parent: o,
parentProperty: null
}, this._handleCallback(v, s, "property"), v;
if ("$" === c) p(this._trace(l, n, i, null, null, s, e));
else if (/^(\x2D?[0-9]*):(\x2D?[0-9]*):?([0-9]*)$/.test(c)) p(this._slice(c, l, n, i, o, a, s));
else if (0 === c.indexOf("?(")) {
if (!1 === this.currEval) throw new Error("Eval [?(expr)] prevented in JSONPath expression.");
var f = c.replace(/^\?\(((?:[\0-\t\x0B\f\x0E-\u2027\u202A-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*?)\)$/, "$1"),
d = /@(?:[\0-\t\x0B\f\x0E-\u2027\u202A-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])?((?:[\0->@-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*)['\[](\??\((?:[\0-\t\x0B\f\x0E-\u2027\u202A-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*?\))(?!(?:[\0-\t\x0B\f\x0E-\u2027\u202A-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])\)\])['\]]/g.exec(f);
d ? this._walk(n, function(e) {
var t = [d[2]],
r = d[1] ? n[e][d[1]] : n[e];
0 < u._trace(t, r, i, o, a, s, !0).length && p(u._trace(l, n[e], w(i, e), n, e, s, !0))
}) : this._walk(n, function(e) {
u._eval(f, n[e], e, i, o, a) && p(u._trace(l, n[e], w(i, e), n, e, s, !0))
})
} else if ("(" === c[0]) {
if (!1 === this.currEval) throw new Error("Eval [(expr)] prevented in JSONPath expression.");
p(this._trace(k(this._eval(c, n, i[i.length - 1], i.slice(0, -1), o, a), l), n, i, o, a, s, e))
} else if ("@" === c[0]) {
var y = !1,
b = c.slice(1, -2);
switch (b) {
case "scalar":
n && ["object", "function"].includes(C(n)) || (y = !0);
break;
case "boolean":
case "string":
case "undefined":
case "function":
C(n) === b && (y = !0);
break;
case "integer":
!Number.isFinite(n) || n % 1 || (y = !0);
break;
case "number":
Number.isFinite(n) && (y = !0);
break;
case "nonFinite":
"number" != typeof n || Number.isFinite(n) || (y = !0);
break;
case "object":
n && C(n) === b && (y = !0);
break;
case "array":
Array.isArray(n) && (y = !0);
break;
case "other":
y = this.currOtherTypeCallback(n, i, o, a);
break;
case "null":
null === n && (y = !0);
break;
default:
throw new TypeError("Unknown value type " + b)
}
if (y) return v = {
path: i,
value: n,
parent: o,
parentProperty: a
}, this._handleCallback(v, s, "value"), v
} else if ("`" === c[0] && n && A.call(n, c.slice(1))) {
var v = c.slice(1);
p(this._trace(l, n[v], w(i, v), n, v, s, e, !0))
} else if (c.includes(",")) {
var E = function(e, t) {
var r = "undefined" != typeof Symbol && e[Symbol.iterator] || e["@@iterator"];
if (!r) {
if (Array.isArray(e) || (r = O(e)) || t && e && "number" == typeof e.length) {
r && (e = r);
var n = 0,
t = function() {};
return {
s: t,
n: function() {
return n >= e.length ? {
done: !0
} : {
done: !1,
value: e[n++]
}
},
e: function(e) {
throw e
},
f: t
}
}
throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")
}
var i, o = !0,
a = !1;
return {
s: function() {
r = r.call(e)
},
n: function() {
var e = r.next();
return o = e.done, e
},
e: function(e) {
a = !0, i = e
},
f: function() {
try {
o || null == r.return || r.return()
} finally {
if (a) throw i
}
}
}
}(c.split(","));
try {
for (E.s(); !(g = E.n()).done;) {
var g = g.value;
p(this._trace(k(g, l), n, i, o, a, s, !0))
}
} catch (e) {
E.e(e)
} finally {
E.f()
}
} else !r && n && A.call(n, c) && p(this._trace(l, n[c], w(i, c), n, c, s, e, !0))
}
if (this._hasParentSelector)
for (var x = 0; x < h.length; x++) {
var F = h[x];
if (F && F.isParentSelector) {
var D = this._trace(F.expr, n, F.path, o, a, s, e);
if (Array.isArray(D)) {
h[x] = D[0];
for (var _ = D.length, m = 1; m < _; m++) x++, h.splice(x, 0, D[m])
} else h[x] = D
}
}
return h
}, F.prototype._walk = function(e, t) {
if (Array.isArray(e))
for (var r = e.length, n = 0; n < r; n++) t(n);
else e && "object" === C(e) && Object.keys(e).forEach(function(e) {
t(e)
})
}, F.prototype._slice = function(e, t, r, n, i, o, a) {
if (Array.isArray(r)) {
for (var s = r.length, u = e.split(":"), c = u[2] && Number.parseInt(u[2]) || 1, e = u[0] && Number.parseInt(u[0]) || 0, l = u[1] && Number.parseInt(u[1]) || s, e = e < 0 ? Math.max(0, e + s) : Math.min(s, e), l = l < 0 ? Math.max(0, l + s) : Math.min(s, l), h = [], p = e; p < l; p += c) this._trace(k(p, t), r, n, i, o, a, !0).forEach(function(e) {
h.push(e)
});
return h
}
}, F.prototype._eval = function(t, e, r, n, i, o) {
var a = this;
this.currSandbox._$_parentProperty = o, this.currSandbox._$_parent = i, this.currSandbox._$_property = r, this.currSandbox._$_root = this.json, this.currSandbox._$_v = e;
e = t.includes("@path");
e && (this.currSandbox._$_path = F.toPathString(n.concat([r])));
var s = this.currEval + "Script:" + t;
if (!F.cache[s]) {
var u = t.replace(/@parentProperty/g, "_$_parentProperty").replace(/@parent/g, "_$_parent").replace(/@property/g, "_$_property").replace(/@root/g, "_$_root").replace(/@([\t-\r \)\.\[\xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF])/g, "_$_v$1");
if (e && (u = u.replace(/@path/g, "_$_path")), "safe" === this.currEval || !0 === this.currEval || void 0 === this.currEval) F.cache[s] = new this.safeVm.Script(u);
else if ("native" === this.currEval) F.cache[s] = new this.vm.Script(u);
else if ("function" == typeof this.currEval && this.currEval.prototype && A.call(this.currEval.prototype, "runInNewContext")) {
e = this.currEval;
F.cache[s] = new e(u)
} else {
if ("function" != typeof this.currEval) throw new TypeError('Unknown "eval" property "'.concat(this.currEval, '"'));
F.cache[s] = {
runInNewContext: function(e) {
return a.currEval(u, e)
}
}
}
}
try {
return F.cache[s].runInNewContext(this.currSandbox)
} catch (e) {
if (this.ignoreEvalErrors) return !1;
throw new Error("jsonPath: " + e.message + ": " + t)
}
}, F.cache = {}, F.toPathString = function(e) {
for (var t = e, r = t.length, n = "$", i = 1; i < r; i++) /^(~|\^|@(?:[\0-\t\x0B\f\x0E-\u2027\u202A-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*?\(\))$/.test(t[i]) || (n += /^[\*0-9]+$/.test(t[i]) ? "[" + t[i] + "]" : "['" + t[i] + "']");
return n
}, F.toPointer = function(e) {
for (var t = e, r = t.length, n = "", i = 1; i < r; i++) /^(~|\^|@(?:[\0-\t\x0B\f\x0E-\u2027\u202A-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*?\(\))$/.test(t[i]) || (n += "/" + t[i].toString().replace(/~/g, "~0").replace(/\//g, "~1"));
return n
}, F.toPathArray = function(e) {
var t = F.cache;
if (t[e]) return t[e].concat();
var r = [],
n = e.replace(/@(?:null|boolean|number|string|integer|undefined|nonFinite|scalar|array|object|function|other)\(\)/g, ";$&;").replace(/['\[](\??\((?:[\0-\t\x0B\f\x0E-\u2027\u202A-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*?\))['\]](?!(?:[\0-\t\x0B\f\x0E-\u2027\u202A-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])\])/g, function(e, t) {
return "[#" + (r.push(t) - 1) + "]"
}).replace(/\[["']((?:[\0-&\(-\\\^-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*)["']\]/g, function(e, t) {
return "['" + t.replace(/\./g, "%@%").replace(/~/g, "%%@@%%") + "']"
}).replace(/~/g, ";~;").replace(/["']?\.["']?(?!(?:[\0-Z\\-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*\])|\[["']?/g, ";").replace(/%@%/g, ".").replace(/%%@@%%/g, "~").replace(/(?:;)?(\^+)(?:;)?/g, function(e, t) {
return ";" + t.split("").join(";") + ";"
}).replace(/;;;|;;/g, ";..;").replace(/;$|'?\]|'$/g, "").split(";").map(function(e) {
var t = e.match(/#([0-9]+)/);
return t && t[1] ? r[t[1]] : e
});
return t[e] = n, t[e].concat()
};
E.plugins.register(b, g);
var D = {
evalAst: function(e, t) {
switch (e.type) {
case "BinaryExpression":
case "LogicalExpression":
return D.evalBinaryExpression(e, t);
case "Compound":
return D.evalCompound(e, t);
case "ConditionalExpression":
return D.evalConditionalExpression(e, t);
case "Identifier":
return D.evalIdentifier(e, t);
case "Literal":
return D.evalLiteral(e, t);
case "MemberExpression":
return D.evalMemberExpression(e, t);
case "UnaryExpression":
return D.evalUnaryExpression(e, t);
case "ArrayExpression":
return D.evalArrayExpression(e, t);
case "CallExpression":
return D.evalCallExpression(e, t);
case "AssignmentExpression":
return D.evalAssignmentExpression(e, t);
default:
throw SyntaxError("Unexpected expression", e)
}
},
evalBinaryExpression: function(e, t) {
return {
"||": function(e, t) {
return e || t()
},
"&&": function(e, t) {
return e && t()
},
"|": function(e, t) {
return e | t()
},
"^": function(e, t) {
return e ^ t()
},
"&": function(e, t) {
return e & t()
},
"==": function(e, t) {
return e == t()
},
"!=": function(e, t) {
return e != t()
},
"===": function(e, t) {
return e === t()
},
"!==": function(e, t) {
return e !== t()
},
"<": function(e, t) {
return e < t()
},
">": function(e, t) {
return e > t()
},
"<=": function(e, t) {
return e <= t()
},
">=": function(e, t) {
return e >= t()
},
"<<": function(e, t) {
return e << t()
},
">>": function(e, t) {
return e >> t()
},
">>>": function(e, t) {
return e >>> t()
},
"+": function(e, t) {
return e + t()
},
"-": function(e, t) {
return e - t()
},
"*": function(e, t) {
return e * t()
},
"/": function(e, t) {
return e / t()
},
"%": function(e, t) {
return e % t()
}
} [e.operator](D.evalAst(e.left, t), function() {
return D.evalAst(e.right, t)
})
},
evalCompound: function(e, t) {
for (var r = 0; r < e.body.length; r++) {
"Identifier" === e.body[r].type && ["var", "let", "const"].includes(e.body[r].name) && e.body[r + 1] && "AssignmentExpression" === e.body[r + 1].type && (r += 1);
var n = e.body[r],
i = D.evalAst(n, t)
}
return i
},
evalConditionalExpression: function(e, t) {
return D.evalAst(e.test, t) ? D.evalAst(e.consequent, t) : D.evalAst(e.alternate, t)
},
evalIdentifier: function(e, t) {
if (e.name in t) return t[e.name];
throw ReferenceError("".concat(e.name, " is not defined"))
},
evalLiteral: function(e) {
return e.value
},
evalMemberExpression: function(e, t) {
var r = e.computed ? D.evalAst(e.property) : e.property.name,
t = D.evalAst(e.object, t),
r = t[r];
return "function" == typeof r ? r.bind(t) : r
},
evalUnaryExpression: function(e, t) {
return {
"-": function(e) {
return -D.evalAst(e, t)
},
"!": function(e) {
return !D.evalAst(e, t)
},
"~": function(e) {
return ~D.evalAst(e, t)
},
"+": function(e) {
return +D.evalAst(e, t)
}
} [e.operator](e.argument)
},
evalArrayExpression: function(e, t) {
return e.elements.map(function(e) {
return D.evalAst(e, t)
})
},
evalCallExpression: function(e, t) {
var r = e.arguments.map(function(e) {
return D.evalAst(e, t)
});
return D.evalAst(e.callee, t).apply(void 0, f(r))
},
evalAssignmentExpression: function(e, t) {
if ("Identifier" !== e.left.type) throw SyntaxError("Invalid left-hand side in assignment");
var r = e.left.name,
e = D.evalAst(e.right, t);
return t[r] = e, t[r]
}
},
b = function() {
return c(function e(t) {
s(this, e), this.code = t, this.ast = E(this.code)
}, [{
key: "runInNewContext",
value: function(e) {
e = r({}, e);
return D.evalAst(this.ast, e)
}
}])
}();
F.prototype.vm = {
Script: function() {
return c(function e(t) {
s(this, e), this.code = t
}, [{
key: "runInNewContext",
value: function(n) {
var e = this.code,
t = Object.keys(n),
r = [];
! function(e, t, r) {
for (var n = e.length, i = 0; i < n; i++) r(e[i]) && t.push(e.splice(i--, 1)[0])
}(t, r, function(e) {
return "function" == typeof n[e]
});
var i = t.map(function(e) {
return n[e]
}),
r = r.reduce(function(e, t) {
var r = n[t].toString();
return /function/.test(r) || (r = "function " + r), "var " + t + "=" + r + ";" + e
}, "");
/(["'])use strict\1/.test(e = r + e) || t.includes("arguments") || (e = "var arguments = undefined;" + e);
r = (e = e.replace(/;[\t-\r \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF]*$/, "")).lastIndexOf(";"), e = -1 < r ? e.slice(0, r + 1) + " return " + e.slice(r + 1) : " return " + e;
return o(Function, t.concat([e])).apply(void 0, f(i))
}
}])
}()
}, F.prototype.safeVm = {
Script: b
}, e.JSONPath = F, e.SafeScript = b
});