diff --git a/lerna.json b/lerna.json index aa444d861c..d295e70a7f 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "0.0.16", + "version": "0.0.22", "npmClient": "yarn", "packages": [ "packages/*" diff --git a/packages/bootstrap-components/package.json b/packages/bootstrap-components/package.json index e13101c1b2..aeb1037872 100644 --- a/packages/bootstrap-components/package.json +++ b/packages/bootstrap-components/package.json @@ -12,7 +12,7 @@ "publishdev": "yarn build && node ./scripts/publishDev.js" }, "devDependencies": { - "@budibase/client": "^0.0.16", + "@budibase/client": "^0.0.22", "fs-extra": "^8.1.0", "lodash": "^4.17.15", "npm-run-all": "^4.1.5", @@ -30,7 +30,7 @@ "keywords": [ "svelte" ], - "version": "0.0.16", + "version": "0.0.22", "license": "MIT", "gitHead": "115189f72a850bfb52b65ec61d932531bf327072" } diff --git a/packages/builder/package.json b/packages/builder/package.json index 904a609ca6..ce0205ca4a 100644 --- a/packages/builder/package.json +++ b/packages/builder/package.json @@ -1,7 +1,8 @@ { "name": "@budibase/builder", - "version": "0.0.16", + "version": "0.0.22", "license": "AGPL-3.0", + "private": true, "scripts": { "build": "rollup -c", "start": "rollup -c -w", @@ -34,7 +35,7 @@ ] }, "dependencies": { - "@budibase/client": "^0.0.16", + "@budibase/client": "^0.0.22", "@nx-js/compiler-util": "^2.0.0", "codemirror": "^5.51.0", "date-fns": "^1.29.0", diff --git a/packages/builder/rollup.config.js b/packages/builder/rollup.config.js index 10e6e866ea..9af67db34a 100644 --- a/packages/builder/rollup.config.js +++ b/packages/builder/rollup.config.js @@ -16,7 +16,7 @@ const _builderProxy = proxy("/_builder", { pathRewrite: { "^/_builder": "" }, }) -const apiProxy = proxy(["/_builder/api/**", "/_builder/**/componentlibrary"], { +const apiProxy = proxy(["/_builder/assets/**", "/_builder/api/**", "/_builder/**/componentlibrary"], { target, logLevel: "debug", changeOrigin: true, diff --git a/packages/builder/src/PackageRoot.svelte b/packages/builder/src/PackageRoot.svelte index 6652c74a1f..ce87fe65e9 100644 --- a/packages/builder/src/PackageRoot.svelte +++ b/packages/builder/src/PackageRoot.svelte @@ -10,7 +10,7 @@
Please create a new screen
{/if}' + func(text) + '
';\n * });\n *\n * p('fred, barney, & pebbles');\n * // => 'fred, barney, & pebbles
'\n */\n function wrap(value, wrapper) {\n return partial(castFunction(wrapper), value);\n }\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Casts `value` as an array if it's not one.\n *\n * @static\n * @memberOf _\n * @since 4.4.0\n * @category Lang\n * @param {*} value The value to inspect.\n * @returns {Array} Returns the cast array.\n * @example\n *\n * _.castArray(1);\n * // => [1]\n *\n * _.castArray({ 'a': 1 });\n * // => [{ 'a': 1 }]\n *\n * _.castArray('abc');\n * // => ['abc']\n *\n * _.castArray(null);\n * // => [null]\n *\n * _.castArray(undefined);\n * // => [undefined]\n *\n * _.castArray();\n * // => []\n *\n * var array = [1, 2, 3];\n * console.log(_.castArray(array) === array);\n * // => true\n */\n function castArray() {\n if (!arguments.length) {\n return [];\n }\n var value = arguments[0];\n return isArray(value) ? value : [value];\n }\n\n /**\n * Creates a shallow clone of `value`.\n *\n * **Note:** This method is loosely based on the\n * [structured clone algorithm](https://mdn.io/Structured_clone_algorithm)\n * and supports cloning arrays, array buffers, booleans, date objects, maps,\n * numbers, `Object` objects, regexes, sets, strings, symbols, and typed\n * arrays. The own enumerable properties of `arguments` objects are cloned\n * as plain objects. An empty object is returned for uncloneable values such\n * as error objects, functions, DOM nodes, and WeakMaps.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to clone.\n * @returns {*} Returns the cloned value.\n * @see _.cloneDeep\n * @example\n *\n * var objects = [{ 'a': 1 }, { 'b': 2 }];\n *\n * var shallow = _.clone(objects);\n * console.log(shallow[0] === objects[0]);\n * // => true\n */\n function clone(value) {\n return baseClone(value, CLONE_SYMBOLS_FLAG);\n }\n\n /**\n * This method is like `_.clone` except that it accepts `customizer` which\n * is invoked to produce the cloned value. If `customizer` returns `undefined`,\n * cloning is handled by the method instead. The `customizer` is invoked with\n * up to four arguments; (value [, index|key, object, stack]).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to clone.\n * @param {Function} [customizer] The function to customize cloning.\n * @returns {*} Returns the cloned value.\n * @see _.cloneDeepWith\n * @example\n *\n * function customizer(value) {\n * if (_.isElement(value)) {\n * return value.cloneNode(false);\n * }\n * }\n *\n * var el = _.cloneWith(document.body, customizer);\n *\n * console.log(el === document.body);\n * // => false\n * console.log(el.nodeName);\n * // => 'BODY'\n * console.log(el.childNodes.length);\n * // => 0\n */\n function cloneWith(value, customizer) {\n customizer = typeof customizer == 'function' ? customizer : undefined;\n return baseClone(value, CLONE_SYMBOLS_FLAG, customizer);\n }\n\n /**\n * This method is like `_.clone` except that it recursively clones `value`.\n *\n * @static\n * @memberOf _\n * @since 1.0.0\n * @category Lang\n * @param {*} value The value to recursively clone.\n * @returns {*} Returns the deep cloned value.\n * @see _.clone\n * @example\n *\n * var objects = [{ 'a': 1 }, { 'b': 2 }];\n *\n * var deep = _.cloneDeep(objects);\n * console.log(deep[0] === objects[0]);\n * // => false\n */\n function cloneDeep(value) {\n return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG);\n }\n\n /**\n * This method is like `_.cloneWith` except that it recursively clones `value`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to recursively clone.\n * @param {Function} [customizer] The function to customize cloning.\n * @returns {*} Returns the deep cloned value.\n * @see _.cloneWith\n * @example\n *\n * function customizer(value) {\n * if (_.isElement(value)) {\n * return value.cloneNode(true);\n * }\n * }\n *\n * var el = _.cloneDeepWith(document.body, customizer);\n *\n * console.log(el === document.body);\n * // => false\n * console.log(el.nodeName);\n * // => 'BODY'\n * console.log(el.childNodes.length);\n * // => 20\n */\n function cloneDeepWith(value, customizer) {\n customizer = typeof customizer == 'function' ? customizer : undefined;\n return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG, customizer);\n }\n\n /**\n * Checks if `object` conforms to `source` by invoking the predicate\n * properties of `source` with the corresponding property values of `object`.\n *\n * **Note:** This method is equivalent to `_.conforms` when `source` is\n * partially applied.\n *\n * @static\n * @memberOf _\n * @since 4.14.0\n * @category Lang\n * @param {Object} object The object to inspect.\n * @param {Object} source The object of property predicates to conform to.\n * @returns {boolean} Returns `true` if `object` conforms, else `false`.\n * @example\n *\n * var object = { 'a': 1, 'b': 2 };\n *\n * _.conformsTo(object, { 'b': function(n) { return n > 1; } });\n * // => true\n *\n * _.conformsTo(object, { 'b': function(n) { return n > 2; } });\n * // => false\n */\n function conformsTo(object, source) {\n return source == null || baseConformsTo(object, source, keys(source));\n }\n\n /**\n * Performs a\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * comparison between two values to determine if they are equivalent.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n * @example\n *\n * var object = { 'a': 1 };\n * var other = { 'a': 1 };\n *\n * _.eq(object, object);\n * // => true\n *\n * _.eq(object, other);\n * // => false\n *\n * _.eq('a', 'a');\n * // => true\n *\n * _.eq('a', Object('a'));\n * // => false\n *\n * _.eq(NaN, NaN);\n * // => true\n */\n function eq(value, other) {\n return value === other || (value !== value && other !== other);\n }\n\n /**\n * Checks if `value` is greater than `other`.\n *\n * @static\n * @memberOf _\n * @since 3.9.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if `value` is greater than `other`,\n * else `false`.\n * @see _.lt\n * @example\n *\n * _.gt(3, 1);\n * // => true\n *\n * _.gt(3, 3);\n * // => false\n *\n * _.gt(1, 3);\n * // => false\n */\n var gt = createRelationalOperation(baseGt);\n\n /**\n * Checks if `value` is greater than or equal to `other`.\n *\n * @static\n * @memberOf _\n * @since 3.9.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if `value` is greater than or equal to\n * `other`, else `false`.\n * @see _.lte\n * @example\n *\n * _.gte(3, 1);\n * // => true\n *\n * _.gte(3, 3);\n * // => true\n *\n * _.gte(1, 3);\n * // => false\n */\n var gte = createRelationalOperation(function(value, other) {\n return value >= other;\n });\n\n /**\n * Checks if `value` is likely an `arguments` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an `arguments` object,\n * else `false`.\n * @example\n *\n * _.isArguments(function() { return arguments; }());\n * // => true\n *\n * _.isArguments([1, 2, 3]);\n * // => false\n */\n var isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) {\n return isObjectLike(value) && hasOwnProperty.call(value, 'callee') &&\n !propertyIsEnumerable.call(value, 'callee');\n };\n\n /**\n * Checks if `value` is classified as an `Array` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array, else `false`.\n * @example\n *\n * _.isArray([1, 2, 3]);\n * // => true\n *\n * _.isArray(document.body.children);\n * // => false\n *\n * _.isArray('abc');\n * // => false\n *\n * _.isArray(_.noop);\n * // => false\n */\n var isArray = Array.isArray;\n\n /**\n * Checks if `value` is classified as an `ArrayBuffer` object.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array buffer, else `false`.\n * @example\n *\n * _.isArrayBuffer(new ArrayBuffer(2));\n * // => true\n *\n * _.isArrayBuffer(new Array(2));\n * // => false\n */\n var isArrayBuffer = nodeIsArrayBuffer ? baseUnary(nodeIsArrayBuffer) : baseIsArrayBuffer;\n\n /**\n * Checks if `value` is array-like. A value is considered array-like if it's\n * not a function and has a `value.length` that's an integer greater than or\n * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is array-like, else `false`.\n * @example\n *\n * _.isArrayLike([1, 2, 3]);\n * // => true\n *\n * _.isArrayLike(document.body.children);\n * // => true\n *\n * _.isArrayLike('abc');\n * // => true\n *\n * _.isArrayLike(_.noop);\n * // => false\n */\n function isArrayLike(value) {\n return value != null && isLength(value.length) && !isFunction(value);\n }\n\n /**\n * This method is like `_.isArrayLike` except that it also checks if `value`\n * is an object.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array-like object,\n * else `false`.\n * @example\n *\n * _.isArrayLikeObject([1, 2, 3]);\n * // => true\n *\n * _.isArrayLikeObject(document.body.children);\n * // => true\n *\n * _.isArrayLikeObject('abc');\n * // => false\n *\n * _.isArrayLikeObject(_.noop);\n * // => false\n */\n function isArrayLikeObject(value) {\n return isObjectLike(value) && isArrayLike(value);\n }\n\n /**\n * Checks if `value` is classified as a boolean primitive or object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a boolean, else `false`.\n * @example\n *\n * _.isBoolean(false);\n * // => true\n *\n * _.isBoolean(null);\n * // => false\n */\n function isBoolean(value) {\n return value === true || value === false ||\n (isObjectLike(value) && baseGetTag(value) == boolTag);\n }\n\n /**\n * Checks if `value` is a buffer.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.\n * @example\n *\n * _.isBuffer(new Buffer(2));\n * // => true\n *\n * _.isBuffer(new Uint8Array(2));\n * // => false\n */\n var isBuffer = nativeIsBuffer || stubFalse;\n\n /**\n * Checks if `value` is classified as a `Date` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a date object, else `false`.\n * @example\n *\n * _.isDate(new Date);\n * // => true\n *\n * _.isDate('Mon April 23 2012');\n * // => false\n */\n var isDate = nodeIsDate ? baseUnary(nodeIsDate) : baseIsDate;\n\n /**\n * Checks if `value` is likely a DOM element.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a DOM element, else `false`.\n * @example\n *\n * _.isElement(document.body);\n * // => true\n *\n * _.isElement('');\n * // => false\n */\n function isElement(value) {\n return isObjectLike(value) && value.nodeType === 1 && !isPlainObject(value);\n }\n\n /**\n * Checks if `value` is an empty object, collection, map, or set.\n *\n * Objects are considered empty if they have no own enumerable string keyed\n * properties.\n *\n * Array-like values such as `arguments` objects, arrays, buffers, strings, or\n * jQuery-like collections are considered empty if they have a `length` of `0`.\n * Similarly, maps and sets are considered empty if they have a `size` of `0`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is empty, else `false`.\n * @example\n *\n * _.isEmpty(null);\n * // => true\n *\n * _.isEmpty(true);\n * // => true\n *\n * _.isEmpty(1);\n * // => true\n *\n * _.isEmpty([1, 2, 3]);\n * // => false\n *\n * _.isEmpty({ 'a': 1 });\n * // => false\n */\n function isEmpty(value) {\n if (value == null) {\n return true;\n }\n if (isArrayLike(value) &&\n (isArray(value) || typeof value == 'string' || typeof value.splice == 'function' ||\n isBuffer(value) || isTypedArray(value) || isArguments(value))) {\n return !value.length;\n }\n var tag = getTag(value);\n if (tag == mapTag || tag == setTag) {\n return !value.size;\n }\n if (isPrototype(value)) {\n return !baseKeys(value).length;\n }\n for (var key in value) {\n if (hasOwnProperty.call(value, key)) {\n return false;\n }\n }\n return true;\n }\n\n /**\n * Performs a deep comparison between two values to determine if they are\n * equivalent.\n *\n * **Note:** This method supports comparing arrays, array buffers, booleans,\n * date objects, error objects, maps, numbers, `Object` objects, regexes,\n * sets, strings, symbols, and typed arrays. `Object` objects are compared\n * by their own, not inherited, enumerable properties. Functions and DOM\n * nodes are compared by strict equality, i.e. `===`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n * @example\n *\n * var object = { 'a': 1 };\n * var other = { 'a': 1 };\n *\n * _.isEqual(object, other);\n * // => true\n *\n * object === other;\n * // => false\n */\n function isEqual(value, other) {\n return baseIsEqual(value, other);\n }\n\n /**\n * This method is like `_.isEqual` except that it accepts `customizer` which\n * is invoked to compare values. If `customizer` returns `undefined`, comparisons\n * are handled by the method instead. The `customizer` is invoked with up to\n * six arguments: (objValue, othValue [, index|key, object, other, stack]).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @param {Function} [customizer] The function to customize comparisons.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n * @example\n *\n * function isGreeting(value) {\n * return /^h(?:i|ello)$/.test(value);\n * }\n *\n * function customizer(objValue, othValue) {\n * if (isGreeting(objValue) && isGreeting(othValue)) {\n * return true;\n * }\n * }\n *\n * var array = ['hello', 'goodbye'];\n * var other = ['hi', 'goodbye'];\n *\n * _.isEqualWith(array, other, customizer);\n * // => true\n */\n function isEqualWith(value, other, customizer) {\n customizer = typeof customizer == 'function' ? customizer : undefined;\n var result = customizer ? customizer(value, other) : undefined;\n return result === undefined ? baseIsEqual(value, other, undefined, customizer) : !!result;\n }\n\n /**\n * Checks if `value` is an `Error`, `EvalError`, `RangeError`, `ReferenceError`,\n * `SyntaxError`, `TypeError`, or `URIError` object.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an error object, else `false`.\n * @example\n *\n * _.isError(new Error);\n * // => true\n *\n * _.isError(Error);\n * // => false\n */\n function isError(value) {\n if (!isObjectLike(value)) {\n return false;\n }\n var tag = baseGetTag(value);\n return tag == errorTag || tag == domExcTag ||\n (typeof value.message == 'string' && typeof value.name == 'string' && !isPlainObject(value));\n }\n\n /**\n * Checks if `value` is a finite primitive number.\n *\n * **Note:** This method is based on\n * [`Number.isFinite`](https://mdn.io/Number/isFinite).\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a finite number, else `false`.\n * @example\n *\n * _.isFinite(3);\n * // => true\n *\n * _.isFinite(Number.MIN_VALUE);\n * // => true\n *\n * _.isFinite(Infinity);\n * // => false\n *\n * _.isFinite('3');\n * // => false\n */\n function isFinite(value) {\n return typeof value == 'number' && nativeIsFinite(value);\n }\n\n /**\n * Checks if `value` is classified as a `Function` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a function, else `false`.\n * @example\n *\n * _.isFunction(_);\n * // => true\n *\n * _.isFunction(/abc/);\n * // => false\n */\n function isFunction(value) {\n if (!isObject(value)) {\n return false;\n }\n // The use of `Object#toString` avoids issues with the `typeof` operator\n // in Safari 9 which returns 'object' for typed arrays and other constructors.\n var tag = baseGetTag(value);\n return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;\n }\n\n /**\n * Checks if `value` is an integer.\n *\n * **Note:** This method is based on\n * [`Number.isInteger`](https://mdn.io/Number/isInteger).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an integer, else `false`.\n * @example\n *\n * _.isInteger(3);\n * // => true\n *\n * _.isInteger(Number.MIN_VALUE);\n * // => false\n *\n * _.isInteger(Infinity);\n * // => false\n *\n * _.isInteger('3');\n * // => false\n */\n function isInteger(value) {\n return typeof value == 'number' && value == toInteger(value);\n }\n\n /**\n * Checks if `value` is a valid array-like length.\n *\n * **Note:** This method is loosely based on\n * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.\n * @example\n *\n * _.isLength(3);\n * // => true\n *\n * _.isLength(Number.MIN_VALUE);\n * // => false\n *\n * _.isLength(Infinity);\n * // => false\n *\n * _.isLength('3');\n * // => false\n */\n function isLength(value) {\n return typeof value == 'number' &&\n value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;\n }\n\n /**\n * Checks if `value` is the\n * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)\n * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an object, else `false`.\n * @example\n *\n * _.isObject({});\n * // => true\n *\n * _.isObject([1, 2, 3]);\n * // => true\n *\n * _.isObject(_.noop);\n * // => true\n *\n * _.isObject(null);\n * // => false\n */\n function isObject(value) {\n var type = typeof value;\n return value != null && (type == 'object' || type == 'function');\n }\n\n /**\n * Checks if `value` is object-like. A value is object-like if it's not `null`\n * and has a `typeof` result of \"object\".\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n * @example\n *\n * _.isObjectLike({});\n * // => true\n *\n * _.isObjectLike([1, 2, 3]);\n * // => true\n *\n * _.isObjectLike(_.noop);\n * // => false\n *\n * _.isObjectLike(null);\n * // => false\n */\n function isObjectLike(value) {\n return value != null && typeof value == 'object';\n }\n\n /**\n * Checks if `value` is classified as a `Map` object.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a map, else `false`.\n * @example\n *\n * _.isMap(new Map);\n * // => true\n *\n * _.isMap(new WeakMap);\n * // => false\n */\n var isMap = nodeIsMap ? baseUnary(nodeIsMap) : baseIsMap;\n\n /**\n * Performs a partial deep comparison between `object` and `source` to\n * determine if `object` contains equivalent property values.\n *\n * **Note:** This method is equivalent to `_.matches` when `source` is\n * partially applied.\n *\n * Partial comparisons will match empty array and empty object `source`\n * values against any array or object value, respectively. See `_.isEqual`\n * for a list of supported value comparisons.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Lang\n * @param {Object} object The object to inspect.\n * @param {Object} source The object of property values to match.\n * @returns {boolean} Returns `true` if `object` is a match, else `false`.\n * @example\n *\n * var object = { 'a': 1, 'b': 2 };\n *\n * _.isMatch(object, { 'b': 2 });\n * // => true\n *\n * _.isMatch(object, { 'b': 1 });\n * // => false\n */\n function isMatch(object, source) {\n return object === source || baseIsMatch(object, source, getMatchData(source));\n }\n\n /**\n * This method is like `_.isMatch` except that it accepts `customizer` which\n * is invoked to compare values. If `customizer` returns `undefined`, comparisons\n * are handled by the method instead. The `customizer` is invoked with five\n * arguments: (objValue, srcValue, index|key, object, source).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {Object} object The object to inspect.\n * @param {Object} source The object of property values to match.\n * @param {Function} [customizer] The function to customize comparisons.\n * @returns {boolean} Returns `true` if `object` is a match, else `false`.\n * @example\n *\n * function isGreeting(value) {\n * return /^h(?:i|ello)$/.test(value);\n * }\n *\n * function customizer(objValue, srcValue) {\n * if (isGreeting(objValue) && isGreeting(srcValue)) {\n * return true;\n * }\n * }\n *\n * var object = { 'greeting': 'hello' };\n * var source = { 'greeting': 'hi' };\n *\n * _.isMatchWith(object, source, customizer);\n * // => true\n */\n function isMatchWith(object, source, customizer) {\n customizer = typeof customizer == 'function' ? customizer : undefined;\n return baseIsMatch(object, source, getMatchData(source), customizer);\n }\n\n /**\n * Checks if `value` is `NaN`.\n *\n * **Note:** This method is based on\n * [`Number.isNaN`](https://mdn.io/Number/isNaN) and is not the same as\n * global [`isNaN`](https://mdn.io/isNaN) which returns `true` for\n * `undefined` and other non-number values.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.\n * @example\n *\n * _.isNaN(NaN);\n * // => true\n *\n * _.isNaN(new Number(NaN));\n * // => true\n *\n * isNaN(undefined);\n * // => true\n *\n * _.isNaN(undefined);\n * // => false\n */\n function isNaN(value) {\n // An `NaN` primitive is the only value that is not equal to itself.\n // Perform the `toStringTag` check first to avoid errors with some\n // ActiveX objects in IE.\n return isNumber(value) && value != +value;\n }\n\n /**\n * Checks if `value` is a pristine native function.\n *\n * **Note:** This method can't reliably detect native functions in the presence\n * of the core-js package because core-js circumvents this kind of detection.\n * Despite multiple requests, the core-js maintainer has made it clear: any\n * attempt to fix the detection will be obstructed. As a result, we're left\n * with little choice but to throw an error. Unfortunately, this also affects\n * packages, like [babel-polyfill](https://www.npmjs.com/package/babel-polyfill),\n * which rely on core-js.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a native function,\n * else `false`.\n * @example\n *\n * _.isNative(Array.prototype.push);\n * // => true\n *\n * _.isNative(_);\n * // => false\n */\n function isNative(value) {\n if (isMaskable(value)) {\n throw new Error(CORE_ERROR_TEXT);\n }\n return baseIsNative(value);\n }\n\n /**\n * Checks if `value` is `null`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is `null`, else `false`.\n * @example\n *\n * _.isNull(null);\n * // => true\n *\n * _.isNull(void 0);\n * // => false\n */\n function isNull(value) {\n return value === null;\n }\n\n /**\n * Checks if `value` is `null` or `undefined`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is nullish, else `false`.\n * @example\n *\n * _.isNil(null);\n * // => true\n *\n * _.isNil(void 0);\n * // => true\n *\n * _.isNil(NaN);\n * // => false\n */\n function isNil(value) {\n return value == null;\n }\n\n /**\n * Checks if `value` is classified as a `Number` primitive or object.\n *\n * **Note:** To exclude `Infinity`, `-Infinity`, and `NaN`, which are\n * classified as numbers, use the `_.isFinite` method.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a number, else `false`.\n * @example\n *\n * _.isNumber(3);\n * // => true\n *\n * _.isNumber(Number.MIN_VALUE);\n * // => true\n *\n * _.isNumber(Infinity);\n * // => true\n *\n * _.isNumber('3');\n * // => false\n */\n function isNumber(value) {\n return typeof value == 'number' ||\n (isObjectLike(value) && baseGetTag(value) == numberTag);\n }\n\n /**\n * Checks if `value` is a plain object, that is, an object created by the\n * `Object` constructor or one with a `[[Prototype]]` of `null`.\n *\n * @static\n * @memberOf _\n * @since 0.8.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a plain object, else `false`.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * }\n *\n * _.isPlainObject(new Foo);\n * // => false\n *\n * _.isPlainObject([1, 2, 3]);\n * // => false\n *\n * _.isPlainObject({ 'x': 0, 'y': 0 });\n * // => true\n *\n * _.isPlainObject(Object.create(null));\n * // => true\n */\n function isPlainObject(value) {\n if (!isObjectLike(value) || baseGetTag(value) != objectTag) {\n return false;\n }\n var proto = getPrototype(value);\n if (proto === null) {\n return true;\n }\n var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor;\n return typeof Ctor == 'function' && Ctor instanceof Ctor &&\n funcToString.call(Ctor) == objectCtorString;\n }\n\n /**\n * Checks if `value` is classified as a `RegExp` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a regexp, else `false`.\n * @example\n *\n * _.isRegExp(/abc/);\n * // => true\n *\n * _.isRegExp('/abc/');\n * // => false\n */\n var isRegExp = nodeIsRegExp ? baseUnary(nodeIsRegExp) : baseIsRegExp;\n\n /**\n * Checks if `value` is a safe integer. An integer is safe if it's an IEEE-754\n * double precision number which isn't the result of a rounded unsafe integer.\n *\n * **Note:** This method is based on\n * [`Number.isSafeInteger`](https://mdn.io/Number/isSafeInteger).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a safe integer, else `false`.\n * @example\n *\n * _.isSafeInteger(3);\n * // => true\n *\n * _.isSafeInteger(Number.MIN_VALUE);\n * // => false\n *\n * _.isSafeInteger(Infinity);\n * // => false\n *\n * _.isSafeInteger('3');\n * // => false\n */\n function isSafeInteger(value) {\n return isInteger(value) && value >= -MAX_SAFE_INTEGER && value <= MAX_SAFE_INTEGER;\n }\n\n /**\n * Checks if `value` is classified as a `Set` object.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a set, else `false`.\n * @example\n *\n * _.isSet(new Set);\n * // => true\n *\n * _.isSet(new WeakSet);\n * // => false\n */\n var isSet = nodeIsSet ? baseUnary(nodeIsSet) : baseIsSet;\n\n /**\n * Checks if `value` is classified as a `String` primitive or object.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a string, else `false`.\n * @example\n *\n * _.isString('abc');\n * // => true\n *\n * _.isString(1);\n * // => false\n */\n function isString(value) {\n return typeof value == 'string' ||\n (!isArray(value) && isObjectLike(value) && baseGetTag(value) == stringTag);\n }\n\n /**\n * Checks if `value` is classified as a `Symbol` primitive or object.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.\n * @example\n *\n * _.isSymbol(Symbol.iterator);\n * // => true\n *\n * _.isSymbol('abc');\n * // => false\n */\n function isSymbol(value) {\n return typeof value == 'symbol' ||\n (isObjectLike(value) && baseGetTag(value) == symbolTag);\n }\n\n /**\n * Checks if `value` is classified as a typed array.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.\n * @example\n *\n * _.isTypedArray(new Uint8Array);\n * // => true\n *\n * _.isTypedArray([]);\n * // => false\n */\n var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;\n\n /**\n * Checks if `value` is `undefined`.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is `undefined`, else `false`.\n * @example\n *\n * _.isUndefined(void 0);\n * // => true\n *\n * _.isUndefined(null);\n * // => false\n */\n function isUndefined(value) {\n return value === undefined;\n }\n\n /**\n * Checks if `value` is classified as a `WeakMap` object.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a weak map, else `false`.\n * @example\n *\n * _.isWeakMap(new WeakMap);\n * // => true\n *\n * _.isWeakMap(new Map);\n * // => false\n */\n function isWeakMap(value) {\n return isObjectLike(value) && getTag(value) == weakMapTag;\n }\n\n /**\n * Checks if `value` is classified as a `WeakSet` object.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a weak set, else `false`.\n * @example\n *\n * _.isWeakSet(new WeakSet);\n * // => true\n *\n * _.isWeakSet(new Set);\n * // => false\n */\n function isWeakSet(value) {\n return isObjectLike(value) && baseGetTag(value) == weakSetTag;\n }\n\n /**\n * Checks if `value` is less than `other`.\n *\n * @static\n * @memberOf _\n * @since 3.9.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if `value` is less than `other`,\n * else `false`.\n * @see _.gt\n * @example\n *\n * _.lt(1, 3);\n * // => true\n *\n * _.lt(3, 3);\n * // => false\n *\n * _.lt(3, 1);\n * // => false\n */\n var lt = createRelationalOperation(baseLt);\n\n /**\n * Checks if `value` is less than or equal to `other`.\n *\n * @static\n * @memberOf _\n * @since 3.9.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if `value` is less than or equal to\n * `other`, else `false`.\n * @see _.gte\n * @example\n *\n * _.lte(1, 3);\n * // => true\n *\n * _.lte(3, 3);\n * // => true\n *\n * _.lte(3, 1);\n * // => false\n */\n var lte = createRelationalOperation(function(value, other) {\n return value <= other;\n });\n\n /**\n * Converts `value` to an array.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {Array} Returns the converted array.\n * @example\n *\n * _.toArray({ 'a': 1, 'b': 2 });\n * // => [1, 2]\n *\n * _.toArray('abc');\n * // => ['a', 'b', 'c']\n *\n * _.toArray(1);\n * // => []\n *\n * _.toArray(null);\n * // => []\n */\n function toArray(value) {\n if (!value) {\n return [];\n }\n if (isArrayLike(value)) {\n return isString(value) ? stringToArray(value) : copyArray(value);\n }\n if (symIterator && value[symIterator]) {\n return iteratorToArray(value[symIterator]());\n }\n var tag = getTag(value),\n func = tag == mapTag ? mapToArray : (tag == setTag ? setToArray : values);\n\n return func(value);\n }\n\n /**\n * Converts `value` to a finite number.\n *\n * @static\n * @memberOf _\n * @since 4.12.0\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {number} Returns the converted number.\n * @example\n *\n * _.toFinite(3.2);\n * // => 3.2\n *\n * _.toFinite(Number.MIN_VALUE);\n * // => 5e-324\n *\n * _.toFinite(Infinity);\n * // => 1.7976931348623157e+308\n *\n * _.toFinite('3.2');\n * // => 3.2\n */\n function toFinite(value) {\n if (!value) {\n return value === 0 ? value : 0;\n }\n value = toNumber(value);\n if (value === INFINITY || value === -INFINITY) {\n var sign = (value < 0 ? -1 : 1);\n return sign * MAX_INTEGER;\n }\n return value === value ? value : 0;\n }\n\n /**\n * Converts `value` to an integer.\n *\n * **Note:** This method is loosely based on\n * [`ToInteger`](http://www.ecma-international.org/ecma-262/7.0/#sec-tointeger).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {number} Returns the converted integer.\n * @example\n *\n * _.toInteger(3.2);\n * // => 3\n *\n * _.toInteger(Number.MIN_VALUE);\n * // => 0\n *\n * _.toInteger(Infinity);\n * // => 1.7976931348623157e+308\n *\n * _.toInteger('3.2');\n * // => 3\n */\n function toInteger(value) {\n var result = toFinite(value),\n remainder = result % 1;\n\n return result === result ? (remainder ? result - remainder : result) : 0;\n }\n\n /**\n * Converts `value` to an integer suitable for use as the length of an\n * array-like object.\n *\n * **Note:** This method is based on\n * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {number} Returns the converted integer.\n * @example\n *\n * _.toLength(3.2);\n * // => 3\n *\n * _.toLength(Number.MIN_VALUE);\n * // => 0\n *\n * _.toLength(Infinity);\n * // => 4294967295\n *\n * _.toLength('3.2');\n * // => 3\n */\n function toLength(value) {\n return value ? baseClamp(toInteger(value), 0, MAX_ARRAY_LENGTH) : 0;\n }\n\n /**\n * Converts `value` to a number.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to process.\n * @returns {number} Returns the number.\n * @example\n *\n * _.toNumber(3.2);\n * // => 3.2\n *\n * _.toNumber(Number.MIN_VALUE);\n * // => 5e-324\n *\n * _.toNumber(Infinity);\n * // => Infinity\n *\n * _.toNumber('3.2');\n * // => 3.2\n */\n function toNumber(value) {\n if (typeof value == 'number') {\n return value;\n }\n if (isSymbol(value)) {\n return NAN;\n }\n if (isObject(value)) {\n var other = typeof value.valueOf == 'function' ? value.valueOf() : value;\n value = isObject(other) ? (other + '') : other;\n }\n if (typeof value != 'string') {\n return value === 0 ? value : +value;\n }\n value = value.replace(reTrim, '');\n var isBinary = reIsBinary.test(value);\n return (isBinary || reIsOctal.test(value))\n ? freeParseInt(value.slice(2), isBinary ? 2 : 8)\n : (reIsBadHex.test(value) ? NAN : +value);\n }\n\n /**\n * Converts `value` to a plain object flattening inherited enumerable string\n * keyed properties of `value` to own properties of the plain object.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {Object} Returns the converted plain object.\n * @example\n *\n * function Foo() {\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.assign({ 'a': 1 }, new Foo);\n * // => { 'a': 1, 'b': 2 }\n *\n * _.assign({ 'a': 1 }, _.toPlainObject(new Foo));\n * // => { 'a': 1, 'b': 2, 'c': 3 }\n */\n function toPlainObject(value) {\n return copyObject(value, keysIn(value));\n }\n\n /**\n * Converts `value` to a safe integer. A safe integer can be compared and\n * represented correctly.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {number} Returns the converted integer.\n * @example\n *\n * _.toSafeInteger(3.2);\n * // => 3\n *\n * _.toSafeInteger(Number.MIN_VALUE);\n * // => 0\n *\n * _.toSafeInteger(Infinity);\n * // => 9007199254740991\n *\n * _.toSafeInteger('3.2');\n * // => 3\n */\n function toSafeInteger(value) {\n return value\n ? baseClamp(toInteger(value), -MAX_SAFE_INTEGER, MAX_SAFE_INTEGER)\n : (value === 0 ? value : 0);\n }\n\n /**\n * Converts `value` to a string. An empty string is returned for `null`\n * and `undefined` values. The sign of `-0` is preserved.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {string} Returns the converted string.\n * @example\n *\n * _.toString(null);\n * // => ''\n *\n * _.toString(-0);\n * // => '-0'\n *\n * _.toString([1, 2, 3]);\n * // => '1,2,3'\n */\n function toString(value) {\n return value == null ? '' : baseToString(value);\n }\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Assigns own enumerable string keyed properties of source objects to the\n * destination object. Source objects are applied from left to right.\n * Subsequent sources overwrite property assignments of previous sources.\n *\n * **Note:** This method mutates `object` and is loosely based on\n * [`Object.assign`](https://mdn.io/Object/assign).\n *\n * @static\n * @memberOf _\n * @since 0.10.0\n * @category Object\n * @param {Object} object The destination object.\n * @param {...Object} [sources] The source objects.\n * @returns {Object} Returns `object`.\n * @see _.assignIn\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * }\n *\n * function Bar() {\n * this.c = 3;\n * }\n *\n * Foo.prototype.b = 2;\n * Bar.prototype.d = 4;\n *\n * _.assign({ 'a': 0 }, new Foo, new Bar);\n * // => { 'a': 1, 'c': 3 }\n */\n var assign = createAssigner(function(object, source) {\n if (isPrototype(source) || isArrayLike(source)) {\n copyObject(source, keys(source), object);\n return;\n }\n for (var key in source) {\n if (hasOwnProperty.call(source, key)) {\n assignValue(object, key, source[key]);\n }\n }\n });\n\n /**\n * This method is like `_.assign` except that it iterates over own and\n * inherited source properties.\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @alias extend\n * @category Object\n * @param {Object} object The destination object.\n * @param {...Object} [sources] The source objects.\n * @returns {Object} Returns `object`.\n * @see _.assign\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * }\n *\n * function Bar() {\n * this.c = 3;\n * }\n *\n * Foo.prototype.b = 2;\n * Bar.prototype.d = 4;\n *\n * _.assignIn({ 'a': 0 }, new Foo, new Bar);\n * // => { 'a': 1, 'b': 2, 'c': 3, 'd': 4 }\n */\n var assignIn = createAssigner(function(object, source) {\n copyObject(source, keysIn(source), object);\n });\n\n /**\n * This method is like `_.assignIn` except that it accepts `customizer`\n * which is invoked to produce the assigned values. If `customizer` returns\n * `undefined`, assignment is handled by the method instead. The `customizer`\n * is invoked with five arguments: (objValue, srcValue, key, object, source).\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @alias extendWith\n * @category Object\n * @param {Object} object The destination object.\n * @param {...Object} sources The source objects.\n * @param {Function} [customizer] The function to customize assigned values.\n * @returns {Object} Returns `object`.\n * @see _.assignWith\n * @example\n *\n * function customizer(objValue, srcValue) {\n * return _.isUndefined(objValue) ? srcValue : objValue;\n * }\n *\n * var defaults = _.partialRight(_.assignInWith, customizer);\n *\n * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });\n * // => { 'a': 1, 'b': 2 }\n */\n var assignInWith = createAssigner(function(object, source, srcIndex, customizer) {\n copyObject(source, keysIn(source), object, customizer);\n });\n\n /**\n * This method is like `_.assign` except that it accepts `customizer`\n * which is invoked to produce the assigned values. If `customizer` returns\n * `undefined`, assignment is handled by the method instead. The `customizer`\n * is invoked with five arguments: (objValue, srcValue, key, object, source).\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Object\n * @param {Object} object The destination object.\n * @param {...Object} sources The source objects.\n * @param {Function} [customizer] The function to customize assigned values.\n * @returns {Object} Returns `object`.\n * @see _.assignInWith\n * @example\n *\n * function customizer(objValue, srcValue) {\n * return _.isUndefined(objValue) ? srcValue : objValue;\n * }\n *\n * var defaults = _.partialRight(_.assignWith, customizer);\n *\n * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });\n * // => { 'a': 1, 'b': 2 }\n */\n var assignWith = createAssigner(function(object, source, srcIndex, customizer) {\n copyObject(source, keys(source), object, customizer);\n });\n\n /**\n * Creates an array of values corresponding to `paths` of `object`.\n *\n * @static\n * @memberOf _\n * @since 1.0.0\n * @category Object\n * @param {Object} object The object to iterate over.\n * @param {...(string|string[])} [paths] The property paths to pick.\n * @returns {Array} Returns the picked values.\n * @example\n *\n * var object = { 'a': [{ 'b': { 'c': 3 } }, 4] };\n *\n * _.at(object, ['a[0].b.c', 'a[1]']);\n * // => [3, 4]\n */\n var at = flatRest(baseAt);\n\n /**\n * Creates an object that inherits from the `prototype` object. If a\n * `properties` object is given, its own enumerable string keyed properties\n * are assigned to the created object.\n *\n * @static\n * @memberOf _\n * @since 2.3.0\n * @category Object\n * @param {Object} prototype The object to inherit from.\n * @param {Object} [properties] The properties to assign to the object.\n * @returns {Object} Returns the new object.\n * @example\n *\n * function Shape() {\n * this.x = 0;\n * this.y = 0;\n * }\n *\n * function Circle() {\n * Shape.call(this);\n * }\n *\n * Circle.prototype = _.create(Shape.prototype, {\n * 'constructor': Circle\n * });\n *\n * var circle = new Circle;\n * circle instanceof Circle;\n * // => true\n *\n * circle instanceof Shape;\n * // => true\n */\n function create(prototype, properties) {\n var result = baseCreate(prototype);\n return properties == null ? result : baseAssign(result, properties);\n }\n\n /**\n * Assigns own and inherited enumerable string keyed properties of source\n * objects to the destination object for all destination properties that\n * resolve to `undefined`. Source objects are applied from left to right.\n * Once a property is set, additional values of the same property are ignored.\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The destination object.\n * @param {...Object} [sources] The source objects.\n * @returns {Object} Returns `object`.\n * @see _.defaultsDeep\n * @example\n *\n * _.defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });\n * // => { 'a': 1, 'b': 2 }\n */\n var defaults = baseRest(function(object, sources) {\n object = Object(object);\n\n var index = -1;\n var length = sources.length;\n var guard = length > 2 ? sources[2] : undefined;\n\n if (guard && isIterateeCall(sources[0], sources[1], guard)) {\n length = 1;\n }\n\n while (++index < length) {\n var source = sources[index];\n var props = keysIn(source);\n var propsIndex = -1;\n var propsLength = props.length;\n\n while (++propsIndex < propsLength) {\n var key = props[propsIndex];\n var value = object[key];\n\n if (value === undefined ||\n (eq(value, objectProto[key]) && !hasOwnProperty.call(object, key))) {\n object[key] = source[key];\n }\n }\n }\n\n return object;\n });\n\n /**\n * This method is like `_.defaults` except that it recursively assigns\n * default properties.\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 3.10.0\n * @category Object\n * @param {Object} object The destination object.\n * @param {...Object} [sources] The source objects.\n * @returns {Object} Returns `object`.\n * @see _.defaults\n * @example\n *\n * _.defaultsDeep({ 'a': { 'b': 2 } }, { 'a': { 'b': 1, 'c': 3 } });\n * // => { 'a': { 'b': 2, 'c': 3 } }\n */\n var defaultsDeep = baseRest(function(args) {\n args.push(undefined, customDefaultsMerge);\n return apply(mergeWith, undefined, args);\n });\n\n /**\n * This method is like `_.find` except that it returns the key of the first\n * element `predicate` returns truthy for instead of the element itself.\n *\n * @static\n * @memberOf _\n * @since 1.1.0\n * @category Object\n * @param {Object} object The object to inspect.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @returns {string|undefined} Returns the key of the matched element,\n * else `undefined`.\n * @example\n *\n * var users = {\n * 'barney': { 'age': 36, 'active': true },\n * 'fred': { 'age': 40, 'active': false },\n * 'pebbles': { 'age': 1, 'active': true }\n * };\n *\n * _.findKey(users, function(o) { return o.age < 40; });\n * // => 'barney' (iteration order is not guaranteed)\n *\n * // The `_.matches` iteratee shorthand.\n * _.findKey(users, { 'age': 1, 'active': true });\n * // => 'pebbles'\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.findKey(users, ['active', false]);\n * // => 'fred'\n *\n * // The `_.property` iteratee shorthand.\n * _.findKey(users, 'active');\n * // => 'barney'\n */\n function findKey(object, predicate) {\n return baseFindKey(object, getIteratee(predicate, 3), baseForOwn);\n }\n\n /**\n * This method is like `_.findKey` except that it iterates over elements of\n * a collection in the opposite order.\n *\n * @static\n * @memberOf _\n * @since 2.0.0\n * @category Object\n * @param {Object} object The object to inspect.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @returns {string|undefined} Returns the key of the matched element,\n * else `undefined`.\n * @example\n *\n * var users = {\n * 'barney': { 'age': 36, 'active': true },\n * 'fred': { 'age': 40, 'active': false },\n * 'pebbles': { 'age': 1, 'active': true }\n * };\n *\n * _.findLastKey(users, function(o) { return o.age < 40; });\n * // => returns 'pebbles' assuming `_.findKey` returns 'barney'\n *\n * // The `_.matches` iteratee shorthand.\n * _.findLastKey(users, { 'age': 36, 'active': true });\n * // => 'barney'\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.findLastKey(users, ['active', false]);\n * // => 'fred'\n *\n * // The `_.property` iteratee shorthand.\n * _.findLastKey(users, 'active');\n * // => 'pebbles'\n */\n function findLastKey(object, predicate) {\n return baseFindKey(object, getIteratee(predicate, 3), baseForOwnRight);\n }\n\n /**\n * Iterates over own and inherited enumerable string keyed properties of an\n * object and invokes `iteratee` for each property. The iteratee is invoked\n * with three arguments: (value, key, object). Iteratee functions may exit\n * iteration early by explicitly returning `false`.\n *\n * @static\n * @memberOf _\n * @since 0.3.0\n * @category Object\n * @param {Object} object The object to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Object} Returns `object`.\n * @see _.forInRight\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.forIn(new Foo, function(value, key) {\n * console.log(key);\n * });\n * // => Logs 'a', 'b', then 'c' (iteration order is not guaranteed).\n */\n function forIn(object, iteratee) {\n return object == null\n ? object\n : baseFor(object, getIteratee(iteratee, 3), keysIn);\n }\n\n /**\n * This method is like `_.forIn` except that it iterates over properties of\n * `object` in the opposite order.\n *\n * @static\n * @memberOf _\n * @since 2.0.0\n * @category Object\n * @param {Object} object The object to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Object} Returns `object`.\n * @see _.forIn\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.forInRight(new Foo, function(value, key) {\n * console.log(key);\n * });\n * // => Logs 'c', 'b', then 'a' assuming `_.forIn` logs 'a', 'b', then 'c'.\n */\n function forInRight(object, iteratee) {\n return object == null\n ? object\n : baseForRight(object, getIteratee(iteratee, 3), keysIn);\n }\n\n /**\n * Iterates over own enumerable string keyed properties of an object and\n * invokes `iteratee` for each property. The iteratee is invoked with three\n * arguments: (value, key, object). Iteratee functions may exit iteration\n * early by explicitly returning `false`.\n *\n * @static\n * @memberOf _\n * @since 0.3.0\n * @category Object\n * @param {Object} object The object to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Object} Returns `object`.\n * @see _.forOwnRight\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.forOwn(new Foo, function(value, key) {\n * console.log(key);\n * });\n * // => Logs 'a' then 'b' (iteration order is not guaranteed).\n */\n function forOwn(object, iteratee) {\n return object && baseForOwn(object, getIteratee(iteratee, 3));\n }\n\n /**\n * This method is like `_.forOwn` except that it iterates over properties of\n * `object` in the opposite order.\n *\n * @static\n * @memberOf _\n * @since 2.0.0\n * @category Object\n * @param {Object} object The object to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Object} Returns `object`.\n * @see _.forOwn\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.forOwnRight(new Foo, function(value, key) {\n * console.log(key);\n * });\n * // => Logs 'b' then 'a' assuming `_.forOwn` logs 'a' then 'b'.\n */\n function forOwnRight(object, iteratee) {\n return object && baseForOwnRight(object, getIteratee(iteratee, 3));\n }\n\n /**\n * Creates an array of function property names from own enumerable properties\n * of `object`.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The object to inspect.\n * @returns {Array} Returns the function names.\n * @see _.functionsIn\n * @example\n *\n * function Foo() {\n * this.a = _.constant('a');\n * this.b = _.constant('b');\n * }\n *\n * Foo.prototype.c = _.constant('c');\n *\n * _.functions(new Foo);\n * // => ['a', 'b']\n */\n function functions(object) {\n return object == null ? [] : baseFunctions(object, keys(object));\n }\n\n /**\n * Creates an array of function property names from own and inherited\n * enumerable properties of `object`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Object\n * @param {Object} object The object to inspect.\n * @returns {Array} Returns the function names.\n * @see _.functions\n * @example\n *\n * function Foo() {\n * this.a = _.constant('a');\n * this.b = _.constant('b');\n * }\n *\n * Foo.prototype.c = _.constant('c');\n *\n * _.functionsIn(new Foo);\n * // => ['a', 'b', 'c']\n */\n function functionsIn(object) {\n return object == null ? [] : baseFunctions(object, keysIn(object));\n }\n\n /**\n * Gets the value at `path` of `object`. If the resolved value is\n * `undefined`, the `defaultValue` is returned in its place.\n *\n * @static\n * @memberOf _\n * @since 3.7.0\n * @category Object\n * @param {Object} object The object to query.\n * @param {Array|string} path The path of the property to get.\n * @param {*} [defaultValue] The value returned for `undefined` resolved values.\n * @returns {*} Returns the resolved value.\n * @example\n *\n * var object = { 'a': [{ 'b': { 'c': 3 } }] };\n *\n * _.get(object, 'a[0].b.c');\n * // => 3\n *\n * _.get(object, ['a', '0', 'b', 'c']);\n * // => 3\n *\n * _.get(object, 'a.b.c', 'default');\n * // => 'default'\n */\n function get(object, path, defaultValue) {\n var result = object == null ? undefined : baseGet(object, path);\n return result === undefined ? defaultValue : result;\n }\n\n /**\n * Checks if `path` is a direct property of `object`.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The object to query.\n * @param {Array|string} path The path to check.\n * @returns {boolean} Returns `true` if `path` exists, else `false`.\n * @example\n *\n * var object = { 'a': { 'b': 2 } };\n * var other = _.create({ 'a': _.create({ 'b': 2 }) });\n *\n * _.has(object, 'a');\n * // => true\n *\n * _.has(object, 'a.b');\n * // => true\n *\n * _.has(object, ['a', 'b']);\n * // => true\n *\n * _.has(other, 'a');\n * // => false\n */\n function has(object, path) {\n return object != null && hasPath(object, path, baseHas);\n }\n\n /**\n * Checks if `path` is a direct or inherited property of `object`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Object\n * @param {Object} object The object to query.\n * @param {Array|string} path The path to check.\n * @returns {boolean} Returns `true` if `path` exists, else `false`.\n * @example\n *\n * var object = _.create({ 'a': _.create({ 'b': 2 }) });\n *\n * _.hasIn(object, 'a');\n * // => true\n *\n * _.hasIn(object, 'a.b');\n * // => true\n *\n * _.hasIn(object, ['a', 'b']);\n * // => true\n *\n * _.hasIn(object, 'b');\n * // => false\n */\n function hasIn(object, path) {\n return object != null && hasPath(object, path, baseHasIn);\n }\n\n /**\n * Creates an object composed of the inverted keys and values of `object`.\n * If `object` contains duplicate values, subsequent values overwrite\n * property assignments of previous values.\n *\n * @static\n * @memberOf _\n * @since 0.7.0\n * @category Object\n * @param {Object} object The object to invert.\n * @returns {Object} Returns the new inverted object.\n * @example\n *\n * var object = { 'a': 1, 'b': 2, 'c': 1 };\n *\n * _.invert(object);\n * // => { '1': 'c', '2': 'b' }\n */\n var invert = createInverter(function(result, value, key) {\n if (value != null &&\n typeof value.toString != 'function') {\n value = nativeObjectToString.call(value);\n }\n\n result[value] = key;\n }, constant(identity));\n\n /**\n * This method is like `_.invert` except that the inverted object is generated\n * from the results of running each element of `object` thru `iteratee`. The\n * corresponding inverted value of each inverted key is an array of keys\n * responsible for generating the inverted value. The iteratee is invoked\n * with one argument: (value).\n *\n * @static\n * @memberOf _\n * @since 4.1.0\n * @category Object\n * @param {Object} object The object to invert.\n * @param {Function} [iteratee=_.identity] The iteratee invoked per element.\n * @returns {Object} Returns the new inverted object.\n * @example\n *\n * var object = { 'a': 1, 'b': 2, 'c': 1 };\n *\n * _.invertBy(object);\n * // => { '1': ['a', 'c'], '2': ['b'] }\n *\n * _.invertBy(object, function(value) {\n * return 'group' + value;\n * });\n * // => { 'group1': ['a', 'c'], 'group2': ['b'] }\n */\n var invertBy = createInverter(function(result, value, key) {\n if (value != null &&\n typeof value.toString != 'function') {\n value = nativeObjectToString.call(value);\n }\n\n if (hasOwnProperty.call(result, value)) {\n result[value].push(key);\n } else {\n result[value] = [key];\n }\n }, getIteratee);\n\n /**\n * Invokes the method at `path` of `object`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Object\n * @param {Object} object The object to query.\n * @param {Array|string} path The path of the method to invoke.\n * @param {...*} [args] The arguments to invoke the method with.\n * @returns {*} Returns the result of the invoked method.\n * @example\n *\n * var object = { 'a': [{ 'b': { 'c': [1, 2, 3, 4] } }] };\n *\n * _.invoke(object, 'a[0].b.c.slice', 1, 3);\n * // => [2, 3]\n */\n var invoke = baseRest(baseInvoke);\n\n /**\n * Creates an array of the own enumerable property names of `object`.\n *\n * **Note:** Non-object values are coerced to objects. See the\n * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)\n * for more details.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.keys(new Foo);\n * // => ['a', 'b'] (iteration order is not guaranteed)\n *\n * _.keys('hi');\n * // => ['0', '1']\n */\n function keys(object) {\n return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);\n }\n\n /**\n * Creates an array of the own and inherited enumerable property names of `object`.\n *\n * **Note:** Non-object values are coerced to objects.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.keysIn(new Foo);\n * // => ['a', 'b', 'c'] (iteration order is not guaranteed)\n */\n function keysIn(object) {\n return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object);\n }\n\n /**\n * The opposite of `_.mapValues`; this method creates an object with the\n * same values as `object` and keys generated by running each own enumerable\n * string keyed property of `object` thru `iteratee`. The iteratee is invoked\n * with three arguments: (value, key, object).\n *\n * @static\n * @memberOf _\n * @since 3.8.0\n * @category Object\n * @param {Object} object The object to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Object} Returns the new mapped object.\n * @see _.mapValues\n * @example\n *\n * _.mapKeys({ 'a': 1, 'b': 2 }, function(value, key) {\n * return key + value;\n * });\n * // => { 'a1': 1, 'b2': 2 }\n */\n function mapKeys(object, iteratee) {\n var result = {};\n iteratee = getIteratee(iteratee, 3);\n\n baseForOwn(object, function(value, key, object) {\n baseAssignValue(result, iteratee(value, key, object), value);\n });\n return result;\n }\n\n /**\n * Creates an object with the same keys as `object` and values generated\n * by running each own enumerable string keyed property of `object` thru\n * `iteratee`. The iteratee is invoked with three arguments:\n * (value, key, object).\n *\n * @static\n * @memberOf _\n * @since 2.4.0\n * @category Object\n * @param {Object} object The object to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Object} Returns the new mapped object.\n * @see _.mapKeys\n * @example\n *\n * var users = {\n * 'fred': { 'user': 'fred', 'age': 40 },\n * 'pebbles': { 'user': 'pebbles', 'age': 1 }\n * };\n *\n * _.mapValues(users, function(o) { return o.age; });\n * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed)\n *\n * // The `_.property` iteratee shorthand.\n * _.mapValues(users, 'age');\n * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed)\n */\n function mapValues(object, iteratee) {\n var result = {};\n iteratee = getIteratee(iteratee, 3);\n\n baseForOwn(object, function(value, key, object) {\n baseAssignValue(result, key, iteratee(value, key, object));\n });\n return result;\n }\n\n /**\n * This method is like `_.assign` except that it recursively merges own and\n * inherited enumerable string keyed properties of source objects into the\n * destination object. Source properties that resolve to `undefined` are\n * skipped if a destination value exists. Array and plain object properties\n * are merged recursively. Other objects and value types are overridden by\n * assignment. Source objects are applied from left to right. Subsequent\n * sources overwrite property assignments of previous sources.\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 0.5.0\n * @category Object\n * @param {Object} object The destination object.\n * @param {...Object} [sources] The source objects.\n * @returns {Object} Returns `object`.\n * @example\n *\n * var object = {\n * 'a': [{ 'b': 2 }, { 'd': 4 }]\n * };\n *\n * var other = {\n * 'a': [{ 'c': 3 }, { 'e': 5 }]\n * };\n *\n * _.merge(object, other);\n * // => { 'a': [{ 'b': 2, 'c': 3 }, { 'd': 4, 'e': 5 }] }\n */\n var merge = createAssigner(function(object, source, srcIndex) {\n baseMerge(object, source, srcIndex);\n });\n\n /**\n * This method is like `_.merge` except that it accepts `customizer` which\n * is invoked to produce the merged values of the destination and source\n * properties. If `customizer` returns `undefined`, merging is handled by the\n * method instead. The `customizer` is invoked with six arguments:\n * (objValue, srcValue, key, object, source, stack).\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Object\n * @param {Object} object The destination object.\n * @param {...Object} sources The source objects.\n * @param {Function} customizer The function to customize assigned values.\n * @returns {Object} Returns `object`.\n * @example\n *\n * function customizer(objValue, srcValue) {\n * if (_.isArray(objValue)) {\n * return objValue.concat(srcValue);\n * }\n * }\n *\n * var object = { 'a': [1], 'b': [2] };\n * var other = { 'a': [3], 'b': [4] };\n *\n * _.mergeWith(object, other, customizer);\n * // => { 'a': [1, 3], 'b': [2, 4] }\n */\n var mergeWith = createAssigner(function(object, source, srcIndex, customizer) {\n baseMerge(object, source, srcIndex, customizer);\n });\n\n /**\n * The opposite of `_.pick`; this method creates an object composed of the\n * own and inherited enumerable property paths of `object` that are not omitted.\n *\n * **Note:** This method is considerably slower than `_.pick`.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The source object.\n * @param {...(string|string[])} [paths] The property paths to omit.\n * @returns {Object} Returns the new object.\n * @example\n *\n * var object = { 'a': 1, 'b': '2', 'c': 3 };\n *\n * _.omit(object, ['a', 'c']);\n * // => { 'b': '2' }\n */\n var omit = flatRest(function(object, paths) {\n var result = {};\n if (object == null) {\n return result;\n }\n var isDeep = false;\n paths = arrayMap(paths, function(path) {\n path = castPath(path, object);\n isDeep || (isDeep = path.length > 1);\n return path;\n });\n copyObject(object, getAllKeysIn(object), result);\n if (isDeep) {\n result = baseClone(result, CLONE_DEEP_FLAG | CLONE_FLAT_FLAG | CLONE_SYMBOLS_FLAG, customOmitClone);\n }\n var length = paths.length;\n while (length--) {\n baseUnset(result, paths[length]);\n }\n return result;\n });\n\n /**\n * The opposite of `_.pickBy`; this method creates an object composed of\n * the own and inherited enumerable string keyed properties of `object` that\n * `predicate` doesn't return truthy for. The predicate is invoked with two\n * arguments: (value, key).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Object\n * @param {Object} object The source object.\n * @param {Function} [predicate=_.identity] The function invoked per property.\n * @returns {Object} Returns the new object.\n * @example\n *\n * var object = { 'a': 1, 'b': '2', 'c': 3 };\n *\n * _.omitBy(object, _.isNumber);\n * // => { 'b': '2' }\n */\n function omitBy(object, predicate) {\n return pickBy(object, negate(getIteratee(predicate)));\n }\n\n /**\n * Creates an object composed of the picked `object` properties.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The source object.\n * @param {...(string|string[])} [paths] The property paths to pick.\n * @returns {Object} Returns the new object.\n * @example\n *\n * var object = { 'a': 1, 'b': '2', 'c': 3 };\n *\n * _.pick(object, ['a', 'c']);\n * // => { 'a': 1, 'c': 3 }\n */\n var pick = flatRest(function(object, paths) {\n return object == null ? {} : basePick(object, paths);\n });\n\n /**\n * Creates an object composed of the `object` properties `predicate` returns\n * truthy for. The predicate is invoked with two arguments: (value, key).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Object\n * @param {Object} object The source object.\n * @param {Function} [predicate=_.identity] The function invoked per property.\n * @returns {Object} Returns the new object.\n * @example\n *\n * var object = { 'a': 1, 'b': '2', 'c': 3 };\n *\n * _.pickBy(object, _.isNumber);\n * // => { 'a': 1, 'c': 3 }\n */\n function pickBy(object, predicate) {\n if (object == null) {\n return {};\n }\n var props = arrayMap(getAllKeysIn(object), function(prop) {\n return [prop];\n });\n predicate = getIteratee(predicate);\n return basePickBy(object, props, function(value, path) {\n return predicate(value, path[0]);\n });\n }\n\n /**\n * This method is like `_.get` except that if the resolved value is a\n * function it's invoked with the `this` binding of its parent object and\n * its result is returned.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The object to query.\n * @param {Array|string} path The path of the property to resolve.\n * @param {*} [defaultValue] The value returned for `undefined` resolved values.\n * @returns {*} Returns the resolved value.\n * @example\n *\n * var object = { 'a': [{ 'b': { 'c1': 3, 'c2': _.constant(4) } }] };\n *\n * _.result(object, 'a[0].b.c1');\n * // => 3\n *\n * _.result(object, 'a[0].b.c2');\n * // => 4\n *\n * _.result(object, 'a[0].b.c3', 'default');\n * // => 'default'\n *\n * _.result(object, 'a[0].b.c3', _.constant('default'));\n * // => 'default'\n */\n function result(object, path, defaultValue) {\n path = castPath(path, object);\n\n var index = -1,\n length = path.length;\n\n // Ensure the loop is entered when path is empty.\n if (!length) {\n length = 1;\n object = undefined;\n }\n while (++index < length) {\n var value = object == null ? undefined : object[toKey(path[index])];\n if (value === undefined) {\n index = length;\n value = defaultValue;\n }\n object = isFunction(value) ? value.call(object) : value;\n }\n return object;\n }\n\n /**\n * Sets the value at `path` of `object`. If a portion of `path` doesn't exist,\n * it's created. Arrays are created for missing index properties while objects\n * are created for all other missing properties. Use `_.setWith` to customize\n * `path` creation.\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 3.7.0\n * @category Object\n * @param {Object} object The object to modify.\n * @param {Array|string} path The path of the property to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns `object`.\n * @example\n *\n * var object = { 'a': [{ 'b': { 'c': 3 } }] };\n *\n * _.set(object, 'a[0].b.c', 4);\n * console.log(object.a[0].b.c);\n * // => 4\n *\n * _.set(object, ['x', '0', 'y', 'z'], 5);\n * console.log(object.x[0].y.z);\n * // => 5\n */\n function set(object, path, value) {\n return object == null ? object : baseSet(object, path, value);\n }\n\n /**\n * This method is like `_.set` except that it accepts `customizer` which is\n * invoked to produce the objects of `path`. If `customizer` returns `undefined`\n * path creation is handled by the method instead. The `customizer` is invoked\n * with three arguments: (nsValue, key, nsObject).\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Object\n * @param {Object} object The object to modify.\n * @param {Array|string} path The path of the property to set.\n * @param {*} value The value to set.\n * @param {Function} [customizer] The function to customize assigned values.\n * @returns {Object} Returns `object`.\n * @example\n *\n * var object = {};\n *\n * _.setWith(object, '[0][1]', 'a', Object);\n * // => { '0': { '1': 'a' } }\n */\n function setWith(object, path, value, customizer) {\n customizer = typeof customizer == 'function' ? customizer : undefined;\n return object == null ? object : baseSet(object, path, value, customizer);\n }\n\n /**\n * Creates an array of own enumerable string keyed-value pairs for `object`\n * which can be consumed by `_.fromPairs`. If `object` is a map or set, its\n * entries are returned.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @alias entries\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the key-value pairs.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.toPairs(new Foo);\n * // => [['a', 1], ['b', 2]] (iteration order is not guaranteed)\n */\n var toPairs = createToPairs(keys);\n\n /**\n * Creates an array of own and inherited enumerable string keyed-value pairs\n * for `object` which can be consumed by `_.fromPairs`. If `object` is a map\n * or set, its entries are returned.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @alias entriesIn\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the key-value pairs.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.toPairsIn(new Foo);\n * // => [['a', 1], ['b', 2], ['c', 3]] (iteration order is not guaranteed)\n */\n var toPairsIn = createToPairs(keysIn);\n\n /**\n * An alternative to `_.reduce`; this method transforms `object` to a new\n * `accumulator` object which is the result of running each of its own\n * enumerable string keyed properties thru `iteratee`, with each invocation\n * potentially mutating the `accumulator` object. If `accumulator` is not\n * provided, a new object with the same `[[Prototype]]` will be used. The\n * iteratee is invoked with four arguments: (accumulator, value, key, object).\n * Iteratee functions may exit iteration early by explicitly returning `false`.\n *\n * @static\n * @memberOf _\n * @since 1.3.0\n * @category Object\n * @param {Object} object The object to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @param {*} [accumulator] The custom accumulator value.\n * @returns {*} Returns the accumulated value.\n * @example\n *\n * _.transform([2, 3, 4], function(result, n) {\n * result.push(n *= n);\n * return n % 2 == 0;\n * }, []);\n * // => [4, 9]\n *\n * _.transform({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) {\n * (result[value] || (result[value] = [])).push(key);\n * }, {});\n * // => { '1': ['a', 'c'], '2': ['b'] }\n */\n function transform(object, iteratee, accumulator) {\n var isArr = isArray(object),\n isArrLike = isArr || isBuffer(object) || isTypedArray(object);\n\n iteratee = getIteratee(iteratee, 4);\n if (accumulator == null) {\n var Ctor = object && object.constructor;\n if (isArrLike) {\n accumulator = isArr ? new Ctor : [];\n }\n else if (isObject(object)) {\n accumulator = isFunction(Ctor) ? baseCreate(getPrototype(object)) : {};\n }\n else {\n accumulator = {};\n }\n }\n (isArrLike ? arrayEach : baseForOwn)(object, function(value, index, object) {\n return iteratee(accumulator, value, index, object);\n });\n return accumulator;\n }\n\n /**\n * Removes the property at `path` of `object`.\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Object\n * @param {Object} object The object to modify.\n * @param {Array|string} path The path of the property to unset.\n * @returns {boolean} Returns `true` if the property is deleted, else `false`.\n * @example\n *\n * var object = { 'a': [{ 'b': { 'c': 7 } }] };\n * _.unset(object, 'a[0].b.c');\n * // => true\n *\n * console.log(object);\n * // => { 'a': [{ 'b': {} }] };\n *\n * _.unset(object, ['a', '0', 'b', 'c']);\n * // => true\n *\n * console.log(object);\n * // => { 'a': [{ 'b': {} }] };\n */\n function unset(object, path) {\n return object == null ? true : baseUnset(object, path);\n }\n\n /**\n * This method is like `_.set` except that accepts `updater` to produce the\n * value to set. Use `_.updateWith` to customize `path` creation. The `updater`\n * is invoked with one argument: (value).\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 4.6.0\n * @category Object\n * @param {Object} object The object to modify.\n * @param {Array|string} path The path of the property to set.\n * @param {Function} updater The function to produce the updated value.\n * @returns {Object} Returns `object`.\n * @example\n *\n * var object = { 'a': [{ 'b': { 'c': 3 } }] };\n *\n * _.update(object, 'a[0].b.c', function(n) { return n * n; });\n * console.log(object.a[0].b.c);\n * // => 9\n *\n * _.update(object, 'x[0].y.z', function(n) { return n ? n + 1 : 0; });\n * console.log(object.x[0].y.z);\n * // => 0\n */\n function update(object, path, updater) {\n return object == null ? object : baseUpdate(object, path, castFunction(updater));\n }\n\n /**\n * This method is like `_.update` except that it accepts `customizer` which is\n * invoked to produce the objects of `path`. If `customizer` returns `undefined`\n * path creation is handled by the method instead. The `customizer` is invoked\n * with three arguments: (nsValue, key, nsObject).\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 4.6.0\n * @category Object\n * @param {Object} object The object to modify.\n * @param {Array|string} path The path of the property to set.\n * @param {Function} updater The function to produce the updated value.\n * @param {Function} [customizer] The function to customize assigned values.\n * @returns {Object} Returns `object`.\n * @example\n *\n * var object = {};\n *\n * _.updateWith(object, '[0][1]', _.constant('a'), Object);\n * // => { '0': { '1': 'a' } }\n */\n function updateWith(object, path, updater, customizer) {\n customizer = typeof customizer == 'function' ? customizer : undefined;\n return object == null ? object : baseUpdate(object, path, castFunction(updater), customizer);\n }\n\n /**\n * Creates an array of the own enumerable string keyed property values of `object`.\n *\n * **Note:** Non-object values are coerced to objects.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property values.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.values(new Foo);\n * // => [1, 2] (iteration order is not guaranteed)\n *\n * _.values('hi');\n * // => ['h', 'i']\n */\n function values(object) {\n return object == null ? [] : baseValues(object, keys(object));\n }\n\n /**\n * Creates an array of the own and inherited enumerable string keyed property\n * values of `object`.\n *\n * **Note:** Non-object values are coerced to objects.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property values.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.valuesIn(new Foo);\n * // => [1, 2, 3] (iteration order is not guaranteed)\n */\n function valuesIn(object) {\n return object == null ? [] : baseValues(object, keysIn(object));\n }\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Clamps `number` within the inclusive `lower` and `upper` bounds.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Number\n * @param {number} number The number to clamp.\n * @param {number} [lower] The lower bound.\n * @param {number} upper The upper bound.\n * @returns {number} Returns the clamped number.\n * @example\n *\n * _.clamp(-10, -5, 5);\n * // => -5\n *\n * _.clamp(10, -5, 5);\n * // => 5\n */\n function clamp(number, lower, upper) {\n if (upper === undefined) {\n upper = lower;\n lower = undefined;\n }\n if (upper !== undefined) {\n upper = toNumber(upper);\n upper = upper === upper ? upper : 0;\n }\n if (lower !== undefined) {\n lower = toNumber(lower);\n lower = lower === lower ? lower : 0;\n }\n return baseClamp(toNumber(number), lower, upper);\n }\n\n /**\n * Checks if `n` is between `start` and up to, but not including, `end`. If\n * `end` is not specified, it's set to `start` with `start` then set to `0`.\n * If `start` is greater than `end` the params are swapped to support\n * negative ranges.\n *\n * @static\n * @memberOf _\n * @since 3.3.0\n * @category Number\n * @param {number} number The number to check.\n * @param {number} [start=0] The start of the range.\n * @param {number} end The end of the range.\n * @returns {boolean} Returns `true` if `number` is in the range, else `false`.\n * @see _.range, _.rangeRight\n * @example\n *\n * _.inRange(3, 2, 4);\n * // => true\n *\n * _.inRange(4, 8);\n * // => true\n *\n * _.inRange(4, 2);\n * // => false\n *\n * _.inRange(2, 2);\n * // => false\n *\n * _.inRange(1.2, 2);\n * // => true\n *\n * _.inRange(5.2, 4);\n * // => false\n *\n * _.inRange(-3, -2, -6);\n * // => true\n */\n function inRange(number, start, end) {\n start = toFinite(start);\n if (end === undefined) {\n end = start;\n start = 0;\n } else {\n end = toFinite(end);\n }\n number = toNumber(number);\n return baseInRange(number, start, end);\n }\n\n /**\n * Produces a random number between the inclusive `lower` and `upper` bounds.\n * If only one argument is provided a number between `0` and the given number\n * is returned. If `floating` is `true`, or either `lower` or `upper` are\n * floats, a floating-point number is returned instead of an integer.\n *\n * **Note:** JavaScript follows the IEEE-754 standard for resolving\n * floating-point values which can produce unexpected results.\n *\n * @static\n * @memberOf _\n * @since 0.7.0\n * @category Number\n * @param {number} [lower=0] The lower bound.\n * @param {number} [upper=1] The upper bound.\n * @param {boolean} [floating] Specify returning a floating-point number.\n * @returns {number} Returns the random number.\n * @example\n *\n * _.random(0, 5);\n * // => an integer between 0 and 5\n *\n * _.random(5);\n * // => also an integer between 0 and 5\n *\n * _.random(5, true);\n * // => a floating-point number between 0 and 5\n *\n * _.random(1.2, 5.2);\n * // => a floating-point number between 1.2 and 5.2\n */\n function random(lower, upper, floating) {\n if (floating && typeof floating != 'boolean' && isIterateeCall(lower, upper, floating)) {\n upper = floating = undefined;\n }\n if (floating === undefined) {\n if (typeof upper == 'boolean') {\n floating = upper;\n upper = undefined;\n }\n else if (typeof lower == 'boolean') {\n floating = lower;\n lower = undefined;\n }\n }\n if (lower === undefined && upper === undefined) {\n lower = 0;\n upper = 1;\n }\n else {\n lower = toFinite(lower);\n if (upper === undefined) {\n upper = lower;\n lower = 0;\n } else {\n upper = toFinite(upper);\n }\n }\n if (lower > upper) {\n var temp = lower;\n lower = upper;\n upper = temp;\n }\n if (floating || lower % 1 || upper % 1) {\n var rand = nativeRandom();\n return nativeMin(lower + (rand * (upper - lower + freeParseFloat('1e-' + ((rand + '').length - 1)))), upper);\n }\n return baseRandom(lower, upper);\n }\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Converts `string` to [camel case](https://en.wikipedia.org/wiki/CamelCase).\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category String\n * @param {string} [string=''] The string to convert.\n * @returns {string} Returns the camel cased string.\n * @example\n *\n * _.camelCase('Foo Bar');\n * // => 'fooBar'\n *\n * _.camelCase('--foo-bar--');\n * // => 'fooBar'\n *\n * _.camelCase('__FOO_BAR__');\n * // => 'fooBar'\n */\n var camelCase = createCompounder(function(result, word, index) {\n word = word.toLowerCase();\n return result + (index ? capitalize(word) : word);\n });\n\n /**\n * Converts the first character of `string` to upper case and the remaining\n * to lower case.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category String\n * @param {string} [string=''] The string to capitalize.\n * @returns {string} Returns the capitalized string.\n * @example\n *\n * _.capitalize('FRED');\n * // => 'Fred'\n */\n function capitalize(string) {\n return upperFirst(toString(string).toLowerCase());\n }\n\n /**\n * Deburrs `string` by converting\n * [Latin-1 Supplement](https://en.wikipedia.org/wiki/Latin-1_Supplement_(Unicode_block)#Character_table)\n * and [Latin Extended-A](https://en.wikipedia.org/wiki/Latin_Extended-A)\n * letters to basic Latin letters and removing\n * [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks).\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category String\n * @param {string} [string=''] The string to deburr.\n * @returns {string} Returns the deburred string.\n * @example\n *\n * _.deburr('déjà vu');\n * // => 'deja vu'\n */\n function deburr(string) {\n string = toString(string);\n return string && string.replace(reLatin, deburrLetter).replace(reComboMark, '');\n }\n\n /**\n * Checks if `string` ends with the given target string.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category String\n * @param {string} [string=''] The string to inspect.\n * @param {string} [target] The string to search for.\n * @param {number} [position=string.length] The position to search up to.\n * @returns {boolean} Returns `true` if `string` ends with `target`,\n * else `false`.\n * @example\n *\n * _.endsWith('abc', 'c');\n * // => true\n *\n * _.endsWith('abc', 'b');\n * // => false\n *\n * _.endsWith('abc', 'b', 2);\n * // => true\n */\n function endsWith(string, target, position) {\n string = toString(string);\n target = baseToString(target);\n\n var length = string.length;\n position = position === undefined\n ? length\n : baseClamp(toInteger(position), 0, length);\n\n var end = position;\n position -= target.length;\n return position >= 0 && string.slice(position, end) == target;\n }\n\n /**\n * Converts the characters \"&\", \"<\", \">\", '\"', and \"'\" in `string` to their\n * corresponding HTML entities.\n *\n * **Note:** No other characters are escaped. To escape additional\n * characters use a third-party library like [_he_](https://mths.be/he).\n *\n * Though the \">\" character is escaped for symmetry, characters like\n * \">\" and \"/\" don't need escaping in HTML and have no special meaning\n * unless they're part of a tag or unquoted attribute value. See\n * [Mathias Bynens's article](https://mathiasbynens.be/notes/ambiguous-ampersands)\n * (under \"semi-related fun fact\") for more details.\n *\n * When working with HTML you should always\n * [quote attribute values](http://wonko.com/post/html-escaping) to reduce\n * XSS vectors.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category String\n * @param {string} [string=''] The string to escape.\n * @returns {string} Returns the escaped string.\n * @example\n *\n * _.escape('fred, barney, & pebbles');\n * // => 'fred, barney, & pebbles'\n */\n function escape(string) {\n string = toString(string);\n return (string && reHasUnescapedHtml.test(string))\n ? string.replace(reUnescapedHtml, escapeHtmlChar)\n : string;\n }\n\n /**\n * Escapes the `RegExp` special characters \"^\", \"$\", \"\\\", \".\", \"*\", \"+\",\n * \"?\", \"(\", \")\", \"[\", \"]\", \"{\", \"}\", and \"|\" in `string`.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category String\n * @param {string} [string=''] The string to escape.\n * @returns {string} Returns the escaped string.\n * @example\n *\n * _.escapeRegExp('[lodash](https://lodash.com/)');\n * // => '\\[lodash\\]\\(https://lodash\\.com/\\)'\n */\n function escapeRegExp(string) {\n string = toString(string);\n return (string && reHasRegExpChar.test(string))\n ? string.replace(reRegExpChar, '\\\\$&')\n : string;\n }\n\n /**\n * Converts `string` to\n * [kebab case](https://en.wikipedia.org/wiki/Letter_case#Special_case_styles).\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category String\n * @param {string} [string=''] The string to convert.\n * @returns {string} Returns the kebab cased string.\n * @example\n *\n * _.kebabCase('Foo Bar');\n * // => 'foo-bar'\n *\n * _.kebabCase('fooBar');\n * // => 'foo-bar'\n *\n * _.kebabCase('__FOO_BAR__');\n * // => 'foo-bar'\n */\n var kebabCase = createCompounder(function(result, word, index) {\n return result + (index ? '-' : '') + word.toLowerCase();\n });\n\n /**\n * Converts `string`, as space separated words, to lower case.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category String\n * @param {string} [string=''] The string to convert.\n * @returns {string} Returns the lower cased string.\n * @example\n *\n * _.lowerCase('--Foo-Bar--');\n * // => 'foo bar'\n *\n * _.lowerCase('fooBar');\n * // => 'foo bar'\n *\n * _.lowerCase('__FOO_BAR__');\n * // => 'foo bar'\n */\n var lowerCase = createCompounder(function(result, word, index) {\n return result + (index ? ' ' : '') + word.toLowerCase();\n });\n\n /**\n * Converts the first character of `string` to lower case.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category String\n * @param {string} [string=''] The string to convert.\n * @returns {string} Returns the converted string.\n * @example\n *\n * _.lowerFirst('Fred');\n * // => 'fred'\n *\n * _.lowerFirst('FRED');\n * // => 'fRED'\n */\n var lowerFirst = createCaseFirst('toLowerCase');\n\n /**\n * Pads `string` on the left and right sides if it's shorter than `length`.\n * Padding characters are truncated if they can't be evenly divided by `length`.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category String\n * @param {string} [string=''] The string to pad.\n * @param {number} [length=0] The padding length.\n * @param {string} [chars=' '] The string used as padding.\n * @returns {string} Returns the padded string.\n * @example\n *\n * _.pad('abc', 8);\n * // => ' abc '\n *\n * _.pad('abc', 8, '_-');\n * // => '_-abc_-_'\n *\n * _.pad('abc', 3);\n * // => 'abc'\n */\n function pad(string, length, chars) {\n string = toString(string);\n length = toInteger(length);\n\n var strLength = length ? stringSize(string) : 0;\n if (!length || strLength >= length) {\n return string;\n }\n var mid = (length - strLength) / 2;\n return (\n createPadding(nativeFloor(mid), chars) +\n string +\n createPadding(nativeCeil(mid), chars)\n );\n }\n\n /**\n * Pads `string` on the right side if it's shorter than `length`. Padding\n * characters are truncated if they exceed `length`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category String\n * @param {string} [string=''] The string to pad.\n * @param {number} [length=0] The padding length.\n * @param {string} [chars=' '] The string used as padding.\n * @returns {string} Returns the padded string.\n * @example\n *\n * _.padEnd('abc', 6);\n * // => 'abc '\n *\n * _.padEnd('abc', 6, '_-');\n * // => 'abc_-_'\n *\n * _.padEnd('abc', 3);\n * // => 'abc'\n */\n function padEnd(string, length, chars) {\n string = toString(string);\n length = toInteger(length);\n\n var strLength = length ? stringSize(string) : 0;\n return (length && strLength < length)\n ? (string + createPadding(length - strLength, chars))\n : string;\n }\n\n /**\n * Pads `string` on the left side if it's shorter than `length`. Padding\n * characters are truncated if they exceed `length`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category String\n * @param {string} [string=''] The string to pad.\n * @param {number} [length=0] The padding length.\n * @param {string} [chars=' '] The string used as padding.\n * @returns {string} Returns the padded string.\n * @example\n *\n * _.padStart('abc', 6);\n * // => ' abc'\n *\n * _.padStart('abc', 6, '_-');\n * // => '_-_abc'\n *\n * _.padStart('abc', 3);\n * // => 'abc'\n */\n function padStart(string, length, chars) {\n string = toString(string);\n length = toInteger(length);\n\n var strLength = length ? stringSize(string) : 0;\n return (length && strLength < length)\n ? (createPadding(length - strLength, chars) + string)\n : string;\n }\n\n /**\n * Converts `string` to an integer of the specified radix. If `radix` is\n * `undefined` or `0`, a `radix` of `10` is used unless `value` is a\n * hexadecimal, in which case a `radix` of `16` is used.\n *\n * **Note:** This method aligns with the\n * [ES5 implementation](https://es5.github.io/#x15.1.2.2) of `parseInt`.\n *\n * @static\n * @memberOf _\n * @since 1.1.0\n * @category String\n * @param {string} string The string to convert.\n * @param {number} [radix=10] The radix to interpret `value` by.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {number} Returns the converted integer.\n * @example\n *\n * _.parseInt('08');\n * // => 8\n *\n * _.map(['6', '08', '10'], _.parseInt);\n * // => [6, 8, 10]\n */\n function parseInt(string, radix, guard) {\n if (guard || radix == null) {\n radix = 0;\n } else if (radix) {\n radix = +radix;\n }\n return nativeParseInt(toString(string).replace(reTrimStart, ''), radix || 0);\n }\n\n /**\n * Repeats the given string `n` times.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category String\n * @param {string} [string=''] The string to repeat.\n * @param {number} [n=1] The number of times to repeat the string.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {string} Returns the repeated string.\n * @example\n *\n * _.repeat('*', 3);\n * // => '***'\n *\n * _.repeat('abc', 2);\n * // => 'abcabc'\n *\n * _.repeat('abc', 0);\n * // => ''\n */\n function repeat(string, n, guard) {\n if ((guard ? isIterateeCall(string, n, guard) : n === undefined)) {\n n = 1;\n } else {\n n = toInteger(n);\n }\n return baseRepeat(toString(string), n);\n }\n\n /**\n * Replaces matches for `pattern` in `string` with `replacement`.\n *\n * **Note:** This method is based on\n * [`String#replace`](https://mdn.io/String/replace).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category String\n * @param {string} [string=''] The string to modify.\n * @param {RegExp|string} pattern The pattern to replace.\n * @param {Function|string} replacement The match replacement.\n * @returns {string} Returns the modified string.\n * @example\n *\n * _.replace('Hi Fred', 'Fred', 'Barney');\n * // => 'Hi Barney'\n */\n function replace() {\n var args = arguments,\n string = toString(args[0]);\n\n return args.length < 3 ? string : string.replace(args[1], args[2]);\n }\n\n /**\n * Converts `string` to\n * [snake case](https://en.wikipedia.org/wiki/Snake_case).\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category String\n * @param {string} [string=''] The string to convert.\n * @returns {string} Returns the snake cased string.\n * @example\n *\n * _.snakeCase('Foo Bar');\n * // => 'foo_bar'\n *\n * _.snakeCase('fooBar');\n * // => 'foo_bar'\n *\n * _.snakeCase('--FOO-BAR--');\n * // => 'foo_bar'\n */\n var snakeCase = createCompounder(function(result, word, index) {\n return result + (index ? '_' : '') + word.toLowerCase();\n });\n\n /**\n * Splits `string` by `separator`.\n *\n * **Note:** This method is based on\n * [`String#split`](https://mdn.io/String/split).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category String\n * @param {string} [string=''] The string to split.\n * @param {RegExp|string} separator The separator pattern to split by.\n * @param {number} [limit] The length to truncate results to.\n * @returns {Array} Returns the string segments.\n * @example\n *\n * _.split('a-b-c', '-', 2);\n * // => ['a', 'b']\n */\n function split(string, separator, limit) {\n if (limit && typeof limit != 'number' && isIterateeCall(string, separator, limit)) {\n separator = limit = undefined;\n }\n limit = limit === undefined ? MAX_ARRAY_LENGTH : limit >>> 0;\n if (!limit) {\n return [];\n }\n string = toString(string);\n if (string && (\n typeof separator == 'string' ||\n (separator != null && !isRegExp(separator))\n )) {\n separator = baseToString(separator);\n if (!separator && hasUnicode(string)) {\n return castSlice(stringToArray(string), 0, limit);\n }\n }\n return string.split(separator, limit);\n }\n\n /**\n * Converts `string` to\n * [start case](https://en.wikipedia.org/wiki/Letter_case#Stylistic_or_specialised_usage).\n *\n * @static\n * @memberOf _\n * @since 3.1.0\n * @category String\n * @param {string} [string=''] The string to convert.\n * @returns {string} Returns the start cased string.\n * @example\n *\n * _.startCase('--foo-bar--');\n * // => 'Foo Bar'\n *\n * _.startCase('fooBar');\n * // => 'Foo Bar'\n *\n * _.startCase('__FOO_BAR__');\n * // => 'FOO BAR'\n */\n var startCase = createCompounder(function(result, word, index) {\n return result + (index ? ' ' : '') + upperFirst(word);\n });\n\n /**\n * Checks if `string` starts with the given target string.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category String\n * @param {string} [string=''] The string to inspect.\n * @param {string} [target] The string to search for.\n * @param {number} [position=0] The position to search from.\n * @returns {boolean} Returns `true` if `string` starts with `target`,\n * else `false`.\n * @example\n *\n * _.startsWith('abc', 'a');\n * // => true\n *\n * _.startsWith('abc', 'b');\n * // => false\n *\n * _.startsWith('abc', 'b', 1);\n * // => true\n */\n function startsWith(string, target, position) {\n string = toString(string);\n position = position == null\n ? 0\n : baseClamp(toInteger(position), 0, string.length);\n\n target = baseToString(target);\n return string.slice(position, position + target.length) == target;\n }\n\n /**\n * Creates a compiled template function that can interpolate data properties\n * in \"interpolate\" delimiters, HTML-escape interpolated data properties in\n * \"escape\" delimiters, and execute JavaScript in \"evaluate\" delimiters. Data\n * properties may be accessed as free variables in the template. If a setting\n * object is given, it takes precedence over `_.templateSettings` values.\n *\n * **Note:** In the development build `_.template` utilizes\n * [sourceURLs](http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/#toc-sourceurl)\n * for easier debugging.\n *\n * For more information on precompiling templates see\n * [lodash's custom builds documentation](https://lodash.com/custom-builds).\n *\n * For more information on Chrome extension sandboxes see\n * [Chrome's extensions documentation](https://developer.chrome.com/extensions/sandboxingEval).\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category String\n * @param {string} [string=''] The template string.\n * @param {Object} [options={}] The options object.\n * @param {RegExp} [options.escape=_.templateSettings.escape]\n * The HTML \"escape\" delimiter.\n * @param {RegExp} [options.evaluate=_.templateSettings.evaluate]\n * The \"evaluate\" delimiter.\n * @param {Object} [options.imports=_.templateSettings.imports]\n * An object to import into the template as free variables.\n * @param {RegExp} [options.interpolate=_.templateSettings.interpolate]\n * The \"interpolate\" delimiter.\n * @param {string} [options.sourceURL='lodash.templateSources[n]']\n * The sourceURL of the compiled template.\n * @param {string} [options.variable='obj']\n * The data object variable name.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {Function} Returns the compiled template function.\n * @example\n *\n * // Use the \"interpolate\" delimiter to create a compiled template.\n * var compiled = _.template('hello <%= user %>!');\n * compiled({ 'user': 'fred' });\n * // => 'hello fred!'\n *\n * // Use the HTML \"escape\" delimiter to escape data property values.\n * var compiled = _.template('<%- value %>');\n * compiled({ 'value': ' diff --git a/packages/server/appPackages/_master/public/unauthenticated/budibase-client.js b/packages/server/appPackages/_master/public/unauthenticated/budibase-client.js index ddaad74d45..2758a2c256 100644 --- a/packages/server/appPackages/_master/public/unauthenticated/budibase-client.js +++ b/packages/server/appPackages/_master/public/unauthenticated/budibase-client.js @@ -133,6 +133,10 @@ var app = (function (exports) { return module = { exports: {} }, fn(module, module.exports), module.exports; } + function getCjsExportFromNamespace (n) { + return n && n['default'] || n; + } + var lodash_min = createCommonjsModule(function (module, exports) { (function(){function n(n,t,r){switch(r.length){case 0:return n.call(t);case 1:return n.call(t,r[0]);case 2:return n.call(t,r[0],r[1]);case 3:return n.call(t,r[0],r[1],r[2])}return n.apply(t,r)}function t(n,t,r,e){for(var u=-1,i=null==n?0:n.length;++u { + const func = props._id ? uiFunctions[props._id] : undefined; + + const parentContext = (parentNode && parentNode.context) || {}; + + let nodesToRender = []; + const createNodeAndRender = context => { + let componentContext = parentContext; + if (context) { + componentContext = { ...context }; + componentContext.$parent = parentContext; + } + + const thisNode = createTreeNode(); + thisNode.context = componentContext; + thisNode.parentNode = parentNode; + thisNode.props = props; + nodesToRender.push(thisNode); + + thisNode.render = initialProps => { + thisNode.component = new componentConstructor({ + target: htmlElement, + props: initialProps, + hydrate: false, + anchor, + }); + thisNode.rootElement = + htmlElement.children[htmlElement.children.length - 1]; + + if (props._id && thisNode.rootElement) { + thisNode.rootElement.classList.add(`pos-${props._id}`); + } + }; + }; + + if (func) { + const state = getCurrentState(); + const routeParams = state["##routeParams"]; + func(createNodeAndRender, parentContext, getCurrentState(), routeParams); + } else { + createNodeAndRender(); + } + + return nodesToRender + }; + + const createTreeNode = () => ({ + context: {}, + props: {}, + rootElement: null, + parentNode: null, + children: [], + bindings: [], + component: null, + unsubscribe: () => {}, + render: () => {}, + get destroy() { + const node = this; + return () => { + if (node.unsubscribe) node.unsubscribe(); + if (node.component && node.component.$destroy) node.component.$destroy(); + if (node.children) { + for (let child of node.children) { + child.destroy(); + } + } + for (let onDestroyItem of node.onDestroy) { + onDestroyItem(); + } + } + }, + onDestroy: [], + }); + + const screenSlotComponent = window => { + return function(opts) { + const node = window.document.createElement("DIV"); + const $set = props => { + props._bb.attachChildren(node); + }; + const $destroy = () => { + if (opts.target && node) opts.target.removeChild(node); + }; + this.$set = $set; + this.$destroy = $destroy; + opts.target.appendChild(node); + } + }; + + const builtinLibName = "##builtin"; + + const isScreenSlot = componentName => + componentName === "##builtin/screenslot"; + + const builtins = window => ({ + screenslot: screenSlotComponent(window), + }); + + var toStr = Object.prototype.toString; + + var isArguments = function isArguments(value) { + var str = toStr.call(value); + var isArgs = str === '[object Arguments]'; + if (!isArgs) { + isArgs = str !== '[object Array]' && + value !== null && + typeof value === 'object' && + typeof value.length === 'number' && + value.length >= 0 && + toStr.call(value.callee) === '[object Function]'; + } + return isArgs; + }; + + var keysShim; + if (!Object.keys) { + // modified from https://github.com/es-shims/es5-shim + var has$1 = Object.prototype.hasOwnProperty; + var toStr$1 = Object.prototype.toString; + var isArgs = isArguments; // eslint-disable-line global-require + var isEnumerable = Object.prototype.propertyIsEnumerable; + var hasDontEnumBug = !isEnumerable.call({ toString: null }, 'toString'); + var hasProtoEnumBug = isEnumerable.call(function () {}, 'prototype'); + var dontEnums = [ + 'toString', + 'toLocaleString', + 'valueOf', + 'hasOwnProperty', + 'isPrototypeOf', + 'propertyIsEnumerable', + 'constructor' + ]; + var equalsConstructorPrototype = function (o) { + var ctor = o.constructor; + return ctor && ctor.prototype === o; + }; + var excludedKeys = { + $applicationCache: true, + $console: true, + $external: true, + $frame: true, + $frameElement: true, + $frames: true, + $innerHeight: true, + $innerWidth: true, + $onmozfullscreenchange: true, + $onmozfullscreenerror: true, + $outerHeight: true, + $outerWidth: true, + $pageXOffset: true, + $pageYOffset: true, + $parent: true, + $scrollLeft: true, + $scrollTop: true, + $scrollX: true, + $scrollY: true, + $self: true, + $webkitIndexedDB: true, + $webkitStorageInfo: true, + $window: true + }; + var hasAutomationEqualityBug = (function () { + /* global window */ + if (typeof window === 'undefined') { return false; } + for (var k in window) { + try { + if (!excludedKeys['$' + k] && has$1.call(window, k) && window[k] !== null && typeof window[k] === 'object') { + try { + equalsConstructorPrototype(window[k]); + } catch (e) { + return true; + } + } + } catch (e) { + return true; + } + } + return false; + }()); + var equalsConstructorPrototypeIfNotBuggy = function (o) { + /* global window */ + if (typeof window === 'undefined' || !hasAutomationEqualityBug) { + return equalsConstructorPrototype(o); + } + try { + return equalsConstructorPrototype(o); + } catch (e) { + return false; + } + }; + + keysShim = function keys(object) { + var isObject = object !== null && typeof object === 'object'; + var isFunction = toStr$1.call(object) === '[object Function]'; + var isArguments = isArgs(object); + var isString = isObject && toStr$1.call(object) === '[object String]'; + var theKeys = []; + + if (!isObject && !isFunction && !isArguments) { + throw new TypeError('Object.keys called on a non-object'); + } + + var skipProto = hasProtoEnumBug && isFunction; + if (isString && object.length > 0 && !has$1.call(object, 0)) { + for (var i = 0; i < object.length; ++i) { + theKeys.push(String(i)); + } + } + + if (isArguments && object.length > 0) { + for (var j = 0; j < object.length; ++j) { + theKeys.push(String(j)); + } + } else { + for (var name in object) { + if (!(skipProto && name === 'prototype') && has$1.call(object, name)) { + theKeys.push(String(name)); + } + } + } + + if (hasDontEnumBug) { + var skipConstructor = equalsConstructorPrototypeIfNotBuggy(object); + + for (var k = 0; k < dontEnums.length; ++k) { + if (!(skipConstructor && dontEnums[k] === 'constructor') && has$1.call(object, dontEnums[k])) { + theKeys.push(dontEnums[k]); + } + } + } + return theKeys; + }; + } + var implementation = keysShim; + + var slice = Array.prototype.slice; + + + var origKeys = Object.keys; + var keysShim$1 = origKeys ? function keys(o) { return origKeys(o); } : implementation; + + var originalKeys = Object.keys; + + keysShim$1.shim = function shimObjectKeys() { + if (Object.keys) { + var keysWorksWithArguments = (function () { + // Safari 5.0 bug + var args = Object.keys(arguments); + return args && args.length === arguments.length; + }(1, 2)); + if (!keysWorksWithArguments) { + Object.keys = function keys(object) { // eslint-disable-line func-name-matching + if (isArguments(object)) { + return originalKeys(slice.call(object)); + } + return originalKeys(object); + }; + } + } else { + Object.keys = keysShim$1; + } + return Object.keys || keysShim$1; + }; + + var objectKeys = keysShim$1; + + var hasToStringTag = typeof Symbol === 'function' && typeof Symbol.toStringTag === 'symbol'; + var toStr$2 = Object.prototype.toString; + + var isStandardArguments = function isArguments(value) { + if (hasToStringTag && value && typeof value === 'object' && Symbol.toStringTag in value) { + return false; + } + return toStr$2.call(value) === '[object Arguments]'; + }; + + var isLegacyArguments = function isArguments(value) { + if (isStandardArguments(value)) { + return true; + } + return value !== null && + typeof value === 'object' && + typeof value.length === 'number' && + value.length >= 0 && + toStr$2.call(value) !== '[object Array]' && + toStr$2.call(value.callee) === '[object Function]'; + }; + + var supportsStandardArguments = (function () { + return isStandardArguments(arguments); + }()); + + isStandardArguments.isLegacyArguments = isLegacyArguments; // for tests + + var isArguments$1 = supportsStandardArguments ? isStandardArguments : isLegacyArguments; + + // http://www.ecma-international.org/ecma-262/6.0/#sec-object.is + + var numberIsNaN = function (value) { + return value !== value; + }; + + var objectIs = function is(a, b) { + if (a === 0 && b === 0) { + return 1 / a === 1 / b; + } + if (a === b) { + return true; + } + if (numberIsNaN(a) && numberIsNaN(b)) { + return true; + } + return false; + }; + + /* eslint no-invalid-this: 1 */ + + var ERROR_MESSAGE = 'Function.prototype.bind called on incompatible '; + var slice$1 = Array.prototype.slice; + var toStr$3 = Object.prototype.toString; + var funcType = '[object Function]'; + + var implementation$1 = function bind(that) { + var target = this; + if (typeof target !== 'function' || toStr$3.call(target) !== funcType) { + throw new TypeError(ERROR_MESSAGE + target); + } + var args = slice$1.call(arguments, 1); + + var bound; + var binder = function () { + if (this instanceof bound) { + var result = target.apply( + this, + args.concat(slice$1.call(arguments)) + ); + if (Object(result) === result) { + return result; + } + return this; + } else { + return target.apply( + that, + args.concat(slice$1.call(arguments)) + ); + } + }; + + var boundLength = Math.max(0, target.length - args.length); + var boundArgs = []; + for (var i = 0; i < boundLength; i++) { + boundArgs.push('$' + i); + } + + bound = Function('binder', 'return function (' + boundArgs.join(',') + '){ return binder.apply(this,arguments); }')(binder); + + if (target.prototype) { + var Empty = function Empty() {}; + Empty.prototype = target.prototype; + bound.prototype = new Empty(); + Empty.prototype = null; + } + + return bound; + }; + + var functionBind = Function.prototype.bind || implementation$1; + + var src = functionBind.call(Function.call, Object.prototype.hasOwnProperty); + + var regexExec = RegExp.prototype.exec; + var gOPD = Object.getOwnPropertyDescriptor; + + var tryRegexExecCall = function tryRegexExec(value) { + try { + var lastIndex = value.lastIndex; + value.lastIndex = 0; + + regexExec.call(value); + return true; + } catch (e) { + return false; + } finally { + value.lastIndex = lastIndex; + } + }; + var toStr$4 = Object.prototype.toString; + var regexClass = '[object RegExp]'; + var hasToStringTag$1 = typeof Symbol === 'function' && typeof Symbol.toStringTag === 'symbol'; + + var isRegex = function isRegex(value) { + if (!value || typeof value !== 'object') { + return false; + } + if (!hasToStringTag$1) { + return toStr$4.call(value) === regexClass; + } + + var descriptor = gOPD(value, 'lastIndex'); + var hasLastIndexDataProperty = descriptor && src(descriptor, 'value'); + if (!hasLastIndexDataProperty) { + return false; + } + + return tryRegexExecCall(value); + }; + + var hasSymbols = typeof Symbol === 'function' && typeof Symbol('foo') === 'symbol'; + + var toStr$5 = Object.prototype.toString; + var concat = Array.prototype.concat; + var origDefineProperty = Object.defineProperty; + + var isFunction = function (fn) { + return typeof fn === 'function' && toStr$5.call(fn) === '[object Function]'; + }; + + var arePropertyDescriptorsSupported = function () { + var obj = {}; + try { + origDefineProperty(obj, 'x', { enumerable: false, value: obj }); + // eslint-disable-next-line no-unused-vars, no-restricted-syntax + for (var _ in obj) { // jscs:ignore disallowUnusedVariables + return false; + } + return obj.x === obj; + } catch (e) { /* this is IE 8. */ + return false; + } + }; + var supportsDescriptors = origDefineProperty && arePropertyDescriptorsSupported(); + + var defineProperty = function (object, name, value, predicate) { + if (name in object && (!isFunction(predicate) || !predicate())) { + return; + } + if (supportsDescriptors) { + origDefineProperty(object, name, { + configurable: true, + enumerable: false, + value: value, + writable: true + }); + } else { + object[name] = value; + } + }; + + var defineProperties = function (object, map) { + var predicates = arguments.length > 2 ? arguments[2] : {}; + var props = objectKeys(map); + if (hasSymbols) { + props = concat.call(props, Object.getOwnPropertySymbols(map)); + } + for (var i = 0; i < props.length; i += 1) { + defineProperty(object, props[i], map[props[i]], predicates[props[i]]); + } + }; + + defineProperties.supportsDescriptors = !!supportsDescriptors; + + var defineProperties_1 = defineProperties; + + /* eslint complexity: [2, 18], max-statements: [2, 33] */ + var shams = function hasSymbols() { + if (typeof Symbol !== 'function' || typeof Object.getOwnPropertySymbols !== 'function') { return false; } + if (typeof Symbol.iterator === 'symbol') { return true; } + + var obj = {}; + var sym = Symbol('test'); + var symObj = Object(sym); + if (typeof sym === 'string') { return false; } + + if (Object.prototype.toString.call(sym) !== '[object Symbol]') { return false; } + if (Object.prototype.toString.call(symObj) !== '[object Symbol]') { return false; } + + // temp disabled per https://github.com/ljharb/object.assign/issues/17 + // if (sym instanceof Symbol) { return false; } + // temp disabled per https://github.com/WebReflection/get-own-property-symbols/issues/4 + // if (!(symObj instanceof Symbol)) { return false; } + + // if (typeof Symbol.prototype.toString !== 'function') { return false; } + // if (String(sym) !== Symbol.prototype.toString.call(sym)) { return false; } + + var symVal = 42; + obj[sym] = symVal; + for (sym in obj) { return false; } // eslint-disable-line no-restricted-syntax + if (typeof Object.keys === 'function' && Object.keys(obj).length !== 0) { return false; } + + if (typeof Object.getOwnPropertyNames === 'function' && Object.getOwnPropertyNames(obj).length !== 0) { return false; } + + var syms = Object.getOwnPropertySymbols(obj); + if (syms.length !== 1 || syms[0] !== sym) { return false; } + + if (!Object.prototype.propertyIsEnumerable.call(obj, sym)) { return false; } + + if (typeof Object.getOwnPropertyDescriptor === 'function') { + var descriptor = Object.getOwnPropertyDescriptor(obj, sym); + if (descriptor.value !== symVal || descriptor.enumerable !== true) { return false; } + } + + return true; + }; + + var origSymbol = commonjsGlobal.Symbol; + + + var hasSymbols$1 = function hasNativeSymbols() { + if (typeof origSymbol !== 'function') { return false; } + if (typeof Symbol !== 'function') { return false; } + if (typeof origSymbol('foo') !== 'symbol') { return false; } + if (typeof Symbol('bar') !== 'symbol') { return false; } + + return shams(); + }; + + /* globals + Atomics, + SharedArrayBuffer, + */ + + var undefined$1; + + var $TypeError = TypeError; + + var $gOPD = Object.getOwnPropertyDescriptor; + if ($gOPD) { + try { + $gOPD({}, ''); + } catch (e) { + $gOPD = null; // this is IE 8, which has a broken gOPD + } + } + + var throwTypeError = function () { throw new $TypeError(); }; + var ThrowTypeError = $gOPD + ? (function () { + try { + // eslint-disable-next-line no-unused-expressions, no-caller, no-restricted-properties + arguments.callee; // IE 8 does not throw here + return throwTypeError; + } catch (calleeThrows) { + try { + // IE 8 throws on Object.getOwnPropertyDescriptor(arguments, '') + return $gOPD(arguments, 'callee').get; + } catch (gOPDthrows) { + return throwTypeError; + } + } + }()) + : throwTypeError; + + var hasSymbols$2 = hasSymbols$1(); + + var getProto = Object.getPrototypeOf || function (x) { return x.__proto__; }; // eslint-disable-line no-proto + var generatorFunction = undefined$1; + var asyncFunction = undefined$1; + var asyncGenFunction = undefined$1; + + var TypedArray = typeof Uint8Array === 'undefined' ? undefined$1 : getProto(Uint8Array); + + var INTRINSICS = { + '%Array%': Array, + '%ArrayBuffer%': typeof ArrayBuffer === 'undefined' ? undefined$1 : ArrayBuffer, + '%ArrayBufferPrototype%': typeof ArrayBuffer === 'undefined' ? undefined$1 : ArrayBuffer.prototype, + '%ArrayIteratorPrototype%': hasSymbols$2 ? getProto([][Symbol.iterator]()) : undefined$1, + '%ArrayPrototype%': Array.prototype, + '%ArrayProto_entries%': Array.prototype.entries, + '%ArrayProto_forEach%': Array.prototype.forEach, + '%ArrayProto_keys%': Array.prototype.keys, + '%ArrayProto_values%': Array.prototype.values, + '%AsyncFromSyncIteratorPrototype%': undefined$1, + '%AsyncFunction%': asyncFunction, + '%AsyncFunctionPrototype%': undefined$1, + '%AsyncGenerator%': undefined$1, + '%AsyncGeneratorFunction%': asyncGenFunction, + '%AsyncGeneratorPrototype%': undefined$1, + '%AsyncIteratorPrototype%': undefined$1, + '%Atomics%': typeof Atomics === 'undefined' ? undefined$1 : Atomics, + '%Boolean%': Boolean, + '%BooleanPrototype%': Boolean.prototype, + '%DataView%': typeof DataView === 'undefined' ? undefined$1 : DataView, + '%DataViewPrototype%': typeof DataView === 'undefined' ? undefined$1 : DataView.prototype, + '%Date%': Date, + '%DatePrototype%': Date.prototype, + '%decodeURI%': decodeURI, + '%decodeURIComponent%': decodeURIComponent, + '%encodeURI%': encodeURI, + '%encodeURIComponent%': encodeURIComponent, + '%Error%': Error, + '%ErrorPrototype%': Error.prototype, + '%eval%': eval, // eslint-disable-line no-eval + '%EvalError%': EvalError, + '%EvalErrorPrototype%': EvalError.prototype, + '%Float32Array%': typeof Float32Array === 'undefined' ? undefined$1 : Float32Array, + '%Float32ArrayPrototype%': typeof Float32Array === 'undefined' ? undefined$1 : Float32Array.prototype, + '%Float64Array%': typeof Float64Array === 'undefined' ? undefined$1 : Float64Array, + '%Float64ArrayPrototype%': typeof Float64Array === 'undefined' ? undefined$1 : Float64Array.prototype, + '%Function%': Function, + '%FunctionPrototype%': Function.prototype, + '%Generator%': undefined$1, + '%GeneratorFunction%': generatorFunction, + '%GeneratorPrototype%': undefined$1, + '%Int8Array%': typeof Int8Array === 'undefined' ? undefined$1 : Int8Array, + '%Int8ArrayPrototype%': typeof Int8Array === 'undefined' ? undefined$1 : Int8Array.prototype, + '%Int16Array%': typeof Int16Array === 'undefined' ? undefined$1 : Int16Array, + '%Int16ArrayPrototype%': typeof Int16Array === 'undefined' ? undefined$1 : Int8Array.prototype, + '%Int32Array%': typeof Int32Array === 'undefined' ? undefined$1 : Int32Array, + '%Int32ArrayPrototype%': typeof Int32Array === 'undefined' ? undefined$1 : Int32Array.prototype, + '%isFinite%': isFinite, + '%isNaN%': isNaN, + '%IteratorPrototype%': hasSymbols$2 ? getProto(getProto([][Symbol.iterator]())) : undefined$1, + '%JSON%': typeof JSON === 'object' ? JSON : undefined$1, + '%JSONParse%': typeof JSON === 'object' ? JSON.parse : undefined$1, + '%Map%': typeof Map === 'undefined' ? undefined$1 : Map, + '%MapIteratorPrototype%': typeof Map === 'undefined' || !hasSymbols$2 ? undefined$1 : getProto(new Map()[Symbol.iterator]()), + '%MapPrototype%': typeof Map === 'undefined' ? undefined$1 : Map.prototype, + '%Math%': Math, + '%Number%': Number, + '%NumberPrototype%': Number.prototype, + '%Object%': Object, + '%ObjectPrototype%': Object.prototype, + '%ObjProto_toString%': Object.prototype.toString, + '%ObjProto_valueOf%': Object.prototype.valueOf, + '%parseFloat%': parseFloat, + '%parseInt%': parseInt, + '%Promise%': typeof Promise === 'undefined' ? undefined$1 : Promise, + '%PromisePrototype%': typeof Promise === 'undefined' ? undefined$1 : Promise.prototype, + '%PromiseProto_then%': typeof Promise === 'undefined' ? undefined$1 : Promise.prototype.then, + '%Promise_all%': typeof Promise === 'undefined' ? undefined$1 : Promise.all, + '%Promise_reject%': typeof Promise === 'undefined' ? undefined$1 : Promise.reject, + '%Promise_resolve%': typeof Promise === 'undefined' ? undefined$1 : Promise.resolve, + '%Proxy%': typeof Proxy === 'undefined' ? undefined$1 : Proxy, + '%RangeError%': RangeError, + '%RangeErrorPrototype%': RangeError.prototype, + '%ReferenceError%': ReferenceError, + '%ReferenceErrorPrototype%': ReferenceError.prototype, + '%Reflect%': typeof Reflect === 'undefined' ? undefined$1 : Reflect, + '%RegExp%': RegExp, + '%RegExpPrototype%': RegExp.prototype, + '%Set%': typeof Set === 'undefined' ? undefined$1 : Set, + '%SetIteratorPrototype%': typeof Set === 'undefined' || !hasSymbols$2 ? undefined$1 : getProto(new Set()[Symbol.iterator]()), + '%SetPrototype%': typeof Set === 'undefined' ? undefined$1 : Set.prototype, + '%SharedArrayBuffer%': typeof SharedArrayBuffer === 'undefined' ? undefined$1 : SharedArrayBuffer, + '%SharedArrayBufferPrototype%': typeof SharedArrayBuffer === 'undefined' ? undefined$1 : SharedArrayBuffer.prototype, + '%String%': String, + '%StringIteratorPrototype%': hasSymbols$2 ? getProto(''[Symbol.iterator]()) : undefined$1, + '%StringPrototype%': String.prototype, + '%Symbol%': hasSymbols$2 ? Symbol : undefined$1, + '%SymbolPrototype%': hasSymbols$2 ? Symbol.prototype : undefined$1, + '%SyntaxError%': SyntaxError, + '%SyntaxErrorPrototype%': SyntaxError.prototype, + '%ThrowTypeError%': ThrowTypeError, + '%TypedArray%': TypedArray, + '%TypedArrayPrototype%': TypedArray ? TypedArray.prototype : undefined$1, + '%TypeError%': $TypeError, + '%TypeErrorPrototype%': $TypeError.prototype, + '%Uint8Array%': typeof Uint8Array === 'undefined' ? undefined$1 : Uint8Array, + '%Uint8ArrayPrototype%': typeof Uint8Array === 'undefined' ? undefined$1 : Uint8Array.prototype, + '%Uint8ClampedArray%': typeof Uint8ClampedArray === 'undefined' ? undefined$1 : Uint8ClampedArray, + '%Uint8ClampedArrayPrototype%': typeof Uint8ClampedArray === 'undefined' ? undefined$1 : Uint8ClampedArray.prototype, + '%Uint16Array%': typeof Uint16Array === 'undefined' ? undefined$1 : Uint16Array, + '%Uint16ArrayPrototype%': typeof Uint16Array === 'undefined' ? undefined$1 : Uint16Array.prototype, + '%Uint32Array%': typeof Uint32Array === 'undefined' ? undefined$1 : Uint32Array, + '%Uint32ArrayPrototype%': typeof Uint32Array === 'undefined' ? undefined$1 : Uint32Array.prototype, + '%URIError%': URIError, + '%URIErrorPrototype%': URIError.prototype, + '%WeakMap%': typeof WeakMap === 'undefined' ? undefined$1 : WeakMap, + '%WeakMapPrototype%': typeof WeakMap === 'undefined' ? undefined$1 : WeakMap.prototype, + '%WeakSet%': typeof WeakSet === 'undefined' ? undefined$1 : WeakSet, + '%WeakSetPrototype%': typeof WeakSet === 'undefined' ? undefined$1 : WeakSet.prototype + }; + + + var $replace = functionBind.call(Function.call, String.prototype.replace); + + /* adapted from https://github.com/lodash/lodash/blob/4.17.15/dist/lodash.js#L6735-L6744 */ + var rePropName = /[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g; + var reEscapeChar = /\\(\\)?/g; /** Used to match backslashes in property paths. */ + var stringToPath = function stringToPath(string) { + var result = []; + $replace(string, rePropName, function (match, number, quote, subString) { + result[result.length] = quote ? $replace(subString, reEscapeChar, '$1') : (number || match); + }); + return result; + }; + /* end adaptation */ + + var getBaseIntrinsic = function getBaseIntrinsic(name, allowMissing) { + if (!(name in INTRINSICS)) { + throw new SyntaxError('intrinsic ' + name + ' does not exist!'); + } + + // istanbul ignore if // hopefully this is impossible to test :-) + if (typeof INTRINSICS[name] === 'undefined' && !allowMissing) { + throw new $TypeError('intrinsic ' + name + ' exists, but is not available. Please file an issue!'); + } + + return INTRINSICS[name]; + }; + + var GetIntrinsic = function GetIntrinsic(name, allowMissing) { + if (typeof name !== 'string' || name.length === 0) { + throw new TypeError('intrinsic name must be a non-empty string'); + } + if (arguments.length > 1 && typeof allowMissing !== 'boolean') { + throw new TypeError('"allowMissing" argument must be a boolean'); + } + + var parts = stringToPath(name); + + var value = getBaseIntrinsic('%' + (parts.length > 0 ? parts[0] : '') + '%', allowMissing); + for (var i = 1; i < parts.length; i += 1) { + if (value != null) { + if ($gOPD && (i + 1) >= parts.length) { + var desc = $gOPD(value, parts[i]); + if (!allowMissing && !(parts[i] in value)) { + throw new $TypeError('base intrinsic for ' + name + ' exists, but the property is not available.'); + } + value = desc ? (desc.get || desc.value) : value[parts[i]]; + } else { + value = value[parts[i]]; + } + } + } + return value; + }; + + var $Function = GetIntrinsic('%Function%'); + var $apply = $Function.apply; + var $call = $Function.call; + + var callBind = function callBind() { + return functionBind.apply($call, arguments); + }; + + var apply = function applyBind() { + return functionBind.apply($apply, arguments); + }; + callBind.apply = apply; + + var $Object = Object; + var $TypeError$1 = TypeError; + + var implementation$2 = function flags() { + if (this != null && this !== $Object(this)) { + throw new $TypeError$1('RegExp.prototype.flags getter called on non-object'); + } + var result = ''; + if (this.global) { + result += 'g'; + } + if (this.ignoreCase) { + result += 'i'; + } + if (this.multiline) { + result += 'm'; + } + if (this.dotAll) { + result += 's'; + } + if (this.unicode) { + result += 'u'; + } + if (this.sticky) { + result += 'y'; + } + return result; + }; + + var supportsDescriptors$1 = defineProperties_1.supportsDescriptors; + var $gOPD$1 = Object.getOwnPropertyDescriptor; + var $TypeError$2 = TypeError; + + var polyfill = function getPolyfill() { + if (!supportsDescriptors$1) { + throw new $TypeError$2('RegExp.prototype.flags requires a true ES5 environment that supports property descriptors'); + } + if ((/a/mig).flags === 'gim') { + var descriptor = $gOPD$1(RegExp.prototype, 'flags'); + if (descriptor && typeof descriptor.get === 'function' && typeof (/a/).dotAll === 'boolean') { + return descriptor.get; + } + } + return implementation$2; + }; + + var supportsDescriptors$2 = defineProperties_1.supportsDescriptors; + + var gOPD$1 = Object.getOwnPropertyDescriptor; + var defineProperty$1 = Object.defineProperty; + var TypeErr = TypeError; + var getProto$1 = Object.getPrototypeOf; + var regex = /a/; + + var shim = function shimFlags() { + if (!supportsDescriptors$2 || !getProto$1) { + throw new TypeErr('RegExp.prototype.flags requires a true ES5 environment that supports property descriptors'); + } + var polyfill$1 = polyfill(); + var proto = getProto$1(regex); + var descriptor = gOPD$1(proto, 'flags'); + if (!descriptor || descriptor.get !== polyfill$1) { + defineProperty$1(proto, 'flags', { + configurable: true, + enumerable: false, + get: polyfill$1 + }); + } + return polyfill$1; + }; + + var flagsBound = callBind(implementation$2); + + defineProperties_1(flagsBound, { + getPolyfill: polyfill, + implementation: implementation$2, + shim: shim + }); + + var regexp_prototype_flags = flagsBound; + + var toString = {}.toString; + + var isarray = Array.isArray || function (arr) { + return toString.call(arr) == '[object Array]'; + }; + + var getDay = Date.prototype.getDay; + var tryDateObject = function tryDateObject(value) { + try { + getDay.call(value); + return true; + } catch (e) { + return false; + } + }; + + var toStr$6 = Object.prototype.toString; + var dateClass = '[object Date]'; + var hasToStringTag$2 = typeof Symbol === 'function' && typeof Symbol.toStringTag === 'symbol'; + + var isDateObject = function isDateObject(value) { + if (typeof value !== 'object' || value === null) { return false; } + return hasToStringTag$2 ? tryDateObject(value) : toStr$6.call(value) === dateClass; + }; + + var strValue = String.prototype.valueOf; + var tryStringObject = function tryStringObject(value) { + try { + strValue.call(value); + return true; + } catch (e) { + return false; + } + }; + var toStr$7 = Object.prototype.toString; + var strClass = '[object String]'; + var hasToStringTag$3 = typeof Symbol === 'function' && typeof Symbol.toStringTag === 'symbol'; + + var isString = function isString(value) { + if (typeof value === 'string') { + return true; + } + if (typeof value !== 'object') { + return false; + } + return hasToStringTag$3 ? tryStringObject(value) : toStr$7.call(value) === strClass; + }; + + var numToStr = Number.prototype.toString; + var tryNumberObject = function tryNumberObject(value) { + try { + numToStr.call(value); + return true; + } catch (e) { + return false; + } + }; + var toStr$8 = Object.prototype.toString; + var numClass = '[object Number]'; + var hasToStringTag$4 = typeof Symbol === 'function' && typeof Symbol.toStringTag === 'symbol'; + + var isNumberObject = function isNumberObject(value) { + if (typeof value === 'number') { + return true; + } + if (typeof value !== 'object') { + return false; + } + return hasToStringTag$4 ? tryNumberObject(value) : toStr$8.call(value) === numClass; + }; + + var boolToStr = Boolean.prototype.toString; + + var tryBooleanObject = function booleanBrandCheck(value) { + try { + boolToStr.call(value); + return true; + } catch (e) { + return false; + } + }; + var toStr$9 = Object.prototype.toString; + var boolClass = '[object Boolean]'; + var hasToStringTag$5 = typeof Symbol === 'function' && typeof Symbol.toStringTag === 'symbol'; + + var isBooleanObject = function isBoolean(value) { + if (typeof value === 'boolean') { + return true; + } + if (value === null || typeof value !== 'object') { + return false; + } + return hasToStringTag$5 && Symbol.toStringTag in value ? tryBooleanObject(value) : toStr$9.call(value) === boolClass; + }; + + /* eslint complexity: [2, 17], max-statements: [2, 33] */ + var shams$1 = function hasSymbols() { + if (typeof Symbol !== 'function' || typeof Object.getOwnPropertySymbols !== 'function') { return false; } + if (typeof Symbol.iterator === 'symbol') { return true; } + + var obj = {}; + var sym = Symbol('test'); + var symObj = Object(sym); + if (typeof sym === 'string') { return false; } + + if (Object.prototype.toString.call(sym) !== '[object Symbol]') { return false; } + if (Object.prototype.toString.call(symObj) !== '[object Symbol]') { return false; } + + // temp disabled per https://github.com/ljharb/object.assign/issues/17 + // if (sym instanceof Symbol) { return false; } + // temp disabled per https://github.com/WebReflection/get-own-property-symbols/issues/4 + // if (!(symObj instanceof Symbol)) { return false; } + + // if (typeof Symbol.prototype.toString !== 'function') { return false; } + // if (String(sym) !== Symbol.prototype.toString.call(sym)) { return false; } + + var symVal = 42; + obj[sym] = symVal; + for (sym in obj) { return false; } // eslint-disable-line no-restricted-syntax + if (typeof Object.keys === 'function' && Object.keys(obj).length !== 0) { return false; } + + if (typeof Object.getOwnPropertyNames === 'function' && Object.getOwnPropertyNames(obj).length !== 0) { return false; } + + var syms = Object.getOwnPropertySymbols(obj); + if (syms.length !== 1 || syms[0] !== sym) { return false; } + + if (!Object.prototype.propertyIsEnumerable.call(obj, sym)) { return false; } + + if (typeof Object.getOwnPropertyDescriptor === 'function') { + var descriptor = Object.getOwnPropertyDescriptor(obj, sym); + if (descriptor.value !== symVal || descriptor.enumerable !== true) { return false; } + } + + return true; + }; + + var origSymbol$1 = commonjsGlobal.Symbol; + + + var hasSymbols$3 = function hasNativeSymbols() { + if (typeof origSymbol$1 !== 'function') { return false; } + if (typeof Symbol !== 'function') { return false; } + if (typeof origSymbol$1('foo') !== 'symbol') { return false; } + if (typeof Symbol('bar') !== 'symbol') { return false; } + + return shams$1(); + }; + + var isSymbol = createCommonjsModule(function (module) { + + var toStr = Object.prototype.toString; + var hasSymbols = hasSymbols$3(); + + if (hasSymbols) { + var symToStr = Symbol.prototype.toString; + var symStringRegex = /^Symbol\(.*\)$/; + var isSymbolObject = function isRealSymbolObject(value) { + if (typeof value.valueOf() !== 'symbol') { + return false; + } + return symStringRegex.test(symToStr.call(value)); + }; + + module.exports = function isSymbol(value) { + if (typeof value === 'symbol') { + return true; + } + if (toStr.call(value) !== '[object Symbol]') { + return false; + } + try { + return isSymbolObject(value); + } catch (e) { + return false; + } + }; + } else { + + module.exports = function isSymbol(value) { + // this environment does not support Symbols. + return false ; + }; + } + }); + + var isBigint = createCommonjsModule(function (module) { + + if (typeof BigInt === 'function') { + var bigIntValueOf = BigInt.prototype.valueOf; + var tryBigInt = function tryBigIntObject(value) { + try { + bigIntValueOf.call(value); + return true; + } catch (e) { + } + return false; + }; + + module.exports = function isBigInt(value) { + if ( + value === null + || typeof value === 'undefined' + || typeof value === 'boolean' + || typeof value === 'string' + || typeof value === 'number' + || typeof value === 'symbol' + || typeof value === 'function' + ) { + return false; + } + if (typeof value === 'bigint') { // eslint-disable-line valid-typeof + return true; + } + + return tryBigInt(value); + }; + } else { + module.exports = function isBigInt(value) { + return false ; + }; + } + }); + + // eslint-disable-next-line consistent-return + var whichBoxedPrimitive = function whichBoxedPrimitive(value) { + // eslint-disable-next-line eqeqeq + if (value == null || (typeof value !== 'object' && typeof value !== 'function')) { + return null; + } + if (isString(value)) { + return 'String'; + } + if (isNumberObject(value)) { + return 'Number'; + } + if (isBooleanObject(value)) { + return 'Boolean'; + } + if (isSymbol(value)) { + return 'Symbol'; + } + if (isBigint(value)) { + return 'BigInt'; + } + }; + + var $indexOf = callBind(GetIntrinsic('String.prototype.indexOf')); + + var callBound = function callBoundIntrinsic(name, allowMissing) { + var intrinsic = GetIntrinsic(name, !!allowMissing); + if (typeof intrinsic === 'function' && $indexOf(name, '.prototype.')) { + return callBind(intrinsic); + } + return intrinsic; + }; + + var $Map = typeof Map === 'function' && Map.prototype ? Map : null; + var $Set = typeof Set === 'function' && Set.prototype ? Set : null; + + var exported; + + if (!$Map) { + // eslint-disable-next-line no-unused-vars + exported = function isMap(x) { + // `Map` is not present in this environment. + return false; + }; + } + + var $mapHas = $Map ? Map.prototype.has : null; + var $setHas = $Set ? Set.prototype.has : null; + if (!exported && !$mapHas) { + // eslint-disable-next-line no-unused-vars + exported = function isMap(x) { + // `Map` does not have a `has` method + return false; + }; + } + + var isMap = exported || function isMap(x) { + if (!x || typeof x !== 'object') { + return false; + } + try { + $mapHas.call(x); + if ($setHas) { + try { + $setHas.call(x); + } catch (e) { + return true; + } + } + return x instanceof $Map; // core-js workaround, pre-v2.5.0 + } catch (e) {} + return false; + }; + + var $Map$1 = typeof Map === 'function' && Map.prototype ? Map : null; + var $Set$1 = typeof Set === 'function' && Set.prototype ? Set : null; + + var exported$1; + + if (!$Set$1) { + // eslint-disable-next-line no-unused-vars + exported$1 = function isSet(x) { + // `Set` is not present in this environment. + return false; + }; + } + + var $mapHas$1 = $Map$1 ? Map.prototype.has : null; + var $setHas$1 = $Set$1 ? Set.prototype.has : null; + if (!exported$1 && !$setHas$1) { + // eslint-disable-next-line no-unused-vars + exported$1 = function isSet(x) { + // `Set` does not have a `has` method + return false; + }; + } + + var isSet = exported$1 || function isSet(x) { + if (!x || typeof x !== 'object') { + return false; + } + try { + $setHas$1.call(x); + if ($mapHas$1) { + try { + $mapHas$1.call(x); + } catch (e) { + return true; + } + } + return x instanceof $Set$1; // core-js workaround, pre-v2.5.0 + } catch (e) {} + return false; + }; + + var $WeakMap = typeof WeakMap === 'function' && WeakMap.prototype ? WeakMap : null; + var $WeakSet = typeof WeakSet === 'function' && WeakSet.prototype ? WeakSet : null; + + var exported$2; + + if (!$WeakMap) { + // eslint-disable-next-line no-unused-vars + exported$2 = function isWeakMap(x) { + // `WeakMap` is not present in this environment. + return false; + }; + } + + var $mapHas$2 = $WeakMap ? $WeakMap.prototype.has : null; + var $setHas$2 = $WeakSet ? $WeakSet.prototype.has : null; + if (!exported$2 && !$mapHas$2) { + // eslint-disable-next-line no-unused-vars + exported$2 = function isWeakMap(x) { + // `WeakMap` does not have a `has` method + return false; + }; + } + + var isWeakmap = exported$2 || function isWeakMap(x) { + if (!x || typeof x !== 'object') { + return false; + } + try { + $mapHas$2.call(x, $mapHas$2); + if ($setHas$2) { + try { + $setHas$2.call(x, $setHas$2); + } catch (e) { + return true; + } + } + return x instanceof $WeakMap; // core-js workaround, pre-v3 + } catch (e) {} + return false; + }; + + var isWeakset = createCommonjsModule(function (module) { + + var $WeakMap = typeof WeakMap === 'function' && WeakMap.prototype ? WeakMap : null; + var $WeakSet = typeof WeakSet === 'function' && WeakSet.prototype ? WeakSet : null; + + var exported; + + if (!$WeakMap) { + // eslint-disable-next-line no-unused-vars + exported = function isWeakSet(x) { + // `WeakSet` is not present in this environment. + return false; + }; + } + + var $mapHas = $WeakMap ? $WeakMap.prototype.has : null; + var $setHas = $WeakSet ? $WeakSet.prototype.has : null; + if (!exported && !$setHas) { + // eslint-disable-next-line no-unused-vars + module.exports = function isWeakSet(x) { + // `WeakSet` does not have a `has` method + return false; + }; + } + + module.exports = exported || function isWeakSet(x) { + if (!x || typeof x !== 'object') { + return false; + } + try { + $setHas.call(x, $setHas); + if ($mapHas) { + try { + $mapHas.call(x, $mapHas); + } catch (e) { + return true; + } + } + return x instanceof $WeakSet; // core-js workaround, pre-v3 + } catch (e) {} + return false; + }; + }); + + var whichCollection = function whichCollection(value) { + if (value && typeof value === 'object') { + if (isMap(value)) { + return 'Map'; + } + if (isSet(value)) { + return 'Set'; + } + if (isWeakmap(value)) { + return 'WeakMap'; + } + if (isWeakset(value)) { + return 'WeakSet'; + } + } + return false; + }; + + /* eslint complexity: [2, 18], max-statements: [2, 33] */ + var shams$2 = function hasSymbols() { + if (typeof Symbol !== 'function' || typeof Object.getOwnPropertySymbols !== 'function') { return false; } + if (typeof Symbol.iterator === 'symbol') { return true; } + + var obj = {}; + var sym = Symbol('test'); + var symObj = Object(sym); + if (typeof sym === 'string') { return false; } + + if (Object.prototype.toString.call(sym) !== '[object Symbol]') { return false; } + if (Object.prototype.toString.call(symObj) !== '[object Symbol]') { return false; } + + // temp disabled per https://github.com/ljharb/object.assign/issues/17 + // if (sym instanceof Symbol) { return false; } + // temp disabled per https://github.com/WebReflection/get-own-property-symbols/issues/4 + // if (!(symObj instanceof Symbol)) { return false; } + + // if (typeof Symbol.prototype.toString !== 'function') { return false; } + // if (String(sym) !== Symbol.prototype.toString.call(sym)) { return false; } + + var symVal = 42; + obj[sym] = symVal; + for (sym in obj) { return false; } // eslint-disable-line no-restricted-syntax + if (typeof Object.keys === 'function' && Object.keys(obj).length !== 0) { return false; } + + if (typeof Object.getOwnPropertyNames === 'function' && Object.getOwnPropertyNames(obj).length !== 0) { return false; } + + var syms = Object.getOwnPropertySymbols(obj); + if (syms.length !== 1 || syms[0] !== sym) { return false; } + + if (!Object.prototype.propertyIsEnumerable.call(obj, sym)) { return false; } + + if (typeof Object.getOwnPropertyDescriptor === 'function') { + var descriptor = Object.getOwnPropertyDescriptor(obj, sym); + if (descriptor.value !== symVal || descriptor.enumerable !== true) { return false; } + } + + return true; + }; + + var origSymbol$2 = commonjsGlobal.Symbol; + + + var hasSymbols$4 = function hasNativeSymbols() { + if (typeof origSymbol$2 !== 'function') { return false; } + if (typeof Symbol !== 'function') { return false; } + if (typeof origSymbol$2('foo') !== 'symbol') { return false; } + if (typeof Symbol('bar') !== 'symbol') { return false; } + + return shams$2(); + }; + + var toString$1 = {}.toString; + + var isarray$1 = Array.isArray || function (arr) { + return toString$1.call(arr) == '[object Array]'; + }; + + var esGetIterator = createCommonjsModule(function (module) { + + /* eslint global-require: 0 */ + // the code is structured this way so that bundlers can + // alias out `has-symbols` to `() => true` or `() => false` if your target + // environments' Symbol capabilities are known, and then use + // dead code elimination on the rest of this module. + // + // Similarly, `isarray` can be aliased to `Array.isArray` if + // available in all target environments. + + + + if (hasSymbols$4() || shams$2()) { + var $iterator = Symbol.iterator; + // Symbol is available natively or shammed + // natively: + // - Chrome >= 38 + // - Edge 12-14?, Edge >= 15 for sure + // - FF >= 36 + // - Safari >= 9 + // - node >= 0.12 + module.exports = function getIterator(iterable) { + // alternatively, `iterable[$iterator]?.()` + if (iterable != null && typeof iterable[$iterator] !== 'undefined') { + return iterable[$iterator](); + } + if (isArguments$1(iterable)) { + // arguments objects lack Symbol.iterator + // - node 0.12 + return Array.prototype[$iterator].call(iterable); + } + }; + } else { + // Symbol is not available, native or shammed + var isArray = isarray$1; + var isString$1 = isString; + var GetIntrinsic$1 = GetIntrinsic; + var $Map = GetIntrinsic$1('%Map%', true); + var $Set = GetIntrinsic$1('%Set%', true); + var callBound$1 = callBound; + var $arrayPush = callBound$1('Array.prototype.push'); + var $charCodeAt = callBound$1('String.prototype.charCodeAt'); + var $stringSlice = callBound$1('String.prototype.slice'); + + var advanceStringIndex = function advanceStringIndex(S, index) { + var length = S.length; + if ((index + 1) >= length) { + return index + 1; + } + + var first = $charCodeAt(S, index); + if (first < 0xD800 || first > 0xDBFF) { + return index + 1; + } + + var second = $charCodeAt(S, index + 1); + if (second < 0xDC00 || second > 0xDFFF) { + return index + 1; + } + + return index + 2; + }; + + var getArrayIterator = function getArrayIterator(arraylike) { + var i = 0; + return { + next: function next() { + var done = i >= arraylike.length; + var value; + if (!done) { + value = arraylike[i]; + i += 1; + } + return { + done: done, + value: value + }; + } + }; + }; + + var getNonCollectionIterator = function getNonCollectionIterator(iterable) { + if (isArray(iterable) || isArguments$1(iterable)) { + return getArrayIterator(iterable); + } + if (isString$1(iterable)) { + var i = 0; + return { + next: function next() { + var nextIndex = advanceStringIndex(iterable, i); + var value = $stringSlice(iterable, i, nextIndex); + i = nextIndex; + return { + done: nextIndex > iterable.length, + value: value + }; + } + }; + } + }; + + if (!$Map && !$Set) { + // the only language iterables are Array, String, arguments + // - Safari <= 6.0 + // - Chrome < 38 + // - node < 0.12 + // - FF < 13 + // - IE < 11 + // - Edge < 11 + + module.exports = getNonCollectionIterator; + } else { + // either Map or Set are available, but Symbol is not + // - es6-shim on an ES5 browser + // - Safari 6.2 (maybe 6.1?) + // - FF v[13, 36) + // - IE 11 + // - Edge 11 + // - Safari v[6, 9) + + var isMap$1 = isMap; + var isSet$1 = isSet; + + // Firefox >= 27, IE 11, Safari 6.2 - 9, Edge 11, es6-shim in older envs, all have forEach + var $mapForEach = callBound$1('Map.prototype.forEach', true); + var $setForEach = callBound$1('Set.prototype.forEach', true); + if (typeof process === 'undefined' || !process.versions || !process.versions.node) { // "if is not node" + + // Firefox 17 - 26 has `.iterator()`, whose iterator `.next()` either + // returns a value, or throws a StopIteration object. These browsers + // do not have any other mechanism for iteration. + var $mapIterator = callBound$1('Map.prototype.iterator', true); + var $setIterator = callBound$1('Set.prototype.iterator', true); + var getStopIterationIterator = function (iterator) { + var done = false; + return { + next: function next() { + try { + return { + done: done, + value: done ? undefined : iterator.next() + }; + } catch (e) { + done = true; + return { + done: true, + value: undefined + }; + } + } + }; + }; + } + // Firefox 27-35, and some older es6-shim versions, use a string "@@iterator" property + // this returns a proper iterator object, so we should use it instead of forEach. + // newer es6-shim versions use a string "_es6-shim iterator_" property. + var $mapAtAtIterator = callBound$1('Map.prototype.@@iterator', true) || callBound$1('Map.prototype._es6-shim iterator_', true); + var $setAtAtIterator = callBound$1('Set.prototype.@@iterator', true) || callBound$1('Set.prototype._es6-shim iterator_', true); + + var getCollectionIterator = function getCollectionIterator(iterable) { + if (isMap$1(iterable)) { + if ($mapIterator) { + return getStopIterationIterator($mapIterator(iterable)); + } + if ($mapAtAtIterator) { + return $mapAtAtIterator(iterable); + } + if ($mapForEach) { + var entries = []; + $mapForEach(iterable, function (v, k) { + $arrayPush(entries, [k, v]); + }); + return getArrayIterator(entries); + } + } + if (isSet$1(iterable)) { + if ($setIterator) { + return getStopIterationIterator($setIterator(iterable)); + } + if ($setAtAtIterator) { + return $setAtAtIterator(iterable); + } + if ($setForEach) { + var values = []; + $setForEach(iterable, function (v) { + $arrayPush(values, v); + }); + return getArrayIterator(values); + } + } + }; + + module.exports = function getIterator(iterable) { + return getCollectionIterator(iterable) || getNonCollectionIterator(iterable); + }; + } + } + }); + + var _nodeResolve_empty = {}; + + var _nodeResolve_empty$1 = /*#__PURE__*/Object.freeze({ + 'default': _nodeResolve_empty + }); + + var require$$0$1 = getCjsExportFromNamespace(_nodeResolve_empty$1); + + var hasMap = typeof Map === 'function' && Map.prototype; + var mapSizeDescriptor = Object.getOwnPropertyDescriptor && hasMap ? Object.getOwnPropertyDescriptor(Map.prototype, 'size') : null; + var mapSize = hasMap && mapSizeDescriptor && typeof mapSizeDescriptor.get === 'function' ? mapSizeDescriptor.get : null; + var mapForEach = hasMap && Map.prototype.forEach; + var hasSet = typeof Set === 'function' && Set.prototype; + var setSizeDescriptor = Object.getOwnPropertyDescriptor && hasSet ? Object.getOwnPropertyDescriptor(Set.prototype, 'size') : null; + var setSize = hasSet && setSizeDescriptor && typeof setSizeDescriptor.get === 'function' ? setSizeDescriptor.get : null; + var setForEach = hasSet && Set.prototype.forEach; + var hasWeakMap = typeof WeakMap === 'function' && WeakMap.prototype; + var weakMapHas = hasWeakMap ? WeakMap.prototype.has : null; + var hasWeakSet = typeof WeakSet === 'function' && WeakSet.prototype; + var weakSetHas = hasWeakSet ? WeakSet.prototype.has : null; + var booleanValueOf = Boolean.prototype.valueOf; + var objectToString = Object.prototype.toString; + var match = String.prototype.match; + var bigIntValueOf = typeof BigInt === 'function' ? BigInt.prototype.valueOf : null; + + var inspectCustom = require$$0$1.custom; + var inspectSymbol = inspectCustom && isSymbol$1(inspectCustom) ? inspectCustom : null; + + var objectInspect = function inspect_(obj, options, depth, seen) { + var opts = options || {}; + + if (has$2(opts, 'quoteStyle') && (opts.quoteStyle !== 'single' && opts.quoteStyle !== 'double')) { + throw new TypeError('option "quoteStyle" must be "single" or "double"'); + } + + if (typeof obj === 'undefined') { + return 'undefined'; + } + if (obj === null) { + return 'null'; + } + if (typeof obj === 'boolean') { + return obj ? 'true' : 'false'; + } + + if (typeof obj === 'string') { + return inspectString(obj, opts); + } + if (typeof obj === 'number') { + if (obj === 0) { + return Infinity / obj > 0 ? '0' : '-0'; + } + return String(obj); + } + if (typeof obj === 'bigint') { // eslint-disable-line valid-typeof + return String(obj) + 'n'; + } + + var maxDepth = typeof opts.depth === 'undefined' ? 5 : opts.depth; + if (typeof depth === 'undefined') { depth = 0; } + if (depth >= maxDepth && maxDepth > 0 && typeof obj === 'object') { + return '[Object]'; + } + + if (typeof seen === 'undefined') { + seen = []; + } else if (indexOf(seen, obj) >= 0) { + return '[Circular]'; + } + + function inspect(value, from) { + if (from) { + seen = seen.slice(); + seen.push(from); + } + return inspect_(value, opts, depth + 1, seen); + } + + if (typeof obj === 'function') { + var name = nameOf(obj); + return '[Function' + (name ? ': ' + name : '') + ']'; + } + if (isSymbol$1(obj)) { + var symString = Symbol.prototype.toString.call(obj); + return typeof obj === 'object' ? markBoxed(symString) : symString; + } + if (isElement(obj)) { + var s = '<' + String(obj.nodeName).toLowerCase(); + var attrs = obj.attributes || []; + for (var i = 0; i < attrs.length; i++) { + s += ' ' + attrs[i].name + '=' + wrapQuotes(quote(attrs[i].value), 'double', opts); + } + s += '>'; + if (obj.childNodes && obj.childNodes.length) { s += '...'; } + s += '' + String(obj.nodeName).toLowerCase() + '>'; + return s; + } + if (isArray(obj)) { + if (obj.length === 0) { return '[]'; } + return '[ ' + arrObjKeys(obj, inspect).join(', ') + ' ]'; + } + if (isError(obj)) { + var parts = arrObjKeys(obj, inspect); + if (parts.length === 0) { return '[' + String(obj) + ']'; } + return '{ [' + String(obj) + '] ' + parts.join(', ') + ' }'; + } + if (typeof obj === 'object') { + if (inspectSymbol && typeof obj[inspectSymbol] === 'function') { + return obj[inspectSymbol](); + } else if (typeof obj.inspect === 'function') { + return obj.inspect(); + } + } + if (isMap$1(obj)) { + var mapParts = []; + mapForEach.call(obj, function (value, key) { + mapParts.push(inspect(key, obj) + ' => ' + inspect(value, obj)); + }); + return collectionOf('Map', mapSize.call(obj), mapParts); + } + if (isSet$1(obj)) { + var setParts = []; + setForEach.call(obj, function (value) { + setParts.push(inspect(value, obj)); + }); + return collectionOf('Set', setSize.call(obj), setParts); + } + if (isWeakMap(obj)) { + return weakCollectionOf('WeakMap'); + } + if (isWeakSet(obj)) { + return weakCollectionOf('WeakSet'); + } + if (isNumber(obj)) { + return markBoxed(inspect(Number(obj))); + } + if (isBigInt(obj)) { + return markBoxed(inspect(bigIntValueOf.call(obj))); + } + if (isBoolean(obj)) { + return markBoxed(booleanValueOf.call(obj)); + } + if (isString$1(obj)) { + return markBoxed(inspect(String(obj))); + } + if (!isDate(obj) && !isRegExp(obj)) { + var xs = arrObjKeys(obj, inspect); + if (xs.length === 0) { return '{}'; } + return '{ ' + xs.join(', ') + ' }'; + } + return String(obj); + }; + + function wrapQuotes(s, defaultStyle, opts) { + var quoteChar = (opts.quoteStyle || defaultStyle) === 'double' ? '"' : "'"; + return quoteChar + s + quoteChar; + } + + function quote(s) { + return String(s).replace(/"/g, '"'); + } + + function isArray(obj) { return toStr$a(obj) === '[object Array]'; } + function isDate(obj) { return toStr$a(obj) === '[object Date]'; } + function isRegExp(obj) { return toStr$a(obj) === '[object RegExp]'; } + function isError(obj) { return toStr$a(obj) === '[object Error]'; } + function isSymbol$1(obj) { return toStr$a(obj) === '[object Symbol]'; } + function isString$1(obj) { return toStr$a(obj) === '[object String]'; } + function isNumber(obj) { return toStr$a(obj) === '[object Number]'; } + function isBigInt(obj) { return toStr$a(obj) === '[object BigInt]'; } + function isBoolean(obj) { return toStr$a(obj) === '[object Boolean]'; } + + var hasOwn = Object.prototype.hasOwnProperty || function (key) { return key in this; }; + function has$2(obj, key) { + return hasOwn.call(obj, key); + } + + function toStr$a(obj) { + return objectToString.call(obj); + } + + function nameOf(f) { + if (f.name) { return f.name; } + var m = match.call(f, /^function\s*([\w$]+)/); + if (m) { return m[1]; } + return null; + } + + function indexOf(xs, x) { + if (xs.indexOf) { return xs.indexOf(x); } + for (var i = 0, l = xs.length; i < l; i++) { + if (xs[i] === x) { return i; } + } + return -1; + } + + function isMap$1(x) { + if (!mapSize || !x || typeof x !== 'object') { + return false; + } + try { + mapSize.call(x); + try { + setSize.call(x); + } catch (s) { + return true; + } + return x instanceof Map; // core-js workaround, pre-v2.5.0 + } catch (e) {} + return false; + } + + function isWeakMap(x) { + if (!weakMapHas || !x || typeof x !== 'object') { + return false; + } + try { + weakMapHas.call(x, weakMapHas); + try { + weakSetHas.call(x, weakSetHas); + } catch (s) { + return true; + } + return x instanceof WeakMap; // core-js workaround, pre-v2.5.0 + } catch (e) {} + return false; + } + + function isSet$1(x) { + if (!setSize || !x || typeof x !== 'object') { + return false; + } + try { + setSize.call(x); + try { + mapSize.call(x); + } catch (m) { + return true; + } + return x instanceof Set; // core-js workaround, pre-v2.5.0 + } catch (e) {} + return false; + } + + function isWeakSet(x) { + if (!weakSetHas || !x || typeof x !== 'object') { + return false; + } + try { + weakSetHas.call(x, weakSetHas); + try { + weakMapHas.call(x, weakMapHas); + } catch (s) { + return true; + } + return x instanceof WeakSet; // core-js workaround, pre-v2.5.0 + } catch (e) {} + return false; + } + + function isElement(x) { + if (!x || typeof x !== 'object') { return false; } + if (typeof HTMLElement !== 'undefined' && x instanceof HTMLElement) { + return true; + } + return typeof x.nodeName === 'string' && typeof x.getAttribute === 'function'; + } + + function inspectString(str, opts) { + // eslint-disable-next-line no-control-regex + var s = str.replace(/(['\\])/g, '\\$1').replace(/[\x00-\x1f]/g, lowbyte); + return wrapQuotes(s, 'single', opts); + } + + function lowbyte(c) { + var n = c.charCodeAt(0); + var x = { + 8: 'b', 9: 't', 10: 'n', 12: 'f', 13: 'r' + }[n]; + if (x) { return '\\' + x; } + return '\\x' + (n < 0x10 ? '0' : '') + n.toString(16); + } + + function markBoxed(str) { + return 'Object(' + str + ')'; + } + + function weakCollectionOf(type) { + return type + ' { ? }'; + } + + function collectionOf(type, size, entries) { + return type + ' (' + size + ') {' + entries.join(', ') + '}'; + } + + function arrObjKeys(obj, inspect) { + var isArr = isArray(obj); + var xs = []; + if (isArr) { + xs.length = obj.length; + for (var i = 0; i < obj.length; i++) { + xs[i] = has$2(obj, i) ? inspect(obj[i], obj) : ''; + } + } + for (var key in obj) { // eslint-disable-line no-restricted-syntax + if (!has$2(obj, key)) { continue; } // eslint-disable-line no-restricted-syntax, no-continue + if (isArr && String(Number(key)) === key && key < obj.length) { continue; } // eslint-disable-line no-restricted-syntax, no-continue + if ((/[^\w$]/).test(key)) { + xs.push(inspect(key, obj) + ': ' + inspect(obj[key], obj)); + } else { + xs.push(key + ': ' + inspect(obj[key], obj)); + } + } + return xs; + } + + var $TypeError$3 = GetIntrinsic('%TypeError%'); + var $WeakMap$1 = GetIntrinsic('%WeakMap%', true); + var $Map$2 = GetIntrinsic('%Map%', true); + var $push = callBound('Array.prototype.push'); + + var $weakMapGet = callBound('WeakMap.prototype.get', true); + var $weakMapSet = callBound('WeakMap.prototype.set', true); + var $weakMapHas = callBound('WeakMap.prototype.has', true); + var $mapGet = callBound('Map.prototype.get', true); + var $mapSet = callBound('Map.prototype.set', true); + var $mapHas$3 = callBound('Map.prototype.has', true); + var objectGet = function (objects, key) { // eslint-disable-line consistent-return + for (var i = 0; i < objects.length; i += 1) { + if (objects[i].key === key) { + return objects[i].value; + } + } + }; + var objectSet = function (objects, key, value) { + for (var i = 0; i < objects.length; i += 1) { + if (objects[i].key === key) { + objects[i].value = value; // eslint-disable-line no-param-reassign + return; + } + } + $push(objects, { + key: key, + value: value + }); + }; + var objectHas = function (objects, key) { + for (var i = 0; i < objects.length; i += 1) { + if (objects[i].key === key) { + return true; + } + } + return false; + }; + + var sideChannel = function getSideChannel() { + var $wm; + var $m; + var $o; + var channel = { + assert: function (key) { + if (!channel.has(key)) { + throw new $TypeError$3('Side channel does not contain ' + objectInspect(key)); + } + }, + get: function (key) { // eslint-disable-line consistent-return + if ($WeakMap$1 && key && (typeof key === 'object' || typeof key === 'function')) { + if ($wm) { + return $weakMapGet($wm, key); + } + } else if ($Map$2) { + if ($m) { + return $mapGet($m, key); + } + } else { + if ($o) { // eslint-disable-line no-lonely-if + return objectGet($o, key); + } + } + }, + has: function (key) { + if ($WeakMap$1 && key && (typeof key === 'object' || typeof key === 'function')) { + if ($wm) { + return $weakMapHas($wm, key); + } + } else if ($Map$2) { + if ($m) { + return $mapHas$3($m, key); + } + } else { + if ($o) { // eslint-disable-line no-lonely-if + return objectHas($o, key); + } + } + return false; + }, + set: function (key, value) { + if ($WeakMap$1 && key && (typeof key === 'object' || typeof key === 'function')) { + if (!$wm) { + $wm = new $WeakMap$1(); + } + $weakMapSet($wm, key, value); + } else if ($Map$2) { + if (!$m) { + $m = new $Map$2(); + } + $mapSet($m, key, value); + } else { + if (!$o) { + $o = []; + } + objectSet($o, key, value); + } + } + }; + return channel; + }; + + var $getTime = callBound('Date.prototype.getTime'); + var gPO = Object.getPrototypeOf; + var $objToString = callBound('Object.prototype.toString'); + + var $Set$2 = GetIntrinsic('%Set%', true); + var $mapHas$4 = callBound('Map.prototype.has', true); + var $mapGet$1 = callBound('Map.prototype.get', true); + var $mapSize = callBound('Map.prototype.size', true); + var $setAdd = callBound('Set.prototype.add', true); + var $setDelete = callBound('Set.prototype.delete', true); + var $setHas$3 = callBound('Set.prototype.has', true); + var $setSize = callBound('Set.prototype.size', true); + + // taken from https://github.com/browserify/commonjs-assert/blob/bba838e9ba9e28edf3127ce6974624208502f6bc/internal/util/comparisons.js#L401-L414 + function setHasEqualElement(set, val1, strict, channel) { + var i = esGetIterator(set); + var result; + while ((result = i.next()) && !result.done) { + if (internalDeepEqual(val1, result.value, strict, channel)) { // eslint-disable-line no-use-before-define + // Remove the matching element to make sure we do not check that again. + $setDelete(set, result.value); + return true; + } + } + + return false; + } + + // taken from https://github.com/browserify/commonjs-assert/blob/bba838e9ba9e28edf3127ce6974624208502f6bc/internal/util/comparisons.js#L416-L439 + function findLooseMatchingPrimitives(prim) { + if (typeof prim === 'undefined') { + return null; + } + if (typeof prim === 'object') { // Only pass in null as object! + return void 0; + } + if (typeof prim === 'symbol') { + return false; + } + if (typeof prim === 'string' || typeof prim === 'number') { + // Loose equal entries exist only if the string is possible to convert to a regular number and not NaN. + return +prim === +prim; // eslint-disable-line no-implicit-coercion + } + return true; + } + + // taken from https://github.com/browserify/commonjs-assert/blob/bba838e9ba9e28edf3127ce6974624208502f6bc/internal/util/comparisons.js#L449-L460 + function mapMightHaveLoosePrim(a, b, prim, item, channel) { + var altValue = findLooseMatchingPrimitives(prim); + if (altValue != null) { + return altValue; + } + var curB = $mapGet$1(b, altValue); + // eslint-disable-next-line no-use-before-define + if ((typeof curB === 'undefined' && !$mapHas$4(b, altValue)) || !internalDeepEqual(item, curB, false, channel)) { + return false; + } + // eslint-disable-next-line no-use-before-define + return !$mapHas$4(a, altValue) && internalDeepEqual(item, curB, false, channel); + } + + // taken from https://github.com/browserify/commonjs-assert/blob/bba838e9ba9e28edf3127ce6974624208502f6bc/internal/util/comparisons.js#L441-L447 + function setMightHaveLoosePrim(a, b, prim) { + var altValue = findLooseMatchingPrimitives(prim); + if (altValue != null) { + return altValue; + } + + return $setHas$3(b, altValue) && !$setHas$3(a, altValue); + } + + // taken from https://github.com/browserify/commonjs-assert/blob/bba838e9ba9e28edf3127ce6974624208502f6bc/internal/util/comparisons.js#L518-L533 + function mapHasEqualEntry(set, map, key1, item1, strict, channel) { + var i = esGetIterator(set); + var result; + var key2; + while ((result = i.next()) && !result.done) { + key2 = result.value; + if ( + // eslint-disable-next-line no-use-before-define + internalDeepEqual(key1, key2, strict, channel) + // eslint-disable-next-line no-use-before-define + && internalDeepEqual(item1, $mapGet$1(map, key2), strict, channel) + ) { + $setDelete(set, key2); + return true; + } + } + + return false; + } + + function internalDeepEqual(actual, expected, options, channel) { + var opts = options || {}; + + // 7.1. All identical values are equivalent, as determined by ===. + if (opts.strict ? objectIs(actual, expected) : actual === expected) { + return true; + } + + var actualBoxed = whichBoxedPrimitive(actual); + var expectedBoxed = whichBoxedPrimitive(expected); + if (actualBoxed !== expectedBoxed) { + return false; + } + + // 7.3. Other pairs that do not both pass typeof value == 'object', equivalence is determined by ==. + if (!actual || !expected || (typeof actual !== 'object' && typeof expected !== 'object')) { + if ((actual === false && expected) || (actual && expected === false)) { return false; } + return opts.strict ? objectIs(actual, expected) : actual == expected; // eslint-disable-line eqeqeq + } + + /* + * 7.4. For all other Object pairs, including Array objects, equivalence is + * determined by having the same number of owned properties (as verified + * with Object.prototype.hasOwnProperty.call), the same set of keys + * (although not necessarily the same order), equivalent values for every + * corresponding key, and an identical 'prototype' property. Note: this + * accounts for both named and indexed properties on Arrays. + */ + // see https://github.com/nodejs/node/commit/d3aafd02efd3a403d646a3044adcf14e63a88d32 for memos/channel inspiration + + var hasActual = channel.has(actual); + var hasExpected = channel.has(expected); + var sentinel; + if (hasActual && hasExpected) { + if (channel.get(actual) === channel.get(expected)) { + return true; + } + } else { + sentinel = {}; + } + if (!hasActual) { channel.set(actual, sentinel); } + if (!hasExpected) { channel.set(expected, sentinel); } + + // eslint-disable-next-line no-use-before-define + return objEquiv(actual, expected, opts, channel); + } + + function isBuffer(x) { + if (!x || typeof x !== 'object' || typeof x.length !== 'number') { + return false; + } + if (typeof x.copy !== 'function' || typeof x.slice !== 'function') { + return false; + } + if (x.length > 0 && typeof x[0] !== 'number') { + return false; + } + return true; + } + + function setEquiv(a, b, opts, channel) { + if ($setSize(a) !== $setSize(b)) { + return false; + } + var iA = esGetIterator(a); + var iB = esGetIterator(b); + var resultA; + var resultB; + var set; + while ((resultA = iA.next()) && !resultA.done) { + if (resultA.value && typeof resultA.value === 'object') { + if (!set) { set = new $Set$2(); } + $setAdd(set, resultA.value); + } else if (!$setHas$3(b, resultA.value)) { + if (opts.strict) { return false; } + if (!setMightHaveLoosePrim(a, b, resultA.value)) { + return false; + } + if (!set) { set = new $Set$2(); } + $setAdd(set, resultA.value); + } + } + if (set) { + while ((resultB = iB.next()) && !resultB.done) { + // We have to check if a primitive value is already matching and only if it's not, go hunting for it. + if (resultB.value && typeof resultB.value === 'object') { + if (!setHasEqualElement(set, resultB.value, opts.strict, channel)) { + return false; + } + } else if ( + !opts.strict + && !$setHas$3(a, resultB.value) + && !setHasEqualElement(set, resultB.value, opts.strict, channel) + ) { + return false; + } + } + return $setSize(set) === 0; + } + return true; + } + + function mapEquiv(a, b, opts, channel) { + if ($mapSize(a) !== $mapSize(b)) { + return false; + } + var iA = esGetIterator(a); + var iB = esGetIterator(b); + var resultA; + var resultB; + var set; + var key; + var item1; + var item2; + while ((resultA = iA.next()) && !resultA.done) { + key = resultA.value[0]; + item1 = resultA.value[1]; + if (key && typeof key === 'object') { + if (!set) { set = new $Set$2(); } + $setAdd(set, key); + } else { + item2 = $mapGet$1(b, key); + // if (typeof curB === 'undefined' && !$mapHas(b, altValue) || !internalDeepEqual(item, curB, false, channel)) { + if ((typeof item2 === 'undefined' && !$mapHas$4(b, key)) || !internalDeepEqual(item1, item2, opts.strict, channel)) { + if (opts.strict) { + return false; + } + if (!mapMightHaveLoosePrim(a, b, key, item1, channel)) { + return false; + } + if (!set) { set = new $Set$2(); } + $setAdd(set, key); + } + } + } + + if (set) { + while ((resultB = iB.next()) && !resultB.done) { + key = resultB.value[0]; + item1 = resultB.value[1]; + if (key && typeof key === 'object') { + if (!mapHasEqualEntry(set, a, key, item1, opts.strict, channel)) { + return false; + } + } else if ( + !opts.strict + && (!a.has(key) || !internalDeepEqual($mapGet$1(a, key), item1, false, channel)) + && !mapHasEqualEntry(set, a, key, item1, false, channel) + ) { + return false; + } + } + return $setSize(set) === 0; + } + return true; + } + + function objEquiv(a, b, opts, channel) { + /* eslint max-statements: [2, 100], max-lines-per-function: [2, 120], max-depth: [2, 5] */ + var i, key; + + if (typeof a !== typeof b) { return false; } + if (a == null || b == null) { return false; } + + // an identical 'prototype' property. + if (a.prototype !== b.prototype) { return false; } + + if ($objToString(a) !== $objToString(b)) { return false; } + + if (isArguments$1(a) !== isArguments$1(b)) { return false; } + + var aIsArray = isarray(a); + var bIsArray = isarray(b); + if (aIsArray !== bIsArray) { return false; } + + // TODO: replace when a cross-realm brand check is available + var aIsError = a instanceof Error; + var bIsError = b instanceof Error; + if (aIsError !== bIsError) { return false; } + if (aIsError || bIsError) { + if (a.name !== b.name || a.message !== b.message) { return false; } + } + + var aIsRegex = isRegex(a); + var bIsRegex = isRegex(b); + if (aIsRegex !== bIsRegex) { return false; } + if ((aIsRegex || bIsRegex) && (a.source !== b.source || regexp_prototype_flags(a) !== regexp_prototype_flags(b))) { + return false; + } + + var aIsDate = isDateObject(a); + var bIsDate = isDateObject(b); + if (aIsDate !== bIsDate) { return false; } + if (aIsDate || bIsDate) { // && would work too, because both are true or both false here + if ($getTime(a) !== $getTime(b)) { return false; } + } + if (opts.strict && gPO && gPO(a) !== gPO(b)) { return false; } + + var aIsBuffer = isBuffer(a); + var bIsBuffer = isBuffer(b); + if (aIsBuffer !== bIsBuffer) { return false; } + if (aIsBuffer || bIsBuffer) { // && would work too, because both are true or both false here + if (a.length !== b.length) { return false; } + for (i = 0; i < a.length; i++) { + if (a[i] !== b[i]) { return false; } + } + return true; + } + + if (typeof a !== typeof b) { return false; } + + try { + var ka = objectKeys(a); + var kb = objectKeys(b); + } catch (e) { // happens when one is a string literal and the other isn't + return false; + } + // having the same number of owned properties (keys incorporates hasOwnProperty) + if (ka.length !== kb.length) { return false; } + + // the same set of keys (although not necessarily the same order), + ka.sort(); + kb.sort(); + // ~~~cheap key test + for (i = ka.length - 1; i >= 0; i--) { + if (ka[i] != kb[i]) { return false; } // eslint-disable-line eqeqeq + } + + // equivalent values for every corresponding key, and ~~~possibly expensive deep test + for (i = ka.length - 1; i >= 0; i--) { + key = ka[i]; + if (!internalDeepEqual(a[key], b[key], opts, channel)) { return false; } + } + + var aCollection = whichCollection(a); + var bCollection = whichCollection(b); + if (aCollection !== bCollection) { + return false; + } + if (aCollection === 'Set' || bCollection === 'Set') { // aCollection === bCollection + return setEquiv(a, b, opts, channel); + } + if (aCollection === 'Map') { // aCollection === bCollection + return mapEquiv(a, b, opts, channel); + } + + return true; + } + + var deepEqual = function deepEqual(a, b, opts) { + return internalDeepEqual(a, b, opts, sideChannel()); + }; + + const attachChildren = initialiseOpts => (htmlElement, options) => { + const { + uiFunctions, + componentLibraries, + treeNode, + onScreenSlotRendered, + setupState, + getCurrentState, + } = initialiseOpts; + + const anchor = options && options.anchor ? options.anchor : null; + const force = options ? options.force : false; + const hydrate = options ? options.hydrate : true; + + if (!force && treeNode.children.length > 0) return treeNode.children + + for (let childNode of treeNode.children) { + childNode.destroy(); + } + + if (hydrate) { + while (htmlElement.firstChild) { + htmlElement.removeChild(htmlElement.firstChild); + } + } + + htmlElement.classList.add(`lay-${treeNode.props._id}`); + + const childNodes = []; + for (let childProps of treeNode.props._children) { + const { componentName, libName } = splitName(childProps._component); + + if (!componentName || !libName) return + + const componentConstructor = componentLibraries[libName][componentName]; + + const childNodesThisIteration = prepareRenderComponent({ + props: childProps, + parentNode: treeNode, + componentConstructor, + uiFunctions, + htmlElement, + anchor, + getCurrentState, + }); + + for (let childNode of childNodesThisIteration) { + childNodes.push(childNode); + } + } + + if (areTreeNodesEqual(treeNode.children, childNodes)) return treeNode.children + + for (let node of childNodes) { + const initialProps = setupState(node); + node.render(initialProps); + } + + const screenSlot = childNodes.find(n => isScreenSlot(n.props._component)); + + if (onScreenSlotRendered && screenSlot) { + // assuming there is only ever one screen slot + onScreenSlotRendered(screenSlot); + } + + treeNode.children = childNodes; + + return childNodes + }; + + const splitName = fullname => { + const componentName = $(fullname, [fp_3("/"), fp_5]); + + const libName = fullname.substring( + 0, + fullname.length - componentName.length - 1 + ); + + return { libName, componentName } + }; + + const areTreeNodesEqual = (children1, children2) => { + if (children1.length !== children2.length) return false + if (children1 === children2) return true + + let isEqual = false; + for (let i = 0; i < children1.length; i++) { + isEqual = deepEqual(children1[i].context, children2[i].context); + if (!isEqual) return false + if (isScreenSlot(children1[i].parentNode.props._component)) { + isEqual = deepEqual(children1[i].props, children2[i].props); + } + if (!isEqual) return false + } + return true + }; + + function regexparam (str, loose) { + if (str instanceof RegExp) return { keys:false, pattern:str }; + var c, o, tmp, ext, keys=[], pattern='', arr = str.split('/'); + arr[0] || arr.shift(); + + while (tmp = arr.shift()) { + c = tmp[0]; + if (c === '*') { + keys.push('wild'); + pattern += '/(.*)'; + } else if (c === ':') { + o = tmp.indexOf('?', 1); + ext = tmp.indexOf('.', 1); + keys.push( tmp.substring(1, !!~o ? o : !!~ext ? ext : tmp.length) ); + pattern += !!~o && !~ext ? '(?:/([^/]+?))?' : '/([^/]+?)'; + if (!!~ext) pattern += (!!~o ? '?' : '') + '\\' + tmp.substring(ext); + } else { + pattern += '/' + tmp; + } + } + + return { + keys: keys, + pattern: new RegExp('^' + pattern + (loose ? '(?=$|\/)' : '\/?$'), 'i') + }; + } + + const screenRouter = (screens, onScreenSelected, appRootPath) => { + const makeRootedPath = url => { + if (appRootPath) { + if (url) return `${appRootPath}${url.startsWith("/") ? "" : "/"}${url}` + return appRootPath + } + return url + }; + + const routes = screens.map(s => makeRootedPath(s.route)); + let fallback = routes.findIndex(([p]) => p === "*"); + if (fallback < 0) fallback = 0; + + let current; + + function route(url) { + const _url = makeRootedPath(url.state || url); + current = routes.findIndex( + p => p !== "*" && new RegExp("^" + p + "$").test(_url) + ); + + const params = {}; + + if (current === -1) { + routes.forEach((p, i) => { + const pm = regexparam(p); + const matches = pm.pattern.exec(_url); + + if (!matches) return + + let j = 0; + while (j < pm.keys.length) { + params[pm.keys[j]] = matches[++j] || null; + } + + current = i; + }); + } + + const storeInitial = {}; + storeInitial["##routeParams"] = params; + const store = writable(storeInitial); + + if (current !== -1) { + onScreenSelected(screens[current], store, _url); + } else { + onScreenSelected(screens[fallback], store, _url); + } + + try { + !url.state && history.pushState(_url, null, _url); + } catch (_) { + // ignoring an exception here as the builder runs an iframe, which does not like this + } + } + + function click(e) { + const x = e.target.closest("a"); + const y = x && x.getAttribute("href"); + + if ( + e.ctrlKey || + e.metaKey || + e.altKey || + e.shiftKey || + e.button || + e.defaultPrevented + ) + return + + if (!y || x.target || x.host !== location.host) return + + e.preventDefault(); + route(y); + } + + addEventListener("popstate", route); + addEventListener("pushstate", route); + addEventListener("click", click); + + return route + }; + const BB_STATE_BINDINGPATH = "##bbstate"; const BB_STATE_BINDINGSOURCE = "##bbsource"; const BB_STATE_FALLBACK = "##bbstatefallback"; - const isBound = prop => - prop !== undefined && prop[BB_STATE_BINDINGPATH] !== undefined; + const isBound = prop => !!parseBinding(prop); - const takeStateFromStore = prop => - prop[BB_STATE_BINDINGSOURCE] === undefined || - prop[BB_STATE_BINDINGSOURCE] === "store"; + /** + * + * @param {object|string|number} prop - component property to parse for a dynamic state binding + * @returns {object|boolean} + */ + const parseBinding = prop => { + if (!prop) return false - const takeStateFromContext = prop => - prop[BB_STATE_BINDINGSOURCE] === "context"; + if (isBindingExpression(prop)) { + return parseBindingExpression(prop) + } - const takeStateFromEventParameters = prop => - prop[BB_STATE_BINDINGSOURCE] === "event"; + if (isAlreadyBinding(prop)) { + return { + path: prop.path, + source: prop.source || "store", + fallback: prop.fallback, + } + } + + if (hasBindingObject(prop)) { + return { + path: prop[BB_STATE_BINDINGPATH], + fallback: prop[BB_STATE_FALLBACK] || "", + source: prop[BB_STATE_BINDINGSOURCE] || "store", + } + } + }; + + const isStoreBinding = binding => binding && binding.source === "store"; + + const hasBindingObject = prop => + typeof prop === "object" && prop[BB_STATE_BINDINGPATH] !== undefined; + + const isAlreadyBinding = prop => typeof prop === "object" && prop.path; + + const isBindingExpression = prop => + typeof prop === "string" && + (prop.startsWith("state.") || + prop.startsWith("context.") || + prop.startsWith("event.") || + prop.startsWith("route.")); + + const parseBindingExpression = prop => { + let [source, ...rest] = prop.split("."); + let path = rest.join("."); + + if (source === "route") { + source = "state"; + path = `##routeParams.${path}`; + } + + return { + fallback: "", // TODO: provide fallback support + source, + path, + } + }; + + const setState = (store, path, value) => { + if (!path || path.length === 0) return + + const pathParts = path.split("."); + + const safeSetPath = (state, currentPartIndex = 0) => { + const currentKey = pathParts[currentPartIndex]; + + if (pathParts.length - 1 == currentPartIndex) { + state[currentKey] = value; + return + } + + if ( + state[currentKey] === null || + state[currentKey] === undefined || + !fp_8(state[currentKey]) + ) { + state[currentKey] = {}; + } + + safeSetPath(state[currentKey], currentPartIndex + 1); + }; + + store.update(state => { + safeSetPath(state); + return state + }); + }; + + const setStateFromBinding = (store, binding, value) => { + const parsedBinding = parseBinding(binding); + if (!parsedBinding) return + return setState(store, parsedBinding.path, value) + }; const getState = (s, path, fallback) => { if (!s) return fallback @@ -21715,61 +24303,21 @@ var app = (function (exports) { const getStateOrValue = (globalState, prop, currentContext) => { if (!prop) return prop - if (isBound(prop)) { - const stateToUse = takeStateFromStore(prop) ? globalState : currentContext; + const binding = parseBinding(prop); - return getState( - stateToUse, - prop[BB_STATE_BINDINGPATH], - prop[BB_STATE_FALLBACK] - ) - } + if (binding) { + const stateToUse = isStoreBinding(binding) ? globalState : currentContext; - if (prop.path && prop.source) { - const stateToUse = prop.source === "store" ? globalState : currentContext; - - return getState(stateToUse, prop.path, prop.fallback) + return getState(stateToUse, binding.path, binding.fallback) } return prop }; - const setState = (store, path, value) => { - if (!path || path.length === 0) return - - const pathParts = path.split("."); - const safeSetPath = (obj, currentPartIndex = 0) => { - const currentKey = pathParts[currentPartIndex]; - - if (pathParts.length - 1 == currentPartIndex) { - obj[currentKey] = value; - return - } - - if ( - obj[currentKey] === null || - obj[currentKey] === undefined || - !fp_8(obj[currentKey]) - ) { - obj[currentKey] = {}; - } - - safeSetPath(obj[currentKey], currentPartIndex + 1); - }; - - store.update(s => { - safeSetPath(s); - return s - }); - }; - - const setStateFromBinding = (store, binding, value) => - setState(store, binding[BB_STATE_BINDINGPATH], value); + const ERROR = "##error_message"; const trimSlash = str => str.replace(/^\/+|\/+$/g, ""); - const ERROR = "##error_message"; - const loadRecord = api => async ({ recordKey, statePath }) => { if (!recordKey) { api.error("Load Record: record key not set"); @@ -21857,7 +24405,7 @@ var app = (function (exports) { if (api.isSuccess(savedRecord)) api.setState(statePath, savedRecord); }; - const createApi = ({ rootPath, setState, getState }) => { + const createApi = ({ rootPath = "", setState, getState }) => { const apiCall = method => ({ url, body, @@ -22000,7 +24548,7 @@ var app = (function (exports) { const EVENT_TYPE_MEMBER_NAME = "##eventHandlerType"; - const eventHandlers = (store, coreApi, rootPath) => { + const eventHandlers = (store, coreApi, rootPath, routeTo) => { const handler = (parameters, execute) => ({ execute, parameters, @@ -22014,7 +24562,7 @@ var app = (function (exports) { }); const api = createApi({ - rootPath: rootPath, + rootPath, setState: setStateWithStore, getState: (path, fallback) => getState(currentState, path, fallback), }); @@ -22037,6 +24585,8 @@ var app = (function (exports) { getNewRecordToState(coreApi, setStateWithStore) ), + "Navigate To": handler(["url"], param => routeTo(param && param.url)), + Authenticate: handler(["username", "password"], api.authenticate), } }; @@ -22046,466 +24596,26 @@ var app = (function (exports) { prop.length > 0 && !fp_2(prop[0][EVENT_TYPE_MEMBER_NAME]); - const doNothing = () => {}; - doNothing.isPlaceholder = true; + const setContext = treeNode => (key, value) => + (treeNode.context[key] = value); - const isMetaProp = propName => - propName === "_component" || - propName === "_children" || - propName === "_id" || - propName === "_style"; + const getContext = treeNode => key => { + if (treeNode.context && treeNode.context[key] !== undefined) + return treeNode.context[key] - const setupBinding = (store, rootProps, coreApi, context, rootPath) => { - const rootInitialProps = { ...rootProps }; + if (!treeNode.context.$parent) return - const getBindings = (props, initialProps) => { - const boundProps = []; - const contextBoundProps = []; - const componentEventHandlers = []; - - for (let propName in props) { - if (isMetaProp(propName)) continue - - const val = props[propName]; - - if (isBound(val) && takeStateFromStore(val)) { - const binding = BindingPath(val); - const source = BindingSource(val); - const fallback = BindingFallback(val); - - boundProps.push({ - path: binding, - fallback, - propName, - source, - }); - - initialProps[propName] = fallback; - } else if (isBound(val) && takeStateFromContext(val)) { - const binding = BindingPath(val); - const fallback = BindingFallback(val); - const source = BindingSource(val); - - contextBoundProps.push({ - path: binding, - fallback, - propName, - source, - }); - - initialProps[propName] = !context - ? val - : getState(context, binding, fallback); - } else if (isEventType(val)) { - const handlers = { propName, handlers: [] }; - componentEventHandlers.push(handlers); - - for (let e of val) { - handlers.handlers.push({ - handlerType: e[EVENT_TYPE_MEMBER_NAME], - parameters: e.parameters, - }); - } - - initialProps[propName] = doNothing; - } - } - - return { - contextBoundProps, - boundProps, - componentEventHandlers, - initialProps, - } - }; - - const bind = rootBindings => component => { - if ( - rootBindings.boundProps.length === 0 && - rootBindings.componentEventHandlers.length === 0 - ) - return - - const handlerTypes = eventHandlers(store, coreApi, rootPath); - - const unsubscribe = store.subscribe(rootState => { - const getPropsFromBindings = (s, bindings) => { - const { boundProps, componentEventHandlers } = bindings; - const newProps = { ...bindings.initialProps }; - - for (let boundProp of boundProps) { - const val = getState(s, boundProp.path, boundProp.fallback); - - if (val === undefined && newProps[boundProp.propName] !== undefined) { - delete newProps[boundProp.propName]; - } - - if (val !== undefined) { - newProps[boundProp.propName] = val; - } - } - - for (let boundHandler of componentEventHandlers) { - const closuredHandlers = []; - for (let h of boundHandler.handlers) { - const handlerType = handlerTypes[h.handlerType]; - closuredHandlers.push(eventContext => { - const parameters = {}; - for (let pname in h.parameters) { - const p = h.parameters[pname]; - parameters[pname] = !isBound(p) - ? p - : takeStateFromStore(p) - ? getState(s, p[BB_STATE_BINDINGPATH], p[BB_STATE_FALLBACK]) - : takeStateFromEventParameters(p) - ? getState( - eventContext, - p[BB_STATE_BINDINGPATH], - p[BB_STATE_FALLBACK] - ) - : takeStateFromContext(p) - ? getState( - context, - p[BB_STATE_BINDINGPATH], - p[BB_STATE_FALLBACK] - ) - : p[BB_STATE_FALLBACK]; - } - handlerType.execute(parameters); - }); - } - - newProps[boundHandler.propName] = async context => { - for (let runHandler of closuredHandlers) { - await runHandler(context); - } - }; - } - - return newProps - }; - - const rootNewProps = getPropsFromBindings(rootState, rootBindings); - - component.$set(rootNewProps); - }); - - return unsubscribe - }; - - const bindings = getBindings(rootProps, rootInitialProps); - - return { - initialProps: rootInitialProps, - bind: bind(bindings), - boundProps: bindings.boundProps, - contextBoundProps: bindings.contextBoundProps, - } - }; - - const BindingPath = prop => prop[BB_STATE_BINDINGPATH]; - const BindingFallback = prop => prop[BB_STATE_FALLBACK]; - const BindingSource = prop => prop[BB_STATE_BINDINGSOURCE]; - - const renderComponent = ({ - componentConstructor, - uiFunctions, - htmlElement, - anchor, - props, - initialProps, - bb, - parentNode, - }) => { - const func = initialProps._id ? uiFunctions[initialProps._id] : undefined; - - const parentContext = (parentNode && parentNode.context) || {}; - - let renderedNodes = []; - const render = context => { - let componentContext = parentContext; - if (context) { - componentContext = { ...componentContext }; - componentContext.$parent = parentContext; - } - - const thisNode = createTreeNode(); - thisNode.context = componentContext; - thisNode.parentNode = parentNode; - thisNode.props = props; - - parentNode.children.push(thisNode); - renderedNodes.push(thisNode); - - initialProps._bb = bb(thisNode, props); - - thisNode.component = new componentConstructor({ - target: htmlElement, - props: initialProps, - hydrate: false, - anchor, - }); - - thisNode.rootElement = htmlElement.children[htmlElement.children.length - 1]; - - if (initialProps._id) { - thisNode.rootElement.classList.add(`pos-${initialProps._id}`); - } - }; - - if (func) { - func(render, parentContext); - } else { - render(); - } - - return renderedNodes - }; - - const createTreeNode = () => ({ - context: {}, - props: {}, - rootElement: null, - parentNode: null, - children: [], - component: null, - unsubscribe: () => {}, - get destroy() { - const node = this; - return () => { - if (node.unsubscribe) node.unsubscribe(); - if (node.component && node.component.$destroy) node.component.$destroy(); - if (node.children) { - for (let child of node.children) { - child.destroy(); - } - } - } - }, - }); - - const screenSlotComponent = window => { - return function(opts) { - const node = window.document.createElement("DIV"); - const $set = props => { - props._bb.hydrateChildren(props._children, node); - }; - const $destroy = () => { - if (opts.target && node) opts.target.removeChild(node); - }; - this.$set = $set; - this.$destroy = $destroy; - opts.target.appendChild(node); - } + return getContext(treeNode.parentNode)(key) }; - const builtinLibName = "##builtin"; - - const isScreenSlot = componentName => - componentName === "##builtin/screenslot"; - - const builtins = window => ({ - screenslot: screenSlotComponent(window), - }); - - const initialiseChildren = initialiseOpts => ( - childrenProps, - htmlElement, - anchor = null - ) => { - const { - uiFunctions, - bb, - coreApi, - store, - componentLibraries, - treeNode, - frontendDefinition, - hydrate, - onScreenSlotRendered, - } = initialiseOpts; - - for (let childNode of treeNode.children) { - childNode.destroy(); - } - - if (hydrate) { - while (htmlElement.firstChild) { - htmlElement.removeChild(htmlElement.firstChild); - } - } - - htmlElement.classList.add(`lay-${treeNode.props._id}`); - - const renderedComponents = []; - for (let childProps of childrenProps) { - const { componentName, libName } = splitName(childProps._component); - - if (!componentName || !libName) return - - const { initialProps, bind } = setupBinding( - store, - childProps, - coreApi, - frontendDefinition.appRootPath - ); - - const componentConstructor = componentLibraries[libName][componentName]; - - const renderedComponentsThisIteration = renderComponent({ - props: childProps, - parentNode: treeNode, - componentConstructor, - uiFunctions, - htmlElement, - anchor, - initialProps, - bb, - }); - - if ( - onScreenSlotRendered && - isScreenSlot(childProps._component) && - renderedComponentsThisIteration.length > 0 - ) { - // assuming there is only ever one screen slot - onScreenSlotRendered(renderedComponentsThisIteration[0]); - } - - for (let comp of renderedComponentsThisIteration) { - comp.unsubscribe = bind(comp.component); - renderedComponents.push(comp); - } - } - - return renderedComponents - }; - - const splitName = fullname => { - const componentName = $(fullname, [fp_3("/"), fp_5]); - - const libName = fullname.substring( - 0, - fullname.length - componentName.length - 1 - ); - - return { libName, componentName } - }; - - function regexparam (str, loose) { - if (str instanceof RegExp) return { keys:false, pattern:str }; - var c, o, tmp, ext, keys=[], pattern='', arr = str.split('/'); - arr[0] || arr.shift(); - - while (tmp = arr.shift()) { - c = tmp[0]; - if (c === '*') { - keys.push('wild'); - pattern += '/(.*)'; - } else if (c === ':') { - o = tmp.indexOf('?', 1); - ext = tmp.indexOf('.', 1); - keys.push( tmp.substring(1, !!~o ? o : !!~ext ? ext : tmp.length) ); - pattern += !!~o && !~ext ? '(?:/([^/]+?))?' : '/([^/]+?)'; - if (!!~ext) pattern += (!!~o ? '?' : '') + '\\' + tmp.substring(ext); - } else { - pattern += '/' + tmp; - } - } - - return { - keys: keys, - pattern: new RegExp('^' + pattern + (loose ? '(?=$|\/)' : '\/?$'), 'i') - }; - } - - const screenRouter = (screens, onScreenSelected) => { - const routes = screens.map(s => s.route); - let fallback = routes.findIndex(([p]) => p === "*"); - if (fallback < 0) fallback = 0; - - let current; - - function route(url) { - const _url = url.state || url; - current = routes.findIndex( - p => p !== "*" && new RegExp("^" + p + "$").test(_url) - ); - - const params = {}; - - if (current === -1) { - routes.forEach(([p], i) => { - const pm = regexparam(p); - const matches = pm.pattern.exec(_url); - - if (!matches) return - - let j = 0; - while (j < pm.keys.length) { - params[pm.keys[j]] = matches[++j] || null; - } - - current = i; - }); - } - - const storeInitial = {}; - const store = writable(storeInitial); - - if (current !== -1) { - onScreenSelected(screens[current], store, _url); - } else if (fallback) { - onScreenSelected(screens[fallback], store, _url); - } - - !url.state && history.pushState(_url, null, _url); - } - - function click(e) { - const x = e.target.closest("a"); - const y = x && x.getAttribute("href"); - - if ( - e.ctrlKey || - e.metaKey || - e.altKey || - e.shiftKey || - e.button || - e.defaultPrevented - ) - return - - if (!y || x.target || x.host !== location.host) return - - e.preventDefault(); - route(y); - } - - addEventListener("popstate", route); - addEventListener("pushstate", route); - addEventListener("click", click); - - return route - }; - - const createApp = ( - document, - componentLibraries, + const bbFactory = ({ + store, + getCurrentState, frontendDefinition, - backendDefinition, - user, + componentLibraries, uiFunctions, - screens - ) => { - const coreApi = createCoreApi(backendDefinition, user); - backendDefinition.hierarchy = coreApi.templateApi.constructHierarchy( - backendDefinition.hierarchy - ); - const pageStore = writable({ - _bbuser: user, - }); - + onScreenSlotRendered, + }) => { const relativeUrl = url => frontendDefinition.appRootPath ? frontendDefinition.appRootPath + "/" + trimSlash(url) @@ -22534,118 +24644,408 @@ var app = (function (exports) { if (isFunction(event)) event(context); }; - let routeTo; - let currentScreenStore; - let currentScreenUbsubscribe; - let currentUrl; - - const onScreenSlotRendered = screenSlotNode => { - const onScreenSelected = (screen, store, url) => { - const { getInitialiseParams, unsubscribe } = initialiseChildrenParams( - store - ); - const initialiseChildParams = getInitialiseParams(true, screenSlotNode); - initialiseChildren(initialiseChildParams)( - [screen.props], - screenSlotNode.rootElement - ); - if (currentScreenUbsubscribe) currentScreenUbsubscribe(); - currentScreenUbsubscribe = unsubscribe; - currentScreenStore = store; - currentUrl = url; - }; - - routeTo = screenRouter(screens, onScreenSelected); - routeTo(currentUrl || window.location.pathname); - }; - - const initialiseChildrenParams = store => { - let currentState = null; - const unsubscribe = store.subscribe(s => { - currentState = s; - }); - - const getInitialiseParams = (hydrate, treeNode) => ({ - bb: getBbClientApi, - coreApi, - store, - document, + return (treeNode, setupState) => { + const attachParams = { componentLibraries, - frontendDefinition, - hydrate, uiFunctions, treeNode, onScreenSlotRendered, + setupState, + getCurrentState, + }; + + return { + attachChildren: attachChildren(attachParams), + context: treeNode.context, + props: treeNode.props, + call: safeCallEvent, + setStateFromBinding: (binding, value) => + setStateFromBinding(store, binding, value), + setState: (path, value) => setState(store, path, value), + getStateOrValue: (prop, currentContext) => + getStateOrValue(getCurrentState(), prop, currentContext), + getContext: getContext(treeNode), + setContext: setContext(treeNode), + store: store, + relativeUrl, + api, + isBound, + parent, + } + } + }; + + const doNothing = () => {}; + doNothing.isPlaceholder = true; + + const isMetaProp = propName => + propName === "_component" || + propName === "_children" || + propName === "_id" || + propName === "_style" || + propName === "_code" || + propName === "_codeMeta"; + + const createStateManager = ({ + store, + coreApi, + appRootPath, + frontendDefinition, + componentLibraries, + uiFunctions, + onScreenSlotRendered, + routeTo, + }) => { + let handlerTypes = eventHandlers(store, coreApi, appRootPath, routeTo); + let currentState; + + // any nodes that have props that are bound to the store + let nodesBoundByProps = []; + + // any node whose children depend on code, that uses the store + let nodesWithCodeBoundChildren = []; + + const getCurrentState = () => currentState; + const registerBindings = _registerBindings( + nodesBoundByProps, + nodesWithCodeBoundChildren + ); + const bb = bbFactory({ + store, + getCurrentState, + frontendDefinition, + componentLibraries, + uiFunctions, + onScreenSlotRendered, + }); + + const setup = _setup(handlerTypes, getCurrentState, registerBindings, bb); + + const unsubscribe = store.subscribe( + onStoreStateUpdated({ + setCurrentState: s => (currentState = s), + getCurrentState, + nodesWithCodeBoundChildren, + nodesBoundByProps, + uiFunctions, + componentLibraries, + onScreenSlotRendered, + setupState: setup, + }) + ); + + return { + setup, + destroy: () => unsubscribe(), + getCurrentState, + store, + } + }; + + const onStoreStateUpdated = ({ + setCurrentState, + getCurrentState, + nodesWithCodeBoundChildren, + nodesBoundByProps, + uiFunctions, + componentLibraries, + onScreenSlotRendered, + setupState, + }) => s => { + setCurrentState(s); + + // the original array gets changed by components' destroy() + // so we make a clone and check if they are still in the original + const nodesWithBoundChildren_clone = [...nodesWithCodeBoundChildren]; + for (let node of nodesWithBoundChildren_clone) { + if (!nodesWithCodeBoundChildren.includes(node)) continue + attachChildren({ + uiFunctions, + componentLibraries, + treeNode: node, + onScreenSlotRendered, + setupState, + getCurrentState, + })(node.rootElement, { hydrate: true, force: true }); + } + + for (let node of nodesBoundByProps) { + setNodeState(s, node); + } + }; + + const _registerBindings = (nodesBoundByProps, nodesWithCodeBoundChildren) => ( + node, + bindings + ) => { + if (bindings.length > 0) { + node.bindings = bindings; + nodesBoundByProps.push(node); + const onDestroy = () => { + nodesBoundByProps = nodesBoundByProps.filter(n => n === node); + node.onDestroy = node.onDestroy.filter(d => d === onDestroy); + }; + node.onDestroy.push(onDestroy); + } + if ( + node.props._children && + node.props._children.filter(c => c._codeMeta && c._codeMeta.dependsOnStore) + .length > 0 + ) { + nodesWithCodeBoundChildren.push(node); + const onDestroy = () => { + nodesWithCodeBoundChildren = nodesWithCodeBoundChildren.filter( + n => n === node + ); + node.onDestroy = node.onDestroy.filter(d => d === onDestroy); + }; + node.onDestroy.push(onDestroy); + } + }; + + const setNodeState = (storeState, node) => { + if (!node.component) return + const newProps = { ...node.bindings.initialProps }; + + for (let binding of node.bindings) { + const val = getState(storeState, binding.path, binding.fallback); + + if (val === undefined && newProps[binding.propName] !== undefined) { + delete newProps[binding.propName]; + } + + if (val !== undefined) { + newProps[binding.propName] = val; + } + } + + node.component.$set(newProps); + }; + + const _setup = ( + handlerTypes, + getCurrentState, + registerBindings, + bb + ) => node => { + const props = node.props; + const context = node.context || {}; + const initialProps = { ...props }; + const storeBoundProps = []; + const currentStoreState = getCurrentState(); + + for (let propName in props) { + if (isMetaProp(propName)) continue + + const propValue = props[propName]; + + const binding = parseBinding(propValue); + const isBound = !!binding; + + if (isBound) binding.propName = propName; + + if (isBound && binding.source === "state") { + storeBoundProps.push(binding); + + initialProps[propName] = !currentStoreState + ? binding.fallback + : getState( + currentStoreState, + binding.path, + binding.fallback, + binding.source + ); + } + + if (isBound && binding.source === "context") { + initialProps[propName] = !context + ? propValue + : getState(context, binding.path, binding.fallback, binding.source); + } + + if (isEventType(propValue)) { + const handlersInfos = []; + for (let event of propValue) { + const handlerInfo = { + handlerType: event[EVENT_TYPE_MEMBER_NAME], + parameters: event.parameters, + }; + const resolvedParams = {}; + for (let paramName in handlerInfo.parameters) { + const paramValue = handlerInfo.parameters[paramName]; + const paramBinding = parseBinding(paramValue); + if (!paramBinding) { + resolvedParams[paramName] = () => paramValue; + continue + } + + let paramValueSource; + + if (paramBinding.source === "context") paramValueSource = context; + if (paramBinding.source === "state") + paramValueSource = getCurrentState(); + if (paramBinding.source === "context") paramValueSource = context; + + // The new dynamic event parameter bound to the relevant source + resolvedParams[paramName] = () => + getState(paramValueSource, paramBinding.path, paramBinding.fallback); + } + + handlerInfo.parameters = resolvedParams; + handlersInfos.push(handlerInfo); + } + + if (handlersInfos.length === 0) initialProps[propName] = doNothing; + else { + initialProps[propName] = async context => { + for (let handlerInfo of handlersInfos) { + const handler = makeHandler(handlerTypes, handlerInfo); + await handler(context); + } + }; + } + } + } + + registerBindings(node, storeBoundProps); + + const setup = _setup(handlerTypes, getCurrentState, registerBindings, bb); + initialProps._bb = bb(node, setup); + + return initialProps + }; + + const makeHandler = (handlerTypes, handlerInfo) => { + const handlerType = handlerTypes[handlerInfo.handlerType]; + return async context => { + const parameters = {}; + for (let paramName in handlerInfo.parameters) { + parameters[paramName] = handlerInfo.parameters[paramName](context); + } + await handlerType.execute(parameters); + } + }; + + const createApp = ( + componentLibraries, + frontendDefinition, + backendDefinition, + user, + uiFunctions, + window + ) => { + const coreApi = createCoreApi(backendDefinition, user); + backendDefinition.hierarchy = coreApi.templateApi.constructHierarchy( + backendDefinition.hierarchy + ); + + let routeTo; + let currentUrl; + let screenStateManager; + + const onScreenSlotRendered = screenSlotNode => { + const onScreenSelected = (screen, store, url) => { + const stateManager = createStateManager({ + store, + coreApi, + frontendDefinition, + componentLibraries, + uiFunctions, + onScreenSlotRendered: () => {}, + routeTo, + appRootPath: frontendDefinition.appRootPath, + }); + const getAttchChildrenParams = attachChildrenParams(stateManager); + screenSlotNode.props._children = [screen.props]; + const initialiseChildParams = getAttchChildrenParams(screenSlotNode); + attachChildren(initialiseChildParams)(screenSlotNode.rootElement, { + hydrate: true, + force: true, + }); + if (screenStateManager) screenStateManager.destroy(); + screenStateManager = stateManager; + currentUrl = url; + }; + + routeTo = screenRouter( + frontendDefinition.screens, + onScreenSelected, + frontendDefinition.appRootPath + ); + const fallbackPath = window.location.pathname.replace( + frontendDefinition.appRootPath, + "" + ); + routeTo(currentUrl || fallbackPath); + }; + + const attachChildrenParams = stateManager => { + const getInitialiseParams = treeNode => ({ + componentLibraries, + uiFunctions, + treeNode, + onScreenSlotRendered, + setupState: stateManager.setup, + getCurrentState: stateManager.getCurrentState, }); - const getBbClientApi = (treeNode, componentProps) => { - return { - hydrateChildren: initialiseChildren( - getInitialiseParams(true, treeNode) - ), - appendChildren: initialiseChildren( - getInitialiseParams(false, treeNode) - ), - insertChildren: (props, htmlElement, anchor) => - initialiseChildren(getInitialiseParams(false, treeNode))( - props, - htmlElement, - anchor - ), - context: treeNode.context, - props: componentProps, - call: safeCallEvent, - setStateFromBinding: (binding, value) => - setStateFromBinding(store, binding, value), - setState: (path, value) => setState(store, path, value), - getStateOrValue: (prop, currentContext) => - getStateOrValue(currentState, prop, currentContext), - store, - relativeUrl, - api, - isBound, - parent, - } - }; - return { getInitialiseParams, unsubscribe } + return getInitialiseParams }; let rootTreeNode; + const pageStateManager = createStateManager({ + store: writable({ _bbuser: user }), + coreApi, + frontendDefinition, + componentLibraries, + uiFunctions, + onScreenSlotRendered, + appRootPath: frontendDefinition.appRootPath, + // seems weird, but the routeTo variable may not be available at this point + routeTo: url => routeTo(url), + }); const initialisePage = (page, target, urlPath) => { currentUrl = urlPath; rootTreeNode = createTreeNode(); - const { getInitialiseParams } = initialiseChildrenParams(pageStore); - const initChildParams = getInitialiseParams(true, rootTreeNode); + rootTreeNode.props = { + _children: [page.props], + }; + rootTreeNode.rootElement = target; + const getInitialiseParams = attachChildrenParams(pageStateManager); + const initChildParams = getInitialiseParams(rootTreeNode); - initialiseChildren(initChildParams)([page.props], target); + attachChildren(initChildParams)(target, { + hydrate: true, + force: true, + }); return rootTreeNode }; return { initialisePage, - screenStore: () => currentScreenStore, - pageStore: () => pageStore, + screenStore: () => screenStateManager.store, + pageStore: () => pageStateManager.store, routeTo: () => routeTo, rootNode: () => rootTreeNode, } }; - const loadBudibase = async ({ - componentLibraries, - page, - screens, - window, - localStorage, - uiFunctions, - }) => { - const backendDefinition = window["##BUDIBASE_BACKEND_DEFINITION##"]; - const frontendDefinition = window["##BUDIBASE_FRONTEND_DEFINITION##"]; - const uiFunctionsFromWindow = window["##BUDIBASE_FRONTEND_FUNCTIONS##"]; - uiFunctions = uiFunctionsFromWindow || uiFunctions; + /** + * create a web application from static budibase definition files. + * @param {object} opts - configuration options for budibase client libary + */ + const loadBudibase = async opts => { + let componentLibraries = opts && opts.componentLibraries; + const _window = (opts && opts.window) || window; + const _localStorage = (opts && opts.localStorage) || localStorage; - const userFromStorage = localStorage.getItem("budibase:user"); + const backendDefinition = _window["##BUDIBASE_BACKEND_DEFINITION##"]; + const frontendDefinition = _window["##BUDIBASE_FRONTEND_DEFINITION##"]; + const uiFunctions = _window["##BUDIBASE_FRONTEND_FUNCTIONS##"]; + + const userFromStorage = _localStorage.getItem("budibase:user"); const user = userFromStorage ? JSON.parse(userFromStorage) @@ -22656,14 +25056,14 @@ var app = (function (exports) { temp: false, }; - const rootPath = + frontendDefinition.appRootPath = frontendDefinition.appRootPath === "" ? "" : "/" + trimSlash(frontendDefinition.appRootPath); if (!componentLibraries) { - - const componentLibraryUrl = lib => rootPath + "/" + trimSlash(lib); + const componentLibraryUrl = lib => + frontendDefinition.appRootPath + "/" + trimSlash(lib); componentLibraries = {}; for (let lib of frontendDefinition.componentLibraries) { @@ -22673,36 +25073,33 @@ var app = (function (exports) { } } - componentLibraries[builtinLibName] = builtins(window); + componentLibraries[builtinLibName] = builtins(_window); - if (!page) { - page = frontendDefinition.page; - } - - if (!screens) { - screens = frontendDefinition.screens; - } - - const { initialisePage, screenStore, pageStore, routeTo, rootNode } = createApp( - window.document, + const { + initialisePage, + screenStore, + pageStore, + routeTo, + rootNode, + } = createApp( componentLibraries, frontendDefinition, backendDefinition, user, uiFunctions || {}, - screens - ); + _window); - const route = window.location - ? window.location.pathname.replace(rootPath, "") - : ""; + const route = _window.location + ? _window.location.pathname.replace(frontendDefinition.appRootPath, "") + : ""; + + initialisePage(frontendDefinition.page, _window.document.body, route); return { - rootNode: initialisePage(page, window.document.body, route), screenStore, pageStore, routeTo, - rootNode + rootNode, } }; diff --git a/packages/server/appPackages/_master/public/unauthenticated/budibase-client.js.map b/packages/server/appPackages/_master/public/unauthenticated/budibase-client.js.map index 5093ed0c14..a79f50e7e9 100644 --- a/packages/server/appPackages/_master/public/unauthenticated/budibase-client.js.map +++ b/packages/server/appPackages/_master/public/unauthenticated/budibase-client.js.map @@ -1 +1 @@ -{"version":3,"file":"budibase-client.js","sources":["../node_modules/svelte/internal/index.mjs","../node_modules/svelte/store/index.mjs","../src/core/createCoreApp.js","../node_modules/lodash/lodash.min.js","../node_modules/lodash/fp/_mapping.js","../node_modules/lodash/fp/placeholder.js","../node_modules/lodash/fp/_baseConvert.js","../node_modules/lodash/fp.js","../node_modules/shortid/lib/random/random-from-seed.js","../node_modules/shortid/lib/alphabet.js","../node_modules/shortid/lib/random/random-byte-browser.js","../node_modules/nanoid/format.js","../node_modules/shortid/lib/generate.js","../node_modules/shortid/lib/build.js","../node_modules/shortid/lib/is-valid.js","../node_modules/shortid/lib/index.js","../node_modules/shortid/index.js","../node_modules/lodash/lodash.js","../../core/src/common/events.js","../../core/src/common/errors.js","../../core/src/common/apiWrapper.js","../node_modules/rollup-plugin-node-globals/src/global.js","../node_modules/process-es6/browser.js","../node_modules/rollup-plugin-node-builtins/src/es6/empty.js","../../core/node_modules/bcryptjs/dist/bcrypt.js","../../core/src/common/index.js","../../core/src/common/validationCommon.js","../node_modules/@nx-js/compiler-util/dist/es.es5.js","../../core/src/indexing/evaluate.js","../../core/src/templateApi/indexes.js","../../core/src/templateApi/hierarchy.js","../../core/src/types/typeHelpers.js","../../core/src/types/string.js","../../core/src/types/bool.js","../../core/src/types/number.js","../../core/src/types/datetime.js","../../core/src/types/array.js","../../core/src/types/reference.js","../../core/src/types/file.js","../../core/src/types/index.js","../../core/src/authApi/authCommon.js","../../core/src/authApi/isAuthorized.js","../../core/src/authApi/permissions.js","../../core/src/recordApi/getNew.js","../../core/src/templateApi/createNodes.js","../src/core/index.js","../src/state/isState.js","../src/state/getState.js","../src/state/setState.js","../src/common/trimSlash.js","../src/state/standardState.js","../src/api/loadRecord.js","../src/api/listRecords.js","../src/api/authenticate.js","../src/api/saveRecord.js","../src/api/index.js","../src/state/coreHandlers.js","../src/state/eventHandlers.js","../src/state/stateBinding.js","../src/render/renderComponent.js","../src/render/screenSlotComponent.js","../src/render/builtinComponents.js","../src/render/initialiseChildren.js","../node_modules/regexparam/dist/regexparam.mjs","../src/render/screenRouter.js","../src/createApp.js","../src/index.js"],"sourcesContent":["function noop() { }\nconst identity = x => x;\nfunction assign(tar, src) {\n // @ts-ignore\n for (const k in src)\n tar[k] = src[k];\n return tar;\n}\nfunction is_promise(value) {\n return value && typeof value === 'object' && typeof value.then === 'function';\n}\nfunction add_location(element, file, line, column, char) {\n element.__svelte_meta = {\n loc: { file, line, column, char }\n };\n}\nfunction run(fn) {\n return fn();\n}\nfunction blank_object() {\n return Object.create(null);\n}\nfunction run_all(fns) {\n fns.forEach(run);\n}\nfunction is_function(thing) {\n return typeof thing === 'function';\n}\nfunction safe_not_equal(a, b) {\n return a != a ? b == b : a !== b || ((a && typeof a === 'object') || typeof a === 'function');\n}\nfunction not_equal(a, b) {\n return a != a ? b == b : a !== b;\n}\nfunction validate_store(store, name) {\n if (!store || typeof store.subscribe !== 'function') {\n throw new Error(`'${name}' is not a store with a 'subscribe' method`);\n }\n}\nfunction subscribe(store, callback) {\n const unsub = store.subscribe(callback);\n return unsub.unsubscribe ? () => unsub.unsubscribe() : unsub;\n}\nfunction get_store_value(store) {\n let value;\n subscribe(store, _ => value = _)();\n return value;\n}\nfunction component_subscribe(component, store, callback) {\n component.$$.on_destroy.push(subscribe(store, callback));\n}\nfunction create_slot(definition, ctx, fn) {\n if (definition) {\n const slot_ctx = get_slot_context(definition, ctx, fn);\n return definition[0](slot_ctx);\n }\n}\nfunction get_slot_context(definition, ctx, fn) {\n return definition[1]\n ? assign({}, assign(ctx.$$scope.ctx, definition[1](fn ? fn(ctx) : {})))\n : ctx.$$scope.ctx;\n}\nfunction get_slot_changes(definition, ctx, changed, fn) {\n return definition[1]\n ? assign({}, assign(ctx.$$scope.changed || {}, definition[1](fn ? fn(changed) : {})))\n : ctx.$$scope.changed || {};\n}\nfunction exclude_internal_props(props) {\n const result = {};\n for (const k in props)\n if (k[0] !== '$')\n result[k] = props[k];\n return result;\n}\nfunction once(fn) {\n let ran = false;\n return function (...args) {\n if (ran)\n return;\n ran = true;\n fn.call(this, ...args);\n };\n}\nfunction null_to_empty(value) {\n return value == null ? '' : value;\n}\nfunction set_store_value(store, ret, value = ret) {\n store.set(value);\n return ret;\n}\n\nconst is_client = typeof window !== 'undefined';\nlet now = is_client\n ? () => window.performance.now()\n : () => Date.now();\nlet raf = is_client ? cb => requestAnimationFrame(cb) : noop;\n// used internally for testing\nfunction set_now(fn) {\n now = fn;\n}\nfunction set_raf(fn) {\n raf = fn;\n}\n\nconst tasks = new Set();\nlet running = false;\nfunction run_tasks() {\n tasks.forEach(task => {\n if (!task[0](now())) {\n tasks.delete(task);\n task[1]();\n }\n });\n running = tasks.size > 0;\n if (running)\n raf(run_tasks);\n}\nfunction clear_loops() {\n // for testing...\n tasks.forEach(task => tasks.delete(task));\n running = false;\n}\nfunction loop(fn) {\n let task;\n if (!running) {\n running = true;\n raf(run_tasks);\n }\n return {\n promise: new Promise(fulfil => {\n tasks.add(task = [fn, fulfil]);\n }),\n abort() {\n tasks.delete(task);\n }\n };\n}\n\nfunction append(target, node) {\n target.appendChild(node);\n}\nfunction insert(target, node, anchor) {\n target.insertBefore(node, anchor || null);\n}\nfunction detach(node) {\n node.parentNode.removeChild(node);\n}\nfunction destroy_each(iterations, detaching) {\n for (let i = 0; i < iterations.length; i += 1) {\n if (iterations[i])\n iterations[i].d(detaching);\n }\n}\nfunction element(name) {\n return document.createElement(name);\n}\nfunction element_is(name, is) {\n return document.createElement(name, { is });\n}\nfunction object_without_properties(obj, exclude) {\n // eslint-disable-next-line @typescript-eslint/no-object-literal-type-assertion\n const target = {};\n for (const k in obj) {\n if (Object.prototype.hasOwnProperty.call(obj, k)\n // @ts-ignore\n && exclude.indexOf(k) === -1) {\n // @ts-ignore\n target[k] = obj[k];\n }\n }\n return target;\n}\nfunction svg_element(name) {\n return document.createElementNS('http://www.w3.org/2000/svg', name);\n}\nfunction text(data) {\n return document.createTextNode(data);\n}\nfunction space() {\n return text(' ');\n}\nfunction empty() {\n return text('');\n}\nfunction listen(node, event, handler, options) {\n node.addEventListener(event, handler, options);\n return () => node.removeEventListener(event, handler, options);\n}\nfunction prevent_default(fn) {\n return function (event) {\n event.preventDefault();\n // @ts-ignore\n return fn.call(this, event);\n };\n}\nfunction stop_propagation(fn) {\n return function (event) {\n event.stopPropagation();\n // @ts-ignore\n return fn.call(this, event);\n };\n}\nfunction self(fn) {\n return function (event) {\n // @ts-ignore\n if (event.target === this)\n fn.call(this, event);\n };\n}\nfunction attr(node, attribute, value) {\n if (value == null)\n node.removeAttribute(attribute);\n else\n node.setAttribute(attribute, value);\n}\nfunction set_attributes(node, attributes) {\n for (const key in attributes) {\n if (key === 'style') {\n node.style.cssText = attributes[key];\n }\n else if (key in node) {\n node[key] = attributes[key];\n }\n else {\n attr(node, key, attributes[key]);\n }\n }\n}\nfunction set_svg_attributes(node, attributes) {\n for (const key in attributes) {\n attr(node, key, attributes[key]);\n }\n}\nfunction set_custom_element_data(node, prop, value) {\n if (prop in node) {\n node[prop] = value;\n }\n else {\n attr(node, prop, value);\n }\n}\nfunction xlink_attr(node, attribute, value) {\n node.setAttributeNS('http://www.w3.org/1999/xlink', attribute, value);\n}\nfunction get_binding_group_value(group) {\n const value = [];\n for (let i = 0; i < group.length; i += 1) {\n if (group[i].checked)\n value.push(group[i].__value);\n }\n return value;\n}\nfunction to_number(value) {\n return value === '' ? undefined : +value;\n}\nfunction time_ranges_to_array(ranges) {\n const array = [];\n for (let i = 0; i < ranges.length; i += 1) {\n array.push({ start: ranges.start(i), end: ranges.end(i) });\n }\n return array;\n}\nfunction children(element) {\n return Array.from(element.childNodes);\n}\nfunction claim_element(nodes, name, attributes, svg) {\n for (let i = 0; i < nodes.length; i += 1) {\n const node = nodes[i];\n if (node.nodeName === name) {\n for (let j = 0; j < node.attributes.length; j += 1) {\n const attribute = node.attributes[j];\n if (!attributes[attribute.name])\n node.removeAttribute(attribute.name);\n }\n return nodes.splice(i, 1)[0]; // TODO strip unwanted attributes\n }\n }\n return svg ? svg_element(name) : element(name);\n}\nfunction claim_text(nodes, data) {\n for (let i = 0; i < nodes.length; i += 1) {\n const node = nodes[i];\n if (node.nodeType === 3) {\n node.data = '' + data;\n return nodes.splice(i, 1)[0];\n }\n }\n return text(data);\n}\nfunction claim_space(nodes) {\n return claim_text(nodes, ' ');\n}\nfunction set_data(text, data) {\n data = '' + data;\n if (text.data !== data)\n text.data = data;\n}\nfunction set_input_value(input, value) {\n if (value != null || input.value) {\n input.value = value;\n }\n}\nfunction set_input_type(input, type) {\n try {\n input.type = type;\n }\n catch (e) {\n // do nothing\n }\n}\nfunction set_style(node, key, value, important) {\n node.style.setProperty(key, value, important ? 'important' : '');\n}\nfunction select_option(select, value) {\n for (let i = 0; i < select.options.length; i += 1) {\n const option = select.options[i];\n if (option.__value === value) {\n option.selected = true;\n return;\n }\n }\n}\nfunction select_options(select, value) {\n for (let i = 0; i < select.options.length; i += 1) {\n const option = select.options[i];\n option.selected = ~value.indexOf(option.__value);\n }\n}\nfunction select_value(select) {\n const selected_option = select.querySelector(':checked') || select.options[0];\n return selected_option && selected_option.__value;\n}\nfunction select_multiple_value(select) {\n return [].map.call(select.querySelectorAll(':checked'), option => option.__value);\n}\nfunction add_resize_listener(element, fn) {\n if (getComputedStyle(element).position === 'static') {\n element.style.position = 'relative';\n }\n const object = document.createElement('object');\n object.setAttribute('style', 'display: block; position: absolute; top: 0; left: 0; height: 100%; width: 100%; overflow: hidden; pointer-events: none; z-index: -1;');\n object.type = 'text/html';\n object.tabIndex = -1;\n let win;\n object.onload = () => {\n win = object.contentDocument.defaultView;\n win.addEventListener('resize', fn);\n };\n if (/Trident/.test(navigator.userAgent)) {\n element.appendChild(object);\n object.data = 'about:blank';\n }\n else {\n object.data = 'about:blank';\n element.appendChild(object);\n }\n return {\n cancel: () => {\n win && win.removeEventListener && win.removeEventListener('resize', fn);\n element.removeChild(object);\n }\n };\n}\nfunction toggle_class(element, name, toggle) {\n element.classList[toggle ? 'add' : 'remove'](name);\n}\nfunction custom_event(type, detail) {\n const e = document.createEvent('CustomEvent');\n e.initCustomEvent(type, false, false, detail);\n return e;\n}\nclass HtmlTag {\n constructor(html, anchor = null) {\n this.e = element('div');\n this.a = anchor;\n this.u(html);\n }\n m(target, anchor = null) {\n for (let i = 0; i < this.n.length; i += 1) {\n insert(target, this.n[i], anchor);\n }\n this.t = target;\n }\n u(html) {\n this.e.innerHTML = html;\n this.n = Array.from(this.e.childNodes);\n }\n p(html) {\n this.d();\n this.u(html);\n this.m(this.t, this.a);\n }\n d() {\n this.n.forEach(detach);\n }\n}\n\nlet stylesheet;\nlet active = 0;\nlet current_rules = {};\n// https://github.com/darkskyapp/string-hash/blob/master/index.js\nfunction hash(str) {\n let hash = 5381;\n let i = str.length;\n while (i--)\n hash = ((hash << 5) - hash) ^ str.charCodeAt(i);\n return hash >>> 0;\n}\nfunction create_rule(node, a, b, duration, delay, ease, fn, uid = 0) {\n const step = 16.666 / duration;\n let keyframes = '{\\n';\n for (let p = 0; p <= 1; p += step) {\n const t = a + (b - a) * ease(p);\n keyframes += p * 100 + `%{${fn(t, 1 - t)}}\\n`;\n }\n const rule = keyframes + `100% {${fn(b, 1 - b)}}\\n}`;\n const name = `__svelte_${hash(rule)}_${uid}`;\n if (!current_rules[name]) {\n if (!stylesheet) {\n const style = element('style');\n document.head.appendChild(style);\n stylesheet = style.sheet;\n }\n current_rules[name] = true;\n stylesheet.insertRule(`@keyframes ${name} ${rule}`, stylesheet.cssRules.length);\n }\n const animation = node.style.animation || '';\n node.style.animation = `${animation ? `${animation}, ` : ``}${name} ${duration}ms linear ${delay}ms 1 both`;\n active += 1;\n return name;\n}\nfunction delete_rule(node, name) {\n node.style.animation = (node.style.animation || '')\n .split(', ')\n .filter(name\n ? anim => anim.indexOf(name) < 0 // remove specific animation\n : anim => anim.indexOf('__svelte') === -1 // remove all Svelte animations\n )\n .join(', ');\n if (name && !--active)\n clear_rules();\n}\nfunction clear_rules() {\n raf(() => {\n if (active)\n return;\n let i = stylesheet.cssRules.length;\n while (i--)\n stylesheet.deleteRule(i);\n current_rules = {};\n });\n}\n\nfunction create_animation(node, from, fn, params) {\n if (!from)\n return noop;\n const to = node.getBoundingClientRect();\n if (from.left === to.left && from.right === to.right && from.top === to.top && from.bottom === to.bottom)\n return noop;\n const { delay = 0, duration = 300, easing = identity, \n // @ts-ignore todo: should this be separated from destructuring? Or start/end added to public api and documentation?\n start: start_time = now() + delay, \n // @ts-ignore todo:\n end = start_time + duration, tick = noop, css } = fn(node, { from, to }, params);\n let running = true;\n let started = false;\n let name;\n function start() {\n if (css) {\n name = create_rule(node, 0, 1, duration, delay, easing, css);\n }\n if (!delay) {\n started = true;\n }\n }\n function stop() {\n if (css)\n delete_rule(node, name);\n running = false;\n }\n loop(now => {\n if (!started && now >= start_time) {\n started = true;\n }\n if (started && now >= end) {\n tick(1, 0);\n stop();\n }\n if (!running) {\n return false;\n }\n if (started) {\n const p = now - start_time;\n const t = 0 + 1 * easing(p / duration);\n tick(t, 1 - t);\n }\n return true;\n });\n start();\n tick(0, 1);\n return stop;\n}\nfunction fix_position(node) {\n const style = getComputedStyle(node);\n if (style.position !== 'absolute' && style.position !== 'fixed') {\n const { width, height } = style;\n const a = node.getBoundingClientRect();\n node.style.position = 'absolute';\n node.style.width = width;\n node.style.height = height;\n add_transform(node, a);\n }\n}\nfunction add_transform(node, a) {\n const b = node.getBoundingClientRect();\n if (a.left !== b.left || a.top !== b.top) {\n const style = getComputedStyle(node);\n const transform = style.transform === 'none' ? '' : style.transform;\n node.style.transform = `${transform} translate(${a.left - b.left}px, ${a.top - b.top}px)`;\n }\n}\n\nlet current_component;\nfunction set_current_component(component) {\n current_component = component;\n}\nfunction get_current_component() {\n if (!current_component)\n throw new Error(`Function called outside component initialization`);\n return current_component;\n}\nfunction beforeUpdate(fn) {\n get_current_component().$$.before_update.push(fn);\n}\nfunction onMount(fn) {\n get_current_component().$$.on_mount.push(fn);\n}\nfunction afterUpdate(fn) {\n get_current_component().$$.after_update.push(fn);\n}\nfunction onDestroy(fn) {\n get_current_component().$$.on_destroy.push(fn);\n}\nfunction createEventDispatcher() {\n const component = current_component;\n return (type, detail) => {\n const callbacks = component.$$.callbacks[type];\n if (callbacks) {\n // TODO are there situations where events could be dispatched\n // in a server (non-DOM) environment?\n const event = custom_event(type, detail);\n callbacks.slice().forEach(fn => {\n fn.call(component, event);\n });\n }\n };\n}\nfunction setContext(key, context) {\n get_current_component().$$.context.set(key, context);\n}\nfunction getContext(key) {\n return get_current_component().$$.context.get(key);\n}\n// TODO figure out if we still want to support\n// shorthand events, or if we want to implement\n// a real bubbling mechanism\nfunction bubble(component, event) {\n const callbacks = component.$$.callbacks[event.type];\n if (callbacks) {\n callbacks.slice().forEach(fn => fn(event));\n }\n}\n\nconst dirty_components = [];\nconst intros = { enabled: false };\nconst binding_callbacks = [];\nconst render_callbacks = [];\nconst flush_callbacks = [];\nconst resolved_promise = Promise.resolve();\nlet update_scheduled = false;\nfunction schedule_update() {\n if (!update_scheduled) {\n update_scheduled = true;\n resolved_promise.then(flush);\n }\n}\nfunction tick() {\n schedule_update();\n return resolved_promise;\n}\nfunction add_render_callback(fn) {\n render_callbacks.push(fn);\n}\nfunction add_flush_callback(fn) {\n flush_callbacks.push(fn);\n}\nfunction flush() {\n const seen_callbacks = new Set();\n do {\n // first, call beforeUpdate functions\n // and update components\n while (dirty_components.length) {\n const component = dirty_components.shift();\n set_current_component(component);\n update(component.$$);\n }\n while (binding_callbacks.length)\n binding_callbacks.pop()();\n // then, once components are updated, call\n // afterUpdate functions. This may cause\n // subsequent updates...\n for (let i = 0; i < render_callbacks.length; i += 1) {\n const callback = render_callbacks[i];\n if (!seen_callbacks.has(callback)) {\n callback();\n // ...so guard against infinite loops\n seen_callbacks.add(callback);\n }\n }\n render_callbacks.length = 0;\n } while (dirty_components.length);\n while (flush_callbacks.length) {\n flush_callbacks.pop()();\n }\n update_scheduled = false;\n}\nfunction update($$) {\n if ($$.fragment) {\n $$.update($$.dirty);\n run_all($$.before_update);\n $$.fragment.p($$.dirty, $$.ctx);\n $$.dirty = null;\n $$.after_update.forEach(add_render_callback);\n }\n}\n\nlet promise;\nfunction wait() {\n if (!promise) {\n promise = Promise.resolve();\n promise.then(() => {\n promise = null;\n });\n }\n return promise;\n}\nfunction dispatch(node, direction, kind) {\n node.dispatchEvent(custom_event(`${direction ? 'intro' : 'outro'}${kind}`));\n}\nconst outroing = new Set();\nlet outros;\nfunction group_outros() {\n outros = {\n r: 0,\n c: [],\n p: outros // parent group\n };\n}\nfunction check_outros() {\n if (!outros.r) {\n run_all(outros.c);\n }\n outros = outros.p;\n}\nfunction transition_in(block, local) {\n if (block && block.i) {\n outroing.delete(block);\n block.i(local);\n }\n}\nfunction transition_out(block, local, detach, callback) {\n if (block && block.o) {\n if (outroing.has(block))\n return;\n outroing.add(block);\n outros.c.push(() => {\n outroing.delete(block);\n if (callback) {\n if (detach)\n block.d(1);\n callback();\n }\n });\n block.o(local);\n }\n}\nconst null_transition = { duration: 0 };\nfunction create_in_transition(node, fn, params) {\n let config = fn(node, params);\n let running = false;\n let animation_name;\n let task;\n let uid = 0;\n function cleanup() {\n if (animation_name)\n delete_rule(node, animation_name);\n }\n function go() {\n const { delay = 0, duration = 300, easing = identity, tick = noop, css } = config || null_transition;\n if (css)\n animation_name = create_rule(node, 0, 1, duration, delay, easing, css, uid++);\n tick(0, 1);\n const start_time = now() + delay;\n const end_time = start_time + duration;\n if (task)\n task.abort();\n running = true;\n add_render_callback(() => dispatch(node, true, 'start'));\n task = loop(now => {\n if (running) {\n if (now >= end_time) {\n tick(1, 0);\n dispatch(node, true, 'end');\n cleanup();\n return running = false;\n }\n if (now >= start_time) {\n const t = easing((now - start_time) / duration);\n tick(t, 1 - t);\n }\n }\n return running;\n });\n }\n let started = false;\n return {\n start() {\n if (started)\n return;\n delete_rule(node);\n if (is_function(config)) {\n config = config();\n wait().then(go);\n }\n else {\n go();\n }\n },\n invalidate() {\n started = false;\n },\n end() {\n if (running) {\n cleanup();\n running = false;\n }\n }\n };\n}\nfunction create_out_transition(node, fn, params) {\n let config = fn(node, params);\n let running = true;\n let animation_name;\n const group = outros;\n group.r += 1;\n function go() {\n const { delay = 0, duration = 300, easing = identity, tick = noop, css } = config || null_transition;\n if (css)\n animation_name = create_rule(node, 1, 0, duration, delay, easing, css);\n const start_time = now() + delay;\n const end_time = start_time + duration;\n add_render_callback(() => dispatch(node, false, 'start'));\n loop(now => {\n if (running) {\n if (now >= end_time) {\n tick(0, 1);\n dispatch(node, false, 'end');\n if (!--group.r) {\n // this will result in `end()` being called,\n // so we don't need to clean up here\n run_all(group.c);\n }\n return false;\n }\n if (now >= start_time) {\n const t = easing((now - start_time) / duration);\n tick(1 - t, t);\n }\n }\n return running;\n });\n }\n if (is_function(config)) {\n wait().then(() => {\n // @ts-ignore\n config = config();\n go();\n });\n }\n else {\n go();\n }\n return {\n end(reset) {\n if (reset && config.tick) {\n config.tick(1, 0);\n }\n if (running) {\n if (animation_name)\n delete_rule(node, animation_name);\n running = false;\n }\n }\n };\n}\nfunction create_bidirectional_transition(node, fn, params, intro) {\n let config = fn(node, params);\n let t = intro ? 0 : 1;\n let running_program = null;\n let pending_program = null;\n let animation_name = null;\n function clear_animation() {\n if (animation_name)\n delete_rule(node, animation_name);\n }\n function init(program, duration) {\n const d = program.b - t;\n duration *= Math.abs(d);\n return {\n a: t,\n b: program.b,\n d,\n duration,\n start: program.start,\n end: program.start + duration,\n group: program.group\n };\n }\n function go(b) {\n const { delay = 0, duration = 300, easing = identity, tick = noop, css } = config || null_transition;\n const program = {\n start: now() + delay,\n b\n };\n if (!b) {\n // @ts-ignore todo: improve typings\n program.group = outros;\n outros.r += 1;\n }\n if (running_program) {\n pending_program = program;\n }\n else {\n // if this is an intro, and there's a delay, we need to do\n // an initial tick and/or apply CSS animation immediately\n if (css) {\n clear_animation();\n animation_name = create_rule(node, t, b, duration, delay, easing, css);\n }\n if (b)\n tick(0, 1);\n running_program = init(program, duration);\n add_render_callback(() => dispatch(node, b, 'start'));\n loop(now => {\n if (pending_program && now > pending_program.start) {\n running_program = init(pending_program, duration);\n pending_program = null;\n dispatch(node, running_program.b, 'start');\n if (css) {\n clear_animation();\n animation_name = create_rule(node, t, running_program.b, running_program.duration, 0, easing, config.css);\n }\n }\n if (running_program) {\n if (now >= running_program.end) {\n tick(t = running_program.b, 1 - t);\n dispatch(node, running_program.b, 'end');\n if (!pending_program) {\n // we're done\n if (running_program.b) {\n // intro — we can tidy up immediately\n clear_animation();\n }\n else {\n // outro — needs to be coordinated\n if (!--running_program.group.r)\n run_all(running_program.group.c);\n }\n }\n running_program = null;\n }\n else if (now >= running_program.start) {\n const p = now - running_program.start;\n t = running_program.a + running_program.d * easing(p / running_program.duration);\n tick(t, 1 - t);\n }\n }\n return !!(running_program || pending_program);\n });\n }\n }\n return {\n run(b) {\n if (is_function(config)) {\n wait().then(() => {\n // @ts-ignore\n config = config();\n go(b);\n });\n }\n else {\n go(b);\n }\n },\n end() {\n clear_animation();\n running_program = pending_program = null;\n }\n };\n}\n\nfunction handle_promise(promise, info) {\n const token = info.token = {};\n function update(type, index, key, value) {\n if (info.token !== token)\n return;\n info.resolved = key && { [key]: value };\n const child_ctx = assign(assign({}, info.ctx), info.resolved);\n const block = type && (info.current = type)(child_ctx);\n if (info.block) {\n if (info.blocks) {\n info.blocks.forEach((block, i) => {\n if (i !== index && block) {\n group_outros();\n transition_out(block, 1, 1, () => {\n info.blocks[i] = null;\n });\n check_outros();\n }\n });\n }\n else {\n info.block.d(1);\n }\n block.c();\n transition_in(block, 1);\n block.m(info.mount(), info.anchor);\n flush();\n }\n info.block = block;\n if (info.blocks)\n info.blocks[index] = block;\n }\n if (is_promise(promise)) {\n const current_component = get_current_component();\n promise.then(value => {\n set_current_component(current_component);\n update(info.then, 1, info.value, value);\n set_current_component(null);\n }, error => {\n set_current_component(current_component);\n update(info.catch, 2, info.error, error);\n set_current_component(null);\n });\n // if we previously had a then/catch block, destroy it\n if (info.current !== info.pending) {\n update(info.pending, 0);\n return true;\n }\n }\n else {\n if (info.current !== info.then) {\n update(info.then, 1, info.value, promise);\n return true;\n }\n info.resolved = { [info.value]: promise };\n }\n}\n\nconst globals = (typeof window !== 'undefined' ? window : global);\n\nfunction destroy_block(block, lookup) {\n block.d(1);\n lookup.delete(block.key);\n}\nfunction outro_and_destroy_block(block, lookup) {\n transition_out(block, 1, 1, () => {\n lookup.delete(block.key);\n });\n}\nfunction fix_and_destroy_block(block, lookup) {\n block.f();\n destroy_block(block, lookup);\n}\nfunction fix_and_outro_and_destroy_block(block, lookup) {\n block.f();\n outro_and_destroy_block(block, lookup);\n}\nfunction update_keyed_each(old_blocks, changed, get_key, dynamic, ctx, list, lookup, node, destroy, create_each_block, next, get_context) {\n let o = old_blocks.length;\n let n = list.length;\n let i = o;\n const old_indexes = {};\n while (i--)\n old_indexes[old_blocks[i].key] = i;\n const new_blocks = [];\n const new_lookup = new Map();\n const deltas = new Map();\n i = n;\n while (i--) {\n const child_ctx = get_context(ctx, list, i);\n const key = get_key(child_ctx);\n let block = lookup.get(key);\n if (!block) {\n block = create_each_block(key, child_ctx);\n block.c();\n }\n else if (dynamic) {\n block.p(changed, child_ctx);\n }\n new_lookup.set(key, new_blocks[i] = block);\n if (key in old_indexes)\n deltas.set(key, Math.abs(i - old_indexes[key]));\n }\n const will_move = new Set();\n const did_move = new Set();\n function insert(block) {\n transition_in(block, 1);\n block.m(node, next);\n lookup.set(block.key, block);\n next = block.first;\n n--;\n }\n while (o && n) {\n const new_block = new_blocks[n - 1];\n const old_block = old_blocks[o - 1];\n const new_key = new_block.key;\n const old_key = old_block.key;\n if (new_block === old_block) {\n // do nothing\n next = new_block.first;\n o--;\n n--;\n }\n else if (!new_lookup.has(old_key)) {\n // remove old block\n destroy(old_block, lookup);\n o--;\n }\n else if (!lookup.has(new_key) || will_move.has(new_key)) {\n insert(new_block);\n }\n else if (did_move.has(old_key)) {\n o--;\n }\n else if (deltas.get(new_key) > deltas.get(old_key)) {\n did_move.add(new_key);\n insert(new_block);\n }\n else {\n will_move.add(old_key);\n o--;\n }\n }\n while (o--) {\n const old_block = old_blocks[o];\n if (!new_lookup.has(old_block.key))\n destroy(old_block, lookup);\n }\n while (n)\n insert(new_blocks[n - 1]);\n return new_blocks;\n}\nfunction measure(blocks) {\n const rects = {};\n let i = blocks.length;\n while (i--)\n rects[blocks[i].key] = blocks[i].node.getBoundingClientRect();\n return rects;\n}\n\nfunction get_spread_update(levels, updates) {\n const update = {};\n const to_null_out = {};\n const accounted_for = { $$scope: 1 };\n let i = levels.length;\n while (i--) {\n const o = levels[i];\n const n = updates[i];\n if (n) {\n for (const key in o) {\n if (!(key in n))\n to_null_out[key] = 1;\n }\n for (const key in n) {\n if (!accounted_for[key]) {\n update[key] = n[key];\n accounted_for[key] = 1;\n }\n }\n levels[i] = n;\n }\n else {\n for (const key in o) {\n accounted_for[key] = 1;\n }\n }\n }\n for (const key in to_null_out) {\n if (!(key in update))\n update[key] = undefined;\n }\n return update;\n}\nfunction get_spread_object(spread_props) {\n return typeof spread_props === 'object' && spread_props !== null ? spread_props : {};\n}\n\nconst invalid_attribute_name_character = /[\\s'\">/=\\u{FDD0}-\\u{FDEF}\\u{FFFE}\\u{FFFF}\\u{1FFFE}\\u{1FFFF}\\u{2FFFE}\\u{2FFFF}\\u{3FFFE}\\u{3FFFF}\\u{4FFFE}\\u{4FFFF}\\u{5FFFE}\\u{5FFFF}\\u{6FFFE}\\u{6FFFF}\\u{7FFFE}\\u{7FFFF}\\u{8FFFE}\\u{8FFFF}\\u{9FFFE}\\u{9FFFF}\\u{AFFFE}\\u{AFFFF}\\u{BFFFE}\\u{BFFFF}\\u{CFFFE}\\u{CFFFF}\\u{DFFFE}\\u{DFFFF}\\u{EFFFE}\\u{EFFFF}\\u{FFFFE}\\u{FFFFF}\\u{10FFFE}\\u{10FFFF}]/u;\n// https://html.spec.whatwg.org/multipage/syntax.html#attributes-2\n// https://infra.spec.whatwg.org/#noncharacter\nfunction spread(args) {\n const attributes = Object.assign({}, ...args);\n let str = '';\n Object.keys(attributes).forEach(name => {\n if (invalid_attribute_name_character.test(name))\n return;\n const value = attributes[name];\n if (value === undefined)\n return;\n if (value === true)\n str += \" \" + name;\n const escaped = String(value)\n .replace(/\"/g, '"')\n .replace(/'/g, ''');\n str += \" \" + name + \"=\" + JSON.stringify(escaped);\n });\n return str;\n}\nconst escaped = {\n '\"': '"',\n \"'\": ''',\n '&': '&',\n '<': '<',\n '>': '>'\n};\nfunction escape(html) {\n return String(html).replace(/[\"'&<>]/g, match => escaped[match]);\n}\nfunction each(items, fn) {\n let str = '';\n for (let i = 0; i < items.length; i += 1) {\n str += fn(items[i], i);\n }\n return str;\n}\nconst missing_component = {\n $$render: () => ''\n};\nfunction validate_component(component, name) {\n if (!component || !component.$$render) {\n if (name === 'svelte:component')\n name += ' this={...}';\n throw new Error(`<${name}> is not a valid SSR component. You may need to review your build config to ensure that dependencies are compiled, rather than imported as pre-compiled modules`);\n }\n return component;\n}\nfunction debug(file, line, column, values) {\n console.log(`{@debug} ${file ? file + ' ' : ''}(${line}:${column})`); // eslint-disable-line no-console\n console.log(values); // eslint-disable-line no-console\n return '';\n}\nlet on_destroy;\nfunction create_ssr_component(fn) {\n function $$render(result, props, bindings, slots) {\n const parent_component = current_component;\n const $$ = {\n on_destroy,\n context: new Map(parent_component ? parent_component.$$.context : []),\n // these will be immediately discarded\n on_mount: [],\n before_update: [],\n after_update: [],\n callbacks: blank_object()\n };\n set_current_component({ $$ });\n const html = fn(result, props, bindings, slots);\n set_current_component(parent_component);\n return html;\n }\n return {\n render: (props = {}, options = {}) => {\n on_destroy = [];\n const result = { head: '', css: new Set() };\n const html = $$render(result, props, {}, options);\n run_all(on_destroy);\n return {\n html,\n css: {\n code: Array.from(result.css).map(css => css.code).join('\\n'),\n map: null // TODO\n },\n head: result.head\n };\n },\n $$render\n };\n}\nfunction add_attribute(name, value, boolean) {\n if (value == null || (boolean && !value))\n return '';\n return ` ${name}${value === true ? '' : `=${typeof value === 'string' ? JSON.stringify(escape(value)) : `\"${value}\"`}`}`;\n}\nfunction add_classes(classes) {\n return classes ? ` class=\"${classes}\"` : ``;\n}\n\nfunction bind(component, name, callback) {\n if (component.$$.props.indexOf(name) === -1)\n return;\n component.$$.bound[name] = callback;\n callback(component.$$.ctx[name]);\n}\nfunction mount_component(component, target, anchor) {\n const { fragment, on_mount, on_destroy, after_update } = component.$$;\n fragment.m(target, anchor);\n // onMount happens before the initial afterUpdate\n add_render_callback(() => {\n const new_on_destroy = on_mount.map(run).filter(is_function);\n if (on_destroy) {\n on_destroy.push(...new_on_destroy);\n }\n else {\n // Edge case - component was destroyed immediately,\n // most likely as a result of a binding initialising\n run_all(new_on_destroy);\n }\n component.$$.on_mount = [];\n });\n after_update.forEach(add_render_callback);\n}\nfunction destroy_component(component, detaching) {\n if (component.$$.fragment) {\n run_all(component.$$.on_destroy);\n component.$$.fragment.d(detaching);\n // TODO null out other refs, including component.$$ (but need to\n // preserve final state?)\n component.$$.on_destroy = component.$$.fragment = null;\n component.$$.ctx = {};\n }\n}\nfunction make_dirty(component, key) {\n if (!component.$$.dirty) {\n dirty_components.push(component);\n schedule_update();\n component.$$.dirty = blank_object();\n }\n component.$$.dirty[key] = true;\n}\nfunction init(component, options, instance, create_fragment, not_equal, prop_names) {\n const parent_component = current_component;\n set_current_component(component);\n const props = options.props || {};\n const $$ = component.$$ = {\n fragment: null,\n ctx: null,\n // state\n props: prop_names,\n update: noop,\n not_equal,\n bound: blank_object(),\n // lifecycle\n on_mount: [],\n on_destroy: [],\n before_update: [],\n after_update: [],\n context: new Map(parent_component ? parent_component.$$.context : []),\n // everything else\n callbacks: blank_object(),\n dirty: null\n };\n let ready = false;\n $$.ctx = instance\n ? instance(component, props, (key, ret, value = ret) => {\n if ($$.ctx && not_equal($$.ctx[key], $$.ctx[key] = value)) {\n if ($$.bound[key])\n $$.bound[key](value);\n if (ready)\n make_dirty(component, key);\n }\n return ret;\n })\n : props;\n $$.update();\n ready = true;\n run_all($$.before_update);\n $$.fragment = create_fragment($$.ctx);\n if (options.target) {\n if (options.hydrate) {\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n $$.fragment.l(children(options.target));\n }\n else {\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n $$.fragment.c();\n }\n if (options.intro)\n transition_in(component.$$.fragment);\n mount_component(component, options.target, options.anchor);\n flush();\n }\n set_current_component(parent_component);\n}\nlet SvelteElement;\nif (typeof HTMLElement !== 'undefined') {\n SvelteElement = class extends HTMLElement {\n constructor() {\n super();\n this.attachShadow({ mode: 'open' });\n }\n connectedCallback() {\n // @ts-ignore todo: improve typings\n for (const key in this.$$.slotted) {\n // @ts-ignore todo: improve typings\n this.appendChild(this.$$.slotted[key]);\n }\n }\n attributeChangedCallback(attr, _oldValue, newValue) {\n this[attr] = newValue;\n }\n $destroy() {\n destroy_component(this, 1);\n this.$destroy = noop;\n }\n $on(type, callback) {\n // TODO should this delegate to addEventListener?\n const callbacks = (this.$$.callbacks[type] || (this.$$.callbacks[type] = []));\n callbacks.push(callback);\n return () => {\n const index = callbacks.indexOf(callback);\n if (index !== -1)\n callbacks.splice(index, 1);\n };\n }\n $set() {\n // overridden by instance, if it has props\n }\n };\n}\nclass SvelteComponent {\n $destroy() {\n destroy_component(this, 1);\n this.$destroy = noop;\n }\n $on(type, callback) {\n const callbacks = (this.$$.callbacks[type] || (this.$$.callbacks[type] = []));\n callbacks.push(callback);\n return () => {\n const index = callbacks.indexOf(callback);\n if (index !== -1)\n callbacks.splice(index, 1);\n };\n }\n $set() {\n // overridden by instance, if it has props\n }\n}\n\nfunction dispatch_dev(type, detail) {\n document.dispatchEvent(custom_event(type, detail));\n}\nfunction append_dev(target, node) {\n dispatch_dev(\"SvelteDOMInsert\", { target, node });\n append(target, node);\n}\nfunction insert_dev(target, node, anchor) {\n dispatch_dev(\"SvelteDOMInsert\", { target, node, anchor });\n insert(target, node, anchor);\n}\nfunction detach_dev(node) {\n dispatch_dev(\"SvelteDOMRemove\", { node });\n detach(node);\n}\nfunction detach_between_dev(before, after) {\n while (before.nextSibling && before.nextSibling !== after) {\n detach_dev(before.nextSibling);\n }\n}\nfunction detach_before_dev(after) {\n while (after.previousSibling) {\n detach_dev(after.previousSibling);\n }\n}\nfunction detach_after_dev(before) {\n while (before.nextSibling) {\n detach_dev(before.nextSibling);\n }\n}\nfunction listen_dev(node, event, handler, options, has_prevent_default, has_stop_propagation) {\n const modifiers = options === true ? [\"capture\"] : options ? Array.from(Object.keys(options)) : [];\n if (has_prevent_default)\n modifiers.push('preventDefault');\n if (has_stop_propagation)\n modifiers.push('stopPropagation');\n dispatch_dev(\"SvelteDOMAddEventListener\", { node, event, handler, modifiers });\n const dispose = listen(node, event, handler, options);\n return () => {\n dispatch_dev(\"SvelteDOMRemoveEventListener\", { node, event, handler, modifiers });\n dispose();\n };\n}\nfunction attr_dev(node, attribute, value) {\n attr(node, attribute, value);\n if (value == null)\n dispatch_dev(\"SvelteDOMRemoveAttribute\", { node, attribute });\n else\n dispatch_dev(\"SvelteDOMSetAttribute\", { node, attribute, value });\n}\nfunction prop_dev(node, property, value) {\n node[property] = value;\n dispatch_dev(\"SvelteDOMSetProperty\", { node, property, value });\n}\nfunction dataset_dev(node, property, value) {\n node.dataset[property] = value;\n dispatch_dev(\"SvelteDOMSetDataset\", { node, property, value });\n}\nfunction set_data_dev(text, data) {\n data = '' + data;\n if (text.data === data)\n return;\n dispatch_dev(\"SvelteDOMSetData\", { node: text, data });\n text.data = data;\n}\nclass SvelteComponentDev extends SvelteComponent {\n constructor(options) {\n if (!options || (!options.target && !options.$$inline)) {\n throw new Error(`'target' is a required option`);\n }\n super();\n }\n $destroy() {\n super.$destroy();\n this.$destroy = () => {\n console.warn(`Component was already destroyed`); // eslint-disable-line no-console\n };\n }\n}\n\nexport { HtmlTag, SvelteComponent, SvelteComponentDev, SvelteElement, add_attribute, add_classes, add_flush_callback, add_location, add_render_callback, add_resize_listener, add_transform, afterUpdate, append, append_dev, assign, attr, attr_dev, beforeUpdate, bind, binding_callbacks, blank_object, bubble, check_outros, children, claim_element, claim_space, claim_text, clear_loops, component_subscribe, createEventDispatcher, create_animation, create_bidirectional_transition, create_in_transition, create_out_transition, create_slot, create_ssr_component, current_component, custom_event, dataset_dev, debug, destroy_block, destroy_component, destroy_each, detach, detach_after_dev, detach_before_dev, detach_between_dev, detach_dev, dirty_components, dispatch_dev, each, element, element_is, empty, escape, escaped, exclude_internal_props, fix_and_destroy_block, fix_and_outro_and_destroy_block, fix_position, flush, getContext, get_binding_group_value, get_current_component, get_slot_changes, get_slot_context, get_spread_object, get_spread_update, get_store_value, globals, group_outros, handle_promise, identity, init, insert, insert_dev, intros, invalid_attribute_name_character, is_client, is_function, is_promise, listen, listen_dev, loop, measure, missing_component, mount_component, noop, not_equal, now, null_to_empty, object_without_properties, onDestroy, onMount, once, outro_and_destroy_block, prevent_default, prop_dev, raf, run, run_all, safe_not_equal, schedule_update, select_multiple_value, select_option, select_options, select_value, self, setContext, set_attributes, set_current_component, set_custom_element_data, set_data, set_data_dev, set_input_type, set_input_value, set_now, set_raf, set_store_value, set_style, set_svg_attributes, space, spread, stop_propagation, subscribe, svg_element, text, tick, time_ranges_to_array, to_number, toggle_class, transition_in, transition_out, update_keyed_each, validate_component, validate_store, xlink_attr };\n","import { safe_not_equal, noop, run_all, is_function } from '../internal';\nexport { get_store_value as get } from '../internal';\n\nconst subscriber_queue = [];\n/**\n * Creates a `Readable` store that allows reading by subscription.\n * @param value initial value\n * @param {StartStopNotifier}start start and stop notifications for subscriptions\n */\nfunction readable(value, start) {\n return {\n subscribe: writable(value, start).subscribe,\n };\n}\n/**\n * Create a `Writable` store that allows both updating and reading by subscription.\n * @param {*=}value initial value\n * @param {StartStopNotifier=}start start and stop notifications for subscriptions\n */\nfunction writable(value, start = noop) {\n let stop;\n const subscribers = [];\n function set(new_value) {\n if (safe_not_equal(value, new_value)) {\n value = new_value;\n if (stop) { // store is ready\n const run_queue = !subscriber_queue.length;\n for (let i = 0; i < subscribers.length; i += 1) {\n const s = subscribers[i];\n s[1]();\n subscriber_queue.push(s, value);\n }\n if (run_queue) {\n for (let i = 0; i < subscriber_queue.length; i += 2) {\n subscriber_queue[i][0](subscriber_queue[i + 1]);\n }\n subscriber_queue.length = 0;\n }\n }\n }\n }\n function update(fn) {\n set(fn(value));\n }\n function subscribe(run, invalidate = noop) {\n const subscriber = [run, invalidate];\n subscribers.push(subscriber);\n if (subscribers.length === 1) {\n stop = start(set) || noop;\n }\n run(value);\n return () => {\n const index = subscribers.indexOf(subscriber);\n if (index !== -1) {\n subscribers.splice(index, 1);\n }\n if (subscribers.length === 0) {\n stop();\n stop = null;\n }\n };\n }\n return { set, update, subscribe };\n}\n/**\n * Derived value store by synchronizing one or more readable stores and\n * applying an aggregation function over its input values.\n * @param {Stores} stores input stores\n * @param {function(Stores=, function(*)=):*}fn function callback that aggregates the values\n * @param {*=}initial_value when used asynchronously\n */\nfunction derived(stores, fn, initial_value) {\n const single = !Array.isArray(stores);\n const stores_array = single\n ? [stores]\n : stores;\n const auto = fn.length < 2;\n return readable(initial_value, (set) => {\n let inited = false;\n const values = [];\n let pending = 0;\n let cleanup = noop;\n const sync = () => {\n if (pending) {\n return;\n }\n cleanup();\n const result = fn(single ? values[0] : values, set);\n if (auto) {\n set(result);\n }\n else {\n cleanup = is_function(result) ? result : noop;\n }\n };\n const unsubscribers = stores_array.map((store, i) => store.subscribe((value) => {\n values[i] = value;\n pending &= ~(1 << i);\n if (inited) {\n sync();\n }\n }, () => {\n pending |= (1 << i);\n }));\n inited = true;\n sync();\n return function stop() {\n run_all(unsubscribers);\n cleanup();\n };\n });\n}\n\nexport { derived, readable, writable };\n","export const createCoreApp = (backendDefinition, user) => {\r\n const app = {\r\n datastore: null,\r\n crypto: null,\r\n publish: () => {},\r\n hierarchy: backendDefinition.hierarchy,\r\n actions: backendDefinition.actions,\r\n user,\r\n }\r\n\r\n return app\r\n}\r\n","/**\n * @license\n * Lodash lodash.com/license | Underscore.js 1.8.3 underscorejs.org/LICENSE\n */\n;(function(){function n(n,t,r){switch(r.length){case 0:return n.call(t);case 1:return n.call(t,r[0]);case 2:return n.call(t,r[0],r[1]);case 3:return n.call(t,r[0],r[1],r[2])}return n.apply(t,r)}function t(n,t,r,e){for(var u=-1,i=null==n?0:n.length;++u\"']/g,G=RegExp(V.source),H=RegExp(K.source),J=/<%-([\\s\\S]+?)%>/g,Y=/<%([\\s\\S]+?)%>/g,Q=/<%=([\\s\\S]+?)%>/g,X=/\\.|\\[(?:[^[\\]]*|([\"'])(?:(?!\\1)[^\\\\]|\\\\.)*?\\1)\\]/,nn=/^\\w*$/,tn=/[^.[\\]]+|\\[(?:(-?\\d+(?:\\.\\d+)?)|([\"'])((?:(?!\\2)[^\\\\]|\\\\.)*?)\\2)\\]|(?=(?:\\.|\\[\\])(?:\\.|\\[\\]|$))/g,rn=/[\\\\^$.*+?()[\\]{}|]/g,en=RegExp(rn.source),un=/^\\s+|\\s+$/g,on=/^\\s+/,fn=/\\s+$/,cn=/\\{(?:\\n\\/\\* \\[wrapped with .+\\] \\*\\/)?\\n?/,an=/\\{\\n\\/\\* \\[wrapped with (.+)\\] \\*/,ln=/,? & /,sn=/[^\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\x7f]+/g,hn=/\\\\(\\\\)?/g,pn=/\\$\\{([^\\\\}]*(?:\\\\.[^\\\\}]*)*)\\}/g,_n=/\\w*$/,vn=/^[-+]0x[0-9a-f]+$/i,gn=/^0b[01]+$/i,dn=/^\\[object .+?Constructor\\]$/,yn=/^0o[0-7]+$/i,bn=/^(?:0|[1-9]\\d*)$/,xn=/[\\xc0-\\xd6\\xd8-\\xf6\\xf8-\\xff\\u0100-\\u017f]/g,jn=/($^)/,wn=/['\\n\\r\\u2028\\u2029\\\\]/g,mn=\"[\\\\ufe0e\\\\ufe0f]?(?:[\\\\u0300-\\\\u036f\\\\ufe20-\\\\ufe2f\\\\u20d0-\\\\u20ff]|\\\\ud83c[\\\\udffb-\\\\udfff])?(?:\\\\u200d(?:[^\\\\ud800-\\\\udfff]|(?:\\\\ud83c[\\\\udde6-\\\\uddff]){2}|[\\\\ud800-\\\\udbff][\\\\udc00-\\\\udfff])[\\\\ufe0e\\\\ufe0f]?(?:[\\\\u0300-\\\\u036f\\\\ufe20-\\\\ufe2f\\\\u20d0-\\\\u20ff]|\\\\ud83c[\\\\udffb-\\\\udfff])?)*\",An=\"(?:[\\\\u2700-\\\\u27bf]|(?:\\\\ud83c[\\\\udde6-\\\\uddff]){2}|[\\\\ud800-\\\\udbff][\\\\udc00-\\\\udfff])\"+mn,En=\"(?:[^\\\\ud800-\\\\udfff][\\\\u0300-\\\\u036f\\\\ufe20-\\\\ufe2f\\\\u20d0-\\\\u20ff]?|[\\\\u0300-\\\\u036f\\\\ufe20-\\\\ufe2f\\\\u20d0-\\\\u20ff]|(?:\\\\ud83c[\\\\udde6-\\\\uddff]){2}|[\\\\ud800-\\\\udbff][\\\\udc00-\\\\udfff]|[\\\\ud800-\\\\udfff])\",kn=RegExp(\"['\\u2019]\",\"g\"),Sn=RegExp(\"[\\\\u0300-\\\\u036f\\\\ufe20-\\\\ufe2f\\\\u20d0-\\\\u20ff]\",\"g\"),On=RegExp(\"\\\\ud83c[\\\\udffb-\\\\udfff](?=\\\\ud83c[\\\\udffb-\\\\udfff])|\"+En+mn,\"g\"),In=RegExp([\"[A-Z\\\\xc0-\\\\xd6\\\\xd8-\\\\xde]?[a-z\\\\xdf-\\\\xf6\\\\xf8-\\\\xff]+(?:['\\u2019](?:d|ll|m|re|s|t|ve))?(?=[\\\\xac\\\\xb1\\\\xd7\\\\xf7\\\\x00-\\\\x2f\\\\x3a-\\\\x40\\\\x5b-\\\\x60\\\\x7b-\\\\xbf\\\\u2000-\\\\u206f \\\\t\\\\x0b\\\\f\\\\xa0\\\\ufeff\\\\n\\\\r\\\\u2028\\\\u2029\\\\u1680\\\\u180e\\\\u2000\\\\u2001\\\\u2002\\\\u2003\\\\u2004\\\\u2005\\\\u2006\\\\u2007\\\\u2008\\\\u2009\\\\u200a\\\\u202f\\\\u205f\\\\u3000]|[A-Z\\\\xc0-\\\\xd6\\\\xd8-\\\\xde]|$)|(?:[A-Z\\\\xc0-\\\\xd6\\\\xd8-\\\\xde]|[^\\\\ud800-\\\\udfff\\\\xac\\\\xb1\\\\xd7\\\\xf7\\\\x00-\\\\x2f\\\\x3a-\\\\x40\\\\x5b-\\\\x60\\\\x7b-\\\\xbf\\\\u2000-\\\\u206f \\\\t\\\\x0b\\\\f\\\\xa0\\\\ufeff\\\\n\\\\r\\\\u2028\\\\u2029\\\\u1680\\\\u180e\\\\u2000\\\\u2001\\\\u2002\\\\u2003\\\\u2004\\\\u2005\\\\u2006\\\\u2007\\\\u2008\\\\u2009\\\\u200a\\\\u202f\\\\u205f\\\\u3000\\\\d+\\\\u2700-\\\\u27bfa-z\\\\xdf-\\\\xf6\\\\xf8-\\\\xffA-Z\\\\xc0-\\\\xd6\\\\xd8-\\\\xde])+(?:['\\u2019](?:D|LL|M|RE|S|T|VE))?(?=[\\\\xac\\\\xb1\\\\xd7\\\\xf7\\\\x00-\\\\x2f\\\\x3a-\\\\x40\\\\x5b-\\\\x60\\\\x7b-\\\\xbf\\\\u2000-\\\\u206f \\\\t\\\\x0b\\\\f\\\\xa0\\\\ufeff\\\\n\\\\r\\\\u2028\\\\u2029\\\\u1680\\\\u180e\\\\u2000\\\\u2001\\\\u2002\\\\u2003\\\\u2004\\\\u2005\\\\u2006\\\\u2007\\\\u2008\\\\u2009\\\\u200a\\\\u202f\\\\u205f\\\\u3000]|[A-Z\\\\xc0-\\\\xd6\\\\xd8-\\\\xde](?:[a-z\\\\xdf-\\\\xf6\\\\xf8-\\\\xff]|[^\\\\ud800-\\\\udfff\\\\xac\\\\xb1\\\\xd7\\\\xf7\\\\x00-\\\\x2f\\\\x3a-\\\\x40\\\\x5b-\\\\x60\\\\x7b-\\\\xbf\\\\u2000-\\\\u206f \\\\t\\\\x0b\\\\f\\\\xa0\\\\ufeff\\\\n\\\\r\\\\u2028\\\\u2029\\\\u1680\\\\u180e\\\\u2000\\\\u2001\\\\u2002\\\\u2003\\\\u2004\\\\u2005\\\\u2006\\\\u2007\\\\u2008\\\\u2009\\\\u200a\\\\u202f\\\\u205f\\\\u3000\\\\d+\\\\u2700-\\\\u27bfa-z\\\\xdf-\\\\xf6\\\\xf8-\\\\xffA-Z\\\\xc0-\\\\xd6\\\\xd8-\\\\xde])|$)|[A-Z\\\\xc0-\\\\xd6\\\\xd8-\\\\xde]?(?:[a-z\\\\xdf-\\\\xf6\\\\xf8-\\\\xff]|[^\\\\ud800-\\\\udfff\\\\xac\\\\xb1\\\\xd7\\\\xf7\\\\x00-\\\\x2f\\\\x3a-\\\\x40\\\\x5b-\\\\x60\\\\x7b-\\\\xbf\\\\u2000-\\\\u206f \\\\t\\\\x0b\\\\f\\\\xa0\\\\ufeff\\\\n\\\\r\\\\u2028\\\\u2029\\\\u1680\\\\u180e\\\\u2000\\\\u2001\\\\u2002\\\\u2003\\\\u2004\\\\u2005\\\\u2006\\\\u2007\\\\u2008\\\\u2009\\\\u200a\\\\u202f\\\\u205f\\\\u3000\\\\d+\\\\u2700-\\\\u27bfa-z\\\\xdf-\\\\xf6\\\\xf8-\\\\xffA-Z\\\\xc0-\\\\xd6\\\\xd8-\\\\xde])+(?:['\\u2019](?:d|ll|m|re|s|t|ve))?|[A-Z\\\\xc0-\\\\xd6\\\\xd8-\\\\xde]+(?:['\\u2019](?:D|LL|M|RE|S|T|VE))?|\\\\d*(?:1ST|2ND|3RD|(?![123])\\\\dTH)(?=\\\\b|[a-z_])|\\\\d*(?:1st|2nd|3rd|(?![123])\\\\dth)(?=\\\\b|[A-Z_])|\\\\d+\",An].join(\"|\"),\"g\"),Rn=RegExp(\"[\\\\u200d\\\\ud800-\\\\udfff\\\\u0300-\\\\u036f\\\\ufe20-\\\\ufe2f\\\\u20d0-\\\\u20ff\\\\ufe0e\\\\ufe0f]\"),zn=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Wn=\"Array Buffer DataView Date Error Float32Array Float64Array Function Int8Array Int16Array Int32Array Map Math Object Promise RegExp Set String Symbol TypeError Uint8Array Uint8ClampedArray Uint16Array Uint32Array WeakMap _ clearTimeout isFinite parseInt setTimeout\".split(\" \"),Bn={};\nBn[\"[object Float32Array]\"]=Bn[\"[object Float64Array]\"]=Bn[\"[object Int8Array]\"]=Bn[\"[object Int16Array]\"]=Bn[\"[object Int32Array]\"]=Bn[\"[object Uint8Array]\"]=Bn[\"[object Uint8ClampedArray]\"]=Bn[\"[object Uint16Array]\"]=Bn[\"[object Uint32Array]\"]=true,Bn[\"[object Arguments]\"]=Bn[\"[object Array]\"]=Bn[\"[object ArrayBuffer]\"]=Bn[\"[object Boolean]\"]=Bn[\"[object DataView]\"]=Bn[\"[object Date]\"]=Bn[\"[object Error]\"]=Bn[\"[object Function]\"]=Bn[\"[object Map]\"]=Bn[\"[object Number]\"]=Bn[\"[object Object]\"]=Bn[\"[object RegExp]\"]=Bn[\"[object Set]\"]=Bn[\"[object String]\"]=Bn[\"[object WeakMap]\"]=false;\nvar Ln={};Ln[\"[object Arguments]\"]=Ln[\"[object Array]\"]=Ln[\"[object ArrayBuffer]\"]=Ln[\"[object DataView]\"]=Ln[\"[object Boolean]\"]=Ln[\"[object Date]\"]=Ln[\"[object Float32Array]\"]=Ln[\"[object Float64Array]\"]=Ln[\"[object Int8Array]\"]=Ln[\"[object Int16Array]\"]=Ln[\"[object Int32Array]\"]=Ln[\"[object Map]\"]=Ln[\"[object Number]\"]=Ln[\"[object Object]\"]=Ln[\"[object RegExp]\"]=Ln[\"[object Set]\"]=Ln[\"[object String]\"]=Ln[\"[object Symbol]\"]=Ln[\"[object Uint8Array]\"]=Ln[\"[object Uint8ClampedArray]\"]=Ln[\"[object Uint16Array]\"]=Ln[\"[object Uint32Array]\"]=true,\nLn[\"[object Error]\"]=Ln[\"[object Function]\"]=Ln[\"[object WeakMap]\"]=false;var Un={\"\\\\\":\"\\\\\",\"'\":\"'\",\"\\n\":\"n\",\"\\r\":\"r\",\"\\u2028\":\"u2028\",\"\\u2029\":\"u2029\"},Cn=parseFloat,Dn=parseInt,Mn=typeof global==\"object\"&&global&&global.Object===Object&&global,Tn=typeof self==\"object\"&&self&&self.Object===Object&&self,$n=Mn||Tn||Function(\"return this\")(),Fn=typeof exports==\"object\"&&exports&&!exports.nodeType&&exports,Nn=Fn&&typeof module==\"object\"&&module&&!module.nodeType&&module,Pn=Nn&&Nn.exports===Fn,Zn=Pn&&Mn.process,qn=function(){\ntry{var n=Nn&&Nn.f&&Nn.f(\"util\").types;return n?n:Zn&&Zn.binding&&Zn.binding(\"util\")}catch(n){}}(),Vn=qn&&qn.isArrayBuffer,Kn=qn&&qn.isDate,Gn=qn&&qn.isMap,Hn=qn&&qn.isRegExp,Jn=qn&&qn.isSet,Yn=qn&&qn.isTypedArray,Qn=b(\"length\"),Xn=x({\"\\xc0\":\"A\",\"\\xc1\":\"A\",\"\\xc2\":\"A\",\"\\xc3\":\"A\",\"\\xc4\":\"A\",\"\\xc5\":\"A\",\"\\xe0\":\"a\",\"\\xe1\":\"a\",\"\\xe2\":\"a\",\"\\xe3\":\"a\",\"\\xe4\":\"a\",\"\\xe5\":\"a\",\"\\xc7\":\"C\",\"\\xe7\":\"c\",\"\\xd0\":\"D\",\"\\xf0\":\"d\",\"\\xc8\":\"E\",\"\\xc9\":\"E\",\"\\xca\":\"E\",\"\\xcb\":\"E\",\"\\xe8\":\"e\",\"\\xe9\":\"e\",\"\\xea\":\"e\",\"\\xeb\":\"e\",\"\\xcc\":\"I\",\n\"\\xcd\":\"I\",\"\\xce\":\"I\",\"\\xcf\":\"I\",\"\\xec\":\"i\",\"\\xed\":\"i\",\"\\xee\":\"i\",\"\\xef\":\"i\",\"\\xd1\":\"N\",\"\\xf1\":\"n\",\"\\xd2\":\"O\",\"\\xd3\":\"O\",\"\\xd4\":\"O\",\"\\xd5\":\"O\",\"\\xd6\":\"O\",\"\\xd8\":\"O\",\"\\xf2\":\"o\",\"\\xf3\":\"o\",\"\\xf4\":\"o\",\"\\xf5\":\"o\",\"\\xf6\":\"o\",\"\\xf8\":\"o\",\"\\xd9\":\"U\",\"\\xda\":\"U\",\"\\xdb\":\"U\",\"\\xdc\":\"U\",\"\\xf9\":\"u\",\"\\xfa\":\"u\",\"\\xfb\":\"u\",\"\\xfc\":\"u\",\"\\xdd\":\"Y\",\"\\xfd\":\"y\",\"\\xff\":\"y\",\"\\xc6\":\"Ae\",\"\\xe6\":\"ae\",\"\\xde\":\"Th\",\"\\xfe\":\"th\",\"\\xdf\":\"ss\",\"\\u0100\":\"A\",\"\\u0102\":\"A\",\"\\u0104\":\"A\",\"\\u0101\":\"a\",\"\\u0103\":\"a\",\"\\u0105\":\"a\",\"\\u0106\":\"C\",\n\"\\u0108\":\"C\",\"\\u010a\":\"C\",\"\\u010c\":\"C\",\"\\u0107\":\"c\",\"\\u0109\":\"c\",\"\\u010b\":\"c\",\"\\u010d\":\"c\",\"\\u010e\":\"D\",\"\\u0110\":\"D\",\"\\u010f\":\"d\",\"\\u0111\":\"d\",\"\\u0112\":\"E\",\"\\u0114\":\"E\",\"\\u0116\":\"E\",\"\\u0118\":\"E\",\"\\u011a\":\"E\",\"\\u0113\":\"e\",\"\\u0115\":\"e\",\"\\u0117\":\"e\",\"\\u0119\":\"e\",\"\\u011b\":\"e\",\"\\u011c\":\"G\",\"\\u011e\":\"G\",\"\\u0120\":\"G\",\"\\u0122\":\"G\",\"\\u011d\":\"g\",\"\\u011f\":\"g\",\"\\u0121\":\"g\",\"\\u0123\":\"g\",\"\\u0124\":\"H\",\"\\u0126\":\"H\",\"\\u0125\":\"h\",\"\\u0127\":\"h\",\"\\u0128\":\"I\",\"\\u012a\":\"I\",\"\\u012c\":\"I\",\"\\u012e\":\"I\",\"\\u0130\":\"I\",\"\\u0129\":\"i\",\n\"\\u012b\":\"i\",\"\\u012d\":\"i\",\"\\u012f\":\"i\",\"\\u0131\":\"i\",\"\\u0134\":\"J\",\"\\u0135\":\"j\",\"\\u0136\":\"K\",\"\\u0137\":\"k\",\"\\u0138\":\"k\",\"\\u0139\":\"L\",\"\\u013b\":\"L\",\"\\u013d\":\"L\",\"\\u013f\":\"L\",\"\\u0141\":\"L\",\"\\u013a\":\"l\",\"\\u013c\":\"l\",\"\\u013e\":\"l\",\"\\u0140\":\"l\",\"\\u0142\":\"l\",\"\\u0143\":\"N\",\"\\u0145\":\"N\",\"\\u0147\":\"N\",\"\\u014a\":\"N\",\"\\u0144\":\"n\",\"\\u0146\":\"n\",\"\\u0148\":\"n\",\"\\u014b\":\"n\",\"\\u014c\":\"O\",\"\\u014e\":\"O\",\"\\u0150\":\"O\",\"\\u014d\":\"o\",\"\\u014f\":\"o\",\"\\u0151\":\"o\",\"\\u0154\":\"R\",\"\\u0156\":\"R\",\"\\u0158\":\"R\",\"\\u0155\":\"r\",\"\\u0157\":\"r\",\"\\u0159\":\"r\",\n\"\\u015a\":\"S\",\"\\u015c\":\"S\",\"\\u015e\":\"S\",\"\\u0160\":\"S\",\"\\u015b\":\"s\",\"\\u015d\":\"s\",\"\\u015f\":\"s\",\"\\u0161\":\"s\",\"\\u0162\":\"T\",\"\\u0164\":\"T\",\"\\u0166\":\"T\",\"\\u0163\":\"t\",\"\\u0165\":\"t\",\"\\u0167\":\"t\",\"\\u0168\":\"U\",\"\\u016a\":\"U\",\"\\u016c\":\"U\",\"\\u016e\":\"U\",\"\\u0170\":\"U\",\"\\u0172\":\"U\",\"\\u0169\":\"u\",\"\\u016b\":\"u\",\"\\u016d\":\"u\",\"\\u016f\":\"u\",\"\\u0171\":\"u\",\"\\u0173\":\"u\",\"\\u0174\":\"W\",\"\\u0175\":\"w\",\"\\u0176\":\"Y\",\"\\u0177\":\"y\",\"\\u0178\":\"Y\",\"\\u0179\":\"Z\",\"\\u017b\":\"Z\",\"\\u017d\":\"Z\",\"\\u017a\":\"z\",\"\\u017c\":\"z\",\"\\u017e\":\"z\",\"\\u0132\":\"IJ\",\"\\u0133\":\"ij\",\n\"\\u0152\":\"Oe\",\"\\u0153\":\"oe\",\"\\u0149\":\"'n\",\"\\u017f\":\"s\"}),nt=x({\"&\":\"&\",\"<\":\"<\",\">\":\">\",'\"':\""\",\"'\":\"'\"}),tt=x({\"&\":\"&\",\"<\":\"<\",\">\":\">\",\""\":'\"',\"'\":\"'\"}),rt=function x(mn){function An(n){if(yu(n)&&!ff(n)&&!(n instanceof Un)){if(n instanceof On)return n;if(oi.call(n,\"__wrapped__\"))return Fe(n)}return new On(n)}function En(){}function On(n,t){this.__wrapped__=n,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=T}function Un(n){this.__wrapped__=n,\nthis.__actions__=[],this.__dir__=1,this.__filtered__=false,this.__iteratees__=[],this.__takeCount__=4294967295,this.__views__=[]}function Mn(n){var t=-1,r=null==n?0:n.length;for(this.clear();++t